From jenkins at lists.osmocom.org Sun Jul 1 06:18:37 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Sun, 1 Jul 2018 06:18:37 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_maste?= =?UTF-8?Q?r-openbsc_=C2=BB_--disable-iu,--enab?= =?UTF-8?Q?le-mgcp-transcoding,--enable-smpp,osmocom-master-debian9_#2206?= Message-ID: <738004617.445.1530425917684.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 666.47 KB...] test_apps/Makefile.am:4: warning: source file '$(TESTAPPS_SOURCE_DIR)/tcp.c' is in a subdirectory, test_apps/Makefile.am:4: but option 'subdir-objects' is disabled binaries/Makefile.am:9: 'test_apps/Makefile.am' included from here test_apps/Makefile.am:4: warning: source file '$(TESTAPPS_SOURCE_DIR)/smpp.c' is in a subdirectory, test_apps/Makefile.am:4: but option 'subdir-objects' is disabled binaries/Makefile.am:9: 'test_apps/Makefile.am' included from here test_apps/Makefile.am:4: warning: source file '$(TESTAPPS_SOURCE_DIR)/sendwp.c' is in a subdirectory, test_apps/Makefile.am:4: but option 'subdir-objects' is disabled binaries/Makefile.am:9: 'test_apps/Makefile.am' included from here test_pdu/Makefile.am:4: warning: source file '$(TESTPDU_SOURCE_DIR)/core.c' is in a subdirectory, test_pdu/Makefile.am:4: but option 'subdir-objects' is disabled binaries/Makefile.am:8: 'test_pdu/Makefile.am' included from here test_pdu/Makefile.am:4: warning: source file '$(TESTPDU_SOURCE_DIR)/submit_multi_resp_test.c' is in a subdirectory, test_pdu/Makefile.am:4: but option 'subdir-objects' is disabled binaries/Makefile.am:8: 'test_pdu/Makefile.am' included from here test_pdu/Makefile.am:8: warning: source file '$(TESTPDU_SOURCE_DIR)/core.c' is in a subdirectory, test_pdu/Makefile.am:8: but option 'subdir-objects' is disabled binaries/Makefile.am:8: 'test_pdu/Makefile.am' included from here test_pdu/Makefile.am:8: warning: source file '$(TESTPDU_SOURCE_DIR)/submit_multi_test.c' is in a subdirectory, test_pdu/Makefile.am:8: but option 'subdir-objects' is disabled binaries/Makefile.am:8: 'test_pdu/Makefile.am' included from here test_pdu/Makefile.am:96: warning: source file '$(TESTPDU_SOURCE_DIR)/core.c' is in a subdirectory, test_pdu/Makefile.am:96: but option 'subdir-objects' is disabled binaries/Makefile.am:8: 'test_pdu/Makefile.am' included from here test_pdu/Makefile.am:96: warning: source file '$(TESTPDU_SOURCE_DIR)/submit_sm_resp_test.c' is in a subdirectory, test_pdu/Makefile.am:96: but option 'subdir-objects' is disabled binaries/Makefile.am:8: 'test_pdu/Makefile.am' included from here test_pdu/Makefile.am:100: warning: source file '$(TESTPDU_SOURCE_DIR)/core.c' is in a subdirectory, test_pdu/Makefile.am:100: but option 'subdir-objects' is disabled binaries/Makefile.am:8: 'test_pdu/Makefile.am' included from here test_pdu/Makefile.am:100: warning: source file '$(TESTPDU_SOURCE_DIR)/submit_sm_test.c' is in a subdirectory, test_pdu/Makefile.am:100: but option 'subdir-objects' is disabled binaries/Makefile.am:8: 'test_pdu/Makefile.am' included from here test_pdu/Makefile.am:104: warning: source file '$(TESTPDU_SOURCE_DIR)/core.c' is in a subdirectory, test_pdu/Makefile.am:104: but option 'subdir-objects' is disabled binaries/Makefile.am:8: 'test_pdu/Makefile.am' included from here test_pdu/Makefile.am:104: warning: source file '$(TESTPDU_SOURCE_DIR)/unbind_resp_test.c' is in a subdirectory, test_pdu/Makefile.am:104: but option 'subdir-objects' is disabled binaries/Makefile.am:8: 'test_pdu/Makefile.am' included from here test_pdu/Makefile.am:108: warning: source file '$(TESTPDU_SOURCE_DIR)/core.c' is in a subdirectory, test_pdu/Makefile.am:108: but option 'subdir-objects' is disabled binaries/Makefile.am:8: 'test_pdu/Makefile.am' included from here test_pdu/Makefile.am:108: warning: source file '$(TESTPDU_SOURCE_DIR)/unbind_test.c' is in a subdirectory, test_pdu/Makefile.am:108: but option 'subdir-objects' is disabled binaries/Makefile.am:8: 'test_pdu/Makefile.am' included from here binaries/Makefile.am: installing 'aux_config/depcomp' test_apps/Makefile.am:26: warning: variable 'analizer_SOURCES' is defined but no program or test_apps/Makefile.am:26: library has 'analizer' as canonical name (possible typo) test_apps/Makefile.am:17: warning: variable 'esme_SOURCES' is defined but no program or test_apps/Makefile.am:17: library has 'esme' as canonical name (possible typo) test_apps/Makefile.am:4: warning: variable 'sendwp_SOURCES' is defined but no program or test_apps/Makefile.am:4: library has 'sendwp' as canonical name (possible typo) test_apps/Makefile.am:30: warning: variable 'analizer_LDFLAGS' is defined but no program or test_apps/Makefile.am:30: library has 'analizer' as canonical name (possible typo) test_apps/Makefile.am:24: warning: variable 'esme_LDFLAGS' is defined but no program or test_apps/Makefile.am:24: library has 'esme' as canonical name (possible typo) test_apps/Makefile.am:11: warning: variable 'sendwp_LDFLAGS' is defined but no program or test_apps/Makefile.am:11: library has 'sendwp' as canonical name (possible typo) + ./configure --prefix=/build/deps/install/stow/libsmpp34 checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking whether gcc understands -c and -o together... yes checking for style of include used by make... GNU checking dependency style of gcc... gcc3 checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking how to print strings... printf checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for fgrep... /bin/grep -F checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B checking the name lister (/usr/bin/nm -B) interface... BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 1572864 checking whether the shell understands some XSI constructs... yes checking whether the shell understands "+="... yes checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop checking for /usr/bin/ld option to reload object files... -r checking for objdump... objdump checking how to recognize dependent libraries... pass_all checking for dlltool... no checking how to associate runtime and link libraries... printf %s\n checking for ar... ar checking for archiver @FILE support... @ checking for strip... strip checking for ranlib... ranlib checking command to parse /usr/bin/nm -B output from gcc object... ok checking for sysroot... no checking for mt... mt checking if mt is a manifest tool... no checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking for objdir... .libs checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC -DPIC checking if gcc PIC flag -fPIC -DPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.o... (cached) yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes checking for pkg-config... /usr/bin/pkg-config checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.20... yes checking for ANSI C header files... (cached) yes checking for stdlib.h... (cached) yes checking netinet/in.h usability... yes checking netinet/in.h presence... yes checking for netinet/in.h... yes checking for stdint.h... (cached) yes checking for string.h... (cached) yes checking for LIBXML2... no checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... yes checking for memset... yes CFLAGS="-g -O2" CPPFLAGS="" checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating def_frame/Makefile config.status: creating def_list/Makefile config.status: creating binaries/Makefile config.status: creating test_apps/Makefile config.status: creating libsmpp34.pc config.status: creating aux_config/config.h config.status: executing depfiles commands config.status: executing libtool commands + make -j1 install echo 1.13.0 > .version-t && mv .version-t .version make install-recursive make[1]: Entering directory '/build/deps/libsmpp34' Making install in binaries make[2]: Entering directory '/build/deps/libsmpp34/binaries' /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../aux_config -I../src -I.. -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -Wall -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -MT libsmpp34_la-smpp34_dumpBuf.lo -MD -MP -MF .deps/libsmpp34_la-smpp34_dumpBuf.Tpo -c -o libsmpp34_la-smpp34_dumpBuf.lo `test -f '../src/smpp34_dumpBuf.c' || echo './'`../src/smpp34_dumpBuf.c libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../aux_config -I../src -I.. -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -Wall -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -MT libsmpp34_la-smpp34_dumpBuf.lo -MD -MP -MF .deps/libsmpp34_la-smpp34_dumpBuf.Tpo -c ../src/smpp34_dumpBuf.c -fPIC -DPIC -o .libs/libsmpp34_la-smpp34_dumpBuf.o libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../aux_config -I../src -I.. -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -Wall -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -MT libsmpp34_la-smpp34_dumpBuf.lo -MD -MP -MF .deps/libsmpp34_la-smpp34_dumpBuf.Tpo -c ../src/smpp34_dumpBuf.c -o libsmpp34_la-smpp34_dumpBuf.o >/dev/null 2>&1 mv -f .deps/libsmpp34_la-smpp34_dumpBuf.Tpo .deps/libsmpp34_la-smpp34_dumpBuf.Plo /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../aux_config -I../src -I.. -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -Wall -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -MT libsmpp34_la-smpp34_dumpPdu.lo -MD -MP -MF .deps/libsmpp34_la-smpp34_dumpPdu.Tpo -c -o libsmpp34_la-smpp34_dumpPdu.lo `test -f '../src/smpp34_dumpPdu.c' || echo './'`../src/smpp34_dumpPdu.c libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../aux_config -I../src -I.. -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -Wall -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -MT libsmpp34_la-smpp34_dumpPdu.lo -MD -MP -MF .deps/libsmpp34_la-smpp34_dumpPdu.Tpo -c ../src/smpp34_dumpPdu.c -fPIC -DPIC -o .libs/libsmpp34_la-smpp34_dumpPdu.o libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../aux_config -I../src -I.. -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -Wall -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -MT libsmpp34_la-smpp34_dumpPdu.lo -MD -MP -MF .deps/libsmpp34_la-smpp34_dumpPdu.Tpo -c ../src/smpp34_dumpPdu.c -o libsmpp34_la-smpp34_dumpPdu.o >/dev/null 2>&1 mv -f .deps/libsmpp34_la-smpp34_dumpPdu.Tpo .deps/libsmpp34_la-smpp34_dumpPdu.Plo /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../aux_config -I../src -I.. -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -Wall -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -MT libsmpp34_la-smpp34_pack.lo -MD -MP -MF .deps/libsmpp34_la-smpp34_pack.Tpo -c -o libsmpp34_la-smpp34_pack.lo `test -f '../src/smpp34_pack.c' || echo './'`../src/smpp34_pack.c libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../aux_config -I../src -I.. -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -Wall -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -MT libsmpp34_la-smpp34_pack.lo -MD -MP -MF .deps/libsmpp34_la-smpp34_pack.Tpo -c ../src/smpp34_pack.c -fPIC -DPIC -o .libs/libsmpp34_la-smpp34_pack.o libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../aux_config -I../src -I.. -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -Wall -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -MT libsmpp34_la-smpp34_pack.lo -MD -MP -MF .deps/libsmpp34_la-smpp34_pack.Tpo -c ../src/smpp34_pack.c -o libsmpp34_la-smpp34_pack.o >/dev/null 2>&1 mv -f .deps/libsmpp34_la-smpp34_pack.Tpo .deps/libsmpp34_la-smpp34_pack.Plo /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../aux_config -I../src -I.. -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -Wall -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -MT libsmpp34_la-smpp34_unpack.lo -MD -MP -MF .deps/libsmpp34_la-smpp34_unpack.Tpo -c -o libsmpp34_la-smpp34_unpack.lo `test -f '../src/smpp34_unpack.c' || echo './'`../src/smpp34_unpack.c libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../aux_config -I../src -I.. -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -Wall -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -MT libsmpp34_la-smpp34_unpack.lo -MD -MP -MF .deps/libsmpp34_la-smpp34_unpack.Tpo -c ../src/smpp34_unpack.c -fPIC -DPIC -o .libs/libsmpp34_la-smpp34_unpack.o libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../aux_config -I../src -I.. -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -Wall -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -MT libsmpp34_la-smpp34_unpack.lo -MD -MP -MF .deps/libsmpp34_la-smpp34_unpack.Tpo -c ../src/smpp34_unpack.c -o libsmpp34_la-smpp34_unpack.o >/dev/null 2>&1 mv -f .deps/libsmpp34_la-smpp34_unpack.Tpo .deps/libsmpp34_la-smpp34_unpack.Plo /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../aux_config -I../src -I.. -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -Wall -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -MT libsmpp34_la-smpp34_structs.lo -MD -MP -MF .deps/libsmpp34_la-smpp34_structs.Tpo -c -o libsmpp34_la-smpp34_structs.lo `test -f '../src/smpp34_structs.c' || echo './'`../src/smpp34_structs.c libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../aux_config -I../src -I.. -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -Wall -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -MT libsmpp34_la-smpp34_structs.lo -MD -MP -MF .deps/libsmpp34_la-smpp34_structs.Tpo -c ../src/smpp34_structs.c -fPIC -DPIC -o .libs/libsmpp34_la-smpp34_structs.o libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../aux_config -I../src -I.. -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -Wall -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -MT libsmpp34_la-smpp34_structs.lo -MD -MP -MF .deps/libsmpp34_la-smpp34_structs.Tpo -c ../src/smpp34_structs.c -o libsmpp34_la-smpp34_structs.o >/dev/null 2>&1 mv -f .deps/libsmpp34_la-smpp34_structs.Tpo .deps/libsmpp34_la-smpp34_structs.Plo /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../aux_config -I../src -I.. -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -Wall -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -MT libsmpp34_la-smpp34_params.lo -MD -MP -MF .deps/libsmpp34_la-smpp34_params.Tpo -c -o libsmpp34_la-smpp34_params.lo `test -f '../src/smpp34_params.c' || echo './'`../src/smpp34_params.c libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../aux_config -I../src -I.. -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -Wall -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -MT libsmpp34_la-smpp34_params.lo -MD -MP -MF .deps/libsmpp34_la-smpp34_params.Tpo -c ../src/smpp34_params.c -fPIC -DPIC -o .libs/libsmpp34_la-smpp34_params.o libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../aux_config -I../src -I.. -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -Wall -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -MT libsmpp34_la-smpp34_params.lo -MD -MP -MF .deps/libsmpp34_la-smpp34_params.Tpo -c ../src/smpp34_params.c -o libsmpp34_la-smpp34_params.o >/dev/null 2>&1 mv -f .deps/libsmpp34_la-smpp34_params.Tpo .deps/libsmpp34_la-smpp34_params.Plo /bin/bash ../libtool --tag=CC --mode=link gcc -g -O2 -Wall -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -version-info 1:0:0 -no-undefined -lrt -lpthread -o libsmpp34.la -rpath /build/deps/install/stow/libsmpp34/lib libsmpp34_la-smpp34_dumpBuf.lo libsmpp34_la-smpp34_dumpPdu.lo libsmpp34_la-smpp34_pack.lo libsmpp34_la-smpp34_unpack.lo libsmpp34_la-smpp34_structs.lo libsmpp34_la-smpp34_params.lo libtool: link: gcc -shared -fPIC -DPIC .libs/libsmpp34_la-smpp34_dumpBuf.o .libs/libsmpp34_la-smpp34_dumpPdu.o .libs/libsmpp34_la-smpp34_pack.o .libs/libsmpp34_la-smpp34_unpack.o .libs/libsmpp34_la-smpp34_structs.o .libs/libsmpp34_la-smpp34_params.o -lrt -lpthread -O2 -O2 -Wl,-soname -Wl,libsmpp34.so.1 -o .libs/libsmpp34.so.1.0.0 libtool: link: (cd ".libs" && rm -f "libsmpp34.so.1" && ln -s "libsmpp34.so.1.0.0" "libsmpp34.so.1") libtool: link: (cd ".libs" && rm -f "libsmpp34.so" && ln -s "libsmpp34.so.1.0.0" "libsmpp34.so") libtool: link: ar cru .libs/libsmpp34.a libsmpp34_la-smpp34_dumpBuf.o libsmpp34_la-smpp34_dumpPdu.o libsmpp34_la-smpp34_pack.o libsmpp34_la-smpp34_unpack.o libsmpp34_la-smpp34_structs.o libsmpp34_la-smpp34_params.o libtool: link: ranlib .libs/libsmpp34.a libtool: link: ( cd ".libs" && rm -f "libsmpp34.la" && ln -s "../libsmpp34.la" "libsmpp34.la" ) gcc -DHAVE_CONFIG_H -I. -I../aux_config -I../src -I.. -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -Wall -fPIC -g -O2 -MT core.o -MD -MP -MF .deps/core.Tpo -c -o core.o `test -f '../test_pdu/core.c' || echo './'`../test_pdu/core.c mv -f .deps/core.Tpo .deps/core.Po gcc -DHAVE_CONFIG_H -I. -I../aux_config -I../src -I.. -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -Wall -fPIC -g -O2 -MT submit_multi_resp_test.o -MD -MP -MF .deps/submit_multi_resp_test.Tpo -c -o submit_multi_resp_test.o `test -f '../test_pdu/submit_multi_resp_test.c' || echo './'`../test_pdu/submit_multi_resp_test.c mv -f .deps/submit_multi_resp_test.Tpo .deps/submit_multi_resp_test.Po /bin/bash ../libtool --tag=CC --mode=link gcc -g -O2 -Wall -fPIC -g -O2 -lrt -lpthread -o submit_multi_resp_test core.o submit_multi_resp_test.o libsmpp34.la libtool: link: gcc -g -O2 -Wall -fPIC -g -O2 -o .libs/submit_multi_resp_test core.o submit_multi_resp_test.o -lrt -lpthread ./.libs/libsmpp34.so -Wl,-rpath -Wl,/build/deps/install/stow/libsmpp34/lib gcc -DHAVE_CONFIG_H -I. -I../aux_config -I../src -I.. -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -Wall -fPIC -g -O2 -MT submit_multi_test.o -MD -MP -MF .deps/submit_multi_test.Tpo -c -o submit_multi_test.o `test -f '../test_pdu/submit_multi_test.c' || echo './'`../test_pdu/submit_multi_test.c mv -f .deps/submit_multi_test.Tpo .deps/submit_multi_test.Po /bin/bash ../libtool --tag=CC --mode=link gcc -g -O2 -Wall -fPIC -g -O2 -lrt -lpthread -o submit_multi_test core.o submit_multi_test.o libsmpp34.la libtool: link: gcc -g -O2 -Wall -fPIC -g -O2 -o .libs/submit_multi_test core.o submit_multi_test.o -lrt -lpthread ./.libs/libsmpp34.so -Wl,-rpath -Wl,/build/deps/install/stow/libsmpp34/lib gcc -DHAVE_CONFIG_H -I. -I../aux_config -I../src -I.. -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -Wall -fPIC -g -O2 -MT alert_notification_test.o -MD -MP -MF .deps/alert_notification_test.Tpo -c -o alert_notification_test.o `test -f '../test_pdu/alert_notification_test.c' || echo './'`../test_pdu/alert_notification_test.c mv -f .deps/alert_notification_test.Tpo .deps/alert_notification_test.Po /bin/bash ../libtool --tag=CC --mode=link gcc -g -O2 -Wall -fPIC -g -O2 -lrt -lpthread -o alert_notification_test core.o alert_notification_test.o libsmpp34.la libtool: link: gcc -g -O2 -Wall -fPIC -g -O2 -o .libs/alert_notification_test core.o alert_notification_test.o -lrt -lpthread ./.libs/libsmpp34.so -Wl,-rpath -Wl,/build/deps/install/stow/libsmpp34/lib gcc -DHAVE_CONFIG_H -I. -I../aux_config -I../src -I.. -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -Wall -fPIC -g -O2 -MT bind_receiver_resp_test.o -MD -MP -MF .deps/bind_receiver_resp_test.Tpo -c -o bind_receiver_resp_test.o `test -f '../test_pdu/bind_receiver_resp_test.c' || echo './'`../test_pdu/bind_receiver_resp_test.c mv -f .deps/bind_receiver_resp_test.Tpo .deps/bind_receiver_resp_test.Po /bin/bash ../libtool --tag=CC --mode=link gcc -g -O2 -Wall -fPIC -g -O2 -lrt -lpthread -o bind_receiver_resp_test core.o bind_receiver_resp_test.o libsmpp34.la libtool: link: gcc -g -O2 -Wall -fPIC -g -O2 -o .libs/bind_receiver_resp_test core.o bind_receiver_resp_test.o -lrt -lpthread ./.libs/libsmpp34.so -Wl,-rpath -Wl,/build/deps/install/stow/libsmpp34/lib gcc -DHAVE_CONFIG_H -I. -I../aux_config -I../src -I.. -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -Wall -fPIC -g -O2 -MT bind_receiver_test.o -MD -MP -MF .deps/bind_receiver_test.Tpo -c -o bind_receiver_test.o `test -f '../test_pdu/bind_receiver_test.c' || echo './'`../test_pdu/bind_receiver_test.c mv -f .deps/bind_receiver_test.Tpo .deps/bind_receiver_test.Po /bin/bash ../libtool --tag=CC --mode=link gcc -g -O2 -Wall -fPIC -g -O2 -lrt -lpthread -o bind_receiver_test core.o bind_receiver_test.o libsmpp34.la libtool: link: gcc -g -O2 -Wall -fPIC -g -O2 -o .libs/bind_receiver_test core.o bind_receiver_test.o -lrt -lpthread ./.libs/libsmpp34.so -Wl,-rpath -Wl,/build/deps/install/stow/libsmpp34/lib gcc -DHAVE_CONFIG_H -I. -I../aux_config -I../src -I.. -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -Wall -fPIC -g -O2 -MT bind_transceiver_resp_test.o -MD -MP -MF .deps/bind_transceiver_resp_test.Tpo -c -o bind_transceiver_resp_test.o `test -f '../test_pdu/bind_transceiver_resp_test.c' || echo './'`../test_pdu/bind_transceiver_resp_test.c mv -f .deps/bind_transceiver_resp_test.Tpo .deps/bind_transceiver_resp_test.Po /bin/bash ../libtool --tag=CC --mode=link gcc -g -O2 -Wall -fPIC -g -O2 -lrt -lpthread -o bind_transceiver_resp_test core.o bind_transceiver_resp_test.o libsmpp34.la libtool: link: gcc -g -O2 -Wall -fPIC -g -O2 -o .libs/bind_transceiver_resp_test core.o bind_transceiver_resp_test.o -lrt -lpthread ./.libs/libsmpp34.so -Wl,-rpath -Wl,/build/deps/install/stow/libsmpp34/lib gcc -DHAVE_CONFIG_H -I. -I../aux_config -I../src -I.. -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -Wall -fPIC -g -O2 -MT bind_transceiver_test.o -MD -MP -MF .deps/bind_transceiver_test.Tpo -c -o bind_transceiver_test.o `test -f '../test_pdu/bind_transceiver_test.c' || echo './'`../test_pdu/bind_transceiver_test.c mv -f .deps/bind_transceiver_test.Tpo .deps/bind_transceiver_test.Po /bin/bash ../libtool --tag=CC --mode=link gcc -g -O2 -Wall -fPIC -g -O2 -lrt -lpthread -o bind_transceiver_test core.o bind_transceiver_test.o libsmpp34.la libtool: link: gcc -g -O2 -Wall -fPIC -g -O2 -o .libs/bind_transceiver_test core.o bind_transceiver_test.o -lrt -lpthread ./.libs/libsmpp34.so -Wl,-rpath -Wl,/build/deps/install/stow/libsmpp34/lib gcc -DHAVE_CONFIG_H -I. -I../aux_config -I../src -I.. -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -Wall -fPIC -g -O2 -MT bind_transmitter_resp_test.o -MD -MP -MF .deps/bind_transmitter_resp_test.Tpo -c -o bind_transmitter_resp_test.o `test -f '../test_pdu/bind_transmitter_resp_test.c' || echo './'`../test_pdu/bind_transmitter_resp_test.c mv -f .deps/bind_transmitter_resp_test.Tpo .deps/bind_transmitter_resp_test.Po /bin/bash ../libtool --tag=CC --mode=link gcc -g -O2 -Wall -fPIC -g -O2 -lrt -lpthread -o bind_transmitter_resp_test core.o bind_transmitter_resp_test.o libsmpp34.la libtool: link: gcc -g -O2 -Wall -fPIC -g -O2 -o .libs/bind_transmitter_resp_test core.o bind_transmitter_resp_test.o -lrt -lpthread ./.libs/libsmpp34.so -Wl,-rpath -Wl,/build/deps/install/stow/libsmpp34/lib gcc -DHAVE_CONFIG_H -I. -I../aux_config -I../src -I.. -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -Wall -fPIC -g -O2 -MT bind_transmitter_test.o -MD -MP -MF .deps/bind_transmitter_test.Tpo -c -o bind_transmitter_test.o `test -f '../test_pdu/bind_transmitter_test.c' || echo './'`../test_pdu/bind_transmitter_test.c mv -f .deps/bind_transmitter_test.Tpo .deps/bind_transmitter_test.Po /bin/bash ../libtool --tag=CC --mode=link gcc -g -O2 -Wall -fPIC -g -O2 -lrt -lpthread -o bind_transmitter_test core.o bind_transmitter_test.o libsmpp34.la libtool: link: gcc -g -O2 -Wall -fPIC -g -O2 -o .libs/bind_transmitter_test core.o bind_transmitter_test.o -lrt -lpthread ./.libs/libsmpp34.so -Wl,-rpath -Wl,/build/deps/install/stow/libsmpp34/lib gcc -DHAVE_CONFIG_H -I. -I../aux_config -I../src -I.. -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS -g -O2 -Wall -fPIC -g -O2 -MT cancel_sm_resp_test.o -MD -MP -MF .deps/cancel_sm_resp_test.Tpo -c -o cancel_sm_resp_test.o `test -f '../test_pdu/cancel_sm_resp_test.c' || echo './'`../test_pdu/cancel_sm_resp_test.c mv -f .deps/cancel_sm_resp_test.Tpo .deps/cancel_sm_resp_test.Po /bin/bash ../libtool --tag=CC --mode=link gcc -g -O2 -Wall -fPIC -g -O2 -lrt -lpthread -o cancel_sm_resp_test core.o cancel_sm_resp_test.o libsmpp34.la Makefile:860: recipe for target 'cancel_sm_resp_test' failed make[2]: Leaving directory '/build/deps/libsmpp34/binaries' make[2]: *** [cancel_sm_resp_test] Segmentation fault (core dumped) make[1]: *** [install-recursive] Error 1 Makefile:460: recipe for target 'install-recursive' failed make[1]: Leaving directory '/build/deps/libsmpp34' Makefile:760: recipe for target 'install' failed make: *** [install] Error 2 Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Sun Jul 1 06:25:26 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Jul 2018 06:25:26 +0000 Subject: Change in simtrace2[master]: contrib/jenkins.sh: Also run firmware tests + build-test host software In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9790 ) Change subject: contrib/jenkins.sh: Also run firmware tests + build-test host software ...................................................................... Patch Set 2: > I'm not too familiar with the jenkins setup. is the current > directory also the directory where the code to test is > (TOPDIR=`pwd`)? > Why is jenkins saying the verification failed? I don't see the > build fail in gerrit-simtrace2? Is it done later? The build failure can be seen here: https://jenkins.osmocom.org/jenkins/job/gerrit-simtrace2/2/a1=default,a2=default,a3=default,a4=default,label=osmocom-gerrit-debian8/console And I think the "problem" is that there's no system-installed libosmocore for compiling the host program. For the other jobs (like e.g. osmo-bts, osmo-bsc, ...) we always build the dependencies fresh from master before building the respective program using http://git.osmocom.org/osmo-ci/tree/scripts/osmo-build-dep.sh. So we'll have to make sure simtrace2 uses pkg-config for the host dependencies like libosmocore, and that we build those dependencies first. -- To view, visit https://gerrit.osmocom.org/9790 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie53857164d0a21daac334057c5bafbfd9912bf4b Gerrit-Change-Number: 9790 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Assignee: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-CC: K?vin Redon Gerrit-Comment-Date: Sun, 01 Jul 2018 06:25:26 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 1 06:42:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Jul 2018 06:42:17 +0000 Subject: Change in simtrace2[master]: firmware/test: Add more include paths Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/9797 Change subject: firmware/test: Add more include paths ...................................................................... firmware/test: Add more include paths Change-Id: I4287fbae6921ed0605265812df5d7243e8857864 --- M firmware/test/Makefile 1 file changed, 10 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/97/9797/1 diff --git a/firmware/test/Makefile b/firmware/test/Makefile index 7384033..0a8b77e 100644 --- a/firmware/test/Makefile +++ b/firmware/test/Makefile @@ -1,4 +1,13 @@ -CFLAGS=-g -Wall -I../src_simtrace -I../libcommon/include -I. +CFLAGS=-g -Wall \ + -I../src_simtrace \ + -I../atmel_softpack_libraries/libchip_sam3s \ + -I../atmel_softpack_libraries/libchip_sam3s/cmsis \ + -I../atmel_softpack_libraries/libchip_sam3s/include \ + -I../atmel_softpack_libraries/usb/include \ + -I../libcommon/include \ + -I../libboard/common/include \ + -I../libboard/simtrace/include \ + -I. LDFLAGS=-losmocore VPATH=../src_simtrace ../libcommon/source -- To view, visit https://gerrit.osmocom.org/9797 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I4287fbae6921ed0605265812df5d7243e8857864 Gerrit-Change-Number: 9797 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 1 06:47:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Jul 2018 06:47:55 +0000 Subject: Change in simtrace2[master]: firmware/test: Add more include paths In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9797 to look at the new patch set (#2). Change subject: firmware/test: Add more include paths ...................................................................... firmware/test: Add more include paths Change-Id: I4287fbae6921ed0605265812df5d7243e8857864 --- M firmware/test/Makefile 1 file changed, 14 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/97/9797/2 -- To view, visit https://gerrit.osmocom.org/9797 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4287fbae6921ed0605265812df5d7243e8857864 Gerrit-Change-Number: 9797 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 1 13:45:23 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Sun, 1 Jul 2018 13:45:23 +0000 Subject: Change in simtrace2[master]: firmware/test: Add more include paths In-Reply-To: References: Message-ID: K?vin Redon has posted comments on this change. ( https://gerrit.osmocom.org/9797 ) Change subject: firmware/test: Add more include paths ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9797 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4287fbae6921ed0605265812df5d7243e8857864 Gerrit-Change-Number: 9797 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon Gerrit-Comment-Date: Sun, 01 Jul 2018 13:45:23 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 1 13:45:47 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Sun, 1 Jul 2018 13:45:47 +0000 Subject: Change in simtrace2[master]: firmware/test: Add more include paths In-Reply-To: References: Message-ID: K?vin Redon has submitted this change and it was merged. ( https://gerrit.osmocom.org/9797 ) Change subject: firmware/test: Add more include paths ...................................................................... firmware/test: Add more include paths Change-Id: I4287fbae6921ed0605265812df5d7243e8857864 --- M firmware/test/Makefile 1 file changed, 14 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified K?vin Redon: Looks good to me, approved diff --git a/firmware/test/Makefile b/firmware/test/Makefile index 7384033..d4c543a 100644 --- a/firmware/test/Makefile +++ b/firmware/test/Makefile @@ -1,5 +1,17 @@ -CFLAGS=-g -Wall -I../src_simtrace -I../libcommon/include -I. -LDFLAGS=-losmocore +LIBOSMOCORE_CFLAGS=`pkg-config --cflags libosmocore` +LIBOSMOCORE_LIBS=`pkg-config --libs libosmocore` + +CFLAGS=-g -Wall $(LIBOSMOCORE_CFLAGS) \ + -I../src_simtrace \ + -I../atmel_softpack_libraries/libchip_sam3s \ + -I../atmel_softpack_libraries/libchip_sam3s/cmsis \ + -I../atmel_softpack_libraries/libchip_sam3s/include \ + -I../atmel_softpack_libraries/usb/include \ + -I../libcommon/include \ + -I../libboard/common/include \ + -I../libboard/simtrace/include \ + -I. +LDFLAGS=$(LIBOSMOCORE_LIBS) VPATH=../src_simtrace ../libcommon/source -- To view, visit https://gerrit.osmocom.org/9797 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I4287fbae6921ed0605265812df5d7243e8857864 Gerrit-Change-Number: 9797 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 1 14:33:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Jul 2018 14:33:48 +0000 Subject: Change in simtrace2[master]: contrib/jenkins.sh: Also run firmware tests + build-test host software In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9790 to look at the new patch set (#5). Change subject: contrib/jenkins.sh: Also run firmware tests + build-test host software ...................................................................... contrib/jenkins.sh: Also run firmware tests + build-test host software Change-Id: Ie53857164d0a21daac334057c5bafbfd9912bf4b --- M contrib/jenkins.sh 1 file changed, 40 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/90/9790/5 -- To view, visit https://gerrit.osmocom.org/9790 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie53857164d0a21daac334057c5bafbfd9912bf4b Gerrit-Change-Number: 9790 Gerrit-PatchSet: 5 Gerrit-Owner: Harald Welte Gerrit-Assignee: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-CC: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 1 14:35:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Jul 2018 14:35:24 +0000 Subject: Change in simtrace2[master]: contrib/jenkins.sh: Also run firmware tests + build-test host software In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9790 ) Change subject: contrib/jenkins.sh: Also run firmware tests + build-test host software ...................................................................... Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9790 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie53857164d0a21daac334057c5bafbfd9912bf4b Gerrit-Change-Number: 9790 Gerrit-PatchSet: 5 Gerrit-Owner: Harald Welte Gerrit-Assignee: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-CC: K?vin Redon Gerrit-Comment-Date: Sun, 01 Jul 2018 14:35:24 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 1 14:35:40 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 1 Jul 2018 14:35:40 +0000 Subject: Change in simtrace2[master]: contrib/jenkins.sh: Also run firmware tests + build-test host software In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9790 ) Change subject: contrib/jenkins.sh: Also run firmware tests + build-test host software ...................................................................... contrib/jenkins.sh: Also run firmware tests + build-test host software Change-Id: Ie53857164d0a21daac334057c5bafbfd9912bf4b --- M contrib/jenkins.sh 1 file changed, 40 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index d263851..4887da2 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,19 +1,57 @@ #!/bin/bash +TOPDIR=`pwd` + +if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then + echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !" + exit 2 +fi + set -e +base="$PWD" +deps="$base/deps" +inst="$deps/install" +export deps inst + +osmo-clean-workspace.sh + +mkdir "$deps" || true + +osmo-build-dep.sh libosmocore "" '--disable-doxygen --enable-gnutls' + +export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" +export LD_LIBRARY_PATH="$inst/lib" + BUILDS="" BUILDS+="simtrace/dfu simtrace/cardem " # simtrace/trace simtrace/triple_play BUILDS+="qmod/dfu qmod/cardem " BUILDS+="owhw/dfu owhw/cardem " -cd firmware - +cd $TOPDIR/firmware for build in $BUILDS; do board=`echo $build | cut -d "/" -f 1` app=`echo $build | cut -d "/" -f 2` echo echo "=============== $board / $app START ==============" make BOARD="$board" APP="$app" + make BOARD="$board" APP="$app" clean echo "=============== $board / $app RES:$? ==============" done + +echo +echo "=============== FIRMWARE TESTS ===========" +cd $TOPDIR/firmware/test +make clean +make +./card_emu_test +make clean + +echo +echo "=============== HOST START ==============" +cd $TOPDIR/host +make clean +make +make clean + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/9790 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ie53857164d0a21daac334057c5bafbfd9912bf4b Gerrit-Change-Number: 9790 Gerrit-PatchSet: 5 Gerrit-Owner: Harald Welte Gerrit-Assignee: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-CC: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Sun Jul 1 15:10:06 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Sun, 1 Jul 2018 15:10:06 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-asn1c_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#171?= In-Reply-To: <1349738667.438.1530371406862.JavaMail.jenkins@jenkins.osmocom.org> References: <1349738667.438.1530371406862.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <1892988791.453.1530457806124.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 3.67 KB...] + ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for style of include used by make... GNU checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking how to run the C++ preprocessor... g++ -E checking for g77... no checking for f77... no checking for xlf... no checking for frt... no checking for pgf77... no checking for cf77... no checking for fort77... no checking for fl32... no checking for af77... no checking for f90... no checking for xlf90... no checking for pgf90... no checking for pghpf... no checking for epcf90... no checking for gfortran... no checking for g95... no checking for f95... no checking for fort... no checking for xlf95... no checking for ifort... no checking for ifc... no checking for efc... no checking for pgf95... no checking for lf95... no checking for ftn... no checking whether we are using the GNU Fortran 77 compiler... no checking whether accepts -g... no checking the maximum length of command line arguments... 32768 checking command to parse /usr/bin/nm -B output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes configure: creating libtool appending configuration tag "CXX" to libtool checking for ld used by g++... /usr/bin/ld -m elf_x86_64 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC checking if g++ PIC flag -fPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate appending configuration tag "F77" to libtool checking for autoconf... /usr/bin/autoconf checking for autoheader... /usr/bin/autoheader checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking dependency style of gcc... (cached) gcc3 checking how to run the C preprocessor... gcc -E checking for a BSD-compatible install... /usr/bin/install -c checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking for bison... bison -y checking for flex... flex checking for yywrap in -lfl... yes checking lex output file root... lex.yy checking whether yytext is a pointer... yes checking for ar... /usr/bin/ar checking for ANSI C header files... (cached) yes checking sys/param.h usability... yes checking sys/param.h presence... yes checking for sys/param.h... yes checking whether byte ordering is bigendian... no checking for off_t... yes checking for size_t... yes checking whether struct tm is in sys/time.h or time.h... time.h checking for intmax_t... yes checking for library containing getopt... none required checking for strtoimax... yes checking for strtoll... yes checking for mergesort... no checking for mkstemps... yes configure: creating ./config.status config.status: creating skeletons/standard-modules/Makefile config.status: creating skeletons/tests/Makefile config.status: creating libasn1compiler/Makefile config.status: creating libasn1parser/Makefile config.status: creating libasn1print/Makefile config.status: creating asn1c/webcgi/Makefile config.status: creating asn1c/tests/Makefile config.status: creating libasn1fix/Makefile config.status: creating skeletons/Makefile config.status: creating examples/Makefile config.status: creating tests/Makefile config.status: creating asn1c/Makefile config.status: creating doc/Makefile config.status: creating asn1c.spec config.status: creating Makefile config.status: creating config.h config.status: executing depfiles commands + make -j 8 make all-recursive make[1]: Entering directory ' Making all in libasn1parser make[2]: Entering directory ' if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF ".deps/asn1parser.Tpo" -c -o asn1parser.lo asn1parser.c; \ then mv -f ".deps/asn1parser.Tpo" ".deps/asn1parser.Plo"; else rm -f ".deps/asn1parser.Tpo"; exit 1; fi bison -y -p asn1p_ -d asn1p_y.y if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF ".deps/asn1p_l.Tpo" -c -o asn1p_l.lo asn1p_l.c; \ then mv -f ".deps/asn1p_l.Tpo" ".deps/asn1p_l.Plo"; else rm -f ".deps/asn1p_l.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF ".deps/asn1p_module.Tpo" -c -o asn1p_module.lo asn1p_module.c; \ then mv -f ".deps/asn1p_module.Tpo" ".deps/asn1p_module.Plo"; else rm -f ".deps/asn1p_module.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF ".deps/asn1p_oid.Tpo" -c -o asn1p_oid.lo asn1p_oid.c; \ then mv -f ".deps/asn1p_oid.Tpo" ".deps/asn1p_oid.Plo"; else rm -f ".deps/asn1p_oid.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF ".deps/asn1p_value.Tpo" -c -o asn1p_value.lo asn1p_value.c; \ then mv -f ".deps/asn1p_value.Tpo" ".deps/asn1p_value.Plo"; else rm -f ".deps/asn1p_value.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF ".deps/asn1p_expr.Tpo" -c -o asn1p_expr.lo asn1p_expr.c; \ then mv -f ".deps/asn1p_expr.Tpo" ".deps/asn1p_expr.Plo"; else rm -f ".deps/asn1p_expr.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF ".deps/asn1p_xports.Tpo" -c -o asn1p_xports.lo asn1p_xports.c; \ then mv -f ".deps/asn1p_xports.Tpo" ".deps/asn1p_xports.Plo"; else rm -f ".deps/asn1p_xports.Tpo"; exit 1; fi asn1p_y.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] mkdir .libs gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -fPIC -DPIC -o .libs/asn1p_oid.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -fPIC -DPIC -o .libs/asn1p_module.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -fPIC -DPIC -o .libs/asn1p_value.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -fPIC -DPIC -o .libs/asn1p_l.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -fPIC -DPIC -o .libs/asn1parser.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -fPIC -DPIC -o .libs/asn1p_expr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -fPIC -DPIC -o .libs/asn1p_xports.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -o asn1p_module.o >/dev/null 2>&1 asn1p_l.c:3521:12: warning: 'input' defined but not used [-Wunused-function] static int input() ^~~~~ gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -o asn1p_oid.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -o asn1parser.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -o asn1p_value.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -o asn1p_xports.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF ".deps/asn1p_constr.Tpo" -c -o asn1p_constr.lo asn1p_constr.c; \ then mv -f ".deps/asn1p_constr.Tpo" ".deps/asn1p_constr.Plo"; else rm -f ".deps/asn1p_constr.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -o asn1p_expr.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF ".deps/asn1p_param.Tpo" -c -o asn1p_param.lo asn1p_param.c; \ then mv -f ".deps/asn1p_param.Tpo" ".deps/asn1p_param.Plo"; else rm -f ".deps/asn1p_param.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF ".deps/asn1p_class.Tpo" -c -o asn1p_class.lo asn1p_class.c; \ then mv -f ".deps/asn1p_class.Tpo" ".deps/asn1p_class.Plo"; else rm -f ".deps/asn1p_class.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF ".deps/asn1p_ref.Tpo" -c -o asn1p_ref.lo asn1p_ref.c; \ then mv -f ".deps/asn1p_ref.Tpo" ".deps/asn1p_ref.Plo"; else rm -f ".deps/asn1p_ref.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -fPIC -DPIC -o .libs/asn1p_constr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -fPIC -DPIC -o .libs/asn1p_class.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -fPIC -DPIC -o .libs/asn1p_param.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -fPIC -DPIC -o .libs/asn1p_ref.o if test -f y.tab.h; then \ to=`echo "asn1p_y_H" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \ sed -e "/^#/!b" -e "s/Y_TAB_H/$to/g" -e "s|y\.tab\.h|asn1p_y.h|" \ y.tab.h >asn1p_y.ht; \ rm -f y.tab.h; \ if cmp -s asn1p_y.ht asn1p_y.h; then \ rm -f asn1p_y.ht ;\ else \ mv asn1p_y.ht asn1p_y.h; \ fi; \ fi if test -f y.output; then \ mv y.output asn1p_y.output; \ fi sed '/^#/ s|y\.tab\.c|asn1p_y.c|' y.tab.c >asn1p_y.ct && mv asn1p_y.ct asn1p_y.c rm -f y.tab.c if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF ".deps/asn1p_y.Tpo" -c -o asn1p_y.lo asn1p_y.c; \ then mv -f ".deps/asn1p_y.Tpo" ".deps/asn1p_y.Plo"; else rm -f ".deps/asn1p_y.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -o asn1p_param.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -o asn1p_ref.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -o asn1p_constr.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -o asn1p_class.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF .deps/asn1p_y.Tpo -c asn1p_y.c -fPIC -DPIC -o .libs/asn1p_y.o asn1p_y.y: In function 'asn1p_parse': asn1p_y.y:357:13: error: 'param' undeclared (first use in this function) *(void **)param = $1; ^~~~~ asn1p_y.y:357:13: note: each undeclared identifier is reported only once for each function it appears in gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -o asn1p_l.o >/dev/null 2>&1 Makefile:299: recipe for target 'asn1p_y.lo' failed make[2]: *** [asn1p_y.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory ' Makefile:302: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory ' Makefile:212: recipe for target 'all' failed make: *** [all] Error 2 Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From jenkins at lists.osmocom.org Sun Jul 1 16:15:04 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Sun, 1 Jul 2018 16:15:04 +0000 (UTC) Subject: =?UTF-8?Q?Jenkins_build_is_back_to_normal_:?= =?UTF-8?Q?_master-openbsc_=C2=BB_--disable-iu,--?= =?UTF-8?Q?enable-mgcp-transcoding,--enable-?= =?UTF-8?Q?smpp,osmocom-master-debian9_#2207?= In-Reply-To: <738004617.445.1530425917684.JavaMail.jenkins@jenkins.osmocom.org> References: <738004617.445.1530425917684.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <1547419298.454.1530461704848.JavaMail.jenkins@jenkins.osmocom.org> See From jenkins at lists.osmocom.org Mon Jul 2 00:05:19 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Mon, 2 Jul 2018 00:05:19 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-osmo-sgsn_=C2=BB_--enable-?= =?UTF-8?Q?iu,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#3975?= Message-ID: <547303454.457.1530489920001.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 278.93 KB...] checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop checking for /usr/bin/ld option to reload object files... -r checking for objdump... objdump checking how to recognize dependent libraries... pass_all checking for dlltool... no checking how to associate runtime and link libraries... printf %s\n checking for ar... ar checking for archiver @FILE support... @ checking for strip... strip checking for ranlib... ranlib checking command to parse /usr/bin/nm -B output from gcc object... ok checking for sysroot... no checking for mt... mt checking if mt is a manifest tool... no checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking for objdir... .libs checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC -DPIC checking if gcc PIC flag -fPIC -DPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.o... (cached) yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes checking for pkg-config... /usr/bin/pkg-config checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.20... yes checking for ANSI C header files... (cached) yes checking for sys/wait.h that is POSIX.1 compatible... yes checking arpa/inet.h usability... yes checking arpa/inet.h presence... yes checking for arpa/inet.h... yes checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking netdb.h usability... yes checking netdb.h presence... yes checking for netdb.h... yes checking netinet/in.h usability... yes checking netinet/in.h presence... yes checking for netinet/in.h... yes checking for stdint.h... (cached) yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking sys/ioctl.h usability... yes checking sys/ioctl.h presence... yes checking for sys/ioctl.h... yes checking sys/socket.h usability... yes checking sys/socket.h presence... yes checking for sys/socket.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking for unistd.h... (cached) yes checking linux/if.h usability... no checking linux/if.h presence... yes configure: WARNING: linux/if.h: present but cannot be compiled configure: WARNING: linux/if.h: check for missing prerequisite headers? configure: WARNING: linux/if.h: see the Autoconf documentation configure: WARNING: linux/if.h: section "Present But Cannot Be Compiled" configure: WARNING: linux/if.h: proceeding with the compiler's result configure: WARNING: ## ------------------------------------------------- ## configure: WARNING: ## Report this to osmocom-net-gprs at lists.osmocom.org ## configure: WARNING: ## ------------------------------------------------- ## checking for linux/if.h... no checking net/if.h usability... yes checking net/if.h presence... yes checking for net/if.h... yes checking linux/if_tun.h usability... yes checking linux/if_tun.h presence... yes checking for linux/if_tun.h... yes checking net/if_tun.h usability... no checking net/if_tun.h presence... no checking for net/if_tun.h... no checking linux/netlink.h usability... yes checking linux/netlink.h presence... yes checking for linux/netlink.h... yes checking linux/rtnetlink.h usability... yes checking linux/rtnetlink.h presence... yes checking for linux/rtnetlink.h... yes checking for an ANSI C-conforming const... yes checking for mode_t... yes checking for size_t... yes checking whether time.h and sys/time.h may both be included... yes checking whether struct ifaliasreq exist... no checking whether struct ifreq.ifru_netmask exist... yes checking whether struct rt_msghdr exist... no checking whether struct iphdr exists... yes checking whether gcc needs -traditional... no checking for gethostbyname... yes checking for inet_ntoa... yes checking for memset... yes checking for select... yes checking for socket... yes checking for strdup... yes checking for strerror... yes checking for strtol... yes checking for inet_aton... yes checking getopt.h usability... yes checking getopt.h presence... yes checking for getopt.h... yes checking for getopt_long... yes checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking whether make sets $(MAKE)... yes checking for style of include used by make... GNU checking dependency style of gcc... gcc3 checking for LIBOSMOCORE... yes checking for LIBOSMOVTY... yes checking for LIBOSMOCTRL... yes CFLAGS="-g -O2" CPPFLAGS="" checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating doc/Makefile config.status: creating doc/examples/Makefile config.status: creating ggsn/Makefile config.status: creating gtp/Makefile config.status: creating lib/Makefile config.status: creating intl/Makefile config.status: creating po/Makefile config.status: creating sgsnemu/Makefile config.status: creating tests/Makefile config.status: creating tests/lib/Makefile config.status: creating tests/gtp/Makefile config.status: creating libgtp.pc config.status: creating osmo-ggsn.spec config.status: creating config.h config.status: executing tests/atconfig commands config.status: executing libtool commands config.status: executing depfiles commands osmo-ggsn Configuration: GTP Linux kernel support: no + make -j 8 install echo 1.2.2.1-3e0b > .version-t && mv .version-t .version make install-recursive make[1]: Entering directory '/build/deps/osmo-ggsn' Making install in lib make[2]: Entering directory '/build/deps/osmo-ggsn/lib' CC getopt.o CC getopt1.o CC ippool.o CC tun.o CC lookup.o CC debug.o CC in46_addr.o CC netdev.o AR libmisc.a make[3]: Entering directory '/build/deps/osmo-ggsn/lib' make[3]: Nothing to be done for 'install-exec-am'. make[3]: Nothing to be done for 'install-data-am'. make[3]: Leaving directory '/build/deps/osmo-ggsn/lib' make[2]: Leaving directory '/build/deps/osmo-ggsn/lib' Making install in gtp make[2]: Entering directory '/build/deps/osmo-ggsn/gtp' CC gtp.lo CC gtpie.lo CC pdp.lo CC lookupa.lo CC queue.lo CCLD libgtp.la make[3]: Entering directory '/build/deps/osmo-ggsn/gtp' /bin/mkdir -p '/build/deps/install/stow/osmo-ggsn/lib' /bin/mkdir -p '/build/deps/install/stow/osmo-ggsn/include' /bin/bash ../libtool --mode=install /usr/bin/install -c libgtp.la '/build/deps/install/stow/osmo-ggsn/lib' /usr/bin/install -c -m 644 gtp.h pdp.h gtpie.h '/build/deps/install/stow/osmo-ggsn/include' libtool: install: /usr/bin/install -c .libs/libgtp.so.3.0.0 /build/deps/install/stow/osmo-ggsn/lib/libgtp.so.3.0.0 libtool: install: (cd /build/deps/install/stow/osmo-ggsn/lib && { ln -s -f libgtp.so.3.0.0 libgtp.so.3 || { rm -f libgtp.so.3 && ln -s libgtp.so.3.0.0 libgtp.so.3; }; }) libtool: install: (cd /build/deps/install/stow/osmo-ggsn/lib && { ln -s -f libgtp.so.3.0.0 libgtp.so || { rm -f libgtp.so && ln -s libgtp.so.3.0.0 libgtp.so; }; }) libtool: install: /usr/bin/install -c .libs/libgtp.lai /build/deps/install/stow/osmo-ggsn/lib/libgtp.la libtool: install: /usr/bin/install -c .libs/libgtp.a /build/deps/install/stow/osmo-ggsn/lib/libgtp.a libtool: install: chmod 644 /build/deps/install/stow/osmo-ggsn/lib/libgtp.a libtool: install: ranlib /build/deps/install/stow/osmo-ggsn/lib/libgtp.a libtool: finish: PATH="/usr/local/bin:/usr/bin:/bin:/usr/games:/home/osmocom-build/bin:/build_bin:/sbin" ldconfig -n /build/deps/install/stow/osmo-ggsn/lib ---------------------------------------------------------------------- Libraries have been installed in: /build/deps/install/stow/osmo-ggsn/lib If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the `-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the `LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the `LD_RUN_PATH' environment variable during linking - use the `-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to `/etc/ld.so.conf' See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- make[3]: Leaving directory '/build/deps/osmo-ggsn/gtp' make[2]: Leaving directory '/build/deps/osmo-ggsn/gtp' Making install in ggsn make[2]: Entering directory '/build/deps/osmo-ggsn/ggsn' CC ggsn_vty.o CC icmpv6.o CC ggsn.o CC checksum.o CCLD osmo-ggsn make[3]: Entering directory '/build/deps/osmo-ggsn/ggsn' make[3]: Nothing to be done for 'install-data-am'. /bin/mkdir -p '/build/deps/install/stow/osmo-ggsn/bin' /bin/bash ../libtool --mode=install /usr/bin/install -c osmo-ggsn '/build/deps/install/stow/osmo-ggsn/bin' libtool: install: /usr/bin/install -c .libs/osmo-ggsn /build/deps/install/stow/osmo-ggsn/bin/osmo-ggsn make[3]: Leaving directory '/build/deps/osmo-ggsn/ggsn' make[2]: Leaving directory '/build/deps/osmo-ggsn/ggsn' Making install in sgsnemu make[2]: Entering directory '/build/deps/osmo-ggsn/sgsnemu' CC sgsnemu.o CC cmdline.o sgsnemu.c: In function 'main': sgsnemu.c:1848:1: internal compiler error: Segmentation fault } ^ Please submit a full bug report, with preprocessed source if appropriate. See for instructions. The bug is not reproducible, so it is likely a hardware or OS problem. make[2]: *** [sgsnemu.o] Error 1 Makefile:409: recipe for target 'sgsnemu.o' failed make[2]: Leaving directory '/build/deps/osmo-ggsn/sgsnemu' make[1]: *** [install-recursive] Error 1 Makefile:468: recipe for target 'install-recursive' failed make[1]: Leaving directory '/build/deps/osmo-ggsn' make: *** [install] Error 2 Makefile:768: recipe for target 'install' failed Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From jenkins at lists.osmocom.org Mon Jul 2 00:09:47 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Mon, 2 Jul 2018 00:09:47 +0000 (UTC) Subject: =?UTF-8?Q?Jenkins_build_is_back_to_normal_:_master-osmo-sgsn_=C2=BB_--en?= =?UTF-8?Q?able-iu,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#3976?= In-Reply-To: <547303454.457.1530489920001.JavaMail.jenkins@jenkins.osmocom.org> References: <547303454.457.1530489920001.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <10547979.458.1530490187194.JavaMail.jenkins@jenkins.osmocom.org> See From gerrit-no-reply at lists.osmocom.org Mon Jul 2 09:16:31 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 2 Jul 2018 09:16:31 +0000 Subject: Change in gapk[master]: libgsmhr/fetch_sources.py: fix source code downloading In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9792 ) Change subject: libgsmhr/fetch_sources.py: fix source code downloading ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9792 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gapk Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8afd39c85dd3e450c5355888ab6edcf4c81f8b87 Gerrit-Change-Number: 9792 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Mon, 02 Jul 2018 09:16:31 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 09:43:42 2018 From: gerrit-no-reply at lists.osmocom.org (tnt) Date: Mon, 2 Jul 2018 09:43:42 +0000 Subject: Change in gapk[master]: fmt_ti.c: fix: properly pre-clean the output buffer In-Reply-To: References: Message-ID: tnt has posted comments on this change. ( https://gerrit.osmocom.org/9794 ) Change subject: fmt_ti.c: fix: properly pre-clean the output buffer ...................................................................... Patch Set 1: This just looks like a false positive to me. Sure msb_put_bit will read an uninitiated value, but the end result should, in the end, always be the same. -- To view, visit https://gerrit.osmocom.org/9794 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gapk Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I79df56dde23702b0eac8e8fdbc0efd270cc0ace4 Gerrit-Change-Number: 9794 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: tnt Gerrit-Comment-Date: Mon, 02 Jul 2018 09:43:42 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 10:04:29 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 2 Jul 2018 10:04:29 +0000 Subject: Change in gapk[master]: fmt_ti.c: fix: properly pre-clean the output buffer In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/9794 ) Change subject: fmt_ti.c: fix: properly pre-clean the output buffer ...................................................................... Patch Set 1: > This just looks like a false positive to me. > Sure msb_put_bit will read an uninitiated value, but the end result > should, in the end, always be the same. Well, most likely this is not a false-positive. It actually affects the output. http://osmocom.org/issues/2934 To confirm this, I have implemented a simple hack, which randomizes output buffers of processing queue before each iteration - 'make check' failed for this format. I think the AddressSanitizer does the same trick. -- To view, visit https://gerrit.osmocom.org/9794 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gapk Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I79df56dde23702b0eac8e8fdbc0efd270cc0ace4 Gerrit-Change-Number: 9794 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: tnt Gerrit-Comment-Date: Mon, 02 Jul 2018 10:04:29 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 10:06:52 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 2 Jul 2018 10:06:52 +0000 Subject: Change in osmo-ci[master]: ansible: gsm-tester: Assign IP addr in different range to nanobts In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9742 ) Change subject: ansible: gsm-tester: Assign IP addr in different range to nanobts ...................................................................... Patch Set 1: I need to update the osmo-gsm-tester documentation with all the ansible related stuff, so I'll do that soon. We can merge this commit for now, since the changes are already deployed anywway. -- To view, visit https://gerrit.osmocom.org/9742 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9eadb0329a670ce6c2254520d9c86bfbdc898b3a Gerrit-Change-Number: 9742 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Mon, 02 Jul 2018 10:06:52 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 13:15:21 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 2 Jul 2018 13:15:21 +0000 Subject: Change in osmo-gsm-manuals[master]: INSTALL.txt: mention xmllint vs. SSL quirk and workaround Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/9816 Change subject: INSTALL.txt: mention xmllint vs. SSL quirk and workaround ...................................................................... INSTALL.txt: mention xmllint vs. SSL quirk and workaround Related: OS#3072 Change-Id: I5e4389878ea3f23b826526de047f9e647c644888 --- M INSTALL.txt 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/16/9816/1 diff --git a/INSTALL.txt b/INSTALL.txt index d250750..9c3ee7b 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -6,6 +6,7 @@ asciidoc-dblatex \ xsltproc \ dblatex \ + docbook5-xml \ mscgen \ graphviz \ python-pychart \ @@ -39,3 +40,7 @@ osmo_interact_vty.py -r "osmo-msc -c ~/src/osmo-msc/doc/examples/osmo-msc/osmo-msc.cfg" \ -X -p 4254 > OsmoMSC/vty/msc_vty_reference.xml + +Note that docbook.org since recently are providing DTDs only on HTTPS URLs, +while xmllint is incapable of SSL. Hence it is necessary to locally install the +docbook DTDs. (On Debian, these are included in the docbook5-xml package.) -- To view, visit https://gerrit.osmocom.org/9816 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I5e4389878ea3f23b826526de047f9e647c644888 Gerrit-Change-Number: 9816 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 13:15:22 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 2 Jul 2018 13:15:22 +0000 Subject: Change in osmo-gsm-manuals[master]: hlr: clarify that aud_3g also applies to 2G Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/9817 Change subject: hlr: clarify that aud_3g also applies to 2G ...................................................................... hlr: clarify that aud_3g also applies to 2G (and tweak wording) Related: OS#3091 Change-Id: I2ae03625ccc1364f953db0611e9a29d935dab803 --- M OsmoHLR/chapters/subscribers.adoc 1 file changed, 17 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/17/9817/1 diff --git a/OsmoHLR/chapters/subscribers.adoc b/OsmoHLR/chapters/subscribers.adoc index b2024d2..bb57d24 100644 --- a/OsmoHLR/chapters/subscribers.adoc +++ b/OsmoHLR/chapters/subscribers.adoc @@ -3,15 +3,16 @@ Subscribers are kept in a local SQLite database file and can be managed via VTY and CTRL interfaces. -See this section for some examples, and also refer to the OsmoHLR VTY reference +This section provides some examples; also refer to the OsmoHLR VTY reference manual <> as well as the Control interface described in <>. === Example: Add/Update/Delete Subscriber via VTY -The following telnet VTY session adds a subscriber complete with 2G and 3G -authentication tokens, and finally removes the subscriber again; it assumes -that osmo-hlr is running and listening for telnet VTY connections on localhost: +The following telnet VTY session adds a subscriber complete with GSM (2G) and +UMTS (3G and 2G) authentication tokens, and finally removes the subscriber +again; it assumes that osmo-hlr is running and listening for telnet VTY +connections on localhost: ---- $ telnet localhost 4258 @@ -23,7 +24,16 @@ The following parameters are managed for each subscriber of the HLR, modelled roughly after 3GPP TS 23.008, version 13.3.0; note that not all of these -parameters are necessarily in active use: +parameters are necessarily in active use. + +The `aud3g` table also applies to 2G networks: it provides UMTS AKA tokens for +Milenage authentication, which is available both on 3G and 2G networks. On 2G, +when both MS and network are R99 capable (like OsmoMSC and OsmoSGSN are), the +full UMTS AKA with Milenage keys from `aud_3g`, using AUTN and extended RES +tokens, is available. With pre-R99 MS or network configurations, the GSM AKA +compatible variant of Milenage, still using the Milenage keys from `aud_3g` but +transceiving only RAND and SRES, may be applicable. (See 3GPP TS 33.102, chapter +6.8.1, Authentication and key agreement of UMTS subscribers.) .OsmoHLR's subscriber parameters [options="header",width="100%",cols="20%,20%,60%"] @@ -32,9 +42,9 @@ |imsi|901700000014701|identity of the SIM/USIM, 3GPP TS 23.008 chapter 2.1.1.1 |msisdn|2342123|number to dial to reach this subscriber (multiple MSISDNs can be stored per subscriber), 3GPP TS 23.008 chapter 2.1.2 |imeisv|4234234234234275|identity of the mobile device and software version, 3GPP TS 23.008 chapter 2.2.3 -|aud2g.algo|comp128v3|Authentication algorithm ID for 2G, corresponds to enum osmo_auth_algo +|aud2g.algo|comp128v3|Authentication algorithm ID for GSM AKA, corresponds to enum osmo_auth_algo |aud2g.ki||Subscriber's secret key (128bit) -|aud3g.algo|milenage|Authentication algorithm ID for 3G and UMTS AKA, corresponds to enum osmo_auth_algo +|aud3g.algo|milenage|Authentication algorithm ID for UMTS AKA (applies to both 3G and 2G networks), corresponds to enum osmo_auth_algo |aud3g.k|(32 hexadecimal digits)|Subscriber's secret key (128bit) |aud3g.op|(32 hexadecimal digits)|Operator's secret key (128bit) |aud3g.opc|(32 hexadecimal digits)|Secret key derived from OP and K (128bit), alternative to using OP which does not disclose OP to subscribers -- To view, visit https://gerrit.osmocom.org/9817 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I2ae03625ccc1364f953db0611e9a29d935dab803 Gerrit-Change-Number: 9817 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 13:38:41 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 2 Jul 2018 13:38:41 +0000 Subject: Change in libosmocore[master]: Don't enforce Python 2 for utilities Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/9818 Change subject: Don't enforce Python 2 for utilities ...................................................................... Don't enforce Python 2 for utilities The conv_gen.py utility was tested against both Python 2 and 3, so there is no need to enforce Python 2. Also, having: #!/usr/local/bin/python{2|3} is a bad idea, because Python may be installed in a different location. Change-Id: I6007d481047b584db13d6eda70fb99f11f9ddaa1 --- M include/Makefile.am M src/gsm/Makefile.am M tests/Makefile.am M utils/conv_codes_gsm.py M utils/conv_gen.py 5 files changed, 6 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/18/9818/1 diff --git a/include/Makefile.am b/include/Makefile.am index 27a4090..38ba14c 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -162,7 +162,7 @@ $(AM_V_GEN)sed -e's/XX/$*/g' $< > $@ osmocom/gsm/gsm0503.h: $(top_srcdir)/utils/conv_gen.py $(top_srcdir)/utils/conv_codes_gsm.py - $(AM_V_GEN)python2 $(top_srcdir)/utils/conv_gen.py gen_header gsm \ + $(AM_V_GEN)python $(top_srcdir)/utils/conv_gen.py gen_header gsm \ --target-path $(builddir)/osmocom/gsm CLEANFILES = osmocom/gsm/gsm0503.h diff --git a/src/gsm/Makefile.am b/src/gsm/Makefile.am index 0439ce6..5387e3a 100644 --- a/src/gsm/Makefile.am +++ b/src/gsm/Makefile.am @@ -47,6 +47,6 @@ # Convolutional codes generation gsm0503_conv.c: $(top_srcdir)/utils/conv_gen.py $(top_srcdir)/utils/conv_codes_gsm.py - $(AM_V_GEN)python2 $(top_srcdir)/utils/conv_gen.py gen_codes gsm + $(AM_V_GEN)python $(top_srcdir)/utils/conv_gen.py gen_codes gsm CLEANFILES = gsm0503_conv.c diff --git a/tests/Makefile.am b/tests/Makefile.am index 70b5cb8..db4e520 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -280,5 +280,5 @@ mv $@.tmp $@ conv/gsm0503_test_vectors.c: $(top_srcdir)/utils/conv_gen.py $(top_srcdir)/utils/conv_codes_gsm.py - $(AM_V_GEN)python2 $(top_srcdir)/utils/conv_gen.py gen_vectors gsm \ + $(AM_V_GEN)python $(top_srcdir)/utils/conv_gen.py gen_vectors gsm \ --target-path $(builddir)/conv diff --git a/utils/conv_codes_gsm.py b/utils/conv_codes_gsm.py index eeed4fd..ec77660 100644 --- a/utils/conv_codes_gsm.py +++ b/utils/conv_codes_gsm.py @@ -1,5 +1,6 @@ -#!/usr/bin/python2 +#!/usr/bin/env python # -*- coding: utf-8 -*- + from conv_gen import ConvolutionalCode from conv_gen import poly diff --git a/utils/conv_gen.py b/utils/conv_gen.py index 6b6b267..06283d8 100644 --- a/utils/conv_gen.py +++ b/utils/conv_gen.py @@ -1,4 +1,4 @@ -#!/usr/bin/python2 +#!/usr/bin/env python mod_license = """ /* -- To view, visit https://gerrit.osmocom.org/9818 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I6007d481047b584db13d6eda70fb99f11f9ddaa1 Gerrit-Change-Number: 9818 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 13:43:29 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 2 Jul 2018 13:43:29 +0000 Subject: Change in osmo-bts[master]: doc: Move calypsoBTS example into trx subdir Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9819 Change subject: doc: Move calypsoBTS example into trx subdir ...................................................................... doc: Move calypsoBTS example into trx subdir CalypsoBTS is a regular osmo-bts-trx with specific config options, so let's move the cfg file to correct place. This also makes it easier to install and package example files later on. Change-Id: Ie2b968c478f1cf4d3e4cb36e4fb743e413cc93f0 --- R doc/examples/trx/osmo-bts-trx-calypso.cfg 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/19/9819/1 diff --git a/doc/examples/calypso/osmo-bts.cfg b/doc/examples/trx/osmo-bts-trx-calypso.cfg similarity index 100% rename from doc/examples/calypso/osmo-bts.cfg rename to doc/examples/trx/osmo-bts-trx-calypso.cfg -- To view, visit https://gerrit.osmocom.org/9819 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ie2b968c478f1cf4d3e4cb36e4fb743e413cc93f0 Gerrit-Change-Number: 9819 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 13:43:29 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 2 Jul 2018 13:43:29 +0000 Subject: Change in osmo-bts[master]: build: Install example cfg files Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9820 Change subject: build: Install example cfg files ...................................................................... build: Install example cfg files Files from doc/examples/foo/bar.cfg are install to /usr/share/doc/osmo-bts/examples/osmo-bts-foo/bar.cfg. Change-Id: I7525d5a3e1a3c83a54f919cce9096303dd506f35 --- M Makefile.am M configure.ac A doc/Makefile.am A doc/examples/Makefile.am 4 files changed, 39 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/20/9820/1 diff --git a/Makefile.am b/Makefile.am index dc42574..10ff2d2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6 -SUBDIRS = include src tests +SUBDIRS = include src tests doc # package the contrib and doc diff --git a/configure.ac b/configure.ac index b364e4d..d4572bc 100644 --- a/configure.ac +++ b/configure.ac @@ -306,4 +306,6 @@ tests/tx_power/Makefile tests/power/Makefile tests/meas/Makefile + doc/Makefile + doc/examples/Makefile Makefile) diff --git a/doc/Makefile.am b/doc/Makefile.am new file mode 100644 index 0000000..1d42b0a --- /dev/null +++ b/doc/Makefile.am @@ -0,0 +1,3 @@ +SUBDIRS = \ + examples \ + $(NULL) diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am new file mode 100644 index 0000000..7f60f81 --- /dev/null +++ b/doc/examples/Makefile.am @@ -0,0 +1,33 @@ + +doc_virtualdir = $(docdir)/examples/osmo-bts-virtual +doc_virtual_DATA = \ + virtual/osmobts-virtual.cfg \ + virtual/openbsc-virtual.cfg + +if ENABLE_SYSMOBTS +doc_sysmodir = $(docdir)/examples/osmo-bts-sysmo +doc_sysmo_DATA = \ + sysmo/osmo-bts.cfg \ + sysmo/sysmobts-mgr.cfg +endif + +if ENABLE_TRX +doc_trxdir = $(docdir)/examples/osmo-bts-trx +doc_trx_DATA = \ + trx/osmo-bts.cfg \ + trx/osmo-bts-trx-calypso.cfg +endif + +if ENABLE_OCTPHY +doc_octphydir = $(docdir)/examples/osmo-bts-octphy +doc_octphy_DATA = \ + octphy/osmo-bts-trx2dsp1.cfg \ + octphy/osmo-bts.cfg +endif + +if ENABLE_LC15BTS +doc_lc15dir = $(docdir)/examples/osmo-bts-lc15 +doc_lc15_DATA = \ + litecell15/osmo-bts.cfg \ + litecell15/lc15bts-mgr.cfg +endif -- To view, visit https://gerrit.osmocom.org/9820 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I7525d5a3e1a3c83a54f919cce9096303dd506f35 Gerrit-Change-Number: 9820 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 13:43:30 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 2 Jul 2018 13:43:30 +0000 Subject: Change in osmo-bts[master]: debian: Package installed example doc files Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9821 Change subject: debian: Package installed example doc files ...................................................................... debian: Package installed example doc files Change-Id: I9449add4905ecc724c0aa9c8c2d56c6ed4138844 --- M debian/osmo-bts-trx.install M debian/osmo-bts-virtual.install 2 files changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/21/9821/1 diff --git a/debian/osmo-bts-trx.install b/debian/osmo-bts-trx.install index 92d524c..e821cb4 100644 --- a/debian/osmo-bts-trx.install +++ b/debian/osmo-bts-trx.install @@ -1 +1,3 @@ usr/bin/osmo-bts-trx +usr/share/doc/osmo-bts/examples/osmo-bts-trx/osmo-bts.cfg +usr/share/doc/osmo-bts/examples/osmo-bts-trx/osmo-bts-trx-calypso.cfg diff --git a/debian/osmo-bts-virtual.install b/debian/osmo-bts-virtual.install index 07adbfd..3815d7c 100644 --- a/debian/osmo-bts-virtual.install +++ b/debian/osmo-bts-virtual.install @@ -1,2 +1,4 @@ usr/bin/osmo-bts-virtual usr/bin/osmo-bts-omldummy +usr/share/doc/osmo-bts/examples/osmo-bts-virtual/osmobts-virtual.cfg +usr/share/doc/osmo-bts/examples/osmo-bts-virtual/openbsc-virtual.cfg -- To view, visit https://gerrit.osmocom.org/9821 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I9449add4905ecc724c0aa9c8c2d56c6ed4138844 Gerrit-Change-Number: 9821 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 13:43:30 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 2 Jul 2018 13:43:30 +0000 Subject: Change in osmo-bts[master]: Remve uneeded direct libortp dependency Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9822 Change subject: Remve uneeded direct libortp dependency ...................................................................... Remve uneeded direct libortp dependency All code in osmo-bts goes through APIs in libosmotrau (osmo_ortp.h), hence direct dependency is not needed. Fixes OBS warnings: dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/osmo-bts-trx/usr/bin/osmo-bts-trx was not linked against libortp.so.9 (it uses none of the library's symbols) dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/osmo-bts-virtual/usr/bin/osmo-bts-omldummy debian/osmo-bts-virtual/usr/bin/osmo-bts-virtual were not linked against libortp.so.9 (they use none of the library's symbols) Change-Id: I96a9b5f0678331dcf66c007928866a124d8700de --- M configure.ac M debian/control M src/osmo-bts-litecell15/Makefile.am M src/osmo-bts-litecell15/tch.c M src/osmo-bts-octphy/Makefile.am M src/osmo-bts-omldummy/Makefile.am M src/osmo-bts-sysmo/Makefile.am M src/osmo-bts-sysmo/tch.c M src/osmo-bts-trx/Makefile.am M src/osmo-bts-virtual/Makefile.am M tests/agch/Makefile.am M tests/cipher/Makefile.am M tests/paging/Makefile.am M tests/power/Makefile.am M tests/sysmobts/Makefile.am 15 files changed, 23 insertions(+), 29 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/22/9822/1 diff --git a/configure.ac b/configure.ac index d4572bc..aad55db 100644 --- a/configure.ac +++ b/configure.ac @@ -70,7 +70,6 @@ PKG_CHECK_MODULES(LIBOSMOCODING, libosmocoding >= 0.11.0) PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.5.0) PKG_CHECK_MODULES(LIBOSMOTRAU, libosmotrau >= 0.5.0) -PKG_CHECK_MODULES(ORTP, ortp) AC_MSG_CHECKING([whether to enable support for sysmobts calibration tool]) AC_ARG_ENABLE(sysmobts-calib, diff --git a/debian/control b/debian/control index 0ac70dd..4835b57 100644 --- a/debian/control +++ b/debian/control @@ -11,7 +11,6 @@ libosmocore-dev, libosmo-abis-dev, libgps-dev, - libortp-dev, txt2man Standards-Version: 3.9.8 Vcs-Browser: http://git.osmocom.org/osmo-bts/ diff --git a/src/osmo-bts-litecell15/Makefile.am b/src/osmo-bts-litecell15/Makefile.am index f30320f..0cc124a 100644 --- a/src/osmo-bts-litecell15/Makefile.am +++ b/src/osmo-bts-litecell15/Makefile.am @@ -1,8 +1,8 @@ -AUTOMAKE_OPTIONS = subdir-objects +AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include $(LITECELL15_INCDIR) -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) $(LIBSYSTEMD_CFLAGS) -COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(LIBSYSTEMD_CFLAGS) +COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) AM_CFLAGS += -DENABLE_LC15BTS diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index 0becfc4..5eae753 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -36,7 +36,6 @@ #include #include #include -#include #include #include diff --git a/src/osmo-bts-octphy/Makefile.am b/src/osmo-bts-octphy/Makefile.am index ccdafaa..43d9cd7 100644 --- a/src/osmo-bts-octphy/Makefile.am +++ b/src/osmo-bts-octphy/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include $(OCTSDR2G_INCDIR) -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(ORTP_CFLAGS) -COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) +COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) EXTRA_DIST = l1_if.h l1_oml.h l1_utils.h octphy_hw_api.h octpkt.h @@ -10,4 +10,3 @@ osmo_bts_octphy_SOURCES = $(COMMON_SOURCES) osmo_bts_octphy_LDADD = $(top_builddir)/src/common/libbts.a $(COMMON_LDADD) - diff --git a/src/osmo-bts-omldummy/Makefile.am b/src/osmo-bts-omldummy/Makefile.am index 4ff28f0..5a4ce7c 100644 --- a/src/osmo-bts-omldummy/Makefile.am +++ b/src/osmo-bts-omldummy/Makefile.am @@ -1,6 +1,6 @@ -AM_CFLAGS = -Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) +AM_CFLAGS = -Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -Iinclude -COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) -ldl +COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) -ldl bin_PROGRAMS = osmo-bts-omldummy diff --git a/src/osmo-bts-sysmo/Makefile.am b/src/osmo-bts-sysmo/Makefile.am index 8e03b77..4901ea3 100644 --- a/src/osmo-bts-sysmo/Makefile.am +++ b/src/osmo-bts-sysmo/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include $(SYSMOBTS_INCDIR) -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) -COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) +COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) EXTRA_DIST = misc/sysmobts_mgr.h misc/sysmobts_misc.h misc/sysmobts_par.h \ misc/sysmobts_eeprom.h misc/sysmobts_nl.h femtobts.h hw_misc.h \ diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index 4e6e246..54e7313 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include diff --git a/src/osmo-bts-trx/Makefile.am b/src/osmo-bts-trx/Makefile.am index c241232..1922240 100644 --- a/src/osmo-bts-trx/Makefile.am +++ b/src/osmo-bts-trx/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -AM_CFLAGS = -Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOCODING_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(ORTP_CFLAGS) -LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOCODING_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) -ldl +AM_CFLAGS = -Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOCODING_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOCODING_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) -ldl EXTRA_DIST = trx_if.h l1_if.h loops.h @@ -8,4 +8,3 @@ osmo_bts_trx_SOURCES = main.c trx_if.c l1_if.c scheduler_trx.c trx_vty.c loops.c osmo_bts_trx_LDADD = $(top_builddir)/src/common/libl1sched.a $(top_builddir)/src/common/libbts.a $(LDADD) - diff --git a/src/osmo-bts-virtual/Makefile.am b/src/osmo-bts-virtual/Makefile.am index eeb76aa..070efed 100644 --- a/src/osmo-bts-virtual/Makefile.am +++ b/src/osmo-bts-virtual/Makefile.am @@ -1,6 +1,6 @@ -AM_CFLAGS = -Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) +AM_CFLAGS = -Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -Iinclude -COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) -ldl +COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) -ldl noinst_HEADERS = l1_if.h osmo_mcast_sock.h virtual_um.h diff --git a/tests/agch/Makefile.am b/tests/agch/Makefile.am index 1357ea2..0c4fce4 100644 --- a/tests/agch/Makefile.am +++ b/tests/agch/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(ORTP_CFLAGS) -LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCODEC_LIBS) $(ORTP_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOCODEC_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCODEC_LIBS) noinst_PROGRAMS = agch_test EXTRA_DIST = agch_test.ok diff --git a/tests/cipher/Makefile.am b/tests/cipher/Makefile.am index a671550..3c23718 100644 --- a/tests/cipher/Makefile.am +++ b/tests/cipher/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(ORTP_CFLAGS) -LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCODEC_LIBS) $(ORTP_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOCODEC_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCODEC_LIBS) noinst_PROGRAMS = cipher_test EXTRA_DIST = cipher_test.ok diff --git a/tests/paging/Makefile.am b/tests/paging/Makefile.am index 98c6673..74d9826 100644 --- a/tests/paging/Makefile.am +++ b/tests/paging/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(ORTP_CFLAGS) -LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCODEC_LIBS) $(ORTP_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOCODEC_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCODEC_LIBS) noinst_PROGRAMS = paging_test EXTRA_DIST = paging_test.ok diff --git a/tests/power/Makefile.am b/tests/power/Makefile.am index 3cb8d15..ac45f23 100644 --- a/tests/power/Makefile.am +++ b/tests/power/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) -LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(ORTP_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) noinst_PROGRAMS = power_test EXTRA_DIST = power_test.ok diff --git a/tests/sysmobts/Makefile.am b/tests/sysmobts/Makefile.am index 5f27116..0829ca5 100644 --- a/tests/sysmobts/Makefile.am +++ b/tests/sysmobts/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo $(SYSMOBTS_INCDIR) -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) -LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(ORTP_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) noinst_PROGRAMS = sysmobts_test EXTRA_DIST = sysmobts_test.ok -- To view, visit https://gerrit.osmocom.org/9822 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I96a9b5f0678331dcf66c007928866a124d8700de Gerrit-Change-Number: 9822 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 13:45:05 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 2 Jul 2018 13:45:05 +0000 Subject: Change in libosmocore[master]: Don't enforce Python 2 for utilities In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9818 ) Change subject: Don't enforce Python 2 for utilities ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9818 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6007d481047b584db13d6eda70fb99f11f9ddaa1 Gerrit-Change-Number: 9818 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Mon, 02 Jul 2018 13:45:05 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 13:46:01 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 2 Jul 2018 13:46:01 +0000 Subject: Change in osmo-bts[master]: Remove unneeded direct libortp dependency In-Reply-To: References: Message-ID: Pau Espin Pedrol has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/9822 ) Change subject: Remove unneeded direct libortp dependency ...................................................................... Remove unneeded direct libortp dependency All code in osmo-bts goes through APIs in libosmotrau (osmo_ortp.h), hence direct dependency is not needed. Fixes OBS warnings: dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/osmo-bts-trx/usr/bin/osmo-bts-trx was not linked against libortp.so.9 (it uses none of the library's symbols) dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/osmo-bts-virtual/usr/bin/osmo-bts-omldummy debian/osmo-bts-virtual/usr/bin/osmo-bts-virtual were not linked against libortp.so.9 (they use none of the library's symbols) Change-Id: I96a9b5f0678331dcf66c007928866a124d8700de --- M configure.ac M debian/control M src/osmo-bts-litecell15/Makefile.am M src/osmo-bts-litecell15/tch.c M src/osmo-bts-octphy/Makefile.am M src/osmo-bts-omldummy/Makefile.am M src/osmo-bts-sysmo/Makefile.am M src/osmo-bts-sysmo/tch.c M src/osmo-bts-trx/Makefile.am M src/osmo-bts-virtual/Makefile.am M tests/agch/Makefile.am M tests/cipher/Makefile.am M tests/paging/Makefile.am M tests/power/Makefile.am M tests/sysmobts/Makefile.am 15 files changed, 23 insertions(+), 29 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/22/9822/2 -- To view, visit https://gerrit.osmocom.org/9822 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I96a9b5f0678331dcf66c007928866a124d8700de Gerrit-Change-Number: 9822 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 14:11:38 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 2 Jul 2018 14:11:38 +0000 Subject: Change in osmo-bsc[master]: large refactoring: use FSMs for lchans; add inter-BSC HO In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9671 ) Change subject: large refactoring: use FSMs for lchans; add inter-BSC HO ...................................................................... Patch Set 12: > Using today's branches I'm getting ttcn3 failures on > BSC_Tests.TC_late_conn_fail for both AoUP and SCCPlite, while > master passes it. I used to get test failures of TC_{late,early}_conn, but these should have been resolved by https://gerrit.osmocom.org/9748 ... I can check again -- To view, visit https://gerrit.osmocom.org/9671 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I82e3f918295daa83274a4cf803f046979f284366 Gerrit-Change-Number: 9671 Gerrit-PatchSet: 12 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Mon, 02 Jul 2018 14:11:38 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 14:14:54 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 2 Jul 2018 14:14:54 +0000 Subject: Change in libosmo-sccp[master]: sccp vty: be fatal for addressbook entry errors In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/4723 ) Change subject: sccp vty: be fatal for addressbook entry errors ...................................................................... Patch Set 2: wow, forgot about this one for more than half a year... -- To view, visit https://gerrit.osmocom.org/4723 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2f71b9c4dd30f919d2054da81283dd7035f44f60 Gerrit-Change-Number: 4723 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Mon, 02 Jul 2018 14:14:54 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 14:22:56 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 2 Jul 2018 14:22:56 +0000 Subject: Change in osmo-bts[master]: build: Install example cfg files In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9820 to look at the new patch set (#2). Change subject: build: Install example cfg files ...................................................................... build: Install example cfg files Files from doc/examples/foo/bar.cfg are install to /usr/share/doc/osmo-bts/examples/osmo-bts-foo/bar.cfg. Change-Id: I7525d5a3e1a3c83a54f919cce9096303dd506f35 --- M Makefile.am M configure.ac A doc/Makefile.am A doc/examples/Makefile.am 4 files changed, 39 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/20/9820/2 -- To view, visit https://gerrit.osmocom.org/9820 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7525d5a3e1a3c83a54f919cce9096303dd506f35 Gerrit-Change-Number: 9820 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 14:30:35 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 2 Jul 2018 14:30:35 +0000 Subject: Change in gapk[master]: testsuite.at: fix: conditionally enable 'ecu/ecu_fr_test' Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/9823 Change subject: testsuite.at: fix: conditionally enable 'ecu/ecu_fr_test' ...................................................................... testsuite.at: fix: conditionally enable 'ecu/ecu_fr_test' In the 'ecu/ecu_fr_test' we have a processing queue with Full Rate decoder block, which depends on libgsm. If libgsm isn't available, the test will fail. Let's enable this test conditionally. Change-Id: I74cf0e9de1e2f65e7227ee1565f12622bb55cabe --- M tests/testsuite.at 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/gapk refs/changes/23/9823/1 diff --git a/tests/testsuite.at b/tests/testsuite.at index 2b1f4c2..5946661 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -25,6 +25,7 @@ AT_SETUP([ecu/ecu_fr_test]) AT_KEYWORDS([ecu_fr_test]) +AT_CHECK([test "x$enable_fr_tests" = xyes || exit 77]) cat $abs_srcdir/ecu/ecu_fr_test.ok > expout AT_CHECK([ $abs_top_builddir/tests/ecu/ecu_fr_test], [0], [expout]) -- To view, visit https://gerrit.osmocom.org/9823 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gapk Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I74cf0e9de1e2f65e7227ee1565f12622bb55cabe Gerrit-Change-Number: 9823 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 14:36:38 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 2 Jul 2018 14:36:38 +0000 Subject: Change in osmo-bts[master]: build: Install example cfg files In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9820 to look at the new patch set (#3). Change subject: build: Install example cfg files ...................................................................... build: Install example cfg files Files from doc/examples/foo/bar.cfg are install to /usr/share/doc/osmo-bts/examples/osmo-bts-foo/bar.cfg. Change-Id: I7525d5a3e1a3c83a54f919cce9096303dd506f35 --- M Makefile.am M configure.ac A doc/Makefile.am A doc/examples/Makefile.am 4 files changed, 44 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/20/9820/3 -- To view, visit https://gerrit.osmocom.org/9820 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7525d5a3e1a3c83a54f919cce9096303dd506f35 Gerrit-Change-Number: 9820 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 14:48:24 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 2 Jul 2018 14:48:24 +0000 Subject: Change in libosmo-sccp[master]: build: Install example cfg files Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9824 Change subject: build: Install example cfg files ...................................................................... build: Install example cfg files Change-Id: I93b73032b9a01a1e121ecf7c0cfcf3d5558efc7f --- M Makefile.am M configure.ac A doc/Makefile.am A doc/examples/Makefile.am 4 files changed, 10 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/24/9824/1 diff --git a/Makefile.am b/Makefile.am index 1ac8e11..3f4de13 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,7 @@ AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6 AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -SUBDIRS = include src tests examples stp +SUBDIRS = include src tests examples stp doc pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libosmo-sccp.pc libosmo-mtp.pc libosmo-sigtran.pc libosmo-xua.pc diff --git a/configure.ac b/configure.ac index d2d4d02..ff9a1c4 100644 --- a/configure.ac +++ b/configure.ac @@ -120,5 +120,7 @@ tests/ss7/Makefile examples/Makefile stp/Makefile + doc/Makefile + doc/examples/Makefile Doxyfile Makefile) diff --git a/doc/Makefile.am b/doc/Makefile.am new file mode 100644 index 0000000..1d42b0a --- /dev/null +++ b/doc/Makefile.am @@ -0,0 +1,3 @@ +SUBDIRS = \ + examples \ + $(NULL) diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am new file mode 100644 index 0000000..b1a7a0f --- /dev/null +++ b/doc/examples/Makefile.am @@ -0,0 +1,4 @@ +examples_stpdir = $(docdir)/examples/osmo-stp +examples_stp_DATA = osmo-stp.cfg + +EXTRA_DIST = $(examples_stp_DATA) -- To view, visit https://gerrit.osmocom.org/9824 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I93b73032b9a01a1e121ecf7c0cfcf3d5558efc7f Gerrit-Change-Number: 9824 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 14:48:24 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 2 Jul 2018 14:48:24 +0000 Subject: Change in libosmo-sccp[master]: debian: Package installed example doc files Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9825 Change subject: debian: Package installed example doc files ...................................................................... debian: Package installed example doc files Change-Id: I1d955ccf83c825d7a648a7e140bb20e10f5ddff3 --- M debian/osmo-stp.install 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/25/9825/1 diff --git a/debian/osmo-stp.install b/debian/osmo-stp.install index 74ce048..b2f8077 100644 --- a/debian/osmo-stp.install +++ b/debian/osmo-stp.install @@ -1 +1,2 @@ /usr/bin/osmo-stp +/usr/share/doc/libosmo-sccp/examples/osmo-stp/osmo-stp.cfg -- To view, visit https://gerrit.osmocom.org/9825 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I1d955ccf83c825d7a648a7e140bb20e10f5ddff3 Gerrit-Change-Number: 9825 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 15:05:49 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 2 Jul 2018 15:05:49 +0000 Subject: Change in osmo-mgw[master]: debian: Package installed example doc files Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9826 Change subject: debian: Package installed example doc files ...................................................................... debian: Package installed example doc files Change-Id: I71afa4799e0b484879b96567acd004755a84027f --- M debian/osmo-bsc-mgcp.install M debian/osmo-mgw.install 2 files changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/26/9826/1 diff --git a/debian/osmo-bsc-mgcp.install b/debian/osmo-bsc-mgcp.install index 1550437..bed2f47 100644 --- a/debian/osmo-bsc-mgcp.install +++ b/debian/osmo-bsc-mgcp.install @@ -1 +1,2 @@ usr/bin/osmo-bsc_mgcp +usr/share/doc/osmo-mgw/examples/osmo-bsc_mgcp/mgcp.cfg diff --git a/debian/osmo-mgw.install b/debian/osmo-mgw.install index 5dac968..39f7c01 100644 --- a/debian/osmo-mgw.install +++ b/debian/osmo-mgw.install @@ -1 +1,2 @@ usr/bin/osmo-mgw +usr/share/doc/osmo-mgw/examples/osmo-mgw/osmo-mgw.cfg -- To view, visit https://gerrit.osmocom.org/9826 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I71afa4799e0b484879b96567acd004755a84027f Gerrit-Change-Number: 9826 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 15:05:50 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 2 Jul 2018 15:05:50 +0000 Subject: Change in osmo-mgw[master]: gitignore: Add m4 scripts from m4 subdir Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9827 Change subject: gitignore: Add m4 scripts from m4 subdir ...................................................................... gitignore: Add m4 scripts from m4 subdir Change-Id: I8da2a55e84bcc24cc5af00dc089630a18105c625 --- M .gitignore 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/27/9827/1 diff --git a/.gitignore b/.gitignore index a9e6b84..7633c73 100644 --- a/.gitignore +++ b/.gitignore @@ -38,6 +38,7 @@ stamp-h1 libtool ltmain.sh +m4/*.m4 # git-version-gen magic .tarball-version -- To view, visit https://gerrit.osmocom.org/9827 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I8da2a55e84bcc24cc5af00dc089630a18105c625 Gerrit-Change-Number: 9827 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Mon Jul 2 15:10:06 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Mon, 2 Jul 2018 15:10:06 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-asn1c_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#172?= In-Reply-To: <1892988791.453.1530457806124.JavaMail.jenkins@jenkins.osmocom.org> References: <1892988791.453.1530457806124.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <6853033.4.1530544206730.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 3.74 KB...] checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for style of include used by make... GNU checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking how to run the C++ preprocessor... g++ -E checking for g77... no checking for f77... no checking for xlf... no checking for frt... no checking for pgf77... no checking for cf77... no checking for fort77... no checking for fl32... no checking for af77... no checking for f90... no checking for xlf90... no checking for pgf90... no checking for pghpf... no checking for epcf90... no checking for gfortran... no checking for g95... no checking for f95... no checking for fort... no checking for xlf95... no checking for ifort... no checking for ifc... no checking for efc... no checking for pgf95... no checking for lf95... no checking for ftn... no checking whether we are using the GNU Fortran 77 compiler... no checking whether accepts -g... no checking the maximum length of command line arguments... 32768 checking command to parse /usr/bin/nm -B output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes configure: creating libtool appending configuration tag "CXX" to libtool checking for ld used by g++... /usr/bin/ld -m elf_x86_64 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC checking if g++ PIC flag -fPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate appending configuration tag "F77" to libtool checking for autoconf... /usr/bin/autoconf checking for autoheader... /usr/bin/autoheader checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking dependency style of gcc... (cached) gcc3 checking how to run the C preprocessor... gcc -E checking for a BSD-compatible install... /usr/bin/install -c checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking for bison... bison -y checking for flex... flex checking for yywrap in -lfl... yes checking lex output file root... lex.yy checking whether yytext is a pointer... yes checking for ar... /usr/bin/ar checking for ANSI C header files... (cached) yes checking sys/param.h usability... yes checking sys/param.h presence... yes checking for sys/param.h... yes checking whether byte ordering is bigendian... no checking for off_t... yes checking for size_t... yes checking whether struct tm is in sys/time.h or time.h... time.h checking for intmax_t... yes checking for library containing getopt... none required checking for strtoimax... yes checking for strtoll... yes checking for mergesort... no checking for mkstemps... yes configure: creating ./config.status config.status: creating skeletons/standard-modules/Makefile config.status: creating skeletons/tests/Makefile config.status: creating libasn1compiler/Makefile config.status: creating libasn1parser/Makefile config.status: creating libasn1print/Makefile config.status: creating asn1c/webcgi/Makefile config.status: creating asn1c/tests/Makefile config.status: creating libasn1fix/Makefile config.status: creating skeletons/Makefile config.status: creating examples/Makefile config.status: creating tests/Makefile config.status: creating asn1c/Makefile config.status: creating doc/Makefile config.status: creating asn1c.spec config.status: creating Makefile config.status: creating config.h config.status: executing depfiles commands + make -j 8 make all-recursive make[1]: Entering directory ' Making all in libasn1parser make[2]: Entering directory ' if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF ".deps/asn1parser.Tpo" -c -o asn1parser.lo asn1parser.c; \ then mv -f ".deps/asn1parser.Tpo" ".deps/asn1parser.Plo"; else rm -f ".deps/asn1parser.Tpo"; exit 1; fi bison -y -p asn1p_ -d asn1p_y.y if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF ".deps/asn1p_l.Tpo" -c -o asn1p_l.lo asn1p_l.c; \ then mv -f ".deps/asn1p_l.Tpo" ".deps/asn1p_l.Plo"; else rm -f ".deps/asn1p_l.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF ".deps/asn1p_module.Tpo" -c -o asn1p_module.lo asn1p_module.c; \ then mv -f ".deps/asn1p_module.Tpo" ".deps/asn1p_module.Plo"; else rm -f ".deps/asn1p_module.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF ".deps/asn1p_oid.Tpo" -c -o asn1p_oid.lo asn1p_oid.c; \ then mv -f ".deps/asn1p_oid.Tpo" ".deps/asn1p_oid.Plo"; else rm -f ".deps/asn1p_oid.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF ".deps/asn1p_value.Tpo" -c -o asn1p_value.lo asn1p_value.c; \ then mv -f ".deps/asn1p_value.Tpo" ".deps/asn1p_value.Plo"; else rm -f ".deps/asn1p_value.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF ".deps/asn1p_expr.Tpo" -c -o asn1p_expr.lo asn1p_expr.c; \ then mv -f ".deps/asn1p_expr.Tpo" ".deps/asn1p_expr.Plo"; else rm -f ".deps/asn1p_expr.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF ".deps/asn1p_xports.Tpo" -c -o asn1p_xports.lo asn1p_xports.c; \ then mv -f ".deps/asn1p_xports.Tpo" ".deps/asn1p_xports.Plo"; else rm -f ".deps/asn1p_xports.Tpo"; exit 1; fi asn1p_y.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] mkdir .libs mkdir .libs mkdir: cannot create directory '.libs': File exists gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -fPIC -DPIC -o .libs/asn1parser.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -fPIC -DPIC -o .libs/asn1p_l.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -fPIC -DPIC -o .libs/asn1p_value.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -fPIC -DPIC -o .libs/asn1p_xports.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -fPIC -DPIC -o .libs/asn1p_expr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -fPIC -DPIC -o .libs/asn1p_oid.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -fPIC -DPIC -o .libs/asn1p_module.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -o asn1p_xports.o >/dev/null 2>&1 asn1p_l.c:3521:12: warning: 'input' defined but not used [-Wunused-function] static int input() ^~~~~ gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -o asn1p_module.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -o asn1p_oid.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -o asn1parser.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -o asn1p_value.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF ".deps/asn1p_constr.Tpo" -c -o asn1p_constr.lo asn1p_constr.c; \ then mv -f ".deps/asn1p_constr.Tpo" ".deps/asn1p_constr.Plo"; else rm -f ".deps/asn1p_constr.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -o asn1p_expr.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF ".deps/asn1p_param.Tpo" -c -o asn1p_param.lo asn1p_param.c; \ then mv -f ".deps/asn1p_param.Tpo" ".deps/asn1p_param.Plo"; else rm -f ".deps/asn1p_param.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF ".deps/asn1p_class.Tpo" -c -o asn1p_class.lo asn1p_class.c; \ then mv -f ".deps/asn1p_class.Tpo" ".deps/asn1p_class.Plo"; else rm -f ".deps/asn1p_class.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF ".deps/asn1p_ref.Tpo" -c -o asn1p_ref.lo asn1p_ref.c; \ then mv -f ".deps/asn1p_ref.Tpo" ".deps/asn1p_ref.Plo"; else rm -f ".deps/asn1p_ref.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -fPIC -DPIC -o .libs/asn1p_constr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -fPIC -DPIC -o .libs/asn1p_param.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -fPIC -DPIC -o .libs/asn1p_class.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -fPIC -DPIC -o .libs/asn1p_ref.o if test -f y.tab.h; then \ to=`echo "asn1p_y_H" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \ sed -e "/^#/!b" -e "s/Y_TAB_H/$to/g" -e "s|y\.tab\.h|asn1p_y.h|" \ y.tab.h >asn1p_y.ht; \ rm -f y.tab.h; \ if cmp -s asn1p_y.ht asn1p_y.h; then \ rm -f asn1p_y.ht ;\ else \ mv asn1p_y.ht asn1p_y.h; \ fi; \ fi if test -f y.output; then \ mv y.output asn1p_y.output; \ fi sed '/^#/ s|y\.tab\.c|asn1p_y.c|' y.tab.c >asn1p_y.ct && mv asn1p_y.ct asn1p_y.c rm -f y.tab.c if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF ".deps/asn1p_y.Tpo" -c -o asn1p_y.lo asn1p_y.c; \ then mv -f ".deps/asn1p_y.Tpo" ".deps/asn1p_y.Plo"; else rm -f ".deps/asn1p_y.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -o asn1p_constr.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -o asn1p_param.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -o asn1p_ref.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -o asn1p_class.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF .deps/asn1p_y.Tpo -c asn1p_y.c -fPIC -DPIC -o .libs/asn1p_y.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -o asn1p_l.o >/dev/null 2>&1 asn1p_y.y: In function 'asn1p_parse': asn1p_y.y:357:13: error: 'param' undeclared (first use in this function) *(void **)param = $1; ^~~~~ asn1p_y.y:357:13: note: each undeclared identifier is reported only once for each function it appears in Makefile:299: recipe for target 'asn1p_y.lo' failed make[2]: *** [asn1p_y.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory ' Makefile:302: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory ' Makefile:212: recipe for target 'all' failed make: *** [all] Error 2 Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Mon Jul 2 16:13:09 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 2 Jul 2018 16:13:09 +0000 Subject: Change in osmo-hlr[master]: debian: Avoid installing duplicate cfg file in /etc Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9828 Change subject: debian: Avoid installing duplicate cfg file in /etc ...................................................................... debian: Avoid installing duplicate cfg file in /etc Change-Id: Ieb25cc8195a2fe7f81b7a39955e0bca5d5c510eb --- M debian/osmo-hlr.install 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/28/9828/1 diff --git a/debian/osmo-hlr.install b/debian/osmo-hlr.install index 062f4fd..1e3bbc6 100644 --- a/debian/osmo-hlr.install +++ b/debian/osmo-hlr.install @@ -2,4 +2,3 @@ /usr/bin/osmo-hlr-db-tool /usr/share/doc/osmo-hlr/hlr.sql /usr/share/doc/osmo-hlr/examples/osmo-hlr.cfg -/usr/share/doc/osmo-hlr/examples/osmo-hlr.cfg /etc/osmocom/ -- To view, visit https://gerrit.osmocom.org/9828 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ieb25cc8195a2fe7f81b7a39955e0bca5d5c510eb Gerrit-Change-Number: 9828 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 16:13:10 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 2 Jul 2018 16:13:10 +0000 Subject: Change in osmo-hlr[master]: sql/Makefile: Install hlr_data.sql as example together with hlr.sql Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9829 Change subject: sql/Makefile: Install hlr_data.sql as example together with hlr.sql ...................................................................... sql/Makefile: Install hlr_data.sql as example together with hlr.sql Change-Id: Id4a12252b309f03bb393fa26612c305744e14403 --- M sql/Makefile.am 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/29/9829/1 diff --git a/sql/Makefile.am b/sql/Makefile.am index f71037b..1367cf2 100644 --- a/sql/Makefile.am +++ b/sql/Makefile.am @@ -4,4 +4,4 @@ $(NULL) docsdir = $(docdir) -docs_DATA = $(srcdir)/hlr.sql +docs_DATA = $(srcdir)/hlr.sql $(srcdir)/hlr_data.sql -- To view, visit https://gerrit.osmocom.org/9829 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id4a12252b309f03bb393fa26612c305744e14403 Gerrit-Change-Number: 9829 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 16:13:10 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 2 Jul 2018 16:13:10 +0000 Subject: Change in osmo-hlr[master]: sql/Makefile: Install sql files under doc/.../sql subdir Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9830 Change subject: sql/Makefile: Install sql files under doc/.../sql subdir ...................................................................... sql/Makefile: Install sql files under doc/.../sql subdir Change-Id: I1c9008d4692412a0cfe39d05216fc9c857cf1e8a --- M debian/osmo-hlr.install M sql/Makefile.am 2 files changed, 4 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/30/9830/1 diff --git a/debian/osmo-hlr.install b/debian/osmo-hlr.install index 1e3bbc6..825e65c 100644 --- a/debian/osmo-hlr.install +++ b/debian/osmo-hlr.install @@ -1,4 +1,5 @@ /usr/bin/osmo-hlr /usr/bin/osmo-hlr-db-tool -/usr/share/doc/osmo-hlr/hlr.sql +/usr/share/doc/osmo-hlr/sql/hlr.sql +/usr/share/doc/osmo-hlr/sql/hlr_data.sql /usr/share/doc/osmo-hlr/examples/osmo-hlr.cfg diff --git a/sql/Makefile.am b/sql/Makefile.am index 1367cf2..75be70e 100644 --- a/sql/Makefile.am +++ b/sql/Makefile.am @@ -3,5 +3,5 @@ hlr.sql \ $(NULL) -docsdir = $(docdir) -docs_DATA = $(srcdir)/hlr.sql $(srcdir)/hlr_data.sql +sqldir = $(docdir)/sql +sql_DATA = $(srcdir)/hlr.sql $(srcdir)/hlr_data.sql -- To view, visit https://gerrit.osmocom.org/9830 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I1c9008d4692412a0cfe39d05216fc9c857cf1e8a Gerrit-Change-Number: 9830 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 16:13:10 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 2 Jul 2018 16:13:10 +0000 Subject: Change in osmo-hlr[master]: sql/Makefile: Create empty /var/lib/osmocom directory at install time Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9831 Change subject: sql/Makefile: Create empty /var/lib/osmocom directory at install time ...................................................................... sql/Makefile: Create empty /var/lib/osmocom directory at install time Otherwise osmo-hlr is unable to start correctly. Change-Id: I1233fc9b3dc685561f79a34e1c32c459dc1aa685 --- M debian/osmo-hlr.install M sql/Makefile.am 2 files changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/31/9831/1 diff --git a/debian/osmo-hlr.install b/debian/osmo-hlr.install index 825e65c..7991522 100644 --- a/debian/osmo-hlr.install +++ b/debian/osmo-hlr.install @@ -3,3 +3,4 @@ /usr/share/doc/osmo-hlr/sql/hlr.sql /usr/share/doc/osmo-hlr/sql/hlr_data.sql /usr/share/doc/osmo-hlr/examples/osmo-hlr.cfg +/var/lib/osmocom diff --git a/sql/Makefile.am b/sql/Makefile.am index 75be70e..e84943b 100644 --- a/sql/Makefile.am +++ b/sql/Makefile.am @@ -5,3 +5,10 @@ sqldir = $(docdir)/sql sql_DATA = $(srcdir)/hlr.sql $(srcdir)/hlr_data.sql + + +install-data-local: + $(MKDIR_P) $(DESTDIR)$(localstatedir)/lib/osmocom + +uninstall-hook: + rm -rf $(DESTDIR)$(localstatedir)/lib/osmocom -- To view, visit https://gerrit.osmocom.org/9831 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I1233fc9b3dc685561f79a34e1c32c459dc1aa685 Gerrit-Change-Number: 9831 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 17:05:03 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 2 Jul 2018 17:05:03 +0000 Subject: Change in osmo-hlr[master]: debian: Avoid installing duplicate cfg file in /etc In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9828 ) Change subject: debian: Avoid installing duplicate cfg file in /etc ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9828 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ieb25cc8195a2fe7f81b7a39955e0bca5d5c510eb Gerrit-Change-Number: 9828 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 02 Jul 2018 17:05:03 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 17:05:26 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 2 Jul 2018 17:05:26 +0000 Subject: Change in osmo-hlr[master]: sql/Makefile: Create empty /var/lib/osmocom directory at install time In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9831 ) Change subject: sql/Makefile: Create empty /var/lib/osmocom directory at install time ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9831 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1233fc9b3dc685561f79a34e1c32c459dc1aa685 Gerrit-Change-Number: 9831 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 02 Jul 2018 17:05:26 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 17:05:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 2 Jul 2018 17:05:28 +0000 Subject: Change in osmo-hlr[master]: sql/Makefile: Install sql files under doc/.../sql subdir In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9830 ) Change subject: sql/Makefile: Install sql files under doc/.../sql subdir ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9830 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1c9008d4692412a0cfe39d05216fc9c857cf1e8a Gerrit-Change-Number: 9830 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 02 Jul 2018 17:05:28 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 17:05:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 2 Jul 2018 17:05:29 +0000 Subject: Change in osmo-hlr[master]: sql/Makefile: Install hlr_data.sql as example together with hlr.sql In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9829 ) Change subject: sql/Makefile: Install hlr_data.sql as example together with hlr.sql ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9829 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id4a12252b309f03bb393fa26612c305744e14403 Gerrit-Change-Number: 9829 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 02 Jul 2018 17:05:29 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 17:05:31 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 2 Jul 2018 17:05:31 +0000 Subject: Change in osmo-hlr[master]: debian: Avoid installing duplicate cfg file in /etc In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9828 ) Change subject: debian: Avoid installing duplicate cfg file in /etc ...................................................................... debian: Avoid installing duplicate cfg file in /etc Change-Id: Ieb25cc8195a2fe7f81b7a39955e0bca5d5c510eb --- M debian/osmo-hlr.install 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/debian/osmo-hlr.install b/debian/osmo-hlr.install index 062f4fd..1e3bbc6 100644 --- a/debian/osmo-hlr.install +++ b/debian/osmo-hlr.install @@ -2,4 +2,3 @@ /usr/bin/osmo-hlr-db-tool /usr/share/doc/osmo-hlr/hlr.sql /usr/share/doc/osmo-hlr/examples/osmo-hlr.cfg -/usr/share/doc/osmo-hlr/examples/osmo-hlr.cfg /etc/osmocom/ -- To view, visit https://gerrit.osmocom.org/9828 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ieb25cc8195a2fe7f81b7a39955e0bca5d5c510eb Gerrit-Change-Number: 9828 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 17:05:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 2 Jul 2018 17:05:32 +0000 Subject: Change in osmo-hlr[master]: sql/Makefile: Install hlr_data.sql as example together with hlr.sql In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9829 ) Change subject: sql/Makefile: Install hlr_data.sql as example together with hlr.sql ...................................................................... sql/Makefile: Install hlr_data.sql as example together with hlr.sql Change-Id: Id4a12252b309f03bb393fa26612c305744e14403 --- M sql/Makefile.am 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/sql/Makefile.am b/sql/Makefile.am index f71037b..1367cf2 100644 --- a/sql/Makefile.am +++ b/sql/Makefile.am @@ -4,4 +4,4 @@ $(NULL) docsdir = $(docdir) -docs_DATA = $(srcdir)/hlr.sql +docs_DATA = $(srcdir)/hlr.sql $(srcdir)/hlr_data.sql -- To view, visit https://gerrit.osmocom.org/9829 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Id4a12252b309f03bb393fa26612c305744e14403 Gerrit-Change-Number: 9829 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 17:05:33 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 2 Jul 2018 17:05:33 +0000 Subject: Change in osmo-hlr[master]: sql/Makefile: Install sql files under doc/.../sql subdir In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9830 ) Change subject: sql/Makefile: Install sql files under doc/.../sql subdir ...................................................................... sql/Makefile: Install sql files under doc/.../sql subdir Change-Id: I1c9008d4692412a0cfe39d05216fc9c857cf1e8a --- M debian/osmo-hlr.install M sql/Makefile.am 2 files changed, 4 insertions(+), 3 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/debian/osmo-hlr.install b/debian/osmo-hlr.install index 1e3bbc6..825e65c 100644 --- a/debian/osmo-hlr.install +++ b/debian/osmo-hlr.install @@ -1,4 +1,5 @@ /usr/bin/osmo-hlr /usr/bin/osmo-hlr-db-tool -/usr/share/doc/osmo-hlr/hlr.sql +/usr/share/doc/osmo-hlr/sql/hlr.sql +/usr/share/doc/osmo-hlr/sql/hlr_data.sql /usr/share/doc/osmo-hlr/examples/osmo-hlr.cfg diff --git a/sql/Makefile.am b/sql/Makefile.am index 1367cf2..75be70e 100644 --- a/sql/Makefile.am +++ b/sql/Makefile.am @@ -3,5 +3,5 @@ hlr.sql \ $(NULL) -docsdir = $(docdir) -docs_DATA = $(srcdir)/hlr.sql $(srcdir)/hlr_data.sql +sqldir = $(docdir)/sql +sql_DATA = $(srcdir)/hlr.sql $(srcdir)/hlr_data.sql -- To view, visit https://gerrit.osmocom.org/9830 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I1c9008d4692412a0cfe39d05216fc9c857cf1e8a Gerrit-Change-Number: 9830 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 17:05:33 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 2 Jul 2018 17:05:33 +0000 Subject: Change in osmo-hlr[master]: sql/Makefile: Create empty /var/lib/osmocom directory at install time In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9831 ) Change subject: sql/Makefile: Create empty /var/lib/osmocom directory at install time ...................................................................... sql/Makefile: Create empty /var/lib/osmocom directory at install time Otherwise osmo-hlr is unable to start correctly. Change-Id: I1233fc9b3dc685561f79a34e1c32c459dc1aa685 --- M debian/osmo-hlr.install M sql/Makefile.am 2 files changed, 8 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/debian/osmo-hlr.install b/debian/osmo-hlr.install index 825e65c..7991522 100644 --- a/debian/osmo-hlr.install +++ b/debian/osmo-hlr.install @@ -3,3 +3,4 @@ /usr/share/doc/osmo-hlr/sql/hlr.sql /usr/share/doc/osmo-hlr/sql/hlr_data.sql /usr/share/doc/osmo-hlr/examples/osmo-hlr.cfg +/var/lib/osmocom diff --git a/sql/Makefile.am b/sql/Makefile.am index 75be70e..e84943b 100644 --- a/sql/Makefile.am +++ b/sql/Makefile.am @@ -5,3 +5,10 @@ sqldir = $(docdir)/sql sql_DATA = $(srcdir)/hlr.sql $(srcdir)/hlr_data.sql + + +install-data-local: + $(MKDIR_P) $(DESTDIR)$(localstatedir)/lib/osmocom + +uninstall-hook: + rm -rf $(DESTDIR)$(localstatedir)/lib/osmocom -- To view, visit https://gerrit.osmocom.org/9831 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I1233fc9b3dc685561f79a34e1c32c459dc1aa685 Gerrit-Change-Number: 9831 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 17:05:38 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 2 Jul 2018 17:05:38 +0000 Subject: Change in osmo-mgw[master]: gitignore: Add m4 scripts from m4 subdir In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9827 ) Change subject: gitignore: Add m4 scripts from m4 subdir ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9827 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8da2a55e84bcc24cc5af00dc089630a18105c625 Gerrit-Change-Number: 9827 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 02 Jul 2018 17:05:38 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 17:05:51 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 2 Jul 2018 17:05:51 +0000 Subject: Change in osmo-mgw[master]: debian: Package installed example doc files In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9826 ) Change subject: debian: Package installed example doc files ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9826 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I71afa4799e0b484879b96567acd004755a84027f Gerrit-Change-Number: 9826 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 02 Jul 2018 17:05:51 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 17:05:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 2 Jul 2018 17:05:53 +0000 Subject: Change in osmo-mgw[master]: debian: Package installed example doc files In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9826 ) Change subject: debian: Package installed example doc files ...................................................................... debian: Package installed example doc files Change-Id: I71afa4799e0b484879b96567acd004755a84027f --- M debian/osmo-bsc-mgcp.install M debian/osmo-mgw.install 2 files changed, 2 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/debian/osmo-bsc-mgcp.install b/debian/osmo-bsc-mgcp.install index 1550437..bed2f47 100644 --- a/debian/osmo-bsc-mgcp.install +++ b/debian/osmo-bsc-mgcp.install @@ -1 +1,2 @@ usr/bin/osmo-bsc_mgcp +usr/share/doc/osmo-mgw/examples/osmo-bsc_mgcp/mgcp.cfg diff --git a/debian/osmo-mgw.install b/debian/osmo-mgw.install index 5dac968..39f7c01 100644 --- a/debian/osmo-mgw.install +++ b/debian/osmo-mgw.install @@ -1 +1,2 @@ usr/bin/osmo-mgw +usr/share/doc/osmo-mgw/examples/osmo-mgw/osmo-mgw.cfg -- To view, visit https://gerrit.osmocom.org/9826 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I71afa4799e0b484879b96567acd004755a84027f Gerrit-Change-Number: 9826 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 17:05:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 2 Jul 2018 17:05:53 +0000 Subject: Change in osmo-mgw[master]: gitignore: Add m4 scripts from m4 subdir In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9827 ) Change subject: gitignore: Add m4 scripts from m4 subdir ...................................................................... gitignore: Add m4 scripts from m4 subdir Change-Id: I8da2a55e84bcc24cc5af00dc089630a18105c625 --- M .gitignore 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/.gitignore b/.gitignore index a9e6b84..7633c73 100644 --- a/.gitignore +++ b/.gitignore @@ -38,6 +38,7 @@ stamp-h1 libtool ltmain.sh +m4/*.m4 # git-version-gen magic .tarball-version -- To view, visit https://gerrit.osmocom.org/9827 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I8da2a55e84bcc24cc5af00dc089630a18105c625 Gerrit-Change-Number: 9827 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 17:06:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 2 Jul 2018 17:06:08 +0000 Subject: Change in libosmo-sccp[master]: build: Install example cfg files In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9824 ) Change subject: build: Install example cfg files ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9824 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I93b73032b9a01a1e121ecf7c0cfcf3d5558efc7f Gerrit-Change-Number: 9824 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 02 Jul 2018 17:06:08 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 17:06:13 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 2 Jul 2018 17:06:13 +0000 Subject: Change in libosmo-sccp[master]: debian: Package installed example doc files In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9825 ) Change subject: debian: Package installed example doc files ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9825 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1d955ccf83c825d7a648a7e140bb20e10f5ddff3 Gerrit-Change-Number: 9825 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 02 Jul 2018 17:06:13 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 17:06:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 2 Jul 2018 17:06:14 +0000 Subject: Change in libosmo-sccp[master]: build: Install example cfg files In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9824 ) Change subject: build: Install example cfg files ...................................................................... build: Install example cfg files Change-Id: I93b73032b9a01a1e121ecf7c0cfcf3d5558efc7f --- M Makefile.am M configure.ac A doc/Makefile.am A doc/examples/Makefile.am 4 files changed, 10 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/Makefile.am b/Makefile.am index 1ac8e11..3f4de13 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,7 @@ AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6 AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -SUBDIRS = include src tests examples stp +SUBDIRS = include src tests examples stp doc pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libosmo-sccp.pc libosmo-mtp.pc libosmo-sigtran.pc libosmo-xua.pc diff --git a/configure.ac b/configure.ac index d2d4d02..ff9a1c4 100644 --- a/configure.ac +++ b/configure.ac @@ -120,5 +120,7 @@ tests/ss7/Makefile examples/Makefile stp/Makefile + doc/Makefile + doc/examples/Makefile Doxyfile Makefile) diff --git a/doc/Makefile.am b/doc/Makefile.am new file mode 100644 index 0000000..1d42b0a --- /dev/null +++ b/doc/Makefile.am @@ -0,0 +1,3 @@ +SUBDIRS = \ + examples \ + $(NULL) diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am new file mode 100644 index 0000000..b1a7a0f --- /dev/null +++ b/doc/examples/Makefile.am @@ -0,0 +1,4 @@ +examples_stpdir = $(docdir)/examples/osmo-stp +examples_stp_DATA = osmo-stp.cfg + +EXTRA_DIST = $(examples_stp_DATA) -- To view, visit https://gerrit.osmocom.org/9824 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I93b73032b9a01a1e121ecf7c0cfcf3d5558efc7f Gerrit-Change-Number: 9824 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 17:06:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 2 Jul 2018 17:06:15 +0000 Subject: Change in libosmo-sccp[master]: debian: Package installed example doc files In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9825 ) Change subject: debian: Package installed example doc files ...................................................................... debian: Package installed example doc files Change-Id: I1d955ccf83c825d7a648a7e140bb20e10f5ddff3 --- M debian/osmo-stp.install 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/debian/osmo-stp.install b/debian/osmo-stp.install index 74ce048..b2f8077 100644 --- a/debian/osmo-stp.install +++ b/debian/osmo-stp.install @@ -1 +1,2 @@ /usr/bin/osmo-stp +/usr/share/doc/libosmo-sccp/examples/osmo-stp/osmo-stp.cfg -- To view, visit https://gerrit.osmocom.org/9825 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I1d955ccf83c825d7a648a7e140bb20e10f5ddff3 Gerrit-Change-Number: 9825 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 17:06:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 2 Jul 2018 17:06:36 +0000 Subject: Change in osmo-bts[master]: doc: Move calypsoBTS example into trx subdir In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9819 ) Change subject: doc: Move calypsoBTS example into trx subdir ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9819 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie2b968c478f1cf4d3e4cb36e4fb743e413cc93f0 Gerrit-Change-Number: 9819 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 02 Jul 2018 17:06:36 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 17:06:50 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 2 Jul 2018 17:06:50 +0000 Subject: Change in osmo-bts[master]: build: Install example cfg files In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9820 ) Change subject: build: Install example cfg files ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9820 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7525d5a3e1a3c83a54f919cce9096303dd506f35 Gerrit-Change-Number: 9820 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 02 Jul 2018 17:06:50 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 17:06:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 2 Jul 2018 17:06:52 +0000 Subject: Change in osmo-bts[master]: debian: Package installed example doc files In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9821 ) Change subject: debian: Package installed example doc files ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9821 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9449add4905ecc724c0aa9c8c2d56c6ed4138844 Gerrit-Change-Number: 9821 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 02 Jul 2018 17:06:52 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 17:06:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 2 Jul 2018 17:06:54 +0000 Subject: Change in osmo-bts[master]: doc: Move calypsoBTS example into trx subdir In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9819 ) Change subject: doc: Move calypsoBTS example into trx subdir ...................................................................... doc: Move calypsoBTS example into trx subdir CalypsoBTS is a regular osmo-bts-trx with specific config options, so let's move the cfg file to correct place. This also makes it easier to install and package example files later on. Change-Id: Ie2b968c478f1cf4d3e4cb36e4fb743e413cc93f0 --- R doc/examples/trx/osmo-bts-trx-calypso.cfg 1 file changed, 0 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/doc/examples/calypso/osmo-bts.cfg b/doc/examples/trx/osmo-bts-trx-calypso.cfg similarity index 100% rename from doc/examples/calypso/osmo-bts.cfg rename to doc/examples/trx/osmo-bts-trx-calypso.cfg -- To view, visit https://gerrit.osmocom.org/9819 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ie2b968c478f1cf4d3e4cb36e4fb743e413cc93f0 Gerrit-Change-Number: 9819 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 17:06:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 2 Jul 2018 17:06:54 +0000 Subject: Change in osmo-bts[master]: build: Install example cfg files In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9820 ) Change subject: build: Install example cfg files ...................................................................... build: Install example cfg files Files from doc/examples/foo/bar.cfg are install to /usr/share/doc/osmo-bts/examples/osmo-bts-foo/bar.cfg. Change-Id: I7525d5a3e1a3c83a54f919cce9096303dd506f35 --- M Makefile.am M configure.ac A doc/Makefile.am A doc/examples/Makefile.am 4 files changed, 44 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/Makefile.am b/Makefile.am index dc42574..10ff2d2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6 -SUBDIRS = include src tests +SUBDIRS = include src tests doc # package the contrib and doc diff --git a/configure.ac b/configure.ac index b364e4d..d4572bc 100644 --- a/configure.ac +++ b/configure.ac @@ -306,4 +306,6 @@ tests/tx_power/Makefile tests/power/Makefile tests/meas/Makefile + doc/Makefile + doc/examples/Makefile Makefile) diff --git a/doc/Makefile.am b/doc/Makefile.am new file mode 100644 index 0000000..1d42b0a --- /dev/null +++ b/doc/Makefile.am @@ -0,0 +1,3 @@ +SUBDIRS = \ + examples \ + $(NULL) diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am new file mode 100644 index 0000000..e4be5fc --- /dev/null +++ b/doc/examples/Makefile.am @@ -0,0 +1,38 @@ + +doc_virtualdir = $(docdir)/examples/osmo-bts-virtual +doc_virtual_DATA = \ + virtual/osmobts-virtual.cfg \ + virtual/openbsc-virtual.cfg +EXTRA_DIST = $(doc_virtual_DATA) + +if ENABLE_SYSMOBTS +doc_sysmodir = $(docdir)/examples/osmo-bts-sysmo +doc_sysmo_DATA = \ + sysmo/osmo-bts.cfg \ + sysmo/sysmobts-mgr.cfg +EXTRA_DIST += $(doc_sysmo_DATA) +endif + +if ENABLE_TRX +doc_trxdir = $(docdir)/examples/osmo-bts-trx +doc_trx_DATA = \ + trx/osmo-bts.cfg \ + trx/osmo-bts-trx-calypso.cfg +EXTRA_DIST += $(doc_trx_DATA) +endif + +if ENABLE_OCTPHY +doc_octphydir = $(docdir)/examples/osmo-bts-octphy +doc_octphy_DATA = \ + octphy/osmo-bts-trx2dsp1.cfg \ + octphy/osmo-bts.cfg +EXTRA_DIST += $(doc_octphy_DATA) +endif + +if ENABLE_LC15BTS +doc_lc15dir = $(docdir)/examples/osmo-bts-lc15 +doc_lc15_DATA = \ + litecell15/osmo-bts.cfg \ + litecell15/lc15bts-mgr.cfg +EXTRA_DIST += $(doc_lc15_DATA) +endif -- To view, visit https://gerrit.osmocom.org/9820 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I7525d5a3e1a3c83a54f919cce9096303dd506f35 Gerrit-Change-Number: 9820 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 17:06:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 2 Jul 2018 17:06:54 +0000 Subject: Change in osmo-bts[master]: debian: Package installed example doc files In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9821 ) Change subject: debian: Package installed example doc files ...................................................................... debian: Package installed example doc files Change-Id: I9449add4905ecc724c0aa9c8c2d56c6ed4138844 --- M debian/osmo-bts-trx.install M debian/osmo-bts-virtual.install 2 files changed, 4 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/debian/osmo-bts-trx.install b/debian/osmo-bts-trx.install index 92d524c..e821cb4 100644 --- a/debian/osmo-bts-trx.install +++ b/debian/osmo-bts-trx.install @@ -1 +1,3 @@ usr/bin/osmo-bts-trx +usr/share/doc/osmo-bts/examples/osmo-bts-trx/osmo-bts.cfg +usr/share/doc/osmo-bts/examples/osmo-bts-trx/osmo-bts-trx-calypso.cfg diff --git a/debian/osmo-bts-virtual.install b/debian/osmo-bts-virtual.install index 07adbfd..3815d7c 100644 --- a/debian/osmo-bts-virtual.install +++ b/debian/osmo-bts-virtual.install @@ -1,2 +1,4 @@ usr/bin/osmo-bts-virtual usr/bin/osmo-bts-omldummy +usr/share/doc/osmo-bts/examples/osmo-bts-virtual/osmobts-virtual.cfg +usr/share/doc/osmo-bts/examples/osmo-bts-virtual/openbsc-virtual.cfg -- To view, visit https://gerrit.osmocom.org/9821 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I9449add4905ecc724c0aa9c8c2d56c6ed4138844 Gerrit-Change-Number: 9821 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 17:07:42 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 2 Jul 2018 17:07:42 +0000 Subject: Change in libosmocore[master]: Don't enforce Python 2 for utilities In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9818 ) Change subject: Don't enforce Python 2 for utilities ...................................................................... Don't enforce Python 2 for utilities The conv_gen.py utility was tested against both Python 2 and 3, so there is no need to enforce Python 2. Also, having: #!/usr/local/bin/python{2|3} is a bad idea, because Python may be installed in a different location. Change-Id: I6007d481047b584db13d6eda70fb99f11f9ddaa1 --- M include/Makefile.am M src/gsm/Makefile.am M tests/Makefile.am M utils/conv_codes_gsm.py M utils/conv_gen.py 5 files changed, 6 insertions(+), 5 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/include/Makefile.am b/include/Makefile.am index 27a4090..38ba14c 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -162,7 +162,7 @@ $(AM_V_GEN)sed -e's/XX/$*/g' $< > $@ osmocom/gsm/gsm0503.h: $(top_srcdir)/utils/conv_gen.py $(top_srcdir)/utils/conv_codes_gsm.py - $(AM_V_GEN)python2 $(top_srcdir)/utils/conv_gen.py gen_header gsm \ + $(AM_V_GEN)python $(top_srcdir)/utils/conv_gen.py gen_header gsm \ --target-path $(builddir)/osmocom/gsm CLEANFILES = osmocom/gsm/gsm0503.h diff --git a/src/gsm/Makefile.am b/src/gsm/Makefile.am index 0439ce6..5387e3a 100644 --- a/src/gsm/Makefile.am +++ b/src/gsm/Makefile.am @@ -47,6 +47,6 @@ # Convolutional codes generation gsm0503_conv.c: $(top_srcdir)/utils/conv_gen.py $(top_srcdir)/utils/conv_codes_gsm.py - $(AM_V_GEN)python2 $(top_srcdir)/utils/conv_gen.py gen_codes gsm + $(AM_V_GEN)python $(top_srcdir)/utils/conv_gen.py gen_codes gsm CLEANFILES = gsm0503_conv.c diff --git a/tests/Makefile.am b/tests/Makefile.am index 70b5cb8..db4e520 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -280,5 +280,5 @@ mv $@.tmp $@ conv/gsm0503_test_vectors.c: $(top_srcdir)/utils/conv_gen.py $(top_srcdir)/utils/conv_codes_gsm.py - $(AM_V_GEN)python2 $(top_srcdir)/utils/conv_gen.py gen_vectors gsm \ + $(AM_V_GEN)python $(top_srcdir)/utils/conv_gen.py gen_vectors gsm \ --target-path $(builddir)/conv diff --git a/utils/conv_codes_gsm.py b/utils/conv_codes_gsm.py index eeed4fd..ec77660 100644 --- a/utils/conv_codes_gsm.py +++ b/utils/conv_codes_gsm.py @@ -1,5 +1,6 @@ -#!/usr/bin/python2 +#!/usr/bin/env python # -*- coding: utf-8 -*- + from conv_gen import ConvolutionalCode from conv_gen import poly diff --git a/utils/conv_gen.py b/utils/conv_gen.py index 6b6b267..06283d8 100644 --- a/utils/conv_gen.py +++ b/utils/conv_gen.py @@ -1,4 +1,4 @@ -#!/usr/bin/python2 +#!/usr/bin/env python mod_license = """ /* -- To view, visit https://gerrit.osmocom.org/9818 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I6007d481047b584db13d6eda70fb99f11f9ddaa1 Gerrit-Change-Number: 9818 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 17:08:03 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 2 Jul 2018 17:08:03 +0000 Subject: Change in osmo-ci[master]: ansible: gsm-tester: Assign IP addr in different range to nanobts In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9742 ) Change subject: ansible: gsm-tester: Assign IP addr in different range to nanobts ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9742 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9eadb0329a670ce6c2254520d9c86bfbdc898b3a Gerrit-Change-Number: 9742 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Mon, 02 Jul 2018 17:08:03 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 17:08:05 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 2 Jul 2018 17:08:05 +0000 Subject: Change in osmo-ci[master]: ansible: gsm-tester: Assign IP addr in different range to nanobts In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9742 ) Change subject: ansible: gsm-tester: Assign IP addr in different range to nanobts ...................................................................... ansible: gsm-tester: Assign IP addr in different range to nanobts We currently use range around 10.42.42.1-10 for local dynamically assigned IP addresses (osmo-msc, osmo-bsc, etc.). The range 10.42.42.50-60 for local statically assigned IP addresses (to run osmo-bts-trx sysmocell-5k for instance, where the other end is cofigured with a static dst addr). For remote addresses, we use IPs in the range 10.42.42.110-120. Let's create a new range in 10.42.42.120-130 for remote addressess assigned by udhcpd server. nanobts assigned assdresses are moved to the latest group to differentiate them easily and show that they are not IP addr used locally. Change-Id: I9eadb0329a670ce6c2254520d9c86bfbdc898b3a --- M ansible/host_vars/osmo-gsm-tester-prod.yml M ansible/host_vars/osmo-gsm-tester-rnd.yml 2 files changed, 3 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved lynxis lazus: Looks good to me, but someone else must approve Pau Espin Pedrol: Verified diff --git a/ansible/host_vars/osmo-gsm-tester-prod.yml b/ansible/host_vars/osmo-gsm-tester-prod.yml index 2f9068e..ee9edea 100644 --- a/ansible/host_vars/osmo-gsm-tester-prod.yml +++ b/ansible/host_vars/osmo-gsm-tester-prod.yml @@ -1,9 +1,9 @@ --- udhcpd_static_leases: - mac: 00:02:95:00:52:ae - ip: 10.42.42.53 + ip: 10.42.42.120 - mac: 00:02:95:00:5a:a4 - ip: 10.42.42.54 + ip: 10.42.42.121 # how many modems are connected via a quadmodem? gsm_modems: 3 diff --git a/ansible/host_vars/osmo-gsm-tester-rnd.yml b/ansible/host_vars/osmo-gsm-tester-rnd.yml index 2e9b0b7..a9c7a24 100644 --- a/ansible/host_vars/osmo-gsm-tester-rnd.yml +++ b/ansible/host_vars/osmo-gsm-tester-rnd.yml @@ -1,7 +1,7 @@ --- udhcpd_static_leases: - mac: 00:02:95:00:41:b3 - ip: 10.42.42.53 + ip: 10.42.42.120 # how many modems are connected via a quadmodem? gsm_modems: 4 -- To view, visit https://gerrit.osmocom.org/9742 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I9eadb0329a670ce6c2254520d9c86bfbdc898b3a Gerrit-Change-Number: 9742 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 17:08:06 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 2 Jul 2018 17:08:06 +0000 Subject: Change in osmo-ci[master]: ansible: gsm-tester: Add IP addr for osmo-bts-octphy to bind to In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9743 ) Change subject: ansible: gsm-tester: Add IP addr for osmo-bts-octphy to bind to ...................................................................... ansible: gsm-tester: Add IP addr for osmo-bts-octphy to bind to Change-Id: I708960790e330a24c653f162b767d3b3ca4d145d --- M ansible/roles/gsm-tester-network/templates/interface.j2 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: lynxis lazus: Looks good to me, approved Pau Espin Pedrol: Verified diff --git a/ansible/roles/gsm-tester-network/templates/interface.j2 b/ansible/roles/gsm-tester-network/templates/interface.j2 index 9803358..a4c86a4 100644 --- a/ansible/roles/gsm-tester-network/templates/interface.j2 +++ b/ansible/roles/gsm-tester-network/templates/interface.j2 @@ -54,3 +54,7 @@ address 10.42.42.51 netmask 255.255.255.0 +auto {{ bts_interface }}:10 +iface {{ bts_interface }}:10 inet static + address 10.42.42.52 + netmask 255.255.255.0 -- To view, visit https://gerrit.osmocom.org/9743 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I708960790e330a24c653f162b767d3b3ca4d145d Gerrit-Change-Number: 9743 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 17:08:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 2 Jul 2018 17:08:20 +0000 Subject: Change in osmo-gsm-manuals[master]: INSTALL.txt: mention xmllint vs. SSL quirk and workaround In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9816 ) Change subject: INSTALL.txt: mention xmllint vs. SSL quirk and workaround ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9816 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5e4389878ea3f23b826526de047f9e647c644888 Gerrit-Change-Number: 9816 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 02 Jul 2018 17:08:20 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 17:08:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 2 Jul 2018 17:08:28 +0000 Subject: Change in osmo-gsm-manuals[master]: hlr: clarify that aud_3g also applies to 2G In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9817 ) Change subject: hlr: clarify that aud_3g also applies to 2G ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9817 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2ae03625ccc1364f953db0611e9a29d935dab803 Gerrit-Change-Number: 9817 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 02 Jul 2018 17:08:28 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 17:08:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 2 Jul 2018 17:08:29 +0000 Subject: Change in osmo-gsm-manuals[master]: INSTALL.txt: mention xmllint vs. SSL quirk and workaround In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9816 ) Change subject: INSTALL.txt: mention xmllint vs. SSL quirk and workaround ...................................................................... INSTALL.txt: mention xmllint vs. SSL quirk and workaround Related: OS#3072 Change-Id: I5e4389878ea3f23b826526de047f9e647c644888 --- M INSTALL.txt 1 file changed, 5 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/INSTALL.txt b/INSTALL.txt index d250750..9c3ee7b 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -6,6 +6,7 @@ asciidoc-dblatex \ xsltproc \ dblatex \ + docbook5-xml \ mscgen \ graphviz \ python-pychart \ @@ -39,3 +40,7 @@ osmo_interact_vty.py -r "osmo-msc -c ~/src/osmo-msc/doc/examples/osmo-msc/osmo-msc.cfg" \ -X -p 4254 > OsmoMSC/vty/msc_vty_reference.xml + +Note that docbook.org since recently are providing DTDs only on HTTPS URLs, +while xmllint is incapable of SSL. Hence it is necessary to locally install the +docbook DTDs. (On Debian, these are included in the docbook5-xml package.) -- To view, visit https://gerrit.osmocom.org/9816 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I5e4389878ea3f23b826526de047f9e647c644888 Gerrit-Change-Number: 9816 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 17:08:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 2 Jul 2018 17:08:29 +0000 Subject: Change in osmo-gsm-manuals[master]: hlr: clarify that aud_3g also applies to 2G In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9817 ) Change subject: hlr: clarify that aud_3g also applies to 2G ...................................................................... hlr: clarify that aud_3g also applies to 2G (and tweak wording) Related: OS#3091 Change-Id: I2ae03625ccc1364f953db0611e9a29d935dab803 --- M OsmoHLR/chapters/subscribers.adoc 1 file changed, 17 insertions(+), 7 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/OsmoHLR/chapters/subscribers.adoc b/OsmoHLR/chapters/subscribers.adoc index b2024d2..bb57d24 100644 --- a/OsmoHLR/chapters/subscribers.adoc +++ b/OsmoHLR/chapters/subscribers.adoc @@ -3,15 +3,16 @@ Subscribers are kept in a local SQLite database file and can be managed via VTY and CTRL interfaces. -See this section for some examples, and also refer to the OsmoHLR VTY reference +This section provides some examples; also refer to the OsmoHLR VTY reference manual <> as well as the Control interface described in <>. === Example: Add/Update/Delete Subscriber via VTY -The following telnet VTY session adds a subscriber complete with 2G and 3G -authentication tokens, and finally removes the subscriber again; it assumes -that osmo-hlr is running and listening for telnet VTY connections on localhost: +The following telnet VTY session adds a subscriber complete with GSM (2G) and +UMTS (3G and 2G) authentication tokens, and finally removes the subscriber +again; it assumes that osmo-hlr is running and listening for telnet VTY +connections on localhost: ---- $ telnet localhost 4258 @@ -23,7 +24,16 @@ The following parameters are managed for each subscriber of the HLR, modelled roughly after 3GPP TS 23.008, version 13.3.0; note that not all of these -parameters are necessarily in active use: +parameters are necessarily in active use. + +The `aud3g` table also applies to 2G networks: it provides UMTS AKA tokens for +Milenage authentication, which is available both on 3G and 2G networks. On 2G, +when both MS and network are R99 capable (like OsmoMSC and OsmoSGSN are), the +full UMTS AKA with Milenage keys from `aud_3g`, using AUTN and extended RES +tokens, is available. With pre-R99 MS or network configurations, the GSM AKA +compatible variant of Milenage, still using the Milenage keys from `aud_3g` but +transceiving only RAND and SRES, may be applicable. (See 3GPP TS 33.102, chapter +6.8.1, Authentication and key agreement of UMTS subscribers.) .OsmoHLR's subscriber parameters [options="header",width="100%",cols="20%,20%,60%"] @@ -32,9 +42,9 @@ |imsi|901700000014701|identity of the SIM/USIM, 3GPP TS 23.008 chapter 2.1.1.1 |msisdn|2342123|number to dial to reach this subscriber (multiple MSISDNs can be stored per subscriber), 3GPP TS 23.008 chapter 2.1.2 |imeisv|4234234234234275|identity of the mobile device and software version, 3GPP TS 23.008 chapter 2.2.3 -|aud2g.algo|comp128v3|Authentication algorithm ID for 2G, corresponds to enum osmo_auth_algo +|aud2g.algo|comp128v3|Authentication algorithm ID for GSM AKA, corresponds to enum osmo_auth_algo |aud2g.ki||Subscriber's secret key (128bit) -|aud3g.algo|milenage|Authentication algorithm ID for 3G and UMTS AKA, corresponds to enum osmo_auth_algo +|aud3g.algo|milenage|Authentication algorithm ID for UMTS AKA (applies to both 3G and 2G networks), corresponds to enum osmo_auth_algo |aud3g.k|(32 hexadecimal digits)|Subscriber's secret key (128bit) |aud3g.op|(32 hexadecimal digits)|Operator's secret key (128bit) |aud3g.opc|(32 hexadecimal digits)|Secret key derived from OP and K (128bit), alternative to using OP which does not disclose OP to subscribers -- To view, visit https://gerrit.osmocom.org/9817 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I2ae03625ccc1364f953db0611e9a29d935dab803 Gerrit-Change-Number: 9817 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 17:33:02 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 2 Jul 2018 17:33:02 +0000 Subject: Change in osmo-bts[master]: debian: Make osmo-bts-* packages conflict with old osmo-bts package Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9832 Change subject: debian: Make osmo-bts-* packages conflict with old osmo-bts package ...................................................................... debian: Make osmo-bts-* packages conflict with old osmo-bts package Avoid 'osmo-bts' in parallel to the other osmo-bts components from the OBS generating confusion and not starting binaries (lib conflicts). Related: OS#3364 Change-Id: Ie8e8d604afeac55530162a69c4dc94e8048ac78d --- M debian/control 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/32/9832/1 diff --git a/debian/control b/debian/control index 4835b57..437335f 100644 --- a/debian/control +++ b/debian/control @@ -19,6 +19,7 @@ Package: osmo-bts-trx Architecture: any +Conflicts: osmo-bts Depends: ${shlibs:Depends}, ${misc:Depends} Description: osmo-bts-trx GSM BTS with osmo-trx osmo-bts-trx to be used with the osmo-trx application @@ -33,6 +34,7 @@ Package: osmo-bts-virtual Architecture: any +Conflicts: osmo-bts Depends: ${shlibs:Depends}, ${misc:Depends} Description: Virtual Osmocom GSM BTS (no RF hardware; GSMTAP/UDP) This version of OsmoBTS doesn't use actual GSM PHY/Hardware/RF, but -- To view, visit https://gerrit.osmocom.org/9832 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ie8e8d604afeac55530162a69c4dc94e8048ac78d Gerrit-Change-Number: 9832 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 17:33:03 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 2 Jul 2018 17:33:03 +0000 Subject: Change in osmo-bts[master]: debian: Create dbg package for osm-bts-virtual Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9833 Change subject: debian: Create dbg package for osm-bts-virtual ...................................................................... debian: Create dbg package for osm-bts-virtual Previously all debug symbols were being stored in osmo-bts-trx-dbg. Change-Id: I9524234cb47c9d5d8e5dc2148c21746e1cd0f10c --- M debian/control M debian/rules 2 files changed, 10 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/33/9833/1 diff --git a/debian/control b/debian/control index 437335f..0377d9f 100644 --- a/debian/control +++ b/debian/control @@ -40,3 +40,11 @@ This version of OsmoBTS doesn't use actual GSM PHY/Hardware/RF, but utilizes GSMTAP-over-UDP frames for the Um interface. This is useful in fully virtualized setups e.g. in combination with OsmocomBB virt_phy. + +Package: osmo-bts-virtual-dbg +Architecture: any +Section: debug +Priority: extra +Depends: osmo-bts-virtual (= ${binary:Version}), ${misc:Depends} +Description: Debug symbols for the osmo-bts-virtual + Make debugging possible diff --git a/debian/rules b/debian/rules index 80ba0b2..32d9342 100755 --- a/debian/rules +++ b/debian/rules @@ -12,7 +12,8 @@ dh $@ --with=systemd --with autoreconf --fail-missing override_dh_strip: - dh_strip --dbg-package=osmo-bts-trx-dbg + dh_strip --package=osmo-bts-virtual --dbg-package=osmo-bts-virtual-dbg + dh_strip --package=osmo-bts-trx --dbg-package=osmo-bts-trx-dbg override_dh_autoreconf: echo $(VERSION) > .tarball-version @@ -29,4 +30,3 @@ # Print test results in case of a failure override_dh_auto_test: dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false) - -- To view, visit https://gerrit.osmocom.org/9833 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I9524234cb47c9d5d8e5dc2148c21746e1cd0f10c Gerrit-Change-Number: 9833 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 18:21:51 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 2 Jul 2018 18:21:51 +0000 Subject: Change in osmo-bts[master]: Remove unneeded direct libortp dependency In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/9822 ) Change subject: Remove unneeded direct libortp dependency ...................................................................... Patch Set 4: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/9822 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I96a9b5f0678331dcf66c007928866a124d8700de Gerrit-Change-Number: 9822 Gerrit-PatchSet: 4 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 02 Jul 2018 18:21:51 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 2 19:24:56 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Mon, 2 Jul 2018 19:24:56 +0000 Subject: Change in osmo-ci[master]: Restrict where the parent build runs for osmo-gsm-manuals In-Reply-To: References: Message-ID: lynxis lazus has posted comments on this change. ( https://gerrit.osmocom.org/9770 ) Change subject: Restrict where the parent build runs for osmo-gsm-manuals ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9770 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I23cf2c98f02278a5deb9c4ae8d13438b76538287 Gerrit-Change-Number: 9770 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Mon, 02 Jul 2018 19:24:56 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 05:58:30 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 05:58:30 +0000 Subject: Change in osmo-bts[master]: Remove unneeded direct libortp dependency In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9822 ) Change subject: Remove unneeded direct libortp dependency ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9822 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I96a9b5f0678331dcf66c007928866a124d8700de Gerrit-Change-Number: 9822 Gerrit-PatchSet: 4 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 03 Jul 2018 05:58:30 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 05:58:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 05:58:52 +0000 Subject: Change in osmo-bts[master]: debian: Make osmo-bts-* packages conflict with old osmo-bts package In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9832 ) Change subject: debian: Make osmo-bts-* packages conflict with old osmo-bts package ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9832 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie8e8d604afeac55530162a69c4dc94e8048ac78d Gerrit-Change-Number: 9832 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 03 Jul 2018 05:58:52 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 05:58:56 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 05:58:56 +0000 Subject: Change in osmo-bts[master]: Remove unneeded direct libortp dependency In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9822 ) Change subject: Remove unneeded direct libortp dependency ...................................................................... Remove unneeded direct libortp dependency All code in osmo-bts goes through APIs in libosmotrau (osmo_ortp.h), hence direct dependency is not needed. Fixes OBS warnings: dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/osmo-bts-trx/usr/bin/osmo-bts-trx was not linked against libortp.so.9 (it uses none of the library's symbols) dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/osmo-bts-virtual/usr/bin/osmo-bts-omldummy debian/osmo-bts-virtual/usr/bin/osmo-bts-virtual were not linked against libortp.so.9 (they use none of the library's symbols) Change-Id: I96a9b5f0678331dcf66c007928866a124d8700de --- M configure.ac M debian/control M src/osmo-bts-litecell15/Makefile.am M src/osmo-bts-litecell15/tch.c M src/osmo-bts-octphy/Makefile.am M src/osmo-bts-omldummy/Makefile.am M src/osmo-bts-sysmo/Makefile.am M src/osmo-bts-sysmo/tch.c M src/osmo-bts-trx/Makefile.am M src/osmo-bts-virtual/Makefile.am M tests/agch/Makefile.am M tests/cipher/Makefile.am M tests/paging/Makefile.am M tests/power/Makefile.am M tests/sysmobts/Makefile.am 15 files changed, 23 insertions(+), 29 deletions(-) Approvals: Jenkins Builder: Verified Vadim Yanitskiy: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/configure.ac b/configure.ac index d4572bc..aad55db 100644 --- a/configure.ac +++ b/configure.ac @@ -70,7 +70,6 @@ PKG_CHECK_MODULES(LIBOSMOCODING, libosmocoding >= 0.11.0) PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.5.0) PKG_CHECK_MODULES(LIBOSMOTRAU, libosmotrau >= 0.5.0) -PKG_CHECK_MODULES(ORTP, ortp) AC_MSG_CHECKING([whether to enable support for sysmobts calibration tool]) AC_ARG_ENABLE(sysmobts-calib, diff --git a/debian/control b/debian/control index 0ac70dd..4835b57 100644 --- a/debian/control +++ b/debian/control @@ -11,7 +11,6 @@ libosmocore-dev, libosmo-abis-dev, libgps-dev, - libortp-dev, txt2man Standards-Version: 3.9.8 Vcs-Browser: http://git.osmocom.org/osmo-bts/ diff --git a/src/osmo-bts-litecell15/Makefile.am b/src/osmo-bts-litecell15/Makefile.am index f30320f..0cc124a 100644 --- a/src/osmo-bts-litecell15/Makefile.am +++ b/src/osmo-bts-litecell15/Makefile.am @@ -1,8 +1,8 @@ -AUTOMAKE_OPTIONS = subdir-objects +AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include $(LITECELL15_INCDIR) -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) $(LIBSYSTEMD_CFLAGS) -COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(LIBSYSTEMD_CFLAGS) +COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) AM_CFLAGS += -DENABLE_LC15BTS diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index 0becfc4..5eae753 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -36,7 +36,6 @@ #include #include #include -#include #include #include diff --git a/src/osmo-bts-octphy/Makefile.am b/src/osmo-bts-octphy/Makefile.am index ccdafaa..43d9cd7 100644 --- a/src/osmo-bts-octphy/Makefile.am +++ b/src/osmo-bts-octphy/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include $(OCTSDR2G_INCDIR) -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(ORTP_CFLAGS) -COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) +COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) EXTRA_DIST = l1_if.h l1_oml.h l1_utils.h octphy_hw_api.h octpkt.h @@ -10,4 +10,3 @@ osmo_bts_octphy_SOURCES = $(COMMON_SOURCES) osmo_bts_octphy_LDADD = $(top_builddir)/src/common/libbts.a $(COMMON_LDADD) - diff --git a/src/osmo-bts-omldummy/Makefile.am b/src/osmo-bts-omldummy/Makefile.am index 4ff28f0..5a4ce7c 100644 --- a/src/osmo-bts-omldummy/Makefile.am +++ b/src/osmo-bts-omldummy/Makefile.am @@ -1,6 +1,6 @@ -AM_CFLAGS = -Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) +AM_CFLAGS = -Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -Iinclude -COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) -ldl +COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) -ldl bin_PROGRAMS = osmo-bts-omldummy diff --git a/src/osmo-bts-sysmo/Makefile.am b/src/osmo-bts-sysmo/Makefile.am index 8e03b77..4901ea3 100644 --- a/src/osmo-bts-sysmo/Makefile.am +++ b/src/osmo-bts-sysmo/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include $(SYSMOBTS_INCDIR) -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) -COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) +COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) EXTRA_DIST = misc/sysmobts_mgr.h misc/sysmobts_misc.h misc/sysmobts_par.h \ misc/sysmobts_eeprom.h misc/sysmobts_nl.h femtobts.h hw_misc.h \ diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index 4e6e246..54e7313 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include diff --git a/src/osmo-bts-trx/Makefile.am b/src/osmo-bts-trx/Makefile.am index c241232..1922240 100644 --- a/src/osmo-bts-trx/Makefile.am +++ b/src/osmo-bts-trx/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -AM_CFLAGS = -Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOCODING_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(ORTP_CFLAGS) -LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOCODING_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) -ldl +AM_CFLAGS = -Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOCODING_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOCODING_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) -ldl EXTRA_DIST = trx_if.h l1_if.h loops.h @@ -8,4 +8,3 @@ osmo_bts_trx_SOURCES = main.c trx_if.c l1_if.c scheduler_trx.c trx_vty.c loops.c osmo_bts_trx_LDADD = $(top_builddir)/src/common/libl1sched.a $(top_builddir)/src/common/libbts.a $(LDADD) - diff --git a/src/osmo-bts-virtual/Makefile.am b/src/osmo-bts-virtual/Makefile.am index eeb76aa..070efed 100644 --- a/src/osmo-bts-virtual/Makefile.am +++ b/src/osmo-bts-virtual/Makefile.am @@ -1,6 +1,6 @@ -AM_CFLAGS = -Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) +AM_CFLAGS = -Wall -fno-strict-aliasing $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -Iinclude -COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) -ldl +COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) -ldl noinst_HEADERS = l1_if.h osmo_mcast_sock.h virtual_um.h diff --git a/tests/agch/Makefile.am b/tests/agch/Makefile.am index 1357ea2..0c4fce4 100644 --- a/tests/agch/Makefile.am +++ b/tests/agch/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(ORTP_CFLAGS) -LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCODEC_LIBS) $(ORTP_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOCODEC_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCODEC_LIBS) noinst_PROGRAMS = agch_test EXTRA_DIST = agch_test.ok diff --git a/tests/cipher/Makefile.am b/tests/cipher/Makefile.am index a671550..3c23718 100644 --- a/tests/cipher/Makefile.am +++ b/tests/cipher/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(ORTP_CFLAGS) -LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCODEC_LIBS) $(ORTP_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOCODEC_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCODEC_LIBS) noinst_PROGRAMS = cipher_test EXTRA_DIST = cipher_test.ok diff --git a/tests/paging/Makefile.am b/tests/paging/Makefile.am index 98c6673..74d9826 100644 --- a/tests/paging/Makefile.am +++ b/tests/paging/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(ORTP_CFLAGS) -LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCODEC_LIBS) $(ORTP_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOCODEC_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCODEC_LIBS) noinst_PROGRAMS = paging_test EXTRA_DIST = paging_test.ok diff --git a/tests/power/Makefile.am b/tests/power/Makefile.am index 3cb8d15..ac45f23 100644 --- a/tests/power/Makefile.am +++ b/tests/power/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) -LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(ORTP_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) noinst_PROGRAMS = power_test EXTRA_DIST = power_test.ok diff --git a/tests/sysmobts/Makefile.am b/tests/sysmobts/Makefile.am index 5f27116..0829ca5 100644 --- a/tests/sysmobts/Makefile.am +++ b/tests/sysmobts/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo $(SYSMOBTS_INCDIR) -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) -LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(ORTP_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) noinst_PROGRAMS = sysmobts_test EXTRA_DIST = sysmobts_test.ok -- To view, visit https://gerrit.osmocom.org/9822 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I96a9b5f0678331dcf66c007928866a124d8700de Gerrit-Change-Number: 9822 Gerrit-PatchSet: 4 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 05:58:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 05:58:57 +0000 Subject: Change in osmo-bts[master]: debian: Make osmo-bts-* packages conflict with old osmo-bts package In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9832 ) Change subject: debian: Make osmo-bts-* packages conflict with old osmo-bts package ...................................................................... debian: Make osmo-bts-* packages conflict with old osmo-bts package Avoid 'osmo-bts' in parallel to the other osmo-bts components from the OBS generating confusion and not starting binaries (lib conflicts). Related: OS#3364 Change-Id: Ie8e8d604afeac55530162a69c4dc94e8048ac78d --- M debian/control 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/debian/control b/debian/control index 4835b57..437335f 100644 --- a/debian/control +++ b/debian/control @@ -19,6 +19,7 @@ Package: osmo-bts-trx Architecture: any +Conflicts: osmo-bts Depends: ${shlibs:Depends}, ${misc:Depends} Description: osmo-bts-trx GSM BTS with osmo-trx osmo-bts-trx to be used with the osmo-trx application @@ -33,6 +34,7 @@ Package: osmo-bts-virtual Architecture: any +Conflicts: osmo-bts Depends: ${shlibs:Depends}, ${misc:Depends} Description: Virtual Osmocom GSM BTS (no RF hardware; GSMTAP/UDP) This version of OsmoBTS doesn't use actual GSM PHY/Hardware/RF, but -- To view, visit https://gerrit.osmocom.org/9832 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ie8e8d604afeac55530162a69c4dc94e8048ac78d Gerrit-Change-Number: 9832 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 05:59:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 05:59:15 +0000 Subject: Change in osmo-bts[master]: debian: Create dbg package for osm-bts-virtual In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9833 ) Change subject: debian: Create dbg package for osm-bts-virtual ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9833 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9524234cb47c9d5d8e5dc2148c21746e1cd0f10c Gerrit-Change-Number: 9833 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 03 Jul 2018 05:59:15 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 05:59:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 05:59:17 +0000 Subject: Change in osmo-bts[master]: debian: Create dbg package for osm-bts-virtual In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9833 ) Change subject: debian: Create dbg package for osm-bts-virtual ...................................................................... debian: Create dbg package for osm-bts-virtual Previously all debug symbols were being stored in osmo-bts-trx-dbg. Change-Id: I9524234cb47c9d5d8e5dc2148c21746e1cd0f10c --- M debian/control M debian/rules 2 files changed, 10 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/debian/control b/debian/control index 437335f..0377d9f 100644 --- a/debian/control +++ b/debian/control @@ -40,3 +40,11 @@ This version of OsmoBTS doesn't use actual GSM PHY/Hardware/RF, but utilizes GSMTAP-over-UDP frames for the Um interface. This is useful in fully virtualized setups e.g. in combination with OsmocomBB virt_phy. + +Package: osmo-bts-virtual-dbg +Architecture: any +Section: debug +Priority: extra +Depends: osmo-bts-virtual (= ${binary:Version}), ${misc:Depends} +Description: Debug symbols for the osmo-bts-virtual + Make debugging possible diff --git a/debian/rules b/debian/rules index 80ba0b2..32d9342 100755 --- a/debian/rules +++ b/debian/rules @@ -12,7 +12,8 @@ dh $@ --with=systemd --with autoreconf --fail-missing override_dh_strip: - dh_strip --dbg-package=osmo-bts-trx-dbg + dh_strip --package=osmo-bts-virtual --dbg-package=osmo-bts-virtual-dbg + dh_strip --package=osmo-bts-trx --dbg-package=osmo-bts-trx-dbg override_dh_autoreconf: echo $(VERSION) > .tarball-version @@ -29,4 +30,3 @@ # Print test results in case of a failure override_dh_auto_test: dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false) - -- To view, visit https://gerrit.osmocom.org/9833 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I9524234cb47c9d5d8e5dc2148c21746e1cd0f10c Gerrit-Change-Number: 9833 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 05:59:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 05:59:28 +0000 Subject: Change in osmo-ci[master]: Restrict where the parent build runs for osmo-gsm-manuals In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9770 ) Change subject: Restrict where the parent build runs for osmo-gsm-manuals ...................................................................... Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/9770 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I23cf2c98f02278a5deb9c4ae8d13438b76538287 Gerrit-Change-Number: 9770 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Tue, 03 Jul 2018 05:59:28 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 05:59:30 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 05:59:30 +0000 Subject: Change in osmo-ci[master]: Restrict where the parent build runs for osmo-gsm-manuals In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9770 ) Change subject: Restrict where the parent build runs for osmo-gsm-manuals ...................................................................... Restrict where the parent build runs for osmo-gsm-manuals This seems to resolve the issue where the jenkins job fails due to missing ssh credentials. Other jobs can also use this by setting the node property Change-Id: I23cf2c98f02278a5deb9c4ae8d13438b76538287 Ticket: OS#3338 --- M jobs/master-builds.yml 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified lynxis lazus: Looks good to me, approved diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml index a3e33be..61f3973 100644 --- a/jobs/master-builds.yml +++ b/jobs/master-builds.yml @@ -5,6 +5,7 @@ # following default values can be overridden by each repo disabled: false concurrent: false + node: '' # axes related defaults slave_axis: !!python/tuple [osmocom-master-debian9] a1_name: a1 @@ -209,6 +210,7 @@ email: gerrit-log at lists.osmocom.org 246tnt at gmail.com - osmo-gsm-manuals: + node: 'osmocom-master-debian9' # publishing once is plenty cmd: > # keep first line with less indent to preserve newlines @@ -354,6 +356,7 @@ sequential: '{obj:sequential}' combination-filter: | {obj:combination_filter} + node: '{obj:node}' axes: - axis: type: slave -- To view, visit https://gerrit.osmocom.org/9770 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I23cf2c98f02278a5deb9c4ae8d13438b76538287 Gerrit-Change-Number: 9770 Gerrit-PatchSet: 2 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 06:26:04 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 06:26:04 +0000 Subject: Change in libosmo-sccp[master]: sccp vty: be fatal for addressbook entry errors In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/4723 ) Change subject: sccp vty: be fatal for addressbook entry errors ...................................................................... Patch Set 2: Code-Review-1 this patc only consists of a commit log message now? -- To view, visit https://gerrit.osmocom.org/4723 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2f71b9c4dd30f919d2054da81283dd7035f44f60 Gerrit-Change-Number: 4723 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Tue, 03 Jul 2018 06:26:04 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Tue Jul 3 06:29:25 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Tue, 3 Jul 2018 06:29:25 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-gapk_=C2=BB_a1=3Ddefaul?= =?UTF-8?Q?t,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#1?= Message-ID: <1442458777.20.1530599365291.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 59.14 KB...] libtool: install: (cd && { ln -s -f libosmosim.so.0.0.2 libosmosim.so.0 || { rm -f libosmosim.so.0 && ln -s libosmosim.so.0.0.2 libosmosim.so.0; }; }) libtool: install: (cd && { ln -s -f libosmosim.so.0.0.2 libosmosim.so || { rm -f libosmosim.so && ln -s libosmosim.so.0.0.2 libosmosim.so; }; }) libtool: install: /usr/bin/install -c .libs/libosmosim.lai libtool: finish: PATH="/usr/local/bin:/usr/bin:/bin:/usr/games:/home/osmocom-build/bin:/sbin" ldconfig -n ---------------------------------------------------------------------- Libraries have been installed in: If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the '-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the 'LD_RUN_PATH' environment variable during linking - use the '-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to '/etc/ld.so.conf' See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- make[3]: Leaving directory ' make[2]: Leaving directory ' Making install in src/pseudotalloc make[2]: Entering directory ' make[3]: Entering directory ' make[3]: Leaving directory ' make[2]: Leaving directory ' Making install in utils make[2]: Entering directory ' CC osmo-arfcn.o CC osmo-auc-gen.o CC osmo_sim_test-osmo-sim-test.o CCLD osmo-arfcn CCLD osmo-auc-gen CCLD osmo-sim-test make[3]: Entering directory ' make[3]: Nothing to be done for 'install-data-am'. /bin/mkdir -p ' /bin/bash ../libtool --mode=install /usr/bin/install -c osmo-arfcn osmo-auc-gen ' libtool: install: /usr/bin/install -c .libs/osmo-arfcn libtool: install: /usr/bin/install -c .libs/osmo-auc-gen make[3]: Leaving directory ' make[2]: Leaving directory ' Making install in tests make[2]: Entering directory ' GEN conv/gsm0503_test_vectors.c Generating test vectors... Generate 'xcch' test vector Generate 'rach' test vector Generate 'rach_ext' test vector Generate 'sch' test vector Generate 'cs2' test vector Generate 'cs3' test vector Generate 'cs2_np' test vector Generate 'cs3_np' test vector Generate 'tch_afs_12_2' test vector Generate 'tch_afs_10_2' test vector Generate 'tch_afs_7_95' test vector Generate 'tch_afs_7_4' test vector Generate 'tch_afs_6_7' test vector Generate 'tch_afs_5_9' test vector Generate 'tch_afs_5_15' test vector Generate 'tch_afs_4_75' test vector Generate 'tch_fr' test vector Generate 'tch_hr' test vector Generate 'tch_ahs_7_95' test vector Generate 'tch_ahs_7_4' test vector Generate 'tch_ahs_6_7' test vector Generate 'tch_ahs_5_9' test vector Generate 'tch_ahs_5_15' test vector Generate 'tch_ahs_4_75' test vector Generate 'mcs1_dl_hdr' test vector Generate 'mcs1_ul_hdr' test vector Generate 'mcs1' test vector Generate 'mcs2' test vector Generate 'mcs3' test vector Generate 'mcs4' test vector Generate 'mcs5_dl_hdr' test vector Generate 'mcs5_ul_hdr' test vector Generate 'mcs5' test vector Generate 'mcs6' test vector Generate 'mcs7_dl_hdr' test vector Generate 'mcs7_ul_hdr' test vector Generate 'mcs7' test vector Generate 'mcs8' test vector Generate 'mcs9' test vector Generation complete. make install-am make[3]: Entering directory ' make[4]: Entering directory ' make[4]: Nothing to be done for 'install-exec-am'. make[4]: Nothing to be done for 'install-data-am'. make[4]: Leaving directory ' make[3]: Leaving directory ' make[2]: Leaving directory ' make[2]: Entering directory ' make[3]: Entering directory ' /bin/mkdir -p ' /bin/mkdir -p ' /bin/mkdir -p ' /usr/bin/install -c -m 644 osmo-release.mk ' /usr/bin/install -c -m 644 libosmocore.pc libosmocodec.pc libosmovty.pc libosmogsm.pc libosmogb.pc libosmoctrl.pc libosmocoding.pc libosmosim.pc ' /usr/bin/install -c osmo-release.sh ' make install-data-hook make[4]: Entering directory ' make[4]: Nothing to be done for 'install-data-hook'. make[4]: Leaving directory ' make[3]: Leaving directory ' make[2]: Leaving directory ' make[1]: Leaving directory ' + STOW_DIR= stow --restow libosmocore + find . -name *.[hc] + verify_value_string_arrays_are_terminated.py ./libgsmhr/libgsmhr.c ./src/fmt_rtp_amr.c ./src/codecs.c ./src/codec_efr.c ./src/procqueue.c ./src/benchmark.c ./src/fmt_amr.c ./src/common.c ./src/fmt_rtp_hr_etsi.c ./src/fmt_gsm.c ./src/fmt_ti.c ./src/pq_rtp.c ./src/formats.c ./src/codec_amr.c ./src/ecu_fr.c ./src/fmt_amr_opencore.c ./src/fmt_racal.c ./src/fmt_rtp_efr.c ./src/codec_fr.c ./src/codec_hr.c ./src/pq_file.c ./src/fmt_hr_ref.c ./src/fmt_rawpcm.c ./src/pq_ecu.c ./src/app_osmo_gapk.c ./src/pq_alsa.c ./src/pq_codec.c ./src/codec_pcm.c ./src/pq_format.c ./src/fmt_rtp_hr_ietf.c ./tests/io/pq_file_test.c ./tests/io/pq_rtp_test.c ./tests/ecu/ecu_fr_test.c ./tests/procqueue/pq_test.c ./deps/libosmocore/src/panic.c ./deps/libosmocore/src/gb/common_vty.h ./deps/libosmocore/src/gb/gprs_ns.c ./deps/libosmocore/src/gb/gprs_ns_vty.c ./deps/libosmocore/src/gb/gprs_ns_frgre.c ./deps/libosmocore/src/gb/gprs_bssgp.c ./deps/libosmocore/src/gb/gprs_bssgp_vty.c ./deps/libosmocore/src/gb/common_vty.c ./deps/libosmocore/src/gb/gprs_bssgp_util.c ./deps/libosmocore/src/gb/gprs_bssgp_bss.c ./deps/libosmocore/src/crc8gen.c ./deps/libosmocore/src/timer_clockgettime.c ./deps/libosmocore/src/vty/talloc_ctx_vty.c ./deps/libosmocore/src/vty/stats_vty.c ./deps/libosmocore/src/vty/buffer.c ./deps/libosmocore/src/vty/command.c ./deps/libosmocore/src/vty/fsm_vty.c ./deps/libosmocore/src/vty/utils.c ./deps/libosmocore/src/vty/vector.c ./deps/libosmocore/src/vty/vty.c ./deps/libosmocore/src/vty/telnet_interface.c ./deps/libosmocore/src/vty/logging_vty.c ./deps/libosmocore/src/bitcomp.c ./deps/libosmocore/src/socket.c ./deps/libosmocore/src/conv_acc_sse_avx.c ./deps/libosmocore/src/codec/gsm660.c ./deps/libosmocore/src/codec/gsm620.c ./deps/libosmocore/src/codec/ecu_fr.c ./deps/libosmocore/src/codec/gsm690.c ./deps/libosmocore/src/codec/gsm610.c ./deps/libosmocore/src/coding/gsm0503_mapping.c ./deps/libosmocore/src/coding/gsm0503_tables.c ./deps/libosmocore/src/coding/gsm0503_interleaving.c ./deps/libosmocore/src/coding/gsm0503_parity.c ./deps/libosmocore/src/coding/gsm0503_coding.c ./deps/libosmocore/src/backtrace.c ./deps/libosmocore/src/crc16.c ./deps/libosmocore/src/ctrl/control_vty.c ./deps/libosmocore/src/ctrl/control_cmd.c ./deps/libosmocore/src/ctrl/fsm_ctrl_commands.c ./deps/libosmocore/src/ctrl/control_if.c ./deps/libosmocore/src/logging_syslog.c ./deps/libosmocore/src/prim.c ./deps/libosmocore/src/application.c ./deps/libosmocore/src/conv_acc_generic.c ./deps/libosmocore/src/conv.c ./deps/libosmocore/src/timer.c ./deps/libosmocore/src/gsm/gsm0414.c ./deps/libosmocore/src/gsm/gan.c ./deps/libosmocore/src/gsm/kasumi.c ./deps/libosmocore/src/gsm/apn.c ./deps/libosmocore/src/gsm/gsm0411_utils.c ./deps/libosmocore/src/gsm/sysinfo.c ./deps/libosmocore/src/gsm/gprs_cipher_core.c ./deps/libosmocore/src/gsm/lapd_core.c ./deps/libosmocore/src/gsm/gsm_04_08_gprs.c ./deps/libosmocore/src/gsm/gea.c ./deps/libosmocore/src/gsm/comp128.c ./deps/libosmocore/src/gsm/gprs_gea.c ./deps/libosmocore/src/gsm/milenage/aes-internal-enc.c ./deps/libosmocore/src/gsm/milenage/aes-internal.c ./deps/libosmocore/src/gsm/milenage/aes_i.h ./deps/libosmocore/src/gsm/milenage/crypto.h ./deps/libosmocore/src/gsm/milenage/milenage.c ./deps/libosmocore/src/gsm/milenage/aes_wrap.h ./deps/libosmocore/src/gsm/milenage/common.h ./deps/libosmocore/src/gsm/milenage/aes.h ./deps/libosmocore/src/gsm/milenage/aes-encblock.c ./deps/libosmocore/src/gsm/milenage/includes.h ./deps/libosmocore/src/gsm/milenage/milenage.h ./deps/libosmocore/src/gsm/mncc.c ./deps/libosmocore/src/gsm/gsm0808.c ./deps/libosmocore/src/gsm/gsup.c ./deps/libosmocore/src/gsm/gsm0502.c ./deps/libosmocore/src/gsm/gsm0411_smc.c ./deps/libosmocore/src/gsm/auth_comp128v1.c ./deps/libosmocore/src/gsm/a5.c ./deps/libosmocore/src/gsm/rsl.c ./deps/libosmocore/src/gsm/lapdm.c ./deps/libosmocore/src/gsm/abis_nm.c ./deps/libosmocore/src/gsm/rxlev_stat.c ./deps/libosmocore/src/gsm/gprs_rlc.c ./deps/libosmocore/src/gsm/gsm48_ie.c ./deps/libosmocore/src/gsm/comp128v23.c ./deps/libosmocore/src/gsm/auth_milenage.c ./deps/libosmocore/src/gsm/ipa.c ./deps/libosmocore/src/gsm/gsm_utils.c ./deps/libosmocore/src/gsm/gsm48.c ./deps/libosmocore/src/gsm/auth_core.c ./deps/libosmocore/src/gsm/auth_comp128v23.c ./deps/libosmocore/src/gsm/tlv_parser.c ./deps/libosmocore/src/gsm/bts_features.c ./deps/libosmocore/src/gsm/gsm23003.c ./deps/libosmocore/src/gsm/gsm0411_smr.c ./deps/libosmocore/src/gsm/gsm0480.c ./deps/libosmocore/src/gsm/gsm0808_utils.c ./deps/libosmocore/src/gsm/gsm0341.c ./deps/libosmocore/src/gsm/gsm0503_conv.c ./deps/libosmocore/src/gsm/oap.c ./deps/libosmocore/src/utils.c ./deps/libosmocore/src/prbs.c ./deps/libosmocore/src/rate_ctr.c ./deps/libosmocore/src/stats.c ./deps/libosmocore/src/signal.c ./deps/libosmocore/src/plugin.c ./deps/libosmocore/src/macaddr.c ./deps/libosmocore/src/logging.c ./deps/libosmocore/src/gsmtap_util.c ./deps/libosmocore/src/crc16gen.c ./deps/libosmocore/src/stats_statsd.c ./deps/libosmocore/src/stat_item.c ./deps/libosmocore/src/timer_gettimeofday.c ./deps/libosmocore/src/fsm.c ./deps/libosmocore/src/serial.c ./deps/libosmocore/src/pseudotalloc/talloc.h ./deps/libosmocore/src/pseudotalloc/pseudotalloc.c ./deps/libosmocore/src/loggingrb.c ./deps/libosmocore/src/conv_acc_sse_impl.h ./deps/libosmocore/src/msgfile.c ./deps/libosmocore/src/sim/card_fs_sim.c ./deps/libosmocore/src/sim/card_fs_usim.c ./deps/libosmocore/src/sim/class_tables.c ./deps/libosmocore/src/sim/reader_pcsc.c ./deps/libosmocore/src/sim/card_fs_isim.c ./deps/libosmocore/src/sim/sim_int.h ./deps/libosmocore/src/sim/card_fs_tetra.c ./deps/libosmocore/src/sim/reader.c ./deps/libosmocore/src/sim/card_fs_uicc.c ./deps/libosmocore/src/sim/gsm_int.h ./deps/libosmocore/src/sim/core.c ./deps/libosmocore/src/bits.c ./deps/libosmocore/src/sercomm.c ./deps/libosmocore/src/select.c ./deps/libosmocore/src/conv_acc.c ./deps/libosmocore/src/counter.c ./deps/libosmocore/src/conv_acc_sse.c ./deps/libosmocore/src/crc32gen.c ./deps/libosmocore/src/bitvec.c ./deps/libosmocore/src/rbtree.c ./deps/libosmocore/src/isdnhdlc.c ./deps/libosmocore/src/msgb.c ./deps/libosmocore/src/strrb.c ./deps/libosmocore/src/crc64gen.c ./deps/libosmocore/src/write_queue.c ./deps/libosmocore/src/logging_gsmtap.c ./deps/libosmocore/tests/ussd/ussd_test.c ./deps/libosmocore/tests/sms/sms_test.c ./deps/libosmocore/tests/bitvec/bitvec_test.c ./deps/libosmocore/tests/gea/gea_test.c ./deps/libosmocore/tests/gsm0808/gsm0808_test.c ./deps/libosmocore/tests/gb/gprs_ns_test.c ./deps/libosmocore/tests/gb/gprs_bssgp_test.c ./deps/libosmocore/tests/gb/bssgp_fc_test.c ./deps/libosmocore/tests/stats/stats_test.c ./deps/libosmocore/tests/vty/vty_test.c ./deps/libosmocore/tests/logging/logging_test.c ./deps/libosmocore/tests/bits/bitcomp_test.c ./deps/libosmocore/tests/bits/bitrev_test.c ./deps/libosmocore/tests/bits/bitfield_test.c ./deps/libosmocore/tests/conv/conv.h ./deps/libosmocore/tests/conv/conv_test.c ./deps/libosmocore/tests/conv/conv_gsm0503_test.c ./deps/libosmocore/tests/conv/conv.c ./deps/libosmocore/tests/conv/gsm0503_test_vectors.c ./deps/libosmocore/tests/strrb/strrb_test.c ./deps/libosmocore/tests/endian/endian_test.c ./deps/libosmocore/tests/sercomm/sercomm_test.c ./deps/libosmocore/tests/codec/codec_ecu_fr_test.c ./deps/libosmocore/tests/codec/codec_test.c ./deps/libosmocore/tests/coding/coding_test.c ./deps/libosmocore/tests/libsercomstub.c ./deps/libosmocore/tests/fr/fr_test.c ./deps/libosmocore/tests/ctrl/ctrl_test.c ./deps/libosmocore/tests/gsm23003/gsm23003_test.c ./deps/libosmocore/tests/msgb/msgb_test.c ./deps/libosmocore/tests/oap/oap_test.c ./deps/libosmocore/tests/kasumi/kasumi_test.c ./deps/libosmocore/tests/loggingrb/loggingrb_test.c ./deps/libosmocore/tests/timer/timer_test.c ./deps/libosmocore/tests/timer/clk_override_test.c ./deps/libosmocore/tests/smscb/smscb_test.c ./deps/libosmocore/tests/smscb/gsm0341_test.c ./deps/libosmocore/tests/a5/a5_test.c ./deps/libosmocore/tests/gprs/gprs_test.c ./deps/libosmocore/tests/prbs/prbs_test.c ./deps/libosmocore/tests/write_queue/wqueue_test.c ./deps/libosmocore/tests/utils/utils_test.c ./deps/libosmocore/tests/msgfile/msgfile_test.c ./deps/libosmocore/tests/gsm0408/gsm0408_test.c ./deps/libosmocore/tests/abis/abis_test.c ./deps/libosmocore/tests/lapd/lapd_test.c ./deps/libosmocore/tests/tlv/tlv_test.c ./deps/libosmocore/tests/sim/sim_test.c ./deps/libosmocore/tests/auth/milenage_test.c ./deps/libosmocore/tests/gsup/gsup_test.c ./deps/libosmocore/tests/fsm/fsm_test.c ./deps/libosmocore/tests/comp128/comp128_test.c ./deps/libosmocore/tests/socket/socket_test.c ./deps/libosmocore/utils/osmo-sim-test.c ./deps/libosmocore/utils/osmo-arfcn.c ./deps/libosmocore/utils/osmo-auc-gen.c ./deps/libosmocore/config.h ./deps/libosmocore/include/osmocom/vty/ports.h ./deps/libosmocore/include/osmocom/vty/misc.h ./deps/libosmocore/include/osmocom/vty/logging.h ./deps/libosmocore/include/osmocom/vty/buffer.h ./deps/libosmocore/include/osmocom/vty/stats.h ./deps/libosmocore/include/osmocom/vty/vty.h ./deps/libosmocore/include/osmocom/vty/vector.h ./deps/libosmocore/include/osmocom/vty/command.h ./deps/libosmocore/include/osmocom/vty/telnet_interface.h ./deps/libosmocore/include/osmocom/codec/gsm610_bits.h ./deps/libosmocore/include/osmocom/codec/ecu.h ./deps/libosmocore/include/osmocom/codec/codec.h ./deps/libosmocore/include/osmocom/coding/gsm0503_mapping.h ./deps/libosmocore/include/osmocom/coding/gsm0503_tables.h ./deps/libosmocore/include/osmocom/coding/gsm0503_coding.h ./deps/libosmocore/include/osmocom/coding/gsm0503_parity.h ./deps/libosmocore/include/osmocom/coding/gsm0503_interleaving.h ./deps/libosmocore/include/osmocom/crypt/auth.h ./deps/libosmocore/include/osmocom/crypt/gprs_cipher.h ./deps/libosmocore/include/osmocom/core/gsmtap.h ./deps/libosmocore/include/osmocom/core/serial.h ./deps/libosmocore/include/osmocom/core/endian.h ./deps/libosmocore/include/osmocom/core/byteswap.h ./deps/libosmocore/include/osmocom/core/application.h ./deps/libosmocore/include/osmocom/core/conv.h ./deps/libosmocore/include/osmocom/core/bitvec.h ./deps/libosmocore/include/osmocom/core/stat_item.h ./deps/libosmocore/include/osmocom/core/logging.h ./deps/libosmocore/include/osmocom/core/backtrace.h ./deps/libosmocore/include/osmocom/core/statistics.h ./deps/libosmocore/include/osmocom/core/crc8gen.h ./deps/libosmocore/include/osmocom/core/bit32gen.h ./deps/libosmocore/include/osmocom/core/crc16gen.h ./deps/libosmocore/include/osmocom/core/linuxrbtree.h ./deps/libosmocore/include/osmocom/core/timer.h ./deps/libosmocore/include/osmocom/core/linuxlist.h ./deps/libosmocore/include/osmocom/core/crcgen.h ./deps/libosmocore/include/osmocom/core/utils.h ./deps/libosmocore/include/osmocom/core/msgfile.h ./deps/libosmocore/include/osmocom/core/signal.h ./deps/libosmocore/include/osmocom/core/loggingrb.h ./deps/libosmocore/include/osmocom/core/bit64gen.h ./deps/libosmocore/include/osmocom/core/process.h ./deps/libosmocore/include/osmocom/core/prim.h ./deps/libosmocore/include/osmocom/core/bits.h ./deps/libosmocore/include/osmocom/core/crc32gen.h ./deps/libosmocore/include/osmocom/core/bitcomp.h ./deps/libosmocore/include/osmocom/core/prbs.h ./deps/libosmocore/include/osmocom/core/talloc.h ./deps/libosmocore/include/osmocom/core/bit16gen.h ./deps/libosmocore/include/osmocom/core/stats.h ./deps/libosmocore/include/osmocom/core/counter.h ./deps/libosmocore/include/osmocom/core/strrb.h ./deps/libosmocore/include/osmocom/core/select.h ./deps/libosmocore/include/osmocom/core/socket.h ./deps/libosmocore/include/osmocom/core/msgb.h ./deps/libosmocore/include/osmocom/core/isdnhdlc.h ./deps/libosmocore/include/osmocom/core/rate_ctr.h ./deps/libosmocore/include/osmocom/core/plugin.h ./deps/libosmocore/include/osmocom/core/defs.h ./deps/libosmocore/include/osmocom/core/macaddr.h ./deps/libosmocore/include/osmocom/core/sercomm.h ./deps/libosmocore/include/osmocom/core/write_queue.h ./deps/libosmocore/include/osmocom/core/panic.h ./deps/libosmocore/include/osmocom/core/fsm.h ./deps/libosmocore/include/osmocom/core/timer_compat.h ./deps/libosmocore/include/osmocom/core/crc16.h ./deps/libosmocore/include/osmocom/core/gsmtap_util.h ./deps/libosmocore/include/osmocom/core/crc64gen.h ./deps/libosmocore/include/osmocom/ctrl/ports.h ./deps/libosmocore/include/osmocom/ctrl/control_cmd.h ./deps/libosmocore/include/osmocom/ctrl/control_vty.h ./deps/libosmocore/include/osmocom/ctrl/control_if.h ./deps/libosmocore/include/osmocom/gsm/abis_nm.h ./deps/libosmocore/include/osmocom/gsm/kasumi.h ./deps/libosmocore/include/osmocom/gsm/gea.h ./deps/libosmocore/include/osmocom/gsm/gsm0480.h ./deps/libosmocore/include/osmocom/gsm/lapd_core.h ./deps/libosmocore/include/osmocom/gsm/gsm0411_smc.h ./deps/libosmocore/include/osmocom/gsm/gsm0341.h ./deps/libosmocore/include/osmocom/gsm/gsm0502.h ./deps/libosmocore/include/osmocom/gsm/comp128v23.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_44_318.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_04_14.h ./deps/libosmocore/include/osmocom/gsm/protocol/smpp34_osmocom.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_04_12.h ./deps/libosmocore/include/osmocom/gsm/protocol/ipaccess.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_03_41.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_04_08.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_12_21.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_08_58.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_04_08_gprs.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_03_40.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_23_003.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_04_11.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_09_02.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_08_08.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_04_80.h ./deps/libosmocore/include/osmocom/gsm/gsm23003.h ./deps/libosmocore/include/osmocom/gsm/mncc.h ./deps/libosmocore/include/osmocom/gsm/ipa.h ./deps/libosmocore/include/osmocom/gsm/prim.h ./deps/libosmocore/include/osmocom/gsm/gsm0411_smr.h ./deps/libosmocore/include/osmocom/gsm/tlv.h ./deps/libosmocore/include/osmocom/gsm/bitvec_gsm.h ./deps/libosmocore/include/osmocom/gsm/gsup.h ./deps/libosmocore/include/osmocom/gsm/a5.h ./deps/libosmocore/include/osmocom/gsm/gsm0808_utils.h ./deps/libosmocore/include/osmocom/gsm/l1sap.h ./deps/libosmocore/include/osmocom/gsm/gsm0411_utils.h ./deps/libosmocore/include/osmocom/gsm/apn.h ./deps/libosmocore/include/osmocom/gsm/gan.h ./deps/libosmocore/include/osmocom/gsm/lapdm.h ./deps/libosmocore/include/osmocom/gsm/gsm0503.h ./deps/libosmocore/include/osmocom/gsm/rxlev_stat.h ./deps/libosmocore/include/osmocom/gsm/meas_rep.h ./deps/libosmocore/include/osmocom/gsm/gsm48_ie.h ./deps/libosmocore/include/osmocom/gsm/comp128.h ./deps/libosmocore/include/osmocom/gsm/gsm0808.h ./deps/libosmocore/include/osmocom/gsm/gsm_utils.h ./deps/libosmocore/include/osmocom/gsm/sysinfo.h ./deps/libosmocore/include/osmocom/gsm/bts_features.h ./deps/libosmocore/include/osmocom/gsm/gsm48.h ./deps/libosmocore/include/osmocom/gsm/rsl.h ./deps/libosmocore/include/osmocom/gsm/oap.h ./deps/libosmocore/include/osmocom/gprs/gprs_msgb.h ./deps/libosmocore/include/osmocom/gprs/gprs_ns_frgre.h ./deps/libosmocore/include/osmocom/gprs/protocol/gsm_08_16.h ./deps/libosmocore/include/osmocom/gprs/protocol/gsm_08_18.h ./deps/libosmocore/include/osmocom/gprs/protocol/gsm_04_60.h ./deps/libosmocore/include/osmocom/gprs/gprs_rlc.h ./deps/libosmocore/include/osmocom/gprs/gprs_bssgp.h ./deps/libosmocore/include/osmocom/gprs/gprs_ns.h ./deps/libosmocore/include/osmocom/gprs/gprs_bssgp_bss.h ./deps/libosmocore/include/osmocom/sim/class_tables.h ./deps/libosmocore/include/osmocom/sim/sim.h ./deps/install/stow/libosmocore/include/osmocom/vty/ports.h ./deps/install/stow/libosmocore/include/osmocom/vty/misc.h ./deps/install/stow/libosmocore/include/osmocom/vty/logging.h ./deps/install/stow/libosmocore/include/osmocom/vty/buffer.h ./deps/install/stow/libosmocore/include/osmocom/vty/stats.h ./deps/install/stow/libosmocore/include/osmocom/vty/vty.h ./deps/install/stow/libosmocore/include/osmocom/vty/vector.h ./deps/install/stow/libosmocore/include/osmocom/vty/command.h ./deps/install/stow/libosmocore/include/osmocom/vty/telnet_interface.h ./deps/install/stow/libosmocore/include/osmocom/codec/gsm610_bits.h ./deps/install/stow/libosmocore/include/osmocom/codec/ecu.h ./deps/install/stow/libosmocore/include/osmocom/codec/codec.h ./deps/install/stow/libosmocore/include/osmocom/coding/gsm0503_mapping.h ./deps/install/stow/libosmocore/include/osmocom/coding/gsm0503_tables.h ./deps/install/stow/libosmocore/include/osmocom/coding/gsm0503_coding.h ./deps/install/stow/libosmocore/include/osmocom/coding/gsm0503_parity.h ./deps/install/stow/libosmocore/include/osmocom/coding/gsm0503_interleaving.h ./deps/install/stow/libosmocore/include/osmocom/crypt/auth.h ./deps/install/stow/libosmocore/include/osmocom/crypt/gprs_cipher.h ./deps/install/stow/libosmocore/include/osmocom/core/gsmtap.h ./deps/install/stow/libosmocore/include/osmocom/core/serial.h ./deps/install/stow/libosmocore/include/osmocom/core/endian.h ./deps/install/stow/libosmocore/include/osmocom/core/byteswap.h ./deps/install/stow/libosmocore/include/osmocom/core/application.h ./deps/install/stow/libosmocore/include/osmocom/core/conv.h ./deps/install/stow/libosmocore/include/osmocom/core/bitvec.h ./deps/install/stow/libosmocore/include/osmocom/core/stat_item.h ./deps/install/stow/libosmocore/include/osmocom/core/logging.h ./deps/install/stow/libosmocore/include/osmocom/core/backtrace.h ./deps/install/stow/libosmocore/include/osmocom/core/statistics.h ./deps/install/stow/libosmocore/include/osmocom/core/crc8gen.h ./deps/install/stow/libosmocore/include/osmocom/core/bit32gen.h ./deps/install/stow/libosmocore/include/osmocom/core/crc16gen.h ./deps/install/stow/libosmocore/include/osmocom/core/linuxrbtree.h ./deps/install/stow/libosmocore/include/osmocom/core/timer.h ./deps/install/stow/libosmocore/include/osmocom/core/linuxlist.h ./deps/install/stow/libosmocore/include/osmocom/core/crcgen.h ./deps/install/stow/libosmocore/include/osmocom/core/utils.h ./deps/install/stow/libosmocore/include/osmocom/core/msgfile.h ./deps/install/stow/libosmocore/include/osmocom/core/signal.h ./deps/install/stow/libosmocore/include/osmocom/core/loggingrb.h ./deps/install/stow/libosmocore/include/osmocom/core/bit64gen.h ./deps/install/stow/libosmocore/include/osmocom/core/process.h ./deps/install/stow/libosmocore/include/osmocom/core/prim.h ./deps/install/stow/libosmocore/include/osmocom/core/bits.h ./deps/install/stow/libosmocore/include/osmocom/core/crc32gen.h ./deps/install/stow/libosmocore/include/osmocom/core/bitcomp.h ./deps/install/stow/libosmocore/include/osmocom/core/prbs.h ./deps/install/stow/libosmocore/include/osmocom/core/talloc.h ./deps/install/stow/libosmocore/include/osmocom/core/bit16gen.h ./deps/install/stow/libosmocore/include/osmocom/core/stats.h ./deps/install/stow/libosmocore/include/osmocom/core/counter.h ./deps/install/stow/libosmocore/include/osmocom/core/strrb.h ./deps/install/stow/libosmocore/include/osmocom/core/select.h ./deps/install/stow/libosmocore/include/osmocom/core/socket.h ./deps/install/stow/libosmocore/include/osmocom/core/msgb.h ./deps/install/stow/libosmocore/include/osmocom/core/isdnhdlc.h ./deps/install/stow/libosmocore/include/osmocom/core/rate_ctr.h ./deps/install/stow/libosmocore/include/osmocom/core/plugin.h ./deps/install/stow/libosmocore/include/osmocom/core/defs.h ./deps/install/stow/libosmocore/include/osmocom/core/macaddr.h ./deps/install/stow/libosmocore/include/osmocom/core/sercomm.h ./deps/install/stow/libosmocore/include/osmocom/core/write_queue.h ./deps/install/stow/libosmocore/include/osmocom/core/panic.h ./deps/install/stow/libosmocore/include/osmocom/core/fsm.h ./deps/install/stow/libosmocore/include/osmocom/core/timer_compat.h ./deps/install/stow/libosmocore/include/osmocom/core/crc16.h ./deps/install/stow/libosmocore/include/osmocom/core/gsmtap_util.h ./deps/install/stow/libosmocore/include/osmocom/core/crc64gen.h ./deps/install/stow/libosmocore/include/osmocom/ctrl/ports.h ./deps/install/stow/libosmocore/include/osmocom/ctrl/control_cmd.h ./deps/install/stow/libosmocore/include/osmocom/ctrl/control_vty.h ./deps/install/stow/libosmocore/include/osmocom/ctrl/control_if.h ./deps/install/stow/libosmocore/include/osmocom/gsm/abis_nm.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm0480.h ./deps/install/stow/libosmocore/include/osmocom/gsm/lapd_core.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm0411_smc.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm0341.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm0502.h ./deps/install/stow/libosmocore/include/osmocom/gsm/comp128v23.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_44_318.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_04_14.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/smpp34_osmocom.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_04_12.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/ipaccess.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_03_41.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_04_08.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_12_21.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_08_58.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_04_08_gprs.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_03_40.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_23_003.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_04_11.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_09_02.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_08_08.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_04_80.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm23003.h ./deps/install/stow/libosmocore/include/osmocom/gsm/mncc.h ./deps/install/stow/libosmocore/include/osmocom/gsm/ipa.h ./deps/install/stow/libosmocore/include/osmocom/gsm/prim.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm0411_smr.h ./deps/install/stow/libosmocore/include/osmocom/gsm/tlv.h ./deps/install/stow/libosmocore/include/osmocom/gsm/bitvec_gsm.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsup.h ./deps/install/stow/libosmocore/include/osmocom/gsm/a5.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm0808_utils.h ./deps/install/stow/libosmocore/include/osmocom/gsm/l1sap.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm0411_utils.h ./deps/install/stow/libosmocore/include/osmocom/gsm/apn.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gan.h ./deps/install/stow/libosmocore/include/osmocom/gsm/lapdm.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm0503.h ./deps/install/stow/libosmocore/include/osmocom/gsm/rxlev_stat.h ./deps/install/stow/libosmocore/include/osmocom/gsm/meas_rep.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm48_ie.h ./deps/install/stow/libosmocore/include/osmocom/gsm/comp128.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm0808.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm_utils.h ./deps/install/stow/libosmocore/include/osmocom/gsm/sysinfo.h ./deps/install/stow/libosmocore/include/osmocom/gsm/bts_features.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm48.h ./deps/install/stow/libosmocore/include/osmocom/gsm/rsl.h ./deps/install/stow/libosmocore/include/osmocom/gsm/oap.h ./deps/install/stow/libosmocore/include/osmocom/gprs/gprs_msgb.h ./deps/install/stow/libosmocore/include/osmocom/gprs/gprs_ns_frgre.h ./deps/install/stow/libosmocore/include/osmocom/gprs/protocol/gsm_08_16.h ./deps/install/stow/libosmocore/include/osmocom/gprs/protocol/gsm_08_18.h ./deps/install/stow/libosmocore/include/osmocom/gprs/protocol/gsm_04_60.h ./deps/install/stow/libosmocore/include/osmocom/gprs/gprs_rlc.h ./deps/install/stow/libosmocore/include/osmocom/gprs/gprs_bssgp.h ./deps/install/stow/libosmocore/include/osmocom/gprs/gprs_ns.h ./deps/install/stow/libosmocore/include/osmocom/gprs/gprs_bssgp_bss.h ./deps/install/stow/libosmocore/include/osmocom/sim/class_tables.h ./deps/install/stow/libosmocore/include/osmocom/sim/sim.h ./include/gsmhr/gsmhr.h ./include/osmocom/gapk/logging.h ./include/osmocom/gapk/codecs.h ./include/osmocom/gapk/utils.h ./include/osmocom/gapk/formats.h ./include/osmocom/gapk/common.h ./include/osmocom/gapk/bench.h ./include/osmocom/gapk/get_cycles.h ./include/osmocom/gapk/benchmark.h ./include/osmocom/gapk/procqueue.h + export PKG_CONFIG_PATH=: + export LD_LIBRARY_PATH= + set +x =============================== gapk =============================== + cd + autoreconf --install --force libtoolize: putting auxiliary files in '.'. libtoolize: copying file './ltmain.sh' libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'. libtoolize: copying file 'm4/libtool.m4' libtoolize: copying file 'm4/ltoptions.m4' libtoolize: copying file 'm4/ltsugar.m4' libtoolize: copying file 'm4/ltversion.m4' libtoolize: copying file 'm4/lt~obsolete.m4' configure.ac:7: installing './compile' configure.ac:7: installing './config.guess' configure.ac:7: installing './config.sub' configure.ac:6: installing './install-sh' configure.ac:6: installing './missing' libgsmhr/Makefile.am: installing './depcomp' + ./configure checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu checking how to print strings... printf checking for style of include used by make... GNU checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking whether gcc understands -c and -o together... yes checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for fgrep... /bin/grep -F checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B checking the name lister (/usr/bin/nm -B) interface... BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 1572864 checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop checking for /usr/bin/ld option to reload object files... -r checking for objdump... objdump checking how to recognize dependent libraries... pass_all checking for dlltool... no checking how to associate runtime and link libraries... printf %s\n checking for ar... ar checking for archiver @FILE support... @ checking for strip... strip checking for ranlib... ranlib checking command to parse /usr/bin/nm -B output from gcc object... ok checking for sysroot... no checking for a working dd... /bin/dd checking how to truncate binary pipes... /bin/dd bs=4096 count=1 checking for mt... mt checking if mt is a manifest tool... no checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking for objdir... .libs checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC -DPIC checking if gcc PIC flag -fPIC -DPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.o... (cached) yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether make supports nested variables... (cached) yes checking for a Python interpreter with version >= 2.4... python checking for python... /usr/bin/python checking for python version... 2.7 checking for python platform... linux2 checking for python script directory... ${prefix}/lib/python2.7/dist-packages checking for python extension module directory... ${exec_prefix}/lib/python2.7/dist-packages checking if gcc supports -fvisibility=hidden... yes checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking whether gcc understands -c and -o together... (cached) yes checking dependency style of gcc... (cached) gcc3 checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for LIBOSMOCORE... yes checking for LIBOSMOCODEC... yes checking for LIBALSA... no configure: error: Package requirements (alsa) were not met: Package alsa was not found in the pkg-config search path. Perhaps you should add the directory containing `alsa.pc' to the PKG_CONFIG_PATH environment variable Package 'alsa', required by 'world', not found Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables LIBALSA_CFLAGS and LIBALSA_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Tue Jul 3 06:33:07 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 06:33:07 +0000 Subject: Change in osmo-ci[master]: jobs: add master+gerrit verification job for gapk Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/9834 Change subject: jobs: add master+gerrit verification job for gapk ...................................................................... jobs: add master+gerrit verification job for gapk Change-Id: Iedf3b43c164ae7e3e653820284c4d4ddaa545784 --- M ansible/roles/osmocom-jenkins-slave/tasks/main.yml M jobs/gerrit-verifications.yml M jobs/master-builds.yml 3 files changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/34/9834/1 diff --git a/ansible/roles/osmocom-jenkins-slave/tasks/main.yml b/ansible/roles/osmocom-jenkins-slave/tasks/main.yml index f76489c..cca3704 100644 --- a/ansible/roles/osmocom-jenkins-slave/tasks/main.yml +++ b/ansible/roles/osmocom-jenkins-slave/tasks/main.yml @@ -46,6 +46,9 @@ # by gsm-manuals - python-nwdiag - python-pychart + # by gapk + - libasound-dev + - libopencore-amrnb-dev - name: install build dependencies and libraries apt: diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index 14df458..0d977b2 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -185,6 +185,7 @@ - osmo-tetra - osmo-sysmon - simtrace2 + - gapk - osmo-ttcn3-hacks: repos_url: 'https://gerrit.osmocom.org/{repos}' diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml index a3e33be..ed25828 100644 --- a/jobs/master-builds.yml +++ b/jobs/master-builds.yml @@ -325,6 +325,7 @@ - osmocom-bb - osmo-sysmon - simtrace2 + - gapk - rtl-sdr: email: laforge at gnumonks.org steve at steve-m.de -- To view, visit https://gerrit.osmocom.org/9834 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iedf3b43c164ae7e3e653820284c4d4ddaa545784 Gerrit-Change-Number: 9834 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 09:56:39 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 3 Jul 2018 09:56:39 +0000 Subject: Change in osmo-gsm-tester[master]: hlr: Get hlr.sql from new path Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9835 Change subject: hlr: Get hlr.sql from new path ...................................................................... hlr: Get hlr.sql from new path As of osmo-hlr edca4f88a653cc688bc1c46611a9f0bc880637e2, hlr.sql file has been moved to an sql subdir. Change-Id: I1cbbe46edc6121476cd2422074a9f3cfc2d8e5ef --- M src/osmo_gsm_tester/osmo_hlr.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/35/9835/1 diff --git a/src/osmo_gsm_tester/osmo_hlr.py b/src/osmo_gsm_tester/osmo_hlr.py index 20eaf02..635f711 100644 --- a/src/osmo_gsm_tester/osmo_hlr.py +++ b/src/osmo_gsm_tester/osmo_hlr.py @@ -54,7 +54,7 @@ # bootstrap an empty hlr.db self.db_file = self.run_dir.new_file('hlr.db') - sql_input = inst.child('share/doc/osmo-hlr/hlr.sql') + sql_input = inst.child('share/doc/osmo-hlr/sql/hlr.sql') if not os.path.isfile(sql_input): raise log.Error('hlr.sql missing:', sql_input) self.run_local('create_hlr_db', ('/bin/sh', '-c', 'sqlite3 %r < %r' % (self.db_file, sql_input))) -- To view, visit https://gerrit.osmocom.org/9835 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I1cbbe46edc6121476cd2422074a9f3cfc2d8e5ef Gerrit-Change-Number: 9835 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 10:22:02 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 3 Jul 2018 10:22:02 +0000 Subject: Change in osmo-gsm-tester[master]: hlr: Get hlr.sql from new path In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9835 ) Change subject: hlr: Get hlr.sql from new path ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9835 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1cbbe46edc6121476cd2422074a9f3cfc2d8e5ef Gerrit-Change-Number: 9835 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 03 Jul 2018 10:22:02 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 10:22:04 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 3 Jul 2018 10:22:04 +0000 Subject: Change in osmo-gsm-tester[master]: hlr: Get hlr.sql from new path In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/9835 ) Change subject: hlr: Get hlr.sql from new path ...................................................................... hlr: Get hlr.sql from new path As of osmo-hlr edca4f88a653cc688bc1c46611a9f0bc880637e2, hlr.sql file has been moved to an sql subdir. Change-Id: I1cbbe46edc6121476cd2422074a9f3cfc2d8e5ef --- M src/osmo_gsm_tester/osmo_hlr.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/src/osmo_gsm_tester/osmo_hlr.py b/src/osmo_gsm_tester/osmo_hlr.py index 20eaf02..635f711 100644 --- a/src/osmo_gsm_tester/osmo_hlr.py +++ b/src/osmo_gsm_tester/osmo_hlr.py @@ -54,7 +54,7 @@ # bootstrap an empty hlr.db self.db_file = self.run_dir.new_file('hlr.db') - sql_input = inst.child('share/doc/osmo-hlr/hlr.sql') + sql_input = inst.child('share/doc/osmo-hlr/sql/hlr.sql') if not os.path.isfile(sql_input): raise log.Error('hlr.sql missing:', sql_input) self.run_local('create_hlr_db', ('/bin/sh', '-c', 'sqlite3 %r < %r' % (self.db_file, sql_input))) -- To view, visit https://gerrit.osmocom.org/9835 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I1cbbe46edc6121476cd2422074a9f3cfc2d8e5ef Gerrit-Change-Number: 9835 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 11:35:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 11:35:27 +0000 Subject: Change in gapk[master]: contrib/jenkins.sh: enable AddressSanitizer In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9796 ) Change subject: contrib/jenkins.sh: enable AddressSanitizer ...................................................................... Patch Set 2: Code-Review+2 we first need -- To view, visit https://gerrit.osmocom.org/9796 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gapk Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5075107e9b563c06f43eb4544e81aefae3ad1f7d Gerrit-Change-Number: 9796 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Tue, 03 Jul 2018 11:35:27 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 11:35:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 11:35:29 +0000 Subject: Change in gapk[master]: contrib/jenkins.sh: enable AddressSanitizer In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9796 ) Change subject: contrib/jenkins.sh: enable AddressSanitizer ...................................................................... Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/9796 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gapk Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5075107e9b563c06f43eb4544e81aefae3ad1f7d Gerrit-Change-Number: 9796 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Tue, 03 Jul 2018 11:35:29 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 11:35:45 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 11:35:45 +0000 Subject: Change in gapk[master]: contrib/jenkins.sh: enable AddressSanitizer In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9796 ) Change subject: contrib/jenkins.sh: enable AddressSanitizer ...................................................................... Patch Set 3: Verified+1 -- To view, visit https://gerrit.osmocom.org/9796 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gapk Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5075107e9b563c06f43eb4544e81aefae3ad1f7d Gerrit-Change-Number: 9796 Gerrit-PatchSet: 3 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Tue, 03 Jul 2018 11:35:45 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 11:35:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 11:35:47 +0000 Subject: Change in gapk[master]: contrib/jenkins.sh: enable AddressSanitizer In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9796 ) Change subject: contrib/jenkins.sh: enable AddressSanitizer ...................................................................... contrib/jenkins.sh: enable AddressSanitizer Change-Id: I5075107e9b563c06f43eb4544e81aefae3ad1f7d --- M contrib/jenkins.sh 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index ba4e7af..cf53c3a 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -34,7 +34,7 @@ cd "$base" autoreconf --install --force -./configure +./configure --enable-sanitize $MAKE $PARALLEL_MAKE LD_LIBRARY_PATH="$inst/lib" $MAKE check || cat-testlogs.sh LD_LIBRARY_PATH="$inst/lib" DISTCHECK_CONFIGURE_FLAGS="" $MAKE distcheck || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/9796 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gapk Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I5075107e9b563c06f43eb4544e81aefae3ad1f7d Gerrit-Change-Number: 9796 Gerrit-PatchSet: 3 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Tue Jul 3 11:41:44 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Tue, 3 Jul 2018 11:41:44 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-gapk_=C2=BB_a1=3Ddefaul?= =?UTF-8?Q?t,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#2?= In-Reply-To: <1442458777.20.1530599365291.JavaMail.jenkins@jenkins.osmocom.org> References: <1442458777.20.1530599365291.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <335297667.31.1530618104176.JavaMail.jenkins@jenkins.osmocom.org> See Changes: [laforge] contrib/jenkins.sh: enable AddressSanitizer ------------------------------------------ [...truncated 58.92 KB...] libtool: install: (cd && { ln -s -f libosmosim.so.0.0.2 libosmosim.so.0 || { rm -f libosmosim.so.0 && ln -s libosmosim.so.0.0.2 libosmosim.so.0; }; }) libtool: install: (cd && { ln -s -f libosmosim.so.0.0.2 libosmosim.so || { rm -f libosmosim.so && ln -s libosmosim.so.0.0.2 libosmosim.so; }; }) libtool: install: /usr/bin/install -c .libs/libosmosim.lai libtool: finish: PATH="/usr/local/bin:/usr/bin:/bin:/usr/games:/home/osmocom-build/bin:/sbin" ldconfig -n ---------------------------------------------------------------------- Libraries have been installed in: If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the '-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the 'LD_RUN_PATH' environment variable during linking - use the '-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to '/etc/ld.so.conf' See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- make[3]: Leaving directory ' make[2]: Leaving directory ' Making install in src/pseudotalloc make[2]: Entering directory ' make[3]: Entering directory ' make[3]: Leaving directory ' make[2]: Leaving directory ' Making install in utils make[2]: Entering directory ' CC osmo-arfcn.o CC osmo-auc-gen.o CC osmo_sim_test-osmo-sim-test.o CCLD osmo-arfcn CCLD osmo-auc-gen CCLD osmo-sim-test make[3]: Entering directory ' make[3]: Nothing to be done for 'install-data-am'. /bin/mkdir -p ' /bin/bash ../libtool --mode=install /usr/bin/install -c osmo-arfcn osmo-auc-gen ' libtool: install: /usr/bin/install -c .libs/osmo-arfcn libtool: install: /usr/bin/install -c .libs/osmo-auc-gen make[3]: Leaving directory ' make[2]: Leaving directory ' Making install in tests make[2]: Entering directory ' GEN conv/gsm0503_test_vectors.c Generating test vectors... Generate 'xcch' test vector Generate 'rach' test vector Generate 'rach_ext' test vector Generate 'sch' test vector Generate 'cs2' test vector Generate 'cs3' test vector Generate 'cs2_np' test vector Generate 'cs3_np' test vector Generate 'tch_afs_12_2' test vector Generate 'tch_afs_10_2' test vector Generate 'tch_afs_7_95' test vector Generate 'tch_afs_7_4' test vector Generate 'tch_afs_6_7' test vector Generate 'tch_afs_5_9' test vector Generate 'tch_afs_5_15' test vector Generate 'tch_afs_4_75' test vector Generate 'tch_fr' test vector Generate 'tch_hr' test vector Generate 'tch_ahs_7_95' test vector Generate 'tch_ahs_7_4' test vector Generate 'tch_ahs_6_7' test vector Generate 'tch_ahs_5_9' test vector Generate 'tch_ahs_5_15' test vector Generate 'tch_ahs_4_75' test vector Generate 'mcs1_dl_hdr' test vector Generate 'mcs1_ul_hdr' test vector Generate 'mcs1' test vector Generate 'mcs2' test vector Generate 'mcs3' test vector Generate 'mcs4' test vector Generate 'mcs5_dl_hdr' test vector Generate 'mcs5_ul_hdr' test vector Generate 'mcs5' test vector Generate 'mcs6' test vector Generate 'mcs7_dl_hdr' test vector Generate 'mcs7_ul_hdr' test vector Generate 'mcs7' test vector Generate 'mcs8' test vector Generate 'mcs9' test vector Generation complete. make install-am make[3]: Entering directory ' make[4]: Entering directory ' make[4]: Nothing to be done for 'install-exec-am'. make[4]: Nothing to be done for 'install-data-am'. make[4]: Leaving directory ' make[3]: Leaving directory ' make[2]: Leaving directory ' make[2]: Entering directory ' make[3]: Entering directory ' /bin/mkdir -p ' /bin/mkdir -p ' /bin/mkdir -p ' /usr/bin/install -c -m 644 osmo-release.mk ' /usr/bin/install -c -m 644 libosmocore.pc libosmocodec.pc libosmovty.pc libosmogsm.pc libosmogb.pc libosmoctrl.pc libosmocoding.pc libosmosim.pc ' /usr/bin/install -c osmo-release.sh ' make install-data-hook make[4]: Entering directory ' make[4]: Nothing to be done for 'install-data-hook'. make[4]: Leaving directory ' make[3]: Leaving directory ' make[2]: Leaving directory ' make[1]: Leaving directory ' + STOW_DIR= stow --restow libosmocore + find . -name *.[hc] + verify_value_string_arrays_are_terminated.py ./libgsmhr/libgsmhr.c ./deps/install/stow/libosmocore/include/osmocom/crypt/gprs_cipher.h ./deps/install/stow/libosmocore/include/osmocom/crypt/auth.h ./deps/install/stow/libosmocore/include/osmocom/vty/buffer.h ./deps/install/stow/libosmocore/include/osmocom/vty/vty.h ./deps/install/stow/libosmocore/include/osmocom/vty/command.h ./deps/install/stow/libosmocore/include/osmocom/vty/ports.h ./deps/install/stow/libosmocore/include/osmocom/vty/telnet_interface.h ./deps/install/stow/libosmocore/include/osmocom/vty/vector.h ./deps/install/stow/libosmocore/include/osmocom/vty/logging.h ./deps/install/stow/libosmocore/include/osmocom/vty/misc.h ./deps/install/stow/libosmocore/include/osmocom/vty/stats.h ./deps/install/stow/libosmocore/include/osmocom/codec/codec.h ./deps/install/stow/libosmocore/include/osmocom/codec/gsm610_bits.h ./deps/install/stow/libosmocore/include/osmocom/codec/ecu.h ./deps/install/stow/libosmocore/include/osmocom/coding/gsm0503_mapping.h ./deps/install/stow/libosmocore/include/osmocom/coding/gsm0503_interleaving.h ./deps/install/stow/libosmocore/include/osmocom/coding/gsm0503_tables.h ./deps/install/stow/libosmocore/include/osmocom/coding/gsm0503_coding.h ./deps/install/stow/libosmocore/include/osmocom/coding/gsm0503_parity.h ./deps/install/stow/libosmocore/include/osmocom/sim/sim.h ./deps/install/stow/libosmocore/include/osmocom/sim/class_tables.h ./deps/install/stow/libosmocore/include/osmocom/core/byteswap.h ./deps/install/stow/libosmocore/include/osmocom/core/timer_compat.h ./deps/install/stow/libosmocore/include/osmocom/core/msgb.h ./deps/install/stow/libosmocore/include/osmocom/core/crc64gen.h ./deps/install/stow/libosmocore/include/osmocom/core/serial.h ./deps/install/stow/libosmocore/include/osmocom/core/backtrace.h ./deps/install/stow/libosmocore/include/osmocom/core/stat_item.h ./deps/install/stow/libosmocore/include/osmocom/core/conv.h ./deps/install/stow/libosmocore/include/osmocom/core/crcgen.h ./deps/install/stow/libosmocore/include/osmocom/core/linuxrbtree.h ./deps/install/stow/libosmocore/include/osmocom/core/strrb.h ./deps/install/stow/libosmocore/include/osmocom/core/crc8gen.h ./deps/install/stow/libosmocore/include/osmocom/core/timer.h ./deps/install/stow/libosmocore/include/osmocom/core/sercomm.h ./deps/install/stow/libosmocore/include/osmocom/core/talloc.h ./deps/install/stow/libosmocore/include/osmocom/core/socket.h ./deps/install/stow/libosmocore/include/osmocom/core/bitvec.h ./deps/install/stow/libosmocore/include/osmocom/core/bits.h ./deps/install/stow/libosmocore/include/osmocom/core/isdnhdlc.h ./deps/install/stow/libosmocore/include/osmocom/core/bitcomp.h ./deps/install/stow/libosmocore/include/osmocom/core/prim.h ./deps/install/stow/libosmocore/include/osmocom/core/loggingrb.h ./deps/install/stow/libosmocore/include/osmocom/core/linuxlist.h ./deps/install/stow/libosmocore/include/osmocom/core/counter.h ./deps/install/stow/libosmocore/include/osmocom/core/bit32gen.h ./deps/install/stow/libosmocore/include/osmocom/core/logging.h ./deps/install/stow/libosmocore/include/osmocom/core/gsmtap_util.h ./deps/install/stow/libosmocore/include/osmocom/core/endian.h ./deps/install/stow/libosmocore/include/osmocom/core/defs.h ./deps/install/stow/libosmocore/include/osmocom/core/fsm.h ./deps/install/stow/libosmocore/include/osmocom/core/statistics.h ./deps/install/stow/libosmocore/include/osmocom/core/msgfile.h ./deps/install/stow/libosmocore/include/osmocom/core/gsmtap.h ./deps/install/stow/libosmocore/include/osmocom/core/plugin.h ./deps/install/stow/libosmocore/include/osmocom/core/prbs.h ./deps/install/stow/libosmocore/include/osmocom/core/write_queue.h ./deps/install/stow/libosmocore/include/osmocom/core/macaddr.h ./deps/install/stow/libosmocore/include/osmocom/core/bit64gen.h ./deps/install/stow/libosmocore/include/osmocom/core/rate_ctr.h ./deps/install/stow/libosmocore/include/osmocom/core/panic.h ./deps/install/stow/libosmocore/include/osmocom/core/process.h ./deps/install/stow/libosmocore/include/osmocom/core/crc16gen.h ./deps/install/stow/libosmocore/include/osmocom/core/select.h ./deps/install/stow/libosmocore/include/osmocom/core/crc16.h ./deps/install/stow/libosmocore/include/osmocom/core/crc32gen.h ./deps/install/stow/libosmocore/include/osmocom/core/utils.h ./deps/install/stow/libosmocore/include/osmocom/core/application.h ./deps/install/stow/libosmocore/include/osmocom/core/signal.h ./deps/install/stow/libosmocore/include/osmocom/core/bit16gen.h ./deps/install/stow/libosmocore/include/osmocom/core/stats.h ./deps/install/stow/libosmocore/include/osmocom/ctrl/ports.h ./deps/install/stow/libosmocore/include/osmocom/ctrl/control_if.h ./deps/install/stow/libosmocore/include/osmocom/ctrl/control_cmd.h ./deps/install/stow/libosmocore/include/osmocom/ctrl/control_vty.h ./deps/install/stow/libosmocore/include/osmocom/gsm/mncc.h ./deps/install/stow/libosmocore/include/osmocom/gsm/l1sap.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm23003.h ./deps/install/stow/libosmocore/include/osmocom/gsm/meas_rep.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm0480.h ./deps/install/stow/libosmocore/include/osmocom/gsm/comp128v23.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm0411_smc.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm0502.h ./deps/install/stow/libosmocore/include/osmocom/gsm/oap.h ./deps/install/stow/libosmocore/include/osmocom/gsm/lapd_core.h ./deps/install/stow/libosmocore/include/osmocom/gsm/lapdm.h ./deps/install/stow/libosmocore/include/osmocom/gsm/bitvec_gsm.h ./deps/install/stow/libosmocore/include/osmocom/gsm/a5.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gan.h ./deps/install/stow/libosmocore/include/osmocom/gsm/rxlev_stat.h ./deps/install/stow/libosmocore/include/osmocom/gsm/prim.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm0808_utils.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm0411_utils.h ./deps/install/stow/libosmocore/include/osmocom/gsm/bts_features.h ./deps/install/stow/libosmocore/include/osmocom/gsm/abis_nm.h ./deps/install/stow/libosmocore/include/osmocom/gsm/apn.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm0411_smr.h ./deps/install/stow/libosmocore/include/osmocom/gsm/ipa.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_04_80.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_12_21.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/ipaccess.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/smpp34_osmocom.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_04_08_gprs.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_08_08.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_09_02.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_03_40.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_23_003.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_04_14.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_04_12.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_44_318.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_03_41.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_04_08.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_08_58.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_04_11.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm0341.h ./deps/install/stow/libosmocore/include/osmocom/gsm/rsl.h ./deps/install/stow/libosmocore/include/osmocom/gsm/comp128.h ./deps/install/stow/libosmocore/include/osmocom/gsm/sysinfo.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsup.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm48.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm0808.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm0503.h ./deps/install/stow/libosmocore/include/osmocom/gsm/tlv.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm48_ie.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm_utils.h ./deps/install/stow/libosmocore/include/osmocom/gprs/gprs_ns_frgre.h ./deps/install/stow/libosmocore/include/osmocom/gprs/gprs_bssgp.h ./deps/install/stow/libosmocore/include/osmocom/gprs/gprs_bssgp_bss.h ./deps/install/stow/libosmocore/include/osmocom/gprs/protocol/gsm_08_18.h ./deps/install/stow/libosmocore/include/osmocom/gprs/protocol/gsm_08_16.h ./deps/install/stow/libosmocore/include/osmocom/gprs/protocol/gsm_04_60.h ./deps/install/stow/libosmocore/include/osmocom/gprs/gprs_rlc.h ./deps/install/stow/libosmocore/include/osmocom/gprs/gprs_msgb.h ./deps/install/stow/libosmocore/include/osmocom/gprs/gprs_ns.h ./deps/libosmocore/config.h ./deps/libosmocore/utils/osmo-auc-gen.c ./deps/libosmocore/utils/osmo-arfcn.c ./deps/libosmocore/utils/osmo-sim-test.c ./deps/libosmocore/src/logging_syslog.c ./deps/libosmocore/src/stats_statsd.c ./deps/libosmocore/src/panic.c ./deps/libosmocore/src/backtrace.c ./deps/libosmocore/src/timer.c ./deps/libosmocore/src/sercomm.c ./deps/libosmocore/src/crc32gen.c ./deps/libosmocore/src/logging_gsmtap.c ./deps/libosmocore/src/crc64gen.c ./deps/libosmocore/src/timer_gettimeofday.c ./deps/libosmocore/src/prim.c ./deps/libosmocore/src/gb/common_vty.c ./deps/libosmocore/src/gb/gprs_bssgp_util.c ./deps/libosmocore/src/gb/gprs_bssgp.c ./deps/libosmocore/src/gb/gprs_ns_vty.c ./deps/libosmocore/src/gb/gprs_ns_frgre.c ./deps/libosmocore/src/gb/gprs_bssgp_bss.c ./deps/libosmocore/src/gb/gprs_ns.c ./deps/libosmocore/src/gb/common_vty.h ./deps/libosmocore/src/gb/gprs_bssgp_vty.c ./deps/libosmocore/src/bitvec.c ./deps/libosmocore/src/isdnhdlc.c ./deps/libosmocore/src/utils.c ./deps/libosmocore/src/strrb.c ./deps/libosmocore/src/conv_acc_sse.c ./deps/libosmocore/src/conv_acc_sse_impl.h ./deps/libosmocore/src/conv.c ./deps/libosmocore/src/crc16.c ./deps/libosmocore/src/vty/buffer.c ./deps/libosmocore/src/vty/vector.c ./deps/libosmocore/src/vty/utils.c ./deps/libosmocore/src/vty/telnet_interface.c ./deps/libosmocore/src/vty/command.c ./deps/libosmocore/src/vty/logging_vty.c ./deps/libosmocore/src/vty/talloc_ctx_vty.c ./deps/libosmocore/src/vty/stats_vty.c ./deps/libosmocore/src/vty/fsm_vty.c ./deps/libosmocore/src/vty/vty.c ./deps/libosmocore/src/bitcomp.c ./deps/libosmocore/src/signal.c ./deps/libosmocore/src/serial.c ./deps/libosmocore/src/crc16gen.c ./deps/libosmocore/src/prbs.c ./deps/libosmocore/src/codec/gsm660.c ./deps/libosmocore/src/codec/gsm610.c ./deps/libosmocore/src/codec/gsm620.c ./deps/libosmocore/src/codec/ecu_fr.c ./deps/libosmocore/src/codec/gsm690.c ./deps/libosmocore/src/socket.c ./deps/libosmocore/src/conv_acc_generic.c ./deps/libosmocore/src/msgb.c ./deps/libosmocore/src/coding/gsm0503_parity.c ./deps/libosmocore/src/coding/gsm0503_interleaving.c ./deps/libosmocore/src/coding/gsm0503_coding.c ./deps/libosmocore/src/coding/gsm0503_mapping.c ./deps/libosmocore/src/coding/gsm0503_tables.c ./deps/libosmocore/src/bits.c ./deps/libosmocore/src/sim/class_tables.c ./deps/libosmocore/src/sim/gsm_int.h ./deps/libosmocore/src/sim/sim_int.h ./deps/libosmocore/src/sim/reader.c ./deps/libosmocore/src/sim/card_fs_usim.c ./deps/libosmocore/src/sim/reader_pcsc.c ./deps/libosmocore/src/sim/card_fs_isim.c ./deps/libosmocore/src/sim/core.c ./deps/libosmocore/src/sim/card_fs_sim.c ./deps/libosmocore/src/sim/card_fs_uicc.c ./deps/libosmocore/src/sim/card_fs_tetra.c ./deps/libosmocore/src/rbtree.c ./deps/libosmocore/src/timer_clockgettime.c ./deps/libosmocore/src/plugin.c ./deps/libosmocore/src/conv_acc_sse_avx.c ./deps/libosmocore/src/stat_item.c ./deps/libosmocore/src/counter.c ./deps/libosmocore/src/application.c ./deps/libosmocore/src/ctrl/control_cmd.c ./deps/libosmocore/src/ctrl/control_vty.c ./deps/libosmocore/src/ctrl/control_if.c ./deps/libosmocore/src/ctrl/fsm_ctrl_commands.c ./deps/libosmocore/src/msgfile.c ./deps/libosmocore/src/gsm/gsm0808.c ./deps/libosmocore/src/gsm/lapdm.c ./deps/libosmocore/src/gsm/gsm_utils.c ./deps/libosmocore/src/gsm/oap.c ./deps/libosmocore/src/gsm/gsm0341.c ./deps/libosmocore/src/gsm/gea.c ./deps/libosmocore/src/gsm/gsm0411_smc.c ./deps/libosmocore/src/gsm/milenage/common.h ./deps/libosmocore/src/gsm/milenage/milenage.c ./deps/libosmocore/src/gsm/milenage/includes.h ./deps/libosmocore/src/gsm/milenage/aes-encblock.c ./deps/libosmocore/src/gsm/milenage/aes.h ./deps/libosmocore/src/gsm/milenage/milenage.h ./deps/libosmocore/src/gsm/milenage/aes-internal-enc.c ./deps/libosmocore/src/gsm/milenage/aes_wrap.h ./deps/libosmocore/src/gsm/milenage/crypto.h ./deps/libosmocore/src/gsm/milenage/aes-internal.c ./deps/libosmocore/src/gsm/milenage/aes_i.h ./deps/libosmocore/src/gsm/gan.c ./deps/libosmocore/src/gsm/comp128v23.c ./deps/libosmocore/src/gsm/comp128.c ./deps/libosmocore/src/gsm/gsm0503_conv.c ./deps/libosmocore/src/gsm/rsl.c ./deps/libosmocore/src/gsm/gsm_04_08_gprs.c ./deps/libosmocore/src/gsm/sysinfo.c ./deps/libosmocore/src/gsm/auth_milenage.c ./deps/libosmocore/src/gsm/gprs_cipher_core.c ./deps/libosmocore/src/gsm/gprs_rlc.c ./deps/libosmocore/src/gsm/bts_features.c ./deps/libosmocore/src/gsm/auth_comp128v23.c ./deps/libosmocore/src/gsm/kasumi.c ./deps/libosmocore/src/gsm/gsm0411_utils.c ./deps/libosmocore/src/gsm/gsm48_ie.c ./deps/libosmocore/src/gsm/gsup.c ./deps/libosmocore/src/gsm/gsm0411_smr.c ./deps/libosmocore/src/gsm/tlv_parser.c ./deps/libosmocore/src/gsm/auth_comp128v1.c ./deps/libosmocore/src/gsm/gsm0808_utils.c ./deps/libosmocore/src/gsm/apn.c ./deps/libosmocore/src/gsm/a5.c ./deps/libosmocore/src/gsm/gsm48.c ./deps/libosmocore/src/gsm/lapd_core.c ./deps/libosmocore/src/gsm/gsm0502.c ./deps/libosmocore/src/gsm/gsm0414.c ./deps/libosmocore/src/gsm/gprs_gea.c ./deps/libosmocore/src/gsm/rxlev_stat.c ./deps/libosmocore/src/gsm/auth_core.c ./deps/libosmocore/src/gsm/gsm0480.c ./deps/libosmocore/src/gsm/gsm23003.c ./deps/libosmocore/src/gsm/abis_nm.c ./deps/libosmocore/src/gsm/ipa.c ./deps/libosmocore/src/gsm/mncc.c ./deps/libosmocore/src/stats.c ./deps/libosmocore/src/fsm.c ./deps/libosmocore/src/macaddr.c ./deps/libosmocore/src/logging.c ./deps/libosmocore/src/crc8gen.c ./deps/libosmocore/src/gsmtap_util.c ./deps/libosmocore/src/rate_ctr.c ./deps/libosmocore/src/conv_acc.c ./deps/libosmocore/src/write_queue.c ./deps/libosmocore/src/pseudotalloc/talloc.h ./deps/libosmocore/src/pseudotalloc/pseudotalloc.c ./deps/libosmocore/src/loggingrb.c ./deps/libosmocore/src/select.c ./deps/libosmocore/include/osmocom/crypt/gprs_cipher.h ./deps/libosmocore/include/osmocom/crypt/auth.h ./deps/libosmocore/include/osmocom/vty/buffer.h ./deps/libosmocore/include/osmocom/vty/vty.h ./deps/libosmocore/include/osmocom/vty/command.h ./deps/libosmocore/include/osmocom/vty/ports.h ./deps/libosmocore/include/osmocom/vty/telnet_interface.h ./deps/libosmocore/include/osmocom/vty/vector.h ./deps/libosmocore/include/osmocom/vty/logging.h ./deps/libosmocore/include/osmocom/vty/misc.h ./deps/libosmocore/include/osmocom/vty/stats.h ./deps/libosmocore/include/osmocom/codec/codec.h ./deps/libosmocore/include/osmocom/codec/gsm610_bits.h ./deps/libosmocore/include/osmocom/codec/ecu.h ./deps/libosmocore/include/osmocom/coding/gsm0503_mapping.h ./deps/libosmocore/include/osmocom/coding/gsm0503_interleaving.h ./deps/libosmocore/include/osmocom/coding/gsm0503_tables.h ./deps/libosmocore/include/osmocom/coding/gsm0503_coding.h ./deps/libosmocore/include/osmocom/coding/gsm0503_parity.h ./deps/libosmocore/include/osmocom/sim/sim.h ./deps/libosmocore/include/osmocom/sim/class_tables.h ./deps/libosmocore/include/osmocom/core/byteswap.h ./deps/libosmocore/include/osmocom/core/timer_compat.h ./deps/libosmocore/include/osmocom/core/msgb.h ./deps/libosmocore/include/osmocom/core/crc64gen.h ./deps/libosmocore/include/osmocom/core/serial.h ./deps/libosmocore/include/osmocom/core/backtrace.h ./deps/libosmocore/include/osmocom/core/stat_item.h ./deps/libosmocore/include/osmocom/core/conv.h ./deps/libosmocore/include/osmocom/core/crcgen.h ./deps/libosmocore/include/osmocom/core/linuxrbtree.h ./deps/libosmocore/include/osmocom/core/strrb.h ./deps/libosmocore/include/osmocom/core/crc8gen.h ./deps/libosmocore/include/osmocom/core/timer.h ./deps/libosmocore/include/osmocom/core/sercomm.h ./deps/libosmocore/include/osmocom/core/talloc.h ./deps/libosmocore/include/osmocom/core/socket.h ./deps/libosmocore/include/osmocom/core/bitvec.h ./deps/libosmocore/include/osmocom/core/bits.h ./deps/libosmocore/include/osmocom/core/isdnhdlc.h ./deps/libosmocore/include/osmocom/core/bitcomp.h ./deps/libosmocore/include/osmocom/core/prim.h ./deps/libosmocore/include/osmocom/core/loggingrb.h ./deps/libosmocore/include/osmocom/core/linuxlist.h ./deps/libosmocore/include/osmocom/core/counter.h ./deps/libosmocore/include/osmocom/core/bit32gen.h ./deps/libosmocore/include/osmocom/core/logging.h ./deps/libosmocore/include/osmocom/core/gsmtap_util.h ./deps/libosmocore/include/osmocom/core/endian.h ./deps/libosmocore/include/osmocom/core/defs.h ./deps/libosmocore/include/osmocom/core/fsm.h ./deps/libosmocore/include/osmocom/core/statistics.h ./deps/libosmocore/include/osmocom/core/msgfile.h ./deps/libosmocore/include/osmocom/core/gsmtap.h ./deps/libosmocore/include/osmocom/core/plugin.h ./deps/libosmocore/include/osmocom/core/prbs.h ./deps/libosmocore/include/osmocom/core/write_queue.h ./deps/libosmocore/include/osmocom/core/macaddr.h ./deps/libosmocore/include/osmocom/core/bit64gen.h ./deps/libosmocore/include/osmocom/core/rate_ctr.h ./deps/libosmocore/include/osmocom/core/panic.h ./deps/libosmocore/include/osmocom/core/process.h ./deps/libosmocore/include/osmocom/core/crc16gen.h ./deps/libosmocore/include/osmocom/core/select.h ./deps/libosmocore/include/osmocom/core/crc16.h ./deps/libosmocore/include/osmocom/core/crc32gen.h ./deps/libosmocore/include/osmocom/core/utils.h ./deps/libosmocore/include/osmocom/core/application.h ./deps/libosmocore/include/osmocom/core/signal.h ./deps/libosmocore/include/osmocom/core/bit16gen.h ./deps/libosmocore/include/osmocom/core/stats.h ./deps/libosmocore/include/osmocom/ctrl/ports.h ./deps/libosmocore/include/osmocom/ctrl/control_if.h ./deps/libosmocore/include/osmocom/ctrl/control_cmd.h ./deps/libosmocore/include/osmocom/ctrl/control_vty.h ./deps/libosmocore/include/osmocom/gsm/mncc.h ./deps/libosmocore/include/osmocom/gsm/l1sap.h ./deps/libosmocore/include/osmocom/gsm/gsm23003.h ./deps/libosmocore/include/osmocom/gsm/meas_rep.h ./deps/libosmocore/include/osmocom/gsm/gsm0480.h ./deps/libosmocore/include/osmocom/gsm/gea.h ./deps/libosmocore/include/osmocom/gsm/comp128v23.h ./deps/libosmocore/include/osmocom/gsm/gsm0411_smc.h ./deps/libosmocore/include/osmocom/gsm/kasumi.h ./deps/libosmocore/include/osmocom/gsm/gsm0502.h ./deps/libosmocore/include/osmocom/gsm/oap.h ./deps/libosmocore/include/osmocom/gsm/lapd_core.h ./deps/libosmocore/include/osmocom/gsm/lapdm.h ./deps/libosmocore/include/osmocom/gsm/bitvec_gsm.h ./deps/libosmocore/include/osmocom/gsm/a5.h ./deps/libosmocore/include/osmocom/gsm/gan.h ./deps/libosmocore/include/osmocom/gsm/rxlev_stat.h ./deps/libosmocore/include/osmocom/gsm/prim.h ./deps/libosmocore/include/osmocom/gsm/gsm0808_utils.h ./deps/libosmocore/include/osmocom/gsm/gsm0411_utils.h ./deps/libosmocore/include/osmocom/gsm/bts_features.h ./deps/libosmocore/include/osmocom/gsm/abis_nm.h ./deps/libosmocore/include/osmocom/gsm/apn.h ./deps/libosmocore/include/osmocom/gsm/gsm0411_smr.h ./deps/libosmocore/include/osmocom/gsm/ipa.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_04_80.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_12_21.h ./deps/libosmocore/include/osmocom/gsm/protocol/ipaccess.h ./deps/libosmocore/include/osmocom/gsm/protocol/smpp34_osmocom.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_04_08_gprs.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_08_08.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_09_02.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_03_40.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_23_003.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_04_14.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_04_12.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_44_318.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_03_41.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_04_08.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_08_58.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_04_11.h ./deps/libosmocore/include/osmocom/gsm/gsm0341.h ./deps/libosmocore/include/osmocom/gsm/rsl.h ./deps/libosmocore/include/osmocom/gsm/comp128.h ./deps/libosmocore/include/osmocom/gsm/sysinfo.h ./deps/libosmocore/include/osmocom/gsm/gsup.h ./deps/libosmocore/include/osmocom/gsm/gsm48.h ./deps/libosmocore/include/osmocom/gsm/gsm0808.h ./deps/libosmocore/include/osmocom/gsm/gsm0503.h ./deps/libosmocore/include/osmocom/gsm/tlv.h ./deps/libosmocore/include/osmocom/gsm/gsm48_ie.h ./deps/libosmocore/include/osmocom/gsm/gsm_utils.h ./deps/libosmocore/include/osmocom/gprs/gprs_ns_frgre.h ./deps/libosmocore/include/osmocom/gprs/gprs_bssgp.h ./deps/libosmocore/include/osmocom/gprs/gprs_bssgp_bss.h ./deps/libosmocore/include/osmocom/gprs/protocol/gsm_08_18.h ./deps/libosmocore/include/osmocom/gprs/protocol/gsm_08_16.h ./deps/libosmocore/include/osmocom/gprs/protocol/gsm_04_60.h ./deps/libosmocore/include/osmocom/gprs/gprs_rlc.h ./deps/libosmocore/include/osmocom/gprs/gprs_msgb.h ./deps/libosmocore/include/osmocom/gprs/gprs_ns.h ./deps/libosmocore/tests/gsup/gsup_test.c ./deps/libosmocore/tests/comp128/comp128_test.c ./deps/libosmocore/tests/gsm0808/gsm0808_test.c ./deps/libosmocore/tests/socket/socket_test.c ./deps/libosmocore/tests/logging/logging_test.c ./deps/libosmocore/tests/tlv/tlv_test.c ./deps/libosmocore/tests/gb/gprs_ns_test.c ./deps/libosmocore/tests/gb/gprs_bssgp_test.c ./deps/libosmocore/tests/gb/bssgp_fc_test.c ./deps/libosmocore/tests/utils/utils_test.c ./deps/libosmocore/tests/timer/clk_override_test.c ./deps/libosmocore/tests/timer/timer_test.c ./deps/libosmocore/tests/gsm23003/gsm23003_test.c ./deps/libosmocore/tests/a5/a5_test.c ./deps/libosmocore/tests/kasumi/kasumi_test.c ./deps/libosmocore/tests/vty/vty_test.c ./deps/libosmocore/tests/libsercomstub.c ./deps/libosmocore/tests/sercomm/sercomm_test.c ./deps/libosmocore/tests/auth/milenage_test.c ./deps/libosmocore/tests/msgfile/msgfile_test.c ./deps/libosmocore/tests/ussd/ussd_test.c ./deps/libosmocore/tests/codec/codec_test.c ./deps/libosmocore/tests/codec/codec_ecu_fr_test.c ./deps/libosmocore/tests/prbs/prbs_test.c ./deps/libosmocore/tests/bitvec/bitvec_test.c ./deps/libosmocore/tests/gsm0408/gsm0408_test.c ./deps/libosmocore/tests/coding/coding_test.c ./deps/libosmocore/tests/strrb/strrb_test.c ./deps/libosmocore/tests/endian/endian_test.c ./deps/libosmocore/tests/msgb/msgb_test.c ./deps/libosmocore/tests/sim/sim_test.c ./deps/libosmocore/tests/write_queue/wqueue_test.c ./deps/libosmocore/tests/fsm/fsm_test.c ./deps/libosmocore/tests/oap/oap_test.c ./deps/libosmocore/tests/ctrl/ctrl_test.c ./deps/libosmocore/tests/fr/fr_test.c ./deps/libosmocore/tests/lapd/lapd_test.c ./deps/libosmocore/tests/sms/sms_test.c ./deps/libosmocore/tests/gea/gea_test.c ./deps/libosmocore/tests/loggingrb/loggingrb_test.c ./deps/libosmocore/tests/conv/gsm0503_test_vectors.c ./deps/libosmocore/tests/conv/conv.h ./deps/libosmocore/tests/conv/conv_test.c ./deps/libosmocore/tests/conv/conv.c ./deps/libosmocore/tests/conv/conv_gsm0503_test.c ./deps/libosmocore/tests/bits/bitrev_test.c ./deps/libosmocore/tests/bits/bitcomp_test.c ./deps/libosmocore/tests/bits/bitfield_test.c ./deps/libosmocore/tests/stats/stats_test.c ./deps/libosmocore/tests/abis/abis_test.c ./deps/libosmocore/tests/gprs/gprs_test.c ./deps/libosmocore/tests/smscb/gsm0341_test.c ./deps/libosmocore/tests/smscb/smscb_test.c ./src/codec_efr.c ./src/common.c ./src/codec_amr.c ./src/fmt_rtp_efr.c ./src/pq_rtp.c ./src/pq_codec.c ./src/fmt_rtp_amr.c ./src/fmt_ti.c ./src/app_osmo_gapk.c ./src/procqueue.c ./src/codec_pcm.c ./src/codecs.c ./src/benchmark.c ./src/pq_format.c ./src/fmt_rtp_hr_ietf.c ./src/fmt_racal.c ./src/fmt_rtp_hr_etsi.c ./src/ecu_fr.c ./src/fmt_rawpcm.c ./src/formats.c ./src/fmt_gsm.c ./src/fmt_amr.c ./src/pq_ecu.c ./src/pq_file.c ./src/pq_alsa.c ./src/codec_hr.c ./src/codec_fr.c ./src/fmt_amr_opencore.c ./src/fmt_hr_ref.c ./include/gsmhr/gsmhr.h ./include/osmocom/gapk/formats.h ./include/osmocom/gapk/common.h ./include/osmocom/gapk/codecs.h ./include/osmocom/gapk/bench.h ./include/osmocom/gapk/benchmark.h ./include/osmocom/gapk/procqueue.h ./include/osmocom/gapk/get_cycles.h ./include/osmocom/gapk/logging.h ./include/osmocom/gapk/utils.h ./tests/io/pq_file_test.c ./tests/io/pq_rtp_test.c ./tests/ecu/ecu_fr_test.c ./tests/procqueue/pq_test.c + export PKG_CONFIG_PATH=: + export LD_LIBRARY_PATH= + set +x =============================== gapk =============================== + cd + autoreconf --install --force libtoolize: putting auxiliary files in '.'. libtoolize: copying file './ltmain.sh' libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'. libtoolize: copying file 'm4/libtool.m4' libtoolize: copying file 'm4/ltoptions.m4' libtoolize: copying file 'm4/ltsugar.m4' libtoolize: copying file 'm4/ltversion.m4' libtoolize: copying file 'm4/lt~obsolete.m4' configure.ac:7: installing './compile' configure.ac:7: installing './config.guess' configure.ac:7: installing './config.sub' configure.ac:6: installing './install-sh' configure.ac:6: installing './missing' libgsmhr/Makefile.am: installing './depcomp' + ./configure --enable-sanitize checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu checking how to print strings... printf checking for style of include used by make... GNU checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking whether gcc understands -c and -o together... yes checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for fgrep... /bin/grep -F checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B checking the name lister (/usr/bin/nm -B) interface... BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 1572864 checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop checking for /usr/bin/ld option to reload object files... -r checking for objdump... objdump checking how to recognize dependent libraries... pass_all checking for dlltool... no checking how to associate runtime and link libraries... printf %s\n checking for ar... ar checking for archiver @FILE support... @ checking for strip... strip checking for ranlib... ranlib checking command to parse /usr/bin/nm -B output from gcc object... ok checking for sysroot... no checking for a working dd... /bin/dd checking how to truncate binary pipes... /bin/dd bs=4096 count=1 checking for mt... mt checking if mt is a manifest tool... no checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking for objdir... .libs checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC -DPIC checking if gcc PIC flag -fPIC -DPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.o... (cached) yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether make supports nested variables... (cached) yes checking for a Python interpreter with version >= 2.4... python checking for python... /usr/bin/python checking for python version... 2.7 checking for python platform... linux2 checking for python script directory... ${prefix}/lib/python2.7/dist-packages checking for python extension module directory... ${exec_prefix}/lib/python2.7/dist-packages checking if gcc supports -fvisibility=hidden... yes checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking whether gcc understands -c and -o together... (cached) yes checking dependency style of gcc... (cached) gcc3 checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for LIBOSMOCORE... yes checking for LIBOSMOCODEC... yes checking for LIBALSA... no configure: error: Package requirements (alsa) were not met: Package alsa was not found in the pkg-config search path. Perhaps you should add the directory containing `alsa.pc' to the PKG_CONFIG_PATH environment variable Package 'alsa', required by 'world', not found Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables LIBALSA_CFLAGS and LIBALSA_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Tue Jul 3 11:42:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 11:42:47 +0000 Subject: Change in osmo-ttcn3-hacks[master]: introduce a TTCN3 test suite for SCCP In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9653 ) Change subject: introduce a TTCN3 test suite for SCCP ...................................................................... Patch Set 1: Code-Review-1 (9 comments) the test is importing/building tons of modules which it doesn't need, this should be cleaned up first. https://gerrit.osmocom.org/#/c/9653/1/sccp/SCCP_Tests.ttcn File sccp/SCCP_Tests.ttcn: https://gerrit.osmocom.org/#/c/9653/1/sccp/SCCP_Tests.ttcn at 37 PS1, Line 37: import from BSSAP_Adapter all; there is nothing BSSAP specific in this test, I'm wondering why it usees BSSAP_Adapter? https://gerrit.osmocom.org/#/c/9653/1/sccp/SCCP_Tests.ttcn at 60 PS1, Line 60: function f_init(BSSAP_Configuration cfg) runs on MTC_CT { this appears to be the only BSSAP related type used, but we're not really using the BSSAP_Adapter. I think this is misleading and I'd prefer if code that tests SCCP only imports no modules and/or types that relate to BSSAP https://gerrit.osmocom.org/#/c/9653/1/sccp/gen_links.sh File sccp/gen_links.sh: https://gerrit.osmocom.org/#/c/9653/1/sccp/gen_links.sh at 49 PS1, Line 49: DIR=$BASEDIR/titan.ProtocolModules.BSSMAP_v11.2.0/src : FILES="BSSAP_Types.ttcn" : gen_links $DIR $FILES this can go https://gerrit.osmocom.org/#/c/9653/1/sccp/gen_links.sh at 53 PS1, Line 53: DIR=$BASEDIR/titan.ProtocolModules.ROSE/src : FILES="Remote_Operations_Generic_ROS_PDUs.asn Remote_Operations_Information_Objects.asn" : gen_links $DIR $FILES : : DIR=$BASEDIR/titan.ProtocolModules.MAP/src : FILES="MAP_ApplicationContexts.asn MAP_CH_DataTypes.asn MAP_CallHandlingOperations.asn MAP_CommonDataTypes.asn MAP_DialogueInformation.asn MAP_ER_DataTypes.asn MAP_EncDec.cc MAP_Errors.asn MAP_GR_DataTypes.asn MAP_Group_Call_Operations.asn MAP_LCS_DataTypes.asn MAP_LocationServiceOperations.asn MAP_MS_DataTypes.asn MAP_MobileServiceOperations.asn MAP_OM_DataTypes.asn MAP_OperationAndMaintenanceOperations.asn MAP_PDU_Defs.asn MAP_Protocol.asn MAP_SM_DataTypes.asn MAP_SS_Code.asn MAP_SS_DataTypes.asn MAP_ShortMessageServiceOperations.asn MAP_SupplementaryServiceOperations.asn MAP_TS_Code.asn MAP_Types.ttcn " : FILES+="MAP_BS_Code.asn MAP_ExtensionDataTypes.asn MobileDomainDefinitions.asn" : gen_links $DIR $FILES : : DIR=$BASEDIR/titan.ProtocolModules.MobileL3_v13.4.0/src : FILES="MobileL3_CC_Types.ttcn MobileL3_CommonIE_Types.ttcn MobileL3_GMM_SM_Types.ttcn MobileL3_MM_Types.ttcn MobileL3_RRM_Types.ttcn MobileL3_SMS_Types.ttcn MobileL3_SS_Types.ttcn MobileL3_Types.ttcn " : FILES+="SS_DataTypes.asn SS_Errors.asn SS_Operations.asn SS_PDU_Defs.asn SS_Protocol.asn SS_Types.ttcn SS_EncDec.cc" : gen_links $DIR $FILES : : DIR=$BASEDIR/titan.ProtocolModules.SDP/src : FILES="SDP_EncDec.cc SDP_Types.ttcn SDP_parse_.tab.c SDP_parse_.tab.h SDP_parse_parser.h SDP_parser.l : SDP_parser.y lex.SDP_parse_.c" : gen_links $DIR $FILES this can all go https://gerrit.osmocom.org/#/c/9653/1/sccp/gen_links.sh at 78 PS1, Line 78: MNCC_Types.ttcn MNCC_EncDec.cc MNCC_CodecPort.ttcn mncc.h MNCC_Emulation.ttcn this can go https://gerrit.osmocom.org/#/c/9653/1/sccp/gen_links.sh at 79 PS1, Line 79: GSUP_Types.ttcn GSUP_Emulation.ttcn this can go https://gerrit.osmocom.org/#/c/9653/1/sccp/gen_links.sh at 80 PS1, Line 80: L3_Templates.ttcn L3_Common.ttcn this can go https://gerrit.osmocom.org/#/c/9653/1/sccp/gen_links.sh at 81 PS1, Line 81: BSSMAP_Emulation.ttcn BSSAP_CodecPort.ttcn BSSMAP_Templates.ttcn BSSAP_Adapter.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_Emulation.ttcn " : FILES+="MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunctDef.cc " : gen_links $DIR $FILES this can all go https://gerrit.osmocom.org/#/c/9653/1/sccp/regen_makefile.sh File sccp/regen_makefile.sh: https://gerrit.osmocom.org/#/c/9653/1/sccp/regen_makefile.sh at 5 PS1, Line 5: -DIPA_EMULATION_MGCP -DIPA_EMULATION_GSUP -DIPA_EMULATION_SCCP those three should be removed, none of this is used here. -- To view, visit https://gerrit.osmocom.org/9653 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I03f5e8b282a7396b45417495c88d8fb81b26cda8 Gerrit-Change-Number: 9653 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 03 Jul 2018 11:42:47 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 11:45:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 11:45:46 +0000 Subject: Change in libosmo-sccp[master]: tweak the default point codes used by sccp_demo_user In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9652 ) Change subject: tweak the default point codes used by sccp_demo_user ...................................................................... Patch Set 1: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/9652/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/9652/1//COMMIT_MSG at 17 PS1, Line 17: -1 As far as I can see, the old code was using -1, not the new code? (leaving that aside, I don't even remember what -1 was intended to signify) https://gerrit.osmocom.org/#/c/9652/1//COMMIT_MSG at 22 PS1, Line 22: Use the same default values for both client and : server modes this wording would mean that both the client and server want to use "23" as local code and "1" as remote point code, and they cannot connect to each other? I suppose this is not what you meant to say? -- To view, visit https://gerrit.osmocom.org/9652 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7432e6fc2617e0fd77a098fcd7d14abc40db7229 Gerrit-Change-Number: 9652 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 03 Jul 2018 11:45:46 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From admin at opensuse.org Tue Jul 3 12:10:53 2018 From: admin at opensuse.org (OBS Notification) Date: Tue, 03 Jul 2018 12:10:53 +0000 Subject: Build failure of network:osmocom:latest/eclipse-titan in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <5b3b67e78774e_11f6109c684143187@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/eclipse-titan/xUbuntu_17.04/x86_64 Package network:osmocom:latest/eclipse-titan failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:latest eclipse-titan Last lines of build log: [ 569s] Parallel_main.cc:165:50: warning: macro "__TIME__" might prevent reproducible builds [-Wdate-time] [ 569s] "Build date (Base Library): " __DATE__ " " __TIME__ "\n" [ 569s] ^~~~~~~~ [ 569s] ar -r libttcn3-parallel.a RT1/TitanLoggerApi.o RT1/TitanLoggerControl.o config_process.lex.o config_process.tab.o RT1/PreGenRecordOf.o Addfunc.o Array.o ASN_Any.o ASN_CharacterString.o ASN_EmbeddedPDV.o ASN_External.o ASN_Null.o Basetype.o BER.o Bitstring.o Boolean.o Charstring.o Communication.o Component.o Default.o Encdec.o Error.o Float.o Hexstring.o RInt.o Integer.o Logger.o LoggerPlugin.o LoggerPluginManager.o LegacyLogger.o LoggingBits.o Module_list.o Objid.o Octetstring.o Port.o RAW.o Runtime.o Snapshot.o Struct_of.o Template.o TEXT.o Textbuf.o Timer.o Param_Types.o Universal_charstring.o Verdicttype.o XER.o XmlReader.o TitanLoggerControlImpl.o TCov.o JSON.o Profiler.o ProfilerTools.o Debugger.o DebuggerUI.o OER.o ../common/memory.o ../common/pattern_la.o ../common/pattern_p.o ../common/config_preproc.o ../common/config_preproc_la.o ../common/config_preproc_p.tab.o ../common/path.o ../common/pattern_uni.o ../common/Quadruple.o ../common/NetworkHandler.o ../common/Path2.o ../common/ModuleVersion.o ../common/JSON_Tokenizer.o ../common/UnicharPattern.o LoggerPlugin_static.o Parallel_main.o [ 569s] ar: creating libttcn3-parallel.a [ 569s] g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -DYY_NO_INPUT -DNDEBUG -DLINUX -DUSE_EPOLL -DYY_NO_INPUT -DNDEBUG -DLINUX -DUSE_EPOLL -I. -IRT1 -I/usr/include/libxml2 -I../common -g -O2 -fdebug-prefix-map=/usr/src/packages/BUILD=. -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wno-long-long -O2 -fPIC -Wall -Wno-long-long -O2 -fPIC LoggerPlugin_dynamic.cc -o LoggerPlugin_dynamic.o [ 570s] g++ -shared -Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now -fPIC -fPIC -o libttcn3-dynamic.so RT1/TitanLoggerApi.o RT1/TitanLoggerControl.o config_process.lex.o config_process.tab.o RT1/PreGenRecordOf.o Addfunc.o Array.o ASN_Any.o ASN_CharacterString.o ASN_EmbeddedPDV.o ASN_External.o ASN_Null.o Basetype.o BER.o Bitstring.o Boolean.o Charstring.o Communication.o Component.o Default.o Encdec.o Error.o Float.o Hexstring.o RInt.o Integer.o Logger.o LoggerPlugin.o LoggerPluginManager.o LegacyLogger.o LoggingBits.o Module_list.o Objid.o Octetstring.o Port.o RAW.o Runtime.o Snapshot.o Struct_of.o Template.o TEXT.o Textbuf.o Timer.o Param_Types.o Universal_charstring.o Verdicttype.o XER.o XmlReader.o TitanLoggerControlImpl.o TCov.o JSON.o Profiler.o ProfilerTools.o Debugger.o DebuggerUI.o OER.o ../common/memory.o ../common/pattern_la.o ../common/pattern_p.o ../common/config_preproc.o ../common/config_preproc_la.o ../common/config_preproc_p.tab.o ../common/path.o ../common/pattern_uni.o ../common/Quadruple.o ../common/NetworkHandler.o ../common/Path2.o ../common/ModuleVersion.o ../common/JSON_Tokenizer.o ../common/UnicharPattern.o LoggerPlugin_dynamic.o Single_main.o -Ldefault/lib -lcrypto -lxml2 [ 570s] /usr/bin/ld: LoggerPlugin_dynamic.o: undefined reference to symbol 'dlclose@@GLIBC_2.2.5' [ 570s] //lib/x86_64-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line [ 570s] collect2: error: ld returned 1 exit status [ 570s] Makefile:344: recipe for target 'libttcn3-dynamic.so' failed [ 570s] make[2]: *** [libttcn3-dynamic.so] Error 1 [ 570s] make[2]: Leaving directory '/usr/src/packages/BUILD/core' [ 570s] Makefile:65: recipe for target 'all' failed [ 570s] make[1]: *** [all] Error 2 [ 570s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 570s] dh_auto_build: make -j1 returned exit code 2 [ 570s] debian/rules:6: recipe for target 'build' failed [ 570s] make: *** [build] Error 2 [ 570s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 570s] [ 570s] lamb17 failed "build eclipse-titan_6.3.1-1.dsc" at Tue Jul 3 12:10:46 UTC 2018. [ 570s] [ 570s] ### VM INTERACTION START ### [ 574s] [ 564.115898] reboot: Power down [ 574s] ### VM INTERACTION END ### [ 574s] [ 574s] lamb17 failed "build eclipse-titan_6.3.1-1.dsc" at Tue Jul 3 12:10:50 UTC 2018. [ 574s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jul 3 12:11:10 2018 From: admin at opensuse.org (OBS Notification) Date: Tue, 03 Jul 2018 12:11:10 +0000 Subject: Build failure of network:osmocom:latest/eclipse-titan in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <5b3b67e7de9bb_11f6109c6841432b6@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/eclipse-titan/xUbuntu_17.04/i586 Package network:osmocom:latest/eclipse-titan failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:latest eclipse-titan Last lines of build log: [ 597s] Parallel_main.cc:165:50: warning: macro "__TIME__" might prevent reproducible builds [-Wdate-time] [ 597s] "Build date (Base Library): " __DATE__ " " __TIME__ "\n" [ 597s] ^~~~~~~~ [ 597s] ar -r libttcn3-parallel.a RT1/TitanLoggerApi.o RT1/TitanLoggerControl.o config_process.lex.o config_process.tab.o RT1/PreGenRecordOf.o Addfunc.o Array.o ASN_Any.o ASN_CharacterString.o ASN_EmbeddedPDV.o ASN_External.o ASN_Null.o Basetype.o BER.o Bitstring.o Boolean.o Charstring.o Communication.o Component.o Default.o Encdec.o Error.o Float.o Hexstring.o RInt.o Integer.o Logger.o LoggerPlugin.o LoggerPluginManager.o LegacyLogger.o LoggingBits.o Module_list.o Objid.o Octetstring.o Port.o RAW.o Runtime.o Snapshot.o Struct_of.o Template.o TEXT.o Textbuf.o Timer.o Param_Types.o Universal_charstring.o Verdicttype.o XER.o XmlReader.o TitanLoggerControlImpl.o TCov.o JSON.o Profiler.o ProfilerTools.o Debugger.o DebuggerUI.o OER.o ../common/memory.o ../common/pattern_la.o ../common/pattern_p.o ../common/config_preproc.o ../common/config_preproc_la.o ../common/config_preproc_p.tab.o ../common/path.o ../common/pattern_uni.o ../common/Quadruple.o ../common/NetworkHandler.o ../common/Path2.o ../common/ModuleVersion.o ../common/JSON_Tokenizer.o ../common/UnicharPattern.o LoggerPlugin_static.o Parallel_main.o [ 597s] ar: creating libttcn3-parallel.a [ 597s] g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -DYY_NO_INPUT -DNDEBUG -DLINUX -DUSE_EPOLL -DYY_NO_INPUT -DNDEBUG -DLINUX -DUSE_EPOLL -I. -IRT1 -I/usr/include/libxml2 -I../common -g -O2 -fdebug-prefix-map=/usr/src/packages/BUILD=. -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wno-long-long -O2 -fPIC -Wall -Wno-long-long -O2 -fPIC LoggerPlugin_dynamic.cc -o LoggerPlugin_dynamic.o [ 598s] g++ -shared -Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now -fPIC -fPIC -o libttcn3-dynamic.so RT1/TitanLoggerApi.o RT1/TitanLoggerControl.o config_process.lex.o config_process.tab.o RT1/PreGenRecordOf.o Addfunc.o Array.o ASN_Any.o ASN_CharacterString.o ASN_EmbeddedPDV.o ASN_External.o ASN_Null.o Basetype.o BER.o Bitstring.o Boolean.o Charstring.o Communication.o Component.o Default.o Encdec.o Error.o Float.o Hexstring.o RInt.o Integer.o Logger.o LoggerPlugin.o LoggerPluginManager.o LegacyLogger.o LoggingBits.o Module_list.o Objid.o Octetstring.o Port.o RAW.o Runtime.o Snapshot.o Struct_of.o Template.o TEXT.o Textbuf.o Timer.o Param_Types.o Universal_charstring.o Verdicttype.o XER.o XmlReader.o TitanLoggerControlImpl.o TCov.o JSON.o Profiler.o ProfilerTools.o Debugger.o DebuggerUI.o OER.o ../common/memory.o ../common/pattern_la.o ../common/pattern_p.o ../common/config_preproc.o ../common/config_preproc_la.o ../common/config_preproc_p.tab.o ../common/path.o ../common/pattern_uni.o ../common/Quadruple.o ../common/NetworkHandler.o ../common/Path2.o ../common/ModuleVersion.o ../common/JSON_Tokenizer.o ../common/UnicharPattern.o LoggerPlugin_dynamic.o Single_main.o -Ldefault/lib -lcrypto -lxml2 [ 598s] /usr/bin/ld: LoggerPlugin_dynamic.o: undefined reference to symbol 'dlopen@@GLIBC_2.1' [ 598s] //lib/i386-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line [ 598s] collect2: error: ld returned 1 exit status [ 598s] Makefile:344: recipe for target 'libttcn3-dynamic.so' failed [ 598s] make[2]: *** [libttcn3-dynamic.so] Error 1 [ 598s] make[2]: Leaving directory '/usr/src/packages/BUILD/core' [ 598s] Makefile:65: recipe for target 'all' failed [ 598s] make[1]: *** [all] Error 2 [ 598s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 598s] dh_auto_build: make -j1 returned exit code 2 [ 598s] debian/rules:6: recipe for target 'build' failed [ 598s] make: *** [build] Error 2 [ 598s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 598s] [ 598s] lamb02 failed "build eclipse-titan_6.3.1-1.dsc" at Tue Jul 3 12:10:56 UTC 2018. [ 598s] [ 598s] ### VM INTERACTION START ### [ 601s] [ 591.708880] reboot: Power down [ 601s] ### VM INTERACTION END ### [ 601s] [ 601s] lamb02 failed "build eclipse-titan_6.3.1-1.dsc" at Tue Jul 3 12:10:59 UTC 2018. [ 601s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From jenkins at lists.osmocom.org Tue Jul 3 12:26:34 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Tue, 3 Jul 2018 12:26:34 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-gapk_=C2=BB_a1=3Ddefaul?= =?UTF-8?Q?t,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#3?= In-Reply-To: <335297667.31.1530618104176.JavaMail.jenkins@jenkins.osmocom.org> References: <335297667.31.1530618104176.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <639984805.32.1530620794068.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 67.45 KB...] libtool: install: (cd && { ln -s -f libosmosim.so.0.0.2 libosmosim.so.0 || { rm -f libosmosim.so.0 && ln -s libosmosim.so.0.0.2 libosmosim.so.0; }; }) libtool: install: (cd && { ln -s -f libosmosim.so.0.0.2 libosmosim.so || { rm -f libosmosim.so && ln -s libosmosim.so.0.0.2 libosmosim.so; }; }) libtool: install: /usr/bin/install -c .libs/libosmosim.lai libtool: finish: PATH="/usr/local/bin:/usr/bin:/bin:/usr/games:/home/osmocom-build/bin:/sbin" ldconfig -n ---------------------------------------------------------------------- Libraries have been installed in: If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the '-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the 'LD_RUN_PATH' environment variable during linking - use the '-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to '/etc/ld.so.conf' See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- make[3]: Leaving directory ' make[2]: Leaving directory ' Making install in src/pseudotalloc make[2]: Entering directory ' make[3]: Entering directory ' make[3]: Leaving directory ' make[2]: Leaving directory ' Making install in utils make[2]: Entering directory ' CC osmo-arfcn.o CC osmo-auc-gen.o CC osmo_sim_test-osmo-sim-test.o CCLD osmo-arfcn CCLD osmo-auc-gen CCLD osmo-sim-test make[3]: Entering directory ' make[3]: Nothing to be done for 'install-data-am'. /bin/mkdir -p ' /bin/bash ../libtool --mode=install /usr/bin/install -c osmo-arfcn osmo-auc-gen ' libtool: install: /usr/bin/install -c .libs/osmo-arfcn libtool: install: /usr/bin/install -c .libs/osmo-auc-gen make[3]: Leaving directory ' make[2]: Leaving directory ' Making install in tests make[2]: Entering directory ' GEN conv/gsm0503_test_vectors.c Generating test vectors... Generate 'xcch' test vector Generate 'rach' test vector Generate 'rach_ext' test vector Generate 'sch' test vector Generate 'cs2' test vector Generate 'cs3' test vector Generate 'cs2_np' test vector Generate 'cs3_np' test vector Generate 'tch_afs_12_2' test vector Generate 'tch_afs_10_2' test vector Generate 'tch_afs_7_95' test vector Generate 'tch_afs_7_4' test vector Generate 'tch_afs_6_7' test vector Generate 'tch_afs_5_9' test vector Generate 'tch_afs_5_15' test vector Generate 'tch_afs_4_75' test vector Generate 'tch_fr' test vector Generate 'tch_hr' test vector Generate 'tch_ahs_7_95' test vector Generate 'tch_ahs_7_4' test vector Generate 'tch_ahs_6_7' test vector Generate 'tch_ahs_5_9' test vector Generate 'tch_ahs_5_15' test vector Generate 'tch_ahs_4_75' test vector Generate 'mcs1_dl_hdr' test vector Generate 'mcs1_ul_hdr' test vector Generate 'mcs1' test vector Generate 'mcs2' test vector Generate 'mcs3' test vector Generate 'mcs4' test vector Generate 'mcs5_dl_hdr' test vector Generate 'mcs5_ul_hdr' test vector Generate 'mcs5' test vector Generate 'mcs6' test vector Generate 'mcs7_dl_hdr' test vector Generate 'mcs7_ul_hdr' test vector Generate 'mcs7' test vector Generate 'mcs8' test vector Generate 'mcs9' test vector Generation complete. make install-am make[3]: Entering directory ' make[4]: Entering directory ' make[4]: Nothing to be done for 'install-exec-am'. make[4]: Nothing to be done for 'install-data-am'. make[4]: Leaving directory ' make[3]: Leaving directory ' make[2]: Leaving directory ' make[2]: Entering directory ' make[3]: Entering directory ' /bin/mkdir -p ' /bin/mkdir -p ' /bin/mkdir -p ' /usr/bin/install -c -m 644 libosmocore.pc libosmocodec.pc libosmovty.pc libosmogsm.pc libosmogb.pc libosmoctrl.pc libosmocoding.pc libosmosim.pc ' /usr/bin/install -c osmo-release.sh ' /usr/bin/install -c -m 644 osmo-release.mk ' make install-data-hook make[4]: Entering directory ' make[4]: Nothing to be done for 'install-data-hook'. make[4]: Leaving directory ' make[3]: Leaving directory ' make[2]: Leaving directory ' make[1]: Leaving directory ' + STOW_DIR= stow --restow libosmocore + find . -name *.[hc] + verify_value_string_arrays_are_terminated.py ./libgsmhr/libgsmhr.c ./deps/install/stow/libosmocore/include/osmocom/crypt/gprs_cipher.h ./deps/install/stow/libosmocore/include/osmocom/crypt/auth.h ./deps/install/stow/libosmocore/include/osmocom/vty/buffer.h ./deps/install/stow/libosmocore/include/osmocom/vty/vty.h ./deps/install/stow/libosmocore/include/osmocom/vty/command.h ./deps/install/stow/libosmocore/include/osmocom/vty/ports.h ./deps/install/stow/libosmocore/include/osmocom/vty/telnet_interface.h ./deps/install/stow/libosmocore/include/osmocom/vty/vector.h ./deps/install/stow/libosmocore/include/osmocom/vty/logging.h ./deps/install/stow/libosmocore/include/osmocom/vty/misc.h ./deps/install/stow/libosmocore/include/osmocom/vty/stats.h ./deps/install/stow/libosmocore/include/osmocom/codec/codec.h ./deps/install/stow/libosmocore/include/osmocom/codec/gsm610_bits.h ./deps/install/stow/libosmocore/include/osmocom/codec/ecu.h ./deps/install/stow/libosmocore/include/osmocom/coding/gsm0503_mapping.h ./deps/install/stow/libosmocore/include/osmocom/coding/gsm0503_interleaving.h ./deps/install/stow/libosmocore/include/osmocom/coding/gsm0503_tables.h ./deps/install/stow/libosmocore/include/osmocom/coding/gsm0503_coding.h ./deps/install/stow/libosmocore/include/osmocom/coding/gsm0503_parity.h ./deps/install/stow/libosmocore/include/osmocom/sim/sim.h ./deps/install/stow/libosmocore/include/osmocom/sim/class_tables.h ./deps/install/stow/libosmocore/include/osmocom/core/byteswap.h ./deps/install/stow/libosmocore/include/osmocom/core/timer_compat.h ./deps/install/stow/libosmocore/include/osmocom/core/msgb.h ./deps/install/stow/libosmocore/include/osmocom/core/crc64gen.h ./deps/install/stow/libosmocore/include/osmocom/core/serial.h ./deps/install/stow/libosmocore/include/osmocom/core/backtrace.h ./deps/install/stow/libosmocore/include/osmocom/core/stat_item.h ./deps/install/stow/libosmocore/include/osmocom/core/conv.h ./deps/install/stow/libosmocore/include/osmocom/core/crcgen.h ./deps/install/stow/libosmocore/include/osmocom/core/linuxrbtree.h ./deps/install/stow/libosmocore/include/osmocom/core/strrb.h ./deps/install/stow/libosmocore/include/osmocom/core/crc8gen.h ./deps/install/stow/libosmocore/include/osmocom/core/timer.h ./deps/install/stow/libosmocore/include/osmocom/core/sercomm.h ./deps/install/stow/libosmocore/include/osmocom/core/talloc.h ./deps/install/stow/libosmocore/include/osmocom/core/socket.h ./deps/install/stow/libosmocore/include/osmocom/core/bitvec.h ./deps/install/stow/libosmocore/include/osmocom/core/bits.h ./deps/install/stow/libosmocore/include/osmocom/core/isdnhdlc.h ./deps/install/stow/libosmocore/include/osmocom/core/bitcomp.h ./deps/install/stow/libosmocore/include/osmocom/core/prim.h ./deps/install/stow/libosmocore/include/osmocom/core/loggingrb.h ./deps/install/stow/libosmocore/include/osmocom/core/linuxlist.h ./deps/install/stow/libosmocore/include/osmocom/core/counter.h ./deps/install/stow/libosmocore/include/osmocom/core/bit32gen.h ./deps/install/stow/libosmocore/include/osmocom/core/logging.h ./deps/install/stow/libosmocore/include/osmocom/core/gsmtap_util.h ./deps/install/stow/libosmocore/include/osmocom/core/endian.h ./deps/install/stow/libosmocore/include/osmocom/core/defs.h ./deps/install/stow/libosmocore/include/osmocom/core/fsm.h ./deps/install/stow/libosmocore/include/osmocom/core/statistics.h ./deps/install/stow/libosmocore/include/osmocom/core/msgfile.h ./deps/install/stow/libosmocore/include/osmocom/core/gsmtap.h ./deps/install/stow/libosmocore/include/osmocom/core/plugin.h ./deps/install/stow/libosmocore/include/osmocom/core/prbs.h ./deps/install/stow/libosmocore/include/osmocom/core/write_queue.h ./deps/install/stow/libosmocore/include/osmocom/core/macaddr.h ./deps/install/stow/libosmocore/include/osmocom/core/bit64gen.h ./deps/install/stow/libosmocore/include/osmocom/core/rate_ctr.h ./deps/install/stow/libosmocore/include/osmocom/core/panic.h ./deps/install/stow/libosmocore/include/osmocom/core/process.h ./deps/install/stow/libosmocore/include/osmocom/core/crc16gen.h ./deps/install/stow/libosmocore/include/osmocom/core/select.h ./deps/install/stow/libosmocore/include/osmocom/core/crc16.h ./deps/install/stow/libosmocore/include/osmocom/core/crc32gen.h ./deps/install/stow/libosmocore/include/osmocom/core/utils.h ./deps/install/stow/libosmocore/include/osmocom/core/application.h ./deps/install/stow/libosmocore/include/osmocom/core/signal.h ./deps/install/stow/libosmocore/include/osmocom/core/bit16gen.h ./deps/install/stow/libosmocore/include/osmocom/core/stats.h ./deps/install/stow/libosmocore/include/osmocom/ctrl/ports.h ./deps/install/stow/libosmocore/include/osmocom/ctrl/control_if.h ./deps/install/stow/libosmocore/include/osmocom/ctrl/control_cmd.h ./deps/install/stow/libosmocore/include/osmocom/ctrl/control_vty.h ./deps/install/stow/libosmocore/include/osmocom/gsm/mncc.h ./deps/install/stow/libosmocore/include/osmocom/gsm/l1sap.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm23003.h ./deps/install/stow/libosmocore/include/osmocom/gsm/meas_rep.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm0480.h ./deps/install/stow/libosmocore/include/osmocom/gsm/comp128v23.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm0411_smc.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm0502.h ./deps/install/stow/libosmocore/include/osmocom/gsm/oap.h ./deps/install/stow/libosmocore/include/osmocom/gsm/lapd_core.h ./deps/install/stow/libosmocore/include/osmocom/gsm/lapdm.h ./deps/install/stow/libosmocore/include/osmocom/gsm/bitvec_gsm.h ./deps/install/stow/libosmocore/include/osmocom/gsm/a5.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gan.h ./deps/install/stow/libosmocore/include/osmocom/gsm/rxlev_stat.h ./deps/install/stow/libosmocore/include/osmocom/gsm/prim.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm0808_utils.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm0411_utils.h ./deps/install/stow/libosmocore/include/osmocom/gsm/bts_features.h ./deps/install/stow/libosmocore/include/osmocom/gsm/abis_nm.h ./deps/install/stow/libosmocore/include/osmocom/gsm/apn.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm0411_smr.h ./deps/install/stow/libosmocore/include/osmocom/gsm/ipa.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_04_80.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_12_21.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/ipaccess.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/smpp34_osmocom.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_04_08_gprs.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_08_08.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_09_02.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_03_40.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_23_003.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_04_14.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_04_12.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_44_318.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_03_41.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_04_08.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_08_58.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_04_11.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm0341.h ./deps/install/stow/libosmocore/include/osmocom/gsm/rsl.h ./deps/install/stow/libosmocore/include/osmocom/gsm/comp128.h ./deps/install/stow/libosmocore/include/osmocom/gsm/sysinfo.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsup.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm48.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm0808.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm0503.h ./deps/install/stow/libosmocore/include/osmocom/gsm/tlv.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm48_ie.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm_utils.h ./deps/install/stow/libosmocore/include/osmocom/gprs/gprs_ns_frgre.h ./deps/install/stow/libosmocore/include/osmocom/gprs/gprs_bssgp.h ./deps/install/stow/libosmocore/include/osmocom/gprs/gprs_bssgp_bss.h ./deps/install/stow/libosmocore/include/osmocom/gprs/protocol/gsm_08_18.h ./deps/install/stow/libosmocore/include/osmocom/gprs/protocol/gsm_08_16.h ./deps/install/stow/libosmocore/include/osmocom/gprs/protocol/gsm_04_60.h ./deps/install/stow/libosmocore/include/osmocom/gprs/gprs_rlc.h ./deps/install/stow/libosmocore/include/osmocom/gprs/gprs_msgb.h ./deps/install/stow/libosmocore/include/osmocom/gprs/gprs_ns.h ./deps/libosmocore/config.h ./deps/libosmocore/utils/osmo-auc-gen.c ./deps/libosmocore/utils/osmo-arfcn.c ./deps/libosmocore/utils/osmo-sim-test.c ./deps/libosmocore/src/logging_syslog.c ./deps/libosmocore/src/stats_statsd.c ./deps/libosmocore/src/panic.c ./deps/libosmocore/src/backtrace.c ./deps/libosmocore/src/timer.c ./deps/libosmocore/src/sercomm.c ./deps/libosmocore/src/crc32gen.c ./deps/libosmocore/src/logging_gsmtap.c ./deps/libosmocore/src/crc64gen.c ./deps/libosmocore/src/timer_gettimeofday.c ./deps/libosmocore/src/prim.c ./deps/libosmocore/src/gb/common_vty.c ./deps/libosmocore/src/gb/gprs_bssgp_util.c ./deps/libosmocore/src/gb/gprs_bssgp.c ./deps/libosmocore/src/gb/gprs_ns_vty.c ./deps/libosmocore/src/gb/gprs_ns_frgre.c ./deps/libosmocore/src/gb/gprs_bssgp_bss.c ./deps/libosmocore/src/gb/gprs_ns.c ./deps/libosmocore/src/gb/common_vty.h ./deps/libosmocore/src/gb/gprs_bssgp_vty.c ./deps/libosmocore/src/bitvec.c ./deps/libosmocore/src/isdnhdlc.c ./deps/libosmocore/src/utils.c ./deps/libosmocore/src/strrb.c ./deps/libosmocore/src/conv_acc_sse.c ./deps/libosmocore/src/conv_acc_sse_impl.h ./deps/libosmocore/src/conv.c ./deps/libosmocore/src/crc16.c ./deps/libosmocore/src/vty/buffer.c ./deps/libosmocore/src/vty/vector.c ./deps/libosmocore/src/vty/utils.c ./deps/libosmocore/src/vty/telnet_interface.c ./deps/libosmocore/src/vty/command.c ./deps/libosmocore/src/vty/logging_vty.c ./deps/libosmocore/src/vty/talloc_ctx_vty.c ./deps/libosmocore/src/vty/stats_vty.c ./deps/libosmocore/src/vty/fsm_vty.c ./deps/libosmocore/src/vty/vty.c ./deps/libosmocore/src/bitcomp.c ./deps/libosmocore/src/signal.c ./deps/libosmocore/src/serial.c ./deps/libosmocore/src/crc16gen.c ./deps/libosmocore/src/prbs.c ./deps/libosmocore/src/codec/gsm660.c ./deps/libosmocore/src/codec/gsm610.c ./deps/libosmocore/src/codec/gsm620.c ./deps/libosmocore/src/codec/ecu_fr.c ./deps/libosmocore/src/codec/gsm690.c ./deps/libosmocore/src/socket.c ./deps/libosmocore/src/conv_acc_generic.c ./deps/libosmocore/src/msgb.c ./deps/libosmocore/src/coding/gsm0503_parity.c ./deps/libosmocore/src/coding/gsm0503_interleaving.c ./deps/libosmocore/src/coding/gsm0503_coding.c ./deps/libosmocore/src/coding/gsm0503_mapping.c ./deps/libosmocore/src/coding/gsm0503_tables.c ./deps/libosmocore/src/bits.c ./deps/libosmocore/src/sim/class_tables.c ./deps/libosmocore/src/sim/gsm_int.h ./deps/libosmocore/src/sim/sim_int.h ./deps/libosmocore/src/sim/reader.c ./deps/libosmocore/src/sim/card_fs_usim.c ./deps/libosmocore/src/sim/reader_pcsc.c ./deps/libosmocore/src/sim/card_fs_isim.c ./deps/libosmocore/src/sim/core.c ./deps/libosmocore/src/sim/card_fs_sim.c ./deps/libosmocore/src/sim/card_fs_uicc.c ./deps/libosmocore/src/sim/card_fs_tetra.c ./deps/libosmocore/src/rbtree.c ./deps/libosmocore/src/timer_clockgettime.c ./deps/libosmocore/src/plugin.c ./deps/libosmocore/src/conv_acc_sse_avx.c ./deps/libosmocore/src/stat_item.c ./deps/libosmocore/src/counter.c ./deps/libosmocore/src/application.c ./deps/libosmocore/src/ctrl/control_cmd.c ./deps/libosmocore/src/ctrl/control_vty.c ./deps/libosmocore/src/ctrl/control_if.c ./deps/libosmocore/src/ctrl/fsm_ctrl_commands.c ./deps/libosmocore/src/msgfile.c ./deps/libosmocore/src/gsm/gsm0808.c ./deps/libosmocore/src/gsm/lapdm.c ./deps/libosmocore/src/gsm/gsm_utils.c ./deps/libosmocore/src/gsm/oap.c ./deps/libosmocore/src/gsm/gsm0341.c ./deps/libosmocore/src/gsm/gea.c ./deps/libosmocore/src/gsm/gsm0411_smc.c ./deps/libosmocore/src/gsm/milenage/common.h ./deps/libosmocore/src/gsm/milenage/milenage.c ./deps/libosmocore/src/gsm/milenage/includes.h ./deps/libosmocore/src/gsm/milenage/aes-encblock.c ./deps/libosmocore/src/gsm/milenage/aes.h ./deps/libosmocore/src/gsm/milenage/milenage.h ./deps/libosmocore/src/gsm/milenage/aes-internal-enc.c ./deps/libosmocore/src/gsm/milenage/aes_wrap.h ./deps/libosmocore/src/gsm/milenage/crypto.h ./deps/libosmocore/src/gsm/milenage/aes-internal.c ./deps/libosmocore/src/gsm/milenage/aes_i.h ./deps/libosmocore/src/gsm/gan.c ./deps/libosmocore/src/gsm/comp128v23.c ./deps/libosmocore/src/gsm/comp128.c ./deps/libosmocore/src/gsm/gsm0503_conv.c ./deps/libosmocore/src/gsm/rsl.c ./deps/libosmocore/src/gsm/gsm_04_08_gprs.c ./deps/libosmocore/src/gsm/sysinfo.c ./deps/libosmocore/src/gsm/auth_milenage.c ./deps/libosmocore/src/gsm/gprs_cipher_core.c ./deps/libosmocore/src/gsm/gprs_rlc.c ./deps/libosmocore/src/gsm/bts_features.c ./deps/libosmocore/src/gsm/auth_comp128v23.c ./deps/libosmocore/src/gsm/kasumi.c ./deps/libosmocore/src/gsm/gsm0411_utils.c ./deps/libosmocore/src/gsm/gsm48_ie.c ./deps/libosmocore/src/gsm/gsup.c ./deps/libosmocore/src/gsm/gsm0411_smr.c ./deps/libosmocore/src/gsm/tlv_parser.c ./deps/libosmocore/src/gsm/auth_comp128v1.c ./deps/libosmocore/src/gsm/gsm0808_utils.c ./deps/libosmocore/src/gsm/apn.c ./deps/libosmocore/src/gsm/a5.c ./deps/libosmocore/src/gsm/gsm48.c ./deps/libosmocore/src/gsm/lapd_core.c ./deps/libosmocore/src/gsm/gsm0502.c ./deps/libosmocore/src/gsm/gsm0414.c ./deps/libosmocore/src/gsm/gprs_gea.c ./deps/libosmocore/src/gsm/rxlev_stat.c ./deps/libosmocore/src/gsm/auth_core.c ./deps/libosmocore/src/gsm/gsm0480.c ./deps/libosmocore/src/gsm/gsm23003.c ./deps/libosmocore/src/gsm/abis_nm.c ./deps/libosmocore/src/gsm/ipa.c ./deps/libosmocore/src/gsm/mncc.c ./deps/libosmocore/src/stats.c ./deps/libosmocore/src/fsm.c ./deps/libosmocore/src/macaddr.c ./deps/libosmocore/src/logging.c ./deps/libosmocore/src/crc8gen.c ./deps/libosmocore/src/gsmtap_util.c ./deps/libosmocore/src/rate_ctr.c ./deps/libosmocore/src/conv_acc.c ./deps/libosmocore/src/write_queue.c ./deps/libosmocore/src/pseudotalloc/talloc.h ./deps/libosmocore/src/pseudotalloc/pseudotalloc.c ./deps/libosmocore/src/loggingrb.c ./deps/libosmocore/src/select.c ./deps/libosmocore/include/osmocom/crypt/gprs_cipher.h ./deps/libosmocore/include/osmocom/crypt/auth.h ./deps/libosmocore/include/osmocom/vty/buffer.h ./deps/libosmocore/include/osmocom/vty/vty.h ./deps/libosmocore/include/osmocom/vty/command.h ./deps/libosmocore/include/osmocom/vty/ports.h ./deps/libosmocore/include/osmocom/vty/telnet_interface.h ./deps/libosmocore/include/osmocom/vty/vector.h ./deps/libosmocore/include/osmocom/vty/logging.h ./deps/libosmocore/include/osmocom/vty/misc.h ./deps/libosmocore/include/osmocom/vty/stats.h ./deps/libosmocore/include/osmocom/codec/codec.h ./deps/libosmocore/include/osmocom/codec/gsm610_bits.h ./deps/libosmocore/include/osmocom/codec/ecu.h ./deps/libosmocore/include/osmocom/coding/gsm0503_mapping.h ./deps/libosmocore/include/osmocom/coding/gsm0503_interleaving.h ./deps/libosmocore/include/osmocom/coding/gsm0503_tables.h ./deps/libosmocore/include/osmocom/coding/gsm0503_coding.h ./deps/libosmocore/include/osmocom/coding/gsm0503_parity.h ./deps/libosmocore/include/osmocom/sim/sim.h ./deps/libosmocore/include/osmocom/sim/class_tables.h ./deps/libosmocore/include/osmocom/core/byteswap.h ./deps/libosmocore/include/osmocom/core/timer_compat.h ./deps/libosmocore/include/osmocom/core/msgb.h ./deps/libosmocore/include/osmocom/core/crc64gen.h ./deps/libosmocore/include/osmocom/core/serial.h ./deps/libosmocore/include/osmocom/core/backtrace.h ./deps/libosmocore/include/osmocom/core/stat_item.h ./deps/libosmocore/include/osmocom/core/conv.h ./deps/libosmocore/include/osmocom/core/crcgen.h ./deps/libosmocore/include/osmocom/core/linuxrbtree.h ./deps/libosmocore/include/osmocom/core/strrb.h ./deps/libosmocore/include/osmocom/core/crc8gen.h ./deps/libosmocore/include/osmocom/core/timer.h ./deps/libosmocore/include/osmocom/core/sercomm.h ./deps/libosmocore/include/osmocom/core/talloc.h ./deps/libosmocore/include/osmocom/core/socket.h ./deps/libosmocore/include/osmocom/core/bitvec.h ./deps/libosmocore/include/osmocom/core/bits.h ./deps/libosmocore/include/osmocom/core/isdnhdlc.h ./deps/libosmocore/include/osmocom/core/bitcomp.h ./deps/libosmocore/include/osmocom/core/prim.h ./deps/libosmocore/include/osmocom/core/loggingrb.h ./deps/libosmocore/include/osmocom/core/linuxlist.h ./deps/libosmocore/include/osmocom/core/counter.h ./deps/libosmocore/include/osmocom/core/bit32gen.h ./deps/libosmocore/include/osmocom/core/logging.h ./deps/libosmocore/include/osmocom/core/gsmtap_util.h ./deps/libosmocore/include/osmocom/core/endian.h ./deps/libosmocore/include/osmocom/core/defs.h ./deps/libosmocore/include/osmocom/core/fsm.h ./deps/libosmocore/include/osmocom/core/statistics.h ./deps/libosmocore/include/osmocom/core/msgfile.h ./deps/libosmocore/include/osmocom/core/gsmtap.h ./deps/libosmocore/include/osmocom/core/plugin.h ./deps/libosmocore/include/osmocom/core/prbs.h ./deps/libosmocore/include/osmocom/core/write_queue.h ./deps/libosmocore/include/osmocom/core/macaddr.h ./deps/libosmocore/include/osmocom/core/bit64gen.h ./deps/libosmocore/include/osmocom/core/rate_ctr.h ./deps/libosmocore/include/osmocom/core/panic.h ./deps/libosmocore/include/osmocom/core/process.h ./deps/libosmocore/include/osmocom/core/crc16gen.h ./deps/libosmocore/include/osmocom/core/select.h ./deps/libosmocore/include/osmocom/core/crc16.h ./deps/libosmocore/include/osmocom/core/crc32gen.h ./deps/libosmocore/include/osmocom/core/utils.h ./deps/libosmocore/include/osmocom/core/application.h ./deps/libosmocore/include/osmocom/core/signal.h ./deps/libosmocore/include/osmocom/core/bit16gen.h ./deps/libosmocore/include/osmocom/core/stats.h ./deps/libosmocore/include/osmocom/ctrl/ports.h ./deps/libosmocore/include/osmocom/ctrl/control_if.h ./deps/libosmocore/include/osmocom/ctrl/control_cmd.h ./deps/libosmocore/include/osmocom/ctrl/control_vty.h ./deps/libosmocore/include/osmocom/gsm/mncc.h ./deps/libosmocore/include/osmocom/gsm/l1sap.h ./deps/libosmocore/include/osmocom/gsm/gsm23003.h ./deps/libosmocore/include/osmocom/gsm/meas_rep.h ./deps/libosmocore/include/osmocom/gsm/gsm0480.h ./deps/libosmocore/include/osmocom/gsm/gea.h ./deps/libosmocore/include/osmocom/gsm/comp128v23.h ./deps/libosmocore/include/osmocom/gsm/gsm0411_smc.h ./deps/libosmocore/include/osmocom/gsm/kasumi.h ./deps/libosmocore/include/osmocom/gsm/gsm0502.h ./deps/libosmocore/include/osmocom/gsm/oap.h ./deps/libosmocore/include/osmocom/gsm/lapd_core.h ./deps/libosmocore/include/osmocom/gsm/lapdm.h ./deps/libosmocore/include/osmocom/gsm/bitvec_gsm.h ./deps/libosmocore/include/osmocom/gsm/a5.h ./deps/libosmocore/include/osmocom/gsm/gan.h ./deps/libosmocore/include/osmocom/gsm/rxlev_stat.h ./deps/libosmocore/include/osmocom/gsm/prim.h ./deps/libosmocore/include/osmocom/gsm/gsm0808_utils.h ./deps/libosmocore/include/osmocom/gsm/gsm0411_utils.h ./deps/libosmocore/include/osmocom/gsm/bts_features.h ./deps/libosmocore/include/osmocom/gsm/abis_nm.h ./deps/libosmocore/include/osmocom/gsm/apn.h ./deps/libosmocore/include/osmocom/gsm/gsm0411_smr.h ./deps/libosmocore/include/osmocom/gsm/ipa.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_04_80.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_12_21.h ./deps/libosmocore/include/osmocom/gsm/protocol/ipaccess.h ./deps/libosmocore/include/osmocom/gsm/protocol/smpp34_osmocom.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_04_08_gprs.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_08_08.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_09_02.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_03_40.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_23_003.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_04_14.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_04_12.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_44_318.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_03_41.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_04_08.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_08_58.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_04_11.h ./deps/libosmocore/include/osmocom/gsm/gsm0341.h ./deps/libosmocore/include/osmocom/gsm/rsl.h ./deps/libosmocore/include/osmocom/gsm/comp128.h ./deps/libosmocore/include/osmocom/gsm/sysinfo.h ./deps/libosmocore/include/osmocom/gsm/gsup.h ./deps/libosmocore/include/osmocom/gsm/gsm48.h ./deps/libosmocore/include/osmocom/gsm/gsm0808.h ./deps/libosmocore/include/osmocom/gsm/gsm0503.h ./deps/libosmocore/include/osmocom/gsm/tlv.h ./deps/libosmocore/include/osmocom/gsm/gsm48_ie.h ./deps/libosmocore/include/osmocom/gsm/gsm_utils.h ./deps/libosmocore/include/osmocom/gprs/gprs_ns_frgre.h ./deps/libosmocore/include/osmocom/gprs/gprs_bssgp.h ./deps/libosmocore/include/osmocom/gprs/gprs_bssgp_bss.h ./deps/libosmocore/include/osmocom/gprs/protocol/gsm_08_18.h ./deps/libosmocore/include/osmocom/gprs/protocol/gsm_08_16.h ./deps/libosmocore/include/osmocom/gprs/protocol/gsm_04_60.h ./deps/libosmocore/include/osmocom/gprs/gprs_rlc.h ./deps/libosmocore/include/osmocom/gprs/gprs_msgb.h ./deps/libosmocore/include/osmocom/gprs/gprs_ns.h ./deps/libosmocore/tests/gsup/gsup_test.c ./deps/libosmocore/tests/comp128/comp128_test.c ./deps/libosmocore/tests/gsm0808/gsm0808_test.c ./deps/libosmocore/tests/socket/socket_test.c ./deps/libosmocore/tests/logging/logging_test.c ./deps/libosmocore/tests/tlv/tlv_test.c ./deps/libosmocore/tests/gb/gprs_ns_test.c ./deps/libosmocore/tests/gb/gprs_bssgp_test.c ./deps/libosmocore/tests/gb/bssgp_fc_test.c ./deps/libosmocore/tests/utils/utils_test.c ./deps/libosmocore/tests/timer/clk_override_test.c ./deps/libosmocore/tests/timer/timer_test.c ./deps/libosmocore/tests/gsm23003/gsm23003_test.c ./deps/libosmocore/tests/a5/a5_test.c ./deps/libosmocore/tests/kasumi/kasumi_test.c ./deps/libosmocore/tests/vty/vty_test.c ./deps/libosmocore/tests/libsercomstub.c ./deps/libosmocore/tests/sercomm/sercomm_test.c ./deps/libosmocore/tests/auth/milenage_test.c ./deps/libosmocore/tests/msgfile/msgfile_test.c ./deps/libosmocore/tests/ussd/ussd_test.c ./deps/libosmocore/tests/codec/codec_test.c ./deps/libosmocore/tests/codec/codec_ecu_fr_test.c ./deps/libosmocore/tests/prbs/prbs_test.c ./deps/libosmocore/tests/bitvec/bitvec_test.c ./deps/libosmocore/tests/gsm0408/gsm0408_test.c ./deps/libosmocore/tests/coding/coding_test.c ./deps/libosmocore/tests/strrb/strrb_test.c ./deps/libosmocore/tests/endian/endian_test.c ./deps/libosmocore/tests/msgb/msgb_test.c ./deps/libosmocore/tests/sim/sim_test.c ./deps/libosmocore/tests/write_queue/wqueue_test.c ./deps/libosmocore/tests/fsm/fsm_test.c ./deps/libosmocore/tests/oap/oap_test.c ./deps/libosmocore/tests/ctrl/ctrl_test.c ./deps/libosmocore/tests/fr/fr_test.c ./deps/libosmocore/tests/lapd/lapd_test.c ./deps/libosmocore/tests/sms/sms_test.c ./deps/libosmocore/tests/gea/gea_test.c ./deps/libosmocore/tests/loggingrb/loggingrb_test.c ./deps/libosmocore/tests/conv/gsm0503_test_vectors.c ./deps/libosmocore/tests/conv/conv.h ./deps/libosmocore/tests/conv/conv_test.c ./deps/libosmocore/tests/conv/conv.c ./deps/libosmocore/tests/conv/conv_gsm0503_test.c ./deps/libosmocore/tests/bits/bitrev_test.c ./deps/libosmocore/tests/bits/bitcomp_test.c ./deps/libosmocore/tests/bits/bitfield_test.c ./deps/libosmocore/tests/stats/stats_test.c ./deps/libosmocore/tests/abis/abis_test.c ./deps/libosmocore/tests/gprs/gprs_test.c ./deps/libosmocore/tests/smscb/gsm0341_test.c ./deps/libosmocore/tests/smscb/smscb_test.c ./src/codec_efr.c ./src/common.c ./src/codec_amr.c ./src/fmt_rtp_efr.c ./src/pq_rtp.c ./src/pq_codec.c ./src/fmt_rtp_amr.c ./src/fmt_ti.c ./src/app_osmo_gapk.c ./src/procqueue.c ./src/codec_pcm.c ./src/codecs.c ./src/benchmark.c ./src/pq_format.c ./src/fmt_rtp_hr_ietf.c ./src/fmt_racal.c ./src/fmt_rtp_hr_etsi.c ./src/ecu_fr.c ./src/fmt_rawpcm.c ./src/formats.c ./src/fmt_gsm.c ./src/fmt_amr.c ./src/pq_ecu.c ./src/pq_file.c ./src/pq_alsa.c ./src/codec_hr.c ./src/codec_fr.c ./src/fmt_amr_opencore.c ./src/fmt_hr_ref.c ./include/gsmhr/gsmhr.h ./include/osmocom/gapk/formats.h ./include/osmocom/gapk/common.h ./include/osmocom/gapk/codecs.h ./include/osmocom/gapk/bench.h ./include/osmocom/gapk/benchmark.h ./include/osmocom/gapk/procqueue.h ./include/osmocom/gapk/get_cycles.h ./include/osmocom/gapk/logging.h ./include/osmocom/gapk/utils.h ./tests/io/pq_file_test.c ./tests/io/pq_rtp_test.c ./tests/ecu/ecu_fr_test.c ./tests/procqueue/pq_test.c + export PKG_CONFIG_PATH=: + export LD_LIBRARY_PATH= + set +x =============================== gapk =============================== + cd + autoreconf --install --force libtoolize: putting auxiliary files in '.'. libtoolize: copying file './ltmain.sh' libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'. libtoolize: copying file 'm4/libtool.m4' libtoolize: copying file 'm4/ltoptions.m4' libtoolize: copying file 'm4/ltsugar.m4' libtoolize: copying file 'm4/ltversion.m4' libtoolize: copying file 'm4/lt~obsolete.m4' configure.ac:7: installing './compile' configure.ac:7: installing './config.guess' configure.ac:7: installing './config.sub' configure.ac:6: installing './install-sh' configure.ac:6: installing './missing' libgsmhr/Makefile.am: installing './depcomp' + ./configure --enable-sanitize checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu checking how to print strings... printf checking for style of include used by make... GNU checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking whether gcc understands -c and -o together... yes checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for fgrep... /bin/grep -F checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B checking the name lister (/usr/bin/nm -B) interface... BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 1572864 checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop checking for /usr/bin/ld option to reload object files... -r checking for objdump... objdump checking how to recognize dependent libraries... pass_all checking for dlltool... no checking how to associate runtime and link libraries... printf %s\n checking for ar... ar checking for archiver @FILE support... @ checking for strip... strip checking for ranlib... ranlib checking command to parse /usr/bin/nm -B output from gcc object... ok checking for sysroot... no checking for a working dd... /bin/dd checking how to truncate binary pipes... /bin/dd bs=4096 count=1 checking for mt... mt checking if mt is a manifest tool... no checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking for objdir... .libs checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC -DPIC checking if gcc PIC flag -fPIC -DPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.o... (cached) yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether make supports nested variables... (cached) yes checking for a Python interpreter with version >= 2.4... python checking for python... /usr/bin/python checking for python version... 2.7 checking for python platform... linux2 checking for python script directory... ${prefix}/lib/python2.7/dist-packages checking for python extension module directory... ${exec_prefix}/lib/python2.7/dist-packages checking if gcc supports -fvisibility=hidden... yes checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking whether gcc understands -c and -o together... (cached) yes checking dependency style of gcc... (cached) gcc3 checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for LIBOSMOCORE... yes checking for LIBOSMOCODEC... yes checking for LIBALSA... no configure: error: Package requirements (alsa) were not met: Package alsa was not found in the pkg-config search path. Perhaps you should add the directory containing `alsa.pc' to the PKG_CONFIG_PATH environment variable Package 'alsa', required by 'world', not found Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables LIBALSA_CFLAGS and LIBALSA_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Tue Jul 3 12:27:12 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 3 Jul 2018 12:27:12 +0000 Subject: Change in osmo-mgw[master]: mgcp_internal: remove unused struct member Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/9836 Change subject: mgcp_internal: remove unused struct member ...................................................................... mgcp_internal: remove unused struct member The struct member rtp_process_data in struct mgcp_rtp_end is unused and should be removed - remove rtp_process_data Change-Id: I3a66d159ce32359621ff2e772ee3421340b78cd5 --- M include/osmocom/mgcp/mgcp_internal.h 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/36/9836/1 diff --git a/include/osmocom/mgcp/mgcp_internal.h b/include/osmocom/mgcp/mgcp_internal.h index 7712593..1b9749d 100644 --- a/include/osmocom/mgcp/mgcp_internal.h +++ b/include/osmocom/mgcp/mgcp_internal.h @@ -137,8 +137,6 @@ int force_constant_ssrc; /* -1: always, 0: don't, 1: once */ /* should we perform align_rtp_timestamp_offset() (1) or not (0) */ int force_aligned_timing; - /* FIXME: not used anymore, used to be [external] transcoding related */ - void *rtp_process_data; /* Each end has a separate socket for RTP and RTCP */ struct osmo_fd rtp; -- To view, visit https://gerrit.osmocom.org/9836 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I3a66d159ce32359621ff2e772ee3421340b78cd5 Gerrit-Change-Number: 9836 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 12:27:13 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 3 Jul 2018 12:27:13 +0000 Subject: Change in osmo-mgw[master]: stats: replace packet statistic counters with libosmocore rate counters Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/9837 Change subject: stats: replace packet statistic counters with libosmocore rate counters ...................................................................... stats: replace packet statistic counters with libosmocore rate counters In struct mgcp_rtp_end one finds unsigned int counters. Those should be replaced with libosmocore rate counters - replace packets_rx, octets_rx, packets_tx, octets_tx and dropped_packets with libosmocore rate counters. Change-Id: I47c5c9006df5044e59ddebb895e62adb849d72d5 Related: OS#2517 --- M include/osmocom/mgcp/mgcp_internal.h M src/libosmo-mgcp/mgcp_conn.c M src/libosmo-mgcp/mgcp_network.c M src/libosmo-mgcp/mgcp_stat.c M src/libosmo-mgcp/mgcp_vty.c M tests/mgcp/mgcp_test.c 6 files changed, 37 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/37/9837/1 diff --git a/include/osmocom/mgcp/mgcp_internal.h b/include/osmocom/mgcp/mgcp_internal.h index 1b9749d..1e0421a 100644 --- a/include/osmocom/mgcp/mgcp_internal.h +++ b/include/osmocom/mgcp/mgcp_internal.h @@ -101,11 +101,11 @@ struct mgcp_rtp_end { /* statistics */ struct { - unsigned int packets_rx; - unsigned int octets_rx; - unsigned int packets_tx; - unsigned int octets_tx; - unsigned int dropped_packets; + struct rate_ctr *packets_rx; + struct rate_ctr *octets_rx; + struct rate_ctr *packets_tx; + struct rate_ctr *octets_tx; + struct rate_ctr *dropped_packets; } stats; /* local IP address of the RTP socket */ diff --git a/src/libosmo-mgcp/mgcp_conn.c b/src/libosmo-mgcp/mgcp_conn.c index e49559c..3943c69 100644 --- a/src/libosmo-mgcp/mgcp_conn.c +++ b/src/libosmo-mgcp/mgcp_conn.c @@ -34,19 +34,28 @@ enum { IN_STREAM_ERR_TSTMP_CTR, OUT_STREAM_ERR_TSTMP_CTR, + RTP_PACKETS_RX_CTR, + RTP_OCTETS_RX_CTR, + RTP_PACKETS_TX_CTR, + RTP_OCTETS_TX_CTR, + RTP_DROPPED_PACKETS_CTR }; static const struct rate_ctr_desc rate_ctr_desc[] = { [IN_STREAM_ERR_TSTMP_CTR] = {"stream_err_tstmp:in", "Inbound rtp-stream timestamp errors."}, [OUT_STREAM_ERR_TSTMP_CTR] = {"stream_err_tstmp:out", "Outbound rtp-stream timestamp errors."}, + [RTP_PACKETS_RX_CTR] = {"rtp:packets_rx", "Inbound rtp packets."}, + [RTP_OCTETS_RX_CTR] = {"rtp:octets_rx", "Inbound rtp octets."}, + [RTP_PACKETS_TX_CTR] = {"rtp:packets_tx", "Outbound rtp packets."}, + [RTP_OCTETS_TX_CTR] = {"rtp:octets_rx", "Outbound rtp octets."}, + [RTP_DROPPED_PACKETS_CTR] = {"rtp:dropped", "dropped rtp packets."} }; - const static struct rate_ctr_group_desc rate_ctr_group_desc = { .group_name_prefix = "conn_rtp", .group_description = "rtp connection statistics", .class_id = 1, - .num_ctr = 2, + .num_ctr = ARRAY_SIZE(rate_ctr_desc), .ctr_desc = rate_ctr_desc }; @@ -121,6 +130,12 @@ conn_rtp->rate_ctr_group = rate_ctr_group_alloc(conn, &rate_ctr_group_desc, rate_ctr_index); conn_rtp->state.in_stream.err_ts_ctr = &conn_rtp->rate_ctr_group->ctr[IN_STREAM_ERR_TSTMP_CTR]; conn_rtp->state.out_stream.err_ts_ctr = &conn_rtp->rate_ctr_group->ctr[OUT_STREAM_ERR_TSTMP_CTR]; + conn_rtp->end.stats.packets_rx = &conn_rtp->rate_ctr_group->ctr[RTP_PACKETS_RX_CTR]; + conn_rtp->end.stats.octets_rx = &conn_rtp->rate_ctr_group->ctr[RTP_OCTETS_RX_CTR]; + conn_rtp->end.stats.packets_tx = &conn_rtp->rate_ctr_group->ctr[RTP_PACKETS_TX_CTR]; + conn_rtp->end.stats.octets_tx = &conn_rtp->rate_ctr_group->ctr[RTP_OCTETS_TX_CTR]; + conn_rtp->end.stats.dropped_packets = &conn_rtp->rate_ctr_group->ctr[RTP_DROPPED_PACKETS_CTR]; + rate_ctr_index++; /* Make sure codec table is reset */ diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c index b47b76c..2bcf4c2 100644 --- a/src/libosmo-mgcp/mgcp_network.c +++ b/src/libosmo-mgcp/mgcp_network.c @@ -694,7 +694,7 @@ dest_name = conn_dst->conn->name; if (!rtp_end->output_enabled) { - rtp_end->stats.dropped_packets += 1; + rate_ctr_inc(rtp_end->stats.dropped_packets); LOGP(DRTP, LOGL_DEBUG, "endpoint:0x%x output disabled, drop to %s %s " "rtp_port:%u rtcp_port:%u\n", @@ -749,8 +749,8 @@ if (len <= 0) return len; - conn_dst->end.stats.packets_tx += 1; - conn_dst->end.stats.octets_tx += len; + rate_ctr_inc(conn_dst->end.stats.packets_tx); + rate_ctr_add(conn_dst->end.stats.octets_tx, len); nbytes += len; buflen = cont; @@ -939,8 +939,8 @@ } /* Increment RX statistics */ - conn->end.stats.packets_rx += 1; - conn->end.stats.octets_rx += rc; + rate_ctr_inc(conn->end.stats.packets_rx); + rate_ctr_add(conn->end.stats.octets_rx, rc); /* Forward a copy of the RTP data to a debug ip/port */ forward_data(fd->fd, &conn->tap_in, buf, rc); diff --git a/src/libosmo-mgcp/mgcp_stat.c b/src/libosmo-mgcp/mgcp_stat.c index cc723bb..97c354a 100644 --- a/src/libosmo-mgcp/mgcp_stat.c +++ b/src/libosmo-mgcp/mgcp_stat.c @@ -44,8 +44,8 @@ * Make sure the sign is correct and use the biggest * positive/negative number that fits. */ - *loss = *expected - end->stats.packets_rx; - if (*expected < end->stats.packets_rx) { + *loss = *expected - end->stats.packets_rx->current; + if (*expected < end->stats.packets_rx->current) { if (*loss > 0) *loss = INT_MIN; } else { @@ -74,9 +74,9 @@ jitter = calc_jitter(&conn->state); nchars = snprintf(str, str_len, - "\r\nP: PS=%u, OS=%u, PR=%u, OR=%u, PL=%d, JI=%u", - conn->end.stats.packets_tx, conn->end.stats.octets_tx, - conn->end.stats.packets_rx, conn->end.stats.octets_rx, + "\r\nP: PS=%lu, OS=%lu, PR=%lu, OR=%lu, PL=%d, JI=%u", + conn->end.stats.packets_tx->current, conn->end.stats.octets_tx->current, + conn->end.stats.packets_rx->current, conn->end.stats.octets_rx->current, ploss, jitter); if (nchars < 0 || nchars >= str_len) goto truncate; diff --git a/src/libosmo-mgcp/mgcp_vty.c b/src/libosmo-mgcp/mgcp_vty.c index a7a1feb..a579b16 100644 --- a/src/libosmo-mgcp/mgcp_vty.c +++ b/src/libosmo-mgcp/mgcp_vty.c @@ -161,7 +161,7 @@ vty_out(vty, " Timestamp Errs: %lu->%lu%s" - " Dropped Packets: %d%s" + " Dropped Packets: %lu%s" " Payload Type: %d Rate: %u Channels: %d %s" " Frame Duration: %u Frame Denominator: %u%s" " FPP: %d Packet Duration: %u%s" @@ -170,7 +170,7 @@ state->in_stream.err_ts_ctr->current, state->out_stream.err_ts_ctr->current, VTY_NEWLINE, - end->stats.dropped_packets, VTY_NEWLINE, + end->stats.dropped_packets->current, VTY_NEWLINE, codec->payload_type, codec->rate, codec->channels, VTY_NEWLINE, codec->frame_duration_num, codec->frame_duration_den, VTY_NEWLINE, end->frames_per_packet, end->packet_duration_ms, diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c index 1d2cf4a..7af1d23 100644 --- a/tests/mgcp/mgcp_test.c +++ b/tests/mgcp/mgcp_test.c @@ -944,15 +944,17 @@ int loss; struct mgcp_rtp_state state; struct mgcp_rtp_end rtp; + struct rate_ctr packets_rx; memset(&state, 0, sizeof(state)); memset(&rtp, 0, sizeof(rtp)); + rtp.stats.packets_rx = &packets_rx; state.stats.initialized = 1; state.stats.base_seq = pl_test_dat[i].base_seq; state.stats.max_seq = pl_test_dat[i].max_seq; state.stats.cycles = pl_test_dat[i].cycles; - rtp.stats.packets_rx = pl_test_dat[i].packets; + rtp.stats.packets_rx->current = pl_test_dat[i].packets; calc_loss(&state, &rtp, &expected, &loss); if (loss != pl_test_dat[i].loss -- To view, visit https://gerrit.osmocom.org/9837 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I47c5c9006df5044e59ddebb895e62adb849d72d5 Gerrit-Change-Number: 9837 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 12:53:29 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 3 Jul 2018 12:53:29 +0000 Subject: Change in pysim[master]: csv: fix missing import (broken CSV support) In-Reply-To: References: Message-ID: dexter has posted comments on this change. ( https://gerrit.osmocom.org/9546 ) Change subject: csv: fix missing import (broken CSV support) ...................................................................... Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/9546 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic5b067b16ec204c2ba2264b1ffb48d37be8d5eb3 Gerrit-Change-Number: 9546 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: dexter Gerrit-Comment-Date: Tue, 03 Jul 2018 12:53:29 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 12:53:37 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 3 Jul 2018 12:53:37 +0000 Subject: Change in pysim[master]: csv: fix missing import (broken CSV support) In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. ( https://gerrit.osmocom.org/9546 ) Change subject: csv: fix missing import (broken CSV support) ...................................................................... csv: fix missing import (broken CSV support) with Change I38f5d36d16b41b5d516a6a3e2ec1d09637883932, new constants for file identifiers were introduced. When csv file input is used, then pySim-prog.py uses one of these constans without importing it from ts_51_011.py - Add missing import Change-Id: Ic5b067b16ec204c2ba2264b1ffb48d37be8d5eb3 --- M pySim-prog.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved dexter: Verified diff --git a/pySim-prog.py b/pySim-prog.py index d70eac9..1685d2b 100755 --- a/pySim-prog.py +++ b/pySim-prog.py @@ -40,7 +40,7 @@ from pySim.commands import SimCardCommands from pySim.cards import _cards_classes from pySim.utils import h2b, swap_nibbles, rpad, derive_milenage_opc, calculate_luhn - +from pySim.ts_51_011 import EF def parse_options(): -- To view, visit https://gerrit.osmocom.org/9546 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ic5b067b16ec204c2ba2264b1ffb48d37be8d5eb3 Gerrit-Change-Number: 9546 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 13:17:01 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 3 Jul 2018 13:17:01 +0000 Subject: Change in pysim[master]: __init__: also fetch response bytes for USIMs automatically In-Reply-To: References: Message-ID: dexter has posted comments on this change. ( https://gerrit.osmocom.org/9575 ) Change subject: __init__: also fetch response bytes for USIMs automatically ...................................................................... Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/9575 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ied7fb78873a7c4109de471c7a5e9c3701ba0c7d5 Gerrit-Change-Number: 9575 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: dexter Gerrit-Comment-Date: Tue, 03 Jul 2018 13:17:01 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 13:17:04 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 3 Jul 2018 13:17:04 +0000 Subject: Change in pysim[master]: __init__: also fetch response bytes for USIMs automatically In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. ( https://gerrit.osmocom.org/9575 ) Change subject: __init__: also fetch response bytes for USIMs automatically ...................................................................... __init__: also fetch response bytes for USIMs automatically The method send_apdu() first transmits the APDU in the cards direction. The card may indicate that there is a response available by responding with SW1=9F, where SW2 is the number of bytes. send_apdu() will then craft a get-response APDU to pickup the response bytes. This mechanism works fine for SIM, but USIM uses SW1=61 to indicate the availability of a response, so lets also sense on SW1=61 to support USIMs as well. - Also check on SW1=61 to see if a response is available Change-Id: Ied7fb78873a7c4109de471c7a5e9c3701ba0c7d5 Related: SYS#4245 --- M pySim/transport/__init__.py 1 file changed, 7 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved dexter: Verified diff --git a/pySim/transport/__init__.py b/pySim/transport/__init__.py index 0a71117..9cd23d0 100644 --- a/pySim/transport/__init__.py +++ b/pySim/transport/__init__.py @@ -67,7 +67,13 @@ """ data, sw = self.send_apdu_raw(pdu) - if (sw is not None) and (sw[0:2] == '9f'): + # When whe have sent the first APDU, the SW may indicate that there are response bytes + # available. There are two SWs commonly used for this 9fxx (sim) and 61xx (usim), where + # xx is the number of response bytes available. + # See also: + # SW1=9F: 3GPP TS 51.011 9.4.1, Responses to commands which are correctly executed + # SW1=61: ISO/IEC 7816-4, Table 5 ? General meaning of the interindustry values of SW1-SW2 + if (sw is not None) and ((sw[0:2] == '9f') or (sw[0:2] == '61')): pdu_gr = pdu[0:2] + 'c00000' + sw[2:4] data, sw = self.send_apdu_raw(pdu_gr) -- To view, visit https://gerrit.osmocom.org/9575 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ied7fb78873a7c4109de471c7a5e9c3701ba0c7d5 Gerrit-Change-Number: 9575 Gerrit-PatchSet: 3 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 14:05:16 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 3 Jul 2018 14:05:16 +0000 Subject: Change in python/osmo-python-tests[master]: debian: Add python module deps for python3-osmopy-utils Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9838 Change subject: debian: Add python module deps for python3-osmopy-utils ...................................................................... debian: Add python module deps for python3-osmopy-utils Change-Id: I97adcb156205389a75d13a53ecab5638c4672436 --- M debian/control 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests refs/changes/38/9838/1 diff --git a/debian/control b/debian/control index f0df4c0..c3843b2 100644 --- a/debian/control +++ b/debian/control @@ -31,7 +31,7 @@ Package: python3-osmopy-utils Architecture: all -Depends: ${python3:Depends}, ${misc:Depends}, python3-osmopy-libs +Depends: ${python3:Depends}, ${misc:Depends}, python3-osmopy-libs, python3-twisted, python3-treq, python3-suds Description: Python code (not only) for testing of Osmocom programs . This package contains the Python 3 version of osmopy utils. -- To view, visit https://gerrit.osmocom.org/9838 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I97adcb156205389a75d13a53ecab5638c4672436 Gerrit-Change-Number: 9838 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Tue Jul 3 15:01:53 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Tue, 3 Jul 2018 15:01:53 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-gapk_=C2=BB_a1=3Ddefaul?= =?UTF-8?Q?t,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#4?= In-Reply-To: <639984805.32.1530620794068.JavaMail.jenkins@jenkins.osmocom.org> References: <639984805.32.1530620794068.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <1369953268.34.1530630113946.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 73.27 KB...] Generate 'tch_afs_5_9' test vector Generate 'tch_afs_5_15' test vector Generate 'tch_afs_4_75' test vector Generate 'tch_fr' test vector Generate 'tch_hr' test vector Generate 'tch_ahs_7_95' test vector Generate 'tch_ahs_7_4' test vector Generate 'tch_ahs_6_7' test vector Generate 'tch_ahs_5_9' test vector Generate 'tch_ahs_5_15' test vector Generate 'tch_ahs_4_75' test vector Generate 'mcs1_dl_hdr' test vector Generate 'mcs1_ul_hdr' test vector Generate 'mcs1' test vector Generate 'mcs2' test vector Generate 'mcs3' test vector Generate 'mcs4' test vector Generate 'mcs5_dl_hdr' test vector Generate 'mcs5_ul_hdr' test vector Generate 'mcs5' test vector Generate 'mcs6' test vector Generate 'mcs7_dl_hdr' test vector Generate 'mcs7_ul_hdr' test vector Generate 'mcs7' test vector Generate 'mcs8' test vector Generate 'mcs9' test vector Generation complete. make install-am make[3]: Entering directory ' make[4]: Entering directory ' make[4]: Nothing to be done for 'install-exec-am'. make[4]: Nothing to be done for 'install-data-am'. make[4]: Leaving directory ' make[3]: Leaving directory ' make[2]: Leaving directory ' make[2]: Entering directory ' make[3]: Entering directory ' /bin/mkdir -p ' /bin/mkdir -p ' /bin/mkdir -p ' /usr/bin/install -c osmo-release.sh ' /usr/bin/install -c -m 644 osmo-release.mk ' /usr/bin/install -c -m 644 libosmocore.pc libosmocodec.pc libosmovty.pc libosmogsm.pc libosmogb.pc libosmoctrl.pc libosmocoding.pc libosmosim.pc ' make install-data-hook make[4]: Entering directory ' make[4]: Nothing to be done for 'install-data-hook'. make[4]: Leaving directory ' make[3]: Leaving directory ' make[2]: Leaving directory ' make[1]: Leaving directory ' + STOW_DIR= stow --restow libosmocore + find . -name *.[hc] + verify_value_string_arrays_are_terminated.py ./libgsmhr/libgsmhr.c ./deps/install/stow/libosmocore/include/osmocom/crypt/gprs_cipher.h ./deps/install/stow/libosmocore/include/osmocom/crypt/auth.h ./deps/install/stow/libosmocore/include/osmocom/vty/buffer.h ./deps/install/stow/libosmocore/include/osmocom/vty/vty.h ./deps/install/stow/libosmocore/include/osmocom/vty/command.h ./deps/install/stow/libosmocore/include/osmocom/vty/ports.h ./deps/install/stow/libosmocore/include/osmocom/vty/telnet_interface.h ./deps/install/stow/libosmocore/include/osmocom/vty/vector.h ./deps/install/stow/libosmocore/include/osmocom/vty/logging.h ./deps/install/stow/libosmocore/include/osmocom/vty/misc.h ./deps/install/stow/libosmocore/include/osmocom/vty/stats.h ./deps/install/stow/libosmocore/include/osmocom/codec/codec.h ./deps/install/stow/libosmocore/include/osmocom/codec/gsm610_bits.h ./deps/install/stow/libosmocore/include/osmocom/codec/ecu.h ./deps/install/stow/libosmocore/include/osmocom/coding/gsm0503_mapping.h ./deps/install/stow/libosmocore/include/osmocom/coding/gsm0503_interleaving.h ./deps/install/stow/libosmocore/include/osmocom/coding/gsm0503_tables.h ./deps/install/stow/libosmocore/include/osmocom/coding/gsm0503_coding.h ./deps/install/stow/libosmocore/include/osmocom/coding/gsm0503_parity.h ./deps/install/stow/libosmocore/include/osmocom/sim/sim.h ./deps/install/stow/libosmocore/include/osmocom/sim/class_tables.h ./deps/install/stow/libosmocore/include/osmocom/core/byteswap.h ./deps/install/stow/libosmocore/include/osmocom/core/timer_compat.h ./deps/install/stow/libosmocore/include/osmocom/core/msgb.h ./deps/install/stow/libosmocore/include/osmocom/core/crc64gen.h ./deps/install/stow/libosmocore/include/osmocom/core/serial.h ./deps/install/stow/libosmocore/include/osmocom/core/backtrace.h ./deps/install/stow/libosmocore/include/osmocom/core/stat_item.h ./deps/install/stow/libosmocore/include/osmocom/core/conv.h ./deps/install/stow/libosmocore/include/osmocom/core/crcgen.h ./deps/install/stow/libosmocore/include/osmocom/core/linuxrbtree.h ./deps/install/stow/libosmocore/include/osmocom/core/strrb.h ./deps/install/stow/libosmocore/include/osmocom/core/crc8gen.h ./deps/install/stow/libosmocore/include/osmocom/core/timer.h ./deps/install/stow/libosmocore/include/osmocom/core/sercomm.h ./deps/install/stow/libosmocore/include/osmocom/core/talloc.h ./deps/install/stow/libosmocore/include/osmocom/core/socket.h ./deps/install/stow/libosmocore/include/osmocom/core/bitvec.h ./deps/install/stow/libosmocore/include/osmocom/core/bits.h ./deps/install/stow/libosmocore/include/osmocom/core/isdnhdlc.h ./deps/install/stow/libosmocore/include/osmocom/core/bitcomp.h ./deps/install/stow/libosmocore/include/osmocom/core/prim.h ./deps/install/stow/libosmocore/include/osmocom/core/loggingrb.h ./deps/install/stow/libosmocore/include/osmocom/core/linuxlist.h ./deps/install/stow/libosmocore/include/osmocom/core/counter.h ./deps/install/stow/libosmocore/include/osmocom/core/bit32gen.h ./deps/install/stow/libosmocore/include/osmocom/core/logging.h ./deps/install/stow/libosmocore/include/osmocom/core/gsmtap_util.h ./deps/install/stow/libosmocore/include/osmocom/core/endian.h ./deps/install/stow/libosmocore/include/osmocom/core/defs.h ./deps/install/stow/libosmocore/include/osmocom/core/fsm.h ./deps/install/stow/libosmocore/include/osmocom/core/statistics.h ./deps/install/stow/libosmocore/include/osmocom/core/msgfile.h ./deps/install/stow/libosmocore/include/osmocom/core/gsmtap.h ./deps/install/stow/libosmocore/include/osmocom/core/plugin.h ./deps/install/stow/libosmocore/include/osmocom/core/prbs.h ./deps/install/stow/libosmocore/include/osmocom/core/write_queue.h ./deps/install/stow/libosmocore/include/osmocom/core/macaddr.h ./deps/install/stow/libosmocore/include/osmocom/core/bit64gen.h ./deps/install/stow/libosmocore/include/osmocom/core/rate_ctr.h ./deps/install/stow/libosmocore/include/osmocom/core/panic.h ./deps/install/stow/libosmocore/include/osmocom/core/process.h ./deps/install/stow/libosmocore/include/osmocom/core/crc16gen.h ./deps/install/stow/libosmocore/include/osmocom/core/select.h ./deps/install/stow/libosmocore/include/osmocom/core/crc16.h ./deps/install/stow/libosmocore/include/osmocom/core/crc32gen.h ./deps/install/stow/libosmocore/include/osmocom/core/utils.h ./deps/install/stow/libosmocore/include/osmocom/core/application.h ./deps/install/stow/libosmocore/include/osmocom/core/signal.h ./deps/install/stow/libosmocore/include/osmocom/core/bit16gen.h ./deps/install/stow/libosmocore/include/osmocom/core/stats.h ./deps/install/stow/libosmocore/include/osmocom/ctrl/ports.h ./deps/install/stow/libosmocore/include/osmocom/ctrl/control_if.h ./deps/install/stow/libosmocore/include/osmocom/ctrl/control_cmd.h ./deps/install/stow/libosmocore/include/osmocom/ctrl/control_vty.h ./deps/install/stow/libosmocore/include/osmocom/gsm/mncc.h ./deps/install/stow/libosmocore/include/osmocom/gsm/l1sap.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm23003.h ./deps/install/stow/libosmocore/include/osmocom/gsm/meas_rep.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm0480.h ./deps/install/stow/libosmocore/include/osmocom/gsm/comp128v23.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm0411_smc.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm0502.h ./deps/install/stow/libosmocore/include/osmocom/gsm/oap.h ./deps/install/stow/libosmocore/include/osmocom/gsm/lapd_core.h ./deps/install/stow/libosmocore/include/osmocom/gsm/lapdm.h ./deps/install/stow/libosmocore/include/osmocom/gsm/bitvec_gsm.h ./deps/install/stow/libosmocore/include/osmocom/gsm/a5.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gan.h ./deps/install/stow/libosmocore/include/osmocom/gsm/rxlev_stat.h ./deps/install/stow/libosmocore/include/osmocom/gsm/prim.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm0808_utils.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm0411_utils.h ./deps/install/stow/libosmocore/include/osmocom/gsm/bts_features.h ./deps/install/stow/libosmocore/include/osmocom/gsm/abis_nm.h ./deps/install/stow/libosmocore/include/osmocom/gsm/apn.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm0411_smr.h ./deps/install/stow/libosmocore/include/osmocom/gsm/ipa.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_04_80.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_12_21.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/ipaccess.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/smpp34_osmocom.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_04_08_gprs.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_08_08.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_09_02.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_03_40.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_23_003.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_04_14.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_04_12.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_44_318.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_03_41.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_04_08.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_08_58.h ./deps/install/stow/libosmocore/include/osmocom/gsm/protocol/gsm_04_11.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm0341.h ./deps/install/stow/libosmocore/include/osmocom/gsm/rsl.h ./deps/install/stow/libosmocore/include/osmocom/gsm/comp128.h ./deps/install/stow/libosmocore/include/osmocom/gsm/sysinfo.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsup.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm48.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm0808.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm0503.h ./deps/install/stow/libosmocore/include/osmocom/gsm/tlv.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm48_ie.h ./deps/install/stow/libosmocore/include/osmocom/gsm/gsm_utils.h ./deps/install/stow/libosmocore/include/osmocom/gprs/gprs_ns_frgre.h ./deps/install/stow/libosmocore/include/osmocom/gprs/gprs_bssgp.h ./deps/install/stow/libosmocore/include/osmocom/gprs/gprs_bssgp_bss.h ./deps/install/stow/libosmocore/include/osmocom/gprs/protocol/gsm_08_18.h ./deps/install/stow/libosmocore/include/osmocom/gprs/protocol/gsm_08_16.h ./deps/install/stow/libosmocore/include/osmocom/gprs/protocol/gsm_04_60.h ./deps/install/stow/libosmocore/include/osmocom/gprs/gprs_rlc.h ./deps/install/stow/libosmocore/include/osmocom/gprs/gprs_msgb.h ./deps/install/stow/libosmocore/include/osmocom/gprs/gprs_ns.h ./deps/libosmocore/config.h ./deps/libosmocore/utils/osmo-auc-gen.c ./deps/libosmocore/utils/osmo-arfcn.c ./deps/libosmocore/utils/osmo-sim-test.c ./deps/libosmocore/src/logging_syslog.c ./deps/libosmocore/src/stats_statsd.c ./deps/libosmocore/src/panic.c ./deps/libosmocore/src/backtrace.c ./deps/libosmocore/src/timer.c ./deps/libosmocore/src/sercomm.c ./deps/libosmocore/src/crc32gen.c ./deps/libosmocore/src/logging_gsmtap.c ./deps/libosmocore/src/crc64gen.c ./deps/libosmocore/src/timer_gettimeofday.c ./deps/libosmocore/src/prim.c ./deps/libosmocore/src/gb/common_vty.c ./deps/libosmocore/src/gb/gprs_bssgp_util.c ./deps/libosmocore/src/gb/gprs_bssgp.c ./deps/libosmocore/src/gb/gprs_ns_vty.c ./deps/libosmocore/src/gb/gprs_ns_frgre.c ./deps/libosmocore/src/gb/gprs_bssgp_bss.c ./deps/libosmocore/src/gb/gprs_ns.c ./deps/libosmocore/src/gb/common_vty.h ./deps/libosmocore/src/gb/gprs_bssgp_vty.c ./deps/libosmocore/src/bitvec.c ./deps/libosmocore/src/isdnhdlc.c ./deps/libosmocore/src/utils.c ./deps/libosmocore/src/strrb.c ./deps/libosmocore/src/conv_acc_sse.c ./deps/libosmocore/src/conv_acc_sse_impl.h ./deps/libosmocore/src/conv.c ./deps/libosmocore/src/crc16.c ./deps/libosmocore/src/vty/buffer.c ./deps/libosmocore/src/vty/vector.c ./deps/libosmocore/src/vty/utils.c ./deps/libosmocore/src/vty/telnet_interface.c ./deps/libosmocore/src/vty/command.c ./deps/libosmocore/src/vty/logging_vty.c ./deps/libosmocore/src/vty/talloc_ctx_vty.c ./deps/libosmocore/src/vty/stats_vty.c ./deps/libosmocore/src/vty/fsm_vty.c ./deps/libosmocore/src/vty/vty.c ./deps/libosmocore/src/bitcomp.c ./deps/libosmocore/src/signal.c ./deps/libosmocore/src/serial.c ./deps/libosmocore/src/crc16gen.c ./deps/libosmocore/src/prbs.c ./deps/libosmocore/src/codec/gsm660.c ./deps/libosmocore/src/codec/gsm610.c ./deps/libosmocore/src/codec/gsm620.c ./deps/libosmocore/src/codec/ecu_fr.c ./deps/libosmocore/src/codec/gsm690.c ./deps/libosmocore/src/socket.c ./deps/libosmocore/src/conv_acc_generic.c ./deps/libosmocore/src/msgb.c ./deps/libosmocore/src/coding/gsm0503_parity.c ./deps/libosmocore/src/coding/gsm0503_interleaving.c ./deps/libosmocore/src/coding/gsm0503_coding.c ./deps/libosmocore/src/coding/gsm0503_mapping.c ./deps/libosmocore/src/coding/gsm0503_tables.c ./deps/libosmocore/src/bits.c ./deps/libosmocore/src/sim/class_tables.c ./deps/libosmocore/src/sim/gsm_int.h ./deps/libosmocore/src/sim/sim_int.h ./deps/libosmocore/src/sim/reader.c ./deps/libosmocore/src/sim/card_fs_usim.c ./deps/libosmocore/src/sim/reader_pcsc.c ./deps/libosmocore/src/sim/card_fs_isim.c ./deps/libosmocore/src/sim/core.c ./deps/libosmocore/src/sim/card_fs_sim.c ./deps/libosmocore/src/sim/card_fs_uicc.c ./deps/libosmocore/src/sim/card_fs_tetra.c ./deps/libosmocore/src/rbtree.c ./deps/libosmocore/src/timer_clockgettime.c ./deps/libosmocore/src/plugin.c ./deps/libosmocore/src/conv_acc_sse_avx.c ./deps/libosmocore/src/stat_item.c ./deps/libosmocore/src/counter.c ./deps/libosmocore/src/application.c ./deps/libosmocore/src/ctrl/control_cmd.c ./deps/libosmocore/src/ctrl/control_vty.c ./deps/libosmocore/src/ctrl/control_if.c ./deps/libosmocore/src/ctrl/fsm_ctrl_commands.c ./deps/libosmocore/src/msgfile.c ./deps/libosmocore/src/gsm/gsm0808.c ./deps/libosmocore/src/gsm/lapdm.c ./deps/libosmocore/src/gsm/gsm_utils.c ./deps/libosmocore/src/gsm/oap.c ./deps/libosmocore/src/gsm/gsm0341.c ./deps/libosmocore/src/gsm/gea.c ./deps/libosmocore/src/gsm/gsm0411_smc.c ./deps/libosmocore/src/gsm/milenage/common.h ./deps/libosmocore/src/gsm/milenage/milenage.c ./deps/libosmocore/src/gsm/milenage/includes.h ./deps/libosmocore/src/gsm/milenage/aes-encblock.c ./deps/libosmocore/src/gsm/milenage/aes.h ./deps/libosmocore/src/gsm/milenage/milenage.h ./deps/libosmocore/src/gsm/milenage/aes-internal-enc.c ./deps/libosmocore/src/gsm/milenage/aes_wrap.h ./deps/libosmocore/src/gsm/milenage/crypto.h ./deps/libosmocore/src/gsm/milenage/aes-internal.c ./deps/libosmocore/src/gsm/milenage/aes_i.h ./deps/libosmocore/src/gsm/gan.c ./deps/libosmocore/src/gsm/comp128v23.c ./deps/libosmocore/src/gsm/comp128.c ./deps/libosmocore/src/gsm/gsm0503_conv.c ./deps/libosmocore/src/gsm/rsl.c ./deps/libosmocore/src/gsm/gsm_04_08_gprs.c ./deps/libosmocore/src/gsm/sysinfo.c ./deps/libosmocore/src/gsm/auth_milenage.c ./deps/libosmocore/src/gsm/gprs_cipher_core.c ./deps/libosmocore/src/gsm/gprs_rlc.c ./deps/libosmocore/src/gsm/bts_features.c ./deps/libosmocore/src/gsm/auth_comp128v23.c ./deps/libosmocore/src/gsm/kasumi.c ./deps/libosmocore/src/gsm/gsm0411_utils.c ./deps/libosmocore/src/gsm/gsm48_ie.c ./deps/libosmocore/src/gsm/gsup.c ./deps/libosmocore/src/gsm/gsm0411_smr.c ./deps/libosmocore/src/gsm/tlv_parser.c ./deps/libosmocore/src/gsm/auth_comp128v1.c ./deps/libosmocore/src/gsm/gsm0808_utils.c ./deps/libosmocore/src/gsm/apn.c ./deps/libosmocore/src/gsm/a5.c ./deps/libosmocore/src/gsm/gsm48.c ./deps/libosmocore/src/gsm/lapd_core.c ./deps/libosmocore/src/gsm/gsm0502.c ./deps/libosmocore/src/gsm/gsm0414.c ./deps/libosmocore/src/gsm/gprs_gea.c ./deps/libosmocore/src/gsm/rxlev_stat.c ./deps/libosmocore/src/gsm/auth_core.c ./deps/libosmocore/src/gsm/gsm0480.c ./deps/libosmocore/src/gsm/gsm23003.c ./deps/libosmocore/src/gsm/abis_nm.c ./deps/libosmocore/src/gsm/ipa.c ./deps/libosmocore/src/gsm/mncc.c ./deps/libosmocore/src/stats.c ./deps/libosmocore/src/fsm.c ./deps/libosmocore/src/macaddr.c ./deps/libosmocore/src/logging.c ./deps/libosmocore/src/crc8gen.c ./deps/libosmocore/src/gsmtap_util.c ./deps/libosmocore/src/rate_ctr.c ./deps/libosmocore/src/conv_acc.c ./deps/libosmocore/src/write_queue.c ./deps/libosmocore/src/pseudotalloc/talloc.h ./deps/libosmocore/src/pseudotalloc/pseudotalloc.c ./deps/libosmocore/src/loggingrb.c ./deps/libosmocore/src/select.c ./deps/libosmocore/include/osmocom/crypt/gprs_cipher.h ./deps/libosmocore/include/osmocom/crypt/auth.h ./deps/libosmocore/include/osmocom/vty/buffer.h ./deps/libosmocore/include/osmocom/vty/vty.h ./deps/libosmocore/include/osmocom/vty/command.h ./deps/libosmocore/include/osmocom/vty/ports.h ./deps/libosmocore/include/osmocom/vty/telnet_interface.h ./deps/libosmocore/include/osmocom/vty/vector.h ./deps/libosmocore/include/osmocom/vty/logging.h ./deps/libosmocore/include/osmocom/vty/misc.h ./deps/libosmocore/include/osmocom/vty/stats.h ./deps/libosmocore/include/osmocom/codec/codec.h ./deps/libosmocore/include/osmocom/codec/gsm610_bits.h ./deps/libosmocore/include/osmocom/codec/ecu.h ./deps/libosmocore/include/osmocom/coding/gsm0503_mapping.h ./deps/libosmocore/include/osmocom/coding/gsm0503_interleaving.h ./deps/libosmocore/include/osmocom/coding/gsm0503_tables.h ./deps/libosmocore/include/osmocom/coding/gsm0503_coding.h ./deps/libosmocore/include/osmocom/coding/gsm0503_parity.h ./deps/libosmocore/include/osmocom/sim/sim.h ./deps/libosmocore/include/osmocom/sim/class_tables.h ./deps/libosmocore/include/osmocom/core/byteswap.h ./deps/libosmocore/include/osmocom/core/timer_compat.h ./deps/libosmocore/include/osmocom/core/msgb.h ./deps/libosmocore/include/osmocom/core/crc64gen.h ./deps/libosmocore/include/osmocom/core/serial.h ./deps/libosmocore/include/osmocom/core/backtrace.h ./deps/libosmocore/include/osmocom/core/stat_item.h ./deps/libosmocore/include/osmocom/core/conv.h ./deps/libosmocore/include/osmocom/core/crcgen.h ./deps/libosmocore/include/osmocom/core/linuxrbtree.h ./deps/libosmocore/include/osmocom/core/strrb.h ./deps/libosmocore/include/osmocom/core/crc8gen.h ./deps/libosmocore/include/osmocom/core/timer.h ./deps/libosmocore/include/osmocom/core/sercomm.h ./deps/libosmocore/include/osmocom/core/talloc.h ./deps/libosmocore/include/osmocom/core/socket.h ./deps/libosmocore/include/osmocom/core/bitvec.h ./deps/libosmocore/include/osmocom/core/bits.h ./deps/libosmocore/include/osmocom/core/isdnhdlc.h ./deps/libosmocore/include/osmocom/core/bitcomp.h ./deps/libosmocore/include/osmocom/core/prim.h ./deps/libosmocore/include/osmocom/core/loggingrb.h ./deps/libosmocore/include/osmocom/core/linuxlist.h ./deps/libosmocore/include/osmocom/core/counter.h ./deps/libosmocore/include/osmocom/core/bit32gen.h ./deps/libosmocore/include/osmocom/core/logging.h ./deps/libosmocore/include/osmocom/core/gsmtap_util.h ./deps/libosmocore/include/osmocom/core/endian.h ./deps/libosmocore/include/osmocom/core/defs.h ./deps/libosmocore/include/osmocom/core/fsm.h ./deps/libosmocore/include/osmocom/core/statistics.h ./deps/libosmocore/include/osmocom/core/msgfile.h ./deps/libosmocore/include/osmocom/core/gsmtap.h ./deps/libosmocore/include/osmocom/core/plugin.h ./deps/libosmocore/include/osmocom/core/prbs.h ./deps/libosmocore/include/osmocom/core/write_queue.h ./deps/libosmocore/include/osmocom/core/macaddr.h ./deps/libosmocore/include/osmocom/core/bit64gen.h ./deps/libosmocore/include/osmocom/core/rate_ctr.h ./deps/libosmocore/include/osmocom/core/panic.h ./deps/libosmocore/include/osmocom/core/process.h ./deps/libosmocore/include/osmocom/core/crc16gen.h ./deps/libosmocore/include/osmocom/core/select.h ./deps/libosmocore/include/osmocom/core/crc16.h ./deps/libosmocore/include/osmocom/core/crc32gen.h ./deps/libosmocore/include/osmocom/core/utils.h ./deps/libosmocore/include/osmocom/core/application.h ./deps/libosmocore/include/osmocom/core/signal.h ./deps/libosmocore/include/osmocom/core/bit16gen.h ./deps/libosmocore/include/osmocom/core/stats.h ./deps/libosmocore/include/osmocom/ctrl/ports.h ./deps/libosmocore/include/osmocom/ctrl/control_if.h ./deps/libosmocore/include/osmocom/ctrl/control_cmd.h ./deps/libosmocore/include/osmocom/ctrl/control_vty.h ./deps/libosmocore/include/osmocom/gsm/mncc.h ./deps/libosmocore/include/osmocom/gsm/l1sap.h ./deps/libosmocore/include/osmocom/gsm/gsm23003.h ./deps/libosmocore/include/osmocom/gsm/meas_rep.h ./deps/libosmocore/include/osmocom/gsm/gsm0480.h ./deps/libosmocore/include/osmocom/gsm/gea.h ./deps/libosmocore/include/osmocom/gsm/comp128v23.h ./deps/libosmocore/include/osmocom/gsm/gsm0411_smc.h ./deps/libosmocore/include/osmocom/gsm/kasumi.h ./deps/libosmocore/include/osmocom/gsm/gsm0502.h ./deps/libosmocore/include/osmocom/gsm/oap.h ./deps/libosmocore/include/osmocom/gsm/lapd_core.h ./deps/libosmocore/include/osmocom/gsm/lapdm.h ./deps/libosmocore/include/osmocom/gsm/bitvec_gsm.h ./deps/libosmocore/include/osmocom/gsm/a5.h ./deps/libosmocore/include/osmocom/gsm/gan.h ./deps/libosmocore/include/osmocom/gsm/rxlev_stat.h ./deps/libosmocore/include/osmocom/gsm/prim.h ./deps/libosmocore/include/osmocom/gsm/gsm0808_utils.h ./deps/libosmocore/include/osmocom/gsm/gsm0411_utils.h ./deps/libosmocore/include/osmocom/gsm/bts_features.h ./deps/libosmocore/include/osmocom/gsm/abis_nm.h ./deps/libosmocore/include/osmocom/gsm/apn.h ./deps/libosmocore/include/osmocom/gsm/gsm0411_smr.h ./deps/libosmocore/include/osmocom/gsm/ipa.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_04_80.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_12_21.h ./deps/libosmocore/include/osmocom/gsm/protocol/ipaccess.h ./deps/libosmocore/include/osmocom/gsm/protocol/smpp34_osmocom.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_04_08_gprs.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_08_08.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_09_02.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_03_40.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_23_003.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_04_14.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_04_12.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_44_318.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_03_41.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_04_08.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_08_58.h ./deps/libosmocore/include/osmocom/gsm/protocol/gsm_04_11.h ./deps/libosmocore/include/osmocom/gsm/gsm0341.h ./deps/libosmocore/include/osmocom/gsm/rsl.h ./deps/libosmocore/include/osmocom/gsm/comp128.h ./deps/libosmocore/include/osmocom/gsm/sysinfo.h ./deps/libosmocore/include/osmocom/gsm/gsup.h ./deps/libosmocore/include/osmocom/gsm/gsm48.h ./deps/libosmocore/include/osmocom/gsm/gsm0808.h ./deps/libosmocore/include/osmocom/gsm/gsm0503.h ./deps/libosmocore/include/osmocom/gsm/tlv.h ./deps/libosmocore/include/osmocom/gsm/gsm48_ie.h ./deps/libosmocore/include/osmocom/gsm/gsm_utils.h ./deps/libosmocore/include/osmocom/gprs/gprs_ns_frgre.h ./deps/libosmocore/include/osmocom/gprs/gprs_bssgp.h ./deps/libosmocore/include/osmocom/gprs/gprs_bssgp_bss.h ./deps/libosmocore/include/osmocom/gprs/protocol/gsm_08_18.h ./deps/libosmocore/include/osmocom/gprs/protocol/gsm_08_16.h ./deps/libosmocore/include/osmocom/gprs/protocol/gsm_04_60.h ./deps/libosmocore/include/osmocom/gprs/gprs_rlc.h ./deps/libosmocore/include/osmocom/gprs/gprs_msgb.h ./deps/libosmocore/include/osmocom/gprs/gprs_ns.h ./deps/libosmocore/tests/gsup/gsup_test.c ./deps/libosmocore/tests/comp128/comp128_test.c ./deps/libosmocore/tests/gsm0808/gsm0808_test.c ./deps/libosmocore/tests/socket/socket_test.c ./deps/libosmocore/tests/logging/logging_test.c ./deps/libosmocore/tests/tlv/tlv_test.c ./deps/libosmocore/tests/gb/gprs_ns_test.c ./deps/libosmocore/tests/gb/gprs_bssgp_test.c ./deps/libosmocore/tests/gb/bssgp_fc_test.c ./deps/libosmocore/tests/utils/utils_test.c ./deps/libosmocore/tests/timer/clk_override_test.c ./deps/libosmocore/tests/timer/timer_test.c ./deps/libosmocore/tests/gsm23003/gsm23003_test.c ./deps/libosmocore/tests/a5/a5_test.c ./deps/libosmocore/tests/kasumi/kasumi_test.c ./deps/libosmocore/tests/vty/vty_test.c ./deps/libosmocore/tests/libsercomstub.c ./deps/libosmocore/tests/sercomm/sercomm_test.c ./deps/libosmocore/tests/auth/milenage_test.c ./deps/libosmocore/tests/msgfile/msgfile_test.c ./deps/libosmocore/tests/ussd/ussd_test.c ./deps/libosmocore/tests/codec/codec_test.c ./deps/libosmocore/tests/codec/codec_ecu_fr_test.c ./deps/libosmocore/tests/prbs/prbs_test.c ./deps/libosmocore/tests/bitvec/bitvec_test.c ./deps/libosmocore/tests/gsm0408/gsm0408_test.c ./deps/libosmocore/tests/coding/coding_test.c ./deps/libosmocore/tests/strrb/strrb_test.c ./deps/libosmocore/tests/endian/endian_test.c ./deps/libosmocore/tests/msgb/msgb_test.c ./deps/libosmocore/tests/sim/sim_test.c ./deps/libosmocore/tests/write_queue/wqueue_test.c ./deps/libosmocore/tests/fsm/fsm_test.c ./deps/libosmocore/tests/oap/oap_test.c ./deps/libosmocore/tests/ctrl/ctrl_test.c ./deps/libosmocore/tests/fr/fr_test.c ./deps/libosmocore/tests/lapd/lapd_test.c ./deps/libosmocore/tests/sms/sms_test.c ./deps/libosmocore/tests/gea/gea_test.c ./deps/libosmocore/tests/loggingrb/loggingrb_test.c ./deps/libosmocore/tests/conv/gsm0503_test_vectors.c ./deps/libosmocore/tests/conv/conv.h ./deps/libosmocore/tests/conv/conv_test.c ./deps/libosmocore/tests/conv/conv.c ./deps/libosmocore/tests/conv/conv_gsm0503_test.c ./deps/libosmocore/tests/bits/bitrev_test.c ./deps/libosmocore/tests/bits/bitcomp_test.c ./deps/libosmocore/tests/bits/bitfield_test.c ./deps/libosmocore/tests/stats/stats_test.c ./deps/libosmocore/tests/abis/abis_test.c ./deps/libosmocore/tests/gprs/gprs_test.c ./deps/libosmocore/tests/smscb/gsm0341_test.c ./deps/libosmocore/tests/smscb/smscb_test.c ./src/codec_efr.c ./src/common.c ./src/codec_amr.c ./src/fmt_rtp_efr.c ./src/pq_rtp.c ./src/pq_codec.c ./src/fmt_rtp_amr.c ./src/fmt_ti.c ./src/app_osmo_gapk.c ./src/procqueue.c ./src/codec_pcm.c ./src/codecs.c ./src/benchmark.c ./src/pq_format.c ./src/fmt_rtp_hr_ietf.c ./src/fmt_racal.c ./src/fmt_rtp_hr_etsi.c ./src/ecu_fr.c ./src/fmt_rawpcm.c ./src/formats.c ./src/fmt_gsm.c ./src/fmt_amr.c ./src/pq_ecu.c ./src/pq_file.c ./src/pq_alsa.c ./src/codec_hr.c ./src/codec_fr.c ./src/fmt_amr_opencore.c ./src/fmt_hr_ref.c ./include/gsmhr/gsmhr.h ./include/osmocom/gapk/formats.h ./include/osmocom/gapk/common.h ./include/osmocom/gapk/codecs.h ./include/osmocom/gapk/bench.h ./include/osmocom/gapk/benchmark.h ./include/osmocom/gapk/procqueue.h ./include/osmocom/gapk/get_cycles.h ./include/osmocom/gapk/logging.h ./include/osmocom/gapk/utils.h ./tests/io/pq_file_test.c ./tests/io/pq_rtp_test.c ./tests/ecu/ecu_fr_test.c ./tests/procqueue/pq_test.c + export PKG_CONFIG_PATH=: + export LD_LIBRARY_PATH= + set +x =============================== gapk =============================== + cd + autoreconf --install --force libtoolize: putting auxiliary files in '.'. libtoolize: copying file './ltmain.sh' libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'. libtoolize: copying file 'm4/libtool.m4' libtoolize: copying file 'm4/ltoptions.m4' libtoolize: copying file 'm4/ltsugar.m4' libtoolize: copying file 'm4/ltversion.m4' libtoolize: copying file 'm4/lt~obsolete.m4' configure.ac:7: installing './compile' configure.ac:7: installing './config.guess' configure.ac:7: installing './config.sub' configure.ac:6: installing './install-sh' configure.ac:6: installing './missing' libgsmhr/Makefile.am: installing './depcomp' + ./configure --enable-sanitize checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu checking how to print strings... printf checking for style of include used by make... GNU checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking whether gcc understands -c and -o together... yes checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for fgrep... /bin/grep -F checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B checking the name lister (/usr/bin/nm -B) interface... BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 1572864 checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop checking for /usr/bin/ld option to reload object files... -r checking for objdump... objdump checking how to recognize dependent libraries... pass_all checking for dlltool... no checking how to associate runtime and link libraries... printf %s\n checking for ar... ar checking for archiver @FILE support... @ checking for strip... strip checking for ranlib... ranlib checking command to parse /usr/bin/nm -B output from gcc object... ok checking for sysroot... no checking for a working dd... /bin/dd checking how to truncate binary pipes... /bin/dd bs=4096 count=1 checking for mt... mt checking if mt is a manifest tool... no checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking for objdir... .libs checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC -DPIC checking if gcc PIC flag -fPIC -DPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.o... (cached) yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether make supports nested variables... (cached) yes checking for a Python interpreter with version >= 2.4... python checking for python... /usr/bin/python checking for python version... 2.7 checking for python platform... linux2 checking for python script directory... ${prefix}/lib/python2.7/dist-packages checking for python extension module directory... ${exec_prefix}/lib/python2.7/dist-packages checking if gcc supports -fvisibility=hidden... yes checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking whether gcc understands -c and -o together... (cached) yes checking dependency style of gcc... (cached) gcc3 checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for LIBOSMOCORE... yes checking for LIBOSMOCODEC... yes checking for LIBALSA... yes checking for OPENCORE_AMRNB... yes checking gsm/gsm.h usability... yes checking gsm/gsm.h presence... yes checking for gsm/gsm.h... yes checking for gsm_create in -lgsm... yes checking for stdint.h... (cached) yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking for unistd.h... (cached) yes checking for inline... inline checking for int16_t... yes checking for int32_t... yes checking for uint16_t... yes checking for uint32_t... yes checking for uint64_t... yes checking for uint8_t... yes checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... no checking for memset... yes checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating src/Makefile config.status: creating libgsmhr/Makefile config.status: creating include/Makefile config.status: creating include/gsmhr/Makefile config.status: creating libosmogapk.pc config.status: creating tests/atlocal config.status: creating tests/Makefile config.status: creating config.h config.status: executing depfiles commands config.status: executing libtool commands config.status: executing tests/atconfig commands + make -j 8 make all-recursive make[1]: Entering directory ' Making all in include make[2]: Entering directory ' Making all in gsmhr make[3]: Entering directory ' make[3]: Nothing to be done for 'all'. make[3]: Leaving directory ' make[3]: Entering directory ' make[3]: Nothing to be done for 'all-am'. make[3]: Leaving directory ' make[2]: Leaving directory ' Making all in libgsmhr make[2]: Entering directory ' ./fetch_sources.py "refsrc" Traceback (most recent call last): File "./fetch_sources.py", line 66, in main(*sys.argv) File "./fetch_sources.py", line 48, in main u = urllib2.urlopen(SRC) File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen return opener.open(url, data, timeout) File "/usr/lib/python2.7/urllib2.py", line 435, in open response = meth(req, response) File "/usr/lib/python2.7/urllib2.py", line 548, in http_response 'http', request, response, code, msg, hdrs) File "/usr/lib/python2.7/urllib2.py", line 473, in error return self._call_chain(*args) File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain result = func(*args) File "/usr/lib/python2.7/urllib2.py", line 556, in http_error_default raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) urllib2.HTTPError: HTTP Error 403: Forbidden Makefile:723: recipe for target 'refsrc/.downloaded' failed make[2]: *** [refsrc/.downloaded] Error 1 make[2]: Leaving directory ' Makefile:479: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory ' Makefile:388: recipe for target 'all' failed make: *** [all] Error 2 Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From jenkins at lists.osmocom.org Tue Jul 3 15:10:06 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Tue, 3 Jul 2018 15:10:06 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-asn1c_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#173?= In-Reply-To: <6853033.4.1530544206730.JavaMail.jenkins@jenkins.osmocom.org> References: <6853033.4.1530544206730.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <1571696431.35.1530630606748.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 3.67 KB...] + ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for style of include used by make... GNU checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking how to run the C++ preprocessor... g++ -E checking for g77... no checking for f77... no checking for xlf... no checking for frt... no checking for pgf77... no checking for cf77... no checking for fort77... no checking for fl32... no checking for af77... no checking for f90... no checking for xlf90... no checking for pgf90... no checking for pghpf... no checking for epcf90... no checking for gfortran... no checking for g95... no checking for f95... no checking for fort... no checking for xlf95... no checking for ifort... no checking for ifc... no checking for efc... no checking for pgf95... no checking for lf95... no checking for ftn... no checking whether we are using the GNU Fortran 77 compiler... no checking whether accepts -g... no checking the maximum length of command line arguments... 32768 checking command to parse /usr/bin/nm -B output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes configure: creating libtool appending configuration tag "CXX" to libtool checking for ld used by g++... /usr/bin/ld -m elf_x86_64 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC checking if g++ PIC flag -fPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate appending configuration tag "F77" to libtool checking for autoconf... /usr/bin/autoconf checking for autoheader... /usr/bin/autoheader checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking dependency style of gcc... (cached) gcc3 checking how to run the C preprocessor... gcc -E checking for a BSD-compatible install... /usr/bin/install -c checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking for bison... bison -y checking for flex... flex checking for yywrap in -lfl... yes checking lex output file root... lex.yy checking whether yytext is a pointer... yes checking for ar... /usr/bin/ar checking for ANSI C header files... (cached) yes checking sys/param.h usability... yes checking sys/param.h presence... yes checking for sys/param.h... yes checking whether byte ordering is bigendian... no checking for off_t... yes checking for size_t... yes checking whether struct tm is in sys/time.h or time.h... time.h checking for intmax_t... yes checking for library containing getopt... none required checking for strtoimax... yes checking for strtoll... yes checking for mergesort... no checking for mkstemps... yes configure: creating ./config.status config.status: creating skeletons/standard-modules/Makefile config.status: creating skeletons/tests/Makefile config.status: creating libasn1compiler/Makefile config.status: creating libasn1parser/Makefile config.status: creating libasn1print/Makefile config.status: creating asn1c/webcgi/Makefile config.status: creating asn1c/tests/Makefile config.status: creating libasn1fix/Makefile config.status: creating skeletons/Makefile config.status: creating examples/Makefile config.status: creating tests/Makefile config.status: creating asn1c/Makefile config.status: creating doc/Makefile config.status: creating asn1c.spec config.status: creating Makefile config.status: creating config.h config.status: executing depfiles commands + make -j 8 make all-recursive make[1]: Entering directory ' Making all in libasn1parser make[2]: Entering directory ' if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF ".deps/asn1parser.Tpo" -c -o asn1parser.lo asn1parser.c; \ then mv -f ".deps/asn1parser.Tpo" ".deps/asn1parser.Plo"; else rm -f ".deps/asn1parser.Tpo"; exit 1; fi bison -y -p asn1p_ -d asn1p_y.y if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF ".deps/asn1p_l.Tpo" -c -o asn1p_l.lo asn1p_l.c; \ then mv -f ".deps/asn1p_l.Tpo" ".deps/asn1p_l.Plo"; else rm -f ".deps/asn1p_l.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF ".deps/asn1p_module.Tpo" -c -o asn1p_module.lo asn1p_module.c; \ then mv -f ".deps/asn1p_module.Tpo" ".deps/asn1p_module.Plo"; else rm -f ".deps/asn1p_module.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF ".deps/asn1p_oid.Tpo" -c -o asn1p_oid.lo asn1p_oid.c; \ then mv -f ".deps/asn1p_oid.Tpo" ".deps/asn1p_oid.Plo"; else rm -f ".deps/asn1p_oid.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF ".deps/asn1p_value.Tpo" -c -o asn1p_value.lo asn1p_value.c; \ then mv -f ".deps/asn1p_value.Tpo" ".deps/asn1p_value.Plo"; else rm -f ".deps/asn1p_value.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF ".deps/asn1p_expr.Tpo" -c -o asn1p_expr.lo asn1p_expr.c; \ then mv -f ".deps/asn1p_expr.Tpo" ".deps/asn1p_expr.Plo"; else rm -f ".deps/asn1p_expr.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF ".deps/asn1p_xports.Tpo" -c -o asn1p_xports.lo asn1p_xports.c; \ then mv -f ".deps/asn1p_xports.Tpo" ".deps/asn1p_xports.Plo"; else rm -f ".deps/asn1p_xports.Tpo"; exit 1; fi asn1p_y.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] mkdir .libs gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -fPIC -DPIC -o .libs/asn1parser.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -fPIC -DPIC -o .libs/asn1p_module.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -fPIC -DPIC -o .libs/asn1p_expr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -fPIC -DPIC -o .libs/asn1p_xports.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -fPIC -DPIC -o .libs/asn1p_value.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -fPIC -DPIC -o .libs/asn1p_l.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -fPIC -DPIC -o .libs/asn1p_oid.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -o asn1p_xports.o >/dev/null 2>&1 asn1p_l.c:3521:12: warning: 'input' defined but not used [-Wunused-function] static int input() ^~~~~ gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -o asn1p_module.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -o asn1parser.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -o asn1p_oid.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF ".deps/asn1p_constr.Tpo" -c -o asn1p_constr.lo asn1p_constr.c; \ then mv -f ".deps/asn1p_constr.Tpo" ".deps/asn1p_constr.Plo"; else rm -f ".deps/asn1p_constr.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -o asn1p_value.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -o asn1p_expr.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF ".deps/asn1p_param.Tpo" -c -o asn1p_param.lo asn1p_param.c; \ then mv -f ".deps/asn1p_param.Tpo" ".deps/asn1p_param.Plo"; else rm -f ".deps/asn1p_param.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF ".deps/asn1p_class.Tpo" -c -o asn1p_class.lo asn1p_class.c; \ then mv -f ".deps/asn1p_class.Tpo" ".deps/asn1p_class.Plo"; else rm -f ".deps/asn1p_class.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF ".deps/asn1p_ref.Tpo" -c -o asn1p_ref.lo asn1p_ref.c; \ then mv -f ".deps/asn1p_ref.Tpo" ".deps/asn1p_ref.Plo"; else rm -f ".deps/asn1p_ref.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -fPIC -DPIC -o .libs/asn1p_constr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -fPIC -DPIC -o .libs/asn1p_param.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -fPIC -DPIC -o .libs/asn1p_class.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -fPIC -DPIC -o .libs/asn1p_ref.o if test -f y.tab.h; then \ to=`echo "asn1p_y_H" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \ sed -e "/^#/!b" -e "s/Y_TAB_H/$to/g" -e "s|y\.tab\.h|asn1p_y.h|" \ y.tab.h >asn1p_y.ht; \ rm -f y.tab.h; \ if cmp -s asn1p_y.ht asn1p_y.h; then \ rm -f asn1p_y.ht ;\ else \ mv asn1p_y.ht asn1p_y.h; \ fi; \ fi if test -f y.output; then \ mv y.output asn1p_y.output; \ fi sed '/^#/ s|y\.tab\.c|asn1p_y.c|' y.tab.c >asn1p_y.ct && mv asn1p_y.ct asn1p_y.c rm -f y.tab.c if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF ".deps/asn1p_y.Tpo" -c -o asn1p_y.lo asn1p_y.c; \ then mv -f ".deps/asn1p_y.Tpo" ".deps/asn1p_y.Plo"; else rm -f ".deps/asn1p_y.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -o asn1p_constr.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -o asn1p_param.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -o asn1p_ref.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF .deps/asn1p_y.Tpo -c asn1p_y.c -fPIC -DPIC -o .libs/asn1p_y.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -o asn1p_class.o >/dev/null 2>&1 asn1p_y.y: In function 'asn1p_parse': asn1p_y.y:357:13: error: 'param' undeclared (first use in this function) *(void **)param = $1; ^~~~~ asn1p_y.y:357:13: note: each undeclared identifier is reported only once for each function it appears in gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -o asn1p_l.o >/dev/null 2>&1 Makefile:299: recipe for target 'asn1p_y.lo' failed make[2]: *** [asn1p_y.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory ' Makefile:302: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory ' Makefile:212: recipe for target 'all' failed make: *** [all] Error 2 Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Tue Jul 3 15:24:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 15:24:24 +0000 Subject: Change in osmo-ci[master]: jobs: add master+gerrit verification job for gapk In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9834 ) Change subject: jobs: add master+gerrit verification job for gapk ...................................................................... Patch Set 1: Verified+1 Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9834 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iedf3b43c164ae7e3e653820284c4d4ddaa545784 Gerrit-Change-Number: 9834 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Tue, 03 Jul 2018 15:24:24 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 15:24:25 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 15:24:25 +0000 Subject: Change in osmo-ci[master]: jobs: add master+gerrit verification job for gapk In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9834 ) Change subject: jobs: add master+gerrit verification job for gapk ...................................................................... jobs: add master+gerrit verification job for gapk Change-Id: Iedf3b43c164ae7e3e653820284c4d4ddaa545784 --- M ansible/roles/osmocom-jenkins-slave/tasks/main.yml M jobs/gerrit-verifications.yml M jobs/master-builds.yml 3 files changed, 5 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/ansible/roles/osmocom-jenkins-slave/tasks/main.yml b/ansible/roles/osmocom-jenkins-slave/tasks/main.yml index f76489c..cca3704 100644 --- a/ansible/roles/osmocom-jenkins-slave/tasks/main.yml +++ b/ansible/roles/osmocom-jenkins-slave/tasks/main.yml @@ -46,6 +46,9 @@ # by gsm-manuals - python-nwdiag - python-pychart + # by gapk + - libasound-dev + - libopencore-amrnb-dev - name: install build dependencies and libraries apt: diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index 14df458..0d977b2 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -185,6 +185,7 @@ - osmo-tetra - osmo-sysmon - simtrace2 + - gapk - osmo-ttcn3-hacks: repos_url: 'https://gerrit.osmocom.org/{repos}' diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml index 61f3973..56e8ca1 100644 --- a/jobs/master-builds.yml +++ b/jobs/master-builds.yml @@ -327,6 +327,7 @@ - osmocom-bb - osmo-sysmon - simtrace2 + - gapk - rtl-sdr: email: laforge at gnumonks.org steve at steve-m.de -- To view, visit https://gerrit.osmocom.org/9834 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iedf3b43c164ae7e3e653820284c4d4ddaa545784 Gerrit-Change-Number: 9834 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 15:24:35 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 15:24:35 +0000 Subject: Change in gapk[master]: libgsmhr/fetch_sources.py: fix source code downloading In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9792 ) Change subject: libgsmhr/fetch_sources.py: fix source code downloading ...................................................................... Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/9792 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gapk Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8afd39c85dd3e450c5355888ab6edcf4c81f8b87 Gerrit-Change-Number: 9792 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Tue, 03 Jul 2018 15:24:35 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 15:24:37 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 15:24:37 +0000 Subject: Change in gapk[master]: libgsmhr/fetch_sources.py: fix source code downloading In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9792 ) Change subject: libgsmhr/fetch_sources.py: fix source code downloading ...................................................................... libgsmhr/fetch_sources.py: fix source code downloading For some reason, the 3GPP server started to reject the source code download request: urllib2.HTTPError: HTTP Error 403: Forbidden Adding both 'User-Agent' and 'Accept' headers solves the problem. Change-Id: I8afd39c85dd3e450c5355888ab6edcf4c81f8b87 --- M libgsmhr/fetch_sources.py 1 file changed, 6 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/libgsmhr/fetch_sources.py b/libgsmhr/fetch_sources.py index a65fff2..6fb1b8e 100755 --- a/libgsmhr/fetch_sources.py +++ b/libgsmhr/fetch_sources.py @@ -12,6 +12,10 @@ SRC = "http://www.3gpp.org/ftp/Specs/archive/06_series/06.06/0606-421.zip" +HDR = { + "User-Agent": "Mozilla/5.0 (X11; ArchLinux; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0", + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", +} def get_zipfile(data): @@ -45,7 +49,8 @@ os.chdir(tgt) # Get the original data - u = urllib2.urlopen(SRC) + req = urllib2.Request(SRC, headers = HDR) + u = urllib2.urlopen(req) d = u.read() # Get DISK.zip -- To view, visit https://gerrit.osmocom.org/9792 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gapk Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I8afd39c85dd3e450c5355888ab6edcf4c81f8b87 Gerrit-Change-Number: 9792 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Tue Jul 3 15:26:26 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Tue, 3 Jul 2018 15:26:26 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-gapk_=C2=BB_a1=3Ddefaul?= =?UTF-8?Q?t,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#5?= In-Reply-To: <1369953268.34.1530630113946.JavaMail.jenkins@jenkins.osmocom.org> References: <1369953268.34.1530630113946.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <1509214416.36.1530631586458.JavaMail.jenkins@jenkins.osmocom.org> See Changes: [laforge] libgsmhr/fetch_sources.py: fix source code downloading ------------------------------------------ [...truncated 154.31 KB...] Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==2756==ABORTING Binary files expout and differ ./testsuite.at:180: exit code was 1, expected 0 18. testsuite.at:176: 18. conv/dec/racal_hr (testsuite.at:176): FAILED (testsuite.at:180) ======================== ./tests/testsuite.dir/15/testsuite.log # -*- compilation -*- 15. testsuite.at:143: testing conv/enc/rtp_hr_ietf ... ./testsuite.at:145: test "x$enable_hr_tests" = xyes || exit 77 ./testsuite.at:147: $abs_top_builddir/src/osmo-gapk \ -i $abs_srcdir/ref-files/hhgttg_part1_5.s16 \ -f rawpcm-s16le -g rtp-hr-ietf stderr: <0000> app_osmo_gapk.c:405 Opening I/O streams <0000> app_osmo_gapk.c:408 Using a file as source <0000> app_osmo_gapk.c:457 Using stdout as sink <0000> app_osmo_gapk.c:526 Creating a processing queue ================================================================= ==2669==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7ffff3ef928c at pc 0x7ffff6e9af7f bp 0x7fffffffdad0 sp 0x7fffffffd280 READ of size 7144 at 0x7ffff3ef928c thread T0 #0 0x7ffff6e9af7e (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x5cf7e) #1 0x7ffff3c76a1c in gsmhr_init :74 #2 0x7ffff67d8f41 in osmo_gapk_pq_queue_codec :48 #3 0x55555555b61f in make_processing_chain :589 #4 0x55555555b61f in main :765 #5 0x7ffff57292e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0) #6 0x55555555ce89 in _start ( 0x7ffff3ef928c is located 52 bytes to the left of global variable 'pL_NewCorrSeq' defined in 'refsrc/dtx.c:1091:10' (0x7ffff3ef92c0) of size 44 0x7ffff3ef928c is located 0 bytes to the right of global variable 'pL_CorrSeq' defined in 'refsrc/dtx.c:1092:10' (0x7ffff3ef9260) of size 44 SUMMARY: AddressSanitizer: global-buffer-overflow (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x5cf7e) Shadow bytes around the buggy address: 0x10007e7d7200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10007e7d7210: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10007e7d7220: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10007e7d7230: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10007e7d7240: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x10007e7d7250: 00[04]f9 f9 f9 f9 f9 f9 00 00 00 00 00 04 f9 f9 0x10007e7d7260: f9 f9 f9 f9 00 00 00 00 00 04 f9 f9 f9 f9 f9 f9 0x10007e7d7270: 02 f9 f9 f9 f9 f9 f9 f9 00 04 f9 f9 f9 f9 f9 f9 0x10007e7d7280: 02 f9 f9 f9 f9 f9 f9 f9 02 f9 f9 f9 f9 f9 f9 f9 0x10007e7d7290: 04 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00 0x10007e7d72a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==2669==ABORTING Binary files expout and differ ./testsuite.at:147: exit code was 1, expected 0 15. testsuite.at:143: 15. conv/enc/rtp_hr_ietf (testsuite.at:143): FAILED (testsuite.at:147) ======================== ./tests/testsuite.dir/26/testsuite.log # -*- compilation -*- 26. testsuite.at:264: testing conv/dec/rtp_hr_ietf ... ./testsuite.at:266: test "x$enable_hr_tests" = xyes || exit 77 ./testsuite.at:268: $abs_top_builddir/src/osmo-gapk \ -i $abs_srcdir/ref-files/hhgttg_part1_5.s16.rtp-hr-ietf \ -f rtp-hr-ietf -g rawpcm-s16le stderr: <0000> app_osmo_gapk.c:405 Opening I/O streams <0000> app_osmo_gapk.c:408 Using a file as source <0000> app_osmo_gapk.c:457 Using stdout as sink <0000> app_osmo_gapk.c:526 Creating a processing queue ================================================================= ==2982==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7ffff3ef928c at pc 0x7ffff6e9af7f bp 0x7fffffffdac0 sp 0x7fffffffd270 READ of size 7144 at 0x7ffff3ef928c thread T0 #0 0x7ffff6e9af7e (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x5cf7e) #1 0x7ffff3c76a1c in gsmhr_init :74 #2 0x7ffff67d8f41 in osmo_gapk_pq_queue_codec :48 #3 0x55555555b5f3 in make_processing_chain :573 #4 0x55555555b5f3 in main :765 #5 0x7ffff57292e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0) #6 0x55555555ce89 in _start ( 0x7ffff3ef928c is located 52 bytes to the left of global variable 'pL_NewCorrSeq' defined in 'refsrc/dtx.c:1091:10' (0x7ffff3ef92c0) of size 44 0x7ffff3ef928c is located 0 bytes to the right of global variable 'pL_CorrSeq' defined in 'refsrc/dtx.c:1092:10' (0x7ffff3ef9260) of size 44 SUMMARY: AddressSanitizer: global-buffer-overflow (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x5cf7e) Shadow bytes around the buggy address: 0x10007e7d7200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10007e7d7210: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10007e7d7220: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10007e7d7230: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10007e7d7240: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x10007e7d7250: 00[04]f9 f9 f9 f9 f9 f9 00 00 00 00 00 04 f9 f9 0x10007e7d7260: f9 f9 f9 f9 00 00 00 00 00 04 f9 f9 f9 f9 f9 f9 0x10007e7d7270: 02 f9 f9 f9 f9 f9 f9 f9 00 04 f9 f9 f9 f9 f9 f9 0x10007e7d7280: 02 f9 f9 f9 f9 f9 f9 f9 02 f9 f9 f9 f9 f9 f9 f9 0x10007e7d7290: 04 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00 0x10007e7d72a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==2982==ABORTING Binary files expout and differ ./testsuite.at:268: exit code was 1, expected 0 26. testsuite.at:264: 26. conv/dec/rtp_hr_ietf (testsuite.at:264): FAILED (testsuite.at:268) ======================== ./tests/testsuite.dir/01/testsuite.log # -*- compilation -*- 1. testsuite.at:4: testing procqueue ... ./testsuite.at:7: $abs_top_builddir/tests/procqueue/pq_test --- /dev/null 2018-03-27 19:17:06.212284948 +0000 +++ 2018-07-03 15:26:25.227377983 +0000 @@ -0,0 +1,9 @@ + +================================================================= +==2265==ERROR: LeakSanitizer: detected memory leaks + +Direct leak of 96 byte(s) in 1 object(s) allocated from: + #0 0x7ffff6effd28 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc1d28) + #1 0x7ffff69f06f2 in talloc_enable_null_tracking (/usr/lib/x86_64-linux-gnu/libtalloc.so.2+0xa6f2) + +SUMMARY: AddressSanitizer: 96 byte(s) leaked in 1 allocation(s). --- expout 2018-07-03 15:26:25.195378219 +0000 +++ 2018-07-03 15:26:25.195378219 +0000 @@ -1,60 +0,0 @@ -Processing queue allocation test: -chunk null_context: depth=0 - chunk struct osmo_gapk_pq 'q3': depth=1 - chunk .name: depth=2 - chunk struct osmo_gapk_pq 'q2': depth=1 - chunk .name: depth=2 - chunk struct osmo_gapk_pq 'q1': depth=1 - chunk .name: depth=2 - chunk struct osmo_gapk_pq: depth=1 - -Item allocation test: -chunk null_context: depth=0 - chunk struct osmo_gapk_pq 'q3': depth=1 - chunk struct osmo_gapk_pq_item: depth=2 - chunk struct osmo_gapk_pq_item: depth=2 - chunk struct osmo_gapk_pq_item: depth=2 - chunk .name: depth=2 - chunk struct osmo_gapk_pq 'q2': depth=1 - chunk struct osmo_gapk_pq_item: depth=2 - chunk struct osmo_gapk_pq_item: depth=2 - chunk .name: depth=2 - chunk struct osmo_gapk_pq 'q1': depth=1 - chunk struct osmo_gapk_pq_item: depth=2 - chunk .name: depth=2 - chunk struct osmo_gapk_pq: depth=1 - -Queue preparation test: -chunk null_context: depth=0 - chunk struct osmo_gapk_pq 'q3': depth=1 - chunk struct osmo_gapk_pq_item: depth=2 - chunk struct osmo_gapk_pq_item: depth=2 - chunk .buffer: depth=3 - chunk struct osmo_gapk_pq_item: depth=2 - chunk .buffer: depth=3 - chunk .name: depth=2 - chunk struct osmo_gapk_pq 'q2': depth=1 - chunk struct osmo_gapk_pq_item: depth=2 - chunk struct osmo_gapk_pq_item: depth=2 - chunk .name: depth=2 - chunk struct osmo_gapk_pq 'q1': depth=1 - chunk struct osmo_gapk_pq_item: depth=2 - chunk .name: depth=2 - chunk struct osmo_gapk_pq: depth=1 - -Queue description test: -Queue q3 description: source/file -> proc/dummy -> sink/alsa -Queue q2 description: source/dummy -> sink/dummy -Queue q1 description: dummy/dummy - -Processing queue execution test: -Incoming data: 0 1 2 3 4 5 6 7 8 9 -Outgoing data: 0 1 0 1 0 1 0 1 0 1 - -Processing queue exit callback test: -Calling exit callback for 'source/file' -Calling exit callback for 'proc/dummy' -Calling exit callback for 'sink/alsa' - -Processing queue deallocation test: -chunk null_context: depth=0 ./testsuite.at:7: exit code was 1, expected 0 1. testsuite.at:4: 1. procqueue (testsuite.at:4): FAILED (testsuite.at:7) Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Tue Jul 3 15:27:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 15:27:36 +0000 Subject: Change in gapk[master]: testsuite.at: fix: conditionally enable 'ecu/ecu_fr_test' In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9823 ) Change subject: testsuite.at: fix: conditionally enable 'ecu/ecu_fr_test' ...................................................................... Patch Set 1: Verified+1 Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9823 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gapk Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I74cf0e9de1e2f65e7227ee1565f12622bb55cabe Gerrit-Change-Number: 9823 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Tue, 03 Jul 2018 15:27:36 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 15:27:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 15:27:41 +0000 Subject: Change in gapk[master]: tests: make both Valgrind and LeakSanitizer happy In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9793 ) Change subject: tests: make both Valgrind and LeakSanitizer happy ...................................................................... Patch Set 2: Verified+1 Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9793 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gapk Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia660d2fdac720f685c0186720d0a476d7e9468be Gerrit-Change-Number: 9793 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Tue, 03 Jul 2018 15:27:41 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 15:27:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 15:27:47 +0000 Subject: Change in gapk[master]: testsuite.at: fix: conditionally enable 'ecu/ecu_fr_test' In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9823 ) Change subject: testsuite.at: fix: conditionally enable 'ecu/ecu_fr_test' ...................................................................... testsuite.at: fix: conditionally enable 'ecu/ecu_fr_test' In the 'ecu/ecu_fr_test' we have a processing queue with Full Rate decoder block, which depends on libgsm. If libgsm isn't available, the test will fail. Let's enable this test conditionally. Change-Id: I74cf0e9de1e2f65e7227ee1565f12622bb55cabe --- M tests/testsuite.at 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/tests/testsuite.at b/tests/testsuite.at index 2b1f4c2..5946661 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -25,6 +25,7 @@ AT_SETUP([ecu/ecu_fr_test]) AT_KEYWORDS([ecu_fr_test]) +AT_CHECK([test "x$enable_fr_tests" = xyes || exit 77]) cat $abs_srcdir/ecu/ecu_fr_test.ok > expout AT_CHECK([ $abs_top_builddir/tests/ecu/ecu_fr_test], [0], [expout]) -- To view, visit https://gerrit.osmocom.org/9823 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gapk Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I74cf0e9de1e2f65e7227ee1565f12622bb55cabe Gerrit-Change-Number: 9823 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 15:27:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 15:27:47 +0000 Subject: Change in gapk[master]: tests: make both Valgrind and LeakSanitizer happy In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9793 ) Change subject: tests: make both Valgrind and LeakSanitizer happy ...................................................................... tests: make both Valgrind and LeakSanitizer happy The talloc_enable_null_tracking() actually allocates a new talloc context, which makes both Valgrind and LeakSanitizer angry. This context should be freed by the talloc_disable_null_tracking(). Change-Id: Ia660d2fdac720f685c0186720d0a476d7e9468be --- M tests/ecu/ecu_fr_test.c M tests/io/pq_file_test.c M tests/io/pq_rtp_test.c M tests/procqueue/pq_test.c 4 files changed, 12 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/tests/ecu/ecu_fr_test.c b/tests/ecu/ecu_fr_test.c index 372df25..609112f 100644 --- a/tests/ecu/ecu_fr_test.c +++ b/tests/ecu/ecu_fr_test.c @@ -143,5 +143,8 @@ /* Make sure we have no memleaks */ talloc_report_depth_cb(NULL, 0, 10, &talloc_ctx_walk_cb, NULL); + /* Make both Valgrind and LeakSanitizer happy */ + talloc_disable_null_tracking(); + return 0; } diff --git a/tests/io/pq_file_test.c b/tests/io/pq_file_test.c index 6691db3..664acf7 100644 --- a/tests/io/pq_file_test.c +++ b/tests/io/pq_file_test.c @@ -145,5 +145,8 @@ /* Print talloc memory hierarchy */ talloc_report_depth_cb(NULL, 0, 10, &talloc_ctx_walk_cb, NULL); + /* Make both Valgrind and LeakSanitizer happy */ + talloc_disable_null_tracking(); + return 0; } diff --git a/tests/io/pq_rtp_test.c b/tests/io/pq_rtp_test.c index f4070b7..2c1bd41 100644 --- a/tests/io/pq_rtp_test.c +++ b/tests/io/pq_rtp_test.c @@ -345,5 +345,8 @@ /* Memory leak detection test */ talloc_report_depth_cb(NULL, 0, 10, &talloc_ctx_walk_cb, NULL); + /* Make both Valgrind and LeakSanitizer happy */ + talloc_disable_null_tracking(); + return 0; } diff --git a/tests/procqueue/pq_test.c b/tests/procqueue/pq_test.c index 198108d..84b3992 100644 --- a/tests/procqueue/pq_test.c +++ b/tests/procqueue/pq_test.c @@ -369,5 +369,8 @@ printf("Processing queue deallocation test:\n"); talloc_report_depth_cb(NULL, 0, 10, &talloc_ctx_walk_cb, NULL); + /* Make both Valgrind and LeakSanitizer happy */ + talloc_disable_null_tracking(); + return 0; } -- To view, visit https://gerrit.osmocom.org/9793 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gapk Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ia660d2fdac720f685c0186720d0a476d7e9468be Gerrit-Change-Number: 9793 Gerrit-PatchSet: 3 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Tue Jul 3 15:28:35 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Tue, 3 Jul 2018 15:28:35 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-gapk_=C2=BB_a1=3Ddefaul?= =?UTF-8?Q?t,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#6?= In-Reply-To: <1509214416.36.1530631586458.JavaMail.jenkins@jenkins.osmocom.org> References: <1509214416.36.1530631586458.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <746838323.37.1530631715970.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 155.74 KB...] Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==17788==ABORTING Binary files expout and differ ./testsuite.at:180: exit code was 1, expected 0 18. testsuite.at:176: 18. conv/dec/racal_hr (testsuite.at:176): FAILED (testsuite.at:180) ======================== ./tests/testsuite.dir/15/testsuite.log # -*- compilation -*- 15. testsuite.at:143: testing conv/enc/rtp_hr_ietf ... ./testsuite.at:145: test "x$enable_hr_tests" = xyes || exit 77 ./testsuite.at:147: $abs_top_builddir/src/osmo-gapk \ -i $abs_srcdir/ref-files/hhgttg_part1_5.s16 \ -f rawpcm-s16le -g rtp-hr-ietf stderr: <0000> app_osmo_gapk.c:405 Opening I/O streams <0000> app_osmo_gapk.c:408 Using a file as source <0000> app_osmo_gapk.c:457 Using stdout as sink <0000> app_osmo_gapk.c:526 Creating a processing queue ================================================================= ==17702==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7ffff3ef928c at pc 0x7ffff6e9af7f bp 0x7fffffffdad0 sp 0x7fffffffd280 READ of size 7144 at 0x7ffff3ef928c thread T0 #0 0x7ffff6e9af7e (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x5cf7e) #1 0x7ffff3c76a1c in gsmhr_init :74 #2 0x7ffff67d8f41 in osmo_gapk_pq_queue_codec :48 #3 0x55555555b61f in make_processing_chain :589 #4 0x55555555b61f in main :765 #5 0x7ffff57292e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0) #6 0x55555555ce89 in _start ( 0x7ffff3ef928c is located 52 bytes to the left of global variable 'pL_NewCorrSeq' defined in 'refsrc/dtx.c:1091:10' (0x7ffff3ef92c0) of size 44 0x7ffff3ef928c is located 0 bytes to the right of global variable 'pL_CorrSeq' defined in 'refsrc/dtx.c:1092:10' (0x7ffff3ef9260) of size 44 SUMMARY: AddressSanitizer: global-buffer-overflow (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x5cf7e) Shadow bytes around the buggy address: 0x10007e7d7200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10007e7d7210: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10007e7d7220: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10007e7d7230: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10007e7d7240: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x10007e7d7250: 00[04]f9 f9 f9 f9 f9 f9 00 00 00 00 00 04 f9 f9 0x10007e7d7260: f9 f9 f9 f9 00 00 00 00 00 04 f9 f9 f9 f9 f9 f9 0x10007e7d7270: 02 f9 f9 f9 f9 f9 f9 f9 00 04 f9 f9 f9 f9 f9 f9 0x10007e7d7280: 02 f9 f9 f9 f9 f9 f9 f9 02 f9 f9 f9 f9 f9 f9 f9 0x10007e7d7290: 04 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00 0x10007e7d72a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==17702==ABORTING Binary files expout and differ ./testsuite.at:147: exit code was 1, expected 0 15. testsuite.at:143: 15. conv/enc/rtp_hr_ietf (testsuite.at:143): FAILED (testsuite.at:147) ======================== ./tests/testsuite.dir/26/testsuite.log # -*- compilation -*- 26. testsuite.at:264: testing conv/dec/rtp_hr_ietf ... ./testsuite.at:266: test "x$enable_hr_tests" = xyes || exit 77 ./testsuite.at:268: $abs_top_builddir/src/osmo-gapk \ -i $abs_srcdir/ref-files/hhgttg_part1_5.s16.rtp-hr-ietf \ -f rtp-hr-ietf -g rawpcm-s16le stderr: <0000> app_osmo_gapk.c:405 Opening I/O streams <0000> app_osmo_gapk.c:408 Using a file as source <0000> app_osmo_gapk.c:457 Using stdout as sink <0000> app_osmo_gapk.c:526 Creating a processing queue ================================================================= ==18013==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7ffff3ef928c at pc 0x7ffff6e9af7f bp 0x7fffffffdac0 sp 0x7fffffffd270 READ of size 7144 at 0x7ffff3ef928c thread T0 #0 0x7ffff6e9af7e (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x5cf7e) #1 0x7ffff3c76a1c in gsmhr_init :74 #2 0x7ffff67d8f41 in osmo_gapk_pq_queue_codec :48 #3 0x55555555b5f3 in make_processing_chain :573 #4 0x55555555b5f3 in main :765 #5 0x7ffff57292e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0) #6 0x55555555ce89 in _start ( 0x7ffff3ef928c is located 52 bytes to the left of global variable 'pL_NewCorrSeq' defined in 'refsrc/dtx.c:1091:10' (0x7ffff3ef92c0) of size 44 0x7ffff3ef928c is located 0 bytes to the right of global variable 'pL_CorrSeq' defined in 'refsrc/dtx.c:1092:10' (0x7ffff3ef9260) of size 44 SUMMARY: AddressSanitizer: global-buffer-overflow (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x5cf7e) Shadow bytes around the buggy address: 0x10007e7d7200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10007e7d7210: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10007e7d7220: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10007e7d7230: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10007e7d7240: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x10007e7d7250: 00[04]f9 f9 f9 f9 f9 f9 00 00 00 00 00 04 f9 f9 0x10007e7d7260: f9 f9 f9 f9 00 00 00 00 00 04 f9 f9 f9 f9 f9 f9 0x10007e7d7270: 02 f9 f9 f9 f9 f9 f9 f9 00 04 f9 f9 f9 f9 f9 f9 0x10007e7d7280: 02 f9 f9 f9 f9 f9 f9 f9 02 f9 f9 f9 f9 f9 f9 f9 0x10007e7d7290: 04 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00 0x10007e7d72a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==18013==ABORTING Binary files expout and differ ./testsuite.at:268: exit code was 1, expected 0 26. testsuite.at:264: 26. conv/dec/rtp_hr_ietf (testsuite.at:264): FAILED (testsuite.at:268) ======================== ./tests/testsuite.dir/01/testsuite.log # -*- compilation -*- 1. testsuite.at:4: testing procqueue ... ./testsuite.at:7: $abs_top_builddir/tests/procqueue/pq_test --- /dev/null 2018-03-27 19:17:06.212284948 +0000 +++ 2018-07-03 15:28:34.750424580 +0000 @@ -0,0 +1,9 @@ + +================================================================= +==17309==ERROR: LeakSanitizer: detected memory leaks + +Direct leak of 96 byte(s) in 1 object(s) allocated from: + #0 0x7ffff6effd28 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc1d28) + #1 0x7ffff69f06f2 in talloc_enable_null_tracking (/usr/lib/x86_64-linux-gnu/libtalloc.so.2+0xa6f2) + +SUMMARY: AddressSanitizer: 96 byte(s) leaked in 1 allocation(s). --- expout 2018-07-03 15:28:34.718424815 +0000 +++ 2018-07-03 15:28:34.718424815 +0000 @@ -1,60 +0,0 @@ -Processing queue allocation test: -chunk null_context: depth=0 - chunk struct osmo_gapk_pq 'q3': depth=1 - chunk .name: depth=2 - chunk struct osmo_gapk_pq 'q2': depth=1 - chunk .name: depth=2 - chunk struct osmo_gapk_pq 'q1': depth=1 - chunk .name: depth=2 - chunk struct osmo_gapk_pq: depth=1 - -Item allocation test: -chunk null_context: depth=0 - chunk struct osmo_gapk_pq 'q3': depth=1 - chunk struct osmo_gapk_pq_item: depth=2 - chunk struct osmo_gapk_pq_item: depth=2 - chunk struct osmo_gapk_pq_item: depth=2 - chunk .name: depth=2 - chunk struct osmo_gapk_pq 'q2': depth=1 - chunk struct osmo_gapk_pq_item: depth=2 - chunk struct osmo_gapk_pq_item: depth=2 - chunk .name: depth=2 - chunk struct osmo_gapk_pq 'q1': depth=1 - chunk struct osmo_gapk_pq_item: depth=2 - chunk .name: depth=2 - chunk struct osmo_gapk_pq: depth=1 - -Queue preparation test: -chunk null_context: depth=0 - chunk struct osmo_gapk_pq 'q3': depth=1 - chunk struct osmo_gapk_pq_item: depth=2 - chunk struct osmo_gapk_pq_item: depth=2 - chunk .buffer: depth=3 - chunk struct osmo_gapk_pq_item: depth=2 - chunk .buffer: depth=3 - chunk .name: depth=2 - chunk struct osmo_gapk_pq 'q2': depth=1 - chunk struct osmo_gapk_pq_item: depth=2 - chunk struct osmo_gapk_pq_item: depth=2 - chunk .name: depth=2 - chunk struct osmo_gapk_pq 'q1': depth=1 - chunk struct osmo_gapk_pq_item: depth=2 - chunk .name: depth=2 - chunk struct osmo_gapk_pq: depth=1 - -Queue description test: -Queue q3 description: source/file -> proc/dummy -> sink/alsa -Queue q2 description: source/dummy -> sink/dummy -Queue q1 description: dummy/dummy - -Processing queue execution test: -Incoming data: 0 1 2 3 4 5 6 7 8 9 -Outgoing data: 0 1 0 1 0 1 0 1 0 1 - -Processing queue exit callback test: -Calling exit callback for 'source/file' -Calling exit callback for 'proc/dummy' -Calling exit callback for 'sink/alsa' - -Processing queue deallocation test: -chunk null_context: depth=0 ./testsuite.at:7: exit code was 1, expected 0 1. testsuite.at:4: 1. procqueue (testsuite.at:4): FAILED (testsuite.at:7) Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Tue Jul 3 15:29:13 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 15:29:13 +0000 Subject: Change in gapk[master]: fmt_ti.c: fix: properly pre-clean the output buffer In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9794 ) Change subject: fmt_ti.c: fix: properly pre-clean the output buffer ...................................................................... Patch Set 2: Verified+1 Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9794 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gapk Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I79df56dde23702b0eac8e8fdbc0efd270cc0ace4 Gerrit-Change-Number: 9794 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: tnt Gerrit-Comment-Date: Tue, 03 Jul 2018 15:29:13 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 15:29:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 15:29:32 +0000 Subject: Change in gapk[master]: fmt_ti.c: fix: properly pre-clean the output buffer In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9794 ) Change subject: fmt_ti.c: fix: properly pre-clean the output buffer ...................................................................... fmt_ti.c: fix: properly pre-clean the output buffer Despite it was stated that only the last nibble isn't being written, some other bytes in the middle of the output buffer were uninitialized during the first exectution of a queue. The problem was observed with AddressSanitizer enabled. Valgrind output: $ valgrind --track-origins=yes \ src/.libs/lt-osmo-gapk \ -i tests/ref-files/hhgttg_part1_5.s16.ti-efr \ -f ti-efr -g rawpcm-s16le \ -o /dev/null -v Conditional jump or move depends on uninitialised value(s) at 0x52728F2: msb_put_bit (utils.h:39) by 0x52728F2: amr_efr_from_canon (fmt_amr.c:45) by 0x5270A7D: osmo_gapk_pq_execute (procqueue.c:202) by 0x40296A: run (app_osmo_gapk.c:650) by 0x40296A: main (app_osmo_gapk.c:778) Uninitialised value was created by a heap allocation at 0x4C2AB80: malloc (in vgpreload_memcheck-amd64-linux.so) by 0x4E3C2A8: talloc_named_const (in libtalloc.so.2.1.5) by 0x5270A1B: osmo_gapk_pq_prepare (procqueue.c:180) by 0x402940: run (app_osmo_gapk.c:645) by 0x402940: main (app_osmo_gapk.c:778) Change-Id: I79df56dde23702b0eac8e8fdbc0efd270cc0ace4 Related: OS#2934 --- M src/fmt_ti.c 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/src/fmt_ti.c b/src/fmt_ti.c index d7a1ec7..61c0f8c 100644 --- a/src/fmt_ti.c +++ b/src/fmt_ti.c @@ -191,7 +191,8 @@ assert(src_len == TI_LEN); - dst[30] = 0x00; /* last nibble won't written, pre-clear it */ + /* Pre-clear the output buffer */ + memset(dst, 0x00, EFR_CANON_LEN); for (i=0; i<244; i++) { int si = i >= 182 ? i+4 : i; -- To view, visit https://gerrit.osmocom.org/9794 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gapk Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I79df56dde23702b0eac8e8fdbc0efd270cc0ace4 Gerrit-Change-Number: 9794 Gerrit-PatchSet: 3 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: tnt -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Tue Jul 3 15:30:42 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Tue, 3 Jul 2018 15:30:42 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-gapk_=C2=BB_a1=3Ddefaul?= =?UTF-8?Q?t,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#7?= In-Reply-To: <746838323.37.1530631715970.JavaMail.jenkins@jenkins.osmocom.org> References: <746838323.37.1530631715970.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <1028518139.38.1530631842983.JavaMail.jenkins@jenkins.osmocom.org> See Changes: [laforge] testsuite.at: fix: conditionally enable 'ecu/ecu_fr_test' [laforge] tests: make both Valgrind and LeakSanitizer happy [laforge] fmt_ti.c: fix: properly pre-clean the output buffer ------------------------------------------ [...truncated 139.79 KB...] 0x7ffff3ef928c is located 52 bytes to the left of global variable 'pL_NewCorrSeq' defined in 'refsrc/dtx.c:1091:10' (0x7ffff3ef92c0) of size 44 0x7ffff3ef928c is located 0 bytes to the right of global variable 'pL_CorrSeq' defined in 'refsrc/dtx.c:1092:10' (0x7ffff3ef9260) of size 44 SUMMARY: AddressSanitizer: global-buffer-overflow (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x5cf7e) Shadow bytes around the buggy address: 0x10007e7d7200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10007e7d7210: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10007e7d7220: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10007e7d7230: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10007e7d7240: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x10007e7d7250: 00[04]f9 f9 f9 f9 f9 f9 00 00 00 00 00 04 f9 f9 0x10007e7d7260: f9 f9 f9 f9 00 00 00 00 00 04 f9 f9 f9 f9 f9 f9 0x10007e7d7270: 02 f9 f9 f9 f9 f9 f9 f9 00 04 f9 f9 f9 f9 f9 f9 0x10007e7d7280: 02 f9 f9 f9 f9 f9 f9 f9 02 f9 f9 f9 f9 f9 f9 f9 0x10007e7d7290: 04 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00 0x10007e7d72a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==32602==ABORTING Binary files expout and differ ./testsuite.at:60: exit code was 1, expected 0 7. testsuite.at:56: 7. conv/enc/racal_hr (testsuite.at:56): FAILED (testsuite.at:60) ======================== ./tests/testsuite.dir/18/testsuite.log # -*- compilation -*- 18. testsuite.at:177: testing conv/dec/racal_hr ... ./testsuite.at:179: test "x$enable_hr_tests" = xyes || exit 77 ./testsuite.at:181: $abs_top_builddir/src/osmo-gapk \ -i $abs_srcdir/ref-files/hhgttg_part1_5.s16.racal-hr \ -f racal-hr -g rawpcm-s16le stderr: <0000> app_osmo_gapk.c:405 Opening I/O streams <0000> app_osmo_gapk.c:408 Using a file as source <0000> app_osmo_gapk.c:457 Using stdout as sink <0000> app_osmo_gapk.c:526 Creating a processing queue ================================================================= ==450==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7ffff3ef928c at pc 0x7ffff6e9af7f bp 0x7fffffffdad0 sp 0x7fffffffd280 READ of size 7144 at 0x7ffff3ef928c thread T0 #0 0x7ffff6e9af7e (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x5cf7e) #1 0x7ffff3c76a1c in gsmhr_init :74 #2 0x7ffff67d8f31 in osmo_gapk_pq_queue_codec :48 #3 0x55555555b5f3 in make_processing_chain :573 #4 0x55555555b5f3 in main :765 #5 0x7ffff57292e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0) #6 0x55555555ce89 in _start ( 0x7ffff3ef928c is located 52 bytes to the left of global variable 'pL_NewCorrSeq' defined in 'refsrc/dtx.c:1091:10' (0x7ffff3ef92c0) of size 44 0x7ffff3ef928c is located 0 bytes to the right of global variable 'pL_CorrSeq' defined in 'refsrc/dtx.c:1092:10' (0x7ffff3ef9260) of size 44 SUMMARY: AddressSanitizer: global-buffer-overflow (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x5cf7e) Shadow bytes around the buggy address: 0x10007e7d7200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10007e7d7210: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10007e7d7220: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10007e7d7230: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10007e7d7240: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x10007e7d7250: 00[04]f9 f9 f9 f9 f9 f9 00 00 00 00 00 04 f9 f9 0x10007e7d7260: f9 f9 f9 f9 00 00 00 00 00 04 f9 f9 f9 f9 f9 f9 0x10007e7d7270: 02 f9 f9 f9 f9 f9 f9 f9 00 04 f9 f9 f9 f9 f9 f9 0x10007e7d7280: 02 f9 f9 f9 f9 f9 f9 f9 02 f9 f9 f9 f9 f9 f9 f9 0x10007e7d7290: 04 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00 0x10007e7d72a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==450==ABORTING Binary files expout and differ ./testsuite.at:181: exit code was 1, expected 0 18. testsuite.at:177: 18. conv/dec/racal_hr (testsuite.at:177): FAILED (testsuite.at:181) ======================== ./tests/testsuite.dir/15/testsuite.log # -*- compilation -*- 15. testsuite.at:144: testing conv/enc/rtp_hr_ietf ... ./testsuite.at:146: test "x$enable_hr_tests" = xyes || exit 77 ./testsuite.at:148: $abs_top_builddir/src/osmo-gapk \ -i $abs_srcdir/ref-files/hhgttg_part1_5.s16 \ -f rawpcm-s16le -g rtp-hr-ietf stderr: <0000> app_osmo_gapk.c:405 Opening I/O streams <0000> app_osmo_gapk.c:408 Using a file as source <0000> app_osmo_gapk.c:457 Using stdout as sink <0000> app_osmo_gapk.c:526 Creating a processing queue ================================================================= ==362==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7ffff3ef928c at pc 0x7ffff6e9af7f bp 0x7fffffffdad0 sp 0x7fffffffd280 READ of size 7144 at 0x7ffff3ef928c thread T0 #0 0x7ffff6e9af7e (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x5cf7e) #1 0x7ffff3c76a1c in gsmhr_init :74 #2 0x7ffff67d8f31 in osmo_gapk_pq_queue_codec :48 #3 0x55555555b61f in make_processing_chain :589 #4 0x55555555b61f in main :765 #5 0x7ffff57292e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0) #6 0x55555555ce89 in _start ( 0x7ffff3ef928c is located 52 bytes to the left of global variable 'pL_NewCorrSeq' defined in 'refsrc/dtx.c:1091:10' (0x7ffff3ef92c0) of size 44 0x7ffff3ef928c is located 0 bytes to the right of global variable 'pL_CorrSeq' defined in 'refsrc/dtx.c:1092:10' (0x7ffff3ef9260) of size 44 SUMMARY: AddressSanitizer: global-buffer-overflow (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x5cf7e) Shadow bytes around the buggy address: 0x10007e7d7200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10007e7d7210: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10007e7d7220: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10007e7d7230: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10007e7d7240: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x10007e7d7250: 00[04]f9 f9 f9 f9 f9 f9 00 00 00 00 00 04 f9 f9 0x10007e7d7260: f9 f9 f9 f9 00 00 00 00 00 04 f9 f9 f9 f9 f9 f9 0x10007e7d7270: 02 f9 f9 f9 f9 f9 f9 f9 00 04 f9 f9 f9 f9 f9 f9 0x10007e7d7280: 02 f9 f9 f9 f9 f9 f9 f9 02 f9 f9 f9 f9 f9 f9 f9 0x10007e7d7290: 04 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00 0x10007e7d72a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==362==ABORTING Binary files expout and differ ./testsuite.at:148: exit code was 1, expected 0 15. testsuite.at:144: 15. conv/enc/rtp_hr_ietf (testsuite.at:144): FAILED (testsuite.at:148) ======================== ./tests/testsuite.dir/26/testsuite.log # -*- compilation -*- 26. testsuite.at:265: testing conv/dec/rtp_hr_ietf ... ./testsuite.at:267: test "x$enable_hr_tests" = xyes || exit 77 ./testsuite.at:269: $abs_top_builddir/src/osmo-gapk \ -i $abs_srcdir/ref-files/hhgttg_part1_5.s16.rtp-hr-ietf \ -f rtp-hr-ietf -g rawpcm-s16le stderr: <0000> app_osmo_gapk.c:405 Opening I/O streams <0000> app_osmo_gapk.c:408 Using a file as source <0000> app_osmo_gapk.c:457 Using stdout as sink <0000> app_osmo_gapk.c:526 Creating a processing queue ================================================================= ==692==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7ffff3ef928c at pc 0x7ffff6e9af7f bp 0x7fffffffdac0 sp 0x7fffffffd270 READ of size 7144 at 0x7ffff3ef928c thread T0 #0 0x7ffff6e9af7e (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x5cf7e) #1 0x7ffff3c76a1c in gsmhr_init :74 #2 0x7ffff67d8f31 in osmo_gapk_pq_queue_codec :48 #3 0x55555555b5f3 in make_processing_chain :573 #4 0x55555555b5f3 in main :765 #5 0x7ffff57292e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0) #6 0x55555555ce89 in _start ( 0x7ffff3ef928c is located 52 bytes to the left of global variable 'pL_NewCorrSeq' defined in 'refsrc/dtx.c:1091:10' (0x7ffff3ef92c0) of size 44 0x7ffff3ef928c is located 0 bytes to the right of global variable 'pL_CorrSeq' defined in 'refsrc/dtx.c:1092:10' (0x7ffff3ef9260) of size 44 SUMMARY: AddressSanitizer: global-buffer-overflow (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x5cf7e) Shadow bytes around the buggy address: 0x10007e7d7200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10007e7d7210: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10007e7d7220: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10007e7d7230: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10007e7d7240: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x10007e7d7250: 00[04]f9 f9 f9 f9 f9 f9 00 00 00 00 00 04 f9 f9 0x10007e7d7260: f9 f9 f9 f9 00 00 00 00 00 04 f9 f9 f9 f9 f9 f9 0x10007e7d7270: 02 f9 f9 f9 f9 f9 f9 f9 00 04 f9 f9 f9 f9 f9 f9 0x10007e7d7280: 02 f9 f9 f9 f9 f9 f9 f9 02 f9 f9 f9 f9 f9 f9 f9 0x10007e7d7290: 04 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00 0x10007e7d72a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==692==ABORTING Binary files expout and differ ./testsuite.at:269: exit code was 1, expected 0 26. testsuite.at:265: 26. conv/dec/rtp_hr_ietf (testsuite.at:265): FAILED (testsuite.at:269) Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Tue Jul 3 16:45:21 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 3 Jul 2018 16:45:21 +0000 Subject: Change in simtrace2[master]: fix: remove unused code Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9839 Change subject: fix: remove unused code ...................................................................... fix: remove unused code adc2uv is not used in boardver_adc.c. a FIXME comment says it should be shared with mode_cardemu.c. the exact same code is already available in mode_cardemu.c Change-Id: Ib87b35bd9a32c8b7df3f8af8015ca002784d333c --- M firmware/libboard/common/source/boardver_adc.c 1 file changed, 0 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/39/9839/1 diff --git a/firmware/libboard/common/source/boardver_adc.c b/firmware/libboard/common/source/boardver_adc.c index ca3d1fe..1bd3b58 100644 --- a/firmware/libboard/common/source/boardver_adc.c +++ b/firmware/libboard/common/source/boardver_adc.c @@ -1,14 +1,6 @@ #include "board.h" #include "boardver_adc.h" -/* FIXME: share this with mode_cardemu.c */ -#define UV_PER_LSB ((3300 * 1000) / 4096) -static uint32_t adc2uv(uint16_t adc) -{ - uint32_t uv = (uint32_t) adc * UV_PER_LSB; - return uv; -} - /*********************************************************************** * ADC for board version detection ***********************************************************************/ -- To view, visit https://gerrit.osmocom.org/9839 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ib87b35bd9a32c8b7df3f8af8015ca002784d333c Gerrit-Change-Number: 9839 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 16:45:22 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 3 Jul 2018 16:45:22 +0000 Subject: Change in simtrace2[master]: copy working cardem app to trace Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9840 Change subject: copy working cardem app to trace ...................................................................... copy working cardem app to trace because the applications share the board capabilities defined in libboard/*/include/board.h and USB configurations are enabled according to the previously defined capabilities in libcommon/source.usb.c, all applications actually offer the same functions. thus creating the trace application is only mainly a cosmetic change, as the sniffer function will also be present and enabled in the cardem application. Change-Id: I24b3500a0905cbd622507722280b3c7e7f188bde --- A firmware/apps/trace/Makefile M firmware/apps/trace/main.c A firmware/apps/trace/usb_strings.txt 3 files changed, 222 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/40/9840/1 diff --git a/firmware/apps/trace/Makefile b/firmware/apps/trace/Makefile new file mode 100644 index 0000000..75c43e8 --- /dev/null +++ b/firmware/apps/trace/Makefile @@ -0,0 +1,3 @@ +C_FILES += $(C_LIBUSB_RT) + +C_FILES += card_emu.c cciddriver.c iso7816_4.c iso7816_fidi.c mitm.c mode_cardemu.c mode_ccid.c simtrace_iso7816.c sniffer.c tc_etu.c usb.c diff --git a/firmware/apps/trace/main.c b/firmware/apps/trace/main.c index e69de29..aabaa41 100644 --- a/firmware/apps/trace/main.c +++ b/firmware/apps/trace/main.c @@ -0,0 +1,209 @@ +// FIXME: Copyright license here +/*------------------------------------------------------------------------------ + * Headers + *------------------------------------------------------------------------------*/ + +#include "board.h" +#include "simtrace.h" +#include "utils.h" +#include "osmocom/core/timer.h" + +unsigned int g_unique_id[4]; + +/*------------------------------------------------------------------------------ + * Internal variables + *------------------------------------------------------------------------------*/ +typedef struct { + /* static initialization, called whether or not the usb config is active */ + void (*configure) (void); + /* initialization function after the config was selected */ + void (*init) (void); + /* de-initialization before selecting new config */ + void (*exit) (void); + /* main loop content for given configuration */ + void (*run) (void); + /* Interrupt handler for USART1 */ + void (*usart0_irq) (void); + /* Interrupt handler for USART1 */ + void (*usart1_irq) (void); +} conf_func; + +static const conf_func config_func_ptrs[] = { + /* array slot 0 is empty, usb configs start at 1 */ +#ifdef HAVE_SNIFFER + [CFG_NUM_SNIFF] = { + .configure = Sniffer_configure, + .init = Sniffer_init, + .exit = Sniffer_exit, + .run = Sniffer_run, + }, +#endif +#ifdef HAVE_CCID + [CFG_NUM_CCID] = { + .configure = CCID_configure, + .init = CCID_init, + .exit = CCID_exit, + .run = CCID_run, + }, +#endif +#ifdef HAVE_CARDEM + [CFG_NUM_PHONE] = { + .configure = mode_cardemu_configure, + .init = mode_cardemu_init, + .exit = mode_cardemu_exit, + .run = mode_cardemu_run, + .usart0_irq = mode_cardemu_usart0_irq, + .usart1_irq = mode_cardemu_usart1_irq, + }, +#endif +#ifdef HAVE_MITM + [CFG_NUM_MITM] = { + .configure = MITM_configure, + .init = MITM_init, + .exit = MITM_exit, + .run = MITM_run, + }, +#endif +}; + +/*------------------------------------------------------------------------------ + * Internal variables + *------------------------------------------------------------------------------*/ +#if defined(HAVE_SNIFFER) +static volatile enum confNum simtrace_config = CFG_NUM_SNIFF; +#elif defined(HAVE_CARDEM) +static volatile enum confNum simtrace_config = CFG_NUM_PHONE; +#elif defined(HAVE_CCID) +static volatile enum confNum simtrace_config = CFG_NUM_CCID; +#endif + +/*---------------------------------------------------------------------------- + * Callbacks + *----------------------------------------------------------------------------*/ + +void USBDDriverCallbacks_ConfigurationChanged(uint8_t cfgnum) +{ + TRACE_INFO_WP("cfgChanged%d ", cfgnum); + simtrace_config = cfgnum; +} + +void USART1_IrqHandler(void) +{ + if (config_func_ptrs[simtrace_config].usart1_irq) + config_func_ptrs[simtrace_config].usart1_irq(); +} + +void USART0_IrqHandler(void) +{ + if (config_func_ptrs[simtrace_config].usart0_irq) + config_func_ptrs[simtrace_config].usart0_irq(); +} + +/* returns '1' in case we should break any endless loop */ +static void check_exec_dbg_cmd(void) +{ + int ch; + + if (!UART_IsRxReady()) + return; + + ch = UART_GetChar(); + + board_exec_dbg_cmd(ch); +} + +/*------------------------------------------------------------------------------ + * Main + *------------------------------------------------------------------------------*/ +#define MAX_USB_ITER BOARD_MCK/72 // This should be around a second +extern int main(void) +{ + uint8_t isUsbConnected = 0; + enum confNum last_simtrace_config = simtrace_config; + unsigned int i = 0; + + led_init(); + led_blink(LED_RED, BLINK_3O_5F); + + /* Enable watchdog for 500ms, with no window */ + WDT_Enable(WDT, WDT_MR_WDRSTEN | WDT_MR_WDDBGHLT | WDT_MR_WDIDLEHLT | + (WDT_GetPeriod(500) << 16) | WDT_GetPeriod(500)); + + PIO_InitializeInterrupts(0); + + EEFC_ReadUniqueID(g_unique_id); + + printf("\n\r\n\r" + "=============================================================================\n\r" + "SIMtrace2 firmware " GIT_VERSION " (C) 2010-2016 by Harald Welte\n\r" + "=============================================================================\n\r"); + + TRACE_INFO("Chip ID: 0x%08x (Ext 0x%08x)\n\r", CHIPID->CHIPID_CIDR, CHIPID->CHIPID_EXID); + TRACE_INFO("Serial Nr. %08x-%08x-%08x-%08x\n\r", + g_unique_id[0], g_unique_id[1], + g_unique_id[2], g_unique_id[3]); + TRACE_INFO("Reset Cause: 0x%x\n\r", (RSTC->RSTC_SR & RSTC_SR_RSTTYP_Msk) >> RSTC_SR_RSTTYP_Pos); + + board_main_top(); + + TRACE_INFO("USB init...\n\r"); + SIMtrace_USB_Initialize(); + + while (USBD_GetState() < USBD_STATE_CONFIGURED) { + WDT_Restart(WDT); + check_exec_dbg_cmd(); +#if 0 + if (i >= MAX_USB_ITER * 3) { + TRACE_ERROR("Resetting board (USB could " + "not be configured)\n\r"); + USBD_Disconnect(); + NVIC_SystemReset(); + } +#endif + i++; + } + + TRACE_INFO("calling configure of all configurations...\n\r"); + for (i = 1; i < sizeof(config_func_ptrs) / sizeof(config_func_ptrs[0]); + ++i) { + if (config_func_ptrs[i].configure) + config_func_ptrs[i].configure(); + } + + TRACE_INFO("calling init of config %u...\n\r", simtrace_config); + config_func_ptrs[simtrace_config].init(); + last_simtrace_config = simtrace_config; + + TRACE_INFO("entering main loop...\n\r"); + while (1) { + WDT_Restart(WDT); +#if TRACE_LEVEL >= TRACE_LEVEL_DEBUG + const char rotor[] = { '-', '\\', '|', '/' }; + putchar('\b'); + putchar(rotor[i++ % ARRAY_SIZE(rotor)]); +#endif + check_exec_dbg_cmd(); + osmo_timers_prepare(); + osmo_timers_update(); + + if (USBD_GetState() < USBD_STATE_CONFIGURED) { + + if (isUsbConnected) { + isUsbConnected = 0; + } + } else if (isUsbConnected == 0) { + TRACE_INFO("USB is now configured\n\r"); + + isUsbConnected = 1; + } + if (last_simtrace_config != simtrace_config) { + TRACE_INFO("USB config chg %u -> %u\n\r", + last_simtrace_config, simtrace_config); + config_func_ptrs[last_simtrace_config].exit(); + config_func_ptrs[simtrace_config].init(); + last_simtrace_config = simtrace_config; + } else { + config_func_ptrs[simtrace_config].run(); + } + } +} diff --git a/firmware/apps/trace/usb_strings.txt b/firmware/apps/trace/usb_strings.txt new file mode 100644 index 0000000..0e797ac --- /dev/null +++ b/firmware/apps/trace/usb_strings.txt @@ -0,0 +1,10 @@ +sysmocom - s.f.m.c. GmbH +SIMtrace 2 compatible device +SIMtrace Sniffer +SIMtrace CCID +SIMtrace Phone +SIMtrace MITM +CardEmulator Modem 1 +CardEmulator Modem 2 +CardEmulator Modem 3 +CardEmulator Modem 4 -- To view, visit https://gerrit.osmocom.org/9840 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I24b3500a0905cbd622507722280b3c7e7f188bde Gerrit-Change-Number: 9840 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 16:45:22 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 3 Jul 2018 16:45:22 +0000 Subject: Change in simtrace2[master]: enable (empty) sniffer support for SIMtrace board Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9841 Change subject: enable (empty) sniffer support for SIMtrace board ...................................................................... enable (empty) sniffer support for SIMtrace board Change-Id: I51619135fd6f5423542f261e7d76bab1a5713e2b --- M firmware/libboard/simtrace/include/board.h M firmware/libcommon/source/sniffer.c 2 files changed, 15 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/41/9841/1 diff --git a/firmware/libboard/simtrace/include/board.h b/firmware/libboard/simtrace/include/board.h index 742ce7c..3b8296b 100644 --- a/firmware/libboard/simtrace/include/board.h +++ b/firmware/libboard/simtrace/include/board.h @@ -11,7 +11,7 @@ /** Phone (SIM card emulator)/CCID Reader/MITM configuration **/ /* Normally the communication lines between phone and SIM card are disconnected */ // Disconnect SIM card I/O, VPP line from the phone lines -// FIXME: Per default pins are input, therefore high-impedance, therefore they don not activate the bus switch, right? +// FIXME: Per default pins are input, therefore high-impedance, therefore the bus switch is in an unknown state by default for hardware version <= 1.4. It should be pulled high by an external resistor to set the bus switch to high-impedance (e.g. off). #define PIN_SC_SW_DEFAULT {PIO_PA20, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} // Disconnect SIM card RST, CLK line from the phone lines #define PIN_IO_SW_DEFAULT {PIO_PA19, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} @@ -82,7 +82,7 @@ #define BOARD_DFU_USB_PRODUCT_ID USB_PRODUCT_SIMTRACE2_DFU #define BOARD_USB_RELEASE 0x000 -//#define HAVE_SNIFFER +#define HAVE_SNIFFER #define HAVE_CCID #define HAVE_CARDEM //#define HAVE_MITM diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 67c11a2..06edb22 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -27,14 +27,15 @@ * ---------------------------------------------------------------------------- */ +#include "board.h" +#include "simtrace.h" + #ifdef HAVE_SNIFFER /*------------------------------------------------------------------------------ * Headers *------------------------------------------------------------------------------*/ -#include "board.h" - #include /*------------------------------------------------------------------------------ @@ -67,6 +68,12 @@ .state = USART_RCV, }; + +int check_data_from_phone(void) +{ + TRACE_INFO("check data from phone\n\r"); +} + /*----------------------------------------------------------------------------- * Initialization routine *-----------------------------------------------------------------------------*/ @@ -74,22 +81,22 @@ /* Called during USB enumeration after device is enumerated by host */ void Sniffer_configure(void) { - TRACE_INFO("Sniffer config\n"); + TRACE_INFO("Sniffer config\n\r"); } /* called when *different* configuration is set by host */ void Sniffer_exit(void) { - TRACE_INFO("Sniffer exit\n"); + TRACE_INFO("Sniffer exit\n\r"); USART_DisableIt(USART_PHONE, US_IER_RXRDY); NVIC_DisableIRQ(USART1_IRQn); USART_SetReceiverEnabled(USART_PHONE, 0); } -/* called when *CCID* configuration is set by host */ +/* called when *Sniffer* configuration is set by host */ void Sniffer_init(void) { - TRACE_INFO("Sniffer Init\n"); + TRACE_INFO("Sniffer Init\n\r"); /* Configure ISO7816 driver */ PIO_Configure(pinsISO7816_sniff, PIO_LISTSIZE(pinsISO7816_sniff)); PIO_Configure(pins_bus, PIO_LISTSIZE(pins_bus)); -- To view, visit https://gerrit.osmocom.org/9841 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I51619135fd6f5423542f261e7d76bab1a5713e2b Gerrit-Change-Number: 9841 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 16:45:22 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 3 Jul 2018 16:45:22 +0000 Subject: Change in simtrace2[master]: add more USB configuration checks and error messages Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9842 Change subject: add more USB configuration checks and error messages ...................................................................... add more USB configuration checks and error messages Change-Id: I20f8018cd5087254dfbfad40b73803390aa84183 --- M firmware/apps/trace/main.c 1 file changed, 64 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/42/9842/1 diff --git a/firmware/apps/trace/main.c b/firmware/apps/trace/main.c index aabaa41..54b4242 100644 --- a/firmware/apps/trace/main.c +++ b/firmware/apps/trace/main.c @@ -1,4 +1,22 @@ -// FIXME: Copyright license here +/* + * (C) 2010-2017 by Harald Welte + * (C) 2018 by Kevin Redon + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ /*------------------------------------------------------------------------------ * Headers *------------------------------------------------------------------------------*/ @@ -84,6 +102,9 @@ void USBDDriverCallbacks_ConfigurationChanged(uint8_t cfgnum) { TRACE_INFO_WP("cfgChanged%d ", cfgnum); + if (cfgnum >= sizeof(config_func_ptrs)/sizeof(config_func_ptrs[0])) { + TRACE_FATAL_WP("no functions defined for configuration %d\n\r", cfgnum); + } simtrace_config = cfgnum; } @@ -144,10 +165,13 @@ g_unique_id[2], g_unique_id[3]); TRACE_INFO("Reset Cause: 0x%x\n\r", (RSTC->RSTC_SR & RSTC_SR_RSTTYP_Msk) >> RSTC_SR_RSTTYP_Pos); + TRACE_INFO("cfg %d\n\r", simtrace_config); + board_main_top(); TRACE_INFO("USB init...\n\r"); SIMtrace_USB_Initialize(); + TRACE_INFO_WP("USBD_Inited\n\r"); while (USBD_GetState() < USBD_STATE_CONFIGURED) { WDT_Restart(WDT); @@ -164,14 +188,26 @@ } TRACE_INFO("calling configure of all configurations...\n\r"); - for (i = 1; i < sizeof(config_func_ptrs) / sizeof(config_func_ptrs[0]); - ++i) { - if (config_func_ptrs[i].configure) + for (i = 1; i < sizeof(config_func_ptrs) / sizeof(config_func_ptrs[0]); ++i) { + if (config_func_ptrs[i].configure) { config_func_ptrs[i].configure(); + } else { + TRACE_WARNING("no configure function defined for configuration %d\n\r", i); + } } + TRACE_INFO("cfg %d\n\r", simtrace_config); + TRACE_INFO("calling init of config %u...\n\r", simtrace_config); - config_func_ptrs[simtrace_config].init(); + if (simtrace_config >= sizeof(config_func_ptrs)/sizeof(config_func_ptrs[0])) { + TRACE_ERROR("no functions defined for configuration %d\n\r", simtrace_config); + } else { + if (config_func_ptrs[simtrace_config].init) { + config_func_ptrs[simtrace_config].init(); + } else { + TRACE_ERROR("no init function defined for configuration %d\n\r", simtrace_config); + } + } last_simtrace_config = simtrace_config; TRACE_INFO("entering main loop...\n\r"); @@ -199,11 +235,31 @@ if (last_simtrace_config != simtrace_config) { TRACE_INFO("USB config chg %u -> %u\n\r", last_simtrace_config, simtrace_config); - config_func_ptrs[last_simtrace_config].exit(); - config_func_ptrs[simtrace_config].init(); + if (last_simtrace_config < sizeof(config_func_ptrs)/sizeof(config_func_ptrs[0])) { + if (config_func_ptrs[last_simtrace_config].exit) { + config_func_ptrs[last_simtrace_config].exit(); + } else { + TRACE_WARNING("exit not defined for configuration %d\n\r", last_simtrace_config); + } + } else { + TRACE_ERROR("no functions defined for configuration %d\n\r", last_simtrace_config); + } + if (simtrace_config < sizeof(config_func_ptrs)/sizeof(config_func_ptrs[0])) { + if (config_func_ptrs[simtrace_config].init) { + config_func_ptrs[simtrace_config].init(); + } else { + TRACE_WARNING("init not defined for configuration %d\n\r", simtrace_config); + } + } else { + TRACE_FATAL("no functions defined for configuration %d\n\r", simtrace_config); + } last_simtrace_config = simtrace_config; } else { - config_func_ptrs[simtrace_config].run(); + if (config_func_ptrs[simtrace_config].run) { + config_func_ptrs[simtrace_config].run(); + } else { + TRACE_ERROR("run not defined for configuration %d\n\r", simtrace_config); + } } } } -- To view, visit https://gerrit.osmocom.org/9842 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I20f8018cd5087254dfbfad40b73803390aa84183 Gerrit-Change-Number: 9842 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 16:45:23 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 3 Jul 2018 16:45:23 +0000 Subject: Change in simtrace2[master]: sniff mode: handle USART 1 RX interrupt to show sniffer data Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9843 Change subject: sniff mode: handle USART 1 RX interrupt to show sniffer data ...................................................................... sniff mode: handle USART 1 RX interrupt to show sniffer data Change-Id: I5504369aed39844b7cf21e5b3ccb542daa6b946e --- M firmware/apps/trace/main.c M firmware/libcommon/include/simtrace.h M firmware/libcommon/source/sniffer.c 3 files changed, 36 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/43/9843/1 diff --git a/firmware/apps/trace/main.c b/firmware/apps/trace/main.c index 54b4242..6096362 100644 --- a/firmware/apps/trace/main.c +++ b/firmware/apps/trace/main.c @@ -54,6 +54,7 @@ .init = Sniffer_init, .exit = Sniffer_exit, .run = Sniffer_run, + .usart1_irq = Sniffer_usart1_irq, }, #endif #ifdef HAVE_CCID diff --git a/firmware/libcommon/include/simtrace.h b/firmware/libcommon/include/simtrace.h index 348cc57..21921ca 100644 --- a/firmware/libcommon/include/simtrace.h +++ b/firmware/libcommon/include/simtrace.h @@ -108,6 +108,8 @@ extern void mode_cardemu_run(void); extern void MITM_run( void ); +/* IRQ functions */ +extern void Sniffer_usart1_irq(void); extern void mode_cardemu_usart0_irq(void); extern void mode_cardemu_usart1_irq(void); diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 06edb22..fa272eb 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -58,7 +58,7 @@ /* Enable power converter 4.5-6V to 3.3V; low: off */ {SIM_PWEN, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT}, - /* Enable second power converter: VCC_PHONE to VCC_SIM; high: on */ + /* Enable power forwarding: VCC_PHONE to VCC_SIM; high: on */ {VCC_FWD, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} }; @@ -68,10 +68,37 @@ .state = USART_RCV, }; +/* Ring buffer to store sniffer communication data */ +static struct ringbuf sniff_buffer; + +/*------------------------------------------------------------------------------ + * Global functions + *------------------------------------------------------------------------------*/ + +void Sniffer_usart1_irq(void) +{ + /* Read channel status register */ + uint32_t csr = usart_info.base->US_CSR & usart_info.base->US_IMR; + /* Verify if character has been received */ + if (csr & US_CSR_RXRDY) { + /* Read communication data byte between phone and SIM */ + uint8_t byte = usart_info.base->US_RHR; + /* Store sniffed data into buffer (also clear interrupt */ + rbuf_write(&sniff_buffer, byte); + } +} + +/*------------------------------------------------------------------------------ + * Internal functions + *------------------------------------------------------------------------------*/ int check_data_from_phone(void) { - TRACE_INFO("check data from phone\n\r"); + /* Display sniffed data */ + while (!rbuf_is_empty(&sniff_buffer)) { + uint8_t byte = rbuf_read(&sniff_buffer); + TRACE_INFO_WP("0x%02x ", byte); + } } /*----------------------------------------------------------------------------- @@ -97,6 +124,10 @@ void Sniffer_init(void) { TRACE_INFO("Sniffer Init\n\r"); + + /* Clear ring buffer containing the sniffed data */ + rbuf_reset(&sniff_buffer); + /* Configure ISO7816 driver */ PIO_Configure(pinsISO7816_sniff, PIO_LISTSIZE(pinsISO7816_sniff)); PIO_Configure(pins_bus, PIO_LISTSIZE(pins_bus)); -- To view, visit https://gerrit.osmocom.org/9843 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I5504369aed39844b7cf21e5b3ccb542daa6b946e Gerrit-Change-Number: 9843 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 16:45:23 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 3 Jul 2018 16:45:23 +0000 Subject: Change in simtrace2[master]: SIMtrace board: comment and fix pin definition Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9844 Change subject: SIMtrace board: comment and fix pin definition ...................................................................... SIMtrace board: comment and fix pin definition Change-Id: Ic77ad5bf6c00c9122c6bb0e12b90e6c5406855fd --- M firmware/libboard/simtrace/include/board.h 1 file changed, 90 insertions(+), 66 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/44/9844/1 diff --git a/firmware/libboard/simtrace/include/board.h b/firmware/libboard/simtrace/include/board.h index 3b8296b..4648313 100644 --- a/firmware/libboard/simtrace/include/board.h +++ b/firmware/libboard/simtrace/include/board.h @@ -1,88 +1,112 @@ #pragma once #include "board_common.h" -/** Name of the board */ +/* Name of the board */ #define BOARD_NAME "SAM3S-SIMTRACE" -/** Board definition */ +/* Board definition */ #define simtrace +/* Board main oscillator frequency (in Hz) */ #define BOARD_MAINOSC 18432000 -/** Phone (SIM card emulator)/CCID Reader/MITM configuration **/ -/* Normally the communication lines between phone and SIM card are disconnected */ -// Disconnect SIM card I/O, VPP line from the phone lines -// FIXME: Per default pins are input, therefore high-impedance, therefore the bus switch is in an unknown state by default for hardware version <= 1.4. It should be pulled high by an external resistor to set the bus switch to high-impedance (e.g. off). -#define PIN_SC_SW_DEFAULT {PIO_PA20, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} -// Disconnect SIM card RST, CLK line from the phone lines -#define PIN_IO_SW_DEFAULT {PIO_PA19, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} -#define PINS_BUS_DEFAULT PIN_SC_SW_DEFAULT, PIN_IO_SW_DEFAULT +/** Pin configuration **/ +/* Button to force bootloader start (shorted to ground when pressed */ +#define PIN_BOOTLOADER_SW {PIO_PA31, PIOA, ID_PIOA, PIO_INPUT, PIO_PULLUP} +/* Enable powering the card using the second 3.3 V output of the LDO (active high) */ +#define SIM_PWEN_PIN {SIM_PWEN, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} +/* Card presence pin */ +#define SW_SIM PIO_PA8 +/* Pull card presence pin high (shorted to ground in card slot when card is present) */ +#define SMARTCARD_CONNECT_PIN {SW_SIM, PIOA, ID_PIOA, PIO_INPUT, PIO_PULLUP | PIO_DEBOUNCE | PIO_DEGLITCH | PIO_IT_EDGE } + +/** Smart card connection **/ +/* Card RST reset signal input (active low; RST_SIM in schematic) */ +#define PIN_ISO7816_RSTMC {PIO_PA7, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT} +/* Card I/O data signal input/output (I/O_SIM in schematic) */ +#define PIN_SIM_IO {PIO_PA6A_TXD0, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT} +/* Card CLK clock input (CLK_SIM in schematic) */ +#define PIN_SIM_CLK {PIO_PA2B_SCK0, PIOA, ID_PIOA, PIO_PERIPH_B, PIO_DEFAULT} +/* ISO7816-communication related pins */ +#define PINS_ISO7816 PIN_SIM_IO, PIN_SIM_CLK, PIN_ISO7816_RSTMC // SIM_PWEN_PIN, PIN_SIM_IO2, PIN_SIM_CLK2 +/* Pin to measure card I/O timing (to start measuring the ETU on I/O activity; connected I/O_SIM in schematic) */ +#define PIN_SIM_IO_INPUT {PIO_PA1B_TIOB0, PIOA, ID_PIOA, PIO_PERIPH_B, PIO_DEFAULT} +/* Pin used as clock input (to measure the ETU duration; connected to CLK_SIM in schematic) */ +#define PIN_SIM_CLK_INPUT {PIO_PA4B_TCLK0, PIOA, ID_PIOA, PIO_PERIPH_B, PIO_DEFAULT} +/* Pins used to measure ETU timing (using timer counter) */ +#define PINS_TC PIN_SIM_IO_INPUT, PIN_SIM_CLK_INPUT + +/** Phone connection **/ +/* Phone USIM slot 1 VCC pin (VCC_PHONE in schematic) */ +#define PIN_USIM1_VCC {PIO_PA25, PIOA, ID_PIOA, PIO_INPUT, PIO_DEFAULT} +/* Phone USIM slot 1 RST pin (active low; RST_PHONE in schematic) */ +#define PIN_USIM1_nRST {PIO_PA24, PIOA, ID_PIOA, PIO_INPUT, PIO_IT_RISE_EDGE | PIO_DEGLITCH } +/* Phone I/O data signal input/output (I/O_PHONE in schematic) */ +#define PIN_PHONE_IO {PIO_PA22A_TXD1, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT} +/* Phone CLK clock input (CLK_PHONE in schematic) */ +#define PIN_PHONE_CLK {PIO_PA23A_SCK1, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT} +/* Pin used for phone USIM slot 1 communication */ +#define PINS_USIM1 PIN_PHONE_IO, PIN_PHONE_CLK, PIN_PHONE_CLK_INPUT, PIN_USIM1_VCC, PIN_PHONE_IO_INPUT, PIN_USIM1_nRST +/* Phone I/O data signal input/output (unused USART RX input; connected to I/O_PHONE in schematic) */ +#define PIN_PHONE_IO_INPUT {PIO_PA21A_RXD1, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT} +/* Pin used as clock input (to measure the ETU duration; connected to CLK_PHONE in schematic) */ +#define PIN_PHONE_CLK_INPUT {PIO_PA29B_TCLK2, PIOA, ID_PIOA, PIO_PERIPH_B, PIO_DEFAULT} + +/** Default configuration **/ +/* Disconnect VPP, CLK, and RST lines between card and phone using bus switch (high sets bus switch to high-impedance) */ +#define PIN_SC_SW_DEFAULT {PIO_PA20, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} +/* Disconnect I/O line between card and phone using bus switch (high sets bus switch to high-impedance) */ +#define PIN_IO_SW_DEFAULT {PIO_PA19, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} +/* Disconnect all lines (VPP, CLK, RST, and I/O) between card and phone */ +#define PINS_BUS_DEFAULT PIN_SC_SW_DEFAULT, PIN_IO_SW_DEFAULT /** Sniffer configuration **/ -// Connect VPP, CLK and RST lines from smartcard to the phone +/* Connect VPP, CLK, and RST lines between card and phone using bus switch (low connects signals on bus switch) */ #define PIN_SC_SW_SNIFF {PIO_PA20, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT} +/* Connect I/O line between card and phone using bus switch (low connects signals on bus switch) */ #define PIN_IO_SW_SNIFF {PIO_PA19, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT} +/* Connect all lines (VPP, CLK, RST, and I/O) between card and phone */ #define PINS_BUS_SNIFF PIN_SC_SW_SNIFF, PIN_IO_SW_SNIFF - +/* Pins used to sniff phone-card communication */ #define PINS_SIM_SNIFF_SIM PIN_PHONE_IO, PIN_PHONE_CLK +/* Disable power converter 4.5-6V to 3.3V; (active high) */ +#define PIN_SIM_PWEN_SNIFF {SIM_PWEN, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT} +/* Enable power switch: VCC_PHONE to VCC_SIM; (active high) */ +#define PIN_VCC_FWD_SNIFF {VCC_FWD, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} +/* Use phone VCC to power card */ +#define PWR_PINS PIN_SIM_PWEN_SNIFF, PIN_VCC_FWD_SNIFF -#define SIM_PWEN_PIN {PIO_PA5, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} +/** External SPI flash interface **/ +/* SPI MISO pin definition */ +#define PIN_SPI_MISO {PIO_PA12A_MISO, PIOA, PIOA, PIO_PERIPH_A, PIO_PULLUP} +/* SPI MOSI pin definition */ +#define PIN_SPI_MOSI {PIO_PA13A_MOSI, PIOA, PIOA, PIO_PERIPH_A, PIO_DEFAULT} +/* SPI SCK pin definition */ +#define PIN_SPI_SCK {PIO_PA14A_SPCK, PIOA, PIOA, PIO_PERIPH_A, PIO_DEFAULT} +/* SPI pins definition. Contains MISO, MOSI & SCK */ +#define PINS_SPI PIN_SPI_MISO, PIN_SPI_MOSI, PIN_SPI_SCK +/* SPI chip select 0 pin definition */ +#define PIN_SPI_NPCS0 {PIO_PA11A_NPCS0, PIOA, PIOA, PIO_PERIPH_A, PIO_DEFAULT} +/* SPI flash write protect pin (active low, pulled low) */ +#define PIN_SPI_WP {PA15, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT} -#define PWR_PINS \ - /* Enable power converter 4.5-6V to 3.3V; low: off */ \ - {SIM_PWEN, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT}, \ - /* Enable second power converter: VCC_PHONE to VCC_SIM; high: on */ \ - {VCC_FWD, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} - -#define SW_SIM PIO_PA8 -#define SMARTCARD_CONNECT_PIN {SW_SIM, PIOA, ID_PIOA, PIO_INPUT, PIO_PULLUP | PIO_DEBOUNCE | PIO_DEGLITCH | PIO_IT_EDGE } -//#define SMARTCARD_CONNECT_PIN {SW_SIM, PIOB, ID_PIOB, PIO_INPUT, PIO_PULLUP | PIO_DEBOUNCE | PIO_IT_EDGE} - -/// PIN used for resetting the smartcard -// FIXME: Card is resetted with pin set to 0 --> PIO_OUTPUT_1 as default is right? -#define PIN_ISO7816_RSTMC {PIO_PA7, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT} - -/// Pins used for connect the smartcard -#define PIN_SIM_IO_INPUT {PIO_PA1, PIOA, ID_PIOA, PIO_INPUT, PIO_DEFAULT} -#define PIN_SIM_IO {PIO_PA6, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT} -#define PIN_SIM_CLK {PIO_PA2, PIOA, ID_PIOA, PIO_PERIPH_B, PIO_DEFAULT} -#define PIN_SIM_CLK_INPUT {PIO_PA4, PIOA, ID_PIOA, PIO_INPUT, PIO_DEFAULT} -//#define PINS_ISO7816 PIN_USART1_TXD, PIN_USART1_SCK, PIN_ISO7816_RSTMC -#define PINS_ISO7816 PIN_SIM_IO, PIN_SIM_CLK, PIN_ISO7816_RSTMC // SIM_PWEN_PIN, PIN_SIM_IO2, PIN_SIM_CLK2 - -#define PINS_TC PIN_SIM_IO_INPUT, PIN_SIM_CLK_INPUT - -#define PIN_USIM1_VCC {PIO_PA25, PIOA, ID_PIOA, PIO_INPUT, PIO_DEFAULT} -#define PIN_USIM1_nRST {PIO_PA24, PIOA, ID_PIOA, PIO_INPUT, PIO_IT_RISE_EDGE | PIO_DEGLITCH } -#define PIN_PHONE_IO_INPUT {PIO_PA21, PIOA, ID_PIOA, PIO_INPUT, PIO_DEFAULT} -#define PIN_PHONE_IO {PIO_PA22, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT} -#define PIN_PHONE_CLK {PIO_PA23A_SCK1, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT} // External Clock Input on PA28 -//#define PIN_PHONE_CLK {PIO_PA23A_SCK1, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} // External Clock Input on PA28 -#define PIN_PHONE_CLK_INPUT {PIO_PA29, PIOA, ID_PIOA, PIO_INPUT, PIO_DEFAULT} -#define PINS_USIM1 PIN_PHONE_IO, PIN_PHONE_CLK, PIN_PHONE_CLK_INPUT, PIN_USIM1_VCC, PIN_PHONE_IO_INPUT, PIN_USIM1_nRST -//, VCC_PHONE - -#define PIN_BOOTLOADER_SW {PIO_PA31, PIOA, ID_PIOA, PIO_INPUT, PIO_PULLUP} - -//** SPI interface **/ -/// SPI MISO pin definition (PA12). -#define PIN_SPI_MISO {1 << 12, PIOA, PIOA, PIO_PERIPH_A, PIO_PULLUP} -/// SPI MOSI pin definition (PA13). -#define PIN_SPI_MOSI {1 << 13, PIOA, PIOA, PIO_PERIPH_A, PIO_DEFAULT} -/// SPI SPCK pin definition (PA14). -#define PIN_SPI_SPCK {1 << 14, PIOA, PIOA, PIO_PERIPH_A, PIO_DEFAULT} -/// SPI pins definition. Contains MISO, MOSI & SPCK (PA12, PA13 & PA14). -#define PINS_SPI PIN_SPI_MISO, PIN_SPI_MOSI, PIN_SPI_SPCK -/// SPI chip select 0 pin definition (PA11). -#define PIN_SPI_NPCS0 {1 << 11, PIOA, PIOA, PIO_PERIPH_A, PIO_DEFAULT} - +/** USB definitions */ +/* OpenMoko SIMtrace 2 USB vendor ID */ +#define BOARD_USB_VENDOR_ID USB_VENDOR_OPENMOKO +/* OpenMoko SIMtrace 2 USB product ID (main application/runtime mode) */ +#define BOARD_USB_PRODUCT_ID USB_PRODUCT_SIMTRACE2 +/* OpenMoko SIMtrace 2 DFU USB product ID (DFU bootloader/DFU mode) */ +#define BOARD_DFU_USB_PRODUCT_ID USB_PRODUCT_SIMTRACE2_DFU +/* USB release number (bcdDevice, shown as 0.00) */ +#define BOARD_USB_RELEASE 0x000 +/* Indicate SIMtrace is bus power in USB attributes */ #define BOARD_USB_BMATTRIBUTES USBConfigurationDescriptor_BUSPOWERED_NORWAKEUP -#define BOARD_USB_VENDOR_ID USB_VENDOR_OPENMOKO -#define BOARD_USB_PRODUCT_ID USB_PRODUCT_SIMTRACE2 -#define BOARD_DFU_USB_PRODUCT_ID USB_PRODUCT_SIMTRACE2_DFU -#define BOARD_USB_RELEASE 0x000 - +/** Supported modes */ +/* SIMtrace board supports sniffer mode */ #define HAVE_SNIFFER +/* SIMtrace board supports CCID mode */ #define HAVE_CCID +/* SIMtrace board supports card emulation mode */ #define HAVE_CARDEM +/* SIMtrace board supports man-in-the-middle mode */ //#define HAVE_MITM -- To view, visit https://gerrit.osmocom.org/9844 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ic77ad5bf6c00c9122c6bb0e12b90e6c5406855fd Gerrit-Change-Number: 9844 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 16:45:23 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 3 Jul 2018 16:45:23 +0000 Subject: Change in simtrace2[master]: sniff: use USART 0 instead of USART 1 Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9845 Change subject: sniff: use USART 0 instead of USART 1 ...................................................................... sniff: use USART 0 instead of USART 1 Use USART 0 connected to the SIM card side to sniff the communication. The card side can also measure ETU times. Do proper pin initialization. This code can already capture the ATR communication between phone and card. Change-Id: I0597ec723cb2225540c89c3821b91d8a45adfcd6 --- M firmware/apps/trace/main.c M firmware/libboard/simtrace/include/board.h M firmware/libcommon/include/simtrace.h M firmware/libcommon/source/sniffer.c 4 files changed, 65 insertions(+), 70 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/45/9845/1 diff --git a/firmware/apps/trace/main.c b/firmware/apps/trace/main.c index 6096362..bc7c030 100644 --- a/firmware/apps/trace/main.c +++ b/firmware/apps/trace/main.c @@ -54,7 +54,7 @@ .init = Sniffer_init, .exit = Sniffer_exit, .run = Sniffer_run, - .usart1_irq = Sniffer_usart1_irq, + .usart0_irq = Sniffer_usart0_irq, }, #endif #ifdef HAVE_CCID @@ -165,8 +165,7 @@ g_unique_id[0], g_unique_id[1], g_unique_id[2], g_unique_id[3]); TRACE_INFO("Reset Cause: 0x%x\n\r", (RSTC->RSTC_SR & RSTC_SR_RSTTYP_Msk) >> RSTC_SR_RSTTYP_Pos); - - TRACE_INFO("cfg %d\n\r", simtrace_config); + TRACE_INFO("USB configuration used: %d\n\r", simtrace_config); board_main_top(); diff --git a/firmware/libboard/simtrace/include/board.h b/firmware/libboard/simtrace/include/board.h index 4648313..00d32ee 100644 --- a/firmware/libboard/simtrace/include/board.h +++ b/firmware/libboard/simtrace/include/board.h @@ -21,13 +21,11 @@ /** Smart card connection **/ /* Card RST reset signal input (active low; RST_SIM in schematic) */ -#define PIN_ISO7816_RSTMC {PIO_PA7, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT} +#define PIN_SIM_RST {PIO_PA7, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT} /* Card I/O data signal input/output (I/O_SIM in schematic) */ #define PIN_SIM_IO {PIO_PA6A_TXD0, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT} /* Card CLK clock input (CLK_SIM in schematic) */ #define PIN_SIM_CLK {PIO_PA2B_SCK0, PIOA, ID_PIOA, PIO_PERIPH_B, PIO_DEFAULT} -/* ISO7816-communication related pins */ -#define PINS_ISO7816 PIN_SIM_IO, PIN_SIM_CLK, PIN_ISO7816_RSTMC // SIM_PWEN_PIN, PIN_SIM_IO2, PIN_SIM_CLK2 /* Pin to measure card I/O timing (to start measuring the ETU on I/O activity; connected I/O_SIM in schematic) */ #define PIN_SIM_IO_INPUT {PIO_PA1B_TIOB0, PIOA, ID_PIOA, PIO_PERIPH_B, PIO_DEFAULT} /* Pin used as clock input (to measure the ETU duration; connected to CLK_SIM in schematic) */ @@ -66,15 +64,23 @@ #define PIN_IO_SW_SNIFF {PIO_PA19, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT} /* Connect all lines (VPP, CLK, RST, and I/O) between card and phone */ #define PINS_BUS_SNIFF PIN_SC_SW_SNIFF, PIN_IO_SW_SNIFF +/* Use RST_SIM line to detect phone issued card reset */ +#define PIN_SIM_RST_SNIFF {PIO_PA7, PIOA, ID_PIOA, PIO_INPUT, PIO_PULLUP | PIO_DEBOUNCE | PIO_DEGLITCH | PIO_IT_EDGE } /* Pins used to sniff phone-card communication */ -#define PINS_SIM_SNIFF_SIM PIN_PHONE_IO, PIN_PHONE_CLK -/* Disable power converter 4.5-6V to 3.3V; (active high) */ +#define PINS_SIM_SNIFF_SIM PIN_SIM_IO, PIN_SIM_CLK, PIN_SIM_RST_SNIFF +/* Disable power converter 4.5-6V to 3.3V (active high) */ #define PIN_SIM_PWEN_SNIFF {SIM_PWEN, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT} -/* Enable power switch: VCC_PHONE to VCC_SIM; (active high) */ +/* Enable power switch to forward VCC_PHONE to VCC_SIM (active high) */ #define PIN_VCC_FWD_SNIFF {VCC_FWD, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} /* Use phone VCC to power card */ #define PWR_PINS PIN_SIM_PWEN_SNIFF, PIN_VCC_FWD_SNIFF +/** CCID configuration */ +/* Card RST reset signal input (active low; RST_SIM in schematic) */ +#define PIN_ISO7816_RSTMC {PIO_PA7, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT} +/* ISO7816-communication related pins */ +#define PINS_ISO7816 PIN_SIM_IO, PIN_SIM_CLK, PIN_ISO7816_RSTMC // SIM_PWEN_PIN, PIN_SIM_IO2, PIN_SIM_CLK2 + /** External SPI flash interface **/ /* SPI MISO pin definition */ #define PIN_SPI_MISO {PIO_PA12A_MISO, PIOA, PIOA, PIO_PERIPH_A, PIO_PULLUP} diff --git a/firmware/libcommon/include/simtrace.h b/firmware/libcommon/include/simtrace.h index 21921ca..e39d1dc 100644 --- a/firmware/libcommon/include/simtrace.h +++ b/firmware/libcommon/include/simtrace.h @@ -77,7 +77,6 @@ extern const USBConfigurationDescriptor *configurationDescriptorsArr[]; -int check_data_from_phone(); void update_fidi(uint8_t fidi); void ISR_PhoneRST( const Pin *pPin); @@ -109,7 +108,7 @@ extern void MITM_run( void ); /* IRQ functions */ -extern void Sniffer_usart1_irq(void); +extern void Sniffer_usart0_irq(void); extern void mode_cardemu_usart0_irq(void); extern void mode_cardemu_usart1_irq(void); diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index fa272eb..7cc688b 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -1,32 +1,22 @@ -/* ---------------------------------------------------------------------------- - * ATMEL Microcontroller Software Support - * ---------------------------------------------------------------------------- - * Copyright (c) 2009, Atmel Corporation +/* + * (C) 2010-2017 by Harald Welte + * (C) 2018 by Kevin Redon + * All Rights Reserved * - * All rights reserved. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * This program 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 Affero General Public License for more details. * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- */ - #include "board.h" #include "simtrace.h" @@ -47,27 +37,24 @@ /** Maximum ATR ucSize in bytes.*/ #define MAX_ATR_SIZE 55 + /*------------------------------------------------------------------------------ * Internal variables *------------------------------------------------------------------------------*/ -/** ISO7816 pins */ -static const Pin pinsISO7816_sniff[] = { PINS_SIM_SNIFF_SIM }; +/* Pin configuration to sniff communication (using USART connection to SIM card) */ +static const Pin pins_sniff[] = { PINS_SIM_SNIFF_SIM }; +/* Connect phone to card using bus switch */ static const Pin pins_bus[] = { PINS_BUS_SNIFF }; - -static const Pin pPwr[] = { - /* Enable power converter 4.5-6V to 3.3V; low: off */ - {SIM_PWEN, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT}, - - /* Enable power forwarding: VCC_PHONE to VCC_SIM; high: on */ - {VCC_FWD, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} -}; - -static struct Usart_info usart_info = { - .base = USART_PHONE, - .id = ID_USART_PHONE, +/* Power card using phone VCC */ +static const Pin pins_power[] = { PWR_PINS }; +/* Timer Counter pins to measure ETU timing */ +static const Pin pins_tc[] = { PINS_TC }; +/* USART peripheral used to sniff communication */ +static struct Usart_info sniff_usart = { + .base = USART_SIM, + .id = ID_USART_SIM, .state = USART_RCV, }; - /* Ring buffer to store sniffer communication data */ static struct ringbuf sniff_buffer; @@ -75,14 +62,14 @@ * Global functions *------------------------------------------------------------------------------*/ -void Sniffer_usart1_irq(void) +void Sniffer_usart0_irq(void) { /* Read channel status register */ - uint32_t csr = usart_info.base->US_CSR & usart_info.base->US_IMR; + uint32_t csr = sniff_usart.base->US_CSR & sniff_usart.base->US_IMR; /* Verify if character has been received */ if (csr & US_CSR_RXRDY) { /* Read communication data byte between phone and SIM */ - uint8_t byte = usart_info.base->US_RHR; + uint8_t byte = sniff_usart.base->US_RHR; /* Store sniffed data into buffer (also clear interrupt */ rbuf_write(&sniff_buffer, byte); } @@ -92,7 +79,7 @@ * Internal functions *------------------------------------------------------------------------------*/ -int check_data_from_phone(void) +static void check_sniffed_data(void) { /* Display sniffed data */ while (!rbuf_is_empty(&sniff_buffer)) { @@ -115,9 +102,10 @@ void Sniffer_exit(void) { TRACE_INFO("Sniffer exit\n\r"); - USART_DisableIt(USART_PHONE, US_IER_RXRDY); - NVIC_DisableIRQ(USART1_IRQn); - USART_SetReceiverEnabled(USART_PHONE, 0); + USART_DisableIt(sniff_usart.base, US_IER_RXRDY); + /* NOTE: don't forget to set the IRQ according to the USART peripheral used */ + NVIC_DisableIRQ(USART0_IRQn); + USART_SetReceiverEnabled(sniff_usart.base, 0); } /* called when *Sniffer* configuration is set by host */ @@ -125,25 +113,28 @@ { TRACE_INFO("Sniffer Init\n\r"); + /* Configure pins to sniff communication between phone and card */ + PIO_Configure(pins_sniff, PIO_LISTSIZE(pins_sniff)); + /* Configure pins to connect phone to card */ + PIO_Configure(pins_bus, PIO_LISTSIZE(pins_bus)); + /* Configure pins to forward phone power to card */ + PIO_Configure(pins_power, PIO_LISTSIZE(pins_power)); + /* Clear ring buffer containing the sniffed data */ rbuf_reset(&sniff_buffer); - - /* Configure ISO7816 driver */ - PIO_Configure(pinsISO7816_sniff, PIO_LISTSIZE(pinsISO7816_sniff)); - PIO_Configure(pins_bus, PIO_LISTSIZE(pins_bus)); - - PIO_Configure(pPwr, PIO_LISTSIZE(pPwr)); - - ISO7816_Init(&usart_info, CLK_SLAVE); - - USART_SetReceiverEnabled(USART_PHONE, 1); - USART_EnableIt(USART_PHONE, US_IER_RXRDY); - NVIC_EnableIRQ(USART1_IRQn); + /* Configure USART to as ISO-7816 slave communication to sniff communication */ + ISO7816_Init(&sniff_usart, CLK_SLAVE); + /* Only receive data when sniffing */ + USART_SetReceiverEnabled(sniff_usart.base, 1); + /* Enable interrupt to indicate when data has been received */ + USART_EnableIt(sniff_usart.base, US_IER_RXRDY); + /* Enable interrupt requests for the USART peripheral (warning: use IRQ corresponding to USART) */ + NVIC_EnableIRQ(USART0_IRQn); } /* main (idle/busy) loop of this USB configuration */ void Sniffer_run(void) { - check_data_from_phone(); + check_sniffed_data(); } #endif /* HAVE_SNIFFER */ -- To view, visit https://gerrit.osmocom.org/9845 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I0597ec723cb2225540c89c3821b91d8a45adfcd6 Gerrit-Change-Number: 9845 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 16:45:24 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 3 Jul 2018 16:45:24 +0000 Subject: Change in simtrace2[master]: simtrace: add dedicated power pins configuration for sniffing Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9846 Change subject: simtrace: add dedicated power pins configuration for sniffing ...................................................................... simtrace: add dedicated power pins configuration for sniffing Change-Id: Ie37edbae6ea42d2b0c2a30eb5590afd0be797d39 --- M firmware/libboard/simtrace/include/board.h 1 file changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/46/9846/1 diff --git a/firmware/libboard/simtrace/include/board.h b/firmware/libboard/simtrace/include/board.h index 00d32ee..8e832dd 100644 --- a/firmware/libboard/simtrace/include/board.h +++ b/firmware/libboard/simtrace/include/board.h @@ -14,6 +14,8 @@ #define PIN_BOOTLOADER_SW {PIO_PA31, PIOA, ID_PIOA, PIO_INPUT, PIO_PULLUP} /* Enable powering the card using the second 3.3 V output of the LDO (active high) */ #define SIM_PWEN_PIN {SIM_PWEN, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} +/* Enable powering the SIM card */ +#define PWR_PINS SIM_PWEN_PIN /* Card presence pin */ #define SW_SIM PIO_PA8 /* Pull card presence pin high (shorted to ground in card slot when card is present) */ @@ -49,7 +51,7 @@ /* Pin used as clock input (to measure the ETU duration; connected to CLK_PHONE in schematic) */ #define PIN_PHONE_CLK_INPUT {PIO_PA29B_TCLK2, PIOA, ID_PIOA, PIO_PERIPH_B, PIO_DEFAULT} -/** Default configuration **/ +/** Default pin configuration **/ /* Disconnect VPP, CLK, and RST lines between card and phone using bus switch (high sets bus switch to high-impedance) */ #define PIN_SC_SW_DEFAULT {PIO_PA20, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} /* Disconnect I/O line between card and phone using bus switch (high sets bus switch to high-impedance) */ @@ -64,16 +66,14 @@ #define PIN_IO_SW_SNIFF {PIO_PA19, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT} /* Connect all lines (VPP, CLK, RST, and I/O) between card and phone */ #define PINS_BUS_SNIFF PIN_SC_SW_SNIFF, PIN_IO_SW_SNIFF -/* Use RST_SIM line to detect phone issued card reset */ -#define PIN_SIM_RST_SNIFF {PIO_PA7, PIOA, ID_PIOA, PIO_INPUT, PIO_PULLUP | PIO_DEBOUNCE | PIO_DEGLITCH | PIO_IT_EDGE } /* Pins used to sniff phone-card communication */ -#define PINS_SIM_SNIFF_SIM PIN_SIM_IO, PIN_SIM_CLK, PIN_SIM_RST_SNIFF +#define PINS_SIM_SNIFF PIN_SIM_IO, PIN_SIM_CLK, PIN_SIM_RST /* Disable power converter 4.5-6V to 3.3V (active high) */ #define PIN_SIM_PWEN_SNIFF {SIM_PWEN, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT} /* Enable power switch to forward VCC_PHONE to VCC_SIM (active high) */ #define PIN_VCC_FWD_SNIFF {VCC_FWD, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} /* Use phone VCC to power card */ -#define PWR_PINS PIN_SIM_PWEN_SNIFF, PIN_VCC_FWD_SNIFF +#define PINS_PWR_SNIFF PIN_SIM_PWEN_SNIFF, PIN_VCC_FWD_SNIFF /** CCID configuration */ /* Card RST reset signal input (active low; RST_SIM in schematic) */ -- To view, visit https://gerrit.osmocom.org/9846 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ie37edbae6ea42d2b0c2a30eb5590afd0be797d39 Gerrit-Change-Number: 9846 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 16:45:25 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 3 Jul 2018 16:45:25 +0000 Subject: Change in simtrace2[master]: board: comment USART definitions and add corresponding IRQ numbers Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9847 Change subject: board: comment USART definitions and add corresponding IRQ numbers ...................................................................... board: comment USART definitions and add corresponding IRQ numbers Change-Id: I3c38e7d75bc7b511827c33af69e335e50d0b35d2 --- M firmware/libboard/common/include/board_common.h 1 file changed, 11 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/47/9847/1 diff --git a/firmware/libboard/common/include/board_common.h b/firmware/libboard/common/include/board_common.h index 8349698..27f7409 100644 --- a/firmware/libboard/common/include/board_common.h +++ b/firmware/libboard/common/include/board_common.h @@ -81,10 +81,19 @@ #define BOARD_ISO7816_BASE_USART USART0 #define BOARD_ISO7816_ID_USART ID_USART0 +/* USART peripherals for a phone and SIM card setup */ +/* USART peripheral connected to the SIM card */ #define USART_SIM USART0 +/* ID of USART peripheral connected to the SIM card */ #define ID_USART_SIM ID_USART0 -#define USART_PHONE USART1 -#define ID_USART_PHONE ID_USART1 +/* Interrupt request ID of USART peripheral connected to the SIM card */ +#define IRQ_USART_SIM USART0_IRQn +/* USART peripheral connected to the phone */ +#define USART_PHONE USART1 +/* ID of USART peripheral connected to the phone */ +#define ID_USART_PHONE ID_USART1 +/* Interrupt request ID of USART peripheral connected to the phone */ +#define IRQ_USART_PHONE USART1_IRQn #define SIM_PWEN PIO_PA5 #define VCC_FWD PIO_PA26 -- To view, visit https://gerrit.osmocom.org/9847 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I3c38e7d75bc7b511827c33af69e335e50d0b35d2 Gerrit-Change-Number: 9847 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 16:45:25 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 3 Jul 2018 16:45:25 +0000 Subject: Change in simtrace2[master]: simtrace: add support for sniffing on both USART Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9848 Change subject: simtrace: add support for sniffing on both USART ...................................................................... simtrace: add support for sniffing on both USART Change-Id: I69eb458e7cb186c990e5d6fbc780f37fdd0cd884 --- M firmware/apps/trace/main.c M firmware/libcommon/include/simtrace.h 2 files changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/48/9848/1 diff --git a/firmware/apps/trace/main.c b/firmware/apps/trace/main.c index bc7c030..e705a17 100644 --- a/firmware/apps/trace/main.c +++ b/firmware/apps/trace/main.c @@ -55,6 +55,7 @@ .exit = Sniffer_exit, .run = Sniffer_run, .usart0_irq = Sniffer_usart0_irq, + .usart1_irq = Sniffer_usart1_irq, }, #endif #ifdef HAVE_CCID diff --git a/firmware/libcommon/include/simtrace.h b/firmware/libcommon/include/simtrace.h index e39d1dc..278d5d2 100644 --- a/firmware/libcommon/include/simtrace.h +++ b/firmware/libcommon/include/simtrace.h @@ -109,6 +109,7 @@ /* IRQ functions */ extern void Sniffer_usart0_irq(void); +extern void Sniffer_usart1_irq(void); extern void mode_cardemu_usart0_irq(void); extern void mode_cardemu_usart1_irq(void); -- To view, visit https://gerrit.osmocom.org/9848 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I69eb458e7cb186c990e5d6fbc780f37fdd0cd884 Gerrit-Change-Number: 9848 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 16:45:25 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 3 Jul 2018 16:45:25 +0000 Subject: Change in simtrace2[master]: sniffer: add state definitions, improve IRQ handling, update pins con... Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9849 Change subject: sniffer: add state definitions, improve IRQ handling, update pins configuration ...................................................................... sniffer: add state definitions, improve IRQ handling, update pins configuration Change-Id: I6b5dfd6d573ac122a60585a24c8a620642805ad5 --- M firmware/libcommon/source/sniffer.c 1 file changed, 78 insertions(+), 27 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/49/9849/1 diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 7cc688b..987e3e5 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -17,6 +17,9 @@ * along with this program. If not, see . * */ +/* This code implement the Sniffer mode to sniff the communication between a SIM card and a phone. + * For historical reasons (i.e. SIMtrace hardware) the USART peripheral connected to the SIM card is used. + */ #include "board.h" #include "simtrace.h" @@ -35,20 +38,51 @@ /** Maximum ucSize in bytes of the smartcard answer to a command.*/ #define MAX_ANSWER_SIZE 10 -/** Maximum ATR ucSize in bytes.*/ -#define MAX_ATR_SIZE 55 +/*! Maximum Answer-To-Reset (ATR) size in bytes ucSize in bytes + * @note defined in ISO/IEC 7816-3:2006(E) section 8.2.1 as 32, on top the initial character TS of section 8.1 + * @remark technical there is no size limitation since Yi present in T0,TDi will indicate if more interface bytes are present, including TDi+i + */ +#define MAX_ATR_SIZE 33 + +/*! ISO 7816-3 states relevant to the sniff mode */ +enum iso7816_3_sniff_state { + ISO7816_S_RESET, /*!< in Reset */ + ISO7816_S_WAIT_ATR, /*!< waiting for ATR to start */ + ISO7816_S_IN_ATR, /*!< while we are receiving the ATR */ + ISO7816_S_WAIT_APDU, /*!< waiting for start of new APDU */ + ISO7816_S_IN_APDU, /*!< inside a single APDU */ + ISO7816_S_IN_PTS, /*!< while we are inside the PTS / PSS */ +}; + +/*! Answer-To-Reset (ATR) sub-states of ISO7816_S_IN_ATR + * @note defined in ISO/IEC 7816-3:2006(E) section 8 + */ +enum atr_sniff_state { + ATR_S_WAIT_TS, /*!< initial byte */ + ATR_S_WAIT_T0, /*!< format byte */ + ATR_S_WAIT_TA, /*!< first sub-group interface byte */ + ATR_S_WAIT_TB, /*!< second sub-group interface byte */ + ATR_S_WAIT_TC, /*!< third sub-group interface byte */ + ATR_S_WAIT_TD, /*!< fourth sub-group interface byte */ + ATR_S_WAIT_HIST, /*!< historical byte */ + ATR_S_WAIT_TCK, /*!< check byte */ + ATR_S_DONE, /*!< to indicated all ATR bytes have been received */ +}; /*------------------------------------------------------------------------------ * Internal variables *------------------------------------------------------------------------------*/ -/* Pin configuration to sniff communication (using USART connection to SIM card) */ -static const Pin pins_sniff[] = { PINS_SIM_SNIFF_SIM }; -/* Connect phone to card using bus switch */ + +/* note: the sniffer code is currently designed to support only one sniffing interface, but the hardware would support a second one. + * to support a second sniffer interface the code should be restructured to use handles. + */ +/* Pin configurations */ +/* Pin configuration to sniff communication (using USART connection card) */ +static const Pin pins_sniff[] = { PINS_SIM_SNIFF }; static const Pin pins_bus[] = { PINS_BUS_SNIFF }; -/* Power card using phone VCC */ -static const Pin pins_power[] = { PWR_PINS }; -/* Timer Counter pins to measure ETU timing */ +static const Pin pins_power[] = { PINS_PWR_SNIFF }; static const Pin pins_tc[] = { PINS_TC }; +/* USART related variables */ /* USART peripheral used to sniff communication */ static struct Usart_info sniff_usart = { .base = USART_SIM, @@ -59,23 +93,6 @@ static struct ringbuf sniff_buffer; /*------------------------------------------------------------------------------ - * Global functions - *------------------------------------------------------------------------------*/ - -void Sniffer_usart0_irq(void) -{ - /* Read channel status register */ - uint32_t csr = sniff_usart.base->US_CSR & sniff_usart.base->US_IMR; - /* Verify if character has been received */ - if (csr & US_CSR_RXRDY) { - /* Read communication data byte between phone and SIM */ - uint8_t byte = sniff_usart.base->US_RHR; - /* Store sniffed data into buffer (also clear interrupt */ - rbuf_write(&sniff_buffer, byte); - } -} - -/*------------------------------------------------------------------------------ * Internal functions *------------------------------------------------------------------------------*/ @@ -88,6 +105,38 @@ } } +/*! Interrupt Service Routine called on USART activity */ +void Sniffer_usart_irq(void) +{ + /* Read channel status register */ + uint32_t csr = sniff_usart.base->US_CSR & sniff_usart.base->US_IMR; + /* Verify if character has been received */ + if (csr & US_CSR_RXRDY) { + /* Read communication data byte between phone and SIM */ + uint8_t byte = sniff_usart.base->US_RHR; + /* Store sniffed data into buffer (also clear interrupt */ + rbuf_write(&sniff_buffer, byte); + } +} + +/*------------------------------------------------------------------------------ + * Global functions + *------------------------------------------------------------------------------*/ + +void Sniffer_usart1_irq(void) +{ + if (ID_USART1==sniff_usart.id) { + Sniffer_usart_irq(); + } +} + +void Sniffer_usart0_irq(void) +{ + if (ID_USART0==sniff_usart.id) { + Sniffer_usart_irq(); + } +} + /*----------------------------------------------------------------------------- * Initialization routine *-----------------------------------------------------------------------------*/ @@ -128,8 +177,10 @@ USART_SetReceiverEnabled(sniff_usart.base, 1); /* Enable interrupt to indicate when data has been received */ USART_EnableIt(sniff_usart.base, US_IER_RXRDY); - /* Enable interrupt requests for the USART peripheral (warning: use IRQ corresponding to USART) */ - NVIC_EnableIRQ(USART0_IRQn); + /* Enable interrupt requests for the USART peripheral */ + NVIC_EnableIRQ(IRQ_USART_SIM); + + /* TODO configure RST pin ISR */ } /* main (idle/busy) loop of this USB configuration */ -- To view, visit https://gerrit.osmocom.org/9849 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I6b5dfd6d573ac122a60585a24c8a620642805ad5 Gerrit-Change-Number: 9849 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 16:45:25 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 3 Jul 2018 16:45:25 +0000 Subject: Change in simtrace2[master]: SIMtrace: only enable main sniffing mode on SIMtrace board Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9850 Change subject: SIMtrace: only enable main sniffing mode on SIMtrace board ...................................................................... SIMtrace: only enable main sniffing mode on SIMtrace board Change-Id: Iff6ebb1d98aa0c31f6d78508afde8f1b05f0f85b --- M firmware/libboard/simtrace/include/board.h 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/50/9850/1 diff --git a/firmware/libboard/simtrace/include/board.h b/firmware/libboard/simtrace/include/board.h index 8e832dd..691dbc3 100644 --- a/firmware/libboard/simtrace/include/board.h +++ b/firmware/libboard/simtrace/include/board.h @@ -111,8 +111,8 @@ /* SIMtrace board supports sniffer mode */ #define HAVE_SNIFFER /* SIMtrace board supports CCID mode */ -#define HAVE_CCID +//#define HAVE_CCID /* SIMtrace board supports card emulation mode */ -#define HAVE_CARDEM +//#define HAVE_CARDEM /* SIMtrace board supports man-in-the-middle mode */ //#define HAVE_MITM -- To view, visit https://gerrit.osmocom.org/9850 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iff6ebb1d98aa0c31f6d78508afde8f1b05f0f85b Gerrit-Change-Number: 9850 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 16:45:26 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 3 Jul 2018 16:45:26 +0000 Subject: Change in simtrace2[master]: SIMtrace: fix default SIM_RST pin state to allow phone controlled reset Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9851 Change subject: SIMtrace: fix default SIM_RST pin state to allow phone controlled reset ...................................................................... SIMtrace: fix default SIM_RST pin state to allow phone controlled reset Change-Id: I1942ec6bd499cb2e14f6d7699a2b2d9b4197e654 --- M firmware/libboard/simtrace/include/board.h 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/51/9851/1 diff --git a/firmware/libboard/simtrace/include/board.h b/firmware/libboard/simtrace/include/board.h index 691dbc3..c5f4dc4 100644 --- a/firmware/libboard/simtrace/include/board.h +++ b/firmware/libboard/simtrace/include/board.h @@ -66,8 +66,10 @@ #define PIN_IO_SW_SNIFF {PIO_PA19, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT} /* Connect all lines (VPP, CLK, RST, and I/O) between card and phone */ #define PINS_BUS_SNIFF PIN_SC_SW_SNIFF, PIN_IO_SW_SNIFF +/* Card RST reset signal input (use as input since the phone will drive it) */ +#define PIN_SIM_RST_SNIFF {PIO_PA7, PIOA, ID_PIOA, PIO_INPUT, PIO_DEFAULT} /* Pins used to sniff phone-card communication */ -#define PINS_SIM_SNIFF PIN_SIM_IO, PIN_SIM_CLK, PIN_SIM_RST +#define PINS_SIM_SNIFF PIN_SIM_IO, PIN_SIM_CLK, PIN_SIM_RST_SNIFF /* Disable power converter 4.5-6V to 3.3V (active high) */ #define PIN_SIM_PWEN_SNIFF {SIM_PWEN, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT} /* Enable power switch to forward VCC_PHONE to VCC_SIM (active high) */ -- To view, visit https://gerrit.osmocom.org/9851 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I1942ec6bd499cb2e14f6d7699a2b2d9b4197e654 Gerrit-Change-Number: 9851 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 16:45:26 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 3 Jul 2018 16:45:26 +0000 Subject: Change in simtrace2[master]: SIMtrace: enable interrupt on edge dection for SIM_RST pin to reset t... Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9852 Change subject: SIMtrace: enable interrupt on edge dection for SIM_RST pin to reset the sniffer ISO state ...................................................................... SIMtrace: enable interrupt on edge dection for SIM_RST pin to reset the sniffer ISO state Change-Id: I92ff29abd6a8690dd033d8cf13ad0d1ff9740fe5 --- M firmware/libboard/simtrace/include/board.h 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/52/9852/1 diff --git a/firmware/libboard/simtrace/include/board.h b/firmware/libboard/simtrace/include/board.h index c5f4dc4..891ab33 100644 --- a/firmware/libboard/simtrace/include/board.h +++ b/firmware/libboard/simtrace/include/board.h @@ -67,7 +67,7 @@ /* Connect all lines (VPP, CLK, RST, and I/O) between card and phone */ #define PINS_BUS_SNIFF PIN_SC_SW_SNIFF, PIN_IO_SW_SNIFF /* Card RST reset signal input (use as input since the phone will drive it) */ -#define PIN_SIM_RST_SNIFF {PIO_PA7, PIOA, ID_PIOA, PIO_INPUT, PIO_DEFAULT} +#define PIN_SIM_RST_SNIFF {PIO_PA7, PIOA, ID_PIOA, PIO_INPUT, PIO_DEGLITCH | PIO_IT_EDGE} /* Pins used to sniff phone-card communication */ #define PINS_SIM_SNIFF PIN_SIM_IO, PIN_SIM_CLK, PIN_SIM_RST_SNIFF /* Disable power converter 4.5-6V to 3.3V (active high) */ -- To view, visit https://gerrit.osmocom.org/9852 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I92ff29abd6a8690dd033d8cf13ad0d1ff9740fe5 Gerrit-Change-Number: 9852 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 16:45:26 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 3 Jul 2018 16:45:26 +0000 Subject: Change in simtrace2[master]: ISO7816: change update_fidi to use provided USART, and disable write ... Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9853 Change subject: ISO7816: change update_fidi to use provided USART, and disable write protection for USART register if required ...................................................................... ISO7816: change update_fidi to use provided USART, and disable write protection for USART register if required Change-Id: I716f4bc3a22800cbce402b146f14ef8b2aab2a98 --- M firmware/libcommon/include/simtrace.h M firmware/libcommon/source/simtrace_iso7816.c 2 files changed, 23 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/53/9853/1 diff --git a/firmware/libcommon/include/simtrace.h b/firmware/libcommon/include/simtrace.h index 278d5d2..3dfefe4 100644 --- a/firmware/libcommon/include/simtrace.h +++ b/firmware/libcommon/include/simtrace.h @@ -77,7 +77,11 @@ extern const USBConfigurationDescriptor *configurationDescriptorsArr[]; -void update_fidi(uint8_t fidi); +/*! Update USART baud rate to Fi/Di ratio + * @param[io] usart USART peripheral base address + * @param[in] fidi FiDi value as provided in TA interface byte + */ +void update_fidi(Usart *usart, uint8_t fidi); void ISR_PhoneRST( const Pin *pPin); diff --git a/firmware/libcommon/source/simtrace_iso7816.c b/firmware/libcommon/source/simtrace_iso7816.c index 81ae980..3d843a7 100644 --- a/firmware/libcommon/source/simtrace_iso7816.c +++ b/firmware/libcommon/source/simtrace_iso7816.c @@ -116,20 +116,27 @@ } /* FIDI update functions */ -void update_fidi(uint8_t fidi) +void update_fidi(Usart *usart, uint8_t fidi) { - int rc; + if (NULL==usart) { + return; + } uint8_t fi = fidi >> 4; uint8_t di = fidi & 0xf; + int ratio = compute_fidi_ratio(fi, di); - rc = compute_fidi_ratio(fi, di); - if (rc > 0 && rc < 0x400) { - TRACE_INFO("computed Fi(%u) Di(%u) ratio: %d", fi, di, rc); - /* make sure UART uses new F/D ratio */ - USART_PHONE->US_CR |= US_CR_RXDIS | US_CR_RSTRX; - USART_PHONE->US_FIDI = rc & 0x3ff; - USART_PHONE->US_CR |= US_CR_RXEN | US_CR_STTTO; - } else - TRACE_INFO("computed FiDi ratio %d unsupported", rc); + if (ratio > 0 && ratio < 0x8000) { + /* make sure USART uses new F/D ratio */ + usart->US_CR |= US_CR_RXDIS | US_CR_RSTRX; + /* disable write protection */ + if (usart->US_WPMR) { + usart->US_WPMR = US_WPMR_WPKEY(0x555341); + } + usart->US_FIDI = (ratio & 0x7ff); + usart->US_CR |= US_CR_RXEN | US_CR_STTTO; + TRACE_INFO("updated USART Fi(%u)/Di(%u) ratio(%d): %u\n\r", fi, di, ratio, usart->US_FIDI); + } else { + TRACE_WARNING("computed Fi/Di ratio %d unsupported\n\r", ratio); + } } -- To view, visit https://gerrit.osmocom.org/9853 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I716f4bc3a22800cbce402b146f14ef8b2aab2a98 Gerrit-Change-Number: 9853 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 16:45:26 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 3 Jul 2018 16:45:26 +0000 Subject: Change in simtrace2[master]: trace: increase watchdog for 500 to 2000 ms to provide more time hand... Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9854 Change subject: trace: increase watchdog for 500 to 2000 ms to provide more time handling buffered data ...................................................................... trace: increase watchdog for 500 to 2000 ms to provide more time handling buffered data Change-Id: Iacd85525f05e692b44183bd4c4585b9e70865cfe --- M firmware/apps/trace/main.c 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/54/9854/1 diff --git a/firmware/apps/trace/main.c b/firmware/apps/trace/main.c index e705a17..3dcbde1 100644 --- a/firmware/apps/trace/main.c +++ b/firmware/apps/trace/main.c @@ -40,7 +40,7 @@ void (*exit) (void); /* main loop content for given configuration */ void (*run) (void); - /* Interrupt handler for USART1 */ + /* Interrupt handler for USART0 */ void (*usart0_irq) (void); /* Interrupt handler for USART1 */ void (*usart1_irq) (void); @@ -148,9 +148,9 @@ led_init(); led_blink(LED_RED, BLINK_3O_5F); - /* Enable watchdog for 500ms, with no window */ + /* Enable watchdog for 2000 ms, with no window */ WDT_Enable(WDT, WDT_MR_WDRSTEN | WDT_MR_WDDBGHLT | WDT_MR_WDIDLEHLT | - (WDT_GetPeriod(500) << 16) | WDT_GetPeriod(500)); + (WDT_GetPeriod(2000) << 16) | WDT_GetPeriod(2000)); PIO_InitializeInterrupts(0); -- To view, visit https://gerrit.osmocom.org/9854 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iacd85525f05e692b44183bd4c4585b9e70865cfe Gerrit-Change-Number: 9854 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 16:45:27 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 3 Jul 2018 16:45:27 +0000 Subject: Change in simtrace2[master]: sniffer: use ISR to store sniffed data in buffer, add ATR and PPS par... Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9855 Change subject: sniffer: use ISR to store sniffed data in buffer, add ATR and PPS parsing, and PPS related FiDi update ...................................................................... sniffer: use ISR to store sniffed data in buffer, add ATR and PPS parsing, and PPS related FiDi update Change-Id: I4b38ce1d80e370fda6aa181e959ba3f1286bb922 --- M firmware/libcommon/source/sniffer.c 1 file changed, 363 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/55/9855/1 diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 987e3e5..c71c491 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -17,8 +17,10 @@ * along with this program. If not, see . * */ -/* This code implement the Sniffer mode to sniff the communication between a SIM card and a phone. +/* This code implement the Sniffer mode to sniff the communication between a SIM card (or any ISO 7816 smart card) and a phone (or any ISO 7816 card reader). * For historical reasons (i.e. SIMtrace hardware) the USART peripheral connected to the SIM card is used. + * TODO handle RST, PTS, and send data over USB + * TODO put common ISO7816-3 code is separate library (and combine clean with iso7816_4) */ #include "board.h" #include "simtrace.h" @@ -30,19 +32,22 @@ *------------------------------------------------------------------------------*/ #include +#include "utils.h" +#include "iso7816_fidi.h" /*------------------------------------------------------------------------------ * Internal definitions *------------------------------------------------------------------------------*/ -/** Maximum ucSize in bytes of the smartcard answer to a command.*/ -#define MAX_ANSWER_SIZE 10 - -/*! Maximum Answer-To-Reset (ATR) size in bytes ucSize in bytes +/*! Maximum Answer-To-Reset (ATR) size in bytes * @note defined in ISO/IEC 7816-3:2006(E) section 8.2.1 as 32, on top the initial character TS of section 8.1 * @remark technical there is no size limitation since Yi present in T0,TDi will indicate if more interface bytes are present, including TDi+i */ #define MAX_ATR_SIZE 33 +/*! Maximum Protocol and Parameters Selection (PPS) size in bytes + * @note defined in ISO/IEC 7816-3:2006(E) section 9.2 + */ +#define MAX_PPS_SIZE 6 /*! ISO 7816-3 states relevant to the sniff mode */ enum iso7816_3_sniff_state { @@ -51,7 +56,9 @@ ISO7816_S_IN_ATR, /*!< while we are receiving the ATR */ ISO7816_S_WAIT_APDU, /*!< waiting for start of new APDU */ ISO7816_S_IN_APDU, /*!< inside a single APDU */ - ISO7816_S_IN_PTS, /*!< while we are inside the PTS / PSS */ + ISO7816_S_IN_PPS_REQ, /*!< while we are inside the PPS request */ + ISO7816_S_WAIT_PPS_RSP, /*!< waiting for start of the PPS response */ + ISO7816_S_IN_PPS_RSP, /*!< while we are inside the PPS request */ }; /*! Answer-To-Reset (ATR) sub-states of ISO7816_S_IN_ATR @@ -66,7 +73,18 @@ ATR_S_WAIT_TD, /*!< fourth sub-group interface byte */ ATR_S_WAIT_HIST, /*!< historical byte */ ATR_S_WAIT_TCK, /*!< check byte */ - ATR_S_DONE, /*!< to indicated all ATR bytes have been received */ +}; + +/*! Protocol and Parameters Selection (PPS) sub-states of ISO7816_S_IN_PTS_REQ/ISO7816_S_IN_PTS_RSP + * @note defined in ISO/IEC 7816-3:2006(E) section 9 + */ +enum pps_sniff_state { + PPS_S_WAIT_PPSS, /*!< initial byte */ + PPS_S_WAIT_PPS0, /*!< format byte */ + PPS_S_WAIT_PPS1, /*!< first parameter byte */ + PPS_S_WAIT_PPS2, /*!< second parameter byte */ + PPS_S_WAIT_PPS3, /*!< third parameter byte */ + PPS_S_WAIT_PCK, /*!< check byte */ }; /*------------------------------------------------------------------------------ @@ -77,36 +95,328 @@ * to support a second sniffer interface the code should be restructured to use handles. */ /* Pin configurations */ -/* Pin configuration to sniff communication (using USART connection card) */ +/*! Pin configuration to sniff communication (using USART connection card) */ static const Pin pins_sniff[] = { PINS_SIM_SNIFF }; +/*! Pin configuration to interconnect phone and card using the bus switch */ static const Pin pins_bus[] = { PINS_BUS_SNIFF }; +/*! Pin configuration to power the card by the phone */ static const Pin pins_power[] = { PINS_PWR_SNIFF }; +/*! Pin configuration for timer counter to measure ETU timing */ static const Pin pins_tc[] = { PINS_TC }; +/*! Pin configuration for card reset line */ +static const Pin pin_rst = PIN_SIM_RST_SNIFF; + /* USART related variables */ -/* USART peripheral used to sniff communication */ +/*! USART peripheral used to sniff communication */ static struct Usart_info sniff_usart = { .base = USART_SIM, .id = ID_USART_SIM, .state = USART_RCV, }; -/* Ring buffer to store sniffer communication data */ +/*! Ring buffer to store sniffer communication data */ static struct ringbuf sniff_buffer; +/* ISO 7816 variables */ +/*! ISO 7816-3 state */ +enum iso7816_3_sniff_state iso_state = ISO7816_S_RESET; +/*! ATR state */ +enum atr_sniff_state atr_state; +/*! ATR data + * @remark can be used to check later protocol changes + */ +uint8_t atr[MAX_ATR_SIZE]; +/*! Current index in the ATR data */ +uint8_t atr_i = 0; +/*! If convention conversion is needed */ +bool convention_convert = false; +/*! The supported T protocols */ +uint16_t t_protocol_support = 0; +/*! PPS state + * @remark it is shared between request and response since they aren't simultaneous but follow the same procedure + */ +enum pps_sniff_state pps_state; +/*! PPS request data + * @remark can be used to check PPS response + */ +uint8_t pps_req[MAX_PPS_SIZE]; +/*! PPS response data */ +uint8_t pps_rsp[MAX_PPS_SIZE]; + /*------------------------------------------------------------------------------ * Internal functions *------------------------------------------------------------------------------*/ +/*! Convert data between direct and inverse convention + * @note direct convention is LSb first and HIGH=1; inverse conversion in MSb first and LOW=1 + * @remark use a look up table to speed up conversion + */ +static const uint8_t convention_convert_lut[256] = { 0xff, 0x7f, 0xbf, 0x3f, 0xdf, 0x5f, 0x9f, 0x1f, 0xef, 0x6f, 0xaf, 0x2f, 0xcf, 0x4f, 0x8f, 0x0f, 0xf7, 0x77, 0xb7, 0x37, 0xd7, 0x57, 0x97, 0x17, 0xe7, 0x67, 0xa7, 0x27, 0xc7, 0x47, 0x87, 0x07, 0xfb, 0x7b, 0xbb, 0x3b, 0xdb, 0x5b, 0x9b, 0x1b, 0xeb, 0x6b, 0xab, 0x2b, 0xcb, 0x4b, 0x8b, 0x0b, 0xf3, 0x73, 0xb3, 0x33, 0xd3, 0x53, 0x93, 0x13, 0xe3, 0x63, 0xa3, 0x23, 0xc3, 0x43, 0x83, 0x03, 0xfd, 0x7d, 0xbd, 0x3d, 0xdd, 0x5d, 0x9d, 0x1d, 0xed, 0x6d, 0xad, 0x2d, 0xcd, 0x4d, 0x8d, 0x0d, 0xf5, 0x75, 0xb5, 0x35, 0xd5, 0x55, 0x95, 0x15, 0xe5, 0x65, 0xa5, 0x25, 0xc5, 0x45, 0x85, 0x05, 0xf9, 0x79, 0xb9, 0x39, 0xd9, 0x59, 0x99, 0x19, 0xe9, 0x69, 0xa9, 0x29, 0xc9, 0x49, 0x89, 0x09, 0xf1, 0x71, 0xb1, 0x31, 0xd1, 0x51, 0x91, 0x11, 0xe1, 0x61, 0xa1, 0x21, 0xc1, 0x41, 0x81, 0x01, 0xfe, 0x7e, 0xbe, 0x3e, 0xde, 0x5e, 0x9e, 0x1e, 0xee, 0x6e, 0xae, 0x2e, 0xce, 0x4e, 0x8e, 0x0e, 0xf6, 0x76, 0xb6, 0x36, 0xd6, 0x56, 0x96, 0x16, 0xe6, 0x66, 0xa6, 0x26, 0xc6, 0x46, 0x86, 0x06, 0xfa, 0x7a, 0xba, 0x3a, 0xda, 0x5a, 0x9a, 0x1a, 0xea, 0x6a, 0xaa, 0x2a, 0xca, 0x4a, 0x8a, 0x0a, 0xf2, 0x72, 0xb2, 0x32, 0xd2, 0x52, 0x92, 0x12, 0xe2, 0x62, 0xa2, 0x22, 0xc2, 0x42, 0x82, 0x02, 0xfc, 0x7c, 0xbc, 0x3c, 0xdc, 0x5c, 0x9c, 0x1c, 0xec, 0x6c, 0xac, 0x2c, 0xcc, 0x4c, 0x8c, 0x0c, 0xf4, 0x74, 0xb4, 0x34, 0xd4, 0x54, 0x94, 0x14, 0xe4, 0x64, 0xa4, 0x24, 0xc4, 0x44, 0x84, 0x04, 0xf8, 0x78, 0xb8, 0x38, 0xd8, 0x58, 0x98, 0x18, 0xe8, 0x68, 0xa8, 0x28, 0xc8, 0x48, 0x88, 0x08, 0xf0, 0x70, 0xb0, 0x30, 0xd0, 0x50, 0x90, 0x10, 0xe0, 0x60, 0xa0, 0x20, 0xc0, 0x40, 0x80, 0x00, }; + +/*! Update the ISO 7816-3 state + * @param[in] iso_state_new new ISO 7816-3 state to update to + */ +static void change_state(enum iso7816_3_sniff_state iso_state_new) +{ + /* sanity check */ + if (iso_state_new==iso_state) { + TRACE_WARNING("Already in ISO 7816 state %u\n\r", iso_state); + return; + } + + /* handle actions to perform when switching state */ + switch (iso_state_new) { + case ISO7816_S_RESET: + update_fidi(sniff_usart.base, 0x11); /* reset baud rate to default Di/Fi values */ + // TODO disable USART and TC + break; + case ISO7816_S_WAIT_ATR: + rbuf_reset(&sniff_buffer); /* reset buffer for new communication */ + // TODO enable USART and TC + break; + case ISO7816_S_IN_ATR: + atr_i = 0; + convention_convert = false; + t_protocol_support = 0; + atr_state = ATR_S_WAIT_TS; + break; + case ISO7816_S_IN_PPS_REQ: + case ISO7816_S_IN_PPS_RSP: + pps_state = PPS_S_WAIT_PPSS; + break; + default: + break; + } + + /* save new state */ + iso_state = iso_state_new; + TRACE_INFO("Changed to ISO 7816-3 state %u\n\r", iso_state); +} + +/*! Process ATR byte + * @param[in] byte ATR byte to process + */ +static void process_byte_atr(uint8_t byte) +{ + static uint8_t atr_hist_len = 0; /* store the number of expected historical bytes */ + static uint8_t y = 0; /* last mask of the upcoming TA, TB, TC, TD interface bytes */ + + /* sanity check */ + if (ISO7816_S_IN_ATR!=iso_state) { + TRACE_ERROR("Processing ATR data in wrong ISO 7816-3 state %u\n\r", iso_state); + return; + } + if (atr_i>=ARRAY_SIZE(atr)) { + TRACE_WARNING("ATR data overflow\n\r"); + return; + } + + /* save data for use by other functions */ + atr[atr_i++] = byte; + + /* handle ATR byte depending on current state */ + switch (atr_state) { + case ATR_S_WAIT_TS: /* see ISO/IEC 7816-3:2006 section 8.1 */ + switch (byte) { + case 0x23: /* direct convention used, but decoded using inverse convention (a parity error should also have occurred) */ + case 0x30: /* inverse convention used, but decoded using direct convention (a parity error should also have occurred) */ + convention_convert = !convention_convert; + case 0x3b: /* direct convention used and correctly decoded */ + case 0x3f: /* inverse convention used and correctly decoded */ + atr_state = ATR_S_WAIT_T0; /* wait for format byte */ + break; + default: + atr_i--; /* revert last byte */ + TRACE_WARNING("Invalid TS received\n\r"); + } + break; + case ATR_S_WAIT_T0: /* see ISO/IEC 7816-3:2006 section 8.2.2 */ + case ATR_S_WAIT_TD: /* see ISO/IEC 7816-3:2006 section 8.2.3 */ + if (ATR_S_WAIT_T0==atr_state) { + atr_hist_len = (byte&0x0f); /* save the number of historical bytes */ + } else if (ATR_S_WAIT_TD==atr_state) { + t_protocol_support |= (1<<(byte&0x0f)); /* remember supported protocol to know if TCK will be present */ + } + y = (byte&0xf0); /* remember upcoming interface bytes */ + if (y&0x10) { + atr_state = ATR_S_WAIT_TA; /* wait for interface byte TA */ + break; + } + case ATR_S_WAIT_TA: /* see ISO/IEC 7816-3:2006 section 8.2.3 */ + if (y&0x20) { + atr_state = ATR_S_WAIT_TB; /* wait for interface byte TB */ + break; + } + case ATR_S_WAIT_TB: /* see ISO/IEC 7816-3:2006 section 8.2.3 */ + if (y&0x40) { + atr_state = ATR_S_WAIT_TC; /* wait for interface byte TC */ + break; + } + case ATR_S_WAIT_TC: /* see ISO/IEC 7816-3:2006 section 8.2.3 */ + if (y&0x80) { + atr_state = ATR_S_WAIT_TD; /* wait for interface byte TD */ + break; + } else if (atr_hist_len) { + atr_state = ATR_S_WAIT_HIST; /* wait for historical bytes */ + break; + } + case ATR_S_WAIT_HIST: /* see ISO/IEC 7816-3:2006 section 8.2.4 */ + if (atr_hist_len) { + atr_hist_len--; + } + if (0==atr_hist_len) { + if (t_protocol_support>1) { + atr_state = ATR_S_WAIT_TCK; /* wait for check bytes */ + break; + } + } else { + break; + } + case ATR_S_WAIT_TCK: /* see ISO/IEC 7816-3:2006 section 8.2.5 */ + /* we could verify the checksum, but we are just here to sniff */ + change_state(ISO7816_S_WAIT_APDU); /* go to next state */ + break; + default: + TRACE_INFO("Unknown ATR state %u\n\r", atr_state); + } +} + +static void process_byte_pps(uint8_t byte) +{ + uint8_t *pps_cur; /* current PPS (request or response) */ + + /* sanity check */ + if (ISO7816_S_IN_PPS_REQ==iso_state) { + pps_cur = pps_req; + } else if (ISO7816_S_IN_PPS_RSP==iso_state) { + pps_cur = pps_rsp; + } else { + TRACE_ERROR("Processing PPS data in wrong ISO 7816-3 state %u\n\r", iso_state); + return; + } + + /* handle PPS byte depending on current state */ + switch (pps_state) { /* see ISO/IEC 7816-3:2006 section 9.2 */ + case PPS_S_WAIT_PPSS: /*!< initial byte */ + if (0xff) { + pps_cur[0] = byte; + pps_state = PPS_S_WAIT_PPS0; /* go to next state */ + } else { + TRACE_INFO("Invalid PPSS received\n\r"); + change_state(ISO7816_S_WAIT_APDU); /* go back to APDU state */ + } + break; + case PPS_S_WAIT_PPS0: /*!< format byte */ + pps_cur[1] = byte; + if (pps_cur[1]&0x10) { + pps_state = PPS_S_WAIT_PPS1; /* go to next state */ + break; + } + case PPS_S_WAIT_PPS1: /*!< first parameter byte */ + pps_cur[2] = byte; /* not always right but doesn't affect the process */ + if (pps_cur[1]&0x20) { + pps_state = PPS_S_WAIT_PPS2; /* go to next state */ + break; + } + case PPS_S_WAIT_PPS2: /*!< second parameter byte */ + pps_cur[3] = byte; /* not always right but doesn't affect the process */ + if (pps_cur[1]&0x40) { + pps_state = PPS_S_WAIT_PPS3; /* go to next state */ + break; + } + case PPS_S_WAIT_PPS3: /*!< third parameter byte */ + pps_cur[4] = byte; /* not always right but doesn't affect the process */ + pps_state = PPS_S_WAIT_PCK; /* go to next state */ + break; + case PPS_S_WAIT_PCK: /*!< check byte */ + pps_cur[5] = byte; /* not always right but doesn't affect the process */ + /* verify the checksum */ + uint8_t check = 0; + check ^= pps_cur[0]; + check ^= pps_cur[1]; + if (pps_cur[1]&0x10) { + check ^= pps_cur[2]; + } + if (pps_cur[1]&0x20) { + check ^= pps_cur[3]; + } + if (pps_cur[1]&0x40) { + check ^= pps_cur[4]; + } + check ^= pps_cur[5]; + if (ISO7816_S_IN_PPS_REQ==iso_state) { + if (0==check) { /* checksum is valid */ + change_state(ISO7816_S_WAIT_PPS_RSP); /* go to next state */ + } else { /* checksum is invalid */ + change_state(ISO7816_S_WAIT_APDU); /* go to next state */ + } + } else if (ISO7816_S_IN_PPS_RSP==iso_state) { + if (0==check) { /* checksum is valid */ + uint8_t fn, dn; + if (pps_cur[1]&0x10) { + fn = (pps_cur[2]>>4); + dn = (pps_cur[2]&0x0f); + } else { + fn = 1; + dn = 1; + } + TRACE_INFO("PPS negotiation successful: Fn=%u Dn=%u\n\r", fn, dn); + update_fidi(sniff_usart.base, pps_cur[2]); + rbuf_reset(&sniff_buffer); /* reset buffer for new communication */ + } else { /* checksum is invalid */ + TRACE_INFO("PPS negotiation failed\n\r"); + } + change_state(ISO7816_S_WAIT_APDU); /* co to next state */ + } + break; + default: + TRACE_INFO("Unknown PPS state %u\n\r", pps_state); + } +} + +static void process_byte_apdu(uint8_t byte) +{ +} + static void check_sniffed_data(void) { - /* Display sniffed data */ + /* Handle sniffed data */ while (!rbuf_is_empty(&sniff_buffer)) { uint8_t byte = rbuf_read(&sniff_buffer); - TRACE_INFO_WP("0x%02x ", byte); + TRACE_WARNING_WP("< 0x%02x\n\r", byte); + switch (iso_state) { /* Handle byte depending on state */ + case ISO7816_S_RESET: /* During reset we shouldn't receive any data */ + break; + case ISO7816_S_WAIT_ATR: /* After a reset we expect the ATR */ + change_state(ISO7816_S_IN_ATR); /* go to next state */ + case ISO7816_S_IN_ATR: /* More ATR data incoming */ + process_byte_atr(byte); + break; + case ISO7816_S_WAIT_APDU: /* After the ATR we expect APDU or PPS data */ + case ISO7816_S_WAIT_PPS_RSP: + if (byte == 0xff) { + if (ISO7816_S_WAIT_PPS_RSP==iso_state) { + change_state(ISO7816_S_IN_PPS_RSP); /* Go to PPS state */ + } else { + change_state(ISO7816_S_IN_PPS_REQ); /* Go to PPS state */ + } + process_byte_pps(byte); + break; + } + case ISO7816_S_IN_APDU: /* More APDU data incoming */ + process_byte_apdu(byte); + break; + case ISO7816_S_IN_PPS_REQ: + case ISO7816_S_IN_PPS_RSP: + process_byte_pps(byte); + break; + default: + TRACE_ERROR("Data received in unknown state %u\n\r", iso_state); + } } } /*! Interrupt Service Routine called on USART activity */ -void Sniffer_usart_irq(void) +void Sniffer_usart_isr(void) { /* Read channel status register */ uint32_t csr = sniff_usart.base->US_CSR & sniff_usart.base->US_IMR; @@ -114,11 +424,36 @@ if (csr & US_CSR_RXRDY) { /* Read communication data byte between phone and SIM */ uint8_t byte = sniff_usart.base->US_RHR; + /* Convert convention if required */ + if (convention_convert) { + byte = convention_convert_lut[byte]; + } /* Store sniffed data into buffer (also clear interrupt */ rbuf_write(&sniff_buffer, byte); } } +/** PIO interrupt service routine to checks if the card reset line has changed + */ +static void Sniffer_reset_isr(const Pin* pPin) +{ + /* Ensure an edge on the reset pin cause the interrupt */ + if (pPin->id!=pin_rst.id || 0==(pPin->mask&pin_rst.mask)) { + TRACE_ERROR("Pin other than reset caused a interrupt\n\r"); + return; + } + /* Update the ISO state according to the reset change */ + if (PIO_Get(&pin_rst)) { + if (ISO7816_S_WAIT_ATR!=iso_state) { + change_state(ISO7816_S_WAIT_ATR); + } + } else { + if (ISO7816_S_RESET!=iso_state) { + change_state(ISO7816_S_RESET); + } + } +} + /*------------------------------------------------------------------------------ * Global functions *------------------------------------------------------------------------------*/ @@ -126,14 +461,14 @@ void Sniffer_usart1_irq(void) { if (ID_USART1==sniff_usart.id) { - Sniffer_usart_irq(); + Sniffer_usart_isr(); } } void Sniffer_usart0_irq(void) { if (ID_USART0==sniff_usart.id) { - Sniffer_usart_irq(); + Sniffer_usart_isr(); } } @@ -153,8 +488,9 @@ TRACE_INFO("Sniffer exit\n\r"); USART_DisableIt(sniff_usart.base, US_IER_RXRDY); /* NOTE: don't forget to set the IRQ according to the USART peripheral used */ - NVIC_DisableIRQ(USART0_IRQn); + NVIC_DisableIRQ(IRQ_USART_SIM); USART_SetReceiverEnabled(sniff_usart.base, 0); + } /* called when *Sniffer* configuration is set by host */ @@ -168,6 +504,12 @@ PIO_Configure(pins_bus, PIO_LISTSIZE(pins_bus)); /* Configure pins to forward phone power to card */ PIO_Configure(pins_power, PIO_LISTSIZE(pins_power)); + /* Enable interrupts on port with reset line */ + NVIC_EnableIRQ(PIOA_IRQn); /* CAUTION this needs to match to the correct port */ + /* Register ISR to handle card reset change */ + PIO_ConfigureIt(&pin_rst, &Sniffer_reset_isr); + /* Enable interrupt on card reset pin */ + PIO_EnableIt(&pin_rst); /* Clear ring buffer containing the sniffed data */ rbuf_reset(&sniff_buffer); @@ -180,10 +522,13 @@ /* Enable interrupt requests for the USART peripheral */ NVIC_EnableIRQ(IRQ_USART_SIM); - /* TODO configure RST pin ISR */ + /* Reset state */ + if (ISO7816_S_RESET!=iso_state) { + change_state(ISO7816_S_RESET); + } } -/* main (idle/busy) loop of this USB configuration */ +/* Main (idle/busy) loop of this USB configuration */ void Sniffer_run(void) { check_sniffed_data(); -- To view, visit https://gerrit.osmocom.org/9855 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I4b38ce1d80e370fda6aa181e959ba3f1286bb922 Gerrit-Change-Number: 9855 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 16:50:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 16:50:46 +0000 Subject: Change in simtrace2[master]: fix: remove unused code In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9839 ) Change subject: fix: remove unused code ...................................................................... Patch Set 1: Code-Review-2 this patch breaks builds on qmod, as there the function is used. IT cannot be merged. -- To view, visit https://gerrit.osmocom.org/9839 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib87b35bd9a32c8b7df3f8af8015ca002784d333c Gerrit-Change-Number: 9839 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 03 Jul 2018 16:50:46 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 16:51:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 16:51:47 +0000 Subject: Change in simtrace2[master]: copy working cardem app to trace In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9840 ) Change subject: copy working cardem app to trace ...................................................................... Patch Set 1: Code-Review+1 probably works if rebased to remove the "fix: remove unused code" -- To view, visit https://gerrit.osmocom.org/9840 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I24b3500a0905cbd622507722280b3c7e7f188bde Gerrit-Change-Number: 9840 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 03 Jul 2018 16:51:47 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 16:52:05 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 16:52:05 +0000 Subject: Change in simtrace2[master]: enable (empty) sniffer support for SIMtrace board In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9841 ) Change subject: enable (empty) sniffer support for SIMtrace board ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9841 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I51619135fd6f5423542f261e7d76bab1a5713e2b Gerrit-Change-Number: 9841 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 03 Jul 2018 16:52:05 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 16:53:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 16:53:48 +0000 Subject: Change in simtrace2[master]: add more USB configuration checks and error messages In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9842 ) Change subject: add more USB configuration checks and error messages ...................................................................... Patch Set 1: Code-Review-1 (5 comments) https://gerrit.osmocom.org/#/c/9842/1/firmware/apps/trace/main.c File firmware/apps/trace/main.c: https://gerrit.osmocom.org/#/c/9842/1/firmware/apps/trace/main.c at 7 PS1, Line 7: Affero no Affero GPL in SIMtrace, I think we should stick to GPLv2-or-later here. https://gerrit.osmocom.org/#/c/9842/1/firmware/apps/trace/main.c at 105 PS1, Line 105: sizeof(config_func_ptrs)/sizeof(config_func_ptrs[0] we should be able to use ARRAY_SIZE here? https://gerrit.osmocom.org/#/c/9842/1/firmware/apps/trace/main.c at 202 PS1, Line 202: sizeof(config_func_ptrs)/sizeof(config_func_ptrs[0]) same comment regarding ARRAY_SIZE https://gerrit.osmocom.org/#/c/9842/1/firmware/apps/trace/main.c at 238 PS1, Line 238: sizeof(config_func_ptrs)/sizeof(config_func_ptrs[0]) and once more ARRAY_SIZE https://gerrit.osmocom.org/#/c/9842/1/firmware/apps/trace/main.c at 247 PS1, Line 247: sizeof(config_func_ptrs)/sizeof(config_func_ptrs[0]) one more time.. -- To view, visit https://gerrit.osmocom.org/9842 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I20f8018cd5087254dfbfad40b73803390aa84183 Gerrit-Change-Number: 9842 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 03 Jul 2018 16:53:48 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 16:54:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 16:54:24 +0000 Subject: Change in simtrace2[master]: sniff mode: handle USART 1 RX interrupt to show sniffer data In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9843 ) Change subject: sniff mode: handle USART 1 RX interrupt to show sniffer data ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/9843 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5504369aed39844b7cf21e5b3ccb542daa6b946e Gerrit-Change-Number: 9843 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 03 Jul 2018 16:54:24 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 16:54:58 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 16:54:58 +0000 Subject: Change in simtrace2[master]: SIMtrace board: comment and fix pin definition In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9844 ) Change subject: SIMtrace board: comment and fix pin definition ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9844 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic77ad5bf6c00c9122c6bb0e12b90e6c5406855fd Gerrit-Change-Number: 9844 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 03 Jul 2018 16:54:58 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 16:55:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 16:55:48 +0000 Subject: Change in simtrace2[master]: sniff: use USART 0 instead of USART 1 In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9845 ) Change subject: sniff: use USART 0 instead of USART 1 ...................................................................... Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/9845/1/firmware/libcommon/source/sniffer.c File firmware/libcommon/source/sniffer.c: https://gerrit.osmocom.org/#/c/9845/1/firmware/libcommon/source/sniffer.c at 7 PS1, Line 7: Affero GPLv2-or-later, not affero. -- To view, visit https://gerrit.osmocom.org/9845 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0597ec723cb2225540c89c3821b91d8a45adfcd6 Gerrit-Change-Number: 9845 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 03 Jul 2018 16:55:48 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 16:55:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 16:55:57 +0000 Subject: Change in simtrace2[master]: simtrace: add dedicated power pins configuration for sniffing In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9846 ) Change subject: simtrace: add dedicated power pins configuration for sniffing ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9846 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie37edbae6ea42d2b0c2a30eb5590afd0be797d39 Gerrit-Change-Number: 9846 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 03 Jul 2018 16:55:57 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 16:56:10 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 16:56:10 +0000 Subject: Change in simtrace2[master]: board: comment USART definitions and add corresponding IRQ numbers In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9847 ) Change subject: board: comment USART definitions and add corresponding IRQ numbers ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9847 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3c38e7d75bc7b511827c33af69e335e50d0b35d2 Gerrit-Change-Number: 9847 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 03 Jul 2018 16:56:10 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 16:56:37 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 16:56:37 +0000 Subject: Change in simtrace2[master]: simtrace: add support for sniffing on both USART In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9848 ) Change subject: simtrace: add support for sniffing on both USART ...................................................................... Patch Set 1: where would we use this? I'm just curious -- To view, visit https://gerrit.osmocom.org/9848 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I69eb458e7cb186c990e5d6fbc780f37fdd0cd884 Gerrit-Change-Number: 9848 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Harald Welte Gerrit-Comment-Date: Tue, 03 Jul 2018 16:56:37 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 16:57:05 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 16:57:05 +0000 Subject: Change in simtrace2[master]: sniffer: add state definitions, improve IRQ handling, update pins con... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9849 ) Change subject: sniffer: add state definitions, improve IRQ handling, update pins configuration ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9849 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6b5dfd6d573ac122a60585a24c8a620642805ad5 Gerrit-Change-Number: 9849 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 03 Jul 2018 16:57:05 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 16:57:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 16:57:15 +0000 Subject: Change in simtrace2[master]: SIMtrace: only enable main sniffing mode on SIMtrace board In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9850 ) Change subject: SIMtrace: only enable main sniffing mode on SIMtrace board ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9850 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iff6ebb1d98aa0c31f6d78508afde8f1b05f0f85b Gerrit-Change-Number: 9850 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 03 Jul 2018 16:57:15 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 16:57:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 16:57:36 +0000 Subject: Change in simtrace2[master]: SIMtrace: fix default SIM_RST pin state to allow phone controlled reset In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9851 ) Change subject: SIMtrace: fix default SIM_RST pin state to allow phone controlled reset ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9851 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1942ec6bd499cb2e14f6d7699a2b2d9b4197e654 Gerrit-Change-Number: 9851 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 03 Jul 2018 16:57:36 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 16:57:49 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 16:57:49 +0000 Subject: Change in simtrace2[master]: SIMtrace: enable interrupt on edge dection for SIM_RST pin to reset t... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9852 ) Change subject: SIMtrace: enable interrupt on edge dection for SIM_RST pin to reset the sniffer ISO state ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9852 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I92ff29abd6a8690dd033d8cf13ad0d1ff9740fe5 Gerrit-Change-Number: 9852 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 03 Jul 2018 16:57:49 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 16:58:45 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 16:58:45 +0000 Subject: Change in simtrace2[master]: ISO7816: change update_fidi to use provided USART, and disable write ... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9853 ) Change subject: ISO7816: change update_fidi to use provided USART, and disable write protection for USART register if required ...................................................................... Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/9853/1/firmware/libcommon/source/simtrace_iso7816.c File firmware/libcommon/source/simtrace_iso7816.c: https://gerrit.osmocom.org/#/c/9853/1/firmware/libcommon/source/simtrace_iso7816.c at 138 PS1, Line 138: TRACE_INFO("updated USART Fi(%u)/Di(%u) ratio(%d): %u\n\r", fi, di, ratio, usart->US_FIDI); it would make sense to print the UASRT number as otherwise you don't know if a given TRACE/log message relates to UART0 or USART1 -- To view, visit https://gerrit.osmocom.org/9853 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I716f4bc3a22800cbce402b146f14ef8b2aab2a98 Gerrit-Change-Number: 9853 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 03 Jul 2018 16:58:45 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 16:58:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 16:58:57 +0000 Subject: Change in simtrace2[master]: trace: increase watchdog for 500 to 2000 ms to provide more time hand... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9854 ) Change subject: trace: increase watchdog for 500 to 2000 ms to provide more time handling buffered data ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9854 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iacd85525f05e692b44183bd4c4585b9e70865cfe Gerrit-Change-Number: 9854 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 03 Jul 2018 16:58:57 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 17:01:26 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 17:01:26 +0000 Subject: Change in simtrace2[master]: sniffer: use ISR to store sniffed data in buffer, add ATR and PPS par... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9855 ) Change subject: sniffer: use ISR to store sniffed data in buffer, add ATR and PPS parsing, and PPS related FiDi update ...................................................................... Patch Set 1: Code-Review+1 (4 comments) https://gerrit.osmocom.org/#/c/9855/1/firmware/libcommon/source/sniffer.c File firmware/libcommon/source/sniffer.c: https://gerrit.osmocom.org/#/c/9855/1/firmware/libcommon/source/sniffer.c at 208 PS1, Line 208: >= it's not super critical (i.e. not required to merge this), but in general, osmocom coding style uses spaces around comparison operators https://gerrit.osmocom.org/#/c/9855/1/firmware/libcommon/source/sniffer.c at 234 PS1, Line 234: == cosmetic: spaces https://gerrit.osmocom.org/#/c/9855/1/firmware/libcommon/source/sniffer.c at 240 PS1, Line 240: & also here, spaces, and in all incarnations below. https://gerrit.osmocom.org/#/c/9855/1/firmware/libcommon/source/sniffer.c at 364 PS1, Line 364: rbuf_reset(&sniff_buffer); /* reset buffer for new communication */ indent level wrong, more critical than the cosmetic spaces above. -- To view, visit https://gerrit.osmocom.org/9855 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4b38ce1d80e370fda6aa181e959ba3f1286bb922 Gerrit-Change-Number: 9855 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 03 Jul 2018 17:01:26 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 17:02:58 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 17:02:58 +0000 Subject: Change in osmo-mgw[master]: stats: replace packet statistic counters with libosmocore rate counters In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9837 ) Change subject: stats: replace packet statistic counters with libosmocore rate counters ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/9837/1/include/osmocom/mgcp/mgcp_internal.h File include/osmocom/mgcp/mgcp_internal.h: https://gerrit.osmocom.org/#/c/9837/1/include/osmocom/mgcp/mgcp_internal.h at 104 PS1, Line 104: struct rate_ctr *packets_rx; I think the more logical / common approach would be to simply have one pointer to the rate counter group here? Please compare with other osmocom code using rate_ctr[_group] -- To view, visit https://gerrit.osmocom.org/9837 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I47c5c9006df5044e59ddebb895e62adb849d72d5 Gerrit-Change-Number: 9837 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-CC: Harald Welte Gerrit-Comment-Date: Tue, 03 Jul 2018 17:02:58 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 17:03:07 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 17:03:07 +0000 Subject: Change in osmo-mgw[master]: mgcp_internal: remove unused struct member In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9836 ) Change subject: mgcp_internal: remove unused struct member ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9836 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3a66d159ce32359621ff2e772ee3421340b78cd5 Gerrit-Change-Number: 9836 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 03 Jul 2018 17:03:07 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 17:03:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 17:03:08 +0000 Subject: Change in osmo-mgw[master]: mgcp_internal: remove unused struct member In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9836 ) Change subject: mgcp_internal: remove unused struct member ...................................................................... mgcp_internal: remove unused struct member The struct member rtp_process_data in struct mgcp_rtp_end is unused and should be removed - remove rtp_process_data Change-Id: I3a66d159ce32359621ff2e772ee3421340b78cd5 --- M include/osmocom/mgcp/mgcp_internal.h 1 file changed, 0 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmocom/mgcp/mgcp_internal.h b/include/osmocom/mgcp/mgcp_internal.h index 7712593..1b9749d 100644 --- a/include/osmocom/mgcp/mgcp_internal.h +++ b/include/osmocom/mgcp/mgcp_internal.h @@ -137,8 +137,6 @@ int force_constant_ssrc; /* -1: always, 0: don't, 1: once */ /* should we perform align_rtp_timestamp_offset() (1) or not (0) */ int force_aligned_timing; - /* FIXME: not used anymore, used to be [external] transcoding related */ - void *rtp_process_data; /* Each end has a separate socket for RTP and RTCP */ struct osmo_fd rtp; -- To view, visit https://gerrit.osmocom.org/9836 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I3a66d159ce32359621ff2e772ee3421340b78cd5 Gerrit-Change-Number: 9836 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 17:03:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 17:03:27 +0000 Subject: Change in gapk[master]: configure.ac: disable building libgsmhr by default In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9795 ) Change subject: configure.ac: disable building libgsmhr by default ...................................................................... Patch Set 2: Verified+1 Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9795 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gapk Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib86f3f972fc31c7eedf7ed75a7c356ac62e47dc6 Gerrit-Change-Number: 9795 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Tue, 03 Jul 2018 17:03:27 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 17:03:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 17:03:29 +0000 Subject: Change in gapk[master]: configure.ac: disable building libgsmhr by default In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9795 ) Change subject: configure.ac: disable building libgsmhr by default ...................................................................... configure.ac: disable building libgsmhr by default At the moment, Half Rate codec support is limited. There are still some issues with encoding of the reference files (see OS#2514), and moreover AddressSanitizer is not happy about libgsmhr... Change-Id: Ib86f3f972fc31c7eedf7ed75a7c356ac62e47dc6 Related: OS#2514 --- M configure.ac 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/configure.ac b/configure.ac index 8b6a489..6551ae6 100644 --- a/configure.ac +++ b/configure.ac @@ -27,10 +27,10 @@ # Options AC_ARG_ENABLE(gsmhr, [AS_HELP_STRING( - [--disable-gsmhr], - [Disable support for GSM HR codec using reference code] + [--enable-gsmhr], + [Enable support for GSM HR codec using GSM 06.06 reference code] )], - [enable_gsmhr=$enableval], [enable_gsmhr="yes"]) + [enable_gsmhr="yes"], [enable_gsmhr=$enableval]) AM_CONDITIONAL(ENABLE_GSMHR, test "x$enable_gsmhr" = "xyes") if test "x$enable_gsmhr" = "xyes"; then AM_PATH_PYTHON([2.4]) -- To view, visit https://gerrit.osmocom.org/9795 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gapk Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ib86f3f972fc31c7eedf7ed75a7c356ac62e47dc6 Gerrit-Change-Number: 9795 Gerrit-PatchSet: 3 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Tue Jul 3 17:06:54 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Tue, 3 Jul 2018 17:06:54 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-gapk_=C2=BB_a1=3Ddefaul?= =?UTF-8?Q?t,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#8?= In-Reply-To: <1028518139.38.1530631842983.JavaMail.jenkins@jenkins.osmocom.org> References: <1028518139.38.1530631842983.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <653566090.39.1530637614456.JavaMail.jenkins@jenkins.osmocom.org> See Changes: [laforge] configure.ac: disable building libgsmhr by default ------------------------------------------ [...truncated 127.22 KB...] checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether make supports nested variables... (cached) yes checking if gcc supports -fvisibility=hidden... yes checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking whether gcc understands -c and -o together... (cached) yes checking dependency style of gcc... (cached) gcc3 checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for LIBOSMOCORE... yes checking for LIBOSMOCODEC... yes checking for LIBALSA... yes checking for OPENCORE_AMRNB... yes checking gsm/gsm.h usability... yes checking gsm/gsm.h presence... yes checking for gsm/gsm.h... yes checking for gsm_create in -lgsm... yes checking for stdint.h... (cached) yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking for unistd.h... (cached) yes checking for inline... inline checking for int16_t... yes checking for int32_t... yes checking for uint16_t... yes checking for uint32_t... yes checking for uint64_t... yes checking for uint8_t... yes checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... yes checking for memset... yes checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating src/Makefile config.status: creating libgsmhr/Makefile config.status: creating include/Makefile config.status: creating include/gsmhr/Makefile config.status: creating libosmogapk.pc config.status: creating tests/atlocal config.status: creating tests/Makefile config.status: creating config.h config.status: executing depfiles commands config.status: executing libtool commands config.status: executing tests/atconfig commands make[1]: Entering directory ' make all-recursive make[2]: Entering directory ' Making all in include make[3]: Entering directory ' make[4]: Entering directory ' make[4]: Nothing to be done for 'all-am'. make[4]: Leaving directory ' make[3]: Leaving directory ' Making all in src make[3]: Entering directory ' CC procqueue.lo CC pq_format.lo CC pq_codec.lo CC pq_file.lo CC pq_alsa.lo CC pq_rtp.lo CC pq_ecu.lo CC ecu_fr.lo CC formats.lo CC fmt_ti.lo CC fmt_amr.lo CC fmt_gsm.lo CC fmt_hr_ref.lo CC fmt_racal.lo CC fmt_rawpcm.lo CC fmt_rtp_amr.lo CC fmt_rtp_efr.lo CC fmt_rtp_hr_etsi.lo CC fmt_rtp_hr_ietf.lo CC fmt_amr_opencore.lo CC codecs.lo CC codec_pcm.lo CC codec_hr.lo CC codec_fr.lo CC codec_efr.lo CC codec_amr.lo CC benchmark.lo CC common.lo CCLD libosmogapk.la CC app_osmo_gapk.o CCLD osmo-gapk make[3]: Leaving directory ' Making all in tests make[3]: Entering directory ' make[3]: Nothing to be done for 'all'. make[3]: Leaving directory ' make[3]: Entering directory ' make[3]: Nothing to be done for 'all-am'. make[3]: Leaving directory ' make[2]: Leaving directory ' make[1]: Leaving directory ' make[1]: Entering directory ' Making dvi in include make[2]: Entering directory ' make[3]: Entering directory ' make[3]: Nothing to be done for 'dvi-am'. make[3]: Leaving directory ' make[2]: Leaving directory ' Making dvi in src make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi'. make[2]: Leaving directory ' Making dvi in tests make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi'. make[2]: Leaving directory ' make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi-am'. make[2]: Leaving directory ' make[1]: Leaving directory ' make[1]: Entering directory ' Making check in include make[2]: Entering directory ' make[3]: Entering directory ' make[3]: Nothing to be done for 'check-am'. make[3]: Leaving directory ' make[2]: Leaving directory ' Making check in src make[2]: Entering directory ' make[2]: Nothing to be done for 'check'. make[2]: Leaving directory ' Making check in tests make[2]: Entering directory ' make procqueue/pq_test io/pq_file_test io/pq_rtp_test ecu/ecu_fr_test make[3]: Entering directory ' CC procqueue/pq_test.o CCLD procqueue/pq_test CC io/pq_file_test.o CCLD io/pq_file_test CC io/pq_rtp_test.o CCLD io/pq_rtp_test CC ecu/ecu_fr_test.o CCLD ecu/ecu_fr_test make[3]: Leaving directory ' make check-local make[3]: Entering directory ' /bin/bash '../../../tests/testsuite' ## ---------------------------- ## ## gapk 0.4.75-27bc test suite. ## ## ---------------------------- ## Regression tests. 1: procqueue ok 2: io/pq_file FAILED (testsuite.at:13) 3: io/pq_rtp ok 4: ecu/ecu_fr_test ok 5: conv/enc/amr_efr ok 6: conv/enc/gsm ok 7: conv/enc/racal_hr skipped (testsuite.at:58) 8: conv/enc/racal_fr ok 9: conv/enc/racal_efr ok 10: conv/enc/ti_hr skipped (testsuite.at:91) 11: conv/enc/ti_fr ok 12: conv/enc/ti_efr ok 13: conv/enc/rtp_efr ok 14: conv/enc/rtp_hr_etsi skipped (testsuite.at:135) 15: conv/enc/rtp_hr_ietf skipped (testsuite.at:146) 16: conv/dec/amr_efr ok 17: conv/dec/gsm ok 18: conv/dec/racal_hr skipped (testsuite.at:179) 19: conv/dec/racal_fr ok 20: conv/dec/racal_efr ok 21: conv/dec/ti_hr skipped (testsuite.at:212) 22: conv/dec/ti_fr ok 23: conv/dec/ti_efr ok 24: conv/dec/rtp_efr ok 25: conv/dec/rtp_hr_etsi skipped (testsuite.at:256) 26: conv/dec/rtp_hr_ietf skipped (testsuite.at:267) ## ------------- ## ## Test results. ## ## ------------- ## ERROR: 18 tests were run, 1 failed unexpectedly. 8 tests were skipped. ## -------------------------- ## ## testsuite.log was created. ## ## -------------------------- ## Please send `tests/testsuite.log' and all information you think might help: To: Subject: [gapk 0.4.75-27bc] testsuite: 2 failed You may investigate any problem if you feel able to do so, in which case the test suite provides a good starting point. Its output may be found below `tests/testsuite.dir'. Makefile:753: recipe for target 'check-local' failed make[3]: *** [check-local] Error 1 make[3]: Leaving directory ' Makefile:602: recipe for target 'check-am' failed make[2]: *** [check-am] Error 2 make[2]: Leaving directory ' Makefile:479: recipe for target 'check-recursive' failed make[1]: *** [check-recursive] Error 1 make[1]: Leaving directory ' Makefile:684: recipe for target 'distcheck' failed make: *** [distcheck] Error 1 + cat-testlogs.sh ======================== ./gapk-0.4.75-27bc/_build/sub/tests/testsuite.dir/02/testsuite.log # -*- compilation -*- 2. testsuite.at:10: testing io/pq_file ... ../../../tests/testsuite.at:13: $abs_top_builddir/tests/io/pq_file_test \ $abs_top_builddir/tests/io/io_sample.txt --- /dev/null 2018-03-27 19:17:06.212284948 +0000 +++ 2018-07-03 17:06:53.730651697 +0000 @@ -0,0 +1,2 @@ +pq_file_test: ../../../tests/io/pq_file_test.c:132: main: Assertion `sample_file != NULL' failed. +: line 29: 30126 Aborted $abs_top_builddir/tests/io/pq_file_test $abs_top_builddir/tests/io/io_sample.txt --- expout 2018-07-03 17:06:53.722651753 +0000 +++ 2018-07-03 17:06:53.722651753 +0000 @@ -1,12 +0,0 @@ -Processing sample file with blk_len=2: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=4: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=8: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=16: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=32: -8217c8fb7675a95008f9089d883gapk - -chunk null_context: depth=0 ../../../tests/testsuite.at:13: exit code was 134, expected 0 2. testsuite.at:10: 2. io/pq_file (testsuite.at:10): FAILED (testsuite.at:13) Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From jenkins at lists.osmocom.org Tue Jul 3 17:54:38 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Tue, 3 Jul 2018 17:54:38 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-gapk_=C2=BB_a1=3Ddefaul?= =?UTF-8?Q?t,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#9?= In-Reply-To: <653566090.39.1530637614456.JavaMail.jenkins@jenkins.osmocom.org> References: <653566090.39.1530637614456.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <1687419589.40.1530640478840.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 127.32 KB...] checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether make supports nested variables... (cached) yes checking if gcc supports -fvisibility=hidden... yes checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking whether gcc understands -c and -o together... (cached) yes checking dependency style of gcc... (cached) gcc3 checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for LIBOSMOCORE... yes checking for LIBOSMOCODEC... yes checking for LIBALSA... yes checking for OPENCORE_AMRNB... yes checking gsm/gsm.h usability... yes checking gsm/gsm.h presence... yes checking for gsm/gsm.h... yes checking for gsm_create in -lgsm... yes checking for stdint.h... (cached) yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking for unistd.h... (cached) yes checking for inline... inline checking for int16_t... yes checking for int32_t... yes checking for uint16_t... yes checking for uint32_t... yes checking for uint64_t... yes checking for uint8_t... yes checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... yes checking for memset... yes checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating src/Makefile config.status: creating libgsmhr/Makefile config.status: creating include/Makefile config.status: creating include/gsmhr/Makefile config.status: creating libosmogapk.pc config.status: creating tests/atlocal config.status: creating tests/Makefile config.status: creating config.h config.status: executing depfiles commands config.status: executing libtool commands config.status: executing tests/atconfig commands make[1]: Entering directory ' make all-recursive make[2]: Entering directory ' Making all in include make[3]: Entering directory ' make[4]: Entering directory ' make[4]: Nothing to be done for 'all-am'. make[4]: Leaving directory ' make[3]: Leaving directory ' Making all in src make[3]: Entering directory ' CC procqueue.lo CC pq_format.lo CC pq_codec.lo CC pq_file.lo CC pq_alsa.lo CC pq_rtp.lo CC pq_ecu.lo CC ecu_fr.lo CC formats.lo CC fmt_ti.lo CC fmt_amr.lo CC fmt_gsm.lo CC fmt_hr_ref.lo CC fmt_racal.lo CC fmt_rawpcm.lo CC fmt_rtp_amr.lo CC fmt_rtp_efr.lo CC fmt_rtp_hr_etsi.lo CC fmt_rtp_hr_ietf.lo CC fmt_amr_opencore.lo CC codecs.lo CC codec_pcm.lo CC codec_hr.lo CC codec_fr.lo CC codec_efr.lo CC codec_amr.lo CC benchmark.lo CC common.lo CCLD libosmogapk.la CC app_osmo_gapk.o CCLD osmo-gapk make[3]: Leaving directory ' Making all in tests make[3]: Entering directory ' make[3]: Nothing to be done for 'all'. make[3]: Leaving directory ' make[3]: Entering directory ' make[3]: Leaving directory ' make[2]: Leaving directory ' make[1]: Leaving directory ' make[1]: Entering directory ' Making dvi in include make[2]: Entering directory ' make[3]: Entering directory ' make[3]: Nothing to be done for 'dvi-am'. make[3]: Leaving directory ' make[2]: Leaving directory ' Making dvi in src make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi'. make[2]: Leaving directory ' Making dvi in tests make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi'. make[2]: Leaving directory ' make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi-am'. make[2]: Leaving directory ' make[1]: Leaving directory ' make[1]: Entering directory ' Making check in include make[2]: Entering directory ' make[3]: Entering directory ' make[3]: Nothing to be done for 'check-am'. make[3]: Leaving directory ' make[2]: Leaving directory ' Making check in src make[2]: Entering directory ' make[2]: Nothing to be done for 'check'. make[2]: Leaving directory ' Making check in tests make[2]: Entering directory ' make procqueue/pq_test io/pq_file_test io/pq_rtp_test ecu/ecu_fr_test make[3]: Entering directory ' CC procqueue/pq_test.o CCLD procqueue/pq_test CC io/pq_file_test.o CCLD io/pq_file_test CC io/pq_rtp_test.o CCLD io/pq_rtp_test CC ecu/ecu_fr_test.o CCLD ecu/ecu_fr_test make[3]: Leaving directory ' make check-local make[3]: Entering directory ' /bin/bash '../../../tests/testsuite' ## ---------------------------- ## ## gapk 0.4.75-27bc test suite. ## ## ---------------------------- ## Regression tests. 1: procqueue ok 2: io/pq_file FAILED (testsuite.at:13) 3: io/pq_rtp ok 4: ecu/ecu_fr_test ok 5: conv/enc/amr_efr ok 6: conv/enc/gsm ok 7: conv/enc/racal_hr skipped (testsuite.at:58) 8: conv/enc/racal_fr ok 9: conv/enc/racal_efr ok 10: conv/enc/ti_hr skipped (testsuite.at:91) 11: conv/enc/ti_fr ok 12: conv/enc/ti_efr ok 13: conv/enc/rtp_efr ok 14: conv/enc/rtp_hr_etsi skipped (testsuite.at:135) 15: conv/enc/rtp_hr_ietf skipped (testsuite.at:146) 16: conv/dec/amr_efr ok 17: conv/dec/gsm ok 18: conv/dec/racal_hr skipped (testsuite.at:179) 19: conv/dec/racal_fr ok 20: conv/dec/racal_efr ok 21: conv/dec/ti_hr skipped (testsuite.at:212) 22: conv/dec/ti_fr ok 23: conv/dec/ti_efr ok 24: conv/dec/rtp_efr ok 25: conv/dec/rtp_hr_etsi skipped (testsuite.at:256) 26: conv/dec/rtp_hr_ietf skipped (testsuite.at:267) ## ------------- ## ## Test results. ## ## ------------- ## ERROR: 18 tests were run, 1 failed unexpectedly. 8 tests were skipped. ## -------------------------- ## ## testsuite.log was created. ## ## -------------------------- ## Please send `tests/testsuite.log' and all information you think might help: To: Subject: [gapk 0.4.75-27bc] testsuite: 2 failed You may investigate any problem if you feel able to do so, in which case the test suite provides a good starting point. Its output may be found below `tests/testsuite.dir'. Makefile:753: recipe for target 'check-local' failed make[3]: *** [check-local] Error 1 make[3]: Leaving directory ' Makefile:602: recipe for target 'check-am' failed make[2]: *** [check-am] Error 2 make[2]: Leaving directory ' Makefile:479: recipe for target 'check-recursive' failed make[1]: *** [check-recursive] Error 1 make[1]: Leaving directory ' Makefile:684: recipe for target 'distcheck' failed make: *** [distcheck] Error 1 + cat-testlogs.sh ======================== ./gapk-0.4.75-27bc/_build/sub/tests/testsuite.dir/02/testsuite.log # -*- compilation -*- 2. testsuite.at:10: testing io/pq_file ... ../../../tests/testsuite.at:13: $abs_top_builddir/tests/io/pq_file_test \ $abs_top_builddir/tests/io/io_sample.txt --- /dev/null 2018-03-27 19:17:06.212284948 +0000 +++ 2018-07-03 17:54:38.091417520 +0000 @@ -0,0 +1,2 @@ +pq_file_test: ../../../tests/io/pq_file_test.c:132: main: Assertion `sample_file != NULL' failed. +: line 29: 12037 Aborted $abs_top_builddir/tests/io/pq_file_test $abs_top_builddir/tests/io/io_sample.txt --- expout 2018-07-03 17:54:38.079417600 +0000 +++ 2018-07-03 17:54:38.079417600 +0000 @@ -1,12 +0,0 @@ -Processing sample file with blk_len=2: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=4: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=8: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=16: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=32: -8217c8fb7675a95008f9089d883gapk - -chunk null_context: depth=0 ../../../tests/testsuite.at:13: exit code was 134, expected 0 2. testsuite.at:10: 2. io/pq_file (testsuite.at:10): FAILED (testsuite.at:13) Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Tue Jul 3 22:29:40 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 3 Jul 2018 22:29:40 +0000 Subject: Change in osmo-ttcn3-hacks[master]: bsc: verify MultiRate Config IE in RSL Chan Activ Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/9856 Change subject: bsc: verify MultiRate Config IE in RSL Chan Activ ...................................................................... bsc: verify MultiRate Config IE in RSL Chan Activ The current osmo-bsc refactoring causes an erratic MR Config IE. This patch ensures that the ttcn3-bsc-tests catch this error. Add MR Config IE expectations to g_pars, set these in the two tests that expect an MR Config IE in the Chan Activ message: BSC_Tests.TC_assignment_codec_amr_{f,h} All other tests now verify that there is *no* MR Config IE in RSL Chan Activ messages -- all other tests request no voice or a non-AMR codec for Chan Activ. Change-Id: Ie841feed9d5e478bab1fea2bb86f300e84799013 --- M bsc/BSC_Tests.ttcn M bsc/MSC_ConnectionHandler.ttcn 2 files changed, 36 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/56/9856/1 diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 328fc59..2a8ad5f 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -1841,6 +1841,26 @@ if (not match(mode_ie, t_mode_ie)) { setverdict(fail, "RSL Channel Mode IE doesn't match expectation"); } + + var RSL_IE_Body mr_conf; + if (g_pars.expect_mr_conf_ie != omit) { + if (f_rsl_find_ie(rsl, RSL_IE_MR_CONFIG, mr_conf) == false) { + setverdict(fail, "Missing MR CONFIG IE in RSL Chan Activ"); + self.stop; + } + log("found RSL MR CONFIG IE: ", mr_conf); + + if (not match(mr_conf, g_pars.expect_mr_conf_ie)) { + setverdict(fail, "RSL MR CONFIG IE does not match expectation. Expected: ", + g_pars.expect_mr_conf_ie); + } + } else { + if (f_rsl_find_ie(rsl, RSL_IE_MR_CONFIG, mr_conf) == true) { + log("found RSL MR CONFIG IE: ", mr_conf); + setverdict(fail, "Found MR CONFIG IE in RSL Chan Activ, expecting omit"); + self.stop; + } + } } testcase TC_assignment_codec_fr() runs on test_CT { @@ -1882,11 +1902,18 @@ testcase TC_assignment_codec_amr_f() runs on test_CT { var TestHdlrParams pars := valueof(t_def_TestHdlrPars); var MSC_ConnHdlr vc_conn; + var RSL_IE_Body mr_conf := { + other := { + len := 2, + payload := '2804'O + } + }; f_init(1, true); f_sleep(1.0); pars.ass_codec_list := valueof(ts_BSSMAP_IE_CodecList({ts_CodecAMR_F})); + pars.expect_mr_conf_ie := mr_conf; vc_conn := f_start_handler(refers(f_TC_assignment_codec), pars); vc_conn.done; } @@ -1894,11 +1921,18 @@ testcase TC_assignment_codec_amr_h() runs on test_CT { var TestHdlrParams pars := valueof(t_def_TestHdlrPars); var MSC_ConnHdlr vc_conn; + var RSL_IE_Body mr_conf := { + other := { + len := 2, + payload := '2804'O + } + }; f_init(1, true); f_sleep(1.0); pars.ass_codec_list := valueof(ts_BSSMAP_IE_CodecList({ts_CodecAMR_H})); + pars.expect_mr_conf_ie := mr_conf; vc_conn := f_start_handler(refers(f_TC_assignment_codec), pars); vc_conn.done; } diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index 0f123b6..1261a4d 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -390,6 +390,7 @@ RslLinkId link_id, integer media_nr, /* determins MGCP EP, port numbers */ BSSMAP_IE_SpeechCodecList ass_codec_list optional, + RSL_IE_Body expect_mr_conf_ie optional, /* typically present for AMR codecs */ TestHdlrEncrParams encr optional, TestHdlrParamsLcls lcls }; @@ -401,6 +402,7 @@ link_id := valueof(ts_RslLinkID_DCCH(0)), media_nr := 1, ass_codec_list := omit, + expect_mr_conf_ie := omit, encr := omit, lcls := { gcr := omit, -- To view, visit https://gerrit.osmocom.org/9856 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ie841feed9d5e478bab1fea2bb86f300e84799013 Gerrit-Change-Number: 9856 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 22:42:59 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 3 Jul 2018 22:42:59 +0000 Subject: Change in osmo-bsc[master]: large refactoring: use FSMs for lchans; add inter-BSC HO In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9671 to look at the new patch set (#13). Change subject: large refactoring: use FSMs for lchans; add inter-BSC HO ...................................................................... large refactoring: use FSMs for lchans; add inter-BSC HO Add FSMs: - timeslot_fsm: handle dynamic timeslots and OML+RSL availability. - lchan_fsm: handle an individual lchan activation, RTP stream and release, signal the appropriate calling FSMs on success, failure, release. - mgw_endpoint_fsm: handle one entire endpoint with several CI. - assignment_fsm: BSSMAP Assignment Request. - handover_fsm: all of intra, inter-MO and inter-MT handover. Above FSMs absorb large parts of the gscon FSM. The gscon FSM was surpassing the maximum amount events (32), and it is more logical to treat assignment, handover and MGW procedures in separate FSMs. - Add logging macros for each FSM type: - LOG_TS() - LOG_LCHAN() - LOG_MGWEP(), LOG_CI() - LOG_ASSIGNMENT() - LOG_HO() These log with the osmo_fsm_inst where present. New style decision: logging without a final newline char is awkward, especially for gsmtap logging and when other logs interleave LOGPC() calls; we have various cases where the final \n goes missing, and also this invokes the log category checking N times instead of once. So I decided to make these macros *always* append a newline, but only if there is no final newline yet. I hope that the compiler optimizes the strlen() of the constant format strings away. Thus I can log with or without typing "\n" and always get an \n termination anyway. General: - replace osmo_timers, state enums and program-wide osmo_signal_dispatch() with dedicated FSM timeouts, states and events. - introduce a common way to handle Tnnn timers: gsm_timers.h/.c: struct T_def. These can be used (with some macro magic) to define a state's timeout once, and not make mistakes for each osmo_fsm_inst_state_chg(). Details: bsc_subscr_conn_fsm.c: - move most states of this FSM to lchan_fsm, assignment_fsm, handover_fsm and mgw_endpoint_fsm. - There is exactly one state for an ongoing Assignment, with all details handled in conn->assignment.fi. The state relies on the assignment_fsm's timeout. - There is one state for an ongoing Handover; except for an incoming Handover from a remote BSS, the gscon remains in ST_INIT until the new lchan and conn are both established. - move bssmap_add_lcls_status() to osmo_bsc_lcls.c abis_rsl.c: - move all dynamic timeslot logic away into timeslot_fsm. Only keep plain send/receive functions in abis_rsl.c - reduce some rsl functions to merely send a message, rename to "_tx_". - rsl_ipacc_mdcx(): add '_tx_' in the name; move parts that change the lchan state out into the lchan_fsm, the lchan->abis_ip.* are now set there prior to invoking this function. - move all timers and error/release handling away into various FSMs. - tweak ipa_smod_s_for_lchan() and ipa_rtp_pt_for_lchan() to not require an lchan passed, but just mode,type that they require. Rename to ipacc_speech_mode*() and ipacc_payload_type(). - add rsl_forward_layer3_info, used for inter-BSC HO MO, to just send the RR message received during BSSMAP Handover Command. - move various logging to LOG_LCHAN() in order to log with the lchan FSM instance. One drawback is that the lchan FSM is limited to one logging category, i.e. this moves some logging from DRR to DRSL. It might actually make sense to combine those categories. - lose LOGP...LOGPC logging cascades: they are bad for gsmtap logging and for performance. - handle_classmark_chg(): change logging, move cm2 len check out of the cm3 condition (I hope that's correct). - gsm48_send_ho_cmd(): split off gsm48_make_ho_cmd() which doesn't send right away, so that during inter-bsc HO we can make an RR Handover Command to send via the MSC to the remote BSS. assignment_fsm.c: - the Chan Mode Modify in case of re-using the same lchan is not implemented yet, because this was also missing in the previous implementation (OS#3357). osmo_bsc_api.c: - simplify bsc_mr_config() and move to lchan_fsm.c, the only caller; rename to lchan_mr_config(). (bsc_mr_config() used to copy the values to mr_bts_lv twice, once by member assignment and then again with a memcpy.) - During handover, we used to copy the MR config from the old lchan. Since we may handover between FR and HR, rather set the MR Config anew every time, so that FR rates are always available on FR lchans, and never on HR lchans. Depends: I03ee7ce840ecfa0b6a33358e7385528aabd4873f Change-Id: I82e3f918295daa83274a4cf803f046979f284366 --- M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/abis_rsl.h A include/osmocom/bsc/assignment_fsm.h M include/osmocom/bsc/bsc_api.h M include/osmocom/bsc/bsc_msc_data.h M include/osmocom/bsc/bsc_subscr_conn_fsm.h M include/osmocom/bsc/bsc_subscriber.h M include/osmocom/bsc/chan_alloc.h M include/osmocom/bsc/debug.h M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/gsm_timers.h M include/osmocom/bsc/handover.h A include/osmocom/bsc/handover_fsm.h A include/osmocom/bsc/lchan_fsm.h A include/osmocom/bsc/lchan_select.h A include/osmocom/bsc/mgw_endpoint_fsm.h M include/osmocom/bsc/neighbor_ident.h M include/osmocom/bsc/osmo_bsc.h M include/osmocom/bsc/osmo_bsc_lcls.h A include/osmocom/bsc/timeslot_fsm.h M src/ipaccess/Makefile.am M src/ipaccess/stubs.c M src/osmo-bsc/Makefile.am M src/osmo-bsc/abis_om2000.c M src/osmo-bsc/abis_rsl.c A src/osmo-bsc/assignment_fsm.c M src/osmo-bsc/bsc_api.c D src/osmo-bsc/bsc_dyn_ts.c M src/osmo-bsc/bsc_subscr_conn_fsm.c M src/osmo-bsc/bsc_subscriber.c M src/osmo-bsc/bsc_vty.c M src/osmo-bsc/bts_ericsson_rbs2000.c M src/osmo-bsc/bts_ipaccess_nanobts.c M src/osmo-bsc/bts_nokia_site.c M src/osmo-bsc/bts_siemens_bs11.c M src/osmo-bsc/chan_alloc.c M src/osmo-bsc/gsm_04_08_utils.c M src/osmo-bsc/gsm_data.c M src/osmo-bsc/gsm_timers.c M src/osmo-bsc/handover_decision.c M src/osmo-bsc/handover_decision_2.c A src/osmo-bsc/handover_fsm.c M src/osmo-bsc/handover_logic.c A src/osmo-bsc/lchan_fsm.c A src/osmo-bsc/lchan_select.c M src/osmo-bsc/meas_feed.c A src/osmo-bsc/mgw_endpoint_fsm.c M src/osmo-bsc/neighbor_ident_vty.c M src/osmo-bsc/osmo_bsc_api.c D src/osmo-bsc/osmo_bsc_audio.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_ctrl.c M src/osmo-bsc/osmo_bsc_filter.c M src/osmo-bsc/osmo_bsc_grace.c M src/osmo-bsc/osmo_bsc_lcls.c M src/osmo-bsc/osmo_bsc_main.c M src/osmo-bsc/osmo_bsc_sigtran.c M src/osmo-bsc/paging.c M src/osmo-bsc/pcu_sock.c M src/osmo-bsc/system_information.c A src/osmo-bsc/timeslot_fsm.c M src/utils/Makefile.am M src/utils/bs11_config.c M src/utils/meas_json.c D src/utils/stubs.c M tests/abis/abis_test.c M tests/bsc/Makefile.am M tests/bsc/bsc_test.c M tests/gsm0408/gsm0408_test.c M tests/handover/Makefile.am M tests/handover/handover_test.c M tests/handover/neighbor_ident_test.c M tests/nanobts_omlattr/nanobts_omlattr_test.c 73 files changed, 8,495 insertions(+), 4,942 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/71/9671/13 -- To view, visit https://gerrit.osmocom.org/9671 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I82e3f918295daa83274a4cf803f046979f284366 Gerrit-Change-Number: 9671 Gerrit-PatchSet: 13 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 22:49:11 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 3 Jul 2018 22:49:11 +0000 Subject: Change in osmo-bsc[master]: large refactoring: use FSMs for lchans; add inter-BSC HO In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9671 ) Change subject: large refactoring: use FSMs for lchans; add inter-BSC HO ...................................................................... Patch Set 13: This latest patch set: There was an error about the MultiRate Config IE. Hence add an error message that warns against a zero length in the MultiRate Config. Compose the MultiRate Config for AMR codecs, like the old implementation did. Note that https://gerrit.osmocom.org/9856 adds a ttcn3-bsc-test that catches the MR Config IE error. mgw_endpoint_fsm.c: tweak logging, add LOG_CI_VERB() which prints an IP address and port only if present, and use that where applicable. (I saw weird logging for CRCX, which typically has no IP:port and looked like "Sending CRCX :0" from empty hostname and zero port) There are still cosmetic bits and testing pending here. -- To view, visit https://gerrit.osmocom.org/9671 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I82e3f918295daa83274a4cf803f046979f284366 Gerrit-Change-Number: 9671 Gerrit-PatchSet: 13 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Tue, 03 Jul 2018 22:49:11 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 23:47:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 23:47:32 +0000 Subject: Change in simtrace2[master]: echo all command characters entered on serial console Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/9857 Change subject: echo all command characters entered on serial console ...................................................................... echo all command characters entered on serial console This is required to make python pexpect.fdexpect happy, as it requires that all characters are echo-ed back in order to detect when the output of a given command starts. Change-Id: I73b24e43f6c8b86a2766aba67d8307c184448aa0 --- M firmware/apps/cardem/main.c 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/57/9857/1 diff --git a/firmware/apps/cardem/main.c b/firmware/apps/cardem/main.c index a80c498..2114901 100644 --- a/firmware/apps/cardem/main.c +++ b/firmware/apps/cardem/main.c @@ -108,6 +108,8 @@ return; ch = UART_GetChar(); + /* We must echo the character to make python fdexpect happy, whcih we use in factory testing */ + fputc(ch, stdout); board_exec_dbg_cmd(ch); } -- To view, visit https://gerrit.osmocom.org/9857 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I73b24e43f6c8b86a2766aba67d8307c184448aa0 Gerrit-Change-Number: 9857 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 3 23:47:34 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 3 Jul 2018 23:47:34 +0000 Subject: Change in simtrace2[master]: qmod: Add 'e' command for erasing the EEPROM Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/9858 Change subject: qmod: Add 'e' command for erasing the EEPROM ...................................................................... qmod: Add 'e' command for erasing the EEPROM Change-Id: Id7cb0db568dd3e9d796829bf0019d63048612998 --- M firmware/libboard/qmod/source/board_qmod.c 1 file changed, 24 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/58/9858/1 diff --git a/firmware/libboard/qmod/source/board_qmod.c b/firmware/libboard/qmod/source/board_qmod.c index dd6e616..c4065eb 100644 --- a/firmware/libboard/qmod/source/board_qmod.c +++ b/firmware/libboard/qmod/source/board_qmod.c @@ -87,6 +87,26 @@ return 0; } +static int erase_hub_eeprom(void) +{ + int i; + + /* wait */ + mdelay(100); + + TRACE_INFO("Erasing EEPROM...\n\r"); + /* write the EEPROM once */ + for (i = 0; i < 256; i++) { + int rc = eeprom_write_byte(0x50, i, 0xff); + /* if the result was negative, repeat that write */ + if (rc < 0) + i--; + } + + return 0; +} + + static void board_exec_dbg_cmd_st12only(int ch) { uint32_t addr, val; @@ -99,6 +119,9 @@ case 'E': write_hub_eeprom(); break; + case 'e': + erase_hub_eeprom(); + break; case 'O': printf("Setting PRTPWR_OVERRIDE\n\r"); PIO_Set(&pin_hubpwr_override); @@ -146,6 +169,7 @@ printf("\tR\treset SAM3\n\r"); if (qmod_sam3_is_12()) { printf("\tE\tprogram EEPROM\n\r"); + printf("\te\tErase EEPROM\n\r"); printf("\tO\tEnable PRTPWR_OVERRIDE\n\r"); printf("\to\tDisable PRTPWR_OVERRIDE\n\r"); printf("\tH\tRelease HUB RESET (high)\n\r"); -- To view, visit https://gerrit.osmocom.org/9858 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id7cb0db568dd3e9d796829bf0019d63048612998 Gerrit-Change-Number: 9858 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 01:56:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 01:56:14 +0000 Subject: Change in simtrace2[master]: echo all command characters entered on serial console In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9857 ) Change subject: echo all command characters entered on serial console ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9857 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I73b24e43f6c8b86a2766aba67d8307c184448aa0 Gerrit-Change-Number: 9857 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 04 Jul 2018 01:56:14 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 01:56:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 01:56:20 +0000 Subject: Change in simtrace2[master]: echo all command characters entered on serial console In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9857 ) Change subject: echo all command characters entered on serial console ...................................................................... echo all command characters entered on serial console This is required to make python pexpect.fdexpect happy, as it requires that all characters are echo-ed back in order to detect when the output of a given command starts. Change-Id: I73b24e43f6c8b86a2766aba67d8307c184448aa0 --- M firmware/apps/cardem/main.c 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/apps/cardem/main.c b/firmware/apps/cardem/main.c index a80c498..2114901 100644 --- a/firmware/apps/cardem/main.c +++ b/firmware/apps/cardem/main.c @@ -108,6 +108,8 @@ return; ch = UART_GetChar(); + /* We must echo the character to make python fdexpect happy, whcih we use in factory testing */ + fputc(ch, stdout); board_exec_dbg_cmd(ch); } -- To view, visit https://gerrit.osmocom.org/9857 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I73b24e43f6c8b86a2766aba67d8307c184448aa0 Gerrit-Change-Number: 9857 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 02:42:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 02:42:32 +0000 Subject: Change in simtrace2[master]: ringbuffer: Don't print/TRAC from ringbuffer Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/9859 Change subject: ringbuffer: Don't print/TRAC from ringbuffer ...................................................................... ringbuffer: Don't print/TRAC from ringbuffer In commit eac1bec4285a48b466e9fd09b0513b3c49d393b3 we start to use the ringbuffer inside the console printing code. As a result, we must not use TRACE_*() or printf() from within ringbuffer.c code to avoid infinite recursion. Instead, let rbuf_write() return a negative return value in case the ring buffer overflows. This way, the callers (outside the console/stdout code) can print an error message themselves. Change-Id: Ib009f013be119dbad22fa2b7d60ec8dee59baee5 --- M firmware/libcommon/include/ringbuffer.h M firmware/libcommon/source/mode_cardemu.c M firmware/libcommon/source/ringbuffer.c 3 files changed, 10 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/59/9859/1 diff --git a/firmware/libcommon/include/ringbuffer.h b/firmware/libcommon/include/ringbuffer.h index 1d29760..efc557c 100644 --- a/firmware/libcommon/include/ringbuffer.h +++ b/firmware/libcommon/include/ringbuffer.h @@ -16,7 +16,7 @@ void rbuf_reset(volatile ringbuf * rb); uint8_t rbuf_read(volatile ringbuf * rb); uint8_t rbuf_peek(volatile ringbuf * rb); -void rbuf_write(volatile ringbuf * rb, uint8_t item); +int rbuf_write(volatile ringbuf * rb, uint8_t item); bool rbuf_is_empty(volatile ringbuf * rb); bool rbuf_is_full(volatile ringbuf * rb); diff --git a/firmware/libcommon/source/mode_cardemu.c b/firmware/libcommon/source/mode_cardemu.c index 7de67df..2d9af99 100644 --- a/firmware/libcommon/source/mode_cardemu.c +++ b/firmware/libcommon/source/mode_cardemu.c @@ -186,7 +186,8 @@ if (csr & US_CSR_RXRDY) { byte = (usart->US_RHR) & 0xFF; - rbuf_write(&ci->rb, byte); + if (rbuf_write(&ci->rb, byte) < 0) + TRACE_ERROR("rbuf overrun\r\n"); } if (csr & US_CSR_TXRDY) { diff --git a/firmware/libcommon/source/ringbuffer.c b/firmware/libcommon/source/ringbuffer.c index 4d980d7..b8cd5c6 100644 --- a/firmware/libcommon/source/ringbuffer.c +++ b/firmware/libcommon/source/ringbuffer.c @@ -2,6 +2,10 @@ #include "trace.h" #include "utils.h" +/* WARNINGI: Since console output is internally using this ringbuffer to implement + * buffered writes, we cannot use any TRACE_*() or printf() style functions here, + * as it would create infinite recursion! */ + void rbuf_reset(volatile ringbuf * rb) { unsigned long state; @@ -52,7 +56,7 @@ return rc; } -void rbuf_write(volatile ringbuf * rb, uint8_t item) +int rbuf_write(volatile ringbuf * rb, uint8_t item) { unsigned long state; @@ -61,9 +65,10 @@ rb->buf[rb->iwr] = item; rb->iwr = (rb->iwr + 1) % RING_BUFLEN; local_irq_restore(state); + return 0; } else { local_irq_restore(state); - TRACE_ERROR("Ringbuffer full, losing bytes!"); + return -1; } } -- To view, visit https://gerrit.osmocom.org/9859 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ib009f013be119dbad22fa2b7d60ec8dee59baee5 Gerrit-Change-Number: 9859 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 02:44:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 02:44:11 +0000 Subject: Change in simtrace2[master]: ringbuffer: Don't print/TRAC from ringbuffer In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9859 ) Change subject: ringbuffer: Don't print/TRAC from ringbuffer ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9859 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib009f013be119dbad22fa2b7d60ec8dee59baee5 Gerrit-Change-Number: 9859 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 04 Jul 2018 02:44:11 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 02:44:13 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 02:44:13 +0000 Subject: Change in simtrace2[master]: ringbuffer: Don't print/TRAC from ringbuffer In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9859 ) Change subject: ringbuffer: Don't print/TRAC from ringbuffer ...................................................................... ringbuffer: Don't print/TRAC from ringbuffer In commit eac1bec4285a48b466e9fd09b0513b3c49d393b3 we start to use the ringbuffer inside the console printing code. As a result, we must not use TRACE_*() or printf() from within ringbuffer.c code to avoid infinite recursion. Instead, let rbuf_write() return a negative return value in case the ring buffer overflows. This way, the callers (outside the console/stdout code) can print an error message themselves. Change-Id: Ib009f013be119dbad22fa2b7d60ec8dee59baee5 --- M firmware/libcommon/include/ringbuffer.h M firmware/libcommon/source/mode_cardemu.c M firmware/libcommon/source/ringbuffer.c 3 files changed, 10 insertions(+), 4 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libcommon/include/ringbuffer.h b/firmware/libcommon/include/ringbuffer.h index 1d29760..efc557c 100644 --- a/firmware/libcommon/include/ringbuffer.h +++ b/firmware/libcommon/include/ringbuffer.h @@ -16,7 +16,7 @@ void rbuf_reset(volatile ringbuf * rb); uint8_t rbuf_read(volatile ringbuf * rb); uint8_t rbuf_peek(volatile ringbuf * rb); -void rbuf_write(volatile ringbuf * rb, uint8_t item); +int rbuf_write(volatile ringbuf * rb, uint8_t item); bool rbuf_is_empty(volatile ringbuf * rb); bool rbuf_is_full(volatile ringbuf * rb); diff --git a/firmware/libcommon/source/mode_cardemu.c b/firmware/libcommon/source/mode_cardemu.c index 7de67df..2d9af99 100644 --- a/firmware/libcommon/source/mode_cardemu.c +++ b/firmware/libcommon/source/mode_cardemu.c @@ -186,7 +186,8 @@ if (csr & US_CSR_RXRDY) { byte = (usart->US_RHR) & 0xFF; - rbuf_write(&ci->rb, byte); + if (rbuf_write(&ci->rb, byte) < 0) + TRACE_ERROR("rbuf overrun\r\n"); } if (csr & US_CSR_TXRDY) { diff --git a/firmware/libcommon/source/ringbuffer.c b/firmware/libcommon/source/ringbuffer.c index 4d980d7..b8cd5c6 100644 --- a/firmware/libcommon/source/ringbuffer.c +++ b/firmware/libcommon/source/ringbuffer.c @@ -2,6 +2,10 @@ #include "trace.h" #include "utils.h" +/* WARNINGI: Since console output is internally using this ringbuffer to implement + * buffered writes, we cannot use any TRACE_*() or printf() style functions here, + * as it would create infinite recursion! */ + void rbuf_reset(volatile ringbuf * rb) { unsigned long state; @@ -52,7 +56,7 @@ return rc; } -void rbuf_write(volatile ringbuf * rb, uint8_t item) +int rbuf_write(volatile ringbuf * rb, uint8_t item) { unsigned long state; @@ -61,9 +65,10 @@ rb->buf[rb->iwr] = item; rb->iwr = (rb->iwr + 1) % RING_BUFLEN; local_irq_restore(state); + return 0; } else { local_irq_restore(state); - TRACE_ERROR("Ringbuffer full, losing bytes!"); + return -1; } } -- To view, visit https://gerrit.osmocom.org/9859 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ib009f013be119dbad22fa2b7d60ec8dee59baee5 Gerrit-Change-Number: 9859 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 08:58:47 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 08:58:47 +0000 Subject: Change in simtrace2[master]: sniff: use USART 0 instead of USART 1 In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9845 to look at the new patch set (#2). Change subject: sniff: use USART 0 instead of USART 1 ...................................................................... sniff: use USART 0 instead of USART 1 Use USART 0 connected to the SIM card side to sniff the communication. The card side can also measure ETU times. Do proper pin initialization. This code can already capture the ATR communication between phone and card. Change-Id: I0597ec723cb2225540c89c3821b91d8a45adfcd6 --- M firmware/apps/trace/main.c M firmware/libboard/simtrace/include/board.h M firmware/libcommon/include/simtrace.h M firmware/libcommon/source/sniffer.c 4 files changed, 65 insertions(+), 68 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/45/9845/2 -- To view, visit https://gerrit.osmocom.org/9845 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0597ec723cb2225540c89c3821b91d8a45adfcd6 Gerrit-Change-Number: 9845 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 08:58:49 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 08:58:49 +0000 Subject: Change in simtrace2[master]: DFU: remove force bootloader button debug message since the console i... Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9860 Change subject: DFU: remove force bootloader button debug message since the console is output message is not initialized yet ...................................................................... DFU: remove force bootloader button debug message since the console is output message is not initialized yet Change-Id: Ibea0105929a8dc38b43dacd9d1e576d7b51d0c6a --- M firmware/libboard/simtrace/source/board_simtrace.c 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/60/9860/1 diff --git a/firmware/libboard/simtrace/source/board_simtrace.c b/firmware/libboard/simtrace/source/board_simtrace.c index 04a3249..90bf9bc 100644 --- a/firmware/libboard/simtrace/source/board_simtrace.c +++ b/firmware/libboard/simtrace/source/board_simtrace.c @@ -44,7 +44,8 @@ /* Enter DFU bootloader in case the respective button is pressed */ if (PIO_Get(&bl_sw_pin) == 0) { - printf("BOOTLOADER switch presssed -> Force DFU\n\r"); + /* do not print to early since the console is not initialized yet */ + //printf("BOOTLOADER switch pressed -> Force DFU\n\r"); return 1; } else return 0; -- To view, visit https://gerrit.osmocom.org/9860 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ibea0105929a8dc38b43dacd9d1e576d7b51d0c6a Gerrit-Change-Number: 9860 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 08:58:49 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 08:58:49 +0000 Subject: Change in simtrace2[master]: board: fix LED pin definition Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9861 Change subject: board: fix LED pin definition ...................................................................... board: fix LED pin definition Change-Id: Ia6c80c0268dec708845e1dad281caaa42027f9db --- M firmware/libboard/common/include/board_common.h 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/61/9861/1 diff --git a/firmware/libboard/common/include/board_common.h b/firmware/libboard/common/include/board_common.h index 27f7409..64bdf0f 100644 --- a/firmware/libboard/common/include/board_common.h +++ b/firmware/libboard/common/include/board_common.h @@ -39,8 +39,8 @@ #define BOARD_MCK 48000000 -#define PIO_LED_RED PIO_PA17 -#define PIO_LED_GREEN PIO_PA17 +#define PIO_LED_RED PIO_PA17 +#define PIO_LED_GREEN PIO_PA18 #define PIN_LED_RED {PIO_LED_RED, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} #define PIN_LED_GREEN {PIO_LED_GREEN, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} -- To view, visit https://gerrit.osmocom.org/9861 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ia6c80c0268dec708845e1dad281caaa42027f9db Gerrit-Change-Number: 9861 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 08:58:50 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 08:58:50 +0000 Subject: Change in simtrace2[master]: DFU: switch green LED on to indicate DFU mode, and red LED to indicat... Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9862 Change subject: DFU: switch green LED on to indicate DFU mode, and red LED to indicate flashing activity ...................................................................... DFU: switch green LED on to indicate DFU mode, and red LED to indicate flashing activity Change-Id: I8e34fd869ed94ad122d6a17f5a432f5a09b820bb --- M firmware/apps/dfu/main.c 1 file changed, 39 insertions(+), 23 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/62/9862/1 diff --git a/firmware/apps/dfu/main.c b/firmware/apps/dfu/main.c index 3d55fdc..26cbb8c 100644 --- a/firmware/apps/dfu/main.c +++ b/firmware/apps/dfu/main.c @@ -13,6 +13,12 @@ /* remember if the watchdog has been configured in the main loop so we can kick it in the ISR */ static bool watchdog_configured = false; +/* There is not enough space in the 16 KiB DFU bootloader to include led.h functions */ +#ifdef PINS_LEDS +/** LED pin configurations */ +static const Pin pinsLeds[] = { PINS_LEDS } ; +#endif + /*---------------------------------------------------------------------------- * Callbacks *----------------------------------------------------------------------------*/ @@ -42,53 +48,62 @@ printf("dnload(altif=%u, offset=%u, len=%u)\n\r", altif, offset, len); +#ifdef PINS_LEDS + PIO_Clear(&pinsLeds[LED_NUM_RED]); +#endif + switch (altif) { case ALTIF_RAM: addr = RAM_ADDR(offset); if (addr < IRAM_ADDR || addr + len >= IRAM_ADDR + IRAM_SIZE || addr + len >= stack_addr) { g_dfu->state = DFU_STATE_dfuERROR; g_dfu->status = DFU_STATUS_errADDRESS; - return DFU_RET_STALL; + rc = DFU_RET_STALL; + break; } memcpy((void *)addr, data, len); - return DFU_RET_ZLP; + rc = DFU_RET_ZLP; + break; case ALTIF_FLASH: addr = FLASH_ADDR(offset); if (addr < IFLASH_ADDR || addr + len >= IFLASH_ADDR + IFLASH_SIZE) { g_dfu->state = DFU_STATE_dfuERROR; g_dfu->status = DFU_STATUS_errADDRESS; - return DFU_RET_STALL; + rc = DFU_RET_STALL; + break; } rc = FLASHD_Unlock(addr, addr + len, 0, 0); if (rc != 0) { TRACE_ERROR("DFU download flash unlock failed\n\r"); - /* FIXME: set error codes */ - return DFU_RET_STALL; + rc = DFU_RET_STALL; + break; } rc = FLASHD_Write(addr, data, len); if (rc != 0) { TRACE_ERROR("DFU download flash erase failed\n\r"); - /* FIXME: set error codes */ - return DFU_RET_STALL; + rc = DFU_RET_STALL; + break; } for (i = 0; i < len; i++) { if (((uint8_t*)addr)[i]!=data[i]) { TRACE_ERROR("DFU download flash data written not correct\n\r"); - return DFU_RET_STALL; + rc = DFU_RET_STALL; + break; } } - rc = FLASHD_Lock(addr, addr + len, 0, 0); - if (rc != 0) { - TRACE_ERROR("DFU download flash lock failed\n\r"); - /* FIXME: set error codes */ - return DFU_RET_STALL; - } - return DFU_RET_ZLP; + rc = DFU_RET_ZLP; + break; default: - /* FIXME: set error codes */ TRACE_ERROR("DFU download for unknown AltIf %d\n\r", altif); - return DFU_RET_STALL; + rc = DFU_RET_STALL; + break; } + +#ifdef PINS_LEDS + PIO_Set(&pinsLeds[LED_NUM_RED]); +#endif + + return rc; } /* incoming call-back: Host has requested to read back 'req_len' bytes @@ -187,17 +202,18 @@ unsigned int i = 0; uint32_t reset_cause = (RSTC->RSTC_SR & RSTC_SR_RSTTYP_Msk) >> RSTC_SR_RSTTYP_Pos; -#if 0 - led_init(); - led_blink(LED_GREEN, BLINK_3O_30F); - led_blink(LED_RED, BLINK_3O_30F); -#endif - /* Enable watchdog for 2000ms, with no window */ WDT_Enable(WDT, WDT_MR_WDRSTEN | WDT_MR_WDDBGHLT | WDT_MR_WDIDLEHLT | (WDT_GetPeriod(2000) << 16) | WDT_GetPeriod(2000)); watchdog_configured = true; +#ifdef PINS_LEDS + /* Configure LED */ + PIO_Configure(pinsLeds, sizeof(pinsLeds)); + PIO_Set(&pinsLeds[LED_NUM_RED]); + PIO_Clear(&pinsLeds[LED_NUM_GREEN]); +#endif + PIO_InitializeInterrupts(0); EEFC_ReadUniqueID(g_unique_id); -- To view, visit https://gerrit.osmocom.org/9862 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I8e34fd869ed94ad122d6a17f5a432f5a09b820bb Gerrit-Change-Number: 9862 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 08:58:50 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 08:58:50 +0000 Subject: Change in simtrace2[master]: update_fidi: remove debug output since this function is called in tim... Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9863 Change subject: update_fidi: remove debug output since this function is called in time critical ISR ...................................................................... update_fidi: remove debug output since this function is called in time critical ISR Change-Id: I08f407d407a18dae3f360ddc64769ddfaeb5b559 --- M firmware/libcommon/source/simtrace_iso7816.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/63/9863/1 diff --git a/firmware/libcommon/source/simtrace_iso7816.c b/firmware/libcommon/source/simtrace_iso7816.c index 3d843a7..fe8b88e 100644 --- a/firmware/libcommon/source/simtrace_iso7816.c +++ b/firmware/libcommon/source/simtrace_iso7816.c @@ -135,8 +135,8 @@ } usart->US_FIDI = (ratio & 0x7ff); usart->US_CR |= US_CR_RXEN | US_CR_STTTO; - TRACE_INFO("updated USART Fi(%u)/Di(%u) ratio(%d): %u\n\r", fi, di, ratio, usart->US_FIDI); + //TRACE_INFO("updated USART Fi(%u)/Di(%u) ratio(%d): %u\n\r", fi, di, ratio, usart->US_FIDI); /* don't print since this is function is also called by ISRs */ } else { - TRACE_WARNING("computed Fi/Di ratio %d unsupported\n\r", ratio); + //TRACE_WARNING("computed Fi/Di ratio %d unsupported\n\r", ratio); /* don't print since this is function is also called by ISRs */ } } -- To view, visit https://gerrit.osmocom.org/9863 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I08f407d407a18dae3f360ddc64769ddfaeb5b559 Gerrit-Change-Number: 9863 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 08:58:50 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 08:58:50 +0000 Subject: Change in simtrace2[master]: LED: add short LED pulse blinking pattern Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9864 Change subject: LED: add short LED pulse blinking pattern ...................................................................... LED: add short LED pulse blinking pattern Change-Id: I0fdc2f902a3b92da6aa9b9c8500abae8a2f79447 --- M firmware/libboard/common/include/led.h M firmware/libboard/common/source/led.c 2 files changed, 19 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/64/9864/1 diff --git a/firmware/libboard/common/include/led.h b/firmware/libboard/common/include/led.h index d1db039..4e29c0e 100644 --- a/firmware/libboard/common/include/led.h +++ b/firmware/libboard/common/include/led.h @@ -13,9 +13,10 @@ BLINK_3O_30F = 3, BLINK_3O_1F_3O_30F = 4, BLINK_3O_1F_3O_1F_3O_30F= 5, - BLINK_200O_F = 6, - BLINK_600O_F = 7, - BLINK_CUSTOM = 8, + BLINK_2O_F = 6, + BLINK_200O_F = 7, + BLINK_600O_F = 8, + BLINK_CUSTOM = 9, _NUM_LED_BLINK }; diff --git a/firmware/libboard/common/source/led.c b/firmware/libboard/common/source/led.c index e4d2d57..00082e2 100644 --- a/firmware/libboard/common/source/led.c +++ b/firmware/libboard/common/source/led.c @@ -16,9 +16,9 @@ ASSERT(led < PIO_LISTSIZE(pinsLeds)); if (on) - PIO_Set(&pinsLeds[led]); - else PIO_Clear(&pinsLeds[led]); + else + PIO_Set(&pinsLeds[led]); } /* LED blinking code */ @@ -27,7 +27,7 @@ struct blink_state { /* duration of the state in ms */ uint16_t duration; - /* bringhtness of LED during the state */ + /* brightness of LED during the state */ uint8_t on; } __attribute__((packed)); @@ -54,6 +54,9 @@ static const struct blink_state bs_3on_1off_3on_1off_3on_30off[] = { { 300, 1 }, { 100, 0 }, { 300, 1 }, { 100, 0 }, { 300, 1 }, { 3000, 0 } }; +static const struct blink_state bs_2on_off[] = { + { 200, 1 }, { 0, 0 }, +}; static const struct blink_state bs_200on_off[] = { { 20000, 1 }, { 0, 0 }, }; @@ -94,6 +97,10 @@ .states = bs_3on_1off_3on_1off_3on_30off, .size = ARRAY_SIZE(bs_3on_1off_3on_1off_3on_30off), }, + [BLINK_2O_F] = { + .states = bs_2on_off, + .size = ARRAY_SIZE(bs_2on_off), + }, [BLINK_200O_F] = { .states = bs_200on_off, .size = ARRAY_SIZE(bs_200on_off), @@ -158,16 +165,16 @@ } static struct led_state led_state[] = { - [LED_GREEN] = { - .led = LED_GREEN, - .timer.cb = blink_tmr_cb, - .timer.data = &led_state[LED_GREEN], - }, [LED_RED] = { .led = LED_RED, .timer.cb = blink_tmr_cb, .timer.data = &led_state[LED_RED], }, + [LED_GREEN] = { + .led = LED_GREEN, + .timer.cb = blink_tmr_cb, + .timer.data = &led_state[LED_GREEN], + }, }; #endif /* PINS_LEDS */ -- To view, visit https://gerrit.osmocom.org/9864 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I0fdc2f902a3b92da6aa9b9c8500abae8a2f79447 Gerrit-Change-Number: 9864 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 08:58:50 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 08:58:50 +0000 Subject: Change in simtrace2[master]: sniff: print parsed ATR and PPS; use red LED to show main application... Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9865 Change subject: sniff: print parsed ATR and PPS; use red LED to show main application is running; use green LED to indicate activity (message parsed) ...................................................................... sniff: print parsed ATR and PPS; use red LED to show main application is running; use green LED to indicate activity (message parsed) Change-Id: I8e906bdbf2c91e608757ae442dfb241f981b8f1e --- M firmware/apps/trace/main.c M firmware/libcommon/source/sniffer.c 2 files changed, 56 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/65/9865/1 diff --git a/firmware/apps/trace/main.c b/firmware/apps/trace/main.c index 8c89907..a288a7b 100644 --- a/firmware/apps/trace/main.c +++ b/firmware/apps/trace/main.c @@ -124,8 +124,10 @@ enum confNum last_simtrace_config = simtrace_config; unsigned int i = 0; + /* Configure LED output (red = on, green = activity */ led_init(); - led_blink(LED_RED, BLINK_3O_5F); + led_blink(LED_RED, BLINK_ALWAYS_ON); + led_blink(LED_GREEN, BLINK_ALWAYS_OFF); /* Enable watchdog for 2000 ms, with no window */ WDT_Enable(WDT, WDT_MR_WDRSTEN | WDT_MR_WDDBGHLT | WDT_MR_WDIDLEHLT | diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index c71c491..15b2f84 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -189,7 +189,23 @@ /* save new state */ iso_state = iso_state_new; - TRACE_INFO("Changed to ISO 7816-3 state %u\n\r", iso_state); + //TRACE_INFO("Changed to ISO 7816-3 state %u\n\r", iso_state); /* don't print since this is function is also called by ISRs */ +} + +/*! Print current ATR */ +static void print_atr(void) +{ + if (ISO7816_S_IN_ATR!=iso_state) { + TRACE_WARNING("Can't print ATR in ISO 7816-3 state %u\n\r", iso_state); + return; + } + + led_blink(LED_GREEN, BLINK_2O_F); + printf("ATR: "); + for (uint8_t i=0; i=ARRAY_SIZE(atr)) { - TRACE_WARNING("ATR data overflow\n\r"); + TRACE_ERROR("ATR data overflow\n\r"); return; } @@ -273,13 +289,46 @@ } case ATR_S_WAIT_TCK: /* see ISO/IEC 7816-3:2006 section 8.2.5 */ /* we could verify the checksum, but we are just here to sniff */ - change_state(ISO7816_S_WAIT_APDU); /* go to next state */ + print_atr(); /* print ATR for info */ + change_state(ISO7816_S_WAIT_TPDU); /* go to next state */ break; default: TRACE_INFO("Unknown ATR state %u\n\r", atr_state); } } +/*! Print current PPS */ +static void print_pps(void) +{ + uint8_t *pps_cur; /* current PPS (request or response) */ + + /* sanity check */ + if (ISO7816_S_IN_PPS_REQ==iso_state) { + pps_cur = pps_req; + } else if (ISO7816_S_IN_PPS_RSP==iso_state) { + pps_cur = pps_rsp; + } else { + TRACE_ERROR("Can't print PPS in ISO 7816-3 state %u\n\r", iso_state); + return; + } + + led_blink(LED_GREEN, BLINK_2O_F); + printf("PPS %s : ", ISO7816_S_IN_PPS_REQ==iso_state ? "REQUEST" : "RESPONSE"); + printf("%02x ", pps_cur[0]); + printf("%02x ", pps_cur[1]); + if (pps_cur[1]&0x10) { + printf("%02x ", pps_cur[2]); + } + if (pps_cur[1]&0x20) { + printf("%02x ", pps_cur[3]); + } + if (pps_cur[1]&0x40) { + printf("%02x ", pps_cur[4]); + } + printf("%02x ", pps_cur[5]); + printf("\n\r"); +} + static void process_byte_pps(uint8_t byte) { uint8_t *pps_cur; /* current PPS (request or response) */ @@ -343,6 +392,7 @@ check ^= pps_cur[4]; } check ^= pps_cur[5]; + print_pps(); /* print PPS for info */ if (ISO7816_S_IN_PPS_REQ==iso_state) { if (0==check) { /* checksum is valid */ change_state(ISO7816_S_WAIT_PPS_RSP); /* go to next state */ -- To view, visit https://gerrit.osmocom.org/9865 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I8e906bdbf2c91e608757ae442dfb241f981b8f1e Gerrit-Change-Number: 9865 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 08:58:51 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 08:58:51 +0000 Subject: Change in simtrace2[master]: sniff: add TPDU parsing (TPDUs become APDUs on the upper layer) Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9866 Change subject: sniff: add TPDU parsing (TPDUs become APDUs on the upper layer) ...................................................................... sniff: add TPDU parsing (TPDUs become APDUs on the upper layer) Change-Id: I09d050d95bd2ab140fe6b4926a37278eb08cc347 --- M firmware/libcommon/source/sniffer.c 1 file changed, 141 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/66/9866/1 diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 15b2f84..0a813e3 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -54,8 +54,8 @@ ISO7816_S_RESET, /*!< in Reset */ ISO7816_S_WAIT_ATR, /*!< waiting for ATR to start */ ISO7816_S_IN_ATR, /*!< while we are receiving the ATR */ - ISO7816_S_WAIT_APDU, /*!< waiting for start of new APDU */ - ISO7816_S_IN_APDU, /*!< inside a single APDU */ + ISO7816_S_WAIT_TPDU, /*!< waiting for start of new TPDU */ + ISO7816_S_IN_TPDU, /*!< inside a single TPDU */ ISO7816_S_IN_PPS_REQ, /*!< while we are inside the PPS request */ ISO7816_S_WAIT_PPS_RSP, /*!< waiting for start of the PPS response */ ISO7816_S_IN_PPS_RSP, /*!< while we are inside the PPS request */ @@ -87,6 +87,23 @@ PPS_S_WAIT_PCK, /*!< check byte */ }; +/*! Transport Protocol Data Unit (TPDU) sub-states of ISO7816_S_IN_TPDU + * @note defined in ISO/IEC 7816-3:2006(E) section 10 and 12 + * @remark APDUs are formed by one or more command+response TPDUs + */ +enum tpdu_sniff_state { + TPDU_S_CLA, /*!< class byte */ + TPDU_S_INS, /*!< instruction byte */ + TPDU_S_P1, /*!< first parameter byte for the instruction */ + TPDU_S_P2, /*!< second parameter byte for the instruction */ + TPDU_S_P3, /*!< third parameter byte encoding the data length */ + TPDU_S_PROCEDURE, /*!< procedure byte (could also be SW1) */ + TPDU_S_DATA_REMAINING, /*!< remaining data bytes */ + TPDU_S_DATA_SINGLE, /*!< single data byte */ + TPDU_S_SW1, /*!< first status word */ + TPDU_S_SW2, /*!< second status word */ +}; + /*------------------------------------------------------------------------------ * Internal variables *------------------------------------------------------------------------------*/ @@ -141,6 +158,15 @@ uint8_t pps_req[MAX_PPS_SIZE]; /*! PPS response data */ uint8_t pps_rsp[MAX_PPS_SIZE]; +/*! TPDU state */ +enum tpdu_sniff_state tpdu_state; +/*! Final TPDU packet + * @note this is the complete command+response TPDU, including header, data, and status words + * @remark this does not include the procedure bytes + */ +uint8_t tpdu_packet[5+256+2]; +/*! Current index in TPDU packet */ +uint8_t tpdu_packet_i = 0; /*------------------------------------------------------------------------------ * Internal functions @@ -183,6 +209,10 @@ case ISO7816_S_IN_PPS_RSP: pps_state = PPS_S_WAIT_PPSS; break; + case ISO7816_S_WAIT_TPDU: + tpdu_state = TPDU_S_CLA; + tpdu_packet_i = 0; + break; default: break; } @@ -351,7 +381,7 @@ pps_state = PPS_S_WAIT_PPS0; /* go to next state */ } else { TRACE_INFO("Invalid PPSS received\n\r"); - change_state(ISO7816_S_WAIT_APDU); /* go back to APDU state */ + change_state(ISO7816_S_WAIT_TPDU); /* go back to TPDU state */ } break; case PPS_S_WAIT_PPS0: /*!< format byte */ @@ -397,7 +427,7 @@ if (0==check) { /* checksum is valid */ change_state(ISO7816_S_WAIT_PPS_RSP); /* go to next state */ } else { /* checksum is invalid */ - change_state(ISO7816_S_WAIT_APDU); /* go to next state */ + change_state(ISO7816_S_WAIT_TPDU); /* go to next state */ } } else if (ISO7816_S_IN_PPS_RSP==iso_state) { if (0==check) { /* checksum is valid */ @@ -415,7 +445,7 @@ } else { /* checksum is invalid */ TRACE_INFO("PPS negotiation failed\n\r"); } - change_state(ISO7816_S_WAIT_APDU); /* co to next state */ + change_state(ISO7816_S_WAIT_TPDU); /* go to next state */ } break; default: @@ -423,8 +453,107 @@ } } -static void process_byte_apdu(uint8_t byte) +/*! Print current TPDU */ +static void print_tpdu(void) { + if (ISO7816_S_IN_TPDU!=iso_state) { + TRACE_WARNING("Can't print TPDU in ISO 7816-3 state %u\n\r", iso_state); + return; + } + + led_blink(LED_GREEN, BLINK_2O_F); + printf("TPDU: "); + for (uint8_t i=0; i=ARRAY_SIZE(tpdu_packet)) { + TRACE_ERROR("TPDU data overflow\n\r"); + return; + } + + /* handle TPDU byte depending on current state */ + switch (tpdu_state) { + case TPDU_S_CLA: + if (0xff==byte) { + TRACE_WARNING("0xff is not a valid class byte\n\r"); + break; + } + tpdu_packet_i = 0; + tpdu_packet[tpdu_packet_i++] = byte; + tpdu_state = TPDU_S_INS; + break; + case TPDU_S_INS: + tpdu_packet_i = 1; + tpdu_packet[tpdu_packet_i++] = byte; + tpdu_state = TPDU_S_P1; + break; + case TPDU_S_P1: + tpdu_packet_i = 2; + tpdu_packet[tpdu_packet_i++] = byte; + tpdu_state = TPDU_S_P2; + break; + case TPDU_S_P2: + tpdu_packet_i = 3; + tpdu_packet[tpdu_packet_i++] = byte; + tpdu_state = TPDU_S_P3; + break; + case TPDU_S_P3: + tpdu_packet_i = 4; + tpdu_packet[tpdu_packet_i++] = byte; + tpdu_state = TPDU_S_PROCEDURE; + break; + case TPDU_S_PROCEDURE: + if (0x60==byte) { /* wait for next procedure byte */ + break; + } else if (tpdu_packet[1]==byte) { /* get all remaining data bytes */ + tpdu_state = TPDU_S_DATA_REMAINING; + break; + } else if ((~tpdu_packet[1])==byte) { /* get single data byte */ + tpdu_state = TPDU_S_DATA_SINGLE; + break; + } + case TPDU_S_SW1: + if ((0x60==(byte&0xf0)) || (0x90==(byte&0xf0))) { /* this procedure byte is SW1 */ + tpdu_packet[tpdu_packet_i++] = byte; + tpdu_state = TPDU_S_SW2; + } else { + TRACE_WARNING("invalid SW1 0x%02x\n\r", byte); + } + break; + case TPDU_S_SW2: + tpdu_packet[tpdu_packet_i++] = byte; + print_tpdu(); /* print TPDU for info */ + change_state(ISO7816_S_WAIT_TPDU); /* this is the end of the TPDU */ + break; + case TPDU_S_DATA_SINGLE: + case TPDU_S_DATA_REMAINING: + tpdu_packet[tpdu_packet_i++] = byte; + if (0==tpdu_packet[4]) { + if (5+256<=tpdu_packet_i) { + tpdu_state = TPDU_S_SW1; + } + } else { + if (5+tpdu_packet[4]<=tpdu_packet_i) { + tpdu_state = TPDU_S_SW1; + } + } + if (TPDU_S_DATA_SINGLE==tpdu_state) { + tpdu_state = TPDU_S_PROCEDURE; + } + break; + default: + TRACE_ERROR("unhandled TPDU state %u\n\r", tpdu_state); + } } static void check_sniffed_data(void) @@ -441,7 +570,7 @@ case ISO7816_S_IN_ATR: /* More ATR data incoming */ process_byte_atr(byte); break; - case ISO7816_S_WAIT_APDU: /* After the ATR we expect APDU or PPS data */ + case ISO7816_S_WAIT_TPDU: /* After the ATR we expect TPDU or PPS data */ case ISO7816_S_WAIT_PPS_RSP: if (byte == 0xff) { if (ISO7816_S_WAIT_PPS_RSP==iso_state) { @@ -452,8 +581,11 @@ process_byte_pps(byte); break; } - case ISO7816_S_IN_APDU: /* More APDU data incoming */ - process_byte_apdu(byte); + case ISO7816_S_IN_TPDU: /* More TPDU data incoming */ + if (ISO7816_S_WAIT_TPDU==iso_state) { + change_state(ISO7816_S_IN_TPDU); + } + process_byte_tpdu(byte); break; case ISO7816_S_IN_PPS_REQ: case ISO7816_S_IN_PPS_RSP: -- To view, visit https://gerrit.osmocom.org/9866 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I09d050d95bd2ab140fe6b4926a37278eb08cc347 Gerrit-Change-Number: 9866 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 08:58:51 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 08:58:51 +0000 Subject: Change in simtrace2[master]: sniff: add WT timeout detection using USART timeout (TC is not required) Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9867 Change subject: sniff: add WT timeout detection using USART timeout (TC is not required) ...................................................................... sniff: add WT timeout detection using USART timeout (TC is not required) Change-Id: I4ec6e812e7e1eb91005027d2e864fc315550d79c --- M firmware/libcommon/source/sniffer.c 1 file changed, 28 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/67/9867/1 diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 0a813e3..9d88c3d 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -193,11 +193,9 @@ switch (iso_state_new) { case ISO7816_S_RESET: update_fidi(sniff_usart.base, 0x11); /* reset baud rate to default Di/Fi values */ - // TODO disable USART and TC break; case ISO7816_S_WAIT_ATR: rbuf_reset(&sniff_buffer); /* reset buffer for new communication */ - // TODO enable USART and TC break; case ISO7816_S_IN_ATR: atr_i = 0; @@ -613,6 +611,30 @@ /* Store sniffed data into buffer (also clear interrupt */ rbuf_write(&sniff_buffer, byte); } + /* Verify it WT timeout occurred, to detect unresponsive card */ + if (csr & US_CSR_TIMEOUT) { + /* Stop timeout until next character is received */ + sniff_usart.base->US_CR |= US_CR_STTTO; + /* Use timeout to detect end of ATR/PPS/TPDU */ + switch (iso_state) { + case ISO7816_S_RESET: + case ISO7816_S_WAIT_ATR: + break; + case ISO7816_S_IN_ATR: + change_state(ISO7816_S_WAIT_ATR); + break; + case ISO7816_S_WAIT_TPDU: + break; + case ISO7816_S_WAIT_PPS_RSP: + case ISO7816_S_IN_TPDU: + case ISO7816_S_IN_PPS_REQ: + case ISO7816_S_IN_PPS_RSP: + change_state(ISO7816_S_WAIT_TPDU); + break; + default: + break; + } + } } /** PIO interrupt service routine to checks if the card reset line has changed @@ -699,8 +721,10 @@ ISO7816_Init(&sniff_usart, CLK_SLAVE); /* Only receive data when sniffing */ USART_SetReceiverEnabled(sniff_usart.base, 1); - /* Enable interrupt to indicate when data has been received */ - USART_EnableIt(sniff_usart.base, US_IER_RXRDY); + /* Enable Receiver time-out WT to detect unresponsive cards */ + sniff_usart.base->US_RTOR = 9600-12; /* -12 because the timer starts at the end of the 12 ETU frame */ + /* Enable interrupt to indicate when data has been received or timeout occurred */ + USART_EnableIt(sniff_usart.base, US_IER_RXRDY | US_IER_TIMEOUT); /* Enable interrupt requests for the USART peripheral */ NVIC_EnableIRQ(IRQ_USART_SIM); -- To view, visit https://gerrit.osmocom.org/9867 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I4ec6e812e7e1eb91005027d2e864fc315550d79c Gerrit-Change-Number: 9867 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 08:58:52 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 08:58:52 +0000 Subject: Change in simtrace2[master]: minor: fix typos in comment Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9868 Change subject: minor: fix typos in comment ...................................................................... minor: fix typos in comment Change-Id: I01b49e047a586dff449d4e134751108e391a8822 --- M firmware/libcommon/include/simtrace_prot.h 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/68/9868/1 diff --git a/firmware/libcommon/include/simtrace_prot.h b/firmware/libcommon/include/simtrace_prot.h index 91b569f..189264d 100644 --- a/firmware/libcommon/include/simtrace_prot.h +++ b/firmware/libcommon/include/simtrace_prot.h @@ -30,7 +30,7 @@ SIMTRACE_MSGC_GENERIC = 0, /* Card Emulation / Forwarding */ SIMTRACE_MSGC_CARDEM, - /* Modem Control (if modem is attached next to device */ + /* Modem Control (if modem is attached next to device) */ SIMTRACE_MSGC_MODEM, /* SIM protocol tracing */ SIMTRACE_MSGC_TRACE, @@ -107,7 +107,7 @@ SIMTRACE_CAP_LED_1, /* Has LED2 */ SIMTRACE_CAP_LED_2, - /* Has Single-Pole Dual-Throw (local/remote SIM */ + /* Has Single-Pole Dual-Throw (local/remote SIM) */ SIMTRACE_CAP_SPDT, /* Has Bus-Switch (trace / MITM) */ SIMTRACE_CAP_BUS_SWITCH, @@ -127,7 +127,7 @@ SIMTRACE_CAP_ASSERT_MODEM_RST, }; -/* vendor-specific capabilities of sysmoocm devices */ +/* vendor-specific capabilities of sysmocom devices */ enum simtrace_capability_vendor { /* Can erase a peer SAM3 controller */ SIMTRACE_CAP_SYSMO_QMOD_ERASE_PEER, @@ -253,7 +253,7 @@ /* SIMTRACE_MSGT_DT_MODEM_RESET */ struct st_modem_reset { - /* 0: de-assert reset, 1: assert reset, 2: poulse reset */ + /* 0: de-assert reset, 1: assert reset, 2: pulse reset */ uint8_t asserted; /* if above is '2', duration of pulse in ms */ uint16_t pulse_duration_msec; -- To view, visit https://gerrit.osmocom.org/9868 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I01b49e047a586dff449d4e134751108e391a8822 Gerrit-Change-Number: 9868 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 08:58:52 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 08:58:52 +0000 Subject: Change in simtrace2[master]: USB: add central file to define USB IDs, classes, and endpoints Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9869 Change subject: USB: add central file to define USB IDs, classes, and endpoints ...................................................................... USB: add central file to define USB IDs, classes, and endpoints Change-Id: Iba81f32a92c68a973e8e7adbc4c2a1064ba5290f --- M firmware/atmel_softpack_libraries/usb/device/dfu/dfu_desc.c M firmware/libboard/common/include/board_common.h M firmware/libboard/owhw/include/board.h M firmware/libboard/qmod/include/board.h M firmware/libboard/simtrace/include/board.h M firmware/libcommon/include/simtrace.h A firmware/libcommon/include/simtrace_usb.h M firmware/libcommon/source/mode_cardemu.c M firmware/libcommon/source/simtrace_iso7816.c M firmware/libcommon/source/usb.c M firmware/libcommon/source/usb_buf.c 11 files changed, 120 insertions(+), 105 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/69/9869/1 diff --git a/firmware/atmel_softpack_libraries/usb/device/dfu/dfu_desc.c b/firmware/atmel_softpack_libraries/usb/device/dfu/dfu_desc.c index f6d484c..75fded1 100644 --- a/firmware/atmel_softpack_libraries/usb/device/dfu/dfu_desc.c +++ b/firmware/atmel_softpack_libraries/usb/device/dfu/dfu_desc.c @@ -28,7 +28,7 @@ .bDeviceClass = 0, .bDeviceSubClass = 0, .bDeviceProtocol = 0, - .bMaxPacketSize0 = BOARD_USB_ENDPOINTS_MAXPACKETSIZE(0), + .bMaxPacketSize0 = USBEndpointDescriptor_MAXCTRLSIZE_FS, .idVendor = BOARD_USB_VENDOR_ID, .idProduct = BOARD_DFU_USB_PRODUCT_ID, .bcdDevice = BOARD_USB_RELEASE, diff --git a/firmware/libboard/common/include/board_common.h b/firmware/libboard/common/include/board_common.h index 64bdf0f..a995d88 100644 --- a/firmware/libboard/common/include/board_common.h +++ b/firmware/libboard/common/include/board_common.h @@ -108,21 +108,6 @@ // D+ has external pull-up #define BOARD_USB_PULLUP_EXTERNAL -#define BOARD_USB_NUMENDPOINTS 8 - -// FIXME: in all other cases return 0? -#define BOARD_USB_ENDPOINTS_MAXPACKETSIZE(i) (((i == 4) || (i == 5))? 512 : 64) -#define BOARD_USB_ENDPOINTS_BANKS(i) (((i == 0) || (i == 3)) ? 1 : 2) - -#define USB_VENDOR_OPENMOKO 0x1d50 -#define USB_PRODUCT_OWHW_SAM3_DFU 0x4001 /* was 0x4000 */ -#define USB_PRODUCT_OWHW_SAM3 0x4001 -#define USB_PRODUCT_QMOD_HUB 0x4002 -#define USB_PRODUCT_QMOD_SAM3_DFU 0x4004 /* was 0x4003 */ -#define USB_PRODUCT_QMOD_SAM3 0x4004 -#define USB_PRODUCT_SIMTRACE2_DFU 0x60e3 /* was 0x60e2 */ -#define USB_PRODUCT_SIMTRACE2 0x60e3 - #define BOARD_USB_DFU #define BOARD_DFU_BOOT_SIZE (16 * 1024) #define BOARD_DFU_RAM_SIZE (2 * 1024) diff --git a/firmware/libboard/owhw/include/board.h b/firmware/libboard/owhw/include/board.h index c770749..def3d8b 100644 --- a/firmware/libboard/owhw/include/board.h +++ b/firmware/libboard/owhw/include/board.h @@ -1,5 +1,6 @@ #pragma once #include "board_common.h" +#include "simtrace_usb.h" /** Name of the board */ #define BOARD_NAME "OWHW" diff --git a/firmware/libboard/qmod/include/board.h b/firmware/libboard/qmod/include/board.h index b8af8d8..2db94ab 100644 --- a/firmware/libboard/qmod/include/board.h +++ b/firmware/libboard/qmod/include/board.h @@ -1,5 +1,6 @@ #pragma once #include "board_common.h" +#include "simtrace_usb.h" #define LED_USIM1 LED_GREEN #define LED_USIM2 LED_RED diff --git a/firmware/libboard/simtrace/include/board.h b/firmware/libboard/simtrace/include/board.h index 891ab33..b21d4fb 100644 --- a/firmware/libboard/simtrace/include/board.h +++ b/firmware/libboard/simtrace/include/board.h @@ -1,5 +1,6 @@ #pragma once #include "board_common.h" +#include "simtrace_usb.h" /* Name of the board */ #define BOARD_NAME "SAM3S-SIMTRACE" diff --git a/firmware/libcommon/include/simtrace.h b/firmware/libcommon/include/simtrace.h index 3dfefe4..43dbf2a 100644 --- a/firmware/libcommon/include/simtrace.h +++ b/firmware/libcommon/include/simtrace.h @@ -5,21 +5,8 @@ #include "board.h" #include -/* Endpoint numbers */ -#define DATAOUT 1 -#define DATAIN 2 -#define INT 3 - #define BUFLEN 512 -#define PHONE_DATAOUT 4 -#define PHONE_DATAIN 5 -#define PHONE_INT 6 - -#define CARDEM_USIM2_DATAOUT DATAOUT -#define CARDEM_USIM2_DATAIN DATAIN -#define CARDEM_USIM2_INT INT - #define CLK_MASTER true #define CLK_SLAVE false diff --git a/firmware/libcommon/include/simtrace_usb.h b/firmware/libcommon/include/simtrace_usb.h new file mode 100644 index 0000000..b9ee5e2 --- /dev/null +++ b/firmware/libcommon/include/simtrace_usb.h @@ -0,0 +1,66 @@ +/* This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + * (C) 2018 by Kevin Redon + * All Rights Reserved + */ + +/* SIMtrace USB IDs */ +#define USB_VENDOR_OPENMOKO 0x1d50 +#define USB_PRODUCT_OWHW_SAM3_DFU 0x4001 /* was 0x4000 */ +#define USB_PRODUCT_OWHW_SAM3 0x4001 +#define USB_PRODUCT_QMOD_HUB 0x4002 +#define USB_PRODUCT_QMOD_SAM3_DFU 0x4004 /* was 0x4003 */ +#define USB_PRODUCT_QMOD_SAM3 0x4004 +#define USB_PRODUCT_SIMTRACE2_DFU 0x60e3 /* was 0x60e2 */ +#define USB_PRODUCT_SIMTRACE2 0x60e3 + +/* USB proprietary class */ +#define USB_CLASS_PROPRIETARY 0xff + +/* SIMtrace USB sub-classes */ +/*! Sniffer USB sub-class */ +#define SIMTRACE_SNIFFER_USB_SUBCLASS 1 +/*! Card-emulation USB sub-class */ +#define SIMTRACE_CARDEM_USB_SUBCLASS 2 + +/* Generic USB endpoint numbers */ +/*! Card-side USB data out (host to device) endpoint number */ +#define SIMTRACE_USB_EP_CARD_DATAOUT 1 +/*! Card-side USB data in (device to host) endpoint number */ +#define SIMTRACE_USB_EP_CARD_DATAIN 2 +/*! Card-side USB interrupt endpoint number */ +#define SIMTRACE_USB_EP_CARD_INT 3 +/*! Phone-side USB data out (host to device) endpoint number */ +#define SIMTRACE_USB_EP_PHONE_DATAOUT 4 +/*! Phone-side USB data in (device to host) endpoint number */ +#define SIMTRACE_USB_EP_PHONE_DATAIN 5 +/*! Phone-side USB interrupt endpoint number */ +#define SIMTRACE_USB_EP_PHONE_INT 6 + +/* Card-emulation USB endpoint numbers */ +/*! USIM1 USB data out (host to device) endpoint number */ +#define SIMTRACE_CARDEM_USB_EP_USIM1_DATAOUT 4 +/*! USIM1 USB data in (device to host) endpoint number */ +#define SIMTRACE_CARDEM_USB_EP_USIM1_DATAIN 5 +/*! USIM1 USB interrupt endpoint number */ +#define SIMTRACE_CARDEM_USB_EP_USIM1_INT 6 +/*! USIM2 USB data out (host to device) endpoint number */ +#define SIMTRACE_CARDEM_USB_EP_USIM2_DATAOUT 1 +/*! USIM2 USB data in (device to host) endpoint number */ +#define SIMTRACE_CARDEM_USB_EP_USIM2_DATAIN 2 +/*! USIM2 USB interrupt endpoint number */ +#define SIMTRACE_CARDEM_USB_EP_USIM2_INT 3 + +/*! Maximum number of endpoints */ +#define BOARD_USB_NUMENDPOINTS 6 diff --git a/firmware/libcommon/source/mode_cardemu.c b/firmware/libcommon/source/mode_cardemu.c index 7de67df..8051b25 100644 --- a/firmware/libcommon/source/mode_cardemu.c +++ b/firmware/libcommon/source/mode_cardemu.c @@ -10,6 +10,7 @@ #include #include "llist_irqsafe.h" #include "usb_buf.h" +#include "simtrace_usb.h" #include "simtrace_prot.h" #include "sim_switch.h" @@ -53,9 +54,9 @@ .id = ID_USART1, .state = USART_RCV }, - .ep_out = PHONE_DATAOUT, - .ep_in = PHONE_DATAIN, - .ep_int = PHONE_INT, + .ep_out = SIMTRACE_CARDEM_USB_EP_USIM1_DATAOUT, + .ep_in = SIMTRACE_CARDEM_USB_EP_USIM1_DATAIN, + .ep_int = SIMTRACE_CARDEM_USB_EP_USIM1_INT, #ifdef PIN_SET_USIM1_PRES .pin_insert = PIN_SET_USIM1_PRES, #endif @@ -68,9 +69,9 @@ .id = ID_USART0, .state = USART_RCV }, - .ep_out = CARDEM_USIM2_DATAOUT, - .ep_in = CARDEM_USIM2_DATAIN, - .ep_int = CARDEM_USIM2_INT, + .ep_out = SIMTRACE_CARDEM_USB_EP_USIM2_DATAOUT, + .ep_in = SIMTRACE_CARDEM_USB_EP_USIM2_DATAIN, + .ep_int = SIMTRACE_CARDEM_USB_EP_USIM2_INT, #ifdef PIN_SET_USIM2_PRES .pin_insert = PIN_SET_USIM2_PRES, #endif @@ -397,7 +398,7 @@ PIO_ConfigureIt(&pin_usim1_vcc, usim1_vcc_irqhandler); PIO_EnableIt(&pin_usim1_vcc); #endif /* DETECT_VCC_BY_ADC */ - cardem_inst[0].ch = card_emu_init(0, 2, 0, PHONE_DATAIN, PHONE_INT); + cardem_inst[0].ch = card_emu_init(0, 2, 0, SIMTRACE_CARDEM_USB_EP_USIM1_DATAIN, SIMTRACE_CARDEM_USB_EP_USIM1_INT); sim_switch_use_physical(0, 1); #ifdef CARDEMU_SECOND_UART @@ -412,7 +413,7 @@ PIO_ConfigureIt(&pin_usim2_vcc, usim2_vcc_irqhandler); PIO_EnableIt(&pin_usim2_vcc); #endif /* DETECT_VCC_BY_ADC */ - cardem_inst[1].ch = card_emu_init(1, 0, 1, CARDEM_USIM2_DATAIN, CARDEM_USIM2_INT); + cardem_inst[1].ch = card_emu_init(1, 0, 1, SIMTRACE_CARDEM_USB_EP_USIM2_DATAIN, SIMTRACE_CARDEM_USB_EP_USIM2_INT); sim_switch_use_physical(1, 1); #endif /* CARDEMU_SECOND_UART */ diff --git a/firmware/libcommon/source/simtrace_iso7816.c b/firmware/libcommon/source/simtrace_iso7816.c index fe8b88e..c1b2c82 100644 --- a/firmware/libcommon/source/simtrace_iso7816.c +++ b/firmware/libcommon/source/simtrace_iso7816.c @@ -33,6 +33,7 @@ #include "board.h" #include "simtrace.h" +#include "simtrace_usb.h" #include "ringbuffer.h" #include "iso7816_fidi.h" @@ -67,7 +68,7 @@ } if ((ret = - USBD_Write(PHONE_INT, "R", 1, + USBD_Write(SIMTRACE_USB_EP_PHONE_INT, "R", 1, (TransferCallback) & Callback_PhoneRST_ISR, 0)) != USBD_STATUS_SUCCESS) { TRACE_ERROR("USB err status: %d (%s)\n", ret, __FUNCTION__); diff --git a/firmware/libcommon/source/usb.c b/firmware/libcommon/source/usb.c index d317435..e929a05 100644 --- a/firmware/libcommon/source/usb.c +++ b/firmware/libcommon/source/usb.c @@ -33,15 +33,13 @@ #include "board.h" #include "simtrace.h" +#include "simtrace_usb.h" #include "utils.h" #include #include #include -#define SIMTRACE_SUBCLASS_SNIFFER 1 -#define SIMTRACE_SUBCLASS_CARDEM 2 - /*------------------------------------------------------------------------------ * USB String descriptors *------------------------------------------------------------------------------*/ @@ -94,8 +92,8 @@ .bInterfaceNumber = 0, .bAlternateSetting = 0, .bNumEndpoints = 3, - .bInterfaceClass = 0xff, - .bInterfaceSubClass = SIMTRACE_SUBCLASS_SNIFFER, + .bInterfaceClass = USB_CLASS_PROPRIETARY, + .bInterfaceSubClass = SIMTRACE_SNIFFER_USB_SUBCLASS, .bInterfaceProtocol = 0, .iInterface = SNIFFER_CONF_STR, }, @@ -105,11 +103,9 @@ .bDescriptorType = USBGenericDescriptor_ENDPOINT, .bEndpointAddress = USBEndpointDescriptor_ADDRESS( USBEndpointDescriptor_OUT, - PHONE_DATAOUT), + SIMTRACE_USB_EP_CARD_DATAOUT), .bmAttributes = USBEndpointDescriptor_BULK, - .wMaxPacketSize = MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE( - PHONE_DATAOUT), - USBEndpointDescriptor_MAXBULKSIZE_FS), + .wMaxPacketSize = USBEndpointDescriptor_MAXBULKSIZE_FS, .bInterval = 0, }, /* Bulk-IN endpoint descriptor */ @@ -118,11 +114,9 @@ .bDescriptorType = USBGenericDescriptor_ENDPOINT, .bEndpointAddress = USBEndpointDescriptor_ADDRESS( USBEndpointDescriptor_IN, - PHONE_DATAIN), + SIMTRACE_USB_EP_CARD_DATAIN), .bmAttributes = USBEndpointDescriptor_BULK, - .wMaxPacketSize = MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE( - PHONE_DATAIN), - USBEndpointDescriptor_MAXBULKSIZE_FS), + .wMaxPacketSize = USBEndpointDescriptor_MAXBULKSIZE_FS, .bInterval = 0, }, // Notification endpoint descriptor @@ -131,11 +125,9 @@ .bDescriptorType = USBGenericDescriptor_ENDPOINT, .bEndpointAddress = USBEndpointDescriptor_ADDRESS( USBEndpointDescriptor_IN, - PHONE_INT), + SIMTRACE_USB_EP_CARD_INT), .bmAttributes = USBEndpointDescriptor_INTERRUPT, - .wMaxPacketSize = MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE( - PHONE_INT), - USBEndpointDescriptor_MAXINTERRUPTSIZE_FS), + .wMaxPacketSize = USBEndpointDescriptor_MAXINTERRUPTSIZE_FS, .bInterval = 0x10, }, DFURT_IF_DESCRIPTOR(1, 0), @@ -205,9 +197,7 @@ USBEndpointDescriptor_ADDRESS(USBEndpointDescriptor_OUT, CCID_EPT_DATA_OUT), .bmAttributes = USBEndpointDescriptor_BULK, - .wMaxPacketSize = MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE( - CCID_EPT_DATA_OUT), - USBEndpointDescriptor_MAXBULKSIZE_FS), + .wMaxPacketSize = USBEndpointDescriptor_MAXBULKSIZE_FS, .bInterval = 0x00, }, // Bulk-IN endpoint descriptor @@ -218,9 +208,7 @@ USBEndpointDescriptor_ADDRESS(USBEndpointDescriptor_IN, CCID_EPT_DATA_IN), .bmAttributes = USBEndpointDescriptor_BULK, - .wMaxPacketSize = MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE( - CCID_EPT_DATA_IN), - USBEndpointDescriptor_MAXBULKSIZE_FS), + .wMaxPacketSize = USBEndpointDescriptor_MAXBULKSIZE_FS), .bInterval = 0x00, }, // Notification endpoint descriptor @@ -231,9 +219,7 @@ USBEndpointDescriptor_ADDRESS(USBEndpointDescriptor_IN, CCID_EPT_NOTIFICATION), .bmAttributes = USBEndpointDescriptor_INTERRUPT, - .wMaxPacketSize = MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE( - CCID_EPT_NOTIFICATION), - USBEndpointDescriptor_MAXINTERRUPTSIZE_FS), + .wMaxPacketSize = USBEndpointDescriptor_MAXINTERRUPTSIZE_FS, .bInterval = 0x10, }, DFURT_IF_DESCRIPTOR(1, 0), @@ -282,8 +268,8 @@ .bInterfaceNumber = 0, .bAlternateSetting = 0, .bNumEndpoints = 3, - .bInterfaceClass = 0xff, - .bInterfaceSubClass = SIMTRACE_SUBCLASS_CARDEM, + .bInterfaceClass = USB_CLASS_PROPRIETARY, + .bInterfaceSubClass = SIMTRACE_CARDEM_USB_SUBCLASS, .bInterfaceProtocol = 0, .iInterface = CARDEM_USIM1_INTF_STR, }, @@ -293,10 +279,9 @@ .bDescriptorType = USBGenericDescriptor_ENDPOINT, .bEndpointAddress = USBEndpointDescriptor_ADDRESS( USBEndpointDescriptor_OUT, - PHONE_DATAOUT), + SIMTRACE_CARDEM_USB_EP_USIM1_DATAOUT), .bmAttributes = USBEndpointDescriptor_BULK, - .wMaxPacketSize = MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE(PHONE_DATAOUT), - USBEndpointDescriptor_MAXBULKSIZE_FS), + .wMaxPacketSize = USBEndpointDescriptor_MAXBULKSIZE_FS, .bInterval = 0 /* Must be 0 for full-speed bulk endpoints */ }, /* Bulk-IN endpoint descriptor */ @@ -305,10 +290,9 @@ .bDescriptorType = USBGenericDescriptor_ENDPOINT, .bEndpointAddress = USBEndpointDescriptor_ADDRESS( USBEndpointDescriptor_IN, - PHONE_DATAIN), + SIMTRACE_CARDEM_USB_EP_USIM1_DATAIN), .bmAttributes = USBEndpointDescriptor_BULK, - .wMaxPacketSize = MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE(PHONE_DATAIN), - USBEndpointDescriptor_MAXBULKSIZE_FS), + .wMaxPacketSize = USBEndpointDescriptor_MAXBULKSIZE_FS, .bInterval = 0 /* Must be 0 for full-speed bulk endpoints */ }, /* Notification endpoint descriptor */ @@ -317,10 +301,9 @@ .bDescriptorType = USBGenericDescriptor_ENDPOINT, .bEndpointAddress = USBEndpointDescriptor_ADDRESS( USBEndpointDescriptor_IN, - PHONE_INT), + SIMTRACE_CARDEM_USB_EP_USIM1_INT), .bmAttributes = USBEndpointDescriptor_INTERRUPT, - .wMaxPacketSize = MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE(PHONE_INT), - USBEndpointDescriptor_MAXINTERRUPTSIZE_FS), + .wMaxPacketSize = USBEndpointDescriptor_MAXINTERRUPTSIZE_FS, .bInterval = 0x10 }, #ifdef CARDEMU_SECOND_UART @@ -331,8 +314,8 @@ .bInterfaceNumber = 1, .bAlternateSetting = 0, .bNumEndpoints = 3, - .bInterfaceClass = 0xff, - .bInterfaceSubClass = SIMTRACE_SUBCLASS_CARDEM, + .bInterfaceClass = USB_CLASS_PROPRIETARY, + .bInterfaceSubClass = SIMTRACE_CARDEM_USB_SUBCLASS, .bInterfaceProtocol = 0, .iInterface = CARDEM_USIM2_INTF_STR, }, @@ -342,10 +325,9 @@ .bDescriptorType = USBGenericDescriptor_ENDPOINT, .bEndpointAddress = USBEndpointDescriptor_ADDRESS( USBEndpointDescriptor_OUT, - CARDEM_USIM2_DATAOUT), + SIMTRACE_CARDEM_USB_EP_USIM2_DATAOUT), .bmAttributes = USBEndpointDescriptor_BULK, - .wMaxPacketSize = MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE(CARDEM_USIM2_DATAOUT), - USBEndpointDescriptor_MAXBULKSIZE_FS), + .wMaxPacketSize = USBEndpointDescriptor_MAXBULKSIZE_FS, .bInterval = 0 /* Must be 0 for full-speed bulk endpoints */ } , @@ -355,10 +337,9 @@ .bDescriptorType = USBGenericDescriptor_ENDPOINT, .bEndpointAddress = USBEndpointDescriptor_ADDRESS( USBEndpointDescriptor_IN, - CARDEM_USIM2_DATAIN), + SIMTRACE_CARDEM_USB_EP_USIM2_DATAIN), .bmAttributes = USBEndpointDescriptor_BULK, - .wMaxPacketSize = MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE(CARDEM_USIM2_DATAIN), - USBEndpointDescriptor_MAXBULKSIZE_FS), + .wMaxPacketSize = USBEndpointDescriptor_MAXBULKSIZE_FS, .bInterval = 0 /* Must be 0 for full-speed bulk endpoints */ }, /* Notification endpoint descriptor */ @@ -367,10 +348,9 @@ .bDescriptorType = USBGenericDescriptor_ENDPOINT, .bEndpointAddress = USBEndpointDescriptor_ADDRESS( USBEndpointDescriptor_IN, - CARDEM_USIM2_INT), + SIMTRACE_CARDEM_USB_EP_USIM2_INT), .bmAttributes = USBEndpointDescriptor_INTERRUPT, - .wMaxPacketSize = MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE(CARDEM_USIM2_INT), - USBEndpointDescriptor_MAXINTERRUPTSIZE_FS), + .wMaxPacketSize = USBEndpointDescriptor_MAXINTERRUPTSIZE_FS, .bInterval = 0x10, }, DFURT_IF_DESCRIPTOR(2, 0), @@ -466,9 +446,7 @@ USBEndpointDescriptor_ADDRESS(USBEndpointDescriptor_OUT, CCID_EPT_DATA_OUT), .bmAttributes = USBEndpointDescriptor_BULK, - .wMaxPacketSize = MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE( - CCID_EPT_DATA_OUT), - USBEndpointDescriptor_MAXBULKSIZE_FS), + .wMaxPacketSize = USBEndpointDescriptor_MAXBULKSIZE_FS, .bInterval = 0x00, }, // Bulk-IN endpoint descriptor @@ -479,9 +457,7 @@ USBEndpointDescriptor_ADDRESS(USBEndpointDescriptor_IN, CCID_EPT_DATA_IN), .bmAttributes = USBEndpointDescriptor_BULK, - .wMaxPacketSize = MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE( - CCID_EPT_DATA_IN), - USBEndpointDescriptor_MAXBULKSIZE_FS), + .wMaxPacketSize = USBEndpointDescriptor_MAXBULKSIZE_FS, .bInterval = 0x00, }, // Notification endpoint descriptor @@ -492,9 +468,7 @@ USBEndpointDescriptor_ADDRESS(USBEndpointDescriptor_IN, CCID_EPT_NOTIFICATION), .bmAttributes = USBEndpointDescriptor_INTERRUPT, - .wMaxPacketSize = MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE( - CCID_EPT_NOTIFICATION), - USBEndpointDescriptor_MAXINTERRUPTSIZE_FS), + .wMaxPacketSize = USBEndpointDescriptor_MAXINTERRUPTSIZE_FS, .bInterval = 0x10, }, @@ -516,10 +490,9 @@ .bDescriptorType = USBGenericDescriptor_ENDPOINT, .bEndpointAddress = USBEndpointDescriptor_ADDRESS( USBEndpointDescriptor_OUT, - PHONE_DATAOUT), + SIMTRACE_USB_EP_PHONE_DATAOUT), .bmAttributes = USBEndpointDescriptor_BULK, - .wMaxPacketSize = MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE(PHONE_DATAOUT), - USBEndpointDescriptor_MAXBULKSIZE_FS), + .wMaxPacketSize = USBEndpointDescriptor_MAXBULKSIZE_FS, .bInterval = 0, /* Must be 0 for full-speed bulk endpoints */ }, /* Bulk-IN endpoint descriptor */ @@ -528,10 +501,9 @@ .bDescriptorType = USBGenericDescriptor_ENDPOINT, .bEndpointAddress = USBEndpointDescriptor_ADDRESS( USBEndpointDescriptor_IN, - PHONE_DATAIN), + SIMTRACE_USB_EP_PHONE_DATAIN), .bmAttributes = USBEndpointDescriptor_BULK, - .wMaxPacketSize = MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE(PHONE_DATAIN), - USBEndpointDescriptor_MAXBULKSIZE_FS), + .wMaxPacketSize = USBEndpointDescriptor_MAXBULKSIZE_FS, .bInterval = 0, /* Must be 0 for full-speed bulk endpoints */ }, /* Notification endpoint descriptor */ @@ -540,10 +512,9 @@ .bDescriptorType = USBGenericDescriptor_ENDPOINT, .bEndpointAddress = USBEndpointDescriptor_ADDRESS( USBEndpointDescriptor_IN, - PHONE_INT), + SIMTRACE_USB_EP_PHONE_INT), .bmAttributes = USBEndpointDescriptor_INTERRUPT, - .wMaxPacketSize = MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE(PHONE_INT), - USBEndpointDescriptor_MAXINTERRUPTSIZE_FS), + .wMaxPacketSize = USBEndpointDescriptor_MAXINTERRUPTSIZE_FS, .bInterval = 0x10 }, DFURT_IF_DESCRIPTOR(2, 0), @@ -573,7 +544,7 @@ .bDeviceClass = 0, .bDeviceSubClass = 0, .bDeviceProtocol = 0, - .bMaxPacketSize0 = BOARD_USB_ENDPOINTS_MAXPACKETSIZE(0), + .bMaxPacketSize0 = 64, .idVendor = BOARD_USB_VENDOR_ID, .idProduct = BOARD_USB_PRODUCT_ID, .bcdDevice = 2, /* Release number */ diff --git a/firmware/libcommon/source/usb_buf.c b/firmware/libcommon/source/usb_buf.c index 848fd24..b8d4dd7 100644 --- a/firmware/libcommon/source/usb_buf.c +++ b/firmware/libcommon/source/usb_buf.c @@ -1,6 +1,7 @@ #include "board.h" #include "trace.h" #include "usb_buf.h" +#include "simtrace_usb.h" #include #include -- To view, visit https://gerrit.osmocom.org/9869 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iba81f32a92c68a973e8e7adbc4c2a1064ba5290f Gerrit-Change-Number: 9869 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 08:58:53 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 08:58:53 +0000 Subject: Change in simtrace2[master]: host usb_util fix: used provided class, sub-class, and interfave when... Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9870 Change subject: host usb_util fix: used provided class, sub-class, and interfave when finding matching interfaces ...................................................................... host usb_util fix: used provided class, sub-class, and interfave when finding matching interfaces Change-Id: Ibc06e751e6ca0f9e9a40d82c4eeddfb975240f91 --- M host/libusb_util.c 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/70/9870/1 diff --git a/host/libusb_util.c b/host/libusb_util.c index 3236e41..5ee685e 100644 --- a/host/libusb_util.c +++ b/host/libusb_util.c @@ -130,11 +130,11 @@ for (k = 0; k < intf->num_altsetting; k++) { const struct libusb_interface_descriptor *if_desc; if_desc = &intf->altsetting[k]; - if (class > 0 && if_desc->bInterfaceClass != class) + if (class >= 0 && if_desc->bInterfaceClass != class) continue; - if (sub_class > 0 && if_desc->bInterfaceSubClass != sub_class) + if (sub_class >= 0 && if_desc->bInterfaceSubClass != sub_class) continue; - if (protocol > 0 && if_desc->bInterfaceProtocol != protocol) + if (protocol >= 0 && if_desc->bInterfaceProtocol != protocol) continue; /* MATCH! */ out[out_idx].usb_dev = dev; @@ -197,7 +197,7 @@ dev_desc.idVendor, dev_desc.idProduct, addr); #endif - rc = dev_find_matching_interfaces(*dev, 255, 2, -1, out_cur, out_len_remain); + rc = dev_find_matching_interfaces(*dev, class, sub_class, protocol, out_cur, out_len_remain); if (rc < 0) continue; out_cur += rc; -- To view, visit https://gerrit.osmocom.org/9870 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ibc06e751e6ca0f9e9a40d82c4eeddfb975240f91 Gerrit-Change-Number: 9870 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 08:58:53 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 08:58:53 +0000 Subject: Change in simtrace2[master]: host USB: use central SIMtrace USB ID definition header Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9871 Change subject: host USB: use central SIMtrace USB ID definition header ...................................................................... host USB: use central SIMtrace USB ID definition header Change-Id: Id18e64fba0a2c308a8aef7d3865200bf0237cae9 --- M host/simtrace2_usb.c A host/simtrace_usb.h 2 files changed, 5 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/71/9871/1 diff --git a/host/simtrace2_usb.c b/host/simtrace2_usb.c index 6cbb8b7..2016670 100644 --- a/host/simtrace2_usb.c +++ b/host/simtrace2_usb.c @@ -6,15 +6,7 @@ #include #include "libusb_util.h" - -#define USB_VENDOR_OPENMOKO 0x1d50 -#define USB_PRODUCT_OWHW_SAM3_DFU 0x4000 -#define USB_PRODUCT_OWHW_SAM3 0x4001 -#define USB_PRODUCT_QMOD_HUB 0x4002 -#define USB_PRODUCT_QMOD_SAM3_DFU 0x4003 -#define USB_PRODUCT_QMOD_SAM3 0x4004 -#define USB_PRODUCT_SIMTRACE2_DFU 0x60e2 -#define USB_PRODUCT_SIMTRACE2 0x60e3 +#include "simtrace_usb.h" static const struct dev_id compatible_dev_ids[] = { { USB_VENDOR_OPENMOKO, USB_PRODUCT_OWHW_SAM3 }, @@ -23,15 +15,15 @@ { 0, 0 } }; -//libusb_get_string_descriptor_ascii(hdl, idx, *data, len) - static int find_devices(void) { struct usb_interface_match ifm[16]; int rc, i, num_interfaces; + /* scan for USB devices matching SIMtrace USB ID with proprietary class */ rc = usb_match_interfaces(NULL, compatible_dev_ids, - 255, 2, -1, ifm, ARRAY_SIZE(ifm)); + USB_CLASS_PROPRIETARY, -1, -1, ifm, ARRAY_SIZE(ifm)); + printf("USB matches: %d\n", rc); if (rc < 0) return rc; num_interfaces = rc; diff --git a/host/simtrace_usb.h b/host/simtrace_usb.h new file mode 120000 index 0000000..f1e0982 --- /dev/null +++ b/host/simtrace_usb.h @@ -0,0 +1 @@ +../firmware/libcommon/include/simtrace_usb.h \ No newline at end of file -- To view, visit https://gerrit.osmocom.org/9871 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id18e64fba0a2c308a8aef7d3865200bf0237cae9 Gerrit-Change-Number: 9871 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 08:58:54 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 08:58:54 +0000 Subject: Change in simtrace2[master]: USB device: add USB message structure for sniffer communication Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9872 Change subject: USB device: add USB message structure for sniffer communication ...................................................................... USB device: add USB message structure for sniffer communication Change-Id: Id2c6f32ade2fec9b9ef91bd8c5e1fd195f2d7351 --- M firmware/libcommon/include/simtrace_prot.h 1 file changed, 52 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/72/9872/1 diff --git a/firmware/libcommon/include/simtrace_prot.h b/firmware/libcommon/include/simtrace_prot.h index 189264d..a43ac72 100644 --- a/firmware/libcommon/include/simtrace_prot.h +++ b/firmware/libcommon/include/simtrace_prot.h @@ -1,7 +1,3 @@ -#pragma once - -#include - /* SIMtrace2 USB protocol */ /* (C) 2015-2017 by Harald Welte @@ -21,6 +17,10 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ +#pragma once + +#include +#include /*********************************************************************** * COMMON HEADER @@ -32,8 +32,8 @@ SIMTRACE_MSGC_CARDEM, /* Modem Control (if modem is attached next to device) */ SIMTRACE_MSGC_MODEM, - /* SIM protocol tracing */ - SIMTRACE_MSGC_TRACE, + /* Reader/phone-car/SIM communication sniff */ + SIMTRACE_MSGC_SNIFF, /* first vendor-specific request */ _SIMTRACE_MGSC_VENDOR_FIRST = 127, @@ -74,10 +74,18 @@ SIMTRACE_MSGT_BD_MODEM_STATUS, }; -/* SIMTRACE_MSGC_TRACE */ -enum simtrace_msg_type_trace { - /* FIXME */ - _dummy, +/* SIMTRACE_MSGC_SNIFF */ +enum simtrace_msg_type_sniff { + /* Status change (card inserted, reset, ...) */ + SIMTRACE_MSGT_SNIFF_CHANGE = 0, + /* Fi/Di baudrate change */ + SIMTRACE_MSGT_SNIFF_FIDI, + /* ATR data */ + SIMTRACE_MSGT_SNIFF_ATR, + /* PPS (request or response) data */ + SIMTRACE_MSGT_SNIFF_PPS, + /* TPDU data */ + SIMTRACE_MSGT_SNIFF_TPDU, }; /* common message header */ @@ -92,7 +100,7 @@ } __attribute__ ((packed)); /*********************************************************************** - * CARD EMULATOR / FORWARDER + * Capabilities ***********************************************************************/ /* generic capabilities */ @@ -137,7 +145,6 @@ SIMTRACE_CAP_SYSMO_QMOD_RESET_HUB, }; - /* SIMTRACE_CMD_BD_BOARD_INFO */ struct simtrace_board_info { struct { @@ -276,3 +283,36 @@ /* bit-field of changed status bits */ uint8_t changed_mask; } __attribute__((packed)); + +/*********************************************************************** + * SNIFF + ***********************************************************************/ + +/* SIMTRACE_MSGT_SNIFF_CHANGE flags */ +#define SNIFF_CHANGE_FLAG_CARD_INSERT (1<<0) +#define SNIFF_CHANGE_FLAG_CARD_EJECT (1<<1) +#define SNIFF_CHANGE_FLAG_RESET_HOLD (1<<2) +#define SNIFF_CHANGE_FLAG_RESET_RELEASE (1<<3) +#define SNIFF_CHANGE_FLAG_TIMEOUT_WT (1<<4) + +/* SIMTRACE_MSGT_SNIFF_CHANGE */ +struct sniff_change { + /* SIMTRACE_MSGT_SNIFF_CHANGE flags */ + uint32_t flags; +} __attribute__ ((packed)); + +/* SIMTRACE_MSGT_SNIFF_FIDI */ +struct sniff_fidi { + /* Fi/Di values as encoded in TA1 */ + uint8_t fidi; +} __attribute__ ((packed)); + +/* SIMTRACE_MSGT_SNIFF_ATR, SIMTRACE_MSGT_SNIFF_PPS, SIMTRACE_MSGT_SNIFF_TPDU */ +struct sniff_data { + /* if the data is complete (an error might have occurred during transmission */ + bool complete; + /* data length */ + uint16_t length; + /* data */ + uint8_t data[0]; +} __attribute__ ((packed)); -- To view, visit https://gerrit.osmocom.org/9872 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id2c6f32ade2fec9b9ef91bd8c5e1fd195f2d7351 Gerrit-Change-Number: 9872 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 08:58:54 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 08:58:54 +0000 Subject: Change in simtrace2[master]: sniffer USB: implement USB communication and send parsed messages Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9873 Change subject: sniffer USB: implement USB communication and send parsed messages ...................................................................... sniffer USB: implement USB communication and send parsed messages Change-Id: Ice7817480705f2124b08c1ff9a8826558b6d8b2b --- M firmware/libcommon/source/sniffer.c 1 file changed, 234 insertions(+), 63 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/73/9873/1 diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 9d88c3d..88ac84f 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -34,6 +34,13 @@ #include #include "utils.h" #include "iso7816_fidi.h" +/* USB related libraries */ +#include "osmocom/core/linuxlist.h" +#include "osmocom/core/msgb.h" +#include "llist_irqsafe.h" +#include "usb_buf.h" +#include "simtrace_usb.h" +#include "simtrace_prot.h" /*------------------------------------------------------------------------------ * Internal definitions @@ -133,6 +140,9 @@ /*! Ring buffer to store sniffer communication data */ static struct ringbuf sniff_buffer; +/* Flags to know is the card status changed (see SIMTRACE_MSGT_DT_SNIFF_CHANGE flags) */ +volatile uint32_t change_flags = 0; + /* ISO 7816 variables */ /*! ISO 7816-3 state */ enum iso7816_3_sniff_state iso_state = ISO7816_S_RESET; @@ -178,6 +188,35 @@ */ static const uint8_t convention_convert_lut[256] = { 0xff, 0x7f, 0xbf, 0x3f, 0xdf, 0x5f, 0x9f, 0x1f, 0xef, 0x6f, 0xaf, 0x2f, 0xcf, 0x4f, 0x8f, 0x0f, 0xf7, 0x77, 0xb7, 0x37, 0xd7, 0x57, 0x97, 0x17, 0xe7, 0x67, 0xa7, 0x27, 0xc7, 0x47, 0x87, 0x07, 0xfb, 0x7b, 0xbb, 0x3b, 0xdb, 0x5b, 0x9b, 0x1b, 0xeb, 0x6b, 0xab, 0x2b, 0xcb, 0x4b, 0x8b, 0x0b, 0xf3, 0x73, 0xb3, 0x33, 0xd3, 0x53, 0x93, 0x13, 0xe3, 0x63, 0xa3, 0x23, 0xc3, 0x43, 0x83, 0x03, 0xfd, 0x7d, 0xbd, 0x3d, 0xdd, 0x5d, 0x9d, 0x1d, 0xed, 0x6d, 0xad, 0x2d, 0xcd, 0x4d, 0x8d, 0x0d, 0xf5, 0x75, 0xb5, 0x35, 0xd5, 0x55, 0x95, 0x15, 0xe5, 0x65, 0xa5, 0x25, 0xc5, 0x45, 0x85, 0x05, 0xf9, 0x79, 0xb9, 0x39, 0xd9, 0x59, 0x99, 0x19, 0xe9, 0x69, 0xa9, 0x29, 0xc9, 0x49, 0x89, 0x09, 0xf1, 0x71, 0xb1, 0x31, 0xd1, 0x51, 0x91, 0x11, 0xe1, 0x61, 0xa1, 0x21, 0xc1, 0x41, 0x81, 0x01, 0xfe, 0x7e, 0xbe, 0x3e, 0xde, 0x5e, 0x9e, 0x1e, 0xee, 0x6e, 0xae, 0x2e, 0xce, 0x4e, 0x8e, 0x0e, 0xf6, 0x76, 0xb6, 0x36, 0xd6, 0x56, 0x96, 0x16, 0xe6, 0x66, 0xa6, 0x26, 0xc6, 0x46, 0x86, 0x06, 0xfa, 0x7a, 0xba, 0x3a, 0xda, 0x5a, 0x9a, 0x1a, 0xea, 0x6a, 0xaa, 0x2a, 0xca, 0x4a, 0x8a, 0x0a, 0xf2, 0x72, 0xb2, 0x32, 0xd2, 0x52, 0x92, 0x12, 0xe2, 0x62, 0xa2, 0x22, 0xc2, 0x42, 0x82, 0x02, 0xfc, 0x7c, 0xbc, 0x3c, 0xdc, 0x5c, 0x9c, 0x1c, 0xec, 0x6c, 0xac, 0x2c, 0xcc, 0x4c, 0x8c, 0x0c, 0xf4, 0x74, 0xb4, 0x34, 0xd4, 0x54, 0x94, 0x14, 0xe4, 0x64, 0xa4, 0x24, 0xc4, 0x44, 0x84, 0x04, 0xf8, 0x78, 0xb8, 0x38, 0xd8, 0x58, 0x98, 0x18, 0xe8, 0x68, 0xa8, 0x28, 0xc8, 0x48, 0x88, 0x08, 0xf0, 0x70, 0xb0, 0x30, 0xd0, 0x50, 0x90, 0x10, 0xe0, 0x60, 0xa0, 0x20, 0xc0, 0x40, 0x80, 0x00, }; +/*! Send card change flags over USB + * @param[in] flags change flags corresponding to SIMTRACE_MSGT_SNIFF_CHANGE + */ +static void usb_send_change(uint32_t flags) +{ + /* Check flags */ + if(0==flags) { /* no changes */ + return; + } + + /* Send message over USB */ + struct msgb *usb_msg = usb_buf_alloc(SIMTRACE_USB_EP_CARD_DATAIN); + if (!usb_msg) { + return; + } + struct simtrace_msg_hdr *usb_msg_header; + usb_msg->l1h = msgb_put(usb_msg, sizeof(*usb_msg_header)); + usb_msg_header = (struct simtrace_msg_hdr *) usb_msg->l1h; + memset(usb_msg_header, 0, sizeof(*usb_msg_header)); + usb_msg_header->msg_class = SIMTRACE_MSGC_SNIFF; + usb_msg_header->msg_type = SIMTRACE_MSGT_SNIFF_CHANGE; + usb_msg->l2h = usb_msg->l1h + sizeof(*usb_msg_header); + struct sniff_change *usb_sniff_change; + usb_sniff_change = (struct sniff_change *) msgb_put(usb_msg, sizeof(*usb_sniff_change)); + usb_sniff_change->flags = flags; + usb_msg_header->msg_len = msgb_length(usb_msg); + usb_buf_submit(usb_msg); +} + /*! Update the ISO 7816-3 state * @param[in] iso_state_new new ISO 7816-3 state to update to */ @@ -193,9 +232,11 @@ switch (iso_state_new) { case ISO7816_S_RESET: update_fidi(sniff_usart.base, 0x11); /* reset baud rate to default Di/Fi values */ + usb_send_change(SNIFF_CHANGE_FLAG_RESET_HOLD); /* send reset change to host software over USB */ break; case ISO7816_S_WAIT_ATR: rbuf_reset(&sniff_buffer); /* reset buffer for new communication */ + usb_send_change(SNIFF_CHANGE_FLAG_RESET_RELEASE); /* send reset change to host software over USB */ break; case ISO7816_S_IN_ATR: atr_i = 0; @@ -220,20 +261,51 @@ //TRACE_INFO("Changed to ISO 7816-3 state %u\n\r", iso_state); /* don't print since this is function is also called by ISRs */ } -/*! Print current ATR */ -static void print_atr(void) +/*! Send current ATR over USB + * @note Also print the ATR over serial + */ +static void usb_send_atr(void) { + /* Check state */ if (ISO7816_S_IN_ATR!=iso_state) { TRACE_WARNING("Can't print ATR in ISO 7816-3 state %u\n\r", iso_state); return; } + if (atr_i>=ARRAY_SIZE(atr)) { + TRACE_ERROR("ATR buffer overflow\n\r"); + return; + } + /* Show activity on LED */ led_blink(LED_GREEN, BLINK_2O_F); + + /* Print ATR */ printf("ATR: "); - for (uint8_t i=0; il1h = msgb_put(usb_msg, sizeof(*usb_msg_header)); + usb_msg_header = (struct simtrace_msg_hdr *) usb_msg->l1h; + memset(usb_msg_header, 0, sizeof(*usb_msg_header)); + usb_msg_header->msg_class = SIMTRACE_MSGC_SNIFF; + usb_msg_header->msg_type = SIMTRACE_MSGT_SNIFF_ATR; + usb_msg->l2h = usb_msg->l1h + sizeof(*usb_msg_header); + struct sniff_data *usb_sniff_data_atr; + usb_sniff_data_atr = (struct sniff_data *) msgb_put(usb_msg, sizeof(*usb_sniff_data_atr)); + usb_sniff_data_atr->complete = true; + usb_sniff_data_atr->length = atr_i; + uint8_t *data = msgb_put(usb_msg, usb_sniff_data_atr->length); + memcpy(data, atr, atr_i); + usb_msg_header->msg_len = msgb_length(usb_msg); + usb_buf_submit(usb_msg); } /*! Process ATR byte @@ -317,7 +389,7 @@ } case ATR_S_WAIT_TCK: /* see ISO/IEC 7816-3:2006 section 8.2.5 */ /* we could verify the checksum, but we are just here to sniff */ - print_atr(); /* print ATR for info */ + usb_send_atr(); /* send ATR to host software using USB */ change_state(ISO7816_S_WAIT_TPDU); /* go to next state */ break; default: @@ -325,12 +397,14 @@ } } -/*! Print current PPS */ -static void print_pps(void) +/*! Send current PPS over USB + * @note Also print the PPS over serial + */ +static void usb_send_pps(void) { uint8_t *pps_cur; /* current PPS (request or response) */ - /* sanity check */ + /* Sanity check */ if (ISO7816_S_IN_PPS_REQ==iso_state) { pps_cur = pps_req; } else if (ISO7816_S_IN_PPS_RSP==iso_state) { @@ -340,21 +414,76 @@ return; } - led_blink(LED_GREEN, BLINK_2O_F); - printf("PPS %s : ", ISO7816_S_IN_PPS_REQ==iso_state ? "REQUEST" : "RESPONSE"); - printf("%02x ", pps_cur[0]); - printf("%02x ", pps_cur[1]); + /* Get only relevant data */ + uint8_t pps[6]; + uint8_t pps_i = 0; + pps[pps_i++] = pps_cur[0]; + pps[pps_i++] = pps_cur[1]; if (pps_cur[1]&0x10) { - printf("%02x ", pps_cur[2]); + pps[pps_i++] = pps_cur[2]; } if (pps_cur[1]&0x20) { - printf("%02x ", pps_cur[3]); + pps[pps_i++] = pps_cur[3]; } if (pps_cur[1]&0x40) { - printf("%02x ", pps_cur[4]); + pps[pps_i++] = pps_cur[4]; } - printf("%02x ", pps_cur[5]); + pps[pps_i++] = pps_cur[5]; + + /* Show activity on LED */ + led_blink(LED_GREEN, BLINK_2O_F); + + /* Print PPS */ + printf("PPS: "); + for (uint8_t i=0; il1h = msgb_put(usb_msg, sizeof(*usb_msg_header)); + usb_msg_header = (struct simtrace_msg_hdr *) usb_msg->l1h; + memset(usb_msg_header, 0, sizeof(*usb_msg_header)); + usb_msg_header->msg_class = SIMTRACE_MSGC_SNIFF; + usb_msg_header->msg_type = SIMTRACE_MSGT_SNIFF_PPS; + usb_msg->l2h = usb_msg->l1h + sizeof(*usb_msg_header); + struct sniff_data *usb_sniff_data_pps; + usb_sniff_data_pps = (struct sniff_data *) msgb_put(usb_msg, sizeof(*usb_sniff_data_pps)); + usb_sniff_data_pps->complete = true; + usb_sniff_data_pps->length = pps_i; + uint8_t *data = msgb_put(usb_msg, usb_sniff_data_pps->length); + memcpy(data, pps, pps_i); + usb_msg_header->msg_len = msgb_length(usb_msg); + usb_buf_submit(usb_msg); +} + +/*! Send Fi/Di change over USB + * @param[in] fidi Fi/Di factor as encoded in TA1 + */ +static void usb_send_fidi(uint8_t fidi) +{ + /* Send message over USB */ + struct msgb *usb_msg = usb_buf_alloc(SIMTRACE_USB_EP_CARD_DATAIN); + if (!usb_msg) { + return; + } + struct simtrace_msg_hdr *usb_msg_header; + usb_msg->l1h = msgb_put(usb_msg, sizeof(*usb_msg_header)); + usb_msg_header = (struct simtrace_msg_hdr *) usb_msg->l1h; + memset(usb_msg_header, 0, sizeof(*usb_msg_header)); + usb_msg_header->msg_class = SIMTRACE_MSGC_SNIFF; + usb_msg_header->msg_type = SIMTRACE_MSGT_SNIFF_FIDI; + usb_msg->l2h = usb_msg->l1h + sizeof(*usb_msg_header); + struct sniff_fidi *usb_sniff_fidi; + usb_sniff_fidi = (struct sniff_fidi *) msgb_put(usb_msg, sizeof(*usb_sniff_fidi)); + usb_sniff_fidi->fidi = fidi; + usb_msg_header->msg_len = msgb_length(usb_msg); + usb_buf_submit(usb_msg); } static void process_byte_pps(uint8_t byte) @@ -420,7 +549,7 @@ check ^= pps_cur[4]; } check ^= pps_cur[5]; - print_pps(); /* print PPS for info */ + usb_send_pps(); /* send PPS to host software using USB */ if (ISO7816_S_IN_PPS_REQ==iso_state) { if (0==check) { /* checksum is valid */ change_state(ISO7816_S_WAIT_PPS_RSP); /* go to next state */ @@ -439,7 +568,7 @@ } TRACE_INFO("PPS negotiation successful: Fn=%u Dn=%u\n\r", fn, dn); update_fidi(sniff_usart.base, pps_cur[2]); - rbuf_reset(&sniff_buffer); /* reset buffer for new communication */ + usb_send_fidi(pps_cur[2]); /* send Fi/Di change notification to host software over USB */ } else { /* checksum is invalid */ TRACE_INFO("PPS negotiation failed\n\r"); } @@ -451,20 +580,47 @@ } } -/*! Print current TPDU */ -static void print_tpdu(void) +/*! Send current TPDU over USB + * @note Also print the TPDU over serial + */ +static void usb_send_tpdu(void) { + /* Check state */ if (ISO7816_S_IN_TPDU!=iso_state) { TRACE_WARNING("Can't print TPDU in ISO 7816-3 state %u\n\r", iso_state); return; } + /* Show activity on LED */ led_blink(LED_GREEN, BLINK_2O_F); + + /* Print TPDU */ printf("TPDU: "); for (uint8_t i=0; il1h = msgb_put(usb_msg, sizeof(*usb_msg_header)); + usb_msg_header = (struct simtrace_msg_hdr *) usb_msg->l1h; + memset(usb_msg_header, 0, sizeof(*usb_msg_header)); + usb_msg_header->msg_class = SIMTRACE_MSGC_SNIFF; + usb_msg_header->msg_type = SIMTRACE_MSGT_SNIFF_ATR; + usb_msg->l2h = usb_msg->l1h + sizeof(*usb_msg_header); + struct sniff_data *usb_sniff_data_tpdu; + usb_sniff_data_tpdu = (struct sniff_data *) msgb_put(usb_msg, sizeof(*usb_sniff_data_tpdu)); + usb_sniff_data_tpdu->complete = true; + usb_sniff_data_tpdu->length = tpdu_packet_i; + uint8_t *data = msgb_put(usb_msg, usb_sniff_data_tpdu->length); + memcpy(data, tpdu_packet, tpdu_packet_i); + usb_msg_header->msg_len = msgb_length(usb_msg); + usb_buf_submit(usb_msg); } static void process_byte_tpdu(uint8_t byte) @@ -530,7 +686,7 @@ break; case TPDU_S_SW2: tpdu_packet[tpdu_packet_i++] = byte; - print_tpdu(); /* print TPDU for info */ + usb_send_tpdu(); /* send TPDU to host software using USB */ change_state(ISO7816_S_WAIT_TPDU); /* this is the end of the TPDU */ break; case TPDU_S_DATA_SINGLE: @@ -554,47 +710,6 @@ } } -static void check_sniffed_data(void) -{ - /* Handle sniffed data */ - while (!rbuf_is_empty(&sniff_buffer)) { - uint8_t byte = rbuf_read(&sniff_buffer); - TRACE_WARNING_WP("< 0x%02x\n\r", byte); - switch (iso_state) { /* Handle byte depending on state */ - case ISO7816_S_RESET: /* During reset we shouldn't receive any data */ - break; - case ISO7816_S_WAIT_ATR: /* After a reset we expect the ATR */ - change_state(ISO7816_S_IN_ATR); /* go to next state */ - case ISO7816_S_IN_ATR: /* More ATR data incoming */ - process_byte_atr(byte); - break; - case ISO7816_S_WAIT_TPDU: /* After the ATR we expect TPDU or PPS data */ - case ISO7816_S_WAIT_PPS_RSP: - if (byte == 0xff) { - if (ISO7816_S_WAIT_PPS_RSP==iso_state) { - change_state(ISO7816_S_IN_PPS_RSP); /* Go to PPS state */ - } else { - change_state(ISO7816_S_IN_PPS_REQ); /* Go to PPS state */ - } - process_byte_pps(byte); - break; - } - case ISO7816_S_IN_TPDU: /* More TPDU data incoming */ - if (ISO7816_S_WAIT_TPDU==iso_state) { - change_state(ISO7816_S_IN_TPDU); - } - process_byte_tpdu(byte); - break; - case ISO7816_S_IN_PPS_REQ: - case ISO7816_S_IN_PPS_RSP: - process_byte_pps(byte); - break; - default: - TRACE_ERROR("Data received in unknown state %u\n\r", iso_state); - } - } -} - /*! Interrupt Service Routine called on USART activity */ void Sniffer_usart_isr(void) { @@ -634,6 +749,7 @@ default: break; } + usb_send_change(SNIFF_CHANGE_FLAG_TIMEOUT_WT); /* send timeout to host software over USB */ } } @@ -690,11 +806,14 @@ void Sniffer_exit(void) { TRACE_INFO("Sniffer exit\n\r"); + /* Disable USART */ USART_DisableIt(sniff_usart.base, US_IER_RXRDY); /* NOTE: don't forget to set the IRQ according to the USART peripheral used */ NVIC_DisableIRQ(IRQ_USART_SIM); USART_SetReceiverEnabled(sniff_usart.base, 0); - + /* Disable RST IRQ */ + PIO_DisableIt(&pin_rst); + NVIC_DisableIRQ(PIOA_IRQn); /* CAUTION this needs to match to the correct port */ } /* called when *Sniffer* configuration is set by host */ @@ -737,6 +856,58 @@ /* Main (idle/busy) loop of this USB configuration */ void Sniffer_run(void) { - check_sniffed_data(); + /* Handle USB queue */ + /* first try to send any pending messages on INT */ + usb_refill_to_host(SIMTRACE_USB_EP_CARD_INT); + /* then try to send any pending messages on IN */ + usb_refill_to_host(SIMTRACE_USB_EP_CARD_DATAIN); + /* ensure we can handle incoming USB messages from the host */ + /* currently we don't need any incoming data + usb_refill_from_host(SIMTRACE_USB_EP_CARD_DATAOUT); + struct llist_head *queue = usb_get_queue(SIMTRACE_USB_EP_CARD_DATAOUT); + process_any_usb_commands(queue); + */ + + /* Handle sniffed data */ + if (!rbuf_is_empty(&sniff_buffer)) { /* use if instead of while to let the main loop restart the watchdog */ + uint8_t byte = rbuf_read(&sniff_buffer); + TRACE_DEBUG_WP("< 0x%02x\n\r", byte); + switch (iso_state) { /* Handle byte depending on state */ + case ISO7816_S_RESET: /* During reset we shouldn't receive any data */ + break; + case ISO7816_S_WAIT_ATR: /* After a reset we expect the ATR */ + change_state(ISO7816_S_IN_ATR); /* go to next state */ + case ISO7816_S_IN_ATR: /* More ATR data incoming */ + process_byte_atr(byte); + break; + case ISO7816_S_WAIT_TPDU: /* After the ATR we expect TPDU or PPS data */ + case ISO7816_S_WAIT_PPS_RSP: + if (byte == 0xff) { + if (ISO7816_S_WAIT_PPS_RSP==iso_state) { + change_state(ISO7816_S_IN_PPS_RSP); /* Go to PPS state */ + } else { + change_state(ISO7816_S_IN_PPS_REQ); /* Go to PPS state */ + } + process_byte_pps(byte); + break; + } + case ISO7816_S_IN_TPDU: /* More TPDU data incoming */ + if (ISO7816_S_WAIT_TPDU==iso_state) { + change_state(ISO7816_S_IN_TPDU); + } + process_byte_tpdu(byte); + break; + case ISO7816_S_IN_PPS_REQ: + case ISO7816_S_IN_PPS_RSP: + process_byte_pps(byte); + break; + default: + TRACE_ERROR("Data received in unknown state %u\n\r", iso_state); + } + } + + /* Handle flags */ + if (change_flags) { /* WARNING this is not synced with the data buffer handling */ + } } #endif /* HAVE_SNIFFER */ -- To view, visit https://gerrit.osmocom.org/9873 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ice7817480705f2124b08c1ff9a8826558b6d8b2b Gerrit-Change-Number: 9873 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 08:58:54 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 08:58:54 +0000 Subject: Change in simtrace2[master]: host USB: add host application to receive and display USB sniffing me... Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9874 Change subject: host USB: add host application to receive and display USB sniffing messages sent by firmware ...................................................................... host USB: add host application to receive and display USB sniffing messages sent by firmware Change-Id: Idefbf21e0bbd2a1e3647fe9aebaf88d1b62dae2d --- M host/Makefile A host/simtrace2-sniff.c 2 files changed, 535 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/74/9874/1 diff --git a/host/Makefile b/host/Makefile index 47ccfec..50497c4 100644 --- a/host/Makefile +++ b/host/Makefile @@ -1,7 +1,7 @@ LDFLAGS=`pkg-config --libs libusb-1.0 libosmocore` -losmocore CFLAGS=-Wall -g -all: simtrace2-remsim simtrace2-remsim-usb2udp simtrace2-list +all: simtrace2-remsim simtrace2-remsim-usb2udp simtrace2-list simtrace2-sniff simtrace2-remsim: simtrace2-remsim.o apdu_dispatch.o simtrace2-discovery.o libusb_util.o $(CC) -o $@ $^ $(LDFLAGS) -losmosim @@ -12,6 +12,9 @@ simtrace2-list: simtrace2_usb.o libusb_util.o $(CC) -o $@ $^ $(LDFLAGS) +simtrace2-sniff: simtrace2-sniff.o simtrace2-discovery.o libusb_util.o + $(CC) -o $@ $^ $(LDFLAGS) + %.o: %.c $(CC) $(CFLAGS) `pkg-config --cflags libusb-1.0 libosmocore` -o $@ -c $^ diff --git a/host/simtrace2-sniff.c b/host/simtrace2-sniff.c new file mode 100644 index 0000000..df3e28a --- /dev/null +++ b/host/simtrace2-sniff.c @@ -0,0 +1,531 @@ +/* simtrace2-sniff - main program for the host PC to communicate with the SIMtrace 2 firmware in sniffer mode */ +/* This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * (C) 2010-2017 by Harald Welte + * (C) 2018 by Kevin Redon + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#define _GNU_SOURCE +#include + +#include +#include +#include +#include +#include + +#include + +#include "libusb_util.h" +#include "simtrace.h" +#include "simtrace_usb.h" +#include "simtrace_prot.h" +#include "simtrace2-discovery.h" + +#include +#include +#include +#include +#include +#include +#include + +/* transport to a SIMtrace device */ +struct st_transport { + /* USB */ + struct libusb_device_handle *usb_devh; + struct { + uint8_t in; + uint8_t out; + uint8_t irq_in; + } usb_ep; +}; + +/* global GSMTAP instance */ +static struct gsmtap_inst *g_gti; + +static int gsmtap_send_sim(const uint8_t *apdu, unsigned int len) +{ + struct gsmtap_hdr *gh; + unsigned int gross_len = len + sizeof(*gh); + uint8_t *buf = malloc(gross_len); + int rc; + + if (!buf) + return -ENOMEM; + + memset(buf, 0, sizeof(*gh)); + gh = (struct gsmtap_hdr *) buf; + gh->version = GSMTAP_VERSION; + gh->hdr_len = sizeof(*gh)/4; + gh->type = GSMTAP_TYPE_SIM; + + memcpy(buf + sizeof(*gh), apdu, len); + + rc = write(gsmtap_inst_fd(g_gti), buf, gross_len); + if (rc < 0) { + perror("write gsmtap"); + free(buf); + return rc; + } + + free(buf); + return 0; +} + +static int process_change(uint8_t *buf, int len) +{ + /* check if there is enough data for the structure */ + if (lenflags) { + printf("Card state change: "); + } + if (change->flags&SNIFF_CHANGE_FLAG_CARD_INSERT) { + printf("card inserted "); + } + if (change->flags&SNIFF_CHANGE_FLAG_CARD_EJECT) { + printf("card ejected "); + } + if (change->flags&SNIFF_CHANGE_FLAG_RESET_HOLD) { + printf("reset hold "); + } + if (change->flags&SNIFF_CHANGE_FLAG_RESET_RELEASE) { + printf("reset release "); + } + if (change->flags&SNIFF_CHANGE_FLAG_TIMEOUT_WT) { + // do nothing since this also triggers on inactivity + } + if (SNIFF_CHANGE_FLAG_TIMEOUT_WT!=change->flags) { + printf("\n"); + } + + return 0; +} + +/* Table 7 of ISO 7816-3:2006 */ +static const uint16_t fi_table[] = { 372, 372, 558, 744, 1116, 1488, 1860, 0, 0, 512, 768, 1024, 1536, 2048, 0, 0, }; + +/* Table 8 from ISO 7816-3:2006 */ +static const uint8_t di_table[] = { 0, 1, 2, 4, 8, 16, 32, 64, 12, 20, 2, 4, 8, 16, 32, 64, }; + +static int process_fidi(uint8_t *buf, int len) +{ + /* check if there is enough data for the structure */ + if (lenfidi>>4], di_table[fidi->fidi&0x0f]); + return 0; +} + +static int process_atr(uint8_t *buf, int len) +{ + /* check if there is enough data for the structure */ + if (lenlength) { + return -2; + } + + printf("ATR%s: ", atr->complete ? "" : " (incomplete)"); + for (uint16_t i=0; ilength; i++) { + printf("%02x ", atr->data[i]); + } + printf("\n"); + return 0; +} + +static int process_pps(uint8_t *buf, int len) +{ + /* check if there is enough data for the structure */ + if (lenlength) { + return -2; + } + + printf("PPS%s: ", pps->complete ? "" : " (incomplete) "); + for (uint16_t i=0; ilength; i++) { + printf("%02x ", pps->data[i]); + } + printf("\n"); + return 0; +} + +static int process_tpdu(uint8_t *buf, int len) +{ + /* check if there is enough data for the structure */ + if (lenlength) { + return -2; + } + + printf("TPDU%s: ", tpdu->complete ? "" : " (incomplete)"); + for (uint16_t i=0; ilength; i++) { + printf("%02x ", tpdu->data[i]); + } + printf("\n"); + return 0; +} + +/*! \brief Process an incoming message from the SIMtrace2 */ +static int process_usb_msg(uint8_t *buf, int len) +{ + /* check if enough data for the header is present */ + if (lenmsg_len) { + return 0; + } + //printf("msg: %s\n", osmo_hexdump(buf, msg_hdr->msg_len)); + + /* check for message class */ + if (SIMTRACE_MSGC_SNIFF!=msg_hdr->msg_class) { /* we only care about sniffing messages */ + return msg_hdr->msg_len; /* discard non-sniffing messaged */ + } + + /* process sniff message payload */ + buf += sizeof(struct simtrace_msg_hdr); + len -= sizeof(struct simtrace_msg_hdr); + switch (msg_hdr->msg_type) { + case SIMTRACE_MSGT_SNIFF_CHANGE: + process_change(buf, len); + break; + case SIMTRACE_MSGT_SNIFF_FIDI: + process_fidi(buf, len); + break; + case SIMTRACE_MSGT_SNIFF_ATR: + process_atr(buf, len); + break; + case SIMTRACE_MSGT_SNIFF_PPS: + process_pps(buf, len); + break; + case SIMTRACE_MSGT_SNIFF_TPDU: + process_tpdu(buf, len); + break; + default: + printf("unknown SIMtrace msg type 0x%02x\n", msg_hdr->msg_type); + break; + } + + return msg_hdr->msg_len; +} + +/*! Transport to SIMtrace device (e.g. USB handle) */ +static struct st_transport _transp; + +static void run_mainloop() +{ + int rc; + uint8_t buf[16*256]; + unsigned int buf_i = 0; + int xfer_len; + + printf("Entering main loop\n"); + + while (true) { + /* read data from SIMtrace2 device (via USB) */ + rc = libusb_bulk_transfer(_transp.usb_devh, _transp.usb_ep.in, + &buf[buf_i], sizeof(buf)-buf_i, &xfer_len, 100000); + if (rc < 0 && rc != LIBUSB_ERROR_TIMEOUT && + rc != LIBUSB_ERROR_INTERRUPTED && + rc != LIBUSB_ERROR_IO) { + fprintf(stderr, "BULK IN transfer error; rc=%d\n", rc); + return; + } + /* dispatch any incoming data */ + if (xfer_len > 0) { + //printf("URB: %s\n", osmo_hexdump(&buf[buf_i], xfer_len)); + buf_i += xfer_len; + if (buf_i>=sizeof(buf)) { + perror("preventing USB buffer overflow"); + return; + } + int processed = process_usb_msg(buf, buf_i); + if (processed>0 && processed<=buf_i) { + for (unsigned int i=processed; i\n" + "(C) 2018 by Kevin Redon \n" + "\n" + ); +} + +static void print_help(void) +{ + printf( + "\t-h\t--help\n" + "\t-i\t--gsmtap-ip\tA.B.C.D\n" + "\t-k\t--keep-running\n" + "\t-V\t--usb-vendor\tVENDOR_ID\n" + "\t-P\t--usb-product\tPRODUCT_ID\n" + "\t-C\t--usb-config\tCONFIG_ID\n" + "\t-I\t--usb-interface\tINTERFACE_ID\n" + "\t-S\t--usb-altsetting ALTSETTING_ID\n" + "\t-A\t--usb-address\tADDRESS\n" + "\n" + ); +} + +static const struct option opts[] = { + { "help", 0, 0, 'h' }, + { "gsmtap-ip", 1, 0, 'i' }, + { "keep-running", 0, 0, 'k' }, + { "usb-vendor", 1, 0, 'V' }, + { "usb-product", 1, 0, 'P' }, + { "usb-config", 1, 0, 'C' }, + { "usb-interface", 1, 0, 'I' }, + { "usb-altsetting", 1, 0, 'S' }, + { "usb-address", 1, 0, 'A' }, + { NULL, 0, 0, 0 } +}; + +/* Known USB device with SIMtrace firmware supporting sniffer */ +static const struct dev_id compatible_dev_ids[] = { + { USB_VENDOR_OPENMOKO, USB_PRODUCT_SIMTRACE2 }, + { 0, 0 } +}; + +static void signal_handler(int signal) +{ + switch (signal) { + case SIGINT: + exit(0); + break; + default: + break; + } +} + +int main(int argc, char **argv) +{ + int rc, ret; + print_welcome(); + + /* Parse arguments */ + char *gsmtap_host = "127.0.0.1"; + int keep_running = 0; + int vendor_id = -1, product_id = -1, addr = -1, config_id = -1, if_num = -1, altsetting = -1; + + while (1) { + int option_index = 0; + + char c = getopt_long(argc, argv, "hi:kV:P:C:I:S:A:", opts, &option_index); + if (c == -1) + break; + switch (c) { + case 'h': + print_help(); + exit(0); + break; + case 'i': + gsmtap_host = optarg; + break; + case 'k': + keep_running = 1; + break; + case 'V': + vendor_id = strtol(optarg, NULL, 16); + break; + case 'P': + product_id = strtol(optarg, NULL, 16); + break; + case 'C': + config_id = atoi(optarg); + break; + case 'I': + if_num = atoi(optarg); + break; + case 'S': + altsetting = atoi(optarg); + break; + case 'A': + addr = atoi(optarg); + break; + } + } + + /* Scan for available SIMtrace USB devices supporting sniffing */ + rc = libusb_init(NULL); + if (rc < 0) { + fprintf(stderr, "libusb initialization failed\n"); + goto do_exit; + } + struct usb_interface_match ifm_scan[16]; + int num_interfaces = usb_match_interfaces(NULL, compatible_dev_ids, + USB_CLASS_PROPRIETARY, SIMTRACE_SNIFFER_USB_SUBCLASS, -1, ifm_scan, ARRAY_SIZE(ifm_scan)); + if (num_interfaces <= 0) { + perror("No compatible USB devices found"); + goto do_exit; + } + + /* Only keep USB matching arguments */ + struct usb_interface_match ifm_filtered[ARRAY_SIZE(ifm_scan)]; + int num_filtered = 0; + for (unsigned int i = 0; i < num_interfaces; i++) { + if (vendor_id>=0 && vendor_id!=ifm_scan[i].vendor) { + continue; + } + if (product_id>=0 && product_id!=ifm_scan[i].product) { + continue; + } + if (config_id>=0 && config_id!=ifm_scan[i].configuration) { + continue; + } + if (if_num>=0 && if_num!=ifm_scan[i].interface) { + continue; + } + if (altsetting>=0 && altsetting!=ifm_scan[i].altsetting) { + continue; + } + if (addr>=0 && addr!=ifm_scan[i].addr) { + continue; + } + ifm_filtered[num_filtered++] = ifm_scan[i]; + } + if (1!=num_filtered) { + perror("No individual matching USB devices found"); + printf("Available USB devices:\n"); + for (unsigned int i = 0; i < num_interfaces; i++) { + printf("\t%04x:%04x Addr=%u, Path=%s, Cfg=%u, Intf=%u, Alt=%u: %d/%d/%d ", + ifm_scan[i].vendor, ifm_scan[i].product, ifm_scan[i].addr, ifm_scan[i].path, + ifm_scan[i].configuration, ifm_scan[i].interface, ifm_scan[i].altsetting, + ifm_scan[i].class, ifm_scan[i].sub_class, ifm_scan[i].protocol); + libusb_device_handle *dev_handle; + rc = libusb_open(ifm_scan[i].usb_dev, &dev_handle); + if (rc < 0) { + printf("\n"); + perror("Cannot open device"); + continue; + } + char strbuf[256]; + rc = libusb_get_string_descriptor_ascii(dev_handle, ifm_scan[i].string_idx, + (unsigned char *)strbuf, sizeof(strbuf)); + libusb_close(dev_handle); + if (rc < 0) { + printf("\n"); + perror("Cannot read string"); + continue; + } + printf("(%s)\n", strbuf); + } + goto do_exit; + } + struct usb_interface_match ifm_selected = ifm_filtered[0]; + printf("Using USB device %04x:%04x Addr=%u, Path=%s, Cfg=%u, Intf=%u, Alt=%u: %d/%d/%d ", + ifm_selected.vendor, ifm_selected.product, ifm_selected.addr, ifm_selected.path, + ifm_selected.configuration, ifm_selected.interface, ifm_selected.altsetting, + ifm_selected.class, ifm_selected.sub_class, ifm_selected.protocol); + libusb_device_handle *dev_handle; + rc = libusb_open(ifm_selected.usb_dev, &dev_handle); + if (rc < 0) { + printf("\n"); + perror("Cannot open device"); + } + char strbuf[256]; + rc = libusb_get_string_descriptor_ascii(dev_handle, ifm_selected.string_idx, + (unsigned char *)strbuf, sizeof(strbuf)); + libusb_close(dev_handle); + if (rc < 0) { + printf("\n"); + perror("Cannot read string"); + } + printf("(%s)\n", strbuf); + + g_gti = gsmtap_source_init(gsmtap_host, GSMTAP_UDP_PORT, 0); + if (!g_gti) { + perror("unable to open GSMTAP"); + goto close_exit; + } + gsmtap_source_add_sink(g_gti); + + signal(SIGINT, &signal_handler); + + do { + _transp.usb_devh = usb_open_claim_interface(NULL, &ifm_selected); + if (!_transp.usb_devh) { + fprintf(stderr, "can't open USB device\n"); + goto close_exit; + } + + rc = libusb_claim_interface(_transp.usb_devh, ifm_selected.interface); + if (rc < 0) { + fprintf(stderr, "can't claim interface %d; rc=%d\n", ifm_selected.interface, rc); + goto close_exit; + } + + rc = get_usb_ep_addrs(_transp.usb_devh, ifm_selected.interface, &_transp.usb_ep.out, + &_transp.usb_ep.in, &_transp.usb_ep.irq_in); + if (rc < 0) { + fprintf(stderr, "can't obtain EP addrs; rc=%d\n", rc); + goto close_exit; + } + + run_mainloop(); + ret = 0; + + if (_transp.usb_devh) + libusb_release_interface(_transp.usb_devh, 0); +close_exit: + if (_transp.usb_devh) + libusb_close(_transp.usb_devh); + if (keep_running) + sleep(1); + } while (keep_running); + + libusb_exit(NULL); +do_exit: + return ret; +} -- To view, visit https://gerrit.osmocom.org/9874 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Idefbf21e0bbd2a1e3647fe9aebaf88d1b62dae2d Gerrit-Change-Number: 9874 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 08:58:55 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 08:58:55 +0000 Subject: Change in simtrace2[master]: sniffer: display F and D values frim PPS Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9875 Change subject: sniffer: display F and D values frim PPS ...................................................................... sniffer: display F and D values frim PPS Change-Id: I3641dcb6c24695a6d3dd3a1ee4333f56a07c99f0 --- M firmware/libcommon/include/iso7816_fidi.h M firmware/libcommon/source/iso7816_fidi.c M firmware/libcommon/source/sniffer.c 3 files changed, 9 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/75/9875/1 diff --git a/firmware/libcommon/include/iso7816_fidi.h b/firmware/libcommon/include/iso7816_fidi.h index e4690a5..3b4b451 100644 --- a/firmware/libcommon/include/iso7816_fidi.h +++ b/firmware/libcommon/include/iso7816_fidi.h @@ -2,5 +2,11 @@ #include +/* Table 7 of ISO 7816-3:2006 */ +extern const uint16_t fi_table[]; + +/* Table 8 from ISO 7816-3:2006 */ +extern const uint8_t di_table[]; + /* compute the F/D ratio based on Fi and Di values */ int compute_fidi_ratio(uint8_t fi, uint8_t di); diff --git a/firmware/libcommon/source/iso7816_fidi.c b/firmware/libcommon/source/iso7816_fidi.c index b35f068..bdccd55 100644 --- a/firmware/libcommon/source/iso7816_fidi.c +++ b/firmware/libcommon/source/iso7816_fidi.c @@ -24,13 +24,13 @@ #include "iso7816_fidi.h" /* Table 7 of ISO 7816-3:2006 */ -static const uint16_t fi_table[] = { +const uint16_t fi_table[] = { 372, 372, 558, 744, 1116, 1488, 1860, 0, 0, 512, 768, 1024, 1536, 2048, 0, 0 }; /* Table 8 from ISO 7816-3:2006 */ -static const uint8_t di_table[] = { +const uint8_t di_table[] = { 0, 1, 2, 4, 8, 16, 32, 64, 12, 20, 2, 4, 8, 16, 32, 64, }; diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 88ac84f..fbf0022 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -566,7 +566,7 @@ fn = 1; dn = 1; } - TRACE_INFO("PPS negotiation successful: Fn=%u Dn=%u\n\r", fn, dn); + TRACE_INFO("PPS negotiation successful: Fn=%u Dn=%u\n\r", fi_table[fn], di_table[dn]); update_fidi(sniff_usart.base, pps_cur[2]); usb_send_fidi(pps_cur[2]); /* send Fi/Di change notification to host software over USB */ } else { /* checksum is invalid */ -- To view, visit https://gerrit.osmocom.org/9875 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I3641dcb6c24695a6d3dd3a1ee4333f56a07c99f0 Gerrit-Change-Number: 9875 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 08:58:55 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 08:58:55 +0000 Subject: Change in simtrace2[master]: console: drop data to be send when buffer is already full Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9876 Change subject: console: drop data to be send when buffer is already full ...................................................................... console: drop data to be send when buffer is already full don't wait for space to be available in the buffer since since would prevent from processing non-console (e.g. debug) more important data Change-Id: Ia625b09eb30bb7b43edd3989f697d8ef33200f28 --- M firmware/libboard/common/source/uart_console.c 1 file changed, 8 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/76/9876/1 diff --git a/firmware/libboard/common/source/uart_console.c b/firmware/libboard/common/source/uart_console.c index e52cd51..a47ba0c 100644 --- a/firmware/libboard/common/source/uart_console.c +++ b/firmware/libboard/common/source/uart_console.c @@ -133,17 +133,15 @@ UART_Configure(CONSOLE_BAUDRATE, BOARD_MCK); } - /* Wait until there is space in the buffer */ - while (rbuf_is_full(&uart_tx_buffer)) { - if (pUart->UART_SR & UART_SR_TXEMPTY) { - pUart->UART_IER = UART_IER_TXRDY; - CONSOLE_ISR(); - } + /* Only store input if buffer is not full, else drop it */ + bool trigger_isr = false; + if (rbuf_is_empty(&uart_tx_buffer)) { + trigger_isr = true; } - - /* Put character into buffer */ - rbuf_write(&uart_tx_buffer, c); - if (pUart->UART_SR & UART_SR_TXEMPTY) { + if (!rbuf_is_full(&uart_tx_buffer)) { + rbuf_write(&uart_tx_buffer, c); + } + if (trigger_isr) { pUart->UART_IER = UART_IER_TXRDY; CONSOLE_ISR(); } -- To view, visit https://gerrit.osmocom.org/9876 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ia625b09eb30bb7b43edd3989f697d8ef33200f28 Gerrit-Change-Number: 9876 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 08:58:55 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 08:58:55 +0000 Subject: Change in simtrace2[master]: buffer: increase buffer size to 512 to cope with fast and long TPDUs Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9877 Change subject: buffer: increase buffer size to 512 to cope with fast and long TPDUs ...................................................................... buffer: increase buffer size to 512 to cope with fast and long TPDUs Change-Id: I194c90cf09306a982d80c5bf1222397af6e658a9 --- M firmware/libcommon/include/ringbuffer.h 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/77/9877/1 diff --git a/firmware/libcommon/include/ringbuffer.h b/firmware/libcommon/include/ringbuffer.h index 1d29760..61c6c58 100644 --- a/firmware/libcommon/include/ringbuffer.h +++ b/firmware/libcommon/include/ringbuffer.h @@ -5,7 +5,7 @@ #include #include -#define RING_BUFLEN 256 +#define RING_BUFLEN 512 typedef struct ringbuf { uint8_t buf[RING_BUFLEN]; -- To view, visit https://gerrit.osmocom.org/9877 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I194c90cf09306a982d80c5bf1222397af6e658a9 Gerrit-Change-Number: 9877 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 08:58:56 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 08:58:56 +0000 Subject: Change in simtrace2[master]: sniffing: move conversion convertion and flag processing from ISR to ... Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9878 Change subject: sniffing: move conversion convertion and flag processing from ISR to main loop to keep ISR fast and focus on data capture ...................................................................... sniffing: move conversion convertion and flag processing from ISR to main loop to keep ISR fast and focus on data capture Change-Id: Ieefa8a5f81dbcc12c1ad3059660dbffa0c1a4961 --- M firmware/libcommon/source/sniffer.c M host/simtrace2-sniff.c 2 files changed, 98 insertions(+), 73 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/78/9878/1 diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index fbf0022..441df7d 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -19,8 +19,7 @@ */ /* This code implement the Sniffer mode to sniff the communication between a SIM card (or any ISO 7816 smart card) and a phone (or any ISO 7816 card reader). * For historical reasons (i.e. SIMtrace hardware) the USART peripheral connected to the SIM card is used. - * TODO handle RST, PTS, and send data over USB - * TODO put common ISO7816-3 code is separate library (and combine clean with iso7816_4) + * TODO put common ISO7816-3 code is separate library (and combine clean with iso7816_4) */ #include "board.h" #include "simtrace.h" @@ -188,35 +187,6 @@ */ static const uint8_t convention_convert_lut[256] = { 0xff, 0x7f, 0xbf, 0x3f, 0xdf, 0x5f, 0x9f, 0x1f, 0xef, 0x6f, 0xaf, 0x2f, 0xcf, 0x4f, 0x8f, 0x0f, 0xf7, 0x77, 0xb7, 0x37, 0xd7, 0x57, 0x97, 0x17, 0xe7, 0x67, 0xa7, 0x27, 0xc7, 0x47, 0x87, 0x07, 0xfb, 0x7b, 0xbb, 0x3b, 0xdb, 0x5b, 0x9b, 0x1b, 0xeb, 0x6b, 0xab, 0x2b, 0xcb, 0x4b, 0x8b, 0x0b, 0xf3, 0x73, 0xb3, 0x33, 0xd3, 0x53, 0x93, 0x13, 0xe3, 0x63, 0xa3, 0x23, 0xc3, 0x43, 0x83, 0x03, 0xfd, 0x7d, 0xbd, 0x3d, 0xdd, 0x5d, 0x9d, 0x1d, 0xed, 0x6d, 0xad, 0x2d, 0xcd, 0x4d, 0x8d, 0x0d, 0xf5, 0x75, 0xb5, 0x35, 0xd5, 0x55, 0x95, 0x15, 0xe5, 0x65, 0xa5, 0x25, 0xc5, 0x45, 0x85, 0x05, 0xf9, 0x79, 0xb9, 0x39, 0xd9, 0x59, 0x99, 0x19, 0xe9, 0x69, 0xa9, 0x29, 0xc9, 0x49, 0x89, 0x09, 0xf1, 0x71, 0xb1, 0x31, 0xd1, 0x51, 0x91, 0x11, 0xe1, 0x61, 0xa1, 0x21, 0xc1, 0x41, 0x81, 0x01, 0xfe, 0x7e, 0xbe, 0x3e, 0xde, 0x5e, 0x9e, 0x1e, 0xee, 0x6e, 0xae, 0x2e, 0xce, 0x4e, 0x8e, 0x0e, 0xf6, 0x76, 0xb6, 0x36, 0xd6, 0x56, 0x96, 0x16, 0xe6, 0x66, 0xa6, 0x26, 0xc6, 0x46, 0x86, 0x06, 0xfa, 0x7a, 0xba, 0x3a, 0xda, 0x5a, 0x9a, 0x1a, 0xea, 0x6a, 0xaa, 0x2a, 0xca, 0x4a, 0x8a, 0x0a, 0xf2, 0x72, 0xb2, 0x32, 0xd2, 0x52, 0x92, 0x12, 0xe2, 0x62, 0xa2, 0x22, 0xc2, 0x42, 0x82, 0x02, 0xfc, 0x7c, 0xbc, 0x3c, 0xdc, 0x5c, 0x9c, 0x1c, 0xec, 0x6c, 0xac, 0x2c, 0xcc, 0x4c, 0x8c, 0x0c, 0xf4, 0x74, 0xb4, 0x34, 0xd4, 0x54, 0x94, 0x14, 0xe4, 0x64, 0xa4, 0x24, 0xc4, 0x44, 0x84, 0x04, 0xf8, 0x78, 0xb8, 0x38, 0xd8, 0x58, 0x98, 0x18, 0xe8, 0x68, 0xa8, 0x28, 0xc8, 0x48, 0x88, 0x08, 0xf0, 0x70, 0xb0, 0x30, 0xd0, 0x50, 0x90, 0x10, 0xe0, 0x60, 0xa0, 0x20, 0xc0, 0x40, 0x80, 0x00, }; -/*! Send card change flags over USB - * @param[in] flags change flags corresponding to SIMTRACE_MSGT_SNIFF_CHANGE - */ -static void usb_send_change(uint32_t flags) -{ - /* Check flags */ - if(0==flags) { /* no changes */ - return; - } - - /* Send message over USB */ - struct msgb *usb_msg = usb_buf_alloc(SIMTRACE_USB_EP_CARD_DATAIN); - if (!usb_msg) { - return; - } - struct simtrace_msg_hdr *usb_msg_header; - usb_msg->l1h = msgb_put(usb_msg, sizeof(*usb_msg_header)); - usb_msg_header = (struct simtrace_msg_hdr *) usb_msg->l1h; - memset(usb_msg_header, 0, sizeof(*usb_msg_header)); - usb_msg_header->msg_class = SIMTRACE_MSGC_SNIFF; - usb_msg_header->msg_type = SIMTRACE_MSGT_SNIFF_CHANGE; - usb_msg->l2h = usb_msg->l1h + sizeof(*usb_msg_header); - struct sniff_change *usb_sniff_change; - usb_sniff_change = (struct sniff_change *) msgb_put(usb_msg, sizeof(*usb_sniff_change)); - usb_sniff_change->flags = flags; - usb_msg_header->msg_len = msgb_length(usb_msg); - usb_buf_submit(usb_msg); -} - /*! Update the ISO 7816-3 state * @param[in] iso_state_new new ISO 7816-3 state to update to */ @@ -232,11 +202,11 @@ switch (iso_state_new) { case ISO7816_S_RESET: update_fidi(sniff_usart.base, 0x11); /* reset baud rate to default Di/Fi values */ - usb_send_change(SNIFF_CHANGE_FLAG_RESET_HOLD); /* send reset change to host software over USB */ + change_flags |= SNIFF_CHANGE_FLAG_RESET_HOLD; /* set flag and let main loop send it */ break; case ISO7816_S_WAIT_ATR: rbuf_reset(&sniff_buffer); /* reset buffer for new communication */ - usb_send_change(SNIFF_CHANGE_FLAG_RESET_RELEASE); /* send reset change to host software over USB */ + change_flags |= SNIFF_CHANGE_FLAG_RESET_RELEASE; /* set flag and let main loop send it */ break; case ISO7816_S_IN_ATR: atr_i = 0; @@ -714,42 +684,34 @@ void Sniffer_usart_isr(void) { /* Read channel status register */ - uint32_t csr = sniff_usart.base->US_CSR & sniff_usart.base->US_IMR; + uint32_t csr = sniff_usart.base->US_CSR; + /* Verify if there was an error */ + if (csr & US_CSR_OVRE) { + TRACE_WARNING("USART overrun error\n\r"); + sniff_usart.base->US_CR |= US_CR_RSTSTA; + } + if (csr & US_CSR_FRAME) { + TRACE_WARNING("USART framing error\n\r"); + sniff_usart.base->US_CR |= US_CR_RSTSTA; + } /* Verify if character has been received */ if (csr & US_CSR_RXRDY) { /* Read communication data byte between phone and SIM */ uint8_t byte = sniff_usart.base->US_RHR; - /* Convert convention if required */ - if (convention_convert) { - byte = convention_convert_lut[byte]; - } /* Store sniffed data into buffer (also clear interrupt */ - rbuf_write(&sniff_buffer, byte); + if (rbuf_is_full(&sniff_buffer)) { + TRACE_ERROR("USART buffer full\n\r"); + } else { + rbuf_write(&sniff_buffer, byte); + } } + /* Verify it WT timeout occurred, to detect unresponsive card */ if (csr & US_CSR_TIMEOUT) { /* Stop timeout until next character is received */ sniff_usart.base->US_CR |= US_CR_STTTO; - /* Use timeout to detect end of ATR/PPS/TPDU */ - switch (iso_state) { - case ISO7816_S_RESET: - case ISO7816_S_WAIT_ATR: - break; - case ISO7816_S_IN_ATR: - change_state(ISO7816_S_WAIT_ATR); - break; - case ISO7816_S_WAIT_TPDU: - break; - case ISO7816_S_WAIT_PPS_RSP: - case ISO7816_S_IN_TPDU: - case ISO7816_S_IN_PPS_REQ: - case ISO7816_S_IN_PPS_RSP: - change_state(ISO7816_S_WAIT_TPDU); - break; - default: - break; - } - usb_send_change(SNIFF_CHANGE_FLAG_TIMEOUT_WT); /* send timeout to host software over USB */ + /* Just set the flag and let the main loop handle it */ + change_flags |= SNIFF_CHANGE_FLAG_TIMEOUT_WT; } } @@ -853,6 +815,40 @@ } } +/*! Send card change flags over USB + * @param[in] flags change flags corresponding to SIMTRACE_MSGT_SNIFF_CHANGE + * @note Also print the TPDU over the debug console + */ +static void usb_send_change(uint32_t flags) +{ + /* Check flags */ + if(0==flags) { /* no changes */ + return; + } + + if (flags&SNIFF_CHANGE_FLAG_TIMEOUT_WT) { + printf("waiting time (WT) timeout\n\r"); + } + + /* Send message over USB */ + struct msgb *usb_msg = usb_buf_alloc(SIMTRACE_USB_EP_CARD_DATAIN); + if (!usb_msg) { + return; + } + struct simtrace_msg_hdr *usb_msg_header; + usb_msg->l1h = msgb_put(usb_msg, sizeof(*usb_msg_header)); + usb_msg_header = (struct simtrace_msg_hdr *) usb_msg->l1h; + memset(usb_msg_header, 0, sizeof(*usb_msg_header)); + usb_msg_header->msg_class = SIMTRACE_MSGC_SNIFF; + usb_msg_header->msg_type = SIMTRACE_MSGT_SNIFF_CHANGE; + usb_msg->l2h = usb_msg->l1h + sizeof(*usb_msg_header); + struct sniff_change *usb_sniff_change; + usb_sniff_change = (struct sniff_change *) msgb_put(usb_msg, sizeof(*usb_sniff_change)); + usb_sniff_change->flags = flags; + usb_msg_header->msg_len = msgb_length(usb_msg); + usb_buf_submit(usb_msg); +} + /* Main (idle/busy) loop of this USB configuration */ void Sniffer_run(void) { @@ -871,7 +867,11 @@ /* Handle sniffed data */ if (!rbuf_is_empty(&sniff_buffer)) { /* use if instead of while to let the main loop restart the watchdog */ uint8_t byte = rbuf_read(&sniff_buffer); - TRACE_DEBUG_WP("< 0x%02x\n\r", byte); + /* Convert convention if required */ + if (convention_convert) { + byte = convention_convert_lut[byte]; + } + //TRACE_ERROR_WP(">%02x", byte); switch (iso_state) { /* Handle byte depending on state */ case ISO7816_S_RESET: /* During reset we shouldn't receive any data */ break; @@ -908,6 +908,31 @@ /* Handle flags */ if (change_flags) { /* WARNING this is not synced with the data buffer handling */ + if (change_flags&SNIFF_CHANGE_FLAG_TIMEOUT_WT) { + /* Use timeout to detect interrupted data transmission */ + switch (iso_state) { + case ISO7816_S_IN_ATR: + usb_send_atr(false); /* send incomplete ATR to host software using USB */ + change_state(ISO7816_S_WAIT_ATR); + break; + case ISO7816_S_IN_TPDU: + usb_send_tpdu(false); /* send incomplete PPS to host software using USB */ + change_state(ISO7816_S_WAIT_TPDU); + break; + case ISO7816_S_IN_PPS_REQ: + case ISO7816_S_IN_PPS_RSP: + usb_send_pps(false); /* send incomplete TPDU to host software using USB */ + change_state(ISO7816_S_WAIT_TPDU); + break; + default: + change_flags &= ~SNIFF_CHANGE_FLAG_TIMEOUT_WT; /* We don't care about the timeout is all other cases */ + break; + } + } + if (change_flags) { + usb_send_change(change_flags); /* send timeout to host software over USB */ + change_flags = 0; /* Reset flags */ + } } } #endif /* HAVE_SNIFFER */ diff --git a/host/simtrace2-sniff.c b/host/simtrace2-sniff.c index df3e28a..bbee518 100644 --- a/host/simtrace2-sniff.c +++ b/host/simtrace2-sniff.c @@ -92,7 +92,7 @@ return 0; } -static int process_change(uint8_t *buf, int len) +static int process_change(const uint8_t *buf, int len) { /* check if there is enough data for the structure */ if (lenflags) { - printf("Card state change: "); - } + printf("Card state change: "); if (change->flags&SNIFF_CHANGE_FLAG_CARD_INSERT) { printf("card inserted "); } @@ -116,11 +114,9 @@ printf("reset release "); } if (change->flags&SNIFF_CHANGE_FLAG_TIMEOUT_WT) { - // do nothing since this also triggers on inactivity + printf("data transfer timeout "); } - if (SNIFF_CHANGE_FLAG_TIMEOUT_WT!=change->flags) { - printf("\n"); - } + printf("\n"); return 0; } @@ -131,7 +127,7 @@ /* Table 8 from ISO 7816-3:2006 */ static const uint8_t di_table[] = { 0, 1, 2, 4, 8, 16, 32, 64, 12, 20, 2, 4, 8, 16, 32, 64, }; -static int process_fidi(uint8_t *buf, int len) +static int process_fidi(const uint8_t *buf, int len) { /* check if there is enough data for the structure */ if (lencomplete ? "" : " (incomplete)"); for (uint16_t i=0; ilength; i++) { printf("%02x ", tpdu->data[i]); } printf("\n"); + + /* send TPDU (now considered as APDU) to GSMTAP */ + gsmtap_send_sim(tpdu->data, tpdu->length); return 0; } /*! \brief Process an incoming message from the SIMtrace2 */ -static int process_usb_msg(uint8_t *buf, int len) +static int process_usb_msg(const uint8_t *buf, int len) { /* check if enough data for the header is present */ if (len -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 08:58:56 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 08:58:56 +0000 Subject: Change in simtrace2[master]: sniffer: also send incomplete (e.g. timeout) data (PPS/ATR/TPDU) Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9879 Change subject: sniffer: also send incomplete (e.g. timeout) data (PPS/ATR/TPDU) ...................................................................... sniffer: also send incomplete (e.g. timeout) data (PPS/ATR/TPDU) Change-Id: Ib070aca181042b477f1ffec48d63dc56c1e4609a --- M firmware/libcommon/source/sniffer.c 1 file changed, 39 insertions(+), 24 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/79/9879/1 diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 441df7d..c14a176 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -91,6 +91,7 @@ PPS_S_WAIT_PPS2, /*!< second parameter byte */ PPS_S_WAIT_PPS3, /*!< third parameter byte */ PPS_S_WAIT_PCK, /*!< check byte */ + PPS_S_WAIT_END, /*!< all done */ }; /*! Transport Protocol Data Unit (TPDU) sub-states of ISO7816_S_IN_TPDU @@ -232,9 +233,10 @@ } /*! Send current ATR over USB - * @note Also print the ATR over serial + * @param[in] complete if the ATR is complete + * @note Also print the ATR to debug console */ -static void usb_send_atr(void) +static void usb_send_atr(bool complete) { /* Check state */ if (ISO7816_S_IN_ATR!=iso_state) { @@ -250,7 +252,7 @@ led_blink(LED_GREEN, BLINK_2O_F); /* Print ATR */ - printf("ATR: "); + printf("ATR%s: ", complete ? "" : " (incomplete)"); for (uint8_t i=0; il2h = usb_msg->l1h + sizeof(*usb_msg_header); struct sniff_data *usb_sniff_data_atr; usb_sniff_data_atr = (struct sniff_data *) msgb_put(usb_msg, sizeof(*usb_sniff_data_atr)); - usb_sniff_data_atr->complete = true; + usb_sniff_data_atr->complete = complete; usb_sniff_data_atr->length = atr_i; uint8_t *data = msgb_put(usb_msg, usb_sniff_data_atr->length); memcpy(data, atr, atr_i); @@ -359,7 +361,7 @@ } case ATR_S_WAIT_TCK: /* see ISO/IEC 7816-3:2006 section 8.2.5 */ /* we could verify the checksum, but we are just here to sniff */ - usb_send_atr(); /* send ATR to host software using USB */ + usb_send_atr(true); /* send ATR to host software using USB */ change_state(ISO7816_S_WAIT_TPDU); /* go to next state */ break; default: @@ -368,9 +370,10 @@ } /*! Send current PPS over USB - * @note Also print the PPS over serial + * @param[in] complete if the PPS is complete + * @note Also print the PPS over the debug console */ -static void usb_send_pps(void) +static void usb_send_pps(bool complete) { uint8_t *pps_cur; /* current PPS (request or response) */ @@ -387,24 +390,30 @@ /* Get only relevant data */ uint8_t pps[6]; uint8_t pps_i = 0; - pps[pps_i++] = pps_cur[0]; - pps[pps_i++] = pps_cur[1]; - if (pps_cur[1]&0x10) { + if (pps_state>PPS_S_WAIT_PPSS) { + pps[pps_i++] = pps_cur[0]; + } + if (pps_state>PPS_S_WAIT_PPS0) { + pps[pps_i++] = pps_cur[1]; + } + if (pps_state>PPS_S_WAIT_PPS1 && pps_cur[1]&0x10) { pps[pps_i++] = pps_cur[2]; } - if (pps_cur[1]&0x20) { + if (pps_state>PPS_S_WAIT_PPS2 && pps_cur[1]&0x20) { pps[pps_i++] = pps_cur[3]; } - if (pps_cur[1]&0x40) { + if (pps_state>PPS_S_WAIT_PPS3 && pps_cur[1]&0x40) { pps[pps_i++] = pps_cur[4]; } - pps[pps_i++] = pps_cur[5]; + if (pps_state>PPS_S_WAIT_PCK) { + pps[pps_i++] = pps_cur[5]; + } /* Show activity on LED */ led_blink(LED_GREEN, BLINK_2O_F); /* Print PPS */ - printf("PPS: "); + printf("PPS%s: ", complete ? "" : " (incomplete)"); for (uint8_t i=0; il2h = usb_msg->l1h + sizeof(*usb_msg_header); struct sniff_data *usb_sniff_data_pps; usb_sniff_data_pps = (struct sniff_data *) msgb_put(usb_msg, sizeof(*usb_sniff_data_pps)); - usb_sniff_data_pps->complete = true; + usb_sniff_data_pps->complete = complete; usb_sniff_data_pps->length = pps_i; uint8_t *data = msgb_put(usb_msg, usb_sniff_data_pps->length); memcpy(data, pps, pps_i); @@ -519,7 +528,8 @@ check ^= pps_cur[4]; } check ^= pps_cur[5]; - usb_send_pps(); /* send PPS to host software using USB */ + pps_state = PPS_S_WAIT_END; + usb_send_pps(true); /* send PPS to host software using USB */ if (ISO7816_S_IN_PPS_REQ==iso_state) { if (0==check) { /* checksum is valid */ change_state(ISO7816_S_WAIT_PPS_RSP); /* go to next state */ @@ -545,15 +555,20 @@ change_state(ISO7816_S_WAIT_TPDU); /* go to next state */ } break; + case PPS_S_WAIT_END: + TRACE_WARNING("Unexpected PPS received %u\n\r", pps_state); + break; default: - TRACE_INFO("Unknown PPS state %u\n\r", pps_state); + TRACE_WARNING("Unknown PPS state %u\n\r", pps_state); + break; } } /*! Send current TPDU over USB - * @note Also print the TPDU over serial + * @param[in] complete if the TPDU is complete + * @note Also print the TPDU over the debug console */ -static void usb_send_tpdu(void) +static void usb_send_tpdu(bool complete) { /* Check state */ if (ISO7816_S_IN_TPDU!=iso_state) { @@ -565,8 +580,8 @@ led_blink(LED_GREEN, BLINK_2O_F); /* Print TPDU */ - printf("TPDU: "); - for (uint8_t i=0; il1h; memset(usb_msg_header, 0, sizeof(*usb_msg_header)); usb_msg_header->msg_class = SIMTRACE_MSGC_SNIFF; - usb_msg_header->msg_type = SIMTRACE_MSGT_SNIFF_ATR; + usb_msg_header->msg_type = SIMTRACE_MSGT_SNIFF_TPDU; usb_msg->l2h = usb_msg->l1h + sizeof(*usb_msg_header); struct sniff_data *usb_sniff_data_tpdu; usb_sniff_data_tpdu = (struct sniff_data *) msgb_put(usb_msg, sizeof(*usb_sniff_data_tpdu)); - usb_sniff_data_tpdu->complete = true; + usb_sniff_data_tpdu->complete = complete; usb_sniff_data_tpdu->length = tpdu_packet_i; uint8_t *data = msgb_put(usb_msg, usb_sniff_data_tpdu->length); memcpy(data, tpdu_packet, tpdu_packet_i); @@ -656,7 +671,7 @@ break; case TPDU_S_SW2: tpdu_packet[tpdu_packet_i++] = byte; - usb_send_tpdu(); /* send TPDU to host software using USB */ + usb_send_tpdu(true); /* send TPDU to host software using USB */ change_state(ISO7816_S_WAIT_TPDU); /* this is the end of the TPDU */ break; case TPDU_S_DATA_SINGLE: -- To view, visit https://gerrit.osmocom.org/9879 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ib070aca181042b477f1ffec48d63dc56c1e4609a Gerrit-Change-Number: 9879 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 08:58:57 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 08:58:57 +0000 Subject: Change in simtrace2[master]: sniffing: fix procedure byte handling and make TPDU parsing for strict Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9880 Change subject: sniffing: fix procedure byte handling and make TPDU parsing for strict ...................................................................... sniffing: fix procedure byte handling and make TPDU parsing for strict Change-Id: If991152f11c4b864ab1386f21dc13c335e6b281f --- M firmware/libcommon/source/sniffer.c 1 file changed, 12 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/80/9880/1 diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index c14a176..3719796 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -176,7 +176,7 @@ */ uint8_t tpdu_packet[5+256+2]; /*! Current index in TPDU packet */ -uint8_t tpdu_packet_i = 0; +uint16_t tpdu_packet_i = 0; /*------------------------------------------------------------------------------ * Internal functions @@ -625,13 +625,19 @@ case TPDU_S_CLA: if (0xff==byte) { TRACE_WARNING("0xff is not a valid class byte\n\r"); - break; + change_state(ISO7816_S_WAIT_TPDU); /* go back to TPDU state */ + return; } tpdu_packet_i = 0; tpdu_packet[tpdu_packet_i++] = byte; tpdu_state = TPDU_S_INS; break; case TPDU_S_INS: + if ((0x60==(byte&0xf0)) || (0x90==(byte&0xf0))) { + TRACE_WARNING("invalid CLA 0x%02x\n\r", byte); + change_state(ISO7816_S_WAIT_TPDU); /* go back to TPDU state */ + return; + } tpdu_packet_i = 1; tpdu_packet[tpdu_packet_i++] = byte; tpdu_state = TPDU_S_P1; @@ -667,6 +673,8 @@ tpdu_state = TPDU_S_SW2; } else { TRACE_WARNING("invalid SW1 0x%02x\n\r", byte); + change_state(ISO7816_S_WAIT_TPDU); /* go back to TPDU state */ + return; } break; case TPDU_S_SW2: @@ -679,11 +687,11 @@ tpdu_packet[tpdu_packet_i++] = byte; if (0==tpdu_packet[4]) { if (5+256<=tpdu_packet_i) { - tpdu_state = TPDU_S_SW1; + tpdu_state = TPDU_S_PROCEDURE; } } else { if (5+tpdu_packet[4]<=tpdu_packet_i) { - tpdu_state = TPDU_S_SW1; + tpdu_state = TPDU_S_PROCEDURE; } } if (TPDU_S_DATA_SINGLE==tpdu_state) { -- To view, visit https://gerrit.osmocom.org/9880 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: If991152f11c4b864ab1386f21dc13c335e6b281f Gerrit-Change-Number: 9880 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 08:58:58 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 08:58:58 +0000 Subject: Change in simtrace2[master]: sniffing: decrease USB IRQ prioprity to prevent USART overrun Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9881 Change subject: sniffing: decrease USB IRQ prioprity to prevent USART overrun ...................................................................... sniffing: decrease USB IRQ prioprity to prevent USART overrun Handling the USB message queue is done in an ISR and take quite some time. This can cause a USART/SIM sniffing buffer overrun, resulting in data loss. By setting the USB IRQ lower than the USART IRQ, the USB ISR can be interrupted (for short) and no data gets lost. Change-Id: I870a0aa8e251bbb53249c54bfcaa45de5b5a9486 --- M firmware/libcommon/source/sniffer.c 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/81/9881/1 diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 3719796..70d3734 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -829,6 +829,10 @@ sniff_usart.base->US_RTOR = 9600-12; /* -12 because the timer starts at the end of the 12 ETU frame */ /* Enable interrupt to indicate when data has been received or timeout occurred */ USART_EnableIt(sniff_usart.base, US_IER_RXRDY | US_IER_TIMEOUT); + /* Set USB priority lower than USART to not miss sniffing data (both at 0 per default) */ + if (NVIC_GetPriority(IRQ_USART_SIM)>=NVIC_GetPriority(UDP_IRQn)) { + NVIC_SetPriority(UDP_IRQn, NVIC_GetPriority(IRQ_USART_SIM)+2); + } /* Enable interrupt requests for the USART peripheral */ NVIC_EnableIRQ(IRQ_USART_SIM); -- To view, visit https://gerrit.osmocom.org/9881 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I870a0aa8e251bbb53249c54bfcaa45de5b5a9486 Gerrit-Change-Number: 9881 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 08:58:58 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 08:58:58 +0000 Subject: Change in simtrace2[master]: sniffer: add waiting time WT update Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9882 Change subject: sniffer: add waiting time WT update ...................................................................... sniffer: add waiting time WT update the waiting time (WT) is used to detect timeouts (e.g. for unresponsive card or just to signal an error/NAK). it is essential to detect to timeout to end current data transfer (e.g. change state). by default (after a reset) to timeout is 9600 ETU, but this can change at two places: - after the ATR using the value of TC2 (if present) - after a PPS (only F is used, and not D) because the timeout value can be larger than the 16-bit of the USART TO register, an external variable needs to be used for the count down. Change-Id: I9735660ffce161cec8d4e63fa60a66fc8ef57525 --- M firmware/libcommon/source/sniffer.c 1 file changed, 66 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/82/9882/1 diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 70d3734..e6fe68f 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -178,6 +178,11 @@ /*! Current index in TPDU packet */ uint16_t tpdu_packet_i = 0; +/*! Waiting Time (WT) + * @note defined in ISO/IEC 7816-3:2006(E) section 8.1 and 10.2 + */ +uint32_t wt = 9600; + /*------------------------------------------------------------------------------ * Internal functions *------------------------------------------------------------------------------*/ @@ -188,6 +193,27 @@ */ static const uint8_t convention_convert_lut[256] = { 0xff, 0x7f, 0xbf, 0x3f, 0xdf, 0x5f, 0x9f, 0x1f, 0xef, 0x6f, 0xaf, 0x2f, 0xcf, 0x4f, 0x8f, 0x0f, 0xf7, 0x77, 0xb7, 0x37, 0xd7, 0x57, 0x97, 0x17, 0xe7, 0x67, 0xa7, 0x27, 0xc7, 0x47, 0x87, 0x07, 0xfb, 0x7b, 0xbb, 0x3b, 0xdb, 0x5b, 0x9b, 0x1b, 0xeb, 0x6b, 0xab, 0x2b, 0xcb, 0x4b, 0x8b, 0x0b, 0xf3, 0x73, 0xb3, 0x33, 0xd3, 0x53, 0x93, 0x13, 0xe3, 0x63, 0xa3, 0x23, 0xc3, 0x43, 0x83, 0x03, 0xfd, 0x7d, 0xbd, 0x3d, 0xdd, 0x5d, 0x9d, 0x1d, 0xed, 0x6d, 0xad, 0x2d, 0xcd, 0x4d, 0x8d, 0x0d, 0xf5, 0x75, 0xb5, 0x35, 0xd5, 0x55, 0x95, 0x15, 0xe5, 0x65, 0xa5, 0x25, 0xc5, 0x45, 0x85, 0x05, 0xf9, 0x79, 0xb9, 0x39, 0xd9, 0x59, 0x99, 0x19, 0xe9, 0x69, 0xa9, 0x29, 0xc9, 0x49, 0x89, 0x09, 0xf1, 0x71, 0xb1, 0x31, 0xd1, 0x51, 0x91, 0x11, 0xe1, 0x61, 0xa1, 0x21, 0xc1, 0x41, 0x81, 0x01, 0xfe, 0x7e, 0xbe, 0x3e, 0xde, 0x5e, 0x9e, 0x1e, 0xee, 0x6e, 0xae, 0x2e, 0xce, 0x4e, 0x8e, 0x0e, 0xf6, 0x76, 0xb6, 0x36, 0xd6, 0x56, 0x96, 0x16, 0xe6, 0x66, 0xa6, 0x26, 0xc6, 0x46, 0x86, 0x06, 0xfa, 0x7a, 0xba, 0x3a, 0xda, 0x5a, 0x9a, 0x1a, 0xea, 0x6a, 0xaa, 0x2a, 0xca, 0x4a, 0x8a, 0x0a, 0xf2, 0x72, 0xb2, 0x32, 0xd2, 0x52, 0x92, 0x12, 0xe2, 0x62, 0xa2, 0x22, 0xc2, 0x42, 0x82, 0x02, 0xfc, 0x7c, 0xbc, 0x3c, 0xdc, 0x5c, 0x9c, 0x1c, 0xec, 0x6c, 0xac, 0x2c, 0xcc, 0x4c, 0x8c, 0x0c, 0xf4, 0x74, 0xb4, 0x34, 0xd4, 0x54, 0x94, 0x14, 0xe4, 0x64, 0xa4, 0x24, 0xc4, 0x44, 0x84, 0x04, 0xf8, 0x78, 0xb8, 0x38, 0xd8, 0x58, 0x98, 0x18, 0xe8, 0x68, 0xa8, 0x28, 0xc8, 0x48, 0x88, 0x08, 0xf0, 0x70, 0xb0, 0x30, 0xd0, 0x50, 0x90, 0x10, 0xe0, 0x60, 0xa0, 0x20, 0xc0, 0x40, 0x80, 0x00, }; +/*! Update Waiting Time (WT) + * @param[in] wi Waiting Integer (0 if unchanged) + * @param[in] d Baud Rate divider (0 if unchanged) + * @note set wt to be used by the receiver timeout + * @note defined in ISO/IEC 7816-3:2006(E) section 8.1 and 10.2 + */ +static void update_wt(uint8_t wi, uint8_t d) +{ + static uint8_t wt_wi = 10; /* Waiting time Integer (WI), used to calculate the Waiting Time (WT) */ + static uint8_t wt_d = 1; /* baud rate adjustment integer (the actual value, not the table index) */ + + if (0!=wi) { + wt_wi = wi; + } + if (0!=d) { + wt_d = d; + } + wt = wt_wi*960UL*wt_d; + TRACE_INFO("WT updated to %u\n\r", wt); +} + /*! Update the ISO 7816-3 state * @param[in] iso_state_new new ISO 7816-3 state to update to */ @@ -203,6 +229,7 @@ switch (iso_state_new) { case ISO7816_S_RESET: update_fidi(sniff_usart.base, 0x11); /* reset baud rate to default Di/Fi values */ + update_wt(10, 1); /* reset WT time-out */ change_flags |= SNIFF_CHANGE_FLAG_RESET_HOLD; /* set flag and let main loop send it */ break; case ISO7816_S_WAIT_ATR: @@ -287,6 +314,7 @@ { static uint8_t atr_hist_len = 0; /* store the number of expected historical bytes */ static uint8_t y = 0; /* last mask of the upcoming TA, TB, TC, TD interface bytes */ + static uint8_t i = 0; /* interface byte subgroup number */ /* sanity check */ if (ISO7816_S_IN_ATR!=iso_state) { @@ -316,6 +344,7 @@ atr_i--; /* revert last byte */ TRACE_WARNING("Invalid TS received\n\r"); } + i = 0; /* first interface byte sub-group is coming (T0 is kind of TD0) */ break; case ATR_S_WAIT_T0: /* see ISO/IEC 7816-3:2006 section 8.2.2 */ case ATR_S_WAIT_TD: /* see ISO/IEC 7816-3:2006 section 8.2.3 */ @@ -325,6 +354,7 @@ t_protocol_support |= (1<<(byte&0x0f)); /* remember supported protocol to know if TCK will be present */ } y = (byte&0xf0); /* remember upcoming interface bytes */ + i++; /* next interface byte sub-group is coming */ if (y&0x10) { atr_state = ATR_S_WAIT_TA; /* wait for interface byte TA */ break; @@ -340,6 +370,14 @@ break; } case ATR_S_WAIT_TC: /* see ISO/IEC 7816-3:2006 section 8.2.3 */ + /* retrieve WI encoded in TC2*/ + if (ATR_S_WAIT_TC==atr_state && 2==i) { + if (0==byte) { + update_wt(10, 0); + } else { + update_wt(byte, 0); + } + } if (y&0x80) { atr_state = ATR_S_WAIT_TD; /* wait for interface byte TD */ break; @@ -548,6 +586,7 @@ } TRACE_INFO("PPS negotiation successful: Fn=%u Dn=%u\n\r", fi_table[fn], di_table[dn]); update_fidi(sniff_usart.base, pps_cur[2]); + update_wt(0, di_table[dn]); usb_send_fidi(pps_cur[2]); /* send Fi/Di change notification to host software over USB */ } else { /* checksum is invalid */ TRACE_INFO("PPS negotiation failed\n\r"); @@ -706,6 +745,9 @@ /*! Interrupt Service Routine called on USART activity */ void Sniffer_usart_isr(void) { + /* Remaining Waiting Time (WI) counter (>16 bits) */ + static volatile uint32_t wt_remaining = 9600; + /* Read channel status register */ uint32_t csr = sniff_usart.base->US_CSR; /* Verify if there was an error */ @@ -717,10 +759,13 @@ TRACE_WARNING("USART framing error\n\r"); sniff_usart.base->US_CR |= US_CR_RSTSTA; } + /* Verify if character has been received */ if (csr & US_CSR_RXRDY) { /* Read communication data byte between phone and SIM */ uint8_t byte = sniff_usart.base->US_RHR; + /* Reset WT timer */ + wt_remaining = wt; /* Store sniffed data into buffer (also clear interrupt */ if (rbuf_is_full(&sniff_buffer)) { TRACE_ERROR("USART buffer full\n\r"); @@ -728,13 +773,28 @@ rbuf_write(&sniff_buffer, byte); } } - + /* Verify it WT timeout occurred, to detect unresponsive card */ if (csr & US_CSR_TIMEOUT) { - /* Stop timeout until next character is received */ + if (wt_remaining<=(sniff_usart.base->US_RTOR&0xffff)) { + /* Just set the flag and let the main loop handle it */ + change_flags |= SNIFF_CHANGE_FLAG_TIMEOUT_WT; + /* Reset timeout value */ + wt_remaining = wt; + } else { + wt_remaining -= (sniff_usart.base->US_RTOR&0xffff); /* be sure to subtract the actual timeout since the new might not have been set and reloaded yet */ + } + if (wt_remaining>0xffff) { + sniff_usart.base->US_RTOR = 0xffff; + } else { + sniff_usart.base->US_RTOR = wt_remaining; + } + /* Stop timeout until next character is received (and clears the timeout flag) */ sniff_usart.base->US_CR |= US_CR_STTTO; - /* Just set the flag and let the main loop handle it */ - change_flags |= SNIFF_CHANGE_FLAG_TIMEOUT_WT; + if (!(change_flags & SNIFF_CHANGE_FLAG_TIMEOUT_WT)) { + /* Immediately restart the counter it the WT timeout did not occur (needs the timeout flag to be cleared) */ + sniff_usart.base->US_CR |= US_CR_RETTO; + } } } @@ -825,8 +885,8 @@ ISO7816_Init(&sniff_usart, CLK_SLAVE); /* Only receive data when sniffing */ USART_SetReceiverEnabled(sniff_usart.base, 1); - /* Enable Receiver time-out WT to detect unresponsive cards */ - sniff_usart.base->US_RTOR = 9600-12; /* -12 because the timer starts at the end of the 12 ETU frame */ + /* Enable Receiver time-out to detect waiting time (WT) time-out (e.g. unresponsive cards) */ + sniff_usart.base->US_RTOR = wt; /* Enable interrupt to indicate when data has been received or timeout occurred */ USART_EnableIt(sniff_usart.base, US_IER_RXRDY | US_IER_TIMEOUT); /* Set USB priority lower than USART to not miss sniffing data (both at 0 per default) */ -- To view, visit https://gerrit.osmocom.org/9882 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I9735660ffce161cec8d4e63fa60a66fc8ef57525 Gerrit-Change-Number: 9882 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 09:10:14 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 4 Jul 2018 09:10:14 +0000 Subject: Change in pysim[master]: wip-wmsim-support Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/9883 Change subject: wip-wmsim-support ...................................................................... wip-wmsim-support Change-Id: I559ac47210a25f7a2010843d9329905f219fe295 --- M pySim/cards.py 1 file changed, 61 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/83/9883/1 diff --git a/pySim/cards.py b/pySim/cards.py index 0c9c2b8..262ffc7 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -736,11 +736,71 @@ # write EF.IMSI data, sw = self._scc.update_binary('6f07', enc_imsi(p['imsi'])) +class WavemobileSim(Card): + """ + WavemobileSim + + """ + + name = 'Wavemobile SIM' + + def __init__(self, ssc): + super(WavemobileSim, self).__init__(ssc) + self._adm_chv_num = 0x0A + self._scc.cla_byte = "00" + self._scc.sel_ctrl = "0004" #request an FCP + + @classmethod + def autodetect(kls, scc): + try: + # Look for ATR + if scc.get_atr() == toBytes("3B 9F 95 80 1F C7 80 31 E0 73 F6 21 13 67 4D 45 16 00 43 01 00 8F"): + return kls(scc) + except: + return None + return None + + def program(self, p): + if not p['pin_adm']: + raise ValueError("Please provide a PIN-ADM as there is no default one") + sw = self.verify_adm(h2b(p['pin_adm'])) + if sw != '9000': + raise RuntimeError('Failed to authenticate with ADM key %s'%(p['pin_adm'],)) + + if p.get('smsp') is not None: + sw = self.update_smsp(p['smsp']) + if sw != '9000': + print("Programming SMSP failed with code %s"%sw) + + if p.get('imsi') is not None: + sw = self.update_imsi(p['imsi']) + if sw != '9000': + print("Programming IMSI failed with code %s"%sw) + + print "========================== NOW READ RECORD ON EF SMSP ==========================" + print self._scc.read_record(EF['SMSP'], 1); + print "========================== NOW READ BINARY ON EF IMSI ==========================" + print self._scc.read_binary(EF['IMSI']); + + r = self._scc.select_file(['3F00']) + r = self._scc.select_file(['7f20']) + print self._scc.read_binary(['6f07']); + + +# r = self._scc.select_file(['ADF0']) + + + print "No program yet!" + return None + + def erase(self): + return + # In order for autodetection ... _cards_classes = [ FakeMagicSim, SuperSim, MagicSim, GrcardSim, SysmoSIMgr1, SysmoSIMgr2, SysmoUSIMgr1, SysmoUSIMSJS1, - FairwavesSIM, OpenCellsSim ] + FairwavesSIM, OpenCellsSim, WavemobileSim ] def card_autodetect(scc): for kls in _cards_classes: -- To view, visit https://gerrit.osmocom.org/9883 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I559ac47210a25f7a2010843d9329905f219fe295 Gerrit-Change-Number: 9883 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 09:10:15 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 4 Jul 2018 09:10:15 +0000 Subject: Change in pysim[master]: pysim-prog: add commandline option to probe cards Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/9884 Change subject: pysim-prog: add commandline option to probe cards ...................................................................... pysim-prog: add commandline option to probe cards In some situations it may be helpful to know the card name (type) we deal with in advance. So lets ad an to probe that only detects the card and then exists. - Add commandline option -T --probe Change-Id: I57422d3819d52fd215ac8f13f890729aad2af76f Related: OS#3376 --- M pySim-prog.py 1 file changed, 13 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/84/9884/1 diff --git a/pySim-prog.py b/pySim-prog.py index 1685d2b..eca8b4e 100755 --- a/pySim-prog.py +++ b/pySim-prog.py @@ -62,6 +62,10 @@ help="Card type (user -t list to view) [default: %default]", default="auto", ) + parser.add_option("-T", "--probe", dest="probe", + help="Determine card type", + default=False, action="store_true" + ) parser.add_option("-a", "--pin-adm", dest="pin_adm", help="ADM PIN used for provisioning (overwrites default)", ) @@ -156,6 +160,9 @@ print kls.name sys.exit(0) + if options.probe: + return options + if options.source == 'csv': if (options.imsi is None) and (options.batch_mode is False) and (options.read_imsi is False): parser.error("CSV mode needs either an IMSI, --read-imsi or batch mode") @@ -525,7 +532,7 @@ for kls in _cards_classes: card = kls.autodetect(scc) if card: - print "Autodetected card type %s" % card.name + print "Autodetected card type: %s" % card.name card.reset() break @@ -540,7 +547,7 @@ card = ctypes[opts.type](scc) else: - raise ValueError("Unknown card type %s" % opts.type) + raise ValueError("Unknown card type: %s" % opts.type) return card @@ -589,6 +596,10 @@ else: sys.exit(-1) + # Probe only + if opts.probe: + break; + # Erase if requested if opts.erase: print "Formatting ..." -- To view, visit https://gerrit.osmocom.org/9884 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I57422d3819d52fd215ac8f13f890729aad2af76f Gerrit-Change-Number: 9884 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 09:15:17 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 4 Jul 2018 09:15:17 +0000 Subject: Change in pysim[master]: wip-wmsim-support In-Reply-To: References: Message-ID: dexter has abandoned this change. ( https://gerrit.osmocom.org/9883 ) Change subject: wip-wmsim-support ...................................................................... Abandoned accidentally pushed, this is not ready yet -- To view, visit https://gerrit.osmocom.org/9883 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: I559ac47210a25f7a2010843d9329905f219fe295 Gerrit-Change-Number: 9883 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 10:05:47 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 10:05:47 +0000 Subject: Change in simtrace2[master]: ISO7816: change update_fidi to use provided USART In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9853 to look at the new patch set (#3). Change subject: ISO7816: change update_fidi to use provided USART ...................................................................... ISO7816: change update_fidi to use provided USART Also disables write protection for USART register if required Change-Id: I716f4bc3a22800cbce402b146f14ef8b2aab2a98 --- M firmware/libcommon/include/simtrace.h M firmware/libcommon/source/simtrace_iso7816.c 2 files changed, 23 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/53/9853/3 -- To view, visit https://gerrit.osmocom.org/9853 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I716f4bc3a22800cbce402b146f14ef8b2aab2a98 Gerrit-Change-Number: 9853 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 10:05:47 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 10:05:47 +0000 Subject: Change in simtrace2[master]: sniffer: use ISR to store sniffed data in buffer, add ATR and PPS par... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9855 to look at the new patch set (#3). Change subject: sniffer: use ISR to store sniffed data in buffer, add ATR and PPS parsing, and PPS related FiDi update ...................................................................... sniffer: use ISR to store sniffed data in buffer, add ATR and PPS parsing, and PPS related FiDi update Change-Id: I4b38ce1d80e370fda6aa181e959ba3f1286bb922 --- M firmware/libcommon/source/sniffer.c 1 file changed, 362 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/55/9855/3 -- To view, visit https://gerrit.osmocom.org/9855 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4b38ce1d80e370fda6aa181e959ba3f1286bb922 Gerrit-Change-Number: 9855 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 10:05:47 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 10:05:47 +0000 Subject: Change in simtrace2[master]: update_fidi: remove debug output since this function is called in tim... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9863 to look at the new patch set (#2). Change subject: update_fidi: remove debug output since this function is called in time critical ISR ...................................................................... update_fidi: remove debug output since this function is called in time critical ISR Change-Id: I08f407d407a18dae3f360ddc64769ddfaeb5b559 --- M firmware/libcommon/source/simtrace_iso7816.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/63/9863/2 -- To view, visit https://gerrit.osmocom.org/9863 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I08f407d407a18dae3f360ddc64769ddfaeb5b559 Gerrit-Change-Number: 9863 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 10:05:47 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 10:05:47 +0000 Subject: Change in simtrace2[master]: sniff: add TPDU parsing (TPDUs become APDUs on the upper layer) In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9866 to look at the new patch set (#2). Change subject: sniff: add TPDU parsing (TPDUs become APDUs on the upper layer) ...................................................................... sniff: add TPDU parsing (TPDUs become APDUs on the upper layer) Change-Id: I09d050d95bd2ab140fe6b4926a37278eb08cc347 --- M firmware/libcommon/source/sniffer.c 1 file changed, 142 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/66/9866/2 -- To view, visit https://gerrit.osmocom.org/9866 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I09d050d95bd2ab140fe6b4926a37278eb08cc347 Gerrit-Change-Number: 9866 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 10:05:47 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 10:05:47 +0000 Subject: Change in simtrace2[master]: sniff: print parsed ATR and PPS; use red LED to show main application... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9865 to look at the new patch set (#2). Change subject: sniff: print parsed ATR and PPS; use red LED to show main application is running; use green LED to indicate activity (message parsed) ...................................................................... sniff: print parsed ATR and PPS; use red LED to show main application is running; use green LED to indicate activity (message parsed) Change-Id: I8e906bdbf2c91e608757ae442dfb241f981b8f1e --- M firmware/apps/trace/main.c M firmware/libcommon/source/sniffer.c 2 files changed, 56 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/65/9865/2 -- To view, visit https://gerrit.osmocom.org/9865 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8e906bdbf2c91e608757ae442dfb241f981b8f1e Gerrit-Change-Number: 9865 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 10:05:47 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 10:05:47 +0000 Subject: Change in simtrace2[master]: sniff: add WT timeout detection using USART timeout (TC is not required) In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9867 to look at the new patch set (#2). Change subject: sniff: add WT timeout detection using USART timeout (TC is not required) ...................................................................... sniff: add WT timeout detection using USART timeout (TC is not required) Change-Id: I4ec6e812e7e1eb91005027d2e864fc315550d79c --- M firmware/libcommon/source/sniffer.c 1 file changed, 28 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/67/9867/2 -- To view, visit https://gerrit.osmocom.org/9867 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4ec6e812e7e1eb91005027d2e864fc315550d79c Gerrit-Change-Number: 9867 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 10:05:47 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 10:05:47 +0000 Subject: Change in simtrace2[master]: sniffer USB: implement USB communication and send parsed messages In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9873 to look at the new patch set (#2). Change subject: sniffer USB: implement USB communication and send parsed messages ...................................................................... sniffer USB: implement USB communication and send parsed messages Change-Id: Ice7817480705f2124b08c1ff9a8826558b6d8b2b --- M firmware/libcommon/source/sniffer.c 1 file changed, 234 insertions(+), 62 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/73/9873/2 -- To view, visit https://gerrit.osmocom.org/9873 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ice7817480705f2124b08c1ff9a8826558b6d8b2b Gerrit-Change-Number: 9873 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 10:05:47 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 10:05:47 +0000 Subject: Change in simtrace2[master]: sniffer: display F and D values frim PPS In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9875 to look at the new patch set (#2). Change subject: sniffer: display F and D values frim PPS ...................................................................... sniffer: display F and D values frim PPS Change-Id: I3641dcb6c24695a6d3dd3a1ee4333f56a07c99f0 --- M firmware/libcommon/include/iso7816_fidi.h M firmware/libcommon/source/iso7816_fidi.c M firmware/libcommon/source/sniffer.c 3 files changed, 9 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/75/9875/2 -- To view, visit https://gerrit.osmocom.org/9875 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3641dcb6c24695a6d3dd3a1ee4333f56a07c99f0 Gerrit-Change-Number: 9875 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 10:05:47 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 10:05:47 +0000 Subject: Change in simtrace2[master]: sniffing: move conversion convertion and flag processing from ISR to ... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9878 to look at the new patch set (#2). Change subject: sniffing: move conversion convertion and flag processing from ISR to main loop to keep ISR fast and focus on data capture ...................................................................... sniffing: move conversion convertion and flag processing from ISR to main loop to keep ISR fast and focus on data capture Change-Id: Ieefa8a5f81dbcc12c1ad3059660dbffa0c1a4961 --- M firmware/libcommon/source/sniffer.c M host/simtrace2-sniff.c 2 files changed, 98 insertions(+), 73 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/78/9878/2 -- To view, visit https://gerrit.osmocom.org/9878 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ieefa8a5f81dbcc12c1ad3059660dbffa0c1a4961 Gerrit-Change-Number: 9878 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 10:05:47 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 10:05:47 +0000 Subject: Change in simtrace2[master]: sniffer: also send incomplete (e.g. timeout) data (PPS/ATR/TPDU) In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9879 to look at the new patch set (#2). Change subject: sniffer: also send incomplete (e.g. timeout) data (PPS/ATR/TPDU) ...................................................................... sniffer: also send incomplete (e.g. timeout) data (PPS/ATR/TPDU) Change-Id: Ib070aca181042b477f1ffec48d63dc56c1e4609a --- M firmware/libcommon/source/sniffer.c 1 file changed, 42 insertions(+), 27 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/79/9879/2 -- To view, visit https://gerrit.osmocom.org/9879 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib070aca181042b477f1ffec48d63dc56c1e4609a Gerrit-Change-Number: 9879 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 10:05:47 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 10:05:47 +0000 Subject: Change in simtrace2[master]: sniffer: add waiting time WT update In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9882 to look at the new patch set (#2). Change subject: sniffer: add waiting time WT update ...................................................................... sniffer: add waiting time WT update the waiting time (WT) is used to detect timeouts (e.g. for unresponsive card or just to signal an error/NAK). it is essential to detect to timeout to end current data transfer (e.g. change state). by default (after a reset) to timeout is 9600 ETU, but this can change at two places: - after the ATR using the value of TC2 (if present) - after a PPS (only F is used, and not D) because the timeout value can be larger than the 16-bit of the USART TO register, an external variable needs to be used for the count down. Change-Id: I9735660ffce161cec8d4e63fa60a66fc8ef57525 --- M firmware/libcommon/source/sniffer.c 1 file changed, 66 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/82/9882/2 -- To view, visit https://gerrit.osmocom.org/9882 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9735660ffce161cec8d4e63fa60a66fc8ef57525 Gerrit-Change-Number: 9882 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 10:10:57 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 10:10:57 +0000 Subject: Change in simtrace2[master]: sniffer: also send incomplete (e.g. timeout) data (PPS/ATR/TPDU) In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9879 to look at the new patch set (#3). Change subject: sniffer: also send incomplete (e.g. timeout) data (PPS/ATR/TPDU) ...................................................................... sniffer: also send incomplete (e.g. timeout) data (PPS/ATR/TPDU) Change-Id: Ib070aca181042b477f1ffec48d63dc56c1e4609a --- M firmware/libcommon/source/sniffer.c 1 file changed, 45 insertions(+), 28 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/79/9879/3 -- To view, visit https://gerrit.osmocom.org/9879 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib070aca181042b477f1ffec48d63dc56c1e4609a Gerrit-Change-Number: 9879 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 10:22:30 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 10:22:30 +0000 Subject: Change in simtrace2[master]: sniff: add TPDU parsing (TPDUs become APDUs on the upper layer) In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9866 to look at the new patch set (#3). Change subject: sniff: add TPDU parsing (TPDUs become APDUs on the upper layer) ...................................................................... sniff: add TPDU parsing (TPDUs become APDUs on the upper layer) Change-Id: I09d050d95bd2ab140fe6b4926a37278eb08cc347 --- M firmware/libcommon/source/sniffer.c 1 file changed, 143 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/66/9866/3 -- To view, visit https://gerrit.osmocom.org/9866 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I09d050d95bd2ab140fe6b4926a37278eb08cc347 Gerrit-Change-Number: 9866 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 10:22:30 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 10:22:30 +0000 Subject: Change in simtrace2[master]: sniffer: also send incomplete (e.g. timeout) data (PPS/ATR/TPDU) In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9879 to look at the new patch set (#4). Change subject: sniffer: also send incomplete (e.g. timeout) data (PPS/ATR/TPDU) ...................................................................... sniffer: also send incomplete (e.g. timeout) data (PPS/ATR/TPDU) Change-Id: Ib070aca181042b477f1ffec48d63dc56c1e4609a --- M firmware/libcommon/source/sniffer.c 1 file changed, 43 insertions(+), 27 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/79/9879/4 -- To view, visit https://gerrit.osmocom.org/9879 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib070aca181042b477f1ffec48d63dc56c1e4609a Gerrit-Change-Number: 9879 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 10:22:30 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 10:22:30 +0000 Subject: Change in simtrace2[master]: sniffing: fix procedure byte handling and make TPDU parsing for strict In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9880 to look at the new patch set (#4). Change subject: sniffing: fix procedure byte handling and make TPDU parsing for strict ...................................................................... sniffing: fix procedure byte handling and make TPDU parsing for strict Change-Id: If991152f11c4b864ab1386f21dc13c335e6b281f --- M firmware/libcommon/source/sniffer.c 1 file changed, 12 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/80/9880/4 -- To view, visit https://gerrit.osmocom.org/9880 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If991152f11c4b864ab1386f21dc13c335e6b281f Gerrit-Change-Number: 9880 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 10:22:30 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 10:22:30 +0000 Subject: Change in simtrace2[master]: sniffing: decrease USB IRQ prioprity to prevent USART overrun In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9881 to look at the new patch set (#4). Change subject: sniffing: decrease USB IRQ prioprity to prevent USART overrun ...................................................................... sniffing: decrease USB IRQ prioprity to prevent USART overrun Handling the USB message queue is done in an ISR and take quite some time. This can cause a USART/SIM sniffing buffer overrun, resulting in data loss. By setting the USB IRQ lower than the USART IRQ, the USB ISR can be interrupted (for short) and no data gets lost. Change-Id: I870a0aa8e251bbb53249c54bfcaa45de5b5a9486 --- M firmware/libcommon/source/sniffer.c 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/81/9881/4 -- To view, visit https://gerrit.osmocom.org/9881 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I870a0aa8e251bbb53249c54bfcaa45de5b5a9486 Gerrit-Change-Number: 9881 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 10:22:30 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 10:22:30 +0000 Subject: Change in simtrace2[master]: sniffer: add waiting time WT update In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9882 to look at the new patch set (#4). Change subject: sniffer: add waiting time WT update ...................................................................... sniffer: add waiting time WT update the waiting time (WT) is used to detect timeouts (e.g. for unresponsive card or just to signal an error/NAK). it is essential to detect to timeout to end current data transfer (e.g. change state). by default (after a reset) to timeout is 9600 ETU, but this can change at two places: - after the ATR using the value of TC2 (if present) - after a PPS (only F is used, and not D) because the timeout value can be larger than the 16-bit of the USART TO register, an external variable needs to be used for the count down. Change-Id: I9735660ffce161cec8d4e63fa60a66fc8ef57525 --- M firmware/libcommon/source/sniffer.c 1 file changed, 66 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/82/9882/4 -- To view, visit https://gerrit.osmocom.org/9882 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9735660ffce161cec8d4e63fa60a66fc8ef57525 Gerrit-Change-Number: 9882 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 10:32:52 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 4 Jul 2018 10:32:52 +0000 Subject: Change in openbsc[master]: nat: Add VTY cmd paging-bss-forward to nat node Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9885 Change subject: nat: Add VTY cmd paging-bss-forward to nat node ...................................................................... nat: Add VTY cmd paging-bss-forward to nat node This command controls forward/drop of BSS paging messages from MSC to all BSCs connected to BSC-NAT. In situations in which MS don't generally roam from one BSC to another under the BSC-NAT, it may be beneficial (bandwidth wise) to drop these global paging commands, which are usually issued by the MSC if the location of the MS isn't known and LAC paging has failed. Change-Id: I737774543e0a8734d79b072e66e3c09e82b001d3 --- M openbsc/include/openbsc/bsc_nat.h M openbsc/src/osmo-bsc_nat/bsc_nat.c M openbsc/src/osmo-bsc_nat/bsc_nat_vty.c 3 files changed, 28 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/85/9885/1 diff --git a/openbsc/include/openbsc/bsc_nat.h b/openbsc/include/openbsc/bsc_nat.h index 5171c3e..3eba70d 100644 --- a/openbsc/include/openbsc/bsc_nat.h +++ b/openbsc/include/openbsc/bsc_nat.h @@ -262,6 +262,7 @@ int mgcp_length; int mgcp_ipa; int sdp_ensure_amr_mode_set; + int paging_bss_forward; /* msc things */ struct llist_head dests; diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c index 2c6c644..0559758 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c @@ -620,6 +620,10 @@ } if (discrim == CELL_IDENT_BSS) { + if (!nat->paging_bss_forward) { + LOGP(DNAT, LOGL_DEBUG, "Dropping BSS paging based on current config\n"); + return; + } /* All cells on the BSS are identified. */ llist_for_each_entry(bsc, &nat->bsc_connections, list_entry) { if (!bsc->authenticated) diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c b/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c index eba968a..15db664 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c @@ -186,6 +186,8 @@ vty_out(vty, " use-msc-ipa-for-mgcp%s", VTY_NEWLINE); vty_out(vty, " %ssdp-ensure-amr-mode-set%s", _nat->sdp_ensure_amr_mode_set ? "" : "no ", VTY_NEWLINE); + vty_out(vty, " %spaging-bss-forward%s", + _nat->paging_bss_forward ? "" : "no ", VTY_NEWLINE); config_write_bsc(vty); @@ -870,6 +872,24 @@ return CMD_SUCCESS; } +DEFUN(cfg_nat_paging_bss_forward, + cfg_nat_paging_bss_forward_cmd, + "paging-bss-forward", + "Forward Paging messages with BSS as Cell Identity Discriminator\n") +{ + _nat->paging_bss_forward = 1; + return CMD_SUCCESS; +} + +DEFUN(cfg_nat_no_paging_bss_forward, + cfg_nat_no_paging_bss_forward_cmd, + "no paging-bss-forward", + NO_STR "Forward Paging messages with BSS as Cell Identity Discriminator\n") +{ + _nat->paging_bss_forward = 0; + return CMD_SUCCESS; +} + /* per BSC configuration */ DEFUN(cfg_bsc, cfg_bsc_cmd, "bsc BSC_NR", "BSC configuration\n" "Identifier of the BSC\n") @@ -1374,6 +1394,9 @@ install_element(NAT_NODE, &cfg_nat_sdp_amr_mode_set_cmd); install_element(NAT_NODE, &cfg_nat_no_sdp_amr_mode_set_cmd); + install_element(NAT_NODE, &cfg_nat_paging_bss_forward_cmd); + install_element(NAT_NODE, &cfg_nat_no_paging_bss_forward_cmd); + install_element(NAT_NODE, &cfg_nat_pgroup_cmd); install_element(NAT_NODE, &cfg_nat_no_pgroup_cmd); install_node(&pgroup_node, config_write_pgroup); -- To view, visit https://gerrit.osmocom.org/9885 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I737774543e0a8734d79b072e66e3c09e82b001d3 Gerrit-Change-Number: 9885 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 10:52:46 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 10:52:46 +0000 Subject: Change in simtrace2[master]: host USB: add host application to receive and display USB sniffing me... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9874 to look at the new patch set (#4). Change subject: host USB: add host application to receive and display USB sniffing messages sent by firmware ...................................................................... host USB: add host application to receive and display USB sniffing messages sent by firmware Change-Id: Idefbf21e0bbd2a1e3647fe9aebaf88d1b62dae2d --- M firmware/libcommon/source/sniffer.c M host/Makefile A host/simtrace2-sniff.c 3 files changed, 537 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/74/9874/4 -- To view, visit https://gerrit.osmocom.org/9874 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Idefbf21e0bbd2a1e3647fe9aebaf88d1b62dae2d Gerrit-Change-Number: 9874 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 10:52:46 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 10:52:46 +0000 Subject: Change in simtrace2[master]: sniffer: also send incomplete (e.g. timeout) data (PPS/ATR/TPDU) In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9879 to look at the new patch set (#5). Change subject: sniffer: also send incomplete (e.g. timeout) data (PPS/ATR/TPDU) ...................................................................... sniffer: also send incomplete (e.g. timeout) data (PPS/ATR/TPDU) Change-Id: Ib070aca181042b477f1ffec48d63dc56c1e4609a --- M firmware/libcommon/source/sniffer.c 1 file changed, 42 insertions(+), 27 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/79/9879/5 -- To view, visit https://gerrit.osmocom.org/9879 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib070aca181042b477f1ffec48d63dc56c1e4609a Gerrit-Change-Number: 9879 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 10:52:46 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 10:52:46 +0000 Subject: Change in simtrace2[master]: sniffing: fix procedure byte handling and make TPDU parsing for strict In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9880 to look at the new patch set (#5). Change subject: sniffing: fix procedure byte handling and make TPDU parsing for strict ...................................................................... sniffing: fix procedure byte handling and make TPDU parsing for strict Change-Id: If991152f11c4b864ab1386f21dc13c335e6b281f --- M firmware/libcommon/source/sniffer.c 1 file changed, 12 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/80/9880/5 -- To view, visit https://gerrit.osmocom.org/9880 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If991152f11c4b864ab1386f21dc13c335e6b281f Gerrit-Change-Number: 9880 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 10:52:46 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 10:52:46 +0000 Subject: Change in simtrace2[master]: sniffing: decrease USB IRQ prioprity to prevent USART overrun In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9881 to look at the new patch set (#5). Change subject: sniffing: decrease USB IRQ prioprity to prevent USART overrun ...................................................................... sniffing: decrease USB IRQ prioprity to prevent USART overrun Handling the USB message queue is done in an ISR and take quite some time. This can cause a USART/SIM sniffing buffer overrun, resulting in data loss. By setting the USB IRQ lower than the USART IRQ, the USB ISR can be interrupted (for short) and no data gets lost. Change-Id: I870a0aa8e251bbb53249c54bfcaa45de5b5a9486 --- M firmware/libcommon/source/sniffer.c 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/81/9881/5 -- To view, visit https://gerrit.osmocom.org/9881 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I870a0aa8e251bbb53249c54bfcaa45de5b5a9486 Gerrit-Change-Number: 9881 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 10:52:46 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 10:52:46 +0000 Subject: Change in simtrace2[master]: sniffer: add waiting time WT update In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9882 to look at the new patch set (#5). Change subject: sniffer: add waiting time WT update ...................................................................... sniffer: add waiting time WT update the waiting time (WT) is used to detect timeouts (e.g. for unresponsive card or just to signal an error/NAK). it is essential to detect to timeout to end current data transfer (e.g. change state). by default (after a reset) to timeout is 9600 ETU, but this can change at two places: - after the ATR using the value of TC2 (if present) - after a PPS (only F is used, and not D) because the timeout value can be larger than the 16-bit of the USART TO register, an external variable needs to be used for the count down. Change-Id: I9735660ffce161cec8d4e63fa60a66fc8ef57525 --- M firmware/libcommon/source/sniffer.c 1 file changed, 66 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/82/9882/5 -- To view, visit https://gerrit.osmocom.org/9882 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9735660ffce161cec8d4e63fa60a66fc8ef57525 Gerrit-Change-Number: 9882 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 11:11:46 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 11:11:46 +0000 Subject: Change in simtrace2[master]: sniffer USB: implement USB communication and send parsed messages In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9873 to look at the new patch set (#4). Change subject: sniffer USB: implement USB communication and send parsed messages ...................................................................... sniffer USB: implement USB communication and send parsed messages Change-Id: Ice7817480705f2124b08c1ff9a8826558b6d8b2b --- M firmware/libcommon/source/sniffer.c 1 file changed, 235 insertions(+), 62 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/73/9873/4 -- To view, visit https://gerrit.osmocom.org/9873 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ice7817480705f2124b08c1ff9a8826558b6d8b2b Gerrit-Change-Number: 9873 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 11:11:46 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 11:11:46 +0000 Subject: Change in simtrace2[master]: sniffer: display F and D values frim PPS In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9875 to look at the new patch set (#5). Change subject: sniffer: display F and D values frim PPS ...................................................................... sniffer: display F and D values frim PPS Change-Id: I3641dcb6c24695a6d3dd3a1ee4333f56a07c99f0 --- M firmware/libcommon/include/iso7816_fidi.h M firmware/libcommon/source/iso7816_fidi.c M firmware/libcommon/source/sniffer.c 3 files changed, 9 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/75/9875/5 -- To view, visit https://gerrit.osmocom.org/9875 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3641dcb6c24695a6d3dd3a1ee4333f56a07c99f0 Gerrit-Change-Number: 9875 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 11:11:46 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 11:11:46 +0000 Subject: Change in simtrace2[master]: console: drop data to be send when buffer is already full In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9876 to look at the new patch set (#5). Change subject: console: drop data to be send when buffer is already full ...................................................................... console: drop data to be send when buffer is already full don't wait for space to be available in the buffer since since would prevent from processing non-console (e.g. debug) more important data Change-Id: Ia625b09eb30bb7b43edd3989f697d8ef33200f28 --- M firmware/libboard/common/source/uart_console.c 1 file changed, 8 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/76/9876/5 -- To view, visit https://gerrit.osmocom.org/9876 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia625b09eb30bb7b43edd3989f697d8ef33200f28 Gerrit-Change-Number: 9876 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 11:11:46 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 11:11:46 +0000 Subject: Change in simtrace2[master]: buffer: increase buffer size to 512 to cope with fast and long TPDUs In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9877 to look at the new patch set (#5). Change subject: buffer: increase buffer size to 512 to cope with fast and long TPDUs ...................................................................... buffer: increase buffer size to 512 to cope with fast and long TPDUs Change-Id: I194c90cf09306a982d80c5bf1222397af6e658a9 --- M firmware/libcommon/include/ringbuffer.h 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/77/9877/5 -- To view, visit https://gerrit.osmocom.org/9877 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I194c90cf09306a982d80c5bf1222397af6e658a9 Gerrit-Change-Number: 9877 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 11:11:46 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 11:11:46 +0000 Subject: Change in simtrace2[master]: sniffing: move conversion convertion and flag processing from ISR to ... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9878 to look at the new patch set (#5). Change subject: sniffing: move conversion convertion and flag processing from ISR to main loop to keep ISR fast and focus on data capture ...................................................................... sniffing: move conversion convertion and flag processing from ISR to main loop to keep ISR fast and focus on data capture Change-Id: Ieefa8a5f81dbcc12c1ad3059660dbffa0c1a4961 --- M firmware/libcommon/source/sniffer.c M host/simtrace2-sniff.c 2 files changed, 98 insertions(+), 73 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/78/9878/5 -- To view, visit https://gerrit.osmocom.org/9878 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ieefa8a5f81dbcc12c1ad3059660dbffa0c1a4961 Gerrit-Change-Number: 9878 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 11:11:46 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 11:11:46 +0000 Subject: Change in simtrace2[master]: sniffer: also send incomplete (e.g. timeout) data (PPS/ATR/TPDU) In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9879 to look at the new patch set (#6). Change subject: sniffer: also send incomplete (e.g. timeout) data (PPS/ATR/TPDU) ...................................................................... sniffer: also send incomplete (e.g. timeout) data (PPS/ATR/TPDU) Change-Id: Ib070aca181042b477f1ffec48d63dc56c1e4609a --- M firmware/libcommon/source/sniffer.c 1 file changed, 42 insertions(+), 27 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/79/9879/6 -- To view, visit https://gerrit.osmocom.org/9879 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib070aca181042b477f1ffec48d63dc56c1e4609a Gerrit-Change-Number: 9879 Gerrit-PatchSet: 6 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 11:11:46 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 11:11:46 +0000 Subject: Change in simtrace2[master]: sniffing: fix procedure byte handling and make TPDU parsing for strict In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9880 to look at the new patch set (#6). Change subject: sniffing: fix procedure byte handling and make TPDU parsing for strict ...................................................................... sniffing: fix procedure byte handling and make TPDU parsing for strict Change-Id: If991152f11c4b864ab1386f21dc13c335e6b281f --- M firmware/libcommon/source/sniffer.c 1 file changed, 12 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/80/9880/6 -- To view, visit https://gerrit.osmocom.org/9880 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If991152f11c4b864ab1386f21dc13c335e6b281f Gerrit-Change-Number: 9880 Gerrit-PatchSet: 6 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 11:11:46 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 11:11:46 +0000 Subject: Change in simtrace2[master]: sniffing: decrease USB IRQ prioprity to prevent USART overrun In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9881 to look at the new patch set (#6). Change subject: sniffing: decrease USB IRQ prioprity to prevent USART overrun ...................................................................... sniffing: decrease USB IRQ prioprity to prevent USART overrun Handling the USB message queue is done in an ISR and take quite some time. This can cause a USART/SIM sniffing buffer overrun, resulting in data loss. By setting the USB IRQ lower than the USART IRQ, the USB ISR can be interrupted (for short) and no data gets lost. Change-Id: I870a0aa8e251bbb53249c54bfcaa45de5b5a9486 --- M firmware/libcommon/source/sniffer.c 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/81/9881/6 -- To view, visit https://gerrit.osmocom.org/9881 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I870a0aa8e251bbb53249c54bfcaa45de5b5a9486 Gerrit-Change-Number: 9881 Gerrit-PatchSet: 6 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 11:11:46 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 11:11:46 +0000 Subject: Change in simtrace2[master]: sniffer: add waiting time WT update In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9882 to look at the new patch set (#6). Change subject: sniffer: add waiting time WT update ...................................................................... sniffer: add waiting time WT update the waiting time (WT) is used to detect timeouts (e.g. for unresponsive card or just to signal an error/NAK). it is essential to detect to timeout to end current data transfer (e.g. change state). by default (after a reset) to timeout is 9600 ETU, but this can change at two places: - after the ATR using the value of TC2 (if present) - after a PPS (only F is used, and not D) because the timeout value can be larger than the 16-bit of the USART TO register, an external variable needs to be used for the count down. Change-Id: I9735660ffce161cec8d4e63fa60a66fc8ef57525 --- M firmware/libcommon/source/sniffer.c 1 file changed, 66 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/82/9882/6 -- To view, visit https://gerrit.osmocom.org/9882 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9735660ffce161cec8d4e63fa60a66fc8ef57525 Gerrit-Change-Number: 9882 Gerrit-PatchSet: 6 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 11:22:19 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 11:22:19 +0000 Subject: Change in simtrace2[master]: host USB: add host application to receive and display USB sniffing me... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9874 to look at the new patch set (#6). Change subject: host USB: add host application to receive and display USB sniffing messages sent by firmware ...................................................................... host USB: add host application to receive and display USB sniffing messages sent by firmware Change-Id: Idefbf21e0bbd2a1e3647fe9aebaf88d1b62dae2d --- M host/Makefile A host/simtrace2-sniff.c 2 files changed, 538 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/74/9874/6 -- To view, visit https://gerrit.osmocom.org/9874 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Idefbf21e0bbd2a1e3647fe9aebaf88d1b62dae2d Gerrit-Change-Number: 9874 Gerrit-PatchSet: 6 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 11:22:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 11:22:48 +0000 Subject: Change in simtrace2[master]: copy working cardem app to trace In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9840 ) Change subject: copy working cardem app to trace ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9840 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I24b3500a0905cbd622507722280b3c7e7f188bde Gerrit-Change-Number: 9840 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 04 Jul 2018 11:22:48 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 11:23:40 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 11:23:40 +0000 Subject: Change in simtrace2[master]: sniff mode: handle USART 1 RX interrupt to show sniffer data In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9843 ) Change subject: sniff mode: handle USART 1 RX interrupt to show sniffer data ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9843 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5504369aed39844b7cf21e5b3ccb542daa6b946e Gerrit-Change-Number: 9843 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 04 Jul 2018 11:23:40 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 11:23:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 11:23:53 +0000 Subject: Change in simtrace2[master]: sniff: use USART 0 instead of USART 1 In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9845 ) Change subject: sniff: use USART 0 instead of USART 1 ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9845 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0597ec723cb2225540c89c3821b91d8a45adfcd6 Gerrit-Change-Number: 9845 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 04 Jul 2018 11:23:53 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 11:24:13 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 11:24:13 +0000 Subject: Change in simtrace2[master]: copy working cardem app to trace In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9840 ) Change subject: copy working cardem app to trace ...................................................................... copy working cardem app to trace because the applications share the board capabilities defined in libboard/*/include/board.h and USB configurations are enabled according to the previously defined capabilities in libcommon/source.usb.c, all applications actually offer the same functions. thus creating the trace application is only mainly a cosmetic change, as the sniffer function will also be present and enabled in the cardem application. Change-Id: I24b3500a0905cbd622507722280b3c7e7f188bde --- A firmware/apps/trace/Makefile M firmware/apps/trace/main.c A firmware/apps/trace/usb_strings.txt 3 files changed, 222 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/firmware/apps/trace/Makefile b/firmware/apps/trace/Makefile new file mode 100644 index 0000000..75c43e8 --- /dev/null +++ b/firmware/apps/trace/Makefile @@ -0,0 +1,3 @@ +C_FILES += $(C_LIBUSB_RT) + +C_FILES += card_emu.c cciddriver.c iso7816_4.c iso7816_fidi.c mitm.c mode_cardemu.c mode_ccid.c simtrace_iso7816.c sniffer.c tc_etu.c usb.c diff --git a/firmware/apps/trace/main.c b/firmware/apps/trace/main.c index e69de29..aabaa41 100644 --- a/firmware/apps/trace/main.c +++ b/firmware/apps/trace/main.c @@ -0,0 +1,209 @@ +// FIXME: Copyright license here +/*------------------------------------------------------------------------------ + * Headers + *------------------------------------------------------------------------------*/ + +#include "board.h" +#include "simtrace.h" +#include "utils.h" +#include "osmocom/core/timer.h" + +unsigned int g_unique_id[4]; + +/*------------------------------------------------------------------------------ + * Internal variables + *------------------------------------------------------------------------------*/ +typedef struct { + /* static initialization, called whether or not the usb config is active */ + void (*configure) (void); + /* initialization function after the config was selected */ + void (*init) (void); + /* de-initialization before selecting new config */ + void (*exit) (void); + /* main loop content for given configuration */ + void (*run) (void); + /* Interrupt handler for USART1 */ + void (*usart0_irq) (void); + /* Interrupt handler for USART1 */ + void (*usart1_irq) (void); +} conf_func; + +static const conf_func config_func_ptrs[] = { + /* array slot 0 is empty, usb configs start at 1 */ +#ifdef HAVE_SNIFFER + [CFG_NUM_SNIFF] = { + .configure = Sniffer_configure, + .init = Sniffer_init, + .exit = Sniffer_exit, + .run = Sniffer_run, + }, +#endif +#ifdef HAVE_CCID + [CFG_NUM_CCID] = { + .configure = CCID_configure, + .init = CCID_init, + .exit = CCID_exit, + .run = CCID_run, + }, +#endif +#ifdef HAVE_CARDEM + [CFG_NUM_PHONE] = { + .configure = mode_cardemu_configure, + .init = mode_cardemu_init, + .exit = mode_cardemu_exit, + .run = mode_cardemu_run, + .usart0_irq = mode_cardemu_usart0_irq, + .usart1_irq = mode_cardemu_usart1_irq, + }, +#endif +#ifdef HAVE_MITM + [CFG_NUM_MITM] = { + .configure = MITM_configure, + .init = MITM_init, + .exit = MITM_exit, + .run = MITM_run, + }, +#endif +}; + +/*------------------------------------------------------------------------------ + * Internal variables + *------------------------------------------------------------------------------*/ +#if defined(HAVE_SNIFFER) +static volatile enum confNum simtrace_config = CFG_NUM_SNIFF; +#elif defined(HAVE_CARDEM) +static volatile enum confNum simtrace_config = CFG_NUM_PHONE; +#elif defined(HAVE_CCID) +static volatile enum confNum simtrace_config = CFG_NUM_CCID; +#endif + +/*---------------------------------------------------------------------------- + * Callbacks + *----------------------------------------------------------------------------*/ + +void USBDDriverCallbacks_ConfigurationChanged(uint8_t cfgnum) +{ + TRACE_INFO_WP("cfgChanged%d ", cfgnum); + simtrace_config = cfgnum; +} + +void USART1_IrqHandler(void) +{ + if (config_func_ptrs[simtrace_config].usart1_irq) + config_func_ptrs[simtrace_config].usart1_irq(); +} + +void USART0_IrqHandler(void) +{ + if (config_func_ptrs[simtrace_config].usart0_irq) + config_func_ptrs[simtrace_config].usart0_irq(); +} + +/* returns '1' in case we should break any endless loop */ +static void check_exec_dbg_cmd(void) +{ + int ch; + + if (!UART_IsRxReady()) + return; + + ch = UART_GetChar(); + + board_exec_dbg_cmd(ch); +} + +/*------------------------------------------------------------------------------ + * Main + *------------------------------------------------------------------------------*/ +#define MAX_USB_ITER BOARD_MCK/72 // This should be around a second +extern int main(void) +{ + uint8_t isUsbConnected = 0; + enum confNum last_simtrace_config = simtrace_config; + unsigned int i = 0; + + led_init(); + led_blink(LED_RED, BLINK_3O_5F); + + /* Enable watchdog for 500ms, with no window */ + WDT_Enable(WDT, WDT_MR_WDRSTEN | WDT_MR_WDDBGHLT | WDT_MR_WDIDLEHLT | + (WDT_GetPeriod(500) << 16) | WDT_GetPeriod(500)); + + PIO_InitializeInterrupts(0); + + EEFC_ReadUniqueID(g_unique_id); + + printf("\n\r\n\r" + "=============================================================================\n\r" + "SIMtrace2 firmware " GIT_VERSION " (C) 2010-2016 by Harald Welte\n\r" + "=============================================================================\n\r"); + + TRACE_INFO("Chip ID: 0x%08x (Ext 0x%08x)\n\r", CHIPID->CHIPID_CIDR, CHIPID->CHIPID_EXID); + TRACE_INFO("Serial Nr. %08x-%08x-%08x-%08x\n\r", + g_unique_id[0], g_unique_id[1], + g_unique_id[2], g_unique_id[3]); + TRACE_INFO("Reset Cause: 0x%x\n\r", (RSTC->RSTC_SR & RSTC_SR_RSTTYP_Msk) >> RSTC_SR_RSTTYP_Pos); + + board_main_top(); + + TRACE_INFO("USB init...\n\r"); + SIMtrace_USB_Initialize(); + + while (USBD_GetState() < USBD_STATE_CONFIGURED) { + WDT_Restart(WDT); + check_exec_dbg_cmd(); +#if 0 + if (i >= MAX_USB_ITER * 3) { + TRACE_ERROR("Resetting board (USB could " + "not be configured)\n\r"); + USBD_Disconnect(); + NVIC_SystemReset(); + } +#endif + i++; + } + + TRACE_INFO("calling configure of all configurations...\n\r"); + for (i = 1; i < sizeof(config_func_ptrs) / sizeof(config_func_ptrs[0]); + ++i) { + if (config_func_ptrs[i].configure) + config_func_ptrs[i].configure(); + } + + TRACE_INFO("calling init of config %u...\n\r", simtrace_config); + config_func_ptrs[simtrace_config].init(); + last_simtrace_config = simtrace_config; + + TRACE_INFO("entering main loop...\n\r"); + while (1) { + WDT_Restart(WDT); +#if TRACE_LEVEL >= TRACE_LEVEL_DEBUG + const char rotor[] = { '-', '\\', '|', '/' }; + putchar('\b'); + putchar(rotor[i++ % ARRAY_SIZE(rotor)]); +#endif + check_exec_dbg_cmd(); + osmo_timers_prepare(); + osmo_timers_update(); + + if (USBD_GetState() < USBD_STATE_CONFIGURED) { + + if (isUsbConnected) { + isUsbConnected = 0; + } + } else if (isUsbConnected == 0) { + TRACE_INFO("USB is now configured\n\r"); + + isUsbConnected = 1; + } + if (last_simtrace_config != simtrace_config) { + TRACE_INFO("USB config chg %u -> %u\n\r", + last_simtrace_config, simtrace_config); + config_func_ptrs[last_simtrace_config].exit(); + config_func_ptrs[simtrace_config].init(); + last_simtrace_config = simtrace_config; + } else { + config_func_ptrs[simtrace_config].run(); + } + } +} diff --git a/firmware/apps/trace/usb_strings.txt b/firmware/apps/trace/usb_strings.txt new file mode 100644 index 0000000..0e797ac --- /dev/null +++ b/firmware/apps/trace/usb_strings.txt @@ -0,0 +1,10 @@ +sysmocom - s.f.m.c. GmbH +SIMtrace 2 compatible device +SIMtrace Sniffer +SIMtrace CCID +SIMtrace Phone +SIMtrace MITM +CardEmulator Modem 1 +CardEmulator Modem 2 +CardEmulator Modem 3 +CardEmulator Modem 4 -- To view, visit https://gerrit.osmocom.org/9840 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I24b3500a0905cbd622507722280b3c7e7f188bde Gerrit-Change-Number: 9840 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 11:24:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 11:24:14 +0000 Subject: Change in simtrace2[master]: enable (empty) sniffer support for SIMtrace board In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9841 ) Change subject: enable (empty) sniffer support for SIMtrace board ...................................................................... enable (empty) sniffer support for SIMtrace board Change-Id: I51619135fd6f5423542f261e7d76bab1a5713e2b --- M firmware/libboard/simtrace/include/board.h M firmware/libcommon/source/sniffer.c 2 files changed, 15 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/firmware/libboard/simtrace/include/board.h b/firmware/libboard/simtrace/include/board.h index 742ce7c..3b8296b 100644 --- a/firmware/libboard/simtrace/include/board.h +++ b/firmware/libboard/simtrace/include/board.h @@ -11,7 +11,7 @@ /** Phone (SIM card emulator)/CCID Reader/MITM configuration **/ /* Normally the communication lines between phone and SIM card are disconnected */ // Disconnect SIM card I/O, VPP line from the phone lines -// FIXME: Per default pins are input, therefore high-impedance, therefore they don not activate the bus switch, right? +// FIXME: Per default pins are input, therefore high-impedance, therefore the bus switch is in an unknown state by default for hardware version <= 1.4. It should be pulled high by an external resistor to set the bus switch to high-impedance (e.g. off). #define PIN_SC_SW_DEFAULT {PIO_PA20, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} // Disconnect SIM card RST, CLK line from the phone lines #define PIN_IO_SW_DEFAULT {PIO_PA19, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} @@ -82,7 +82,7 @@ #define BOARD_DFU_USB_PRODUCT_ID USB_PRODUCT_SIMTRACE2_DFU #define BOARD_USB_RELEASE 0x000 -//#define HAVE_SNIFFER +#define HAVE_SNIFFER #define HAVE_CCID #define HAVE_CARDEM //#define HAVE_MITM diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 67c11a2..06edb22 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -27,14 +27,15 @@ * ---------------------------------------------------------------------------- */ +#include "board.h" +#include "simtrace.h" + #ifdef HAVE_SNIFFER /*------------------------------------------------------------------------------ * Headers *------------------------------------------------------------------------------*/ -#include "board.h" - #include /*------------------------------------------------------------------------------ @@ -67,6 +68,12 @@ .state = USART_RCV, }; + +int check_data_from_phone(void) +{ + TRACE_INFO("check data from phone\n\r"); +} + /*----------------------------------------------------------------------------- * Initialization routine *-----------------------------------------------------------------------------*/ @@ -74,22 +81,22 @@ /* Called during USB enumeration after device is enumerated by host */ void Sniffer_configure(void) { - TRACE_INFO("Sniffer config\n"); + TRACE_INFO("Sniffer config\n\r"); } /* called when *different* configuration is set by host */ void Sniffer_exit(void) { - TRACE_INFO("Sniffer exit\n"); + TRACE_INFO("Sniffer exit\n\r"); USART_DisableIt(USART_PHONE, US_IER_RXRDY); NVIC_DisableIRQ(USART1_IRQn); USART_SetReceiverEnabled(USART_PHONE, 0); } -/* called when *CCID* configuration is set by host */ +/* called when *Sniffer* configuration is set by host */ void Sniffer_init(void) { - TRACE_INFO("Sniffer Init\n"); + TRACE_INFO("Sniffer Init\n\r"); /* Configure ISO7816 driver */ PIO_Configure(pinsISO7816_sniff, PIO_LISTSIZE(pinsISO7816_sniff)); PIO_Configure(pins_bus, PIO_LISTSIZE(pins_bus)); -- To view, visit https://gerrit.osmocom.org/9841 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I51619135fd6f5423542f261e7d76bab1a5713e2b Gerrit-Change-Number: 9841 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 11:24:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 11:24:15 +0000 Subject: Change in simtrace2[master]: sniff mode: handle USART 1 RX interrupt to show sniffer data In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9843 ) Change subject: sniff mode: handle USART 1 RX interrupt to show sniffer data ...................................................................... sniff mode: handle USART 1 RX interrupt to show sniffer data Change-Id: I5504369aed39844b7cf21e5b3ccb542daa6b946e --- M firmware/apps/trace/main.c M firmware/libcommon/include/simtrace.h M firmware/libcommon/source/sniffer.c 3 files changed, 36 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/firmware/apps/trace/main.c b/firmware/apps/trace/main.c index aabaa41..06c4176 100644 --- a/firmware/apps/trace/main.c +++ b/firmware/apps/trace/main.c @@ -36,6 +36,7 @@ .init = Sniffer_init, .exit = Sniffer_exit, .run = Sniffer_run, + .usart1_irq = Sniffer_usart1_irq, }, #endif #ifdef HAVE_CCID diff --git a/firmware/libcommon/include/simtrace.h b/firmware/libcommon/include/simtrace.h index 348cc57..21921ca 100644 --- a/firmware/libcommon/include/simtrace.h +++ b/firmware/libcommon/include/simtrace.h @@ -108,6 +108,8 @@ extern void mode_cardemu_run(void); extern void MITM_run( void ); +/* IRQ functions */ +extern void Sniffer_usart1_irq(void); extern void mode_cardemu_usart0_irq(void); extern void mode_cardemu_usart1_irq(void); diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 06edb22..fa272eb 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -58,7 +58,7 @@ /* Enable power converter 4.5-6V to 3.3V; low: off */ {SIM_PWEN, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT}, - /* Enable second power converter: VCC_PHONE to VCC_SIM; high: on */ + /* Enable power forwarding: VCC_PHONE to VCC_SIM; high: on */ {VCC_FWD, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} }; @@ -68,10 +68,37 @@ .state = USART_RCV, }; +/* Ring buffer to store sniffer communication data */ +static struct ringbuf sniff_buffer; + +/*------------------------------------------------------------------------------ + * Global functions + *------------------------------------------------------------------------------*/ + +void Sniffer_usart1_irq(void) +{ + /* Read channel status register */ + uint32_t csr = usart_info.base->US_CSR & usart_info.base->US_IMR; + /* Verify if character has been received */ + if (csr & US_CSR_RXRDY) { + /* Read communication data byte between phone and SIM */ + uint8_t byte = usart_info.base->US_RHR; + /* Store sniffed data into buffer (also clear interrupt */ + rbuf_write(&sniff_buffer, byte); + } +} + +/*------------------------------------------------------------------------------ + * Internal functions + *------------------------------------------------------------------------------*/ int check_data_from_phone(void) { - TRACE_INFO("check data from phone\n\r"); + /* Display sniffed data */ + while (!rbuf_is_empty(&sniff_buffer)) { + uint8_t byte = rbuf_read(&sniff_buffer); + TRACE_INFO_WP("0x%02x ", byte); + } } /*----------------------------------------------------------------------------- @@ -97,6 +124,10 @@ void Sniffer_init(void) { TRACE_INFO("Sniffer Init\n\r"); + + /* Clear ring buffer containing the sniffed data */ + rbuf_reset(&sniff_buffer); + /* Configure ISO7816 driver */ PIO_Configure(pinsISO7816_sniff, PIO_LISTSIZE(pinsISO7816_sniff)); PIO_Configure(pins_bus, PIO_LISTSIZE(pins_bus)); -- To view, visit https://gerrit.osmocom.org/9843 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I5504369aed39844b7cf21e5b3ccb542daa6b946e Gerrit-Change-Number: 9843 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 11:24:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 11:24:15 +0000 Subject: Change in simtrace2[master]: SIMtrace board: comment and fix pin definition In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9844 ) Change subject: SIMtrace board: comment and fix pin definition ...................................................................... SIMtrace board: comment and fix pin definition Change-Id: Ic77ad5bf6c00c9122c6bb0e12b90e6c5406855fd --- M firmware/libboard/simtrace/include/board.h 1 file changed, 90 insertions(+), 66 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/firmware/libboard/simtrace/include/board.h b/firmware/libboard/simtrace/include/board.h index 3b8296b..4648313 100644 --- a/firmware/libboard/simtrace/include/board.h +++ b/firmware/libboard/simtrace/include/board.h @@ -1,88 +1,112 @@ #pragma once #include "board_common.h" -/** Name of the board */ +/* Name of the board */ #define BOARD_NAME "SAM3S-SIMTRACE" -/** Board definition */ +/* Board definition */ #define simtrace +/* Board main oscillator frequency (in Hz) */ #define BOARD_MAINOSC 18432000 -/** Phone (SIM card emulator)/CCID Reader/MITM configuration **/ -/* Normally the communication lines between phone and SIM card are disconnected */ -// Disconnect SIM card I/O, VPP line from the phone lines -// FIXME: Per default pins are input, therefore high-impedance, therefore the bus switch is in an unknown state by default for hardware version <= 1.4. It should be pulled high by an external resistor to set the bus switch to high-impedance (e.g. off). -#define PIN_SC_SW_DEFAULT {PIO_PA20, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} -// Disconnect SIM card RST, CLK line from the phone lines -#define PIN_IO_SW_DEFAULT {PIO_PA19, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} -#define PINS_BUS_DEFAULT PIN_SC_SW_DEFAULT, PIN_IO_SW_DEFAULT +/** Pin configuration **/ +/* Button to force bootloader start (shorted to ground when pressed */ +#define PIN_BOOTLOADER_SW {PIO_PA31, PIOA, ID_PIOA, PIO_INPUT, PIO_PULLUP} +/* Enable powering the card using the second 3.3 V output of the LDO (active high) */ +#define SIM_PWEN_PIN {SIM_PWEN, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} +/* Card presence pin */ +#define SW_SIM PIO_PA8 +/* Pull card presence pin high (shorted to ground in card slot when card is present) */ +#define SMARTCARD_CONNECT_PIN {SW_SIM, PIOA, ID_PIOA, PIO_INPUT, PIO_PULLUP | PIO_DEBOUNCE | PIO_DEGLITCH | PIO_IT_EDGE } + +/** Smart card connection **/ +/* Card RST reset signal input (active low; RST_SIM in schematic) */ +#define PIN_ISO7816_RSTMC {PIO_PA7, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT} +/* Card I/O data signal input/output (I/O_SIM in schematic) */ +#define PIN_SIM_IO {PIO_PA6A_TXD0, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT} +/* Card CLK clock input (CLK_SIM in schematic) */ +#define PIN_SIM_CLK {PIO_PA2B_SCK0, PIOA, ID_PIOA, PIO_PERIPH_B, PIO_DEFAULT} +/* ISO7816-communication related pins */ +#define PINS_ISO7816 PIN_SIM_IO, PIN_SIM_CLK, PIN_ISO7816_RSTMC // SIM_PWEN_PIN, PIN_SIM_IO2, PIN_SIM_CLK2 +/* Pin to measure card I/O timing (to start measuring the ETU on I/O activity; connected I/O_SIM in schematic) */ +#define PIN_SIM_IO_INPUT {PIO_PA1B_TIOB0, PIOA, ID_PIOA, PIO_PERIPH_B, PIO_DEFAULT} +/* Pin used as clock input (to measure the ETU duration; connected to CLK_SIM in schematic) */ +#define PIN_SIM_CLK_INPUT {PIO_PA4B_TCLK0, PIOA, ID_PIOA, PIO_PERIPH_B, PIO_DEFAULT} +/* Pins used to measure ETU timing (using timer counter) */ +#define PINS_TC PIN_SIM_IO_INPUT, PIN_SIM_CLK_INPUT + +/** Phone connection **/ +/* Phone USIM slot 1 VCC pin (VCC_PHONE in schematic) */ +#define PIN_USIM1_VCC {PIO_PA25, PIOA, ID_PIOA, PIO_INPUT, PIO_DEFAULT} +/* Phone USIM slot 1 RST pin (active low; RST_PHONE in schematic) */ +#define PIN_USIM1_nRST {PIO_PA24, PIOA, ID_PIOA, PIO_INPUT, PIO_IT_RISE_EDGE | PIO_DEGLITCH } +/* Phone I/O data signal input/output (I/O_PHONE in schematic) */ +#define PIN_PHONE_IO {PIO_PA22A_TXD1, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT} +/* Phone CLK clock input (CLK_PHONE in schematic) */ +#define PIN_PHONE_CLK {PIO_PA23A_SCK1, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT} +/* Pin used for phone USIM slot 1 communication */ +#define PINS_USIM1 PIN_PHONE_IO, PIN_PHONE_CLK, PIN_PHONE_CLK_INPUT, PIN_USIM1_VCC, PIN_PHONE_IO_INPUT, PIN_USIM1_nRST +/* Phone I/O data signal input/output (unused USART RX input; connected to I/O_PHONE in schematic) */ +#define PIN_PHONE_IO_INPUT {PIO_PA21A_RXD1, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT} +/* Pin used as clock input (to measure the ETU duration; connected to CLK_PHONE in schematic) */ +#define PIN_PHONE_CLK_INPUT {PIO_PA29B_TCLK2, PIOA, ID_PIOA, PIO_PERIPH_B, PIO_DEFAULT} + +/** Default configuration **/ +/* Disconnect VPP, CLK, and RST lines between card and phone using bus switch (high sets bus switch to high-impedance) */ +#define PIN_SC_SW_DEFAULT {PIO_PA20, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} +/* Disconnect I/O line between card and phone using bus switch (high sets bus switch to high-impedance) */ +#define PIN_IO_SW_DEFAULT {PIO_PA19, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} +/* Disconnect all lines (VPP, CLK, RST, and I/O) between card and phone */ +#define PINS_BUS_DEFAULT PIN_SC_SW_DEFAULT, PIN_IO_SW_DEFAULT /** Sniffer configuration **/ -// Connect VPP, CLK and RST lines from smartcard to the phone +/* Connect VPP, CLK, and RST lines between card and phone using bus switch (low connects signals on bus switch) */ #define PIN_SC_SW_SNIFF {PIO_PA20, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT} +/* Connect I/O line between card and phone using bus switch (low connects signals on bus switch) */ #define PIN_IO_SW_SNIFF {PIO_PA19, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT} +/* Connect all lines (VPP, CLK, RST, and I/O) between card and phone */ #define PINS_BUS_SNIFF PIN_SC_SW_SNIFF, PIN_IO_SW_SNIFF - +/* Pins used to sniff phone-card communication */ #define PINS_SIM_SNIFF_SIM PIN_PHONE_IO, PIN_PHONE_CLK +/* Disable power converter 4.5-6V to 3.3V; (active high) */ +#define PIN_SIM_PWEN_SNIFF {SIM_PWEN, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT} +/* Enable power switch: VCC_PHONE to VCC_SIM; (active high) */ +#define PIN_VCC_FWD_SNIFF {VCC_FWD, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} +/* Use phone VCC to power card */ +#define PWR_PINS PIN_SIM_PWEN_SNIFF, PIN_VCC_FWD_SNIFF -#define SIM_PWEN_PIN {PIO_PA5, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} +/** External SPI flash interface **/ +/* SPI MISO pin definition */ +#define PIN_SPI_MISO {PIO_PA12A_MISO, PIOA, PIOA, PIO_PERIPH_A, PIO_PULLUP} +/* SPI MOSI pin definition */ +#define PIN_SPI_MOSI {PIO_PA13A_MOSI, PIOA, PIOA, PIO_PERIPH_A, PIO_DEFAULT} +/* SPI SCK pin definition */ +#define PIN_SPI_SCK {PIO_PA14A_SPCK, PIOA, PIOA, PIO_PERIPH_A, PIO_DEFAULT} +/* SPI pins definition. Contains MISO, MOSI & SCK */ +#define PINS_SPI PIN_SPI_MISO, PIN_SPI_MOSI, PIN_SPI_SCK +/* SPI chip select 0 pin definition */ +#define PIN_SPI_NPCS0 {PIO_PA11A_NPCS0, PIOA, PIOA, PIO_PERIPH_A, PIO_DEFAULT} +/* SPI flash write protect pin (active low, pulled low) */ +#define PIN_SPI_WP {PA15, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT} -#define PWR_PINS \ - /* Enable power converter 4.5-6V to 3.3V; low: off */ \ - {SIM_PWEN, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT}, \ - /* Enable second power converter: VCC_PHONE to VCC_SIM; high: on */ \ - {VCC_FWD, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} - -#define SW_SIM PIO_PA8 -#define SMARTCARD_CONNECT_PIN {SW_SIM, PIOA, ID_PIOA, PIO_INPUT, PIO_PULLUP | PIO_DEBOUNCE | PIO_DEGLITCH | PIO_IT_EDGE } -//#define SMARTCARD_CONNECT_PIN {SW_SIM, PIOB, ID_PIOB, PIO_INPUT, PIO_PULLUP | PIO_DEBOUNCE | PIO_IT_EDGE} - -/// PIN used for resetting the smartcard -// FIXME: Card is resetted with pin set to 0 --> PIO_OUTPUT_1 as default is right? -#define PIN_ISO7816_RSTMC {PIO_PA7, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT} - -/// Pins used for connect the smartcard -#define PIN_SIM_IO_INPUT {PIO_PA1, PIOA, ID_PIOA, PIO_INPUT, PIO_DEFAULT} -#define PIN_SIM_IO {PIO_PA6, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT} -#define PIN_SIM_CLK {PIO_PA2, PIOA, ID_PIOA, PIO_PERIPH_B, PIO_DEFAULT} -#define PIN_SIM_CLK_INPUT {PIO_PA4, PIOA, ID_PIOA, PIO_INPUT, PIO_DEFAULT} -//#define PINS_ISO7816 PIN_USART1_TXD, PIN_USART1_SCK, PIN_ISO7816_RSTMC -#define PINS_ISO7816 PIN_SIM_IO, PIN_SIM_CLK, PIN_ISO7816_RSTMC // SIM_PWEN_PIN, PIN_SIM_IO2, PIN_SIM_CLK2 - -#define PINS_TC PIN_SIM_IO_INPUT, PIN_SIM_CLK_INPUT - -#define PIN_USIM1_VCC {PIO_PA25, PIOA, ID_PIOA, PIO_INPUT, PIO_DEFAULT} -#define PIN_USIM1_nRST {PIO_PA24, PIOA, ID_PIOA, PIO_INPUT, PIO_IT_RISE_EDGE | PIO_DEGLITCH } -#define PIN_PHONE_IO_INPUT {PIO_PA21, PIOA, ID_PIOA, PIO_INPUT, PIO_DEFAULT} -#define PIN_PHONE_IO {PIO_PA22, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT} -#define PIN_PHONE_CLK {PIO_PA23A_SCK1, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT} // External Clock Input on PA28 -//#define PIN_PHONE_CLK {PIO_PA23A_SCK1, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} // External Clock Input on PA28 -#define PIN_PHONE_CLK_INPUT {PIO_PA29, PIOA, ID_PIOA, PIO_INPUT, PIO_DEFAULT} -#define PINS_USIM1 PIN_PHONE_IO, PIN_PHONE_CLK, PIN_PHONE_CLK_INPUT, PIN_USIM1_VCC, PIN_PHONE_IO_INPUT, PIN_USIM1_nRST -//, VCC_PHONE - -#define PIN_BOOTLOADER_SW {PIO_PA31, PIOA, ID_PIOA, PIO_INPUT, PIO_PULLUP} - -//** SPI interface **/ -/// SPI MISO pin definition (PA12). -#define PIN_SPI_MISO {1 << 12, PIOA, PIOA, PIO_PERIPH_A, PIO_PULLUP} -/// SPI MOSI pin definition (PA13). -#define PIN_SPI_MOSI {1 << 13, PIOA, PIOA, PIO_PERIPH_A, PIO_DEFAULT} -/// SPI SPCK pin definition (PA14). -#define PIN_SPI_SPCK {1 << 14, PIOA, PIOA, PIO_PERIPH_A, PIO_DEFAULT} -/// SPI pins definition. Contains MISO, MOSI & SPCK (PA12, PA13 & PA14). -#define PINS_SPI PIN_SPI_MISO, PIN_SPI_MOSI, PIN_SPI_SPCK -/// SPI chip select 0 pin definition (PA11). -#define PIN_SPI_NPCS0 {1 << 11, PIOA, PIOA, PIO_PERIPH_A, PIO_DEFAULT} - +/** USB definitions */ +/* OpenMoko SIMtrace 2 USB vendor ID */ +#define BOARD_USB_VENDOR_ID USB_VENDOR_OPENMOKO +/* OpenMoko SIMtrace 2 USB product ID (main application/runtime mode) */ +#define BOARD_USB_PRODUCT_ID USB_PRODUCT_SIMTRACE2 +/* OpenMoko SIMtrace 2 DFU USB product ID (DFU bootloader/DFU mode) */ +#define BOARD_DFU_USB_PRODUCT_ID USB_PRODUCT_SIMTRACE2_DFU +/* USB release number (bcdDevice, shown as 0.00) */ +#define BOARD_USB_RELEASE 0x000 +/* Indicate SIMtrace is bus power in USB attributes */ #define BOARD_USB_BMATTRIBUTES USBConfigurationDescriptor_BUSPOWERED_NORWAKEUP -#define BOARD_USB_VENDOR_ID USB_VENDOR_OPENMOKO -#define BOARD_USB_PRODUCT_ID USB_PRODUCT_SIMTRACE2 -#define BOARD_DFU_USB_PRODUCT_ID USB_PRODUCT_SIMTRACE2_DFU -#define BOARD_USB_RELEASE 0x000 - +/** Supported modes */ +/* SIMtrace board supports sniffer mode */ #define HAVE_SNIFFER +/* SIMtrace board supports CCID mode */ #define HAVE_CCID +/* SIMtrace board supports card emulation mode */ #define HAVE_CARDEM +/* SIMtrace board supports man-in-the-middle mode */ //#define HAVE_MITM -- To view, visit https://gerrit.osmocom.org/9844 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ic77ad5bf6c00c9122c6bb0e12b90e6c5406855fd Gerrit-Change-Number: 9844 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 11:24:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 11:24:16 +0000 Subject: Change in simtrace2[master]: sniff: use USART 0 instead of USART 1 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9845 ) Change subject: sniff: use USART 0 instead of USART 1 ...................................................................... sniff: use USART 0 instead of USART 1 Use USART 0 connected to the SIM card side to sniff the communication. The card side can also measure ETU times. Do proper pin initialization. This code can already capture the ATR communication between phone and card. Change-Id: I0597ec723cb2225540c89c3821b91d8a45adfcd6 --- M firmware/apps/trace/main.c M firmware/libboard/simtrace/include/board.h M firmware/libcommon/include/simtrace.h M firmware/libcommon/source/sniffer.c 4 files changed, 65 insertions(+), 68 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/firmware/apps/trace/main.c b/firmware/apps/trace/main.c index 06c4176..2e6dc31 100644 --- a/firmware/apps/trace/main.c +++ b/firmware/apps/trace/main.c @@ -36,7 +36,7 @@ .init = Sniffer_init, .exit = Sniffer_exit, .run = Sniffer_run, - .usart1_irq = Sniffer_usart1_irq, + .usart0_irq = Sniffer_usart0_irq, }, #endif #ifdef HAVE_CCID @@ -144,6 +144,7 @@ g_unique_id[0], g_unique_id[1], g_unique_id[2], g_unique_id[3]); TRACE_INFO("Reset Cause: 0x%x\n\r", (RSTC->RSTC_SR & RSTC_SR_RSTTYP_Msk) >> RSTC_SR_RSTTYP_Pos); + TRACE_INFO("USB configuration used: %d\n\r", simtrace_config); board_main_top(); diff --git a/firmware/libboard/simtrace/include/board.h b/firmware/libboard/simtrace/include/board.h index 4648313..00d32ee 100644 --- a/firmware/libboard/simtrace/include/board.h +++ b/firmware/libboard/simtrace/include/board.h @@ -21,13 +21,11 @@ /** Smart card connection **/ /* Card RST reset signal input (active low; RST_SIM in schematic) */ -#define PIN_ISO7816_RSTMC {PIO_PA7, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT} +#define PIN_SIM_RST {PIO_PA7, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT} /* Card I/O data signal input/output (I/O_SIM in schematic) */ #define PIN_SIM_IO {PIO_PA6A_TXD0, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT} /* Card CLK clock input (CLK_SIM in schematic) */ #define PIN_SIM_CLK {PIO_PA2B_SCK0, PIOA, ID_PIOA, PIO_PERIPH_B, PIO_DEFAULT} -/* ISO7816-communication related pins */ -#define PINS_ISO7816 PIN_SIM_IO, PIN_SIM_CLK, PIN_ISO7816_RSTMC // SIM_PWEN_PIN, PIN_SIM_IO2, PIN_SIM_CLK2 /* Pin to measure card I/O timing (to start measuring the ETU on I/O activity; connected I/O_SIM in schematic) */ #define PIN_SIM_IO_INPUT {PIO_PA1B_TIOB0, PIOA, ID_PIOA, PIO_PERIPH_B, PIO_DEFAULT} /* Pin used as clock input (to measure the ETU duration; connected to CLK_SIM in schematic) */ @@ -66,15 +64,23 @@ #define PIN_IO_SW_SNIFF {PIO_PA19, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT} /* Connect all lines (VPP, CLK, RST, and I/O) between card and phone */ #define PINS_BUS_SNIFF PIN_SC_SW_SNIFF, PIN_IO_SW_SNIFF +/* Use RST_SIM line to detect phone issued card reset */ +#define PIN_SIM_RST_SNIFF {PIO_PA7, PIOA, ID_PIOA, PIO_INPUT, PIO_PULLUP | PIO_DEBOUNCE | PIO_DEGLITCH | PIO_IT_EDGE } /* Pins used to sniff phone-card communication */ -#define PINS_SIM_SNIFF_SIM PIN_PHONE_IO, PIN_PHONE_CLK -/* Disable power converter 4.5-6V to 3.3V; (active high) */ +#define PINS_SIM_SNIFF_SIM PIN_SIM_IO, PIN_SIM_CLK, PIN_SIM_RST_SNIFF +/* Disable power converter 4.5-6V to 3.3V (active high) */ #define PIN_SIM_PWEN_SNIFF {SIM_PWEN, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT} -/* Enable power switch: VCC_PHONE to VCC_SIM; (active high) */ +/* Enable power switch to forward VCC_PHONE to VCC_SIM (active high) */ #define PIN_VCC_FWD_SNIFF {VCC_FWD, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} /* Use phone VCC to power card */ #define PWR_PINS PIN_SIM_PWEN_SNIFF, PIN_VCC_FWD_SNIFF +/** CCID configuration */ +/* Card RST reset signal input (active low; RST_SIM in schematic) */ +#define PIN_ISO7816_RSTMC {PIO_PA7, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT} +/* ISO7816-communication related pins */ +#define PINS_ISO7816 PIN_SIM_IO, PIN_SIM_CLK, PIN_ISO7816_RSTMC // SIM_PWEN_PIN, PIN_SIM_IO2, PIN_SIM_CLK2 + /** External SPI flash interface **/ /* SPI MISO pin definition */ #define PIN_SPI_MISO {PIO_PA12A_MISO, PIOA, PIOA, PIO_PERIPH_A, PIO_PULLUP} diff --git a/firmware/libcommon/include/simtrace.h b/firmware/libcommon/include/simtrace.h index 21921ca..e39d1dc 100644 --- a/firmware/libcommon/include/simtrace.h +++ b/firmware/libcommon/include/simtrace.h @@ -77,7 +77,6 @@ extern const USBConfigurationDescriptor *configurationDescriptorsArr[]; -int check_data_from_phone(); void update_fidi(uint8_t fidi); void ISR_PhoneRST( const Pin *pPin); @@ -109,7 +108,7 @@ extern void MITM_run( void ); /* IRQ functions */ -extern void Sniffer_usart1_irq(void); +extern void Sniffer_usart0_irq(void); extern void mode_cardemu_usart0_irq(void); extern void mode_cardemu_usart1_irq(void); diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index fa272eb..7cc688b 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -1,32 +1,22 @@ -/* ---------------------------------------------------------------------------- - * ATMEL Microcontroller Software Support - * ---------------------------------------------------------------------------- - * Copyright (c) 2009, Atmel Corporation +/* + * (C) 2010-2017 by Harald Welte + * (C) 2018 by Kevin Redon + * All Rights Reserved * - * All rights reserved. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * This program 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 Affero General Public License for more details. * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- */ - #include "board.h" #include "simtrace.h" @@ -47,27 +37,24 @@ /** Maximum ATR ucSize in bytes.*/ #define MAX_ATR_SIZE 55 + /*------------------------------------------------------------------------------ * Internal variables *------------------------------------------------------------------------------*/ -/** ISO7816 pins */ -static const Pin pinsISO7816_sniff[] = { PINS_SIM_SNIFF_SIM }; +/* Pin configuration to sniff communication (using USART connection to SIM card) */ +static const Pin pins_sniff[] = { PINS_SIM_SNIFF_SIM }; +/* Connect phone to card using bus switch */ static const Pin pins_bus[] = { PINS_BUS_SNIFF }; - -static const Pin pPwr[] = { - /* Enable power converter 4.5-6V to 3.3V; low: off */ - {SIM_PWEN, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT}, - - /* Enable power forwarding: VCC_PHONE to VCC_SIM; high: on */ - {VCC_FWD, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} -}; - -static struct Usart_info usart_info = { - .base = USART_PHONE, - .id = ID_USART_PHONE, +/* Power card using phone VCC */ +static const Pin pins_power[] = { PWR_PINS }; +/* Timer Counter pins to measure ETU timing */ +static const Pin pins_tc[] = { PINS_TC }; +/* USART peripheral used to sniff communication */ +static struct Usart_info sniff_usart = { + .base = USART_SIM, + .id = ID_USART_SIM, .state = USART_RCV, }; - /* Ring buffer to store sniffer communication data */ static struct ringbuf sniff_buffer; @@ -75,14 +62,14 @@ * Global functions *------------------------------------------------------------------------------*/ -void Sniffer_usart1_irq(void) +void Sniffer_usart0_irq(void) { /* Read channel status register */ - uint32_t csr = usart_info.base->US_CSR & usart_info.base->US_IMR; + uint32_t csr = sniff_usart.base->US_CSR & sniff_usart.base->US_IMR; /* Verify if character has been received */ if (csr & US_CSR_RXRDY) { /* Read communication data byte between phone and SIM */ - uint8_t byte = usart_info.base->US_RHR; + uint8_t byte = sniff_usart.base->US_RHR; /* Store sniffed data into buffer (also clear interrupt */ rbuf_write(&sniff_buffer, byte); } @@ -92,7 +79,7 @@ * Internal functions *------------------------------------------------------------------------------*/ -int check_data_from_phone(void) +static void check_sniffed_data(void) { /* Display sniffed data */ while (!rbuf_is_empty(&sniff_buffer)) { @@ -115,9 +102,10 @@ void Sniffer_exit(void) { TRACE_INFO("Sniffer exit\n\r"); - USART_DisableIt(USART_PHONE, US_IER_RXRDY); - NVIC_DisableIRQ(USART1_IRQn); - USART_SetReceiverEnabled(USART_PHONE, 0); + USART_DisableIt(sniff_usart.base, US_IER_RXRDY); + /* NOTE: don't forget to set the IRQ according to the USART peripheral used */ + NVIC_DisableIRQ(USART0_IRQn); + USART_SetReceiverEnabled(sniff_usart.base, 0); } /* called when *Sniffer* configuration is set by host */ @@ -125,25 +113,28 @@ { TRACE_INFO("Sniffer Init\n\r"); + /* Configure pins to sniff communication between phone and card */ + PIO_Configure(pins_sniff, PIO_LISTSIZE(pins_sniff)); + /* Configure pins to connect phone to card */ + PIO_Configure(pins_bus, PIO_LISTSIZE(pins_bus)); + /* Configure pins to forward phone power to card */ + PIO_Configure(pins_power, PIO_LISTSIZE(pins_power)); + /* Clear ring buffer containing the sniffed data */ rbuf_reset(&sniff_buffer); - - /* Configure ISO7816 driver */ - PIO_Configure(pinsISO7816_sniff, PIO_LISTSIZE(pinsISO7816_sniff)); - PIO_Configure(pins_bus, PIO_LISTSIZE(pins_bus)); - - PIO_Configure(pPwr, PIO_LISTSIZE(pPwr)); - - ISO7816_Init(&usart_info, CLK_SLAVE); - - USART_SetReceiverEnabled(USART_PHONE, 1); - USART_EnableIt(USART_PHONE, US_IER_RXRDY); - NVIC_EnableIRQ(USART1_IRQn); + /* Configure USART to as ISO-7816 slave communication to sniff communication */ + ISO7816_Init(&sniff_usart, CLK_SLAVE); + /* Only receive data when sniffing */ + USART_SetReceiverEnabled(sniff_usart.base, 1); + /* Enable interrupt to indicate when data has been received */ + USART_EnableIt(sniff_usart.base, US_IER_RXRDY); + /* Enable interrupt requests for the USART peripheral (warning: use IRQ corresponding to USART) */ + NVIC_EnableIRQ(USART0_IRQn); } /* main (idle/busy) loop of this USB configuration */ void Sniffer_run(void) { - check_data_from_phone(); + check_sniffed_data(); } #endif /* HAVE_SNIFFER */ -- To view, visit https://gerrit.osmocom.org/9845 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I0597ec723cb2225540c89c3821b91d8a45adfcd6 Gerrit-Change-Number: 9845 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 11:26:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 11:26:21 +0000 Subject: Change in simtrace2[master]: DFU: remove force bootloader button debug message since the console i... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9860 ) Change subject: DFU: remove force bootloader button debug message since the console is output message is not initialized yet ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9860 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ibea0105929a8dc38b43dacd9d1e576d7b51d0c6a Gerrit-Change-Number: 9860 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 04 Jul 2018 11:26:21 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 11:26:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 11:26:36 +0000 Subject: Change in simtrace2[master]: board: fix LED pin definition In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9861 ) Change subject: board: fix LED pin definition ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9861 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia6c80c0268dec708845e1dad281caaa42027f9db Gerrit-Change-Number: 9861 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 04 Jul 2018 11:26:36 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 11:27:59 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 11:27:59 +0000 Subject: Change in simtrace2[master]: DFU: switch green LED on to indicate DFU mode, and red LED to indicat... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9862 ) Change subject: DFU: switch green LED on to indicate DFU mode, and red LED to indicate flashing activity ...................................................................... Patch Set 2: Please note not all boards have a green+red led. In qmod, we have one led per slot (two per SAM3) and they all have the same color -- To view, visit https://gerrit.osmocom.org/9862 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8e34fd869ed94ad122d6a17f5a432f5a09b820bb Gerrit-Change-Number: 9862 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Harald Welte Gerrit-Comment-Date: Wed, 04 Jul 2018 11:27:59 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 11:35:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 11:35:29 +0000 Subject: Change in pysim[master]: commands: get file/record length from FCP (USIM) In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9597 ) Change subject: commands: get file/record length from FCP (USIM) ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9597 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I068cf8a532e1c79a2d208e9d275c155ddb72713c Gerrit-Change-Number: 9597 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Wed, 04 Jul 2018 11:35:29 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 11:36:04 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 11:36:04 +0000 Subject: Change in pysim[master]: pysim-prog: add commandline option to probe cards In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9884 ) Change subject: pysim-prog: add commandline option to probe cards ...................................................................... Patch Set 1: Verified+1 Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9884 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I57422d3819d52fd215ac8f13f890729aad2af76f Gerrit-Change-Number: 9884 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Wed, 04 Jul 2018 11:36:04 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 11:36:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 11:36:11 +0000 Subject: Change in pysim[master]: commands: get file/record length from FCP (USIM) In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9597 ) Change subject: commands: get file/record length from FCP (USIM) ...................................................................... Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/9597 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I068cf8a532e1c79a2d208e9d275c155ddb72713c Gerrit-Change-Number: 9597 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Wed, 04 Jul 2018 11:36:11 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 11:36:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 11:36:21 +0000 Subject: Change in pysim[master]: commands: get file/record length from FCP (USIM) In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9597 ) Change subject: commands: get file/record length from FCP (USIM) ...................................................................... commands: get file/record length from FCP (USIM) Some of the methods SimCardCommands() have ways to determaine length information from the card response. Regular sims use a format where the length field is on a fixed position. USIMs use FCP templates (format control parameters), which is a TLV encodecs string. So lets distingish if we deal with an USIM (We can easily do this by looking at the select control parameters) and extract the length info from the FCP. - If we deal with USIMs, use the FCP to determine length information Change-Id: I068cf8a532e1c79a2d208e9d275c155ddb72713c Related: SYS#4245 --- M pySim/commands.py 1 file changed, 56 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/pySim/commands.py b/pySim/commands.py index eba915c..9e16b0e 100644 --- a/pySim/commands.py +++ b/pySim/commands.py @@ -23,7 +23,7 @@ # from pySim.utils import rpad, b2h - +from pytlv.TLV import * class SimCardCommands(object): def __init__(self, transport): @@ -31,6 +31,56 @@ self._cla_byte = "a0" self.sel_ctrl = "0000" + # Get file size from FCP + def __get_len_from_tlv(self, fcp): + # see also: ETSI TS 102 221, chapter 11.1.1.3.1 Response for MF, + # DF or ADF + tlvparser = TLV(['82', '83', '84', 'A5', '8a', '8b', '8c', '80', 'ab', 'c6', '81', '88']) + + # pytlv is case sensitive! + fcp = fcp.lower() + + if fcp[0:2] != '62': + raise ValueError('Tag of the FCP template does not match, expected 62 but got %s'%fcp[0:2]) + + # Unfortunately the spec is not very clear if the FCP length is + # coded as one or two byte vale, so we have to try it out by + # checking if the length of the remaining TLV string matches + # what we get in the length field. + # See also ETSI TS 102 221, chapter 11.1.1.3.0 Base coding. + exp_tlv_len = int(fcp[2:4], 16) + if len(fcp[4:])/2 == exp_tlv_len: + skip = 4 + else: + exp_tlv_len = int(fcp[2:6], 16) + if len(fcp[4:])/2 == exp_tlv_len: + skip = 6 + + # Skip FCP tag and length + tlv = fcp[skip:] + tlv_parsed = tlvparser.parse(tlv) + + return int(tlv_parsed['80'], 16) + + # Tell the length of a record by the card response + # USIMs respond with an FCP template, which is different + # from what SIMs responds. See also: + # USIM: ETSI TS 102 221, chapter 11.1.1.3 Response Data + # SIM: GSM 11.11, chapter 9.2.1 SELECT + def __record_len(self, r): + if self.sel_ctrl == "0004": + return self.__get_len_from_tlv(r[-1]) + else: + return int(r[-1][28:30], 16) + + # Tell the length of a binary file. See also comment + # above. + def __len(self, r): + if self.sel_ctrl == "0004": + return self.__get_len_from_tlv(r[-1]) + else: + return int(r[-1][4:8], 16) + def get_atr(self): return self._tp.get_atr() @@ -60,7 +110,7 @@ ef = [ef] r = self.select_file(ef) if length is None: - length = int(r[-1][4:8], 16) - offset + length = self.__len(r) - offset pdu = self.cla_byte + 'b0%04x%02x' % (offset, (min(256, length) & 0xff)) return self._tp.send_apdu(pdu) @@ -75,7 +125,7 @@ if not hasattr(type(ef), '__iter__'): ef = [ef] r = self.select_file(ef) - rec_length = int(r[-1][28:30], 16) + rec_length = self.__record_len(r) pdu = self.cla_byte + 'b2%02x04%02x' % (rec_no, rec_length) return self._tp.send_apdu(pdu) @@ -84,7 +134,7 @@ ef = [ef] r = self.select_file(ef) if not force_len: - rec_length = int(r[-1][28:30], 16) + rec_length = self.__record_len(r) if (len(data)/2 != rec_length): raise ValueError('Invalid data length (expected %d, got %d)' % (rec_length, len(data)/2)) else: @@ -94,11 +144,11 @@ def record_size(self, ef): r = self.select_file(ef) - return int(r[-1][28:30], 16) + return self.__record_len(r) def record_count(self, ef): r = self.select_file(ef) - return int(r[-1][4:8], 16) // int(r[-1][28:30], 16) + return self.__len(r) // self.__record_len(r) def run_gsm(self, rand): if len(rand) != 32: -- To view, visit https://gerrit.osmocom.org/9597 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I068cf8a532e1c79a2d208e9d275c155ddb72713c Gerrit-Change-Number: 9597 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 11:39:21 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 11:39:21 +0000 Subject: Change in simtrace2[master]: host USB: add host application to receive and display USB sniffing me... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9874 to look at the new patch set (#7). Change subject: host USB: add host application to receive and display USB sniffing messages sent by firmware ...................................................................... host USB: add host application to receive and display USB sniffing messages sent by firmware Change-Id: Idefbf21e0bbd2a1e3647fe9aebaf88d1b62dae2d --- M host/Makefile A host/simtrace2-sniff.c 2 files changed, 538 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/74/9874/7 -- To view, visit https://gerrit.osmocom.org/9874 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Idefbf21e0bbd2a1e3647fe9aebaf88d1b62dae2d Gerrit-Change-Number: 9874 Gerrit-PatchSet: 7 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 11:54:05 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 11:54:05 +0000 Subject: Change in pysim[master]: pysim-prog: add commandline option to probe cards In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9884 ) Change subject: pysim-prog: add commandline option to probe cards ...................................................................... Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/9884 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I57422d3819d52fd215ac8f13f890729aad2af76f Gerrit-Change-Number: 9884 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Wed, 04 Jul 2018 11:54:05 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 11:54:06 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 11:54:06 +0000 Subject: Change in pysim[master]: pysim-prog: add commandline option to probe cards In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9884 ) Change subject: pysim-prog: add commandline option to probe cards ...................................................................... pysim-prog: add commandline option to probe cards In some situations it may be helpful to know the card name (type) we deal with in advance. So lets ad an to probe that only detects the card and then exists. - Add commandline option -T --probe Change-Id: I57422d3819d52fd215ac8f13f890729aad2af76f Related: OS#3376 --- M pySim-prog.py 1 file changed, 13 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/pySim-prog.py b/pySim-prog.py index 1685d2b..eca8b4e 100755 --- a/pySim-prog.py +++ b/pySim-prog.py @@ -62,6 +62,10 @@ help="Card type (user -t list to view) [default: %default]", default="auto", ) + parser.add_option("-T", "--probe", dest="probe", + help="Determine card type", + default=False, action="store_true" + ) parser.add_option("-a", "--pin-adm", dest="pin_adm", help="ADM PIN used for provisioning (overwrites default)", ) @@ -156,6 +160,9 @@ print kls.name sys.exit(0) + if options.probe: + return options + if options.source == 'csv': if (options.imsi is None) and (options.batch_mode is False) and (options.read_imsi is False): parser.error("CSV mode needs either an IMSI, --read-imsi or batch mode") @@ -525,7 +532,7 @@ for kls in _cards_classes: card = kls.autodetect(scc) if card: - print "Autodetected card type %s" % card.name + print "Autodetected card type: %s" % card.name card.reset() break @@ -540,7 +547,7 @@ card = ctypes[opts.type](scc) else: - raise ValueError("Unknown card type %s" % opts.type) + raise ValueError("Unknown card type: %s" % opts.type) return card @@ -589,6 +596,10 @@ else: sys.exit(-1) + # Probe only + if opts.probe: + break; + # Erase if requested if opts.erase: print "Formatting ..." -- To view, visit https://gerrit.osmocom.org/9884 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I57422d3819d52fd215ac8f13f890729aad2af76f Gerrit-Change-Number: 9884 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 11:54:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 11:54:28 +0000 Subject: Change in simtrace2[master]: simtrace: add support for sniffing on both USART In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9848 ) Change subject: simtrace: add support for sniffing on both USART ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9848 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I69eb458e7cb186c990e5d6fbc780f37fdd0cd884 Gerrit-Change-Number: 9848 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 04 Jul 2018 11:54:28 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 11:55:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 11:55:16 +0000 Subject: Change in simtrace2[master]: update_fidi: remove debug output since this function is called in tim... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9863 ) Change subject: update_fidi: remove debug output since this function is called in time critical ISR ...................................................................... Patch Set 3: is this really needed? particularly now that the console is going through the ringbuffer and is not busy-waiting? Can we print the message at a later point after we left IRQ context? -- To view, visit https://gerrit.osmocom.org/9863 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I08f407d407a18dae3f360ddc64769ddfaeb5b559 Gerrit-Change-Number: 9863 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Harald Welte Gerrit-Comment-Date: Wed, 04 Jul 2018 11:55:16 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 11:56:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 11:56:18 +0000 Subject: Change in simtrace2[master]: LED: add short LED pulse blinking pattern In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9864 ) Change subject: LED: add short LED pulse blinking pattern ...................................................................... Patch Set 3: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/9864/3/firmware/libboard/common/source/led.c File firmware/libboard/common/source/led.c: https://gerrit.osmocom.org/#/c/9864/3/firmware/libboard/common/source/led.c at 20 PS3, Line 20: else this appears to change the on/off logic for the LEDs. That's a logically separate change from "adding a fast blinking pattern" and it's not mentioned in the change log. -- To view, visit https://gerrit.osmocom.org/9864 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0fdc2f902a3b92da6aa9b9c8500abae8a2f79447 Gerrit-Change-Number: 9864 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 04 Jul 2018 11:56:18 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 11:57:31 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 11:57:31 +0000 Subject: Change in simtrace2[master]: sniff: print parsed ATR and PPS; use red LED to show main application... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9865 ) Change subject: sniff: print parsed ATR and PPS; use red LED to show main application is running; use green LED to indicate activity (message parsed) ...................................................................... Patch Set 3: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/9865/3//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/9865/3//COMMIT_MSG at 7 PS3, Line 7: sniff: print parsed ATR and PPS; use red LED to show main application is running; use green LED to indicate activity (message parsed) cosmietics: I think it's more "logical" if the permanent gren LED indicated "I'm running main program, everything is OK" and the blinking red led would indicate activity. Not critical, just some idea... -- To view, visit https://gerrit.osmocom.org/9865 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8e906bdbf2c91e608757ae442dfb241f981b8f1e Gerrit-Change-Number: 9865 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 04 Jul 2018 11:57:31 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 11:58:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 11:58:54 +0000 Subject: Change in simtrace2[master]: sniff: add TPDU parsing (TPDUs become APDUs on the upper layer) In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9866 ) Change subject: sniff: add TPDU parsing (TPDUs become APDUs on the upper layer) ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9866 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I09d050d95bd2ab140fe6b4926a37278eb08cc347 Gerrit-Change-Number: 9866 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 04 Jul 2018 11:58:54 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 11:59:13 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 11:59:13 +0000 Subject: Change in simtrace2[master]: sniff: add WT timeout detection using USART timeout (TC is not required) In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9867 ) Change subject: sniff: add WT timeout detection using USART timeout (TC is not required) ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9867 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4ec6e812e7e1eb91005027d2e864fc315550d79c Gerrit-Change-Number: 9867 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 04 Jul 2018 11:59:13 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:05:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 12:05:24 +0000 Subject: Change in simtrace2[master]: minor: fix typos in comment In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9868 ) Change subject: minor: fix typos in comment ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9868 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I01b49e047a586dff449d4e134751108e391a8822 Gerrit-Change-Number: 9868 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 04 Jul 2018 12:05:24 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:05:39 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 12:05:39 +0000 Subject: Change in simtrace2[master]: fix: remove unused code In-Reply-To: References: Message-ID: K?vin Redon has abandoned this change. ( https://gerrit.osmocom.org/9839 ) Change subject: fix: remove unused code ...................................................................... Abandoned code is still used. I will remove the warning later on -- To view, visit https://gerrit.osmocom.org/9839 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: Ib87b35bd9a32c8b7df3f8af8015ca002784d333c Gerrit-Change-Number: 9839 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:07:51 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 12:07:51 +0000 Subject: Change in simtrace2[master]: USB: add central file to define USB IDs, classes, and endpoints In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9869 ) Change subject: USB: add central file to define USB IDs, classes, and endpoints ...................................................................... Patch Set 4: Code-Review+2 (2 comments) https://gerrit.osmocom.org/#/c/9869/4/firmware/libcommon/include/simtrace_usb.h File firmware/libcommon/include/simtrace_usb.h: https://gerrit.osmocom.org/#/c/9869/4/firmware/libcommon/include/simtrace_usb.h at 2 PS4, Line 2: Affero GPLv2-or-later, not AGPlv3-or-late https://gerrit.osmocom.org/#/c/9869/4/firmware/libcommon/include/simtrace_usb.h at 14 PS4, Line 14: Kevin Redon (C) 2018 by sysmocom -s.f.m.c. GmbH, Author: Kevin Redon -- To view, visit https://gerrit.osmocom.org/9869 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iba81f32a92c68a973e8e7adbc4c2a1064ba5290f Gerrit-Change-Number: 9869 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 04 Jul 2018 12:07:51 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:07:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 12:07:54 +0000 Subject: Change in simtrace2[master]: USB: add central file to define USB IDs, classes, and endpoints In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9869 ) Change subject: USB: add central file to define USB IDs, classes, and endpoints ...................................................................... Patch Set 4: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/9869 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iba81f32a92c68a973e8e7adbc4c2a1064ba5290f Gerrit-Change-Number: 9869 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 04 Jul 2018 12:07:54 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:08:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 12:08:18 +0000 Subject: Change in simtrace2[master]: host usb_util fix: used provided class, sub-class, and interfave when... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9870 ) Change subject: host usb_util fix: used provided class, sub-class, and interfave when finding matching interfaces ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9870 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ibc06e751e6ca0f9e9a40d82c4eeddfb975240f91 Gerrit-Change-Number: 9870 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 04 Jul 2018 12:08:18 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:09:09 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 12:09:09 +0000 Subject: Change in simtrace2[master]: host USB: use central SIMtrace USB ID definition header In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9871 ) Change subject: host USB: use central SIMtrace USB ID definition header ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9871 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id18e64fba0a2c308a8aef7d3865200bf0237cae9 Gerrit-Change-Number: 9871 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 04 Jul 2018 12:09:09 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:09:59 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 12:09:59 +0000 Subject: Change in simtrace2[master]: USB device: add USB message structure for sniffer communication In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9872 ) Change subject: USB device: add USB message structure for sniffer communication ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9872 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id2c6f32ade2fec9b9ef91bd8c5e1fd195f2d7351 Gerrit-Change-Number: 9872 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 04 Jul 2018 12:09:59 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:16:19 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 12:16:19 +0000 Subject: Change in simtrace2[master]: sniffer USB: implement USB communication and send parsed messages In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9873 ) Change subject: sniffer USB: implement USB communication and send parsed messages ...................................................................... Patch Set 5: Code-Review-1 (7 comments) https://gerrit.osmocom.org/#/c/9873/5/firmware/libcommon/source/sniffer.c File firmware/libcommon/source/sniffer.c: https://gerrit.osmocom.org/#/c/9873/5/firmware/libcommon/source/sniffer.c at 206 PS5, Line 206: struct simtrace_msg_hdr *usb_msg_header; : usb_msg->l1h = msgb_put(usb_msg, sizeof(*usb_msg_header)); : usb_msg_header = (struct simtrace_msg_hdr *) usb_msg->l1h; : memset(usb_msg_header, 0, sizeof(*usb_msg_header)); : usb_msg_header->msg_class = SIMTRACE_MSGC_SNIFF; : usb_msg_header->msg_type = SIMTRACE_MSGT_SNIFF_CHANGE; : usb_msg->l2h = usb_msg->l1h + sizeof(*usb_msg_header) this kind of block seems to repeat over the file. I think it makes sense to factor it out into a separate function like msgb_put_usb_msg_header(msg, msg_class, msg_type) which would then contain all of these lines marked here. https://gerrit.osmocom.org/#/c/9873/5/firmware/libcommon/source/sniffer.c at 216 PS5, Line 216: usb_msg_header->msg_len = msgb_length(usb_msg); If you re-ordered it to: * first msgb_put the usb_sniff change * then msgb_push the usb_msg_header in front it would not be needed to update the length at the end. In fact, the pushing of the usb_msg_header could be done in a wrapper function around usb_buf_submit, so it would become simply a usb_push_header_and_submit(usb_msg, SIMTRACE_MSGC_SNIFF, SIMTRACE_MSGT_SNIFF_CHANGE) This way the API becomes super easy to use (and get right) https://gerrit.osmocom.org/#/c/9873/5/firmware/libcommon/source/sniffer.c at 275 PS5, Line 275: TRACE_ERROR("ATR buffer overflow\n\r"); this might be something worth counting and/or reporting to the host? Keep in mind, the normal user has nothing connected to the UART... https://gerrit.osmocom.org/#/c/9873/5/firmware/libcommon/source/sniffer.c at 295 PS5, Line 295: struct simtrace_msg_hdr *usb_msg_header; : usb_msg->l1h = msgb_put(usb_msg, sizeof(*usb_msg_header)); : usb_msg_header = (struct simtrace_msg_hdr *) usb_msg->l1h; : memset(usb_msg_header, 0, sizeof(*usb_msg_header)); : usb_msg_header->msg_class = SIMTRACE_MSGC_SNIFF; : usb_msg_header->msg_type = SIMTRACE_MSGT_SNIFF_ATR; : usb_msg->l2h = usb_msg->l1h + sizeof(*usb_msg_header); : struct sniff_data *usb_sniff_data_atr; : usb_sniff_data_atr = (struct sniff_data *) msgb_put(usb_msg, sizeof(*usb_sniff_data_atr)); : usb_sniff_data_atr->complete = true; : usb_sniff_data_atr->length = atr_i; : uint8_t *data = msgb_put(usb_msg, usb_sniff_data_atr->length); : memcpy(data, atr, atr_i); : usb_msg_header->msg_len = msgb_length(usb_msg); see my comments above on how to simplify this https://gerrit.osmocom.org/#/c/9873/5/firmware/libcommon/source/sniffer.c at 450 PS5, Line 450: struct simtrace_msg_hdr *usb_msg_header; : usb_msg->l1h = msgb_put(usb_msg, sizeof(*usb_msg_header)); : usb_msg_header = (struct simtrace_msg_hdr *) usb_msg->l1h; : memset(usb_msg_header, 0, sizeof(*usb_msg_header)); : usb_msg_header->msg_class = SIMTRACE_MSGC_SNIFF; : usb_msg_header->msg_type = SIMTRACE_MSGT_SNIFF_PPS; : usb_msg->l2h = usb_msg->l1h + sizeof(*usb_msg_header); : struct sniff_data *usb_sniff_data_pps; : usb_sniff_data_pps = (struct sniff_data *) msgb_put(usb_msg, sizeof(*usb_sniff_data_pps)); : usb_sniff_data_pps->complete = true; : usb_sniff_data_pps->length = pps_i; : uint8_t *data = msgb_put(usb_msg, usb_sniff_data_pps->length); : memcpy(data, pps, pps_i); : usb_msg_header->msg_len = msgb_length(usb_msg); same here: see comments above https://gerrit.osmocom.org/#/c/9873/5/firmware/libcommon/source/sniffer.c at 477 PS5, Line 477: struct simtrace_msg_hdr *usb_msg_header; : usb_msg->l1h = msgb_put(usb_msg, sizeof(*usb_msg_header)); : usb_msg_header = (struct simtrace_msg_hdr *) usb_msg->l1h; : memset(usb_msg_header, 0, sizeof(*usb_msg_header)); : usb_msg_header->msg_class = SIMTRACE_MSGC_SNIFF; : usb_msg_header->msg_type = SIMTRACE_MSGT_SNIFF_FIDI; : usb_msg->l2h = usb_msg->l1h + sizeof(*usb_msg_header); : struct sniff_fidi *usb_sniff_fidi; : usb_sniff_fidi = (struct sniff_fidi *) msgb_put(usb_msg, sizeof(*usb_sniff_fidi)); : usb_sniff_fidi->fidi = fidi; : usb_msg_header->msg_len = msgb_length(usb_msg); : usb_buf_submit(usb_msg); and once more https://gerrit.osmocom.org/#/c/9873/5/firmware/libcommon/source/sniffer.c at 612 PS5, Line 612: struct simtrace_msg_hdr *usb_msg_header; : usb_msg->l1h = msgb_put(usb_msg, sizeof(*usb_msg_header)); : usb_msg_header = (struct simtrace_msg_hdr *) usb_msg->l1h; : memset(usb_msg_header, 0, sizeof(*usb_msg_header)); : usb_msg_header->msg_class = SIMTRACE_MSGC_SNIFF; : usb_msg_header->msg_type = SIMTRACE_MSGT_SNIFF_ATR; : usb_msg->l2h = usb_msg->l1h + sizeof(*usb_msg_header); : struct sniff_data *usb_sniff_data_tpdu; : usb_sniff_data_tpdu = (struct sniff_data *) msgb_put(usb_msg, sizeof(*usb_sniff_data_tpdu)); : usb_sniff_data_tpdu->complete = true; : usb_sniff_data_tpdu->length = tpdu_packet_i; : uint8_t *data = msgb_put(usb_msg, usb_sniff_data_tpdu->length); : memcpy(data, tpdu_packet, tpdu_packet_i); : usb_msg_header->msg_len = msgb_length(usb_msg); and yet again -- To view, visit https://gerrit.osmocom.org/9873 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ice7817480705f2124b08c1ff9a8826558b6d8b2b Gerrit-Change-Number: 9873 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 04 Jul 2018 12:16:19 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:16:24 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 12:16:24 +0000 Subject: Change in simtrace2[master]: add more USB configuration checks and error messages In-Reply-To: References: Message-ID: K?vin Redon has abandoned this change. ( https://gerrit.osmocom.org/9842 ) Change subject: add more USB configuration checks and error messages ...................................................................... Abandoned license change not applicable anymore, ARRAY_SIZE fixed in later commit -- To view, visit https://gerrit.osmocom.org/9842 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: I20f8018cd5087254dfbfad40b73803390aa84183 Gerrit-Change-Number: 9842 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:17:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 12:17:11 +0000 Subject: Change in simtrace2[master]: host USB: add host application to receive and display USB sniffing me... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9874 ) Change subject: host USB: add host application to receive and display USB sniffing messages sent by firmware ...................................................................... Patch Set 7: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/9874/7/host/simtrace2-sniff.c File host/simtrace2-sniff.c: https://gerrit.osmocom.org/#/c/9874/7/host/simtrace2-sniff.c at 3 PS7, Line 3: * it under the terms of the GNU General Public License version 2 GPLv2 or later (to be compatible with GPLv3/AGPLv3/...) -- To view, visit https://gerrit.osmocom.org/9874 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Idefbf21e0bbd2a1e3647fe9aebaf88d1b62dae2d Gerrit-Change-Number: 9874 Gerrit-PatchSet: 7 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 04 Jul 2018 12:17:11 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:19:12 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 12:19:12 +0000 Subject: Change in simtrace2[master]: sniffer: display F and D values frim PPS In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9875 ) Change subject: sniffer: display F and D values frim PPS ...................................................................... Patch Set 7: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/9875/7/firmware/libcommon/include/iso7816_fidi.h File firmware/libcommon/include/iso7816_fidi.h: https://gerrit.osmocom.org/#/c/9875/7/firmware/libcommon/include/iso7816_fidi.h at 6 PS7, Line 6: extern const uint16_t fi_table[]; normally I would recommend to have an accessor function or macro to catch out-of-bounds array index overflow. However, the [current] single user of those tables is clearly only passing 4-bit wide values as array index, so it is still ok. However, future users may differ. -- To view, visit https://gerrit.osmocom.org/9875 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3641dcb6c24695a6d3dd3a1ee4333f56a07c99f0 Gerrit-Change-Number: 9875 Gerrit-PatchSet: 7 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 04 Jul 2018 12:19:12 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:20:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 12:20:21 +0000 Subject: Change in simtrace2[master]: console: drop data to be send when buffer is already full In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9876 ) Change subject: console: drop data to be send when buffer is already full ...................................................................... Patch Set 7: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/9876/7/firmware/libboard/common/source/uart_console.c File firmware/libboard/common/source/uart_console.c: https://gerrit.osmocom.org/#/c/9876/7/firmware/libboard/common/source/uart_console.c at 146 PS7, Line 146: CONSOLE_ISR(); Unrelated to this current patch: I was wondering why you explicitly call the ISR from normal program context here? -- To view, visit https://gerrit.osmocom.org/9876 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia625b09eb30bb7b43edd3989f697d8ef33200f28 Gerrit-Change-Number: 9876 Gerrit-PatchSet: 7 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 04 Jul 2018 12:20:21 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:20:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 12:20:53 +0000 Subject: Change in simtrace2[master]: buffer: increase buffer size to 512 to cope with fast and long TPDUs In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9877 ) Change subject: buffer: increase buffer size to 512 to cope with fast and long TPDUs ...................................................................... Patch Set 7: Code-Review-1 pleease note that even incrementing from 128 to 256 already broke cardem, and we need to fix that first -- To view, visit https://gerrit.osmocom.org/9877 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I194c90cf09306a982d80c5bf1222397af6e658a9 Gerrit-Change-Number: 9877 Gerrit-PatchSet: 7 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 04 Jul 2018 12:20:53 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:22:02 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 12:22:02 +0000 Subject: Change in simtrace2[master]: sniffing: move conversion convertion and flag processing from ISR to ... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9878 ) Change subject: sniffing: move conversion convertion and flag processing from ISR to main loop to keep ISR fast and focus on data capture ...................................................................... Patch Set 7: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/9878/7/firmware/libcommon/source/sniffer.c File firmware/libcommon/source/sniffer.c: https://gerrit.osmocom.org/#/c/9878/7/firmware/libcommon/source/sniffer.c at 841 PS7, Line 841: struct simtrace_msg_hdr *usb_msg_header; : usb_msg->l1h = msgb_put(usb_msg, sizeof(*usb_msg_header)); : usb_msg_header = (struct simtrace_msg_hdr *) usb_msg->l1h; : memset(usb_msg_header, 0, sizeof(*usb_msg_header)); : usb_msg_header->msg_class = SIMTRACE_MSGC_SNIFF; : usb_msg_header->msg_type = SIMTRACE_MSGT_SNIFF_CHANGE; : usb_msg->l2h = usb_msg->l1h + sizeof(*usb_msg_header); : struct sniff_change *usb_sniff_change; : usb_sniff_change = (struct sniff_change *) msgb_put(usb_msg, sizeof(*usb_sniff_change)); : usb_sniff_change->flags = flags; : usb_msg_header->msg_len = msgb_length(usb_msg); this will need to be changed according to the API suggestions I posted against an earlier patch in the series -- To view, visit https://gerrit.osmocom.org/9878 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ieefa8a5f81dbcc12c1ad3059660dbffa0c1a4961 Gerrit-Change-Number: 9878 Gerrit-PatchSet: 7 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 04 Jul 2018 12:22:02 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:22:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 12:22:27 +0000 Subject: Change in simtrace2[master]: sniffer: also send incomplete (e.g. timeout) data (PPS/ATR/TPDU) In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9879 ) Change subject: sniffer: also send incomplete (e.g. timeout) data (PPS/ATR/TPDU) ...................................................................... Patch Set 8: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9879 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib070aca181042b477f1ffec48d63dc56c1e4609a Gerrit-Change-Number: 9879 Gerrit-PatchSet: 8 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 04 Jul 2018 12:22:27 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:23:13 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 12:23:13 +0000 Subject: Change in simtrace2[master]: qmod: Add 'e' command for erasing the EEPROM In-Reply-To: References: Message-ID: K?vin Redon has posted comments on this change. ( https://gerrit.osmocom.org/9858 ) Change subject: qmod: Add 'e' command for erasing the EEPROM ...................................................................... Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/9858/1/firmware/libboard/qmod/source/board_qmod.c File firmware/libboard/qmod/source/board_qmod.c: https://gerrit.osmocom.org/#/c/9858/1/firmware/libboard/qmod/source/board_qmod.c at 103 PS1, Line 103: --; this can cause an endless loop, halted by the watchdog. alternative: print error message instead and continue with erasing the rest (or stop erasing) -- To view, visit https://gerrit.osmocom.org/9858 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id7cb0db568dd3e9d796829bf0019d63048612998 Gerrit-Change-Number: 9858 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon Gerrit-Comment-Date: Wed, 04 Jul 2018 12:23:13 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:23:38 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 12:23:38 +0000 Subject: Change in simtrace2[master]: sniffing: fix procedure byte handling and make TPDU parsing for strict In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9880 ) Change subject: sniffing: fix procedure byte handling and make TPDU parsing for strict ...................................................................... Patch Set 8: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/9880/8//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/9880/8//COMMIT_MSG at 7 PS8, Line 7: for strict more strict? -- To view, visit https://gerrit.osmocom.org/9880 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If991152f11c4b864ab1386f21dc13c335e6b281f Gerrit-Change-Number: 9880 Gerrit-PatchSet: 8 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 04 Jul 2018 12:23:38 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:23:56 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 12:23:56 +0000 Subject: Change in simtrace2[master]: sniffing: decrease USB IRQ prioprity to prevent USART overrun In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9881 ) Change subject: sniffing: decrease USB IRQ prioprity to prevent USART overrun ...................................................................... Patch Set 8: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9881 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I870a0aa8e251bbb53249c54bfcaa45de5b5a9486 Gerrit-Change-Number: 9881 Gerrit-PatchSet: 8 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 04 Jul 2018 12:23:56 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:24:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 12:24:24 +0000 Subject: Change in simtrace2[master]: sniffer: add waiting time WT update In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9882 ) Change subject: sniffer: add waiting time WT update ...................................................................... Patch Set 8: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9882 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9735660ffce161cec8d4e63fa60a66fc8ef57525 Gerrit-Change-Number: 9882 Gerrit-PatchSet: 8 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 04 Jul 2018 12:24:24 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:24:56 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 12:24:56 +0000 Subject: Change in openbsc[master]: nat: Add VTY cmd paging-bss-forward to nat node In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9885 ) Change subject: nat: Add VTY cmd paging-bss-forward to nat node ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9885 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I737774543e0a8734d79b072e66e3c09e82b001d3 Gerrit-Change-Number: 9885 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 04 Jul 2018 12:24:56 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:25:43 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 12:25:43 +0000 Subject: Change in osmo-ttcn3-hacks[master]: bsc: verify MultiRate Config IE in RSL Chan Activ In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9856 ) Change subject: bsc: verify MultiRate Config IE in RSL Chan Activ ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9856 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie841feed9d5e478bab1fea2bb86f300e84799013 Gerrit-Change-Number: 9856 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 04 Jul 2018 12:25:43 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:25:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 12:25:46 +0000 Subject: Change in osmo-ttcn3-hacks[master]: bsc: verify MultiRate Config IE in RSL Chan Activ In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9856 ) Change subject: bsc: verify MultiRate Config IE in RSL Chan Activ ...................................................................... bsc: verify MultiRate Config IE in RSL Chan Activ The current osmo-bsc refactoring causes an erratic MR Config IE. This patch ensures that the ttcn3-bsc-tests catch this error. Add MR Config IE expectations to g_pars, set these in the two tests that expect an MR Config IE in the Chan Activ message: BSC_Tests.TC_assignment_codec_amr_{f,h} All other tests now verify that there is *no* MR Config IE in RSL Chan Activ messages -- all other tests request no voice or a non-AMR codec for Chan Activ. Change-Id: Ie841feed9d5e478bab1fea2bb86f300e84799013 --- M bsc/BSC_Tests.ttcn M bsc/MSC_ConnectionHandler.ttcn 2 files changed, 36 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 328fc59..2a8ad5f 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -1841,6 +1841,26 @@ if (not match(mode_ie, t_mode_ie)) { setverdict(fail, "RSL Channel Mode IE doesn't match expectation"); } + + var RSL_IE_Body mr_conf; + if (g_pars.expect_mr_conf_ie != omit) { + if (f_rsl_find_ie(rsl, RSL_IE_MR_CONFIG, mr_conf) == false) { + setverdict(fail, "Missing MR CONFIG IE in RSL Chan Activ"); + self.stop; + } + log("found RSL MR CONFIG IE: ", mr_conf); + + if (not match(mr_conf, g_pars.expect_mr_conf_ie)) { + setverdict(fail, "RSL MR CONFIG IE does not match expectation. Expected: ", + g_pars.expect_mr_conf_ie); + } + } else { + if (f_rsl_find_ie(rsl, RSL_IE_MR_CONFIG, mr_conf) == true) { + log("found RSL MR CONFIG IE: ", mr_conf); + setverdict(fail, "Found MR CONFIG IE in RSL Chan Activ, expecting omit"); + self.stop; + } + } } testcase TC_assignment_codec_fr() runs on test_CT { @@ -1882,11 +1902,18 @@ testcase TC_assignment_codec_amr_f() runs on test_CT { var TestHdlrParams pars := valueof(t_def_TestHdlrPars); var MSC_ConnHdlr vc_conn; + var RSL_IE_Body mr_conf := { + other := { + len := 2, + payload := '2804'O + } + }; f_init(1, true); f_sleep(1.0); pars.ass_codec_list := valueof(ts_BSSMAP_IE_CodecList({ts_CodecAMR_F})); + pars.expect_mr_conf_ie := mr_conf; vc_conn := f_start_handler(refers(f_TC_assignment_codec), pars); vc_conn.done; } @@ -1894,11 +1921,18 @@ testcase TC_assignment_codec_amr_h() runs on test_CT { var TestHdlrParams pars := valueof(t_def_TestHdlrPars); var MSC_ConnHdlr vc_conn; + var RSL_IE_Body mr_conf := { + other := { + len := 2, + payload := '2804'O + } + }; f_init(1, true); f_sleep(1.0); pars.ass_codec_list := valueof(ts_BSSMAP_IE_CodecList({ts_CodecAMR_H})); + pars.expect_mr_conf_ie := mr_conf; vc_conn := f_start_handler(refers(f_TC_assignment_codec), pars); vc_conn.done; } diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index 0f123b6..1261a4d 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -390,6 +390,7 @@ RslLinkId link_id, integer media_nr, /* determins MGCP EP, port numbers */ BSSMAP_IE_SpeechCodecList ass_codec_list optional, + RSL_IE_Body expect_mr_conf_ie optional, /* typically present for AMR codecs */ TestHdlrEncrParams encr optional, TestHdlrParamsLcls lcls }; @@ -401,6 +402,7 @@ link_id := valueof(ts_RslLinkID_DCCH(0)), media_nr := 1, ass_codec_list := omit, + expect_mr_conf_ie := omit, encr := omit, lcls := { gcr := omit, -- To view, visit https://gerrit.osmocom.org/9856 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ie841feed9d5e478bab1fea2bb86f300e84799013 Gerrit-Change-Number: 9856 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Wed Jul 4 12:26:48 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Wed, 4 Jul 2018 12:26:48 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-gapk_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#10?= In-Reply-To: <1687419589.40.1530640478840.JavaMail.jenkins@jenkins.osmocom.org> References: <1687419589.40.1530640478840.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <1935380069.53.1530707208638.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 127.18 KB...] checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether make supports nested variables... (cached) yes checking if gcc supports -fvisibility=hidden... yes checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking whether gcc understands -c and -o together... (cached) yes checking dependency style of gcc... (cached) gcc3 checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for LIBOSMOCORE... yes checking for LIBOSMOCODEC... yes checking for LIBALSA... yes checking for OPENCORE_AMRNB... yes checking gsm/gsm.h usability... yes checking gsm/gsm.h presence... yes checking for gsm/gsm.h... yes checking for gsm_create in -lgsm... yes checking for stdint.h... (cached) yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking for unistd.h... (cached) yes checking for inline... inline checking for int16_t... yes checking for int32_t... yes checking for uint16_t... yes checking for uint32_t... yes checking for uint64_t... yes checking for uint8_t... yes checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... yes checking for memset... yes checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating src/Makefile config.status: creating libgsmhr/Makefile config.status: creating include/Makefile config.status: creating include/gsmhr/Makefile config.status: creating libosmogapk.pc config.status: creating tests/atlocal config.status: creating tests/Makefile config.status: creating config.h config.status: executing depfiles commands config.status: executing libtool commands config.status: executing tests/atconfig commands make[1]: Entering directory ' make all-recursive make[2]: Entering directory ' Making all in include make[3]: Entering directory ' make[4]: Entering directory ' make[4]: Nothing to be done for 'all-am'. make[4]: Leaving directory ' make[3]: Leaving directory ' Making all in src make[3]: Entering directory ' CC procqueue.lo CC pq_format.lo CC pq_codec.lo CC pq_file.lo CC pq_alsa.lo CC pq_rtp.lo CC pq_ecu.lo CC ecu_fr.lo CC formats.lo CC fmt_ti.lo CC fmt_amr.lo CC fmt_gsm.lo CC fmt_hr_ref.lo CC fmt_racal.lo CC fmt_rawpcm.lo CC fmt_rtp_amr.lo CC fmt_rtp_efr.lo CC fmt_rtp_hr_etsi.lo CC fmt_rtp_hr_ietf.lo CC fmt_amr_opencore.lo CC codecs.lo CC codec_pcm.lo CC codec_hr.lo CC codec_fr.lo CC codec_efr.lo CC codec_amr.lo CC benchmark.lo CC common.lo CCLD libosmogapk.la CC app_osmo_gapk.o CCLD osmo-gapk make[3]: Leaving directory ' Making all in tests make[3]: Entering directory ' make[3]: Nothing to be done for 'all'. make[3]: Leaving directory ' make[3]: Entering directory ' make[3]: Leaving directory ' make[2]: Leaving directory ' make[1]: Leaving directory ' make[1]: Entering directory ' Making dvi in include make[2]: Entering directory ' make[3]: Entering directory ' make[3]: Nothing to be done for 'dvi-am'. make[3]: Leaving directory ' make[2]: Leaving directory ' Making dvi in src make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi'. make[2]: Leaving directory ' Making dvi in tests make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi'. make[2]: Leaving directory ' make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi-am'. make[2]: Leaving directory ' make[1]: Leaving directory ' make[1]: Entering directory ' Making check in include make[2]: Entering directory ' make[3]: Entering directory ' make[3]: Nothing to be done for 'check-am'. make[3]: Leaving directory ' make[2]: Leaving directory ' Making check in src make[2]: Entering directory ' make[2]: Nothing to be done for 'check'. make[2]: Leaving directory ' Making check in tests make[2]: Entering directory ' make procqueue/pq_test io/pq_file_test io/pq_rtp_test ecu/ecu_fr_test make[3]: Entering directory ' CC procqueue/pq_test.o CCLD procqueue/pq_test CC io/pq_file_test.o CCLD io/pq_file_test CC io/pq_rtp_test.o CCLD io/pq_rtp_test CC ecu/ecu_fr_test.o CCLD ecu/ecu_fr_test make[3]: Leaving directory ' make check-local make[3]: Entering directory ' /bin/bash '../../../tests/testsuite' ## ---------------------------- ## ## gapk 0.4.75-27bc test suite. ## ## ---------------------------- ## Regression tests. 1: procqueue ok 2: io/pq_file FAILED (testsuite.at:13) 3: io/pq_rtp ok 4: ecu/ecu_fr_test ok 5: conv/enc/amr_efr ok 6: conv/enc/gsm ok 7: conv/enc/racal_hr skipped (testsuite.at:58) 8: conv/enc/racal_fr ok 9: conv/enc/racal_efr ok 10: conv/enc/ti_hr skipped (testsuite.at:91) 11: conv/enc/ti_fr ok 12: conv/enc/ti_efr ok 13: conv/enc/rtp_efr ok 14: conv/enc/rtp_hr_etsi skipped (testsuite.at:135) 15: conv/enc/rtp_hr_ietf skipped (testsuite.at:146) 16: conv/dec/amr_efr ok 17: conv/dec/gsm ok 18: conv/dec/racal_hr skipped (testsuite.at:179) 19: conv/dec/racal_fr ok 20: conv/dec/racal_efr ok 21: conv/dec/ti_hr skipped (testsuite.at:212) 22: conv/dec/ti_fr ok 23: conv/dec/ti_efr ok 24: conv/dec/rtp_efr ok 25: conv/dec/rtp_hr_etsi skipped (testsuite.at:256) 26: conv/dec/rtp_hr_ietf skipped (testsuite.at:267) ## ------------- ## ## Test results. ## ## ------------- ## ERROR: 18 tests were run, 1 failed unexpectedly. 8 tests were skipped. ## -------------------------- ## ## testsuite.log was created. ## ## -------------------------- ## Please send `tests/testsuite.log' and all information you think might help: To: Subject: [gapk 0.4.75-27bc] testsuite: 2 failed You may investigate any problem if you feel able to do so, in which case the test suite provides a good starting point. Its output may be found below `tests/testsuite.dir'. Makefile:753: recipe for target 'check-local' failed make[3]: *** [check-local] Error 1 make[3]: Leaving directory ' Makefile:602: recipe for target 'check-am' failed make[2]: *** [check-am] Error 2 make[2]: Leaving directory ' Makefile:479: recipe for target 'check-recursive' failed make[1]: *** [check-recursive] Error 1 make[1]: Leaving directory ' Makefile:684: recipe for target 'distcheck' failed make: *** [distcheck] Error 1 + cat-testlogs.sh ======================== ./gapk-0.4.75-27bc/_build/sub/tests/testsuite.dir/02/testsuite.log # -*- compilation -*- 2. testsuite.at:10: testing io/pq_file ... ../../../tests/testsuite.at:13: $abs_top_builddir/tests/io/pq_file_test \ $abs_top_builddir/tests/io/io_sample.txt --- /dev/null 2018-03-27 19:17:06.212284948 +0000 +++ 2018-07-04 12:26:47.897509354 +0000 @@ -0,0 +1,2 @@ +pq_file_test: ../../../tests/io/pq_file_test.c:132: main: Assertion `sample_file != NULL' failed. +: line 29: 12779 Aborted $abs_top_builddir/tests/io/pq_file_test $abs_top_builddir/tests/io/io_sample.txt --- expout 2018-07-04 12:26:47.885509446 +0000 +++ 2018-07-04 12:26:47.885509446 +0000 @@ -1,12 +0,0 @@ -Processing sample file with blk_len=2: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=4: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=8: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=16: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=32: -8217c8fb7675a95008f9089d883gapk - -chunk null_context: depth=0 ../../../tests/testsuite.at:13: exit code was 134, expected 0 2. testsuite.at:10: 2. io/pq_file (testsuite.at:10): FAILED (testsuite.at:13) Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:27:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 12:27:15 +0000 Subject: Change in osmo-ttcn3-hacks[master]: bsc: inter-BSC HO: add TC_ho_out_of_this_bsc, TC_ho_into_this_bsc In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9674 ) Change subject: bsc: inter-BSC HO: add TC_ho_out_of_this_bsc, TC_ho_into_this_bsc ...................................................................... Patch Set 4: Code-Review-1 review comments to be adressed -- To view, visit https://gerrit.osmocom.org/9674 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id22852d4be7f127d827e7a8beeec55db27c07f03 Gerrit-Change-Number: 9674 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Wed, 04 Jul 2018 12:27:15 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:29:35 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 12:29:35 +0000 Subject: Change in simtrace2[master]: simtrace: add dedicated power pins configuration for sniffing In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9846 to look at the new patch set (#4). Change subject: simtrace: add dedicated power pins configuration for sniffing ...................................................................... simtrace: add dedicated power pins configuration for sniffing Change-Id: Ie37edbae6ea42d2b0c2a30eb5590afd0be797d39 --- M firmware/libboard/simtrace/include/board.h M firmware/libcommon/source/sniffer.c 2 files changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/46/9846/4 -- To view, visit https://gerrit.osmocom.org/9846 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie37edbae6ea42d2b0c2a30eb5590afd0be797d39 Gerrit-Change-Number: 9846 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:29:35 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 12:29:35 +0000 Subject: Change in simtrace2[master]: sniffer: add state definitions, improve IRQ handling, update pins con... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9849 to look at the new patch set (#4). Change subject: sniffer: add state definitions, improve IRQ handling, update pins configuration ...................................................................... sniffer: add state definitions, improve IRQ handling, update pins configuration Change-Id: I6b5dfd6d573ac122a60585a24c8a620642805ad5 --- M firmware/libcommon/source/sniffer.c 1 file changed, 77 insertions(+), 26 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/49/9849/4 -- To view, visit https://gerrit.osmocom.org/9849 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6b5dfd6d573ac122a60585a24c8a620642805ad5 Gerrit-Change-Number: 9849 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:29:35 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 12:29:35 +0000 Subject: Change in simtrace2[master]: SIMtrace: only enable main sniffing mode on SIMtrace board In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9850 to look at the new patch set (#4). Change subject: SIMtrace: only enable main sniffing mode on SIMtrace board ...................................................................... SIMtrace: only enable main sniffing mode on SIMtrace board Change-Id: Iff6ebb1d98aa0c31f6d78508afde8f1b05f0f85b --- M firmware/libboard/simtrace/include/board.h 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/50/9850/4 -- To view, visit https://gerrit.osmocom.org/9850 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iff6ebb1d98aa0c31f6d78508afde8f1b05f0f85b Gerrit-Change-Number: 9850 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:29:35 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 12:29:35 +0000 Subject: Change in simtrace2[master]: SIMtrace: fix default SIM_RST pin state to allow phone controlled reset In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9851 to look at the new patch set (#4). Change subject: SIMtrace: fix default SIM_RST pin state to allow phone controlled reset ...................................................................... SIMtrace: fix default SIM_RST pin state to allow phone controlled reset Change-Id: I1942ec6bd499cb2e14f6d7699a2b2d9b4197e654 --- M firmware/libboard/simtrace/include/board.h 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/51/9851/4 -- To view, visit https://gerrit.osmocom.org/9851 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1942ec6bd499cb2e14f6d7699a2b2d9b4197e654 Gerrit-Change-Number: 9851 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:29:35 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 12:29:35 +0000 Subject: Change in simtrace2[master]: SIMtrace: enable interrupt on edge dection for SIM_RST pin to reset t... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9852 to look at the new patch set (#4). Change subject: SIMtrace: enable interrupt on edge dection for SIM_RST pin to reset the sniffer ISO state ...................................................................... SIMtrace: enable interrupt on edge dection for SIM_RST pin to reset the sniffer ISO state Change-Id: I92ff29abd6a8690dd033d8cf13ad0d1ff9740fe5 --- M firmware/libboard/simtrace/include/board.h 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/52/9852/4 -- To view, visit https://gerrit.osmocom.org/9852 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I92ff29abd6a8690dd033d8cf13ad0d1ff9740fe5 Gerrit-Change-Number: 9852 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:29:35 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 12:29:35 +0000 Subject: Change in simtrace2[master]: ISO7816: change update_fidi to use provided USART In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9853 to look at the new patch set (#5). Change subject: ISO7816: change update_fidi to use provided USART ...................................................................... ISO7816: change update_fidi to use provided USART Also disables write protection for USART register if required Change-Id: I716f4bc3a22800cbce402b146f14ef8b2aab2a98 --- M firmware/libcommon/include/simtrace.h M firmware/libcommon/source/simtrace_iso7816.c 2 files changed, 23 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/53/9853/5 -- To view, visit https://gerrit.osmocom.org/9853 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I716f4bc3a22800cbce402b146f14ef8b2aab2a98 Gerrit-Change-Number: 9853 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:29:35 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 12:29:35 +0000 Subject: Change in simtrace2[master]: trace: increase watchdog for 500 to 2000 ms to provide more time hand... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9854 to look at the new patch set (#5). Change subject: trace: increase watchdog for 500 to 2000 ms to provide more time handling buffered data ...................................................................... trace: increase watchdog for 500 to 2000 ms to provide more time handling buffered data Change-Id: Iacd85525f05e692b44183bd4c4585b9e70865cfe --- M firmware/apps/trace/main.c 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/54/9854/5 -- To view, visit https://gerrit.osmocom.org/9854 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iacd85525f05e692b44183bd4c4585b9e70865cfe Gerrit-Change-Number: 9854 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:29:35 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 12:29:35 +0000 Subject: Change in simtrace2[master]: sniffer: use ISR to store sniffed data in buffer, add ATR and PPS par... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9855 to look at the new patch set (#5). Change subject: sniffer: use ISR to store sniffed data in buffer, add ATR and PPS parsing, and PPS related FiDi update ...................................................................... sniffer: use ISR to store sniffed data in buffer, add ATR and PPS parsing, and PPS related FiDi update Change-Id: I4b38ce1d80e370fda6aa181e959ba3f1286bb922 --- M firmware/libcommon/source/sniffer.c 1 file changed, 362 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/55/9855/5 -- To view, visit https://gerrit.osmocom.org/9855 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4b38ce1d80e370fda6aa181e959ba3f1286bb922 Gerrit-Change-Number: 9855 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:29:35 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 12:29:35 +0000 Subject: Change in simtrace2[master]: DFU: remove force bootloader button debug message since the console i... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9860 to look at the new patch set (#4). Change subject: DFU: remove force bootloader button debug message since the console is output message is not initialized yet ...................................................................... DFU: remove force bootloader button debug message since the console is output message is not initialized yet Change-Id: Ibea0105929a8dc38b43dacd9d1e576d7b51d0c6a --- M firmware/libboard/simtrace/source/board_simtrace.c 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/60/9860/4 -- To view, visit https://gerrit.osmocom.org/9860 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibea0105929a8dc38b43dacd9d1e576d7b51d0c6a Gerrit-Change-Number: 9860 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:29:35 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 12:29:35 +0000 Subject: Change in simtrace2[master]: board: fix LED pin definition In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9861 to look at the new patch set (#4). Change subject: board: fix LED pin definition ...................................................................... board: fix LED pin definition Change-Id: Ia6c80c0268dec708845e1dad281caaa42027f9db --- M firmware/libboard/common/include/board_common.h 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/61/9861/4 -- To view, visit https://gerrit.osmocom.org/9861 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia6c80c0268dec708845e1dad281caaa42027f9db Gerrit-Change-Number: 9861 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:29:35 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 12:29:35 +0000 Subject: Change in simtrace2[master]: DFU: switch green LED on to indicate DFU mode, and red LED to indicat... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9862 to look at the new patch set (#4). Change subject: DFU: switch green LED on to indicate DFU mode, and red LED to indicate flashing activity ...................................................................... DFU: switch green LED on to indicate DFU mode, and red LED to indicate flashing activity Change-Id: I8e34fd869ed94ad122d6a17f5a432f5a09b820bb --- M firmware/apps/dfu/main.c 1 file changed, 39 insertions(+), 23 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/62/9862/4 -- To view, visit https://gerrit.osmocom.org/9862 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8e34fd869ed94ad122d6a17f5a432f5a09b820bb Gerrit-Change-Number: 9862 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:29:35 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 12:29:35 +0000 Subject: Change in simtrace2[master]: update_fidi: remove debug output since this function is called in tim... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9863 to look at the new patch set (#4). Change subject: update_fidi: remove debug output since this function is called in time critical ISR ...................................................................... update_fidi: remove debug output since this function is called in time critical ISR Change-Id: I08f407d407a18dae3f360ddc64769ddfaeb5b559 --- M firmware/libcommon/source/simtrace_iso7816.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/63/9863/4 -- To view, visit https://gerrit.osmocom.org/9863 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I08f407d407a18dae3f360ddc64769ddfaeb5b559 Gerrit-Change-Number: 9863 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:29:35 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 12:29:35 +0000 Subject: Change in simtrace2[master]: LED: add short LED pulse blinking pattern In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9864 to look at the new patch set (#4). Change subject: LED: add short LED pulse blinking pattern ...................................................................... LED: add short LED pulse blinking pattern Change-Id: I0fdc2f902a3b92da6aa9b9c8500abae8a2f79447 --- M firmware/libboard/common/include/led.h M firmware/libboard/common/source/led.c 2 files changed, 19 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/64/9864/4 -- To view, visit https://gerrit.osmocom.org/9864 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0fdc2f902a3b92da6aa9b9c8500abae8a2f79447 Gerrit-Change-Number: 9864 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:29:35 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 12:29:35 +0000 Subject: Change in simtrace2[master]: sniff: print parsed ATR and PPS; use red LED to show main application... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9865 to look at the new patch set (#4). Change subject: sniff: print parsed ATR and PPS; use red LED to show main application is running; use green LED to indicate activity (message parsed) ...................................................................... sniff: print parsed ATR and PPS; use red LED to show main application is running; use green LED to indicate activity (message parsed) Change-Id: I8e906bdbf2c91e608757ae442dfb241f981b8f1e --- M firmware/apps/trace/main.c M firmware/libcommon/source/sniffer.c 2 files changed, 56 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/65/9865/4 -- To view, visit https://gerrit.osmocom.org/9865 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8e906bdbf2c91e608757ae442dfb241f981b8f1e Gerrit-Change-Number: 9865 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:29:35 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 12:29:35 +0000 Subject: Change in simtrace2[master]: sniff: add TPDU parsing (TPDUs become APDUs on the upper layer) In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9866 to look at the new patch set (#5). Change subject: sniff: add TPDU parsing (TPDUs become APDUs on the upper layer) ...................................................................... sniff: add TPDU parsing (TPDUs become APDUs on the upper layer) Change-Id: I09d050d95bd2ab140fe6b4926a37278eb08cc347 --- M firmware/libcommon/source/sniffer.c 1 file changed, 143 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/66/9866/5 -- To view, visit https://gerrit.osmocom.org/9866 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I09d050d95bd2ab140fe6b4926a37278eb08cc347 Gerrit-Change-Number: 9866 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:29:35 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 12:29:35 +0000 Subject: Change in simtrace2[master]: sniff: add WT timeout detection using USART timeout (TC is not required) In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9867 to look at the new patch set (#5). Change subject: sniff: add WT timeout detection using USART timeout (TC is not required) ...................................................................... sniff: add WT timeout detection using USART timeout (TC is not required) Change-Id: I4ec6e812e7e1eb91005027d2e864fc315550d79c --- M firmware/libcommon/source/sniffer.c 1 file changed, 28 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/67/9867/5 -- To view, visit https://gerrit.osmocom.org/9867 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4ec6e812e7e1eb91005027d2e864fc315550d79c Gerrit-Change-Number: 9867 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:29:35 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 12:29:35 +0000 Subject: Change in simtrace2[master]: minor: fix typos in comment In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9868 to look at the new patch set (#5). Change subject: minor: fix typos in comment ...................................................................... minor: fix typos in comment Change-Id: I01b49e047a586dff449d4e134751108e391a8822 --- M firmware/libcommon/include/simtrace_prot.h 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/68/9868/5 -- To view, visit https://gerrit.osmocom.org/9868 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I01b49e047a586dff449d4e134751108e391a8822 Gerrit-Change-Number: 9868 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:29:35 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 12:29:35 +0000 Subject: Change in simtrace2[master]: USB: add central file to define USB IDs, classes, and endpoints In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9869 to look at the new patch set (#5). Change subject: USB: add central file to define USB IDs, classes, and endpoints ...................................................................... USB: add central file to define USB IDs, classes, and endpoints Change-Id: Iba81f32a92c68a973e8e7adbc4c2a1064ba5290f --- M firmware/atmel_softpack_libraries/usb/device/dfu/dfu_desc.c M firmware/libboard/common/include/board_common.h M firmware/libboard/owhw/include/board.h M firmware/libboard/qmod/include/board.h M firmware/libboard/simtrace/include/board.h M firmware/libcommon/include/simtrace.h A firmware/libcommon/include/simtrace_usb.h M firmware/libcommon/source/mode_cardemu.c M firmware/libcommon/source/simtrace_iso7816.c M firmware/libcommon/source/usb.c M firmware/libcommon/source/usb_buf.c 11 files changed, 120 insertions(+), 105 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/69/9869/5 -- To view, visit https://gerrit.osmocom.org/9869 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iba81f32a92c68a973e8e7adbc4c2a1064ba5290f Gerrit-Change-Number: 9869 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:29:35 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 12:29:35 +0000 Subject: Change in simtrace2[master]: host usb_util fix: used provided class, sub-class, and interfave when... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9870 to look at the new patch set (#5). Change subject: host usb_util fix: used provided class, sub-class, and interfave when finding matching interfaces ...................................................................... host usb_util fix: used provided class, sub-class, and interfave when finding matching interfaces Change-Id: Ibc06e751e6ca0f9e9a40d82c4eeddfb975240f91 --- M host/libusb_util.c 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/70/9870/5 -- To view, visit https://gerrit.osmocom.org/9870 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibc06e751e6ca0f9e9a40d82c4eeddfb975240f91 Gerrit-Change-Number: 9870 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:29:35 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 12:29:35 +0000 Subject: Change in simtrace2[master]: host USB: use central SIMtrace USB ID definition header In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9871 to look at the new patch set (#5). Change subject: host USB: use central SIMtrace USB ID definition header ...................................................................... host USB: use central SIMtrace USB ID definition header Change-Id: Id18e64fba0a2c308a8aef7d3865200bf0237cae9 --- M host/simtrace2_usb.c A host/simtrace_usb.h 2 files changed, 5 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/71/9871/5 -- To view, visit https://gerrit.osmocom.org/9871 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id18e64fba0a2c308a8aef7d3865200bf0237cae9 Gerrit-Change-Number: 9871 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:29:35 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 12:29:35 +0000 Subject: Change in simtrace2[master]: USB device: add USB message structure for sniffer communication In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9872 to look at the new patch set (#5). Change subject: USB device: add USB message structure for sniffer communication ...................................................................... USB device: add USB message structure for sniffer communication Change-Id: Id2c6f32ade2fec9b9ef91bd8c5e1fd195f2d7351 --- M firmware/libcommon/include/simtrace_prot.h 1 file changed, 52 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/72/9872/5 -- To view, visit https://gerrit.osmocom.org/9872 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id2c6f32ade2fec9b9ef91bd8c5e1fd195f2d7351 Gerrit-Change-Number: 9872 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:29:35 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 12:29:35 +0000 Subject: Change in simtrace2[master]: sniffer USB: implement USB communication and send parsed messages In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9873 to look at the new patch set (#6). Change subject: sniffer USB: implement USB communication and send parsed messages ...................................................................... sniffer USB: implement USB communication and send parsed messages Change-Id: Ice7817480705f2124b08c1ff9a8826558b6d8b2b --- M firmware/libcommon/source/sniffer.c 1 file changed, 235 insertions(+), 62 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/73/9873/6 -- To view, visit https://gerrit.osmocom.org/9873 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ice7817480705f2124b08c1ff9a8826558b6d8b2b Gerrit-Change-Number: 9873 Gerrit-PatchSet: 6 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:29:35 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 12:29:35 +0000 Subject: Change in simtrace2[master]: host USB: add host application to receive and display USB sniffing me... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9874 to look at the new patch set (#8). Change subject: host USB: add host application to receive and display USB sniffing messages sent by firmware ...................................................................... host USB: add host application to receive and display USB sniffing messages sent by firmware Change-Id: Idefbf21e0bbd2a1e3647fe9aebaf88d1b62dae2d --- M host/Makefile A host/simtrace2-sniff.c 2 files changed, 538 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/74/9874/8 -- To view, visit https://gerrit.osmocom.org/9874 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Idefbf21e0bbd2a1e3647fe9aebaf88d1b62dae2d Gerrit-Change-Number: 9874 Gerrit-PatchSet: 8 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:29:35 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 12:29:35 +0000 Subject: Change in simtrace2[master]: sniffer: display F and D values frim PPS In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9875 to look at the new patch set (#8). Change subject: sniffer: display F and D values frim PPS ...................................................................... sniffer: display F and D values frim PPS Change-Id: I3641dcb6c24695a6d3dd3a1ee4333f56a07c99f0 --- M firmware/libcommon/include/iso7816_fidi.h M firmware/libcommon/source/iso7816_fidi.c M firmware/libcommon/source/sniffer.c 3 files changed, 9 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/75/9875/8 -- To view, visit https://gerrit.osmocom.org/9875 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3641dcb6c24695a6d3dd3a1ee4333f56a07c99f0 Gerrit-Change-Number: 9875 Gerrit-PatchSet: 8 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:29:35 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 12:29:35 +0000 Subject: Change in simtrace2[master]: console: drop data to be send when buffer is already full In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9876 to look at the new patch set (#8). Change subject: console: drop data to be send when buffer is already full ...................................................................... console: drop data to be send when buffer is already full don't wait for space to be available in the buffer since since would prevent from processing non-console (e.g. debug) more important data Change-Id: Ia625b09eb30bb7b43edd3989f697d8ef33200f28 --- M firmware/libboard/common/source/uart_console.c 1 file changed, 8 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/76/9876/8 -- To view, visit https://gerrit.osmocom.org/9876 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia625b09eb30bb7b43edd3989f697d8ef33200f28 Gerrit-Change-Number: 9876 Gerrit-PatchSet: 8 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:29:35 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 12:29:35 +0000 Subject: Change in simtrace2[master]: buffer: increase buffer size to 512 to cope with fast and long TPDUs In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9877 to look at the new patch set (#8). Change subject: buffer: increase buffer size to 512 to cope with fast and long TPDUs ...................................................................... buffer: increase buffer size to 512 to cope with fast and long TPDUs Change-Id: I194c90cf09306a982d80c5bf1222397af6e658a9 --- M firmware/libcommon/include/ringbuffer.h 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/77/9877/8 -- To view, visit https://gerrit.osmocom.org/9877 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I194c90cf09306a982d80c5bf1222397af6e658a9 Gerrit-Change-Number: 9877 Gerrit-PatchSet: 8 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:29:35 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 12:29:35 +0000 Subject: Change in simtrace2[master]: sniffing: move conversion convertion and flag processing from ISR to ... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9878 to look at the new patch set (#8). Change subject: sniffing: move conversion convertion and flag processing from ISR to main loop to keep ISR fast and focus on data capture ...................................................................... sniffing: move conversion convertion and flag processing from ISR to main loop to keep ISR fast and focus on data capture Change-Id: Ieefa8a5f81dbcc12c1ad3059660dbffa0c1a4961 --- M firmware/libcommon/source/sniffer.c M host/simtrace2-sniff.c 2 files changed, 98 insertions(+), 73 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/78/9878/8 -- To view, visit https://gerrit.osmocom.org/9878 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ieefa8a5f81dbcc12c1ad3059660dbffa0c1a4961 Gerrit-Change-Number: 9878 Gerrit-PatchSet: 8 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:29:35 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 12:29:35 +0000 Subject: Change in simtrace2[master]: sniffer: also send incomplete (e.g. timeout) data (PPS/ATR/TPDU) In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9879 to look at the new patch set (#9). Change subject: sniffer: also send incomplete (e.g. timeout) data (PPS/ATR/TPDU) ...................................................................... sniffer: also send incomplete (e.g. timeout) data (PPS/ATR/TPDU) Change-Id: Ib070aca181042b477f1ffec48d63dc56c1e4609a --- M firmware/libcommon/source/sniffer.c 1 file changed, 42 insertions(+), 27 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/79/9879/9 -- To view, visit https://gerrit.osmocom.org/9879 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib070aca181042b477f1ffec48d63dc56c1e4609a Gerrit-Change-Number: 9879 Gerrit-PatchSet: 9 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:29:35 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 12:29:35 +0000 Subject: Change in simtrace2[master]: sniffing: fix procedure byte handling and make TPDU parsing for strict In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9880 to look at the new patch set (#9). Change subject: sniffing: fix procedure byte handling and make TPDU parsing for strict ...................................................................... sniffing: fix procedure byte handling and make TPDU parsing for strict Change-Id: If991152f11c4b864ab1386f21dc13c335e6b281f --- M firmware/libcommon/source/sniffer.c 1 file changed, 12 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/80/9880/9 -- To view, visit https://gerrit.osmocom.org/9880 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If991152f11c4b864ab1386f21dc13c335e6b281f Gerrit-Change-Number: 9880 Gerrit-PatchSet: 9 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:29:35 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 12:29:35 +0000 Subject: Change in simtrace2[master]: sniffing: decrease USB IRQ prioprity to prevent USART overrun In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9881 to look at the new patch set (#9). Change subject: sniffing: decrease USB IRQ prioprity to prevent USART overrun ...................................................................... sniffing: decrease USB IRQ prioprity to prevent USART overrun Handling the USB message queue is done in an ISR and take quite some time. This can cause a USART/SIM sniffing buffer overrun, resulting in data loss. By setting the USB IRQ lower than the USART IRQ, the USB ISR can be interrupted (for short) and no data gets lost. Change-Id: I870a0aa8e251bbb53249c54bfcaa45de5b5a9486 --- M firmware/libcommon/source/sniffer.c 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/81/9881/9 -- To view, visit https://gerrit.osmocom.org/9881 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I870a0aa8e251bbb53249c54bfcaa45de5b5a9486 Gerrit-Change-Number: 9881 Gerrit-PatchSet: 9 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:29:35 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 12:29:35 +0000 Subject: Change in simtrace2[master]: sniffer: add waiting time WT update In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9882 to look at the new patch set (#9). Change subject: sniffer: add waiting time WT update ...................................................................... sniffer: add waiting time WT update the waiting time (WT) is used to detect timeouts (e.g. for unresponsive card or just to signal an error/NAK). it is essential to detect to timeout to end current data transfer (e.g. change state). by default (after a reset) to timeout is 9600 ETU, but this can change at two places: - after the ATR using the value of TC2 (if present) - after a PPS (only F is used, and not D) because the timeout value can be larger than the 16-bit of the USART TO register, an external variable needs to be used for the count down. Change-Id: I9735660ffce161cec8d4e63fa60a66fc8ef57525 --- M firmware/libcommon/source/sniffer.c 1 file changed, 66 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/82/9882/9 -- To view, visit https://gerrit.osmocom.org/9882 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9735660ffce161cec8d4e63fa60a66fc8ef57525 Gerrit-Change-Number: 9882 Gerrit-PatchSet: 9 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:29:59 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 12:29:59 +0000 Subject: Change in simtrace2[master]: minor style change: use ARRAY_SIZE Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9886 Change subject: minor style change: use ARRAY_SIZE ...................................................................... minor style change: use ARRAY_SIZE Change-Id: Ia5243c342535963a3800849cd5a7d183a510d2d6 --- M firmware/apps/trace/main.c 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/86/9886/1 diff --git a/firmware/apps/trace/main.c b/firmware/apps/trace/main.c index a288a7b..754e905 100644 --- a/firmware/apps/trace/main.c +++ b/firmware/apps/trace/main.c @@ -169,8 +169,7 @@ } TRACE_INFO("calling configure of all configurations...\n\r"); - for (i = 1; i < sizeof(config_func_ptrs) / sizeof(config_func_ptrs[0]); - ++i) { + for (i = 1; i < ARRAY_SIZE(config_func_ptrs); i++) { if (config_func_ptrs[i].configure) config_func_ptrs[i].configure(); } -- To view, visit https://gerrit.osmocom.org/9886 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ia5243c342535963a3800849cd5a7d183a510d2d6 Gerrit-Change-Number: 9886 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 12:47:53 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 12:47:53 +0000 Subject: Change in simtrace2[master]: qmod: Add 'e' command for erasing the EEPROM In-Reply-To: References: Message-ID: K?vin Redon has posted comments on this change. ( https://gerrit.osmocom.org/9858 ) Change subject: qmod: Add 'e' command for erasing the EEPROM ...................................................................... Patch Set 1: Code-Review-1 see previous comment -- To view, visit https://gerrit.osmocom.org/9858 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id7cb0db568dd3e9d796829bf0019d63048612998 Gerrit-Change-Number: 9858 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon Gerrit-Comment-Date: Wed, 04 Jul 2018 12:47:53 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 13:01:59 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 13:01:59 +0000 Subject: Change in simtrace2[master]: minor style change: use ARRAY_SIZE In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9886 ) Change subject: minor style change: use ARRAY_SIZE ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9886 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia5243c342535963a3800849cd5a7d183a510d2d6 Gerrit-Change-Number: 9886 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 04 Jul 2018 13:01:59 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 13:02:26 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 13:02:26 +0000 Subject: Change in simtrace2[master]: simtrace: add dedicated power pins configuration for sniffing In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9846 ) Change subject: simtrace: add dedicated power pins configuration for sniffing ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9846 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie37edbae6ea42d2b0c2a30eb5590afd0be797d39 Gerrit-Change-Number: 9846 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 04 Jul 2018 13:02:26 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 13:02:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 13:02:41 +0000 Subject: Change in simtrace2[master]: sniffer: add state definitions, improve IRQ handling, update pins con... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9849 ) Change subject: sniffer: add state definitions, improve IRQ handling, update pins configuration ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9849 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6b5dfd6d573ac122a60585a24c8a620642805ad5 Gerrit-Change-Number: 9849 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 04 Jul 2018 13:02:41 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 13:02:58 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 13:02:58 +0000 Subject: Change in simtrace2[master]: simtrace: add dedicated power pins configuration for sniffing In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9846 ) Change subject: simtrace: add dedicated power pins configuration for sniffing ...................................................................... simtrace: add dedicated power pins configuration for sniffing Change-Id: Ie37edbae6ea42d2b0c2a30eb5590afd0be797d39 --- M firmware/libboard/simtrace/include/board.h M firmware/libcommon/source/sniffer.c 2 files changed, 6 insertions(+), 6 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libboard/simtrace/include/board.h b/firmware/libboard/simtrace/include/board.h index 00d32ee..8e832dd 100644 --- a/firmware/libboard/simtrace/include/board.h +++ b/firmware/libboard/simtrace/include/board.h @@ -14,6 +14,8 @@ #define PIN_BOOTLOADER_SW {PIO_PA31, PIOA, ID_PIOA, PIO_INPUT, PIO_PULLUP} /* Enable powering the card using the second 3.3 V output of the LDO (active high) */ #define SIM_PWEN_PIN {SIM_PWEN, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} +/* Enable powering the SIM card */ +#define PWR_PINS SIM_PWEN_PIN /* Card presence pin */ #define SW_SIM PIO_PA8 /* Pull card presence pin high (shorted to ground in card slot when card is present) */ @@ -49,7 +51,7 @@ /* Pin used as clock input (to measure the ETU duration; connected to CLK_PHONE in schematic) */ #define PIN_PHONE_CLK_INPUT {PIO_PA29B_TCLK2, PIOA, ID_PIOA, PIO_PERIPH_B, PIO_DEFAULT} -/** Default configuration **/ +/** Default pin configuration **/ /* Disconnect VPP, CLK, and RST lines between card and phone using bus switch (high sets bus switch to high-impedance) */ #define PIN_SC_SW_DEFAULT {PIO_PA20, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} /* Disconnect I/O line between card and phone using bus switch (high sets bus switch to high-impedance) */ @@ -64,16 +66,14 @@ #define PIN_IO_SW_SNIFF {PIO_PA19, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT} /* Connect all lines (VPP, CLK, RST, and I/O) between card and phone */ #define PINS_BUS_SNIFF PIN_SC_SW_SNIFF, PIN_IO_SW_SNIFF -/* Use RST_SIM line to detect phone issued card reset */ -#define PIN_SIM_RST_SNIFF {PIO_PA7, PIOA, ID_PIOA, PIO_INPUT, PIO_PULLUP | PIO_DEBOUNCE | PIO_DEGLITCH | PIO_IT_EDGE } /* Pins used to sniff phone-card communication */ -#define PINS_SIM_SNIFF_SIM PIN_SIM_IO, PIN_SIM_CLK, PIN_SIM_RST_SNIFF +#define PINS_SIM_SNIFF PIN_SIM_IO, PIN_SIM_CLK, PIN_SIM_RST /* Disable power converter 4.5-6V to 3.3V (active high) */ #define PIN_SIM_PWEN_SNIFF {SIM_PWEN, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT} /* Enable power switch to forward VCC_PHONE to VCC_SIM (active high) */ #define PIN_VCC_FWD_SNIFF {VCC_FWD, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} /* Use phone VCC to power card */ -#define PWR_PINS PIN_SIM_PWEN_SNIFF, PIN_VCC_FWD_SNIFF +#define PINS_PWR_SNIFF PIN_SIM_PWEN_SNIFF, PIN_VCC_FWD_SNIFF /** CCID configuration */ /* Card RST reset signal input (active low; RST_SIM in schematic) */ diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 7cc688b..61c8864 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -42,7 +42,7 @@ * Internal variables *------------------------------------------------------------------------------*/ /* Pin configuration to sniff communication (using USART connection to SIM card) */ -static const Pin pins_sniff[] = { PINS_SIM_SNIFF_SIM }; +static const Pin pins_sniff[] = { PINS_SIM_SNIFF }; /* Connect phone to card using bus switch */ static const Pin pins_bus[] = { PINS_BUS_SNIFF }; /* Power card using phone VCC */ -- To view, visit https://gerrit.osmocom.org/9846 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ie37edbae6ea42d2b0c2a30eb5590afd0be797d39 Gerrit-Change-Number: 9846 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 13:02:59 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 13:02:59 +0000 Subject: Change in simtrace2[master]: board: comment USART definitions and add corresponding IRQ numbers In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9847 ) Change subject: board: comment USART definitions and add corresponding IRQ numbers ...................................................................... board: comment USART definitions and add corresponding IRQ numbers Change-Id: I3c38e7d75bc7b511827c33af69e335e50d0b35d2 --- M firmware/libboard/common/include/board_common.h 1 file changed, 11 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libboard/common/include/board_common.h b/firmware/libboard/common/include/board_common.h index 8349698..27f7409 100644 --- a/firmware/libboard/common/include/board_common.h +++ b/firmware/libboard/common/include/board_common.h @@ -81,10 +81,19 @@ #define BOARD_ISO7816_BASE_USART USART0 #define BOARD_ISO7816_ID_USART ID_USART0 +/* USART peripherals for a phone and SIM card setup */ +/* USART peripheral connected to the SIM card */ #define USART_SIM USART0 +/* ID of USART peripheral connected to the SIM card */ #define ID_USART_SIM ID_USART0 -#define USART_PHONE USART1 -#define ID_USART_PHONE ID_USART1 +/* Interrupt request ID of USART peripheral connected to the SIM card */ +#define IRQ_USART_SIM USART0_IRQn +/* USART peripheral connected to the phone */ +#define USART_PHONE USART1 +/* ID of USART peripheral connected to the phone */ +#define ID_USART_PHONE ID_USART1 +/* Interrupt request ID of USART peripheral connected to the phone */ +#define IRQ_USART_PHONE USART1_IRQn #define SIM_PWEN PIO_PA5 #define VCC_FWD PIO_PA26 -- To view, visit https://gerrit.osmocom.org/9847 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I3c38e7d75bc7b511827c33af69e335e50d0b35d2 Gerrit-Change-Number: 9847 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 13:03:00 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 13:03:00 +0000 Subject: Change in simtrace2[master]: simtrace: add support for sniffing on both USART In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9848 ) Change subject: simtrace: add support for sniffing on both USART ...................................................................... simtrace: add support for sniffing on both USART Change-Id: I69eb458e7cb186c990e5d6fbc780f37fdd0cd884 --- M firmware/apps/trace/main.c M firmware/libcommon/include/simtrace.h 2 files changed, 2 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/apps/trace/main.c b/firmware/apps/trace/main.c index 2e6dc31..e7ce7b7 100644 --- a/firmware/apps/trace/main.c +++ b/firmware/apps/trace/main.c @@ -37,6 +37,7 @@ .exit = Sniffer_exit, .run = Sniffer_run, .usart0_irq = Sniffer_usart0_irq, + .usart1_irq = Sniffer_usart1_irq, }, #endif #ifdef HAVE_CCID diff --git a/firmware/libcommon/include/simtrace.h b/firmware/libcommon/include/simtrace.h index e39d1dc..278d5d2 100644 --- a/firmware/libcommon/include/simtrace.h +++ b/firmware/libcommon/include/simtrace.h @@ -109,6 +109,7 @@ /* IRQ functions */ extern void Sniffer_usart0_irq(void); +extern void Sniffer_usart1_irq(void); extern void mode_cardemu_usart0_irq(void); extern void mode_cardemu_usart1_irq(void); -- To view, visit https://gerrit.osmocom.org/9848 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I69eb458e7cb186c990e5d6fbc780f37fdd0cd884 Gerrit-Change-Number: 9848 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 13:03:01 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 13:03:01 +0000 Subject: Change in simtrace2[master]: sniffer: add state definitions, improve IRQ handling, update pins con... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9849 ) Change subject: sniffer: add state definitions, improve IRQ handling, update pins configuration ...................................................................... sniffer: add state definitions, improve IRQ handling, update pins configuration Change-Id: I6b5dfd6d573ac122a60585a24c8a620642805ad5 --- M firmware/libcommon/source/sniffer.c 1 file changed, 77 insertions(+), 26 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 61c8864..987e3e5 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -17,6 +17,9 @@ * along with this program. If not, see . * */ +/* This code implement the Sniffer mode to sniff the communication between a SIM card and a phone. + * For historical reasons (i.e. SIMtrace hardware) the USART peripheral connected to the SIM card is used. + */ #include "board.h" #include "simtrace.h" @@ -35,20 +38,51 @@ /** Maximum ucSize in bytes of the smartcard answer to a command.*/ #define MAX_ANSWER_SIZE 10 -/** Maximum ATR ucSize in bytes.*/ -#define MAX_ATR_SIZE 55 +/*! Maximum Answer-To-Reset (ATR) size in bytes ucSize in bytes + * @note defined in ISO/IEC 7816-3:2006(E) section 8.2.1 as 32, on top the initial character TS of section 8.1 + * @remark technical there is no size limitation since Yi present in T0,TDi will indicate if more interface bytes are present, including TDi+i + */ +#define MAX_ATR_SIZE 33 + +/*! ISO 7816-3 states relevant to the sniff mode */ +enum iso7816_3_sniff_state { + ISO7816_S_RESET, /*!< in Reset */ + ISO7816_S_WAIT_ATR, /*!< waiting for ATR to start */ + ISO7816_S_IN_ATR, /*!< while we are receiving the ATR */ + ISO7816_S_WAIT_APDU, /*!< waiting for start of new APDU */ + ISO7816_S_IN_APDU, /*!< inside a single APDU */ + ISO7816_S_IN_PTS, /*!< while we are inside the PTS / PSS */ +}; + +/*! Answer-To-Reset (ATR) sub-states of ISO7816_S_IN_ATR + * @note defined in ISO/IEC 7816-3:2006(E) section 8 + */ +enum atr_sniff_state { + ATR_S_WAIT_TS, /*!< initial byte */ + ATR_S_WAIT_T0, /*!< format byte */ + ATR_S_WAIT_TA, /*!< first sub-group interface byte */ + ATR_S_WAIT_TB, /*!< second sub-group interface byte */ + ATR_S_WAIT_TC, /*!< third sub-group interface byte */ + ATR_S_WAIT_TD, /*!< fourth sub-group interface byte */ + ATR_S_WAIT_HIST, /*!< historical byte */ + ATR_S_WAIT_TCK, /*!< check byte */ + ATR_S_DONE, /*!< to indicated all ATR bytes have been received */ +}; /*------------------------------------------------------------------------------ * Internal variables *------------------------------------------------------------------------------*/ -/* Pin configuration to sniff communication (using USART connection to SIM card) */ + +/* note: the sniffer code is currently designed to support only one sniffing interface, but the hardware would support a second one. + * to support a second sniffer interface the code should be restructured to use handles. + */ +/* Pin configurations */ +/* Pin configuration to sniff communication (using USART connection card) */ static const Pin pins_sniff[] = { PINS_SIM_SNIFF }; -/* Connect phone to card using bus switch */ static const Pin pins_bus[] = { PINS_BUS_SNIFF }; -/* Power card using phone VCC */ -static const Pin pins_power[] = { PWR_PINS }; -/* Timer Counter pins to measure ETU timing */ +static const Pin pins_power[] = { PINS_PWR_SNIFF }; static const Pin pins_tc[] = { PINS_TC }; +/* USART related variables */ /* USART peripheral used to sniff communication */ static struct Usart_info sniff_usart = { .base = USART_SIM, @@ -59,23 +93,6 @@ static struct ringbuf sniff_buffer; /*------------------------------------------------------------------------------ - * Global functions - *------------------------------------------------------------------------------*/ - -void Sniffer_usart0_irq(void) -{ - /* Read channel status register */ - uint32_t csr = sniff_usart.base->US_CSR & sniff_usart.base->US_IMR; - /* Verify if character has been received */ - if (csr & US_CSR_RXRDY) { - /* Read communication data byte between phone and SIM */ - uint8_t byte = sniff_usart.base->US_RHR; - /* Store sniffed data into buffer (also clear interrupt */ - rbuf_write(&sniff_buffer, byte); - } -} - -/*------------------------------------------------------------------------------ * Internal functions *------------------------------------------------------------------------------*/ @@ -88,6 +105,38 @@ } } +/*! Interrupt Service Routine called on USART activity */ +void Sniffer_usart_irq(void) +{ + /* Read channel status register */ + uint32_t csr = sniff_usart.base->US_CSR & sniff_usart.base->US_IMR; + /* Verify if character has been received */ + if (csr & US_CSR_RXRDY) { + /* Read communication data byte between phone and SIM */ + uint8_t byte = sniff_usart.base->US_RHR; + /* Store sniffed data into buffer (also clear interrupt */ + rbuf_write(&sniff_buffer, byte); + } +} + +/*------------------------------------------------------------------------------ + * Global functions + *------------------------------------------------------------------------------*/ + +void Sniffer_usart1_irq(void) +{ + if (ID_USART1==sniff_usart.id) { + Sniffer_usart_irq(); + } +} + +void Sniffer_usart0_irq(void) +{ + if (ID_USART0==sniff_usart.id) { + Sniffer_usart_irq(); + } +} + /*----------------------------------------------------------------------------- * Initialization routine *-----------------------------------------------------------------------------*/ @@ -128,8 +177,10 @@ USART_SetReceiverEnabled(sniff_usart.base, 1); /* Enable interrupt to indicate when data has been received */ USART_EnableIt(sniff_usart.base, US_IER_RXRDY); - /* Enable interrupt requests for the USART peripheral (warning: use IRQ corresponding to USART) */ - NVIC_EnableIRQ(USART0_IRQn); + /* Enable interrupt requests for the USART peripheral */ + NVIC_EnableIRQ(IRQ_USART_SIM); + + /* TODO configure RST pin ISR */ } /* main (idle/busy) loop of this USB configuration */ -- To view, visit https://gerrit.osmocom.org/9849 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I6b5dfd6d573ac122a60585a24c8a620642805ad5 Gerrit-Change-Number: 9849 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 13:03:02 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 13:03:02 +0000 Subject: Change in simtrace2[master]: SIMtrace: only enable main sniffing mode on SIMtrace board In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9850 ) Change subject: SIMtrace: only enable main sniffing mode on SIMtrace board ...................................................................... SIMtrace: only enable main sniffing mode on SIMtrace board Change-Id: Iff6ebb1d98aa0c31f6d78508afde8f1b05f0f85b --- M firmware/libboard/simtrace/include/board.h 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libboard/simtrace/include/board.h b/firmware/libboard/simtrace/include/board.h index 8e832dd..691dbc3 100644 --- a/firmware/libboard/simtrace/include/board.h +++ b/firmware/libboard/simtrace/include/board.h @@ -111,8 +111,8 @@ /* SIMtrace board supports sniffer mode */ #define HAVE_SNIFFER /* SIMtrace board supports CCID mode */ -#define HAVE_CCID +//#define HAVE_CCID /* SIMtrace board supports card emulation mode */ -#define HAVE_CARDEM +//#define HAVE_CARDEM /* SIMtrace board supports man-in-the-middle mode */ //#define HAVE_MITM -- To view, visit https://gerrit.osmocom.org/9850 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iff6ebb1d98aa0c31f6d78508afde8f1b05f0f85b Gerrit-Change-Number: 9850 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 13:03:02 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 13:03:02 +0000 Subject: Change in simtrace2[master]: SIMtrace: fix default SIM_RST pin state to allow phone controlled reset In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9851 ) Change subject: SIMtrace: fix default SIM_RST pin state to allow phone controlled reset ...................................................................... SIMtrace: fix default SIM_RST pin state to allow phone controlled reset Change-Id: I1942ec6bd499cb2e14f6d7699a2b2d9b4197e654 --- M firmware/libboard/simtrace/include/board.h 1 file changed, 3 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libboard/simtrace/include/board.h b/firmware/libboard/simtrace/include/board.h index 691dbc3..c5f4dc4 100644 --- a/firmware/libboard/simtrace/include/board.h +++ b/firmware/libboard/simtrace/include/board.h @@ -66,8 +66,10 @@ #define PIN_IO_SW_SNIFF {PIO_PA19, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT} /* Connect all lines (VPP, CLK, RST, and I/O) between card and phone */ #define PINS_BUS_SNIFF PIN_SC_SW_SNIFF, PIN_IO_SW_SNIFF +/* Card RST reset signal input (use as input since the phone will drive it) */ +#define PIN_SIM_RST_SNIFF {PIO_PA7, PIOA, ID_PIOA, PIO_INPUT, PIO_DEFAULT} /* Pins used to sniff phone-card communication */ -#define PINS_SIM_SNIFF PIN_SIM_IO, PIN_SIM_CLK, PIN_SIM_RST +#define PINS_SIM_SNIFF PIN_SIM_IO, PIN_SIM_CLK, PIN_SIM_RST_SNIFF /* Disable power converter 4.5-6V to 3.3V (active high) */ #define PIN_SIM_PWEN_SNIFF {SIM_PWEN, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT} /* Enable power switch to forward VCC_PHONE to VCC_SIM (active high) */ -- To view, visit https://gerrit.osmocom.org/9851 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I1942ec6bd499cb2e14f6d7699a2b2d9b4197e654 Gerrit-Change-Number: 9851 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 13:03:03 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 13:03:03 +0000 Subject: Change in simtrace2[master]: SIMtrace: enable interrupt on edge dection for SIM_RST pin to reset t... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9852 ) Change subject: SIMtrace: enable interrupt on edge dection for SIM_RST pin to reset the sniffer ISO state ...................................................................... SIMtrace: enable interrupt on edge dection for SIM_RST pin to reset the sniffer ISO state Change-Id: I92ff29abd6a8690dd033d8cf13ad0d1ff9740fe5 --- M firmware/libboard/simtrace/include/board.h 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libboard/simtrace/include/board.h b/firmware/libboard/simtrace/include/board.h index c5f4dc4..891ab33 100644 --- a/firmware/libboard/simtrace/include/board.h +++ b/firmware/libboard/simtrace/include/board.h @@ -67,7 +67,7 @@ /* Connect all lines (VPP, CLK, RST, and I/O) between card and phone */ #define PINS_BUS_SNIFF PIN_SC_SW_SNIFF, PIN_IO_SW_SNIFF /* Card RST reset signal input (use as input since the phone will drive it) */ -#define PIN_SIM_RST_SNIFF {PIO_PA7, PIOA, ID_PIOA, PIO_INPUT, PIO_DEFAULT} +#define PIN_SIM_RST_SNIFF {PIO_PA7, PIOA, ID_PIOA, PIO_INPUT, PIO_DEGLITCH | PIO_IT_EDGE} /* Pins used to sniff phone-card communication */ #define PINS_SIM_SNIFF PIN_SIM_IO, PIN_SIM_CLK, PIN_SIM_RST_SNIFF /* Disable power converter 4.5-6V to 3.3V (active high) */ -- To view, visit https://gerrit.osmocom.org/9852 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I92ff29abd6a8690dd033d8cf13ad0d1ff9740fe5 Gerrit-Change-Number: 9852 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 13:22:09 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 13:22:09 +0000 Subject: Change in simtrace2[master]: sniffer USB: implement USB communication and send parsed messages In-Reply-To: References: Message-ID: K?vin Redon has posted comments on this change. ( https://gerrit.osmocom.org/9873 ) Change subject: sniffer USB: implement USB communication and send parsed messages ...................................................................... Patch Set 6: (1 comment) https://gerrit.osmocom.org/#/c/9873/5/firmware/libcommon/source/sniffer.c File firmware/libcommon/source/sniffer.c: https://gerrit.osmocom.org/#/c/9873/5/firmware/libcommon/source/sniffer.c at 275 PS5, Line 275: TRACE_ERROR("ATR buffer overflow\n\r"); > this might be something worth counting and/or reporting to the host? Keep in mind, the normal user [?] this is merely a security check to prevent out of bound read later on. the parse ATR code should already have prevented this case. but the bigger question is how much of the communication parsing check do we want to send to the user (e.g. invalid class, ...) -- To view, visit https://gerrit.osmocom.org/9873 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ice7817480705f2124b08c1ff9a8826558b6d8b2b Gerrit-Change-Number: 9873 Gerrit-PatchSet: 6 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon Gerrit-Comment-Date: Wed, 04 Jul 2018 13:22:09 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 13:22:21 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 13:22:21 +0000 Subject: Change in simtrace2[master]: sniffer USB: implement USB communication and send parsed messages In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9873 to look at the new patch set (#7). Change subject: sniffer USB: implement USB communication and send parsed messages ...................................................................... sniffer USB: implement USB communication and send parsed messages Change-Id: Ice7817480705f2124b08c1ff9a8826558b6d8b2b --- M firmware/libcommon/source/sniffer.c 1 file changed, 223 insertions(+), 62 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/73/9873/7 -- To view, visit https://gerrit.osmocom.org/9873 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ice7817480705f2124b08c1ff9a8826558b6d8b2b Gerrit-Change-Number: 9873 Gerrit-PatchSet: 7 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 13:22:21 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 13:22:21 +0000 Subject: Change in simtrace2[master]: sniffing: move conversion convertion and flag processing from ISR to ... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9878 to look at the new patch set (#9). Change subject: sniffing: move conversion convertion and flag processing from ISR to main loop to keep ISR fast and focus on data capture ...................................................................... sniffing: move conversion convertion and flag processing from ISR to main loop to keep ISR fast and focus on data capture Change-Id: Ieefa8a5f81dbcc12c1ad3059660dbffa0c1a4961 --- M firmware/libcommon/source/sniffer.c M host/simtrace2-sniff.c 2 files changed, 88 insertions(+), 64 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/78/9878/9 -- To view, visit https://gerrit.osmocom.org/9878 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ieefa8a5f81dbcc12c1ad3059660dbffa0c1a4961 Gerrit-Change-Number: 9878 Gerrit-PatchSet: 9 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 13:22:21 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 13:22:21 +0000 Subject: Change in simtrace2[master]: sniffer: also send incomplete (e.g. timeout) data (PPS/ATR/TPDU) In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9879 to look at the new patch set (#10). Change subject: sniffer: also send incomplete (e.g. timeout) data (PPS/ATR/TPDU) ...................................................................... sniffer: also send incomplete (e.g. timeout) data (PPS/ATR/TPDU) Change-Id: Ib070aca181042b477f1ffec48d63dc56c1e4609a --- M firmware/libcommon/source/sniffer.c 1 file changed, 41 insertions(+), 26 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/79/9879/10 -- To view, visit https://gerrit.osmocom.org/9879 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib070aca181042b477f1ffec48d63dc56c1e4609a Gerrit-Change-Number: 9879 Gerrit-PatchSet: 10 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 13:22:21 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 13:22:21 +0000 Subject: Change in simtrace2[master]: sniffer: add waiting time WT update In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9882 to look at the new patch set (#10). Change subject: sniffer: add waiting time WT update ...................................................................... sniffer: add waiting time WT update the waiting time (WT) is used to detect timeouts (e.g. for unresponsive card or just to signal an error/NAK). it is essential to detect to timeout to end current data transfer (e.g. change state). by default (after a reset) to timeout is 9600 ETU, but this can change at two places: - after the ATR using the value of TC2 (if present) - after a PPS (only F is used, and not D) because the timeout value can be larger than the 16-bit of the USART TO register, an external variable needs to be used for the count down. Change-Id: I9735660ffce161cec8d4e63fa60a66fc8ef57525 --- M firmware/libcommon/source/sniffer.c 1 file changed, 66 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/82/9882/10 -- To view, visit https://gerrit.osmocom.org/9882 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9735660ffce161cec8d4e63fa60a66fc8ef57525 Gerrit-Change-Number: 9882 Gerrit-PatchSet: 10 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 13:45:22 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 13:45:22 +0000 Subject: Change in simtrace2[master]: ISO7816: change update_fidi to use provided USART In-Reply-To: References: Message-ID: K?vin Redon has posted comments on this change. ( https://gerrit.osmocom.org/9853 ) Change subject: ISO7816: change update_fidi to use provided USART ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/9853/1/firmware/libcommon/source/simtrace_iso7816.c File firmware/libcommon/source/simtrace_iso7816.c: https://gerrit.osmocom.org/#/c/9853/1/firmware/libcommon/source/simtrace_iso7816.c at 138 PS1, Line 138: TRACE_INFO("updated USART Fi(%u)/Di(%u) ratio(%d): %u\n\r", fi, di, ratio, usart->US_FIDI); > it would make sense to print the UASRT number as otherwise you don't know if a given TRACE/log messa [?] fixed in newer patchset -- To view, visit https://gerrit.osmocom.org/9853 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I716f4bc3a22800cbce402b146f14ef8b2aab2a98 Gerrit-Change-Number: 9853 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon Gerrit-Comment-Date: Wed, 04 Jul 2018 13:45:22 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 13:46:15 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 13:46:15 +0000 Subject: Change in simtrace2[master]: sniffer: use ISR to store sniffed data in buffer, add ATR and PPS par... In-Reply-To: References: Message-ID: K?vin Redon has posted comments on this change. ( https://gerrit.osmocom.org/9855 ) Change subject: sniffer: use ISR to store sniffed data in buffer, add ATR and PPS parsing, and PPS related FiDi update ...................................................................... Patch Set 5: indentation is fixed. I will take care of all the cosmetics in a later commit -- To view, visit https://gerrit.osmocom.org/9855 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4b38ce1d80e370fda6aa181e959ba3f1286bb922 Gerrit-Change-Number: 9855 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon Gerrit-Comment-Date: Wed, 04 Jul 2018 13:46:15 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 13:52:01 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 13:52:01 +0000 Subject: Change in simtrace2[master]: DFU: switch green LED on to indicate DFU mode, and red LED to indicat... In-Reply-To: References: Message-ID: K?vin Redon has posted comments on this change. ( https://gerrit.osmocom.org/9862 ) Change subject: DFU: switch green LED on to indicate DFU mode, and red LED to indicate flashing activity ...................................................................... Patch Set 4: > Please note not all boards have a green+red led. In qmod, we have > one led per slot (two per SAM3) and they all have the same color I am aware that the qmod has two red LEDs. the schematic still names them LED_R[ED] and LED_G[REEN], and they use the same pins as SIMtrace. As such it does not break compatibility. We just have to keep this in mind when writing manuals. -- To view, visit https://gerrit.osmocom.org/9862 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8e34fd869ed94ad122d6a17f5a432f5a09b820bb Gerrit-Change-Number: 9862 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon Gerrit-CC: Harald Welte Gerrit-Comment-Date: Wed, 04 Jul 2018 13:52:01 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 14:03:30 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 14:03:30 +0000 Subject: Change in simtrace2[master]: update_fidi: remove debug output since this function is called in tim... In-Reply-To: References: Message-ID: K?vin Redon has posted comments on this change. ( https://gerrit.osmocom.org/9863 ) Change subject: update_fidi: remove debug output since this function is called in time critical ISR ...................................................................... Patch Set 4: > is this really needed? particularly now that the console is going > through the ringbuffer and is not busy-waiting? Can we print the > message at a later point after we left IRQ context? the message is printed in sniffer.c just before using update_fidi (at the end of the PPS procedure). I still would avoid any printf since it is still used in an ISR (only after a SIM RST though). I don't mind leaving the messages, but then the reset handling should be placed outside the ISR (which is fine with me, since resets are quit long usually). as you prefer -- To view, visit https://gerrit.osmocom.org/9863 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I08f407d407a18dae3f360ddc64769ddfaeb5b559 Gerrit-Change-Number: 9863 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon Gerrit-CC: Harald Welte Gerrit-Comment-Date: Wed, 04 Jul 2018 14:03:30 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 14:33:08 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 14:33:08 +0000 Subject: Change in simtrace2[master]: LED: add short LED pulse blinking pattern In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9864 to look at the new patch set (#5). Change subject: LED: add short LED pulse blinking pattern ...................................................................... LED: add short LED pulse blinking pattern Change-Id: I0fdc2f902a3b92da6aa9b9c8500abae8a2f79447 --- M firmware/libboard/common/include/led.h M firmware/libboard/common/source/led.c 2 files changed, 17 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/64/9864/5 -- To view, visit https://gerrit.osmocom.org/9864 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0fdc2f902a3b92da6aa9b9c8500abae8a2f79447 Gerrit-Change-Number: 9864 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 14:34:00 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 14:34:00 +0000 Subject: Change in simtrace2[master]: LED: add short LED pulse blinking pattern In-Reply-To: References: Message-ID: K?vin Redon has posted comments on this change. ( https://gerrit.osmocom.org/9864 ) Change subject: LED: add short LED pulse blinking pattern ...................................................................... Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/9864/3/firmware/libboard/common/source/led.c File firmware/libboard/common/source/led.c: https://gerrit.osmocom.org/#/c/9864/3/firmware/libboard/common/source/led.c at 20 PS3, Line 20: else > this appears to change the on/off logic for the LEDs. [?] you are right, I will make a separate commit -- To view, visit https://gerrit.osmocom.org/9864 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0fdc2f902a3b92da6aa9b9c8500abae8a2f79447 Gerrit-Change-Number: 9864 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon Gerrit-Comment-Date: Wed, 04 Jul 2018 14:34:00 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 14:37:56 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 14:37:56 +0000 Subject: Change in simtrace2[master]: fix LED switching on/off Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9887 Change subject: fix LED switching on/off ...................................................................... fix LED switching on/off In the SIMtrace and QMOD schematics the LEDs are connected to +3.3V. Thus to switch the LED on we need to set the pin low. Change-Id: Id8cc27e6f0b6556ba5e7ea4d254dd0fe59042a0c --- M firmware/libboard/common/source/led.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/87/9887/1 diff --git a/firmware/libboard/common/source/led.c b/firmware/libboard/common/source/led.c index 540f031..00082e2 100644 --- a/firmware/libboard/common/source/led.c +++ b/firmware/libboard/common/source/led.c @@ -16,9 +16,9 @@ ASSERT(led < PIO_LISTSIZE(pinsLeds)); if (on) - PIO_Set(&pinsLeds[led]); - else PIO_Clear(&pinsLeds[led]); + else + PIO_Set(&pinsLeds[led]); } /* LED blinking code */ -- To view, visit https://gerrit.osmocom.org/9887 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id8cc27e6f0b6556ba5e7ea4d254dd0fe59042a0c Gerrit-Change-Number: 9887 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 14:51:41 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 14:51:41 +0000 Subject: Change in simtrace2[master]: host USB: add host application to receive and display USB sniffing me... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9874 to look at the new patch set (#11). Change subject: host USB: add host application to receive and display USB sniffing messages sent by firmware ...................................................................... host USB: add host application to receive and display USB sniffing messages sent by firmware Change-Id: Idefbf21e0bbd2a1e3647fe9aebaf88d1b62dae2d --- M host/Makefile A host/simtrace2-sniff.c 2 files changed, 538 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/74/9874/11 -- To view, visit https://gerrit.osmocom.org/9874 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Idefbf21e0bbd2a1e3647fe9aebaf88d1b62dae2d Gerrit-Change-Number: 9874 Gerrit-PatchSet: 11 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 14:52:58 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 14:52:58 +0000 Subject: Change in simtrace2[master]: host USB: add host application to receive and display USB sniffing me... In-Reply-To: References: Message-ID: K?vin Redon has posted comments on this change. ( https://gerrit.osmocom.org/9874 ) Change subject: host USB: add host application to receive and display USB sniffing messages sent by firmware ...................................................................... Patch Set 7: (1 comment) https://gerrit.osmocom.org/#/c/9874/7/host/simtrace2-sniff.c File host/simtrace2-sniff.c: https://gerrit.osmocom.org/#/c/9874/7/host/simtrace2-sniff.c at 3 PS7, Line 3: * it under the terms of the GNU General Public License version 2 > GPLv2 or later (to be compatible with GPLv3/AGPLv3/... [?] fixed. I will also have a separate commit to set the copyrights on all files (gplv2+, if not atmel) -- To view, visit https://gerrit.osmocom.org/9874 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Idefbf21e0bbd2a1e3647fe9aebaf88d1b62dae2d Gerrit-Change-Number: 9874 Gerrit-PatchSet: 7 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon Gerrit-Comment-Date: Wed, 04 Jul 2018 14:52:58 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:02:02 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 15:02:02 +0000 Subject: Change in simtrace2[master]: sniffer: use ISR to store sniffed data in buffer, add ATR and PPS par... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9855 ) Change subject: sniffer: use ISR to store sniffed data in buffer, add ATR and PPS parsing, and PPS related FiDi update ...................................................................... Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9855 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4b38ce1d80e370fda6aa181e959ba3f1286bb922 Gerrit-Change-Number: 9855 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon Gerrit-Comment-Date: Wed, 04 Jul 2018 15:02:02 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:02:37 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 15:02:37 +0000 Subject: Change in simtrace2[master]: ISO7816: change update_fidi to use provided USART In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9853 ) Change subject: ISO7816: change update_fidi to use provided USART ...................................................................... Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9853 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I716f4bc3a22800cbce402b146f14ef8b2aab2a98 Gerrit-Change-Number: 9853 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon Gerrit-Comment-Date: Wed, 04 Jul 2018 15:02:37 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:02:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 15:02:48 +0000 Subject: Change in simtrace2[master]: DFU: switch green LED on to indicate DFU mode, and red LED to indicat... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9862 ) Change subject: DFU: switch green LED on to indicate DFU mode, and red LED to indicate flashing activity ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9862 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8e34fd869ed94ad122d6a17f5a432f5a09b820bb Gerrit-Change-Number: 9862 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon Gerrit-Comment-Date: Wed, 04 Jul 2018 15:02:48 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:03:19 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 15:03:19 +0000 Subject: Change in simtrace2[master]: update_fidi: remove debug output since this function is called in tim... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9863 ) Change subject: update_fidi: remove debug output since this function is called in time critical ISR ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9863 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I08f407d407a18dae3f360ddc64769ddfaeb5b559 Gerrit-Change-Number: 9863 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon Gerrit-Comment-Date: Wed, 04 Jul 2018 15:03:19 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:03:26 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 15:03:26 +0000 Subject: Change in simtrace2[master]: ISO7816: change update_fidi to use provided USART In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9853 ) Change subject: ISO7816: change update_fidi to use provided USART ...................................................................... ISO7816: change update_fidi to use provided USART Also disables write protection for USART register if required Change-Id: I716f4bc3a22800cbce402b146f14ef8b2aab2a98 --- M firmware/libcommon/include/simtrace.h M firmware/libcommon/source/simtrace_iso7816.c 2 files changed, 23 insertions(+), 12 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/firmware/libcommon/include/simtrace.h b/firmware/libcommon/include/simtrace.h index 278d5d2..cbf1948 100644 --- a/firmware/libcommon/include/simtrace.h +++ b/firmware/libcommon/include/simtrace.h @@ -77,7 +77,11 @@ extern const USBConfigurationDescriptor *configurationDescriptorsArr[]; -void update_fidi(uint8_t fidi); +/*! Update USART baud rate to Fi/Di ratio + * @param[io] usart USART peripheral base address + * @param[in] fidi FiDi value as provided in TA interface byte + */ +void update_fidi(Usart_info *usart, uint8_t fidi); void ISR_PhoneRST( const Pin *pPin); diff --git a/firmware/libcommon/source/simtrace_iso7816.c b/firmware/libcommon/source/simtrace_iso7816.c index 81ae980..17f38a8 100644 --- a/firmware/libcommon/source/simtrace_iso7816.c +++ b/firmware/libcommon/source/simtrace_iso7816.c @@ -116,20 +116,27 @@ } /* FIDI update functions */ -void update_fidi(uint8_t fidi) +void update_fidi(Usart_info *usart, uint8_t fidi) { - int rc; + if (NULL==usart) { + return; + } uint8_t fi = fidi >> 4; uint8_t di = fidi & 0xf; + int ratio = compute_fidi_ratio(fi, di); - rc = compute_fidi_ratio(fi, di); - if (rc > 0 && rc < 0x400) { - TRACE_INFO("computed Fi(%u) Di(%u) ratio: %d", fi, di, rc); - /* make sure UART uses new F/D ratio */ - USART_PHONE->US_CR |= US_CR_RXDIS | US_CR_RSTRX; - USART_PHONE->US_FIDI = rc & 0x3ff; - USART_PHONE->US_CR |= US_CR_RXEN | US_CR_STTTO; - } else - TRACE_INFO("computed FiDi ratio %d unsupported", rc); + if (ratio > 0 && ratio < 0x8000) { + /* make sure USART uses new F/D ratio */ + usart->base->US_CR |= US_CR_RXDIS | US_CR_RSTRX; + /* disable write protection */ + if (usart->base->US_WPMR) { + usart->base->US_WPMR = US_WPMR_WPKEY(0x555341); + } + usart->base->US_FIDI = (ratio & 0x7ff); + usart->base->US_CR |= US_CR_RXEN | US_CR_STTTO; + TRACE_INFO("updated USART(%u) Fi(%u)/Di(%u) ratio(%d): %u\n\r", usart->id, fi, di, ratio, usart->base->US_FIDI); + } else { + TRACE_WARNING("computed Fi/Di ratio %d unsupported\n\r", ratio); + } } -- To view, visit https://gerrit.osmocom.org/9853 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I716f4bc3a22800cbce402b146f14ef8b2aab2a98 Gerrit-Change-Number: 9853 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:03:26 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 15:03:26 +0000 Subject: Change in simtrace2[master]: trace: increase watchdog for 500 to 2000 ms to provide more time hand... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9854 ) Change subject: trace: increase watchdog for 500 to 2000 ms to provide more time handling buffered data ...................................................................... trace: increase watchdog for 500 to 2000 ms to provide more time handling buffered data Change-Id: Iacd85525f05e692b44183bd4c4585b9e70865cfe --- M firmware/apps/trace/main.c 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/apps/trace/main.c b/firmware/apps/trace/main.c index e7ce7b7..8c89907 100644 --- a/firmware/apps/trace/main.c +++ b/firmware/apps/trace/main.c @@ -22,7 +22,7 @@ void (*exit) (void); /* main loop content for given configuration */ void (*run) (void); - /* Interrupt handler for USART1 */ + /* Interrupt handler for USART0 */ void (*usart0_irq) (void); /* Interrupt handler for USART1 */ void (*usart1_irq) (void); @@ -127,9 +127,9 @@ led_init(); led_blink(LED_RED, BLINK_3O_5F); - /* Enable watchdog for 500ms, with no window */ + /* Enable watchdog for 2000 ms, with no window */ WDT_Enable(WDT, WDT_MR_WDRSTEN | WDT_MR_WDDBGHLT | WDT_MR_WDIDLEHLT | - (WDT_GetPeriod(500) << 16) | WDT_GetPeriod(500)); + (WDT_GetPeriod(2000) << 16) | WDT_GetPeriod(2000)); PIO_InitializeInterrupts(0); -- To view, visit https://gerrit.osmocom.org/9854 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iacd85525f05e692b44183bd4c4585b9e70865cfe Gerrit-Change-Number: 9854 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:03:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 15:03:27 +0000 Subject: Change in simtrace2[master]: sniffer: use ISR to store sniffed data in buffer, add ATR and PPS par... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9855 ) Change subject: sniffer: use ISR to store sniffed data in buffer, add ATR and PPS parsing, and PPS related FiDi update ...................................................................... sniffer: use ISR to store sniffed data in buffer, add ATR and PPS parsing, and PPS related FiDi update Change-Id: I4b38ce1d80e370fda6aa181e959ba3f1286bb922 --- M firmware/libcommon/source/sniffer.c 1 file changed, 362 insertions(+), 18 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 987e3e5..66aceab 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -17,8 +17,10 @@ * along with this program. If not, see . * */ -/* This code implement the Sniffer mode to sniff the communication between a SIM card and a phone. +/* This code implement the Sniffer mode to sniff the communication between a SIM card (or any ISO 7816 smart card) and a phone (or any ISO 7816 card reader). * For historical reasons (i.e. SIMtrace hardware) the USART peripheral connected to the SIM card is used. + * TODO handle RST, PTS, and send data over USB + * TODO put common ISO7816-3 code is separate library (and combine clean with iso7816_4) */ #include "board.h" #include "simtrace.h" @@ -30,19 +32,22 @@ *------------------------------------------------------------------------------*/ #include +#include "utils.h" +#include "iso7816_fidi.h" /*------------------------------------------------------------------------------ * Internal definitions *------------------------------------------------------------------------------*/ -/** Maximum ucSize in bytes of the smartcard answer to a command.*/ -#define MAX_ANSWER_SIZE 10 - -/*! Maximum Answer-To-Reset (ATR) size in bytes ucSize in bytes +/*! Maximum Answer-To-Reset (ATR) size in bytes * @note defined in ISO/IEC 7816-3:2006(E) section 8.2.1 as 32, on top the initial character TS of section 8.1 * @remark technical there is no size limitation since Yi present in T0,TDi will indicate if more interface bytes are present, including TDi+i */ #define MAX_ATR_SIZE 33 +/*! Maximum Protocol and Parameters Selection (PPS) size in bytes + * @note defined in ISO/IEC 7816-3:2006(E) section 9.2 + */ +#define MAX_PPS_SIZE 6 /*! ISO 7816-3 states relevant to the sniff mode */ enum iso7816_3_sniff_state { @@ -51,7 +56,9 @@ ISO7816_S_IN_ATR, /*!< while we are receiving the ATR */ ISO7816_S_WAIT_APDU, /*!< waiting for start of new APDU */ ISO7816_S_IN_APDU, /*!< inside a single APDU */ - ISO7816_S_IN_PTS, /*!< while we are inside the PTS / PSS */ + ISO7816_S_IN_PPS_REQ, /*!< while we are inside the PPS request */ + ISO7816_S_WAIT_PPS_RSP, /*!< waiting for start of the PPS response */ + ISO7816_S_IN_PPS_RSP, /*!< while we are inside the PPS request */ }; /*! Answer-To-Reset (ATR) sub-states of ISO7816_S_IN_ATR @@ -66,7 +73,18 @@ ATR_S_WAIT_TD, /*!< fourth sub-group interface byte */ ATR_S_WAIT_HIST, /*!< historical byte */ ATR_S_WAIT_TCK, /*!< check byte */ - ATR_S_DONE, /*!< to indicated all ATR bytes have been received */ +}; + +/*! Protocol and Parameters Selection (PPS) sub-states of ISO7816_S_IN_PTS_REQ/ISO7816_S_IN_PTS_RSP + * @note defined in ISO/IEC 7816-3:2006(E) section 9 + */ +enum pps_sniff_state { + PPS_S_WAIT_PPSS, /*!< initial byte */ + PPS_S_WAIT_PPS0, /*!< format byte */ + PPS_S_WAIT_PPS1, /*!< first parameter byte */ + PPS_S_WAIT_PPS2, /*!< second parameter byte */ + PPS_S_WAIT_PPS3, /*!< third parameter byte */ + PPS_S_WAIT_PCK, /*!< check byte */ }; /*------------------------------------------------------------------------------ @@ -77,36 +95,327 @@ * to support a second sniffer interface the code should be restructured to use handles. */ /* Pin configurations */ -/* Pin configuration to sniff communication (using USART connection card) */ +/*! Pin configuration to sniff communication (using USART connection card) */ static const Pin pins_sniff[] = { PINS_SIM_SNIFF }; +/*! Pin configuration to interconnect phone and card using the bus switch */ static const Pin pins_bus[] = { PINS_BUS_SNIFF }; +/*! Pin configuration to power the card by the phone */ static const Pin pins_power[] = { PINS_PWR_SNIFF }; +/*! Pin configuration for timer counter to measure ETU timing */ static const Pin pins_tc[] = { PINS_TC }; +/*! Pin configuration for card reset line */ +static const Pin pin_rst = PIN_SIM_RST_SNIFF; + /* USART related variables */ -/* USART peripheral used to sniff communication */ +/*! USART peripheral used to sniff communication */ static struct Usart_info sniff_usart = { .base = USART_SIM, .id = ID_USART_SIM, .state = USART_RCV, }; -/* Ring buffer to store sniffer communication data */ +/*! Ring buffer to store sniffer communication data */ static struct ringbuf sniff_buffer; +/* ISO 7816 variables */ +/*! ISO 7816-3 state */ +enum iso7816_3_sniff_state iso_state = ISO7816_S_RESET; +/*! ATR state */ +enum atr_sniff_state atr_state; +/*! ATR data + * @remark can be used to check later protocol changes + */ +uint8_t atr[MAX_ATR_SIZE]; +/*! Current index in the ATR data */ +uint8_t atr_i = 0; +/*! If convention conversion is needed */ +bool convention_convert = false; +/*! The supported T protocols */ +uint16_t t_protocol_support = 0; +/*! PPS state + * @remark it is shared between request and response since they aren't simultaneous but follow the same procedure + */ +enum pps_sniff_state pps_state; +/*! PPS request data + * @remark can be used to check PPS response + */ +uint8_t pps_req[MAX_PPS_SIZE]; +/*! PPS response data */ +uint8_t pps_rsp[MAX_PPS_SIZE]; + /*------------------------------------------------------------------------------ * Internal functions *------------------------------------------------------------------------------*/ +/*! Convert data between direct and inverse convention + * @note direct convention is LSb first and HIGH=1; inverse conversion in MSb first and LOW=1 + * @remark use a look up table to speed up conversion + */ +static const uint8_t convention_convert_lut[256] = { 0xff, 0x7f, 0xbf, 0x3f, 0xdf, 0x5f, 0x9f, 0x1f, 0xef, 0x6f, 0xaf, 0x2f, 0xcf, 0x4f, 0x8f, 0x0f, 0xf7, 0x77, 0xb7, 0x37, 0xd7, 0x57, 0x97, 0x17, 0xe7, 0x67, 0xa7, 0x27, 0xc7, 0x47, 0x87, 0x07, 0xfb, 0x7b, 0xbb, 0x3b, 0xdb, 0x5b, 0x9b, 0x1b, 0xeb, 0x6b, 0xab, 0x2b, 0xcb, 0x4b, 0x8b, 0x0b, 0xf3, 0x73, 0xb3, 0x33, 0xd3, 0x53, 0x93, 0x13, 0xe3, 0x63, 0xa3, 0x23, 0xc3, 0x43, 0x83, 0x03, 0xfd, 0x7d, 0xbd, 0x3d, 0xdd, 0x5d, 0x9d, 0x1d, 0xed, 0x6d, 0xad, 0x2d, 0xcd, 0x4d, 0x8d, 0x0d, 0xf5, 0x75, 0xb5, 0x35, 0xd5, 0x55, 0x95, 0x15, 0xe5, 0x65, 0xa5, 0x25, 0xc5, 0x45, 0x85, 0x05, 0xf9, 0x79, 0xb9, 0x39, 0xd9, 0x59, 0x99, 0x19, 0xe9, 0x69, 0xa9, 0x29, 0xc9, 0x49, 0x89, 0x09, 0xf1, 0x71, 0xb1, 0x31, 0xd1, 0x51, 0x91, 0x11, 0xe1, 0x61, 0xa1, 0x21, 0xc1, 0x41, 0x81, 0x01, 0xfe, 0x7e, 0xbe, 0x3e, 0xde, 0x5e, 0x9e, 0x1e, 0xee, 0x6e, 0xae, 0x2e, 0xce, 0x4e, 0x8e, 0x0e, 0xf6, 0x76, 0xb6, 0x36, 0xd6, 0x56, 0x96, 0x16, 0xe6, 0x66, 0xa6, 0x26, 0xc6, 0x46, 0x86, 0x06, 0xfa, 0x7a, 0xba, 0x3a, 0xda, 0x5a, 0x9a, 0x1a, 0xea, 0x6a, 0xaa, 0x2a, 0xca, 0x4a, 0x8a, 0x0a, 0xf2, 0x72, 0xb2, 0x32, 0xd2, 0x52, 0x92, 0x12, 0xe2, 0x62, 0xa2, 0x22, 0xc2, 0x42, 0x82, 0x02, 0xfc, 0x7c, 0xbc, 0x3c, 0xdc, 0x5c, 0x9c, 0x1c, 0xec, 0x6c, 0xac, 0x2c, 0xcc, 0x4c, 0x8c, 0x0c, 0xf4, 0x74, 0xb4, 0x34, 0xd4, 0x54, 0x94, 0x14, 0xe4, 0x64, 0xa4, 0x24, 0xc4, 0x44, 0x84, 0x04, 0xf8, 0x78, 0xb8, 0x38, 0xd8, 0x58, 0x98, 0x18, 0xe8, 0x68, 0xa8, 0x28, 0xc8, 0x48, 0x88, 0x08, 0xf0, 0x70, 0xb0, 0x30, 0xd0, 0x50, 0x90, 0x10, 0xe0, 0x60, 0xa0, 0x20, 0xc0, 0x40, 0x80, 0x00, }; + +/*! Update the ISO 7816-3 state + * @param[in] iso_state_new new ISO 7816-3 state to update to + */ +static void change_state(enum iso7816_3_sniff_state iso_state_new) +{ + /* sanity check */ + if (iso_state_new==iso_state) { + TRACE_WARNING("Already in ISO 7816 state %u\n\r", iso_state); + return; + } + + /* handle actions to perform when switching state */ + switch (iso_state_new) { + case ISO7816_S_RESET: + update_fidi(&sniff_usart, 0x11); /* reset baud rate to default Di/Fi values */ + // TODO disable USART and TC + break; + case ISO7816_S_WAIT_ATR: + rbuf_reset(&sniff_buffer); /* reset buffer for new communication */ + // TODO enable USART and TC + break; + case ISO7816_S_IN_ATR: + atr_i = 0; + convention_convert = false; + t_protocol_support = 0; + atr_state = ATR_S_WAIT_TS; + break; + case ISO7816_S_IN_PPS_REQ: + case ISO7816_S_IN_PPS_RSP: + pps_state = PPS_S_WAIT_PPSS; + break; + default: + break; + } + + /* save new state */ + iso_state = iso_state_new; + TRACE_INFO("Changed to ISO 7816-3 state %u\n\r", iso_state); +} + +/*! Process ATR byte + * @param[in] byte ATR byte to process + */ +static void process_byte_atr(uint8_t byte) +{ + static uint8_t atr_hist_len = 0; /* store the number of expected historical bytes */ + static uint8_t y = 0; /* last mask of the upcoming TA, TB, TC, TD interface bytes */ + + /* sanity check */ + if (ISO7816_S_IN_ATR!=iso_state) { + TRACE_ERROR("Processing ATR data in wrong ISO 7816-3 state %u\n\r", iso_state); + return; + } + if (atr_i>=ARRAY_SIZE(atr)) { + TRACE_WARNING("ATR data overflow\n\r"); + return; + } + + /* save data for use by other functions */ + atr[atr_i++] = byte; + + /* handle ATR byte depending on current state */ + switch (atr_state) { + case ATR_S_WAIT_TS: /* see ISO/IEC 7816-3:2006 section 8.1 */ + switch (byte) { + case 0x23: /* direct convention used, but decoded using inverse convention (a parity error should also have occurred) */ + case 0x30: /* inverse convention used, but decoded using direct convention (a parity error should also have occurred) */ + convention_convert = !convention_convert; + case 0x3b: /* direct convention used and correctly decoded */ + case 0x3f: /* inverse convention used and correctly decoded */ + atr_state = ATR_S_WAIT_T0; /* wait for format byte */ + break; + default: + atr_i--; /* revert last byte */ + TRACE_WARNING("Invalid TS received\n\r"); + } + break; + case ATR_S_WAIT_T0: /* see ISO/IEC 7816-3:2006 section 8.2.2 */ + case ATR_S_WAIT_TD: /* see ISO/IEC 7816-3:2006 section 8.2.3 */ + if (ATR_S_WAIT_T0==atr_state) { + atr_hist_len = (byte&0x0f); /* save the number of historical bytes */ + } else if (ATR_S_WAIT_TD==atr_state) { + t_protocol_support |= (1<<(byte&0x0f)); /* remember supported protocol to know if TCK will be present */ + } + y = (byte&0xf0); /* remember upcoming interface bytes */ + if (y&0x10) { + atr_state = ATR_S_WAIT_TA; /* wait for interface byte TA */ + break; + } + case ATR_S_WAIT_TA: /* see ISO/IEC 7816-3:2006 section 8.2.3 */ + if (y&0x20) { + atr_state = ATR_S_WAIT_TB; /* wait for interface byte TB */ + break; + } + case ATR_S_WAIT_TB: /* see ISO/IEC 7816-3:2006 section 8.2.3 */ + if (y&0x40) { + atr_state = ATR_S_WAIT_TC; /* wait for interface byte TC */ + break; + } + case ATR_S_WAIT_TC: /* see ISO/IEC 7816-3:2006 section 8.2.3 */ + if (y&0x80) { + atr_state = ATR_S_WAIT_TD; /* wait for interface byte TD */ + break; + } else if (atr_hist_len) { + atr_state = ATR_S_WAIT_HIST; /* wait for historical bytes */ + break; + } + case ATR_S_WAIT_HIST: /* see ISO/IEC 7816-3:2006 section 8.2.4 */ + if (atr_hist_len) { + atr_hist_len--; + } + if (0==atr_hist_len) { + if (t_protocol_support>1) { + atr_state = ATR_S_WAIT_TCK; /* wait for check bytes */ + break; + } + } else { + break; + } + case ATR_S_WAIT_TCK: /* see ISO/IEC 7816-3:2006 section 8.2.5 */ + /* we could verify the checksum, but we are just here to sniff */ + change_state(ISO7816_S_WAIT_APDU); /* go to next state */ + break; + default: + TRACE_INFO("Unknown ATR state %u\n\r", atr_state); + } +} + +static void process_byte_pps(uint8_t byte) +{ + uint8_t *pps_cur; /* current PPS (request or response) */ + + /* sanity check */ + if (ISO7816_S_IN_PPS_REQ==iso_state) { + pps_cur = pps_req; + } else if (ISO7816_S_IN_PPS_RSP==iso_state) { + pps_cur = pps_rsp; + } else { + TRACE_ERROR("Processing PPS data in wrong ISO 7816-3 state %u\n\r", iso_state); + return; + } + + /* handle PPS byte depending on current state */ + switch (pps_state) { /* see ISO/IEC 7816-3:2006 section 9.2 */ + case PPS_S_WAIT_PPSS: /*!< initial byte */ + if (0xff) { + pps_cur[0] = byte; + pps_state = PPS_S_WAIT_PPS0; /* go to next state */ + } else { + TRACE_INFO("Invalid PPSS received\n\r"); + change_state(ISO7816_S_WAIT_APDU); /* go back to APDU state */ + } + break; + case PPS_S_WAIT_PPS0: /*!< format byte */ + pps_cur[1] = byte; + if (pps_cur[1]&0x10) { + pps_state = PPS_S_WAIT_PPS1; /* go to next state */ + break; + } + case PPS_S_WAIT_PPS1: /*!< first parameter byte */ + pps_cur[2] = byte; /* not always right but doesn't affect the process */ + if (pps_cur[1]&0x20) { + pps_state = PPS_S_WAIT_PPS2; /* go to next state */ + break; + } + case PPS_S_WAIT_PPS2: /*!< second parameter byte */ + pps_cur[3] = byte; /* not always right but doesn't affect the process */ + if (pps_cur[1]&0x40) { + pps_state = PPS_S_WAIT_PPS3; /* go to next state */ + break; + } + case PPS_S_WAIT_PPS3: /*!< third parameter byte */ + pps_cur[4] = byte; /* not always right but doesn't affect the process */ + pps_state = PPS_S_WAIT_PCK; /* go to next state */ + break; + case PPS_S_WAIT_PCK: /*!< check byte */ + pps_cur[5] = byte; /* not always right but doesn't affect the process */ + /* verify the checksum */ + uint8_t check = 0; + check ^= pps_cur[0]; + check ^= pps_cur[1]; + if (pps_cur[1]&0x10) { + check ^= pps_cur[2]; + } + if (pps_cur[1]&0x20) { + check ^= pps_cur[3]; + } + if (pps_cur[1]&0x40) { + check ^= pps_cur[4]; + } + check ^= pps_cur[5]; + if (ISO7816_S_IN_PPS_REQ==iso_state) { + if (0==check) { /* checksum is valid */ + change_state(ISO7816_S_WAIT_PPS_RSP); /* go to next state */ + } else { /* checksum is invalid */ + change_state(ISO7816_S_WAIT_APDU); /* go to next state */ + } + } else if (ISO7816_S_IN_PPS_RSP==iso_state) { + if (0==check) { /* checksum is valid */ + uint8_t fn, dn; + if (pps_cur[1]&0x10) { + fn = (pps_cur[2]>>4); + dn = (pps_cur[2]&0x0f); + } else { + fn = 1; + dn = 1; + } + TRACE_INFO("PPS negotiation successful: Fn=%u Dn=%u\n\r", fn, dn); + update_fidi(&sniff_usart, pps_cur[2]); + } else { /* checksum is invalid */ + TRACE_INFO("PPS negotiation failed\n\r"); + } + change_state(ISO7816_S_WAIT_APDU); /* co to next state */ + } + break; + default: + TRACE_INFO("Unknown PPS state %u\n\r", pps_state); + } +} + +static void process_byte_apdu(uint8_t byte) +{ +} + static void check_sniffed_data(void) { - /* Display sniffed data */ + /* Handle sniffed data */ while (!rbuf_is_empty(&sniff_buffer)) { uint8_t byte = rbuf_read(&sniff_buffer); - TRACE_INFO_WP("0x%02x ", byte); + TRACE_WARNING_WP("< 0x%02x\n\r", byte); + switch (iso_state) { /* Handle byte depending on state */ + case ISO7816_S_RESET: /* During reset we shouldn't receive any data */ + break; + case ISO7816_S_WAIT_ATR: /* After a reset we expect the ATR */ + change_state(ISO7816_S_IN_ATR); /* go to next state */ + case ISO7816_S_IN_ATR: /* More ATR data incoming */ + process_byte_atr(byte); + break; + case ISO7816_S_WAIT_APDU: /* After the ATR we expect APDU or PPS data */ + case ISO7816_S_WAIT_PPS_RSP: + if (byte == 0xff) { + if (ISO7816_S_WAIT_PPS_RSP==iso_state) { + change_state(ISO7816_S_IN_PPS_RSP); /* Go to PPS state */ + } else { + change_state(ISO7816_S_IN_PPS_REQ); /* Go to PPS state */ + } + process_byte_pps(byte); + break; + } + case ISO7816_S_IN_APDU: /* More APDU data incoming */ + process_byte_apdu(byte); + break; + case ISO7816_S_IN_PPS_REQ: + case ISO7816_S_IN_PPS_RSP: + process_byte_pps(byte); + break; + default: + TRACE_ERROR("Data received in unknown state %u\n\r", iso_state); + } } } /*! Interrupt Service Routine called on USART activity */ -void Sniffer_usart_irq(void) +void Sniffer_usart_isr(void) { /* Read channel status register */ uint32_t csr = sniff_usart.base->US_CSR & sniff_usart.base->US_IMR; @@ -114,11 +423,36 @@ if (csr & US_CSR_RXRDY) { /* Read communication data byte between phone and SIM */ uint8_t byte = sniff_usart.base->US_RHR; + /* Convert convention if required */ + if (convention_convert) { + byte = convention_convert_lut[byte]; + } /* Store sniffed data into buffer (also clear interrupt */ rbuf_write(&sniff_buffer, byte); } } +/** PIO interrupt service routine to checks if the card reset line has changed + */ +static void Sniffer_reset_isr(const Pin* pPin) +{ + /* Ensure an edge on the reset pin cause the interrupt */ + if (pPin->id!=pin_rst.id || 0==(pPin->mask&pin_rst.mask)) { + TRACE_ERROR("Pin other than reset caused a interrupt\n\r"); + return; + } + /* Update the ISO state according to the reset change */ + if (PIO_Get(&pin_rst)) { + if (ISO7816_S_WAIT_ATR!=iso_state) { + change_state(ISO7816_S_WAIT_ATR); + } + } else { + if (ISO7816_S_RESET!=iso_state) { + change_state(ISO7816_S_RESET); + } + } +} + /*------------------------------------------------------------------------------ * Global functions *------------------------------------------------------------------------------*/ @@ -126,14 +460,14 @@ void Sniffer_usart1_irq(void) { if (ID_USART1==sniff_usart.id) { - Sniffer_usart_irq(); + Sniffer_usart_isr(); } } void Sniffer_usart0_irq(void) { if (ID_USART0==sniff_usart.id) { - Sniffer_usart_irq(); + Sniffer_usart_isr(); } } @@ -153,8 +487,9 @@ TRACE_INFO("Sniffer exit\n\r"); USART_DisableIt(sniff_usart.base, US_IER_RXRDY); /* NOTE: don't forget to set the IRQ according to the USART peripheral used */ - NVIC_DisableIRQ(USART0_IRQn); + NVIC_DisableIRQ(IRQ_USART_SIM); USART_SetReceiverEnabled(sniff_usart.base, 0); + } /* called when *Sniffer* configuration is set by host */ @@ -168,6 +503,12 @@ PIO_Configure(pins_bus, PIO_LISTSIZE(pins_bus)); /* Configure pins to forward phone power to card */ PIO_Configure(pins_power, PIO_LISTSIZE(pins_power)); + /* Enable interrupts on port with reset line */ + NVIC_EnableIRQ(PIOA_IRQn); /* CAUTION this needs to match to the correct port */ + /* Register ISR to handle card reset change */ + PIO_ConfigureIt(&pin_rst, &Sniffer_reset_isr); + /* Enable interrupt on card reset pin */ + PIO_EnableIt(&pin_rst); /* Clear ring buffer containing the sniffed data */ rbuf_reset(&sniff_buffer); @@ -180,10 +521,13 @@ /* Enable interrupt requests for the USART peripheral */ NVIC_EnableIRQ(IRQ_USART_SIM); - /* TODO configure RST pin ISR */ + /* Reset state */ + if (ISO7816_S_RESET!=iso_state) { + change_state(ISO7816_S_RESET); + } } -/* main (idle/busy) loop of this USB configuration */ +/* Main (idle/busy) loop of this USB configuration */ void Sniffer_run(void) { check_sniffed_data(); -- To view, visit https://gerrit.osmocom.org/9855 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I4b38ce1d80e370fda6aa181e959ba3f1286bb922 Gerrit-Change-Number: 9855 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:03:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 15:03:28 +0000 Subject: Change in simtrace2[master]: DFU: remove force bootloader button debug message since the console i... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9860 ) Change subject: DFU: remove force bootloader button debug message since the console is output message is not initialized yet ...................................................................... DFU: remove force bootloader button debug message since the console is output message is not initialized yet Change-Id: Ibea0105929a8dc38b43dacd9d1e576d7b51d0c6a --- M firmware/libboard/simtrace/source/board_simtrace.c 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libboard/simtrace/source/board_simtrace.c b/firmware/libboard/simtrace/source/board_simtrace.c index 04a3249..90bf9bc 100644 --- a/firmware/libboard/simtrace/source/board_simtrace.c +++ b/firmware/libboard/simtrace/source/board_simtrace.c @@ -44,7 +44,8 @@ /* Enter DFU bootloader in case the respective button is pressed */ if (PIO_Get(&bl_sw_pin) == 0) { - printf("BOOTLOADER switch presssed -> Force DFU\n\r"); + /* do not print to early since the console is not initialized yet */ + //printf("BOOTLOADER switch pressed -> Force DFU\n\r"); return 1; } else return 0; -- To view, visit https://gerrit.osmocom.org/9860 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ibea0105929a8dc38b43dacd9d1e576d7b51d0c6a Gerrit-Change-Number: 9860 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:03:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 15:03:28 +0000 Subject: Change in simtrace2[master]: board: fix LED pin definition In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9861 ) Change subject: board: fix LED pin definition ...................................................................... board: fix LED pin definition Change-Id: Ia6c80c0268dec708845e1dad281caaa42027f9db --- M firmware/libboard/common/include/board_common.h 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libboard/common/include/board_common.h b/firmware/libboard/common/include/board_common.h index 27f7409..64bdf0f 100644 --- a/firmware/libboard/common/include/board_common.h +++ b/firmware/libboard/common/include/board_common.h @@ -39,8 +39,8 @@ #define BOARD_MCK 48000000 -#define PIO_LED_RED PIO_PA17 -#define PIO_LED_GREEN PIO_PA17 +#define PIO_LED_RED PIO_PA17 +#define PIO_LED_GREEN PIO_PA18 #define PIN_LED_RED {PIO_LED_RED, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} #define PIN_LED_GREEN {PIO_LED_GREEN, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT} -- To view, visit https://gerrit.osmocom.org/9861 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ia6c80c0268dec708845e1dad281caaa42027f9db Gerrit-Change-Number: 9861 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:03:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 15:03:29 +0000 Subject: Change in simtrace2[master]: DFU: switch green LED on to indicate DFU mode, and red LED to indicat... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9862 ) Change subject: DFU: switch green LED on to indicate DFU mode, and red LED to indicate flashing activity ...................................................................... DFU: switch green LED on to indicate DFU mode, and red LED to indicate flashing activity Change-Id: I8e34fd869ed94ad122d6a17f5a432f5a09b820bb --- M firmware/apps/dfu/main.c 1 file changed, 39 insertions(+), 23 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/firmware/apps/dfu/main.c b/firmware/apps/dfu/main.c index 3d55fdc..26cbb8c 100644 --- a/firmware/apps/dfu/main.c +++ b/firmware/apps/dfu/main.c @@ -13,6 +13,12 @@ /* remember if the watchdog has been configured in the main loop so we can kick it in the ISR */ static bool watchdog_configured = false; +/* There is not enough space in the 16 KiB DFU bootloader to include led.h functions */ +#ifdef PINS_LEDS +/** LED pin configurations */ +static const Pin pinsLeds[] = { PINS_LEDS } ; +#endif + /*---------------------------------------------------------------------------- * Callbacks *----------------------------------------------------------------------------*/ @@ -42,53 +48,62 @@ printf("dnload(altif=%u, offset=%u, len=%u)\n\r", altif, offset, len); +#ifdef PINS_LEDS + PIO_Clear(&pinsLeds[LED_NUM_RED]); +#endif + switch (altif) { case ALTIF_RAM: addr = RAM_ADDR(offset); if (addr < IRAM_ADDR || addr + len >= IRAM_ADDR + IRAM_SIZE || addr + len >= stack_addr) { g_dfu->state = DFU_STATE_dfuERROR; g_dfu->status = DFU_STATUS_errADDRESS; - return DFU_RET_STALL; + rc = DFU_RET_STALL; + break; } memcpy((void *)addr, data, len); - return DFU_RET_ZLP; + rc = DFU_RET_ZLP; + break; case ALTIF_FLASH: addr = FLASH_ADDR(offset); if (addr < IFLASH_ADDR || addr + len >= IFLASH_ADDR + IFLASH_SIZE) { g_dfu->state = DFU_STATE_dfuERROR; g_dfu->status = DFU_STATUS_errADDRESS; - return DFU_RET_STALL; + rc = DFU_RET_STALL; + break; } rc = FLASHD_Unlock(addr, addr + len, 0, 0); if (rc != 0) { TRACE_ERROR("DFU download flash unlock failed\n\r"); - /* FIXME: set error codes */ - return DFU_RET_STALL; + rc = DFU_RET_STALL; + break; } rc = FLASHD_Write(addr, data, len); if (rc != 0) { TRACE_ERROR("DFU download flash erase failed\n\r"); - /* FIXME: set error codes */ - return DFU_RET_STALL; + rc = DFU_RET_STALL; + break; } for (i = 0; i < len; i++) { if (((uint8_t*)addr)[i]!=data[i]) { TRACE_ERROR("DFU download flash data written not correct\n\r"); - return DFU_RET_STALL; + rc = DFU_RET_STALL; + break; } } - rc = FLASHD_Lock(addr, addr + len, 0, 0); - if (rc != 0) { - TRACE_ERROR("DFU download flash lock failed\n\r"); - /* FIXME: set error codes */ - return DFU_RET_STALL; - } - return DFU_RET_ZLP; + rc = DFU_RET_ZLP; + break; default: - /* FIXME: set error codes */ TRACE_ERROR("DFU download for unknown AltIf %d\n\r", altif); - return DFU_RET_STALL; + rc = DFU_RET_STALL; + break; } + +#ifdef PINS_LEDS + PIO_Set(&pinsLeds[LED_NUM_RED]); +#endif + + return rc; } /* incoming call-back: Host has requested to read back 'req_len' bytes @@ -187,17 +202,18 @@ unsigned int i = 0; uint32_t reset_cause = (RSTC->RSTC_SR & RSTC_SR_RSTTYP_Msk) >> RSTC_SR_RSTTYP_Pos; -#if 0 - led_init(); - led_blink(LED_GREEN, BLINK_3O_30F); - led_blink(LED_RED, BLINK_3O_30F); -#endif - /* Enable watchdog for 2000ms, with no window */ WDT_Enable(WDT, WDT_MR_WDRSTEN | WDT_MR_WDDBGHLT | WDT_MR_WDIDLEHLT | (WDT_GetPeriod(2000) << 16) | WDT_GetPeriod(2000)); watchdog_configured = true; +#ifdef PINS_LEDS + /* Configure LED */ + PIO_Configure(pinsLeds, sizeof(pinsLeds)); + PIO_Set(&pinsLeds[LED_NUM_RED]); + PIO_Clear(&pinsLeds[LED_NUM_GREEN]); +#endif + PIO_InitializeInterrupts(0); EEFC_ReadUniqueID(g_unique_id); -- To view, visit https://gerrit.osmocom.org/9862 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I8e34fd869ed94ad122d6a17f5a432f5a09b820bb Gerrit-Change-Number: 9862 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:03:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 15:03:29 +0000 Subject: Change in simtrace2[master]: update_fidi: remove debug output since this function is called in tim... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9863 ) Change subject: update_fidi: remove debug output since this function is called in time critical ISR ...................................................................... update_fidi: remove debug output since this function is called in time critical ISR Change-Id: I08f407d407a18dae3f360ddc64769ddfaeb5b559 --- M firmware/libcommon/source/simtrace_iso7816.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/firmware/libcommon/source/simtrace_iso7816.c b/firmware/libcommon/source/simtrace_iso7816.c index 17f38a8..466bd65 100644 --- a/firmware/libcommon/source/simtrace_iso7816.c +++ b/firmware/libcommon/source/simtrace_iso7816.c @@ -135,8 +135,8 @@ } usart->base->US_FIDI = (ratio & 0x7ff); usart->base->US_CR |= US_CR_RXEN | US_CR_STTTO; - TRACE_INFO("updated USART(%u) Fi(%u)/Di(%u) ratio(%d): %u\n\r", usart->id, fi, di, ratio, usart->base->US_FIDI); + //TRACE_INFO("updated USART(%u) Fi(%u)/Di(%u) ratio(%d): %u\n\r", usart->id, fi, di, ratio, usart->base->US_FIDI); } else { - TRACE_WARNING("computed Fi/Di ratio %d unsupported\n\r", ratio); + //TRACE_WARNING("computed Fi/Di ratio %d unsupported\n\r", ratio); /* don't print since this is function is also called by ISRs */ } } -- To view, visit https://gerrit.osmocom.org/9863 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I08f407d407a18dae3f360ddc64769ddfaeb5b559 Gerrit-Change-Number: 9863 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:04:07 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 15:04:07 +0000 Subject: Change in simtrace2[master]: sniff: print parsed ATR and PPS; use red LED to show main application... In-Reply-To: References: Message-ID: K?vin Redon has posted comments on this change. ( https://gerrit.osmocom.org/9865 ) Change subject: sniff: print parsed ATR and PPS; use red LED to show main application is running; use green LED to indicate activity (message parsed) ...................................................................... Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/9865/3//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/9865/3//COMMIT_MSG at 7 PS3, Line 7: sniff: print parsed ATR and PPS; use red LED to show main application is running; use green LED to indicate activity (message parsed) > cosmietics: I think it's more "logical" if the permanent gren LED indicated "I'm running main progra [?] I have the habit of full red = there is power, blinking red = there is an error, and other LEDs are for something else. but you are right, green generally means everything is fine. we can have red (power) + green (ok) on when everything is ok, blink red on error, blink green on activity. how about that? -- To view, visit https://gerrit.osmocom.org/9865 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8e906bdbf2c91e608757ae442dfb241f981b8f1e Gerrit-Change-Number: 9865 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon Gerrit-Comment-Date: Wed, 04 Jul 2018 15:04:07 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:04:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 15:04:18 +0000 Subject: Change in openbsc[master]: nat: Add VTY cmd paging-bss-forward to nat node In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9885 ) Change subject: nat: Add VTY cmd paging-bss-forward to nat node ...................................................................... nat: Add VTY cmd paging-bss-forward to nat node This command controls forward/drop of BSS paging messages from MSC to all BSCs connected to BSC-NAT. In situations in which MS don't generally roam from one BSC to another under the BSC-NAT, it may be beneficial (bandwidth wise) to drop these global paging commands, which are usually issued by the MSC if the location of the MS isn't known and LAC paging has failed. Change-Id: I737774543e0a8734d79b072e66e3c09e82b001d3 --- M openbsc/include/openbsc/bsc_nat.h M openbsc/src/osmo-bsc_nat/bsc_nat.c M openbsc/src/osmo-bsc_nat/bsc_nat_vty.c 3 files changed, 28 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/openbsc/include/openbsc/bsc_nat.h b/openbsc/include/openbsc/bsc_nat.h index 5171c3e..3eba70d 100644 --- a/openbsc/include/openbsc/bsc_nat.h +++ b/openbsc/include/openbsc/bsc_nat.h @@ -262,6 +262,7 @@ int mgcp_length; int mgcp_ipa; int sdp_ensure_amr_mode_set; + int paging_bss_forward; /* msc things */ struct llist_head dests; diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c index 2c6c644..0559758 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c @@ -620,6 +620,10 @@ } if (discrim == CELL_IDENT_BSS) { + if (!nat->paging_bss_forward) { + LOGP(DNAT, LOGL_DEBUG, "Dropping BSS paging based on current config\n"); + return; + } /* All cells on the BSS are identified. */ llist_for_each_entry(bsc, &nat->bsc_connections, list_entry) { if (!bsc->authenticated) diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c b/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c index eba968a..15db664 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c @@ -186,6 +186,8 @@ vty_out(vty, " use-msc-ipa-for-mgcp%s", VTY_NEWLINE); vty_out(vty, " %ssdp-ensure-amr-mode-set%s", _nat->sdp_ensure_amr_mode_set ? "" : "no ", VTY_NEWLINE); + vty_out(vty, " %spaging-bss-forward%s", + _nat->paging_bss_forward ? "" : "no ", VTY_NEWLINE); config_write_bsc(vty); @@ -870,6 +872,24 @@ return CMD_SUCCESS; } +DEFUN(cfg_nat_paging_bss_forward, + cfg_nat_paging_bss_forward_cmd, + "paging-bss-forward", + "Forward Paging messages with BSS as Cell Identity Discriminator\n") +{ + _nat->paging_bss_forward = 1; + return CMD_SUCCESS; +} + +DEFUN(cfg_nat_no_paging_bss_forward, + cfg_nat_no_paging_bss_forward_cmd, + "no paging-bss-forward", + NO_STR "Forward Paging messages with BSS as Cell Identity Discriminator\n") +{ + _nat->paging_bss_forward = 0; + return CMD_SUCCESS; +} + /* per BSC configuration */ DEFUN(cfg_bsc, cfg_bsc_cmd, "bsc BSC_NR", "BSC configuration\n" "Identifier of the BSC\n") @@ -1374,6 +1394,9 @@ install_element(NAT_NODE, &cfg_nat_sdp_amr_mode_set_cmd); install_element(NAT_NODE, &cfg_nat_no_sdp_amr_mode_set_cmd); + install_element(NAT_NODE, &cfg_nat_paging_bss_forward_cmd); + install_element(NAT_NODE, &cfg_nat_no_paging_bss_forward_cmd); + install_element(NAT_NODE, &cfg_nat_pgroup_cmd); install_element(NAT_NODE, &cfg_nat_no_pgroup_cmd); install_node(&pgroup_node, config_write_pgroup); -- To view, visit https://gerrit.osmocom.org/9885 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I737774543e0a8734d79b072e66e3c09e82b001d3 Gerrit-Change-Number: 9885 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:05:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 15:05:27 +0000 Subject: Change in simtrace2[master]: fix LED switching on/off In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9887 ) Change subject: fix LED switching on/off ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9887 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id8cc27e6f0b6556ba5e7ea4d254dd0fe59042a0c Gerrit-Change-Number: 9887 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 04 Jul 2018 15:05:27 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:05:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 15:05:47 +0000 Subject: Change in simtrace2[master]: LED: add short LED pulse blinking pattern In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9864 ) Change subject: LED: add short LED pulse blinking pattern ...................................................................... Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9864 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0fdc2f902a3b92da6aa9b9c8500abae8a2f79447 Gerrit-Change-Number: 9864 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon Gerrit-Comment-Date: Wed, 04 Jul 2018 15:05:47 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:07:01 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 15:07:01 +0000 Subject: Change in simtrace2[master]: sniff: print parsed ATR and PPS; use red LED to show main application... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9865 ) Change subject: sniff: print parsed ATR and PPS; use red LED to show main application is running; use green LED to indicate activity (message parsed) ...................................................................... Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/9865/3//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/9865/3//COMMIT_MSG at 7 PS3, Line 7: sniff: print parsed ATR and PPS; use red LED to show main application is running; use green LED to indicate activity (message parsed) > red (power) + green (ok) on when everything is ok, blink red on error, blink green on activity. how about that? excellent plan! -- To view, visit https://gerrit.osmocom.org/9865 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8e906bdbf2c91e608757ae442dfb241f981b8f1e Gerrit-Change-Number: 9865 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon Gerrit-Comment-Date: Wed, 04 Jul 2018 15:07:01 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:07:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 15:07:23 +0000 Subject: Change in simtrace2[master]: LED: add short LED pulse blinking pattern In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9864 ) Change subject: LED: add short LED pulse blinking pattern ...................................................................... LED: add short LED pulse blinking pattern Change-Id: I0fdc2f902a3b92da6aa9b9c8500abae8a2f79447 --- M firmware/libboard/common/include/led.h M firmware/libboard/common/source/led.c 2 files changed, 17 insertions(+), 9 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libboard/common/include/led.h b/firmware/libboard/common/include/led.h index d1db039..4e29c0e 100644 --- a/firmware/libboard/common/include/led.h +++ b/firmware/libboard/common/include/led.h @@ -13,9 +13,10 @@ BLINK_3O_30F = 3, BLINK_3O_1F_3O_30F = 4, BLINK_3O_1F_3O_1F_3O_30F= 5, - BLINK_200O_F = 6, - BLINK_600O_F = 7, - BLINK_CUSTOM = 8, + BLINK_2O_F = 6, + BLINK_200O_F = 7, + BLINK_600O_F = 8, + BLINK_CUSTOM = 9, _NUM_LED_BLINK }; diff --git a/firmware/libboard/common/source/led.c b/firmware/libboard/common/source/led.c index e4d2d57..540f031 100644 --- a/firmware/libboard/common/source/led.c +++ b/firmware/libboard/common/source/led.c @@ -27,7 +27,7 @@ struct blink_state { /* duration of the state in ms */ uint16_t duration; - /* bringhtness of LED during the state */ + /* brightness of LED during the state */ uint8_t on; } __attribute__((packed)); @@ -54,6 +54,9 @@ static const struct blink_state bs_3on_1off_3on_1off_3on_30off[] = { { 300, 1 }, { 100, 0 }, { 300, 1 }, { 100, 0 }, { 300, 1 }, { 3000, 0 } }; +static const struct blink_state bs_2on_off[] = { + { 200, 1 }, { 0, 0 }, +}; static const struct blink_state bs_200on_off[] = { { 20000, 1 }, { 0, 0 }, }; @@ -94,6 +97,10 @@ .states = bs_3on_1off_3on_1off_3on_30off, .size = ARRAY_SIZE(bs_3on_1off_3on_1off_3on_30off), }, + [BLINK_2O_F] = { + .states = bs_2on_off, + .size = ARRAY_SIZE(bs_2on_off), + }, [BLINK_200O_F] = { .states = bs_200on_off, .size = ARRAY_SIZE(bs_200on_off), @@ -158,16 +165,16 @@ } static struct led_state led_state[] = { - [LED_GREEN] = { - .led = LED_GREEN, - .timer.cb = blink_tmr_cb, - .timer.data = &led_state[LED_GREEN], - }, [LED_RED] = { .led = LED_RED, .timer.cb = blink_tmr_cb, .timer.data = &led_state[LED_RED], }, + [LED_GREEN] = { + .led = LED_GREEN, + .timer.cb = blink_tmr_cb, + .timer.data = &led_state[LED_GREEN], + }, }; #endif /* PINS_LEDS */ -- To view, visit https://gerrit.osmocom.org/9864 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I0fdc2f902a3b92da6aa9b9c8500abae8a2f79447 Gerrit-Change-Number: 9864 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Wed Jul 4 15:10:06 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Wed, 4 Jul 2018 15:10:06 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-asn1c_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#174?= In-Reply-To: <1571696431.35.1530630606748.JavaMail.jenkins@jenkins.osmocom.org> References: <1571696431.35.1530630606748.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <1886686306.55.1530717006754.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 3.67 KB...] + ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for style of include used by make... GNU checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking how to run the C++ preprocessor... g++ -E checking for g77... no checking for f77... no checking for xlf... no checking for frt... no checking for pgf77... no checking for cf77... no checking for fort77... no checking for fl32... no checking for af77... no checking for f90... no checking for xlf90... no checking for pgf90... no checking for pghpf... no checking for epcf90... no checking for gfortran... no checking for g95... no checking for f95... no checking for fort... no checking for xlf95... no checking for ifort... no checking for ifc... no checking for efc... no checking for pgf95... no checking for lf95... no checking for ftn... no checking whether we are using the GNU Fortran 77 compiler... no checking whether accepts -g... no checking the maximum length of command line arguments... 32768 checking command to parse /usr/bin/nm -B output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes configure: creating libtool appending configuration tag "CXX" to libtool checking for ld used by g++... /usr/bin/ld -m elf_x86_64 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC checking if g++ PIC flag -fPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate appending configuration tag "F77" to libtool checking for autoconf... /usr/bin/autoconf checking for autoheader... /usr/bin/autoheader checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking dependency style of gcc... (cached) gcc3 checking how to run the C preprocessor... gcc -E checking for a BSD-compatible install... /usr/bin/install -c checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking for bison... bison -y checking for flex... flex checking for yywrap in -lfl... yes checking lex output file root... lex.yy checking whether yytext is a pointer... yes checking for ar... /usr/bin/ar checking for ANSI C header files... (cached) yes checking sys/param.h usability... yes checking sys/param.h presence... yes checking for sys/param.h... yes checking whether byte ordering is bigendian... no checking for off_t... yes checking for size_t... yes checking whether struct tm is in sys/time.h or time.h... time.h checking for intmax_t... yes checking for library containing getopt... none required checking for strtoimax... yes checking for strtoll... yes checking for mergesort... no checking for mkstemps... yes configure: creating ./config.status config.status: creating skeletons/standard-modules/Makefile config.status: creating skeletons/tests/Makefile config.status: creating libasn1compiler/Makefile config.status: creating libasn1parser/Makefile config.status: creating libasn1print/Makefile config.status: creating asn1c/webcgi/Makefile config.status: creating asn1c/tests/Makefile config.status: creating libasn1fix/Makefile config.status: creating skeletons/Makefile config.status: creating examples/Makefile config.status: creating tests/Makefile config.status: creating asn1c/Makefile config.status: creating doc/Makefile config.status: creating asn1c.spec config.status: creating Makefile config.status: creating config.h config.status: executing depfiles commands + make -j 8 make all-recursive make[1]: Entering directory ' Making all in libasn1parser make[2]: Entering directory ' if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF ".deps/asn1parser.Tpo" -c -o asn1parser.lo asn1parser.c; \ then mv -f ".deps/asn1parser.Tpo" ".deps/asn1parser.Plo"; else rm -f ".deps/asn1parser.Tpo"; exit 1; fi bison -y -p asn1p_ -d asn1p_y.y if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF ".deps/asn1p_l.Tpo" -c -o asn1p_l.lo asn1p_l.c; \ then mv -f ".deps/asn1p_l.Tpo" ".deps/asn1p_l.Plo"; else rm -f ".deps/asn1p_l.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF ".deps/asn1p_module.Tpo" -c -o asn1p_module.lo asn1p_module.c; \ then mv -f ".deps/asn1p_module.Tpo" ".deps/asn1p_module.Plo"; else rm -f ".deps/asn1p_module.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF ".deps/asn1p_oid.Tpo" -c -o asn1p_oid.lo asn1p_oid.c; \ then mv -f ".deps/asn1p_oid.Tpo" ".deps/asn1p_oid.Plo"; else rm -f ".deps/asn1p_oid.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF ".deps/asn1p_value.Tpo" -c -o asn1p_value.lo asn1p_value.c; \ then mv -f ".deps/asn1p_value.Tpo" ".deps/asn1p_value.Plo"; else rm -f ".deps/asn1p_value.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF ".deps/asn1p_expr.Tpo" -c -o asn1p_expr.lo asn1p_expr.c; \ then mv -f ".deps/asn1p_expr.Tpo" ".deps/asn1p_expr.Plo"; else rm -f ".deps/asn1p_expr.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF ".deps/asn1p_xports.Tpo" -c -o asn1p_xports.lo asn1p_xports.c; \ then mv -f ".deps/asn1p_xports.Tpo" ".deps/asn1p_xports.Plo"; else rm -f ".deps/asn1p_xports.Tpo"; exit 1; fi asn1p_y.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] mkdir .libs gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -fPIC -DPIC -o .libs/asn1p_module.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -fPIC -DPIC -o .libs/asn1p_value.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -fPIC -DPIC -o .libs/asn1p_expr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -fPIC -DPIC -o .libs/asn1p_l.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -fPIC -DPIC -o .libs/asn1parser.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -fPIC -DPIC -o .libs/asn1p_oid.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -fPIC -DPIC -o .libs/asn1p_xports.o asn1p_l.c:3521:12: warning: 'input' defined but not used [-Wunused-function] static int input() ^~~~~ gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -o asn1p_module.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -o asn1p_xports.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -o asn1parser.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -o asn1p_oid.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF ".deps/asn1p_constr.Tpo" -c -o asn1p_constr.lo asn1p_constr.c; \ then mv -f ".deps/asn1p_constr.Tpo" ".deps/asn1p_constr.Plo"; else rm -f ".deps/asn1p_constr.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -o asn1p_value.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -o asn1p_expr.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF ".deps/asn1p_param.Tpo" -c -o asn1p_param.lo asn1p_param.c; \ then mv -f ".deps/asn1p_param.Tpo" ".deps/asn1p_param.Plo"; else rm -f ".deps/asn1p_param.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF ".deps/asn1p_class.Tpo" -c -o asn1p_class.lo asn1p_class.c; \ then mv -f ".deps/asn1p_class.Tpo" ".deps/asn1p_class.Plo"; else rm -f ".deps/asn1p_class.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -fPIC -DPIC -o .libs/asn1p_constr.o if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF ".deps/asn1p_ref.Tpo" -c -o asn1p_ref.lo asn1p_ref.c; \ then mv -f ".deps/asn1p_ref.Tpo" ".deps/asn1p_ref.Plo"; else rm -f ".deps/asn1p_ref.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -fPIC -DPIC -o .libs/asn1p_param.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -fPIC -DPIC -o .libs/asn1p_class.o if test -f y.tab.h; then \ to=`echo "asn1p_y_H" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \ sed -e "/^#/!b" -e "s/Y_TAB_H/$to/g" -e "s|y\.tab\.h|asn1p_y.h|" \ y.tab.h >asn1p_y.ht; \ rm -f y.tab.h; \ if cmp -s asn1p_y.ht asn1p_y.h; then \ rm -f asn1p_y.ht ;\ else \ mv asn1p_y.ht asn1p_y.h; \ fi; \ fi if test -f y.output; then \ mv y.output asn1p_y.output; \ fi sed '/^#/ s|y\.tab\.c|asn1p_y.c|' y.tab.c >asn1p_y.ct && mv asn1p_y.ct asn1p_y.c gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -o asn1p_param.o >/dev/null 2>&1 rm -f y.tab.c if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF ".deps/asn1p_y.Tpo" -c -o asn1p_y.lo asn1p_y.c; \ then mv -f ".deps/asn1p_y.Tpo" ".deps/asn1p_y.Plo"; else rm -f ".deps/asn1p_y.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -o asn1p_constr.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -fPIC -DPIC -o .libs/asn1p_ref.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -o asn1p_class.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -o asn1p_ref.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF .deps/asn1p_y.Tpo -c asn1p_y.c -fPIC -DPIC -o .libs/asn1p_y.o asn1p_y.y: In function 'asn1p_parse': asn1p_y.y:357:13: error: 'param' undeclared (first use in this function) *(void **)param = $1; ^~~~~ asn1p_y.y:357:13: note: each undeclared identifier is reported only once for each function it appears in gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -o asn1p_l.o >/dev/null 2>&1 Makefile:299: recipe for target 'asn1p_y.lo' failed make[2]: *** [asn1p_y.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory ' Makefile:302: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory ' Makefile:212: recipe for target 'all' failed make: *** [all] Error 2 Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:10:15 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 15:10:15 +0000 Subject: Change in simtrace2[master]: USB: add central file to define USB IDs, classes, and endpoints In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9869 to look at the new patch set (#7). Change subject: USB: add central file to define USB IDs, classes, and endpoints ...................................................................... USB: add central file to define USB IDs, classes, and endpoints Change-Id: Iba81f32a92c68a973e8e7adbc4c2a1064ba5290f --- M firmware/atmel_softpack_libraries/usb/device/dfu/dfu_desc.c M firmware/libboard/common/include/board_common.h M firmware/libboard/owhw/include/board.h M firmware/libboard/qmod/include/board.h M firmware/libboard/simtrace/include/board.h M firmware/libcommon/include/simtrace.h A firmware/libcommon/include/simtrace_usb.h M firmware/libcommon/source/mode_cardemu.c M firmware/libcommon/source/simtrace_iso7816.c M firmware/libcommon/source/usb.c M firmware/libcommon/source/usb_buf.c 11 files changed, 121 insertions(+), 105 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/69/9869/7 -- To view, visit https://gerrit.osmocom.org/9869 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iba81f32a92c68a973e8e7adbc4c2a1064ba5290f Gerrit-Change-Number: 9869 Gerrit-PatchSet: 7 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:10:30 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 15:10:30 +0000 Subject: Change in simtrace2[master]: USB: add central file to define USB IDs, classes, and endpoints In-Reply-To: References: Message-ID: K?vin Redon has posted comments on this change. ( https://gerrit.osmocom.org/9869 ) Change subject: USB: add central file to define USB IDs, classes, and endpoints ...................................................................... Patch Set 4: (2 comments) fixed https://gerrit.osmocom.org/#/c/9869/4/firmware/libcommon/include/simtrace_usb.h File firmware/libcommon/include/simtrace_usb.h: https://gerrit.osmocom.org/#/c/9869/4/firmware/libcommon/include/simtrace_usb.h at 2 PS4, Line 2: Affero > GPLv2-or-later, not AGPlv3-or-late fixed https://gerrit.osmocom.org/#/c/9869/4/firmware/libcommon/include/simtrace_usb.h at 14 PS4, Line 14: Kevin Redon > (C) 2018 by sysmocom -s.f.m.c. GmbH, Author: Kevin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon Gerrit-Comment-Date: Wed, 04 Jul 2018 15:10:30 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:12:48 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 15:12:48 +0000 Subject: Change in simtrace2[master]: sniffer USB: implement USB communication and send parsed messages In-Reply-To: References: Message-ID: K?vin Redon has posted comments on this change. ( https://gerrit.osmocom.org/9873 ) Change subject: sniffer USB: implement USB communication and send parsed messages ...................................................................... Patch Set 5: (1 comment) common USB message header initialize function added https://gerrit.osmocom.org/#/c/9873/5/firmware/libcommon/source/sniffer.c File firmware/libcommon/source/sniffer.c: https://gerrit.osmocom.org/#/c/9873/5/firmware/libcommon/source/sniffer.c at 206 PS5, Line 206: struct simtrace_msg_hdr *usb_msg_header; : usb_msg->l1h = msgb_put(usb_msg, sizeof(*usb_msg_header)); : usb_msg_header = (struct simtrace_msg_hdr *) usb_msg->l1h; : memset(usb_msg_header, 0, sizeof(*usb_msg_header)); : usb_msg_header->msg_class = SIMTRACE_MSGC_SNIFF; : usb_msg_header->msg_type = SIMTRACE_MSGT_SNIFF_CHANGE; : usb_msg->l2h = usb_msg->l1h + sizeof(*usb_msg_header) > this kind of block seems to repeat over the file. [?] fixed -- To view, visit https://gerrit.osmocom.org/9873 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ice7817480705f2124b08c1ff9a8826558b6d8b2b Gerrit-Change-Number: 9873 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon Gerrit-Comment-Date: Wed, 04 Jul 2018 15:12:48 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:15:54 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 15:15:54 +0000 Subject: Change in simtrace2[master]: sniffing: move conversion convertion and flag processing from ISR to ... In-Reply-To: References: Message-ID: K?vin Redon has posted comments on this change. ( https://gerrit.osmocom.org/9878 ) Change subject: sniffing: move conversion convertion and flag processing from ISR to main loop to keep ISR fast and focus on data capture ...................................................................... Patch Set 7: (1 comment) fixed https://gerrit.osmocom.org/#/c/9878/7/firmware/libcommon/source/sniffer.c File firmware/libcommon/source/sniffer.c: https://gerrit.osmocom.org/#/c/9878/7/firmware/libcommon/source/sniffer.c at 841 PS7, Line 841: struct simtrace_msg_hdr *usb_msg_header; : usb_msg->l1h = msgb_put(usb_msg, sizeof(*usb_msg_header)); : usb_msg_header = (struct simtrace_msg_hdr *) usb_msg->l1h; : memset(usb_msg_header, 0, sizeof(*usb_msg_header)); : usb_msg_header->msg_class = SIMTRACE_MSGC_SNIFF; : usb_msg_header->msg_type = SIMTRACE_MSGT_SNIFF_CHANGE; : usb_msg->l2h = usb_msg->l1h + sizeof(*usb_msg_header); : struct sniff_change *usb_sniff_change; : usb_sniff_change = (struct sniff_change *) msgb_put(usb_msg, sizeof(*usb_sniff_change)); : usb_sniff_change->flags = flags; : usb_msg_header->msg_len = msgb_length(usb_msg); > this will need to be changed according to the API suggestions I posted against an earlier patch in t [?] fixed in the previous changeset -- To view, visit https://gerrit.osmocom.org/9878 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ieefa8a5f81dbcc12c1ad3059660dbffa0c1a4961 Gerrit-Change-Number: 9878 Gerrit-PatchSet: 7 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon Gerrit-Comment-Date: Wed, 04 Jul 2018 15:15:54 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:17:45 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 15:17:45 +0000 Subject: Change in simtrace2[master]: sniffing: fix procedure byte handling and make TPDU parsing more strict In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9880 to look at the new patch set (#14). Change subject: sniffing: fix procedure byte handling and make TPDU parsing more strict ...................................................................... sniffing: fix procedure byte handling and make TPDU parsing more strict Change-Id: If991152f11c4b864ab1386f21dc13c335e6b281f --- M firmware/libcommon/source/sniffer.c 1 file changed, 12 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/80/9880/14 -- To view, visit https://gerrit.osmocom.org/9880 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If991152f11c4b864ab1386f21dc13c335e6b281f Gerrit-Change-Number: 9880 Gerrit-PatchSet: 14 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:17:45 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 15:17:45 +0000 Subject: Change in simtrace2[master]: sniffing: decrease USB IRQ prioprity to prevent USART overrun In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9881 to look at the new patch set (#14). Change subject: sniffing: decrease USB IRQ prioprity to prevent USART overrun ...................................................................... sniffing: decrease USB IRQ prioprity to prevent USART overrun Handling the USB message queue is done in an ISR and take quite some time. This can cause a USART/SIM sniffing buffer overrun, resulting in data loss. By setting the USB IRQ lower than the USART IRQ, the USB ISR can be interrupted (for short) and no data gets lost. Change-Id: I870a0aa8e251bbb53249c54bfcaa45de5b5a9486 --- M firmware/libcommon/source/sniffer.c 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/81/9881/14 -- To view, visit https://gerrit.osmocom.org/9881 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I870a0aa8e251bbb53249c54bfcaa45de5b5a9486 Gerrit-Change-Number: 9881 Gerrit-PatchSet: 14 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:17:45 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 15:17:45 +0000 Subject: Change in simtrace2[master]: sniffer: add waiting time WT update In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9882 to look at the new patch set (#14). Change subject: sniffer: add waiting time WT update ...................................................................... sniffer: add waiting time WT update the waiting time (WT) is used to detect timeouts (e.g. for unresponsive card or just to signal an error/NAK). it is essential to detect to timeout to end current data transfer (e.g. change state). by default (after a reset) to timeout is 9600 ETU, but this can change at two places: - after the ATR using the value of TC2 (if present) - after a PPS (only F is used, and not D) because the timeout value can be larger than the 16-bit of the USART TO register, an external variable needs to be used for the count down. Change-Id: I9735660ffce161cec8d4e63fa60a66fc8ef57525 --- M firmware/libcommon/source/sniffer.c 1 file changed, 66 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/82/9882/14 -- To view, visit https://gerrit.osmocom.org/9882 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9735660ffce161cec8d4e63fa60a66fc8ef57525 Gerrit-Change-Number: 9882 Gerrit-PatchSet: 14 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:17:45 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 15:17:45 +0000 Subject: Change in simtrace2[master]: minor style change: use ARRAY_SIZE In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9886 to look at the new patch set (#6). Change subject: minor style change: use ARRAY_SIZE ...................................................................... minor style change: use ARRAY_SIZE Change-Id: Ia5243c342535963a3800849cd5a7d183a510d2d6 --- M firmware/apps/trace/main.c 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/86/9886/6 -- To view, visit https://gerrit.osmocom.org/9886 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia5243c342535963a3800849cd5a7d183a510d2d6 Gerrit-Change-Number: 9886 Gerrit-PatchSet: 6 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:17:45 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 15:17:45 +0000 Subject: Change in simtrace2[master]: fix LED switching on/off In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9887 to look at the new patch set (#4). Change subject: fix LED switching on/off ...................................................................... fix LED switching on/off In the SIMtrace and QMOD schematics the LEDs are connected to +3.3V. Thus to switch the LED on we need to set the pin low. Change-Id: Id8cc27e6f0b6556ba5e7ea4d254dd0fe59042a0c --- M firmware/libboard/common/source/led.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/87/9887/4 -- To view, visit https://gerrit.osmocom.org/9887 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id8cc27e6f0b6556ba5e7ea4d254dd0fe59042a0c Gerrit-Change-Number: 9887 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:18:24 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 15:18:24 +0000 Subject: Change in simtrace2[master]: sniffing: fix procedure byte handling and make TPDU parsing more strict In-Reply-To: References: Message-ID: K?vin Redon has posted comments on this change. ( https://gerrit.osmocom.org/9880 ) Change subject: sniffing: fix procedure byte handling and make TPDU parsing more strict ...................................................................... Patch Set 8: (1 comment) fixed https://gerrit.osmocom.org/#/c/9880/8//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/9880/8//COMMIT_MSG at 7 PS8, Line 7: for strict > more strict? fixed -- To view, visit https://gerrit.osmocom.org/9880 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If991152f11c4b864ab1386f21dc13c335e6b281f Gerrit-Change-Number: 9880 Gerrit-PatchSet: 8 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon Gerrit-Comment-Date: Wed, 04 Jul 2018 15:18:24 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:25:53 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 4 Jul 2018 15:25:53 +0000 Subject: Change in simtrace2[master]: sniff: print parsed ATR and PPS; use red LED to show main application... In-Reply-To: References: Message-ID: K?vin Redon has posted comments on this change. ( https://gerrit.osmocom.org/9865 ) Change subject: sniff: print parsed ATR and PPS; use red LED to show main application is running; use green LED to indicate activity (message parsed) ...................................................................... Patch Set 5: > (1 comment) since I need to add a new pattern (blink = short off, than back on) and add the blinking at various places at the code (also for error), I will make a new commit. please +2 this commit -- To view, visit https://gerrit.osmocom.org/9865 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8e906bdbf2c91e608757ae442dfb241f981b8f1e Gerrit-Change-Number: 9865 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon Gerrit-Comment-Date: Wed, 04 Jul 2018 15:25:53 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:33:13 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 15:33:13 +0000 Subject: Change in simtrace2[master]: sniff: print parsed ATR and PPS; use red LED to show main application... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9865 ) Change subject: sniff: print parsed ATR and PPS; use red LED to show main application is running; use green LED to indicate activity (message parsed) ...................................................................... Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9865 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8e906bdbf2c91e608757ae442dfb241f981b8f1e Gerrit-Change-Number: 9865 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon Gerrit-Comment-Date: Wed, 04 Jul 2018 15:33:13 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:33:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 15:33:21 +0000 Subject: Change in simtrace2[master]: sniff: print parsed ATR and PPS; use red LED to show main application... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9865 ) Change subject: sniff: print parsed ATR and PPS; use red LED to show main application is running; use green LED to indicate activity (message parsed) ...................................................................... sniff: print parsed ATR and PPS; use red LED to show main application is running; use green LED to indicate activity (message parsed) Change-Id: I8e906bdbf2c91e608757ae442dfb241f981b8f1e --- M firmware/apps/trace/main.c M firmware/libcommon/source/sniffer.c 2 files changed, 56 insertions(+), 3 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/apps/trace/main.c b/firmware/apps/trace/main.c index 8c89907..a288a7b 100644 --- a/firmware/apps/trace/main.c +++ b/firmware/apps/trace/main.c @@ -124,8 +124,10 @@ enum confNum last_simtrace_config = simtrace_config; unsigned int i = 0; + /* Configure LED output (red = on, green = activity */ led_init(); - led_blink(LED_RED, BLINK_3O_5F); + led_blink(LED_RED, BLINK_ALWAYS_ON); + led_blink(LED_GREEN, BLINK_ALWAYS_OFF); /* Enable watchdog for 2000 ms, with no window */ WDT_Enable(WDT, WDT_MR_WDRSTEN | WDT_MR_WDDBGHLT | WDT_MR_WDIDLEHLT | diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 66aceab..4b3545f 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -189,7 +189,24 @@ /* save new state */ iso_state = iso_state_new; - TRACE_INFO("Changed to ISO 7816-3 state %u\n\r", iso_state); + //TRACE_INFO("Changed to ISO 7816-3 state %u\n\r", iso_state); /* don't print since this is function is also called by ISRs */ +} + +/*! Print current ATR */ +static void print_atr(void) +{ + if (ISO7816_S_IN_ATR!=iso_state) { + TRACE_WARNING("Can't print ATR in ISO 7816-3 state %u\n\r", iso_state); + return; + } + + led_blink(LED_GREEN, BLINK_2O_F); + printf("ATR: "); + uint8_t i; + for (i = 0; i < atr_i && i < ARRAY_SIZE(atr); i++) { + printf("%02x ", atr[i]); + } + printf("\n\r"); } /*! Process ATR byte @@ -206,7 +223,7 @@ return; } if (atr_i>=ARRAY_SIZE(atr)) { - TRACE_WARNING("ATR data overflow\n\r"); + TRACE_ERROR("ATR data overflow\n\r"); return; } @@ -273,6 +290,7 @@ } case ATR_S_WAIT_TCK: /* see ISO/IEC 7816-3:2006 section 8.2.5 */ /* we could verify the checksum, but we are just here to sniff */ + print_atr(); /* print ATR for info */ change_state(ISO7816_S_WAIT_APDU); /* go to next state */ break; default: @@ -280,6 +298,38 @@ } } +/*! Print current PPS */ +static void print_pps(void) +{ + uint8_t *pps_cur; /* current PPS (request or response) */ + + /* sanity check */ + if (ISO7816_S_IN_PPS_REQ==iso_state) { + pps_cur = pps_req; + } else if (ISO7816_S_IN_PPS_RSP==iso_state) { + pps_cur = pps_rsp; + } else { + TRACE_ERROR("Can't print PPS in ISO 7816-3 state %u\n\r", iso_state); + return; + } + + led_blink(LED_GREEN, BLINK_2O_F); + printf("PPS %s : ", ISO7816_S_IN_PPS_REQ==iso_state ? "REQUEST" : "RESPONSE"); + printf("%02x ", pps_cur[0]); + printf("%02x ", pps_cur[1]); + if (pps_cur[1]&0x10) { + printf("%02x ", pps_cur[2]); + } + if (pps_cur[1]&0x20) { + printf("%02x ", pps_cur[3]); + } + if (pps_cur[1]&0x40) { + printf("%02x ", pps_cur[4]); + } + printf("%02x ", pps_cur[5]); + printf("\n\r"); +} + static void process_byte_pps(uint8_t byte) { uint8_t *pps_cur; /* current PPS (request or response) */ @@ -343,6 +393,7 @@ check ^= pps_cur[4]; } check ^= pps_cur[5]; + print_pps(); /* print PPS for info */ if (ISO7816_S_IN_PPS_REQ==iso_state) { if (0==check) { /* checksum is valid */ change_state(ISO7816_S_WAIT_PPS_RSP); /* go to next state */ -- To view, visit https://gerrit.osmocom.org/9865 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I8e906bdbf2c91e608757ae442dfb241f981b8f1e Gerrit-Change-Number: 9865 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:33:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 15:33:21 +0000 Subject: Change in simtrace2[master]: sniff: add TPDU parsing (TPDUs become APDUs on the upper layer) In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9866 ) Change subject: sniff: add TPDU parsing (TPDUs become APDUs on the upper layer) ...................................................................... sniff: add TPDU parsing (TPDUs become APDUs on the upper layer) Change-Id: I09d050d95bd2ab140fe6b4926a37278eb08cc347 --- M firmware/libcommon/source/sniffer.c 1 file changed, 143 insertions(+), 10 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 4b3545f..bada46e 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -54,8 +54,8 @@ ISO7816_S_RESET, /*!< in Reset */ ISO7816_S_WAIT_ATR, /*!< waiting for ATR to start */ ISO7816_S_IN_ATR, /*!< while we are receiving the ATR */ - ISO7816_S_WAIT_APDU, /*!< waiting for start of new APDU */ - ISO7816_S_IN_APDU, /*!< inside a single APDU */ + ISO7816_S_WAIT_TPDU, /*!< waiting for start of new TPDU */ + ISO7816_S_IN_TPDU, /*!< inside a single TPDU */ ISO7816_S_IN_PPS_REQ, /*!< while we are inside the PPS request */ ISO7816_S_WAIT_PPS_RSP, /*!< waiting for start of the PPS response */ ISO7816_S_IN_PPS_RSP, /*!< while we are inside the PPS request */ @@ -87,6 +87,23 @@ PPS_S_WAIT_PCK, /*!< check byte */ }; +/*! Transport Protocol Data Unit (TPDU) sub-states of ISO7816_S_IN_TPDU + * @note defined in ISO/IEC 7816-3:2006(E) section 10 and 12 + * @remark APDUs are formed by one or more command+response TPDUs + */ +enum tpdu_sniff_state { + TPDU_S_CLA, /*!< class byte */ + TPDU_S_INS, /*!< instruction byte */ + TPDU_S_P1, /*!< first parameter byte for the instruction */ + TPDU_S_P2, /*!< second parameter byte for the instruction */ + TPDU_S_P3, /*!< third parameter byte encoding the data length */ + TPDU_S_PROCEDURE, /*!< procedure byte (could also be SW1) */ + TPDU_S_DATA_REMAINING, /*!< remaining data bytes */ + TPDU_S_DATA_SINGLE, /*!< single data byte */ + TPDU_S_SW1, /*!< first status word */ + TPDU_S_SW2, /*!< second status word */ +}; + /*------------------------------------------------------------------------------ * Internal variables *------------------------------------------------------------------------------*/ @@ -141,6 +158,15 @@ uint8_t pps_req[MAX_PPS_SIZE]; /*! PPS response data */ uint8_t pps_rsp[MAX_PPS_SIZE]; +/*! TPDU state */ +enum tpdu_sniff_state tpdu_state; +/*! Final TPDU packet + * @note this is the complete command+response TPDU, including header, data, and status words + * @remark this does not include the procedure bytes + */ +uint8_t tpdu_packet[5+256+2]; +/*! Current index in TPDU packet */ +uint8_t tpdu_packet_i = 0; /*------------------------------------------------------------------------------ * Internal functions @@ -183,6 +209,10 @@ case ISO7816_S_IN_PPS_RSP: pps_state = PPS_S_WAIT_PPSS; break; + case ISO7816_S_WAIT_TPDU: + tpdu_state = TPDU_S_CLA; + tpdu_packet_i = 0; + break; default: break; } @@ -291,7 +321,7 @@ case ATR_S_WAIT_TCK: /* see ISO/IEC 7816-3:2006 section 8.2.5 */ /* we could verify the checksum, but we are just here to sniff */ print_atr(); /* print ATR for info */ - change_state(ISO7816_S_WAIT_APDU); /* go to next state */ + change_state(ISO7816_S_WAIT_TPDU); /* go to next state */ break; default: TRACE_INFO("Unknown ATR state %u\n\r", atr_state); @@ -352,7 +382,7 @@ pps_state = PPS_S_WAIT_PPS0; /* go to next state */ } else { TRACE_INFO("Invalid PPSS received\n\r"); - change_state(ISO7816_S_WAIT_APDU); /* go back to APDU state */ + change_state(ISO7816_S_WAIT_TPDU); /* go back to TPDU state */ } break; case PPS_S_WAIT_PPS0: /*!< format byte */ @@ -398,7 +428,7 @@ if (0==check) { /* checksum is valid */ change_state(ISO7816_S_WAIT_PPS_RSP); /* go to next state */ } else { /* checksum is invalid */ - change_state(ISO7816_S_WAIT_APDU); /* go to next state */ + change_state(ISO7816_S_WAIT_TPDU); /* go to next state */ } } else if (ISO7816_S_IN_PPS_RSP==iso_state) { if (0==check) { /* checksum is valid */ @@ -415,7 +445,7 @@ } else { /* checksum is invalid */ TRACE_INFO("PPS negotiation failed\n\r"); } - change_state(ISO7816_S_WAIT_APDU); /* co to next state */ + change_state(ISO7816_S_WAIT_TPDU); /* go to next state */ } break; default: @@ -423,8 +453,108 @@ } } -static void process_byte_apdu(uint8_t byte) +/*! Print current TPDU */ +static void print_tpdu(void) { + if (ISO7816_S_IN_TPDU!=iso_state) { + TRACE_WARNING("Can't print TPDU in ISO 7816-3 state %u\n\r", iso_state); + return; + } + + led_blink(LED_GREEN, BLINK_2O_F); + printf("TPDU: "); + uint16_t i; + for (i = 0; i < tpdu_packet_i && i < ARRAY_SIZE(tpdu_packet); i++) { + printf("%02x ", tpdu_packet[i]); + } + printf("\n\r"); +} + +static void process_byte_tpdu(uint8_t byte) +{ + /* sanity check */ + if (ISO7816_S_IN_TPDU!=iso_state) { + TRACE_ERROR("Processing TPDU data in wrong ISO 7816-3 state %u\n\r", iso_state); + return; + } + if (tpdu_packet_i>=ARRAY_SIZE(tpdu_packet)) { + TRACE_ERROR("TPDU data overflow\n\r"); + return; + } + + /* handle TPDU byte depending on current state */ + switch (tpdu_state) { + case TPDU_S_CLA: + if (0xff==byte) { + TRACE_WARNING("0xff is not a valid class byte\n\r"); + break; + } + tpdu_packet_i = 0; + tpdu_packet[tpdu_packet_i++] = byte; + tpdu_state = TPDU_S_INS; + break; + case TPDU_S_INS: + tpdu_packet_i = 1; + tpdu_packet[tpdu_packet_i++] = byte; + tpdu_state = TPDU_S_P1; + break; + case TPDU_S_P1: + tpdu_packet_i = 2; + tpdu_packet[tpdu_packet_i++] = byte; + tpdu_state = TPDU_S_P2; + break; + case TPDU_S_P2: + tpdu_packet_i = 3; + tpdu_packet[tpdu_packet_i++] = byte; + tpdu_state = TPDU_S_P3; + break; + case TPDU_S_P3: + tpdu_packet_i = 4; + tpdu_packet[tpdu_packet_i++] = byte; + tpdu_state = TPDU_S_PROCEDURE; + break; + case TPDU_S_PROCEDURE: + if (0x60==byte) { /* wait for next procedure byte */ + break; + } else if (tpdu_packet[1]==byte) { /* get all remaining data bytes */ + tpdu_state = TPDU_S_DATA_REMAINING; + break; + } else if ((~tpdu_packet[1])==byte) { /* get single data byte */ + tpdu_state = TPDU_S_DATA_SINGLE; + break; + } + case TPDU_S_SW1: + if ((0x60==(byte&0xf0)) || (0x90==(byte&0xf0))) { /* this procedure byte is SW1 */ + tpdu_packet[tpdu_packet_i++] = byte; + tpdu_state = TPDU_S_SW2; + } else { + TRACE_WARNING("invalid SW1 0x%02x\n\r", byte); + } + break; + case TPDU_S_SW2: + tpdu_packet[tpdu_packet_i++] = byte; + print_tpdu(); /* print TPDU for info */ + change_state(ISO7816_S_WAIT_TPDU); /* this is the end of the TPDU */ + break; + case TPDU_S_DATA_SINGLE: + case TPDU_S_DATA_REMAINING: + tpdu_packet[tpdu_packet_i++] = byte; + if (0==tpdu_packet[4]) { + if (5+256<=tpdu_packet_i) { + tpdu_state = TPDU_S_SW1; + } + } else { + if (5+tpdu_packet[4]<=tpdu_packet_i) { + tpdu_state = TPDU_S_SW1; + } + } + if (TPDU_S_DATA_SINGLE==tpdu_state) { + tpdu_state = TPDU_S_PROCEDURE; + } + break; + default: + TRACE_ERROR("unhandled TPDU state %u\n\r", tpdu_state); + } } static void check_sniffed_data(void) @@ -441,7 +571,7 @@ case ISO7816_S_IN_ATR: /* More ATR data incoming */ process_byte_atr(byte); break; - case ISO7816_S_WAIT_APDU: /* After the ATR we expect APDU or PPS data */ + case ISO7816_S_WAIT_TPDU: /* After the ATR we expect TPDU or PPS data */ case ISO7816_S_WAIT_PPS_RSP: if (byte == 0xff) { if (ISO7816_S_WAIT_PPS_RSP==iso_state) { @@ -452,8 +582,11 @@ process_byte_pps(byte); break; } - case ISO7816_S_IN_APDU: /* More APDU data incoming */ - process_byte_apdu(byte); + case ISO7816_S_IN_TPDU: /* More TPDU data incoming */ + if (ISO7816_S_WAIT_TPDU==iso_state) { + change_state(ISO7816_S_IN_TPDU); + } + process_byte_tpdu(byte); break; case ISO7816_S_IN_PPS_REQ: case ISO7816_S_IN_PPS_RSP: -- To view, visit https://gerrit.osmocom.org/9866 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I09d050d95bd2ab140fe6b4926a37278eb08cc347 Gerrit-Change-Number: 9866 Gerrit-PatchSet: 6 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:33:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 15:33:22 +0000 Subject: Change in simtrace2[master]: sniff: add WT timeout detection using USART timeout (TC is not required) In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9867 ) Change subject: sniff: add WT timeout detection using USART timeout (TC is not required) ...................................................................... sniff: add WT timeout detection using USART timeout (TC is not required) Change-Id: I4ec6e812e7e1eb91005027d2e864fc315550d79c --- M firmware/libcommon/source/sniffer.c 1 file changed, 28 insertions(+), 4 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index bada46e..8a94c8a 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -193,11 +193,9 @@ switch (iso_state_new) { case ISO7816_S_RESET: update_fidi(&sniff_usart, 0x11); /* reset baud rate to default Di/Fi values */ - // TODO disable USART and TC break; case ISO7816_S_WAIT_ATR: rbuf_reset(&sniff_buffer); /* reset buffer for new communication */ - // TODO enable USART and TC break; case ISO7816_S_IN_ATR: atr_i = 0; @@ -614,6 +612,30 @@ /* Store sniffed data into buffer (also clear interrupt */ rbuf_write(&sniff_buffer, byte); } + /* Verify it WT timeout occurred, to detect unresponsive card */ + if (csr & US_CSR_TIMEOUT) { + /* Stop timeout until next character is received */ + sniff_usart.base->US_CR |= US_CR_STTTO; + /* Use timeout to detect end of ATR/PPS/TPDU */ + switch (iso_state) { + case ISO7816_S_RESET: + case ISO7816_S_WAIT_ATR: + break; + case ISO7816_S_IN_ATR: + change_state(ISO7816_S_WAIT_ATR); + break; + case ISO7816_S_WAIT_TPDU: + break; + case ISO7816_S_WAIT_PPS_RSP: + case ISO7816_S_IN_TPDU: + case ISO7816_S_IN_PPS_REQ: + case ISO7816_S_IN_PPS_RSP: + change_state(ISO7816_S_WAIT_TPDU); + break; + default: + break; + } + } } /** PIO interrupt service routine to checks if the card reset line has changed @@ -700,8 +722,10 @@ ISO7816_Init(&sniff_usart, CLK_SLAVE); /* Only receive data when sniffing */ USART_SetReceiverEnabled(sniff_usart.base, 1); - /* Enable interrupt to indicate when data has been received */ - USART_EnableIt(sniff_usart.base, US_IER_RXRDY); + /* Enable Receiver time-out WT to detect unresponsive cards */ + sniff_usart.base->US_RTOR = 9600-12; /* -12 because the timer starts at the end of the 12 ETU frame */ + /* Enable interrupt to indicate when data has been received or timeout occurred */ + USART_EnableIt(sniff_usart.base, US_IER_RXRDY | US_IER_TIMEOUT); /* Enable interrupt requests for the USART peripheral */ NVIC_EnableIRQ(IRQ_USART_SIM); -- To view, visit https://gerrit.osmocom.org/9867 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I4ec6e812e7e1eb91005027d2e864fc315550d79c Gerrit-Change-Number: 9867 Gerrit-PatchSet: 6 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:33:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 15:33:22 +0000 Subject: Change in simtrace2[master]: minor: fix typos in comment In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9868 ) Change subject: minor: fix typos in comment ...................................................................... minor: fix typos in comment Change-Id: I01b49e047a586dff449d4e134751108e391a8822 --- M firmware/libcommon/include/simtrace_prot.h 1 file changed, 4 insertions(+), 4 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libcommon/include/simtrace_prot.h b/firmware/libcommon/include/simtrace_prot.h index 91b569f..189264d 100644 --- a/firmware/libcommon/include/simtrace_prot.h +++ b/firmware/libcommon/include/simtrace_prot.h @@ -30,7 +30,7 @@ SIMTRACE_MSGC_GENERIC = 0, /* Card Emulation / Forwarding */ SIMTRACE_MSGC_CARDEM, - /* Modem Control (if modem is attached next to device */ + /* Modem Control (if modem is attached next to device) */ SIMTRACE_MSGC_MODEM, /* SIM protocol tracing */ SIMTRACE_MSGC_TRACE, @@ -107,7 +107,7 @@ SIMTRACE_CAP_LED_1, /* Has LED2 */ SIMTRACE_CAP_LED_2, - /* Has Single-Pole Dual-Throw (local/remote SIM */ + /* Has Single-Pole Dual-Throw (local/remote SIM) */ SIMTRACE_CAP_SPDT, /* Has Bus-Switch (trace / MITM) */ SIMTRACE_CAP_BUS_SWITCH, @@ -127,7 +127,7 @@ SIMTRACE_CAP_ASSERT_MODEM_RST, }; -/* vendor-specific capabilities of sysmoocm devices */ +/* vendor-specific capabilities of sysmocom devices */ enum simtrace_capability_vendor { /* Can erase a peer SAM3 controller */ SIMTRACE_CAP_SYSMO_QMOD_ERASE_PEER, @@ -253,7 +253,7 @@ /* SIMTRACE_MSGT_DT_MODEM_RESET */ struct st_modem_reset { - /* 0: de-assert reset, 1: assert reset, 2: poulse reset */ + /* 0: de-assert reset, 1: assert reset, 2: pulse reset */ uint8_t asserted; /* if above is '2', duration of pulse in ms */ uint16_t pulse_duration_msec; -- To view, visit https://gerrit.osmocom.org/9868 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I01b49e047a586dff449d4e134751108e391a8822 Gerrit-Change-Number: 9868 Gerrit-PatchSet: 6 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:33:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 15:33:55 +0000 Subject: Change in simtrace2[master]: USB: add central file to define USB IDs, classes, and endpoints In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9869 ) Change subject: USB: add central file to define USB IDs, classes, and endpoints ...................................................................... Patch Set 7: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9869 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iba81f32a92c68a973e8e7adbc4c2a1064ba5290f Gerrit-Change-Number: 9869 Gerrit-PatchSet: 7 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon Gerrit-Comment-Date: Wed, 04 Jul 2018 15:33:55 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:35:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 15:35:22 +0000 Subject: Change in simtrace2[master]: sniffer USB: implement USB communication and send parsed messages In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9873 ) Change subject: sniffer USB: implement USB communication and send parsed messages ...................................................................... Patch Set 9: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9873 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ice7817480705f2124b08c1ff9a8826558b6d8b2b Gerrit-Change-Number: 9873 Gerrit-PatchSet: 9 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon Gerrit-Comment-Date: Wed, 04 Jul 2018 15:35:22 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:44:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 15:44:14 +0000 Subject: Change in simtrace2[master]: USB: add central file to define USB IDs, classes, and endpoints In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9869 ) Change subject: USB: add central file to define USB IDs, classes, and endpoints ...................................................................... USB: add central file to define USB IDs, classes, and endpoints Change-Id: Iba81f32a92c68a973e8e7adbc4c2a1064ba5290f --- M firmware/atmel_softpack_libraries/usb/device/dfu/dfu_desc.c M firmware/libboard/common/include/board_common.h M firmware/libboard/owhw/include/board.h M firmware/libboard/qmod/include/board.h M firmware/libboard/simtrace/include/board.h M firmware/libcommon/include/simtrace.h A firmware/libcommon/include/simtrace_usb.h M firmware/libcommon/source/mode_cardemu.c M firmware/libcommon/source/simtrace_iso7816.c M firmware/libcommon/source/usb.c M firmware/libcommon/source/usb_buf.c 11 files changed, 121 insertions(+), 105 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/atmel_softpack_libraries/usb/device/dfu/dfu_desc.c b/firmware/atmel_softpack_libraries/usb/device/dfu/dfu_desc.c index f6d484c..75fded1 100644 --- a/firmware/atmel_softpack_libraries/usb/device/dfu/dfu_desc.c +++ b/firmware/atmel_softpack_libraries/usb/device/dfu/dfu_desc.c @@ -28,7 +28,7 @@ .bDeviceClass = 0, .bDeviceSubClass = 0, .bDeviceProtocol = 0, - .bMaxPacketSize0 = BOARD_USB_ENDPOINTS_MAXPACKETSIZE(0), + .bMaxPacketSize0 = USBEndpointDescriptor_MAXCTRLSIZE_FS, .idVendor = BOARD_USB_VENDOR_ID, .idProduct = BOARD_DFU_USB_PRODUCT_ID, .bcdDevice = BOARD_USB_RELEASE, diff --git a/firmware/libboard/common/include/board_common.h b/firmware/libboard/common/include/board_common.h index 64bdf0f..a995d88 100644 --- a/firmware/libboard/common/include/board_common.h +++ b/firmware/libboard/common/include/board_common.h @@ -108,21 +108,6 @@ // D+ has external pull-up #define BOARD_USB_PULLUP_EXTERNAL -#define BOARD_USB_NUMENDPOINTS 8 - -// FIXME: in all other cases return 0? -#define BOARD_USB_ENDPOINTS_MAXPACKETSIZE(i) (((i == 4) || (i == 5))? 512 : 64) -#define BOARD_USB_ENDPOINTS_BANKS(i) (((i == 0) || (i == 3)) ? 1 : 2) - -#define USB_VENDOR_OPENMOKO 0x1d50 -#define USB_PRODUCT_OWHW_SAM3_DFU 0x4001 /* was 0x4000 */ -#define USB_PRODUCT_OWHW_SAM3 0x4001 -#define USB_PRODUCT_QMOD_HUB 0x4002 -#define USB_PRODUCT_QMOD_SAM3_DFU 0x4004 /* was 0x4003 */ -#define USB_PRODUCT_QMOD_SAM3 0x4004 -#define USB_PRODUCT_SIMTRACE2_DFU 0x60e3 /* was 0x60e2 */ -#define USB_PRODUCT_SIMTRACE2 0x60e3 - #define BOARD_USB_DFU #define BOARD_DFU_BOOT_SIZE (16 * 1024) #define BOARD_DFU_RAM_SIZE (2 * 1024) diff --git a/firmware/libboard/owhw/include/board.h b/firmware/libboard/owhw/include/board.h index c770749..def3d8b 100644 --- a/firmware/libboard/owhw/include/board.h +++ b/firmware/libboard/owhw/include/board.h @@ -1,5 +1,6 @@ #pragma once #include "board_common.h" +#include "simtrace_usb.h" /** Name of the board */ #define BOARD_NAME "OWHW" diff --git a/firmware/libboard/qmod/include/board.h b/firmware/libboard/qmod/include/board.h index b8af8d8..2db94ab 100644 --- a/firmware/libboard/qmod/include/board.h +++ b/firmware/libboard/qmod/include/board.h @@ -1,5 +1,6 @@ #pragma once #include "board_common.h" +#include "simtrace_usb.h" #define LED_USIM1 LED_GREEN #define LED_USIM2 LED_RED diff --git a/firmware/libboard/simtrace/include/board.h b/firmware/libboard/simtrace/include/board.h index 891ab33..b21d4fb 100644 --- a/firmware/libboard/simtrace/include/board.h +++ b/firmware/libboard/simtrace/include/board.h @@ -1,5 +1,6 @@ #pragma once #include "board_common.h" +#include "simtrace_usb.h" /* Name of the board */ #define BOARD_NAME "SAM3S-SIMTRACE" diff --git a/firmware/libcommon/include/simtrace.h b/firmware/libcommon/include/simtrace.h index cbf1948..3c414bc 100644 --- a/firmware/libcommon/include/simtrace.h +++ b/firmware/libcommon/include/simtrace.h @@ -5,21 +5,8 @@ #include "board.h" #include -/* Endpoint numbers */ -#define DATAOUT 1 -#define DATAIN 2 -#define INT 3 - #define BUFLEN 512 -#define PHONE_DATAOUT 4 -#define PHONE_DATAIN 5 -#define PHONE_INT 6 - -#define CARDEM_USIM2_DATAOUT DATAOUT -#define CARDEM_USIM2_DATAIN DATAIN -#define CARDEM_USIM2_INT INT - #define CLK_MASTER true #define CLK_SLAVE false diff --git a/firmware/libcommon/include/simtrace_usb.h b/firmware/libcommon/include/simtrace_usb.h new file mode 100644 index 0000000..969d890 --- /dev/null +++ b/firmware/libcommon/include/simtrace_usb.h @@ -0,0 +1,67 @@ +/* This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * (C) 2018 by sysmocom -s.f.m.c. GmbH, Author: Kevin Redon + * All Rights Reserved + */ + +/* SIMtrace USB IDs */ +#define USB_VENDOR_OPENMOKO 0x1d50 +#define USB_PRODUCT_OWHW_SAM3_DFU 0x4001 /* was 0x4000 */ +#define USB_PRODUCT_OWHW_SAM3 0x4001 +#define USB_PRODUCT_QMOD_HUB 0x4002 +#define USB_PRODUCT_QMOD_SAM3_DFU 0x4004 /* was 0x4003 */ +#define USB_PRODUCT_QMOD_SAM3 0x4004 +#define USB_PRODUCT_SIMTRACE2_DFU 0x60e3 /* was 0x60e2 */ +#define USB_PRODUCT_SIMTRACE2 0x60e3 + +/* USB proprietary class */ +#define USB_CLASS_PROPRIETARY 0xff + +/* SIMtrace USB sub-classes */ +/*! Sniffer USB sub-class */ +#define SIMTRACE_SNIFFER_USB_SUBCLASS 1 +/*! Card-emulation USB sub-class */ +#define SIMTRACE_CARDEM_USB_SUBCLASS 2 + +/* Generic USB endpoint numbers */ +/*! Card-side USB data out (host to device) endpoint number */ +#define SIMTRACE_USB_EP_CARD_DATAOUT 1 +/*! Card-side USB data in (device to host) endpoint number */ +#define SIMTRACE_USB_EP_CARD_DATAIN 2 +/*! Card-side USB interrupt endpoint number */ +#define SIMTRACE_USB_EP_CARD_INT 3 +/*! Phone-side USB data out (host to device) endpoint number */ +#define SIMTRACE_USB_EP_PHONE_DATAOUT 4 +/*! Phone-side USB data in (device to host) endpoint number */ +#define SIMTRACE_USB_EP_PHONE_DATAIN 5 +/*! Phone-side USB interrupt endpoint number */ +#define SIMTRACE_USB_EP_PHONE_INT 6 + +/* Card-emulation USB endpoint numbers */ +/*! USIM1 USB data out (host to device) endpoint number */ +#define SIMTRACE_CARDEM_USB_EP_USIM1_DATAOUT 4 +/*! USIM1 USB data in (device to host) endpoint number */ +#define SIMTRACE_CARDEM_USB_EP_USIM1_DATAIN 5 +/*! USIM1 USB interrupt endpoint number */ +#define SIMTRACE_CARDEM_USB_EP_USIM1_INT 6 +/*! USIM2 USB data out (host to device) endpoint number */ +#define SIMTRACE_CARDEM_USB_EP_USIM2_DATAOUT 1 +/*! USIM2 USB data in (device to host) endpoint number */ +#define SIMTRACE_CARDEM_USB_EP_USIM2_DATAIN 2 +/*! USIM2 USB interrupt endpoint number */ +#define SIMTRACE_CARDEM_USB_EP_USIM2_INT 3 + +/*! Maximum number of endpoints */ +#define BOARD_USB_NUMENDPOINTS 6 diff --git a/firmware/libcommon/source/mode_cardemu.c b/firmware/libcommon/source/mode_cardemu.c index 2d9af99..104691f 100644 --- a/firmware/libcommon/source/mode_cardemu.c +++ b/firmware/libcommon/source/mode_cardemu.c @@ -10,6 +10,7 @@ #include #include "llist_irqsafe.h" #include "usb_buf.h" +#include "simtrace_usb.h" #include "simtrace_prot.h" #include "sim_switch.h" @@ -53,9 +54,9 @@ .id = ID_USART1, .state = USART_RCV }, - .ep_out = PHONE_DATAOUT, - .ep_in = PHONE_DATAIN, - .ep_int = PHONE_INT, + .ep_out = SIMTRACE_CARDEM_USB_EP_USIM1_DATAOUT, + .ep_in = SIMTRACE_CARDEM_USB_EP_USIM1_DATAIN, + .ep_int = SIMTRACE_CARDEM_USB_EP_USIM1_INT, #ifdef PIN_SET_USIM1_PRES .pin_insert = PIN_SET_USIM1_PRES, #endif @@ -68,9 +69,9 @@ .id = ID_USART0, .state = USART_RCV }, - .ep_out = CARDEM_USIM2_DATAOUT, - .ep_in = CARDEM_USIM2_DATAIN, - .ep_int = CARDEM_USIM2_INT, + .ep_out = SIMTRACE_CARDEM_USB_EP_USIM2_DATAOUT, + .ep_in = SIMTRACE_CARDEM_USB_EP_USIM2_DATAIN, + .ep_int = SIMTRACE_CARDEM_USB_EP_USIM2_INT, #ifdef PIN_SET_USIM2_PRES .pin_insert = PIN_SET_USIM2_PRES, #endif @@ -398,7 +399,7 @@ PIO_ConfigureIt(&pin_usim1_vcc, usim1_vcc_irqhandler); PIO_EnableIt(&pin_usim1_vcc); #endif /* DETECT_VCC_BY_ADC */ - cardem_inst[0].ch = card_emu_init(0, 2, 0, PHONE_DATAIN, PHONE_INT); + cardem_inst[0].ch = card_emu_init(0, 2, 0, SIMTRACE_CARDEM_USB_EP_USIM1_DATAIN, SIMTRACE_CARDEM_USB_EP_USIM1_INT); sim_switch_use_physical(0, 1); #ifdef CARDEMU_SECOND_UART @@ -413,7 +414,7 @@ PIO_ConfigureIt(&pin_usim2_vcc, usim2_vcc_irqhandler); PIO_EnableIt(&pin_usim2_vcc); #endif /* DETECT_VCC_BY_ADC */ - cardem_inst[1].ch = card_emu_init(1, 0, 1, CARDEM_USIM2_DATAIN, CARDEM_USIM2_INT); + cardem_inst[1].ch = card_emu_init(1, 0, 1, SIMTRACE_CARDEM_USB_EP_USIM2_DATAIN, SIMTRACE_CARDEM_USB_EP_USIM2_INT); sim_switch_use_physical(1, 1); #endif /* CARDEMU_SECOND_UART */ diff --git a/firmware/libcommon/source/simtrace_iso7816.c b/firmware/libcommon/source/simtrace_iso7816.c index 466bd65..6c0d363 100644 --- a/firmware/libcommon/source/simtrace_iso7816.c +++ b/firmware/libcommon/source/simtrace_iso7816.c @@ -33,6 +33,7 @@ #include "board.h" #include "simtrace.h" +#include "simtrace_usb.h" #include "ringbuffer.h" #include "iso7816_fidi.h" @@ -67,7 +68,7 @@ } if ((ret = - USBD_Write(PHONE_INT, "R", 1, + USBD_Write(SIMTRACE_USB_EP_PHONE_INT, "R", 1, (TransferCallback) & Callback_PhoneRST_ISR, 0)) != USBD_STATUS_SUCCESS) { TRACE_ERROR("USB err status: %d (%s)\n", ret, __FUNCTION__); diff --git a/firmware/libcommon/source/usb.c b/firmware/libcommon/source/usb.c index d317435..e929a05 100644 --- a/firmware/libcommon/source/usb.c +++ b/firmware/libcommon/source/usb.c @@ -33,15 +33,13 @@ #include "board.h" #include "simtrace.h" +#include "simtrace_usb.h" #include "utils.h" #include #include #include -#define SIMTRACE_SUBCLASS_SNIFFER 1 -#define SIMTRACE_SUBCLASS_CARDEM 2 - /*------------------------------------------------------------------------------ * USB String descriptors *------------------------------------------------------------------------------*/ @@ -94,8 +92,8 @@ .bInterfaceNumber = 0, .bAlternateSetting = 0, .bNumEndpoints = 3, - .bInterfaceClass = 0xff, - .bInterfaceSubClass = SIMTRACE_SUBCLASS_SNIFFER, + .bInterfaceClass = USB_CLASS_PROPRIETARY, + .bInterfaceSubClass = SIMTRACE_SNIFFER_USB_SUBCLASS, .bInterfaceProtocol = 0, .iInterface = SNIFFER_CONF_STR, }, @@ -105,11 +103,9 @@ .bDescriptorType = USBGenericDescriptor_ENDPOINT, .bEndpointAddress = USBEndpointDescriptor_ADDRESS( USBEndpointDescriptor_OUT, - PHONE_DATAOUT), + SIMTRACE_USB_EP_CARD_DATAOUT), .bmAttributes = USBEndpointDescriptor_BULK, - .wMaxPacketSize = MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE( - PHONE_DATAOUT), - USBEndpointDescriptor_MAXBULKSIZE_FS), + .wMaxPacketSize = USBEndpointDescriptor_MAXBULKSIZE_FS, .bInterval = 0, }, /* Bulk-IN endpoint descriptor */ @@ -118,11 +114,9 @@ .bDescriptorType = USBGenericDescriptor_ENDPOINT, .bEndpointAddress = USBEndpointDescriptor_ADDRESS( USBEndpointDescriptor_IN, - PHONE_DATAIN), + SIMTRACE_USB_EP_CARD_DATAIN), .bmAttributes = USBEndpointDescriptor_BULK, - .wMaxPacketSize = MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE( - PHONE_DATAIN), - USBEndpointDescriptor_MAXBULKSIZE_FS), + .wMaxPacketSize = USBEndpointDescriptor_MAXBULKSIZE_FS, .bInterval = 0, }, // Notification endpoint descriptor @@ -131,11 +125,9 @@ .bDescriptorType = USBGenericDescriptor_ENDPOINT, .bEndpointAddress = USBEndpointDescriptor_ADDRESS( USBEndpointDescriptor_IN, - PHONE_INT), + SIMTRACE_USB_EP_CARD_INT), .bmAttributes = USBEndpointDescriptor_INTERRUPT, - .wMaxPacketSize = MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE( - PHONE_INT), - USBEndpointDescriptor_MAXINTERRUPTSIZE_FS), + .wMaxPacketSize = USBEndpointDescriptor_MAXINTERRUPTSIZE_FS, .bInterval = 0x10, }, DFURT_IF_DESCRIPTOR(1, 0), @@ -205,9 +197,7 @@ USBEndpointDescriptor_ADDRESS(USBEndpointDescriptor_OUT, CCID_EPT_DATA_OUT), .bmAttributes = USBEndpointDescriptor_BULK, - .wMaxPacketSize = MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE( - CCID_EPT_DATA_OUT), - USBEndpointDescriptor_MAXBULKSIZE_FS), + .wMaxPacketSize = USBEndpointDescriptor_MAXBULKSIZE_FS, .bInterval = 0x00, }, // Bulk-IN endpoint descriptor @@ -218,9 +208,7 @@ USBEndpointDescriptor_ADDRESS(USBEndpointDescriptor_IN, CCID_EPT_DATA_IN), .bmAttributes = USBEndpointDescriptor_BULK, - .wMaxPacketSize = MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE( - CCID_EPT_DATA_IN), - USBEndpointDescriptor_MAXBULKSIZE_FS), + .wMaxPacketSize = USBEndpointDescriptor_MAXBULKSIZE_FS), .bInterval = 0x00, }, // Notification endpoint descriptor @@ -231,9 +219,7 @@ USBEndpointDescriptor_ADDRESS(USBEndpointDescriptor_IN, CCID_EPT_NOTIFICATION), .bmAttributes = USBEndpointDescriptor_INTERRUPT, - .wMaxPacketSize = MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE( - CCID_EPT_NOTIFICATION), - USBEndpointDescriptor_MAXINTERRUPTSIZE_FS), + .wMaxPacketSize = USBEndpointDescriptor_MAXINTERRUPTSIZE_FS, .bInterval = 0x10, }, DFURT_IF_DESCRIPTOR(1, 0), @@ -282,8 +268,8 @@ .bInterfaceNumber = 0, .bAlternateSetting = 0, .bNumEndpoints = 3, - .bInterfaceClass = 0xff, - .bInterfaceSubClass = SIMTRACE_SUBCLASS_CARDEM, + .bInterfaceClass = USB_CLASS_PROPRIETARY, + .bInterfaceSubClass = SIMTRACE_CARDEM_USB_SUBCLASS, .bInterfaceProtocol = 0, .iInterface = CARDEM_USIM1_INTF_STR, }, @@ -293,10 +279,9 @@ .bDescriptorType = USBGenericDescriptor_ENDPOINT, .bEndpointAddress = USBEndpointDescriptor_ADDRESS( USBEndpointDescriptor_OUT, - PHONE_DATAOUT), + SIMTRACE_CARDEM_USB_EP_USIM1_DATAOUT), .bmAttributes = USBEndpointDescriptor_BULK, - .wMaxPacketSize = MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE(PHONE_DATAOUT), - USBEndpointDescriptor_MAXBULKSIZE_FS), + .wMaxPacketSize = USBEndpointDescriptor_MAXBULKSIZE_FS, .bInterval = 0 /* Must be 0 for full-speed bulk endpoints */ }, /* Bulk-IN endpoint descriptor */ @@ -305,10 +290,9 @@ .bDescriptorType = USBGenericDescriptor_ENDPOINT, .bEndpointAddress = USBEndpointDescriptor_ADDRESS( USBEndpointDescriptor_IN, - PHONE_DATAIN), + SIMTRACE_CARDEM_USB_EP_USIM1_DATAIN), .bmAttributes = USBEndpointDescriptor_BULK, - .wMaxPacketSize = MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE(PHONE_DATAIN), - USBEndpointDescriptor_MAXBULKSIZE_FS), + .wMaxPacketSize = USBEndpointDescriptor_MAXBULKSIZE_FS, .bInterval = 0 /* Must be 0 for full-speed bulk endpoints */ }, /* Notification endpoint descriptor */ @@ -317,10 +301,9 @@ .bDescriptorType = USBGenericDescriptor_ENDPOINT, .bEndpointAddress = USBEndpointDescriptor_ADDRESS( USBEndpointDescriptor_IN, - PHONE_INT), + SIMTRACE_CARDEM_USB_EP_USIM1_INT), .bmAttributes = USBEndpointDescriptor_INTERRUPT, - .wMaxPacketSize = MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE(PHONE_INT), - USBEndpointDescriptor_MAXINTERRUPTSIZE_FS), + .wMaxPacketSize = USBEndpointDescriptor_MAXINTERRUPTSIZE_FS, .bInterval = 0x10 }, #ifdef CARDEMU_SECOND_UART @@ -331,8 +314,8 @@ .bInterfaceNumber = 1, .bAlternateSetting = 0, .bNumEndpoints = 3, - .bInterfaceClass = 0xff, - .bInterfaceSubClass = SIMTRACE_SUBCLASS_CARDEM, + .bInterfaceClass = USB_CLASS_PROPRIETARY, + .bInterfaceSubClass = SIMTRACE_CARDEM_USB_SUBCLASS, .bInterfaceProtocol = 0, .iInterface = CARDEM_USIM2_INTF_STR, }, @@ -342,10 +325,9 @@ .bDescriptorType = USBGenericDescriptor_ENDPOINT, .bEndpointAddress = USBEndpointDescriptor_ADDRESS( USBEndpointDescriptor_OUT, - CARDEM_USIM2_DATAOUT), + SIMTRACE_CARDEM_USB_EP_USIM2_DATAOUT), .bmAttributes = USBEndpointDescriptor_BULK, - .wMaxPacketSize = MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE(CARDEM_USIM2_DATAOUT), - USBEndpointDescriptor_MAXBULKSIZE_FS), + .wMaxPacketSize = USBEndpointDescriptor_MAXBULKSIZE_FS, .bInterval = 0 /* Must be 0 for full-speed bulk endpoints */ } , @@ -355,10 +337,9 @@ .bDescriptorType = USBGenericDescriptor_ENDPOINT, .bEndpointAddress = USBEndpointDescriptor_ADDRESS( USBEndpointDescriptor_IN, - CARDEM_USIM2_DATAIN), + SIMTRACE_CARDEM_USB_EP_USIM2_DATAIN), .bmAttributes = USBEndpointDescriptor_BULK, - .wMaxPacketSize = MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE(CARDEM_USIM2_DATAIN), - USBEndpointDescriptor_MAXBULKSIZE_FS), + .wMaxPacketSize = USBEndpointDescriptor_MAXBULKSIZE_FS, .bInterval = 0 /* Must be 0 for full-speed bulk endpoints */ }, /* Notification endpoint descriptor */ @@ -367,10 +348,9 @@ .bDescriptorType = USBGenericDescriptor_ENDPOINT, .bEndpointAddress = USBEndpointDescriptor_ADDRESS( USBEndpointDescriptor_IN, - CARDEM_USIM2_INT), + SIMTRACE_CARDEM_USB_EP_USIM2_INT), .bmAttributes = USBEndpointDescriptor_INTERRUPT, - .wMaxPacketSize = MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE(CARDEM_USIM2_INT), - USBEndpointDescriptor_MAXINTERRUPTSIZE_FS), + .wMaxPacketSize = USBEndpointDescriptor_MAXINTERRUPTSIZE_FS, .bInterval = 0x10, }, DFURT_IF_DESCRIPTOR(2, 0), @@ -466,9 +446,7 @@ USBEndpointDescriptor_ADDRESS(USBEndpointDescriptor_OUT, CCID_EPT_DATA_OUT), .bmAttributes = USBEndpointDescriptor_BULK, - .wMaxPacketSize = MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE( - CCID_EPT_DATA_OUT), - USBEndpointDescriptor_MAXBULKSIZE_FS), + .wMaxPacketSize = USBEndpointDescriptor_MAXBULKSIZE_FS, .bInterval = 0x00, }, // Bulk-IN endpoint descriptor @@ -479,9 +457,7 @@ USBEndpointDescriptor_ADDRESS(USBEndpointDescriptor_IN, CCID_EPT_DATA_IN), .bmAttributes = USBEndpointDescriptor_BULK, - .wMaxPacketSize = MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE( - CCID_EPT_DATA_IN), - USBEndpointDescriptor_MAXBULKSIZE_FS), + .wMaxPacketSize = USBEndpointDescriptor_MAXBULKSIZE_FS, .bInterval = 0x00, }, // Notification endpoint descriptor @@ -492,9 +468,7 @@ USBEndpointDescriptor_ADDRESS(USBEndpointDescriptor_IN, CCID_EPT_NOTIFICATION), .bmAttributes = USBEndpointDescriptor_INTERRUPT, - .wMaxPacketSize = MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE( - CCID_EPT_NOTIFICATION), - USBEndpointDescriptor_MAXINTERRUPTSIZE_FS), + .wMaxPacketSize = USBEndpointDescriptor_MAXINTERRUPTSIZE_FS, .bInterval = 0x10, }, @@ -516,10 +490,9 @@ .bDescriptorType = USBGenericDescriptor_ENDPOINT, .bEndpointAddress = USBEndpointDescriptor_ADDRESS( USBEndpointDescriptor_OUT, - PHONE_DATAOUT), + SIMTRACE_USB_EP_PHONE_DATAOUT), .bmAttributes = USBEndpointDescriptor_BULK, - .wMaxPacketSize = MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE(PHONE_DATAOUT), - USBEndpointDescriptor_MAXBULKSIZE_FS), + .wMaxPacketSize = USBEndpointDescriptor_MAXBULKSIZE_FS, .bInterval = 0, /* Must be 0 for full-speed bulk endpoints */ }, /* Bulk-IN endpoint descriptor */ @@ -528,10 +501,9 @@ .bDescriptorType = USBGenericDescriptor_ENDPOINT, .bEndpointAddress = USBEndpointDescriptor_ADDRESS( USBEndpointDescriptor_IN, - PHONE_DATAIN), + SIMTRACE_USB_EP_PHONE_DATAIN), .bmAttributes = USBEndpointDescriptor_BULK, - .wMaxPacketSize = MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE(PHONE_DATAIN), - USBEndpointDescriptor_MAXBULKSIZE_FS), + .wMaxPacketSize = USBEndpointDescriptor_MAXBULKSIZE_FS, .bInterval = 0, /* Must be 0 for full-speed bulk endpoints */ }, /* Notification endpoint descriptor */ @@ -540,10 +512,9 @@ .bDescriptorType = USBGenericDescriptor_ENDPOINT, .bEndpointAddress = USBEndpointDescriptor_ADDRESS( USBEndpointDescriptor_IN, - PHONE_INT), + SIMTRACE_USB_EP_PHONE_INT), .bmAttributes = USBEndpointDescriptor_INTERRUPT, - .wMaxPacketSize = MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE(PHONE_INT), - USBEndpointDescriptor_MAXINTERRUPTSIZE_FS), + .wMaxPacketSize = USBEndpointDescriptor_MAXINTERRUPTSIZE_FS, .bInterval = 0x10 }, DFURT_IF_DESCRIPTOR(2, 0), @@ -573,7 +544,7 @@ .bDeviceClass = 0, .bDeviceSubClass = 0, .bDeviceProtocol = 0, - .bMaxPacketSize0 = BOARD_USB_ENDPOINTS_MAXPACKETSIZE(0), + .bMaxPacketSize0 = 64, .idVendor = BOARD_USB_VENDOR_ID, .idProduct = BOARD_USB_PRODUCT_ID, .bcdDevice = 2, /* Release number */ diff --git a/firmware/libcommon/source/usb_buf.c b/firmware/libcommon/source/usb_buf.c index 848fd24..b8d4dd7 100644 --- a/firmware/libcommon/source/usb_buf.c +++ b/firmware/libcommon/source/usb_buf.c @@ -1,6 +1,7 @@ #include "board.h" #include "trace.h" #include "usb_buf.h" +#include "simtrace_usb.h" #include #include -- To view, visit https://gerrit.osmocom.org/9869 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iba81f32a92c68a973e8e7adbc4c2a1064ba5290f Gerrit-Change-Number: 9869 Gerrit-PatchSet: 7 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:44:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 15:44:15 +0000 Subject: Change in simtrace2[master]: host usb_util fix: used provided class, sub-class, and interfave when... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9870 ) Change subject: host usb_util fix: used provided class, sub-class, and interfave when finding matching interfaces ...................................................................... host usb_util fix: used provided class, sub-class, and interfave when finding matching interfaces Change-Id: Ibc06e751e6ca0f9e9a40d82c4eeddfb975240f91 --- M host/libusb_util.c 1 file changed, 4 insertions(+), 4 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/host/libusb_util.c b/host/libusb_util.c index 3236e41..5ee685e 100644 --- a/host/libusb_util.c +++ b/host/libusb_util.c @@ -130,11 +130,11 @@ for (k = 0; k < intf->num_altsetting; k++) { const struct libusb_interface_descriptor *if_desc; if_desc = &intf->altsetting[k]; - if (class > 0 && if_desc->bInterfaceClass != class) + if (class >= 0 && if_desc->bInterfaceClass != class) continue; - if (sub_class > 0 && if_desc->bInterfaceSubClass != sub_class) + if (sub_class >= 0 && if_desc->bInterfaceSubClass != sub_class) continue; - if (protocol > 0 && if_desc->bInterfaceProtocol != protocol) + if (protocol >= 0 && if_desc->bInterfaceProtocol != protocol) continue; /* MATCH! */ out[out_idx].usb_dev = dev; @@ -197,7 +197,7 @@ dev_desc.idVendor, dev_desc.idProduct, addr); #endif - rc = dev_find_matching_interfaces(*dev, 255, 2, -1, out_cur, out_len_remain); + rc = dev_find_matching_interfaces(*dev, class, sub_class, protocol, out_cur, out_len_remain); if (rc < 0) continue; out_cur += rc; -- To view, visit https://gerrit.osmocom.org/9870 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ibc06e751e6ca0f9e9a40d82c4eeddfb975240f91 Gerrit-Change-Number: 9870 Gerrit-PatchSet: 7 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:44:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 15:44:16 +0000 Subject: Change in simtrace2[master]: host USB: use central SIMtrace USB ID definition header In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9871 ) Change subject: host USB: use central SIMtrace USB ID definition header ...................................................................... host USB: use central SIMtrace USB ID definition header Change-Id: Id18e64fba0a2c308a8aef7d3865200bf0237cae9 --- M host/simtrace2_usb.c A host/simtrace_usb.h 2 files changed, 5 insertions(+), 12 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/host/simtrace2_usb.c b/host/simtrace2_usb.c index 6cbb8b7..2016670 100644 --- a/host/simtrace2_usb.c +++ b/host/simtrace2_usb.c @@ -6,15 +6,7 @@ #include #include "libusb_util.h" - -#define USB_VENDOR_OPENMOKO 0x1d50 -#define USB_PRODUCT_OWHW_SAM3_DFU 0x4000 -#define USB_PRODUCT_OWHW_SAM3 0x4001 -#define USB_PRODUCT_QMOD_HUB 0x4002 -#define USB_PRODUCT_QMOD_SAM3_DFU 0x4003 -#define USB_PRODUCT_QMOD_SAM3 0x4004 -#define USB_PRODUCT_SIMTRACE2_DFU 0x60e2 -#define USB_PRODUCT_SIMTRACE2 0x60e3 +#include "simtrace_usb.h" static const struct dev_id compatible_dev_ids[] = { { USB_VENDOR_OPENMOKO, USB_PRODUCT_OWHW_SAM3 }, @@ -23,15 +15,15 @@ { 0, 0 } }; -//libusb_get_string_descriptor_ascii(hdl, idx, *data, len) - static int find_devices(void) { struct usb_interface_match ifm[16]; int rc, i, num_interfaces; + /* scan for USB devices matching SIMtrace USB ID with proprietary class */ rc = usb_match_interfaces(NULL, compatible_dev_ids, - 255, 2, -1, ifm, ARRAY_SIZE(ifm)); + USB_CLASS_PROPRIETARY, -1, -1, ifm, ARRAY_SIZE(ifm)); + printf("USB matches: %d\n", rc); if (rc < 0) return rc; num_interfaces = rc; diff --git a/host/simtrace_usb.h b/host/simtrace_usb.h new file mode 120000 index 0000000..f1e0982 --- /dev/null +++ b/host/simtrace_usb.h @@ -0,0 +1 @@ +../firmware/libcommon/include/simtrace_usb.h \ No newline at end of file -- To view, visit https://gerrit.osmocom.org/9871 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Id18e64fba0a2c308a8aef7d3865200bf0237cae9 Gerrit-Change-Number: 9871 Gerrit-PatchSet: 7 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:44:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 15:44:17 +0000 Subject: Change in simtrace2[master]: USB device: add USB message structure for sniffer communication In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9872 ) Change subject: USB device: add USB message structure for sniffer communication ...................................................................... USB device: add USB message structure for sniffer communication Change-Id: Id2c6f32ade2fec9b9ef91bd8c5e1fd195f2d7351 --- M firmware/libcommon/include/simtrace_prot.h 1 file changed, 52 insertions(+), 12 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libcommon/include/simtrace_prot.h b/firmware/libcommon/include/simtrace_prot.h index 189264d..a43ac72 100644 --- a/firmware/libcommon/include/simtrace_prot.h +++ b/firmware/libcommon/include/simtrace_prot.h @@ -1,7 +1,3 @@ -#pragma once - -#include - /* SIMtrace2 USB protocol */ /* (C) 2015-2017 by Harald Welte @@ -21,6 +17,10 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ +#pragma once + +#include +#include /*********************************************************************** * COMMON HEADER @@ -32,8 +32,8 @@ SIMTRACE_MSGC_CARDEM, /* Modem Control (if modem is attached next to device) */ SIMTRACE_MSGC_MODEM, - /* SIM protocol tracing */ - SIMTRACE_MSGC_TRACE, + /* Reader/phone-car/SIM communication sniff */ + SIMTRACE_MSGC_SNIFF, /* first vendor-specific request */ _SIMTRACE_MGSC_VENDOR_FIRST = 127, @@ -74,10 +74,18 @@ SIMTRACE_MSGT_BD_MODEM_STATUS, }; -/* SIMTRACE_MSGC_TRACE */ -enum simtrace_msg_type_trace { - /* FIXME */ - _dummy, +/* SIMTRACE_MSGC_SNIFF */ +enum simtrace_msg_type_sniff { + /* Status change (card inserted, reset, ...) */ + SIMTRACE_MSGT_SNIFF_CHANGE = 0, + /* Fi/Di baudrate change */ + SIMTRACE_MSGT_SNIFF_FIDI, + /* ATR data */ + SIMTRACE_MSGT_SNIFF_ATR, + /* PPS (request or response) data */ + SIMTRACE_MSGT_SNIFF_PPS, + /* TPDU data */ + SIMTRACE_MSGT_SNIFF_TPDU, }; /* common message header */ @@ -92,7 +100,7 @@ } __attribute__ ((packed)); /*********************************************************************** - * CARD EMULATOR / FORWARDER + * Capabilities ***********************************************************************/ /* generic capabilities */ @@ -137,7 +145,6 @@ SIMTRACE_CAP_SYSMO_QMOD_RESET_HUB, }; - /* SIMTRACE_CMD_BD_BOARD_INFO */ struct simtrace_board_info { struct { @@ -276,3 +283,36 @@ /* bit-field of changed status bits */ uint8_t changed_mask; } __attribute__((packed)); + +/*********************************************************************** + * SNIFF + ***********************************************************************/ + +/* SIMTRACE_MSGT_SNIFF_CHANGE flags */ +#define SNIFF_CHANGE_FLAG_CARD_INSERT (1<<0) +#define SNIFF_CHANGE_FLAG_CARD_EJECT (1<<1) +#define SNIFF_CHANGE_FLAG_RESET_HOLD (1<<2) +#define SNIFF_CHANGE_FLAG_RESET_RELEASE (1<<3) +#define SNIFF_CHANGE_FLAG_TIMEOUT_WT (1<<4) + +/* SIMTRACE_MSGT_SNIFF_CHANGE */ +struct sniff_change { + /* SIMTRACE_MSGT_SNIFF_CHANGE flags */ + uint32_t flags; +} __attribute__ ((packed)); + +/* SIMTRACE_MSGT_SNIFF_FIDI */ +struct sniff_fidi { + /* Fi/Di values as encoded in TA1 */ + uint8_t fidi; +} __attribute__ ((packed)); + +/* SIMTRACE_MSGT_SNIFF_ATR, SIMTRACE_MSGT_SNIFF_PPS, SIMTRACE_MSGT_SNIFF_TPDU */ +struct sniff_data { + /* if the data is complete (an error might have occurred during transmission */ + bool complete; + /* data length */ + uint16_t length; + /* data */ + uint8_t data[0]; +} __attribute__ ((packed)); -- To view, visit https://gerrit.osmocom.org/9872 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Id2c6f32ade2fec9b9ef91bd8c5e1fd195f2d7351 Gerrit-Change-Number: 9872 Gerrit-PatchSet: 7 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:44:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 15:44:18 +0000 Subject: Change in simtrace2[master]: sniffer USB: implement USB communication and send parsed messages In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9873 ) Change subject: sniffer USB: implement USB communication and send parsed messages ...................................................................... sniffer USB: implement USB communication and send parsed messages Change-Id: Ice7817480705f2124b08c1ff9a8826558b6d8b2b --- M firmware/libcommon/source/sniffer.c 1 file changed, 223 insertions(+), 62 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 8a94c8a..27f102d 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -34,6 +34,13 @@ #include #include "utils.h" #include "iso7816_fidi.h" +/* USB related libraries */ +#include "osmocom/core/linuxlist.h" +#include "osmocom/core/msgb.h" +#include "llist_irqsafe.h" +#include "usb_buf.h" +#include "simtrace_usb.h" +#include "simtrace_prot.h" /*------------------------------------------------------------------------------ * Internal definitions @@ -133,6 +140,9 @@ /*! Ring buffer to store sniffer communication data */ static struct ringbuf sniff_buffer; +/* Flags to know is the card status changed (see SIMTRACE_MSGT_DT_SNIFF_CHANGE flags) */ +volatile uint32_t change_flags = 0; + /* ISO 7816 variables */ /*! ISO 7816-3 state */ enum iso7816_3_sniff_state iso_state = ISO7816_S_RESET; @@ -178,6 +188,59 @@ */ static const uint8_t convention_convert_lut[256] = { 0xff, 0x7f, 0xbf, 0x3f, 0xdf, 0x5f, 0x9f, 0x1f, 0xef, 0x6f, 0xaf, 0x2f, 0xcf, 0x4f, 0x8f, 0x0f, 0xf7, 0x77, 0xb7, 0x37, 0xd7, 0x57, 0x97, 0x17, 0xe7, 0x67, 0xa7, 0x27, 0xc7, 0x47, 0x87, 0x07, 0xfb, 0x7b, 0xbb, 0x3b, 0xdb, 0x5b, 0x9b, 0x1b, 0xeb, 0x6b, 0xab, 0x2b, 0xcb, 0x4b, 0x8b, 0x0b, 0xf3, 0x73, 0xb3, 0x33, 0xd3, 0x53, 0x93, 0x13, 0xe3, 0x63, 0xa3, 0x23, 0xc3, 0x43, 0x83, 0x03, 0xfd, 0x7d, 0xbd, 0x3d, 0xdd, 0x5d, 0x9d, 0x1d, 0xed, 0x6d, 0xad, 0x2d, 0xcd, 0x4d, 0x8d, 0x0d, 0xf5, 0x75, 0xb5, 0x35, 0xd5, 0x55, 0x95, 0x15, 0xe5, 0x65, 0xa5, 0x25, 0xc5, 0x45, 0x85, 0x05, 0xf9, 0x79, 0xb9, 0x39, 0xd9, 0x59, 0x99, 0x19, 0xe9, 0x69, 0xa9, 0x29, 0xc9, 0x49, 0x89, 0x09, 0xf1, 0x71, 0xb1, 0x31, 0xd1, 0x51, 0x91, 0x11, 0xe1, 0x61, 0xa1, 0x21, 0xc1, 0x41, 0x81, 0x01, 0xfe, 0x7e, 0xbe, 0x3e, 0xde, 0x5e, 0x9e, 0x1e, 0xee, 0x6e, 0xae, 0x2e, 0xce, 0x4e, 0x8e, 0x0e, 0xf6, 0x76, 0xb6, 0x36, 0xd6, 0x56, 0x96, 0x16, 0xe6, 0x66, 0xa6, 0x26, 0xc6, 0x46, 0x86, 0x06, 0xfa, 0x7a, 0xba, 0x3a, 0xda, 0x5a, 0x9a, 0x1a, 0xea, 0x6a, 0xaa, 0x2a, 0xca, 0x4a, 0x8a, 0x0a, 0xf2, 0x72, 0xb2, 0x32, 0xd2, 0x52, 0x92, 0x12, 0xe2, 0x62, 0xa2, 0x22, 0xc2, 0x42, 0x82, 0x02, 0xfc, 0x7c, 0xbc, 0x3c, 0xdc, 0x5c, 0x9c, 0x1c, 0xec, 0x6c, 0xac, 0x2c, 0xcc, 0x4c, 0x8c, 0x0c, 0xf4, 0x74, 0xb4, 0x34, 0xd4, 0x54, 0x94, 0x14, 0xe4, 0x64, 0xa4, 0x24, 0xc4, 0x44, 0x84, 0x04, 0xf8, 0x78, 0xb8, 0x38, 0xd8, 0x58, 0x98, 0x18, 0xe8, 0x68, 0xa8, 0x28, 0xc8, 0x48, 0x88, 0x08, 0xf0, 0x70, 0xb0, 0x30, 0xd0, 0x50, 0x90, 0x10, 0xe0, 0x60, 0xa0, 0x20, 0xc0, 0x40, 0x80, 0x00, }; +/*! Allocate USB buffer and push + initialize simtrace_msg_hdr + * @param[in] ep USB IN endpoint where the message will be sent to + * @param[in] msg_class SIMtrace USB message class + * @param[in] msg_type SIMtrace USB message type + * @return USB message with allocated ans initialized header, or NULL if allocation failed + */ +static struct msgb *usb_msg_alloc_hdr(uint8_t ep, uint8_t msg_class, uint8_t msg_type) +{ + struct msgb *usb_msg = usb_buf_alloc(SIMTRACE_USB_EP_CARD_DATAIN); + if (!usb_msg) { + return NULL; + } + struct simtrace_msg_hdr *usb_msg_header; + usb_msg->l1h = msgb_put(usb_msg, sizeof(*usb_msg_header)); + usb_msg_header = (struct simtrace_msg_hdr *) usb_msg->l1h; + memset(usb_msg_header, 0, sizeof(*usb_msg_header)); + usb_msg_header->msg_class = SIMTRACE_MSGC_SNIFF; + usb_msg_header->msg_type = SIMTRACE_MSGT_SNIFF_CHANGE; + usb_msg->l2h = usb_msg->l1h + sizeof(*usb_msg_header); + + return usb_msg; +} + +/* update SIMtrace header msg_len and submit USB buffer + * param[in] usb_msg USB message to update and send + */ +void usb_msg_upd_len_and_submit(struct msgb *usb_msg) +{ + struct simtrace_msg_hdr *usb_msg_header = (struct simtrace_msg_hdr *) usb_msg->l1h; + usb_msg_header->msg_len = msgb_length(usb_msg); + usb_buf_submit(usb_msg); +} + +/*! Send card change flags over USB + * @param[in] flags change flags corresponding to SIMTRACE_MSGT_SNIFF_CHANGE + */ +static void usb_send_change(uint32_t flags) +{ + /* Check flags */ + if(0==flags) { /* no changes */ + return; + } + + /* Send message over USB */ + struct msgb *usb_msg = usb_msg_alloc_hdr(SIMTRACE_USB_EP_CARD_DATAIN, SIMTRACE_MSGC_SNIFF, SIMTRACE_MSGT_SNIFF_CHANGE); + if (!usb_msg) { + return; + } + struct sniff_change *usb_sniff_change = (struct sniff_change *) msgb_put(usb_msg, sizeof(*usb_sniff_change)); + usb_sniff_change->flags = flags; + usb_msg_upd_len_and_submit(usb_msg); +} + /*! Update the ISO 7816-3 state * @param[in] iso_state_new new ISO 7816-3 state to update to */ @@ -193,9 +256,11 @@ switch (iso_state_new) { case ISO7816_S_RESET: update_fidi(&sniff_usart, 0x11); /* reset baud rate to default Di/Fi values */ + usb_send_change(SNIFF_CHANGE_FLAG_RESET_HOLD); /* send reset change to host software over USB */ break; case ISO7816_S_WAIT_ATR: rbuf_reset(&sniff_buffer); /* reset buffer for new communication */ + usb_send_change(SNIFF_CHANGE_FLAG_RESET_RELEASE); /* send reset change to host software over USB */ break; case ISO7816_S_IN_ATR: atr_i = 0; @@ -220,21 +285,43 @@ //TRACE_INFO("Changed to ISO 7816-3 state %u\n\r", iso_state); /* don't print since this is function is also called by ISRs */ } -/*! Print current ATR */ -static void print_atr(void) +/*! Send current ATR over USB + * @note Also print the ATR over serial + */ +static void usb_send_atr(void) { + /* Check state */ if (ISO7816_S_IN_ATR!=iso_state) { TRACE_WARNING("Can't print ATR in ISO 7816-3 state %u\n\r", iso_state); return; } + if (atr_i>=ARRAY_SIZE(atr)) { + TRACE_ERROR("ATR buffer overflow\n\r"); + return; + } + /* Show activity on LED */ led_blink(LED_GREEN, BLINK_2O_F); + + /* Print ATR */ printf("ATR: "); uint8_t i; - for (i = 0; i < atr_i && i < ARRAY_SIZE(atr); i++) { + for (i = 0; i < atr_i; i++) { printf("%02x ", atr[i]); } printf("\n\r"); + + /* Send ATR over USB */ + struct msgb *usb_msg = usb_msg_alloc_hdr(SIMTRACE_USB_EP_CARD_DATAIN, SIMTRACE_MSGC_SNIFF, SIMTRACE_MSGT_SNIFF_ATR); + if (!usb_msg) { + return; + } + struct sniff_data *usb_sniff_data_atr = (struct sniff_data *) msgb_put(usb_msg, sizeof(*usb_sniff_data_atr)); + usb_sniff_data_atr->complete = true; + usb_sniff_data_atr->length = atr_i; + uint8_t *data = msgb_put(usb_msg, usb_sniff_data_atr->length); + memcpy(data, atr, atr_i); + usb_msg_upd_len_and_submit(usb_msg); } /*! Process ATR byte @@ -318,7 +405,7 @@ } case ATR_S_WAIT_TCK: /* see ISO/IEC 7816-3:2006 section 8.2.5 */ /* we could verify the checksum, but we are just here to sniff */ - print_atr(); /* print ATR for info */ + usb_send_atr(); /* send ATR to host software using USB */ change_state(ISO7816_S_WAIT_TPDU); /* go to next state */ break; default: @@ -326,12 +413,14 @@ } } -/*! Print current PPS */ -static void print_pps(void) +/*! Send current PPS over USB + * @note Also print the PPS over serial + */ +static void usb_send_pps(void) { uint8_t *pps_cur; /* current PPS (request or response) */ - /* sanity check */ + /* Sanity check */ if (ISO7816_S_IN_PPS_REQ==iso_state) { pps_cur = pps_req; } else if (ISO7816_S_IN_PPS_RSP==iso_state) { @@ -341,21 +430,59 @@ return; } - led_blink(LED_GREEN, BLINK_2O_F); - printf("PPS %s : ", ISO7816_S_IN_PPS_REQ==iso_state ? "REQUEST" : "RESPONSE"); - printf("%02x ", pps_cur[0]); - printf("%02x ", pps_cur[1]); + /* Get only relevant data */ + uint8_t pps[6]; + uint8_t pps_i = 0; + pps[pps_i++] = pps_cur[0]; + pps[pps_i++] = pps_cur[1]; if (pps_cur[1]&0x10) { - printf("%02x ", pps_cur[2]); + pps[pps_i++] = pps_cur[2]; } if (pps_cur[1]&0x20) { - printf("%02x ", pps_cur[3]); + pps[pps_i++] = pps_cur[3]; } if (pps_cur[1]&0x40) { - printf("%02x ", pps_cur[4]); + pps[pps_i++] = pps_cur[4]; } - printf("%02x ", pps_cur[5]); + pps[pps_i++] = pps_cur[5]; + + /* Show activity on LED */ + led_blink(LED_GREEN, BLINK_2O_F); + + /* Print PPS */ + printf("PPS: "); + uint8_t i; + for (i = 0; i < pps_i; i++) { + printf("%02x ", pps[i]); + } printf("\n\r"); + + /* Send message over USB */ + struct msgb *usb_msg = usb_msg_alloc_hdr(SIMTRACE_USB_EP_CARD_DATAIN, SIMTRACE_MSGC_SNIFF, SIMTRACE_MSGT_SNIFF_PPS); + if (!usb_msg) { + return; + } + struct sniff_data *usb_sniff_data_pps = (struct sniff_data *) msgb_put(usb_msg, sizeof(*usb_sniff_data_pps)); + usb_sniff_data_pps->complete = true; + usb_sniff_data_pps->length = pps_i; + uint8_t *data = msgb_put(usb_msg, usb_sniff_data_pps->length); + memcpy(data, pps, pps_i); + usb_msg_upd_len_and_submit(usb_msg); +} + +/*! Send Fi/Di change over USB + * @param[in] fidi Fi/Di factor as encoded in TA1 + */ +static void usb_send_fidi(uint8_t fidi) +{ + /* Send message over USB */ + struct msgb *usb_msg = usb_msg_alloc_hdr(SIMTRACE_USB_EP_CARD_DATAIN, SIMTRACE_MSGC_SNIFF, SIMTRACE_MSGT_SNIFF_FIDI); + if (!usb_msg) { + return; + } + struct sniff_fidi *usb_sniff_fidi = (struct sniff_fidi *) msgb_put(usb_msg, sizeof(*usb_sniff_fidi)); + usb_sniff_fidi->fidi = fidi; + usb_msg_upd_len_and_submit(usb_msg); } static void process_byte_pps(uint8_t byte) @@ -421,7 +548,7 @@ check ^= pps_cur[4]; } check ^= pps_cur[5]; - print_pps(); /* print PPS for info */ + usb_send_pps(); /* send PPS to host software using USB */ if (ISO7816_S_IN_PPS_REQ==iso_state) { if (0==check) { /* checksum is valid */ change_state(ISO7816_S_WAIT_PPS_RSP); /* go to next state */ @@ -440,6 +567,7 @@ } TRACE_INFO("PPS negotiation successful: Fn=%u Dn=%u\n\r", fn, dn); update_fidi(&sniff_usart, pps_cur[2]); + usb_send_fidi(pps_cur[2]); /* send Fi/Di change notification to host software over USB */ } else { /* checksum is invalid */ TRACE_INFO("PPS negotiation failed\n\r"); } @@ -451,21 +579,39 @@ } } -/*! Print current TPDU */ -static void print_tpdu(void) +/*! Send current TPDU over USB + * @note Also print the TPDU over serial + */ +static void usb_send_tpdu(void) { + /* Check state */ if (ISO7816_S_IN_TPDU!=iso_state) { TRACE_WARNING("Can't print TPDU in ISO 7816-3 state %u\n\r", iso_state); return; } + /* Show activity on LED */ led_blink(LED_GREEN, BLINK_2O_F); + + /* Print TPDU */ printf("TPDU: "); uint16_t i; for (i = 0; i < tpdu_packet_i && i < ARRAY_SIZE(tpdu_packet); i++) { printf("%02x ", tpdu_packet[i]); } printf("\n\r"); + + /* Send ATR over USB */ + struct msgb *usb_msg = usb_msg_alloc_hdr(SIMTRACE_USB_EP_CARD_DATAIN, SIMTRACE_MSGC_SNIFF, SIMTRACE_MSGT_SNIFF_TPDU); + if (!usb_msg) { + return; + } + struct sniff_data *usb_sniff_data_tpdu = (struct sniff_data *) msgb_put(usb_msg, sizeof(*usb_sniff_data_tpdu)); + usb_sniff_data_tpdu->complete = true; + usb_sniff_data_tpdu->length = tpdu_packet_i; + uint8_t *data = msgb_put(usb_msg, usb_sniff_data_tpdu->length); + memcpy(data, tpdu_packet, tpdu_packet_i); + usb_msg_upd_len_and_submit(usb_msg); } static void process_byte_tpdu(uint8_t byte) @@ -531,7 +677,7 @@ break; case TPDU_S_SW2: tpdu_packet[tpdu_packet_i++] = byte; - print_tpdu(); /* print TPDU for info */ + usb_send_tpdu(); /* send TPDU to host software using USB */ change_state(ISO7816_S_WAIT_TPDU); /* this is the end of the TPDU */ break; case TPDU_S_DATA_SINGLE: @@ -555,47 +701,6 @@ } } -static void check_sniffed_data(void) -{ - /* Handle sniffed data */ - while (!rbuf_is_empty(&sniff_buffer)) { - uint8_t byte = rbuf_read(&sniff_buffer); - TRACE_WARNING_WP("< 0x%02x\n\r", byte); - switch (iso_state) { /* Handle byte depending on state */ - case ISO7816_S_RESET: /* During reset we shouldn't receive any data */ - break; - case ISO7816_S_WAIT_ATR: /* After a reset we expect the ATR */ - change_state(ISO7816_S_IN_ATR); /* go to next state */ - case ISO7816_S_IN_ATR: /* More ATR data incoming */ - process_byte_atr(byte); - break; - case ISO7816_S_WAIT_TPDU: /* After the ATR we expect TPDU or PPS data */ - case ISO7816_S_WAIT_PPS_RSP: - if (byte == 0xff) { - if (ISO7816_S_WAIT_PPS_RSP==iso_state) { - change_state(ISO7816_S_IN_PPS_RSP); /* Go to PPS state */ - } else { - change_state(ISO7816_S_IN_PPS_REQ); /* Go to PPS state */ - } - process_byte_pps(byte); - break; - } - case ISO7816_S_IN_TPDU: /* More TPDU data incoming */ - if (ISO7816_S_WAIT_TPDU==iso_state) { - change_state(ISO7816_S_IN_TPDU); - } - process_byte_tpdu(byte); - break; - case ISO7816_S_IN_PPS_REQ: - case ISO7816_S_IN_PPS_RSP: - process_byte_pps(byte); - break; - default: - TRACE_ERROR("Data received in unknown state %u\n\r", iso_state); - } - } -} - /*! Interrupt Service Routine called on USART activity */ void Sniffer_usart_isr(void) { @@ -635,6 +740,7 @@ default: break; } + usb_send_change(SNIFF_CHANGE_FLAG_TIMEOUT_WT); /* send timeout to host software over USB */ } } @@ -691,11 +797,14 @@ void Sniffer_exit(void) { TRACE_INFO("Sniffer exit\n\r"); + /* Disable USART */ USART_DisableIt(sniff_usart.base, US_IER_RXRDY); /* NOTE: don't forget to set the IRQ according to the USART peripheral used */ NVIC_DisableIRQ(IRQ_USART_SIM); USART_SetReceiverEnabled(sniff_usart.base, 0); - + /* Disable RST IRQ */ + PIO_DisableIt(&pin_rst); + NVIC_DisableIRQ(PIOA_IRQn); /* CAUTION this needs to match to the correct port */ } /* called when *Sniffer* configuration is set by host */ @@ -738,6 +847,58 @@ /* Main (idle/busy) loop of this USB configuration */ void Sniffer_run(void) { - check_sniffed_data(); + /* Handle USB queue */ + /* first try to send any pending messages on INT */ + usb_refill_to_host(SIMTRACE_USB_EP_CARD_INT); + /* then try to send any pending messages on IN */ + usb_refill_to_host(SIMTRACE_USB_EP_CARD_DATAIN); + /* ensure we can handle incoming USB messages from the host */ + /* currently we don't need any incoming data + usb_refill_from_host(SIMTRACE_USB_EP_CARD_DATAOUT); + struct llist_head *queue = usb_get_queue(SIMTRACE_USB_EP_CARD_DATAOUT); + process_any_usb_commands(queue); + */ + + /* Handle sniffed data */ + if (!rbuf_is_empty(&sniff_buffer)) { /* use if instead of while to let the main loop restart the watchdog */ + uint8_t byte = rbuf_read(&sniff_buffer); + TRACE_DEBUG_WP("< 0x%02x\n\r", byte); + switch (iso_state) { /* Handle byte depending on state */ + case ISO7816_S_RESET: /* During reset we shouldn't receive any data */ + break; + case ISO7816_S_WAIT_ATR: /* After a reset we expect the ATR */ + change_state(ISO7816_S_IN_ATR); /* go to next state */ + case ISO7816_S_IN_ATR: /* More ATR data incoming */ + process_byte_atr(byte); + break; + case ISO7816_S_WAIT_TPDU: /* After the ATR we expect TPDU or PPS data */ + case ISO7816_S_WAIT_PPS_RSP: + if (byte == 0xff) { + if (ISO7816_S_WAIT_PPS_RSP==iso_state) { + change_state(ISO7816_S_IN_PPS_RSP); /* Go to PPS state */ + } else { + change_state(ISO7816_S_IN_PPS_REQ); /* Go to PPS state */ + } + process_byte_pps(byte); + break; + } + case ISO7816_S_IN_TPDU: /* More TPDU data incoming */ + if (ISO7816_S_WAIT_TPDU==iso_state) { + change_state(ISO7816_S_IN_TPDU); + } + process_byte_tpdu(byte); + break; + case ISO7816_S_IN_PPS_REQ: + case ISO7816_S_IN_PPS_RSP: + process_byte_pps(byte); + break; + default: + TRACE_ERROR("Data received in unknown state %u\n\r", iso_state); + } + } + + /* Handle flags */ + if (change_flags) { /* WARNING this is not synced with the data buffer handling */ + } } #endif /* HAVE_SNIFFER */ -- To view, visit https://gerrit.osmocom.org/9873 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ice7817480705f2124b08c1ff9a8826558b6d8b2b Gerrit-Change-Number: 9873 Gerrit-PatchSet: 9 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:44:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 15:44:28 +0000 Subject: Change in simtrace2[master]: host USB: add host application to receive and display USB sniffing me... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9874 ) Change subject: host USB: add host application to receive and display USB sniffing messages sent by firmware ...................................................................... Patch Set 12: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9874 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Idefbf21e0bbd2a1e3647fe9aebaf88d1b62dae2d Gerrit-Change-Number: 9874 Gerrit-PatchSet: 12 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon Gerrit-Comment-Date: Wed, 04 Jul 2018 15:44:28 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:44:35 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 15:44:35 +0000 Subject: Change in simtrace2[master]: host USB: add host application to receive and display USB sniffing me... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9874 ) Change subject: host USB: add host application to receive and display USB sniffing messages sent by firmware ...................................................................... host USB: add host application to receive and display USB sniffing messages sent by firmware Change-Id: Idefbf21e0bbd2a1e3647fe9aebaf88d1b62dae2d --- M host/Makefile A host/simtrace2-sniff.c 2 files changed, 538 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/host/Makefile b/host/Makefile index 47ccfec..50497c4 100644 --- a/host/Makefile +++ b/host/Makefile @@ -1,7 +1,7 @@ LDFLAGS=`pkg-config --libs libusb-1.0 libosmocore` -losmocore CFLAGS=-Wall -g -all: simtrace2-remsim simtrace2-remsim-usb2udp simtrace2-list +all: simtrace2-remsim simtrace2-remsim-usb2udp simtrace2-list simtrace2-sniff simtrace2-remsim: simtrace2-remsim.o apdu_dispatch.o simtrace2-discovery.o libusb_util.o $(CC) -o $@ $^ $(LDFLAGS) -losmosim @@ -12,6 +12,9 @@ simtrace2-list: simtrace2_usb.o libusb_util.o $(CC) -o $@ $^ $(LDFLAGS) +simtrace2-sniff: simtrace2-sniff.o simtrace2-discovery.o libusb_util.o + $(CC) -o $@ $^ $(LDFLAGS) + %.o: %.c $(CC) $(CFLAGS) `pkg-config --cflags libusb-1.0 libosmocore` -o $@ -c $^ diff --git a/host/simtrace2-sniff.c b/host/simtrace2-sniff.c new file mode 100644 index 0000000..dc4708f --- /dev/null +++ b/host/simtrace2-sniff.c @@ -0,0 +1,534 @@ +/* simtrace2-sniff - main program for the host PC to communicate with the SIMtrace 2 firmware in sniffer mode */ +/* This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * (C) 2010-2017 by Harald Welte + * (C) 2018 by Kevin Redon + */ +#include +#include +#include +#include +#include +#include +#include +#include +#define _GNU_SOURCE +#include + +#include +#include +#include +#include +#include + +#include + +#include "libusb_util.h" +#include "simtrace.h" +#include "simtrace_usb.h" +#include "simtrace_prot.h" +#include "simtrace2-discovery.h" + +#include +#include +#include +#include +#include +#include +#include + +/* transport to a SIMtrace device */ +struct st_transport { + /* USB */ + struct libusb_device_handle *usb_devh; + struct { + uint8_t in; + uint8_t out; + uint8_t irq_in; + } usb_ep; +}; + +/* global GSMTAP instance */ +static struct gsmtap_inst *g_gti; + +static int gsmtap_send_sim(const uint8_t *apdu, unsigned int len) +{ + struct gsmtap_hdr *gh; + unsigned int gross_len = len + sizeof(*gh); + uint8_t *buf = malloc(gross_len); + int rc; + + if (!buf) + return -ENOMEM; + + memset(buf, 0, sizeof(*gh)); + gh = (struct gsmtap_hdr *) buf; + gh->version = GSMTAP_VERSION; + gh->hdr_len = sizeof(*gh)/4; + gh->type = GSMTAP_TYPE_SIM; + + memcpy(buf + sizeof(*gh), apdu, len); + + rc = write(gsmtap_inst_fd(g_gti), buf, gross_len); + if (rc < 0) { + perror("write gsmtap"); + free(buf); + return rc; + } + + free(buf); + return 0; +} + +static int process_change(uint8_t *buf, int len) +{ + /* check if there is enough data for the structure */ + if (lenflags) { + printf("Card state change: "); + } + if (change->flags&SNIFF_CHANGE_FLAG_CARD_INSERT) { + printf("card inserted "); + } + if (change->flags&SNIFF_CHANGE_FLAG_CARD_EJECT) { + printf("card ejected "); + } + if (change->flags&SNIFF_CHANGE_FLAG_RESET_HOLD) { + printf("reset hold "); + } + if (change->flags&SNIFF_CHANGE_FLAG_RESET_RELEASE) { + printf("reset release "); + } + if (change->flags&SNIFF_CHANGE_FLAG_TIMEOUT_WT) { + // do nothing since this also triggers on inactivity + } + if (SNIFF_CHANGE_FLAG_TIMEOUT_WT!=change->flags) { + printf("\n"); + } + + return 0; +} + +/* Table 7 of ISO 7816-3:2006 */ +static const uint16_t fi_table[] = { 372, 372, 558, 744, 1116, 1488, 1860, 0, 0, 512, 768, 1024, 1536, 2048, 0, 0, }; + +/* Table 8 from ISO 7816-3:2006 */ +static const uint8_t di_table[] = { 0, 1, 2, 4, 8, 16, 32, 64, 12, 20, 2, 4, 8, 16, 32, 64, }; + +static int process_fidi(uint8_t *buf, int len) +{ + /* check if there is enough data for the structure */ + if (lenfidi>>4], di_table[fidi->fidi&0x0f]); + return 0; +} + +static int process_atr(uint8_t *buf, int len) +{ + /* check if there is enough data for the structure */ + if (lenlength) { + return -2; + } + + printf("ATR%s: ", atr->complete ? "" : " (incomplete)"); + uint16_t i; + for (i = 0; i < atr->length; i++) { + printf("%02x ", atr->data[i]); + } + printf("\n"); + return 0; +} + +static int process_pps(uint8_t *buf, int len) +{ + /* check if there is enough data for the structure */ + if (lenlength) { + return -2; + } + + printf("PPS%s: ", pps->complete ? "" : " (incomplete) "); + uint16_t i; + for (i = 0; i < pps->length; i++) { + printf("%02x ", pps->data[i]); + } + printf("\n"); + return 0; +} + +static int process_tpdu(uint8_t *buf, int len) +{ + /* check if there is enough data for the structure */ + if (lenlength) { + return -2; + } + + printf("TPDU%s: ", tpdu->complete ? "" : " (incomplete)"); + uint16_t i; + for (i = 0; i < tpdu->length; i++) { + printf("%02x ", tpdu->data[i]); + } + printf("\n"); + return 0; +} + +/*! \brief Process an incoming message from the SIMtrace2 */ +static int process_usb_msg(uint8_t *buf, int len) +{ + /* check if enough data for the header is present */ + if (lenmsg_len) { + return 0; + } + //printf("msg: %s\n", osmo_hexdump(buf, msg_hdr->msg_len)); + + /* check for message class */ + if (SIMTRACE_MSGC_SNIFF!=msg_hdr->msg_class) { /* we only care about sniffing messages */ + return msg_hdr->msg_len; /* discard non-sniffing messaged */ + } + + /* process sniff message payload */ + buf += sizeof(struct simtrace_msg_hdr); + len -= sizeof(struct simtrace_msg_hdr); + switch (msg_hdr->msg_type) { + case SIMTRACE_MSGT_SNIFF_CHANGE: + process_change(buf, len); + break; + case SIMTRACE_MSGT_SNIFF_FIDI: + process_fidi(buf, len); + break; + case SIMTRACE_MSGT_SNIFF_ATR: + process_atr(buf, len); + break; + case SIMTRACE_MSGT_SNIFF_PPS: + process_pps(buf, len); + break; + case SIMTRACE_MSGT_SNIFF_TPDU: + process_tpdu(buf, len); + break; + default: + printf("unknown SIMtrace msg type 0x%02x\n", msg_hdr->msg_type); + break; + } + + return msg_hdr->msg_len; +} + +/*! Transport to SIMtrace device (e.g. USB handle) */ +static struct st_transport _transp; + +static void run_mainloop() +{ + int rc; + uint8_t buf[16*256]; + unsigned int i, buf_i = 0; + int xfer_len; + + printf("Entering main loop\n"); + + while (true) { + /* read data from SIMtrace2 device (via USB) */ + rc = libusb_bulk_transfer(_transp.usb_devh, _transp.usb_ep.in, + &buf[buf_i], sizeof(buf)-buf_i, &xfer_len, 100000); + if (rc < 0 && rc != LIBUSB_ERROR_TIMEOUT && + rc != LIBUSB_ERROR_INTERRUPTED && + rc != LIBUSB_ERROR_IO) { + fprintf(stderr, "BULK IN transfer error; rc=%d\n", rc); + return; + } + /* dispatch any incoming data */ + if (xfer_len > 0) { + //printf("URB: %s\n", osmo_hexdump(&buf[buf_i], xfer_len)); + buf_i += xfer_len; + if (buf_i>=sizeof(buf)) { + perror("preventing USB buffer overflow"); + return; + } + int processed = process_usb_msg(buf, buf_i); + if (processed > 0 && processed <= buf_i) { + for (i = processed; i < buf_i; i++) { + buf[i-processed] = buf[i]; + } + buf_i -= processed; + } + } + } +} + +static void print_welcome(void) +{ + printf("simtrace2-sniff - Phone-SIM card communication sniffer \n" + "(C) 2010-2017 by Harald Welte \n" + "(C) 2018 by Kevin Redon \n" + "\n" + ); +} + +static void print_help(void) +{ + printf( + "\t-h\t--help\n" + "\t-i\t--gsmtap-ip\tA.B.C.D\n" + "\t-k\t--keep-running\n" + "\t-V\t--usb-vendor\tVENDOR_ID\n" + "\t-P\t--usb-product\tPRODUCT_ID\n" + "\t-C\t--usb-config\tCONFIG_ID\n" + "\t-I\t--usb-interface\tINTERFACE_ID\n" + "\t-S\t--usb-altsetting ALTSETTING_ID\n" + "\t-A\t--usb-address\tADDRESS\n" + "\n" + ); +} + +static const struct option opts[] = { + { "help", 0, 0, 'h' }, + { "gsmtap-ip", 1, 0, 'i' }, + { "keep-running", 0, 0, 'k' }, + { "usb-vendor", 1, 0, 'V' }, + { "usb-product", 1, 0, 'P' }, + { "usb-config", 1, 0, 'C' }, + { "usb-interface", 1, 0, 'I' }, + { "usb-altsetting", 1, 0, 'S' }, + { "usb-address", 1, 0, 'A' }, + { NULL, 0, 0, 0 } +}; + +/* Known USB device with SIMtrace firmware supporting sniffer */ +static const struct dev_id compatible_dev_ids[] = { + { USB_VENDOR_OPENMOKO, USB_PRODUCT_SIMTRACE2 }, + { 0, 0 } +}; + +static void signal_handler(int signal) +{ + switch (signal) { + case SIGINT: + exit(0); + break; + default: + break; + } +} + +int main(int argc, char **argv) +{ + int i, rc, ret; + print_welcome(); + + /* Parse arguments */ + char *gsmtap_host = "127.0.0.1"; + int keep_running = 0; + int vendor_id = -1, product_id = -1, addr = -1, config_id = -1, if_num = -1, altsetting = -1; + + while (1) { + int option_index = 0; + + char c = getopt_long(argc, argv, "hi:kV:P:C:I:S:A:", opts, &option_index); + if (c == -1) + break; + switch (c) { + case 'h': + print_help(); + exit(0); + break; + case 'i': + gsmtap_host = optarg; + break; + case 'k': + keep_running = 1; + break; + case 'V': + vendor_id = strtol(optarg, NULL, 16); + break; + case 'P': + product_id = strtol(optarg, NULL, 16); + break; + case 'C': + config_id = atoi(optarg); + break; + case 'I': + if_num = atoi(optarg); + break; + case 'S': + altsetting = atoi(optarg); + break; + case 'A': + addr = atoi(optarg); + break; + } + } + + /* Scan for available SIMtrace USB devices supporting sniffing */ + rc = libusb_init(NULL); + if (rc < 0) { + fprintf(stderr, "libusb initialization failed\n"); + goto do_exit; + } + struct usb_interface_match ifm_scan[16]; + int num_interfaces = usb_match_interfaces(NULL, compatible_dev_ids, + USB_CLASS_PROPRIETARY, SIMTRACE_SNIFFER_USB_SUBCLASS, -1, ifm_scan, ARRAY_SIZE(ifm_scan)); + if (num_interfaces <= 0) { + perror("No compatible USB devices found"); + goto do_exit; + } + + /* Only keep USB matching arguments */ + struct usb_interface_match ifm_filtered[ARRAY_SIZE(ifm_scan)]; + int num_filtered = 0; + for (i = 0; i < num_interfaces; i++) { + if (vendor_id>=0 && vendor_id!=ifm_scan[i].vendor) { + continue; + } + if (product_id>=0 && product_id!=ifm_scan[i].product) { + continue; + } + if (config_id>=0 && config_id!=ifm_scan[i].configuration) { + continue; + } + if (if_num>=0 && if_num!=ifm_scan[i].interface) { + continue; + } + if (altsetting>=0 && altsetting!=ifm_scan[i].altsetting) { + continue; + } + if (addr>=0 && addr!=ifm_scan[i].addr) { + continue; + } + ifm_filtered[num_filtered++] = ifm_scan[i]; + } + if (1!=num_filtered) { + perror("No individual matching USB devices found"); + printf("Available USB devices:\n"); + for (i = 0; i < num_interfaces; i++) { + printf("\t%04x:%04x Addr=%u, Path=%s, Cfg=%u, Intf=%u, Alt=%u: %d/%d/%d ", + ifm_scan[i].vendor, ifm_scan[i].product, ifm_scan[i].addr, ifm_scan[i].path, + ifm_scan[i].configuration, ifm_scan[i].interface, ifm_scan[i].altsetting, + ifm_scan[i].class, ifm_scan[i].sub_class, ifm_scan[i].protocol); + libusb_device_handle *dev_handle; + rc = libusb_open(ifm_scan[i].usb_dev, &dev_handle); + if (rc < 0) { + printf("\n"); + perror("Cannot open device"); + continue; + } + char strbuf[256]; + rc = libusb_get_string_descriptor_ascii(dev_handle, ifm_scan[i].string_idx, + (unsigned char *)strbuf, sizeof(strbuf)); + libusb_close(dev_handle); + if (rc < 0) { + printf("\n"); + perror("Cannot read string"); + continue; + } + printf("(%s)\n", strbuf); + } + goto do_exit; + } + struct usb_interface_match ifm_selected = ifm_filtered[0]; + printf("Using USB device %04x:%04x Addr=%u, Path=%s, Cfg=%u, Intf=%u, Alt=%u: %d/%d/%d ", + ifm_selected.vendor, ifm_selected.product, ifm_selected.addr, ifm_selected.path, + ifm_selected.configuration, ifm_selected.interface, ifm_selected.altsetting, + ifm_selected.class, ifm_selected.sub_class, ifm_selected.protocol); + libusb_device_handle *dev_handle; + rc = libusb_open(ifm_selected.usb_dev, &dev_handle); + if (rc < 0) { + printf("\n"); + perror("Cannot open device"); + } + char strbuf[256]; + rc = libusb_get_string_descriptor_ascii(dev_handle, ifm_selected.string_idx, + (unsigned char *)strbuf, sizeof(strbuf)); + libusb_close(dev_handle); + if (rc < 0) { + printf("\n"); + perror("Cannot read string"); + } + printf("(%s)\n", strbuf); + + g_gti = gsmtap_source_init(gsmtap_host, GSMTAP_UDP_PORT, 0); + if (!g_gti) { + perror("unable to open GSMTAP"); + goto close_exit; + } + gsmtap_source_add_sink(g_gti); + + signal(SIGINT, &signal_handler); + + do { + _transp.usb_devh = usb_open_claim_interface(NULL, &ifm_selected); + if (!_transp.usb_devh) { + fprintf(stderr, "can't open USB device\n"); + goto close_exit; + } + + rc = libusb_claim_interface(_transp.usb_devh, ifm_selected.interface); + if (rc < 0) { + fprintf(stderr, "can't claim interface %d; rc=%d\n", ifm_selected.interface, rc); + goto close_exit; + } + + rc = get_usb_ep_addrs(_transp.usb_devh, ifm_selected.interface, &_transp.usb_ep.out, + &_transp.usb_ep.in, &_transp.usb_ep.irq_in); + if (rc < 0) { + fprintf(stderr, "can't obtain EP addrs; rc=%d\n", rc); + goto close_exit; + } + + run_mainloop(); + ret = 0; + + if (_transp.usb_devh) + libusb_release_interface(_transp.usb_devh, 0); +close_exit: + if (_transp.usb_devh) + libusb_close(_transp.usb_devh); + if (keep_running) + sleep(1); + } while (keep_running); + + libusb_exit(NULL); +do_exit: + return ret; +} -- To view, visit https://gerrit.osmocom.org/9874 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Idefbf21e0bbd2a1e3647fe9aebaf88d1b62dae2d Gerrit-Change-Number: 9874 Gerrit-PatchSet: 12 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:44:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 15:44:36 +0000 Subject: Change in simtrace2[master]: sniffer: display F and D values frim PPS In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9875 ) Change subject: sniffer: display F and D values frim PPS ...................................................................... sniffer: display F and D values frim PPS Change-Id: I3641dcb6c24695a6d3dd3a1ee4333f56a07c99f0 --- M firmware/libcommon/include/iso7816_fidi.h M firmware/libcommon/source/iso7816_fidi.c M firmware/libcommon/source/sniffer.c 3 files changed, 9 insertions(+), 3 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libcommon/include/iso7816_fidi.h b/firmware/libcommon/include/iso7816_fidi.h index e4690a5..3b4b451 100644 --- a/firmware/libcommon/include/iso7816_fidi.h +++ b/firmware/libcommon/include/iso7816_fidi.h @@ -2,5 +2,11 @@ #include +/* Table 7 of ISO 7816-3:2006 */ +extern const uint16_t fi_table[]; + +/* Table 8 from ISO 7816-3:2006 */ +extern const uint8_t di_table[]; + /* compute the F/D ratio based on Fi and Di values */ int compute_fidi_ratio(uint8_t fi, uint8_t di); diff --git a/firmware/libcommon/source/iso7816_fidi.c b/firmware/libcommon/source/iso7816_fidi.c index b35f068..bdccd55 100644 --- a/firmware/libcommon/source/iso7816_fidi.c +++ b/firmware/libcommon/source/iso7816_fidi.c @@ -24,13 +24,13 @@ #include "iso7816_fidi.h" /* Table 7 of ISO 7816-3:2006 */ -static const uint16_t fi_table[] = { +const uint16_t fi_table[] = { 372, 372, 558, 744, 1116, 1488, 1860, 0, 0, 512, 768, 1024, 1536, 2048, 0, 0 }; /* Table 8 from ISO 7816-3:2006 */ -static const uint8_t di_table[] = { +const uint8_t di_table[] = { 0, 1, 2, 4, 8, 16, 32, 64, 12, 20, 2, 4, 8, 16, 32, 64, }; diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 27f102d..fe550ea 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -565,7 +565,7 @@ fn = 1; dn = 1; } - TRACE_INFO("PPS negotiation successful: Fn=%u Dn=%u\n\r", fn, dn); + TRACE_INFO("PPS negotiation successful: Fn=%u Dn=%u\n\r", fi_table[fn], di_table[dn]); update_fidi(&sniff_usart, pps_cur[2]); usb_send_fidi(pps_cur[2]); /* send Fi/Di change notification to host software over USB */ } else { /* checksum is invalid */ -- To view, visit https://gerrit.osmocom.org/9875 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I3641dcb6c24695a6d3dd3a1ee4333f56a07c99f0 Gerrit-Change-Number: 9875 Gerrit-PatchSet: 12 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:44:37 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 15:44:37 +0000 Subject: Change in simtrace2[master]: console: drop data to be send when buffer is already full In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9876 ) Change subject: console: drop data to be send when buffer is already full ...................................................................... console: drop data to be send when buffer is already full don't wait for space to be available in the buffer since since would prevent from processing non-console (e.g. debug) more important data Change-Id: Ia625b09eb30bb7b43edd3989f697d8ef33200f28 --- M firmware/libboard/common/source/uart_console.c 1 file changed, 8 insertions(+), 10 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libboard/common/source/uart_console.c b/firmware/libboard/common/source/uart_console.c index e52cd51..a47ba0c 100644 --- a/firmware/libboard/common/source/uart_console.c +++ b/firmware/libboard/common/source/uart_console.c @@ -133,17 +133,15 @@ UART_Configure(CONSOLE_BAUDRATE, BOARD_MCK); } - /* Wait until there is space in the buffer */ - while (rbuf_is_full(&uart_tx_buffer)) { - if (pUart->UART_SR & UART_SR_TXEMPTY) { - pUart->UART_IER = UART_IER_TXRDY; - CONSOLE_ISR(); - } + /* Only store input if buffer is not full, else drop it */ + bool trigger_isr = false; + if (rbuf_is_empty(&uart_tx_buffer)) { + trigger_isr = true; } - - /* Put character into buffer */ - rbuf_write(&uart_tx_buffer, c); - if (pUart->UART_SR & UART_SR_TXEMPTY) { + if (!rbuf_is_full(&uart_tx_buffer)) { + rbuf_write(&uart_tx_buffer, c); + } + if (trigger_isr) { pUart->UART_IER = UART_IER_TXRDY; CONSOLE_ISR(); } -- To view, visit https://gerrit.osmocom.org/9876 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ia625b09eb30bb7b43edd3989f697d8ef33200f28 Gerrit-Change-Number: 9876 Gerrit-PatchSet: 12 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:45:10 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 15:45:10 +0000 Subject: Change in simtrace2[master]: sniffing: move conversion convertion and flag processing from ISR to ... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9878 ) Change subject: sniffing: move conversion convertion and flag processing from ISR to main loop to keep ISR fast and focus on data capture ...................................................................... Patch Set 12: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9878 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ieefa8a5f81dbcc12c1ad3059660dbffa0c1a4961 Gerrit-Change-Number: 9878 Gerrit-PatchSet: 12 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon Gerrit-Comment-Date: Wed, 04 Jul 2018 15:45:10 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:45:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 15:45:22 +0000 Subject: Change in simtrace2[master]: sniffer: also send incomplete (e.g. timeout) data (PPS/ATR/TPDU) In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9879 ) Change subject: sniffer: also send incomplete (e.g. timeout) data (PPS/ATR/TPDU) ...................................................................... Patch Set 13: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9879 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib070aca181042b477f1ffec48d63dc56c1e4609a Gerrit-Change-Number: 9879 Gerrit-PatchSet: 13 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 04 Jul 2018 15:45:22 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:45:42 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 15:45:42 +0000 Subject: Change in simtrace2[master]: sniffing: fix procedure byte handling and make TPDU parsing more strict In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9880 ) Change subject: sniffing: fix procedure byte handling and make TPDU parsing more strict ...................................................................... Patch Set 14: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9880 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If991152f11c4b864ab1386f21dc13c335e6b281f Gerrit-Change-Number: 9880 Gerrit-PatchSet: 14 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon Gerrit-Comment-Date: Wed, 04 Jul 2018 15:45:42 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 15:45:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 15:45:57 +0000 Subject: Change in simtrace2[master]: sniffer: add waiting time WT update In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9882 ) Change subject: sniffer: add waiting time WT update ...................................................................... Patch Set 14: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9882 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9735660ffce161cec8d4e63fa60a66fc8ef57525 Gerrit-Change-Number: 9882 Gerrit-PatchSet: 14 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 04 Jul 2018 15:45:57 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 20:24:30 2018 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 4 Jul 2018 20:24:30 +0000 Subject: Change in osmo-gsm-tester[master]: ms: Remove debug left over for the test In-Reply-To: References: Message-ID: Holger Freyther has submitted this change and it was merged. ( https://gerrit.osmocom.org/9664 ) Change subject: ms: Remove debug left over for the test ...................................................................... ms: Remove debug left over for the test Change-Id: I17aa97a99cb1b1f9205b3a951370fe5ad49ae3dc --- M src/osmo_ms_driver/__main__.py 1 file changed, 0 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, but someone else must approve Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_ms_driver/__main__.py b/src/osmo_ms_driver/__main__.py index 6b61d64..0e35280 100644 --- a/src/osmo_ms_driver/__main__.py +++ b/src/osmo_ms_driver/__main__.py @@ -60,8 +60,6 @@ # Event server to handle MS->test events ev_server = EventServer("ev_server", event_server_path) ev_server.listen(loop) - #while True: - # loop.select() # Just a single test for now. test = MassUpdateLocationTest("lu_test", num_ms, cdf, ev_server, tmp_dir) -- To view, visit https://gerrit.osmocom.org/9664 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I17aa97a99cb1b1f9205b3a951370fe5ad49ae3dc Gerrit-Change-Number: 9664 Gerrit-PatchSet: 2 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 20:24:41 2018 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 4 Jul 2018 20:24:41 +0000 Subject: Change in osmo-gsm-tester[master]: ms: Make the outer variables configurable In-Reply-To: References: Message-ID: Holger Freyther has submitted this change and it was merged. ( https://gerrit.osmocom.org/9713 ) Change subject: ms: Make the outer variables configurable ...................................................................... ms: Make the outer variables configurable Do the easy part for making these variables configurable. Change-Id: If8bbedcf672f6481a12c30d3669564704063626c --- M src/osmo_ms_driver/__main__.py M src/osmo_ms_driver/cdf.py 2 files changed, 31 insertions(+), 9 deletions(-) Approvals: Harald Welte: Looks good to me, but someone else must approve Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_ms_driver/__main__.py b/src/osmo_ms_driver/__main__.py index 0e35280..7bca1d1 100644 --- a/src/osmo_ms_driver/__main__.py +++ b/src/osmo_ms_driver/__main__.py @@ -19,50 +19,65 @@ from .event_server import EventServer from .simple_loop import SimpleLoop from .location_update_test import MassUpdateLocationTest -from .cdf import ease_in_out_duration, linear_with_duration +from .cdf import ease_in_out_duration, linear_with_duration, cdfs from osmo_gsm_tester import log # System modules +import argparse import datetime import subprocess import signal import tempfile import os.path +import os +def parser(): + parser = argparse.ArgumentParser(epilog=__doc__, formatter_class=argparse.RawTextHelpFormatter) + parser.add_argument('-s', '--launch-duration', dest='launch_duration', + default=60, type=int, + help="Time launching applications should take in seconds") + parser.add_argument('-i', '--launch-interval', dest='launch_interval', + default=100, type=int, + help="Time between launching in milliseconds") + parser.add_argument('-d', '--distribution', dest="cdf_name", + choices=cdfs.keys(), default="ease_in_out", + help="Curve to use for starting within launch duration") + parser.add_argument('-m', '--number-ms', dest="num_ms", + default=10, type=int, + help="Number of MobileStations to simulate") + return parser def main(): # Create a default log to stdout log.LogTarget().style(src=False) + args = parser().parse_args() + # We don't care what is happening to child processes we spawn! signal.signal(signal.SIGCHLD, signal.SIG_IGN) loop = SimpleLoop() - # TODO: Parse parameters and test composition. Right now we test - # with a single set of values. - num_ms = 10 - tmp_dir = tempfile.mkdtemp(suffix="osmo-ms-driver") log.log("Going to store files in ", tmp_dir=tmp_dir) # How long should starting all apps take - time_start=datetime.timedelta(seconds=60) + time_start=datetime.timedelta(seconds=args.launch_duration) # In which steps to start processes - time_step=datetime.timedelta(milliseconds=100) + time_step=datetime.timedelta(milliseconds=args.launch_interval) # Event server path event_server_path = os.path.join(tmp_dir, "osmo_ms_driver.unix") # The function that decides when to start something - cdf = ease_in_out_duration(time_start, time_step) + cdf = cdfs[args.cdf_name](time_start, time_step) # Event server to handle MS->test events ev_server = EventServer("ev_server", event_server_path) ev_server.listen(loop) # Just a single test for now. - test = MassUpdateLocationTest("lu_test", num_ms, cdf, ev_server, tmp_dir) + test = MassUpdateLocationTest("lu_test", args.num_ms, cdf, ev_server, tmp_dir) # Run until everything has been launched test.launch(loop) diff --git a/src/osmo_ms_driver/cdf.py b/src/osmo_ms_driver/cdf.py index 781349b..e163cc3 100644 --- a/src/osmo_ms_driver/cdf.py +++ b/src/osmo_ms_driver/cdf.py @@ -103,3 +103,10 @@ scale = 1.0/duration.total_seconds() return DistributionFunctionHandler(step_size, duration, lambda x: _in_out(x*scale)) + + +cdfs = { + 'immediate': lambda x,y: immediate(y), + 'linear': linear_with_duration, + 'ease_in_out': ease_in_out_duration, +} -- To view, visit https://gerrit.osmocom.org/9713 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: If8bbedcf672f6481a12c30d3669564704063626c Gerrit-Change-Number: 9713 Gerrit-PatchSet: 3 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 20:26:03 2018 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 4 Jul 2018 20:26:03 +0000 Subject: Change in osmo-gsm-tester[master]: ms: Attempt to stop all mobile/virtphy instances on exit In-Reply-To: References: Message-ID: Holger Freyther has posted comments on this change. ( https://gerrit.osmocom.org/9714 ) Change subject: ms: Attempt to stop all mobile/virtphy instances on exit ...................................................................... Patch Set 2: > You get all this for free when inheriting from osmo_gsm_tester.Process > class, then using osmo_gsm_tester.suite.py (SuiteDefition & > SuiteRun) to maintain them for you. You may want to integrate all > these tests with it in the future. IIRC last time I tried it didn't scale up to the 10k processes but that might have been due the logging code (that I fixed since then). Let's have a look at how to unify this in the future. -- To view, visit https://gerrit.osmocom.org/9714 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6cec050db7d4c355fb6678b2d84309fbbe5587b3 Gerrit-Change-Number: 9714 Gerrit-PatchSet: 2 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 04 Jul 2018 20:26:03 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 20:44:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 20:44:18 +0000 Subject: Change in simtrace2[master]: sniffing: move conversion convertion and flag processing from ISR to ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9878 ) Change subject: sniffing: move conversion convertion and flag processing from ISR to main loop to keep ISR fast and focus on data capture ...................................................................... sniffing: move conversion convertion and flag processing from ISR to main loop to keep ISR fast and focus on data capture Change-Id: Ieefa8a5f81dbcc12c1ad3059660dbffa0c1a4961 --- M firmware/libcommon/source/sniffer.c M host/simtrace2-sniff.c 2 files changed, 88 insertions(+), 64 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index fe550ea..c2b8725 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -19,8 +19,7 @@ */ /* This code implement the Sniffer mode to sniff the communication between a SIM card (or any ISO 7816 smart card) and a phone (or any ISO 7816 card reader). * For historical reasons (i.e. SIMtrace hardware) the USART peripheral connected to the SIM card is used. - * TODO handle RST, PTS, and send data over USB - * TODO put common ISO7816-3 code is separate library (and combine clean with iso7816_4) + * TODO put common ISO7816-3 code is separate library (and combine clean with iso7816_4) */ #include "board.h" #include "simtrace.h" @@ -221,26 +220,6 @@ usb_buf_submit(usb_msg); } -/*! Send card change flags over USB - * @param[in] flags change flags corresponding to SIMTRACE_MSGT_SNIFF_CHANGE - */ -static void usb_send_change(uint32_t flags) -{ - /* Check flags */ - if(0==flags) { /* no changes */ - return; - } - - /* Send message over USB */ - struct msgb *usb_msg = usb_msg_alloc_hdr(SIMTRACE_USB_EP_CARD_DATAIN, SIMTRACE_MSGC_SNIFF, SIMTRACE_MSGT_SNIFF_CHANGE); - if (!usb_msg) { - return; - } - struct sniff_change *usb_sniff_change = (struct sniff_change *) msgb_put(usb_msg, sizeof(*usb_sniff_change)); - usb_sniff_change->flags = flags; - usb_msg_upd_len_and_submit(usb_msg); -} - /*! Update the ISO 7816-3 state * @param[in] iso_state_new new ISO 7816-3 state to update to */ @@ -256,11 +235,11 @@ switch (iso_state_new) { case ISO7816_S_RESET: update_fidi(&sniff_usart, 0x11); /* reset baud rate to default Di/Fi values */ - usb_send_change(SNIFF_CHANGE_FLAG_RESET_HOLD); /* send reset change to host software over USB */ + change_flags |= SNIFF_CHANGE_FLAG_RESET_HOLD; /* set flag and let main loop send it */ break; case ISO7816_S_WAIT_ATR: rbuf_reset(&sniff_buffer); /* reset buffer for new communication */ - usb_send_change(SNIFF_CHANGE_FLAG_RESET_RELEASE); /* send reset change to host software over USB */ + change_flags |= SNIFF_CHANGE_FLAG_RESET_RELEASE; /* set flag and let main loop send it */ break; case ISO7816_S_IN_ATR: atr_i = 0; @@ -705,42 +684,34 @@ void Sniffer_usart_isr(void) { /* Read channel status register */ - uint32_t csr = sniff_usart.base->US_CSR & sniff_usart.base->US_IMR; + uint32_t csr = sniff_usart.base->US_CSR; + /* Verify if there was an error */ + if (csr & US_CSR_OVRE) { + TRACE_WARNING("USART overrun error\n\r"); + sniff_usart.base->US_CR |= US_CR_RSTSTA; + } + if (csr & US_CSR_FRAME) { + TRACE_WARNING("USART framing error\n\r"); + sniff_usart.base->US_CR |= US_CR_RSTSTA; + } /* Verify if character has been received */ if (csr & US_CSR_RXRDY) { /* Read communication data byte between phone and SIM */ uint8_t byte = sniff_usart.base->US_RHR; - /* Convert convention if required */ - if (convention_convert) { - byte = convention_convert_lut[byte]; - } /* Store sniffed data into buffer (also clear interrupt */ - rbuf_write(&sniff_buffer, byte); + if (rbuf_is_full(&sniff_buffer)) { + TRACE_ERROR("USART buffer full\n\r"); + } else { + rbuf_write(&sniff_buffer, byte); + } } + /* Verify it WT timeout occurred, to detect unresponsive card */ if (csr & US_CSR_TIMEOUT) { /* Stop timeout until next character is received */ sniff_usart.base->US_CR |= US_CR_STTTO; - /* Use timeout to detect end of ATR/PPS/TPDU */ - switch (iso_state) { - case ISO7816_S_RESET: - case ISO7816_S_WAIT_ATR: - break; - case ISO7816_S_IN_ATR: - change_state(ISO7816_S_WAIT_ATR); - break; - case ISO7816_S_WAIT_TPDU: - break; - case ISO7816_S_WAIT_PPS_RSP: - case ISO7816_S_IN_TPDU: - case ISO7816_S_IN_PPS_REQ: - case ISO7816_S_IN_PPS_RSP: - change_state(ISO7816_S_WAIT_TPDU); - break; - default: - break; - } - usb_send_change(SNIFF_CHANGE_FLAG_TIMEOUT_WT); /* send timeout to host software over USB */ + /* Just set the flag and let the main loop handle it */ + change_flags |= SNIFF_CHANGE_FLAG_TIMEOUT_WT; } } @@ -844,6 +815,30 @@ } } +/*! Send card change flags over USB + * @param[in] flags change flags corresponding to SIMTRACE_MSGT_SNIFF_CHANGE + */ +static void usb_send_change(uint32_t flags) +{ + /* Check flags */ + if(0==flags) { /* no changes */ + return; + } + + if (flags&SNIFF_CHANGE_FLAG_TIMEOUT_WT) { + printf("waiting time (WT) timeout\n\r"); + } + + /* Send message over USB */ + struct msgb *usb_msg = usb_msg_alloc_hdr(SIMTRACE_USB_EP_CARD_DATAIN, SIMTRACE_MSGC_SNIFF, SIMTRACE_MSGT_SNIFF_CHANGE); + if (!usb_msg) { + return; + } + struct sniff_change *usb_sniff_change = (struct sniff_change *) msgb_put(usb_msg, sizeof(*usb_sniff_change)); + usb_sniff_change->flags = flags; + usb_msg_upd_len_and_submit(usb_msg); +} + /* Main (idle/busy) loop of this USB configuration */ void Sniffer_run(void) { @@ -862,7 +857,11 @@ /* Handle sniffed data */ if (!rbuf_is_empty(&sniff_buffer)) { /* use if instead of while to let the main loop restart the watchdog */ uint8_t byte = rbuf_read(&sniff_buffer); - TRACE_DEBUG_WP("< 0x%02x\n\r", byte); + /* Convert convention if required */ + if (convention_convert) { + byte = convention_convert_lut[byte]; + } + //TRACE_ERROR_WP(">%02x", byte); switch (iso_state) { /* Handle byte depending on state */ case ISO7816_S_RESET: /* During reset we shouldn't receive any data */ break; @@ -899,6 +898,31 @@ /* Handle flags */ if (change_flags) { /* WARNING this is not synced with the data buffer handling */ + if (change_flags&SNIFF_CHANGE_FLAG_TIMEOUT_WT) { + /* Use timeout to detect interrupted data transmission */ + switch (iso_state) { + case ISO7816_S_IN_ATR: + //usb_send_atr(false); /* send incomplete ATR to host software using USB */ + change_state(ISO7816_S_WAIT_ATR); + break; + case ISO7816_S_IN_TPDU: + //usb_send_tpdu(false); /* send incomplete PPS to host software using USB */ + change_state(ISO7816_S_WAIT_TPDU); + break; + case ISO7816_S_IN_PPS_REQ: + case ISO7816_S_IN_PPS_RSP: + //usb_send_pps(false); /* send incomplete TPDU to host software using USB */ + change_state(ISO7816_S_WAIT_TPDU); + break; + default: + change_flags &= ~SNIFF_CHANGE_FLAG_TIMEOUT_WT; /* We don't care about the timeout is all other cases */ + break; + } + } + if (change_flags) { + usb_send_change(change_flags); /* send timeout to host software over USB */ + change_flags = 0; /* Reset flags */ + } } } #endif /* HAVE_SNIFFER */ diff --git a/host/simtrace2-sniff.c b/host/simtrace2-sniff.c index dc4708f..67bfb79 100644 --- a/host/simtrace2-sniff.c +++ b/host/simtrace2-sniff.c @@ -92,7 +92,7 @@ return 0; } -static int process_change(uint8_t *buf, int len) +static int process_change(const uint8_t *buf, int len) { /* check if there is enough data for the structure */ if (lenflags) { - printf("Card state change: "); - } + printf("Card state change: "); if (change->flags&SNIFF_CHANGE_FLAG_CARD_INSERT) { printf("card inserted "); } @@ -116,11 +114,9 @@ printf("reset release "); } if (change->flags&SNIFF_CHANGE_FLAG_TIMEOUT_WT) { - // do nothing since this also triggers on inactivity + printf("data transfer timeout "); } - if (SNIFF_CHANGE_FLAG_TIMEOUT_WT!=change->flags) { - printf("\n"); - } + printf("\n"); return 0; } @@ -131,7 +127,7 @@ /* Table 8 from ISO 7816-3:2006 */ static const uint8_t di_table[] = { 0, 1, 2, 4, 8, 16, 32, 64, 12, 20, 2, 4, 8, 16, 32, 64, }; -static int process_fidi(uint8_t *buf, int len) +static int process_fidi(const uint8_t *buf, int len) { /* check if there is enough data for the structure */ if (lencomplete ? "" : " (incomplete)"); uint16_t i; for (i = 0; i < tpdu->length; i++) { printf("%02x ", tpdu->data[i]); } printf("\n"); + + /* send TPDU (now considered as APDU) to GSMTAP */ + gsmtap_send_sim(tpdu->data, tpdu->length); return 0; } /*! \brief Process an incoming message from the SIMtrace2 */ -static int process_usb_msg(uint8_t *buf, int len) +static int process_usb_msg(const uint8_t *buf, int len) { /* check if enough data for the header is present */ if (len Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 20:44:19 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 20:44:19 +0000 Subject: Change in simtrace2[master]: sniffer: also send incomplete (e.g. timeout) data (PPS/ATR/TPDU) In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9879 ) Change subject: sniffer: also send incomplete (e.g. timeout) data (PPS/ATR/TPDU) ...................................................................... sniffer: also send incomplete (e.g. timeout) data (PPS/ATR/TPDU) Change-Id: Ib070aca181042b477f1ffec48d63dc56c1e4609a --- M firmware/libcommon/source/sniffer.c 1 file changed, 41 insertions(+), 26 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index c2b8725..2ad435c 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -91,6 +91,7 @@ PPS_S_WAIT_PPS2, /*!< second parameter byte */ PPS_S_WAIT_PPS3, /*!< third parameter byte */ PPS_S_WAIT_PCK, /*!< check byte */ + PPS_S_WAIT_END, /*!< all done */ }; /*! Transport Protocol Data Unit (TPDU) sub-states of ISO7816_S_IN_TPDU @@ -265,9 +266,10 @@ } /*! Send current ATR over USB - * @note Also print the ATR over serial + * @param[in] complete if the ATR is complete + * @note Also print the ATR to debug console */ -static void usb_send_atr(void) +static void usb_send_atr(bool complete) { /* Check state */ if (ISO7816_S_IN_ATR!=iso_state) { @@ -283,7 +285,7 @@ led_blink(LED_GREEN, BLINK_2O_F); /* Print ATR */ - printf("ATR: "); + printf("ATR%s: ", complete ? "" : " (incomplete)"); uint8_t i; for (i = 0; i < atr_i; i++) { printf("%02x ", atr[i]); @@ -296,7 +298,7 @@ return; } struct sniff_data *usb_sniff_data_atr = (struct sniff_data *) msgb_put(usb_msg, sizeof(*usb_sniff_data_atr)); - usb_sniff_data_atr->complete = true; + usb_sniff_data_atr->complete = complete; usb_sniff_data_atr->length = atr_i; uint8_t *data = msgb_put(usb_msg, usb_sniff_data_atr->length); memcpy(data, atr, atr_i); @@ -384,7 +386,7 @@ } case ATR_S_WAIT_TCK: /* see ISO/IEC 7816-3:2006 section 8.2.5 */ /* we could verify the checksum, but we are just here to sniff */ - usb_send_atr(); /* send ATR to host software using USB */ + usb_send_atr(true); /* send ATR to host software using USB */ change_state(ISO7816_S_WAIT_TPDU); /* go to next state */ break; default: @@ -393,9 +395,10 @@ } /*! Send current PPS over USB - * @note Also print the PPS over serial + * @param[in] complete if the PPS is complete + * @note Also print the PPS over the debug console */ -static void usb_send_pps(void) +static void usb_send_pps(bool complete) { uint8_t *pps_cur; /* current PPS (request or response) */ @@ -412,26 +415,32 @@ /* Get only relevant data */ uint8_t pps[6]; uint8_t pps_i = 0; - pps[pps_i++] = pps_cur[0]; - pps[pps_i++] = pps_cur[1]; - if (pps_cur[1]&0x10) { + if (pps_state>PPS_S_WAIT_PPSS) { + pps[pps_i++] = pps_cur[0]; + } + if (pps_state>PPS_S_WAIT_PPS0) { + pps[pps_i++] = pps_cur[1]; + } + if (pps_state>PPS_S_WAIT_PPS1 && pps_cur[1]&0x10) { pps[pps_i++] = pps_cur[2]; } - if (pps_cur[1]&0x20) { + if (pps_state>PPS_S_WAIT_PPS2 && pps_cur[1]&0x20) { pps[pps_i++] = pps_cur[3]; } - if (pps_cur[1]&0x40) { + if (pps_state>PPS_S_WAIT_PPS3 && pps_cur[1]&0x40) { pps[pps_i++] = pps_cur[4]; } - pps[pps_i++] = pps_cur[5]; + if (pps_state>PPS_S_WAIT_PCK) { + pps[pps_i++] = pps_cur[5]; + } /* Show activity on LED */ led_blink(LED_GREEN, BLINK_2O_F); /* Print PPS */ - printf("PPS: "); + printf("PPS%s: ", complete ? "" : " (incomplete)"); uint8_t i; - for (i = 0; i < pps_i; i++) { + for (i = 0; i < pps_i; i++) { printf("%02x ", pps[i]); } printf("\n\r"); @@ -442,7 +451,7 @@ return; } struct sniff_data *usb_sniff_data_pps = (struct sniff_data *) msgb_put(usb_msg, sizeof(*usb_sniff_data_pps)); - usb_sniff_data_pps->complete = true; + usb_sniff_data_pps->complete = complete; usb_sniff_data_pps->length = pps_i; uint8_t *data = msgb_put(usb_msg, usb_sniff_data_pps->length); memcpy(data, pps, pps_i); @@ -527,7 +536,8 @@ check ^= pps_cur[4]; } check ^= pps_cur[5]; - usb_send_pps(); /* send PPS to host software using USB */ + pps_state = PPS_S_WAIT_END; + usb_send_pps(true); /* send PPS to host software using USB */ if (ISO7816_S_IN_PPS_REQ==iso_state) { if (0==check) { /* checksum is valid */ change_state(ISO7816_S_WAIT_PPS_RSP); /* go to next state */ @@ -553,15 +563,20 @@ change_state(ISO7816_S_WAIT_TPDU); /* go to next state */ } break; + case PPS_S_WAIT_END: + TRACE_WARNING("Unexpected PPS received %u\n\r", pps_state); + break; default: - TRACE_INFO("Unknown PPS state %u\n\r", pps_state); + TRACE_WARNING("Unknown PPS state %u\n\r", pps_state); + break; } } /*! Send current TPDU over USB - * @note Also print the TPDU over serial + * @param[in] complete if the TPDU is complete + * @note Also print the TPDU over the debug console */ -static void usb_send_tpdu(void) +static void usb_send_tpdu(bool complete) { /* Check state */ if (ISO7816_S_IN_TPDU!=iso_state) { @@ -573,7 +588,7 @@ led_blink(LED_GREEN, BLINK_2O_F); /* Print TPDU */ - printf("TPDU: "); + printf("TPDU%s: ", complete ? "" : " (incomplete)"); uint16_t i; for (i = 0; i < tpdu_packet_i && i < ARRAY_SIZE(tpdu_packet); i++) { printf("%02x ", tpdu_packet[i]); @@ -586,7 +601,7 @@ return; } struct sniff_data *usb_sniff_data_tpdu = (struct sniff_data *) msgb_put(usb_msg, sizeof(*usb_sniff_data_tpdu)); - usb_sniff_data_tpdu->complete = true; + usb_sniff_data_tpdu->complete = complete; usb_sniff_data_tpdu->length = tpdu_packet_i; uint8_t *data = msgb_put(usb_msg, usb_sniff_data_tpdu->length); memcpy(data, tpdu_packet, tpdu_packet_i); @@ -656,7 +671,7 @@ break; case TPDU_S_SW2: tpdu_packet[tpdu_packet_i++] = byte; - usb_send_tpdu(); /* send TPDU to host software using USB */ + usb_send_tpdu(true); /* send TPDU to host software using USB */ change_state(ISO7816_S_WAIT_TPDU); /* this is the end of the TPDU */ break; case TPDU_S_DATA_SINGLE: @@ -902,16 +917,16 @@ /* Use timeout to detect interrupted data transmission */ switch (iso_state) { case ISO7816_S_IN_ATR: - //usb_send_atr(false); /* send incomplete ATR to host software using USB */ + usb_send_atr(false); /* send incomplete ATR to host software using USB */ change_state(ISO7816_S_WAIT_ATR); break; case ISO7816_S_IN_TPDU: - //usb_send_tpdu(false); /* send incomplete PPS to host software using USB */ + usb_send_tpdu(false); /* send incomplete PPS to host software using USB */ change_state(ISO7816_S_WAIT_TPDU); break; case ISO7816_S_IN_PPS_REQ: case ISO7816_S_IN_PPS_RSP: - //usb_send_pps(false); /* send incomplete TPDU to host software using USB */ + usb_send_pps(false); /* send incomplete TPDU to host software using USB */ change_state(ISO7816_S_WAIT_TPDU); break; default: -- To view, visit https://gerrit.osmocom.org/9879 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ib070aca181042b477f1ffec48d63dc56c1e4609a Gerrit-Change-Number: 9879 Gerrit-PatchSet: 14 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 20:44:19 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 20:44:19 +0000 Subject: Change in simtrace2[master]: sniffing: fix procedure byte handling and make TPDU parsing more strict In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9880 ) Change subject: sniffing: fix procedure byte handling and make TPDU parsing more strict ...................................................................... sniffing: fix procedure byte handling and make TPDU parsing more strict Change-Id: If991152f11c4b864ab1386f21dc13c335e6b281f --- M firmware/libcommon/source/sniffer.c 1 file changed, 12 insertions(+), 4 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 2ad435c..1b6d5e7 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -176,7 +176,7 @@ */ uint8_t tpdu_packet[5+256+2]; /*! Current index in TPDU packet */ -uint8_t tpdu_packet_i = 0; +uint16_t tpdu_packet_i = 0; /*------------------------------------------------------------------------------ * Internal functions @@ -625,13 +625,19 @@ case TPDU_S_CLA: if (0xff==byte) { TRACE_WARNING("0xff is not a valid class byte\n\r"); - break; + change_state(ISO7816_S_WAIT_TPDU); /* go back to TPDU state */ + return; } tpdu_packet_i = 0; tpdu_packet[tpdu_packet_i++] = byte; tpdu_state = TPDU_S_INS; break; case TPDU_S_INS: + if ((0x60==(byte&0xf0)) || (0x90==(byte&0xf0))) { + TRACE_WARNING("invalid CLA 0x%02x\n\r", byte); + change_state(ISO7816_S_WAIT_TPDU); /* go back to TPDU state */ + return; + } tpdu_packet_i = 1; tpdu_packet[tpdu_packet_i++] = byte; tpdu_state = TPDU_S_P1; @@ -667,6 +673,8 @@ tpdu_state = TPDU_S_SW2; } else { TRACE_WARNING("invalid SW1 0x%02x\n\r", byte); + change_state(ISO7816_S_WAIT_TPDU); /* go back to TPDU state */ + return; } break; case TPDU_S_SW2: @@ -679,11 +687,11 @@ tpdu_packet[tpdu_packet_i++] = byte; if (0==tpdu_packet[4]) { if (5+256<=tpdu_packet_i) { - tpdu_state = TPDU_S_SW1; + tpdu_state = TPDU_S_PROCEDURE; } } else { if (5+tpdu_packet[4]<=tpdu_packet_i) { - tpdu_state = TPDU_S_SW1; + tpdu_state = TPDU_S_PROCEDURE; } } if (TPDU_S_DATA_SINGLE==tpdu_state) { -- To view, visit https://gerrit.osmocom.org/9880 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: If991152f11c4b864ab1386f21dc13c335e6b281f Gerrit-Change-Number: 9880 Gerrit-PatchSet: 15 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 20:44:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 20:44:21 +0000 Subject: Change in simtrace2[master]: sniffing: decrease USB IRQ prioprity to prevent USART overrun In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9881 ) Change subject: sniffing: decrease USB IRQ prioprity to prevent USART overrun ...................................................................... sniffing: decrease USB IRQ prioprity to prevent USART overrun Handling the USB message queue is done in an ISR and take quite some time. This can cause a USART/SIM sniffing buffer overrun, resulting in data loss. By setting the USB IRQ lower than the USART IRQ, the USB ISR can be interrupted (for short) and no data gets lost. Change-Id: I870a0aa8e251bbb53249c54bfcaa45de5b5a9486 --- M firmware/libcommon/source/sniffer.c 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 1b6d5e7..2a7ae5f 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -829,6 +829,10 @@ sniff_usart.base->US_RTOR = 9600-12; /* -12 because the timer starts at the end of the 12 ETU frame */ /* Enable interrupt to indicate when data has been received or timeout occurred */ USART_EnableIt(sniff_usart.base, US_IER_RXRDY | US_IER_TIMEOUT); + /* Set USB priority lower than USART to not miss sniffing data (both at 0 per default) */ + if (NVIC_GetPriority(IRQ_USART_SIM)>=NVIC_GetPriority(UDP_IRQn)) { + NVIC_SetPriority(UDP_IRQn, NVIC_GetPriority(IRQ_USART_SIM)+2); + } /* Enable interrupt requests for the USART peripheral */ NVIC_EnableIRQ(IRQ_USART_SIM); -- To view, visit https://gerrit.osmocom.org/9881 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I870a0aa8e251bbb53249c54bfcaa45de5b5a9486 Gerrit-Change-Number: 9881 Gerrit-PatchSet: 15 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 20:44:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 20:44:22 +0000 Subject: Change in simtrace2[master]: sniffer: add waiting time WT update In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9882 ) Change subject: sniffer: add waiting time WT update ...................................................................... sniffer: add waiting time WT update the waiting time (WT) is used to detect timeouts (e.g. for unresponsive card or just to signal an error/NAK). it is essential to detect to timeout to end current data transfer (e.g. change state). by default (after a reset) to timeout is 9600 ETU, but this can change at two places: - after the ATR using the value of TC2 (if present) - after a PPS (only F is used, and not D) because the timeout value can be larger than the 16-bit of the USART TO register, an external variable needs to be used for the count down. Change-Id: I9735660ffce161cec8d4e63fa60a66fc8ef57525 --- M firmware/libcommon/source/sniffer.c 1 file changed, 66 insertions(+), 6 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 2a7ae5f..87e6d32 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -178,6 +178,11 @@ /*! Current index in TPDU packet */ uint16_t tpdu_packet_i = 0; +/*! Waiting Time (WT) + * @note defined in ISO/IEC 7816-3:2006(E) section 8.1 and 10.2 + */ +uint32_t wt = 9600; + /*------------------------------------------------------------------------------ * Internal functions *------------------------------------------------------------------------------*/ @@ -188,6 +193,27 @@ */ static const uint8_t convention_convert_lut[256] = { 0xff, 0x7f, 0xbf, 0x3f, 0xdf, 0x5f, 0x9f, 0x1f, 0xef, 0x6f, 0xaf, 0x2f, 0xcf, 0x4f, 0x8f, 0x0f, 0xf7, 0x77, 0xb7, 0x37, 0xd7, 0x57, 0x97, 0x17, 0xe7, 0x67, 0xa7, 0x27, 0xc7, 0x47, 0x87, 0x07, 0xfb, 0x7b, 0xbb, 0x3b, 0xdb, 0x5b, 0x9b, 0x1b, 0xeb, 0x6b, 0xab, 0x2b, 0xcb, 0x4b, 0x8b, 0x0b, 0xf3, 0x73, 0xb3, 0x33, 0xd3, 0x53, 0x93, 0x13, 0xe3, 0x63, 0xa3, 0x23, 0xc3, 0x43, 0x83, 0x03, 0xfd, 0x7d, 0xbd, 0x3d, 0xdd, 0x5d, 0x9d, 0x1d, 0xed, 0x6d, 0xad, 0x2d, 0xcd, 0x4d, 0x8d, 0x0d, 0xf5, 0x75, 0xb5, 0x35, 0xd5, 0x55, 0x95, 0x15, 0xe5, 0x65, 0xa5, 0x25, 0xc5, 0x45, 0x85, 0x05, 0xf9, 0x79, 0xb9, 0x39, 0xd9, 0x59, 0x99, 0x19, 0xe9, 0x69, 0xa9, 0x29, 0xc9, 0x49, 0x89, 0x09, 0xf1, 0x71, 0xb1, 0x31, 0xd1, 0x51, 0x91, 0x11, 0xe1, 0x61, 0xa1, 0x21, 0xc1, 0x41, 0x81, 0x01, 0xfe, 0x7e, 0xbe, 0x3e, 0xde, 0x5e, 0x9e, 0x1e, 0xee, 0x6e, 0xae, 0x2e, 0xce, 0x4e, 0x8e, 0x0e, 0xf6, 0x76, 0xb6, 0x36, 0xd6, 0x56, 0x96, 0x16, 0xe6, 0x66, 0xa6, 0x26, 0xc6, 0x46, 0x86, 0x06, 0xfa, 0x7a, 0xba, 0x3a, 0xda, 0x5a, 0x9a, 0x1a, 0xea, 0x6a, 0xaa, 0x2a, 0xca, 0x4a, 0x8a, 0x0a, 0xf2, 0x72, 0xb2, 0x32, 0xd2, 0x52, 0x92, 0x12, 0xe2, 0x62, 0xa2, 0x22, 0xc2, 0x42, 0x82, 0x02, 0xfc, 0x7c, 0xbc, 0x3c, 0xdc, 0x5c, 0x9c, 0x1c, 0xec, 0x6c, 0xac, 0x2c, 0xcc, 0x4c, 0x8c, 0x0c, 0xf4, 0x74, 0xb4, 0x34, 0xd4, 0x54, 0x94, 0x14, 0xe4, 0x64, 0xa4, 0x24, 0xc4, 0x44, 0x84, 0x04, 0xf8, 0x78, 0xb8, 0x38, 0xd8, 0x58, 0x98, 0x18, 0xe8, 0x68, 0xa8, 0x28, 0xc8, 0x48, 0x88, 0x08, 0xf0, 0x70, 0xb0, 0x30, 0xd0, 0x50, 0x90, 0x10, 0xe0, 0x60, 0xa0, 0x20, 0xc0, 0x40, 0x80, 0x00, }; +/*! Update Waiting Time (WT) + * @param[in] wi Waiting Integer (0 if unchanged) + * @param[in] d Baud Rate divider (0 if unchanged) + * @note set wt to be used by the receiver timeout + * @note defined in ISO/IEC 7816-3:2006(E) section 8.1 and 10.2 + */ +static void update_wt(uint8_t wi, uint8_t d) +{ + static uint8_t wt_wi = 10; /* Waiting time Integer (WI), used to calculate the Waiting Time (WT) */ + static uint8_t wt_d = 1; /* baud rate adjustment integer (the actual value, not the table index) */ + + if (0!=wi) { + wt_wi = wi; + } + if (0!=d) { + wt_d = d; + } + wt = wt_wi*960UL*wt_d; + TRACE_INFO("WT updated to %u\n\r", wt); +} + /*! Allocate USB buffer and push + initialize simtrace_msg_hdr * @param[in] ep USB IN endpoint where the message will be sent to * @param[in] msg_class SIMtrace USB message class @@ -236,6 +262,7 @@ switch (iso_state_new) { case ISO7816_S_RESET: update_fidi(&sniff_usart, 0x11); /* reset baud rate to default Di/Fi values */ + update_wt(10, 1); /* reset WT time-out */ change_flags |= SNIFF_CHANGE_FLAG_RESET_HOLD; /* set flag and let main loop send it */ break; case ISO7816_S_WAIT_ATR: @@ -312,6 +339,7 @@ { static uint8_t atr_hist_len = 0; /* store the number of expected historical bytes */ static uint8_t y = 0; /* last mask of the upcoming TA, TB, TC, TD interface bytes */ + static uint8_t i = 0; /* interface byte subgroup number */ /* sanity check */ if (ISO7816_S_IN_ATR!=iso_state) { @@ -341,6 +369,7 @@ atr_i--; /* revert last byte */ TRACE_WARNING("Invalid TS received\n\r"); } + i = 0; /* first interface byte sub-group is coming (T0 is kind of TD0) */ break; case ATR_S_WAIT_T0: /* see ISO/IEC 7816-3:2006 section 8.2.2 */ case ATR_S_WAIT_TD: /* see ISO/IEC 7816-3:2006 section 8.2.3 */ @@ -350,6 +379,7 @@ t_protocol_support |= (1<<(byte&0x0f)); /* remember supported protocol to know if TCK will be present */ } y = (byte&0xf0); /* remember upcoming interface bytes */ + i++; /* next interface byte sub-group is coming */ if (y&0x10) { atr_state = ATR_S_WAIT_TA; /* wait for interface byte TA */ break; @@ -365,6 +395,14 @@ break; } case ATR_S_WAIT_TC: /* see ISO/IEC 7816-3:2006 section 8.2.3 */ + /* retrieve WI encoded in TC2*/ + if (ATR_S_WAIT_TC==atr_state && 2==i) { + if (0==byte) { + update_wt(10, 0); + } else { + update_wt(byte, 0); + } + } if (y&0x80) { atr_state = ATR_S_WAIT_TD; /* wait for interface byte TD */ break; @@ -556,6 +594,7 @@ } TRACE_INFO("PPS negotiation successful: Fn=%u Dn=%u\n\r", fi_table[fn], di_table[dn]); update_fidi(&sniff_usart, pps_cur[2]); + update_wt(0, di_table[dn]); usb_send_fidi(pps_cur[2]); /* send Fi/Di change notification to host software over USB */ } else { /* checksum is invalid */ TRACE_INFO("PPS negotiation failed\n\r"); @@ -706,6 +745,9 @@ /*! Interrupt Service Routine called on USART activity */ void Sniffer_usart_isr(void) { + /* Remaining Waiting Time (WI) counter (>16 bits) */ + static volatile uint32_t wt_remaining = 9600; + /* Read channel status register */ uint32_t csr = sniff_usart.base->US_CSR; /* Verify if there was an error */ @@ -717,10 +759,13 @@ TRACE_WARNING("USART framing error\n\r"); sniff_usart.base->US_CR |= US_CR_RSTSTA; } + /* Verify if character has been received */ if (csr & US_CSR_RXRDY) { /* Read communication data byte between phone and SIM */ uint8_t byte = sniff_usart.base->US_RHR; + /* Reset WT timer */ + wt_remaining = wt; /* Store sniffed data into buffer (also clear interrupt */ if (rbuf_is_full(&sniff_buffer)) { TRACE_ERROR("USART buffer full\n\r"); @@ -728,13 +773,28 @@ rbuf_write(&sniff_buffer, byte); } } - + /* Verify it WT timeout occurred, to detect unresponsive card */ if (csr & US_CSR_TIMEOUT) { - /* Stop timeout until next character is received */ + if (wt_remaining<=(sniff_usart.base->US_RTOR&0xffff)) { + /* Just set the flag and let the main loop handle it */ + change_flags |= SNIFF_CHANGE_FLAG_TIMEOUT_WT; + /* Reset timeout value */ + wt_remaining = wt; + } else { + wt_remaining -= (sniff_usart.base->US_RTOR&0xffff); /* be sure to subtract the actual timeout since the new might not have been set and reloaded yet */ + } + if (wt_remaining>0xffff) { + sniff_usart.base->US_RTOR = 0xffff; + } else { + sniff_usart.base->US_RTOR = wt_remaining; + } + /* Stop timeout until next character is received (and clears the timeout flag) */ sniff_usart.base->US_CR |= US_CR_STTTO; - /* Just set the flag and let the main loop handle it */ - change_flags |= SNIFF_CHANGE_FLAG_TIMEOUT_WT; + if (!(change_flags & SNIFF_CHANGE_FLAG_TIMEOUT_WT)) { + /* Immediately restart the counter it the WT timeout did not occur (needs the timeout flag to be cleared) */ + sniff_usart.base->US_CR |= US_CR_RETTO; + } } } @@ -825,8 +885,8 @@ ISO7816_Init(&sniff_usart, CLK_SLAVE); /* Only receive data when sniffing */ USART_SetReceiverEnabled(sniff_usart.base, 1); - /* Enable Receiver time-out WT to detect unresponsive cards */ - sniff_usart.base->US_RTOR = 9600-12; /* -12 because the timer starts at the end of the 12 ETU frame */ + /* Enable Receiver time-out to detect waiting time (WT) time-out (e.g. unresponsive cards) */ + sniff_usart.base->US_RTOR = wt; /* Enable interrupt to indicate when data has been received or timeout occurred */ USART_EnableIt(sniff_usart.base, US_IER_RXRDY | US_IER_TIMEOUT); /* Set USB priority lower than USART to not miss sniffing data (both at 0 per default) */ -- To view, visit https://gerrit.osmocom.org/9882 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I9735660ffce161cec8d4e63fa60a66fc8ef57525 Gerrit-Change-Number: 9882 Gerrit-PatchSet: 15 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 20:44:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 20:44:22 +0000 Subject: Change in simtrace2[master]: minor style change: use ARRAY_SIZE In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9886 ) Change subject: minor style change: use ARRAY_SIZE ...................................................................... minor style change: use ARRAY_SIZE Change-Id: Ia5243c342535963a3800849cd5a7d183a510d2d6 --- M firmware/apps/trace/main.c 1 file changed, 1 insertion(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/apps/trace/main.c b/firmware/apps/trace/main.c index a288a7b..754e905 100644 --- a/firmware/apps/trace/main.c +++ b/firmware/apps/trace/main.c @@ -169,8 +169,7 @@ } TRACE_INFO("calling configure of all configurations...\n\r"); - for (i = 1; i < sizeof(config_func_ptrs) / sizeof(config_func_ptrs[0]); - ++i) { + for (i = 1; i < ARRAY_SIZE(config_func_ptrs); i++) { if (config_func_ptrs[i].configure) config_func_ptrs[i].configure(); } -- To view, visit https://gerrit.osmocom.org/9886 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ia5243c342535963a3800849cd5a7d183a510d2d6 Gerrit-Change-Number: 9886 Gerrit-PatchSet: 7 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 4 20:44:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 4 Jul 2018 20:44:23 +0000 Subject: Change in simtrace2[master]: fix LED switching on/off In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9887 ) Change subject: fix LED switching on/off ...................................................................... fix LED switching on/off In the SIMtrace and QMOD schematics the LEDs are connected to +3.3V. Thus to switch the LED on we need to set the pin low. Change-Id: Id8cc27e6f0b6556ba5e7ea4d254dd0fe59042a0c --- M firmware/libboard/common/source/led.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libboard/common/source/led.c b/firmware/libboard/common/source/led.c index 540f031..00082e2 100644 --- a/firmware/libboard/common/source/led.c +++ b/firmware/libboard/common/source/led.c @@ -16,9 +16,9 @@ ASSERT(led < PIO_LISTSIZE(pinsLeds)); if (on) - PIO_Set(&pinsLeds[led]); - else PIO_Clear(&pinsLeds[led]); + else + PIO_Set(&pinsLeds[led]); } /* LED blinking code */ -- To view, visit https://gerrit.osmocom.org/9887 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Id8cc27e6f0b6556ba5e7ea4d254dd0fe59042a0c Gerrit-Change-Number: 9887 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 06:55:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 5 Jul 2018 06:55:57 +0000 Subject: Change in osmo-ci[master]: jobs: gerrit: use debian-9 In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9545 ) Change subject: jobs: gerrit: use debian-9 ...................................................................... Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/9545 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9204ca2f083c8a6a04c6c0fc7d51752a4f1a4830 Gerrit-Change-Number: 9545 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Thu, 05 Jul 2018 06:55:57 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 06:56:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 5 Jul 2018 06:56:44 +0000 Subject: Change in osmo-ci[master]: verify_value_string_arrays_are_terminated.py: allow dir args and no args In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9544 ) Change subject: verify_value_string_arrays_are_terminated.py: allow dir args and no args ...................................................................... Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/9544 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I36456383906b6295c798b82aa131dda21f8efc02 Gerrit-Change-Number: 9544 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Thu, 05 Jul 2018 06:56:44 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 06:56:49 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 5 Jul 2018 06:56:49 +0000 Subject: Change in osmo-ci[master]: verify_value_string_arrays_are_terminated.py: allow dir args and no args In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9544 ) Change subject: verify_value_string_arrays_are_terminated.py: allow dir args and no args ...................................................................... verify_value_string_arrays_are_terminated.py: allow dir args and no args So far we call with a $(find . -name "*.[hc]") argument list, which might become too long at some point. Rather include dir walking in the script itself and allow passing dir arguments as well. This is backwards compatible, calling with above file args still works. Change-Id: I36456383906b6295c798b82aa131dda21f8efc02 --- M scripts/verify_value_string_arrays_are_terminated.py 1 file changed, 18 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/scripts/verify_value_string_arrays_are_terminated.py b/scripts/verify_value_string_arrays_are_terminated.py index ad936a5..9f0ad82 100755 --- a/scripts/verify_value_string_arrays_are_terminated.py +++ b/scripts/verify_value_string_arrays_are_terminated.py @@ -3,7 +3,7 @@ ''' Usage: - verify_value_string_arrays_are_terminated.py PATH [PATH [...]] + verify_value_string_arrays_are_terminated.py [ROOT_DIR|PATH] [...] e.g. libosmocore/contrib/verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") @@ -12,6 +12,7 @@ import re import sys import codecs +import os.path value_string_array_re = re.compile( r'((\bstruct\s+value_string\b[^{;]*?)\s*=[^{;]*{[^;]*}\s*;)', @@ -22,7 +23,10 @@ '\s*' + members + '(0|NULL)\s*}') errors_found = 0 -for f in sys.argv[1:]: +def check_file(f): + global errors_found + if not (f.endswith('.h') or f.endswith('.c') or f.endswith('.cpp')): + return arrays = value_string_array_re.findall(codecs.open(f, "r", "utf-8").read()) for array_def, name in arrays: if not terminator_re.search(array_def): @@ -30,4 +34,16 @@ % (name, f)) errors_found += 1 +args = sys.argv[1:] +if not args: + args = ['.'] + +for f in args: + if os.path.isdir(f): + for parent_path, subdirs, files in os.walk(f, None, None): + for ff in files: + check_file(os.path.join(parent_path, ff)) + else: + check_file(f) + sys.exit(errors_found) -- To view, visit https://gerrit.osmocom.org/9544 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I36456383906b6295c798b82aa131dda21f8efc02 Gerrit-Change-Number: 9544 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 06:56:49 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 5 Jul 2018 06:56:49 +0000 Subject: Change in osmo-ci[master]: jobs: gerrit: use debian-9 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9545 ) Change subject: jobs: gerrit: use debian-9 ...................................................................... jobs: gerrit: use debian-9 This is the same as done for the master builds in I6f025c642d5ae57cdda9d7b34bbaeb82ca119354, seems I forgot to follow up with this one. Change-Id: I9204ca2f083c8a6a04c6c0fc7d51752a4f1a4830 --- M jobs/gerrit-verifications.yml 1 file changed, 2 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified lynxis lazus: Looks good to me, approved diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index 0d977b2..6ccccbc 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -8,7 +8,7 @@ concurrent: false node: osmocom-gerrit-debian8 # axes related defaults - slave_axis: !!python/tuple [osmocom-gerrit-debian8] + slave_axis: !!python/tuple [osmocom-gerrit-debian9] a1_name: a1 a1: !!python/tuple [default] a2_name: a2 @@ -108,8 +108,7 @@ - osmo-gsm-manuals - - osmo-hlr: - slave_axis: !!python/tuple [osmocom-gerrit-debian8, osmocom-gerrit-debian9] + - osmo-hlr - osmo-iuh @@ -174,7 +173,6 @@ - osmo-sip-connector - osmo-trx: - slave_axis: !!python/tuple [osmocom-gerrit-debian9] a1_name: INSTR # ARM variants temporarily disabled due to issue OS#3061 # a1: !!python/tuple [--with-sse, --with-neon, --with-neon-vfpv4] -- To view, visit https://gerrit.osmocom.org/9545 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I9204ca2f083c8a6a04c6c0fc7d51752a4f1a4830 Gerrit-Change-Number: 9545 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 09:41:46 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 5 Jul 2018 09:41:46 +0000 Subject: Change in osmo-ttcn3-hacks[master]: GGSN_Tests: test what happens when PCO contains only one DNS entry In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9394 to look at the new patch set (#2). Change subject: GGSN_Tests: test what happens when PCO contains only one DNS entry ...................................................................... GGSN_Tests: test what happens when PCO contains only one DNS entry When the protocol configuration options (PCO) contain an IPCP container then lists only one one DNS server (normally there are two included, a primary and a secondary). Than the parser in osmo-ggsn runs into an endles loop. This testcase tries to provoke this behavior by sending PDP CONTEXT ACTIVATE messages with PCO that contain only a single DNS entry per IPCP container. The hanging of osmo-ggsn is already fixed (see Depends). However when Primary and Secondary DNS are in separate IPCP containers, then only the first IPCP container is parsed (see also OS#3381) Change-Id: I71761e1f9db7ceac3c3df43d2e539f8c8d53c4fc Depends: osmo-msc Icffde89f9bc5d8fcadf6e2dd6c0b4de03440edd5 Closes: OS#3288 Related: OS#3381 --- M ggsn_tests/GGSN_Tests.ttcn M ggsn_tests/expected-results.xml M library/GTP_Templates.ttcn 3 files changed, 120 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/94/9394/2 -- To view, visit https://gerrit.osmocom.org/9394 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I71761e1f9db7ceac3c3df43d2e539f8c8d53c4fc Gerrit-Change-Number: 9394 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 11:16:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 5 Jul 2018 11:16:55 +0000 Subject: Change in osmo-ttcn3-hacks[master]: GGSN_Tests: test what happens when PCO contains only one DNS entry In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9394 ) Change subject: GGSN_Tests: test what happens when PCO contains only one DNS entry ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9394 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I71761e1f9db7ceac3c3df43d2e539f8c8d53c4fc Gerrit-Change-Number: 9394 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 05 Jul 2018 11:16:55 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 11:21:21 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 5 Jul 2018 11:21:21 +0000 Subject: Change in osmo-ttcn3-hacks[master]: GGSN_Tests: test what happens when PCO contains only one DNS entry In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9394 ) Change subject: GGSN_Tests: test what happens when PCO contains only one DNS entry ...................................................................... Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/9394/2/ggsn_tests/GGSN_Tests.ttcn File ggsn_tests/GGSN_Tests.ttcn: https://gerrit.osmocom.org/#/c/9394/2/ggsn_tests/GGSN_Tests.ttcn at 964 PS2, Line 964: pco_neg_dns_expected := '0200000A8306'O & ggsn_ip4_dns2 What's this hardcoded hex string here for? -- To view, visit https://gerrit.osmocom.org/9394 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I71761e1f9db7ceac3c3df43d2e539f8c8d53c4fc Gerrit-Change-Number: 9394 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 05 Jul 2018 11:21:21 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 12:07:42 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 5 Jul 2018 12:07:42 +0000 Subject: Change in libosmo-netif[master]: stream.c: Use non-blocking connect in osmo_stream_cli Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/9888 Change subject: stream.c: Use non-blocking connect in osmo_stream_cli ...................................................................... stream.c: Use non-blocking connect in osmo_stream_cli When establishing a client-side stream connection via libosmo-netif, we must using non-blocking connect if we want to avoid blocking/stalling the entire process. The libosmocore socket API provides the OSMO_SOCK_F_NONBLOCK flag for this. Make use of it! Change-Id: I9bfcb39b5801a36ef32ca0d1f3eb8236687d7ed6 Related: OS#3383 --- M src/stream.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/88/9888/1 diff --git a/src/stream.c b/src/stream.c index 9dcb94b..6eb2313 100644 --- a/src/stream.c +++ b/src/stream.c @@ -451,7 +451,7 @@ ret = osmo_sock_init2(AF_INET, SOCK_STREAM, cli->proto, cli->local_addr, cli->local_port, cli->addr, cli->port, - OSMO_SOCK_F_CONNECT|OSMO_SOCK_F_BIND); + OSMO_SOCK_F_CONNECT|OSMO_SOCK_F_BIND|OSMO_SOCK_F_NONBLOCK); if (ret < 0) { if (reconnect) osmo_stream_cli_reconnect(cli); -- To view, visit https://gerrit.osmocom.org/9888 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I9bfcb39b5801a36ef32ca0d1f3eb8236687d7ed6 Gerrit-Change-Number: 9888 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Thu Jul 5 12:26:47 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Thu, 5 Jul 2018 12:26:47 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-gapk_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#11?= In-Reply-To: <1935380069.53.1530707208638.JavaMail.jenkins@jenkins.osmocom.org> References: <1935380069.53.1530707208638.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <11270302.69.1530793608007.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 127.17 KB...] checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether make supports nested variables... (cached) yes checking if gcc supports -fvisibility=hidden... yes checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking whether gcc understands -c and -o together... (cached) yes checking dependency style of gcc... (cached) gcc3 checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for LIBOSMOCORE... yes checking for LIBOSMOCODEC... yes checking for LIBALSA... yes checking for OPENCORE_AMRNB... yes checking gsm/gsm.h usability... yes checking gsm/gsm.h presence... yes checking for gsm/gsm.h... yes checking for gsm_create in -lgsm... yes checking for stdint.h... (cached) yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking for unistd.h... (cached) yes checking for inline... inline checking for int16_t... yes checking for int32_t... yes checking for uint16_t... yes checking for uint32_t... yes checking for uint64_t... yes checking for uint8_t... yes checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... yes checking for memset... yes checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating src/Makefile config.status: creating libgsmhr/Makefile config.status: creating include/Makefile config.status: creating include/gsmhr/Makefile config.status: creating libosmogapk.pc config.status: creating tests/atlocal config.status: creating tests/Makefile config.status: creating config.h config.status: executing depfiles commands config.status: executing libtool commands config.status: executing tests/atconfig commands make[1]: Entering directory ' make all-recursive make[2]: Entering directory ' Making all in include make[3]: Entering directory ' make[4]: Entering directory ' make[4]: Nothing to be done for 'all-am'. make[4]: Leaving directory ' make[3]: Leaving directory ' Making all in src make[3]: Entering directory ' CC procqueue.lo CC pq_format.lo CC pq_codec.lo CC pq_file.lo CC pq_alsa.lo CC pq_rtp.lo CC pq_ecu.lo CC ecu_fr.lo CC formats.lo CC fmt_ti.lo CC fmt_amr.lo CC fmt_gsm.lo CC fmt_hr_ref.lo CC fmt_racal.lo CC fmt_rawpcm.lo CC fmt_rtp_amr.lo CC fmt_rtp_efr.lo CC fmt_rtp_hr_etsi.lo CC fmt_rtp_hr_ietf.lo CC fmt_amr_opencore.lo CC codecs.lo CC codec_pcm.lo CC codec_hr.lo CC codec_fr.lo CC codec_efr.lo CC codec_amr.lo CC benchmark.lo CC common.lo CCLD libosmogapk.la CC app_osmo_gapk.o CCLD osmo-gapk make[3]: Leaving directory ' Making all in tests make[3]: Entering directory ' make[3]: Nothing to be done for 'all'. make[3]: Leaving directory ' make[3]: Entering directory ' make[3]: Leaving directory ' make[2]: Leaving directory ' make[1]: Leaving directory ' make[1]: Entering directory ' Making dvi in include make[2]: Entering directory ' make[3]: Entering directory ' make[3]: Nothing to be done for 'dvi-am'. make[3]: Leaving directory ' make[2]: Leaving directory ' Making dvi in src make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi'. make[2]: Leaving directory ' Making dvi in tests make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi'. make[2]: Leaving directory ' make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi-am'. make[2]: Leaving directory ' make[1]: Leaving directory ' make[1]: Entering directory ' Making check in include make[2]: Entering directory ' make[3]: Entering directory ' make[3]: Nothing to be done for 'check-am'. make[3]: Leaving directory ' make[2]: Leaving directory ' Making check in src make[2]: Entering directory ' make[2]: Nothing to be done for 'check'. make[2]: Leaving directory ' Making check in tests make[2]: Entering directory ' make procqueue/pq_test io/pq_file_test io/pq_rtp_test ecu/ecu_fr_test make[3]: Entering directory ' CC procqueue/pq_test.o CCLD procqueue/pq_test CC io/pq_file_test.o CCLD io/pq_file_test CC io/pq_rtp_test.o CCLD io/pq_rtp_test CC ecu/ecu_fr_test.o CCLD ecu/ecu_fr_test make[3]: Leaving directory ' make check-local make[3]: Entering directory ' /bin/bash '../../../tests/testsuite' ## ---------------------------- ## ## gapk 0.4.75-27bc test suite. ## ## ---------------------------- ## Regression tests. 1: procqueue ok 2: io/pq_file FAILED (testsuite.at:13) 3: io/pq_rtp ok 4: ecu/ecu_fr_test ok 5: conv/enc/amr_efr ok 6: conv/enc/gsm ok 7: conv/enc/racal_hr skipped (testsuite.at:58) 8: conv/enc/racal_fr ok 9: conv/enc/racal_efr ok 10: conv/enc/ti_hr skipped (testsuite.at:91) 11: conv/enc/ti_fr ok 12: conv/enc/ti_efr ok 13: conv/enc/rtp_efr ok 14: conv/enc/rtp_hr_etsi skipped (testsuite.at:135) 15: conv/enc/rtp_hr_ietf skipped (testsuite.at:146) 16: conv/dec/amr_efr ok 17: conv/dec/gsm ok 18: conv/dec/racal_hr skipped (testsuite.at:179) 19: conv/dec/racal_fr ok 20: conv/dec/racal_efr ok 21: conv/dec/ti_hr skipped (testsuite.at:212) 22: conv/dec/ti_fr ok 23: conv/dec/ti_efr ok 24: conv/dec/rtp_efr ok 25: conv/dec/rtp_hr_etsi skipped (testsuite.at:256) 26: conv/dec/rtp_hr_ietf skipped (testsuite.at:267) ## ------------- ## ## Test results. ## ## ------------- ## ERROR: 18 tests were run, 1 failed unexpectedly. 8 tests were skipped. ## -------------------------- ## ## testsuite.log was created. ## ## -------------------------- ## Please send `tests/testsuite.log' and all information you think might help: To: Subject: [gapk 0.4.75-27bc] testsuite: 2 failed You may investigate any problem if you feel able to do so, in which case the test suite provides a good starting point. Its output may be found below `tests/testsuite.dir'. Makefile:753: recipe for target 'check-local' failed make[3]: *** [check-local] Error 1 make[3]: Leaving directory ' Makefile:602: recipe for target 'check-am' failed make[2]: *** [check-am] Error 2 make[2]: Leaving directory ' Makefile:479: recipe for target 'check-recursive' failed make[1]: *** [check-recursive] Error 1 make[1]: Leaving directory ' Makefile:684: recipe for target 'distcheck' failed make: *** [distcheck] Error 1 + cat-testlogs.sh ======================== ./gapk-0.4.75-27bc/_build/sub/tests/testsuite.dir/02/testsuite.log # -*- compilation -*- 2. testsuite.at:10: testing io/pq_file ... ../../../tests/testsuite.at:13: $abs_top_builddir/tests/io/pq_file_test \ $abs_top_builddir/tests/io/io_sample.txt --- /dev/null 2018-03-27 19:17:06.212284948 +0000 +++ 2018-07-05 12:26:47.287087319 +0000 @@ -0,0 +1,2 @@ +pq_file_test: ../../../tests/io/pq_file_test.c:132: main: Assertion `sample_file != NULL' failed. +: line 29: 21143 Aborted $abs_top_builddir/tests/io/pq_file_test $abs_top_builddir/tests/io/io_sample.txt --- expout 2018-07-05 12:26:47.275087394 +0000 +++ 2018-07-05 12:26:47.275087394 +0000 @@ -1,12 +0,0 @@ -Processing sample file with blk_len=2: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=4: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=8: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=16: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=32: -8217c8fb7675a95008f9089d883gapk - -chunk null_context: depth=0 ../../../tests/testsuite.at:13: exit code was 134, expected 0 2. testsuite.at:10: 2. io/pq_file (testsuite.at:10): FAILED (testsuite.at:13) Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Thu Jul 5 12:54:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 5 Jul 2018 12:54:08 +0000 Subject: Change in libosmo-netif[master]: stream.c: Use non-blocking connect in osmo_stream_cli In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9888 ) Change subject: stream.c: Use non-blocking connect in osmo_stream_cli ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9888 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9bfcb39b5801a36ef32ca0d1f3eb8236687d7ed6 Gerrit-Change-Number: 9888 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Thu, 05 Jul 2018 12:54:08 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 12:54:09 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 5 Jul 2018 12:54:09 +0000 Subject: Change in libosmo-netif[master]: stream.c: Use non-blocking connect in osmo_stream_cli In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9888 ) Change subject: stream.c: Use non-blocking connect in osmo_stream_cli ...................................................................... stream.c: Use non-blocking connect in osmo_stream_cli When establishing a client-side stream connection via libosmo-netif, we must using non-blocking connect if we want to avoid blocking/stalling the entire process. The libosmocore socket API provides the OSMO_SOCK_F_NONBLOCK flag for this. Make use of it! Change-Id: I9bfcb39b5801a36ef32ca0d1f3eb8236687d7ed6 Related: OS#3383 --- M src/stream.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/stream.c b/src/stream.c index 9dcb94b..6eb2313 100644 --- a/src/stream.c +++ b/src/stream.c @@ -451,7 +451,7 @@ ret = osmo_sock_init2(AF_INET, SOCK_STREAM, cli->proto, cli->local_addr, cli->local_port, cli->addr, cli->port, - OSMO_SOCK_F_CONNECT|OSMO_SOCK_F_BIND); + OSMO_SOCK_F_CONNECT|OSMO_SOCK_F_BIND|OSMO_SOCK_F_NONBLOCK); if (ret < 0) { if (reconnect) osmo_stream_cli_reconnect(cli); -- To view, visit https://gerrit.osmocom.org/9888 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I9bfcb39b5801a36ef32ca0d1f3eb8236687d7ed6 Gerrit-Change-Number: 9888 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 13:32:51 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 5 Jul 2018 13:32:51 +0000 Subject: Change in osmo-mgw[master]: stats: replace packet statistic counters with libosmocore rate counters In-Reply-To: References: Message-ID: Hello Stefan Sperling, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9837 to look at the new patch set (#2). Change subject: stats: replace packet statistic counters with libosmocore rate counters ...................................................................... stats: replace packet statistic counters with libosmocore rate counters In struct mgcp_rtp_end one finds unsigned int counters. Those should be replaced with libosmocore rate counters - replace packets_rx, octets_rx, packets_tx, octets_tx and dropped_packets with libosmocore rate counters. Change-Id: I47c5c9006df5044e59ddebb895e62adb849d72d5 Related: OS#2517 --- M include/osmocom/mgcp/mgcp_conn.h M include/osmocom/mgcp/mgcp_internal.h M include/osmocom/mgcp/mgcp_stat.h M src/libosmo-mgcp/mgcp_conn.c M src/libosmo-mgcp/mgcp_network.c M src/libosmo-mgcp/mgcp_osmux.c M src/libosmo-mgcp/mgcp_stat.c M src/libosmo-mgcp/mgcp_vty.c M tests/mgcp/mgcp_test.c 9 files changed, 77 insertions(+), 55 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/37/9837/2 -- To view, visit https://gerrit.osmocom.org/9837 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I47c5c9006df5044e59ddebb895e62adb849d72d5 Gerrit-Change-Number: 9837 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-CC: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 13:45:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 5 Jul 2018 13:45:53 +0000 Subject: Change in osmo-mgw[master]: stats: replace packet statistic counters with libosmocore rate counters In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9837 ) Change subject: stats: replace packet statistic counters with libosmocore rate counters ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/9837 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I47c5c9006df5044e59ddebb895e62adb849d72d5 Gerrit-Change-Number: 9837 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-Comment-Date: Thu, 05 Jul 2018 13:45:53 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 13:55:23 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 5 Jul 2018 13:55:23 +0000 Subject: Change in osmo-mgw[master]: stats: replace packet statistic counters with libosmocore rate counters In-Reply-To: References: Message-ID: Hello Stefan Sperling, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9837 to look at the new patch set (#3). Change subject: stats: replace packet statistic counters with libosmocore rate counters ...................................................................... stats: replace packet statistic counters with libosmocore rate counters In struct mgcp_rtp_end one finds unsigned int counters. Those should be replaced with libosmocore rate counters - replace packets_rx, octets_rx, packets_tx, octets_tx and dropped_packets with libosmocore rate counters. Change-Id: I47c5c9006df5044e59ddebb895e62adb849d72d5 Related: OS#2517 --- M include/osmocom/mgcp/mgcp_conn.h M include/osmocom/mgcp/mgcp_internal.h M include/osmocom/mgcp/mgcp_stat.h M src/libosmo-mgcp/mgcp_conn.c M src/libosmo-mgcp/mgcp_network.c M src/libosmo-mgcp/mgcp_osmux.c M src/libosmo-mgcp/mgcp_stat.c M src/libosmo-mgcp/mgcp_vty.c M tests/mgcp/mgcp_test.c 9 files changed, 86 insertions(+), 55 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/37/9837/3 -- To view, visit https://gerrit.osmocom.org/9837 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I47c5c9006df5044e59ddebb895e62adb849d72d5 Gerrit-Change-Number: 9837 Gerrit-PatchSet: 3 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 14:18:10 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 5 Jul 2018 14:18:10 +0000 Subject: Change in osmo-ttcn3-hacks[master]: GGSN_Tests: test what happens when PCO contains only one DNS entry In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9394 to look at the new patch set (#3). Change subject: GGSN_Tests: test what happens when PCO contains only one DNS entry ...................................................................... GGSN_Tests: test what happens when PCO contains only one DNS entry When the protocol configuration options (PCO) contain an IPCP container then lists only one one DNS server (normally there are two included, a primary and a secondary). Than the parser in osmo-ggsn runs into an endles loop. This testcase tries to provoke this behavior by sending PDP CONTEXT ACTIVATE messages with PCO that contain only a single DNS entry per IPCP container. The hanging of osmo-ggsn is already fixed (see Depends). However when Primary and Secondary DNS are in separate IPCP containers, then only the first IPCP container is parsed (see also OS#3381) Change-Id: I71761e1f9db7ceac3c3df43d2e539f8c8d53c4fc Depends: osmo-msc Icffde89f9bc5d8fcadf6e2dd6c0b4de03440edd5 Closes: OS#3288 Related: OS#3381 --- M ggsn_tests/GGSN_Tests.ttcn M ggsn_tests/expected-results.xml M library/GTP_Templates.ttcn 3 files changed, 127 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/94/9394/3 -- To view, visit https://gerrit.osmocom.org/9394 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I71761e1f9db7ceac3c3df43d2e539f8c8d53c4fc Gerrit-Change-Number: 9394 Gerrit-PatchSet: 3 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 14:30:19 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 5 Jul 2018 14:30:19 +0000 Subject: Change in openbsc[master]: rtp_proxy: use 3GPP assigned payload type numbers In-Reply-To: References: Message-ID: dexter has posted comments on this change. ( https://gerrit.osmocom.org/9782 ) Change subject: rtp_proxy: use 3GPP assigned payload type numbers ...................................................................... Patch Set 1: > I'm not sure what we gain from this in openbsc.git. There's no > 3GPP AoIP in openbsc.git, and the definitions by 3GPP are specific > to that iterface. I thought it might be better to use the 3GPP payload type numbers here as well, but yes. It does not improve anything but introduces a risk of a regression (nanoBTS, various PBXes and what not...) -- To view, visit https://gerrit.osmocom.org/9782 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I96784be13254b16744211ed3bd1c9e6ad9a792ba Gerrit-Change-Number: 9782 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-Comment-Date: Thu, 05 Jul 2018 14:30:19 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 14:30:22 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 5 Jul 2018 14:30:22 +0000 Subject: Change in openbsc[master]: rtp_proxy: use 3GPP assigned payload type numbers In-Reply-To: References: Message-ID: dexter has abandoned this change. ( https://gerrit.osmocom.org/9782 ) Change subject: rtp_proxy: use 3GPP assigned payload type numbers ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/9782 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: I96784be13254b16744211ed3bd1c9e6ad9a792ba Gerrit-Change-Number: 9782 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 14:54:15 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Thu, 5 Jul 2018 14:54:15 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS_Tests: Call mtc.stop in f_shutdown() to fix sporadic test failures Message-ID: daniel has uploaded this change for review. ( https://gerrit.osmocom.org/9889 Change subject: BTS_Tests: Call mtc.stop in f_shutdown() to fix sporadic test failures ...................................................................... BTS_Tests: Call mtc.stop in f_shutdown() to fix sporadic test failures mtc.stop cleanly shuts down a testcase. This avoids errors influencing the result after the test completed (such as ports being shutdown with messages arriving on them causing a dynamic test case error). Change-Id: I0f6e10006f46db0d68796c7082497af90f74cd07 --- M bts/BTS_Tests.ttcn 1 file changed, 2 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/89/9889/1 diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index b77a70a..dbb8313 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -341,10 +341,8 @@ } function f_shutdown() runs on test_CT { - /* shut down all "externally interfaced" components first to avoid unclean shutdown */ - vc_IPA.stop; - vc_RSL.stop; - f_ipa_ctrl_stop(); + /* mtc.stop cleanly stops testcase execution to avoid unclean shutdown */ + mtc.stop; } /* Attach L1CTL to master test_CT (classic tests, non-handler mode) */ -- To view, visit https://gerrit.osmocom.org/9889 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I0f6e10006f46db0d68796c7082497af90f74cd07 Gerrit-Change-Number: 9889 Gerrit-PatchSet: 1 Gerrit-Owner: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 14:54:16 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Thu, 5 Jul 2018 14:54:16 +0000 Subject: Change in osmo-ttcn3-hacks[master]: Stop testcase execution after failing Message-ID: daniel has uploaded this change for review. ( https://gerrit.osmocom.org/9890 Change subject: Stop testcase execution after failing ...................................................................... Stop testcase execution after failing This hopefully prevents the verdict from changing to a dynamic test case error during an unclean termination Change-Id: I20e156982ae8150a9e7a145f66283de4a5d8e0bd --- M bts/BTS_Tests.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/90/9890/1 diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index dbb8313..0583171 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -757,7 +757,7 @@ var octetstring l3 := substr(dl.payload.data_ind.payload, 4, 19); if (match(l3, l3_exp)) { setverdict(fail, "Received unexpected SACCH ", dl); - self.stop; + mtc.stop; } else { repeat; } -- To view, visit https://gerrit.osmocom.org/9890 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I20e156982ae8150a9e7a145f66283de4a5d8e0bd Gerrit-Change-Number: 9890 Gerrit-PatchSet: 1 Gerrit-Owner: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 14:54:16 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Thu, 5 Jul 2018 14:54:16 +0000 Subject: Change in osmo-ttcn3-hacks[master]: Call f_shutdown after setting the verdict in TC_paging_* Message-ID: daniel has uploaded this change for review. ( https://gerrit.osmocom.org/9891 Change subject: Call f_shutdown after setting the verdict in TC_paging_* ...................................................................... Call f_shutdown after setting the verdict in TC_paging_* Since f_shutdown now ends the testcase by calling mtc.stop we need to set a verdict first. Change-Id: Ia9dfcb1dd90e0f6fe61cf88a8de4c10a0cad4009 --- M bts/BTS_Tests.ttcn 1 file changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/91/9891/1 diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index 0583171..f66a43f 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -1668,8 +1668,6 @@ [] as_rsl_res_ind(); } - f_shutdown(); - log("num_paging_sent=", st.num_paging_sent, " rcvd_msgs=", st.num_paging_rcv_msgs, " rcvd_ids=", st.num_paging_rcv_ids); return st; @@ -1695,6 +1693,7 @@ } else { setverdict(pass); } + f_shutdown(); } /* Create ~ 80% paging load (TMSI only) sustained for about 20s, verifying that @@ -1717,6 +1716,7 @@ } else { setverdict(pass); } + f_shutdown(); } /* Create ~ 200% paging load (IMSI only) sustained for about 20s, verifying that @@ -1741,6 +1741,7 @@ } else { setverdict(pass); } + f_shutdown(); } /* Create ~ 200% paging load (TMSI only) sustained for about 20s, verifying that @@ -1765,6 +1766,7 @@ } else { setverdict(pass); } + f_shutdown(); } -- To view, visit https://gerrit.osmocom.org/9891 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ia9dfcb1dd90e0f6fe61cf88a8de4c10a0cad4009 Gerrit-Change-Number: 9891 Gerrit-PatchSet: 1 Gerrit-Owner: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 14:57:57 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 5 Jul 2018 14:57:57 +0000 Subject: Change in osmo-bsc[master]: rsl: use 3GPP assigned payload type numbers In-Reply-To: References: Message-ID: dexter has posted comments on this change. ( https://gerrit.osmocom.org/9781 ) Change subject: rsl: use 3GPP assigned payload type numbers ...................................................................... Patch Set 1: I was interpreting the spec so that the RTP stream should use the 3GPP payload types from the BTS on. I was thinking that IPACC is propritary and its just the way to configure the PT on the BTS. But thats propritary, there is no official way to communicate a payload type via Abis? You think that the 3GPP RTP payload types must be used on everything that crosses the A interface and whats inside the BSS is not relevant because its not visible to the outside? Rewriting the Payload-Type on the MGW was not on my radar yet, but we have to do this of course. -- To view, visit https://gerrit.osmocom.org/9781 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib6a866b29d863d6875c67748dbe6b6468941ab29 Gerrit-Change-Number: 9781 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-CC: Harald Welte Gerrit-Comment-Date: Thu, 05 Jul 2018 14:57:57 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Thu Jul 5 15:10:06 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Thu, 5 Jul 2018 15:10:06 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-asn1c_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#175?= In-Reply-To: <1886686306.55.1530717006754.JavaMail.jenkins@jenkins.osmocom.org> References: <1886686306.55.1530717006754.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <1959345212.70.1530803406453.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 3.74 KB...] checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for style of include used by make... GNU checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking how to run the C++ preprocessor... g++ -E checking for g77... no checking for f77... no checking for xlf... no checking for frt... no checking for pgf77... no checking for cf77... no checking for fort77... no checking for fl32... no checking for af77... no checking for f90... no checking for xlf90... no checking for pgf90... no checking for pghpf... no checking for epcf90... no checking for gfortran... no checking for g95... no checking for f95... no checking for fort... no checking for xlf95... no checking for ifort... no checking for ifc... no checking for efc... no checking for pgf95... no checking for lf95... no checking for ftn... no checking whether we are using the GNU Fortran 77 compiler... no checking whether accepts -g... no checking the maximum length of command line arguments... 32768 checking command to parse /usr/bin/nm -B output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes configure: creating libtool appending configuration tag "CXX" to libtool checking for ld used by g++... /usr/bin/ld -m elf_x86_64 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC checking if g++ PIC flag -fPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate appending configuration tag "F77" to libtool checking for autoconf... /usr/bin/autoconf checking for autoheader... /usr/bin/autoheader checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking dependency style of gcc... (cached) gcc3 checking how to run the C preprocessor... gcc -E checking for a BSD-compatible install... /usr/bin/install -c checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking for bison... bison -y checking for flex... flex checking for yywrap in -lfl... yes checking lex output file root... lex.yy checking whether yytext is a pointer... yes checking for ar... /usr/bin/ar checking for ANSI C header files... (cached) yes checking sys/param.h usability... yes checking sys/param.h presence... yes checking for sys/param.h... yes checking whether byte ordering is bigendian... no checking for off_t... yes checking for size_t... yes checking whether struct tm is in sys/time.h or time.h... time.h checking for intmax_t... yes checking for library containing getopt... none required checking for strtoimax... yes checking for strtoll... yes checking for mergesort... no checking for mkstemps... yes configure: creating ./config.status config.status: creating skeletons/standard-modules/Makefile config.status: creating skeletons/tests/Makefile config.status: creating libasn1compiler/Makefile config.status: creating libasn1parser/Makefile config.status: creating libasn1print/Makefile config.status: creating asn1c/webcgi/Makefile config.status: creating asn1c/tests/Makefile config.status: creating libasn1fix/Makefile config.status: creating skeletons/Makefile config.status: creating examples/Makefile config.status: creating tests/Makefile config.status: creating asn1c/Makefile config.status: creating doc/Makefile config.status: creating asn1c.spec config.status: creating Makefile config.status: creating config.h config.status: executing depfiles commands + make -j 8 make all-recursive make[1]: Entering directory ' Making all in libasn1parser make[2]: Entering directory ' if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF ".deps/asn1parser.Tpo" -c -o asn1parser.lo asn1parser.c; \ then mv -f ".deps/asn1parser.Tpo" ".deps/asn1parser.Plo"; else rm -f ".deps/asn1parser.Tpo"; exit 1; fi bison -y -p asn1p_ -d asn1p_y.y if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF ".deps/asn1p_l.Tpo" -c -o asn1p_l.lo asn1p_l.c; \ then mv -f ".deps/asn1p_l.Tpo" ".deps/asn1p_l.Plo"; else rm -f ".deps/asn1p_l.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF ".deps/asn1p_module.Tpo" -c -o asn1p_module.lo asn1p_module.c; \ then mv -f ".deps/asn1p_module.Tpo" ".deps/asn1p_module.Plo"; else rm -f ".deps/asn1p_module.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF ".deps/asn1p_oid.Tpo" -c -o asn1p_oid.lo asn1p_oid.c; \ then mv -f ".deps/asn1p_oid.Tpo" ".deps/asn1p_oid.Plo"; else rm -f ".deps/asn1p_oid.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF ".deps/asn1p_value.Tpo" -c -o asn1p_value.lo asn1p_value.c; \ then mv -f ".deps/asn1p_value.Tpo" ".deps/asn1p_value.Plo"; else rm -f ".deps/asn1p_value.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF ".deps/asn1p_expr.Tpo" -c -o asn1p_expr.lo asn1p_expr.c; \ then mv -f ".deps/asn1p_expr.Tpo" ".deps/asn1p_expr.Plo"; else rm -f ".deps/asn1p_expr.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF ".deps/asn1p_xports.Tpo" -c -o asn1p_xports.lo asn1p_xports.c; \ then mv -f ".deps/asn1p_xports.Tpo" ".deps/asn1p_xports.Plo"; else rm -f ".deps/asn1p_xports.Tpo"; exit 1; fi asn1p_y.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] mkdir .libs mkdir .libs mkdir: cannot create directory '.libs': File exists gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -fPIC -DPIC -o .libs/asn1p_l.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -fPIC -DPIC -o .libs/asn1p_oid.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -fPIC -DPIC -o .libs/asn1p_xports.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -fPIC -DPIC -o .libs/asn1parser.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -fPIC -DPIC -o .libs/asn1p_module.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -fPIC -DPIC -o .libs/asn1p_value.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -fPIC -DPIC -o .libs/asn1p_expr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -o asn1p_xports.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -o asn1p_module.o >/dev/null 2>&1 asn1p_l.c:3521:12: warning: 'input' defined but not used [-Wunused-function] static int input() ^~~~~ gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -o asn1p_oid.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -o asn1parser.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF ".deps/asn1p_constr.Tpo" -c -o asn1p_constr.lo asn1p_constr.c; \ then mv -f ".deps/asn1p_constr.Tpo" ".deps/asn1p_constr.Plo"; else rm -f ".deps/asn1p_constr.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -o asn1p_value.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF ".deps/asn1p_param.Tpo" -c -o asn1p_param.lo asn1p_param.c; \ then mv -f ".deps/asn1p_param.Tpo" ".deps/asn1p_param.Plo"; else rm -f ".deps/asn1p_param.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -o asn1p_expr.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF ".deps/asn1p_class.Tpo" -c -o asn1p_class.lo asn1p_class.c; \ then mv -f ".deps/asn1p_class.Tpo" ".deps/asn1p_class.Plo"; else rm -f ".deps/asn1p_class.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF ".deps/asn1p_ref.Tpo" -c -o asn1p_ref.lo asn1p_ref.c; \ then mv -f ".deps/asn1p_ref.Tpo" ".deps/asn1p_ref.Plo"; else rm -f ".deps/asn1p_ref.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -fPIC -DPIC -o .libs/asn1p_constr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -fPIC -DPIC -o .libs/asn1p_param.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -fPIC -DPIC -o .libs/asn1p_class.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -fPIC -DPIC -o .libs/asn1p_ref.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -o asn1p_constr.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -o asn1p_param.o >/dev/null 2>&1 if test -f y.tab.h; then \ to=`echo "asn1p_y_H" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \ sed -e "/^#/!b" -e "s/Y_TAB_H/$to/g" -e "s|y\.tab\.h|asn1p_y.h|" \ y.tab.h >asn1p_y.ht; \ rm -f y.tab.h; \ if cmp -s asn1p_y.ht asn1p_y.h; then \ rm -f asn1p_y.ht ;\ else \ mv asn1p_y.ht asn1p_y.h; \ fi; \ fi if test -f y.output; then \ mv y.output asn1p_y.output; \ fi sed '/^#/ s|y\.tab\.c|asn1p_y.c|' y.tab.c >asn1p_y.ct && mv asn1p_y.ct asn1p_y.c rm -f y.tab.c if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF ".deps/asn1p_y.Tpo" -c -o asn1p_y.lo asn1p_y.c; \ then mv -f ".deps/asn1p_y.Tpo" ".deps/asn1p_y.Plo"; else rm -f ".deps/asn1p_y.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -o asn1p_ref.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -o asn1p_class.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF .deps/asn1p_y.Tpo -c asn1p_y.c -fPIC -DPIC -o .libs/asn1p_y.o asn1p_y.y: In function 'asn1p_parse': asn1p_y.y:357:13: error: 'param' undeclared (first use in this function) *(void **)param = $1; ^~~~~ asn1p_y.y:357:13: note: each undeclared identifier is reported only once for each function it appears in gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -o asn1p_l.o >/dev/null 2>&1 Makefile:299: recipe for target 'asn1p_y.lo' failed make[2]: *** [asn1p_y.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory ' Makefile:302: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory ' Makefile:212: recipe for target 'all' failed make: *** [all] Error 2 Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Thu Jul 5 15:21:26 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 5 Jul 2018 15:21:26 +0000 Subject: Change in osmo-bsc[master]: rsl: use 3GPP assigned payload type numbers In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9781 to look at the new patch set (#2). Change subject: rsl: use 3GPP assigned payload type numbers ...................................................................... rsl: use 3GPP assigned payload type numbers The payload types for AMR, EFR, and GSM-HR are dynamic payload types. In theory those can have any number from the IANA reserved dynamic payload type rante. However 3GPP TS 48.103 assignes AMR, EFR and GSM-HR a fixed payload type number from the dynamic payload type range. Lets make sure our payload types use the 3GPP payload type numbers instead of arbitrary choosen ones. - change payload type define constants to match 3GPP TS 48.103 Change-Id: Ib6a866b29d863d6875c67748dbe6b6468941ab29 Related: OS#2728 --- M src/osmo-bsc/abis_rsl.c 1 file changed, 2 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/81/9781/2 -- To view, visit https://gerrit.osmocom.org/9781 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib6a866b29d863d6875c67748dbe6b6468941ab29 Gerrit-Change-Number: 9781 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-CC: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 15:30:47 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 5 Jul 2018 15:30:47 +0000 Subject: Change in osmo-bsc[master]: rsl: use 3GPP assigned payload type numbers In-Reply-To: References: Message-ID: dexter has posted comments on this change. ( https://gerrit.osmocom.org/9781 ) Change subject: rsl: use 3GPP assigned payload type numbers ...................................................................... Patch Set 1: I have now changed it so that it uses the constants from libosmo-abis -- To view, visit https://gerrit.osmocom.org/9781 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib6a866b29d863d6875c67748dbe6b6468941ab29 Gerrit-Change-Number: 9781 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-CC: Harald Welte Gerrit-Comment-Date: Thu, 05 Jul 2018 15:30:47 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 15:32:59 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 5 Jul 2018 15:32:59 +0000 Subject: Change in osmo-bsc[master]: rsl: use 3GPP assigned payload type numbers In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9781 to look at the new patch set (#3). Change subject: rsl: use 3GPP assigned payload type numbers ...................................................................... rsl: use 3GPP assigned payload type numbers The payload types for AMR, EFR, and GSM-HR are dynamic payload types. In theory those can have any number from the IANA reserved dynamic payload type rante. However 3GPP TS 48.103 assignes AMR, EFR and GSM-HR a fixed payload type number from the dynamic payload type range. Lets make sure our payload types use the 3GPP payload type numbers instead of arbitrary choosen ones. - change payload type define constants to match 3GPP TS 48.103 Depends: libosmo-abis If5bfa4aac37ce95741322f6a7481cf612425d77b Change-Id: Ib6a866b29d863d6875c67748dbe6b6468941ab29 Related: OS#2728 --- M src/osmo-bsc/abis_rsl.c 1 file changed, 2 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/81/9781/3 -- To view, visit https://gerrit.osmocom.org/9781 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib6a866b29d863d6875c67748dbe6b6468941ab29 Gerrit-Change-Number: 9781 Gerrit-PatchSet: 3 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-CC: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 15:36:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 5 Jul 2018 15:36:44 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS_Tests: Call mtc.stop in f_shutdown() to fix sporadic test failures In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9889 ) Change subject: BTS_Tests: Call mtc.stop in f_shutdown() to fix sporadic test failures ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9889 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0f6e10006f46db0d68796c7082497af90f74cd07 Gerrit-Change-Number: 9889 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 05 Jul 2018 15:36:44 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 15:37:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 5 Jul 2018 15:37:08 +0000 Subject: Change in osmo-ttcn3-hacks[master]: Stop testcase execution after failing In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9890 ) Change subject: Stop testcase execution after failing ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9890 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I20e156982ae8150a9e7a145f66283de4a5d8e0bd Gerrit-Change-Number: 9890 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 05 Jul 2018 15:37:08 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 15:37:12 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Thu, 5 Jul 2018 15:37:12 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS_Tests: Call mtc.stop in f_shutdown() to fix sporadic test failures In-Reply-To: References: Message-ID: daniel has submitted this change and it was merged. ( https://gerrit.osmocom.org/9889 ) Change subject: BTS_Tests: Call mtc.stop in f_shutdown() to fix sporadic test failures ...................................................................... BTS_Tests: Call mtc.stop in f_shutdown() to fix sporadic test failures mtc.stop cleanly shuts down a testcase. This avoids errors influencing the result after the test completed (such as ports being shutdown with messages arriving on them causing a dynamic test case error). Change-Id: I0f6e10006f46db0d68796c7082497af90f74cd07 --- M bts/BTS_Tests.ttcn 1 file changed, 2 insertions(+), 4 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index b77a70a..dbb8313 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -341,10 +341,8 @@ } function f_shutdown() runs on test_CT { - /* shut down all "externally interfaced" components first to avoid unclean shutdown */ - vc_IPA.stop; - vc_RSL.stop; - f_ipa_ctrl_stop(); + /* mtc.stop cleanly stops testcase execution to avoid unclean shutdown */ + mtc.stop; } /* Attach L1CTL to master test_CT (classic tests, non-handler mode) */ -- To view, visit https://gerrit.osmocom.org/9889 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I0f6e10006f46db0d68796c7082497af90f74cd07 Gerrit-Change-Number: 9889 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 15:37:25 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Thu, 5 Jul 2018 15:37:25 +0000 Subject: Change in osmo-ttcn3-hacks[master]: Stop testcase execution after failing In-Reply-To: References: Message-ID: daniel has submitted this change and it was merged. ( https://gerrit.osmocom.org/9890 ) Change subject: Stop testcase execution after failing ...................................................................... Stop testcase execution after failing This hopefully prevents the verdict from changing to a dynamic test case error during an unclean termination Change-Id: I20e156982ae8150a9e7a145f66283de4a5d8e0bd --- M bts/BTS_Tests.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index dbb8313..0583171 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -757,7 +757,7 @@ var octetstring l3 := substr(dl.payload.data_ind.payload, 4, 19); if (match(l3, l3_exp)) { setverdict(fail, "Received unexpected SACCH ", dl); - self.stop; + mtc.stop; } else { repeat; } -- To view, visit https://gerrit.osmocom.org/9890 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I20e156982ae8150a9e7a145f66283de4a5d8e0bd Gerrit-Change-Number: 9890 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 15:37:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 5 Jul 2018 15:37:32 +0000 Subject: Change in osmo-ttcn3-hacks[master]: Call f_shutdown after setting the verdict in TC_paging_* In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9891 ) Change subject: Call f_shutdown after setting the verdict in TC_paging_* ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9891 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia9dfcb1dd90e0f6fe61cf88a8de4c10a0cad4009 Gerrit-Change-Number: 9891 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 05 Jul 2018 15:37:32 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 15:37:34 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 5 Jul 2018 15:37:34 +0000 Subject: Change in osmo-ttcn3-hacks[master]: Call f_shutdown after setting the verdict in TC_paging_* In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9891 ) Change subject: Call f_shutdown after setting the verdict in TC_paging_* ...................................................................... Call f_shutdown after setting the verdict in TC_paging_* Since f_shutdown now ends the testcase by calling mtc.stop we need to set a verdict first. Change-Id: Ia9dfcb1dd90e0f6fe61cf88a8de4c10a0cad4009 --- M bts/BTS_Tests.ttcn 1 file changed, 4 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index 0583171..f66a43f 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -1668,8 +1668,6 @@ [] as_rsl_res_ind(); } - f_shutdown(); - log("num_paging_sent=", st.num_paging_sent, " rcvd_msgs=", st.num_paging_rcv_msgs, " rcvd_ids=", st.num_paging_rcv_ids); return st; @@ -1695,6 +1693,7 @@ } else { setverdict(pass); } + f_shutdown(); } /* Create ~ 80% paging load (TMSI only) sustained for about 20s, verifying that @@ -1717,6 +1716,7 @@ } else { setverdict(pass); } + f_shutdown(); } /* Create ~ 200% paging load (IMSI only) sustained for about 20s, verifying that @@ -1741,6 +1741,7 @@ } else { setverdict(pass); } + f_shutdown(); } /* Create ~ 200% paging load (TMSI only) sustained for about 20s, verifying that @@ -1765,6 +1766,7 @@ } else { setverdict(pass); } + f_shutdown(); } -- To view, visit https://gerrit.osmocom.org/9891 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ia9dfcb1dd90e0f6fe61cf88a8de4c10a0cad4009 Gerrit-Change-Number: 9891 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 15:40:42 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 5 Jul 2018 15:40:42 +0000 Subject: Change in osmo-ttcn3-hacks[master]: GGSN_Tests: test what happens when PCO contains only one DNS entry In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9394 ) Change subject: GGSN_Tests: test what happens when PCO contains only one DNS entry ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9394 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I71761e1f9db7ceac3c3df43d2e539f8c8d53c4fc Gerrit-Change-Number: 9394 Gerrit-PatchSet: 3 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 05 Jul 2018 15:40:42 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 15:40:43 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 5 Jul 2018 15:40:43 +0000 Subject: Change in osmo-ttcn3-hacks[master]: GGSN_Tests: test what happens when PCO contains only one DNS entry In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9394 ) Change subject: GGSN_Tests: test what happens when PCO contains only one DNS entry ...................................................................... GGSN_Tests: test what happens when PCO contains only one DNS entry When the protocol configuration options (PCO) contain an IPCP container then lists only one one DNS server (normally there are two included, a primary and a secondary). Than the parser in osmo-ggsn runs into an endles loop. This testcase tries to provoke this behavior by sending PDP CONTEXT ACTIVATE messages with PCO that contain only a single DNS entry per IPCP container. The hanging of osmo-ggsn is already fixed (see Depends). However when Primary and Secondary DNS are in separate IPCP containers, then only the first IPCP container is parsed (see also OS#3381) Change-Id: I71761e1f9db7ceac3c3df43d2e539f8c8d53c4fc Depends: osmo-msc Icffde89f9bc5d8fcadf6e2dd6c0b4de03440edd5 Closes: OS#3288 Related: OS#3381 --- M ggsn_tests/GGSN_Tests.ttcn M ggsn_tests/expected-results.xml M library/GTP_Templates.ttcn 3 files changed, 127 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn index d099681..97abc4d 100644 --- a/ggsn_tests/GGSN_Tests.ttcn +++ b/ggsn_tests/GGSN_Tests.ttcn @@ -932,6 +932,86 @@ T_default.stop; } + /* Test if the parser can cope with PCO that only contain either a + * single primary DNS or a secondary DNS. */ + testcase TC_pdp4_act_deact_with_single_dns() runs on GT_CT { + + /* Note: an unpatched osmo-ggsn version will enter an endless-loop when + * the test is executed. + * see also: Change-Id Icffde89f9bc5d8fcadf6e2dd6c0b4de03440edd5 and OS#3288 */ + + f_init(); + var PdpContext ctx := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInternet, valueof(t_EuaIPv4Dyn))); + var OCT4 ggsn_ip4_dns1 := f_inet_addr(m_ggsn_ip4_dns1); + var OCT4 ggsn_ip4_dns2 := f_inet_addr(m_ggsn_ip4_dns2); + var octetstring pco_neg_dns; + var octetstring pco_neg_dns_expected; + + /* PCO with primary DNS only */ + ctx.pco_req := valueof(ts_PCO_IPv4_PRI_DNS_IPCP); + f_pdp_ctx_act(ctx); + pco_neg_dns := f_PCO_extract_proto(ctx.pco_neg, '8021'O, 1); + pco_neg_dns_expected := '0200000A8106'O & ggsn_ip4_dns1 + /* Note: The prepended hex bytes encode the following information: + * 0x02 = Configuration ACK + * 0x00 = Identifier + * 0x000a = Length + * 0x81 = Type (Primary DNS Server Address) + * 0x06 = Length + * (4 byte IP-Address appended) */ + if (not match(pco_neg_dns, pco_neg_dns_expected)) { + setverdict(fail, "Primary DNS IPv4 PCO option not found"); + } + f_pdp_ctx_del(ctx, '1'B); + + /* PCO with secondary DNS only */ + ctx.pco_req := valueof(ts_PCO_IPv4_SEC_DNS_IPCP); + f_pdp_ctx_act(ctx); + pco_neg_dns := f_PCO_extract_proto(ctx.pco_neg, '8021'O, 1); + pco_neg_dns_expected := '0200000A8306'O & ggsn_ip4_dns2 + if (not match(pco_neg_dns, pco_neg_dns_expected)) { + setverdict(fail, "Secondary DNS IPv4 PCO option not found"); + } + f_pdp_ctx_del(ctx, '1'B); + } + + /* Test if the parser can cope with PCO that contains primary and secondary DNS in a separate IPCP container. + * Note: an unpatched osmo-ggsn version will enter an endless-loop when the test is run + * see Change-Id Icffde89f9bc5d8fcadf6e2dd6c0b4de03440edd5 and OS#3288. */ + testcase TC_pdp4_act_deact_with_separate_dns() runs on GT_CT { + + /* Note: an unpatched osmo-ggsn version will enter an endless-loop when + * the test is executed. + * see also: Change-Id Icffde89f9bc5d8fcadf6e2dd6c0b4de03440edd5 and OS#3288 */ + + f_init(); + var PdpContext ctx := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInternet, valueof(t_EuaIPv4Dyn))); + var OCT4 ggsn_ip4_dns1 := f_inet_addr(m_ggsn_ip4_dns1); + var OCT4 ggsn_ip4_dns2 := f_inet_addr(m_ggsn_ip4_dns2); + var octetstring pco_neg_dns; + var octetstring pco_neg_dns_expected; + + ctx.pco_req := valueof(ts_PCO_IPv4_SEPARATE_DNS_IPCP); + f_pdp_ctx_act(ctx); + + /* Check if primary DNS is contained */ + pco_neg_dns := f_PCO_extract_proto(ctx.pco_neg, '8021'O, 1); + pco_neg_dns_expected := '0200000A8106'O & ggsn_ip4_dns1 + if (not match(pco_neg_dns, pco_neg_dns_expected)) { + setverdict(fail, "Primary DNS IPv4 PCO option not found"); + } + f_pdp_ctx_del(ctx, '1'B); + + /* Check if secondary DNS is contained */ + /* Note: this check fill fail due to a bug in osmo-ggsn, see also OS#3381 */ + pco_neg_dns := f_PCO_extract_proto(ctx.pco_neg, '8021'O, 1); + pco_neg_dns_expected := '0200000A8306'O & ggsn_ip4_dns2 + if (not match(pco_neg_dns, pco_neg_dns_expected)) { + setverdict(fail, "Secondary DNS IPv4 PCO option not found"); + } + f_pdp_ctx_del(ctx, '1'B); + } + control { execute(TC_pdp4_act_deact()); execute(TC_pdp4_act_deact_ipcp()); @@ -939,6 +1019,8 @@ execute(TC_pdp4_act_deact_gtpu_access()); execute(TC_pdp4_clients_interact_with_txseq()); execute(TC_pdp4_clients_interact_without_txseq()); + execute(TC_pdp4_act_deact_with_single_dns()); + execute(TC_pdp4_act_deact_with_separate_dns()); execute(TC_pdp6_act_deact()); execute(TC_pdp6_act_deact_pcodns()); diff --git a/ggsn_tests/expected-results.xml b/ggsn_tests/expected-results.xml index 1e5da38..383ea39 100644 --- a/ggsn_tests/expected-results.xml +++ b/ggsn_tests/expected-results.xml @@ -1,10 +1,17 @@ - + + + + Secondary DNS IPv4 PCO option not found + GGSN_Tests.ttcn:MASKED GGSN_Tests control part + GGSN_Tests.ttcn:MASKED TC_pdp4_act_deact_with_separate_dns testcase + + diff --git a/library/GTP_Templates.ttcn b/library/GTP_Templates.ttcn index 44ec439..a222b2e 100644 --- a/library/GTP_Templates.ttcn +++ b/library/GTP_Templates.ttcn @@ -400,6 +400,36 @@ } } + template ProtConfigOptions ts_PCO_IPv4_PRI_DNS_IPCP modifies ts_PCO := { + protocols := { + /* dummy PAP entry to check if our parser can cope with a single primary DNS entry + * see Change-Id Icffde89f9bc5d8fcadf6e2dd6c0b4de03440edd5 and OS#3288 */ + { protocolID := 'C023'O, lengthProtoID := 0, protoIDContents := ''O }, + { protocolID := '8021'O, lengthProtoID := 16, protoIDContents := + enc_IpcpPacket(valueof(ts_IPCP_ReqDNS_Primary)) } + } + } + template ProtConfigOptions ts_PCO_IPv4_SEC_DNS_IPCP modifies ts_PCO := { + protocols := { + /* dummy PAP entry to check if our parser can cope with a single secondary DNS entry + * see Change-Id Icffde89f9bc5d8fcadf6e2dd6c0b4de03440edd5 and OS#3288 */ + { protocolID := 'C023'O, lengthProtoID := 0, protoIDContents := ''O }, + { protocolID := '8021'O, lengthProtoID := 16, protoIDContents := + enc_IpcpPacket(valueof(ts_IPCP_ReqDNS_Secondary)) } + } + } + template ProtConfigOptions ts_PCO_IPv4_SEPARATE_DNS_IPCP modifies ts_PCO := { + protocols := { + /* dummy PAP entry to check if our parser can cope with a primary and secondary DNS + * in separate IPCP containers OS#3381 */ + { protocolID := 'C023'O, lengthProtoID := 0, protoIDContents := ''O }, + { protocolID := '8021'O, lengthProtoID := 16, protoIDContents := + enc_IpcpPacket(valueof(ts_IPCP_ReqDNS_Primary)) }, + { protocolID := '8021'O, lengthProtoID := 16, protoIDContents := + enc_IpcpPacket(valueof(ts_IPCP_ReqDNS_Secondary)) } + } + } + template ProtocolElement tr_PCO_Proto(OCT2 prot_id) := { protocolID := prot_id, lengthProtoID := ?, @@ -468,6 +498,13 @@ ts_IPCP(LCP_Configure_Request, identifier, { tr_IPCP_PrimaryDns('00000000'O), tr_IPCP_SecondaryDns('00000000'O) }); + template IpcpPacket ts_IPCP_ReqDNS_Primary(uint8_t identifier := 0) := + ts_IPCP(LCP_Configure_Request, identifier, + { tr_IPCP_PrimaryDns('00000000'O) }); + template IpcpPacket ts_IPCP_ReqDNS_Secondary(uint8_t identifier := 0) := + ts_IPCP(LCP_Configure_Request, identifier, + { tr_IPCP_SecondaryDns('00000000'O) }); + function f_teardown_ind_IE(in template (omit) BIT1 ind) return template (omit) TearDownInd { if (istemplatekind(ind, "omit")) { return omit; -- To view, visit https://gerrit.osmocom.org/9394 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I71761e1f9db7ceac3c3df43d2e539f8c8d53c4fc Gerrit-Change-Number: 9394 Gerrit-PatchSet: 4 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 15:42:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 5 Jul 2018 15:42:20 +0000 Subject: Change in osmo-mgw[master]: stats: replace packet statistic counters with libosmocore rate counters In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9837 ) Change subject: stats: replace packet statistic counters with libosmocore rate counters ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9837 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I47c5c9006df5044e59ddebb895e62adb849d72d5 Gerrit-Change-Number: 9837 Gerrit-PatchSet: 3 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-Comment-Date: Thu, 05 Jul 2018 15:42:20 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 15:42:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 5 Jul 2018 15:42:21 +0000 Subject: Change in osmo-mgw[master]: stats: replace packet statistic counters with libosmocore rate counters In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9837 ) Change subject: stats: replace packet statistic counters with libosmocore rate counters ...................................................................... stats: replace packet statistic counters with libosmocore rate counters In struct mgcp_rtp_end one finds unsigned int counters. Those should be replaced with libosmocore rate counters - replace packets_rx, octets_rx, packets_tx, octets_tx and dropped_packets with libosmocore rate counters. Change-Id: I47c5c9006df5044e59ddebb895e62adb849d72d5 Related: OS#2517 --- M include/osmocom/mgcp/mgcp_conn.h M include/osmocom/mgcp/mgcp_internal.h M include/osmocom/mgcp/mgcp_stat.h M src/libosmo-mgcp/mgcp_conn.c M src/libosmo-mgcp/mgcp_network.c M src/libosmo-mgcp/mgcp_osmux.c M src/libosmo-mgcp/mgcp_stat.c M src/libosmo-mgcp/mgcp_vty.c M tests/mgcp/mgcp_test.c 9 files changed, 86 insertions(+), 55 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmocom/mgcp/mgcp_conn.h b/include/osmocom/mgcp/mgcp_conn.h index e2a423f..3da7334 100644 --- a/include/osmocom/mgcp/mgcp_conn.h +++ b/include/osmocom/mgcp/mgcp_conn.h @@ -27,6 +27,17 @@ #include #include +/* RTP connection related counters */ +enum { + IN_STREAM_ERR_TSTMP_CTR, + OUT_STREAM_ERR_TSTMP_CTR, + RTP_PACKETS_RX_CTR, + RTP_OCTETS_RX_CTR, + RTP_PACKETS_TX_CTR, + RTP_OCTETS_TX_CTR, + RTP_DROPPED_PACKETS_CTR +}; + struct mgcp_conn *mgcp_conn_alloc(void *ctx, struct mgcp_endpoint *endp, enum mgcp_conn_type type, char *name); struct mgcp_conn *mgcp_conn_get(struct mgcp_endpoint *endp, const char *id); diff --git a/include/osmocom/mgcp/mgcp_internal.h b/include/osmocom/mgcp/mgcp_internal.h index 1b9749d..38b687c 100644 --- a/include/osmocom/mgcp/mgcp_internal.h +++ b/include/osmocom/mgcp/mgcp_internal.h @@ -99,15 +99,6 @@ /* 'mgcp_rtp_end': basically a wrapper around the RTP+RTCP ports */ struct mgcp_rtp_end { - /* statistics */ - struct { - unsigned int packets_rx; - unsigned int octets_rx; - unsigned int packets_tx; - unsigned int octets_tx; - unsigned int dropped_packets; - } stats; - /* local IP address of the RTP socket */ struct in_addr addr; diff --git a/include/osmocom/mgcp/mgcp_stat.h b/include/osmocom/mgcp/mgcp_stat.h index b6c73fa..0bde8cf 100644 --- a/include/osmocom/mgcp/mgcp_stat.h +++ b/include/osmocom/mgcp/mgcp_stat.h @@ -30,8 +30,7 @@ void mgcp_format_stats(char *str, size_t str_len, struct mgcp_conn *conn); /* Exposed for test purposes only, do not use actively */ -void calc_loss(struct mgcp_rtp_state *s, struct mgcp_rtp_end *, - uint32_t *expected, int *loss); +void calc_loss(struct mgcp_conn_rtp *conn, uint32_t *expected, int *loss); /* Exposed for test purposes only, do not use actively */ uint32_t calc_jitter(struct mgcp_rtp_state *); diff --git a/src/libosmo-mgcp/mgcp_conn.c b/src/libosmo-mgcp/mgcp_conn.c index e49559c..3a5db0f 100644 --- a/src/libosmo-mgcp/mgcp_conn.c +++ b/src/libosmo-mgcp/mgcp_conn.c @@ -31,22 +31,21 @@ #include #include -enum { - IN_STREAM_ERR_TSTMP_CTR, - OUT_STREAM_ERR_TSTMP_CTR, -}; - static const struct rate_ctr_desc rate_ctr_desc[] = { [IN_STREAM_ERR_TSTMP_CTR] = {"stream_err_tstmp:in", "Inbound rtp-stream timestamp errors."}, [OUT_STREAM_ERR_TSTMP_CTR] = {"stream_err_tstmp:out", "Outbound rtp-stream timestamp errors."}, + [RTP_PACKETS_RX_CTR] = {"rtp:packets_rx", "Inbound rtp packets."}, + [RTP_OCTETS_RX_CTR] = {"rtp:octets_rx", "Inbound rtp octets."}, + [RTP_PACKETS_TX_CTR] = {"rtp:packets_tx", "Outbound rtp packets."}, + [RTP_OCTETS_TX_CTR] = {"rtp:octets_rx", "Outbound rtp octets."}, + [RTP_DROPPED_PACKETS_CTR] = {"rtp:dropped", "dropped rtp packets."} }; - const static struct rate_ctr_group_desc rate_ctr_group_desc = { .group_name_prefix = "conn_rtp", .group_description = "rtp connection statistics", .class_id = 1, - .num_ctr = 2, + .num_ctr = ARRAY_SIZE(rate_ctr_desc), .ctr_desc = rate_ctr_desc }; @@ -107,7 +106,6 @@ end->rtp.fd = -1; end->rtcp.fd = -1; - memset(&end->stats, 0, sizeof(end->stats)); end->rtp_port = end->rtcp_port = 0; talloc_free(end->fmtp_extra); end->fmtp_extra = NULL; diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c index b47b76c..494156d 100644 --- a/src/libosmo-mgcp/mgcp_network.c +++ b/src/libosmo-mgcp/mgcp_network.c @@ -694,7 +694,7 @@ dest_name = conn_dst->conn->name; if (!rtp_end->output_enabled) { - rtp_end->stats.dropped_packets += 1; + rate_ctr_inc(&conn_dst->rate_ctr_group->ctr[RTP_DROPPED_PACKETS_CTR]); LOGP(DRTP, LOGL_DEBUG, "endpoint:0x%x output disabled, drop to %s %s " "rtp_port:%u rtcp_port:%u\n", @@ -749,8 +749,8 @@ if (len <= 0) return len; - conn_dst->end.stats.packets_tx += 1; - conn_dst->end.stats.octets_tx += len; + rate_ctr_inc(&conn_dst->rate_ctr_group->ctr[RTP_PACKETS_TX_CTR]); + rate_ctr_add(&conn_dst->rate_ctr_group->ctr[RTP_OCTETS_TX_CTR], len); nbytes += len; buflen = cont; @@ -769,8 +769,8 @@ &rtp_end->addr, rtp_end->rtcp_port, buf, len); - conn_dst->end.stats.packets_tx += 1; - conn_dst->end.stats.octets_tx += len; + rate_ctr_inc(&conn_dst->rate_ctr_group->ctr[RTP_PACKETS_TX_CTR]); + rate_ctr_add(&conn_dst->rate_ctr_group->ctr[RTP_OCTETS_TX_CTR], len); return len; } @@ -939,8 +939,8 @@ } /* Increment RX statistics */ - conn->end.stats.packets_rx += 1; - conn->end.stats.octets_rx += rc; + rate_ctr_inc(&conn->rate_ctr_group->ctr[RTP_PACKETS_RX_CTR]); + rate_ctr_add(&conn->rate_ctr_group->ctr[RTP_OCTETS_RX_CTR], rc); /* Forward a copy of the RTP data to a debug ip/port */ forward_data(fd->fd, &conn->tap_in, buf, rc); diff --git a/src/libosmo-mgcp/mgcp_osmux.c b/src/libosmo-mgcp/mgcp_osmux.c index 281595c..26817c8 100644 --- a/src/libosmo-mgcp/mgcp_osmux.c +++ b/src/libosmo-mgcp/mgcp_osmux.c @@ -256,8 +256,8 @@ .sin_port = conn_net->end.rtp_port, }; - conn_bts->end.stats.octets_tx += msg->len; - conn_bts->end.stats.packets_tx++; + rate_ctr_inc(&conn_bts->rate_ctr_group->ctr[RTP_PACKETS_TX_CTR]); + rate_ctr_add(&conn_bts->rate_ctr_group->ctr[RTP_OCTETS_TX_CTR], msg->len); /* Send RTP data to NET */ /* FIXME: Get rid of conn_bts and conn_net! */ @@ -283,8 +283,8 @@ .sin_port = conn_bts->end.rtp_port, }; - conn_net->end.stats.octets_tx += msg->len; - conn_net->end.stats.packets_tx++; + rate_ctr_inc(&conn_net->rate_ctr_group->ctr[RTP_PACKETS_TX_CTR]); + rate_ctr_add(&conn_net->rate_ctr_group->ctr[RTP_OCTETS_TX_CTR], msg->len); /* Send RTP data to BTS */ /* FIXME: Get rid of conn_bts and conn_net! */ diff --git a/src/libosmo-mgcp/mgcp_stat.c b/src/libosmo-mgcp/mgcp_stat.c index cc723bb..4072ac0 100644 --- a/src/libosmo-mgcp/mgcp_stat.c +++ b/src/libosmo-mgcp/mgcp_stat.c @@ -27,10 +27,11 @@ #include /* Helper function for mgcp_format_stats_rtp() to calculate packet loss */ -void calc_loss(struct mgcp_rtp_state *state, - struct mgcp_rtp_end *end, uint32_t *expected, - int *loss) +void calc_loss(struct mgcp_conn_rtp *conn, uint32_t *expected, int *loss) { + struct mgcp_rtp_state *state = &conn->state; + struct rate_ctr *packets_rx = &conn->rate_ctr_group->ctr[RTP_PACKETS_RX_CTR]; + *expected = state->stats.cycles + state->stats.max_seq; *expected = *expected - state->stats.base_seq + 1; @@ -44,8 +45,8 @@ * Make sure the sign is correct and use the biggest * positive/negative number that fits. */ - *loss = *expected - end->stats.packets_rx; - if (*expected < end->stats.packets_rx) { + *loss = *expected - packets_rx->current; + if (*expected < packets_rx->current) { if (*loss > 0) *loss = INT_MIN; } else { @@ -70,13 +71,18 @@ int ploss; int nchars; - calc_loss(&conn->state, &conn->end, &expected, &ploss); + struct rate_ctr *packets_rx = &conn->rate_ctr_group->ctr[RTP_PACKETS_RX_CTR]; + struct rate_ctr *octets_rx = &conn->rate_ctr_group->ctr[RTP_OCTETS_RX_CTR]; + struct rate_ctr *packets_tx = &conn->rate_ctr_group->ctr[RTP_PACKETS_TX_CTR]; + struct rate_ctr *octets_tx = &conn->rate_ctr_group->ctr[RTP_OCTETS_TX_CTR]; + + calc_loss(conn, &expected, &ploss); jitter = calc_jitter(&conn->state); nchars = snprintf(str, str_len, - "\r\nP: PS=%u, OS=%u, PR=%u, OR=%u, PL=%d, JI=%u", - conn->end.stats.packets_tx, conn->end.stats.octets_tx, - conn->end.stats.packets_rx, conn->end.stats.octets_rx, + "\r\nP: PS=%lu, OS=%lu, PR=%lu, OR=%lu, PL=%d, JI=%u", + packets_tx->current, octets_tx->current, + packets_rx->current, octets_rx->current, ploss, jitter); if (nchars < 0 || nchars >= str_len) goto truncate; diff --git a/src/libosmo-mgcp/mgcp_vty.c b/src/libosmo-mgcp/mgcp_vty.c index a7a1feb..b586ff6 100644 --- a/src/libosmo-mgcp/mgcp_vty.c +++ b/src/libosmo-mgcp/mgcp_vty.c @@ -154,14 +154,18 @@ return CMD_SUCCESS; } -static void dump_rtp_end(struct vty *vty, struct mgcp_rtp_state *state, - struct mgcp_rtp_end *end) +static void dump_rtp_end(struct vty *vty, struct mgcp_conn_rtp *conn) { + struct mgcp_rtp_state *state = &conn->state; + struct mgcp_rtp_end *end = &conn->end; struct mgcp_rtp_codec *codec = end->codec; + struct rate_ctr *dropped_packets; + + dropped_packets = &conn->rate_ctr_group->ctr[RTP_DROPPED_PACKETS_CTR]; vty_out(vty, " Timestamp Errs: %lu->%lu%s" - " Dropped Packets: %d%s" + " Dropped Packets: %lu%s" " Payload Type: %d Rate: %u Channels: %d %s" " Frame Duration: %u Frame Denominator: %u%s" " FPP: %d Packet Duration: %u%s" @@ -170,7 +174,7 @@ state->in_stream.err_ts_ctr->current, state->out_stream.err_ts_ctr->current, VTY_NEWLINE, - end->stats.dropped_packets, VTY_NEWLINE, + dropped_packets->current, VTY_NEWLINE, codec->payload_type, codec->rate, codec->channels, VTY_NEWLINE, codec->frame_duration_num, codec->frame_duration_den, VTY_NEWLINE, end->frames_per_packet, end->packet_duration_ms, @@ -208,8 +212,7 @@ * connection types (E1) as soon as * the implementation is available */ if (conn->type == MGCP_CONN_TYPE_RTP) { - dump_rtp_end(vty, &conn->u.rtp.state, - &conn->u.rtp.end); + dump_rtp_end(vty, &conn->u.rtp); } } } diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c index 1d2cf4a..56d0cee 100644 --- a/tests/mgcp/mgcp_test.c +++ b/tests/mgcp/mgcp_test.c @@ -937,23 +937,43 @@ static void test_packet_loss_calc(void) { int i; + struct mgcp_endpoint endp; + struct mgcp_trunk_config trunk; + printf("Testing packet loss calculation.\n"); + memset(&endp, 0, sizeof(endp)); + memset(&trunk, 0, sizeof(trunk)); + + endp.type = &ep_typeset.rtp; + trunk.vty_number_endpoints = 1; + trunk.endpoints = &endp; + endp.tcfg = &trunk; + INIT_LLIST_HEAD(&endp.conns); + for (i = 0; i < ARRAY_SIZE(pl_test_dat); ++i) { uint32_t expected; int loss; - struct mgcp_rtp_state state; - struct mgcp_rtp_end rtp; - memset(&state, 0, sizeof(state)); - memset(&rtp, 0, sizeof(rtp)); - state.stats.initialized = 1; - state.stats.base_seq = pl_test_dat[i].base_seq; - state.stats.max_seq = pl_test_dat[i].max_seq; - state.stats.cycles = pl_test_dat[i].cycles; + struct mgcp_conn_rtp *conn = NULL; + struct mgcp_conn *_conn = NULL; + struct mgcp_rtp_state *state; + struct rate_ctr *packets_rx; - rtp.stats.packets_rx = pl_test_dat[i].packets; - calc_loss(&state, &rtp, &expected, &loss); + _conn = + mgcp_conn_alloc(NULL, &endp, MGCP_CONN_TYPE_RTP, + "test-connection"); + conn = mgcp_conn_get_rtp(&endp, _conn->id); + state = &conn->state; + packets_rx = &conn->rate_ctr_group->ctr[RTP_PACKETS_RX_CTR]; + + state->stats.initialized = 1; + state->stats.base_seq = pl_test_dat[i].base_seq; + state->stats.max_seq = pl_test_dat[i].max_seq; + state->stats.cycles = pl_test_dat[i].cycles; + + packets_rx->current = pl_test_dat[i].packets; + calc_loss(conn, &expected, &loss); if (loss != pl_test_dat[i].loss || expected != pl_test_dat[i].expected) { @@ -962,7 +982,10 @@ i, loss, pl_test_dat[i].loss, expected, pl_test_dat[i].expected); } + + mgcp_conn_free_all(&endp); } + } int mgcp_parse_stats(struct msgb *msg, uint32_t *ps, uint32_t *os, -- To view, visit https://gerrit.osmocom.org/9837 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I47c5c9006df5044e59ddebb895e62adb849d72d5 Gerrit-Change-Number: 9837 Gerrit-PatchSet: 3 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 16:27:03 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 5 Jul 2018 16:27:03 +0000 Subject: Change in osmo-gsm-manuals[master]: bts: Fix typo Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9892 Change subject: bts: Fix typo ...................................................................... bts: Fix typo Change-Id: I47758acec07a587730552a9c46dc02976c807d9a --- M OsmoBTS/chapters/bts-models.adoc 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/92/9892/1 diff --git a/OsmoBTS/chapters/bts-models.adoc b/OsmoBTS/chapters/bts-models.adoc index fe06c04..4ae73c0 100644 --- a/OsmoBTS/chapters/bts-models.adoc +++ b/OsmoBTS/chapters/bts-models.adoc @@ -6,7 +6,7 @@ generally referred to as the _bts_model_ code. The common part includes the core BTS architecture as well as code for -implementing the external interfaces such Abis, control, PCU socket and +implementing the external interfaces such as Abis, control, PCU socket and GSMTAP. The bts_model parts include support for driving one particular -- To view, visit https://gerrit.osmocom.org/9892 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I47758acec07a587730552a9c46dc02976c807d9a Gerrit-Change-Number: 9892 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 16:27:03 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 5 Jul 2018 16:27:03 +0000 Subject: Change in osmo-gsm-manuals[master]: trx: Add reference to project wiki page in overfiew section Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9893 Change subject: trx: Add reference to project wiki page in overfiew section ...................................................................... trx: Add reference to project wiki page in overfiew section Change-Id: I83cbd67909c42f4ed4857834e23c07ad4e2e22aa --- M OsmoTRX/chapters/overview.adoc 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/93/9893/1 diff --git a/OsmoTRX/chapters/overview.adoc b/OsmoTRX/chapters/overview.adoc index b7d9697..785e26b 100644 --- a/OsmoTRX/chapters/overview.adoc +++ b/OsmoTRX/chapters/overview.adoc @@ -57,3 +57,6 @@ OsmoTRX [color=red]; } ---- + +For more information see +https://osmocom.org/projects/osmotrx/wiki/OsmoTRX -- To view, visit https://gerrit.osmocom.org/9893 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I83cbd67909c42f4ed4857834e23c07ad4e2e22aa Gerrit-Change-Number: 9893 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 16:27:03 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 5 Jul 2018 16:27:03 +0000 Subject: Change in osmo-gsm-manuals[master]: trx: Add Hardware architecture support section Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9894 Change subject: trx: Add Hardware architecture support section ...................................................................... trx: Add Hardware architecture support section Change-Id: I38388bcb2ea7c0481052d3bca589cb34965ea7fa --- A OsmoTRX/chapters/trx-architectures.adoc M OsmoTRX/osmotrx-usermanual.adoc 2 files changed, 37 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/94/9894/1 diff --git a/OsmoTRX/chapters/trx-architectures.adoc b/OsmoTRX/chapters/trx-architectures.adoc new file mode 100644 index 0000000..3beb518 --- /dev/null +++ b/OsmoTRX/chapters/trx-architectures.adoc @@ -0,0 +1,35 @@ +[[osmotrx_arch_support]] +== OsmoTRX hardware architecture support + +OsmoTRX comes out-of-the-box with several algorithms and operations +optimized for certain instruction-set architectures, as well as non-optimized +fall-back algorithms in case required instruction sets are not supported by the +compiler at compile time or by the executing machine at run-time. Support for +these optimized algorithms can be enabled and disabled by means of configure +flags. Accelerated operations include pulse shape filtering, resampling, +sequence correlation, and many other signal processing operations. + +On Intel processors, OsmoTRX makes heavy use of the Streaming SIMD Extensions +(SSE) instruction set. SSE3 is the minimum requirement for accelerated use. +SSE3 is present in the majority of Intel processors since later versions of the +Pentium 4 architecture and is also present on low power Atom processors. Support +is automatically detected at build time. For additional performance information, +please see the performance and benchmarks section. SSE4.1 instruction set is +supported too. By passing the flag _--with_sse_ to the configure script, the +compiler will build an extra version of each of the supported algorithms using +each of the supported mentioned instruction sets. Then, at run-time, OsmoTRX +will auto-detect capabilities of the executing machine and enable an optimized +algorithm using the most suitable available (previously compiled) instruction +set. + +On ARM processors, NEON and NEON FMA are supported. Different to the x86, +there is no auto-detection in this case, nor difference between compile and +runtime. NEON can be enabled by passing the flag _--with-neon_ to the configure +script; the used compiler must support NEON instruction set and the resulting +binary will only run fine on an ARM board supporting NEON extensions. Running +OsmoTRX built with flag _--with-neon_ on a board without NEON instruction set +support, will most probably end up in the process being killed with a _SIGILL_ +Illegal Instruction signal by the operating system. NEON FMA (Fused +Multiply-Add) is an extension to the NEON instruction set, and its use in +OsmoTRX can be enabled by passing the _--with_neon_vfpv4_ flag, which will also +implicitly enable NEON support (_--with_neon_). diff --git a/OsmoTRX/osmotrx-usermanual.adoc b/OsmoTRX/osmotrx-usermanual.adoc index 3b2e991..f2ccbaf 100644 --- a/OsmoTRX/osmotrx-usermanual.adoc +++ b/OsmoTRX/osmotrx-usermanual.adoc @@ -23,6 +23,8 @@ include::chapters/configuration.adoc[] +include::chapters/trx-architectures.adoc[] + include::../common/chapters/trx_if.adoc[] include::../common/chapters/port_numbers.adoc[] -- To view, visit https://gerrit.osmocom.org/9894 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I38388bcb2ea7c0481052d3bca589cb34965ea7fa Gerrit-Change-Number: 9894 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 16:27:04 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 5 Jul 2018 16:27:04 +0000 Subject: Change in osmo-gsm-manuals[master]: trx: Add Hardware device support section Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9895 Change subject: trx: Add Hardware device support section ...................................................................... trx: Add Hardware device support section Change-Id: I87fc54cf1751f31a3e92d6503625e984f9a6130f --- A OsmoTRX/chapters/trx-backends.adoc M OsmoTRX/osmotrx-usermanual.adoc 2 files changed, 69 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/95/9895/1 diff --git a/OsmoTRX/chapters/trx-backends.adoc b/OsmoTRX/chapters/trx-backends.adoc new file mode 100644 index 0000000..b92a2da --- /dev/null +++ b/OsmoTRX/chapters/trx-backends.adoc @@ -0,0 +1,67 @@ +[[osmotrx_device_support]] +== OsmoTRX hardware device support + +OsmoTRX consists of a _common_ part that applies to all TRX devices as well as +_hardware-specific_ parts for each TRX device. The hardware-specific parts are +usually provided by vendor-specific or device-specific libraries that are then +handled by some OsmoTRX glue code presenting a unified interface towards the +rest of the code by means of a _RadioDevice_ class. + +The common part includes the core TRX architecture as well as code for +implementing the external interfaces such as the TRX Manager UDP socket, +control, and VTY interfaces. + +The hardware-specific parts include support for driving one particular +implementation of a radio modem. Such a physical layer +implementation can come in many forms. Sometimes it runs on a general +purpose CPU, sometimes on a dedicated ARM core, a dedicated DSP, a +combination of DSP and FPGA. + +Joining the common pare with each of the available backends results in a +different binary with different suffix for each backend. For instance, when +OsmoTRX is built with UHD backend, an _osmo-trx-uhd_ binary is generated; when +OsmoTRX is built with LimeSuite backend, an _osmo-trx-lms_ binary is generated. +Build of different backend can be enabled and disabled by means of configure +flags, which can be found in each subsection relative to each backend below. + +== `osmo-trx-uhd` for UHD based Transceivers + +This OsmoTRX model uses _libuhd_ (UHD, USRP Hardware Driver) to drive the +device, that is configuring it and reading/writing samples to it. + +This backend has been mostly used to so far to drive devices such as the Ettus +B200 family and Fairwaves UmTRX family, and used to be the default backend used +for legacy @osmo-trx@ binary when per-backend binaries didn't exist yet. + +Any device providing generic support for UHD should theoretically be able to be +run through this backend without much effort, but pracitcal experience showed +that some devices don't play well with it, such as the LimeSDR family of +devices, which showed far better results when using its native interface. + +Related code can be found in the _Transceiver52M/device/uhd/_ directory in +_osmo-trx.git_. + +== `osmo-trx-lms` for LimeSuite based Transceivers + +This OsmoTRX model uses LimeSuite API and library to drive the device, that is +configuring it and reading/writing samples to it. + +This backend was developed in order to be used together with LimeSDR-USB and +LimeSDR-mini devices, due to to the poor results obtained with the UHD backend, +and to simplify the stack. + +Related code can be found in the _Transceiver52M/device/lms/_ directory in +_osmo-trx.git_. + + +== `osmo-trx-usrp1` for libusrp based Transceivers + +This OsmoTRX model uses the legacy libusrp driver provided in GNU Radio 3.4.2. + +As this code was dropped from GNU Radio at some point and was found very +difficult to build, some work was done to create a standalone libusrp which can +be nowadays found as a separate git repository together with other osmocom git +repositories, in https://git.osmocom.org/libusrp/ + +Related code can be found in the _Transceiver52M/device/usrp1/_ directory in +_osmo-trx.git_. diff --git a/OsmoTRX/osmotrx-usermanual.adoc b/OsmoTRX/osmotrx-usermanual.adoc index f2ccbaf..7d04f78 100644 --- a/OsmoTRX/osmotrx-usermanual.adoc +++ b/OsmoTRX/osmotrx-usermanual.adoc @@ -25,6 +25,8 @@ include::chapters/trx-architectures.adoc[] +include::chapters/trx-backends.adoc[] + include::../common/chapters/trx_if.adoc[] include::../common/chapters/port_numbers.adoc[] -- To view, visit https://gerrit.osmocom.org/9895 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I87fc54cf1751f31a3e92d6503625e984f9a6130f Gerrit-Change-Number: 9895 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 19:56:36 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 5 Jul 2018 19:56:36 +0000 Subject: Change in osmo-gsm-manuals[master]: trx: Add Hardware device support section In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/9895 ) Change subject: trx: Add Hardware device support section ...................................................................... Patch Set 1: (5 comments) Not a code but text review ;) https://gerrit.osmocom.org/#/c/9895/1/OsmoTRX/chapters/trx-backends.adoc File OsmoTRX/chapters/trx-backends.adoc: https://gerrit.osmocom.org/#/c/9895/1/OsmoTRX/chapters/trx-backends.adoc at 11 PS1, Line 11: socket There are at least three sockets, so s/socket/sockets/. https://gerrit.osmocom.org/#/c/9895/1/OsmoTRX/chapters/trx-backends.adoc at 20 PS1, Line 20: pare s/pare/part? https://gerrit.osmocom.org/#/c/9895/1/OsmoTRX/chapters/trx-backends.adoc at 30 PS1, Line 30: to reading/writing .. to/from ;) https://gerrit.osmocom.org/#/c/9895/1/OsmoTRX/chapters/trx-backends.adoc at 32 PS1, Line 32: to Do we need this 'to'? https://gerrit.osmocom.org/#/c/9895/1/OsmoTRX/chapters/trx-backends.adoc at 47 PS1, Line 47: to same applies here -- To view, visit https://gerrit.osmocom.org/9895 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I87fc54cf1751f31a3e92d6503625e984f9a6130f Gerrit-Change-Number: 9895 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 05 Jul 2018 19:56:36 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 20:04:14 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 5 Jul 2018 20:04:14 +0000 Subject: Change in osmo-gsm-manuals[master]: trx: Add Hardware architecture support section In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/9894 ) Change subject: trx: Add Hardware architecture support section ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/9894/1/OsmoTRX/chapters/trx-architectures.adoc File OsmoTRX/chapters/trx-architectures.adoc: https://gerrit.osmocom.org/#/c/9894/1/OsmoTRX/chapters/trx-architectures.adoc at 18 PS1, Line 18: the : compiler will build an extra version of each of the supported algorithms using : each of the supported mentioned instruction sets AFAIK this flag is enabled by default, so additionally passing it to configure doesn't make sense... I think we may write here that it's possible to completely disable SIMD support using this flag (--with-sse=no)... -- To view, visit https://gerrit.osmocom.org/9894 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I38388bcb2ea7c0481052d3bca589cb34965ea7fa Gerrit-Change-Number: 9894 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 05 Jul 2018 20:04:14 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 20:15:13 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 5 Jul 2018 20:15:13 +0000 Subject: Change in osmo-gsm-manuals[master]: bts: Fix typo In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9892 ) Change subject: bts: Fix typo ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9892 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I47758acec07a587730552a9c46dc02976c807d9a Gerrit-Change-Number: 9892 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Thu, 05 Jul 2018 20:15:13 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 20:15:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 5 Jul 2018 20:15:22 +0000 Subject: Change in osmo-gsm-manuals[master]: trx: Add reference to project wiki page in overfiew section In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9893 ) Change subject: trx: Add reference to project wiki page in overfiew section ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9893 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I83cbd67909c42f4ed4857834e23c07ad4e2e22aa Gerrit-Change-Number: 9893 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Thu, 05 Jul 2018 20:15:22 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 20:30:21 2018 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Thu, 5 Jul 2018 20:30:21 +0000 Subject: Change in osmo-gsm-tester[master]: ms: Attempt to stop all mobile/virtphy instances on exit In-Reply-To: References: Message-ID: Holger Freyther has submitted this change and it was merged. ( https://gerrit.osmocom.org/9714 ) Change subject: ms: Attempt to stop all mobile/virtphy instances on exit ...................................................................... ms: Attempt to stop all mobile/virtphy instances on exit We leave mobile/virtphy running after the test. Attempt to gracefully exit and kill all of them. I experimented with both os.setpgrp and the prctl(PR_SET_DEATH_SIG) but that didn't improve the situation. Change-Id: I6cec050db7d4c355fb6678b2d84309fbbe5587b3 --- M src/osmo_ms_driver/__main__.py 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, but someone else must approve Pau Espin Pedrol: Looks good to me, approved diff --git a/src/osmo_ms_driver/__main__.py b/src/osmo_ms_driver/__main__.py index 7bca1d1..abc5e54 100644 --- a/src/osmo_ms_driver/__main__.py +++ b/src/osmo_ms_driver/__main__.py @@ -24,6 +24,7 @@ # System modules import argparse +import atexit import datetime import subprocess import signal @@ -78,6 +79,7 @@ # Just a single test for now. test = MassUpdateLocationTest("lu_test", args.num_ms, cdf, ev_server, tmp_dir) + atexit.register(test.stop_all) # Run until everything has been launched test.launch(loop) -- To view, visit https://gerrit.osmocom.org/9714 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I6cec050db7d4c355fb6678b2d84309fbbe5587b3 Gerrit-Change-Number: 9714 Gerrit-PatchSet: 3 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 20:30:42 2018 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Thu, 5 Jul 2018 20:30:42 +0000 Subject: Change in osmo-gsm-tester[master]: ms: Begin to refactor and be able to share functionality In-Reply-To: References: Message-ID: Holger Freyther has submitted this change and it was merged. ( https://gerrit.osmocom.org/9712 ) Change subject: ms: Begin to refactor and be able to share functionality ...................................................................... ms: Begin to refactor and be able to share functionality Change-Id: I840af0396f08744ce8ee6a2967f880d5cb7f815f --- M src/osmo_ms_driver/location_update_test.py A src/osmo_ms_driver/test_support.py 2 files changed, 57 insertions(+), 30 deletions(-) Approvals: Harald Welte: Looks good to me, but someone else must approve Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_ms_driver/location_update_test.py b/src/osmo_ms_driver/location_update_test.py index 0d27d0e..2a3c246 100644 --- a/src/osmo_ms_driver/location_update_test.py +++ b/src/osmo_ms_driver/location_update_test.py @@ -1,5 +1,5 @@ -# osmo_ms_driver: Starter for processes -# Help to start processes over time. +# osmo_ms_driver: Locationg Update Test +# Create MS's and wait for the Location Update to succeed. # # Copyright (C) 2018 by Holger Hans Peter Freyther # @@ -19,46 +19,22 @@ from osmo_gsm_tester import log from .starter import OsmoVirtPhy, OsmoMobile +from .test_support import imsi_ki_gen, Results from datetime import timedelta import time -def imsi_ki_gen(): - """ - Generate IMSIs and KIs to be used by test. - """ - n = 1010000000000 - while True: - yield ("%.15d" % n, "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00") - n += 1 - -class Results(log.Origin): +class LUResult(Results): def __init__(self, name): - super().__init__(log.C_RUN, name) - self._time_of_registration = None - self._time_of_launch = None + super().__init__(name) self._time_of_lu = None - def set_start_time(self, time): - assert self._time_of_registration is None - self._time_of_registration = time - - def set_launch_time(self, time): - assert self._time_of_launch is None - self._time_of_launch = time - def set_lu_time(self, time): assert self._time_of_lu is None self._time_of_lu = time - def start_time(self): - return self._time_of_registration or 0 - - def launch_time(self): - return self._time_of_launch or 0 - def lu_time(self): return self._time_of_lu or 0 @@ -98,7 +74,7 @@ self.TEMPLATE_CFG, imsi_gen, phy.phy_filename(), event_server.server_path()) - self._results[ms_name] = Results(ms_name) + self._results[ms_name] = LUResult(ms_name) self._unstarted.append(launcher) self._event_server = event_server self._event_server.register(self.handle_msg) diff --git a/src/osmo_ms_driver/test_support.py b/src/osmo_ms_driver/test_support.py new file mode 100644 index 0000000..f1c34fb --- /dev/null +++ b/src/osmo_ms_driver/test_support.py @@ -0,0 +1,51 @@ +# osmo_ms_driver: Test helpers and base classes +# +# Copyright (C) 2018 by Holger Hans Peter Freyther +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +from osmo_gsm_tester import log + +def imsi_ki_gen(): + """ + Generate IMSIs and KIs to be used by test. + """ + n = 1010000000000 + while True: + yield ("%.15d" % n, "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00") + n += 1 + +class Results(log.Origin): + """ + A base class to collect results from tests. + """ + + def __init__(self, name): + super().__init__(log.C_RUN, name) + self._time_of_registration = None + self._time_of_launch = None + + def set_start_time(self, time): + assert self._time_of_registration is None + self._time_of_registration = time + + def set_launch_time(self, time): + assert self._time_of_launch is None + self._time_of_launch = time + + def start_time(self): + return self._time_of_registration or 0 + + def launch_time(self): + return self._time_of_launch or 0 -- To view, visit https://gerrit.osmocom.org/9712 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I840af0396f08744ce8ee6a2967f880d5cb7f815f Gerrit-Change-Number: 9712 Gerrit-PatchSet: 3 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 5 20:35:33 2018 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Thu, 5 Jul 2018 20:35:33 +0000 Subject: Change in osmo-gsm-tester[master]: ms: Quit early when all tests concluded.. In-Reply-To: References: Message-ID: Holger Freyther has posted comments on this change. ( https://gerrit.osmocom.org/9716 ) Change subject: ms: Quit early when all tests concluded.. ...................................................................... Patch Set 2: > (1 comment) Good point. I should count "completion" and have a boolean instead. I wanted to get it correct first though. I will revise this patch. -- To view, visit https://gerrit.osmocom.org/9716 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3575ee7618c35e3b66d25fa31844d267489d9179 Gerrit-Change-Number: 9716 Gerrit-PatchSet: 2 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 05 Jul 2018 20:35:33 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From admin at opensuse.org Thu Jul 5 20:49:30 2018 From: admin at opensuse.org (OBS Notification) Date: Thu, 05 Jul 2018 20:49:30 +0000 Subject: Build failure of network:osmocom:nightly/osmo-mgw in Debian_9.0/armv7l In-Reply-To: References: Message-ID: <5b3e8465f1f0e_12bfe8e6804139f0@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-mgw/Debian_9.0/armv7l Package network:osmocom:nightly/osmo-mgw failed to build in Debian_9.0/armv7l Check out the package for editing: osc checkout network:osmocom:nightly osmo-mgw Last lines of build log: [ 145s] | #define HAVE_SYS_STAT_H 1 [ 145s] | #define HAVE_STDLIB_H 1 [ 145s] | #define HAVE_STRING_H 1 [ 145s] | #define HAVE_MEMORY_H 1 [ 145s] | #define HAVE_STRINGS_H 1 [ 145s] | #define HAVE_INTTYPES_H 1 [ 145s] | #define HAVE_STDINT_H 1 [ 145s] | #define HAVE_UNISTD_H 1 [ 145s] | #define HAVE_DLFCN_H 1 [ 145s] | #define LT_OBJDIR ".libs/" [ 145s] | [ 145s] | configure: exit 0 [ 145s] [ 145s] debian/rules:30: recipe for target 'override_dh_auto_test' failed [ 145s] make[1]: *** [override_dh_auto_test] Error 1 [ 145s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 145s] debian/rules:17: recipe for target 'build' failed [ 145s] make: *** [build] Error 2 [ 145s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 145s] [ 145s] armbuild22 failed "build osmo-mgw_1.3.0.29.cede2.dsc" at Thu Jul 5 20:49:24 UTC 2018. [ 145s] [ 145s] ### VM INTERACTION START ### [ 147s] [ 134.758057] SysRq : Power Off [ 147s] [ 134.759838] reboot: Power down [ 147s] ### VM INTERACTION END ### [ 147s] [ 147s] armbuild22 failed "build osmo-mgw_1.3.0.29.cede2.dsc" at Thu Jul 5 20:49:27 UTC 2018. [ 147s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From jenkins at lists.osmocom.org Thu Jul 5 23:18:25 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Thu, 5 Jul 2018 23:18:25 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-osmo-bts_=C2=BB_t?= =?UTF-8?Q?rx,master,default,osmocom-master-debian9_#855?= Message-ID: <327281201.74.1530832705233.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 56.23 KB...] - add LIBDIR to the 'LD_RUN_PATH' environment variable during linking - use the '-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to '/etc/ld.so.conf' See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- make[3]: Leaving directory ' make[2]: Leaving directory ' Making install in src/codec make[2]: Entering directory ' CC gsm610.lo CC gsm620.lo CC gsm660.lo CC gsm690.lo CC ecu_fr.lo CCLD libosmocodec.la make[3]: Entering directory ' make[3]: Nothing to be done for 'install-data-am'. /bin/mkdir -p ' /bin/bash ../../libtool --mode=install /usr/bin/install -c libosmocodec.la ' libtool: warning: relinking 'libosmocodec.la' libtool: install: (cd /bin/bash " --silent --tag CC --mode=relink gcc -Wall -g -O2 -DBUILDING_LIBOSMOCORE -Wall -version-info 1:0:1 -no-undefined -o libosmocodec.la -rpath gsm610.lo gsm620.lo gsm660.lo gsm690.lo ecu_fr.lo ../../src/libosmocore.la ) libtool: install: /usr/bin/install -c .libs/libosmocodec.so.0.1.0T libtool: install: (cd && { ln -s -f libosmocodec.so.0.1.0 libosmocodec.so.0 || { rm -f libosmocodec.so.0 && ln -s libosmocodec.so.0.1.0 libosmocodec.so.0; }; }) libtool: install: (cd && { ln -s -f libosmocodec.so.0.1.0 libosmocodec.so || { rm -f libosmocodec.so && ln -s libosmocodec.so.0.1.0 libosmocodec.so; }; }) libtool: install: /usr/bin/install -c .libs/libosmocodec.lai libtool: finish: PATH="/usr/local/bin:/usr/bin:/bin:/usr/games:/home/osmocom-build/bin:/sbin" ldconfig -n ---------------------------------------------------------------------- Libraries have been installed in: If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the '-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the 'LD_RUN_PATH' environment variable during linking - use the '-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to '/etc/ld.so.conf' See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- make[3]: Leaving directory ' make[2]: Leaving directory ' Making install in src/gsm make[2]: Entering directory ' GEN gsm0503_conv.c Generating convolutional codes... Generate 'xcch' definition Generate 'rach' definition Generate 'rach_ext' definition Generate 'sch' definition Generate 'cs2' definition Generate 'cs3' definition Generate 'cs2_np' definition Generate 'cs3_np' definition Generate 'tch_afs_12_2' definition Generate 'tch_afs_10_2' definition Generate 'tch_afs_7_95' definition Generate 'tch_afs_7_4' definition Generate 'tch_afs_6_7' definition Generate 'tch_afs_5_9' definition Generate 'tch_afs_5_15' definition Generate 'tch_afs_4_75' definition Generate 'tch_fr' definition Generate 'tch_hr' definition Generate 'tch_ahs_7_95' definition Generate 'tch_ahs_7_4' definition Generate 'tch_ahs_6_7' definition Generate 'tch_ahs_5_9' definition Generate 'tch_ahs_5_15' definition Generate 'tch_ahs_4_75' definition Generate 'mcs1_dl_hdr' definition Generate 'mcs1_ul_hdr' definition Generate 'mcs1' definition Generate 'mcs2' definition Generate 'mcs3' definition Generate 'mcs4' definition Generate 'mcs5_dl_hdr' definition Generate 'mcs5_ul_hdr' definition Generate 'mcs5' definition Generate 'mcs6' definition Generate 'mcs7_dl_hdr' definition Generate 'mcs7_ul_hdr' definition Generate 'mcs7' definition Generate 'mcs8' definition Generate 'mcs9' definition Generation complete. make install-am make[3]: Entering directory ' CC rxlev_stat.lo CC rsl.lo CC a5.lo CC gsm48.lo CC tlv_parser.lo CC gsm_utils.lo CC comp128.lo CC comp128v23.lo CC gsm48_ie.lo CC gsm0808.lo CC sysinfo.lo gsm_utils.c:112:9: note: #pragma message: including GnuTLS for getrandom fallback. #pragma message ("including GnuTLS for getrandom fallback.") ^~~~~~~ CC gprs_cipher_core.lo gsm_utils.c: In function ?osmo_get_rand_id?: gsm_utils.c:448:9: note: #pragma message: Using direct syscall access for getrandom(): consider upgrading to glibc >= 2.25 #pragma message ("Using direct syscall access for getrandom(): consider upgrading to glibc >= 2.25") ^~~~~~~ gsm_utils.c:456:9: note: #pragma message: Secure random failed: using GnuTLS fallback. #pragma message ("Secure random failed: using GnuTLS fallback.") ^~~~~~~ CC gsm0480.lo CC gprs_rlc.lo CC abis_nm.lo CC gsm0502.lo CC gsm0411_utils.lo CC gsm0411_smc.lo CC gsm0411_smr.lo CC gsm0414.lo CC lapd_core.lo CC lapdm.lo CC kasumi.lo CC gsm_04_08_gprs.lo CC auth_core.lo CC auth_comp128v1.lo CC auth_comp128v23.lo CC auth_milenage.lo CC gea.lo CC milenage/aes-internal.lo CC milenage/aes-internal-enc.lo CC milenage/milenage.lo CC gan.lo CC ipa.lo CC apn.lo CC gsm0341.lo CC gsup.lo CC gprs_gea.lo CC gsm0503_conv.lo CC oap.lo CC gsm23003.lo CC mncc.lo CC gsm0808_utils.lo CC bts_features.lo CC milenage/aes-encblock.lo CCLD libgsmint.la ar: `u' modifier ignored since `D' is the default (see `U') CCLD libosmogsm.la make[4]: Entering directory ' make[4]: Nothing to be done for 'install-data-am'. /bin/mkdir -p ' /bin/bash ../../libtool --mode=install /usr/bin/install -c libosmogsm.la ' libtool: warning: relinking 'libosmogsm.la' libtool: install: (cd /bin/bash " --silent --tag CC --mode=relink gcc -Wall -g -O2 -DBUILDING_LIBOSMOCORE -Wall -Wl,--version-script=./libosmogsm.map -version-info 9:0:0 -no-undefined -o libosmogsm.la -rpath libgsmint.la -ltalloc -lgnutls ) libtool: install: /usr/bin/install -c .libs/libosmogsm.so.9.0.0T libtool: install: (cd && { ln -s -f libosmogsm.so.9.0.0 libosmogsm.so.9 || { rm -f libosmogsm.so.9 && ln -s libosmogsm.so.9.0.0 libosmogsm.so.9; }; }) libtool: install: (cd && { ln -s -f libosmogsm.so.9.0.0 libosmogsm.so || { rm -f libosmogsm.so && ln -s libosmogsm.so.9.0.0 libosmogsm.so; }; }) libtool: install: /usr/bin/install -c .libs/libosmogsm.lai libtool: finish: PATH="/usr/local/bin:/usr/bin:/bin:/usr/games:/home/osmocom-build/bin:/sbin" ldconfig -n ---------------------------------------------------------------------- Libraries have been installed in: If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the '-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the 'LD_RUN_PATH' environment variable during linking - use the '-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to '/etc/ld.so.conf' See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- make[4]: Leaving directory ' make[3]: Leaving directory ' make[2]: Leaving directory ' Making install in src/coding make[2]: Entering directory ' CC gsm0503_interleaving.lo CC gsm0503_mapping.lo CC gsm0503_tables.lo CC gsm0503_coding.lo CC gsm0503_parity.lo CCLD libosmocoding.la make[3]: Entering directory ' make[3]: Nothing to be done for 'install-data-am'. /bin/mkdir -p ' /bin/bash ../../libtool --mode=install /usr/bin/install -c libosmocoding.la ' libtool: warning: relinking 'libosmocoding.la' libtool: install: (cd /bin/bash " --silent --tag CC --mode=relink gcc -Wall -g -O2 -DBUILDING_LIBOSMOCORE -Wall -Wl,--version-script=./libosmocoding.map -version-info 1:0:1 -no-undefined -ltalloc -o libosmocoding.la -rpath gsm0503_interleaving.lo gsm0503_mapping.lo gsm0503_tables.lo gsm0503_parity.lo gsm0503_coding.lo ../libosmocore.la ../gsm/libosmogsm.la ../codec/libosmocodec.la ) libtool: install: /usr/bin/install -c .libs/libosmocoding.so.0.1.0T libtool: install: (cd && { ln -s -f libosmocoding.so.0.1.0 libosmocoding.so.0 || { rm -f libosmocoding.so.0 && ln -s libosmocoding.so.0.1.0 libosmocoding.so.0; }; }) libtool: install: (cd && { ln -s -f libosmocoding.so.0.1.0 libosmocoding.so || { rm -f libosmocoding.so && ln -s libosmocoding.so.0.1.0 libosmocoding.so; }; }) libtool: install: /usr/bin/install -c .libs/libosmocoding.lai libtool: finish: PATH="/usr/local/bin:/usr/bin:/bin:/usr/games:/home/osmocom-build/bin:/sbin" ldconfig -n ---------------------------------------------------------------------- Libraries have been installed in: If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the '-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the 'LD_RUN_PATH' environment variable during linking - use the '-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to '/etc/ld.so.conf' See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- make[3]: Leaving directory ' make[2]: Leaving directory ' Making install in src/gb make[2]: Entering directory ' CC gprs_ns.lo CC gprs_ns_frgre.lo CC gprs_ns_vty.lo CC gprs_bssgp.lo CC common_vty.lo CC gprs_bssgp_util.lo CC gprs_bssgp_vty.lo CC gprs_bssgp_bss.lo /bin/bash: line 2: 13572 Illegal instruction /bin/bash ../../libtool --silent --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../include -DBUILDING_LIBOSMOCORE -Wall -Wall -fno-strict-aliasing -g -O2 -DBUILDING_LIBOSMOCORE -Wall -MT gprs_bssgp_bss.lo -MD -MP -MF $depbase.Tpo -c -o gprs_bssgp_bss.lo gprs_bssgp_bss.c Makefile:485: recipe for target 'gprs_bssgp_bss.lo' failed make[2]: *** [gprs_bssgp_bss.lo] Error 132 make[2]: *** Waiting for unfinished jobs.... /bin/bash: line 2: 13569 Illegal instruction /bin/bash ../../libtool --silent --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../include -DBUILDING_LIBOSMOCORE -Wall -Wall -fno-strict-aliasing -g -O2 -DBUILDING_LIBOSMOCORE -Wall -MT gprs_bssgp.lo -MD -MP -MF $depbase.Tpo -c -o gprs_bssgp.lo gprs_bssgp.c Makefile:485: recipe for target 'gprs_bssgp.lo' failed make[2]: *** [gprs_bssgp.lo] Error 132 make[2]: Leaving directory ' Makefile:604: recipe for target 'install-recursive' failed make[1]: *** [install-recursive] Error 1 make[1]: Leaving directory ' Makefile:903: recipe for target 'install' failed make: *** [install] Error 2 Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From jenkins at lists.osmocom.org Fri Jul 6 00:04:43 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Fri, 6 Jul 2018 00:04:43 +0000 (UTC) Subject: =?UTF-8?Q?Jenkins_build_is_back_to_normal_:_master-osmo-bts?= =?UTF-8?Q?_=C2=BB_trx,master,default,osmocom-master-debian9_#856?= In-Reply-To: <327281201.74.1530832705233.JavaMail.jenkins@jenkins.osmocom.org> References: <327281201.74.1530832705233.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <688016153.76.1530835483641.JavaMail.jenkins@jenkins.osmocom.org> See From gerrit-no-reply at lists.osmocom.org Fri Jul 6 09:42:38 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 6 Jul 2018 09:42:38 +0000 Subject: Change in osmo-gsm-manuals[master]: bts: Fix typo In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/9892 ) Change subject: bts: Fix typo ...................................................................... bts: Fix typo Change-Id: I47758acec07a587730552a9c46dc02976c807d9a --- M OsmoBTS/chapters/bts-models.adoc 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/OsmoBTS/chapters/bts-models.adoc b/OsmoBTS/chapters/bts-models.adoc index fe06c04..4ae73c0 100644 --- a/OsmoBTS/chapters/bts-models.adoc +++ b/OsmoBTS/chapters/bts-models.adoc @@ -6,7 +6,7 @@ generally referred to as the _bts_model_ code. The common part includes the core BTS architecture as well as code for -implementing the external interfaces such Abis, control, PCU socket and +implementing the external interfaces such as Abis, control, PCU socket and GSMTAP. The bts_model parts include support for driving one particular -- To view, visit https://gerrit.osmocom.org/9892 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I47758acec07a587730552a9c46dc02976c807d9a Gerrit-Change-Number: 9892 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 6 09:42:41 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 6 Jul 2018 09:42:41 +0000 Subject: Change in osmo-gsm-manuals[master]: trx: Add reference to project wiki page in overfiew section In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/9893 ) Change subject: trx: Add reference to project wiki page in overfiew section ...................................................................... trx: Add reference to project wiki page in overfiew section Change-Id: I83cbd67909c42f4ed4857834e23c07ad4e2e22aa --- M OsmoTRX/chapters/overview.adoc 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/OsmoTRX/chapters/overview.adoc b/OsmoTRX/chapters/overview.adoc index b7d9697..785e26b 100644 --- a/OsmoTRX/chapters/overview.adoc +++ b/OsmoTRX/chapters/overview.adoc @@ -57,3 +57,6 @@ OsmoTRX [color=red]; } ---- + +For more information see +https://osmocom.org/projects/osmotrx/wiki/OsmoTRX -- To view, visit https://gerrit.osmocom.org/9893 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I83cbd67909c42f4ed4857834e23c07ad4e2e22aa Gerrit-Change-Number: 9893 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 6 10:00:40 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 6 Jul 2018 10:00:40 +0000 Subject: Change in osmo-gsm-manuals[master]: trx: Add Hardware device support section In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9895 ) Change subject: trx: Add Hardware device support section ...................................................................... Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/9895/1/OsmoTRX/chapters/trx-backends.adoc File OsmoTRX/chapters/trx-backends.adoc: https://gerrit.osmocom.org/#/c/9895/1/OsmoTRX/chapters/trx-backends.adoc at 11 PS1, Line 11: socket > There are at least three sockets, so s/socket/sockets/. Well in here I basically have a comma separated list of interfaces, so it basically should be read as "RX Manager UDP socket interface". https://gerrit.osmocom.org/#/c/9895/1/OsmoTRX/chapters/trx-backends.adoc at 30 PS1, Line 30: to > reading/writing .. [?] The other way actually :P -- To view, visit https://gerrit.osmocom.org/9895 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I87fc54cf1751f31a3e92d6503625e984f9a6130f Gerrit-Change-Number: 9895 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Fri, 06 Jul 2018 10:00:40 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 6 10:01:12 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 6 Jul 2018 10:01:12 +0000 Subject: Change in osmo-gsm-manuals[master]: trx: Add Hardware architecture support section In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9894 to look at the new patch set (#2). Change subject: trx: Add Hardware architecture support section ...................................................................... trx: Add Hardware architecture support section Change-Id: I38388bcb2ea7c0481052d3bca589cb34965ea7fa --- A OsmoTRX/chapters/trx-architectures.adoc M OsmoTRX/osmotrx-usermanual.adoc 2 files changed, 36 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/94/9894/2 -- To view, visit https://gerrit.osmocom.org/9894 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I38388bcb2ea7c0481052d3bca589cb34965ea7fa Gerrit-Change-Number: 9894 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 6 10:01:12 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 6 Jul 2018 10:01:12 +0000 Subject: Change in osmo-gsm-manuals[master]: trx: Add Hardware device support section In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9895 to look at the new patch set (#2). Change subject: trx: Add Hardware device support section ...................................................................... trx: Add Hardware device support section Change-Id: I87fc54cf1751f31a3e92d6503625e984f9a6130f --- A OsmoTRX/chapters/trx-backends.adoc M OsmoTRX/osmotrx-usermanual.adoc 2 files changed, 69 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/95/9895/2 -- To view, visit https://gerrit.osmocom.org/9895 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I87fc54cf1751f31a3e92d6503625e984f9a6130f Gerrit-Change-Number: 9895 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 6 10:43:03 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Fri, 6 Jul 2018 10:43:03 +0000 Subject: Change in osmo-ttcn3-hacks[master]: introduce a TTCN3 test suite for SCCP In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9653 to look at the new patch set (#2). Change subject: introduce a TTCN3 test suite for SCCP ...................................................................... introduce a TTCN3 test suite for SCCP This test suite acts as an SCCP server on top of M3UA. SCCP tests are run against the sccp_demo_user program which can be found in libosmo-sccp/examples. This program must be started in client mode: sccp_demo_user -c The SCCP test suite should then work out of the box with the provided SCCP_Tests.cfg file and this additional change to sccp_demo_user default point codes: https://gerrit.osmocom.org/#/c/libosmo-sccp/+/9652/ There is currently only one test, for the libosmo-sccp crash reported as issue OS#2666. The implementation of this test is currently using an ugly workaround due to shortcomings of the M3UA Emulation layer (see source code comments). Whether a better solution is feasible is still to be determined. The test requires a patch to the SCCP Protocol Emulation which has been submitted upstream: https://git.eclipse.org/r/#/c/124552/ Change-Id: I03f5e8b282a7396b45417495c88d8fb81b26cda8 Related: OS#2666 --- M Makefile M bsc/BSC_Tests.ttcn M bsc/gen_links.sh M library/BSSAP_Adapter.ttcn A library/SCCP_Templates.ttcn M msc/MSC_Tests.ttcn M msc/gen_links.sh A sccp/SCCP_Tests.cfg A sccp/SCCP_Tests.default A sccp/SCCP_Tests.ttcn A sccp/gen_links.sh A sccp/regen_makefile.sh 12 files changed, 362 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/53/9653/2 -- To view, visit https://gerrit.osmocom.org/9653 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I03f5e8b282a7396b45417495c88d8fb81b26cda8 Gerrit-Change-Number: 9653 Gerrit-PatchSet: 2 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 6 10:44:37 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Fri, 6 Jul 2018 10:44:37 +0000 Subject: Change in osmo-ttcn3-hacks[master]: introduce a TTCN3 test suite for SCCP In-Reply-To: References: Message-ID: Stefan Sperling has posted comments on this change. ( https://gerrit.osmocom.org/9653 ) Change subject: introduce a TTCN3 test suite for SCCP ...................................................................... Patch Set 2: Dependencies have been reduced in new patch set. The test no longer depends on BSSAP_Adapter. -- To view, visit https://gerrit.osmocom.org/9653 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I03f5e8b282a7396b45417495c88d8fb81b26cda8 Gerrit-Change-Number: 9653 Gerrit-PatchSet: 2 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-Comment-Date: Fri, 06 Jul 2018 10:44:37 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 6 12:05:41 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 6 Jul 2018 12:05:41 +0000 Subject: Change in osmo-ttcn3-hacks[master]: ggsn: Apply GPDU seqnum option to all APNs Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9896 Change subject: ggsn: Apply GPDU seqnum option to all APNs ...................................................................... ggsn: Apply GPDU seqnum option to all APNs Change-Id: I6efe926c8bb7a0056d26e15eefa282266e7bc6ca --- M ggsn_tests/GGSN_Tests.ttcn M ggsn_tests/expected-results.xml 2 files changed, 20 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/96/9896/1 diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn index 97abc4d..6ae205f 100644 --- a/ggsn_tests/GGSN_Tests.ttcn +++ b/ggsn_tests/GGSN_Tests.ttcn @@ -105,12 +105,29 @@ private function f_vty_set_gpdu_txseq(boolean enable) runs on GT_CT { f_vty_enter_config(GGSNVTY); f_vty_transceive(GGSNVTY, "ggsn ggsn0"); + f_vty_transceive(GGSNVTY, "apn internet"); if (enable) { f_vty_transceive(GGSNVTY, "g-pdu tx-sequence-numbers"); } else { f_vty_transceive(GGSNVTY, "no g-pdu tx-sequence-numbers"); } + f_vty_transceive(GGSNVTY, "exit"); + + f_vty_transceive(GGSNVTY, "apn inet6"); + if (enable) { + f_vty_transceive(GGSNVTY, "g-pdu tx-sequence-numbers"); + } else { + f_vty_transceive(GGSNVTY, "no g-pdu tx-sequence-numbers"); + } + f_vty_transceive(GGSNVTY, "exit"); + + f_vty_transceive(GGSNVTY, "apn inet46"); + if (enable) { + f_vty_transceive(GGSNVTY, "g-pdu tx-sequence-numbers"); + } else { + f_vty_transceive(GGSNVTY, "no g-pdu tx-sequence-numbers"); + } f_vty_transceive(GGSNVTY, "end"); } diff --git a/ggsn_tests/expected-results.xml b/ggsn_tests/expected-results.xml index 383ea39..081325e 100644 --- a/ggsn_tests/expected-results.xml +++ b/ggsn_tests/expected-results.xml @@ -1,10 +1,11 @@ - + - + + Secondary DNS IPv4 PCO option not found -- To view, visit https://gerrit.osmocom.org/9896 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I6efe926c8bb7a0056d26e15eefa282266e7bc6ca Gerrit-Change-Number: 9896 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Fri Jul 6 12:26:47 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Fri, 6 Jul 2018 12:26:47 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-gapk_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#12?= In-Reply-To: <11270302.69.1530793608007.JavaMail.jenkins@jenkins.osmocom.org> References: <11270302.69.1530793608007.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <962466005.87.1530880007441.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 127.05 KB...] checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether make supports nested variables... (cached) yes checking if gcc supports -fvisibility=hidden... yes checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking whether gcc understands -c and -o together... (cached) yes checking dependency style of gcc... (cached) gcc3 checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for LIBOSMOCORE... yes checking for LIBOSMOCODEC... yes checking for LIBALSA... yes checking for OPENCORE_AMRNB... yes checking gsm/gsm.h usability... yes checking gsm/gsm.h presence... yes checking for gsm/gsm.h... yes checking for gsm_create in -lgsm... yes checking for stdint.h... (cached) yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking for unistd.h... (cached) yes checking for inline... inline checking for int16_t... yes checking for int32_t... yes checking for uint16_t... yes checking for uint32_t... yes checking for uint64_t... yes checking for uint8_t... yes checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... yes checking for memset... yes checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating src/Makefile config.status: creating libgsmhr/Makefile config.status: creating include/Makefile config.status: creating include/gsmhr/Makefile config.status: creating libosmogapk.pc config.status: creating tests/atlocal config.status: creating tests/Makefile config.status: creating config.h config.status: executing depfiles commands config.status: executing libtool commands config.status: executing tests/atconfig commands make[1]: Entering directory ' make all-recursive make[2]: Entering directory ' Making all in include make[3]: Entering directory ' make[4]: Entering directory ' make[4]: Nothing to be done for 'all-am'. make[4]: Leaving directory ' make[3]: Leaving directory ' Making all in src make[3]: Entering directory ' CC procqueue.lo CC pq_format.lo CC pq_codec.lo CC pq_file.lo CC pq_alsa.lo CC pq_rtp.lo CC pq_ecu.lo CC ecu_fr.lo CC formats.lo CC fmt_ti.lo CC fmt_amr.lo CC fmt_gsm.lo CC fmt_hr_ref.lo CC fmt_racal.lo CC fmt_rawpcm.lo CC fmt_rtp_amr.lo CC fmt_rtp_efr.lo CC fmt_rtp_hr_etsi.lo CC fmt_rtp_hr_ietf.lo CC fmt_amr_opencore.lo CC codecs.lo CC codec_pcm.lo CC codec_hr.lo CC codec_fr.lo CC codec_efr.lo CC codec_amr.lo CC benchmark.lo CC common.lo CCLD libosmogapk.la CC app_osmo_gapk.o CCLD osmo-gapk make[3]: Leaving directory ' Making all in tests make[3]: Entering directory ' make[3]: Nothing to be done for 'all'. make[3]: Leaving directory ' make[3]: Entering directory ' make[3]: Leaving directory ' make[2]: Leaving directory ' make[1]: Leaving directory ' make[1]: Entering directory ' Making dvi in include make[2]: Entering directory ' make[3]: Entering directory ' make[3]: Nothing to be done for 'dvi-am'. make[3]: Leaving directory ' make[2]: Leaving directory ' Making dvi in src make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi'. make[2]: Leaving directory ' Making dvi in tests make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi'. make[2]: Leaving directory ' make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi-am'. make[2]: Leaving directory ' make[1]: Leaving directory ' make[1]: Entering directory ' Making check in include make[2]: Entering directory ' make[3]: Entering directory ' make[3]: Nothing to be done for 'check-am'. make[3]: Leaving directory ' make[2]: Leaving directory ' Making check in src make[2]: Entering directory ' make[2]: Nothing to be done for 'check'. make[2]: Leaving directory ' Making check in tests make[2]: Entering directory ' make procqueue/pq_test io/pq_file_test io/pq_rtp_test ecu/ecu_fr_test make[3]: Entering directory ' CC procqueue/pq_test.o CCLD procqueue/pq_test CC io/pq_file_test.o CCLD io/pq_file_test CC io/pq_rtp_test.o CCLD io/pq_rtp_test CC ecu/ecu_fr_test.o CCLD ecu/ecu_fr_test make[3]: Leaving directory ' make check-local make[3]: Entering directory ' /bin/bash '../../../tests/testsuite' ## ---------------------------- ## ## gapk 0.4.75-27bc test suite. ## ## ---------------------------- ## Regression tests. 1: procqueue ok 2: io/pq_file FAILED (testsuite.at:13) 3: io/pq_rtp ok 4: ecu/ecu_fr_test ok 5: conv/enc/amr_efr ok 6: conv/enc/gsm ok 7: conv/enc/racal_hr skipped (testsuite.at:58) 8: conv/enc/racal_fr ok 9: conv/enc/racal_efr ok 10: conv/enc/ti_hr skipped (testsuite.at:91) 11: conv/enc/ti_fr ok 12: conv/enc/ti_efr ok 13: conv/enc/rtp_efr ok 14: conv/enc/rtp_hr_etsi skipped (testsuite.at:135) 15: conv/enc/rtp_hr_ietf skipped (testsuite.at:146) 16: conv/dec/amr_efr ok 17: conv/dec/gsm ok 18: conv/dec/racal_hr skipped (testsuite.at:179) 19: conv/dec/racal_fr ok 20: conv/dec/racal_efr ok 21: conv/dec/ti_hr skipped (testsuite.at:212) 22: conv/dec/ti_fr ok 23: conv/dec/ti_efr ok 24: conv/dec/rtp_efr ok 25: conv/dec/rtp_hr_etsi skipped (testsuite.at:256) 26: conv/dec/rtp_hr_ietf skipped (testsuite.at:267) ## ------------- ## ## Test results. ## ## ------------- ## ERROR: 18 tests were run, 1 failed unexpectedly. 8 tests were skipped. ## -------------------------- ## ## testsuite.log was created. ## ## -------------------------- ## Please send `tests/testsuite.log' and all information you think might help: To: Subject: [gapk 0.4.75-27bc] testsuite: 2 failed You may investigate any problem if you feel able to do so, in which case the test suite provides a good starting point. Its output may be found below `tests/testsuite.dir'. Makefile:753: recipe for target 'check-local' failed make[3]: *** [check-local] Error 1 make[3]: Leaving directory ' Makefile:602: recipe for target 'check-am' failed make[2]: *** [check-am] Error 2 make[2]: Leaving directory ' Makefile:479: recipe for target 'check-recursive' failed make[1]: *** [check-recursive] Error 1 make[1]: Leaving directory ' Makefile:684: recipe for target 'distcheck' failed make: *** [distcheck] Error 1 + cat-testlogs.sh ======================== ./gapk-0.4.75-27bc/_build/sub/tests/testsuite.dir/02/testsuite.log # -*- compilation -*- 2. testsuite.at:10: testing io/pq_file ... ../../../tests/testsuite.at:13: $abs_top_builddir/tests/io/pq_file_test \ $abs_top_builddir/tests/io/io_sample.txt --- /dev/null 2018-03-27 19:17:06.212284948 +0000 +++ 2018-07-06 12:26:46.756566307 +0000 @@ -0,0 +1,2 @@ +pq_file_test: ../../../tests/io/pq_file_test.c:132: main: Assertion `sample_file != NULL' failed. +: line 29: 348 Aborted $abs_top_builddir/tests/io/pq_file_test $abs_top_builddir/tests/io/io_sample.txt --- expout 2018-07-06 12:26:46.748566355 +0000 +++ 2018-07-06 12:26:46.748566355 +0000 @@ -1,12 +0,0 @@ -Processing sample file with blk_len=2: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=4: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=8: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=16: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=32: -8217c8fb7675a95008f9089d883gapk - -chunk null_context: depth=0 ../../../tests/testsuite.at:13: exit code was 134, expected 0 2. testsuite.at:10: 2. io/pq_file (testsuite.at:10): FAILED (testsuite.at:13) Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Fri Jul 6 12:50:51 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 6 Jul 2018 12:50:51 +0000 Subject: Change in docker-playground[master]: ttcn3-*: Merge logfiles no matter resolution of tests Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9897 Change subject: ttcn3-*: Merge logfiles no matter resolution of tests ...................................................................... ttcn3-*: Merge logfiles no matter resolution of tests Previous to this commit, log messages were not being merged if tests were resolved as failed (test-suite.sh ending with exit code != 0), which can happen if at least one test failed. Change-Id: If293fc2d3182ef2a7b997faa8b41129a9dd89c45 --- M ttcn3-bsc-test/Dockerfile M ttcn3-bts-test/Dockerfile M ttcn3-ggsn-test/Dockerfile M ttcn3-hlr-test/Dockerfile M ttcn3-mgw-test/Dockerfile M ttcn3-msc-test/Dockerfile M ttcn3-nitb-sysinfo/Dockerfile M ttcn3-sgsn-test/Dockerfile M ttcn3-sip-test/Dockerfile 9 files changed, 36 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/97/9897/1 diff --git a/ttcn3-bsc-test/Dockerfile b/ttcn3-bsc-test/Dockerfile index 4f0c606..9bdc898 100644 --- a/ttcn3-bsc-test/Dockerfile +++ b/ttcn3-bsc-test/Dockerfile @@ -26,5 +26,7 @@ COPY BSC_Tests.cfg /data/BSC_Tests.cfg CMD cd /data && \ - /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/bsc/BSC_Tests && \ - /osmo-ttcn3-hacks/log_merge.sh BSC_Tests --rm + /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/bsc/BSC_Tests; \ + exit_code=$?; \ + /osmo-ttcn3-hacks/log_merge.sh BSC_Tests --rm; \ + exit $exit_code diff --git a/ttcn3-bts-test/Dockerfile b/ttcn3-bts-test/Dockerfile index 43ed4f0..3fec55b 100644 --- a/ttcn3-bts-test/Dockerfile +++ b/ttcn3-bts-test/Dockerfile @@ -26,5 +26,7 @@ COPY BTS_Tests.cfg /data/BTS_Tests.cfg CMD cd /data && \ - /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/bts/BTS_Tests && \ - /osmo-ttcn3-hacks/log_merge.sh BTS_Tests --rm + /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/bts/BTS_Tests; \ + exit_code=$?; \ + /osmo-ttcn3-hacks/log_merge.sh BTS_Tests --rm; \ + exit $exit_code diff --git a/ttcn3-ggsn-test/Dockerfile b/ttcn3-ggsn-test/Dockerfile index 3c676cd..4e5e2da 100644 --- a/ttcn3-ggsn-test/Dockerfile +++ b/ttcn3-ggsn-test/Dockerfile @@ -22,5 +22,7 @@ COPY GGSN_Tests.cfg /data/GGSN_Tests.cfg CMD cd /data && \ - /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/ggsn_tests/GGSN_Tests && \ - /osmo-ttcn3-hacks/log_merge.sh GGSN_Tests --rm + /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/ggsn_tests/GGSN_Tests; \ + exit_code=$?; \ + /osmo-ttcn3-hacks/log_merge.sh GGSN_Tests --rm; \ + exit $exit_code diff --git a/ttcn3-hlr-test/Dockerfile b/ttcn3-hlr-test/Dockerfile index 8a920a6..0dee3d3 100644 --- a/ttcn3-hlr-test/Dockerfile +++ b/ttcn3-hlr-test/Dockerfile @@ -26,5 +26,7 @@ COPY HLR_Tests.cfg /data/HLR_Tests.cfg CMD cd /data && \ - /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/hlr/HLR_Tests && \ - /osmo-ttcn3-hacks/log_merge.sh HLR_Tests --rm + /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/hlr/HLR_Tests; \ + exit_code=$?; \ + /osmo-ttcn3-hacks/log_merge.sh HLR_Tests --rm; \ + exit $exit_code diff --git a/ttcn3-mgw-test/Dockerfile b/ttcn3-mgw-test/Dockerfile index 423e9df..6460c0a 100644 --- a/ttcn3-mgw-test/Dockerfile +++ b/ttcn3-mgw-test/Dockerfile @@ -23,5 +23,7 @@ COPY MGCP_Test.cfg /data/MGCP_Test.cfg CMD cd /data && \ - /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/mgw/MGCP_Test && \ - /osmo-ttcn3-hacks/log_merge.sh MGCP_Test --rm + /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/mgw/MGCP_Test; \ + exit_code=$?; \ + /osmo-ttcn3-hacks/log_merge.sh MGCP_Test --rm; \ + exit $exit_code diff --git a/ttcn3-msc-test/Dockerfile b/ttcn3-msc-test/Dockerfile index 315638f..bbc60a2 100644 --- a/ttcn3-msc-test/Dockerfile +++ b/ttcn3-msc-test/Dockerfile @@ -26,5 +26,7 @@ COPY MSC_Tests.cfg /data/MSC_Tests.cfg CMD cd /data && \ - /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/msc/MSC_Tests && \ - /osmo-ttcn3-hacks/log_merge.sh MSC_Tests --rm + /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/msc/MSC_Tests; \ + exit_code=$?; \ + /osmo-ttcn3-hacks/log_merge.sh MSC_Tests --rm; \ + exit $exit_code diff --git a/ttcn3-nitb-sysinfo/Dockerfile b/ttcn3-nitb-sysinfo/Dockerfile index fb5ceb2..39860f2 100644 --- a/ttcn3-nitb-sysinfo/Dockerfile +++ b/ttcn3-nitb-sysinfo/Dockerfile @@ -20,5 +20,7 @@ COPY Test.cfg /data/Test.cfg CMD cd /data && \ - /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/sysinfo/Test && \ - /osmo-ttcn3-hacks/log_merge.sh Test + /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/sysinfo/Test; \ + exit_code=$?; \ + /osmo-ttcn3-hacks/log_merge.sh Test; \ + exit $exit_code diff --git a/ttcn3-sgsn-test/Dockerfile b/ttcn3-sgsn-test/Dockerfile index dfca1c4..d06195d 100644 --- a/ttcn3-sgsn-test/Dockerfile +++ b/ttcn3-sgsn-test/Dockerfile @@ -26,5 +26,7 @@ COPY SGSN_Tests.cfg /data/SGSN_Tests.cfg CMD cd /data && \ - /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/sgsn/SGSN_Tests && \ - /osmo-ttcn3-hacks/log_merge.sh SGSN_Tests --rm + /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/sgsn/SGSN_Tests; \ + exit_code=$?; \ + /osmo-ttcn3-hacks/log_merge.sh SGSN_Tests --rm; \ + exit $exit_code diff --git a/ttcn3-sip-test/Dockerfile b/ttcn3-sip-test/Dockerfile index d443d29..7d566b9 100644 --- a/ttcn3-sip-test/Dockerfile +++ b/ttcn3-sip-test/Dockerfile @@ -26,5 +26,7 @@ COPY SIP_Tests.cfg /data/SIP_Tests.cfg CMD cd /data && \ - /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/sip/SIP_Tests && \ - /osmo-ttcn3-hacks/log_merge.sh SIP_Tests --rm + /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/sip/SIP_Tests; \ + exit_code=$?; \ + /osmo-ttcn3-hacks/log_merge.sh SIP_Tests --rm; \ + exit $exit_code -- To view, visit https://gerrit.osmocom.org/9897 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: If293fc2d3182ef2a7b997faa8b41129a9dd89c45 Gerrit-Change-Number: 9897 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 6 14:10:38 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 6 Jul 2018 14:10:38 +0000 Subject: Change in docker-playground[master]: ttcn3-nitb-sysinfo: Remove input logfiles after merging them Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9898 Change subject: ttcn3-nitb-sysinfo: Remove input logfiles after merging them ...................................................................... ttcn3-nitb-sysinfo: Remove input logfiles after merging them All other ttcn3 projects do it. Change-Id: Iee0e96d3832d88f2ee5958158b372243441750b3 --- M ttcn3-nitb-sysinfo/Dockerfile 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/98/9898/1 diff --git a/ttcn3-nitb-sysinfo/Dockerfile b/ttcn3-nitb-sysinfo/Dockerfile index 39860f2..8cd9e58 100644 --- a/ttcn3-nitb-sysinfo/Dockerfile +++ b/ttcn3-nitb-sysinfo/Dockerfile @@ -22,5 +22,5 @@ CMD cd /data && \ /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/sysinfo/Test; \ exit_code=$?; \ - /osmo-ttcn3-hacks/log_merge.sh Test; \ + /osmo-ttcn3-hacks/log_merge.sh Test --rm; \ exit $exit_code -- To view, visit https://gerrit.osmocom.org/9898 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iee0e96d3832d88f2ee5958158b372243441750b3 Gerrit-Change-Number: 9898 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 6 14:12:41 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 6 Jul 2018 14:12:41 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS_Tests: altstep as_meas_res: Check for meas timer timeout only if ... Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9899 Change subject: BTS_Tests: altstep as_meas_res: Check for meas timer timeout only if previously set ...................................................................... BTS_Tests: altstep as_meas_res: Check for meas timer timeout only if previously set Should fix following spotted message in TTCN3 logs: BTS_Tests.ttcn:1297 Timeout operation on timer g_Tmeas_exp failed: The timer is not started. Change-Id: Ia28c40e8cb338ecc23f72474832307bba2b09503 --- M bts/BTS_Tests.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/99/9899/1 diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index f66a43f..aee081e 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -1294,7 +1294,7 @@ setverdict(fail, "Received unexpected MEAS RES ", rsl); self.stop; } - [] g_Tmeas_exp.timeout { + [g_Tmeas_exp.running] g_Tmeas_exp.timeout { setverdict(fail, "Didn't receive expected measurement result") self.stop; } -- To view, visit https://gerrit.osmocom.org/9899 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ia28c40e8cb338ecc23f72474832307bba2b09503 Gerrit-Change-Number: 9899 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 6 14:42:45 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 6 Jul 2018 14:42:45 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS_Tests: altstep as_meas_res: Check for meas timer timeout only if ... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9899 ) Change subject: BTS_Tests: altstep as_meas_res: Check for meas timer timeout only if previously set ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9899 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia28c40e8cb338ecc23f72474832307bba2b09503 Gerrit-Change-Number: 9899 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Fri, 06 Jul 2018 14:42:45 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 6 14:42:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 6 Jul 2018 14:42:47 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS_Tests: altstep as_meas_res: Check for meas timer timeout only if ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9899 ) Change subject: BTS_Tests: altstep as_meas_res: Check for meas timer timeout only if previously set ...................................................................... BTS_Tests: altstep as_meas_res: Check for meas timer timeout only if previously set Should fix following spotted message in TTCN3 logs: BTS_Tests.ttcn:1297 Timeout operation on timer g_Tmeas_exp failed: The timer is not started. Change-Id: Ia28c40e8cb338ecc23f72474832307bba2b09503 --- M bts/BTS_Tests.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index f66a43f..aee081e 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -1294,7 +1294,7 @@ setverdict(fail, "Received unexpected MEAS RES ", rsl); self.stop; } - [] g_Tmeas_exp.timeout { + [g_Tmeas_exp.running] g_Tmeas_exp.timeout { setverdict(fail, "Didn't receive expected measurement result") self.stop; } -- To view, visit https://gerrit.osmocom.org/9899 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ia28c40e8cb338ecc23f72474832307bba2b09503 Gerrit-Change-Number: 9899 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 6 14:43:04 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 6 Jul 2018 14:43:04 +0000 Subject: Change in docker-playground[master]: ttcn3-nitb-sysinfo: Remove input logfiles after merging them In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9898 ) Change subject: ttcn3-nitb-sysinfo: Remove input logfiles after merging them ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9898 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iee0e96d3832d88f2ee5958158b372243441750b3 Gerrit-Change-Number: 9898 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Fri, 06 Jul 2018 14:43:04 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 6 14:43:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 6 Jul 2018 14:43:18 +0000 Subject: Change in docker-playground[master]: ttcn3-*: Merge logfiles no matter resolution of tests In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9897 ) Change subject: ttcn3-*: Merge logfiles no matter resolution of tests ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9897 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If293fc2d3182ef2a7b997faa8b41129a9dd89c45 Gerrit-Change-Number: 9897 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Fri, 06 Jul 2018 14:43:18 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 6 14:43:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 6 Jul 2018 14:43:20 +0000 Subject: Change in docker-playground[master]: ttcn3-*: Merge logfiles no matter resolution of tests In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9897 ) Change subject: ttcn3-*: Merge logfiles no matter resolution of tests ...................................................................... Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/9897 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If293fc2d3182ef2a7b997faa8b41129a9dd89c45 Gerrit-Change-Number: 9897 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Fri, 06 Jul 2018 14:43:20 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 6 14:43:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 6 Jul 2018 14:43:21 +0000 Subject: Change in docker-playground[master]: ttcn3-*: Merge logfiles no matter resolution of tests In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9897 ) Change subject: ttcn3-*: Merge logfiles no matter resolution of tests ...................................................................... ttcn3-*: Merge logfiles no matter resolution of tests Previous to this commit, log messages were not being merged if tests were resolved as failed (test-suite.sh ending with exit code != 0), which can happen if at least one test failed. Change-Id: If293fc2d3182ef2a7b997faa8b41129a9dd89c45 --- M ttcn3-bsc-test/Dockerfile M ttcn3-bts-test/Dockerfile M ttcn3-ggsn-test/Dockerfile M ttcn3-hlr-test/Dockerfile M ttcn3-mgw-test/Dockerfile M ttcn3-msc-test/Dockerfile M ttcn3-nitb-sysinfo/Dockerfile M ttcn3-sgsn-test/Dockerfile M ttcn3-sip-test/Dockerfile 9 files changed, 36 insertions(+), 18 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/ttcn3-bsc-test/Dockerfile b/ttcn3-bsc-test/Dockerfile index 4f0c606..9bdc898 100644 --- a/ttcn3-bsc-test/Dockerfile +++ b/ttcn3-bsc-test/Dockerfile @@ -26,5 +26,7 @@ COPY BSC_Tests.cfg /data/BSC_Tests.cfg CMD cd /data && \ - /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/bsc/BSC_Tests && \ - /osmo-ttcn3-hacks/log_merge.sh BSC_Tests --rm + /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/bsc/BSC_Tests; \ + exit_code=$?; \ + /osmo-ttcn3-hacks/log_merge.sh BSC_Tests --rm; \ + exit $exit_code diff --git a/ttcn3-bts-test/Dockerfile b/ttcn3-bts-test/Dockerfile index 43ed4f0..3fec55b 100644 --- a/ttcn3-bts-test/Dockerfile +++ b/ttcn3-bts-test/Dockerfile @@ -26,5 +26,7 @@ COPY BTS_Tests.cfg /data/BTS_Tests.cfg CMD cd /data && \ - /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/bts/BTS_Tests && \ - /osmo-ttcn3-hacks/log_merge.sh BTS_Tests --rm + /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/bts/BTS_Tests; \ + exit_code=$?; \ + /osmo-ttcn3-hacks/log_merge.sh BTS_Tests --rm; \ + exit $exit_code diff --git a/ttcn3-ggsn-test/Dockerfile b/ttcn3-ggsn-test/Dockerfile index 3c676cd..4e5e2da 100644 --- a/ttcn3-ggsn-test/Dockerfile +++ b/ttcn3-ggsn-test/Dockerfile @@ -22,5 +22,7 @@ COPY GGSN_Tests.cfg /data/GGSN_Tests.cfg CMD cd /data && \ - /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/ggsn_tests/GGSN_Tests && \ - /osmo-ttcn3-hacks/log_merge.sh GGSN_Tests --rm + /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/ggsn_tests/GGSN_Tests; \ + exit_code=$?; \ + /osmo-ttcn3-hacks/log_merge.sh GGSN_Tests --rm; \ + exit $exit_code diff --git a/ttcn3-hlr-test/Dockerfile b/ttcn3-hlr-test/Dockerfile index 8a920a6..0dee3d3 100644 --- a/ttcn3-hlr-test/Dockerfile +++ b/ttcn3-hlr-test/Dockerfile @@ -26,5 +26,7 @@ COPY HLR_Tests.cfg /data/HLR_Tests.cfg CMD cd /data && \ - /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/hlr/HLR_Tests && \ - /osmo-ttcn3-hacks/log_merge.sh HLR_Tests --rm + /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/hlr/HLR_Tests; \ + exit_code=$?; \ + /osmo-ttcn3-hacks/log_merge.sh HLR_Tests --rm; \ + exit $exit_code diff --git a/ttcn3-mgw-test/Dockerfile b/ttcn3-mgw-test/Dockerfile index 423e9df..6460c0a 100644 --- a/ttcn3-mgw-test/Dockerfile +++ b/ttcn3-mgw-test/Dockerfile @@ -23,5 +23,7 @@ COPY MGCP_Test.cfg /data/MGCP_Test.cfg CMD cd /data && \ - /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/mgw/MGCP_Test && \ - /osmo-ttcn3-hacks/log_merge.sh MGCP_Test --rm + /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/mgw/MGCP_Test; \ + exit_code=$?; \ + /osmo-ttcn3-hacks/log_merge.sh MGCP_Test --rm; \ + exit $exit_code diff --git a/ttcn3-msc-test/Dockerfile b/ttcn3-msc-test/Dockerfile index 315638f..bbc60a2 100644 --- a/ttcn3-msc-test/Dockerfile +++ b/ttcn3-msc-test/Dockerfile @@ -26,5 +26,7 @@ COPY MSC_Tests.cfg /data/MSC_Tests.cfg CMD cd /data && \ - /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/msc/MSC_Tests && \ - /osmo-ttcn3-hacks/log_merge.sh MSC_Tests --rm + /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/msc/MSC_Tests; \ + exit_code=$?; \ + /osmo-ttcn3-hacks/log_merge.sh MSC_Tests --rm; \ + exit $exit_code diff --git a/ttcn3-nitb-sysinfo/Dockerfile b/ttcn3-nitb-sysinfo/Dockerfile index fb5ceb2..39860f2 100644 --- a/ttcn3-nitb-sysinfo/Dockerfile +++ b/ttcn3-nitb-sysinfo/Dockerfile @@ -20,5 +20,7 @@ COPY Test.cfg /data/Test.cfg CMD cd /data && \ - /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/sysinfo/Test && \ - /osmo-ttcn3-hacks/log_merge.sh Test + /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/sysinfo/Test; \ + exit_code=$?; \ + /osmo-ttcn3-hacks/log_merge.sh Test; \ + exit $exit_code diff --git a/ttcn3-sgsn-test/Dockerfile b/ttcn3-sgsn-test/Dockerfile index dfca1c4..d06195d 100644 --- a/ttcn3-sgsn-test/Dockerfile +++ b/ttcn3-sgsn-test/Dockerfile @@ -26,5 +26,7 @@ COPY SGSN_Tests.cfg /data/SGSN_Tests.cfg CMD cd /data && \ - /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/sgsn/SGSN_Tests && \ - /osmo-ttcn3-hacks/log_merge.sh SGSN_Tests --rm + /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/sgsn/SGSN_Tests; \ + exit_code=$?; \ + /osmo-ttcn3-hacks/log_merge.sh SGSN_Tests --rm; \ + exit $exit_code diff --git a/ttcn3-sip-test/Dockerfile b/ttcn3-sip-test/Dockerfile index d443d29..7d566b9 100644 --- a/ttcn3-sip-test/Dockerfile +++ b/ttcn3-sip-test/Dockerfile @@ -26,5 +26,7 @@ COPY SIP_Tests.cfg /data/SIP_Tests.cfg CMD cd /data && \ - /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/sip/SIP_Tests && \ - /osmo-ttcn3-hacks/log_merge.sh SIP_Tests --rm + /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/sip/SIP_Tests; \ + exit_code=$?; \ + /osmo-ttcn3-hacks/log_merge.sh SIP_Tests --rm; \ + exit $exit_code -- To view, visit https://gerrit.osmocom.org/9897 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: If293fc2d3182ef2a7b997faa8b41129a9dd89c45 Gerrit-Change-Number: 9897 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 6 14:43:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 6 Jul 2018 14:43:24 +0000 Subject: Change in docker-playground[master]: ttcn3-nitb-sysinfo: Remove input logfiles after merging them In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9898 ) Change subject: ttcn3-nitb-sysinfo: Remove input logfiles after merging them ...................................................................... Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/9898 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iee0e96d3832d88f2ee5958158b372243441750b3 Gerrit-Change-Number: 9898 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Fri, 06 Jul 2018 14:43:24 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 6 14:43:25 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 6 Jul 2018 14:43:25 +0000 Subject: Change in docker-playground[master]: ttcn3-nitb-sysinfo: Remove input logfiles after merging them In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9898 ) Change subject: ttcn3-nitb-sysinfo: Remove input logfiles after merging them ...................................................................... ttcn3-nitb-sysinfo: Remove input logfiles after merging them All other ttcn3 projects do it. Change-Id: Iee0e96d3832d88f2ee5958158b372243441750b3 --- M ttcn3-nitb-sysinfo/Dockerfile 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/ttcn3-nitb-sysinfo/Dockerfile b/ttcn3-nitb-sysinfo/Dockerfile index 39860f2..8cd9e58 100644 --- a/ttcn3-nitb-sysinfo/Dockerfile +++ b/ttcn3-nitb-sysinfo/Dockerfile @@ -22,5 +22,5 @@ CMD cd /data && \ /osmo-ttcn3-hacks/start-testsuite.sh /osmo-ttcn3-hacks/sysinfo/Test; \ exit_code=$?; \ - /osmo-ttcn3-hacks/log_merge.sh Test; \ + /osmo-ttcn3-hacks/log_merge.sh Test --rm; \ exit $exit_code -- To view, visit https://gerrit.osmocom.org/9898 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iee0e96d3832d88f2ee5958158b372243441750b3 Gerrit-Change-Number: 9898 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 6 14:43:59 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 6 Jul 2018 14:43:59 +0000 Subject: Change in osmo-ttcn3-hacks[master]: ggsn: Apply GPDU seqnum option to all APNs In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9896 ) Change subject: ggsn: Apply GPDU seqnum option to all APNs ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9896 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6efe926c8bb7a0056d26e15eefa282266e7bc6ca Gerrit-Change-Number: 9896 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Fri, 06 Jul 2018 14:43:59 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 6 14:44:00 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 6 Jul 2018 14:44:00 +0000 Subject: Change in osmo-ttcn3-hacks[master]: ggsn: Apply GPDU seqnum option to all APNs In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9896 ) Change subject: ggsn: Apply GPDU seqnum option to all APNs ...................................................................... ggsn: Apply GPDU seqnum option to all APNs Change-Id: I6efe926c8bb7a0056d26e15eefa282266e7bc6ca --- M ggsn_tests/GGSN_Tests.ttcn M ggsn_tests/expected-results.xml 2 files changed, 20 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn index 97abc4d..6ae205f 100644 --- a/ggsn_tests/GGSN_Tests.ttcn +++ b/ggsn_tests/GGSN_Tests.ttcn @@ -105,12 +105,29 @@ private function f_vty_set_gpdu_txseq(boolean enable) runs on GT_CT { f_vty_enter_config(GGSNVTY); f_vty_transceive(GGSNVTY, "ggsn ggsn0"); + f_vty_transceive(GGSNVTY, "apn internet"); if (enable) { f_vty_transceive(GGSNVTY, "g-pdu tx-sequence-numbers"); } else { f_vty_transceive(GGSNVTY, "no g-pdu tx-sequence-numbers"); } + f_vty_transceive(GGSNVTY, "exit"); + + f_vty_transceive(GGSNVTY, "apn inet6"); + if (enable) { + f_vty_transceive(GGSNVTY, "g-pdu tx-sequence-numbers"); + } else { + f_vty_transceive(GGSNVTY, "no g-pdu tx-sequence-numbers"); + } + f_vty_transceive(GGSNVTY, "exit"); + + f_vty_transceive(GGSNVTY, "apn inet46"); + if (enable) { + f_vty_transceive(GGSNVTY, "g-pdu tx-sequence-numbers"); + } else { + f_vty_transceive(GGSNVTY, "no g-pdu tx-sequence-numbers"); + } f_vty_transceive(GGSNVTY, "end"); } diff --git a/ggsn_tests/expected-results.xml b/ggsn_tests/expected-results.xml index 383ea39..081325e 100644 --- a/ggsn_tests/expected-results.xml +++ b/ggsn_tests/expected-results.xml @@ -1,10 +1,11 @@ - + - + + Secondary DNS IPv4 PCO option not found -- To view, visit https://gerrit.osmocom.org/9896 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I6efe926c8bb7a0056d26e15eefa282266e7bc6ca Gerrit-Change-Number: 9896 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 6 14:47:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 6 Jul 2018 14:47:15 +0000 Subject: Change in osmo-ttcn3-hacks[master]: introduce a TTCN3 test suite for SCCP In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9653 ) Change subject: introduce a TTCN3 test suite for SCCP ...................................................................... Patch Set 2: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/9653/2/sccp/gen_links.sh File sccp/gen_links.sh: https://gerrit.osmocom.org/#/c/9653/2/sccp/gen_links.sh at 56 PS2, Line 56: FILES+="MNCC_Types.ttcn MNCC_EncDec.cc MNCC_CodecPort.ttcn mncc.h MNCC_Emulation.ttcn " where is MNCC used in this testsuite? I commented on its removal in my previous review. Maybe thre is some dependency that I'm not aware of? If so, please explain. Thanks! -- To view, visit https://gerrit.osmocom.org/9653 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I03f5e8b282a7396b45417495c88d8fb81b26cda8 Gerrit-Change-Number: 9653 Gerrit-PatchSet: 2 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-Comment-Date: Fri, 06 Jul 2018 14:47:15 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 6 14:48:10 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 6 Jul 2018 14:48:10 +0000 Subject: Change in osmo-gsm-manuals[master]: trx: Add Hardware architecture support section In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9894 ) Change subject: trx: Add Hardware architecture support section ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9894 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I38388bcb2ea7c0481052d3bca589cb34965ea7fa Gerrit-Change-Number: 9894 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Fri, 06 Jul 2018 14:48:10 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 6 14:48:43 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 6 Jul 2018 14:48:43 +0000 Subject: Change in osmo-gsm-manuals[master]: trx: Add Hardware device support section In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9895 ) Change subject: trx: Add Hardware device support section ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9895 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I87fc54cf1751f31a3e92d6503625e984f9a6130f Gerrit-Change-Number: 9895 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Fri, 06 Jul 2018 14:48:43 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 6 14:52:09 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 6 Jul 2018 14:52:09 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BSC_Tests: Also test LCLS with halfrate codecs Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/9900 Change subject: BSC_Tests: Also test LCLS with halfrate codecs ...................................................................... BSC_Tests: Also test LCLS with halfrate codecs At the moment LCLS is only tested using GSM-FR. There are not LCLS tests that test with GSM-HR yet. Lets make GSM-HR available and see what happens when we run BSC_Tests_LCLS.TC_lcls_gcr_bway_connect on HR instead of FR. - set channelType depending on g_pars.ass_codec_list.codecElements[0] - add testcase TC_lcls_gcr_bway_connect_hr Related OS#1602 Change-Id: I2421519a642bdb7453ae4a9058e177845690a489 --- M bsc/BSC_Tests.ttcn M bsc/BSC_Tests_LCLS.ttcn M bsc/expected-results.xml 3 files changed, 24 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/00/9900/1 diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 2a8ad5f..149d5b7 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -1735,7 +1735,7 @@ } /* determine BSSMAP_IE_ChannelType from *first* element of BSSMAP_FIELD_CodecElement */ -private function f_BSSMAP_chtype_from_codec(BSSMAP_FIELD_CodecElement a_elem) +function f_BSSMAP_chtype_from_codec(BSSMAP_FIELD_CodecElement a_elem) return BSSMAP_IE_ChannelType { /* FIXME: actually look at all elements of BSSMAP_IE_SpeechCodecList */ var BSSMAP_IE_ChannelType ret := valueof(ts_BSSMAP_IE_ChannelType); diff --git a/bsc/BSC_Tests_LCLS.ttcn b/bsc/BSC_Tests_LCLS.ttcn index b99ba58..da9fe94 100644 --- a/bsc/BSC_Tests_LCLS.ttcn +++ b/bsc/BSC_Tests_LCLS.ttcn @@ -128,8 +128,12 @@ private function f_lcls_connhdlr_main(charstring id) runs on LCLS_MSC_ConnHdlr { /* 1) establish the connection between RSL and BSSAP side */ var PDU_BSSAP ass_req := f_gen_ass_req(); + var template PDU_BSSAP ass_compl := f_gen_exp_compl(); ass_req.pdu.bssmap.assignmentRequest.codecList := g_pars.ass_codec_list; + ass_req.pdu.bssmap.assignmentRequest.channelType := + f_BSSMAP_chtype_from_codec(g_pars.ass_codec_list.codecElements[0]); + f_establish_fully(ass_req, ass_compl); /* 2) notify master that assignment has completed */ @@ -251,8 +255,7 @@ f_lcls_test_fini(); } -/* Send an ASSIGNMENT REQ with LCLS GCR+CFG+CSC; expect connect both-way */ -testcase TC_lcls_gcr_bway_connect() runs on lcls_test_CT { +private function f_tc_lcls_gcr_bway_connect(boolean hr) runs on lcls_test_CT { var TestHdlrParams pars_a := valueof(t_def_TestHdlrPars); var TestHdlrParams pars_b; var MSC_ConnHdlr vc_conn; @@ -260,7 +263,11 @@ f_lcls_init(); - pars_a.ass_codec_list := valueof(ts_BSSMAP_IE_CodecList({ts_CodecFR})); + if (hr == true) { + pars_a.ass_codec_list := valueof(ts_BSSMAP_IE_CodecList({ts_CodecHR})); + } else { + pars_a.ass_codec_list := valueof(ts_BSSMAP_IE_CodecList({ts_CodecFR})); + } pars_a.lcls.gcr := valueof(ts_GCR('010203'O, '0405'O, '060708090a'O)); pars_a.lcls.cfg := LCLS_CFG_both_way; pars_a.lcls.csc := LCLS_CSC_connect; @@ -272,6 +279,7 @@ pars_b.lcls.exp_sts := LCLS_STS_locally_switched; f_lcls_test_init(pars_a, pars_b); + CONN_A.receive(LclsCompSync:LCLS_COMP_SYNC_ASS_COMPL); interleave { [] CONN_A.receive(tr_BSSMAP_LclsNotificationSts(LCLS_STS_not_yet_ls)); @@ -285,6 +293,16 @@ f_lcls_test_fini(); } +/* Send an ASSIGNMENT REQ with LCLS GCR+CFG+CSC; expect connect both-way (full rate)*/ +testcase TC_lcls_gcr_bway_connect() runs on lcls_test_CT { + f_tc_lcls_gcr_bway_connect(false) +} + +/* Send an ASSIGNMENT REQ with LCLS GCR+CFG+CSC; expect connect both-way (half rate) */ +testcase TC_lcls_gcr_bway_connect_hr() runs on lcls_test_CT { + f_tc_lcls_gcr_bway_connect(true) +} + /* Send an ASSIGNMENT REQ with LCLS CFG+CSC enabling LCLS but GCR doesn't match! */ testcase TC_lcls_gcr_nomatch_bway_connect() runs on lcls_test_CT { var TestHdlrParams pars_a := valueof(t_def_TestHdlrPars); @@ -581,6 +599,7 @@ execute( TC_lcls_gcr_only() ); execute( TC_lcls_gcr_bway_connect() ); + execute( TC_lcls_gcr_bway_connect_hr() ); execute( TC_lcls_gcr_nomatch_bway_connect() ); execute( TC_lcls_gcr_bway_dont_connect() ); execute( TC_lcls_gcr_unsuppported_cfg() ); diff --git a/bsc/expected-results.xml b/bsc/expected-results.xml index 969660e..dbe3d2c 100644 --- a/bsc/expected-results.xml +++ b/bsc/expected-results.xml @@ -87,6 +87,7 @@ + -- To view, visit https://gerrit.osmocom.org/9900 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I2421519a642bdb7453ae4a9058e177845690a489 Gerrit-Change-Number: 9900 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 6 15:07:31 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Fri, 6 Jul 2018 15:07:31 +0000 Subject: Change in osmo-ttcn3-hacks[master]: introduce a TTCN3 test suite for SCCP In-Reply-To: References: Message-ID: Stefan Sperling has posted comments on this change. ( https://gerrit.osmocom.org/9653 ) Change subject: introduce a TTCN3 test suite for SCCP ...................................................................... Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/9653/2/sccp/gen_links.sh File sccp/gen_links.sh: https://gerrit.osmocom.org/#/c/9653/2/sccp/gen_links.sh at 56 PS2, Line 56: FILES+="MNCC_Types.ttcn MNCC_EncDec.cc MNCC_CodecPort.ttcn mncc.h MNCC_Emulation.ttcn " > where is MNCC used in this testsuite? I commented on its removal in my previous review. [?] Indeed, it is not needed. Thanks for pointing this out again, I got a bit lost in the amount of things to remove :) -- To view, visit https://gerrit.osmocom.org/9653 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I03f5e8b282a7396b45417495c88d8fb81b26cda8 Gerrit-Change-Number: 9653 Gerrit-PatchSet: 2 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-Comment-Date: Fri, 06 Jul 2018 15:07:31 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 6 15:07:59 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Fri, 6 Jul 2018 15:07:59 +0000 Subject: Change in osmo-ttcn3-hacks[master]: introduce a TTCN3 test suite for SCCP In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9653 to look at the new patch set (#3). Change subject: introduce a TTCN3 test suite for SCCP ...................................................................... introduce a TTCN3 test suite for SCCP This test suite acts as an SCCP server on top of M3UA. SCCP tests are run against the sccp_demo_user program which can be found in libosmo-sccp/examples. This program must be started in client mode: sccp_demo_user -c The SCCP test suite should then work out of the box with the provided SCCP_Tests.cfg file and this additional change to sccp_demo_user default point codes: https://gerrit.osmocom.org/#/c/libosmo-sccp/+/9652/ There is currently only one test, for the libosmo-sccp crash reported as issue OS#2666. The implementation of this test is currently using an ugly workaround due to shortcomings of the M3UA Emulation layer (see source code comments). Whether a better solution is feasible is still to be determined. The test requires a patch to the SCCP Protocol Emulation which has been submitted upstream: https://git.eclipse.org/r/#/c/124552/ Change-Id: I03f5e8b282a7396b45417495c88d8fb81b26cda8 Related: OS#2666 --- M Makefile M bsc/BSC_Tests.ttcn M bsc/gen_links.sh M library/BSSAP_Adapter.ttcn A library/SCCP_Templates.ttcn M msc/MSC_Tests.ttcn M msc/gen_links.sh A sccp/SCCP_Tests.cfg A sccp/SCCP_Tests.default A sccp/SCCP_Tests.ttcn A sccp/gen_links.sh A sccp/regen_makefile.sh 12 files changed, 361 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/53/9653/3 -- To view, visit https://gerrit.osmocom.org/9653 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I03f5e8b282a7396b45417495c88d8fb81b26cda8 Gerrit-Change-Number: 9653 Gerrit-PatchSet: 3 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Fri Jul 6 15:10:06 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Fri, 6 Jul 2018 15:10:06 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-asn1c_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#176?= In-Reply-To: <1959345212.70.1530803406453.JavaMail.jenkins@jenkins.osmocom.org> References: <1959345212.70.1530803406453.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <1068669447.89.1530889806501.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 3.67 KB...] + ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for style of include used by make... GNU checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking how to run the C++ preprocessor... g++ -E checking for g77... no checking for f77... no checking for xlf... no checking for frt... no checking for pgf77... no checking for cf77... no checking for fort77... no checking for fl32... no checking for af77... no checking for f90... no checking for xlf90... no checking for pgf90... no checking for pghpf... no checking for epcf90... no checking for gfortran... no checking for g95... no checking for f95... no checking for fort... no checking for xlf95... no checking for ifort... no checking for ifc... no checking for efc... no checking for pgf95... no checking for lf95... no checking for ftn... no checking whether we are using the GNU Fortran 77 compiler... no checking whether accepts -g... no checking the maximum length of command line arguments... 32768 checking command to parse /usr/bin/nm -B output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes configure: creating libtool appending configuration tag "CXX" to libtool checking for ld used by g++... /usr/bin/ld -m elf_x86_64 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC checking if g++ PIC flag -fPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate appending configuration tag "F77" to libtool checking for autoconf... /usr/bin/autoconf checking for autoheader... /usr/bin/autoheader checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking dependency style of gcc... (cached) gcc3 checking how to run the C preprocessor... gcc -E checking for a BSD-compatible install... /usr/bin/install -c checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking for bison... bison -y checking for flex... flex checking for yywrap in -lfl... yes checking lex output file root... lex.yy checking whether yytext is a pointer... yes checking for ar... /usr/bin/ar checking for ANSI C header files... (cached) yes checking sys/param.h usability... yes checking sys/param.h presence... yes checking for sys/param.h... yes checking whether byte ordering is bigendian... no checking for off_t... yes checking for size_t... yes checking whether struct tm is in sys/time.h or time.h... time.h checking for intmax_t... yes checking for library containing getopt... none required checking for strtoimax... yes checking for strtoll... yes checking for mergesort... no checking for mkstemps... yes configure: creating ./config.status config.status: creating skeletons/standard-modules/Makefile config.status: creating skeletons/tests/Makefile config.status: creating libasn1compiler/Makefile config.status: creating libasn1parser/Makefile config.status: creating libasn1print/Makefile config.status: creating asn1c/webcgi/Makefile config.status: creating asn1c/tests/Makefile config.status: creating libasn1fix/Makefile config.status: creating skeletons/Makefile config.status: creating examples/Makefile config.status: creating tests/Makefile config.status: creating asn1c/Makefile config.status: creating doc/Makefile config.status: creating asn1c.spec config.status: creating Makefile config.status: creating config.h config.status: executing depfiles commands + make -j 8 make all-recursive make[1]: Entering directory ' Making all in libasn1parser make[2]: Entering directory ' if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF ".deps/asn1parser.Tpo" -c -o asn1parser.lo asn1parser.c; \ then mv -f ".deps/asn1parser.Tpo" ".deps/asn1parser.Plo"; else rm -f ".deps/asn1parser.Tpo"; exit 1; fi bison -y -p asn1p_ -d asn1p_y.y if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF ".deps/asn1p_l.Tpo" -c -o asn1p_l.lo asn1p_l.c; \ then mv -f ".deps/asn1p_l.Tpo" ".deps/asn1p_l.Plo"; else rm -f ".deps/asn1p_l.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF ".deps/asn1p_module.Tpo" -c -o asn1p_module.lo asn1p_module.c; \ then mv -f ".deps/asn1p_module.Tpo" ".deps/asn1p_module.Plo"; else rm -f ".deps/asn1p_module.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF ".deps/asn1p_oid.Tpo" -c -o asn1p_oid.lo asn1p_oid.c; \ then mv -f ".deps/asn1p_oid.Tpo" ".deps/asn1p_oid.Plo"; else rm -f ".deps/asn1p_oid.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF ".deps/asn1p_value.Tpo" -c -o asn1p_value.lo asn1p_value.c; \ then mv -f ".deps/asn1p_value.Tpo" ".deps/asn1p_value.Plo"; else rm -f ".deps/asn1p_value.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF ".deps/asn1p_expr.Tpo" -c -o asn1p_expr.lo asn1p_expr.c; \ then mv -f ".deps/asn1p_expr.Tpo" ".deps/asn1p_expr.Plo"; else rm -f ".deps/asn1p_expr.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF ".deps/asn1p_xports.Tpo" -c -o asn1p_xports.lo asn1p_xports.c; \ then mv -f ".deps/asn1p_xports.Tpo" ".deps/asn1p_xports.Plo"; else rm -f ".deps/asn1p_xports.Tpo"; exit 1; fi asn1p_y.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] mkdir .libs gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -fPIC -DPIC -o .libs/asn1p_xports.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -fPIC -DPIC -o .libs/asn1p_l.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -fPIC -DPIC -o .libs/asn1p_module.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -fPIC -DPIC -o .libs/asn1p_expr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -fPIC -DPIC -o .libs/asn1p_oid.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -fPIC -DPIC -o .libs/asn1parser.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -fPIC -DPIC -o .libs/asn1p_value.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -o asn1p_xports.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -o asn1p_module.o >/dev/null 2>&1 asn1p_l.c:3521:12: warning: 'input' defined but not used [-Wunused-function] static int input() ^~~~~ gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -o asn1p_oid.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -o asn1parser.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -o asn1p_value.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF ".deps/asn1p_constr.Tpo" -c -o asn1p_constr.lo asn1p_constr.c; \ then mv -f ".deps/asn1p_constr.Tpo" ".deps/asn1p_constr.Plo"; else rm -f ".deps/asn1p_constr.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF ".deps/asn1p_param.Tpo" -c -o asn1p_param.lo asn1p_param.c; \ then mv -f ".deps/asn1p_param.Tpo" ".deps/asn1p_param.Plo"; else rm -f ".deps/asn1p_param.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -o asn1p_expr.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF ".deps/asn1p_class.Tpo" -c -o asn1p_class.lo asn1p_class.c; \ then mv -f ".deps/asn1p_class.Tpo" ".deps/asn1p_class.Plo"; else rm -f ".deps/asn1p_class.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF ".deps/asn1p_ref.Tpo" -c -o asn1p_ref.lo asn1p_ref.c; \ then mv -f ".deps/asn1p_ref.Tpo" ".deps/asn1p_ref.Plo"; else rm -f ".deps/asn1p_ref.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -fPIC -DPIC -o .libs/asn1p_constr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -fPIC -DPIC -o .libs/asn1p_param.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -fPIC -DPIC -o .libs/asn1p_class.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -fPIC -DPIC -o .libs/asn1p_ref.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -o asn1p_param.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -o asn1p_constr.o >/dev/null 2>&1 if test -f y.tab.h; then \ to=`echo "asn1p_y_H" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \ sed -e "/^#/!b" -e "s/Y_TAB_H/$to/g" -e "s|y\.tab\.h|asn1p_y.h|" \ y.tab.h >asn1p_y.ht; \ rm -f y.tab.h; \ if cmp -s asn1p_y.ht asn1p_y.h; then \ rm -f asn1p_y.ht ;\ else \ mv asn1p_y.ht asn1p_y.h; \ fi; \ fi if test -f y.output; then \ mv y.output asn1p_y.output; \ fi sed '/^#/ s|y\.tab\.c|asn1p_y.c|' y.tab.c >asn1p_y.ct && mv asn1p_y.ct asn1p_y.c gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -o asn1p_ref.o >/dev/null 2>&1 rm -f y.tab.c if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF ".deps/asn1p_y.Tpo" -c -o asn1p_y.lo asn1p_y.c; \ then mv -f ".deps/asn1p_y.Tpo" ".deps/asn1p_y.Plo"; else rm -f ".deps/asn1p_y.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -o asn1p_class.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF .deps/asn1p_y.Tpo -c asn1p_y.c -fPIC -DPIC -o .libs/asn1p_y.o asn1p_y.y: In function 'asn1p_parse': asn1p_y.y:357:13: error: 'param' undeclared (first use in this function) *(void **)param = $1; ^~~~~ asn1p_y.y:357:13: note: each undeclared identifier is reported only once for each function it appears in gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -o asn1p_l.o >/dev/null 2>&1 Makefile:299: recipe for target 'asn1p_y.lo' failed make[2]: *** [asn1p_y.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory ' Makefile:302: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory ' Makefile:212: recipe for target 'all' failed make: *** [all] Error 2 Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Fri Jul 6 15:17:52 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 6 Jul 2018 15:17:52 +0000 Subject: Change in libosmocore[master]: gsm0808: Add value_string for encryption algorithms Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9901 Change subject: gsm0808: Add value_string for encryption algorithms ...................................................................... gsm0808: Add value_string for encryption algorithms Change-Id: Iadf6460c438d02c53c2eaa9e42d51844ad28859a --- M include/osmocom/gsm/protocol/gsm_08_08.h M src/gsm/gsm0808.c M src/gsm/libosmogsm.map 3 files changed, 14 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/01/9901/1 diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h index db5f7fa..c007d2b 100644 --- a/include/osmocom/gsm/protocol/gsm_08_08.h +++ b/include/osmocom/gsm/protocol/gsm_08_08.h @@ -459,6 +459,7 @@ GSM0808_ALG_ID_A5_6 = 0x07, GSM0808_ALG_ID_A5_7 = 0x08, }; +extern const struct value_string gsm0808_chosen_enc_alg_names[]; /* GSM 08.08 3.2.2.85 Paging Information */ enum gsm0808_paging_info { diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c index 625de81..e3f4efe 100644 --- a/src/gsm/gsm0808.c +++ b/src/gsm/gsm0808.c @@ -1153,6 +1153,18 @@ { 0, NULL } }; +const struct value_string gsm0808_chosen_enc_alg_names[] = { + { GSM0808_ALG_ID_A5_0, "A5/0" }, + { GSM0808_ALG_ID_A5_1, "A5/1" }, + { GSM0808_ALG_ID_A5_2, "A5/2" }, + { GSM0808_ALG_ID_A5_3, "A5/3" }, + { GSM0808_ALG_ID_A5_4, "A5/4" }, + { GSM0808_ALG_ID_A5_5, "A5/5" }, + { GSM0808_ALG_ID_A5_6, "A5/6" }, + { GSM0808_ALG_ID_A5_7, "A5/7" }, + { 0, NULL } +}; + static const struct value_string gsm0808_cause_names[] = { { GSM0808_CAUSE_RADIO_INTERFACE_MESSAGE_FAILURE, "RADIO INTERFACE MESSAGE FAILURE" }, { GSM0808_CAUSE_RADIO_INTERFACE_FAILURE, "RADIO INTERFACE FAILURE" }, diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 96779d2..e1486b7 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -201,6 +201,7 @@ gsm0808_chan_type_to_speech_codec; gsm0808_speech_codec_from_chan_type; gsm0808_speech_codec_type_names; +gsm0808_chosen_enc_alg_names; gsm0808_channel_type_name; gsm0808_lcls_config_names; gsm0808_lcls_control_names; -- To view, visit https://gerrit.osmocom.org/9901 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iadf6460c438d02c53c2eaa9e42d51844ad28859a Gerrit-Change-Number: 9901 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 6 15:21:01 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Fri, 6 Jul 2018 15:21:01 +0000 Subject: Change in libosmo-sccp[master]: tweak the default point codes used by sccp_demo_user In-Reply-To: References: Message-ID: Stefan Sperling has posted comments on this change. ( https://gerrit.osmocom.org/9652 ) Change subject: tweak the default point codes used by sccp_demo_user ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/9652/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/9652/1//COMMIT_MSG at 17 PS1, Line 17: -1 > As far as I can see, the old code was using -1, not the new code? (leaving that aside, I don't even [?] The old code (before 4dc9088cabedc40cb9072814237ad5926b12bd35) was passing -1 for port numbers, not point codes. I believe in this context -1 means "use any port". The server was using point code 1, and expected the client to use point code 23. The client was using point code 23. One mistake in 4dc9088cabedc40cb9072814237ad5926b12bd35 was that I set the LOCAL_PC to -1 instead of 1 (got mixed up between ports and point codes). I understand that having sccp_demo_user client/server talk to each other out of the box will be useful. I will try to keep it working that way in the next patch set. -- To view, visit https://gerrit.osmocom.org/9652 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7432e6fc2617e0fd77a098fcd7d14abc40db7229 Gerrit-Change-Number: 9652 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-Comment-Date: Fri, 06 Jul 2018 15:21:01 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 6 15:25:11 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 6 Jul 2018 15:25:11 +0000 Subject: Change in osmo-bts[master]: rsl: Use value_string to print encryption algo name Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9902 Change subject: rsl: Use value_string to print encryption algo name ...................................................................... rsl: Use value_string to print encryption algo name Change-Id: I8303364270e73718e57f8efc2f375817b9496ffc --- M src/common/rsl.c 1 file changed, 5 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/02/9902/1 diff --git a/src/common/rsl.c b/src/common/rsl.c index 8bbf73c..9295240 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -865,12 +865,13 @@ { int rc; struct gsm_bts *bts = lchan->ts->trx->bts; + const char *ciph_name = get_value_string(gsm0808_chosen_enc_alg_names, *val); /* check if the encryption algorithm sent by BSC is supported! */ rc = bts_supports_cipher(bts, *val); if (rc != 1) { - LOGP(DRSL, LOGL_ERROR, "%s: BTS doesn't support cipher 0x%02x\n", - gsm_lchan_name(lchan), *val); + LOGP(DRSL, LOGL_ERROR, "%s: BTS doesn't support cipher %s\n", + gsm_lchan_name(lchan), ciph_name); return -EINVAL; } @@ -886,8 +887,8 @@ if (lchan->encr.key_len > sizeof(lchan->encr.key)) lchan->encr.key_len = sizeof(lchan->encr.key); memcpy(lchan->encr.key, val, lchan->encr.key_len); - DEBUGP(DRSL, "%s: Setting lchan cipher algorithm 0x%02x\n", - gsm_lchan_name(lchan), lchan->encr.alg_id); + DEBUGP(DRSL, "%s: Setting lchan cipher algorithm %s\n", + gsm_lchan_name(lchan), ciph_name); return 0; } -- To view, visit https://gerrit.osmocom.org/9902 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I8303364270e73718e57f8efc2f375817b9496ffc Gerrit-Change-Number: 9902 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 6 15:25:33 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 6 Jul 2018 15:25:33 +0000 Subject: Change in osmo-bts[master]: rsl: Use value_string to print encryption algo name In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9902 ) Change subject: rsl: Use value_string to print encryption algo name ...................................................................... Patch Set 1: Depends on https://gerrit.osmocom.org/#/c/libosmocore/+/9901/ to build correctly. -- To view, visit https://gerrit.osmocom.org/9902 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8303364270e73718e57f8efc2f375817b9496ffc Gerrit-Change-Number: 9902 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Jenkins Builder Gerrit-Comment-Date: Fri, 06 Jul 2018 15:25:33 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 6 15:42:25 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Fri, 6 Jul 2018 15:42:25 +0000 Subject: Change in libosmo-sccp[master]: tweak the default point codes used by sccp_demo_user In-Reply-To: References: Message-ID: Stefan Sperling has posted comments on this change. ( https://gerrit.osmocom.org/9652 ) Change subject: tweak the default point codes used by sccp_demo_user ...................................................................... Patch Set 1: > (1 comment) Correction: -1 indicates the default protocol port for any of the protocols SUA, M3UA, and IPA, respectively. The -1 is passed the port number to use is obtained from osmo_ss7_asp_protocol_port(). -- To view, visit https://gerrit.osmocom.org/9652 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7432e6fc2617e0fd77a098fcd7d14abc40db7229 Gerrit-Change-Number: 9652 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-Comment-Date: Fri, 06 Jul 2018 15:42:25 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 6 16:06:27 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Fri, 6 Jul 2018 16:06:27 +0000 Subject: Change in osmo-ttcn3-hacks[master]: RSL_Emulation: Stop with error verdict if conn table runs out of space Message-ID: daniel has uploaded this change for review. ( https://gerrit.osmocom.org/9903 Change subject: RSL_Emulation: Stop with error verdict if conn table runs out of space ...................................................................... RSL_Emulation: Stop with error verdict if conn table runs out of space Change-Id: If1a002da97cf1b66855f2e7a0fe2a54a6428bc81 --- M library/RSL_Emulation.ttcn 1 file changed, 4 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/03/9903/1 diff --git a/library/RSL_Emulation.ttcn b/library/RSL_Emulation.ttcn index 119a9be..325f22e 100644 --- a/library/RSL_Emulation.ttcn +++ b/library/RSL_Emulation.ttcn @@ -195,7 +195,7 @@ return; } } - setverdict(fail, "No free entry in conn table for ", ra, fn); + testcase.stop("No free entry in conn table for ", ra, fn); } /* create an ew client with given RA and FN */ @@ -212,7 +212,7 @@ return; } } - setverdict(fail, "No free entry in conn table for ", trx_nr, chan_nr, comp_ref); + testcase.stop("No free entry in conn table for ", trx_nr, chan_nr, comp_ref); } @@ -263,8 +263,7 @@ return; } } - setverdict(fail, "No space left in LastActTable to store chan_act for ", chan_nr); - self.stop; + testcase.stop("No space left in LastActTable to store chan_act for ", chan_nr); } private function f_lookup_last_act(uint8_t trx_nr, RslChannelNr chan_nr) @@ -275,8 +274,7 @@ return LastActTable[i].chan_act; } } - setverdict(fail, "No LastActTable entry found for TRX ", trx_nr, " ", chan_nr); - self.stop; + testcase.stop("No LastActTable entry found for TRX ", trx_nr, " ", chan_nr); } private function f_last_act_table_init() runs on RSL_Emulation_CT { -- To view, visit https://gerrit.osmocom.org/9903 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: If1a002da97cf1b66855f2e7a0fe2a54a6428bc81 Gerrit-Change-Number: 9903 Gerrit-PatchSet: 1 Gerrit-Owner: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 6 16:06:27 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Fri, 6 Jul 2018 16:06:27 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS_Tests: Ensure mtc.stop is called after setverdict(fail, ...) Message-ID: daniel has uploaded this change for review. ( https://gerrit.osmocom.org/9904 Change subject: BTS_Tests: Ensure mtc.stop is called after setverdict(fail, ...) ...................................................................... BTS_Tests: Ensure mtc.stop is called after setverdict(fail, ...) This will prevent subsequent failures from overwriting the verdict so we can easily see the root cause of the test failure. Change-Id: Iba59a69127e845cadbe9aaa1dabd87ff5ce8b43b --- M bts/BTS_Tests.ttcn 1 file changed, 74 insertions(+), 40 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/04/9904/1 diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index aee081e..4f0f0ef 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -257,7 +257,7 @@ } [] pt.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_INFO_IND(?, ?, ?))) -> value sd { setverdict(fail, "Invalid PCU Version/BTS Number received"); - self.stop; + mtc.stop; } } @@ -276,7 +276,7 @@ [] as_pcu_info_ind(pt, pcu_conn_id, pcu_last_info); [] T.timeout { setverdict(fail, "Timeout waiting for PCU INFO_IND"); - self.stop; + mtc.stop; } } } @@ -316,7 +316,7 @@ [] RSL_CCHAN.receive(ASP_IPA_Event:{up_down := ASP_IPA_EVENT_UP}); [] T.timeout { setverdict(fail, "Timeout waiting for ASP_IPA_EVENT_UP"); - self.stop; + mtc.stop; } } f_sleep(0.5); /* workaround for OS#3000 */ @@ -389,7 +389,7 @@ private altstep as_Tguard() runs on ConnHdlr { [] g_Tguard.timeout { setverdict(fail, "Tguard timeout"); - self.stop; + mtc.stop; } } @@ -404,7 +404,7 @@ "", -1, -1, {udp:={}}, {}); if (not ispresent(res.connId)) { setverdict(fail, "Could not connect to trx-control interface of trxcon, check your configuration"); - self.stop; + mtc.stop; } g_bb_trxc_conn_id := res.connId; } @@ -455,14 +455,14 @@ } [] T.timeout { setverdict(fail, "Timeout expecting " & id); - self.stop; + mtc.stop; } [not ignore_other] as_l1_sacch(); [not ignore_other] as_meas_res(); [not ignore_other] as_l1_dcch(); [not ignore_other] RSL.receive { setverdict(fail, "Unexpected RSL message received"); - self.stop; + mtc.stop; } [ignore_other] RSL.receive { repeat; } } @@ -550,6 +550,7 @@ alt { [] RSL.receive(tr_RSL_CHAN_ACT_ACK(g_chan_nr)) { setverdict(fail, "Unexpected CHAN ACT ACK on double activation"); + mtc.stop; } [] RSL.receive(tr_RSL_CHAN_ACT_NACK(g_chan_nr)) { setverdict(pass); @@ -577,6 +578,7 @@ } [] T.timeout { setverdict(fail, "Timeout expecting RF_CHAN_REL_ACK"); + mtc.stop; } } } @@ -594,6 +596,7 @@ alt { [] RSL.receive(tr_RSL_CHAN_ACT_ACK(g_chan_nr)) { setverdict(fail, "Unexpected CHAN ACT ACK"); + mtc.stop; } [] RSL.receive(tr_RSL_CHAN_ACT_NACK(g_chan_nr)) { setverdict(pass); @@ -667,6 +670,7 @@ alt { [not exp] L1CTL.receive(tr_L1CTL_DATA_IND(g_chan_nr, tr_RslLinkID_SACCH(0))) { setverdict(fail, "Received SACCH when not expecting it"); + mtc.stop; } [not exp] T_sacch.timeout { setverdict(pass); @@ -676,6 +680,7 @@ } [exp] T_sacch.timeout { setverdict(fail, "Timeout waiting for SACCH on ", g_chan_nr); + mtc.stop; } [] L1CTL.receive { repeat; } [] RSL.receive { repeat; } @@ -740,7 +745,7 @@ [] L1CTL.receive { repeat; } [] T_sacch.timeout { setverdict(fail, "Timeout waiting for SACCH ", l3_exp); - self.stop; + mtc.stop; } } } @@ -986,7 +991,7 @@ var GsmFrameNumber fn := f_L1CTL_RACH(L1CTL, oct2int(ra)); if (fn == fn_last) { setverdict(fail, "Two RACH in same FN?!?"); - self.stop; + mtc.stop; } fn_last := fn; @@ -998,12 +1003,12 @@ } [] RSL_CCHAN.receive(tr_RSL_UD(tr_RSL_CHAN_RQD(?, ?, ?))) { setverdict(fail, "Unexpected CHAN RQD"); - self.stop; + mtc.stop; } [] RSL_CCHAN.receive { repeat; } [] T.timeout { setverdict(fail, "Timeout waiting for CHAN RQD"); - self.stop; + mtc.stop; } } } @@ -1024,7 +1029,7 @@ var GsmFrameNumber fn := f_L1CTL_RACH(L1CTL, oct2int(ra)); if (fn == fn_last) { setverdict(fail, "Two RACH in same FN?!?"); - self.stop; + mtc.stop; } fn_last := fn; } @@ -1055,7 +1060,7 @@ "", -1, -1, {udp:={}}, {}); if (not ispresent(res.connId)) { setverdict(fail, "Could not connect to trx-control interface of trxcon, check your configuration"); - self.stop; + mtc.stop; } g_bb_trxc_conn_id := res.connId; } @@ -1079,6 +1084,7 @@ } [not expect_pass] RSL_CCHAN.receive(tr_RSL_UD(tr_RSL_CHAN_RQD(ra, fn))) { setverdict(fail, "RACH passed but was expected to be dropped: ", toffs256); + mtc.stop; } [] RSL_CCHAN.receive { repeat; } [not expect_pass] T.timeout { @@ -1086,6 +1092,7 @@ } [expect_pass] T.timeout { setverdict(fail, "Timeout waiting for CHAN RQD"); + mtc.stop; } } } @@ -1287,16 +1294,16 @@ repeat; } else { setverdict(fail, "Received unspecific MEAS RES ", rsl); - self.stop; + mtc.stop; } } [] RSL.receive(tr_RSL_MEAS_RES(?)) -> value rsl { setverdict(fail, "Received unexpected MEAS RES ", rsl); - self.stop; + mtc.stop; } [g_Tmeas_exp.running] g_Tmeas_exp.timeout { setverdict(fail, "Didn't receive expected measurement result") - self.stop; + mtc.stop; } } @@ -1312,7 +1319,7 @@ case (RSL_ALG_ID_A5_7) { return 7; } case else { setverdict(fail, "Unknwon Algorithm ID"); - self.stop; + mtc.stop; } } } @@ -1328,7 +1335,7 @@ case (RSL_ALG_ID_A5_7) { return '110'B; } case else { setverdict(fail, "Unknwon Algorithm ID"); - self.stop; + mtc.stop; } } } @@ -1405,12 +1412,13 @@ [] as_l1_dcch(); [] L1CTL.receive { repeat; } [g_Tmeas_exp.running] T.timeout { - /* as_meas_res() would have done setverdict(fail) / self.stop in case + /* as_meas_res() would have done setverdict(fail) / mtc.stop in case * of any earlier errors, so if we reach this timeout, we're good */ setverdict(pass); } [] T.timeout { setverdict(fail, "No MEAS RES received at all"); + mtc.stop; } } f_rsl_chan_deact(); @@ -1494,6 +1502,7 @@ [] RSL.receive { repeat }; [] T.timeout { setverdict(fail, "No CONN FAIL IND received"); + mtc.stop; } } f_rsl_chan_deact(); @@ -1639,6 +1648,7 @@ } [not cfg.exp_overload] RSL_CCHAN.receive(tr_RSL_UD(tr_RSL_PAGING_LOAD_IND(0))) { setverdict(fail, "Unexpected PCH Overload"); + mtc.stop; } [cfg.exp_load_ind] RSL_CCHAN.receive(tr_RSL_UD(tr_RSL_PAGING_LOAD_IND)) { log("Rx LOAD_IND"); @@ -1664,6 +1674,7 @@ [] RSL_CCHAN.receive(tr_RSL_UD(tr_RSL_PAGING_LOAD_IND)) { repeat; } [] T_wait.timeout { setverdict(fail, "Waiting for empty paging queue"); + mtc.stop; } [] as_rsl_res_ind(); } @@ -1830,7 +1841,7 @@ if (not match(rr, tr_IMM_ASS(42, ?, 5, ?, ?))) { /* FIXME: Why are we seeing paging requests on PCH/AGCH? */ //setverdict(fail, "Unexpected IMM-ASS values on AGCH: ", rr); - //self.stop; + //mtc.stop; } else { num_rx := num_rx+1; } @@ -1843,6 +1854,7 @@ log("AGCH test: " & res_str); if (num_rx + num_del != num_tx) { setverdict(fail, "RX + DEL != TX ?!?: " & res_str); + mtc.stop } rx_ratio := int2float(num_rx) / int2float(num_tx); if (rx_ratio < exp_pass*0.8 or rx_ratio > exp_pass*1.2) { @@ -1850,6 +1862,7 @@ } else { setverdict(pass); } + f_shutdown(); } /* send a long burst of 1000 IMM.ASS with 20ms spacing (50 per s); expect 75% of them to be deleted */ @@ -1903,6 +1916,7 @@ function f_ensure_si_vec_contains(SystemInformationVectorPerTc arr, integer tc, RrMessageType key, boolean ext_bcch := false) { if (not f_si_vecslot_contains(arr[tc], key, ext_bcch)) { setverdict(fail, "No ", key, " in TC=", tc, "!"); + mtc.stop; } } @@ -1922,7 +1936,7 @@ var integer count := 0; if (sizeof(arr) < m) { setverdict(fail, "Error: Insufficient SI in array"); - self.stop; + mtc.stop; } for (var integer i:= 0; i < m; i := i + 1) { var integer fn_mod51 := arr[i].frame_number mod 51; @@ -1944,6 +1958,7 @@ function f_ensure_si_vec_contains_n_of_m(SystemInformationVectorPerTc arr, integer tc, RrMessageType key, boolean ext_bcch := false, integer n, integer m) { if (not f_si_vecslot_contains_n_of_m(arr[tc], key, ext_bcch, n, m)) { setverdict(fail, "Not ", n, "/", m, " of ", key, " in TC=", tc, "!"); + mtc.stop; } } @@ -1965,6 +1980,7 @@ function f_ensure_si_vec_contains_only(SystemInformationVectorPerTc arr, integer tc, RrMessageType key, boolean ext_bcch := false) { if (not f_si_vecslot_contains_only(arr[tc], key, ext_bcch)) { setverdict(fail, "Not all ", key, " in TC=", tc, "!"); + mtc.stop; } } @@ -1994,6 +2010,7 @@ for (i := 0; i < sizeof(si_per_tc); i := i + 1) { if (sizeof(si_per_tc[i]) == 0) { setverdict(fail, "No SI messages for TC=", i); + mtc.stop; } } if (cfg.si1_present) { @@ -2076,6 +2093,7 @@ } if (f_si_vec_contains(si_per_tc, SYSTEM_INFORMATION_TYPE_13alt)) { setverdict(fail, "Cannot have SI13alt and SI13"); + mtc.stop; } } if (cfg.si16_present or cfg.si17_present) { @@ -2086,6 +2104,7 @@ } if (f_si_vec_contains(si_per_tc, SYSTEM_INFORMATION_TYPE_22)) { setverdict(fail, "Cannot have SI16/SI17 and SI22!"); + mtc.stop; } if (not cfg.bcch_extended) { testcase.stop("Error: SI16/SI17 requires BCCH Extd!"); @@ -2131,6 +2150,7 @@ } if (f_si_vec_contains(si_per_tc, SYSTEM_INFORMATION_TYPE_13)) { setverdict(fail, "Cannot have SI13alt and SI13"); + mtc.stop; } if (not cfg.bcch_extended) { f_ensure_si_vec_contains_n_of_m(si_per_tc, 4, SYSTEM_INFORMATION_TYPE_13alt, false, 1, 4); @@ -2162,6 +2182,7 @@ f_ensure_si_vec_contains_n_of_m(si_per_tc, 4, SYSTEM_INFORMATION_TYPE_21, true, 1, 4); if (f_si_vecslot_contains(si_per_tc[4], SYSTEM_INFORMATION_TYPE_21)) { setverdict(fail, "Cannot have SI21 on BCCH Norm if BCCH Extd enabled!"); + mtc.stop; } } } @@ -2176,6 +2197,7 @@ if (f_si_vec_contains(si_per_tc, SYSTEM_INFORMATION_TYPE_16) or f_si_vec_contains(si_per_tc, SYSTEM_INFORMATION_TYPE_17)) { setverdict(fail, "Cannot have SI16/SI17 and SI22!"); + mtc.stop; } if (not cfg.bcch_extended) { testcase.stop("Error: SI22 requires BCCH Extd!"); @@ -2337,12 +2359,14 @@ } [] RSL_CCHAN.receive(tr_RSL_UD(tr_RSL_ERROR_REPORT(?))) { setverdict(fail, "Wrong cause in RSL ERR REP"); + mtc.stop; } [] RSL_CCHAN.receive { repeat; } [] T.timeout { setverdict(fail, "Timeout waiting for RSL ERR REP"); + mtc.stop; } } } @@ -2489,7 +2513,7 @@ alt { [] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_RTS_REQ(bts_nr))) { setverdict(fail, "PCU RTS.req before PDCH active?"); - self.stop; + mtc.stop; } [] PCU.receive { repeat; } [] T.timeout { } @@ -2507,15 +2531,16 @@ [not exp_success] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_RTS_REQ(bts_nr, trx_nr, ts_nr))) { setverdict(fail, "Unexpected RTS.req for supposedly failing activation"); - self.stop; + mtc.stop; } [] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_RTS_REQ)) { setverdict(fail, "RTS.req for wrong TRX/TS"); - self.stop; + mtc.stop; } [] PCU.receive { repeat; } [exp_success] T.timeout { setverdict(fail, "Timeout waiting for PCU RTS.req"); + mtc.stop; } [not exp_success] T.timeout { setverdict(pass); @@ -2536,7 +2561,7 @@ alt { [] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_RTS_REQ(bts_nr, trx_nr, ts_nr))) { setverdict(fail, "Received unexpected PCU RTS.req"); - self.stop; + mtc.stop; } [] PCU.receive { repeat; } [] T.timeout { @@ -2607,7 +2632,7 @@ [] PCU.receive { repeat; } [] T.timeout { setverdict(fail, "Timeout waiting for SI13"); - self.stop; + mtc.stop; } } } @@ -2641,6 +2666,7 @@ [] PCU.receive { repeat; } [] T.timeout { setverdict(fail, "Timeout waiting for RTS.ind"); + mtc.stop; } } } @@ -2714,6 +2740,7 @@ [] L1CTL.receive { repeat; } [] T.timeout { setverdict(fail, "Timeout waiting for PCU-originated AGCH block on Um"); + mtc.stop; } } } @@ -2738,6 +2765,7 @@ [] L1CTL.receive { repeat; } [] T.timeout { setverdict(fail, "Timeout waiting for PCU-originated AGCH block on Um"); + mtc.stop; } } } @@ -2754,7 +2782,7 @@ var GsmFrameNumber fn := f_L1CTL_RACH(L1CTL, oct2int(ra)); if (fn == fn_last) { setverdict(fail, "Two RACH in same FN?!?"); - self.stop; + mtc.stop; } fn_last := fn; @@ -2766,12 +2794,12 @@ } [] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_RACH_IND)) { setverdict(fail, "Unexpected RACH IND"); - self.stop; + mtc.stop; } [] PCU.receive { repeat; } [] T.timeout { setverdict(fail, "Timeout waiting for RACH IND"); - self.stop; + mtc.stop; } } } @@ -2810,12 +2838,12 @@ } [] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_PAG_REQ)) { setverdict(fail, "Unexpected PAGING REQ"); - self.stop; + mtc.stop; } [] PCU.receive { repeat; } [] T.timeout { setverdict(fail, "Timeout waiting for PAGING REQ"); - self.stop; + mtc.stop; } } } @@ -2837,7 +2865,7 @@ [] PCU.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_INFO_IND(bts_nr, ?))) -> value sd { if (substr(sd.data.u.info_ind.trx[trx_nr].pdch_mask, g_chan_nr.tn, 1) != '1'B) { setverdict(fail, "PCUIF_INFO_IND PDCH_MASK not '1' after PDCH ACT"); - self.stop; + mtc.stop; } } [] PCU.receive { repeat; } @@ -2858,7 +2886,7 @@ [] PCU.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_INFO_IND(bts_nr, ?))) -> value sd { if (substr(sd.data.u.info_ind.trx[trx_nr].pdch_mask, g_chan_nr.tn, 1) != '0'B) { setverdict(fail, "PCUIF_INFO_IND PDCH_MASK not '0' after PDCH DEACT"); - self.stop; + mtc.stop; } } [] PCU.receive { repeat; } @@ -3021,7 +3049,7 @@ [] PCU.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_INFO_IND(bts_nr, ?))) -> value sd { if (substr(sd.data.u.info_ind.trx[trx_nr].pdch_mask, g_chan_nr.tn, 1) != '1'B) { setverdict(fail, "PCUIF_INFO_IND PDCH_MASK not '1' after PDCH ACT"); - self.stop; + mtc.stop; } } [] PCU.receive { repeat; } @@ -3044,7 +3072,7 @@ [] PCU.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_INFO_IND(bts_nr, ?))) -> value sd { if (substr(sd.data.u.info_ind.trx[trx_nr].pdch_mask, g_chan_nr.tn, 1) != '0'B) { setverdict(fail, "PCUIF_INFO_IND PDCH_MASK not '0' after PDCH DEACT"); - self.stop; + mtc.stop; } } [] PCU.receive { repeat; } @@ -3130,7 +3158,7 @@ [] RSL.receive(tr_RSL_IPA_PDCH_ACT_NACK(g_chan_nr, ?)); [] RSL.receive(tr_RSL_IPA_PDCH_ACT_ACK(g_chan_nr, ?)) { setverdict(fail, "Unexpected PDCH ACT ACK"); - self.stop; + mtc.stop; } [] RSL.receive { repeat; } } @@ -3254,6 +3282,7 @@ setverdict(pass); } else { setverdict(fail, "Unexpected EST IND with L3 in ", tc); + mtc.stop; } } [tc.l3 == ''O] RSL.receive(tr_RSL_EST_IND_NOL3(g_chan_nr, tc.link_id)) { @@ -3261,10 +3290,12 @@ setverdict(pass); } else { setverdict(fail, "Unexpected EST IND without L3 in ", tc); + mtc.stop; } } [tc.exp] T.timeout { setverdict(fail, "Timeout waiting for EST IND"); + mtc.stop; } [not tc.exp] T.timeout { setverdict(pass); @@ -3326,7 +3357,7 @@ [] L1CTL.receive { repeat; } [] T.timeout { setverdict(fail, "Timeout waiting for SABM"); - self.stop; + mtc.stop; } } @@ -3381,7 +3412,7 @@ alt { [] T.timeout { setverdict(fail, "Timeout waiting for LAPDm ", exp); - self.stop; + mtc.stop; } [] as_l1_exp_lapdm(exp); } @@ -3397,7 +3428,7 @@ [l3 == ''O] RSL.receive(tr_RSL_EST_IND_NOL3(g_chan_nr, link_id)); [] RSL.receive(tr_RSL_ERROR_IND(g_chan_nr, link_id, ?)) { setverdict(fail, "Failing due to RSL_ERROR_IND"); - self.stop; + mtc.stop; } [] RSL.receive { repeat; } } @@ -3613,6 +3644,7 @@ } [] T.timeout { setverdict(fail, "Timeout waiting for UNIT_DATA_IND"); + mtc.stop; } [] RSL.receive { repeat; } } @@ -3723,12 +3755,13 @@ lf.ab := dec_LapdmFrameAB(enc); } else { setverdict(fail, "unsupported frame type"); - self.stop; + mtc.stop; } /* check if decoder result matches expectation */ if (not match(lf, exp_match)) { setverdict(fail, name, ": decoded LAPDm doesn't match"); + mtc.stop; } else { log(name, ": matched"); setverdict(pass); @@ -3738,6 +3771,7 @@ reenc := enc_LapdmFrame(lf); if (enc != reenc) { setverdict(fail, name, ": re-encoded LAPDm frame doesn't match"); + mtc.stop; } else { setverdict(pass); } -- To view, visit https://gerrit.osmocom.org/9904 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iba59a69127e845cadbe9aaa1dabd87ff5ce8b43b Gerrit-Change-Number: 9904 Gerrit-PatchSet: 1 Gerrit-Owner: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 6 16:06:28 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Fri, 6 Jul 2018 16:06:28 +0000 Subject: Change in osmo-ttcn3-hacks[master]: library: Ensure setverdict(fail is followed by mtc.stop Message-ID: daniel has uploaded this change for review. ( https://gerrit.osmocom.org/9905 Change subject: library: Ensure setverdict(fail is followed by mtc.stop ...................................................................... library: Ensure setverdict(fail is followed by mtc.stop This will prevent subsequent failures from overwriting the verdict so we can easily see the root cause of the test failure. Change-Id: Idc6819aaf0b01e70c38fad828dd44dcec6bdd778 --- M library/BSSAP_Adapter.ttcn M library/BSSGP_Emulation.ttcn M library/BSSMAP_Emulation.ttcn M library/GSM_Types.ttcn M library/GSUP_Emulation.ttcn M library/GTP_Emulation.ttcn M library/GTP_Templates.ttcn M library/IPA_Emulation.ttcnpp M library/IuUP_Emulation.ttcn M library/L1CTL_PortType.ttcn M library/L3_Common.ttcn M library/LAPDm_RAW_PT.ttcn M library/MGCP_Emulation.ttcn M library/MGCP_Templates.ttcn M library/MNCC_Emulation.ttcn M library/MNCC_Types.ttcn M library/NS_Emulation.ttcn M library/Osmocom_CTRL_Adapter.ttcn M library/Osmocom_CTRL_Functions.ttcn M library/Osmocom_Types.ttcn M library/Osmocom_VTY_Functions.ttcn M library/PCUIF_CodecPort.ttcn M library/RSL_Emulation.ttcn M library/RTP_Emulation.ttcn M library/SIP_Emulation.ttcn M library/SMPP_Emulation.ttcn M library/TRXC_CodecPort.ttcn 27 files changed, 149 insertions(+), 147 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/05/9905/1 diff --git a/library/BSSAP_Adapter.ttcn b/library/BSSAP_Adapter.ttcn index e50487d..b29d03f 100644 --- a/library/BSSAP_Adapter.ttcn +++ b/library/BSSAP_Adapter.ttcn @@ -144,7 +144,7 @@ } case else { setverdict(fail, "Unsuppored BSSAP_Transport"); - self.stop; + mtc.stop; } } diff --git a/library/BSSGP_Emulation.ttcn b/library/BSSGP_Emulation.ttcn index f51d539..8b3b9eb 100644 --- a/library/BSSGP_Emulation.ttcn +++ b/library/BSSGP_Emulation.ttcn @@ -288,8 +288,7 @@ return; } } - setverdict(fail, "Client Table full"); - self.stop; + testcase.stop("Client Table full"); } private function f_tbl_client_del(hexstring imsi, BSSGP_Client_CT vc_conn) runs on BSSGP_CT { @@ -299,7 +298,7 @@ if (ClientTable[i].comp_ref != vc_conn) { setverdict(fail, "Cannot unregister index=", i, " IMSI ", imsi, " registred to ", ClientTable[i].comp_ref, " from ", vc_conn); - self.stop; + mtc.stop; } log("Removing Client IMSI=", imsi, ", index=", i); ClientTable[i] := { @@ -313,7 +312,7 @@ } } setverdict(fail, "Could not find client for IMSI ", imsi); - self.stop; + mtc.stop; } /* TS 44.064 7.2.1.1 LLGMM-ASSIGN */ @@ -344,7 +343,7 @@ } } setverdict(fail, "Couldn't find Component for IMSI ", imsi); - self.stop; + mtc.stop; } private function f_tbl_comp_by_tlli(OCT4 tlli) runs on BSSGP_CT return BSSGP_Client_CT { @@ -357,7 +356,7 @@ } } setverdict(fail, "Couldn't find Component for TLLI ", tlli); - self.stop; + mtc.stop; } private function f_tbl_idx_by_comp(BSSGP_Client_CT comp_ref) runs on BSSGP_CT return integer { @@ -368,7 +367,7 @@ } } setverdict(fail, "Couldn't find Client for Component ", comp_ref); - self.stop; + mtc.stop; } private function f_tbl_tlli_by_comp(BSSGP_Client_CT comp_ref) runs on BSSGP_CT return OCT4 { @@ -380,7 +379,7 @@ } } setverdict(fail, "Couldn't find TLLI for Component ", comp_ref); - self.stop; + mtc.stop; } altstep as_allstate() runs on BSSGP_CT { @@ -590,7 +589,7 @@ return c_LLC_SAPI_LLSMS; } setverdict(fail, "No LLC SAPI for ", l3_mo); - self.stop; + mtc.stop; } private function f_llc_sapi_by_l3_mt(PDU_L3_SGSN_MS l3_mt) return BIT4 { @@ -602,7 +601,7 @@ return c_LLC_SAPI_LLSMS; } setverdict(fail, "No LLC SAPI for ", l3_mt); - self.stop; + mtc.stop; } diff --git a/library/BSSMAP_Emulation.ttcn b/library/BSSMAP_Emulation.ttcn index e65c550..921ac59 100644 --- a/library/BSSMAP_Emulation.ttcn +++ b/library/BSSMAP_Emulation.ttcn @@ -202,9 +202,8 @@ return ConnectionTable[i].comp_ref; } } - log("BSSMAP Connection table not found by SCCP Connection ID ", sccp_conn_id); - setverdict(fail); - self.stop; + setverdict(fail, "BSSMAP Connection table not found by SCCP Connection ID ", sccp_conn_id); + mtc.stop; } /* resolve component reference by CIC */ @@ -216,9 +215,8 @@ return ConnectionTable[i].comp_ref; } } - log("BSSMAP Connection table not found by MGCP Transaction ID ", tid); - setverdict(fail); - self.stop; + setverdict(fail, "BSSMAP Connection table not found by MGCP Transaction ID ", tid); + mtc.stop; } private function f_comp_store_mgcp_tid(BSSAP_ConnHdlr client, MgcpTransId tid) @@ -230,9 +228,8 @@ return; } } - log("BSSMAP Connection table not found by component ", client); - setverdict(fail); - self.stop; + setverdict(fail, "BSSMAP Connection table not found by component ", client); + mtc.stop; } private function f_comp_by_cic(integer cic) @@ -243,9 +240,8 @@ return ConnectionTable[i].comp_ref; } } - log("BSSMAP Connection table not found by CIC ", cic); - setverdict(fail); - self.stop; + setverdict(fail, "BSSMAP Connection table not found by CIC ", cic); + mtc.stop; } private function f_comp_store_cic(BSSAP_ConnHdlr client, integer cic) @@ -257,8 +253,8 @@ return; } } - log("BSSMAP Connection table not found by component ", client); - setverdict(fail); + setverdict(fail, "BSSMAP Connection table not found by component ", client); + mtc.stop; } /* resolve connection ID by component reference */ @@ -269,9 +265,8 @@ return ConnectionTable[i].sccp_conn_id; } } - log("BSSMAP Connection table not found by component ", client); - setverdict(fail); - self.stop; + setverdict(fail, "BSSMAP Connection table not found by component ", client); + mtc.stop; } /* resolve ConnectionTable index component reference */ @@ -282,9 +277,8 @@ return i; } } - log("BSSMAP Connection table not found by component ", client); - setverdict(fail); - self.stop; + setverdict(fail, "BSSMAP Connection table not found by component ", client); + mtc.stop; } private function f_gen_conn_id() @@ -325,9 +319,7 @@ return; } } - log("BSSMAP Connection table full!"); - setverdict(fail); - self.stop; + testcase.stop("BSSMAP Connection table full!"); } private function f_conn_table_del(integer sccp_conn_id) @@ -341,9 +333,8 @@ return } } - log("BSSMAP Connection table attempt to delete non-existant ", sccp_conn_id); - setverdict(fail); - self.stop; + setverdict(fail, "BSSMAP Connection table attempt to delete non-existant ", sccp_conn_id); + mtc.stop; } private function f_imsi_table_find(hexstring imsi, template OCT4 tmsi) @@ -501,7 +492,8 @@ repeat; } [] T.timeout { - setverdict(fail); + setverdict(fail, "Timeout waiting for BSSAP RESET"); + mtc.stop; } } } @@ -517,7 +509,10 @@ } [] as_reset_ack(); [] BSSAP.receive { repeat }; - [] T.timeout { setverdict(fail, "Waiting for RESET-ACK after sending RESET"); } + [] T.timeout { + setverdict(fail, "Timeout waiting for RESET-ACK after sending RESET"); + mtc.stop; + } } } @@ -763,6 +758,7 @@ if (not ischosen(conn_ind.userData.pdu.bssmap.completeLayer3Information)) { setverdict(fail, "N-CONNECT.ind with L3 != COMPLETE L3"); + mtc.stop; return ret; } l3_info := conn_ind.userData.pdu.bssmap.completeLayer3Information.layer3Information.layer3info; @@ -782,6 +778,7 @@ } } setverdict(fail, "Couldn't find Expect for incoming connection ", conn_ind); + mtc.stop; return ret; } @@ -796,7 +793,7 @@ return; } } - setverdict(fail, "No space left in ExpectTable"); + testcase.stop("No space left in ExpectTable"); } private function f_create_imsi(hexstring imsi, OCT4 tmsi, BSSAP_ConnHdlr hdlr) @@ -810,8 +807,7 @@ return; } } - setverdict(fail, "No space left in ImsiTable"); - self.stop; + testcase.stop("No space left in ImsiTable"); } diff --git a/library/GSM_Types.ttcn b/library/GSM_Types.ttcn index 2000b4a..59ccb76 100644 --- a/library/GSM_Types.ttcn +++ b/library/GSM_Types.ttcn @@ -34,6 +34,7 @@ case (CS3) { return 52 } case else { setverdict(fail, "Invalid GPRS CS ", cs); + mtc.stop; return -1; } } diff --git a/library/GSUP_Emulation.ttcn b/library/GSUP_Emulation.ttcn index 7cf1656..86859ba 100644 --- a/library/GSUP_Emulation.ttcn +++ b/library/GSUP_Emulation.ttcn @@ -98,9 +98,8 @@ return GsupImsiTable[i].comp_ref; } } - log("GSUP IMSI table not found by IMSI ", imsi); - setverdict(fail); - self.stop; + setverdict(fail, "GSUP IMSI table not found by IMSI ", imsi); + mtc.stop; } /* resolve connection ID by component reference */ @@ -111,9 +110,8 @@ return GsupImsiTable[i].imsi; } } - log("GSUP IMSI table not found by component ", client); - setverdict(fail); - self.stop; + setverdict(fail, "GSUP IMSI table not found by component ", client); + mtc.stop; } private function f_imsi_table_init() @@ -142,9 +140,7 @@ return; } } - log("GSUP IMSI table full!"); - setverdict(fail); - self.stop; + testcase.stop("GSUP IMSI table full!"); } private function f_imsi_table_del(charstring imsi) @@ -158,9 +154,8 @@ return } } - log("GSUP IMSI table attempt to delete non-existant ", imsi); - setverdict(fail); - self.stop; + setverdict(fail, "GSUP IMSI table attempt to delete non-existant ", imsi); + mtc.stop; } @@ -190,7 +185,7 @@ [] GSUP.receive(ASP_IPA_Event:{up_down:=ASP_IPA_EVENT_UP}) { repeat; } [] GSUP.receive(ASP_IPA_Event:{up_down:=ASP_IPA_EVENT_DOWN}) { setverdict(fail, "GSUP Connection Lost"); - self.stop; + mtc.stop; } /* GSUP -> Client: call related messages */ @@ -272,6 +267,7 @@ } } setverdict(fail, "Couldn't find GsupExpect for incoming imsi ", imsi); + mtc.stop; return ret; } @@ -287,7 +283,7 @@ return; } } - setverdict(fail, "No space left in GsupExpectTable"); + testcase.stop("No space left in GsupExpectTable"); } /* client/conn_hdlr side function to use procedure port to create expect in emulation */ diff --git a/library/GTP_Emulation.ttcn b/library/GTP_Emulation.ttcn index 534fdef..750f744 100644 --- a/library/GTP_Emulation.ttcn +++ b/library/GTP_Emulation.ttcn @@ -62,7 +62,7 @@ } } setverdict(fail, "No Component for TEID ", teid); - self.stop; + mtc.stop; } private function f_comp_by_imsi(hexstring imsi) runs on GTP_Emulation_CT return GTP_ConnHdlr { @@ -73,7 +73,7 @@ } } setverdict(fail, "No Component for IMSI ", imsi); - self.stop; + mtc.stop; } private function f_tid_tbl_add(OCT4 teid, GTP_ConnHdlr vc_conn) runs on GTP_Emulation_CT { @@ -85,8 +85,7 @@ return; } } - setverdict(fail, "No Space in TidTable for ", teid); - self.stop; + testcase.stop("No Space in TidTable for ", teid); } private function f_imsi_tbl_add(hexstring imsi, GTP_ConnHdlr vc_conn) runs on GTP_Emulation_CT { @@ -98,8 +97,7 @@ return; } } - setverdict(fail, "No Space in IMSI Table for ", imsi); - self.stop; + testcase.stop("No Space in IMSI Table for ", imsi); } function f_gtpc_extract_imsi(PDU_GTPC gtp) return template (omit) hexstring { diff --git a/library/GTP_Templates.ttcn b/library/GTP_Templates.ttcn index a222b2e..d778c97 100644 --- a/library/GTP_Templates.ttcn +++ b/library/GTP_Templates.ttcn @@ -462,7 +462,8 @@ } } } - setverdict(fail); + setverdict(fail, "Could not extract protocol payload from protocol ", protocol); + mtc.stop; return ''O; } diff --git a/library/IPA_Emulation.ttcnpp b/library/IPA_Emulation.ttcnpp index df2b15e..a271f2d 100644 --- a/library/IPA_Emulation.ttcnpp +++ b/library/IPA_Emulation.ttcnpp @@ -203,7 +203,7 @@ local_host, local_port, 0, { tcp:={} }); if (not ispresent(res.connId)) { setverdict(fail, "Could not connect IPA socket, check your configuration"); - self.stop; + mtc.stop; } g_ipa_conn_id := res.connId; g_ccm_pars := ccm_pars; @@ -218,7 +218,7 @@ local_host, local_port, { tcp:={} }); if (not ispresent(res.connId)) { setverdict(fail, "Could not listen IPA socket, check your configuration"); - self.stop; + mtc.stop; } g_ipa_conn_id := res.connId; g_ccm_pars := ccm_pars; @@ -507,7 +507,7 @@ } case else { setverdict(fail, "Unknown mode"); - self.stop; + mtc.stop; } } } diff --git a/library/IuUP_Emulation.ttcn b/library/IuUP_Emulation.ttcn index 77cd739..752b897 100644 --- a/library/IuUP_Emulation.ttcn +++ b/library/IuUP_Emulation.ttcn @@ -80,6 +80,7 @@ return pdu.type_0.payload; } else { setverdict(fail, "PDU Type 0 received but 1 configured"); + mtc.stop; } } else if (ischosen(pdu.type_1)) { if (st.cfg.data_pdu_type_0 == false) { @@ -88,11 +89,13 @@ return pdu.type_1.payload; } else { setverdict(fail, "PDU Type 1 received but 0 configured"); + mtc.stop; } } else if (ischosen(pdu.type_14)) { if (match(pdu, tr_IuUP_INIT)) { if (st.cfg.active_init == true) { setverdict(fail, "INIT received in ACTIVE role"); + mtc.stop; } else { /* store an INIT_ACK to be transmitted later */ st.pending_tx_pdu := valueof(ts_IuUP_INIT_ACK(pdu.type_14.frame_nr, @@ -104,11 +107,13 @@ st.state := ST_DATA_TRANSFER_READY; } else { setverdict(fail, "INIT_ACK received in PASSIVE role"); + mtc.stop; } } return ''O; } else { setverdict(fail, "Impossible IuUP PDU decoded from ", inp); + mtc.stop; } self.stop; } diff --git a/library/L1CTL_PortType.ttcn b/library/L1CTL_PortType.ttcn index ba9c2b5..14a059c 100644 --- a/library/L1CTL_PortType.ttcn +++ b/library/L1CTL_PortType.ttcn @@ -41,7 +41,7 @@ [] pt.receive(tr_L1CTL_FBSB_CONF(0)) { return; }; [i >= 9] pt.receive(tr_L1CTL_FBSB_CONF(?)) { setverdict(fail, "FBSB Failed with non-zero return code"); - self.stop; + mtc.stop; }; [] pt.receive(tr_L1CTL_FBSB_CONF(?)) { f_sleep(1.0); @@ -49,7 +49,7 @@ [] pt.receive { repeat; }; [] T.timeout { setverdict(fail, "Timeout in FBSB") - self.stop; + mtc.stop; }; } } @@ -64,7 +64,7 @@ [] pt.receive { repeat; } [] T.timeout { setverdict(fail, "Timeout in CCH_MODE"); - self.stop; + mtc.stop; } } } @@ -80,7 +80,7 @@ [] pt.receive { repeat; }; [] T.timeout { setverdict(fail, "Timeout in RACH"); - self.stop; + mtc.stop; } } return fn; @@ -108,7 +108,7 @@ [] pt.receive { repeat }; [] T.timeout { setverdict(fail, "Timeout waiting for IMM ASS"); - self.stop; + mtc.stop; } } T.stop; @@ -133,7 +133,7 @@ [] pt.receive { repeat }; [] T.timeout { setverdict(fail, "Timeout waiting for IMM ASS"); - self.stop; + mtc.stop; } } T.stop; @@ -149,7 +149,7 @@ [] pt.receive { repeat }; [] T.timeout { setverdict(fail, "Timeout waiting for TBF-CFG.conf"); - self.stop; + mtc.stop; }; } T.stop; @@ -174,7 +174,7 @@ [] pt.receive { repeat; } [] T.timeout { setverdict(fail, "Timeout waiting for RESET.conf"); - self.stop; + mtc.stop; } } } diff --git a/library/L3_Common.ttcn b/library/L3_Common.ttcn index 2b39621..bf7818a 100644 --- a/library/L3_Common.ttcn +++ b/library/L3_Common.ttcn @@ -70,7 +70,7 @@ return TLLI_RAND_G_RNTI; } else { setverdict(fail, "Unknonw TLLI Type ", tllib); - self.stop; + mtc.stop; } } diff --git a/library/LAPDm_RAW_PT.ttcn b/library/LAPDm_RAW_PT.ttcn index bdfc50b..6b8f9fb 100644 --- a/library/LAPDm_RAW_PT.ttcn +++ b/library/LAPDm_RAW_PT.ttcn @@ -320,7 +320,7 @@ var TBF_UL_establish_res res; if (isvalue(g_tbf_ul[tbf_nr].arfcn)) { setverdict(fail, "Cannot establish UL TBF ID ", tbf_nr, ": BUSY"); - self.stop; + mtc.stop; } f_establish_tbf(tbf_ul_req.ra); if (ph_state == PH_STATE_TBF) { @@ -340,7 +340,7 @@ var TbfNr tbf_nr := tbf_dl_req.tbf_nr; if (isvalue(g_tbf_dl[tbf_nr].arfcn)) { setverdict(fail, "Cannot establish DL TBF ID ", tbf_nr, ": BUSY"); - self.stop; + mtc.stop; } g_tbf_dl[tbf_nr] := tbf_dl_req.pars; f_L1CTL_TBF_CFG(L1CTL, false, tbf_dl_req.pars.tfi); diff --git a/library/MGCP_Emulation.ttcn b/library/MGCP_Emulation.ttcn index 0863511..c3d09b9 100644 --- a/library/MGCP_Emulation.ttcn +++ b/library/MGCP_Emulation.ttcn @@ -134,9 +134,8 @@ return MgcpEndpointTable[i].comp_ref; } } - log("MGCP Endpoint Table not found by Endpoint", ep); - setverdict(fail); - self.stop; + setverdict(fail, "MGCP Endpoint Table not found by Endpoint", ep); + mtc.stop; } private function f_ep_by_comp(MGCP_ConnHdlr client) @@ -147,9 +146,8 @@ return MgcpEndpointTable[i].endpoint; } } - log("MGCP Endpoint Table not found by component ", client); - setverdict(fail); - self.stop; + setverdict(fail, "MGCP Endpoint Table not found by component ", client); + mtc.stop; } private function f_ep_table_add(MGCP_ConnHdlr comp_ref, MgcpEndpoint ep) @@ -162,8 +160,7 @@ return; } } - setverdict(fail, "MGCP Endpoint Table full!"); - self.stop; + testcase.stop("MGCP Endpoint Table full!"); } private function f_ep_table_del(MGCP_ConnHdlr comp_ref, MgcpEndpoint ep) @@ -178,7 +175,7 @@ } } setverdict(fail, "MGCP Endpoint Table: Couldn't find to-be-deleted entry!"); - self.stop; + mtc.stop; } @@ -211,7 +208,7 @@ var MgcpEndpoint ep; if (f_mgcp_find_param(msg, "Z", ep) == false) { setverdict(fail, "No SpecificEndpointName in MGCP response", msg); - self.stop; + mtc.stop; } return ep; } @@ -239,7 +236,7 @@ } if (not ispresent(res.connId)) { setverdict(fail, "Could not connect MGCP socket, check your configuration"); - self.stop; + mtc.stop; } g_mgcp_conn_id := res.connId; @@ -273,7 +270,7 @@ res := MGCP_CodecPort_CtrlFunct.f_IPL4_connect(MGCP, p.callagent_ip, p.callagent_udp_port, p.mgw_ip, p.mgw_udp_port, g_mgcp_conn_id, { udp:={} }); if (not ispresent(res.connId)) { setverdict(fail, "Could not connect MGCP socket, check your configuration"); - self.stop; + mtc.stop; } } if (ischosen(mrf.msg.command)) { @@ -302,7 +299,7 @@ } } else { setverdict(fail, "Received unexpected MGCP response: ", mrf.msg.response); - self.stop; + mtc.stop; } } [] MGCP_PROC.getcall(MGCPEM_register:{?,?}) -> param(crit, vc_conn) { @@ -387,6 +384,7 @@ } } setverdict(fail, "Couldn't find Expect for CRCX", cmd); + mtc.stop; return ret; } @@ -398,7 +396,7 @@ for (i := 0; i < sizeof(MgcpExpectTable); i := i+1) { if (crit == MgcpExpectTable[i].crit) { setverdict(fail, "Crit already present", crit); - self.stop; + mtc.stop; } } for (i := 0; i < sizeof(MgcpExpectTable); i := i+1) { @@ -409,7 +407,7 @@ return; } } - setverdict(fail, "No space left in MgcpExpectTable") + testcase.stop("No space left in MgcpExpectTable") } /* client/conn_hdlr side function to use procedure port to create expect in emulation */ @@ -459,7 +457,8 @@ return "AMR-WB"; } - setverdict(fail); + setverdict(fail, "Unknown payload type ", pt); + mtc.stop; return ""; } diff --git a/library/MGCP_Templates.ttcn b/library/MGCP_Templates.ttcn index 9d6dea6..afdc33d 100644 --- a/library/MGCP_Templates.ttcn +++ b/library/MGCP_Templates.ttcn @@ -294,7 +294,7 @@ return par.val; } } - setverdict(fail); + setverdict(fail, "Could not extract parameters for code ", code); return ""; } diff --git a/library/MNCC_Emulation.ttcn b/library/MNCC_Emulation.ttcn index d9b7c79..94ed1c4 100644 --- a/library/MNCC_Emulation.ttcn +++ b/library/MNCC_Emulation.ttcn @@ -116,9 +116,8 @@ return MnccCallTable[i].comp_ref; } } - log("MNCC Call table not found by MNCC Call ID ", mncc_call_id); - setverdict(fail); - self.stop; + setverdict(fail, "MNCC Call table not found by MNCC Call ID ", mncc_call_id); + mtc.stop; } /* resolve connection ID by component reference */ @@ -129,9 +128,8 @@ return MnccCallTable[i].mncc_call_id; } } - log("MNCC Call table not found by component ", client); - setverdict(fail); - self.stop; + setverdict(fail, "MNCC Call table not found by component ", client); + mtc.stop; } private function f_gen_call_id() @@ -171,9 +169,7 @@ return; } } - log("MNCC Call table full!"); - setverdict(fail); - self.stop; + testcase.stop("MNCC Call table full!"); } private function f_call_table_del(uint32_t mncc_call_id) @@ -187,9 +183,8 @@ return } } - log("MNCC Call table attempt to delete non-existant ", mncc_call_id); - setverdict(fail); - self.stop; + setverdict(fail, "MNCC Call table attempt to delete non-existant ", mncc_call_id); + mtc.stop; } @@ -203,14 +198,14 @@ [] MNCC.receive(UD_connect_result:?) -> value res { if (ispresent(res.result) and ispresent(res.result.result_code) and res.result.result_code == ERROR) { setverdict(fail, "Error connecting to MNCC socket", res); - self.stop; + mtc.stop; } else { g_mncc_ud_id := res.id; } } [] T.timeout { setverdict(fail, "Timeout connecting to MNCC socket"); - self.stop; + mtc.stop; } } } @@ -226,14 +221,14 @@ [] MNCC.receive(UD_listen_result:?) -> value res { if (ispresent(res.result) and ispresent(res.result.result_code) and res.result.result_code == ERROR) { setverdict(fail, "Error listening to MNCC socket", res); - self.stop; + mtc.stop; } else { g_mncc_ud_id := res.id; } } [] T.timeout { setverdict(fail, "Timeout listening to MNCC socket"); - self.stop; + mtc.stop; } } @@ -244,7 +239,7 @@ } [] T.timeout { setverdict(fail, "Timeout waiting for MNCC connection"); - self.stop; + mtc.stop; } } } @@ -393,6 +388,7 @@ if (not ischosen(conn_ind.u.signal) or (conn_ind.msg_type != MNCC_SETUP_IND and conn_ind.msg_type != MNCC_SETUP_REQ)) { setverdict(fail, "MNCC ExpectedCreateCallback needs MNCC_SETUP_{IND,REQ}"); + mtc.stop; return ret; } dest_number := conn_ind.u.signal.called.number; @@ -412,6 +408,7 @@ } } setverdict(fail, "Couldn't find MnccExpect for incoming call ", dest_number); + mtc.stop; return ret; } @@ -427,7 +424,7 @@ return; } } - setverdict(fail, "No space left in MnccMnccExpectTable"); + testcase.stop("No space left in MnccMnccExpectTable"); } /* client/conn_hdlr side function to use procedure port to create expect in emulation */ diff --git a/library/MNCC_Types.ttcn b/library/MNCC_Types.ttcn index 19af236..157457a 100644 --- a/library/MNCC_Types.ttcn +++ b/library/MNCC_Types.ttcn @@ -1922,7 +1922,7 @@ return pdu.u.signal.callref; } else { setverdict(fail, "Unable to determine Callref for MNCC", pdu); - self.stop + mtc.stop } } diff --git a/library/NS_Emulation.ttcn b/library/NS_Emulation.ttcn index d43d15c..01d45b4 100644 --- a/library/NS_Emulation.ttcn +++ b/library/NS_Emulation.ttcn @@ -83,7 +83,7 @@ res := f_IPL4_connect(NSCP, mp_remote_ip, mp_remote_udp_port, mp_local_ip, mp_local_udp_port, 0, { udp := {}}); if (not ispresent(res.connId)) { setverdict(fail, "Could not connect NS UDP socket, check your configuration"); - self.stop; + mtc.stop; } g_conn_id := res.connId; f_change_state(NSE_S_DEAD_BLOCKED); diff --git a/library/Osmocom_CTRL_Adapter.ttcn b/library/Osmocom_CTRL_Adapter.ttcn index 22195c8..a98ac29 100644 --- a/library/Osmocom_CTRL_Adapter.ttcn +++ b/library/Osmocom_CTRL_Adapter.ttcn @@ -38,7 +38,7 @@ [] IPA_CTRL.receive(ASP_IPA_Event:{up_down := ASP_IPA_EVENT_UP}) { } [] T.timeout { setverdict(fail, "Timeout CTRL waiting for ASP_IPA_EVENT_UP"); - self.stop; + mtc.stop; } } } diff --git a/library/Osmocom_CTRL_Functions.ttcn b/library/Osmocom_CTRL_Functions.ttcn index 70885c9..da3b80d 100644 --- a/library/Osmocom_CTRL_Functions.ttcn +++ b/library/Osmocom_CTRL_Functions.ttcn @@ -40,10 +40,12 @@ [] pt.receive(tr_CtrlMsgTrap) { repeat; } [] pt.receive(tr_CtrlMsgError) -> value rx { setverdict(fail, "Error in CTRL GET ", variable, ": ", rx.err.reason); + mtc.stop; return "FAIL"; } [] T.timeout { setverdict(fail, "Timeout waiting for CTRL GET REPLY ", variable); + mtc.stop; return "TIMEOUT"; } } @@ -62,9 +64,11 @@ [] pt.receive(tr_CtrlMsgTrap) { repeat; } [] pt.receive(tr_CtrlMsgError) -> value rx { setverdict(fail, "Error in CTRL GET ", variable, ": ", rx.err.reason); + mtc.stop; } [] T.timeout { setverdict(fail, "Timeout waiting for CTRL SET REPLY ", variable); + mtc.stop; } } } @@ -80,6 +84,7 @@ } [] T.timeout { setverdict(fail, "Timeout waiting for TRAP ", variable); + mtc.stop; return "TIMEOUT"; } } @@ -92,6 +97,7 @@ ctrl_resp := f_ctrl_get(pt, variable); if (not match(ctrl_resp, exp)) { setverdict(fail, "Unexpected " & variable & ":" & ctrl_resp); + mtc.stop; } } @@ -111,6 +117,7 @@ ctrl_resp := f_ctrl_get(pt, variable); if (not match(str2int(ctrl_resp), exp)) { setverdict(fail, variable & " value " & ctrl_resp & " didn't match ", exp); + mtc.stop; } } diff --git a/library/Osmocom_Types.ttcn b/library/Osmocom_Types.ttcn index d01fe37..6c1690a 100644 --- a/library/Osmocom_Types.ttcn +++ b/library/Osmocom_Types.ttcn @@ -96,7 +96,7 @@ } } setverdict(fail, "Unsupported template", inp); - self.stop; + mtc.stop; } type record of integer IntegerRecord; diff --git a/library/Osmocom_VTY_Functions.ttcn b/library/Osmocom_VTY_Functions.ttcn index c7f4441..6e4eb74 100644 --- a/library/Osmocom_VTY_Functions.ttcn +++ b/library/Osmocom_VTY_Functions.ttcn @@ -59,7 +59,7 @@ [] pt.receive(charstring:?) -> value rx { buf := buf & rx; repeat }; [] T.timeout { setverdict(fail, "VTY Timeout for prompt"); - self.stop; + mtc.stop; }; } T.stop; @@ -132,7 +132,7 @@ var charstring ret := f_vty_transceive_ret(pt, cmd); if (not match(ret, exp_ret)) { setverdict(fail, "Non-matching VTY response: ", ret); - self.stop; + mtc.stop; } } @@ -140,7 +140,7 @@ var charstring ret := f_vty_transceive_ret(pt, cmd); if (match(ret, exp_ret)) { setverdict(fail, "Unexpected matching VTY response: ", ret); - self.stop; + mtc.stop; } } diff --git a/library/PCUIF_CodecPort.ttcn b/library/PCUIF_CodecPort.ttcn index c642202..389c5ca 100644 --- a/library/PCUIF_CodecPort.ttcn +++ b/library/PCUIF_CodecPort.ttcn @@ -70,14 +70,14 @@ } else { setverdict(fail, "Error connecting to PCU socket"); } - self.stop; + mtc.stop; } else { return res.id; } } [] T.timeout { setverdict(fail, "Timeout connecting to PCU socket"); - self.stop; + mtc.stop; } } return -23; @@ -106,7 +106,7 @@ [] pt.receive { repeat; } [] T.timeout { setverdict(fail, "Timeout waiting for PCU DATA.cnf"); - self.stop; + mtc.stop; } } return 0; diff --git a/library/RSL_Emulation.ttcn b/library/RSL_Emulation.ttcn index 325f22e..3c035e9 100644 --- a/library/RSL_Emulation.ttcn +++ b/library/RSL_Emulation.ttcn @@ -90,11 +90,11 @@ } [] RSL.receive { setverdict(fail, "Unexpected RSL message on DCHAN"); - self.stop; + mtc.stop; } [] T.timeout { setverdict(fail, "Timeout waiting for RSL on DCHAN"); - self.stop; + mtc.stop; } } /* never reached */ @@ -361,7 +361,7 @@ cid := f_cid_by_ra_fn(ra, fn); if (cid == -1) { setverdict(fail, "IMM ASS for unknown DChan"); - self.stop; + mtc.stop; } /* update client with trx_nr */ ConnectionTable[cid].trx_nr := f_trx_by_streamId(rx_rsl.streamId); @@ -421,12 +421,13 @@ CLIENT_PT.send(rx_rsl.rsl) to ConnectionTable[cid].comp_ref; } else { setverdict(fail, "RSL for unknown Dchan"); + mtc.stop; } } [not dchan_suspended] IPA_PT.receive { setverdict(fail, "Received unknown primitive from IPA"); - self.stop; + mtc.stop; } [bts_role] CLIENT_PT.receive(RSLDC_ChanRqd:?) -> value chan_rqd sender vc_conn { diff --git a/library/RTP_Emulation.ttcn b/library/RTP_Emulation.ttcn index 475b478..71cd8db 100644 --- a/library/RTP_Emulation.ttcn +++ b/library/RTP_Emulation.ttcn @@ -303,7 +303,7 @@ g_local_port, {udp:={}}); if (not ispresent(res.connId)) { setverdict(fail, "Could not listen on RTP socket, check your configuration"); - self.stop; + mtc.stop; } g_rtp_conn_id := res.connId; tr_rtp.connId := g_rtp_conn_id; @@ -311,7 +311,7 @@ g_local_port+1, {udp:={}}); if (not ispresent(res.connId)) { setverdict(fail, "Could not listen on RTCP socket, check your configuration"); - self.stop; + mtc.stop; } g_rtcp_conn_id := res.connId; tr_rtcp.connId := g_rtcp_conn_id; @@ -329,7 +329,7 @@ g_rtp_conn_id, {udp:={}}); if (not ispresent(res.connId)) { setverdict(fail, "Could not connect to RTP socket, check your configuration"); - self.stop; + mtc.stop; } res := RTP_CodecPort_CtrlFunct.f_IPL4_connect(RTCP, g_remote_host, g_remote_port+1, @@ -337,7 +337,7 @@ g_rtcp_conn_id, {udp:={}}); if (not ispresent(res.connId)) { setverdict(fail, "Could not connect to RTCP socket, check your configuration"); - self.stop; + mtc.stop; } CTRL.reply(RTPEM_connect:{g_remote_host, g_remote_port}); } @@ -426,9 +426,11 @@ /* fail on any unexpected messages */ [] RTP.receive { setverdict(fail, "Received unexpected type from RTP"); + mtc.stop; } [] RTCP.receive { setverdict(fail, "Received unexpected type from RTCP"); + mtc.stop; } } } diff --git a/library/SIP_Emulation.ttcn b/library/SIP_Emulation.ttcn index 3957b8f..98f7371 100644 --- a/library/SIP_Emulation.ttcn +++ b/library/SIP_Emulation.ttcn @@ -155,7 +155,7 @@ } } setverdict(fail, "SIP Call table not found by SIP Call ID ", call_id); - self.stop; + mtc.stop; } /* resolve connection ID by component reference */ @@ -167,7 +167,7 @@ } } setverdict(fail, "SIP Call table not found by component ", client); - self.stop; + mtc.stop; } private function f_expect_table_init() @@ -196,8 +196,7 @@ return; } } - setverdict(fail, "SIP Call table full"); - self.stop; + testcase.stop("SIP Call table full"); } private function f_call_table_del(CallidString call_id) @@ -211,7 +210,7 @@ } } setverdict(fail, "SIP Call table attempt to delete non-existant ", call_id); - self.stop; + mtc.stop; } /* call-back type, to be provided by specific implementation; called when new call connection @@ -270,7 +269,7 @@ CLIENT.send(sip_req) to vc_conn; } else { setverdict(fail, "SIP Request for unknown call ", call_id); - self.stop; + mtc.stop; } } /* SIP response was received on SIP socket/port */ @@ -281,7 +280,7 @@ CLIENT.send(sip_resp) to vc_conn; } else { setverdict(fail, "SIP Response for unknown call ", call_id); - self.stop; + mtc.stop; } } @@ -344,6 +343,7 @@ if (sip_req.requestLine.method != INVITE_E) { setverdict(fail, "SIP ExpectedCreateCallback needs INVITE"); + mtc.stop return ret; } sip_to := sip_req.msgHeader.toField.addressField.nameAddr.addrSpec; @@ -378,6 +378,7 @@ } setverdict(fail, "Couldn't find SipExpect for incoming call ", sip_to); + mtc.stop return ret; } @@ -393,7 +394,7 @@ return; } } - setverdict(fail, "No space left in SipExpectTable"); + testcase.stop("No space left in SipExpectTable"); } /* client/conn_hdlr side function to use procedure port to create expect in emulation */ diff --git a/library/SMPP_Emulation.ttcn b/library/SMPP_Emulation.ttcn index 27876dc..6dc78e9 100644 --- a/library/SMPP_Emulation.ttcn +++ b/library/SMPP_Emulation.ttcn @@ -88,7 +88,7 @@ } } setverdict(fail, "No componten for SMPP TID ", tid); - self.stop; + mtc.stop; } @@ -109,8 +109,7 @@ return; } } - setverdict(fail, "SMPP Trans table full!"); - self.stop; + testcase.stop("SMPP Trans table full!"); } private function f_trans_table_del(uint32_t trans_id) @@ -123,7 +122,7 @@ } } setverdict(fail, "SMPP Trans table attempt to delete non-existant ", trans_id); - self.stop; + mtc.stop; } @@ -136,7 +135,7 @@ local_host, local_port, 0, { tcp :={} }); if (not ispresent(res.connId)) { setverdict(fail, "Could not connect to SMPP port, check your configuration"); - self.stop; + mtc.stop; } g_smpp_conn_id := res.connId; } @@ -187,7 +186,7 @@ [] SMPP_PORT.receive(tr_SMPP_Recv(g_smpp_conn_id, pdu)) { } [] T_wait.timeout { setverdict(fail, "Timeout waiting for ", pdu); - self.stop; + mtc.stop; } } } @@ -211,7 +210,7 @@ } [] SMPP_PORT.receive { setverdict(fail, "Unexpected SMPP from peer"); - self.stop; + mtc.stop; } } @@ -371,8 +370,7 @@ return; } } - setverdict(fail, "No space left in SmppExpectTable"); - self.stop; + testcase.stop("No space left in SmppExpectTable"); } private function f_exp_lookup(SMPP_TON ton, SMPP_NPI npi, charstring dst) diff --git a/library/TRXC_CodecPort.ttcn b/library/TRXC_CodecPort.ttcn index 774b674..09b2977 100644 --- a/library/TRXC_CodecPort.ttcn +++ b/library/TRXC_CodecPort.ttcn @@ -81,6 +81,7 @@ } [] T.timeout { setverdict(fail, "Timeout waiting for ", tr, " on ", pt); + mtc.stop; } } return rf.msg; -- To view, visit https://gerrit.osmocom.org/9905 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Idc6819aaf0b01e70c38fad828dd44dcec6bdd778 Gerrit-Change-Number: 9905 Gerrit-PatchSet: 1 Gerrit-Owner: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 6 16:07:38 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Fri, 6 Jul 2018 16:07:38 +0000 Subject: Change in libosmo-sccp[master]: tweak the default point codes used by sccp_demo_user In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9652 to look at the new patch set (#2). Change subject: tweak the default point codes used by sccp_demo_user ...................................................................... tweak the default point codes used by sccp_demo_user commit 4dc9088cabedc40cb9072814237ad5926b12bd35 changed default local point code values from: Client local point code: 23 Server local point code: 1 to Local point code: -1 (in either mode) Remote point code: 23 (in either mode) Revert to the previous behaviour: Set the client's default point code to 23, and the server's default point code to 1 so that sccp_demo_user clients and servers will talk to each other by default. Show default values for all cases in the help output. This default behaviour will be assumed by the upcoming SCCP test suite. While here, remove unused -p option from getopt() argument list. Change-Id: I7432e6fc2617e0fd77a098fcd7d14abc40db7229 Related: OS#2666 --- M examples/sccp_demo_user.c 1 file changed, 49 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/52/9652/2 -- To view, visit https://gerrit.osmocom.org/9652 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7432e6fc2617e0fd77a098fcd7d14abc40db7229 Gerrit-Change-Number: 9652 Gerrit-PatchSet: 2 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 6 17:11:51 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 6 Jul 2018 17:11:51 +0000 Subject: Change in osmocom-bb[master]: calypso: Print warning about unsupported encryption algorithms Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9906 Change subject: calypso: Print warning about unsupported encryption algorithms ...................................................................... calypso: Print warning about unsupported encryption algorithms Unfortunately current code architecture doesn't support a return path with an error so tell the caller of L1CTL on the other side that something's wrong. Change-Id: Ib9b622dd5c9770c5e97fa58deee124a409544d3b --- M src/target/firmware/calypso/dsp.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/06/9906/1 diff --git a/src/target/firmware/calypso/dsp.c b/src/target/firmware/calypso/dsp.c index c37ca82..235d359 100644 --- a/src/target/firmware/calypso/dsp.c +++ b/src/target/firmware/calypso/dsp.c @@ -568,6 +568,9 @@ { dsp_api.ndb->d_a5mode = mode; + if (mode >= 3) /* Only A5/0, A5/1, A5/2 are supported by calypso */ + printd("Algo A5/%u is not supported!!!\n", mode); + if (!mode || !key) return; -- To view, visit https://gerrit.osmocom.org/9906 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ib9b622dd5c9770c5e97fa58deee124a409544d3b Gerrit-Change-Number: 9906 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From admin at opensuse.org Fri Jul 6 20:46:35 2018 From: admin at opensuse.org (OBS Notification) Date: Fri, 06 Jul 2018 20:46:35 +0000 Subject: Build failure of network:osmocom:nightly/osmo-mgw in Debian_9.0/armv7l In-Reply-To: References: Message-ID: <5b3fd52fe81db_26aad46842299e7@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-mgw/Debian_9.0/armv7l Package network:osmocom:nightly/osmo-mgw failed to build in Debian_9.0/armv7l Check out the package for editing: osc checkout network:osmocom:nightly osmo-mgw Last lines of build log: [ 218s] | configure:6324: checking for a working dd [ 218s] | configure:6362: result: /bin/dd [ 218s] | configure:6366: checking how to truncate binary pipes [ 218s] | configure:6381: result: /bin/dd bs=4096 count=1 [ 218s] | configure:6710: checking for mt [ 218s] | configure:6740: result: no [ 218s] | configure:6760: checking if : is a manifest tool [ 218s] | configure:6766: : '-?' [ 218s] | configure:6774: result: no [ 218s] | configure:7451: checking how to run the C preprocessor [ 218s] | configure:7482: gcc -E -Wdate-time -D_FORTIFY_SOURCE=2 conftest.c [ 218s] | configure:7482: $? = 0 [ 218s] | configure:7496: gcc -E -Wdate-time -D_FORTIFY_SOURCE=2 conftest.c [ 218s] | conftest.c:11:28: fatal error: ac_nonexistent.h: No such file or directory [ 218s] | #include [ 218s] | ^ [ 218s] | compilation terminated. [ 218s] | configure:7496: $? = 1 [ 218s] | configure: failed program was: [ 218s] | | /* confdefs.h */ [ 218s] | | #define PACKAGE_NAME "osmo-mgw" [ 218s] | | #define PACKAGE_TARNAME "osmo-mgw" [ 218s] | | #define PACKAGE_VERSION "1.3.0.29.cede2" [ 220s] | | #define PACKAGE_STRING "osmo-mgw 1.3.0.[ 181.264316] SysRq : Power Off [ 220s] [ 181.266012] reboot: Power down [ 220s] ### VM INTERACTION END ### [ 220s] [ 220s] armbuild19 failed "build osmo-mgw_1.3.0.29.cede2.dsc" at Fri Jul 6 20:46:19 UTC 2018. [ 220s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Fri Jul 6 21:33:07 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 6 Jul 2018 21:33:07 +0000 Subject: Change in osmo-ttcn3-hacks[master]: log / comment tweaks In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9627 ) Change subject: log / comment tweaks ...................................................................... Patch Set 3: I can see the MGW's MGCP communication easily, but AFAICT wireshark doesn't show me the IPACC CRCX/MDCX contents sent to the BTS. Am I missing a config item? -- To view, visit https://gerrit.osmocom.org/9627 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I93c2914e766e200d89308cc81dd803e939b9b28c Gerrit-Change-Number: 9627 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte Gerrit-Comment-Date: Fri, 06 Jul 2018 21:33:07 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 6 22:06:12 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 6 Jul 2018 22:06:12 +0000 Subject: Change in osmo-bsc[master]: inter-BSC HO: add neighbor_ident API to manage neighbor-BSS-cells In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9666 ) Change subject: inter-BSC HO: add neighbor_ident API to manage neighbor-BSS-cells ...................................................................... Patch Set 3: (5 comments) https://gerrit.osmocom.org/#/c/9666/3/include/osmocom/bsc/gsm_data.h File include/osmocom/bsc/gsm_data.h: https://gerrit.osmocom.org/#/c/9666/3/include/osmocom/bsc/gsm_data.h at 755 PS3, Line 755: struct gsm_bts_ref { > not a request to change, just a general reminder: We also have the "vector" of libosmovty, which is [?] ah. I thought the vector was a string parsing specific implementation, now I see it's sort of like the C++ vector... with vector the allocation dance is slightly more complex to code, though it has a better memory footprint. Though if you say not a request to change, then I'll not change it. https://gerrit.osmocom.org/#/c/9666/3/include/osmocom/bsc/neighbor_ident.h File include/osmocom/bsc/neighbor_ident.h: https://gerrit.osmocom.org/#/c/9666/3/include/osmocom/bsc/neighbor_ident.h at 18 PS3, Line 18: BSIC_9BIT, > huh, where's that 9 bit BSIC coming from? Do you have a spec reference for me? 23.003 "4.3.2 Base Station Identify Code (BSIC)" says: "BSIC is a 6 bit code which is structured as shown in Figure 6. Exceptions apply to networks supporting EC-GSM-IoT or PEO and for mobile stations in EC or PEO operation (see 3GPP TS 43.064 [112]) where the BSIC is a 9 bit code which is structured as shown in Figure 6a." Let me guess, EC-GSM-IoT or PEO (which i haven't a clue about) doesn't apply and we can cut out the entire 9-bit bsic enum? I think I just saw the 6-or-9-bit BSIC encoding somewhere, like in a message coding chapter, and thought it was safer to allow both from the start... https://gerrit.osmocom.org/#/c/9666/3/src/osmo-bsc/gsm_data.c File src/osmo-bsc/gsm_data.c: https://gerrit.osmocom.org/#/c/9666/3/src/osmo-bsc/gsm_data.c at 567 PS3, Line 567: bool gsm_bts_matches_cell_id(struct gsm_bts *bts, const struct gsm0808_cell_id *ci) > not important, but I'd expect 'bts' could also be a const pointer, as we're just reading/comparing/m [?] I wonder why I wouldn't have consted that... maybe it was copy-pasted from a more potent function. Ah, I see now that I'm actually changing it again in the "large refactoring commit", will move that part here. https://gerrit.osmocom.org/#/c/9666/3/src/osmo-bsc/neighbor_ident_vty.c File src/osmo-bsc/neighbor_ident_vty.c: https://gerrit.osmocom.org/#/c/9666/3/src/osmo-bsc/neighbor_ident_vty.c at 560 PS3, Line 560: install_element(BTS_NODE, &cfg_neighbor_resolve_cmd); > the BTS_NODE is a sub-node of the CONFIG NODE. [?] hm, so when I'm in the bts node and entered some neighbor entries, I can't just query on the same level but I should prepend 'do bts '? I understand the scoping aspect, wasn't aware that it's that strict though. Ok, so how about 'show bts NR neighbor NEIGHBOR_IDENT_VTY_KEY_PARAMS'. https://gerrit.osmocom.org/#/c/9666/3/tests/handover/neighbor_ident_test.c File tests/handover/neighbor_ident_test.c: https://gerrit.osmocom.org/#/c/9666/3/tests/handover/neighbor_ident_test.c at 33 PS3, Line 33: arfcn > it might be interesting to have test cases for ARFCNs in different bands. [?] In turn I'm not fully understanding yet where the pitfall lies in that. Here, I'm simply using arfcn as a 16bit key, and the high bit is simply the high bit in that number space. Should it imply some special meaning and/or affect other data fields? -- To view, visit https://gerrit.osmocom.org/9666 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0153d7069817fba9146ddc11214de2757d7d37bf Gerrit-Change-Number: 9666 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 06 Jul 2018 22:06:12 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 6 22:07:22 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 6 Jul 2018 22:07:22 +0000 Subject: Change in osmo-bsc[master]: inter-BSC HO: add neighbor_ident API to manage neighbor-BSS-cells In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9666 ) Change subject: inter-BSC HO: add neighbor_ident API to manage neighbor-BSS-cells ...................................................................... Patch Set 3: > -1 to the whole branch since osmo-gsm-tester found an assertion > failure: > > 20180627143850497 DRLL <0000> mgcp_client_fsm.c:430 > MGCP_CONN(to-BTS)[0x612000007120]{ST_DLCX_RESP}: Received Event > EV_DLCX_RESP > 20180627143850497 DRLL <0000> mgcp_client_fsm.c:446 > MGCP_CONN(to-BTS)[0x612000007120]{ST_DLCX_RESP}: Terminating (cause > = OSMO_FSM_TERM_REGULAR) > 20180627143850497 DRLL <0000> mgcp_client_fsm.c:446 > MGCP_CONN(to-BTS)[0x612000007120]{ST_DLCX_RESP}: Freeing instance > 20180627143850497 DRLL <0000> fsm.c:381 MGCP_CONN(to-BTS)[0x612000007120]{ST_DLCX_RESP}: > Deallocated > 20180627143850498 DRSL <0003> abis_rsl.c:1123 lchan(0-0-2-TCH_F-0)[0x612000008aa0]{BORKEN}: > (type=NONE) Rx RF_CHAN_REL_ACK > 20180627143850499 DRSL <0003> abis_rsl.c:1155 lchan(0-0-2-TCH_F-0)[0x612000008aa0]{BORKEN}: > Received Event LCHAN_EV_RSL_RF_CHAN_REL_ACK > Assert failed false lchan_fsm.c:1119 this is related to the "large refactoring" commit. A fix for that ... problem family exists and will be pushed soon. -- To view, visit https://gerrit.osmocom.org/9666 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0153d7069817fba9146ddc11214de2757d7d37bf Gerrit-Change-Number: 9666 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 06 Jul 2018 22:07:22 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 6 22:18:31 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 6 Jul 2018 22:18:31 +0000 Subject: Change in osmo-bsc[master]: fix / clarify rsl dtap cache In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9668 ) Change subject: fix / clarify rsl dtap cache ...................................................................... Patch Set 3: (3 comments) Sorry about not addressing everything yet, as I am resolving other patches' issues, I want to re-push to ensure we see small patch sets, but am not through with this one yet... https://gerrit.osmocom.org/#/c/9668/3/include/osmocom/bsc/gsm_data.h File include/osmocom/bsc/gsm_data.h: https://gerrit.osmocom.org/#/c/9668/3/include/osmocom/bsc/gsm_data.h at 123 PS3, Line 123: struct llist_head dtap_cache; > unrelated to this patch: I think "cache" is a misnomer. It' s simply a queue. [?] I agree, just took this over from other peoples' patches https://gerrit.osmocom.org/#/c/9668/3/src/osmo-bsc/bsc_subscr_conn_fsm.c File src/osmo-bsc/bsc_subscr_conn_fsm.c: https://gerrit.osmocom.org/#/c/9668/3/src/osmo-bsc/bsc_subscr_conn_fsm.c at 1125 PS3, Line 1125: 23 > no #define? 23 seems like a lot, btw. Wasn't my choice; I think this is just an upper sanity limit, could be intentional to be essentially "unlimited". Need not be config item, does it? https://gerrit.osmocom.org/#/c/9668/3/src/osmo-bsc/bsc_subscr_conn_fsm.c at 1126 PS3, Line 1126: DHO > why do we log this in DHO, if it's now a generic functionality? good point -- To view, visit https://gerrit.osmocom.org/9668 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6ffd7aa641c8905292c769400048c96aa0949585 Gerrit-Change-Number: 9668 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Fri, 06 Jul 2018 22:18:31 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 6 22:18:54 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 6 Jul 2018 22:18:54 +0000 Subject: Change in osmo-bsc[master]: inter-BSC HO: add neighbor_ident API to manage neighbor-BSS-cells In-Reply-To: References: Message-ID: Hello Pau Espin Pedrol, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9666 to look at the new patch set (#7). Change subject: inter-BSC HO: add neighbor_ident API to manage neighbor-BSS-cells ...................................................................... inter-BSC HO: add neighbor_ident API to manage neighbor-BSS-cells Change-Id: I0153d7069817fba9146ddc11214de2757d7d37bf --- M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/handover.h A include/osmocom/bsc/neighbor_ident.h M src/osmo-bsc/Makefile.am M src/osmo-bsc/bsc_init.c M src/osmo-bsc/bsc_vty.c M src/osmo-bsc/gsm_data.c M src/osmo-bsc/handover_logic.c A src/osmo-bsc/neighbor_ident.c A src/osmo-bsc/neighbor_ident_vty.c M src/osmo-bsc/net_init.c M src/osmo-bsc/system_information.c M tests/bsc/Makefile.am M tests/gsm0408/Makefile.am M tests/handover/Makefile.am A tests/handover/neighbor_ident_test.c A tests/handover/neighbor_ident_test.err A tests/handover/neighbor_ident_test.ok A tests/neighbor_ident.vty M tests/testsuite.at 21 files changed, 1,958 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/66/9666/7 -- To view, visit https://gerrit.osmocom.org/9666 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0153d7069817fba9146ddc11214de2757d7d37bf Gerrit-Change-Number: 9666 Gerrit-PatchSet: 7 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 7 07:48:08 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Sat, 7 Jul 2018 07:48:08 +0000 Subject: Change in osmo-ttcn3-hacks[master]: Stop tests after failures Message-ID: daniel has uploaded this change for review. ( https://gerrit.osmocom.org/9907 Change subject: Stop tests after failures ...................................................................... Stop tests after failures Call mtc.stop after setverdict(fail), add reasons to most failures and fail with verdict error for internal errors. Change-Id: I9b618235939fa41160b9be6677b121963d3ec857 --- M mgw/MGCP_Test.ttcn M mgw/RTP_Endpoint.ttcn M msc/BSC_ConnectionHandler.ttcn M msc/MSC_Tests.ttcn M pcu/GPRS_TBF.ttcn M pcu/PCU_Tests.ttcn M selftest/Selftest.ttcn M sgsn/SGSN_Tests.ttcn M sip/SIP_Tests.ttcn M sysinfo/Test.ttcn 10 files changed, 155 insertions(+), 71 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/07/9907/1 diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn index d816a71..feed34f 100644 --- a/mgw/MGCP_Test.ttcn +++ b/mgw/MGCP_Test.ttcn @@ -70,7 +70,7 @@ res := MGCP_CodecPort_CtrlFunct.f_IPL4_connect(MGCP, mp_remote_ip, mp_remote_udp_port, mp_local_ip, mp_local_udp_port, 0, { udp := {} }); if (not ispresent(res.connId)) { setverdict(fail, "Could not connect MGCP, check your configuration"); - self.stop; + mtc.stop; } g_mgcp_conn_id := res.connId; @@ -179,9 +179,15 @@ T.start; alt { [] MGCP.receive(mrt) -> value mrf { } - [] MGCP.receive(tr_MGCP_RecvFrom_R(?)) { setverdict(fail); } + [] MGCP.receive(tr_MGCP_RecvFrom_R(?)) { + setverdict(fail, "Response didn't match template"); + mtc.stop; + } [] MGCP.receive { repeat; } - [] T.timeout { setverdict(fail); } + [] T.timeout { + setverdict(fail, "Timeout waiting for response to ", cmd); + mtc.stop; + } } T.stop; @@ -201,7 +207,8 @@ return str2hex(par.val); } } - setverdict(fail); + setverdict(fail, "Could not find conn id for MgcpReponse"); + mtc.stop; return '00000000'H; } @@ -370,12 +377,14 @@ payload type should be visible in the SDP of the response. */ if (resp.sdp.media_list[0].media_field.fmts[0] != "0") { setverdict(fail, "SDP contains unexpected codec"); + mtc.stop; } /* See also OS#2658: We also expect the MGW to assign a port number to us. */ if (isbound(resp.sdp.media_list[0].media_field.ports.port_number) == false) { setverdict(fail, "SDP does not contain a port number"); + mtc.stop; } } @@ -559,6 +568,7 @@ } if (f_mgcp_find_param(resp_msg, "Z", ep_assigned) == false) { setverdict(fail, "No SpecificEndpointName in MGCP response", resp); + mtc.stop; } /* clean-up */ @@ -591,6 +601,7 @@ } if (f_mgcp_find_param(resp_msg, "Z", ep_assigned[i]) == false) { setverdict(fail, "No SpecificEndpointName in MGCP response", resp); + mtc.stop; } } @@ -900,6 +911,7 @@ stats[1] := f_rtpem_stats_get(RTPEM[1]); if (not f_rtpem_stats_compare(stats[0], stats[1])) { setverdict(fail, "RTP endpoint statistics don't match"); + mtc.stop; } setverdict(pass); } @@ -1027,6 +1039,7 @@ stats[1] := f_rtpem_stats_get(RTPEM[1]); if (not f_rtpem_stats_compare(stats[0], stats[1], tolerance)) { setverdict(fail, "RTP endpoint statistics don't match"); + mtc.stop; } setverdict(pass); @@ -1072,10 +1085,12 @@ stats[0] := f_rtpem_stats_get(RTPEM[0]); if (stats[0].num_pkts_rx_err_disabled != 0) { setverdict(fail, "received packets from MGW on recvonly connection"); + mtc.stop; } stats[1] := f_rtpem_stats_get(RTPEM[1]); if (stats[1].num_pkts_rx_err_disabled != 0) { setverdict(fail, "received packets from MGW on recvonly connection"); + mtc.stop; } /* The second leg starts transmitting a little later */ @@ -1084,10 +1099,12 @@ stats[0] := f_rtpem_stats_get(RTPEM[0]); if (stats[0].num_pkts_rx_err_disabled != 0) { setverdict(fail, "received packets from MGW on recvonly connection"); + mtc.stop; } stats[1] := f_rtpem_stats_get(RTPEM[1]); if (stats[1].num_pkts_rx_err_disabled != 0) { setverdict(fail, "received packets from MGW on recvonly connection"); + mtc.stop; } /* The first leg will now be switched into bidirectional @@ -1097,10 +1114,12 @@ stats[0] := f_rtpem_stats_get(RTPEM[0]); if (stats[1].num_pkts_rx_err_disabled != 0) { setverdict(fail, "received packets from MGW on recvonly connection"); + mtc.stop; } stats[1] := f_rtpem_stats_get(RTPEM[1]); if (stats[1].num_pkts_rx_err_disabled != 0) { setverdict(fail, "received packets from MGW on recvonly connection"); + mtc.stop; } /* When the second leg is switched into bidirectional mode @@ -1122,11 +1141,13 @@ temp := stats[0].num_pkts_tx - num_pkts_tx[0] - stats[1].num_pkts_rx; if (temp > 3 or temp < -3) { setverdict(fail, "number of packets not within normal parameters"); + mtc.stop; } temp := stats[1].num_pkts_tx - num_pkts_tx[1] - stats[0].num_pkts_rx; if (temp > 3 or temp < -3) { setverdict(fail, "number of packets not within normal parameters"); + mtc.stop; } /* Tear down */ @@ -1177,6 +1198,7 @@ stats[1] := f_rtpem_stats_get(RTPEM[1]); if (not f_rtpem_stats_compare(stats[0], stats[1])) { setverdict(fail, "RTP endpoint statistics don't match"); + mtc.stop; } setverdict(pass); @@ -1234,10 +1256,12 @@ stats[1] := f_rtpem_stats_get(RTPEM[1]); if (not f_rtpem_stats_compare(stats[0], stats[1], 5)) { setverdict(fail, "RTP endpoint statistics don't match"); + mtc.stop; } stats[2] := f_rtpem_stats_get(RTPEM[2]); if (stats[2].num_pkts_rx_err_disabled != 0) { setverdict(fail, "received packets on old leg after handover"); + mtc.stop; } setverdict(pass); diff --git a/mgw/RTP_Endpoint.ttcn b/mgw/RTP_Endpoint.ttcn index 3c939a2..c73aa58 100644 --- a/mgw/RTP_Endpoint.ttcn +++ b/mgw/RTP_Endpoint.ttcn @@ -111,7 +111,7 @@ sub.local_name, sub.local_port, sub.connection_id, { udp := {} }); if (not ispresent(res.connId)) { setverdict(fail, "Could not connect RTP, check your configuration"); - self.stop; + mtc.stop; } /* connect without previous bind: save conenction id allocated by IPL4asp */ if (sub.connection_id == -1) { @@ -136,7 +136,7 @@ res := f_IPL4_listen(RTP, sub.local_name, sub.local_port, { udp := {} }); if (not ispresent(res.connId)) { setverdict(fail, "Could not listen to RTP, check your configuration"); - self.stop; + mtc.stop; } sub.connection_id := res.connId; } diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn index 803cb4d..4e02d6c 100644 --- a/msc/BSC_ConnectionHandler.ttcn +++ b/msc/BSC_ConnectionHandler.ttcn @@ -109,7 +109,7 @@ private altstep as_Tguard() runs on BSC_ConnHdlr { [] g_Tguard.timeout { setverdict(fail, "Tguard timeout"); - self.stop; + mtc.stop; } } @@ -183,7 +183,7 @@ [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_CONF_IND) {} [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) { setverdict(fail, "DISC.ind from SCCP"); - self.stop; + mtc.stop; } } } @@ -294,7 +294,7 @@ } [] BSSAP.receive(tr_BSSMAP_CipherModeCmd(?, g_pars.vec.kc)) { setverdict(fail, "Wrong ciphering algorithm mask in CiphModCmd"); - self.stop; + mtc.stop; } } /* FIXME: Send the best available algorithm */ @@ -331,7 +331,7 @@ if (not ispresent(lu_acc.mobileIdentityTLV) or not ischosen(lu_acc.mobileIdentityTLV.mobileIdentityLV.mobileIdentityV.oddEvenInd_identity.tmsi_ptmsi)) { setverdict(fail, "Expected TMSI but no TMSI was allocated"); - self.stop; + mtc.stop; } else { g_pars.tmsi := lu_acc.mobileIdentityTLV.mobileIdentityLV.mobileIdentityV.oddEvenInd_identity.tmsi_ptmsi.octets; BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_TmsiRealloc_Cmpl)); @@ -340,13 +340,13 @@ if (ispresent(lu_acc.mobileIdentityTLV) and ischosen(lu_acc.mobileIdentityTLV.mobileIdentityLV.mobileIdentityV.oddEvenInd_identity.tmsi_ptmsi)) { setverdict(fail, "Expected no TMSI but TMSI was allocated"); - self.stop; + mtc.stop; } } } [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) { setverdict(fail, "Expected LU ACK, but received LU REJ"); - self.stop; + mtc.stop; } } /* FIXME: there could be pending SMS or other common procedures by the MSC, let's ignore them */ @@ -695,7 +695,7 @@ [] MNCC.receive(tr_MNCC_START_DTMF_ind(cpars.mncc_callref, "2")) {} [] T.timeout { setverdict(fail, "Timeout waiting for START_DTMF_ind"); - self.stop; + mtc.stop; } } @@ -704,7 +704,7 @@ alt { [] MNCC.receive(tr_MNCC_START_DTMF_ind(cpars.mncc_callref, "2")) { setverdict(fail, "Received duplicate START_DTMF_ind"); - self.stop; + mtc.stop; } [] T.timeout { } } @@ -716,7 +716,7 @@ [] MNCC.receive(tr_MNCC_START_DTMF_ind(cpars.mncc_callref, "3")) { } [] T.timeout { setverdict(fail, "Received duplicate START_DTMF_ind"); - self.stop; + mtc.stop; } } @@ -732,13 +732,13 @@ } [] BSSAP.receive { setverdict(fail, "Unexpected BSSMAP while waiting for SCCP Release"); - self.stop; + mtc.stop; } } } [] BSSAP.receive { setverdict(fail, "Unexpected BSSMAP while waiting for ClearCommand"); - self.stop; + mtc.stop; } } @@ -750,7 +750,7 @@ [] as_clear_cmd_compl_disc(t) { } [] T.timeout { setverdict(fail, "Timeout waiting for ClearCommand/Release"); - self.stop; + mtc.stop; } } } @@ -808,7 +808,7 @@ private altstep as_other_sms() runs on BSC_ConnHdlr { [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_SMS(?, ?, ?), ?)) { setverdict(fail, "Unexpected SMS related PDU from MSC"); - self.stop; + mtc.stop; } } diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index dc3ad1e..a2e000a 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -133,7 +133,7 @@ private altstep as_Tguard_direct() runs on MTC_CT { [] Tguard_direct.timeout { setverdict(fail, "Tguard timeout"); - self.stop; + mtc.stop; } } @@ -213,7 +213,7 @@ [] GSUP_IPA_EVENT.receive(t_ASP_IPA_EVT_UD(ASP_IPA_EVENT_UP)) { } [] T.timeout { setverdict(fail, "No connection to GSUP Port"); - self.stop + mtc.stop } } } @@ -226,7 +226,7 @@ g_initialized := true; if (num_bsc > NUM_BSC) { - setverdict(fail, "excess number of BSC instances requested"); + testcase.stop("excess number of BSC instances requested"); } for (var integer i := 0; i < num_bsc; i := i + 1) { @@ -234,7 +234,7 @@ f_bssap_init(g_bssap[i], mp_bssap_cfg[i], "MSC_Test_" & int2str(i), BSC_BssmapOps); f_bssap_start(g_bssap[i]); } else { - setverdict(fail, "missing BSSAP configuration"); + testcase.stop("missing BSSAP configuration"); } } @@ -529,7 +529,7 @@ } [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Acc)) { setverdict(fail, "Expecting LU REJ, but got ACCEPT"); - self.stop; + mtc.stop; } } f_expect_clear(); @@ -558,7 +558,7 @@ } [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Acc)) { setverdict(fail, "Expecting LU REJ, but got ACCEPT"); - self.stop; + mtc.stop; } } f_expect_clear(); @@ -605,11 +605,18 @@ alt { [] BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ)) { } //[] BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_ACC)) { } - [] BSSAP.receive { setverdict(fail, "Received unexpected BSSAP"); } + [] BSSAP.receive { + setverdict(fail, "Received unexpected BSSAP"); + mtc.stop; + } [] GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)) { setverdict(fail, "Unexpected GSUP UL REQ"); + mtc.stop; } - [] T.timeout { setverdict(fail, "Timeout waiting for CM SERV REQ"); } + [] T.timeout { + setverdict(fail, "Timeout waiting for CM SERV REQ"); + mtc.stop; + } } f_expect_clear(); @@ -730,6 +737,7 @@ /* See https://osmocom.org/issues/2862 */ [] BSSAP.receive(tr_BSSMAP_ClearCommand) { setverdict(fail, "Got a second Clear Command, only one expected"); + mtc.stop; repeat; } [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {} @@ -840,6 +848,7 @@ } [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) { setverdict(fail, "Expected LU ACK, but received REJ"); + mtc.stop; } } @@ -1127,7 +1136,7 @@ [] as_clear_cmd_compl_disc(); [] T.timeout { setverdict(fail, "Timeout waiting for ClearCommand or SCCP Release"); - self.stop; + mtc.stop; } } setverdict(pass); @@ -1161,7 +1170,7 @@ [] as_clear_cmd_compl_disc(); [] T.timeout { setverdict(fail, "Timeout waiting for ClearCommand or SCCP Release"); - self.stop; + mtc.stop; } } setverdict(pass); @@ -1305,7 +1314,10 @@ timer T := 30.0; T.start; alt { - [] T.timeout { setverdict(fail, "Timeout waiting for channel release"); self.stop; } + [] T.timeout { + setverdict(fail, "Timeout waiting for channel release"); + mtc.stop; + } [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_RELEASE(cpars.transaction_id))) { BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_REL_COMPL(cpars.transaction_id))); repeat; @@ -1317,7 +1329,10 @@ * the current implementation, there is no recovery mechanism implemented * and a DLCX can not be performed as the MSC does not know a specific * endpoint yet. */ - [] MGCP.receive { setverdict(fail, "Unexpected MGCP message"); self.stop; } + [] MGCP.receive { + setverdict(fail, "Unexpected MGCP message"); + mtc.stop; + } [] as_clear_cmd_compl_disc(); } } @@ -1405,7 +1420,10 @@ timer T := 30.0; T.start; alt { - [] T.timeout { setverdict(fail, "Timeout waiting for channel release"); self.stop; } + [] T.timeout { + setverdict(fail, "Timeout waiting for channel release"); + mtc.stop; + } [] BSSAP.receive { repeat; } [] MNCC.receive { repeat; } [] GSUP.receive { repeat; } @@ -1449,7 +1467,10 @@ timer T := 190.0; T.start; alt { - [] T.timeout { setverdict(fail, "Timeout waiting for T310"); self.stop; } + [] T.timeout { + setverdict(fail, "Timeout waiting for T310"); + mtc.stop; + } [] MNCC.receive(tr_MNCC_DISC_ind(cpars.mncc_callref)) { MNCC.send(ts_MNCC_REL_req(cpars.mncc_callref, valueof(ts_MNCC_cause(23)))); } @@ -1496,7 +1517,7 @@ [] GSUP.receive(tr_GSUP_CL_RES(g_pars.imsi)) { } [] GSUP.receive(tr_GSUP_CL_ERR(g_pars.imsi)) { setverdict(fail, "Received GSUP Location Cancel Error"); - self.stop; + mtc.stop; } } @@ -1508,7 +1529,7 @@ [] BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ)) { } [] BSSAP.receive { setverdict(fail, "Received unexpected BSSAP instead of CM SERV REJ"); - self.stop; + mtc.stop; } } setverdict(pass); @@ -1581,11 +1602,11 @@ } [] BSSAP.receive(tr_BSSMAP_CipherModeCmd(?,?)) { setverdict(fail, "CipherModeCommand despite no A5 intersection"); - self.stop; + mtc.stop; } [] BSSAP.receive { setverdict(fail, "Unknown/unexpected BSSAP received"); - self.stop; + mtc.stop; } } setverdict(pass); @@ -1648,11 +1669,11 @@ } [] BSSAP.receive(tr_BSSMAP_CipherModeCmd(?,?)) { setverdict(fail, "CipherModeCommand despite no A5 intersection"); - self.stop; + mtc.stop; } [] BSSAP.receive { setverdict(fail, "Unknown/unexpected BSSAP received"); - self.stop; + mtc.stop; } } setverdict(pass); @@ -1764,6 +1785,7 @@ [reset_ack_seen == true] T.timeout { setverdict(pass) } [reset_ack_seen == false] T.timeout { setverdict(fail, "no BSSMAP RESET ACK seen!"); + mtc.stop; } } } @@ -1999,7 +2021,7 @@ case ('110'B) { return abbreviated; } } setverdict(fail, "Unknown TON ", ton); - self.stop; + mtc.stop; } /* convert GSM L3 NPI to SMPP_NPI enum */ function f_sm_npi_from_gsm(BIT4 npi) return SMPP_NPI { @@ -2014,7 +2036,7 @@ case ('1010'B) { return ermes; } } setverdict(fail, "Unknown NPI ", npi); - self.stop; + mtc.stop; } /* build a SMPP_SM from SmsParameters */ @@ -2154,7 +2176,7 @@ } [] BSSAP.receive { setverdict(fail, "Unknown/unexpected BSSAP received"); - self.stop; + mtc.stop; } } @@ -2217,7 +2239,7 @@ } [] BSSAP.receive { setverdict(fail, "Unknown/unexpected BSSAP received"); - self.stop; + mtc.stop; } } diff --git a/pcu/GPRS_TBF.ttcn b/pcu/GPRS_TBF.ttcn index 3e8658e..951cf4a 100644 --- a/pcu/GPRS_TBF.ttcn +++ b/pcu/GPRS_TBF.ttcn @@ -121,7 +121,7 @@ var integer idx := n - us.et.v_a; if (idx < 0 or idx > lengthof(us.et.v_b)) { setverdict(fail, "UlTbf: Cannot ACK ", n, " while V(A) is ", us.et.v_a); - self.stop; + mtc.stop; } /* set the bit in the acknowledge state array */ us.et.v_b[idx] := '1'B; @@ -411,7 +411,7 @@ function f_dl_tbf_is_in_window(integer bsn) return boolean { setverdict(fail, "pleaes implement me"); - self.stop; + mtc.stop; } function f_dl_tbf_is_received(inout DlTbfState ds, integer bsn) return boolean { @@ -471,7 +471,7 @@ var integer bsn := db.mac_hdr.hdr_ext.bsn; if (db.mac_hdr.hdr_ext.tfi != ds.tfi) { setverdict(fail, "Unexpected TFI of DL Data Block ", db); - self.stop; + mtc.stop; } f_dl_tbf_mark_received(ds, bsn); if (ds.tbf.ack_mode) { @@ -480,7 +480,7 @@ * SNS */ if (bsn < ds.er.v_q or bsn > ds.er.v_q + ds.tbf.ws) { setverdict(fail, "Unexpected BSN outside of window ", bsn); - self.stop; + mtc.stop; } /* In RLC acknowledged mode, the value of V(Q) shall be updated when the RLC diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn index 6e36f68..dfd380d 100644 --- a/pcu/PCU_Tests.ttcn +++ b/pcu/PCU_Tests.ttcn @@ -131,7 +131,8 @@ log("NS Expected: ", b); if (a != b) { - setverdict(fail); + setverdict(fail, "Values mismatch", a, b); + mtc.stop; } else { setverdict(pass); } @@ -188,7 +189,10 @@ alt { [] BSSGP.receive(t_BssgpStsInd(?, ?, BVC_S_UNBLOCKED)) { } [] BSSGP.receive { repeat; } - [] T.timeout { setverdict(fail); } + [] T.timeout { + setverdict(fail, "Timeout establishing BSSGP connection"); + mtc.stop; + } } T.stop log("BSSGP successfully initialized"); @@ -233,7 +237,7 @@ [] L1.receive { repeat; } [] T.timeout { setverdict(fail, "Timeout establishing UL TBF"); - self.stop; + mtc.stop; } } T.stop; @@ -275,6 +279,7 @@ } [] T.timeout { setverdict(fail, "Timeout waiting for ", bd_exp); + mtc.stop; } } } @@ -365,7 +370,8 @@ log("LLC Expected: ", b); if (a != b) { - setverdict(fail); + setverdict(fail, "LLC input ", b, " != expected ", a); + mtc.stop; } else { setverdict(pass); } @@ -437,7 +443,10 @@ log("Dec: ", udb); var octetstring enc := enc_RlcmacUlBlock(udb); log("Enc: ", enc); - if (enc != buf) { setverdict(fail, "Re-encoded data doesn't equal input data"); } + if (enc != buf) { + setverdict(fail, "Re-encoded data doesn't equal input data"); + mtc.stop; + } } function f_rlcmac_uld_decenc(in octetstring buf) { @@ -447,7 +456,10 @@ log("Dec: ", udb); var octetstring enc := enc_RlcmacUlDataBlock(udb); log("Enc: ", enc); - if (enc != buf) { setverdict(fail, "Re-encoded data doesn't equal input data"); } + if (enc != buf) { + setverdict(fail, "Re-encoded data doesn't equal input data"); + mtc.stop; + } } function f_rlcmac_dld_decenc(in octetstring buf) { @@ -457,7 +469,10 @@ log("Dec: ", udb); var octetstring enc := enc_RlcmacDlDataBlock(udb); log("Enc: ", enc); - if (enc != buf) { setverdict(fail, "Re-encoded data doesn't equal input data"); } + if (enc != buf) { + setverdict(fail, "Re-encoded data doesn't equal input data"); + mtc.stop; + } } @@ -561,7 +576,7 @@ [] L1.receive { repeat }; [] T.timeout { setverdict(fail, "Timeout waiting for IMM ASS") - self.stop; + mtc.stop; } } T.stop; diff --git a/selftest/Selftest.ttcn b/selftest/Selftest.ttcn index 826d244..8411b3d 100644 --- a/selftest/Selftest.ttcn +++ b/selftest/Selftest.ttcn @@ -57,7 +57,7 @@ res := IPL4asp_PortType.f_IPL4_connect(IP, "127.0.0.1", 55555, "", -1,-1, {tcp:={}}); if (not ispresent(res.connId)) { setverdict(fail, "Could not connect to TCP port, check your configuration"); - self.stop; + mtc.stop; } g_ip_conn_id := res.connId; } diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 017c724..91edf24 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -133,7 +133,7 @@ [] GSUP_IPA_EVENT.receive(t_ASP_IPA_EVT_UD(ASP_IPA_EVENT_UP)) { } [] T.timeout { setverdict(fail, "No connection to GSUP Port"); - self.stop; + mtc.stop; } } } @@ -230,7 +230,7 @@ private altstep as_Tguard() runs on BSSGP_ConnHdlr { [] g_Tguard.timeout { setverdict(fail, "Tguard timeout"); - self.stop; + mtc.stop; } } @@ -375,19 +375,19 @@ if (not (g_pars.bssgp_cell_id.ra_id.lai.mcc_mnc == aa_plmn)) { setverdict(fail, "mismatching PLMN in Attach Accept: " & hex2str(aa_plmn) & "; expected " & hex2str(g_pars.bssgp_cell_id.ra_id.lai.mcc_mnc)); - self.stop; + mtc.stop; } g_pars.ra := aa.routingAreaIdentification; if (ispresent(aa.allocatedPTMSI)) { if (not g_pars.net.expect_ptmsi) { setverdict(fail, "unexpected P-TMSI allocation"); - self.stop; + mtc.stop; } f_upd_ptmsi_and_tlli(aa.allocatedPTMSI.mobileIdentityLV.mobileIdentityV.oddEvenInd_identity.tmsi_ptmsi.octets); } if (ispresent(aa.msIdentity)) { setverdict(fail, "unexpected TMSI allocation in non-combined attach"); - self.stop; + mtc.stop; } /* P-TMSI.sig */ if (ispresent(aa.ptmsiSignature)) { @@ -404,13 +404,13 @@ if (ispresent(ra.allocatedPTMSI)) { if (not g_pars.net.expect_ptmsi) { setverdict(fail, "unexpected P-TMSI allocation"); - self.stop; + mtc.stop; } f_upd_ptmsi_and_tlli(ra.allocatedPTMSI.mobileIdentityLV.mobileIdentityV.oddEvenInd_identity.tmsi_ptmsi.octets); } if (ispresent(ra.msIdentity)) { setverdict(fail, "unexpected TMSI allocation in non-combined attach"); - self.stop; + mtc.stop; } /* P-TMSI.sig */ if (ispresent(ra.ptmsiSignature)) { @@ -530,6 +530,7 @@ } [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT(?))) { setverdict(fail, "Wrong Attach Reject Cause"); + mtc.stop; } } } @@ -598,6 +599,7 @@ [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?))) -> value bd { f_process_attach_accept(bd.l3_mt.msgs.gprs_mm.attachAccept); setverdict(fail); + mtc.stop; } } } @@ -627,6 +629,7 @@ [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?))) -> value bd { f_process_attach_accept(bd.l3_mt.msgs.gprs_mm.attachAccept); setverdict(fail); + mtc.stop; } } } @@ -708,6 +711,7 @@ } [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT(*, *, *))) { setverdict(fail); + mtc.stop; } } } @@ -761,6 +765,7 @@ } [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_RAU_REJECT)) { setverdict(fail, "Unexpected RAU Reject"); + mtc.stop; } [] BSSGP.receive { repeat; } } @@ -786,10 +791,12 @@ alt { [not expect_purge] GSUP.receive(tr_GSUP_PURGE_MS_REQ(?)) { setverdict(fail, "Unexpected GSUP PURGE MS for unregistered TLLI"); + mtc.stop; } [power_off] BSSGP.receive(tr_BD_L3_MT(tr_GMM_DET_ACCEPT_MT)) -> value bd { g_pars.ra := omit; setverdict(fail, "Unexpected ATTACH ACCEPT in no-power-off DETACH"); + mtc.stop; /* TODO: check if any PDP contexts are deactivated on network side? */ } [power_off] T.timeout { @@ -913,9 +920,11 @@ } [exp_rej] BSSGP.receive(tr_BD_L3_MT(tr_SM_ACT_PDP_ACCEPT)) { setverdict(fail, "Unexpected PDP CTX ACT ACC"); + mtc.stop; } [not exp_rej] BSSGP.receive(tr_BD_L3_MT(tr_SM_ACT_PDP_REJ(apars.tid, ?))) { setverdict(fail, "Unexpected PDP CTX ACT FAIL"); + mtc.stop; } [not exp_rej] BSSGP.receive(tr_BD_L3_MT(tr_SM_ACT_PDP_ACCEPT(apars.tid, apars.sapi))) { setverdict(pass); @@ -1138,9 +1147,11 @@ } [] GTP.receive(tr_GTPC_MsgType(?, createPDPContextRequest, ?)) { setverdict(fail, "Unexpected GTP PDP CTX ACT"); + mtc.stop; } [] BSSGP.receive(tr_BD_L3_MT(tr_SM_ACT_PDP_ACCEPT(?, ?))) { setverdict(fail, "Unexpected SM PDP CTX ACT ACK"); + mtc.stop; } [] BSSGP.receive { repeat; } } @@ -1266,10 +1277,11 @@ [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_DET_REQ_MT(*, *, *))) { T.stop; setverdict(fail, "Unexpected GMM Detach Request"); + mtc.stop; } [] T.timeout { setverdict(pass); - self.stop; + mtc.stop; } [] BSSGP.receive { repeat; @@ -1411,6 +1423,7 @@ } if (count_req != 5) { setverdict(fail, "Did not received GMM ID Request Type IMEI 5 times!"); + mtc.stop; } setverdict(pass); } @@ -1458,6 +1471,7 @@ } if (count_req != 5) { setverdict(fail, "Did not received GMM ID Request Type IMSI 5 times!"); + mtc.stop; } setverdict(pass); } @@ -1517,6 +1531,7 @@ alt { [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT(?))) { setverdict(fail, "Received unexpected GMM Attach REJECT"); + mtc.stop; } [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT(*, *, *))) -> value bd { f_process_attach_accept(bd.l3_mt.msgs.gprs_mm.attachAccept); @@ -1572,6 +1587,7 @@ } if (count_req != 5) { setverdict(fail, "Did not received GMM Attach Complete."); + mtc.stop; } setverdict(pass); } diff --git a/sip/SIP_Tests.ttcn b/sip/SIP_Tests.ttcn index f690dc7..24b3622 100644 --- a/sip/SIP_Tests.ttcn +++ b/sip/SIP_Tests.ttcn @@ -131,7 +131,7 @@ private altstep as_Tguard() runs on ConnHdlr { [] g_Tguard.timeout { setverdict(fail, "Tguard timeout"); - self.stop; + mtc.stop; } } diff --git a/sysinfo/Test.ttcn b/sysinfo/Test.ttcn index 02a2279..1927e88 100644 --- a/sysinfo/Test.ttcn +++ b/sysinfo/Test.ttcn @@ -139,8 +139,8 @@ /* ensure a given TC slot of the SI vector contains given SI type at least once at TC */ function f_ensure_si_vec_contains(SystemInformationVectorPerTc arr, integer tc, RrMessageType key, boolean ext_bcch := false) { if (not f_si_vecslot_contains(arr[tc], key, ext_bcch)) { - log("Fail: No ", key, " in TC=", tc, "!"); - setverdict(fail); + setverdict(fail), "Fail: No ", key, " in TC=", tc, "!"); + mtc.stop; } } @@ -180,8 +180,8 @@ /* ensure a given TC slot of the SI vector contains given SI type at least N out of M times at TC */ function f_ensure_si_vec_contains_n_of_m(SystemInformationVectorPerTc arr, integer tc, RrMessageType key, boolean ext_bcch := false, integer n, integer m) { if (not f_si_vecslot_contains_n_of_m(arr[tc], key, ext_bcch, n, m)) { - log("Fail: Not ", n, "/", m, " of ", key, " in TC=", tc, "!"); - setverdict(fail); + setverdict(fail, "Fail: Not ", n, "/", m, " of ", key, " in TC=", tc, "!"); + mtc.stop; } } @@ -202,8 +202,8 @@ /* ensure a given TC slot of the SI vector contains only given SI type */ function f_ensure_si_vec_contains_only(SystemInformationVectorPerTc arr, integer tc, RrMessageType key, boolean ext_bcch := false) { if (not f_si_vecslot_contains_only(arr[tc], key, ext_bcch)) { - log("Fail: Not all ", key, " in TC=", tc, "!"); - setverdict(fail); + setverdict(fail, "Fail: Not all ", key, " in TC=", tc, "!"); + mtc.stop; } } @@ -233,6 +233,7 @@ for (i := 0; i < sizeof(si_per_tc); i := i + 1) { if (sizeof(si_per_tc[i]) == 0) { setverdict(fail, "No SI messages for TC=0!"); + mtc.stop; } } if (cfg.si1_present) { @@ -313,6 +314,7 @@ } if (f_si_vec_contains(si_per_tc, SYSTEM_INFORMATION_TYPE_13alt)) { setverdict(fail, "Cannot have SI13alt and SI13"); + mtc.stop; } } if (cfg.si16_present or cfg.si17_present) { @@ -323,6 +325,7 @@ } if (f_si_vec_contains(si_per_tc, SYSTEM_INFORMATION_TYPE_22)) { setverdict(fail, "Cannot have SI16/SI17 and SI22!"); + mtc.stop; } if (not cfg.bcch_extended) { testcase.stop("Error: SI16/SI17 requires BCCH Extd!"); @@ -368,6 +371,7 @@ } if (f_si_vec_contains(si_per_tc, SYSTEM_INFORMATION_TYPE_13)) { setverdict(fail, "Cannot have SI13alt and SI13"); + mtc.stop; } if (not cfg.bcch_extended) { f_ensure_si_vec_contains_n_of_m(si_per_tc, 4, SYSTEM_INFORMATION_TYPE_13alt, false, 1, 4); @@ -399,6 +403,7 @@ f_ensure_si_vec_contains_n_of_m(si_per_tc, 4, SYSTEM_INFORMATION_TYPE_21, true, 1, 4); if (f_si_vecslot_contains(si_per_tc[4], SYSTEM_INFORMATION_TYPE_21)) { setverdict(fail, "Cannot have SI21 on BCCH Norm if BCCH Extd enabled!"); + mtc.stop; } } } @@ -413,6 +418,7 @@ if (f_si_vec_contains(si_per_tc, SYSTEM_INFORMATION_TYPE_16) or f_si_vec_contains(si_per_tc, SYSTEM_INFORMATION_TYPE_17)) { setverdict(fail, "Cannot have SI16/SI17 and SI22!"); + mtc.stop; } if (not cfg.bcch_extended) { testcase.stop("Error: SI22 requires BCCH Extd!"); @@ -484,6 +490,7 @@ var SystemInformation si := f_gsmtap_get_si(pt, msg_type); if (not match(si, t)) { setverdict(fail, "SI ", si, " doesn't match ", t); + mtc.stop; } else { setverdict(pass); } -- To view, visit https://gerrit.osmocom.org/9907 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I9b618235939fa41160b9be6677b121963d3ec857 Gerrit-Change-Number: 9907 Gerrit-PatchSet: 1 Gerrit-Owner: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Sat Jul 7 12:26:47 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Sat, 7 Jul 2018 12:26:47 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-gapk_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#13?= In-Reply-To: <962466005.87.1530880007441.JavaMail.jenkins@jenkins.osmocom.org> References: <962466005.87.1530880007441.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <1605326291.98.1530966407878.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 127.14 KB...] checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether make supports nested variables... (cached) yes checking if gcc supports -fvisibility=hidden... yes checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking whether gcc understands -c and -o together... (cached) yes checking dependency style of gcc... (cached) gcc3 checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for LIBOSMOCORE... yes checking for LIBOSMOCODEC... yes checking for LIBALSA... yes checking for OPENCORE_AMRNB... yes checking gsm/gsm.h usability... yes checking gsm/gsm.h presence... yes checking for gsm/gsm.h... yes checking for gsm_create in -lgsm... yes checking for stdint.h... (cached) yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking for unistd.h... (cached) yes checking for inline... inline checking for int16_t... yes checking for int32_t... yes checking for uint16_t... yes checking for uint32_t... yes checking for uint64_t... yes checking for uint8_t... yes checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... yes checking for memset... yes checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating src/Makefile config.status: creating libgsmhr/Makefile config.status: creating include/Makefile config.status: creating include/gsmhr/Makefile config.status: creating libosmogapk.pc config.status: creating tests/atlocal config.status: creating tests/Makefile config.status: creating config.h config.status: executing depfiles commands config.status: executing libtool commands config.status: executing tests/atconfig commands make[1]: Entering directory ' make all-recursive make[2]: Entering directory ' Making all in include make[3]: Entering directory ' make[4]: Entering directory ' make[4]: Nothing to be done for 'all-am'. make[4]: Leaving directory ' make[3]: Leaving directory ' Making all in src make[3]: Entering directory ' CC procqueue.lo CC pq_format.lo CC pq_codec.lo CC pq_file.lo CC pq_alsa.lo CC pq_rtp.lo CC pq_ecu.lo CC ecu_fr.lo CC formats.lo CC fmt_ti.lo CC fmt_amr.lo CC fmt_gsm.lo CC fmt_hr_ref.lo CC fmt_racal.lo CC fmt_rawpcm.lo CC fmt_rtp_amr.lo CC fmt_rtp_efr.lo CC fmt_rtp_hr_etsi.lo CC fmt_rtp_hr_ietf.lo CC fmt_amr_opencore.lo CC codecs.lo CC codec_pcm.lo CC codec_hr.lo CC codec_fr.lo CC codec_efr.lo CC codec_amr.lo CC benchmark.lo CC common.lo CCLD libosmogapk.la CC app_osmo_gapk.o CCLD osmo-gapk make[3]: Leaving directory ' Making all in tests make[3]: Entering directory ' make[3]: Nothing to be done for 'all'. make[3]: Leaving directory ' make[3]: Entering directory ' make[3]: Nothing to be done for 'all-am'. make[3]: Leaving directory ' make[2]: Leaving directory ' make[1]: Leaving directory ' make[1]: Entering directory ' Making dvi in include make[2]: Entering directory ' make[3]: Entering directory ' make[3]: Nothing to be done for 'dvi-am'. make[3]: Leaving directory ' make[2]: Leaving directory ' Making dvi in src make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi'. make[2]: Leaving directory ' Making dvi in tests make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi'. make[2]: Leaving directory ' make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi-am'. make[2]: Leaving directory ' make[1]: Leaving directory ' make[1]: Entering directory ' Making check in include make[2]: Entering directory ' make[3]: Entering directory ' make[3]: Nothing to be done for 'check-am'. make[3]: Leaving directory ' make[2]: Leaving directory ' Making check in src make[2]: Entering directory ' make[2]: Nothing to be done for 'check'. make[2]: Leaving directory ' Making check in tests make[2]: Entering directory ' make procqueue/pq_test io/pq_file_test io/pq_rtp_test ecu/ecu_fr_test make[3]: Entering directory ' CC procqueue/pq_test.o CCLD procqueue/pq_test CC io/pq_file_test.o CCLD io/pq_file_test CC io/pq_rtp_test.o CCLD io/pq_rtp_test CC ecu/ecu_fr_test.o CCLD ecu/ecu_fr_test make[3]: Leaving directory ' make check-local make[3]: Entering directory ' /bin/bash '../../../tests/testsuite' ## ---------------------------- ## ## gapk 0.4.75-27bc test suite. ## ## ---------------------------- ## Regression tests. 1: procqueue ok 2: io/pq_file FAILED (testsuite.at:13) 3: io/pq_rtp ok 4: ecu/ecu_fr_test ok 5: conv/enc/amr_efr ok 6: conv/enc/gsm ok 7: conv/enc/racal_hr skipped (testsuite.at:58) 8: conv/enc/racal_fr ok 9: conv/enc/racal_efr ok 10: conv/enc/ti_hr skipped (testsuite.at:91) 11: conv/enc/ti_fr ok 12: conv/enc/ti_efr ok 13: conv/enc/rtp_efr ok 14: conv/enc/rtp_hr_etsi skipped (testsuite.at:135) 15: conv/enc/rtp_hr_ietf skipped (testsuite.at:146) 16: conv/dec/amr_efr ok 17: conv/dec/gsm ok 18: conv/dec/racal_hr skipped (testsuite.at:179) 19: conv/dec/racal_fr ok 20: conv/dec/racal_efr ok 21: conv/dec/ti_hr skipped (testsuite.at:212) 22: conv/dec/ti_fr ok 23: conv/dec/ti_efr ok 24: conv/dec/rtp_efr ok 25: conv/dec/rtp_hr_etsi skipped (testsuite.at:256) 26: conv/dec/rtp_hr_ietf skipped (testsuite.at:267) ## ------------- ## ## Test results. ## ## ------------- ## ERROR: 18 tests were run, 1 failed unexpectedly. 8 tests were skipped. ## -------------------------- ## ## testsuite.log was created. ## ## -------------------------- ## Please send `tests/testsuite.log' and all information you think might help: To: Subject: [gapk 0.4.75-27bc] testsuite: 2 failed You may investigate any problem if you feel able to do so, in which case the test suite provides a good starting point. Its output may be found below `tests/testsuite.dir'. Makefile:753: recipe for target 'check-local' failed make[3]: *** [check-local] Error 1 make[3]: Leaving directory ' Makefile:602: recipe for target 'check-am' failed make[2]: *** [check-am] Error 2 make[2]: Leaving directory ' Makefile:479: recipe for target 'check-recursive' failed make[1]: *** [check-recursive] Error 1 make[1]: Leaving directory ' Makefile:684: recipe for target 'distcheck' failed make: *** [distcheck] Error 1 + cat-testlogs.sh ======================== ./gapk-0.4.75-27bc/_build/sub/tests/testsuite.dir/02/testsuite.log # -*- compilation -*- 2. testsuite.at:10: testing io/pq_file ... ../../../tests/testsuite.at:13: $abs_top_builddir/tests/io/pq_file_test \ $abs_top_builddir/tests/io/io_sample.txt --- /dev/null 2018-03-27 19:17:06.212284948 +0000 +++ 2018-07-07 12:26:47.186539778 +0000 @@ -0,0 +1,2 @@ +pq_file_test: ../../../tests/io/pq_file_test.c:132: main: Assertion `sample_file != NULL' failed. +: line 29: 24912 Aborted $abs_top_builddir/tests/io/pq_file_test $abs_top_builddir/tests/io/io_sample.txt --- expout 2018-07-07 12:26:47.174539844 +0000 +++ 2018-07-07 12:26:47.174539844 +0000 @@ -1,12 +0,0 @@ -Processing sample file with blk_len=2: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=4: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=8: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=16: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=32: -8217c8fb7675a95008f9089d883gapk - -chunk null_context: depth=0 ../../../tests/testsuite.at:13: exit code was 134, expected 0 2. testsuite.at:10: 2. io/pq_file (testsuite.at:10): FAILED (testsuite.at:13) Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Sat Jul 7 13:28:52 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Sat, 7 Jul 2018 13:28:52 +0000 Subject: Change in simtrace2[master]: DFU: set stack pointer before starting main app Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9908 Change subject: DFU: set stack pointer before starting main app ...................................................................... DFU: set stack pointer before starting main app The stack size is fixed. The linker script puts the stack section after the bss section. The initial stack pointer is not at the end of the RAM (as often seen). Thus the initial stack pointer address of the main application is different than the one from DFU. When starting the main application the stack pointer needs to be set to the new value. If this is not done the main application stack may overwrite the data in bss, even without exceeding the fixed stack size. Change-Id: Ie354d603fe302d3d5bdfa9c31575411de722323b --- M firmware/libboard/common/source/board_cstartup_gnu.c 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/08/9908/1 diff --git a/firmware/libboard/common/source/board_cstartup_gnu.c b/firmware/libboard/common/source/board_cstartup_gnu.c index 15c70dd..4b561ec 100644 --- a/firmware/libboard/common/source/board_cstartup_gnu.c +++ b/firmware/libboard/common/source/board_cstartup_gnu.c @@ -133,7 +133,11 @@ void (*appReset)(void); pSrc = (unsigned int *) ((unsigned char *)IFLASH_ADDR + BOARD_DFU_BOOT_SIZE); - SCB->VTOR = ((unsigned int)(pSrc)) | (0x0 << 7); + /* set vector table to application vector table (store at the beginning of the application) */ + SCB->VTOR = (unsigned int)(pSrc); + /* set stack pointer to address provided in the beginning of the application (loaded into a register first) */ + __asm__ volatile ("MSR msp,%0" : :"r"(*pSrc)); + /* start application (by jumping to the reset function which address is stored as second entry of the vector table) */ appReset = (void(*)(void))pSrc[1]; g_dfu->state = DFU_STATE_appIDLE; -- To view, visit https://gerrit.osmocom.org/9908 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ie354d603fe302d3d5bdfa9c31575411de722323b Gerrit-Change-Number: 9908 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 7 13:28:53 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Sat, 7 Jul 2018 13:28:53 +0000 Subject: Change in simtrace2[master]: DFU: disable configured console UART before starting main app Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9909 Change subject: DFU: disable configured console UART before starting main app ...................................................................... DFU: disable configured console UART before starting main app The DFU uses the UART peripheral (with IRQ/ISR) for the debug output console. Before starting the main application we should make sure this configuration is reset to avoid interference (particularly the IRQ/ISR). This is not too important though since the main application reconfigures the UART for console output. Other peripheral could also be disabled (e.g. all other PIO used by DFU), but most of them also get configured by the main application. Change-Id: I8234d1b85938ad6393094c08183f613ad09ee01b --- M firmware/libboard/common/include/uart_console.h M firmware/libboard/common/source/board_cstartup_gnu.c M firmware/libboard/common/source/uart_console.c 3 files changed, 19 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/09/9909/1 diff --git a/firmware/libboard/common/include/uart_console.h b/firmware/libboard/common/include/uart_console.h index c48c2c1..0e49bfd 100644 --- a/firmware/libboard/common/include/uart_console.h +++ b/firmware/libboard/common/include/uart_console.h @@ -34,6 +34,7 @@ #include extern void UART_Configure( uint32_t dwBaudrate, uint32_t dwMasterClock ) ; +extern void UART_Exit(void) ; extern void UART_PutChar( uint8_t uc ) ; extern uint32_t UART_GetChar( void ) ; extern uint32_t UART_IsRxReady( void ) ; diff --git a/firmware/libboard/common/source/board_cstartup_gnu.c b/firmware/libboard/common/source/board_cstartup_gnu.c index 4b561ec..42231fb 100644 --- a/firmware/libboard/common/source/board_cstartup_gnu.c +++ b/firmware/libboard/common/source/board_cstartup_gnu.c @@ -173,6 +173,8 @@ * the second entry in the vector table is the reset address, corresponding to the application start */ if (((*((uint32_t*)(IFLASH_ADDR+BOARD_DFU_BOOT_SIZE)))&0xFFFF0000)==0x20000000) { + UART_Exit(); + __disable_irq(); BootIntoApp(); /* Infinite loop */ while ( 1 ) ; diff --git a/firmware/libboard/common/source/uart_console.c b/firmware/libboard/common/source/uart_console.c index a47ba0c..fe64922 100644 --- a/firmware/libboard/common/source/uart_console.c +++ b/firmware/libboard/common/source/uart_console.c @@ -103,6 +103,22 @@ _ucIsConsoleInitialized=1 ; } +/** + * \brief Disables the USART peripheral and related IRQ + */ +void UART_Exit(void) +{ + if (!_ucIsConsoleInitialized) { + return; + } + + Uart *pUart = CONSOLE_UART; + pUart->UART_IDR = UART_IDR_TXRDY; + pUart->UART_CR = UART_CR_RSTRX | UART_CR_RSTTX | UART_CR_RXDIS | UART_CR_TXDIS | UART_CR_RSTSTA; + PMC->PMC_PCDR0 = 1 << CONSOLE_ID; + NVIC_DisableIRQ(CONSOLE_IRQ); +} + /** Interrupt Service routine to transmit queued data */ void CONSOLE_ISR(void) { -- To view, visit https://gerrit.osmocom.org/9909 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I8234d1b85938ad6393094c08183f613ad09ee01b Gerrit-Change-Number: 9909 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 7 13:28:53 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Sat, 7 Jul 2018 13:28:53 +0000 Subject: Change in simtrace2[master]: UART: make IRQ/ISR enabling simpler Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9910 Change subject: UART: make IRQ/ISR enabling simpler ...................................................................... UART: make IRQ/ISR enabling simpler Change-Id: Id3742850eb5bac91559e0c2b4144bd7b1ae5b07b --- M firmware/libboard/common/source/uart_console.c 1 file changed, 4 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/10/9910/1 diff --git a/firmware/libboard/common/source/uart_console.c b/firmware/libboard/common/source/uart_console.c index fe64922..9004197 100644 --- a/firmware/libboard/common/source/uart_console.c +++ b/firmware/libboard/common/source/uart_console.c @@ -150,16 +150,12 @@ } /* Only store input if buffer is not full, else drop it */ - bool trigger_isr = false; - if (rbuf_is_empty(&uart_tx_buffer)) { - trigger_isr = true; - } if (!rbuf_is_full(&uart_tx_buffer)) { rbuf_write(&uart_tx_buffer, c); - } - if (trigger_isr) { - pUart->UART_IER = UART_IER_TXRDY; - CONSOLE_ISR(); + if (!(pUart->UART_IMR & UART_IMR_TXRDY)) { + pUart->UART_IER = UART_IER_TXRDY; + CONSOLE_ISR(); + } } } -- To view, visit https://gerrit.osmocom.org/9910 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id3742850eb5bac91559e0c2b4144bd7b1ae5b07b Gerrit-Change-Number: 9910 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 7 13:28:53 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Sat, 7 Jul 2018 13:28:53 +0000 Subject: Change in simtrace2[master]: UART: remove unused code Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9911 Change subject: UART: remove unused code ...................................................................... UART: remove unused code PutChar already takes care of enabling the IRQ Change-Id: I63af5eba27c9a6f3e23412060028e817e4d9f233 --- M firmware/libboard/common/source/uart_console.c 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/11/9911/1 diff --git a/firmware/libboard/common/source/uart_console.c b/firmware/libboard/common/source/uart_console.c index 9004197..07f41ed 100644 --- a/firmware/libboard/common/source/uart_console.c +++ b/firmware/libboard/common/source/uart_console.c @@ -125,7 +125,6 @@ Uart *uart = CONSOLE_UART; if (uart->UART_SR & UART_SR_TXRDY) { if (!rbuf_is_empty(&uart_tx_buffer)) { - //uart->UART_IER = UART_IER_TXRDY; uart->UART_THR = rbuf_read(&uart_tx_buffer); } else { uart->UART_IDR = UART_IER_TXRDY; -- To view, visit https://gerrit.osmocom.org/9911 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I63af5eba27c9a6f3e23412060028e817e4d9f233 Gerrit-Change-Number: 9911 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 7 13:28:54 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Sat, 7 Jul 2018 13:28:54 +0000 Subject: Change in simtrace2[master]: DFU: re-enable UART after testing forced bootloader Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9912 Change subject: DFU: re-enable UART after testing forced bootloader ...................................................................... DFU: re-enable UART after testing forced bootloader The qmod does not have a separate force button as simtrace has. Instead it check is TX and RX of UART are shorted using PIO. If the pins are not set back to the UART peripheral, the TRACE/debug console output will not work anymore. Change-Id: Id434b49909d6395a2f93a00f39d2d770a5725466 --- M firmware/libboard/qmod/source/board_qmod.c 1 file changed, 20 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/12/9912/1 diff --git a/firmware/libboard/qmod/source/board_qmod.c b/firmware/libboard/qmod/source/board_qmod.c index dd6e616..0eda1ef 100644 --- a/firmware/libboard/qmod/source/board_qmod.c +++ b/firmware/libboard/qmod/source/board_qmod.c @@ -261,20 +261,32 @@ /* Configure UART pins as I/O */ PIO_Configure(uart_loopback_pins, PIO_LISTSIZE(uart_loopback_pins)); + /* Send pattern over UART TX and check if it is received on RX + * If the loop doesn't get interrupted, RxD always follows TxD and thus a + * loopback jumper has been placed on RxD/TxD, and we will boot + * into DFU unconditionally + */ + int has_loopback_jumper = 1; for (i = 0; i < 10; i++) { /* Set TxD high; abort if RxD doesn't go high either */ PIO_Set(&uart_loopback_pins[1]); - if (!PIO_Get(&uart_loopback_pins[0])) - return 0; + if (!PIO_Get(&uart_loopback_pins[0])) { + has_loopback_jumper = 0; + break; + } /* Set TxD low, abort if RxD doesn't go low either */ PIO_Clear(&uart_loopback_pins[1]); - if (PIO_Get(&uart_loopback_pins[0])) - return 0; + if (PIO_Get(&uart_loopback_pins[0])) { + has_loopback_jumper = 0; + break; + } } - /* if we reached here, RxD always follows TxD and thus a - * loopback jumper has been placed on RxD/TxD, and we will boot - * into DFU unconditionally */ - return 1; + + /* Put pins back to UART mode */ + const Pin uart_pins[] = {PINS_UART}; + PIO_Configure(uart_pins, PIO_LISTSIZE(uart_pins)); + + return has_loopback_jumper; } int board_override_enter_dfu(void) -- To view, visit https://gerrit.osmocom.org/9912 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id434b49909d6395a2f93a00f39d2d770a5725466 Gerrit-Change-Number: 9912 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 7 13:28:54 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Sat, 7 Jul 2018 13:28:54 +0000 Subject: Change in simtrace2[master]: DFU: use central DFU override check Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9913 Change subject: DFU: use central DFU override check ...................................................................... DFU: use central DFU override check TRACE_INFO will also provide the DFU start reason, but TRACE_INFO (TRACE_LEVEL >= 4) should only be used for debugging. WARNING: With TRACE_LEVEL >= 4 the DFU binary is over the maximum of 16 kiB allocated for the DFU bootloader. Thus make combined will not boot the main application because its start if after the expecte 16 kiB address; and flashing using DFU will overwrite the DFU bootloader itself. Change-Id: I82323e0f76c03f67df7dc8f2b6783166cc25f3aa --- M firmware/apps/dfu/main.c M firmware/libboard/common/source/board_cstartup_gnu.c 2 files changed, 49 insertions(+), 28 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/13/9913/1 diff --git a/firmware/apps/dfu/main.c b/firmware/apps/dfu/main.c index 26cbb8c..796a13f 100644 --- a/firmware/apps/dfu/main.c +++ b/firmware/apps/dfu/main.c @@ -159,22 +159,32 @@ int USBDFU_OverrideEnterDFU(void) { uint32_t *app_part = (uint32_t *)FLASH_ADDR(0); + /* at the first call we are before the text segment has been relocated, + * so g_dfu is not initialized yet */ + g_dfu = &_g_dfu; + static bool dfu_magic = false; + if (dfu_magic || (!dfu_magic && USB_DFU_MAGIC == g_dfu->magic)) { + dfu_magic = true; + return 1; + } /* If the loopback jumper is set, we enter DFU mode */ - if (board_override_enter_dfu()) - return 1; + if (board_override_enter_dfu()) { + return 2; + } /* if the first word of the application partition doesn't look * like a stack pointer (i.e. point to RAM), enter DFU mode */ - if ((app_part[0] < IRAM_ADDR) || - ((uint8_t *)app_part[0] > IRAM_END)) - return 1; + if ((app_part[0] < IRAM_ADDR) || ((uint8_t *)app_part[0] > IRAM_END)) { + return 3; + } /* if the second word of the application partition doesn't look * like a function from flash (reset vector), enter DFU mode */ if (((uint32_t *)app_part[1] < app_part) || - ((uint8_t *)app_part[1] > IFLASH_END)) - return 1; + ((uint8_t *)app_part[1] > IFLASH_END)) { + return 4; + } return 0; } @@ -218,7 +228,7 @@ EEFC_ReadUniqueID(g_unique_id); - printf("\n\r\n\r" + printf("\n\r\n\r" "=============================================================================\n\r" "DFU bootloader %s for board %s (C) 2010-2017 by Harald Welte\n\r" "=============================================================================\n\r", @@ -230,6 +240,31 @@ g_unique_id[2], g_unique_id[3]); TRACE_INFO("Reset Cause: 0x%x\n\r", reset_cause); +#if (TRACE_LEVEL >= TRACE_LEVEL_INFO) + /* Find out why we are in the DFU bootloader, and not the main application */ + TRACE_INFO("DFU bootloader start reason: "); + switch (USBDFU_OverrideEnterDFU()) { + case 0: + TRACE_INFO_WP("none\n\r"); + break; + case 1: + TRACE_INFO_WP("DFU switch requested by main application\n\r"); + break; + case 2: + TRACE_INFO_WP("bootloader forced (button pressed or jumper set)\n\r"); + break; + case 3: + TRACE_INFO_WP("stack pointer (first application word) does no point in RAM\n\r"); + break; + case 4: // the is no reason + TRACE_INFO_WP("reset vector (second application word) does no point in flash\n\r"); + break; + default: + TRACE_INFO_WP("unknown\n\r"); + break; + } +#endif + /* clear g_dfu on power-up reset */ if (reset_cause == 0) memset(g_dfu, 0, sizeof(*g_dfu)); diff --git a/firmware/libboard/common/source/board_cstartup_gnu.c b/firmware/libboard/common/source/board_cstartup_gnu.c index 42231fb..bfe59ad 100644 --- a/firmware/libboard/common/source/board_cstartup_gnu.c +++ b/firmware/libboard/common/source/board_cstartup_gnu.c @@ -159,26 +159,12 @@ #if defined(BOARD_USB_DFU) && defined(APPLICATION_dfu) - /* we are before the text segment has been relocated, so g_dfu is - * not initialized yet */ - g_dfu = &_g_dfu; - if ((g_dfu->magic != USB_DFU_MAGIC) && !USBDFU_OverrideEnterDFU()) { - /* start application if valid - * the application starts with the vector table - * the first entry in the vector table is the initial stack pointer (SP) address - * the stack will be placed in RAM, which begins at 0x2000 0000 - * there is up to 48 KB of RAM (0xc000) - * since the stack grown "downwards" it should start at the end of the RAM: max 0x2000 c000 - * if the SP is not in this range (e.g. flash has been erased) there is no valid application - * the second entry in the vector table is the reset address, corresponding to the application start - */ - if (((*((uint32_t*)(IFLASH_ADDR+BOARD_DFU_BOOT_SIZE)))&0xFFFF0000)==0x20000000) { - UART_Exit(); - __disable_irq(); - BootIntoApp(); - /* Infinite loop */ - while ( 1 ) ; - } + if (!USBDFU_OverrideEnterDFU()) { + UART_Exit(); + __disable_irq(); + BootIntoApp(); + /* Infinite loop */ + while ( 1 ) ; } #endif -- To view, visit https://gerrit.osmocom.org/9913 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I82323e0f76c03f67df7dc8f2b6783166cc25f3aa Gerrit-Change-Number: 9913 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 7 13:41:22 2018 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sat, 7 Jul 2018 13:41:22 +0000 Subject: Change in openbsc[master]: bsc-nat: ipaccess_auth_bsc: Close bsc conn immediately on bad format ... In-Reply-To: References: Message-ID: Holger Freyther has posted comments on this change. ( https://gerrit.osmocom.org/9510 ) Change subject: bsc-nat: ipaccess_auth_bsc: Close bsc conn immediately on bad format received ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/9510/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/9510/1//COMMIT_MSG at 13 PS1, Line 13: Previously, authentication would still not be accepted but the : connection would be staying alive for a while until id_timeout timer : triggers. Let's close the connection immediately instead, this way BSC : side can see quickly something is wrong with what it is sending. That is because our memcmp is not constant time and I didn't want to build an oracle. ;) -- To view, visit https://gerrit.osmocom.org/9510 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I972961b8967076c56c607f98c2360054144951e4 Gerrit-Change-Number: 9510 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Holger Freyther Gerrit-Comment-Date: Sat, 07 Jul 2018 13:41:22 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 7 13:45:21 2018 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sat, 7 Jul 2018 13:45:21 +0000 Subject: Change in openbsc[master]: bsc-nat: forward_sccp_to_msc: Fix memleak on receive from non authent... In-Reply-To: References: Message-ID: Holger Freyther has posted comments on this change. ( https://gerrit.osmocom.org/9509 ) Change subject: bsc-nat: forward_sccp_to_msc: Fix memleak on receive from non authenticated bsc ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/9509/1/openbsc/src/osmo-bsc_nat/bsc_nat.c File openbsc/src/osmo-bsc_nat/bsc_nat.c: https://gerrit.osmocom.org/#/c/9509/1/openbsc/src/osmo-bsc_nat/bsc_nat.c at a1127 PS1, Line 1127: Are you sure this leaked? The code relied on the parent/child relationship of a talloc context. "parsed" is allocated in the "msg" context. It's still better to explicitly free it. -- To view, visit https://gerrit.osmocom.org/9509 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ifd0c145ff733fdfb2f6fcb32065de99ee951d106 Gerrit-Change-Number: 9509 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Holger Freyther Gerrit-Comment-Date: Sat, 07 Jul 2018 13:45:21 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Sat Jul 7 15:10:06 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Sat, 7 Jul 2018 15:10:06 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-asn1c_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#177?= In-Reply-To: <1068669447.89.1530889806501.JavaMail.jenkins@jenkins.osmocom.org> References: <1068669447.89.1530889806501.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <1936162015.99.1530976206463.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 3.81 KB...] checking target system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for style of include used by make... GNU checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking how to run the C++ preprocessor... g++ -E checking for g77... no checking for f77... no checking for xlf... no checking for frt... no checking for pgf77... no checking for cf77... no checking for fort77... no checking for fl32... no checking for af77... no checking for f90... no checking for xlf90... no checking for pgf90... no checking for pghpf... no checking for epcf90... no checking for gfortran... no checking for g95... no checking for f95... no checking for fort... no checking for xlf95... no checking for ifort... no checking for ifc... no checking for efc... no checking for pgf95... no checking for lf95... no checking for ftn... no checking whether we are using the GNU Fortran 77 compiler... no checking whether accepts -g... no checking the maximum length of command line arguments... 32768 checking command to parse /usr/bin/nm -B output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes configure: creating libtool appending configuration tag "CXX" to libtool checking for ld used by g++... /usr/bin/ld -m elf_x86_64 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC checking if g++ PIC flag -fPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate appending configuration tag "F77" to libtool checking for autoconf... /usr/bin/autoconf checking for autoheader... /usr/bin/autoheader checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking dependency style of gcc... (cached) gcc3 checking how to run the C preprocessor... gcc -E checking for a BSD-compatible install... /usr/bin/install -c checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking for bison... bison -y checking for flex... flex checking for yywrap in -lfl... yes checking lex output file root... lex.yy checking whether yytext is a pointer... yes checking for ar... /usr/bin/ar checking for ANSI C header files... (cached) yes checking sys/param.h usability... yes checking sys/param.h presence... yes checking for sys/param.h... yes checking whether byte ordering is bigendian... no checking for off_t... yes checking for size_t... yes checking whether struct tm is in sys/time.h or time.h... time.h checking for intmax_t... yes checking for library containing getopt... none required checking for strtoimax... yes checking for strtoll... yes checking for mergesort... no checking for mkstemps... yes configure: creating ./config.status config.status: creating skeletons/standard-modules/Makefile config.status: creating skeletons/tests/Makefile config.status: creating libasn1compiler/Makefile config.status: creating libasn1parser/Makefile config.status: creating libasn1print/Makefile config.status: creating asn1c/webcgi/Makefile config.status: creating asn1c/tests/Makefile config.status: creating libasn1fix/Makefile config.status: creating skeletons/Makefile config.status: creating examples/Makefile config.status: creating tests/Makefile config.status: creating asn1c/Makefile config.status: creating doc/Makefile config.status: creating asn1c.spec config.status: creating Makefile config.status: creating config.h config.status: executing depfiles commands + make -j 8 make all-recursive make[1]: Entering directory ' Making all in libasn1parser make[2]: Entering directory ' if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF ".deps/asn1parser.Tpo" -c -o asn1parser.lo asn1parser.c; \ then mv -f ".deps/asn1parser.Tpo" ".deps/asn1parser.Plo"; else rm -f ".deps/asn1parser.Tpo"; exit 1; fi bison -y -p asn1p_ -d asn1p_y.y if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF ".deps/asn1p_l.Tpo" -c -o asn1p_l.lo asn1p_l.c; \ then mv -f ".deps/asn1p_l.Tpo" ".deps/asn1p_l.Plo"; else rm -f ".deps/asn1p_l.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF ".deps/asn1p_module.Tpo" -c -o asn1p_module.lo asn1p_module.c; \ then mv -f ".deps/asn1p_module.Tpo" ".deps/asn1p_module.Plo"; else rm -f ".deps/asn1p_module.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF ".deps/asn1p_oid.Tpo" -c -o asn1p_oid.lo asn1p_oid.c; \ then mv -f ".deps/asn1p_oid.Tpo" ".deps/asn1p_oid.Plo"; else rm -f ".deps/asn1p_oid.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF ".deps/asn1p_value.Tpo" -c -o asn1p_value.lo asn1p_value.c; \ then mv -f ".deps/asn1p_value.Tpo" ".deps/asn1p_value.Plo"; else rm -f ".deps/asn1p_value.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF ".deps/asn1p_expr.Tpo" -c -o asn1p_expr.lo asn1p_expr.c; \ then mv -f ".deps/asn1p_expr.Tpo" ".deps/asn1p_expr.Plo"; else rm -f ".deps/asn1p_expr.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF ".deps/asn1p_xports.Tpo" -c -o asn1p_xports.lo asn1p_xports.c; \ then mv -f ".deps/asn1p_xports.Tpo" ".deps/asn1p_xports.Plo"; else rm -f ".deps/asn1p_xports.Tpo"; exit 1; fi asn1p_y.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] mkdir .libs mkdir .libs mkdir .libs mkdir: cannot create directory '.libs': File exists mkdir: cannot create directory '.libs': File exists gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -fPIC -DPIC -o .libs/asn1p_oid.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -fPIC -DPIC -o .libs/asn1parser.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -fPIC -DPIC -o .libs/asn1p_xports.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -fPIC -DPIC -o .libs/asn1p_module.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -fPIC -DPIC -o .libs/asn1p_l.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -fPIC -DPIC -o .libs/asn1p_value.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -fPIC -DPIC -o .libs/asn1p_expr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -o asn1p_xports.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -o asn1p_module.o >/dev/null 2>&1 asn1p_l.c:3521:12: warning: 'input' defined but not used [-Wunused-function] static int input() ^~~~~ gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -o asn1p_oid.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -o asn1parser.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF ".deps/asn1p_constr.Tpo" -c -o asn1p_constr.lo asn1p_constr.c; \ then mv -f ".deps/asn1p_constr.Tpo" ".deps/asn1p_constr.Plo"; else rm -f ".deps/asn1p_constr.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -o asn1p_expr.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF ".deps/asn1p_param.Tpo" -c -o asn1p_param.lo asn1p_param.c; \ then mv -f ".deps/asn1p_param.Tpo" ".deps/asn1p_param.Plo"; else rm -f ".deps/asn1p_param.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -o asn1p_value.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF ".deps/asn1p_class.Tpo" -c -o asn1p_class.lo asn1p_class.c; \ then mv -f ".deps/asn1p_class.Tpo" ".deps/asn1p_class.Plo"; else rm -f ".deps/asn1p_class.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF ".deps/asn1p_ref.Tpo" -c -o asn1p_ref.lo asn1p_ref.c; \ then mv -f ".deps/asn1p_ref.Tpo" ".deps/asn1p_ref.Plo"; else rm -f ".deps/asn1p_ref.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -fPIC -DPIC -o .libs/asn1p_constr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -fPIC -DPIC -o .libs/asn1p_param.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -fPIC -DPIC -o .libs/asn1p_class.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -o asn1p_constr.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -fPIC -DPIC -o .libs/asn1p_ref.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -o asn1p_param.o >/dev/null 2>&1 if test -f y.tab.h; then \ to=`echo "asn1p_y_H" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \ sed -e "/^#/!b" -e "s/Y_TAB_H/$to/g" -e "s|y\.tab\.h|asn1p_y.h|" \ y.tab.h >asn1p_y.ht; \ rm -f y.tab.h; \ if cmp -s asn1p_y.ht asn1p_y.h; then \ rm -f asn1p_y.ht ;\ else \ mv asn1p_y.ht asn1p_y.h; \ fi; \ fi if test -f y.output; then \ mv y.output asn1p_y.output; \ fi sed '/^#/ s|y\.tab\.c|asn1p_y.c|' y.tab.c >asn1p_y.ct && mv asn1p_y.ct asn1p_y.c rm -f y.tab.c if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF ".deps/asn1p_y.Tpo" -c -o asn1p_y.lo asn1p_y.c; \ then mv -f ".deps/asn1p_y.Tpo" ".deps/asn1p_y.Plo"; else rm -f ".deps/asn1p_y.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -o asn1p_class.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -o asn1p_ref.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF .deps/asn1p_y.Tpo -c asn1p_y.c -fPIC -DPIC -o .libs/asn1p_y.o asn1p_y.y: In function 'asn1p_parse': asn1p_y.y:357:13: error: 'param' undeclared (first use in this function) *(void **)param = $1; ^~~~~ asn1p_y.y:357:13: note: each undeclared identifier is reported only once for each function it appears in gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -o asn1p_l.o >/dev/null 2>&1 Makefile:299: recipe for target 'asn1p_y.lo' failed make[2]: *** [asn1p_y.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory ' Makefile:302: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory ' Makefile:212: recipe for target 'all' failed make: *** [all] Error 2 Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Sat Jul 7 15:34:16 2018 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sat, 7 Jul 2018 15:34:16 +0000 Subject: Change in osmo-gsm-tester[master]: ms: Quit early when all tests concluded.. In-Reply-To: References: Message-ID: Hello Pau Espin Pedrol, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9716 to look at the new patch set (#3). Change subject: ms: Quit early when all tests concluded.. ...................................................................... ms: Quit early when all tests concluded.. And fix the the detection if everything has completed. Change-Id: I3575ee7618c35e3b66d25fa31844d267489d9179 --- M src/osmo_ms_driver/location_update_test.py 1 file changed, 11 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/16/9716/3 -- To view, visit https://gerrit.osmocom.org/9716 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3575ee7618c35e3b66d25fa31844d267489d9179 Gerrit-Change-Number: 9716 Gerrit-PatchSet: 3 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 7 15:46:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 7 Jul 2018 15:46:32 +0000 Subject: Change in osmo-msc[master]: configure.ac: drop unused dependencies In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9751 ) Change subject: configure.ac: drop unused dependencies ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9751 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I82083c33b0448113c74b21ed6c51cda121bc9f79 Gerrit-Change-Number: 9751 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Sat, 07 Jul 2018 15:46:32 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 7 15:46:33 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 7 Jul 2018 15:46:33 +0000 Subject: Change in osmo-msc[master]: configure.ac: drop unused dependencies In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9751 ) Change subject: configure.ac: drop unused dependencies ...................................................................... configure.ac: drop unused dependencies Change-Id: I82083c33b0448113c74b21ed6c51cda121bc9f79 --- M configure.ac 1 file changed, 0 insertions(+), 12 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/configure.ac b/configure.ac index c02b74d..be66d51 100644 --- a/configure.ac +++ b/configure.ac @@ -34,10 +34,6 @@ AC_MSG_ERROR([Please install autoconf-archive; re-run 'autoreconf -fi' for it to take effect.]) ]) -dnl checks for libraries -AC_SEARCH_LIBS([dlopen], [dl dld], [LIBRARY_DL="$LIBS";LIBS=""]) -AC_SUBST(LIBRARY_DL) - PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.11.0) PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.11.0) @@ -104,14 +100,6 @@ AC_HEADER_STDC AC_CHECK_HEADERS(dbi/dbd.h,,AC_MSG_ERROR(DBI library is not installed)) -found_pcap=yes -AC_CHECK_HEADERS(pcap/pcap.h,,found_pcap=no) -AM_CONDITIONAL(HAVE_PCAP, test "$found_pcap" = yes) - -found_cdk=yes -AC_CHECK_HEADERS(cdk/cdk.h,,found_cdk=no) -AM_CONDITIONAL(HAVE_LIBCDK, test "$found_cdk" = yes) - found_sqlite3=yes PKG_CHECK_MODULES(SQLITE3, sqlite3, ,found_sqlite3=no) AM_CONDITIONAL(HAVE_SQLITE3, test "$found_sqlite3" = yes) -- To view, visit https://gerrit.osmocom.org/9751 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I82083c33b0448113c74b21ed6c51cda121bc9f79 Gerrit-Change-Number: 9751 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 7 15:47:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 7 Jul 2018 15:47:29 +0000 Subject: Change in simtrace2[master]: DFU: disable configured console UART before starting main app In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9909 ) Change subject: DFU: disable configured console UART before starting main app ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9909 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8234d1b85938ad6393094c08183f613ad09ee01b Gerrit-Change-Number: 9909 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Sat, 07 Jul 2018 15:47:29 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 7 15:48:02 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 7 Jul 2018 15:48:02 +0000 Subject: Change in simtrace2[master]: UART: make IRQ/ISR enabling simpler In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9910 ) Change subject: UART: make IRQ/ISR enabling simpler ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9910 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id3742850eb5bac91559e0c2b4144bd7b1ae5b07b Gerrit-Change-Number: 9910 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Sat, 07 Jul 2018 15:48:02 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 7 15:48:10 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 7 Jul 2018 15:48:10 +0000 Subject: Change in simtrace2[master]: UART: remove unused code In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9911 ) Change subject: UART: remove unused code ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9911 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I63af5eba27c9a6f3e23412060028e817e4d9f233 Gerrit-Change-Number: 9911 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Sat, 07 Jul 2018 15:48:10 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 7 15:48:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 7 Jul 2018 15:48:54 +0000 Subject: Change in simtrace2[master]: DFU: re-enable UART after testing forced bootloader In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9912 ) Change subject: DFU: re-enable UART after testing forced bootloader ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9912 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id434b49909d6395a2f93a00f39d2d770a5725466 Gerrit-Change-Number: 9912 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Sat, 07 Jul 2018 15:48:54 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Sat Jul 7 16:06:37 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Sat, 7 Jul 2018 16:06:37 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_mast?= =?UTF-8?Q?er-osmo-mgw_=C2=BB_--enable-mgcp-tr?= =?UTF-8?Q?anscoding,a2=3Ddefault,a3=3Ddefaul?= =?UTF-8?Q?t,osmocom-master-debian9_#1089?= Message-ID: <1040826328.100.1530979597173.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 19.47 KB...] /bin/mkdir -p '/build/deps/install/stow/libosmocore/include/osmocom/codec' /usr/bin/install -c -m 644 osmocom/codec/ecu.h osmocom/codec/codec.h osmocom/codec/gsm610_bits.h '/build/deps/install/stow/libosmocore/include/osmocom/codec' make[4]: Leaving directory '/build/deps/libosmocore/include' make[3]: Leaving directory '/build/deps/libosmocore/include' make[2]: Leaving directory '/build/deps/libosmocore/include' Making install in src make[2]: Entering directory '/build/deps/libosmocore/src' GEN crc8gen.c GEN crc32gen.c GEN crc64gen.c GEN crc16gen.c make install-am make[3]: Entering directory '/build/deps/libosmocore/src' CC timer.lo CC select.lo CC timer_clockgettime.lo CC timer_gettimeofday.lo CC signal.lo CC msgb.lo CC bits.lo CC bitvec.lo CC bitcomp.lo CC counter.lo CC fsm.lo CC write_queue.lo CC utils.lo CC socket.lo CC logging.lo CC logging_syslog.lo CC logging_gsmtap.lo CC rate_ctr.lo CC gsmtap_util.lo CC crc16.lo CC panic.lo CC backtrace.lo CC conv.lo CC application.lo CC rbtree.lo CC strrb.lo CC loggingrb.lo CC crc8gen.lo CC crc16gen.lo CC crc32gen.lo CC crc64gen.lo CC macaddr.lo CC stat_item.lo CC stats.lo CC stats_statsd.lo CC prim.lo CC conv_acc.lo CC conv_acc_generic.lo CC sercomm.lo CC prbs.lo CC isdnhdlc.lo CC conv_acc_sse.lo CC conv_acc_sse_avx.lo CC plugin.lo CC msgfile.lo CC serial.lo CCLD libosmocore.la make[4]: Entering directory '/build/deps/libosmocore/src' make[4]: Nothing to be done for 'install-data-am'. /bin/mkdir -p '/build/deps/install/stow/libosmocore/lib' /bin/bash ../libtool --mode=install /usr/bin/install -c libosmocore.la '/build/deps/install/stow/libosmocore/lib' libtool: install: /usr/bin/install -c .libs/libosmocore.so.10.0.0 /build/deps/install/stow/libosmocore/lib/libosmocore.so.10.0.0 libtool: install: (cd /build/deps/install/stow/libosmocore/lib && { ln -s -f libosmocore.so.10.0.0 libosmocore.so.10 || { rm -f libosmocore.so.10 && ln -s libosmocore.so.10.0.0 libosmocore.so.10; }; }) libtool: install: (cd /build/deps/install/stow/libosmocore/lib && { ln -s -f libosmocore.so.10.0.0 libosmocore.so || { rm -f libosmocore.so && ln -s libosmocore.so.10.0.0 libosmocore.so; }; }) libtool: install: /usr/bin/install -c .libs/libosmocore.lai /build/deps/install/stow/libosmocore/lib/libosmocore.la libtool: finish: PATH="/usr/local/bin:/usr/bin:/bin:/usr/games:/home/osmocom-build/bin:/build_bin:/sbin" ldconfig -n /build/deps/install/stow/libosmocore/lib ---------------------------------------------------------------------- Libraries have been installed in: /build/deps/install/stow/libosmocore/lib If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the `-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the `LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the `LD_RUN_PATH' environment variable during linking - use the `-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to `/etc/ld.so.conf' See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- make[4]: Leaving directory '/build/deps/libosmocore/src' make[3]: Leaving directory '/build/deps/libosmocore/src' make[2]: Leaving directory '/build/deps/libosmocore/src' Making install in src/vty make[2]: Entering directory '/build/deps/libosmocore/src/vty' CC command.lo CC buffer.lo CC vty.lo CC utils.lo CC vector.lo CC logging_vty.lo CC telnet_interface.lo CC stats_vty.lo CC fsm_vty.lo CC talloc_ctx_vty.lo CCLD libosmovty.la make[3]: Entering directory '/build/deps/libosmocore/src/vty' make[3]: Nothing to be done for 'install-data-am'. /bin/mkdir -p '/build/deps/install/stow/libosmocore/lib' /bin/bash ../../libtool --mode=install /usr/bin/install -c libosmovty.la '/build/deps/install/stow/libosmocore/lib' libtool: install: warning: relinking `libosmovty.la' libtool: install: (cd /build/deps/libosmocore/src/vty; /bin/bash /build/deps/libosmocore/libtool --silent --tag CC --mode=relink gcc -Wall -g -O2 -DBUILDING_LIBOSMOCORE -Wall -version-info 4:1:0 -no-undefined -o libosmovty.la -rpath /build/deps/install/stow/libosmocore/lib buffer.lo command.lo vty.lo vector.lo utils.lo telnet_interface.lo logging_vty.lo stats_vty.lo fsm_vty.lo talloc_ctx_vty.lo ../../src/libosmocore.la -ltalloc ) libtool: install: /usr/bin/install -c .libs/libosmovty.so.4.0.1T /build/deps/install/stow/libosmocore/lib/libosmovty.so.4.0.1 libtool: install: (cd /build/deps/install/stow/libosmocore/lib && { ln -s -f libosmovty.so.4.0.1 libosmovty.so.4 || { rm -f libosmovty.so.4 && ln -s libosmovty.so.4.0.1 libosmovty.so.4; }; }) libtool: install: (cd /build/deps/install/stow/libosmocore/lib && { ln -s -f libosmovty.so.4.0.1 libosmovty.so || { rm -f libosmovty.so && ln -s libosmovty.so.4.0.1 libosmovty.so; }; }) libtool: install: /usr/bin/install -c .libs/libosmovty.lai /build/deps/install/stow/libosmocore/lib/libosmovty.la libtool: finish: PATH="/usr/local/bin:/usr/bin:/bin:/usr/games:/home/osmocom-build/bin:/build_bin:/sbin" ldconfig -n /build/deps/install/stow/libosmocore/lib ---------------------------------------------------------------------- Libraries have been installed in: /build/deps/install/stow/libosmocore/lib If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the `-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the `LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the `LD_RUN_PATH' environment variable during linking - use the `-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to `/etc/ld.so.conf' See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- make[3]: Leaving directory '/build/deps/libosmocore/src/vty' make[2]: Leaving directory '/build/deps/libosmocore/src/vty' Making install in src/codec make[2]: Entering directory '/build/deps/libosmocore/src/codec' CC gsm660.lo CC gsm610.lo CC gsm620.lo CC ecu_fr.lo CC gsm690.lo CCLD libosmocodec.la make[3]: Entering directory '/build/deps/libosmocore/src/codec' make[3]: Nothing to be done for 'install-data-am'. /bin/mkdir -p '/build/deps/install/stow/libosmocore/lib' /bin/bash ../../libtool --mode=install /usr/bin/install -c libosmocodec.la '/build/deps/install/stow/libosmocore/lib' libtool: install: warning: relinking `libosmocodec.la' libtool: install: (cd /build/deps/libosmocore/src/codec; /bin/bash /build/deps/libosmocore/libtool --silent --tag CC --mode=relink gcc -Wall -g -O2 -DBUILDING_LIBOSMOCORE -Wall -version-info 1:0:1 -no-undefined -o libosmocodec.la -rpath /build/deps/install/stow/libosmocore/lib gsm610.lo gsm620.lo gsm660.lo gsm690.lo ecu_fr.lo ../../src/libosmocore.la ) libtool: install: /usr/bin/install -c .libs/libosmocodec.so.0.1.0T /build/deps/install/stow/libosmocore/lib/libosmocodec.so.0.1.0 libtool: install: (cd /build/deps/install/stow/libosmocore/lib && { ln -s -f libosmocodec.so.0.1.0 libosmocodec.so.0 || { rm -f libosmocodec.so.0 && ln -s libosmocodec.so.0.1.0 libosmocodec.so.0; }; }) libtool: install: (cd /build/deps/install/stow/libosmocore/lib && { ln -s -f libosmocodec.so.0.1.0 libosmocodec.so || { rm -f libosmocodec.so && ln -s libosmocodec.so.0.1.0 libosmocodec.so; }; }) libtool: install: /usr/bin/install -c .libs/libosmocodec.lai /build/deps/install/stow/libosmocore/lib/libosmocodec.la libtool: finish: PATH="/usr/local/bin:/usr/bin:/bin:/usr/games:/home/osmocom-build/bin:/build_bin:/sbin" ldconfig -n /build/deps/install/stow/libosmocore/lib ---------------------------------------------------------------------- Libraries have been installed in: /build/deps/install/stow/libosmocore/lib If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the `-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the `LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the `LD_RUN_PATH' environment variable during linking - use the `-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to `/etc/ld.so.conf' See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- make[3]: Leaving directory '/build/deps/libosmocore/src/codec' make[2]: Leaving directory '/build/deps/libosmocore/src/codec' Making install in src/gsm make[2]: Entering directory '/build/deps/libosmocore/src/gsm' GEN gsm0503_conv.c Generating convolutional codes... Generate 'xcch' definition Generate 'rach' definition Generate 'rach_ext' definition Generate 'sch' definition Generate 'cs2' definition Generate 'cs3' definition Generate 'cs2_np' definition Generate 'cs3_np' definition Generate 'tch_afs_12_2' definition Generate 'tch_afs_10_2' definition Generate 'tch_afs_7_95' definition Generate 'tch_afs_7_4' definition Generate 'tch_afs_6_7' definition Generate 'tch_afs_5_9' definition Generate 'tch_afs_5_15' definition Generate 'tch_afs_4_75' definition Generate 'tch_fr' definition Generate 'tch_hr' definition Generate 'tch_ahs_7_95' definition Generate 'tch_ahs_7_4' definition Generate 'tch_ahs_6_7' definition Generate 'tch_ahs_5_9' definition Generate 'tch_ahs_5_15' definition Generate 'tch_ahs_4_75' definition Generate 'mcs1_dl_hdr' definition Generate 'mcs1_ul_hdr' definition Generate 'mcs1' definition Generate 'mcs2' definition Generate 'mcs3' definition Generate 'mcs4' definition Generate 'mcs5_dl_hdr' definition Generate 'mcs5_ul_hdr' definition Generate 'mcs5' definition Generate 'mcs6' definition Generate 'mcs7_dl_hdr' definition Generate 'mcs7_ul_hdr' definition Generate 'mcs7' definition Generate 'mcs8' definition Generate 'mcs9' definition Generation complete. make install-am make[3]: Entering directory '/build/deps/libosmocore/src/gsm' CC a5.lo CC tlv_parser.lo CC rxlev_stat.lo CC comp128.lo CC comp128v23.lo CC gsm_utils.lo CC rsl.lo CC gsm48.lo /bin/bash: line 2: 5618 Segmentation fault (core dumped) /bin/bash ../../libtool --silent --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../include -I/usr/include/p11-kit-1 -DBUILDING_LIBOSMOCORE -Wall -Wall -g -O2 -DBUILDING_LIBOSMOCORE -Wall -MT tlv_parser.lo -MD -MP -MF $depbase.Tpo -c -o tlv_parser.lo tlv_parser.c Makefile:568: recipe for target 'tlv_parser.lo' failed make[3]: *** [tlv_parser.lo] Error 139 make[3]: *** Waiting for unfinished jobs.... gsm_utils.c:112:9: note: #pragma message: including GnuTLS for getrandom fallback. #pragma message ("including GnuTLS for getrandom fallback.") ^ gsm_utils.c: In function 'osmo_get_rand_id': gsm_utils.c:456:9: note: #pragma message: Secure random failed: using GnuTLS fallback. #pragma message ("Secure random failed: using GnuTLS fallback.") ^ make[3]: Leaving directory '/build/deps/libosmocore/src/gsm' Makefile:673: recipe for target 'install' failed make[2]: Leaving directory '/build/deps/libosmocore/src/gsm' make[2]: *** [install] Error 2 make[1]: *** [install-recursive] Error 1 Makefile:593: recipe for target 'install-recursive' failed make[1]: Leaving directory '/build/deps/libosmocore' make: *** [install] Error 2 Makefile:892: recipe for target 'install' failed Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Sat Jul 7 16:16:39 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 7 Jul 2018 16:16:39 +0000 Subject: Change in simtrace2[master]: DFU: set stack pointer before starting main app In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9908 ) Change subject: DFU: set stack pointer before starting main app ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9908 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie354d603fe302d3d5bdfa9c31575411de722323b Gerrit-Change-Number: 9908 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Sat, 07 Jul 2018 16:16:39 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 7 16:16:43 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 7 Jul 2018 16:16:43 +0000 Subject: Change in simtrace2[master]: buffer: increase buffer size to 512 to cope with fast and long TPDUs In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9877 ) Change subject: buffer: increase buffer size to 512 to cope with fast and long TPDUs ...................................................................... Patch Set 13: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9877 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I194c90cf09306a982d80c5bf1222397af6e658a9 Gerrit-Change-Number: 9877 Gerrit-PatchSet: 13 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Sat, 07 Jul 2018 16:16:43 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 7 16:16:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 7 Jul 2018 16:16:53 +0000 Subject: Change in simtrace2[master]: buffer: increase buffer size to 512 to cope with fast and long TPDUs In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9877 ) Change subject: buffer: increase buffer size to 512 to cope with fast and long TPDUs ...................................................................... buffer: increase buffer size to 512 to cope with fast and long TPDUs Change-Id: I194c90cf09306a982d80c5bf1222397af6e658a9 --- M firmware/libcommon/include/ringbuffer.h 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libcommon/include/ringbuffer.h b/firmware/libcommon/include/ringbuffer.h index efc557c..aa200ba 100644 --- a/firmware/libcommon/include/ringbuffer.h +++ b/firmware/libcommon/include/ringbuffer.h @@ -5,7 +5,7 @@ #include #include -#define RING_BUFLEN 256 +#define RING_BUFLEN 512 typedef struct ringbuf { uint8_t buf[RING_BUFLEN]; -- To view, visit https://gerrit.osmocom.org/9877 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I194c90cf09306a982d80c5bf1222397af6e658a9 Gerrit-Change-Number: 9877 Gerrit-PatchSet: 13 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 7 16:16:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 7 Jul 2018 16:16:53 +0000 Subject: Change in simtrace2[master]: DFU: set stack pointer before starting main app In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9908 ) Change subject: DFU: set stack pointer before starting main app ...................................................................... DFU: set stack pointer before starting main app The stack size is fixed. The linker script puts the stack section after the bss section. The initial stack pointer is not at the end of the RAM (as often seen). Thus the initial stack pointer address of the main application is different than the one from DFU. When starting the main application the stack pointer needs to be set to the new value. If this is not done the main application stack may overwrite the data in bss, even without exceeding the fixed stack size. Change-Id: Ie354d603fe302d3d5bdfa9c31575411de722323b --- M firmware/libboard/common/source/board_cstartup_gnu.c 1 file changed, 5 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libboard/common/source/board_cstartup_gnu.c b/firmware/libboard/common/source/board_cstartup_gnu.c index 15c70dd..4b561ec 100644 --- a/firmware/libboard/common/source/board_cstartup_gnu.c +++ b/firmware/libboard/common/source/board_cstartup_gnu.c @@ -133,7 +133,11 @@ void (*appReset)(void); pSrc = (unsigned int *) ((unsigned char *)IFLASH_ADDR + BOARD_DFU_BOOT_SIZE); - SCB->VTOR = ((unsigned int)(pSrc)) | (0x0 << 7); + /* set vector table to application vector table (store at the beginning of the application) */ + SCB->VTOR = (unsigned int)(pSrc); + /* set stack pointer to address provided in the beginning of the application (loaded into a register first) */ + __asm__ volatile ("MSR msp,%0" : :"r"(*pSrc)); + /* start application (by jumping to the reset function which address is stored as second entry of the vector table) */ appReset = (void(*)(void))pSrc[1]; g_dfu->state = DFU_STATE_appIDLE; -- To view, visit https://gerrit.osmocom.org/9908 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ie354d603fe302d3d5bdfa9c31575411de722323b Gerrit-Change-Number: 9908 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 7 16:16:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 7 Jul 2018 16:16:54 +0000 Subject: Change in simtrace2[master]: DFU: disable configured console UART before starting main app In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9909 ) Change subject: DFU: disable configured console UART before starting main app ...................................................................... DFU: disable configured console UART before starting main app The DFU uses the UART peripheral (with IRQ/ISR) for the debug output console. Before starting the main application we should make sure this configuration is reset to avoid interference (particularly the IRQ/ISR). This is not too important though since the main application reconfigures the UART for console output. Other peripheral could also be disabled (e.g. all other PIO used by DFU), but most of them also get configured by the main application. Change-Id: I8234d1b85938ad6393094c08183f613ad09ee01b --- M firmware/libboard/common/include/uart_console.h M firmware/libboard/common/source/board_cstartup_gnu.c M firmware/libboard/common/source/uart_console.c 3 files changed, 19 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libboard/common/include/uart_console.h b/firmware/libboard/common/include/uart_console.h index c48c2c1..0e49bfd 100644 --- a/firmware/libboard/common/include/uart_console.h +++ b/firmware/libboard/common/include/uart_console.h @@ -34,6 +34,7 @@ #include extern void UART_Configure( uint32_t dwBaudrate, uint32_t dwMasterClock ) ; +extern void UART_Exit(void) ; extern void UART_PutChar( uint8_t uc ) ; extern uint32_t UART_GetChar( void ) ; extern uint32_t UART_IsRxReady( void ) ; diff --git a/firmware/libboard/common/source/board_cstartup_gnu.c b/firmware/libboard/common/source/board_cstartup_gnu.c index 4b561ec..42231fb 100644 --- a/firmware/libboard/common/source/board_cstartup_gnu.c +++ b/firmware/libboard/common/source/board_cstartup_gnu.c @@ -173,6 +173,8 @@ * the second entry in the vector table is the reset address, corresponding to the application start */ if (((*((uint32_t*)(IFLASH_ADDR+BOARD_DFU_BOOT_SIZE)))&0xFFFF0000)==0x20000000) { + UART_Exit(); + __disable_irq(); BootIntoApp(); /* Infinite loop */ while ( 1 ) ; diff --git a/firmware/libboard/common/source/uart_console.c b/firmware/libboard/common/source/uart_console.c index a47ba0c..fe64922 100644 --- a/firmware/libboard/common/source/uart_console.c +++ b/firmware/libboard/common/source/uart_console.c @@ -103,6 +103,22 @@ _ucIsConsoleInitialized=1 ; } +/** + * \brief Disables the USART peripheral and related IRQ + */ +void UART_Exit(void) +{ + if (!_ucIsConsoleInitialized) { + return; + } + + Uart *pUart = CONSOLE_UART; + pUart->UART_IDR = UART_IDR_TXRDY; + pUart->UART_CR = UART_CR_RSTRX | UART_CR_RSTTX | UART_CR_RXDIS | UART_CR_TXDIS | UART_CR_RSTSTA; + PMC->PMC_PCDR0 = 1 << CONSOLE_ID; + NVIC_DisableIRQ(CONSOLE_IRQ); +} + /** Interrupt Service routine to transmit queued data */ void CONSOLE_ISR(void) { -- To view, visit https://gerrit.osmocom.org/9909 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I8234d1b85938ad6393094c08183f613ad09ee01b Gerrit-Change-Number: 9909 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 7 16:16:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 7 Jul 2018 16:16:55 +0000 Subject: Change in simtrace2[master]: UART: make IRQ/ISR enabling simpler In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9910 ) Change subject: UART: make IRQ/ISR enabling simpler ...................................................................... UART: make IRQ/ISR enabling simpler Change-Id: Id3742850eb5bac91559e0c2b4144bd7b1ae5b07b --- M firmware/libboard/common/source/uart_console.c 1 file changed, 4 insertions(+), 8 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libboard/common/source/uart_console.c b/firmware/libboard/common/source/uart_console.c index fe64922..9004197 100644 --- a/firmware/libboard/common/source/uart_console.c +++ b/firmware/libboard/common/source/uart_console.c @@ -150,16 +150,12 @@ } /* Only store input if buffer is not full, else drop it */ - bool trigger_isr = false; - if (rbuf_is_empty(&uart_tx_buffer)) { - trigger_isr = true; - } if (!rbuf_is_full(&uart_tx_buffer)) { rbuf_write(&uart_tx_buffer, c); - } - if (trigger_isr) { - pUart->UART_IER = UART_IER_TXRDY; - CONSOLE_ISR(); + if (!(pUart->UART_IMR & UART_IMR_TXRDY)) { + pUart->UART_IER = UART_IER_TXRDY; + CONSOLE_ISR(); + } } } -- To view, visit https://gerrit.osmocom.org/9910 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Id3742850eb5bac91559e0c2b4144bd7b1ae5b07b Gerrit-Change-Number: 9910 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 7 16:16:56 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 7 Jul 2018 16:16:56 +0000 Subject: Change in simtrace2[master]: UART: remove unused code In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9911 ) Change subject: UART: remove unused code ...................................................................... UART: remove unused code PutChar already takes care of enabling the IRQ Change-Id: I63af5eba27c9a6f3e23412060028e817e4d9f233 --- M firmware/libboard/common/source/uart_console.c 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libboard/common/source/uart_console.c b/firmware/libboard/common/source/uart_console.c index 9004197..07f41ed 100644 --- a/firmware/libboard/common/source/uart_console.c +++ b/firmware/libboard/common/source/uart_console.c @@ -125,7 +125,6 @@ Uart *uart = CONSOLE_UART; if (uart->UART_SR & UART_SR_TXRDY) { if (!rbuf_is_empty(&uart_tx_buffer)) { - //uart->UART_IER = UART_IER_TXRDY; uart->UART_THR = rbuf_read(&uart_tx_buffer); } else { uart->UART_IDR = UART_IER_TXRDY; -- To view, visit https://gerrit.osmocom.org/9911 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I63af5eba27c9a6f3e23412060028e817e4d9f233 Gerrit-Change-Number: 9911 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 7 16:16:56 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 7 Jul 2018 16:16:56 +0000 Subject: Change in simtrace2[master]: DFU: re-enable UART after testing forced bootloader In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9912 ) Change subject: DFU: re-enable UART after testing forced bootloader ...................................................................... DFU: re-enable UART after testing forced bootloader The qmod does not have a separate force button as simtrace has. Instead it check is TX and RX of UART are shorted using PIO. If the pins are not set back to the UART peripheral, the TRACE/debug console output will not work anymore. Change-Id: Id434b49909d6395a2f93a00f39d2d770a5725466 --- M firmware/libboard/qmod/source/board_qmod.c 1 file changed, 20 insertions(+), 8 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libboard/qmod/source/board_qmod.c b/firmware/libboard/qmod/source/board_qmod.c index dd6e616..0eda1ef 100644 --- a/firmware/libboard/qmod/source/board_qmod.c +++ b/firmware/libboard/qmod/source/board_qmod.c @@ -261,20 +261,32 @@ /* Configure UART pins as I/O */ PIO_Configure(uart_loopback_pins, PIO_LISTSIZE(uart_loopback_pins)); + /* Send pattern over UART TX and check if it is received on RX + * If the loop doesn't get interrupted, RxD always follows TxD and thus a + * loopback jumper has been placed on RxD/TxD, and we will boot + * into DFU unconditionally + */ + int has_loopback_jumper = 1; for (i = 0; i < 10; i++) { /* Set TxD high; abort if RxD doesn't go high either */ PIO_Set(&uart_loopback_pins[1]); - if (!PIO_Get(&uart_loopback_pins[0])) - return 0; + if (!PIO_Get(&uart_loopback_pins[0])) { + has_loopback_jumper = 0; + break; + } /* Set TxD low, abort if RxD doesn't go low either */ PIO_Clear(&uart_loopback_pins[1]); - if (PIO_Get(&uart_loopback_pins[0])) - return 0; + if (PIO_Get(&uart_loopback_pins[0])) { + has_loopback_jumper = 0; + break; + } } - /* if we reached here, RxD always follows TxD and thus a - * loopback jumper has been placed on RxD/TxD, and we will boot - * into DFU unconditionally */ - return 1; + + /* Put pins back to UART mode */ + const Pin uart_pins[] = {PINS_UART}; + PIO_Configure(uart_pins, PIO_LISTSIZE(uart_pins)); + + return has_loopback_jumper; } int board_override_enter_dfu(void) -- To view, visit https://gerrit.osmocom.org/9912 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Id434b49909d6395a2f93a00f39d2d770a5725466 Gerrit-Change-Number: 9912 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 7 16:18:33 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 7 Jul 2018 16:18:33 +0000 Subject: Change in osmo-ttcn3-hacks[master]: RSL_Emulation: Stop with error verdict if conn table runs out of space In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9903 ) Change subject: RSL_Emulation: Stop with error verdict if conn table runs out of space ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9903 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If1a002da97cf1b66855f2e7a0fe2a54a6428bc81 Gerrit-Change-Number: 9903 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Sat, 07 Jul 2018 16:18:33 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 7 16:18:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 7 Jul 2018 16:18:55 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS_Tests: Ensure mtc.stop is called after setverdict(fail, ...) In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9904 ) Change subject: BTS_Tests: Ensure mtc.stop is called after setverdict(fail, ...) ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9904 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iba59a69127e845cadbe9aaa1dabd87ff5ce8b43b Gerrit-Change-Number: 9904 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Sat, 07 Jul 2018 16:18:55 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 7 16:19:01 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 7 Jul 2018 16:19:01 +0000 Subject: Change in osmo-ttcn3-hacks[master]: RSL_Emulation: Stop with error verdict if conn table runs out of space In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9903 ) Change subject: RSL_Emulation: Stop with error verdict if conn table runs out of space ...................................................................... RSL_Emulation: Stop with error verdict if conn table runs out of space Change-Id: If1a002da97cf1b66855f2e7a0fe2a54a6428bc81 --- M library/RSL_Emulation.ttcn 1 file changed, 4 insertions(+), 6 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/library/RSL_Emulation.ttcn b/library/RSL_Emulation.ttcn index 119a9be..325f22e 100644 --- a/library/RSL_Emulation.ttcn +++ b/library/RSL_Emulation.ttcn @@ -195,7 +195,7 @@ return; } } - setverdict(fail, "No free entry in conn table for ", ra, fn); + testcase.stop("No free entry in conn table for ", ra, fn); } /* create an ew client with given RA and FN */ @@ -212,7 +212,7 @@ return; } } - setverdict(fail, "No free entry in conn table for ", trx_nr, chan_nr, comp_ref); + testcase.stop("No free entry in conn table for ", trx_nr, chan_nr, comp_ref); } @@ -263,8 +263,7 @@ return; } } - setverdict(fail, "No space left in LastActTable to store chan_act for ", chan_nr); - self.stop; + testcase.stop("No space left in LastActTable to store chan_act for ", chan_nr); } private function f_lookup_last_act(uint8_t trx_nr, RslChannelNr chan_nr) @@ -275,8 +274,7 @@ return LastActTable[i].chan_act; } } - setverdict(fail, "No LastActTable entry found for TRX ", trx_nr, " ", chan_nr); - self.stop; + testcase.stop("No LastActTable entry found for TRX ", trx_nr, " ", chan_nr); } private function f_last_act_table_init() runs on RSL_Emulation_CT { -- To view, visit https://gerrit.osmocom.org/9903 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: If1a002da97cf1b66855f2e7a0fe2a54a6428bc81 Gerrit-Change-Number: 9903 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 7 16:19:01 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 7 Jul 2018 16:19:01 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS_Tests: Ensure mtc.stop is called after setverdict(fail, ...) In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9904 ) Change subject: BTS_Tests: Ensure mtc.stop is called after setverdict(fail, ...) ...................................................................... BTS_Tests: Ensure mtc.stop is called after setverdict(fail, ...) This will prevent subsequent failures from overwriting the verdict so we can easily see the root cause of the test failure. Change-Id: Iba59a69127e845cadbe9aaa1dabd87ff5ce8b43b --- M bts/BTS_Tests.ttcn 1 file changed, 74 insertions(+), 40 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index aee081e..4f0f0ef 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -257,7 +257,7 @@ } [] pt.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_INFO_IND(?, ?, ?))) -> value sd { setverdict(fail, "Invalid PCU Version/BTS Number received"); - self.stop; + mtc.stop; } } @@ -276,7 +276,7 @@ [] as_pcu_info_ind(pt, pcu_conn_id, pcu_last_info); [] T.timeout { setverdict(fail, "Timeout waiting for PCU INFO_IND"); - self.stop; + mtc.stop; } } } @@ -316,7 +316,7 @@ [] RSL_CCHAN.receive(ASP_IPA_Event:{up_down := ASP_IPA_EVENT_UP}); [] T.timeout { setverdict(fail, "Timeout waiting for ASP_IPA_EVENT_UP"); - self.stop; + mtc.stop; } } f_sleep(0.5); /* workaround for OS#3000 */ @@ -389,7 +389,7 @@ private altstep as_Tguard() runs on ConnHdlr { [] g_Tguard.timeout { setverdict(fail, "Tguard timeout"); - self.stop; + mtc.stop; } } @@ -404,7 +404,7 @@ "", -1, -1, {udp:={}}, {}); if (not ispresent(res.connId)) { setverdict(fail, "Could not connect to trx-control interface of trxcon, check your configuration"); - self.stop; + mtc.stop; } g_bb_trxc_conn_id := res.connId; } @@ -455,14 +455,14 @@ } [] T.timeout { setverdict(fail, "Timeout expecting " & id); - self.stop; + mtc.stop; } [not ignore_other] as_l1_sacch(); [not ignore_other] as_meas_res(); [not ignore_other] as_l1_dcch(); [not ignore_other] RSL.receive { setverdict(fail, "Unexpected RSL message received"); - self.stop; + mtc.stop; } [ignore_other] RSL.receive { repeat; } } @@ -550,6 +550,7 @@ alt { [] RSL.receive(tr_RSL_CHAN_ACT_ACK(g_chan_nr)) { setverdict(fail, "Unexpected CHAN ACT ACK on double activation"); + mtc.stop; } [] RSL.receive(tr_RSL_CHAN_ACT_NACK(g_chan_nr)) { setverdict(pass); @@ -577,6 +578,7 @@ } [] T.timeout { setverdict(fail, "Timeout expecting RF_CHAN_REL_ACK"); + mtc.stop; } } } @@ -594,6 +596,7 @@ alt { [] RSL.receive(tr_RSL_CHAN_ACT_ACK(g_chan_nr)) { setverdict(fail, "Unexpected CHAN ACT ACK"); + mtc.stop; } [] RSL.receive(tr_RSL_CHAN_ACT_NACK(g_chan_nr)) { setverdict(pass); @@ -667,6 +670,7 @@ alt { [not exp] L1CTL.receive(tr_L1CTL_DATA_IND(g_chan_nr, tr_RslLinkID_SACCH(0))) { setverdict(fail, "Received SACCH when not expecting it"); + mtc.stop; } [not exp] T_sacch.timeout { setverdict(pass); @@ -676,6 +680,7 @@ } [exp] T_sacch.timeout { setverdict(fail, "Timeout waiting for SACCH on ", g_chan_nr); + mtc.stop; } [] L1CTL.receive { repeat; } [] RSL.receive { repeat; } @@ -740,7 +745,7 @@ [] L1CTL.receive { repeat; } [] T_sacch.timeout { setverdict(fail, "Timeout waiting for SACCH ", l3_exp); - self.stop; + mtc.stop; } } } @@ -986,7 +991,7 @@ var GsmFrameNumber fn := f_L1CTL_RACH(L1CTL, oct2int(ra)); if (fn == fn_last) { setverdict(fail, "Two RACH in same FN?!?"); - self.stop; + mtc.stop; } fn_last := fn; @@ -998,12 +1003,12 @@ } [] RSL_CCHAN.receive(tr_RSL_UD(tr_RSL_CHAN_RQD(?, ?, ?))) { setverdict(fail, "Unexpected CHAN RQD"); - self.stop; + mtc.stop; } [] RSL_CCHAN.receive { repeat; } [] T.timeout { setverdict(fail, "Timeout waiting for CHAN RQD"); - self.stop; + mtc.stop; } } } @@ -1024,7 +1029,7 @@ var GsmFrameNumber fn := f_L1CTL_RACH(L1CTL, oct2int(ra)); if (fn == fn_last) { setverdict(fail, "Two RACH in same FN?!?"); - self.stop; + mtc.stop; } fn_last := fn; } @@ -1055,7 +1060,7 @@ "", -1, -1, {udp:={}}, {}); if (not ispresent(res.connId)) { setverdict(fail, "Could not connect to trx-control interface of trxcon, check your configuration"); - self.stop; + mtc.stop; } g_bb_trxc_conn_id := res.connId; } @@ -1079,6 +1084,7 @@ } [not expect_pass] RSL_CCHAN.receive(tr_RSL_UD(tr_RSL_CHAN_RQD(ra, fn))) { setverdict(fail, "RACH passed but was expected to be dropped: ", toffs256); + mtc.stop; } [] RSL_CCHAN.receive { repeat; } [not expect_pass] T.timeout { @@ -1086,6 +1092,7 @@ } [expect_pass] T.timeout { setverdict(fail, "Timeout waiting for CHAN RQD"); + mtc.stop; } } } @@ -1287,16 +1294,16 @@ repeat; } else { setverdict(fail, "Received unspecific MEAS RES ", rsl); - self.stop; + mtc.stop; } } [] RSL.receive(tr_RSL_MEAS_RES(?)) -> value rsl { setverdict(fail, "Received unexpected MEAS RES ", rsl); - self.stop; + mtc.stop; } [g_Tmeas_exp.running] g_Tmeas_exp.timeout { setverdict(fail, "Didn't receive expected measurement result") - self.stop; + mtc.stop; } } @@ -1312,7 +1319,7 @@ case (RSL_ALG_ID_A5_7) { return 7; } case else { setverdict(fail, "Unknwon Algorithm ID"); - self.stop; + mtc.stop; } } } @@ -1328,7 +1335,7 @@ case (RSL_ALG_ID_A5_7) { return '110'B; } case else { setverdict(fail, "Unknwon Algorithm ID"); - self.stop; + mtc.stop; } } } @@ -1405,12 +1412,13 @@ [] as_l1_dcch(); [] L1CTL.receive { repeat; } [g_Tmeas_exp.running] T.timeout { - /* as_meas_res() would have done setverdict(fail) / self.stop in case + /* as_meas_res() would have done setverdict(fail) / mtc.stop in case * of any earlier errors, so if we reach this timeout, we're good */ setverdict(pass); } [] T.timeout { setverdict(fail, "No MEAS RES received at all"); + mtc.stop; } } f_rsl_chan_deact(); @@ -1494,6 +1502,7 @@ [] RSL.receive { repeat }; [] T.timeout { setverdict(fail, "No CONN FAIL IND received"); + mtc.stop; } } f_rsl_chan_deact(); @@ -1639,6 +1648,7 @@ } [not cfg.exp_overload] RSL_CCHAN.receive(tr_RSL_UD(tr_RSL_PAGING_LOAD_IND(0))) { setverdict(fail, "Unexpected PCH Overload"); + mtc.stop; } [cfg.exp_load_ind] RSL_CCHAN.receive(tr_RSL_UD(tr_RSL_PAGING_LOAD_IND)) { log("Rx LOAD_IND"); @@ -1664,6 +1674,7 @@ [] RSL_CCHAN.receive(tr_RSL_UD(tr_RSL_PAGING_LOAD_IND)) { repeat; } [] T_wait.timeout { setverdict(fail, "Waiting for empty paging queue"); + mtc.stop; } [] as_rsl_res_ind(); } @@ -1830,7 +1841,7 @@ if (not match(rr, tr_IMM_ASS(42, ?, 5, ?, ?))) { /* FIXME: Why are we seeing paging requests on PCH/AGCH? */ //setverdict(fail, "Unexpected IMM-ASS values on AGCH: ", rr); - //self.stop; + //mtc.stop; } else { num_rx := num_rx+1; } @@ -1843,6 +1854,7 @@ log("AGCH test: " & res_str); if (num_rx + num_del != num_tx) { setverdict(fail, "RX + DEL != TX ?!?: " & res_str); + mtc.stop } rx_ratio := int2float(num_rx) / int2float(num_tx); if (rx_ratio < exp_pass*0.8 or rx_ratio > exp_pass*1.2) { @@ -1850,6 +1862,7 @@ } else { setverdict(pass); } + f_shutdown(); } /* send a long burst of 1000 IMM.ASS with 20ms spacing (50 per s); expect 75% of them to be deleted */ @@ -1903,6 +1916,7 @@ function f_ensure_si_vec_contains(SystemInformationVectorPerTc arr, integer tc, RrMessageType key, boolean ext_bcch := false) { if (not f_si_vecslot_contains(arr[tc], key, ext_bcch)) { setverdict(fail, "No ", key, " in TC=", tc, "!"); + mtc.stop; } } @@ -1922,7 +1936,7 @@ var integer count := 0; if (sizeof(arr) < m) { setverdict(fail, "Error: Insufficient SI in array"); - self.stop; + mtc.stop; } for (var integer i:= 0; i < m; i := i + 1) { var integer fn_mod51 := arr[i].frame_number mod 51; @@ -1944,6 +1958,7 @@ function f_ensure_si_vec_contains_n_of_m(SystemInformationVectorPerTc arr, integer tc, RrMessageType key, boolean ext_bcch := false, integer n, integer m) { if (not f_si_vecslot_contains_n_of_m(arr[tc], key, ext_bcch, n, m)) { setverdict(fail, "Not ", n, "/", m, " of ", key, " in TC=", tc, "!"); + mtc.stop; } } @@ -1965,6 +1980,7 @@ function f_ensure_si_vec_contains_only(SystemInformationVectorPerTc arr, integer tc, RrMessageType key, boolean ext_bcch := false) { if (not f_si_vecslot_contains_only(arr[tc], key, ext_bcch)) { setverdict(fail, "Not all ", key, " in TC=", tc, "!"); + mtc.stop; } } @@ -1994,6 +2010,7 @@ for (i := 0; i < sizeof(si_per_tc); i := i + 1) { if (sizeof(si_per_tc[i]) == 0) { setverdict(fail, "No SI messages for TC=", i); + mtc.stop; } } if (cfg.si1_present) { @@ -2076,6 +2093,7 @@ } if (f_si_vec_contains(si_per_tc, SYSTEM_INFORMATION_TYPE_13alt)) { setverdict(fail, "Cannot have SI13alt and SI13"); + mtc.stop; } } if (cfg.si16_present or cfg.si17_present) { @@ -2086,6 +2104,7 @@ } if (f_si_vec_contains(si_per_tc, SYSTEM_INFORMATION_TYPE_22)) { setverdict(fail, "Cannot have SI16/SI17 and SI22!"); + mtc.stop; } if (not cfg.bcch_extended) { testcase.stop("Error: SI16/SI17 requires BCCH Extd!"); @@ -2131,6 +2150,7 @@ } if (f_si_vec_contains(si_per_tc, SYSTEM_INFORMATION_TYPE_13)) { setverdict(fail, "Cannot have SI13alt and SI13"); + mtc.stop; } if (not cfg.bcch_extended) { f_ensure_si_vec_contains_n_of_m(si_per_tc, 4, SYSTEM_INFORMATION_TYPE_13alt, false, 1, 4); @@ -2162,6 +2182,7 @@ f_ensure_si_vec_contains_n_of_m(si_per_tc, 4, SYSTEM_INFORMATION_TYPE_21, true, 1, 4); if (f_si_vecslot_contains(si_per_tc[4], SYSTEM_INFORMATION_TYPE_21)) { setverdict(fail, "Cannot have SI21 on BCCH Norm if BCCH Extd enabled!"); + mtc.stop; } } } @@ -2176,6 +2197,7 @@ if (f_si_vec_contains(si_per_tc, SYSTEM_INFORMATION_TYPE_16) or f_si_vec_contains(si_per_tc, SYSTEM_INFORMATION_TYPE_17)) { setverdict(fail, "Cannot have SI16/SI17 and SI22!"); + mtc.stop; } if (not cfg.bcch_extended) { testcase.stop("Error: SI22 requires BCCH Extd!"); @@ -2337,12 +2359,14 @@ } [] RSL_CCHAN.receive(tr_RSL_UD(tr_RSL_ERROR_REPORT(?))) { setverdict(fail, "Wrong cause in RSL ERR REP"); + mtc.stop; } [] RSL_CCHAN.receive { repeat; } [] T.timeout { setverdict(fail, "Timeout waiting for RSL ERR REP"); + mtc.stop; } } } @@ -2489,7 +2513,7 @@ alt { [] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_RTS_REQ(bts_nr))) { setverdict(fail, "PCU RTS.req before PDCH active?"); - self.stop; + mtc.stop; } [] PCU.receive { repeat; } [] T.timeout { } @@ -2507,15 +2531,16 @@ [not exp_success] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_RTS_REQ(bts_nr, trx_nr, ts_nr))) { setverdict(fail, "Unexpected RTS.req for supposedly failing activation"); - self.stop; + mtc.stop; } [] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_RTS_REQ)) { setverdict(fail, "RTS.req for wrong TRX/TS"); - self.stop; + mtc.stop; } [] PCU.receive { repeat; } [exp_success] T.timeout { setverdict(fail, "Timeout waiting for PCU RTS.req"); + mtc.stop; } [not exp_success] T.timeout { setverdict(pass); @@ -2536,7 +2561,7 @@ alt { [] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_RTS_REQ(bts_nr, trx_nr, ts_nr))) { setverdict(fail, "Received unexpected PCU RTS.req"); - self.stop; + mtc.stop; } [] PCU.receive { repeat; } [] T.timeout { @@ -2607,7 +2632,7 @@ [] PCU.receive { repeat; } [] T.timeout { setverdict(fail, "Timeout waiting for SI13"); - self.stop; + mtc.stop; } } } @@ -2641,6 +2666,7 @@ [] PCU.receive { repeat; } [] T.timeout { setverdict(fail, "Timeout waiting for RTS.ind"); + mtc.stop; } } } @@ -2714,6 +2740,7 @@ [] L1CTL.receive { repeat; } [] T.timeout { setverdict(fail, "Timeout waiting for PCU-originated AGCH block on Um"); + mtc.stop; } } } @@ -2738,6 +2765,7 @@ [] L1CTL.receive { repeat; } [] T.timeout { setverdict(fail, "Timeout waiting for PCU-originated AGCH block on Um"); + mtc.stop; } } } @@ -2754,7 +2782,7 @@ var GsmFrameNumber fn := f_L1CTL_RACH(L1CTL, oct2int(ra)); if (fn == fn_last) { setverdict(fail, "Two RACH in same FN?!?"); - self.stop; + mtc.stop; } fn_last := fn; @@ -2766,12 +2794,12 @@ } [] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_RACH_IND)) { setverdict(fail, "Unexpected RACH IND"); - self.stop; + mtc.stop; } [] PCU.receive { repeat; } [] T.timeout { setverdict(fail, "Timeout waiting for RACH IND"); - self.stop; + mtc.stop; } } } @@ -2810,12 +2838,12 @@ } [] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_PAG_REQ)) { setverdict(fail, "Unexpected PAGING REQ"); - self.stop; + mtc.stop; } [] PCU.receive { repeat; } [] T.timeout { setverdict(fail, "Timeout waiting for PAGING REQ"); - self.stop; + mtc.stop; } } } @@ -2837,7 +2865,7 @@ [] PCU.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_INFO_IND(bts_nr, ?))) -> value sd { if (substr(sd.data.u.info_ind.trx[trx_nr].pdch_mask, g_chan_nr.tn, 1) != '1'B) { setverdict(fail, "PCUIF_INFO_IND PDCH_MASK not '1' after PDCH ACT"); - self.stop; + mtc.stop; } } [] PCU.receive { repeat; } @@ -2858,7 +2886,7 @@ [] PCU.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_INFO_IND(bts_nr, ?))) -> value sd { if (substr(sd.data.u.info_ind.trx[trx_nr].pdch_mask, g_chan_nr.tn, 1) != '0'B) { setverdict(fail, "PCUIF_INFO_IND PDCH_MASK not '0' after PDCH DEACT"); - self.stop; + mtc.stop; } } [] PCU.receive { repeat; } @@ -3021,7 +3049,7 @@ [] PCU.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_INFO_IND(bts_nr, ?))) -> value sd { if (substr(sd.data.u.info_ind.trx[trx_nr].pdch_mask, g_chan_nr.tn, 1) != '1'B) { setverdict(fail, "PCUIF_INFO_IND PDCH_MASK not '1' after PDCH ACT"); - self.stop; + mtc.stop; } } [] PCU.receive { repeat; } @@ -3044,7 +3072,7 @@ [] PCU.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_INFO_IND(bts_nr, ?))) -> value sd { if (substr(sd.data.u.info_ind.trx[trx_nr].pdch_mask, g_chan_nr.tn, 1) != '0'B) { setverdict(fail, "PCUIF_INFO_IND PDCH_MASK not '0' after PDCH DEACT"); - self.stop; + mtc.stop; } } [] PCU.receive { repeat; } @@ -3130,7 +3158,7 @@ [] RSL.receive(tr_RSL_IPA_PDCH_ACT_NACK(g_chan_nr, ?)); [] RSL.receive(tr_RSL_IPA_PDCH_ACT_ACK(g_chan_nr, ?)) { setverdict(fail, "Unexpected PDCH ACT ACK"); - self.stop; + mtc.stop; } [] RSL.receive { repeat; } } @@ -3254,6 +3282,7 @@ setverdict(pass); } else { setverdict(fail, "Unexpected EST IND with L3 in ", tc); + mtc.stop; } } [tc.l3 == ''O] RSL.receive(tr_RSL_EST_IND_NOL3(g_chan_nr, tc.link_id)) { @@ -3261,10 +3290,12 @@ setverdict(pass); } else { setverdict(fail, "Unexpected EST IND without L3 in ", tc); + mtc.stop; } } [tc.exp] T.timeout { setverdict(fail, "Timeout waiting for EST IND"); + mtc.stop; } [not tc.exp] T.timeout { setverdict(pass); @@ -3326,7 +3357,7 @@ [] L1CTL.receive { repeat; } [] T.timeout { setverdict(fail, "Timeout waiting for SABM"); - self.stop; + mtc.stop; } } @@ -3381,7 +3412,7 @@ alt { [] T.timeout { setverdict(fail, "Timeout waiting for LAPDm ", exp); - self.stop; + mtc.stop; } [] as_l1_exp_lapdm(exp); } @@ -3397,7 +3428,7 @@ [l3 == ''O] RSL.receive(tr_RSL_EST_IND_NOL3(g_chan_nr, link_id)); [] RSL.receive(tr_RSL_ERROR_IND(g_chan_nr, link_id, ?)) { setverdict(fail, "Failing due to RSL_ERROR_IND"); - self.stop; + mtc.stop; } [] RSL.receive { repeat; } } @@ -3613,6 +3644,7 @@ } [] T.timeout { setverdict(fail, "Timeout waiting for UNIT_DATA_IND"); + mtc.stop; } [] RSL.receive { repeat; } } @@ -3723,12 +3755,13 @@ lf.ab := dec_LapdmFrameAB(enc); } else { setverdict(fail, "unsupported frame type"); - self.stop; + mtc.stop; } /* check if decoder result matches expectation */ if (not match(lf, exp_match)) { setverdict(fail, name, ": decoded LAPDm doesn't match"); + mtc.stop; } else { log(name, ": matched"); setverdict(pass); @@ -3738,6 +3771,7 @@ reenc := enc_LapdmFrame(lf); if (enc != reenc) { setverdict(fail, name, ": re-encoded LAPDm frame doesn't match"); + mtc.stop; } else { setverdict(pass); } -- To view, visit https://gerrit.osmocom.org/9904 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iba59a69127e845cadbe9aaa1dabd87ff5ce8b43b Gerrit-Change-Number: 9904 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 7 16:19:40 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 7 Jul 2018 16:19:40 +0000 Subject: Change in osmocom-bb[master]: calypso: Print warning about unsupported encryption algorithms In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9906 ) Change subject: calypso: Print warning about unsupported encryption algorithms ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9906 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib9b622dd5c9770c5e97fa58deee124a409544d3b Gerrit-Change-Number: 9906 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Sat, 07 Jul 2018 16:19:40 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 7 16:19:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 7 Jul 2018 16:19:46 +0000 Subject: Change in osmocom-bb[master]: calypso: Print warning about unsupported encryption algorithms In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9906 ) Change subject: calypso: Print warning about unsupported encryption algorithms ...................................................................... calypso: Print warning about unsupported encryption algorithms Unfortunately current code architecture doesn't support a return path with an error so tell the caller of L1CTL on the other side that something's wrong. Change-Id: Ib9b622dd5c9770c5e97fa58deee124a409544d3b --- M src/target/firmware/calypso/dsp.c 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/target/firmware/calypso/dsp.c b/src/target/firmware/calypso/dsp.c index c37ca82..235d359 100644 --- a/src/target/firmware/calypso/dsp.c +++ b/src/target/firmware/calypso/dsp.c @@ -568,6 +568,9 @@ { dsp_api.ndb->d_a5mode = mode; + if (mode >= 3) /* Only A5/0, A5/1, A5/2 are supported by calypso */ + printd("Algo A5/%u is not supported!!!\n", mode); + if (!mode || !key) return; -- To view, visit https://gerrit.osmocom.org/9906 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ib9b622dd5c9770c5e97fa58deee124a409544d3b Gerrit-Change-Number: 9906 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From admin at opensuse.org Sat Jul 7 20:28:15 2018 From: admin at opensuse.org (OBS Notification) Date: Sat, 07 Jul 2018 20:28:15 +0000 Subject: Build failure of network:osmocom:nightly/osmo-mgw in Debian_9.0/armv7l In-Reply-To: References: Message-ID: <5b41226e71e44_26aad46847321a1@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-mgw/Debian_9.0/armv7l Package network:osmocom:nightly/osmo-mgw failed to build in Debian_9.0/armv7l Check out the package for editing: osc checkout network:osmocom:nightly osmo-mgw Last lines of build log: [ 151s] -'10, a:PCMU' -> 'a:PCMU' [ 151s] -'10,a: PCMU' -> 'a: PCMU' [ 151s] -'10 ,a: PCMU' -> 'a: PCMU' [ 151s] -', a:PCMU' -> 'a:PCMU' [ 151s] -' a:PCMU' -> 'a:PCMU' [ 151s] -'' -> '(null)' [ 151s] -p10, aPCMU -> (null) [ 151s] -'10,a :PCMU' -> '(null)' [ 151s] -Done [ 151s] +DLCX failed. [ 151s] +backtrace() returned 0 addresses [ 151s] ./testsuite.at:27: exit code was 134, expected 0 [ 151s] 4. testsuite.at:24: 4. mgcp (testsuite.at:24): FAILED (testsuite.at:27) [ 151s] debian/rules:30: recipe for target 'override_dh_auto_test' failed [ 151s] make[1]: *** [override_dh_auto_test] Error 1 [ 151s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 151s] debian/rules:17: recipe for target 'build' failed [ 151s] make: *** [build] Error 2 [ 151s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 151s] [ 151s] armbuild21 failed "build osmo-mgw_1.3.0.29.cede2.dsc" at Sat Jul 7 20:28:07 UTC 2018. [ 151s] [ 151s] ### VM INTERACTION START ### [ 153s] [ 139.512576] SysRq : Power Off [ 153s] [ 139.513759] reboot: Power down [ 153s] ### VM INTERACTION END ### [ 153s] [ 153s] armbuild21 failed "build osmo-mgw_1.3.0.29.cede2.dsc" at Sat Jul 7 20:28:10 UTC 2018. [ 153s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Sat Jul 7 21:11:05 2018 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sat, 7 Jul 2018 21:11:05 +0000 Subject: Change in osmocom-bb[master]: Move from libc random() to osmo_get_rand_id Message-ID: Holger Freyther has uploaded this change for review. ( https://gerrit.osmocom.org/9914 Change subject: Move from libc random() to osmo_get_rand_id ...................................................................... Move from libc random() to osmo_get_rand_id When starting multiple mobile in the same second, the libc random number generator will be seeded to exactly the same value. The random bits inside the RACH request(s) will be exactly the same across multiple mobile and when the channel fails they all pick the same randomized back-off timing. Use stronger random numbers and replace all calls to random(2) with osmo_get_rand_id. Add a fallback to try random(). Change-Id: Ie0cc64663cd4b90c027b79545dc5d3ac9d87b9dd --- M src/host/layer23/src/mobile/gsm322.c M src/host/layer23/src/mobile/gsm48_mm.c M src/host/layer23/src/mobile/gsm48_rr.c M src/host/layer23/src/mobile/settings.c 4 files changed, 18 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/14/9914/1 diff --git a/src/host/layer23/src/mobile/gsm322.c b/src/host/layer23/src/mobile/gsm322.c index c3485b6..fc90c07 100644 --- a/src/host/layer23/src/mobile/gsm322.c +++ b/src/host/layer23/src/mobile/gsm322.c @@ -959,7 +959,9 @@ entries++; } while(entries) { - move = random() % entries; + if (osmo_get_rand_id((uint8_t *) &move, sizeof(move)) != 0) + move = random() % entries; + move = move % entries; i = 0; llist_for_each_entry(temp, &temp_list, entry) { if (rxlev2dbm(temp->rxlev) > -85) { diff --git a/src/host/layer23/src/mobile/gsm48_mm.c b/src/host/layer23/src/mobile/gsm48_mm.c index a7af1f5..a36e7e8 100644 --- a/src/host/layer23/src/mobile/gsm48_mm.c +++ b/src/host/layer23/src/mobile/gsm48_mm.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -2099,7 +2100,9 @@ mm->t3212.timeout.tv_sec = current_time.tv_sec + (t % s->t3212); } else { - uint32_t rand = random(); + uint32_t rand; + if (osmo_get_rand_id((uint8_t *) &rand, sizeof(rand)) != 0) + rand = random(); LOGP(DMM, LOGL_INFO, "New T3212 while timer is not " "running (value %d)\n", s->t3212); diff --git a/src/host/layer23/src/mobile/gsm48_rr.c b/src/host/layer23/src/mobile/gsm48_rr.c index dd3fe93..db2cb5e 100644 --- a/src/host/layer23/src/mobile/gsm48_rr.c +++ b/src/host/layer23/src/mobile/gsm48_rr.c @@ -71,6 +71,7 @@ #include #include #include +#include #include #include @@ -1628,7 +1629,8 @@ } } - chan_req = random(); + if (osmo_get_rand_id((uint8_t *) &chan_req, sizeof(chan_req)) != 0) + chan_req = random(); chan_req &= rr->chan_req_mask; chan_req |= rr->chan_req_val; diff --git a/src/host/layer23/src/mobile/settings.c b/src/host/layer23/src/mobile/settings.c index 7370b0a..80b0b48 100644 --- a/src/host/layer23/src/mobile/settings.c +++ b/src/host/layer23/src/mobile/settings.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -178,14 +179,19 @@ { int digits = set->imei_random; char rand[16]; + long rand_num; if (digits <= 0) return 0; if (digits > 15) digits = 15; - sprintf(rand, "%08ld", random() % 100000000); - sprintf(rand + 8, "%07ld", random() % 10000000); + if (osmo_get_rand_id((uint8_t *) &rand_num, sizeof(rand_num)) != 0) + rand_num = random(); + sprintf(rand, "%08ld", rand_num % 100000000); + if (osmo_get_rand_id((uint8_t *) &rand_num, sizeof(rand_num)) != 0) + rand_num = random(); + sprintf(rand + 8, "%07ld", rand_num % 10000000); strcpy(set->imei + 15 - digits, rand + 15 - digits); strncpy(set->imeisv, set->imei, 15); -- To view, visit https://gerrit.osmocom.org/9914 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ie0cc64663cd4b90c027b79545dc5d3ac9d87b9dd Gerrit-Change-Number: 9914 Gerrit-PatchSet: 1 Gerrit-Owner: Holger Freyther -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 7 22:36:12 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 7 Jul 2018 22:36:12 +0000 Subject: Change in osmocom-bb[master]: Move from libc random() to osmo_get_rand_id In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/9914 ) Change subject: Move from libc random() to osmo_get_rand_id ...................................................................... Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/9914/1/src/host/layer23/src/mobile/gsm322.c File src/host/layer23/src/mobile/gsm322.c: https://gerrit.osmocom.org/#/c/9914/1/src/host/layer23/src/mobile/gsm322.c at 964 PS1, Line 964: move = move % entries; cosmetic: this line may go under the 'else' part of condition. -- To view, visit https://gerrit.osmocom.org/9914 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie0cc64663cd4b90c027b79545dc5d3ac9d87b9dd Gerrit-Change-Number: 9914 Gerrit-PatchSet: 1 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Sat, 07 Jul 2018 22:36:12 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 7 23:54:04 2018 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sat, 7 Jul 2018 23:54:04 +0000 Subject: Change in osmocom-bb[master]: Move from libc random() to osmo_get_rand_id In-Reply-To: References: Message-ID: Holger Freyther has posted comments on this change. ( https://gerrit.osmocom.org/9914 ) Change subject: Move from libc random() to osmo_get_rand_id ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/9914/1/src/host/layer23/src/mobile/gsm322.c File src/host/layer23/src/mobile/gsm322.c: https://gerrit.osmocom.org/#/c/9914/1/src/host/layer23/src/mobile/gsm322.c at 964 PS1, Line 964: move = move % entries; > cosmetic: this line may go under the 'else' part of condition. it should have read: "move = random()"; because we will execute % random anyway. I will update it. -- To view, visit https://gerrit.osmocom.org/9914 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie0cc64663cd4b90c027b79545dc5d3ac9d87b9dd Gerrit-Change-Number: 9914 Gerrit-PatchSet: 1 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Sat, 07 Jul 2018 23:54:04 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 7 23:54:38 2018 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sat, 7 Jul 2018 23:54:38 +0000 Subject: Change in osmocom-bb[master]: Move from libc random() to osmo_get_rand_id In-Reply-To: References: Message-ID: Hello Vadim Yanitskiy, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9914 to look at the new patch set (#2). Change subject: Move from libc random() to osmo_get_rand_id ...................................................................... Move from libc random() to osmo_get_rand_id When starting multiple mobile in the same second, the libc random number generator will be seeded to exactly the same value. The random bits inside the RACH request(s) will be exactly the same across multiple mobile and when the channel fails they all pick the same randomized back-off timing. Use stronger random numbers and replace all calls to random(2) with osmo_get_rand_id. Add a fallback to try random(). Change-Id: Ie0cc64663cd4b90c027b79545dc5d3ac9d87b9dd --- M src/host/layer23/src/mobile/gsm322.c M src/host/layer23/src/mobile/gsm48_mm.c M src/host/layer23/src/mobile/gsm48_rr.c M src/host/layer23/src/mobile/settings.c 4 files changed, 18 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/14/9914/2 -- To view, visit https://gerrit.osmocom.org/9914 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie0cc64663cd4b90c027b79545dc5d3ac9d87b9dd Gerrit-Change-Number: 9914 Gerrit-PatchSet: 2 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Sun Jul 8 00:06:40 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Sun, 8 Jul 2018 00:06:40 +0000 (UTC) Subject: =?UTF-8?Q?Jenkins_build_is_back_to_normal_?= =?UTF-8?Q?:_master-osmo-mgw_=C2=BB_--enable-mgc?= =?UTF-8?Q?p-transcoding,a2=3Ddefault,a3=3Ddefa?= =?UTF-8?Q?ult,osmocom-master-debian9_#1090?= In-Reply-To: <1040826328.100.1530979597173.JavaMail.jenkins@jenkins.osmocom.org> References: <1040826328.100.1530979597173.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <48088669.101.1531008400627.JavaMail.jenkins@jenkins.osmocom.org> See From jenkins at lists.osmocom.org Sun Jul 8 00:09:21 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Sun, 8 Jul 2018 00:09:21 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-osmo-iuh_=C2=BB_a1=3Ddefaul?= =?UTF-8?Q?t,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#1527?= Message-ID: <1035348100.102.1531008561721.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 678.53 KB...] CC RANAP_CauseMisc.lo CC RANAP_CauseNAS.lo CC RANAP_CauseProtocol.lo In file included from :8:0, from ../../include/osmocom/ranap/RANAP_AuthorisedPLMNs.h:14, from RANAP_AuthorisedPLMNs.c:7: ../../include/osmocom/ranap/RANAP_AuthorisedPLMNs.h:27:23: warning: ?struct MemberC? declared inside parameter list will not be visible outside of this definition or declaration A_SEQUENCE_OF(struct MemberC { ^ :17:16: note: in definition of macro ?A_SET_OF? void (*free)(type *); \ ^~~~ ../../include/osmocom/ranap/RANAP_AuthorisedPLMNs.h:27:2: note: in expansion of macro ?A_SEQUENCE_OF? A_SEQUENCE_OF(struct MemberC { ^~~~~~~~~~~~~ CC RANAP_CauseRadioNetwork.lo CC RANAP_CauseRadioNetworkExtension.lo CC RANAP_CauseNon-Standard.lo CC RANAP_CauseTransmissionNetwork.lo CC RANAP_Cell-Access-Mode.lo CC RANAP_CellBased.lo CC RANAP_CellIdList.lo CC RANAP_Cell-Id.lo CC RANAP_Cell-Capacity-Class-Value.lo CC RANAP_CellLoadInformation.lo CC RANAP_CellLoadInformationGroup.lo CC RANAP_CellType.lo CC RANAP_ClientType.lo CC RANAP_CriticalityDiagnostics.lo CC RANAP_CriticalityDiagnostics-IE-List.lo CC RANAP_MessageStructure.lo CC RANAP_CGI.lo CC RANAP_ChosenEncryptionAlgorithm.lo CC RANAP_ChosenIntegrityProtectionAlgorithm.lo In file included from :8:0, from ../../include/osmocom/ranap/RANAP_CriticalityDiagnostics-IE-List.h:14, from ../../include/osmocom/ranap/RANAP_CriticalityDiagnostics.h:17, from RANAP_CriticalityDiagnostics.c:7: ../../include/osmocom/ranap/RANAP_CriticalityDiagnostics-IE-List.h:28:23: warning: ?struct MemberG? declared inside parameter list will not be visible outside of this definition or declaration A_SEQUENCE_OF(struct MemberG { ^ :17:16: note: in definition of macro ?A_SET_OF? void (*free)(type *); \ ^~~~ ../../include/osmocom/ranap/RANAP_CriticalityDiagnostics-IE-List.h:28:2: note: in expansion of macro ?A_SEQUENCE_OF? A_SEQUENCE_OF(struct MemberG { ^~~~~~~~~~~~~ CC RANAP_CI.lo In file included from :8:0, from ../../include/osmocom/ranap/RANAP_CriticalityDiagnostics-IE-List.h:14, from RANAP_CriticalityDiagnostics-IE-List.c:7: ../../include/osmocom/ranap/RANAP_CriticalityDiagnostics-IE-List.h:28:23: warning: ?struct MemberG? declared inside parameter list will not be visible outside of this definition or declaration A_SEQUENCE_OF(struct MemberG { ^ :17:16: note: in definition of macro ?A_SET_OF? void (*free)(type *); \ ^~~~ ../../include/osmocom/ranap/RANAP_CriticalityDiagnostics-IE-List.h:28:2: note: in expansion of macro ?A_SEQUENCE_OF? A_SEQUENCE_OF(struct MemberG { ^~~~~~~~~~~~~ CC RANAP_ClassmarkInformation2.lo In file included from :8:0, from ../../include/osmocom/ranap/RANAP_MessageStructure.h:14, from RANAP_MessageStructure.c:7: ../../include/osmocom/ranap/RANAP_MessageStructure.h:27:23: warning: ?struct MemberL? declared inside parameter list will not be visible outside of this definition or declaration A_SEQUENCE_OF(struct MemberL { ^ :17:16: note: in definition of macro ?A_SET_OF? void (*free)(type *); \ ^~~~ ../../include/osmocom/ranap/RANAP_MessageStructure.h:27:2: note: in expansion of macro ?A_SEQUENCE_OF? A_SEQUENCE_OF(struct MemberL { ^~~~~~~~~~~~~ CC RANAP_ClassmarkInformation3.lo CC RANAP_CN-DomainIndicator.lo CC RANAP_CN-ID.lo CC RANAP_Correlation-ID.lo CC RANAP_CSFB-Information.lo CC RANAP_CSG-Id.lo CC RANAP_CSG-Id-List.lo CC RANAP_CSG-Membership-Status.lo CC RANAP_DataPDUType.lo CC RANAP_DataVolumeReference.lo CC RANAP_DataVolumeReportingIndication.lo CC RANAP_DCH-ID.lo CC RANAP_DeliveryOfErroneousSDU.lo CC RANAP_DeliveryOrder.lo CC RANAP_DeltaRAListofIdleModeUEs.lo CC RANAP_NewRAListofIdleModeUEs.lo CC RANAP_RAListwithNoIdleModeUEsAnyMore.lo CC RANAP_ForwardingIndication.lo CC RANAP_DL-GTP-PDU-SequenceNumber.lo CC RANAP_DL-N-PDU-SequenceNumber.lo CC RANAP_D-RNTI.lo CC RANAP_DRX-CycleLengthCoefficient.lo CC RANAP_DSCH-ID.lo CC RANAP_EARFCN-Extended.lo CC RANAP_E-DCH-MAC-d-Flow-ID.lo CC RANAP_ENB-ID.lo CC RANAP_EncryptionAlgorithm.lo CC RANAP_EncryptionInformation.lo CC RANAP_EncryptionKey.lo CC RANAP_End-Of-CSFB.lo CC RANAP_EquipmentsToBeTraced.lo CC RANAP_E-UTRAN-Service-Handover.lo CC RANAP_Event.lo CC RANAP_Event1F-Parameters.lo CC RANAP_Event1I-Parameters.lo CC RANAP_ExtendedGuaranteedBitrate.lo CC RANAP_ExtendedMaxBitrate.lo CC RANAP_ExtendedRNC-ID.lo CC RANAP_FrameSequenceNumber.lo CC RANAP_FrequenceLayerConvergenceFlag.lo CC RANAP_GANSS-PositioningDataSet.lo CC RANAP_GANSS-PositioningMethodAndUsage.lo CC RANAP_GeographicalArea.lo CC RANAP_GeographicalCoordinates.lo In file included from :8:0, from ../../include/osmocom/ranap/RANAP_IE-Extensions.h:15, from ../../include/osmocom/ranap/RANAP_GeographicalCoordinates.h:16, from ../../include/osmocom/ranap/RANAP_GA-Point.h:14, from ../../include/osmocom/ranap/RANAP_GeographicalArea.h:14, from RANAP_GeographicalArea.c:7: ../../include/osmocom/ranap/RANAP_GA-Polygon.h:26:23: warning: ?struct Member? declared inside parameter list will not be visible outside of this definition or declaration A_SEQUENCE_OF(struct Member { ^ :17:16: note: in definition of macro ?A_SET_OF? void (*free)(type *); \ ^~~~ ../../include/osmocom/ranap/RANAP_GA-Polygon.h:26:2: note: in expansion of macro ?A_SEQUENCE_OF? A_SEQUENCE_OF(struct Member { ^~~~~~~~~~~~~ CC RANAP_GA-AltitudeAndDirection.lo CC RANAP_GA-EllipsoidArc.lo CC RANAP_GA-Point.lo CC RANAP_GA-PointWithAltitudeAndUncertaintyEllipsoid.lo CC RANAP_GA-PointWithAltitude.lo CC RANAP_GA-PointWithUnCertainty.lo CC RANAP_GA-PointWithUnCertaintyEllipse.lo CC RANAP_GA-Polygon.lo CC RANAP_GA-UncertaintyEllipse.lo CC RANAP_GERAN-BSC-Container.lo CC RANAP_GERAN-Cell-ID.lo CC RANAP_GERAN-Classmark.lo CC RANAP_GlobalCN-ID.lo CC RANAP_GlobalRNC-ID.lo CC RANAP_GTP-TEI.lo In file included from :8:0, from ../../include/osmocom/ranap/RANAP_GA-Polygon.h:14, from RANAP_GA-Polygon.c:7: ../../include/osmocom/ranap/RANAP_GA-Polygon.h:26:23: warning: ?struct Member? declared inside parameter list will not be visible outside of this definition or declaration A_SEQUENCE_OF(struct Member { ^ :17:16: note: in definition of macro ?A_SET_OF? void (*free)(type *); \ ^~~~ ../../include/osmocom/ranap/RANAP_GA-Polygon.h:26:2: note: in expansion of macro ?A_SEQUENCE_OF? A_SEQUENCE_OF(struct Member { ^~~~~~~~~~~~~ CC RANAP_GuaranteedBitrate.lo CC RANAP_HigherBitratesThan16MbpsFlag.lo CC RANAP_HS-DSCH-MAC-d-Flow-ID.lo CC RANAP_IMEI.lo CC RANAP_IMEIGroup.lo CC RANAP_IMEIList.lo CC RANAP_IMEISV.lo CC RANAP_IMEISVGroup.lo CC RANAP_IMEISVList.lo CC RANAP_ImmediateMDT.lo CC RANAP_IMSI.lo CC RANAP_IncludeVelocity.lo CC RANAP_InformationExchangeID.lo CC RANAP_InformationExchangeType.lo CC RANAP_InformationRequested.lo CC RANAP_InformationRequestType.lo CC RANAP_InformationTransferID.lo CC RANAP_InformationTransferType.lo CC RANAP_IntegrityProtectionAlgorithm.lo CC RANAP_IntegrityProtectionInformation.lo CC RANAP_IntegrityProtectionKey.lo CC RANAP_InterSystemInformationTransferType.lo CC RANAP_InterSystemInformation-TransparentContainer.lo CC RANAP_IPMulticastAddress.lo CC RANAP_IuSignallingConnectionIdentifier.lo CC RANAP_IuTransportAssociation.lo CC RANAP_KeyStatus.lo CC RANAP_LA-LIST.lo CC RANAP_LAC.lo CC RANAP_LAI.lo CC RANAP_LastKnownServiceArea.lo CC RANAP_LastVisitedUTRANCell-Item.lo CC RANAP_LHN-ID.lo In file included from :8:0, from ../../include/osmocom/ranap/RANAP_LA-LIST.h:14, from RANAP_LA-LIST.c:7: ../../include/osmocom/ranap/RANAP_LA-LIST.h:27:23: warning: ?struct MemberA? declared inside parameter list will not be visible outside of this definition or declaration A_SEQUENCE_OF(struct MemberA { ^ :17:16: note: in definition of macro ?A_SET_OF? void (*free)(type *); \ ^~~~ ../../include/osmocom/ranap/RANAP_LA-LIST.h:27:2: note: in expansion of macro ?A_SEQUENCE_OF? A_SEQUENCE_OF(struct MemberA { ^~~~~~~~~~~~~ CC RANAP_Links-to-log.lo CC RANAP_ListOF-SNAs.lo CC RANAP_ListOfInterfacesToTrace.lo CC RANAP_InterfacesToTraceItem.lo CC RANAP_LoadValue.lo CC RANAP_LocationRelatedDataRequestType.lo CC RANAP_LocationRelatedDataRequestTypeSpecificToGERANIuMode.lo CC RANAP_LocationReportingTransferInformation.lo CC RANAP_ReportChangeOfSAI.lo CC RANAP_PeriodicReportingIndicator.lo CC RANAP_DirectReportingIndicator.lo CC RANAP_L3-Information.lo CC RANAP_M1Report.lo CC RANAP_M2Report.lo CC RANAP_M4Report.lo CC RANAP_M4-Collection-Parameters.lo CC RANAP_M4-Period.lo CC RANAP_M4-Threshold.lo CC RANAP_M5Report.lo CC RANAP_M5-Period.lo CC RANAP_M6Report.lo CC RANAP_M6-Period.lo CC RANAP_M7Report.lo CC RANAP_M7-Period.lo malloc: .././make_cmd.c:103: assertion botched malloc: block on free list clobbered Aborting.../bin/bash: line 1: 8013 Aborted /bin/bash ../../libtool --silent --tag=CC --mode=compile gcc -DPACKAGE_NAME=\"osmo-iuh\" -DPACKAGE_TARNAME=\"osmo-iuh\" -DPACKAGE_VERSION=\"0.3.0.1-7a97f\" -DPACKAGE_STRING=\"osmo-iuh\ 0.3.0.1-7a97f\" -DPACKAGE_BUGREPORT=\"openbsc at lists.osmocom.org\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DPACKAGE=\"osmo-iuh\" -DVERSION=\"0.3.0.1-7a97f\" -DSTDC_HEADERS=1 -I. -fsanitize=address -fsanitize=undefined -Wall -I../../include -I -I -I -g -O2 -fsanitize=address -fsanitize=undefined -Wall -MT RANAP_M4-Threshold.lo -MD -MP -MF .deps/RANAP_M4-Threshold.Tpo -c -o RANAP_M4-Threshold.lo RANAP_M4-Threshold.c Makefile:2505: recipe for target 'RANAP_M4-Threshold.lo' failed make[4]: *** [RANAP_M4-Threshold.lo] Error 134 make[4]: *** Waiting for unfinished jobs.... make[4]: Leaving directory ' Makefile:641: recipe for target 'all-recursive' failed make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory ' Makefile:453: recipe for target 'all' failed make[2]: *** [all] Error 2 make[2]: Leaving directory ' Makefile:454: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory ' Makefile:378: recipe for target 'all' failed make: *** [all] Error 2 Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Sun Jul 8 00:51:26 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 8 Jul 2018 00:51:26 +0000 Subject: Change in osmocom-bb[master]: Move from libc random() to osmo_get_rand_id In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/9914 ) Change subject: Move from libc random() to osmo_get_rand_id ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/9914 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie0cc64663cd4b90c027b79545dc5d3ac9d87b9dd Gerrit-Change-Number: 9914 Gerrit-PatchSet: 2 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Sun, 08 Jul 2018 00:51:26 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Sun Jul 8 00:59:43 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Sun, 8 Jul 2018 00:59:43 +0000 (UTC) Subject: =?UTF-8?Q?Jenkins_build_is_back_to_normal_:_master-osmo-iuh_=C2=BB_a1=3Dd?= =?UTF-8?Q?efault,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#1528?= In-Reply-To: <1035348100.102.1531008561721.JavaMail.jenkins@jenkins.osmocom.org> References: <1035348100.102.1531008561721.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <1469603998.103.1531011583407.JavaMail.jenkins@jenkins.osmocom.org> See From jenkins at lists.osmocom.org Sun Jul 8 12:26:47 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Sun, 8 Jul 2018 12:26:47 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-gapk_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#14?= In-Reply-To: <1605326291.98.1530966407878.JavaMail.jenkins@jenkins.osmocom.org> References: <1605326291.98.1530966407878.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <845334203.115.1531052807467.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 127.05 KB...] checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether make supports nested variables... (cached) yes checking if gcc supports -fvisibility=hidden... yes checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking whether gcc understands -c and -o together... (cached) yes checking dependency style of gcc... (cached) gcc3 checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for LIBOSMOCORE... yes checking for LIBOSMOCODEC... yes checking for LIBALSA... yes checking for OPENCORE_AMRNB... yes checking gsm/gsm.h usability... yes checking gsm/gsm.h presence... yes checking for gsm/gsm.h... yes checking for gsm_create in -lgsm... yes checking for stdint.h... (cached) yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking for unistd.h... (cached) yes checking for inline... inline checking for int16_t... yes checking for int32_t... yes checking for uint16_t... yes checking for uint32_t... yes checking for uint64_t... yes checking for uint8_t... yes checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... yes checking for memset... yes checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating src/Makefile config.status: creating libgsmhr/Makefile config.status: creating include/Makefile config.status: creating include/gsmhr/Makefile config.status: creating libosmogapk.pc config.status: creating tests/atlocal config.status: creating tests/Makefile config.status: creating config.h config.status: executing depfiles commands config.status: executing libtool commands config.status: executing tests/atconfig commands make[1]: Entering directory ' make all-recursive make[2]: Entering directory ' Making all in include make[3]: Entering directory ' make[4]: Entering directory ' make[4]: Nothing to be done for 'all-am'. make[4]: Leaving directory ' make[3]: Leaving directory ' Making all in src make[3]: Entering directory ' CC procqueue.lo CC pq_format.lo CC pq_codec.lo CC pq_file.lo CC pq_alsa.lo CC pq_rtp.lo CC pq_ecu.lo CC ecu_fr.lo CC formats.lo CC fmt_ti.lo CC fmt_amr.lo CC fmt_gsm.lo CC fmt_hr_ref.lo CC fmt_racal.lo CC fmt_rawpcm.lo CC fmt_rtp_amr.lo CC fmt_rtp_efr.lo CC fmt_rtp_hr_etsi.lo CC fmt_rtp_hr_ietf.lo CC fmt_amr_opencore.lo CC codecs.lo CC codec_pcm.lo CC codec_hr.lo CC codec_fr.lo CC codec_efr.lo CC codec_amr.lo CC benchmark.lo CC common.lo CCLD libosmogapk.la CC app_osmo_gapk.o CCLD osmo-gapk make[3]: Leaving directory ' Making all in tests make[3]: Entering directory ' make[3]: Nothing to be done for 'all'. make[3]: Leaving directory ' make[3]: Entering directory ' make[3]: Leaving directory ' make[2]: Leaving directory ' make[1]: Leaving directory ' make[1]: Entering directory ' Making dvi in include make[2]: Entering directory ' make[3]: Entering directory ' make[3]: Nothing to be done for 'dvi-am'. make[3]: Leaving directory ' make[2]: Leaving directory ' Making dvi in src make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi'. make[2]: Leaving directory ' Making dvi in tests make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi'. make[2]: Leaving directory ' make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi-am'. make[2]: Leaving directory ' make[1]: Leaving directory ' make[1]: Entering directory ' Making check in include make[2]: Entering directory ' make[3]: Entering directory ' make[3]: Nothing to be done for 'check-am'. make[3]: Leaving directory ' make[2]: Leaving directory ' Making check in src make[2]: Entering directory ' make[2]: Nothing to be done for 'check'. make[2]: Leaving directory ' Making check in tests make[2]: Entering directory ' make procqueue/pq_test io/pq_file_test io/pq_rtp_test ecu/ecu_fr_test make[3]: Entering directory ' CC procqueue/pq_test.o CCLD procqueue/pq_test CC io/pq_file_test.o CCLD io/pq_file_test CC io/pq_rtp_test.o CCLD io/pq_rtp_test CC ecu/ecu_fr_test.o CCLD ecu/ecu_fr_test make[3]: Leaving directory ' make check-local make[3]: Entering directory ' /bin/bash '../../../tests/testsuite' ## ---------------------------- ## ## gapk 0.4.75-27bc test suite. ## ## ---------------------------- ## Regression tests. 1: procqueue ok 2: io/pq_file FAILED (testsuite.at:13) 3: io/pq_rtp ok 4: ecu/ecu_fr_test ok 5: conv/enc/amr_efr ok 6: conv/enc/gsm ok 7: conv/enc/racal_hr skipped (testsuite.at:58) 8: conv/enc/racal_fr ok 9: conv/enc/racal_efr ok 10: conv/enc/ti_hr skipped (testsuite.at:91) 11: conv/enc/ti_fr ok 12: conv/enc/ti_efr ok 13: conv/enc/rtp_efr ok 14: conv/enc/rtp_hr_etsi skipped (testsuite.at:135) 15: conv/enc/rtp_hr_ietf skipped (testsuite.at:146) 16: conv/dec/amr_efr ok 17: conv/dec/gsm ok 18: conv/dec/racal_hr skipped (testsuite.at:179) 19: conv/dec/racal_fr ok 20: conv/dec/racal_efr ok 21: conv/dec/ti_hr skipped (testsuite.at:212) 22: conv/dec/ti_fr ok 23: conv/dec/ti_efr ok 24: conv/dec/rtp_efr ok 25: conv/dec/rtp_hr_etsi skipped (testsuite.at:256) 26: conv/dec/rtp_hr_ietf skipped (testsuite.at:267) ## ------------- ## ## Test results. ## ## ------------- ## ERROR: 18 tests were run, 1 failed unexpectedly. 8 tests were skipped. ## -------------------------- ## ## testsuite.log was created. ## ## -------------------------- ## Please send `tests/testsuite.log' and all information you think might help: To: Subject: [gapk 0.4.75-27bc] testsuite: 2 failed You may investigate any problem if you feel able to do so, in which case the test suite provides a good starting point. Its output may be found below `tests/testsuite.dir'. Makefile:753: recipe for target 'check-local' failed make[3]: *** [check-local] Error 1 make[3]: Leaving directory ' Makefile:602: recipe for target 'check-am' failed make[2]: *** [check-am] Error 2 make[2]: Leaving directory ' Makefile:479: recipe for target 'check-recursive' failed make[1]: *** [check-recursive] Error 1 make[1]: Leaving directory ' Makefile:684: recipe for target 'distcheck' failed make: *** [distcheck] Error 1 + cat-testlogs.sh ======================== ./gapk-0.4.75-27bc/_build/sub/tests/testsuite.dir/02/testsuite.log # -*- compilation -*- 2. testsuite.at:10: testing io/pq_file ... ../../../tests/testsuite.at:13: $abs_top_builddir/tests/io/pq_file_test \ $abs_top_builddir/tests/io/io_sample.txt --- /dev/null 2018-03-27 19:17:06.212284948 +0000 +++ 2018-07-08 12:26:46.759059552 +0000 @@ -0,0 +1,2 @@ +pq_file_test: ../../../tests/io/pq_file_test.c:132: main: Assertion `sample_file != NULL' failed. +: line 29: 16539 Aborted $abs_top_builddir/tests/io/pq_file_test $abs_top_builddir/tests/io/io_sample.txt --- expout 2018-07-08 12:26:46.751059597 +0000 +++ 2018-07-08 12:26:46.751059597 +0000 @@ -1,12 +0,0 @@ -Processing sample file with blk_len=2: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=4: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=8: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=16: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=32: -8217c8fb7675a95008f9089d883gapk - -chunk null_context: depth=0 ../../../tests/testsuite.at:13: exit code was 134, expected 0 2. testsuite.at:10: 2. io/pq_file (testsuite.at:10): FAILED (testsuite.at:13) Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From jenkins at lists.osmocom.org Sun Jul 8 15:10:06 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Sun, 8 Jul 2018 15:10:06 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-asn1c_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#178?= In-Reply-To: <1936162015.99.1530976206463.JavaMail.jenkins@jenkins.osmocom.org> References: <1936162015.99.1530976206463.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <992330324.116.1531062606385.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 3.67 KB...] + ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for style of include used by make... GNU checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking how to run the C++ preprocessor... g++ -E checking for g77... no checking for f77... no checking for xlf... no checking for frt... no checking for pgf77... no checking for cf77... no checking for fort77... no checking for fl32... no checking for af77... no checking for f90... no checking for xlf90... no checking for pgf90... no checking for pghpf... no checking for epcf90... no checking for gfortran... no checking for g95... no checking for f95... no checking for fort... no checking for xlf95... no checking for ifort... no checking for ifc... no checking for efc... no checking for pgf95... no checking for lf95... no checking for ftn... no checking whether we are using the GNU Fortran 77 compiler... no checking whether accepts -g... no checking the maximum length of command line arguments... 32768 checking command to parse /usr/bin/nm -B output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes configure: creating libtool appending configuration tag "CXX" to libtool checking for ld used by g++... /usr/bin/ld -m elf_x86_64 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC checking if g++ PIC flag -fPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate appending configuration tag "F77" to libtool checking for autoconf... /usr/bin/autoconf checking for autoheader... /usr/bin/autoheader checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking dependency style of gcc... (cached) gcc3 checking how to run the C preprocessor... gcc -E checking for a BSD-compatible install... /usr/bin/install -c checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking for bison... bison -y checking for flex... flex checking for yywrap in -lfl... yes checking lex output file root... lex.yy checking whether yytext is a pointer... yes checking for ar... /usr/bin/ar checking for ANSI C header files... (cached) yes checking sys/param.h usability... yes checking sys/param.h presence... yes checking for sys/param.h... yes checking whether byte ordering is bigendian... no checking for off_t... yes checking for size_t... yes checking whether struct tm is in sys/time.h or time.h... time.h checking for intmax_t... yes checking for library containing getopt... none required checking for strtoimax... yes checking for strtoll... yes checking for mergesort... no checking for mkstemps... yes configure: creating ./config.status config.status: creating skeletons/standard-modules/Makefile config.status: creating skeletons/tests/Makefile config.status: creating libasn1compiler/Makefile config.status: creating libasn1parser/Makefile config.status: creating libasn1print/Makefile config.status: creating asn1c/webcgi/Makefile config.status: creating asn1c/tests/Makefile config.status: creating libasn1fix/Makefile config.status: creating skeletons/Makefile config.status: creating examples/Makefile config.status: creating tests/Makefile config.status: creating asn1c/Makefile config.status: creating doc/Makefile config.status: creating asn1c.spec config.status: creating Makefile config.status: creating config.h config.status: executing depfiles commands + make -j 8 make all-recursive make[1]: Entering directory ' Making all in libasn1parser make[2]: Entering directory ' if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF ".deps/asn1parser.Tpo" -c -o asn1parser.lo asn1parser.c; \ then mv -f ".deps/asn1parser.Tpo" ".deps/asn1parser.Plo"; else rm -f ".deps/asn1parser.Tpo"; exit 1; fi bison -y -p asn1p_ -d asn1p_y.y if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF ".deps/asn1p_l.Tpo" -c -o asn1p_l.lo asn1p_l.c; \ then mv -f ".deps/asn1p_l.Tpo" ".deps/asn1p_l.Plo"; else rm -f ".deps/asn1p_l.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF ".deps/asn1p_module.Tpo" -c -o asn1p_module.lo asn1p_module.c; \ then mv -f ".deps/asn1p_module.Tpo" ".deps/asn1p_module.Plo"; else rm -f ".deps/asn1p_module.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF ".deps/asn1p_oid.Tpo" -c -o asn1p_oid.lo asn1p_oid.c; \ then mv -f ".deps/asn1p_oid.Tpo" ".deps/asn1p_oid.Plo"; else rm -f ".deps/asn1p_oid.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF ".deps/asn1p_value.Tpo" -c -o asn1p_value.lo asn1p_value.c; \ then mv -f ".deps/asn1p_value.Tpo" ".deps/asn1p_value.Plo"; else rm -f ".deps/asn1p_value.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF ".deps/asn1p_expr.Tpo" -c -o asn1p_expr.lo asn1p_expr.c; \ then mv -f ".deps/asn1p_expr.Tpo" ".deps/asn1p_expr.Plo"; else rm -f ".deps/asn1p_expr.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF ".deps/asn1p_xports.Tpo" -c -o asn1p_xports.lo asn1p_xports.c; \ then mv -f ".deps/asn1p_xports.Tpo" ".deps/asn1p_xports.Plo"; else rm -f ".deps/asn1p_xports.Tpo"; exit 1; fi asn1p_y.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] mkdir .libs gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -fPIC -DPIC -o .libs/asn1p_value.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -fPIC -DPIC -o .libs/asn1p_xports.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -fPIC -DPIC -o .libs/asn1p_expr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -fPIC -DPIC -o .libs/asn1parser.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -fPIC -DPIC -o .libs/asn1p_l.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -fPIC -DPIC -o .libs/asn1p_module.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -fPIC -DPIC -o .libs/asn1p_oid.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -o asn1p_xports.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -o asn1p_module.o >/dev/null 2>&1 asn1p_l.c:3521:12: warning: 'input' defined but not used [-Wunused-function] static int input() ^~~~~ if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF ".deps/asn1p_constr.Tpo" -c -o asn1p_constr.lo asn1p_constr.c; \ then mv -f ".deps/asn1p_constr.Tpo" ".deps/asn1p_constr.Plo"; else rm -f ".deps/asn1p_constr.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -o asn1parser.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -o asn1p_value.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -o asn1p_oid.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF ".deps/asn1p_param.Tpo" -c -o asn1p_param.lo asn1p_param.c; \ then mv -f ".deps/asn1p_param.Tpo" ".deps/asn1p_param.Plo"; else rm -f ".deps/asn1p_param.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -o asn1p_expr.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF ".deps/asn1p_class.Tpo" -c -o asn1p_class.lo asn1p_class.c; \ then mv -f ".deps/asn1p_class.Tpo" ".deps/asn1p_class.Plo"; else rm -f ".deps/asn1p_class.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF ".deps/asn1p_ref.Tpo" -c -o asn1p_ref.lo asn1p_ref.c; \ then mv -f ".deps/asn1p_ref.Tpo" ".deps/asn1p_ref.Plo"; else rm -f ".deps/asn1p_ref.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -fPIC -DPIC -o .libs/asn1p_constr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -fPIC -DPIC -o .libs/asn1p_param.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -fPIC -DPIC -o .libs/asn1p_class.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -fPIC -DPIC -o .libs/asn1p_ref.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -o asn1p_param.o >/dev/null 2>&1 if test -f y.tab.h; then \ to=`echo "asn1p_y_H" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \ sed -e "/^#/!b" -e "s/Y_TAB_H/$to/g" -e "s|y\.tab\.h|asn1p_y.h|" \ y.tab.h >asn1p_y.ht; \ rm -f y.tab.h; \ if cmp -s asn1p_y.ht asn1p_y.h; then \ rm -f asn1p_y.ht ;\ else \ mv asn1p_y.ht asn1p_y.h; \ fi; \ fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -o asn1p_constr.o >/dev/null 2>&1 if test -f y.output; then \ mv y.output asn1p_y.output; \ fi sed '/^#/ s|y\.tab\.c|asn1p_y.c|' y.tab.c >asn1p_y.ct && mv asn1p_y.ct asn1p_y.c rm -f y.tab.c if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF ".deps/asn1p_y.Tpo" -c -o asn1p_y.lo asn1p_y.c; \ then mv -f ".deps/asn1p_y.Tpo" ".deps/asn1p_y.Plo"; else rm -f ".deps/asn1p_y.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -o asn1p_ref.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -o asn1p_class.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -o asn1p_l.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF .deps/asn1p_y.Tpo -c asn1p_y.c -fPIC -DPIC -o .libs/asn1p_y.o asn1p_y.y: In function 'asn1p_parse': asn1p_y.y:357:13: error: 'param' undeclared (first use in this function) *(void **)param = $1; ^~~~~ asn1p_y.y:357:13: note: each undeclared identifier is reported only once for each function it appears in Makefile:299: recipe for target 'asn1p_y.lo' failed make[2]: *** [asn1p_y.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory ' Makefile:302: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory ' Makefile:212: recipe for target 'all' failed make: *** [all] Error 2 Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Sun Jul 8 15:36:18 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Sun, 8 Jul 2018 15:36:18 +0000 Subject: Change in simtrace2[master]: host: set license to GPLv2+ Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9915 Change subject: host: set license to GPLv2+ ...................................................................... host: set license to GPLv2+ Change-Id: I0948d74874af1d3a0f1b4cbcb4a838e4ecd9fe3f --- M host/apdu_dispatch.c M host/apdu_dispatch.h M host/libusb_util.c M host/libusb_util.h M host/simtrace2-discovery.c M host/simtrace2-discovery.h M host/simtrace2-remsim.c M host/simtrace2-sniff.c M host/simtrace2_usb.c M host/usb2udp.c 10 files changed, 134 insertions(+), 30 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/15/9915/1 diff --git a/host/apdu_dispatch.c b/host/apdu_dispatch.c index 6bdba9f..080ab82 100644 --- a/host/apdu_dispatch.c +++ b/host/apdu_dispatch.c @@ -2,20 +2,19 @@ * * (C) 2016 by Harald Welte * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 - * as published by the Free Software Foundation + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation * - * This program 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 General Public License for more details. + * This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; 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 General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - #include #include #include diff --git a/host/apdu_dispatch.h b/host/apdu_dispatch.h index c76c8ec..b5fe3a2 100644 --- a/host/apdu_dispatch.h +++ b/host/apdu_dispatch.h @@ -1,3 +1,20 @@ +/* apdu_dispatch - State machine to determine Rx/Tx phases of APDU + * + * (C) 2016 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #pragma once #include diff --git a/host/libusb_util.c b/host/libusb_util.c index 5ee685e..4846cab 100644 --- a/host/libusb_util.c +++ b/host/libusb_util.c @@ -1,3 +1,20 @@ +/* libisb utilities + * + * (C) 2010-2016 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #include #include #include diff --git a/host/libusb_util.h b/host/libusb_util.h index 5bbe3cb..c2b646f 100644 --- a/host/libusb_util.h +++ b/host/libusb_util.h @@ -1,3 +1,20 @@ +/* libisb utilities + * + * (C) 2010-2016 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #pragma once #include diff --git a/host/simtrace2-discovery.c b/host/simtrace2-discovery.c index 38868fb..15b922d 100644 --- a/host/simtrace2-discovery.c +++ b/host/simtrace2-discovery.c @@ -1,3 +1,21 @@ +/* simtrace2-discovery - host PC library to scan for matching USB + * devices + * + * (C) 2016 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #include #include diff --git a/host/simtrace2-discovery.h b/host/simtrace2-discovery.h index 539b471..c0db266 100644 --- a/host/simtrace2-discovery.h +++ b/host/simtrace2-discovery.h @@ -1,3 +1,21 @@ +/* simtrace2-discovery - host PC library to scan for matching USB + * devices + * + * (C) 2016 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #pragma once #include diff --git a/host/simtrace2-remsim.c b/host/simtrace2-remsim.c index df38f77..6b49f4a 100644 --- a/host/simtrace2-remsim.c +++ b/host/simtrace2-remsim.c @@ -1,21 +1,21 @@ -/* simtrace2-remsim - main program for the host PC +/* simtrace2-remsim - main program for the host PC to provide a remote SIM + * using the SIMtrace 2 firmware in card emulation mode * - * (C) 2010-2017 by Harald Welte + * (C) 2016 by Harald Welte * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 - * as published by the Free Software Foundation + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation * - * This program 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 General Public License for more details. + * This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; 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 General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - #include #include #include diff --git a/host/simtrace2-sniff.c b/host/simtrace2-sniff.c index 67bfb79..b61b7d0 100644 --- a/host/simtrace2-sniff.c +++ b/host/simtrace2-sniff.c @@ -1,5 +1,10 @@ -/* simtrace2-sniff - main program for the host PC to communicate with the SIMtrace 2 firmware in sniffer mode */ -/* This program is free software; you can redistribute it and/or +/* simtrace2-sniff - main program for the host PC to communicate with the + * SIMtrace 2 firmware in sniffer mode + * + * (C) 2016 by Harald Welte + * (C) 2018 by sysmocom -s.f.m.c. GmbH, Author: Kevin Redon + * + * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. @@ -12,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * (C) 2010-2017 by Harald Welte - * (C) 2018 by Kevin Redon */ #include #include diff --git a/host/simtrace2_usb.c b/host/simtrace2_usb.c index 2016670..353e187 100644 --- a/host/simtrace2_usb.c +++ b/host/simtrace2_usb.c @@ -1,3 +1,20 @@ +/* simtrace2_usb - host PC application to list found SIMtrace 2 USB devices + * + * (C) 2016 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #include #include #include diff --git a/host/usb2udp.c b/host/usb2udp.c index 7a1e4a3..e78dc91 100644 --- a/host/usb2udp.c +++ b/host/usb2udp.c @@ -15,7 +15,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - #include #include #include -- To view, visit https://gerrit.osmocom.org/9915 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I0948d74874af1d3a0f1b4cbcb4a838e4ecd9fe3f Gerrit-Change-Number: 9915 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 8 15:36:19 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Sun, 8 Jul 2018 15:36:19 +0000 Subject: Change in simtrace2[master]: firmware: set license to GPLv2+ Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9916 Change subject: firmware: set license to GPLv2+ ...................................................................... firmware: set license to GPLv2+ Change-Id: Id4c00159f984976b6d8641900fb64e36a3a30407 --- M firmware/apps/cardem/main.c M firmware/apps/dfu/main.c M firmware/apps/trace/main.c M firmware/apps/triple_play/main.c M firmware/libboard/common/include/board_common.h M firmware/libboard/common/include/board_lowlevel.h M firmware/libboard/common/include/boardver_adc.h M firmware/libboard/common/include/led.h M firmware/libboard/common/include/manifest.h M firmware/libboard/common/include/sim_switch.h M firmware/libboard/common/include/uart_console.h M firmware/libboard/common/source/board_cstartup_gnu.c M firmware/libboard/common/source/boardver_adc.c M firmware/libboard/common/source/led.c M firmware/libboard/common/source/manifest.c M firmware/libboard/common/source/sim_switch.c M firmware/libboard/owhw/include/board.h M firmware/libboard/owhw/source/owhw.c M firmware/libboard/qmod/include/board.h M firmware/libboard/qmod/include/card_pres.h M firmware/libboard/qmod/include/i2c.h M firmware/libboard/qmod/include/wwan_led.h M firmware/libboard/qmod/include/wwan_perst.h M firmware/libboard/qmod/source/board_qmod.c M firmware/libboard/qmod/source/card_pres.c M firmware/libboard/qmod/source/i2c.c M firmware/libboard/qmod/source/wwan_led.c M firmware/libboard/qmod/source/wwan_perst.c M firmware/libboard/simtrace/include/board.h M firmware/libboard/simtrace/source/board_simtrace.c M firmware/libcommon/include/card_emu.h M firmware/libcommon/include/iso7816_fidi.h M firmware/libcommon/include/llist_irqsafe.h M firmware/libcommon/include/ringbuffer.h M firmware/libcommon/include/simtrace.h M firmware/libcommon/include/simtrace_prot.h M firmware/libcommon/include/simtrace_usb.h M firmware/libcommon/include/stdio.h M firmware/libcommon/include/talloc.h M firmware/libcommon/include/usb_buf.h M firmware/libcommon/include/utils.h M firmware/libcommon/source/card_emu.c M firmware/libcommon/source/fputs.c M firmware/libcommon/source/host_communication.c M firmware/libcommon/source/iso7816_fidi.c M firmware/libcommon/source/mode_cardemu.c M firmware/libcommon/source/pseudo_talloc.c M firmware/libcommon/source/ringbuffer.c M firmware/libcommon/source/sniffer.c M firmware/libcommon/source/tc_etu.c M firmware/libcommon/source/usb_buf.c 51 files changed, 791 insertions(+), 118 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/16/9916/1 diff --git a/firmware/apps/cardem/main.c b/firmware/apps/cardem/main.c index 2114901..9241c06 100644 --- a/firmware/apps/cardem/main.c +++ b/firmware/apps/cardem/main.c @@ -1,4 +1,21 @@ -// FIXME: Copyright license here +/* SIMtrace 2 firmware card emulation application + * + * (C) 2015-2017 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ /*------------------------------------------------------------------------------ * Headers *------------------------------------------------------------------------------*/ diff --git a/firmware/apps/dfu/main.c b/firmware/apps/dfu/main.c index 796a13f..eb63cb5 100644 --- a/firmware/apps/dfu/main.c +++ b/firmware/apps/dfu/main.c @@ -1,3 +1,22 @@ +/* SIMtrace 2 firmware USB DFU bootloader + * + * (C) 2015-2017 by Harald Welte + * (C) 2018 by sysmocom -s.f.m.c. GmbH, Author: Kevin Redon + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ #include "board.h" #include "utils.h" #include "usb/device/dfu/dfu.h" diff --git a/firmware/apps/trace/main.c b/firmware/apps/trace/main.c index 754e905..d2fddf9 100644 --- a/firmware/apps/trace/main.c +++ b/firmware/apps/trace/main.c @@ -1,4 +1,22 @@ -// FIXME: Copyright license here +/* SIMtrace 2 firmware sniffer application + * + * (C) 2015-2017 by Harald Welte + * (C) 2018 by sysmocom -s.f.m.c. GmbH, Author: Kevin Redon + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ /*------------------------------------------------------------------------------ * Headers *------------------------------------------------------------------------------*/ diff --git a/firmware/apps/triple_play/main.c b/firmware/apps/triple_play/main.c index 75fcb36..47d53af 100644 --- a/firmware/apps/triple_play/main.c +++ b/firmware/apps/triple_play/main.c @@ -1,4 +1,21 @@ -// FIXME: Copyright license here +/* SIMtrace 2 firmware card emulation, CCID, and sniffer application + * + * (C) 2015-2017 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ /*------------------------------------------------------------------------------ * Headers *------------------------------------------------------------------------------*/ diff --git a/firmware/libboard/common/include/board_common.h b/firmware/libboard/common/include/board_common.h index a995d88..06d3d6a 100644 --- a/firmware/libboard/common/include/board_common.h +++ b/firmware/libboard/common/include/board_common.h @@ -1,3 +1,19 @@ +/* SIMtrace 2 common board pin definitions + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #ifndef _BOARD_ #define _BOARD_ diff --git a/firmware/libboard/common/include/board_lowlevel.h b/firmware/libboard/common/include/board_lowlevel.h index cc6cdbe..19d4f9e 100644 --- a/firmware/libboard/common/include/board_lowlevel.h +++ b/firmware/libboard/common/include/board_lowlevel.h @@ -26,7 +26,6 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ---------------------------------------------------------------------------- */ - /** * \file * diff --git a/firmware/libboard/common/include/boardver_adc.h b/firmware/libboard/common/include/boardver_adc.h index a89d630..9b01d0a 100644 --- a/firmware/libboard/common/include/boardver_adc.h +++ b/firmware/libboard/common/include/boardver_adc.h @@ -1,3 +1,17 @@ +/* This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #pragma once int get_board_version_adc(void); diff --git a/firmware/libboard/common/include/led.h b/firmware/libboard/common/include/led.h index 4e29c0e..0c851f0 100644 --- a/firmware/libboard/common/include/led.h +++ b/firmware/libboard/common/include/led.h @@ -1,3 +1,17 @@ +/* This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #pragma once enum led { diff --git a/firmware/libboard/common/include/manifest.h b/firmware/libboard/common/include/manifest.h index 6c1b202..b29c1aa 100644 --- a/firmware/libboard/common/include/manifest.h +++ b/firmware/libboard/common/include/manifest.h @@ -1,4 +1,17 @@ - +/* This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #ifndef _MANIFEST_H #define _MANIFEST_H diff --git a/firmware/libboard/common/include/sim_switch.h b/firmware/libboard/common/include/sim_switch.h index 16c5aa3..3d131f2 100644 --- a/firmware/libboard/common/include/sim_switch.h +++ b/firmware/libboard/common/include/sim_switch.h @@ -1,3 +1,17 @@ +/* This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #pragma once int sim_switch_use_physical(unsigned int nr, int physical); diff --git a/firmware/libboard/common/include/uart_console.h b/firmware/libboard/common/include/uart_console.h index 0e49bfd..c0ee3a7 100644 --- a/firmware/libboard/common/include/uart_console.h +++ b/firmware/libboard/common/include/uart_console.h @@ -2,6 +2,7 @@ * ATMEL Microcontroller Software Support * ---------------------------------------------------------------------------- * Copyright (c) 2009, Atmel Corporation + * Copyright (c) 2018, sysmocom -s.f.m.c. GmbH, Author: Kevin Redon * * All rights reserved. * @@ -26,8 +27,6 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ---------------------------------------------------------------------------- */ - - #ifndef _UART_CONSOLE_ #define _UART_CONSOLE_ diff --git a/firmware/libboard/common/source/board_cstartup_gnu.c b/firmware/libboard/common/source/board_cstartup_gnu.c index bfe59ad..c46d42f 100644 --- a/firmware/libboard/common/source/board_cstartup_gnu.c +++ b/firmware/libboard/common/source/board_cstartup_gnu.c @@ -2,7 +2,8 @@ * ATMEL Microcontroller Software Support * ---------------------------------------------------------------------------- * Copyright (c) 2010, Atmel Corporation - * Copyright (C) 2017, Harald Welte + * Copyright (c) 2017, Harald Welte + * Copyright (c) 2018, sysmocom -s.f.m.c. GmbH, Author: Kevin Redon * * All rights reserved. * diff --git a/firmware/libboard/common/source/boardver_adc.c b/firmware/libboard/common/source/boardver_adc.c index ca3d1fe..f204aa1 100644 --- a/firmware/libboard/common/source/boardver_adc.c +++ b/firmware/libboard/common/source/boardver_adc.c @@ -1,3 +1,17 @@ +/* This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #include "board.h" #include "boardver_adc.h" diff --git a/firmware/libboard/common/source/led.c b/firmware/libboard/common/source/led.c index 00082e2..cffff70 100644 --- a/firmware/libboard/common/source/led.c +++ b/firmware/libboard/common/source/led.c @@ -1,3 +1,22 @@ +/* LED control + * + * (C) 2015-2017 by Harald Welte + * (C) 2018 by sysmocom -s.f.m.c. GmbH, Author: Kevin Redon + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #include #include #include diff --git a/firmware/libboard/common/source/manifest.c b/firmware/libboard/common/source/manifest.c index e6d8d59..0ad537c 100644 --- a/firmware/libboard/common/source/manifest.c +++ b/firmware/libboard/common/source/manifest.c @@ -1,4 +1,17 @@ - +/* This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #include "manifest.h" const char *manifest_application = APPLICATION; diff --git a/firmware/libboard/common/source/sim_switch.c b/firmware/libboard/common/source/sim_switch.c index bad7291..59513ad 100644 --- a/firmware/libboard/common/source/sim_switch.c +++ b/firmware/libboard/common/source/sim_switch.c @@ -1,5 +1,21 @@ -/* Code to switch between local (physical) and remote (emulated) SIM */ - +/* Code to switch between local (physical) and remote (emulated) SIM + * + * (C) 2015-2017 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #include "board.h" #include "trace.h" #include "led.h" diff --git a/firmware/libboard/owhw/include/board.h b/firmware/libboard/owhw/include/board.h index def3d8b..be6bb17 100644 --- a/firmware/libboard/owhw/include/board.h +++ b/firmware/libboard/owhw/include/board.h @@ -1,3 +1,21 @@ +/* OWHW board definition + * + * (C) 2015-2017 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #pragma once #include "board_common.h" #include "simtrace_usb.h" diff --git a/firmware/libboard/owhw/source/owhw.c b/firmware/libboard/owhw/source/owhw.c index d1e54e6..c5cbf7b 100644 --- a/firmware/libboard/owhw/source/owhw.c +++ b/firmware/libboard/owhw/source/owhw.c @@ -1,20 +1,20 @@ -/* Card simulator specific functions */ -/* (C) 2015 by Harald Welte +/* Card simulator specific functions * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * (C) 2015-2017 by Harald Welte * - * This program 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 General Public License for more details. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program 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 General Public License for more details. * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA */ #include "chip.h" diff --git a/firmware/libboard/qmod/include/board.h b/firmware/libboard/qmod/include/board.h index 2db94ab..c23ad50 100644 --- a/firmware/libboard/qmod/include/board.h +++ b/firmware/libboard/qmod/include/board.h @@ -1,3 +1,21 @@ +/* sysmocom quad-modem sysmoQMOD board definition + * + * (C) 2016-2017 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #pragma once #include "board_common.h" #include "simtrace_usb.h" diff --git a/firmware/libboard/qmod/include/card_pres.h b/firmware/libboard/qmod/include/card_pres.h index fd7f065..81f0613 100644 --- a/firmware/libboard/qmod/include/card_pres.h +++ b/firmware/libboard/qmod/include/card_pres.h @@ -1,3 +1,21 @@ +/* card presence utilities + * + * (C) 2016-2017 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #pragma once int is_card_present(int port); diff --git a/firmware/libboard/qmod/include/i2c.h b/firmware/libboard/qmod/include/i2c.h index 15e4b37..30f57ce 100644 --- a/firmware/libboard/qmod/include/i2c.h +++ b/firmware/libboard/qmod/include/i2c.h @@ -1,3 +1,19 @@ +/* I2C EEPROM memory read and write utilities + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #pragma once void i2c_pin_init(void); diff --git a/firmware/libboard/qmod/include/wwan_led.h b/firmware/libboard/qmod/include/wwan_led.h index 7ba72ea..77887c7 100644 --- a/firmware/libboard/qmod/include/wwan_led.h +++ b/firmware/libboard/qmod/include/wwan_led.h @@ -1,3 +1,19 @@ +/* Code to read/track the status of the WWAN LEDs of attached modems + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #pragma once int wwan_led_active(int wwan); diff --git a/firmware/libboard/qmod/include/wwan_perst.h b/firmware/libboard/qmod/include/wwan_perst.h index 979fe83..c934afc 100644 --- a/firmware/libboard/qmod/include/wwan_perst.h +++ b/firmware/libboard/qmod/include/wwan_perst.h @@ -1,3 +1,19 @@ +/* Code to control the PERST lines of attached modems + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #pragma once int wwan_perst_set(int modem_nr, int active); diff --git a/firmware/libboard/qmod/source/board_qmod.c b/firmware/libboard/qmod/source/board_qmod.c index 0eda1ef..7ae1978 100644 --- a/firmware/libboard/qmod/source/board_qmod.c +++ b/firmware/libboard/qmod/source/board_qmod.c @@ -1,6 +1,21 @@ -/* Quad-modem speciic application code */ -/* (C) 2016-2016 by Harald Welte */ - +/* sysmocom quad-modem sysmoQMOD application code + * + * (C) 2016-2017 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #include "board.h" #include "simtrace.h" #include "utils.h" diff --git a/firmware/libboard/qmod/source/card_pres.c b/firmware/libboard/qmod/source/card_pres.c index 0cd34f0..7a32b57 100644 --- a/firmware/libboard/qmod/source/card_pres.c +++ b/firmware/libboard/qmod/source/card_pres.c @@ -1,3 +1,21 @@ +/* card presence utilities + * + * (C) 2016-2017 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #include #include "board.h" #include "utils.h" diff --git a/firmware/libboard/qmod/source/i2c.c b/firmware/libboard/qmod/source/i2c.c index 607f247..06c7565 100644 --- a/firmware/libboard/qmod/source/i2c.c +++ b/firmware/libboard/qmod/source/i2c.c @@ -1,3 +1,19 @@ +/* I2C EEPROM memory read and write utilities + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #include "board.h" #include diff --git a/firmware/libboard/qmod/source/wwan_led.c b/firmware/libboard/qmod/source/wwan_led.c index d95b31c..b3b5693 100644 --- a/firmware/libboard/qmod/source/wwan_led.c +++ b/firmware/libboard/qmod/source/wwan_led.c @@ -1,11 +1,24 @@ /* Code to read/track the status of the WWAN LEDs of attached modems * - * Depending on the board this is running on, it might be possible + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ +/* Depending on the board this is running on, it might be possible * for the controller to read the status of the WWAN LED output lines of * the cellular modem. If the board supports this, it sets the * PIN_WWAN1 and/or PIN_WWAN2 defines in its board.h file. */ - #include "board.h" #include "wwan_led.h" diff --git a/firmware/libboard/qmod/source/wwan_perst.c b/firmware/libboard/qmod/source/wwan_perst.c index a6d7dd2..95a7c7b 100644 --- a/firmware/libboard/qmod/source/wwan_perst.c +++ b/firmware/libboard/qmod/source/wwan_perst.c @@ -1,11 +1,24 @@ /* Code to control the PERST lines of attached modems * - * Depending on the board this is running on, it might be possible + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ +/* Depending on the board this is running on, it might be possible * for the controller to set the status of the PERST input line of * the cellular modem. If the board supports this, it sets the * PIN_PERST1 and/or PIN_PERST2 defines in its board.h file. */ - #include "board.h" #include "trace.h" #include "wwan_perst.h" diff --git a/firmware/libboard/simtrace/include/board.h b/firmware/libboard/simtrace/include/board.h index b21d4fb..db3a925 100644 --- a/firmware/libboard/simtrace/include/board.h +++ b/firmware/libboard/simtrace/include/board.h @@ -1,3 +1,22 @@ +/* SIMtrace with SAM3S board definition + * + * (C) 2016-2017 by Harald Welte + * (C) 2018 by sysmocom -s.f.m.c. GmbH, Author: Kevin Redon + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #pragma once #include "board_common.h" #include "simtrace_usb.h" diff --git a/firmware/libboard/simtrace/source/board_simtrace.c b/firmware/libboard/simtrace/source/board_simtrace.c index 90bf9bc..9d323cf 100644 --- a/firmware/libboard/simtrace/source/board_simtrace.c +++ b/firmware/libboard/simtrace/source/board_simtrace.c @@ -1,6 +1,22 @@ -/* SIMtrace specific application code */ -/* (C) 2017 by Harald Welte */ - +/* SIMtrace with SAM3S specific application code + * + * (C) 2017 by Harald Welte + * (C) 2018 by sysmocom -s.f.m.c. GmbH, Author: Kevin Redon + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #include "board.h" #include "simtrace.h" #include "utils.h" diff --git a/firmware/libcommon/include/card_emu.h b/firmware/libcommon/include/card_emu.h index 43279f8..7144168 100644 --- a/firmware/libcommon/include/card_emu.h +++ b/firmware/libcommon/include/card_emu.h @@ -1,3 +1,21 @@ +/* ISO7816-3 state machine for the card side + * + * (C) 2010-2017 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #pragma once #include diff --git a/firmware/libcommon/include/iso7816_fidi.h b/firmware/libcommon/include/iso7816_fidi.h index 3b4b451..c56478b 100644 --- a/firmware/libcommon/include/iso7816_fidi.h +++ b/firmware/libcommon/include/iso7816_fidi.h @@ -1,3 +1,21 @@ +/* ISO7816-3 Fi/Di tables + computation + * + * (C) 2010-2015 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #pragma once #include diff --git a/firmware/libcommon/include/llist_irqsafe.h b/firmware/libcommon/include/llist_irqsafe.h index d9c003d..9171ccf 100644 --- a/firmware/libcommon/include/llist_irqsafe.h +++ b/firmware/libcommon/include/llist_irqsafe.h @@ -1,3 +1,21 @@ +/* IRQ-safe linked lists + * + * (C) 2015-2017 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #pragma once #include diff --git a/firmware/libcommon/include/ringbuffer.h b/firmware/libcommon/include/ringbuffer.h index aa200ba..a6eddc9 100644 --- a/firmware/libcommon/include/ringbuffer.h +++ b/firmware/libcommon/include/ringbuffer.h @@ -1,3 +1,19 @@ +/* Ring buffer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #ifndef SIMTRACE_RINGBUF_H #define SIMTRACE_RINGBUF_H diff --git a/firmware/libcommon/include/simtrace.h b/firmware/libcommon/include/simtrace.h index 3c414bc..5edea17 100644 --- a/firmware/libcommon/include/simtrace.h +++ b/firmware/libcommon/include/simtrace.h @@ -1,3 +1,21 @@ +/* SIMtrace 2 mode definitions + * + * (C) 2015-2017 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #ifndef SIMTRACE_H #define SIMTRACE_H diff --git a/firmware/libcommon/include/simtrace_prot.h b/firmware/libcommon/include/simtrace_prot.h index a43ac72..1e9d72f 100644 --- a/firmware/libcommon/include/simtrace_prot.h +++ b/firmware/libcommon/include/simtrace_prot.h @@ -1,21 +1,21 @@ -/* SIMtrace2 USB protocol */ - -/* (C) 2015-2017 by Harald Welte +/* SIMtrace2 USB protocol * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * (C) 2015-2017 by Harald Welte + * (C) 2018 by sysmocom -s.f.m.c. GmbH, Author: Kevin Redon * - * This program 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 General Public License for more details. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program 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 General Public License for more details. * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA */ #pragma once diff --git a/firmware/libcommon/include/simtrace_usb.h b/firmware/libcommon/include/simtrace_usb.h index 969d890..c0da9c5 100644 --- a/firmware/libcommon/include/simtrace_usb.h +++ b/firmware/libcommon/include/simtrace_usb.h @@ -1,7 +1,11 @@ -/* This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. +/* SIMtrace 2 USB definitions + * + * (C) 2018 by sysmocom -s.f.m.c. GmbH, Author: Kevin Redon + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -10,12 +14,8 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * (C) 2018 by sysmocom -s.f.m.c. GmbH, Author: Kevin Redon - * All Rights Reserved + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA */ - /* SIMtrace USB IDs */ #define USB_VENDOR_OPENMOKO 0x1d50 #define USB_PRODUCT_OWHW_SAM3_DFU 0x4001 /* was 0x4000 */ diff --git a/firmware/libcommon/include/stdio.h b/firmware/libcommon/include/stdio.h index 24bf861..7695d20 100644 --- a/firmware/libcommon/include/stdio.h +++ b/firmware/libcommon/include/stdio.h @@ -1,3 +1,31 @@ +/* ---------------------------------------------------------------------------- + * ATMEL Microcontroller Software Support + * ---------------------------------------------------------------------------- + * Copyright (c) 2008, Atmel Corporation + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ---------------------------------------------------------------------------- + */ #pragma once #include #include diff --git a/firmware/libcommon/include/talloc.h b/firmware/libcommon/include/talloc.h index f2d9666..0bd75d2 100644 --- a/firmware/libcommon/include/talloc.h +++ b/firmware/libcommon/include/talloc.h @@ -1,3 +1,19 @@ +/* Memory allocation library + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #pragma once #include diff --git a/firmware/libcommon/include/usb_buf.h b/firmware/libcommon/include/usb_buf.h index 7171c68..bd6947b 100644 --- a/firmware/libcommon/include/usb_buf.h +++ b/firmware/libcommon/include/usb_buf.h @@ -1,3 +1,19 @@ +/* USB buffer library + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #pragma once #include diff --git a/firmware/libcommon/include/utils.h b/firmware/libcommon/include/utils.h index b9af1f6..2c966f9 100644 --- a/firmware/libcommon/include/utils.h +++ b/firmware/libcommon/include/utils.h @@ -1,3 +1,19 @@ +/* General utilities + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #pragma once #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) diff --git a/firmware/libcommon/source/card_emu.c b/firmware/libcommon/source/card_emu.c index 7aa3fc0..9291064 100644 --- a/firmware/libcommon/source/card_emu.c +++ b/firmware/libcommon/source/card_emu.c @@ -1,24 +1,21 @@ -/* ISO7816-3 state machine for the card side */ -/* (C) 2010-2017 by Harald Welte +/* ISO7816-3 state machine for the card side * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * (C) 2010-2017 by Harald Welte * - * This program 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 General Public License for more details. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program 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 General Public License for more details. * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA */ - -//#define TRACE_LEVEL 6 - #include #include #include diff --git a/firmware/libcommon/source/fputs.c b/firmware/libcommon/source/fputs.c index f7add10..ca6f851 100644 --- a/firmware/libcommon/source/fputs.c +++ b/firmware/libcommon/source/fputs.c @@ -1,3 +1,19 @@ +/* UART print output + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #include #include "uart_console.h" diff --git a/firmware/libcommon/source/host_communication.c b/firmware/libcommon/source/host_communication.c index 75e1779..783c976 100644 --- a/firmware/libcommon/source/host_communication.c +++ b/firmware/libcommon/source/host_communication.c @@ -1,3 +1,19 @@ +/* USB communication methods + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #include "board.h" #include "llist_irqsafe.h" #include "usb_buf.h" diff --git a/firmware/libcommon/source/iso7816_fidi.c b/firmware/libcommon/source/iso7816_fidi.c index bdccd55..1c70467 100644 --- a/firmware/libcommon/source/iso7816_fidi.c +++ b/firmware/libcommon/source/iso7816_fidi.c @@ -1,22 +1,21 @@ -/* ISO7816-3 Fi/Di tables + computation */ -/* (C) 2010-2015 by Harald Welte +/* ISO7816-3 Fi/Di tables + computation * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * (C) 2010-2015 by Harald Welte * - * This program 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 General Public License for more details. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program 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 General Public License for more details. * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA */ - #include #include diff --git a/firmware/libcommon/source/mode_cardemu.c b/firmware/libcommon/source/mode_cardemu.c index 104691f..bc91273 100644 --- a/firmware/libcommon/source/mode_cardemu.c +++ b/firmware/libcommon/source/mode_cardemu.c @@ -1,5 +1,21 @@ -//#define TRACE_LEVEL 6 - +/* card emulation mode + * + * (C) 2015-2017 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #include "board.h" #include "simtrace.h" #include "ringbuffer.h" diff --git a/firmware/libcommon/source/pseudo_talloc.c b/firmware/libcommon/source/pseudo_talloc.c index c9722ba..564c3ef 100644 --- a/firmware/libcommon/source/pseudo_talloc.c +++ b/firmware/libcommon/source/pseudo_talloc.c @@ -1,3 +1,19 @@ +/* Memory allocation library + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #include #include "talloc.h" diff --git a/firmware/libcommon/source/ringbuffer.c b/firmware/libcommon/source/ringbuffer.c index b8cd5c6..70747a1 100644 --- a/firmware/libcommon/source/ringbuffer.c +++ b/firmware/libcommon/source/ringbuffer.c @@ -1,8 +1,24 @@ +/* Ring buffer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #include "ringbuffer.h" #include "trace.h" #include "utils.h" -/* WARNINGI: Since console output is internally using this ringbuffer to implement +/* WARNING: Since console output is internally using this ringbuffer to implement * buffered writes, we cannot use any TRACE_*() or printf() style functions here, * as it would create infinite recursion! */ diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 87e6d32..5ab60bb 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -1,25 +1,29 @@ -/* - * (C) 2010-2017 by Harald Welte - * (C) 2018 by Kevin Redon - * All Rights Reserved +/* SIMtrace 2 sniffer mode + * + * (C) 2016-2017 by Harald Welte + * (C) 2018 by sysmocom -s.f.m.c. GmbH, Author: Kevin Redon * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. + * GNU General Public License for more details. * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA */ -/* This code implement the Sniffer mode to sniff the communication between a SIM card (or any ISO 7816 smart card) and a phone (or any ISO 7816 card reader). - * For historical reasons (i.e. SIMtrace hardware) the USART peripheral connected to the SIM card is used. - * TODO put common ISO7816-3 code is separate library (and combine clean with iso7816_4) +/* This code implement the Sniffer mode to sniff the communication between a + * SIM card (or any ISO 7816 smart card) and a phone (or any ISO 7816 card + * reader). + * For historical reasons (i.e. SIMtrace hardware) the USART peripheral + * connected to the SIM card is used. + * TODO put common ISO7816-3 code is separate library (and combine clean with + * iso7816_4) */ #include "board.h" #include "simtrace.h" diff --git a/firmware/libcommon/source/tc_etu.c b/firmware/libcommon/source/tc_etu.c index f3eb039..04a7324 100644 --- a/firmware/libcommon/source/tc_etu.c +++ b/firmware/libcommon/source/tc_etu.c @@ -1,23 +1,21 @@ -/* SIMtrace TC (Timer / Clock) code for ETU tracking */ - -/* (C) 2006-2016 by Harald Welte +/* SIMtrace TC (Timer / Clock) code for ETU tracking * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * (C) 2006-2016 by Harald Welte * - * This program 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 General Public License for more details. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program 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 General Public License for more details. * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA */ - #include #include "utils.h" diff --git a/firmware/libcommon/source/usb_buf.c b/firmware/libcommon/source/usb_buf.c index b8d4dd7..418569e 100644 --- a/firmware/libcommon/source/usb_buf.c +++ b/firmware/libcommon/source/usb_buf.c @@ -1,3 +1,19 @@ +/* USB buffer library + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #include "board.h" #include "trace.h" #include "usb_buf.h" -- To view, visit https://gerrit.osmocom.org/9916 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id4c00159f984976b6d8641900fb64e36a3a30407 Gerrit-Change-Number: 9916 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 8 15:36:19 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Sun, 8 Jul 2018 15:36:19 +0000 Subject: Change in simtrace2[master]: set linux end of line Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9917 Change subject: set linux end of line ...................................................................... set linux end of line Change-Id: I5200f0d6f39b0641cac26a4109a3cd33e8474b9b --- M firmware/atmel_softpack_libraries/libchip_sam3s/include/efc.h M firmware/atmel_softpack_libraries/libchip_sam3s/include/flashd.h M firmware/atmel_softpack_libraries/libchip_sam3s/source/USBD_HAL.c M firmware/atmel_softpack_libraries/libchip_sam3s/source/efc.c M firmware/atmel_softpack_libraries/libchip_sam3s/source/exceptions.c M firmware/atmel_softpack_libraries/libchip_sam3s/source/flashd.c M firmware/atmel_softpack_libraries/libchip_sam3s/source/pio.c M firmware/atmel_softpack_libraries/libchip_sam3s/source/pio_it.c M firmware/atmel_softpack_libraries/libchip_sam3s/source/pmc.c M firmware/atmel_softpack_libraries/libchip_sam3s/source/spi.c M firmware/atmel_softpack_libraries/libchip_sam3s/source/tc.c M firmware/atmel_softpack_libraries/libchip_sam3s/source/usart.c M firmware/atmel_softpack_libraries/libchip_sam3s/source/wdt.c M firmware/libboard/common/source/board_cstartup_gnu.c M firmware/libboard/common/source/board_lowlevel.c M firmware/libboard/common/source/uart_console.c 16 files changed, 6,071 insertions(+), 6,071 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/17/9917/1 -- To view, visit https://gerrit.osmocom.org/9917 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I5200f0d6f39b0641cac26a4109a3cd33e8474b9b Gerrit-Change-Number: 9917 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 8 15:36:21 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Sun, 8 Jul 2018 15:36:21 +0000 Subject: Change in simtrace2[master]: cosmetic: put spaces around operations Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9919 Change subject: cosmetic: put spaces around operations ...................................................................... cosmetic: put spaces around operations Change-Id: If5ba5f8d16680e8403944274336ea595017063db --- M firmware/libcommon/source/sniffer.c 1 file changed, 72 insertions(+), 72 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/19/9919/1 diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 5ab60bb..81a6712 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -208,10 +208,10 @@ static uint8_t wt_wi = 10; /* Waiting time Integer (WI), used to calculate the Waiting Time (WT) */ static uint8_t wt_d = 1; /* baud rate adjustment integer (the actual value, not the table index) */ - if (0!=wi) { + if (0 != wi) { wt_wi = wi; } - if (0!=d) { + if (0 != d) { wt_d = d; } wt = wt_wi*960UL*wt_d; @@ -257,7 +257,7 @@ static void change_state(enum iso7816_3_sniff_state iso_state_new) { /* sanity check */ - if (iso_state_new==iso_state) { + if (iso_state_new == iso_state) { TRACE_WARNING("Already in ISO 7816 state %u\n\r", iso_state); return; } @@ -303,11 +303,11 @@ static void usb_send_atr(bool complete) { /* Check state */ - if (ISO7816_S_IN_ATR!=iso_state) { + if (ISO7816_S_IN_ATR != iso_state) { TRACE_WARNING("Can't print ATR in ISO 7816-3 state %u\n\r", iso_state); return; } - if (atr_i>=ARRAY_SIZE(atr)) { + if (atr_i >= ARRAY_SIZE(atr)) { TRACE_ERROR("ATR buffer overflow\n\r"); return; } @@ -346,11 +346,11 @@ static uint8_t i = 0; /* interface byte subgroup number */ /* sanity check */ - if (ISO7816_S_IN_ATR!=iso_state) { + if (ISO7816_S_IN_ATR != iso_state) { TRACE_ERROR("Processing ATR data in wrong ISO 7816-3 state %u\n\r", iso_state); return; } - if (atr_i>=ARRAY_SIZE(atr)) { + if (atr_i >= ARRAY_SIZE(atr)) { TRACE_ERROR("ATR data overflow\n\r"); return; } @@ -377,37 +377,37 @@ break; case ATR_S_WAIT_T0: /* see ISO/IEC 7816-3:2006 section 8.2.2 */ case ATR_S_WAIT_TD: /* see ISO/IEC 7816-3:2006 section 8.2.3 */ - if (ATR_S_WAIT_T0==atr_state) { - atr_hist_len = (byte&0x0f); /* save the number of historical bytes */ - } else if (ATR_S_WAIT_TD==atr_state) { - t_protocol_support |= (1<<(byte&0x0f)); /* remember supported protocol to know if TCK will be present */ + if (ATR_S_WAIT_T0 == atr_state) { + atr_hist_len = (byte & 0x0f); /* save the number of historical bytes */ + } else if (ATR_S_WAIT_TD == atr_state) { + t_protocol_support |= (1<<(byte & 0x0f)); /* remember supported protocol to know if TCK will be present */ } - y = (byte&0xf0); /* remember upcoming interface bytes */ + y = (byte & 0xf0); /* remember upcoming interface bytes */ i++; /* next interface byte sub-group is coming */ - if (y&0x10) { + if (y & 0x10) { atr_state = ATR_S_WAIT_TA; /* wait for interface byte TA */ break; } case ATR_S_WAIT_TA: /* see ISO/IEC 7816-3:2006 section 8.2.3 */ - if (y&0x20) { + if (y & 0x20) { atr_state = ATR_S_WAIT_TB; /* wait for interface byte TB */ break; } case ATR_S_WAIT_TB: /* see ISO/IEC 7816-3:2006 section 8.2.3 */ - if (y&0x40) { + if (y & 0x40) { atr_state = ATR_S_WAIT_TC; /* wait for interface byte TC */ break; } case ATR_S_WAIT_TC: /* see ISO/IEC 7816-3:2006 section 8.2.3 */ /* retrieve WI encoded in TC2*/ if (ATR_S_WAIT_TC==atr_state && 2==i) { - if (0==byte) { + if (0 == byte) { update_wt(10, 0); } else { update_wt(byte, 0); } } - if (y&0x80) { + if (y & 0x80) { atr_state = ATR_S_WAIT_TD; /* wait for interface byte TD */ break; } else if (atr_hist_len) { @@ -418,8 +418,8 @@ if (atr_hist_len) { atr_hist_len--; } - if (0==atr_hist_len) { - if (t_protocol_support>1) { + if (0 == atr_hist_len) { + if (t_protocol_support > 1) { atr_state = ATR_S_WAIT_TCK; /* wait for check bytes */ break; } @@ -445,9 +445,9 @@ uint8_t *pps_cur; /* current PPS (request or response) */ /* Sanity check */ - if (ISO7816_S_IN_PPS_REQ==iso_state) { + if (ISO7816_S_IN_PPS_REQ == iso_state) { pps_cur = pps_req; - } else if (ISO7816_S_IN_PPS_RSP==iso_state) { + } else if (ISO7816_S_IN_PPS_RSP == iso_state) { pps_cur = pps_rsp; } else { TRACE_ERROR("Can't print PPS in ISO 7816-3 state %u\n\r", iso_state); @@ -457,22 +457,22 @@ /* Get only relevant data */ uint8_t pps[6]; uint8_t pps_i = 0; - if (pps_state>PPS_S_WAIT_PPSS) { + if (pps_state > PPS_S_WAIT_PPSS) { pps[pps_i++] = pps_cur[0]; } - if (pps_state>PPS_S_WAIT_PPS0) { + if (pps_state > PPS_S_WAIT_PPS0) { pps[pps_i++] = pps_cur[1]; } - if (pps_state>PPS_S_WAIT_PPS1 && pps_cur[1]&0x10) { + if (pps_state > PPS_S_WAIT_PPS1 && pps_cur[1] & 0x10) { pps[pps_i++] = pps_cur[2]; } - if (pps_state>PPS_S_WAIT_PPS2 && pps_cur[1]&0x20) { + if (pps_state > PPS_S_WAIT_PPS2 && pps_cur[1] & 0x20) { pps[pps_i++] = pps_cur[3]; } - if (pps_state>PPS_S_WAIT_PPS3 && pps_cur[1]&0x40) { + if (pps_state > PPS_S_WAIT_PPS3 && pps_cur[1] & 0x40) { pps[pps_i++] = pps_cur[4]; } - if (pps_state>PPS_S_WAIT_PCK) { + if (pps_state > PPS_S_WAIT_PCK) { pps[pps_i++] = pps_cur[5]; } @@ -520,9 +520,9 @@ uint8_t *pps_cur; /* current PPS (request or response) */ /* sanity check */ - if (ISO7816_S_IN_PPS_REQ==iso_state) { + if (ISO7816_S_IN_PPS_REQ == iso_state) { pps_cur = pps_req; - } else if (ISO7816_S_IN_PPS_RSP==iso_state) { + } else if (ISO7816_S_IN_PPS_RSP == iso_state) { pps_cur = pps_rsp; } else { TRACE_ERROR("Processing PPS data in wrong ISO 7816-3 state %u\n\r", iso_state); @@ -542,19 +542,19 @@ break; case PPS_S_WAIT_PPS0: /*!< format byte */ pps_cur[1] = byte; - if (pps_cur[1]&0x10) { + if (pps_cur[1] & 0x10) { pps_state = PPS_S_WAIT_PPS1; /* go to next state */ break; } case PPS_S_WAIT_PPS1: /*!< first parameter byte */ pps_cur[2] = byte; /* not always right but doesn't affect the process */ - if (pps_cur[1]&0x20) { + if (pps_cur[1] & 0x20) { pps_state = PPS_S_WAIT_PPS2; /* go to next state */ break; } case PPS_S_WAIT_PPS2: /*!< second parameter byte */ pps_cur[3] = byte; /* not always right but doesn't affect the process */ - if (pps_cur[1]&0x40) { + if (pps_cur[1] & 0x40) { pps_state = PPS_S_WAIT_PPS3; /* go to next state */ break; } @@ -568,30 +568,30 @@ uint8_t check = 0; check ^= pps_cur[0]; check ^= pps_cur[1]; - if (pps_cur[1]&0x10) { + if (pps_cur[1] & 0x10) { check ^= pps_cur[2]; } - if (pps_cur[1]&0x20) { + if (pps_cur[1] & 0x20) { check ^= pps_cur[3]; } - if (pps_cur[1]&0x40) { + if (pps_cur[1] & 0x40) { check ^= pps_cur[4]; } check ^= pps_cur[5]; pps_state = PPS_S_WAIT_END; usb_send_pps(true); /* send PPS to host software using USB */ - if (ISO7816_S_IN_PPS_REQ==iso_state) { - if (0==check) { /* checksum is valid */ + if (ISO7816_S_IN_PPS_REQ == iso_state) { + if (0 == check) { /* checksum is valid */ change_state(ISO7816_S_WAIT_PPS_RSP); /* go to next state */ } else { /* checksum is invalid */ change_state(ISO7816_S_WAIT_TPDU); /* go to next state */ } - } else if (ISO7816_S_IN_PPS_RSP==iso_state) { - if (0==check) { /* checksum is valid */ + } else if (ISO7816_S_IN_PPS_RSP == iso_state) { + if (0 == check) { /* checksum is valid */ uint8_t fn, dn; - if (pps_cur[1]&0x10) { - fn = (pps_cur[2]>>4); - dn = (pps_cur[2]&0x0f); + if (pps_cur[1] & 0x10) { + fn = (pps_cur[2] >> 4); + dn = (pps_cur[2] & 0x0f); } else { fn = 1; dn = 1; @@ -622,7 +622,7 @@ static void usb_send_tpdu(bool complete) { /* Check state */ - if (ISO7816_S_IN_TPDU!=iso_state) { + if (ISO7816_S_IN_TPDU != iso_state) { TRACE_WARNING("Can't print TPDU in ISO 7816-3 state %u\n\r", iso_state); return; } @@ -654,11 +654,11 @@ static void process_byte_tpdu(uint8_t byte) { /* sanity check */ - if (ISO7816_S_IN_TPDU!=iso_state) { + if (ISO7816_S_IN_TPDU != iso_state) { TRACE_ERROR("Processing TPDU data in wrong ISO 7816-3 state %u\n\r", iso_state); return; } - if (tpdu_packet_i>=ARRAY_SIZE(tpdu_packet)) { + if (tpdu_packet_i >= ARRAY_SIZE(tpdu_packet)) { TRACE_ERROR("TPDU data overflow\n\r"); return; } @@ -666,7 +666,7 @@ /* handle TPDU byte depending on current state */ switch (tpdu_state) { case TPDU_S_CLA: - if (0xff==byte) { + if (0xff == byte) { TRACE_WARNING("0xff is not a valid class byte\n\r"); change_state(ISO7816_S_WAIT_TPDU); /* go back to TPDU state */ return; @@ -676,7 +676,7 @@ tpdu_state = TPDU_S_INS; break; case TPDU_S_INS: - if ((0x60==(byte&0xf0)) || (0x90==(byte&0xf0))) { + if ((0x60 == (byte & 0xf0)) || (0x90 == (byte & 0xf0))) { TRACE_WARNING("invalid CLA 0x%02x\n\r", byte); change_state(ISO7816_S_WAIT_TPDU); /* go back to TPDU state */ return; @@ -701,17 +701,17 @@ tpdu_state = TPDU_S_PROCEDURE; break; case TPDU_S_PROCEDURE: - if (0x60==byte) { /* wait for next procedure byte */ + if (0x60 == byte) { /* wait for next procedure byte */ break; - } else if (tpdu_packet[1]==byte) { /* get all remaining data bytes */ + } else if (tpdu_packet[1] == byte) { /* get all remaining data bytes */ tpdu_state = TPDU_S_DATA_REMAINING; break; - } else if ((~tpdu_packet[1])==byte) { /* get single data byte */ + } else if ((~tpdu_packet[1]) == byte) { /* get single data byte */ tpdu_state = TPDU_S_DATA_SINGLE; break; } case TPDU_S_SW1: - if ((0x60==(byte&0xf0)) || (0x90==(byte&0xf0))) { /* this procedure byte is SW1 */ + if ((0x60 == (byte & 0xf0)) || (0x90 == (byte & 0xf0))) { /* this procedure byte is SW1 */ tpdu_packet[tpdu_packet_i++] = byte; tpdu_state = TPDU_S_SW2; } else { @@ -728,16 +728,16 @@ case TPDU_S_DATA_SINGLE: case TPDU_S_DATA_REMAINING: tpdu_packet[tpdu_packet_i++] = byte; - if (0==tpdu_packet[4]) { - if (5+256<=tpdu_packet_i) { + if (0 == tpdu_packet[4]) { + if (5+256 <= tpdu_packet_i) { tpdu_state = TPDU_S_PROCEDURE; } } else { - if (5+tpdu_packet[4]<=tpdu_packet_i) { + if (5+tpdu_packet[4] <= tpdu_packet_i) { tpdu_state = TPDU_S_PROCEDURE; } } - if (TPDU_S_DATA_SINGLE==tpdu_state) { + if (TPDU_S_DATA_SINGLE == tpdu_state) { tpdu_state = TPDU_S_PROCEDURE; } break; @@ -780,15 +780,15 @@ /* Verify it WT timeout occurred, to detect unresponsive card */ if (csr & US_CSR_TIMEOUT) { - if (wt_remaining<=(sniff_usart.base->US_RTOR&0xffff)) { + if (wt_remaining <= (sniff_usart.base->US_RTOR & 0xffff)) { /* Just set the flag and let the main loop handle it */ change_flags |= SNIFF_CHANGE_FLAG_TIMEOUT_WT; /* Reset timeout value */ wt_remaining = wt; } else { - wt_remaining -= (sniff_usart.base->US_RTOR&0xffff); /* be sure to subtract the actual timeout since the new might not have been set and reloaded yet */ + wt_remaining -= (sniff_usart.base->US_RTOR & 0xffff); /* be sure to subtract the actual timeout since the new might not have been set and reloaded yet */ } - if (wt_remaining>0xffff) { + if (wt_remaining > 0xffff) { sniff_usart.base->US_RTOR = 0xffff; } else { sniff_usart.base->US_RTOR = wt_remaining; @@ -807,17 +807,17 @@ static void Sniffer_reset_isr(const Pin* pPin) { /* Ensure an edge on the reset pin cause the interrupt */ - if (pPin->id!=pin_rst.id || 0==(pPin->mask&pin_rst.mask)) { + if (pPin->id != pin_rst.id || 0 == (pPin->mask & pin_rst.mask)) { TRACE_ERROR("Pin other than reset caused a interrupt\n\r"); return; } /* Update the ISO state according to the reset change */ if (PIO_Get(&pin_rst)) { - if (ISO7816_S_WAIT_ATR!=iso_state) { + if (ISO7816_S_WAIT_ATR != iso_state) { change_state(ISO7816_S_WAIT_ATR); } } else { - if (ISO7816_S_RESET!=iso_state) { + if (ISO7816_S_RESET != iso_state) { change_state(ISO7816_S_RESET); } } @@ -829,14 +829,14 @@ void Sniffer_usart1_irq(void) { - if (ID_USART1==sniff_usart.id) { + if (ID_USART1 == sniff_usart.id) { Sniffer_usart_isr(); } } void Sniffer_usart0_irq(void) { - if (ID_USART0==sniff_usart.id) { + if (ID_USART0 == sniff_usart.id) { Sniffer_usart_isr(); } } @@ -894,14 +894,14 @@ /* Enable interrupt to indicate when data has been received or timeout occurred */ USART_EnableIt(sniff_usart.base, US_IER_RXRDY | US_IER_TIMEOUT); /* Set USB priority lower than USART to not miss sniffing data (both at 0 per default) */ - if (NVIC_GetPriority(IRQ_USART_SIM)>=NVIC_GetPriority(UDP_IRQn)) { - NVIC_SetPriority(UDP_IRQn, NVIC_GetPriority(IRQ_USART_SIM)+2); + if (NVIC_GetPriority(IRQ_USART_SIM) >= NVIC_GetPriority(UDP_IRQn)) { + NVIC_SetPriority(UDP_IRQn, NVIC_GetPriority(IRQ_USART_SIM) + 2); } /* Enable interrupt requests for the USART peripheral */ NVIC_EnableIRQ(IRQ_USART_SIM); /* Reset state */ - if (ISO7816_S_RESET!=iso_state) { + if (ISO7816_S_RESET != iso_state) { change_state(ISO7816_S_RESET); } } @@ -912,11 +912,11 @@ static void usb_send_change(uint32_t flags) { /* Check flags */ - if(0==flags) { /* no changes */ + if(0 == flags) { /* no changes */ return; } - if (flags&SNIFF_CHANGE_FLAG_TIMEOUT_WT) { + if (flags & SNIFF_CHANGE_FLAG_TIMEOUT_WT) { printf("waiting time (WT) timeout\n\r"); } @@ -963,8 +963,8 @@ break; case ISO7816_S_WAIT_TPDU: /* After the ATR we expect TPDU or PPS data */ case ISO7816_S_WAIT_PPS_RSP: - if (byte == 0xff) { - if (ISO7816_S_WAIT_PPS_RSP==iso_state) { + if (0xff == byte) { + if (ISO7816_S_WAIT_PPS_RSP == iso_state) { change_state(ISO7816_S_IN_PPS_RSP); /* Go to PPS state */ } else { change_state(ISO7816_S_IN_PPS_REQ); /* Go to PPS state */ @@ -973,7 +973,7 @@ break; } case ISO7816_S_IN_TPDU: /* More TPDU data incoming */ - if (ISO7816_S_WAIT_TPDU==iso_state) { + if (ISO7816_S_WAIT_TPDU == iso_state) { change_state(ISO7816_S_IN_TPDU); } process_byte_tpdu(byte); @@ -989,7 +989,7 @@ /* Handle flags */ if (change_flags) { /* WARNING this is not synced with the data buffer handling */ - if (change_flags&SNIFF_CHANGE_FLAG_TIMEOUT_WT) { + if (change_flags & SNIFF_CHANGE_FLAG_TIMEOUT_WT) { /* Use timeout to detect interrupted data transmission */ switch (iso_state) { case ISO7816_S_IN_ATR: -- To view, visit https://gerrit.osmocom.org/9919 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: If5ba5f8d16680e8403944274336ea595017063db Gerrit-Change-Number: 9919 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 8 15:36:22 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Sun, 8 Jul 2018 15:36:22 +0000 Subject: Change in simtrace2[master]: USB: add flags for sniff data and centralise transfer Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9920 Change subject: USB: add flags for sniff data and centralise transfer ...................................................................... USB: add flags for sniff data and centralise transfer Also fix issue in usb_msg_alloc_hdr and add cosmetic spaces around operations. Change-Id: I768a0ad639aa5e648a630af72d01f7b68082b6b6 --- M firmware/libcommon/include/simtrace_prot.h M firmware/libcommon/source/sniffer.c M host/simtrace2-sniff.c 3 files changed, 139 insertions(+), 141 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/20/9920/1 diff --git a/firmware/libcommon/include/simtrace_prot.h b/firmware/libcommon/include/simtrace_prot.h index 1e9d72f..f1f736b 100644 --- a/firmware/libcommon/include/simtrace_prot.h +++ b/firmware/libcommon/include/simtrace_prot.h @@ -294,6 +294,9 @@ #define SNIFF_CHANGE_FLAG_RESET_HOLD (1<<2) #define SNIFF_CHANGE_FLAG_RESET_RELEASE (1<<3) #define SNIFF_CHANGE_FLAG_TIMEOUT_WT (1<<4) +/* SIMTRACE_MSGT_SNIFF_ATR, SIMTRACE_MSGT_SNIFF_PPS, SIMTRACE_MSGT_SNIFF_TPDU flags */ +#define SNIFF_DATA_FLAG_ERROR_INCOMPLETE (1<<5) +#define SNIFF_DATA_FLAG_ERROR_MALFORMED (1<<6) /* SIMTRACE_MSGT_SNIFF_CHANGE */ struct sniff_change { @@ -309,8 +312,8 @@ /* SIMTRACE_MSGT_SNIFF_ATR, SIMTRACE_MSGT_SNIFF_PPS, SIMTRACE_MSGT_SNIFF_TPDU */ struct sniff_data { - /* if the data is complete (an error might have occurred during transmission */ - bool complete; + /* data flags */ + uint32_t flags; /* data length */ uint16_t length; /* data */ diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 81a6712..b78339b 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -235,7 +235,7 @@ usb_msg_header = (struct simtrace_msg_hdr *) usb_msg->l1h; memset(usb_msg_header, 0, sizeof(*usb_msg_header)); usb_msg_header->msg_class = SIMTRACE_MSGC_SNIFF; - usb_msg_header->msg_type = SIMTRACE_MSGT_SNIFF_CHANGE; + usb_msg_header->msg_type = msg_class; usb_msg->l2h = usb_msg->l1h + sizeof(*usb_msg_header); return usb_msg; @@ -296,11 +296,74 @@ //TRACE_INFO("Changed to ISO 7816-3 state %u\n\r", iso_state); /* don't print since this is function is also called by ISRs */ } +static void usb_send_data(enum simtrace_msg_type_sniff type, const uint8_t* data, uint16_t length, uint32_t flags) +{ + /* Sanity check */ + if (type != SIMTRACE_MSGT_SNIFF_ATR && type != SIMTRACE_MSGT_SNIFF_PPS && type != SIMTRACE_MSGT_SNIFF_TPDU) { + return; + } + + /* Show activity on LED */ + led_blink(LED_GREEN, BLINK_2O_F); + + /* Send data over USB */ + struct msgb *usb_msg = usb_msg_alloc_hdr(SIMTRACE_USB_EP_CARD_DATAIN, SIMTRACE_MSGC_SNIFF, type); + if (!usb_msg) { + return; + } + struct sniff_data *usb_sniff_data = (struct sniff_data *) msgb_put(usb_msg, sizeof(*usb_sniff_data)); + usb_sniff_data->flags = flags; + usb_sniff_data->length = length; + uint8_t *sniff_data = msgb_put(usb_msg, usb_sniff_data->length); + memcpy(sniff_data, data, length); + usb_msg_upd_len_and_submit(usb_msg); + + /* Print message */ + switch (type) { + case SIMTRACE_MSGT_SNIFF_ATR: + printf("ATR"); + break; + case SIMTRACE_MSGT_SNIFF_PPS: + printf("PPS"); + break; + case SIMTRACE_MSGT_SNIFF_TPDU: + printf("TPDU"); + break; + default: + printf("???"); + break; + } + if (flags) { + printf(" ("); + if (flags & SNIFF_DATA_FLAG_ERROR_INCOMPLETE) { + printf("incomplete"); + flags &= ~SNIFF_DATA_FLAG_ERROR_INCOMPLETE; + if (flags) { + printf(", "); + } + } + if (flags & SNIFF_DATA_FLAG_ERROR_MALFORMED) { + printf("malformed"); + flags &= ~SNIFF_DATA_FLAG_ERROR_MALFORMED; + if (flags) { + printf(", "); + } + } + printf(")"); + } + printf(": "); + uint16_t i; + for (i = 0; i < length; i++) { + printf("%02x ", data[i]); + } + printf("\n\r"); +} + /*! Send current ATR over USB - * @param[in] complete if the ATR is complete + * @param[in] flags SNIFF_DATA_FLAG_ data flags * @note Also print the ATR to debug console */ -static void usb_send_atr(bool complete) +static void usb_send_atr(uint32_t flags) { /* Check state */ if (ISO7816_S_IN_ATR != iso_state) { @@ -312,28 +375,8 @@ return; } - /* Show activity on LED */ - led_blink(LED_GREEN, BLINK_2O_F); - - /* Print ATR */ - printf("ATR%s: ", complete ? "" : " (incomplete)"); - uint8_t i; - for (i = 0; i < atr_i; i++) { - printf("%02x ", atr[i]); - } - printf("\n\r"); - /* Send ATR over USB */ - struct msgb *usb_msg = usb_msg_alloc_hdr(SIMTRACE_USB_EP_CARD_DATAIN, SIMTRACE_MSGC_SNIFF, SIMTRACE_MSGT_SNIFF_ATR); - if (!usb_msg) { - return; - } - struct sniff_data *usb_sniff_data_atr = (struct sniff_data *) msgb_put(usb_msg, sizeof(*usb_sniff_data_atr)); - usb_sniff_data_atr->complete = complete; - usb_sniff_data_atr->length = atr_i; - uint8_t *data = msgb_put(usb_msg, usb_sniff_data_atr->length); - memcpy(data, atr, atr_i); - usb_msg_upd_len_and_submit(usb_msg); + usb_send_data(SIMTRACE_MSGT_SNIFF_ATR, atr, atr_i, flags); } /*! Process ATR byte @@ -428,7 +471,7 @@ } case ATR_S_WAIT_TCK: /* see ISO/IEC 7816-3:2006 section 8.2.5 */ /* we could verify the checksum, but we are just here to sniff */ - usb_send_atr(true); /* send ATR to host software using USB */ + usb_send_atr(0); /* send ATR to host software using USB */ change_state(ISO7816_S_WAIT_TPDU); /* go to next state */ break; default: @@ -437,10 +480,10 @@ } /*! Send current PPS over USB - * @param[in] complete if the PPS is complete + * @param[in] flags SNIFF_DATA_FLAG_ data flags * @note Also print the PPS over the debug console */ -static void usb_send_pps(bool complete) +static void usb_send_pps(uint32_t flags) { uint8_t *pps_cur; /* current PPS (request or response) */ @@ -475,29 +518,9 @@ if (pps_state > PPS_S_WAIT_PCK) { pps[pps_i++] = pps_cur[5]; } - - /* Show activity on LED */ - led_blink(LED_GREEN, BLINK_2O_F); - - /* Print PPS */ - printf("PPS%s: ", complete ? "" : " (incomplete)"); - uint8_t i; - for (i = 0; i < pps_i; i++) { - printf("%02x ", pps[i]); - } - printf("\n\r"); /* Send message over USB */ - struct msgb *usb_msg = usb_msg_alloc_hdr(SIMTRACE_USB_EP_CARD_DATAIN, SIMTRACE_MSGC_SNIFF, SIMTRACE_MSGT_SNIFF_PPS); - if (!usb_msg) { - return; - } - struct sniff_data *usb_sniff_data_pps = (struct sniff_data *) msgb_put(usb_msg, sizeof(*usb_sniff_data_pps)); - usb_sniff_data_pps->complete = complete; - usb_sniff_data_pps->length = pps_i; - uint8_t *data = msgb_put(usb_msg, usb_sniff_data_pps->length); - memcpy(data, pps, pps_i); - usb_msg_upd_len_and_submit(usb_msg); + usb_send_data(SIMTRACE_MSGT_SNIFF_PPS, pps, pps_i, flags); } /*! Send Fi/Di change over USB @@ -579,7 +602,7 @@ } check ^= pps_cur[5]; pps_state = PPS_S_WAIT_END; - usb_send_pps(true); /* send PPS to host software using USB */ + usb_send_pps(0); /* send PPS to host software using USB */ if (ISO7816_S_IN_PPS_REQ == iso_state) { if (0 == check) { /* checksum is valid */ change_state(ISO7816_S_WAIT_PPS_RSP); /* go to next state */ @@ -616,10 +639,10 @@ } /*! Send current TPDU over USB - * @param[in] complete if the TPDU is complete + * @param[in] flags SNIFF_DATA_FLAG_ data flags * @note Also print the TPDU over the debug console */ -static void usb_send_tpdu(bool complete) +static void usb_send_tpdu(uint32_t flags) { /* Check state */ if (ISO7816_S_IN_TPDU != iso_state) { @@ -627,28 +650,8 @@ return; } - /* Show activity on LED */ - led_blink(LED_GREEN, BLINK_2O_F); - - /* Print TPDU */ - printf("TPDU%s: ", complete ? "" : " (incomplete)"); - uint16_t i; - for (i = 0; i < tpdu_packet_i && i < ARRAY_SIZE(tpdu_packet); i++) { - printf("%02x ", tpdu_packet[i]); - } - printf("\n\r"); - /* Send ATR over USB */ - struct msgb *usb_msg = usb_msg_alloc_hdr(SIMTRACE_USB_EP_CARD_DATAIN, SIMTRACE_MSGC_SNIFF, SIMTRACE_MSGT_SNIFF_TPDU); - if (!usb_msg) { - return; - } - struct sniff_data *usb_sniff_data_tpdu = (struct sniff_data *) msgb_put(usb_msg, sizeof(*usb_sniff_data_tpdu)); - usb_sniff_data_tpdu->complete = complete; - usb_sniff_data_tpdu->length = tpdu_packet_i; - uint8_t *data = msgb_put(usb_msg, usb_sniff_data_tpdu->length); - memcpy(data, tpdu_packet, tpdu_packet_i); - usb_msg_upd_len_and_submit(usb_msg); + usb_send_data(SIMTRACE_MSGT_SNIFF_TPDU, tpdu_packet, tpdu_packet_i, flags); } static void process_byte_tpdu(uint8_t byte) @@ -722,7 +725,7 @@ break; case TPDU_S_SW2: tpdu_packet[tpdu_packet_i++] = byte; - usb_send_tpdu(true); /* send TPDU to host software using USB */ + usb_send_tpdu(0); /* send TPDU to host software using USB */ change_state(ISO7816_S_WAIT_TPDU); /* this is the end of the TPDU */ break; case TPDU_S_DATA_SINGLE: @@ -993,16 +996,16 @@ /* Use timeout to detect interrupted data transmission */ switch (iso_state) { case ISO7816_S_IN_ATR: - usb_send_atr(false); /* send incomplete ATR to host software using USB */ + usb_send_atr(SNIFF_DATA_FLAG_ERROR_INCOMPLETE); /* send incomplete ATR to host software using USB */ change_state(ISO7816_S_WAIT_ATR); break; case ISO7816_S_IN_TPDU: - usb_send_tpdu(false); /* send incomplete PPS to host software using USB */ + usb_send_tpdu(SNIFF_DATA_FLAG_ERROR_INCOMPLETE); /* send incomplete PPS to host software using USB */ change_state(ISO7816_S_WAIT_TPDU); break; case ISO7816_S_IN_PPS_REQ: case ISO7816_S_IN_PPS_RSP: - usb_send_pps(false); /* send incomplete TPDU to host software using USB */ + usb_send_pps(SNIFF_DATA_FLAG_ERROR_INCOMPLETE); /* send incomplete TPDU to host software using USB */ change_state(ISO7816_S_WAIT_TPDU); break; default: diff --git a/host/simtrace2-sniff.c b/host/simtrace2-sniff.c index b61b7d0..eb547b0 100644 --- a/host/simtrace2-sniff.c +++ b/host/simtrace2-sniff.c @@ -97,7 +97,7 @@ static int process_change(const uint8_t *buf, int len) { /* check if there is enough data for the structure */ - if (lenlength) { + if (len < sizeof(struct sniff_data) + data->length) { return -2; } - printf("ATR%s: ", atr->complete ? "" : " (incomplete)"); + /* check type */ + if (type != SIMTRACE_MSGT_SNIFF_ATR && type != SIMTRACE_MSGT_SNIFF_PPS && type != SIMTRACE_MSGT_SNIFF_TPDU) { + return -3; + } + + /* Print message */ + switch (type) { + case SIMTRACE_MSGT_SNIFF_ATR: + printf("ATR"); + break; + case SIMTRACE_MSGT_SNIFF_PPS: + printf("PPS"); + break; + case SIMTRACE_MSGT_SNIFF_TPDU: + printf("TPDU"); + break; + default: + printf("???"); + break; + } + if (data->flags) { + printf(" ("); + if (data->flags & SNIFF_DATA_FLAG_ERROR_INCOMPLETE) { + printf("incomplete"); + data->flags &= ~SNIFF_DATA_FLAG_ERROR_INCOMPLETE; + if (data->flags) { + printf(", "); + } + } + if (data->flags & SNIFF_DATA_FLAG_ERROR_MALFORMED) { + printf("malformed"); + data->flags &= ~SNIFF_DATA_FLAG_ERROR_MALFORMED; + if (data->flags) { + printf(", "); + } + } + printf(")"); + } + printf(": "); uint16_t i; - for (i = 0; i < atr->length; i++) { - printf("%02x ", atr->data[i]); - } - printf("\n"); - return 0; -} - -static int process_pps(const uint8_t *buf, int len) -{ - /* check if there is enough data for the structure */ - if (lenlength) { - return -2; - } - - printf("PPS%s: ", pps->complete ? "" : " (incomplete) "); - uint16_t i; - for (i = 0; i < pps->length; i++) { - printf("%02x ", pps->data[i]); - } - printf("\n"); - return 0; -} - -static int process_tpdu(const uint8_t *buf, int len) -{ - /* check if there is enough data for the structure */ - if (lenlength) { - return -2; - } - - /* print TPDU */ - printf("TPDU%s: ", tpdu->complete ? "" : " (incomplete)"); - uint16_t i; - for (i = 0; i < tpdu->length; i++) { - printf("%02x ", tpdu->data[i]); + for (i = 0; i < data->length; i++) { + printf("%02x ", data->data[i]); } printf("\n"); - /* send TPDU (now considered as APDU) to GSMTAP */ - gsmtap_send_sim(tpdu->data, tpdu->length); + if (SIMTRACE_MSGT_SNIFF_TPDU == type) { + /* send TPDU (now considered as APDU) to GSMTAP */ + gsmtap_send_sim(data->data, data->length); + } + return 0; } @@ -215,19 +211,19 @@ static int process_usb_msg(const uint8_t *buf, int len) { /* check if enough data for the header is present */ - if (lenmsg_len) { + if (len < msg_hdr->msg_len) { return 0; } //printf("msg: %s\n", osmo_hexdump(buf, msg_hdr->msg_len)); /* check for message class */ - if (SIMTRACE_MSGC_SNIFF!=msg_hdr->msg_class) { /* we only care about sniffing messages */ + if (SIMTRACE_MSGC_SNIFF != msg_hdr->msg_class) { /* we only care about sniffing messages */ return msg_hdr->msg_len; /* discard non-sniffing messaged */ } @@ -242,13 +238,9 @@ process_fidi(buf, len); break; case SIMTRACE_MSGT_SNIFF_ATR: - process_atr(buf, len); - break; case SIMTRACE_MSGT_SNIFF_PPS: - process_pps(buf, len); - break; case SIMTRACE_MSGT_SNIFF_TPDU: - process_tpdu(buf, len); + process_data(msg_hdr->msg_type, buf, len); break; default: printf("unknown SIMtrace msg type 0x%02x\n", msg_hdr->msg_type); -- To view, visit https://gerrit.osmocom.org/9920 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I768a0ad639aa5e648a630af72d01f7b68082b6b6 Gerrit-Change-Number: 9920 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 8 15:36:22 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Sun, 8 Jul 2018 15:36:22 +0000 Subject: Change in simtrace2[master]: sniffer: move data print before USB send Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9921 Change subject: sniffer: move data print before USB send ...................................................................... sniffer: move data print before USB send when the host software does not retrieve the USB messages the memory is filled and no new USB messages can be allocated, preventing the following code to print the message Change-Id: Ie8946894a84cb853b45555f7abb1ca6f32111425 --- M firmware/libcommon/source/sniffer.c 1 file changed, 13 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/21/9921/1 diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index b78339b..a47ef55 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -306,18 +306,6 @@ /* Show activity on LED */ led_blink(LED_GREEN, BLINK_2O_F); - /* Send data over USB */ - struct msgb *usb_msg = usb_msg_alloc_hdr(SIMTRACE_USB_EP_CARD_DATAIN, SIMTRACE_MSGC_SNIFF, type); - if (!usb_msg) { - return; - } - struct sniff_data *usb_sniff_data = (struct sniff_data *) msgb_put(usb_msg, sizeof(*usb_sniff_data)); - usb_sniff_data->flags = flags; - usb_sniff_data->length = length; - uint8_t *sniff_data = msgb_put(usb_msg, usb_sniff_data->length); - memcpy(sniff_data, data, length); - usb_msg_upd_len_and_submit(usb_msg); - /* Print message */ switch (type) { case SIMTRACE_MSGT_SNIFF_ATR: @@ -357,6 +345,19 @@ printf("%02x ", data[i]); } printf("\n\r"); + + /* Send data over USB */ + struct msgb *usb_msg = usb_msg_alloc_hdr(SIMTRACE_USB_EP_CARD_DATAIN, SIMTRACE_MSGC_SNIFF, type); + if (!usb_msg) { + return; + } + struct sniff_data *usb_sniff_data = (struct sniff_data *) msgb_put(usb_msg, sizeof(*usb_sniff_data)); + usb_sniff_data->flags = flags; + usb_sniff_data->length = length; + uint8_t *sniff_data = msgb_put(usb_msg, usb_sniff_data->length); + memcpy(sniff_data, data, length); + usb_msg_upd_len_and_submit(usb_msg); + } /*! Send current ATR over USB -- To view, visit https://gerrit.osmocom.org/9921 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ie8946894a84cb853b45555f7abb1ca6f32111425 Gerrit-Change-Number: 9921 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 8 15:36:23 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Sun, 8 Jul 2018 15:36:23 +0000 Subject: Change in simtrace2[master]: sniffer: move reset handling from ISR to main loop Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9922 Change subject: sniffer: move reset handling from ISR to main loop ...................................................................... sniffer: move reset handling from ISR to main loop Change-Id: Ia88fb4baf49017524bb201123da3511e5342ba48 --- M firmware/libcommon/source/sniffer.c 1 file changed, 16 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/22/9922/1 diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index a47ef55..0c7829f 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -267,11 +267,9 @@ case ISO7816_S_RESET: update_fidi(&sniff_usart, 0x11); /* reset baud rate to default Di/Fi values */ update_wt(10, 1); /* reset WT time-out */ - change_flags |= SNIFF_CHANGE_FLAG_RESET_HOLD; /* set flag and let main loop send it */ break; case ISO7816_S_WAIT_ATR: rbuf_reset(&sniff_buffer); /* reset buffer for new communication */ - change_flags |= SNIFF_CHANGE_FLAG_RESET_RELEASE; /* set flag and let main loop send it */ break; case ISO7816_S_IN_ATR: atr_i = 0; @@ -817,13 +815,9 @@ } /* Update the ISO state according to the reset change */ if (PIO_Get(&pin_rst)) { - if (ISO7816_S_WAIT_ATR != iso_state) { - change_state(ISO7816_S_WAIT_ATR); - } + change_flags |= SNIFF_CHANGE_FLAG_RESET_HOLD; /* set flag and let main loop send it */ } else { - if (ISO7816_S_RESET != iso_state) { - change_state(ISO7816_S_RESET); - } + change_flags |= SNIFF_CHANGE_FLAG_RESET_RELEASE; /* set flag and let main loop send it */ } } @@ -949,6 +943,10 @@ process_any_usb_commands(queue); */ + /* WARNING: the signal data and flags are not synchronized. We have to hope + * the processing is fast enough to not land in the wrong state while data + * is remaining + */ /* Handle sniffed data */ if (!rbuf_is_empty(&sniff_buffer)) { /* use if instead of while to let the main loop restart the watchdog */ uint8_t byte = rbuf_read(&sniff_buffer); @@ -993,6 +991,16 @@ /* Handle flags */ if (change_flags) { /* WARNING this is not synced with the data buffer handling */ + if (change_flags & SNIFF_CHANGE_FLAG_RESET_HOLD) { + if (ISO7816_S_WAIT_ATR != iso_state) { + change_state(ISO7816_S_WAIT_ATR); + } + } + if (change_flags & SNIFF_CHANGE_FLAG_RESET_RELEASE) { + if (ISO7816_S_RESET != iso_state) { + change_state(ISO7816_S_RESET); + } + } if (change_flags & SNIFF_CHANGE_FLAG_TIMEOUT_WT) { /* Use timeout to detect interrupted data transmission */ switch (iso_state) { -- To view, visit https://gerrit.osmocom.org/9922 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ia88fb4baf49017524bb201123da3511e5342ba48 Gerrit-Change-Number: 9922 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 8 15:36:23 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Sun, 8 Jul 2018 15:36:23 +0000 Subject: Change in simtrace2[master]: LED: add need pattern Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9923 Change subject: LED: add need pattern ...................................................................... LED: add need pattern new LED pattern: off for 200 ms and then on Change-Id: Id2c40dc20d75ed6f38b735164ad1eb2860dc480c --- M firmware/libboard/common/include/led.h M firmware/libboard/common/source/led.c 2 files changed, 13 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/23/9923/1 diff --git a/firmware/libboard/common/include/led.h b/firmware/libboard/common/include/led.h index 0c851f0..339702d 100644 --- a/firmware/libboard/common/include/led.h +++ b/firmware/libboard/common/include/led.h @@ -31,6 +31,7 @@ BLINK_200O_F = 7, BLINK_600O_F = 8, BLINK_CUSTOM = 9, + BLINK_2F_O, _NUM_LED_BLINK }; diff --git a/firmware/libboard/common/source/led.c b/firmware/libboard/common/source/led.c index e3293b6..6772007 100644 --- a/firmware/libboard/common/source/led.c +++ b/firmware/libboard/common/source/led.c @@ -73,16 +73,23 @@ static const struct blink_state bs_3on_1off_3on_1off_3on_30off[] = { { 300, 1 }, { 100, 0 }, { 300, 1 }, { 100, 0 }, { 300, 1 }, { 3000, 0 } }; + static const struct blink_state bs_2on_off[] = { { 200, 1 }, { 0, 0 }, }; + static const struct blink_state bs_200on_off[] = { { 20000, 1 }, { 0, 0 }, }; + static const struct blink_state bs_600on_off[] = { { 60000, 1 }, { 0, 0 }, }; +static const struct blink_state bs_2off_on[] = { + { 200, 0 }, { 0, 1 }, +}; + /* a blink pattern is an array of blink_states */ struct blink_pattern { @@ -128,6 +135,11 @@ .states = bs_600on_off, .size = ARRAY_SIZE(bs_600on_off), }, + [BLINK_2F_O] = { + .states = bs_2off_on, + .size = ARRAY_SIZE(bs_2off_on), + }, + }; struct led_state { -- To view, visit https://gerrit.osmocom.org/9923 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id2c40dc20d75ed6f38b735164ad1eb2860dc480c Gerrit-Change-Number: 9923 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 8 15:36:24 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Sun, 8 Jul 2018 15:36:24 +0000 Subject: Change in simtrace2[master]: sniffer: set LED pattern Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9924 Change subject: sniffer: set LED pattern ...................................................................... sniffer: set LED pattern The red and green LEDs are now used as follows: - red on = power (firmware is running) - red blink = error detected (e.g. during ISO-7816 parsing) - green on = running (sniffer mode is running) - green blink = activity (e.g. USB message sent) Change-Id: Ib1b6ff87fb92d6ed3ecae4bc89386206aaab508e --- M firmware/apps/trace/main.c M firmware/libcommon/source/sniffer.c 2 files changed, 8 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/24/9924/1 diff --git a/firmware/apps/trace/main.c b/firmware/apps/trace/main.c index 6b6d70b..f7eb15d 100644 --- a/firmware/apps/trace/main.c +++ b/firmware/apps/trace/main.c @@ -142,10 +142,15 @@ enum confNum last_simtrace_config = simtrace_config; unsigned int i = 0; - /* Configure LED output (red = on, green = activity */ + /* Configure LED output + * red on = power + * red blink = error + * green on = running + * green blink = activity + */ led_init(); led_blink(LED_RED, BLINK_ALWAYS_ON); - led_blink(LED_GREEN, BLINK_ALWAYS_OFF); + led_blink(LED_GREEN, BLINK_ALWAYS_ON); /* Enable watchdog for 2000 ms, with no window */ WDT_Enable(WDT, WDT_MR_WDRSTEN | WDT_MR_WDDBGHLT | WDT_MR_WDIDLEHLT | diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 0c7829f..0026783 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -302,7 +302,7 @@ } /* Show activity on LED */ - led_blink(LED_GREEN, BLINK_2O_F); + led_blink(LED_GREEN, BLINK_2F_O); /* Print message */ switch (type) { -- To view, visit https://gerrit.osmocom.org/9924 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ib1b6ff87fb92d6ed3ecae4bc89386206aaab508e Gerrit-Change-Number: 9924 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 8 15:36:25 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Sun, 8 Jul 2018 15:36:25 +0000 Subject: Change in simtrace2[master]: minor: fix linker warning Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9925 Change subject: minor: fix linker warning ...................................................................... minor: fix linker warning linker warning: obj/simtrace/dfu_sniffer.o: In function `usb_send_data': /media/data/work/simtrace2/simtrace2/firmware/libcommon/source/sniffer.c:338: warning: undefined reference to `putchar' Change-Id: I934f3fcb474d4046e921511a024c3a0b8533c782 --- M firmware/libcommon/source/sniffer.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/25/9925/1 diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 0026783..9e7341b 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -335,7 +335,7 @@ printf(", "); } } - printf(")"); + putchar(')'); } printf(": "); uint16_t i; -- To view, visit https://gerrit.osmocom.org/9925 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I934f3fcb474d4046e921511a024c3a0b8533c782 Gerrit-Change-Number: 9925 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 8 15:36:26 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Sun, 8 Jul 2018 15:36:26 +0000 Subject: Change in simtrace2[master]: sniffer: also send malformed message over USB Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9926 Change subject: sniffer: also send malformed message over USB ...................................................................... sniffer: also send malformed message over USB Change-Id: I124c8db1d2f836e185630bbe8b5e52eb085d702a --- M firmware/libcommon/source/sniffer.c 1 file changed, 15 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/26/9926/1 diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 9e7341b..79d825f 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -412,8 +412,11 @@ atr_state = ATR_S_WAIT_T0; /* wait for format byte */ break; default: - atr_i--; /* revert last byte */ TRACE_WARNING("Invalid TS received\n\r"); + led_blink(LED_RED, BLINK_2F_O); /* indicate error to user */ + usb_send_atr(SNIFF_DATA_FLAG_ERROR_MALFORMED); /* send ATR to host software using USB */ + change_state(ISO7816_S_WAIT_ATR); /* reset state */ + break; } i = 0; /* first interface byte sub-group is coming (T0 is kind of TD0) */ break; @@ -559,6 +562,8 @@ pps_state = PPS_S_WAIT_PPS0; /* go to next state */ } else { TRACE_INFO("Invalid PPSS received\n\r"); + led_blink(LED_RED, BLINK_2F_O); /* indicate error to user */ + usb_send_pps(SNIFF_DATA_FLAG_ERROR_MALFORMED); /* send ATR to host software using USB */ change_state(ISO7816_S_WAIT_TPDU); /* go back to TPDU state */ } break; @@ -670,6 +675,8 @@ case TPDU_S_CLA: if (0xff == byte) { TRACE_WARNING("0xff is not a valid class byte\n\r"); + led_blink(LED_RED, BLINK_2F_O); /* indicate error to user */ + usb_send_tpdu(SNIFF_DATA_FLAG_ERROR_MALFORMED); /* send ATR to host software using USB */ change_state(ISO7816_S_WAIT_TPDU); /* go back to TPDU state */ return; } @@ -680,6 +687,8 @@ case TPDU_S_INS: if ((0x60 == (byte & 0xf0)) || (0x90 == (byte & 0xf0))) { TRACE_WARNING("invalid CLA 0x%02x\n\r", byte); + led_blink(LED_RED, BLINK_2F_O); /* indicate error to user */ + usb_send_tpdu(SNIFF_DATA_FLAG_ERROR_MALFORMED); /* send ATR to host software using USB */ change_state(ISO7816_S_WAIT_TPDU); /* go back to TPDU state */ return; } @@ -718,6 +727,8 @@ tpdu_state = TPDU_S_SW2; } else { TRACE_WARNING("invalid SW1 0x%02x\n\r", byte); + led_blink(LED_RED, BLINK_2F_O); /* indicate error to user */ + usb_send_tpdu(SNIFF_DATA_FLAG_ERROR_MALFORMED); /* send ATR to host software using USB */ change_state(ISO7816_S_WAIT_TPDU); /* go back to TPDU state */ return; } @@ -1005,15 +1016,18 @@ /* Use timeout to detect interrupted data transmission */ switch (iso_state) { case ISO7816_S_IN_ATR: + led_blink(LED_RED, BLINK_2F_O); /* indicate error to user */ usb_send_atr(SNIFF_DATA_FLAG_ERROR_INCOMPLETE); /* send incomplete ATR to host software using USB */ change_state(ISO7816_S_WAIT_ATR); break; case ISO7816_S_IN_TPDU: + led_blink(LED_RED, BLINK_2F_O); /* indicate error to user */ usb_send_tpdu(SNIFF_DATA_FLAG_ERROR_INCOMPLETE); /* send incomplete PPS to host software using USB */ change_state(ISO7816_S_WAIT_TPDU); break; case ISO7816_S_IN_PPS_REQ: case ISO7816_S_IN_PPS_RSP: + led_blink(LED_RED, BLINK_2F_O); /* indicate error to user */ usb_send_pps(SNIFF_DATA_FLAG_ERROR_INCOMPLETE); /* send incomplete TPDU to host software using USB */ change_state(ISO7816_S_WAIT_TPDU); break; -- To view, visit https://gerrit.osmocom.org/9926 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I124c8db1d2f836e185630bbe8b5e52eb085d702a Gerrit-Change-Number: 9926 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 8 15:36:27 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Sun, 8 Jul 2018 15:36:27 +0000 Subject: Change in simtrace2[master]: sniffer: only allocate USB message if queue is not too long Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9927 Change subject: sniffer: only allocate USB message if queue is not too long ...................................................................... sniffer: only allocate USB message if queue is not too long When the host does not retrieved the USB messages, they keep getting queue in the firmware, filling the RAM, and preventing further memory to be allocated. Change-Id: I0e447acdf757dcb5dc5c4d8b84a4235866914cad --- M firmware/libcommon/source/sniffer.c 1 file changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/27/9927/1 diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 79d825f..cd732f9 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -226,6 +226,14 @@ */ static struct msgb *usb_msg_alloc_hdr(uint8_t ep, uint8_t msg_class, uint8_t msg_type) { + /* Only allocate message if not too many are already in the queue */ + struct llist_head *head = usb_get_queue(SIMTRACE_USB_EP_CARD_DATAIN); + if (!head) { + return NULL; + } + if (llist_count(head) > 5) { + return NULL; + } struct msgb *usb_msg = usb_buf_alloc(SIMTRACE_USB_EP_CARD_DATAIN); if (!usb_msg) { return NULL; -- To view, visit https://gerrit.osmocom.org/9927 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I0e447acdf757dcb5dc5c4d8b84a4235866914cad Gerrit-Change-Number: 9927 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From admin at opensuse.org Sun Jul 8 22:33:40 2018 From: admin at opensuse.org (OBS Notification) Date: Sun, 08 Jul 2018 22:33:40 +0000 Subject: Build failure of network:osmocom:nightly/osmo-mgw in Debian_9.0/armv7l In-Reply-To: References: Message-ID: <5b42915b4ddfa_26aad4684126064f@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-mgw/Debian_9.0/armv7l Package network:osmocom:nightly/osmo-mgw failed to build in Debian_9.0/armv7l Check out the package for editing: osc checkout network:osmocom:nightly osmo-mgw Last lines of build log: [ 141s] | #define HAVE_SYS_STAT_H 1 [ 141s] | #define HAVE_STDLIB_H 1 [ 141s] | #define HAVE_STRING_H 1 [ 141s] | #define HAVE_MEMORY_H 1 [ 141s] | #define HAVE_STRINGS_H 1 [ 141s] | #define HAVE_INTTYPES_H 1 [ 141s] | #define HAVE_STDINT_H 1 [ 141s] | #define HAVE_UNISTD_H 1 [ 141s] | #define HAVE_DLFCN_H 1 [ 141s] | #define LT_OBJDIR ".libs/" [ 141s] | [ 141s] | configure: exit 0 [ 141s] [ 141s] debian/rules:30: recipe for target 'override_dh_auto_test' failed [ 141s] make[1]: *** [override_dh_auto_test] Error 1 [ 141s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 141s] debian/rules:17: recipe for target 'build' failed [ 141s] make: *** [build] Error 2 [ 141s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 141s] [ 141s] armbuild22 failed "build osmo-mgw_1.3.0.29.cede2.dsc" at Sun Jul 8 22:33:26 UTC 2018. [ 141s] [ 141s] ### VM INTERACTION START ### [ 143s] [ 131.003635] SysRq : Power Off [ 143s] [ 131.028356] reboot: Power down [ 144s] ### VM INTERACTION END ### [ 144s] [ 144s] armbuild22 failed "build osmo-mgw_1.3.0.29.cede2.dsc" at Sun Jul 8 22:33:29 UTC 2018. [ 144s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Mon Jul 9 07:42:19 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 9 Jul 2018 07:42:19 +0000 Subject: Change in osmo-gsm-manuals[master]: trx: Add Hardware architecture support section In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/9894 ) Change subject: trx: Add Hardware architecture support section ...................................................................... trx: Add Hardware architecture support section Change-Id: I38388bcb2ea7c0481052d3bca589cb34965ea7fa --- A OsmoTRX/chapters/trx-architectures.adoc M OsmoTRX/osmotrx-usermanual.adoc 2 files changed, 36 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/OsmoTRX/chapters/trx-architectures.adoc b/OsmoTRX/chapters/trx-architectures.adoc new file mode 100644 index 0000000..66eae5e --- /dev/null +++ b/OsmoTRX/chapters/trx-architectures.adoc @@ -0,0 +1,34 @@ +[[osmotrx_arch_support]] +== OsmoTRX hardware architecture support + +OsmoTRX comes out-of-the-box with several algorithms and operations +optimized for certain instruction-set architectures, as well as non-optimized +fall-back algorithms in case required instruction sets are not supported by the +compiler at compile time or by the executing machine at run-time. Support for +these optimized algorithms can be enabled and disabled by means of configure +flags. Accelerated operations include pulse shape filtering, resampling, +sequence correlation, and many other signal processing operations. + +On Intel processors, OsmoTRX makes heavy use of the Streaming SIMD Extensions +(SSE) instruction set. SSE3 is the minimum requirement for accelerated use. +SSE3 is present in the majority of Intel processors since later versions of the +Pentium 4 architecture and is also present on low power Atom processors. Support +is automatically detected at build time. SSE4.1 instruction set is supported +too. This feature is enabled by default unless explicitly disabled by passing +the configure flag _--with-sse=no_. When enabled, the compiler will build an +extra version of each of the supported algorithms using each of the supported +mentioned instruction sets. Then, at run-time, OsmoTRX will auto-detect +capabilities of the executing machine and enable an optimized algorithm using +the most suitable available (previously compiled) instruction set. + +On ARM processors, NEON and NEON FMA are supported. Different to the x86, there +is no auto-detection in this case, nor difference between compile and runtime. +NEON support is disabled by default and can be enabled by passing the flag +_--with-neon=yes_ to the configure script; the used compiler must support NEON +instruction set and the resulting binary will only run fine on an ARM board +supporting NEON extensions. Running OsmoTRX built with flag _--with-neon_ on a +board without NEON instruction set support, will most probably end up in the +process being killed with a _SIGILL_ Illegal Instruction signal by the operating +system. NEON FMA (Fused Multiply-Add) is an extension to the NEON instruction +set, and its use in OsmoTRX can be enabled by passing the _--with_neon_vfpv4_ +flag, which will also implicitly enable NEON support (_--with_neon_). diff --git a/OsmoTRX/osmotrx-usermanual.adoc b/OsmoTRX/osmotrx-usermanual.adoc index 3b2e991..f2ccbaf 100644 --- a/OsmoTRX/osmotrx-usermanual.adoc +++ b/OsmoTRX/osmotrx-usermanual.adoc @@ -23,6 +23,8 @@ include::chapters/configuration.adoc[] +include::chapters/trx-architectures.adoc[] + include::../common/chapters/trx_if.adoc[] include::../common/chapters/port_numbers.adoc[] -- To view, visit https://gerrit.osmocom.org/9894 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I38388bcb2ea7c0481052d3bca589cb34965ea7fa Gerrit-Change-Number: 9894 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 9 07:42:21 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 9 Jul 2018 07:42:21 +0000 Subject: Change in osmo-gsm-manuals[master]: trx: Add Hardware device support section In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/9895 ) Change subject: trx: Add Hardware device support section ...................................................................... trx: Add Hardware device support section Change-Id: I87fc54cf1751f31a3e92d6503625e984f9a6130f --- A OsmoTRX/chapters/trx-backends.adoc M OsmoTRX/osmotrx-usermanual.adoc 2 files changed, 69 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/OsmoTRX/chapters/trx-backends.adoc b/OsmoTRX/chapters/trx-backends.adoc new file mode 100644 index 0000000..32ff82a --- /dev/null +++ b/OsmoTRX/chapters/trx-backends.adoc @@ -0,0 +1,67 @@ +[[osmotrx_device_support]] +== OsmoTRX hardware device support + +OsmoTRX consists of a _common_ part that applies to all TRX devices as well as +_hardware-specific_ parts for each TRX device. The hardware-specific parts are +usually provided by vendor-specific or device-specific libraries that are then +handled by some OsmoTRX glue code presenting a unified interface towards the +rest of the code by means of a _RadioDevice_ class. + +The common part includes the core TRX architecture as well as code for +implementing the external interfaces such as the TRX Manager UDP socket, +control, and VTY interfaces. + +The hardware-specific parts include support for driving one particular +implementation of a radio modem. Such a physical layer +implementation can come in many forms. Sometimes it runs on a general +purpose CPU, sometimes on a dedicated ARM core, a dedicated DSP, a +combination of DSP and FPGA. + +Joining the common part with each of the available backends results in a +different binary with different suffix for each backend. For instance, when +OsmoTRX is built with UHD backend, an _osmo-trx-uhd_ binary is generated; when +OsmoTRX is built with LimeSuite backend, an _osmo-trx-lms_ binary is generated. +Build of different backend can be enabled and disabled by means of configure +flags, which can be found in each subsection relative to each backend below. + +== `osmo-trx-uhd` for UHD based Transceivers + +This OsmoTRX model uses _libuhd_ (UHD, USRP Hardware Driver) to drive the +device, that is configuring it and reading/writing samples from/to it. + +So far, this backend has been mostly used to drive devices such as the Ettus +B200 family and Fairwaves UmTRX family, and used to be the default backend used +for legacy @osmo-trx@ binary when per-backend binaries didn't exist yet. + +Any device providing generic support for UHD should theoretically be able to be +run through this backend without much effort, but pracitcal experience showed +that some devices don't play well with it, such as the LimeSDR family of +devices, which showed far better results when using its native interface. + +Related code can be found in the _Transceiver52M/device/uhd/_ directory in +_osmo-trx.git_. + +== `osmo-trx-lms` for LimeSuite based Transceivers + +This OsmoTRX model uses LimeSuite API and library to drive the device, that is +configuring it and reading/writing samples from/to it. + +This backend was developed in order to be used together with LimeSDR-USB and +LimeSDR-mini devices, due to to the poor results obtained with the UHD backend, +and to simplify the stack. + +Related code can be found in the _Transceiver52M/device/lms/_ directory in +_osmo-trx.git_. + + +== `osmo-trx-usrp1` for libusrp based Transceivers + +This OsmoTRX model uses the legacy libusrp driver provided in GNU Radio 3.4.2. + +As this code was dropped from GNU Radio at some point and was found very +difficult to build, some work was done to create a standalone libusrp which can +be nowadays found as a separate git repository together with other osmocom git +repositories, in https://git.osmocom.org/libusrp/ + +Related code can be found in the _Transceiver52M/device/usrp1/_ directory in +_osmo-trx.git_. diff --git a/OsmoTRX/osmotrx-usermanual.adoc b/OsmoTRX/osmotrx-usermanual.adoc index f2ccbaf..7d04f78 100644 --- a/OsmoTRX/osmotrx-usermanual.adoc +++ b/OsmoTRX/osmotrx-usermanual.adoc @@ -25,6 +25,8 @@ include::chapters/trx-architectures.adoc[] +include::chapters/trx-backends.adoc[] + include::../common/chapters/trx_if.adoc[] include::../common/chapters/port_numbers.adoc[] -- To view, visit https://gerrit.osmocom.org/9895 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I87fc54cf1751f31a3e92d6503625e984f9a6130f Gerrit-Change-Number: 9895 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Mon Jul 9 12:26:47 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Mon, 9 Jul 2018 12:26:47 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-gapk_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#15?= In-Reply-To: <845334203.115.1531052807467.JavaMail.jenkins@jenkins.osmocom.org> References: <845334203.115.1531052807467.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <1424480821.129.1531139207621.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 127.05 KB...] checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether make supports nested variables... (cached) yes checking if gcc supports -fvisibility=hidden... yes checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking whether gcc understands -c and -o together... (cached) yes checking dependency style of gcc... (cached) gcc3 checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for LIBOSMOCORE... yes checking for LIBOSMOCODEC... yes checking for LIBALSA... yes checking for OPENCORE_AMRNB... yes checking gsm/gsm.h usability... yes checking gsm/gsm.h presence... yes checking for gsm/gsm.h... yes checking for gsm_create in -lgsm... yes checking for stdint.h... (cached) yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking for unistd.h... (cached) yes checking for inline... inline checking for int16_t... yes checking for int32_t... yes checking for uint16_t... yes checking for uint32_t... yes checking for uint64_t... yes checking for uint8_t... yes checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... yes checking for memset... yes checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating src/Makefile config.status: creating libgsmhr/Makefile config.status: creating include/Makefile config.status: creating include/gsmhr/Makefile config.status: creating libosmogapk.pc config.status: creating tests/atlocal config.status: creating tests/Makefile config.status: creating config.h config.status: executing depfiles commands config.status: executing libtool commands config.status: executing tests/atconfig commands make[1]: Entering directory ' make all-recursive make[2]: Entering directory ' Making all in include make[3]: Entering directory ' make[4]: Entering directory ' make[4]: Nothing to be done for 'all-am'. make[4]: Leaving directory ' make[3]: Leaving directory ' Making all in src make[3]: Entering directory ' CC procqueue.lo CC pq_format.lo CC pq_codec.lo CC pq_file.lo CC pq_alsa.lo CC pq_rtp.lo CC pq_ecu.lo CC ecu_fr.lo CC formats.lo CC fmt_ti.lo CC fmt_amr.lo CC fmt_gsm.lo CC fmt_hr_ref.lo CC fmt_racal.lo CC fmt_rawpcm.lo CC fmt_rtp_amr.lo CC fmt_rtp_efr.lo CC fmt_rtp_hr_etsi.lo CC fmt_rtp_hr_ietf.lo CC fmt_amr_opencore.lo CC codecs.lo CC codec_pcm.lo CC codec_hr.lo CC codec_fr.lo CC codec_efr.lo CC codec_amr.lo CC benchmark.lo CC common.lo CCLD libosmogapk.la CC app_osmo_gapk.o CCLD osmo-gapk make[3]: Leaving directory ' Making all in tests make[3]: Entering directory ' make[3]: Nothing to be done for 'all'. make[3]: Leaving directory ' make[3]: Entering directory ' make[3]: Leaving directory ' make[2]: Leaving directory ' make[1]: Leaving directory ' make[1]: Entering directory ' Making dvi in include make[2]: Entering directory ' make[3]: Entering directory ' make[3]: Nothing to be done for 'dvi-am'. make[3]: Leaving directory ' make[2]: Leaving directory ' Making dvi in src make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi'. make[2]: Leaving directory ' Making dvi in tests make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi'. make[2]: Leaving directory ' make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi-am'. make[2]: Leaving directory ' make[1]: Leaving directory ' make[1]: Entering directory ' Making check in include make[2]: Entering directory ' make[3]: Entering directory ' make[3]: Nothing to be done for 'check-am'. make[3]: Leaving directory ' make[2]: Leaving directory ' Making check in src make[2]: Entering directory ' make[2]: Nothing to be done for 'check'. make[2]: Leaving directory ' Making check in tests make[2]: Entering directory ' make procqueue/pq_test io/pq_file_test io/pq_rtp_test ecu/ecu_fr_test make[3]: Entering directory ' CC procqueue/pq_test.o CCLD procqueue/pq_test CC io/pq_file_test.o CCLD io/pq_file_test CC io/pq_rtp_test.o CCLD io/pq_rtp_test CC ecu/ecu_fr_test.o CCLD ecu/ecu_fr_test make[3]: Leaving directory ' make check-local make[3]: Entering directory ' /bin/bash '../../../tests/testsuite' ## ---------------------------- ## ## gapk 0.4.75-27bc test suite. ## ## ---------------------------- ## Regression tests. 1: procqueue ok 2: io/pq_file FAILED (testsuite.at:13) 3: io/pq_rtp ok 4: ecu/ecu_fr_test ok 5: conv/enc/amr_efr ok 6: conv/enc/gsm ok 7: conv/enc/racal_hr skipped (testsuite.at:58) 8: conv/enc/racal_fr ok 9: conv/enc/racal_efr ok 10: conv/enc/ti_hr skipped (testsuite.at:91) 11: conv/enc/ti_fr ok 12: conv/enc/ti_efr ok 13: conv/enc/rtp_efr ok 14: conv/enc/rtp_hr_etsi skipped (testsuite.at:135) 15: conv/enc/rtp_hr_ietf skipped (testsuite.at:146) 16: conv/dec/amr_efr ok 17: conv/dec/gsm ok 18: conv/dec/racal_hr skipped (testsuite.at:179) 19: conv/dec/racal_fr ok 20: conv/dec/racal_efr ok 21: conv/dec/ti_hr skipped (testsuite.at:212) 22: conv/dec/ti_fr ok 23: conv/dec/ti_efr ok 24: conv/dec/rtp_efr ok 25: conv/dec/rtp_hr_etsi skipped (testsuite.at:256) 26: conv/dec/rtp_hr_ietf skipped (testsuite.at:267) ## ------------- ## ## Test results. ## ## ------------- ## ERROR: 18 tests were run, 1 failed unexpectedly. 8 tests were skipped. ## -------------------------- ## ## testsuite.log was created. ## ## -------------------------- ## Please send `tests/testsuite.log' and all information you think might help: To: Subject: [gapk 0.4.75-27bc] testsuite: 2 failed You may investigate any problem if you feel able to do so, in which case the test suite provides a good starting point. Its output may be found below `tests/testsuite.dir'. Makefile:753: recipe for target 'check-local' failed make[3]: *** [check-local] Error 1 make[3]: Leaving directory ' Makefile:602: recipe for target 'check-am' failed make[2]: *** [check-am] Error 2 make[2]: Leaving directory ' Makefile:479: recipe for target 'check-recursive' failed make[1]: *** [check-recursive] Error 1 make[1]: Leaving directory ' Makefile:684: recipe for target 'distcheck' failed make: *** [distcheck] Error 1 + cat-testlogs.sh ======================== ./gapk-0.4.75-27bc/_build/sub/tests/testsuite.dir/02/testsuite.log # -*- compilation -*- 2. testsuite.at:10: testing io/pq_file ... ../../../tests/testsuite.at:13: $abs_top_builddir/tests/io/pq_file_test \ $abs_top_builddir/tests/io/io_sample.txt --- /dev/null 2018-03-27 19:17:06.212284948 +0000 +++ 2018-07-09 12:26:46.928793960 +0000 @@ -0,0 +1,2 @@ +pq_file_test: ../../../tests/io/pq_file_test.c:132: main: Assertion `sample_file != NULL' failed. +: line 29: 2589 Aborted $abs_top_builddir/tests/io/pq_file_test $abs_top_builddir/tests/io/io_sample.txt --- expout 2018-07-09 12:26:46.920794007 +0000 +++ 2018-07-09 12:26:46.920794007 +0000 @@ -1,12 +0,0 @@ -Processing sample file with blk_len=2: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=4: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=8: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=16: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=32: -8217c8fb7675a95008f9089d883gapk - -chunk null_context: depth=0 ../../../tests/testsuite.at:13: exit code was 134, expected 0 2. testsuite.at:10: 2. io/pq_file (testsuite.at:10): FAILED (testsuite.at:13) Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Mon Jul 9 13:20:04 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 9 Jul 2018 13:20:04 +0000 Subject: Change in gapk[master]: Make RTP payload type configurable Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/9928 Change subject: Make RTP payload type configurable ...................................................................... Make RTP payload type configurable For a long time the RTP payload type was hard-coded for outgoing frames. The problem is that according to RFC 3551 only GSM FR has a static payload type value (see table 4, value 3). For other codecs the payload type may be negotiated between the both sides dynamically (i.e. in range 96-127). Let's allow a binary/API user to configure this manually. Change-Id: Ia07ed4e13b4a70c8bb4181564a8190861fd269da Closes: OS#2482 --- M include/osmocom/gapk/procqueue.h M src/app_osmo_gapk.c M src/pq_rtp.c M tests/io/pq_rtp_test.c 4 files changed, 64 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/gapk refs/changes/28/9928/1 diff --git a/include/osmocom/gapk/procqueue.h b/include/osmocom/gapk/procqueue.h index ac9253b..82c1cf9 100644 --- a/include/osmocom/gapk/procqueue.h +++ b/include/osmocom/gapk/procqueue.h @@ -89,8 +89,10 @@ int osmo_gapk_pq_queue_file_output(struct osmo_gapk_pq *pq, FILE *dst, unsigned int block_len); /* RTP */ -int osmo_gapk_pq_queue_rtp_input(struct osmo_gapk_pq *pq, int rtp_fd, unsigned int block_len); -int osmo_gapk_pq_queue_rtp_output(struct osmo_gapk_pq *pq, int rtp_fd, unsigned int block_len); +int osmo_gapk_pq_queue_rtp_input(struct osmo_gapk_pq *pq, int rtp_fd, + unsigned int block_len, uint8_t pt); +int osmo_gapk_pq_queue_rtp_output(struct osmo_gapk_pq *pq, int rtp_fd, + unsigned int block_len, uint8_t pt); /* ALSA */ int osmo_gapk_pq_queue_alsa_input(struct osmo_gapk_pq *pq, const char *hwdev, unsigned int blk_len); diff --git a/src/app_osmo_gapk.c b/src/app_osmo_gapk.c index a4b93ef..91647ee 100644 --- a/src/app_osmo_gapk.c +++ b/src/app_osmo_gapk.c @@ -64,6 +64,9 @@ const char *alsa_out; const struct osmo_gapk_format_desc *fmt_out; + /* RTP payload type */ + uint8_t rtp_pt_in, rtp_pt_out; + int benchmark; int verbose; }; @@ -133,6 +136,8 @@ #endif fprintf(stdout, " -f, --input-format=FMT\tInput format (see below)\n"); fprintf(stdout, " -g, --output-format=FMT\tOutput format (see below)\n"); + fprintf(stdout, " -p --rtp-pt-in=TYPE\t\tRTP payload type for incoming frames\n"); + fprintf(stdout, " -P --rtp-pt-out=TYPE\t\tRTP payload type for outgoing frames\n"); fprintf(stdout, " -b, --enable-benchmark\tEnable codec benchmarking\n"); fprintf(stdout, " -v, --verbose\t\t\tEnable debug messages\n"); fprintf(stdout, "\n"); @@ -203,11 +208,13 @@ #endif {"input-format", 1, 0, 'f'}, {"output-format", 1, 0, 'g'}, + {"rtp-pt-in", 1, 0, 'p'}, + {"rtp-pt-out", 1, 0, 'P'}, {"enable-benchmark", 0, 0, 'b'}, {"verbose", 0, 0, 'v'}, {"help", 0, 0, 'h'}, }; - const char *short_options = "i:o:I:O:f:g:bvh" + const char *short_options = "i:o:I:O:f:g:p:P:bvh" #ifdef HAVE_ALSA "a:A:" #endif @@ -218,6 +225,10 @@ /* Set some defaults */ memset(opt, 0x00, sizeof(*opt)); + /* Default RTP payload type (GSM FR, see RFC 3551) */ + opt->rtp_pt_in = 3; + opt->rtp_pt_out = 3; + /* Parse */ while (1) { int c, rv; @@ -279,6 +290,24 @@ } break; + case 'p': + rv = atoi(optarg); + if (rv < 0 || rv > 0xff) { + LOGP(DAPP, LOGL_ERROR, "Invalid RTP payload type: %d\n", rv); + return -EINVAL; + } + opt->rtp_pt_in = rv; + break; + + case 'P': + rv = atoi(optarg); + if (rv < 0 || rv > 0xff) { + LOGP(DAPP, LOGL_ERROR, "Invalid RTP payload type: %d\n", rv); + return -EINVAL; + } + opt->rtp_pt_out = rv; + break; + case 'b': opt->benchmark = 1; break; @@ -540,7 +569,8 @@ if (gs->in.file.fh) osmo_gapk_pq_queue_file_input(gs->pq, gs->in.file.fh, fmt_in->frame_len); else if (gs->in.rtp.fd != -1) - osmo_gapk_pq_queue_rtp_input(gs->pq, gs->in.rtp.fd, fmt_in->frame_len); + osmo_gapk_pq_queue_rtp_input(gs->pq, gs->in.rtp.fd, + fmt_in->frame_len, gs->opts.rtp_pt_in); #ifdef HAVE_ALSA else if (gs->opts.alsa_in) osmo_gapk_pq_queue_alsa_input(gs->pq, gs->opts.alsa_in, fmt_in->frame_len); @@ -618,7 +648,8 @@ if (gs->out.file.fh) osmo_gapk_pq_queue_file_output(gs->pq, gs->out.file.fh, fmt_out->frame_len); else if (gs->out.rtp.fd != -1) - osmo_gapk_pq_queue_rtp_output(gs->pq, gs->out.rtp.fd, fmt_out->frame_len); + osmo_gapk_pq_queue_rtp_output(gs->pq, gs->out.rtp.fd, + fmt_out->frame_len, gs->opts.rtp_pt_out); #ifdef HAVE_ALSA else if (gs->opts.alsa_out) osmo_gapk_pq_queue_alsa_output(gs->pq, gs->opts.alsa_out, fmt_out->frame_len); diff --git a/src/pq_rtp.c b/src/pq_rtp.c index a50013a..81eeb19 100644 --- a/src/pq_rtp.c +++ b/src/pq_rtp.c @@ -70,8 +70,6 @@ #define RTP_VERSION 2 -#define RTP_PT_GSM_FULL 3 - struct pq_state_rtp { int fd; int blk_len; @@ -193,7 +191,8 @@ } static int -pq_queue_rtp_op(struct osmo_gapk_pq *pq, int udp_fd, unsigned int blk_len, int in_out_n) +pq_queue_rtp_op(struct osmo_gapk_pq *pq, int udp_fd, + unsigned int blk_len, int in_out_n, uint8_t pt) { struct osmo_gapk_pq_item *item; struct pq_state_rtp *state; @@ -210,12 +209,20 @@ * per RTP frame */ state->duration = 160; + /** + * RTP payload type according to RFC 3551, + * section "6. Payload Type Definitions". + * + * Only GSM FR has a static payload type value (see table 4). + * For other codecs the payload type may be negotiated + * between the both sides dynamically (i.e. in range 96-127). + */ + state->payload_type = pt; + if (in_out_n == 0) { state->ssrc = rand(); state->sequence = random(); state->timestamp = random(); - /* FIXME: other payload types!! */ - state->payload_type = RTP_PT_GSM_FULL; } item = osmo_gapk_pq_add_item(pq); @@ -248,24 +255,30 @@ * This typically only makes sense as first item in the queue * \param pq Processing Queue to add this RTP input to * \param[in] udp_fd UDP file descriptor for the RTP input - * \param[in] blk_len Block Length to read from RTP */ + * \param[in] blk_len Block Length to read from RTP + * \param[in] pt Payload type according to RFC 3551 + */ int -osmo_gapk_pq_queue_rtp_input(struct osmo_gapk_pq *pq, int udp_fd, unsigned int blk_len) +osmo_gapk_pq_queue_rtp_input(struct osmo_gapk_pq *pq, int udp_fd, + unsigned int blk_len, uint8_t pt) { LOGPGAPK(LOGL_DEBUG, "PQ '%s': Adding RTP input (blk_len=%u)\n", pq->name, blk_len); - return pq_queue_rtp_op(pq, udp_fd, blk_len, 1); + return pq_queue_rtp_op(pq, udp_fd, blk_len, 1, pt); } /*! Add RTP output to processing queue. * This typically only makes sense as last item in the queue * \param pq Processing Queue to add this RTP output to * \param[in] udp_fd UDP file descriptor for the RTP output - * \param[in] blk_len Block Length to read from RTP */ + * \param[in] blk_len Block Length to read from RTP + * \param[in] pt Payload type according to RFC 3551 + */ int -osmo_gapk_pq_queue_rtp_output(struct osmo_gapk_pq *pq, int udp_fd, unsigned int blk_len) +osmo_gapk_pq_queue_rtp_output(struct osmo_gapk_pq *pq, int udp_fd, + unsigned int blk_len, uint8_t pt) { LOGPGAPK(LOGL_DEBUG, "PQ '%s': Adding RTP output (blk_len=%u)\n", pq->name, blk_len); - return pq_queue_rtp_op(pq, udp_fd, blk_len, 0); + return pq_queue_rtp_op(pq, udp_fd, blk_len, 0, pt); } diff --git a/tests/io/pq_rtp_test.c b/tests/io/pq_rtp_test.c index 2c1bd41..76f59d2 100644 --- a/tests/io/pq_rtp_test.c +++ b/tests/io/pq_rtp_test.c @@ -173,7 +173,7 @@ } /* Init an RTP sink */ - rc = osmo_gapk_pq_queue_rtp_output(pq, state->rtp_dst_fd, payload_len); + rc = osmo_gapk_pq_queue_rtp_output(pq, state->rtp_dst_fd, payload_len, 0x00); if (rc) { printf("Could not init an RTP sink\n"); return rc; @@ -210,7 +210,7 @@ } /* Init an RTP source on any available port */ - rc = osmo_gapk_pq_queue_rtp_input(pq, state->rtp_src_fd, payload_len); + rc = osmo_gapk_pq_queue_rtp_input(pq, state->rtp_src_fd, payload_len, 0x00); if (rc) { printf("Could not init an RTP sink\n"); return rc; -- To view, visit https://gerrit.osmocom.org/9928 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gapk Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ia07ed4e13b4a70c8bb4181564a8190861fd269da Gerrit-Change-Number: 9928 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 9 13:34:08 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 9 Jul 2018 13:34:08 +0000 Subject: Change in gapk[master]: tests/testsuite.at: fix: use proper dir for io/pq_file test Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/9929 Change subject: tests/testsuite.at: fix: use proper dir for io/pq_file test ...................................................................... tests/testsuite.at: fix: use proper dir for io/pq_file test The 'io_sample.txt' is stored in the source directory, not in the build directory... Change-Id: Icae2b8c0a7d5e5b8894cf6ac1370803f39382ffb --- M tests/testsuite.at 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/gapk refs/changes/29/9929/1 diff --git a/tests/testsuite.at b/tests/testsuite.at index 5946661..4635565 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -12,7 +12,7 @@ cat $abs_srcdir/io/pq_file_test.ok > expout AT_CHECK([ $abs_top_builddir/tests/io/pq_file_test \ - $abs_top_builddir/tests/io/io_sample.txt], + $abs_srcdir/tests/io/io_sample.txt], [0], [expout]) AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/9929 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gapk Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Icae2b8c0a7d5e5b8894cf6ac1370803f39382ffb Gerrit-Change-Number: 9929 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 9 13:42:32 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 9 Jul 2018 13:42:32 +0000 Subject: Change in gapk[master]: tests/testsuite.at: fix: use proper dir for io/pq_file test In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9929 to look at the new patch set (#2). Change subject: tests/testsuite.at: fix: use proper dir for io/pq_file test ...................................................................... tests/testsuite.at: fix: use proper dir for io/pq_file test The 'io_sample.txt' is stored in the source directory, not in the build directory... Change-Id: Icae2b8c0a7d5e5b8894cf6ac1370803f39382ffb --- M tests/testsuite.at 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/gapk refs/changes/29/9929/2 -- To view, visit https://gerrit.osmocom.org/9929 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gapk Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icae2b8c0a7d5e5b8894cf6ac1370803f39382ffb Gerrit-Change-Number: 9929 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Mon Jul 9 15:10:06 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Mon, 9 Jul 2018 15:10:06 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-asn1c_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#179?= In-Reply-To: <992330324.116.1531062606385.JavaMail.jenkins@jenkins.osmocom.org> References: <992330324.116.1531062606385.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <1702930910.130.1531149006525.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 3.67 KB...] + ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for style of include used by make... GNU checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking how to run the C++ preprocessor... g++ -E checking for g77... no checking for f77... no checking for xlf... no checking for frt... no checking for pgf77... no checking for cf77... no checking for fort77... no checking for fl32... no checking for af77... no checking for f90... no checking for xlf90... no checking for pgf90... no checking for pghpf... no checking for epcf90... no checking for gfortran... no checking for g95... no checking for f95... no checking for fort... no checking for xlf95... no checking for ifort... no checking for ifc... no checking for efc... no checking for pgf95... no checking for lf95... no checking for ftn... no checking whether we are using the GNU Fortran 77 compiler... no checking whether accepts -g... no checking the maximum length of command line arguments... 32768 checking command to parse /usr/bin/nm -B output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes configure: creating libtool appending configuration tag "CXX" to libtool checking for ld used by g++... /usr/bin/ld -m elf_x86_64 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC checking if g++ PIC flag -fPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate appending configuration tag "F77" to libtool checking for autoconf... /usr/bin/autoconf checking for autoheader... /usr/bin/autoheader checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking dependency style of gcc... (cached) gcc3 checking how to run the C preprocessor... gcc -E checking for a BSD-compatible install... /usr/bin/install -c checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking for bison... bison -y checking for flex... flex checking for yywrap in -lfl... yes checking lex output file root... lex.yy checking whether yytext is a pointer... yes checking for ar... /usr/bin/ar checking for ANSI C header files... (cached) yes checking sys/param.h usability... yes checking sys/param.h presence... yes checking for sys/param.h... yes checking whether byte ordering is bigendian... no checking for off_t... yes checking for size_t... yes checking whether struct tm is in sys/time.h or time.h... time.h checking for intmax_t... yes checking for library containing getopt... none required checking for strtoimax... yes checking for strtoll... yes checking for mergesort... no checking for mkstemps... yes configure: creating ./config.status config.status: creating skeletons/standard-modules/Makefile config.status: creating skeletons/tests/Makefile config.status: creating libasn1compiler/Makefile config.status: creating libasn1parser/Makefile config.status: creating libasn1print/Makefile config.status: creating asn1c/webcgi/Makefile config.status: creating asn1c/tests/Makefile config.status: creating libasn1fix/Makefile config.status: creating skeletons/Makefile config.status: creating examples/Makefile config.status: creating tests/Makefile config.status: creating asn1c/Makefile config.status: creating doc/Makefile config.status: creating asn1c.spec config.status: creating Makefile config.status: creating config.h config.status: executing depfiles commands + make -j 8 make all-recursive make[1]: Entering directory ' Making all in libasn1parser make[2]: Entering directory ' if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF ".deps/asn1parser.Tpo" -c -o asn1parser.lo asn1parser.c; \ then mv -f ".deps/asn1parser.Tpo" ".deps/asn1parser.Plo"; else rm -f ".deps/asn1parser.Tpo"; exit 1; fi bison -y -p asn1p_ -d asn1p_y.y if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF ".deps/asn1p_l.Tpo" -c -o asn1p_l.lo asn1p_l.c; \ then mv -f ".deps/asn1p_l.Tpo" ".deps/asn1p_l.Plo"; else rm -f ".deps/asn1p_l.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF ".deps/asn1p_module.Tpo" -c -o asn1p_module.lo asn1p_module.c; \ then mv -f ".deps/asn1p_module.Tpo" ".deps/asn1p_module.Plo"; else rm -f ".deps/asn1p_module.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF ".deps/asn1p_oid.Tpo" -c -o asn1p_oid.lo asn1p_oid.c; \ then mv -f ".deps/asn1p_oid.Tpo" ".deps/asn1p_oid.Plo"; else rm -f ".deps/asn1p_oid.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF ".deps/asn1p_value.Tpo" -c -o asn1p_value.lo asn1p_value.c; \ then mv -f ".deps/asn1p_value.Tpo" ".deps/asn1p_value.Plo"; else rm -f ".deps/asn1p_value.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF ".deps/asn1p_expr.Tpo" -c -o asn1p_expr.lo asn1p_expr.c; \ then mv -f ".deps/asn1p_expr.Tpo" ".deps/asn1p_expr.Plo"; else rm -f ".deps/asn1p_expr.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF ".deps/asn1p_xports.Tpo" -c -o asn1p_xports.lo asn1p_xports.c; \ then mv -f ".deps/asn1p_xports.Tpo" ".deps/asn1p_xports.Plo"; else rm -f ".deps/asn1p_xports.Tpo"; exit 1; fi asn1p_y.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] mkdir .libs gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -fPIC -DPIC -o .libs/asn1p_expr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -fPIC -DPIC -o .libs/asn1parser.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -fPIC -DPIC -o .libs/asn1p_oid.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -fPIC -DPIC -o .libs/asn1p_module.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -fPIC -DPIC -o .libs/asn1p_xports.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -fPIC -DPIC -o .libs/asn1p_value.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -fPIC -DPIC -o .libs/asn1p_l.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -o asn1p_xports.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -o asn1p_module.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -o asn1parser.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -o asn1p_oid.o >/dev/null 2>&1 asn1p_l.c:3521:12: warning: 'input' defined but not used [-Wunused-function] static int input() ^~~~~ if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF ".deps/asn1p_constr.Tpo" -c -o asn1p_constr.lo asn1p_constr.c; \ then mv -f ".deps/asn1p_constr.Tpo" ".deps/asn1p_constr.Plo"; else rm -f ".deps/asn1p_constr.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -o asn1p_value.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -o asn1p_expr.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF ".deps/asn1p_param.Tpo" -c -o asn1p_param.lo asn1p_param.c; \ then mv -f ".deps/asn1p_param.Tpo" ".deps/asn1p_param.Plo"; else rm -f ".deps/asn1p_param.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF ".deps/asn1p_class.Tpo" -c -o asn1p_class.lo asn1p_class.c; \ then mv -f ".deps/asn1p_class.Tpo" ".deps/asn1p_class.Plo"; else rm -f ".deps/asn1p_class.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF ".deps/asn1p_ref.Tpo" -c -o asn1p_ref.lo asn1p_ref.c; \ then mv -f ".deps/asn1p_ref.Tpo" ".deps/asn1p_ref.Plo"; else rm -f ".deps/asn1p_ref.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -fPIC -DPIC -o .libs/asn1p_constr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -fPIC -DPIC -o .libs/asn1p_param.o if test -f y.tab.h; then \ to=`echo "asn1p_y_H" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \ sed -e "/^#/!b" -e "s/Y_TAB_H/$to/g" -e "s|y\.tab\.h|asn1p_y.h|" \ y.tab.h >asn1p_y.ht; \ rm -f y.tab.h; \ if cmp -s asn1p_y.ht asn1p_y.h; then \ rm -f asn1p_y.ht ;\ else \ mv asn1p_y.ht asn1p_y.h; \ fi; \ fi if test -f y.output; then \ mv y.output asn1p_y.output; \ fi sed '/^#/ s|y\.tab\.c|asn1p_y.c|' y.tab.c >asn1p_y.ct && mv asn1p_y.ct asn1p_y.c rm -f y.tab.c if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF ".deps/asn1p_y.Tpo" -c -o asn1p_y.lo asn1p_y.c; \ then mv -f ".deps/asn1p_y.Tpo" ".deps/asn1p_y.Plo"; else rm -f ".deps/asn1p_y.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -o asn1p_constr.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -fPIC -DPIC -o .libs/asn1p_ref.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -fPIC -DPIC -o .libs/asn1p_class.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -o asn1p_param.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF .deps/asn1p_y.Tpo -c asn1p_y.c -fPIC -DPIC -o .libs/asn1p_y.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -o asn1p_class.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -o asn1p_ref.o >/dev/null 2>&1 asn1p_y.y: In function 'asn1p_parse': asn1p_y.y:357:13: error: 'param' undeclared (first use in this function) *(void **)param = $1; ^~~~~ asn1p_y.y:357:13: note: each undeclared identifier is reported only once for each function it appears in gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -o asn1p_l.o >/dev/null 2>&1 Makefile:299: recipe for target 'asn1p_y.lo' failed make[2]: *** [asn1p_y.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory ' Makefile:302: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory ' Makefile:212: recipe for target 'all' failed make: *** [all] Error 2 Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Mon Jul 9 15:17:02 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 9 Jul 2018 15:17:02 +0000 Subject: Change in gapk[master]: build: fix packaging problems and make distcheck happy Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/9930 Change subject: build: fix packaging problems and make distcheck happy ...................................................................... build: fix packaging problems and make distcheck happy The 'distcheck' rule performs all of the operations associated with packaging a distribution and verifying that the distribution works. There were several problems: - libgsmhr/Makefile.am: 'patches' dir was not listed in EXTRA_DIST - libgsmhr/Makefile.am: (dist)clean targets wan't defined properly - tests/Makefile.am: 'ref-files' dir was not listed in EXTRA_DIST - tests/testsuite.at: wrong path was used for io_sample.txt Change-Id: Ieb8f6a2a81f9b75c8c6c5db443b0e7be02bc4153 --- M libgsmhr/Makefile.am M tests/Makefile.am M tests/testsuite.at 3 files changed, 10 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/gapk refs/changes/30/9930/1 diff --git a/libgsmhr/Makefile.am b/libgsmhr/Makefile.am index e6d246d..f36d759 100644 --- a/libgsmhr/Makefile.am +++ b/libgsmhr/Makefile.am @@ -1,7 +1,10 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir) AM_CFLAGS = -fPIC -Wall ${SYMBOL_VISIBILITY} -EXTRA_DIST=fetch_sources.py +EXTRA_DIST = \ + fetch_sources.py \ + patches \ + $(NULL) LIBVERSION=0:0:0 @@ -22,4 +25,7 @@ libgsmhr_la_LIBADD = -ldl clean-local: - -rm -rf ${REFSRC_PATH}/*.{c,h} ${REFSRC_PATH}/.downloaded + -rm -rf ${REFSRC_PATH}/*.lo + +distclean-local: + -rm -rf ${REFSRC_PATH}/ diff --git a/tests/Makefile.am b/tests/Makefile.am index 4f7c4be..dee4060 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -79,7 +79,7 @@ io/pq_file_test.ok \ io/pq_rtp_test.ok \ io/io_sample.txt \ - ref-files/* \ + ref-files \ $(NULL) DISTCLEANFILES = atconfig atlocal diff --git a/tests/testsuite.at b/tests/testsuite.at index 5946661..1edd077 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -12,7 +12,7 @@ cat $abs_srcdir/io/pq_file_test.ok > expout AT_CHECK([ $abs_top_builddir/tests/io/pq_file_test \ - $abs_top_builddir/tests/io/io_sample.txt], + $abs_srcdir/io/io_sample.txt], [0], [expout]) AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/9930 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gapk Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ieb8f6a2a81f9b75c8c6c5db443b0e7be02bc4153 Gerrit-Change-Number: 9930 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 9 15:17:28 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 9 Jul 2018 15:17:28 +0000 Subject: Change in gapk[master]: tests/testsuite.at: fix: use proper dir for io/pq_file test In-Reply-To: References: Message-ID: Vadim Yanitskiy has abandoned this change. ( https://gerrit.osmocom.org/9929 ) Change subject: tests/testsuite.at: fix: use proper dir for io/pq_file test ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/9929 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gapk Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: Icae2b8c0a7d5e5b8894cf6ac1370803f39382ffb Gerrit-Change-Number: 9929 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 9 15:25:03 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 9 Jul 2018 15:25:03 +0000 Subject: Change in osmo-mgw[master]: stat+vty: fix printing of rate counter values Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/9931 Change subject: stat+vty: fix printing of rate counter values ...................................................................... stat+vty: fix printing of rate counter values When creating the mgcp statistics (DLCX) and also when printing values in the VTY. The printf placeholder %lu is used. However, this is not portable when the same code is compiled on a machine with different integer size (e.g. armv7). - Use PRIu64 when printing ->current value of the rate counters Change-Id: Ifb8944cec83868845f74ad84551eb090f812daf8 --- M src/libosmo-mgcp/mgcp_stat.c M src/libosmo-mgcp/mgcp_vty.c 2 files changed, 6 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/31/9931/1 diff --git a/src/libosmo-mgcp/mgcp_stat.c b/src/libosmo-mgcp/mgcp_stat.c index 4072ac0..3685cfe 100644 --- a/src/libosmo-mgcp/mgcp_stat.c +++ b/src/libosmo-mgcp/mgcp_stat.c @@ -25,6 +25,7 @@ #include #include #include +#include /* Helper function for mgcp_format_stats_rtp() to calculate packet loss */ void calc_loss(struct mgcp_conn_rtp *conn, uint32_t *expected, int *loss) @@ -80,7 +81,7 @@ jitter = calc_jitter(&conn->state); nchars = snprintf(str, str_len, - "\r\nP: PS=%lu, OS=%lu, PR=%lu, OR=%lu, PL=%d, JI=%u", + "\r\nP: PS=%" PRIu64 ", OS=%" PRIu64 ", PR=%" PRIu64 ", OR=%" PRIu64 ", PL=%d, JI=%u", packets_tx->current, octets_tx->current, packets_rx->current, octets_rx->current, ploss, jitter); @@ -93,7 +94,7 @@ if (conn->conn->endp->cfg->osmux != OSMUX_USAGE_OFF) { /* Error Counter */ nchars = snprintf(str, str_len, - "\r\nX-Osmo-CP: EC TI=%lu, TO=%lu", + "\r\nX-Osmo-CP: EC TI=%" PRIu64 ", TO=%" PRIu64, conn->state.in_stream.err_ts_ctr->current, conn->state.out_stream.err_ts_ctr->current); if (nchars < 0 || nchars >= str_len) diff --git a/src/libosmo-mgcp/mgcp_vty.c b/src/libosmo-mgcp/mgcp_vty.c index b586ff6..ad462b7 100644 --- a/src/libosmo-mgcp/mgcp_vty.c +++ b/src/libosmo-mgcp/mgcp_vty.c @@ -30,6 +30,7 @@ #include #include +#include #define RTCP_OMIT_STR "Drop RTCP packets in both directions\n" #define RTP_PATCH_STR "Modify RTP packet header in both directions\n" @@ -164,8 +165,8 @@ dropped_packets = &conn->rate_ctr_group->ctr[RTP_DROPPED_PACKETS_CTR]; vty_out(vty, - " Timestamp Errs: %lu->%lu%s" - " Dropped Packets: %lu%s" + " Timestamp Errs: %" PRIu64 "->%" PRIu64 "%s" + " Dropped Packets: %" PRIu64 "%s" " Payload Type: %d Rate: %u Channels: %d %s" " Frame Duration: %u Frame Denominator: %u%s" " FPP: %d Packet Duration: %u%s" -- To view, visit https://gerrit.osmocom.org/9931 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ifb8944cec83868845f74ad84551eb090f812daf8 Gerrit-Change-Number: 9931 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 9 17:13:07 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 9 Jul 2018 17:13:07 +0000 Subject: Change in osmo-mgw[master]: stat+vty: fix printing of rate counter values In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9931 ) Change subject: stat+vty: fix printing of rate counter values ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9931 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ifb8944cec83868845f74ad84551eb090f812daf8 Gerrit-Change-Number: 9931 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Mon, 09 Jul 2018 17:13:07 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 9 17:13:11 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 9 Jul 2018 17:13:11 +0000 Subject: Change in osmo-mgw[master]: stat+vty: fix printing of rate counter values In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/9931 ) Change subject: stat+vty: fix printing of rate counter values ...................................................................... stat+vty: fix printing of rate counter values When creating the mgcp statistics (DLCX) and also when printing values in the VTY. The printf placeholder %lu is used. However, this is not portable when the same code is compiled on a machine with different integer size (e.g. armv7). - Use PRIu64 when printing ->current value of the rate counters Change-Id: Ifb8944cec83868845f74ad84551eb090f812daf8 --- M src/libosmo-mgcp/mgcp_stat.c M src/libosmo-mgcp/mgcp_vty.c 2 files changed, 6 insertions(+), 4 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/src/libosmo-mgcp/mgcp_stat.c b/src/libosmo-mgcp/mgcp_stat.c index 4072ac0..3685cfe 100644 --- a/src/libosmo-mgcp/mgcp_stat.c +++ b/src/libosmo-mgcp/mgcp_stat.c @@ -25,6 +25,7 @@ #include #include #include +#include /* Helper function for mgcp_format_stats_rtp() to calculate packet loss */ void calc_loss(struct mgcp_conn_rtp *conn, uint32_t *expected, int *loss) @@ -80,7 +81,7 @@ jitter = calc_jitter(&conn->state); nchars = snprintf(str, str_len, - "\r\nP: PS=%lu, OS=%lu, PR=%lu, OR=%lu, PL=%d, JI=%u", + "\r\nP: PS=%" PRIu64 ", OS=%" PRIu64 ", PR=%" PRIu64 ", OR=%" PRIu64 ", PL=%d, JI=%u", packets_tx->current, octets_tx->current, packets_rx->current, octets_rx->current, ploss, jitter); @@ -93,7 +94,7 @@ if (conn->conn->endp->cfg->osmux != OSMUX_USAGE_OFF) { /* Error Counter */ nchars = snprintf(str, str_len, - "\r\nX-Osmo-CP: EC TI=%lu, TO=%lu", + "\r\nX-Osmo-CP: EC TI=%" PRIu64 ", TO=%" PRIu64, conn->state.in_stream.err_ts_ctr->current, conn->state.out_stream.err_ts_ctr->current); if (nchars < 0 || nchars >= str_len) diff --git a/src/libosmo-mgcp/mgcp_vty.c b/src/libosmo-mgcp/mgcp_vty.c index b586ff6..ad462b7 100644 --- a/src/libosmo-mgcp/mgcp_vty.c +++ b/src/libosmo-mgcp/mgcp_vty.c @@ -30,6 +30,7 @@ #include #include +#include #define RTCP_OMIT_STR "Drop RTCP packets in both directions\n" #define RTP_PATCH_STR "Modify RTP packet header in both directions\n" @@ -164,8 +165,8 @@ dropped_packets = &conn->rate_ctr_group->ctr[RTP_DROPPED_PACKETS_CTR]; vty_out(vty, - " Timestamp Errs: %lu->%lu%s" - " Dropped Packets: %lu%s" + " Timestamp Errs: %" PRIu64 "->%" PRIu64 "%s" + " Dropped Packets: %" PRIu64 "%s" " Payload Type: %d Rate: %u Channels: %d %s" " Frame Duration: %u Frame Denominator: %u%s" " FPP: %d Packet Duration: %u%s" -- To view, visit https://gerrit.osmocom.org/9931 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ifb8944cec83868845f74ad84551eb090f812daf8 Gerrit-Change-Number: 9931 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 9 17:23:39 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 9 Jul 2018 17:23:39 +0000 Subject: Change in gapk[master]: build: fix packaging problems and make distcheck happy In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9930 ) Change subject: build: fix packaging problems and make distcheck happy ...................................................................... Patch Set 1: (3 comments) https://gerrit.osmocom.org/#/c/9930/1/libgsmhr/Makefile.am File libgsmhr/Makefile.am: https://gerrit.osmocom.org/#/c/9930/1/libgsmhr/Makefile.am at 15 PS1, Line 15: $(srcdir)/fetch_sources.py "${REFSRC_PATH}" Since this is in EXTRA_DIST I bet this should be $(builddir) instead of srcdir. https://gerrit.osmocom.org/#/c/9930/1/tests/Makefile.am File tests/Makefile.am: https://gerrit.osmocom.org/#/c/9930/1/tests/Makefile.am at 82 PS1, Line 82: ref-files \ If it's a directory I'd be more easy to follow if you add a "/" at the end. https://gerrit.osmocom.org/#/c/9930/1/tests/testsuite.at File tests/testsuite.at: https://gerrit.osmocom.org/#/c/9930/1/tests/testsuite.at at 15 PS1, Line 15: $abs_srcdir/io/io_sample.txt], I think we are missing EXTRA_DIT and adding those there, like we do in all other projects with .ok files. -- To view, visit https://gerrit.osmocom.org/9930 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gapk Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ieb8f6a2a81f9b75c8c6c5db443b0e7be02bc4153 Gerrit-Change-Number: 9930 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Mon, 09 Jul 2018 17:23:39 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 9 17:52:54 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 9 Jul 2018 17:52:54 +0000 Subject: Change in gapk[master]: build: fix packaging problems and make distcheck happy In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/9930 ) Change subject: build: fix packaging problems and make distcheck happy ...................................................................... Patch Set 1: (3 comments) https://gerrit.osmocom.org/#/c/9930/1/libgsmhr/Makefile.am File libgsmhr/Makefile.am: https://gerrit.osmocom.org/#/c/9930/1/libgsmhr/Makefile.am at 15 PS1, Line 15: $(srcdir)/fetch_sources.py "${REFSRC_PATH}" > Since this is in EXTRA_DIST I bet this should be $(builddir) instead of srcdir. Hmm, in libosmocore we use exactly 'srcdir'... I don't think it makes sense in context of this change. After reading https://www.gnu.org/software/automake/manual/html_node/Python.html I am wondering, may we use noinst_PYTHON or nodist_python_PYTHON for this script? https://gerrit.osmocom.org/#/c/9930/1/tests/Makefile.am File tests/Makefile.am: https://gerrit.osmocom.org/#/c/9930/1/tests/Makefile.am at 82 PS1, Line 82: ref-files \ > If it's a directory I'd be more easy to follow if you add a "/" at the end. For some reason, having 'dir/' breaks the build... I noticed that this results in embedding this directory, i.e.: expected: tests/ref-files/... got: tests/ref-files/ref-files/... https://gerrit.osmocom.org/#/c/9930/1/tests/testsuite.at File tests/testsuite.at: https://gerrit.osmocom.org/#/c/9930/1/tests/testsuite.at at 15 PS1, Line 15: $abs_srcdir/io/io_sample.txt], > I think we are missing EXTRA_DIT and adding those there, like we do in all other projects with . [?] There is EXTRA_DIST definition in tests/Makefile.am. -- To view, visit https://gerrit.osmocom.org/9930 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gapk Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ieb8f6a2a81f9b75c8c6c5db443b0e7be02bc4153 Gerrit-Change-Number: 9930 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Mon, 09 Jul 2018 17:52:54 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 9 19:12:58 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 9 Jul 2018 19:12:58 +0000 Subject: Change in osmo-sgsn[master]: sgsn_libgtp.c: Log pointer of deleted context Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9932 Change subject: sgsn_libgtp.c: Log pointer of deleted context ...................................................................... sgsn_libgtp.c: Log pointer of deleted context Change-Id: I8a4627b54090e72f86a9c5a781670be52522062b --- M src/gprs/sgsn_libgtp.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/32/9932/1 diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 4061e7a..70112cb 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -635,7 +635,7 @@ /* Called whenever a PDP context is deleted for any reason */ static int cb_delete_context(struct pdp_t *pdp) { - LOGPDPX(DGPRS, LOGL_INFO, pdp, "Context was deleted\n"); + LOGPDPX(DGPRS, LOGL_INFO, pdp, "Context %p was deleted\n", pdp); return 0; } -- To view, visit https://gerrit.osmocom.org/9932 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I8a4627b54090e72f86a9c5a781670be52522062b Gerrit-Change-Number: 9932 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 9 19:12:59 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 9 Jul 2018 19:12:59 +0000 Subject: Change in osmo-sgsn[master]: Maintain per ggsn pdp ctx list Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9933 Change subject: Maintain per ggsn pdp ctx list ...................................................................... Maintain per ggsn pdp ctx list This way we can easily track all pdp context associated to a specific ggsn, which is useful to handle some scenarios. Change-Id: I3bbcc0883df2bf1290ba8d4bd70db8baa494087a --- M include/osmocom/sgsn/gprs_sgsn.h M src/gprs/gprs_sgsn.c M src/gprs/sgsn_libgtp.c 3 files changed, 18 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/33/9933/1 diff --git a/include/osmocom/sgsn/gprs_sgsn.h b/include/osmocom/sgsn/gprs_sgsn.h index 64e5619..33b12dc 100644 --- a/include/osmocom/sgsn/gprs_sgsn.h +++ b/include/osmocom/sgsn/gprs_sgsn.h @@ -296,6 +296,7 @@ struct sgsn_mm_ctx *mm; /* back pointer to MM CTX */ int destroy_ggsn; /* destroy it on destruction */ struct sgsn_ggsn_ctx *ggsn; /* which GGSN serves this PDP */ + struct llist_head ggsn_list; /* list_head for ggsn->pdp_list */ struct rate_ctr_group *ctrg; //unsigned int id; @@ -338,6 +339,7 @@ uint8_t tid); struct sgsn_pdp_ctx *sgsn_pdp_ctx_alloc(struct sgsn_mm_ctx *mm, + struct sgsn_ggsn_ctx *ggsn, uint8_t nsapi); void sgsn_pdp_ctx_terminate(struct sgsn_pdp_ctx *pdp); void sgsn_pdp_ctx_free(struct sgsn_pdp_ctx *pdp); @@ -350,12 +352,14 @@ struct in_addr remote_addr; int remote_restart_ctr; struct gsn_t *gsn; + struct llist_head pdp_list; /* list of associated pdp ctx (struct sgsn_pdp_ctx*) */ }; struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_alloc(uint32_t id); void sgsn_ggsn_ctx_free(struct sgsn_ggsn_ctx *ggc); struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_id(uint32_t id); struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_addr(struct in_addr *addr); struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_find_alloc(uint32_t id); +int sgsn_ggsn_ctx_drop_all_pdp(struct sgsn_ggsn_ctx *ggsn); struct apn_ctx { struct llist_head list; @@ -378,10 +382,6 @@ uint32_t sgsn_alloc_ptmsi(void); void sgsn_inst_init(void); -/* High-level function to be called in case a GGSN has disappeared or - * ottherwise lost state (recovery procedure) */ -int drop_all_pdp_for_ggsn(struct sgsn_ggsn_ctx *ggsn); - char *gprs_pdpaddr2str(uint8_t *pdpa, uint8_t len); /* diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c index 688eaed..a58e504 100644 --- a/src/gprs/gprs_sgsn.c +++ b/src/gprs/gprs_sgsn.c @@ -388,6 +388,7 @@ /* you don't want to use this directly, call sgsn_create_pdp_ctx() */ struct sgsn_pdp_ctx *sgsn_pdp_ctx_alloc(struct sgsn_mm_ctx *mm, + struct sgsn_ggsn_ctx *ggsn, uint8_t nsapi) { struct sgsn_pdp_ctx *pdp; @@ -401,6 +402,7 @@ return NULL; pdp->mm = mm; + pdp->ggsn = ggsn; pdp->nsapi = nsapi; pdp->ctrg = rate_ctr_group_alloc(pdp, &pdpctx_ctrg_desc, nsapi); if (!pdp->ctrg) { @@ -409,6 +411,7 @@ return NULL; } llist_add(&pdp->list, &mm->pdp_list); + llist_add(&pdp->ggsn_list, &ggsn->pdp_list); llist_add(&pdp->g_list, &sgsn_pdp_ctxts); return pdp; @@ -462,6 +465,8 @@ rate_ctr_group_free(pdp->ctrg); if (pdp->mm) llist_del(&pdp->list); + if (pdp->ggsn) + llist_del(&pdp->ggsn_list); llist_del(&pdp->g_list); /* _if_ we still have a library handle, at least set it to NULL @@ -496,6 +501,7 @@ ggc->remote_restart_ctr = -1; /* if we are called from config file parse, this gsn doesn't exist yet */ ggc->gsn = sgsn->gsn; + INIT_LLIST_HEAD(&ggc->pdp_list); llist_add(&ggc->list, &sgsn_ggsn_ctxts); return ggc; @@ -503,6 +509,7 @@ void sgsn_ggsn_ctx_free(struct sgsn_ggsn_ctx *ggc) { + OSMO_ASSERT(llist_empty(&ggc->pdp_list)); llist_del(&ggc->list); talloc_free(ggc); } @@ -702,19 +709,14 @@ /* High-level function to be called in case a GGSN has disappeared or * otherwise lost state (recovery procedure) */ -int drop_all_pdp_for_ggsn(struct sgsn_ggsn_ctx *ggsn) +int sgsn_ggsn_ctx_drop_all_pdp(struct sgsn_ggsn_ctx *ggsn) { - struct sgsn_mm_ctx *mm; int num = 0; - llist_for_each_entry(mm, &sgsn_mm_ctxts, list) { - struct sgsn_pdp_ctx *pdp; - llist_for_each_entry(pdp, &mm->pdp_list, list) { - if (pdp->ggsn == ggsn) { - drop_one_pdp(pdp); - num++; - } - } + struct sgsn_pdp_ctx *pdp, *pdp2; + llist_for_each_entry_safe(pdp, pdp2, &ggsn->pdp_list, ggsn_list) { + drop_one_pdp(pdp); + num++; } return num; diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 70112cb..2da8c4a 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -145,7 +145,7 @@ const uint8_t *qos; int rc; - pctx = sgsn_pdp_ctx_alloc(mmctx, nsapi); + pctx = sgsn_pdp_ctx_alloc(mmctx, ggsn, nsapi); if (!pctx) { LOGP(DGPRS, LOGL_ERROR, "Couldn't allocate PDP Ctx\n"); return NULL; @@ -160,7 +160,6 @@ } pdp->priv = pctx; pctx->lib = pdp; - pctx->ggsn = ggsn; //pdp->peer = /* sockaddr_in of GGSN (receive) */ //pdp->ipif = /* not used by library */ @@ -603,7 +602,7 @@ "releasing all PDP contexts\n", ggsn->remote_restart_ctr, recovery); ggsn->remote_restart_ctr = recovery; - drop_all_pdp_for_ggsn(ggsn); + sgsn_ggsn_ctx_drop_all_pdp(ggsn); } return 0; } -- To view, visit https://gerrit.osmocom.org/9933 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I3bbcc0883df2bf1290ba8d4bd70db8baa494087a Gerrit-Change-Number: 9933 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 9 19:12:59 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 9 Jul 2018 19:12:59 +0000 Subject: Change in osmo-sgsn[master]: osmo-sgsn: ping GGSN periodically and check for restart counter Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9934 Change subject: osmo-sgsn: ping GGSN periodically and check for restart counter ...................................................................... osmo-sgsn: ping GGSN periodically and check for restart counter Before this commit, echo req/rsp logic was implemented in libgtp but never used in osmo-sgsn. This commit adds a timer which periodically sends a GTP ECHO Request to every GGSN if there's at least one pdpd context associated with it. This way by checking the restart counter in the ECHO Reply it can be known if the GGSN was restarted. In this case, logic already present in osmo-sgsn will terminate all pdp contexts associated with that GGSN. Change-Id: I9d714726785407859f26bbef052cd0efc28e8dae --- M include/osmocom/sgsn/gprs_sgsn.h M include/osmocom/sgsn/sgsn.h M src/gprs/gprs_sgsn.c M src/gprs/sgsn_libgtp.c M src/gprs/sgsn_vty.c 5 files changed, 52 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/34/9934/1 diff --git a/include/osmocom/sgsn/gprs_sgsn.h b/include/osmocom/sgsn/gprs_sgsn.h index 33b12dc..f4de826 100644 --- a/include/osmocom/sgsn/gprs_sgsn.h +++ b/include/osmocom/sgsn/gprs_sgsn.h @@ -353,6 +353,8 @@ int remote_restart_ctr; struct gsn_t *gsn; struct llist_head pdp_list; /* list of associated pdp ctx (struct sgsn_pdp_ctx*) */ + struct osmo_timer_list echo_timer; + int32_t echo_interval; }; struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_alloc(uint32_t id); void sgsn_ggsn_ctx_free(struct sgsn_ggsn_ctx *ggc); @@ -360,6 +362,8 @@ struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_addr(struct in_addr *addr); struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_find_alloc(uint32_t id); int sgsn_ggsn_ctx_drop_all_pdp(struct sgsn_ggsn_ctx *ggsn); +void sgsn_ggsn_ctx_add_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx *pdp); +void sgsn_ggsn_ctx_remove_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx *pdp); struct apn_ctx { struct llist_head list; diff --git a/include/osmocom/sgsn/sgsn.h b/include/osmocom/sgsn/sgsn.h index 829a8fc..dae9d12 100644 --- a/include/osmocom/sgsn/sgsn.h +++ b/include/osmocom/sgsn/sgsn.h @@ -171,6 +171,7 @@ struct tlv_parsed *tp); int sgsn_delete_pdp_ctx(struct sgsn_pdp_ctx *pctx); void sgsn_pdp_upd_gtp_u(struct sgsn_pdp_ctx *pdp, void *addr, size_t alen); +void sgsn_ggsn_echo_req(struct sgsn_ggsn_ctx *ggc); /* gprs_sndcp.c */ diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c index a58e504..26d992a 100644 --- a/src/gprs/gprs_sgsn.c +++ b/src/gprs/gprs_sgsn.c @@ -411,7 +411,7 @@ return NULL; } llist_add(&pdp->list, &mm->pdp_list); - llist_add(&pdp->ggsn_list, &ggsn->pdp_list); + sgsn_ggsn_ctx_add_pdp(pdp->ggsn, pdp); llist_add(&pdp->g_list, &sgsn_pdp_ctxts); return pdp; @@ -466,7 +466,7 @@ if (pdp->mm) llist_del(&pdp->list); if (pdp->ggsn) - llist_del(&pdp->ggsn_list); + sgsn_ggsn_ctx_remove_pdp(pdp->ggsn, pdp); llist_del(&pdp->g_list); /* _if_ we still have a library handle, at least set it to NULL @@ -487,6 +487,12 @@ } /* GGSN contexts */ +static void echo_timer_cb(void *data) +{ + struct sgsn_ggsn_ctx *ggc = (struct sgsn_ggsn_ctx *) data; + sgsn_ggsn_echo_req(ggc); + osmo_timer_schedule(&ggc->echo_timer, ggc->echo_interval, 0); +} struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_alloc(uint32_t id) { @@ -499,9 +505,11 @@ ggc->id = id; ggc->gtp_version = 1; ggc->remote_restart_ctr = -1; + ggc->echo_interval = -1; /* if we are called from config file parse, this gsn doesn't exist yet */ ggc->gsn = sgsn->gsn; INIT_LLIST_HEAD(&ggc->pdp_list); + osmo_timer_setup(&ggc->echo_timer, echo_timer_cb, ggc); llist_add(&ggc->list, &sgsn_ggsn_ctxts); return ggc; @@ -722,6 +730,19 @@ return num; } +void sgsn_ggsn_ctx_add_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx *pdp) +{ + if (llist_empty(&ggc->pdp_list) && ggc->echo_interval > 0) + osmo_timer_schedule(&ggc->echo_timer, ggc->echo_interval, 0); + llist_add(&pdp->ggsn_list, &ggc->pdp_list); +} +void sgsn_ggsn_ctx_remove_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx *pdp) +{ + llist_del(&pdp->ggsn_list); + if (llist_empty(&ggc->pdp_list) && osmo_timer_pending(&ggc->echo_timer)) + osmo_timer_del(&ggc->echo_timer); +} + void sgsn_update_subscriber_data(struct sgsn_mm_ctx *mmctx) { OSMO_ASSERT(mmctx != NULL); diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 2da8c4a..88cea5d 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -460,6 +460,11 @@ gtp_update_context(pdp->ggsn->gsn, pdp->lib, pdp, &pdp->lib->hisaddr0); } +void sgsn_ggsn_echo_req(struct sgsn_ggsn_ctx *ggc) +{ + gtp_echo_req(ggc->gsn, ggc->gtp_version, NULL, &ggc->remote_addr); +} + #ifdef BUILD_IU /* Callback for RAB assignment response */ int sgsn_ranap_rab_ass_resp(struct sgsn_mm_ctx *ctx, RANAP_RAB_SetupOrModifiedItemIEs_t *setup_ies) diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c index 07d4293..f9b26b8 100644 --- a/src/gprs/sgsn_vty.c +++ b/src/gprs/sgsn_vty.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -181,6 +182,9 @@ inet_ntoa(gctx->remote_addr), VTY_NEWLINE); vty_out(vty, " ggsn %u gtp-version %u%s", gctx->id, gctx->gtp_version, VTY_NEWLINE); + if (gctx->echo_interval != -1) + vty_out(vty, " ggsn %u echo-interval %"PRId32"%s", + gctx->id, gctx->echo_interval, VTY_NEWLINE); } if (sgsn->cfg.dynamic_lookup) @@ -356,6 +360,20 @@ return CMD_SUCCESS; } +DEFUN(cfg_ggsn_echo_interval, cfg_ggsn_echo_interval_cmd, + "ggsn <0-255> echo-interval <60-36000>", + GGSN_STR "GGSN Number\n" + "Send an echo request to this static GGSN every interval.\n" + "Interval between echo requests in seconds.\n") +{ + uint32_t id = atoi(argv[0]); + struct sgsn_ggsn_ctx *ggc = sgsn_ggsn_ctx_find_alloc(id); + + ggc->echo_interval = atoi(argv[1]); + + return CMD_SUCCESS; +} + DEFUN(cfg_ggsn_dynamic_lookup, cfg_ggsn_dynamic_lookup_cmd, "ggsn dynamic", GGSN_STR @@ -1277,6 +1295,7 @@ install_element(SGSN_NODE, &cfg_ggsn_remote_ip_cmd); //install_element(SGSN_NODE, &cfg_ggsn_remote_port_cmd); install_element(SGSN_NODE, &cfg_ggsn_gtp_version_cmd); + install_element(SGSN_NODE, &cfg_ggsn_echo_interval_cmd); install_element(SGSN_NODE, &cfg_imsi_acl_cmd); install_element(SGSN_NODE, &cfg_auth_policy_cmd); install_element(SGSN_NODE, &cfg_encrypt_cmd); -- To view, visit https://gerrit.osmocom.org/9934 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I9d714726785407859f26bbef052cd0efc28e8dae Gerrit-Change-Number: 9934 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 9 19:13:00 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 9 Jul 2018 19:13:00 +0000 Subject: Change in osmo-sgsn[master]: Disarm T3395 when dettaching mmctx from pdpctx Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9935 Change subject: Disarm T3395 when dettaching mmctx from pdpctx ...................................................................... Disarm T3395 when dettaching mmctx from pdpctx In sgsn_pdp_ctx_terminate, a pdp ctx is terminated and the mm ctx is detached. However, T3395 may still be armed and then pdpctx_timer_cb will trigger, and attempt to use the pdp->mm ctx which was already detached (set to NULL) when calling gsm48_tx_gsm_deact_pdp_req()->mmctx2msgid(). Following list of log lines shows the scenario+crash, in which osmo-sgsn is trying to deactivate the ctx all the time but the PCU doesn't ACK it, and then at some point the PDP context is forced released. osmo-sgsn/src/gprs/gprs_gmm.c:2294 MM(901700000015254/d7e9ab95) <- DEACTIVATE PDP CONTEXT REQ osmo-sgsn/src/gprs/gprs_gmm.c:1464 MM(901700000015254/d7e9ab95) -> GMM DETACH REQUEST TLLI=0xd7e9ab95 type=GPRS detach Power-off osmo-sgsn/src/gprs/gprs_gmm.c:313 MM(901700000015254/d7e9ab95) Cleaning MM context due to GPRS DETACH REQUEST osmo-sgsn/src/gprs/gprs_sgsn.c:332 MM(901700000015254/d7e9ab95) Dropping PDP context for NSAPI=5 osmo-sgsn/src/gprs/gprs_sgsn.c:434 PDP(901700000015254/0) Forcing release of PDP context osmo-sgsn/src/gprs/gprs_sndcp.c:508 SNSM-DEACTIVATE.ind (lle=0x62100001bca0, TLLI=d7e9ab95, SAPI=3, NSAPI=5) osmo-sgsn/src/gprs/sgsn_libgtp.c:310 PDP(---/0) Delete PDP Context osmo-sgsn/src/gprs/gprs_gmm.c:2294 MM(---/ffffffff) <- DEACTIVATE PDP CONTEXT REQ osmo-sgsn/src/gprs/gprs_gmm.c:305:25: runtime error: member access within null pointer of type 'const struct sgsn_mm_ctx' Program received signal SIGSEGV, Segmentation fault. 0x0000555555698c1b in mmctx2msgid (msg=0x61d0000172e0, mm=0x0) at /home/pespin/dev/sysmocom/git/osmo-sgsn/src/gprs/gprs_gmm.c:305 305 msgb_tlli(msg) = mm->gb.tlli; (gdb) bt #0 0x0000555555698c1b in mmctx2msgid (msg=0x61d0000172e0, mm=0x0) at osmo-sgsn/src/gprs/gprs_gmm.c:305 #1 0x00005555556b170a in _gsm48_tx_gsm_deact_pdp_req (mm=0x0, tid=0 '\000', sm_cause=38 '&') at osmo-sgsn/src/gprs/gprs_gmm.c:2297 #2 0x00005555556b1a2e in gsm48_tx_gsm_deact_pdp_req (pdp=0x6140000008a0, sm_cause=38 '&') at osmo-sgsn/src/gprs/gprs_gmm.c:2311 #3 0x00005555556b876c in pdpctx_timer_cb (_pdp=0x6140000008a0) at osmo-sgsn/src/gprs/gprs_gmm.c:2717 #4 0x00007ffff355eb3e in osmo_timers_update () at libosmocore/src/timer.c:257 #5 0x00007ffff356255c in osmo_select_main (polling=0) at libosmocore/src/select.c:254 #6 0x00005555556f17cb in main (argc=3, argv=0x7fffffffe298) at osmo-sgsn/src/gprs/sgsn_main.c:531 Change-Id: I2120e53ade6cabad37f9bd99e6680a453411821b --- M include/osmocom/sgsn/gprs_gmm.h M src/gprs/gprs_gmm.c M src/gprs/gprs_sgsn.c 3 files changed, 13 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/35/9935/1 diff --git a/include/osmocom/sgsn/gprs_gmm.h b/include/osmocom/sgsn/gprs_gmm.h index 3c93efc..28c96ce 100644 --- a/include/osmocom/sgsn/gprs_gmm.h +++ b/include/osmocom/sgsn/gprs_gmm.h @@ -43,4 +43,6 @@ /* TODO: move extract_subscr_* when gsm48_gmm_authorize() got removed */ void extract_subscr_msisdn(struct sgsn_mm_ctx *ctx); void extract_subscr_hlr(struct sgsn_mm_ctx *ctx); + +void pdp_ctx_detach_mm_ctx(struct sgsn_pdp_ctx *pdp); #endif /* _GPRS_GMM_H */ diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index 6a5c5d9..9d8a869 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -2192,6 +2192,16 @@ osmo_timer_del(&pdp->timer); } +void pdp_ctx_detach_mm_ctx(struct sgsn_pdp_ctx *pdp) +{ + /* Detach from MM context */ + llist_del(&pdp->list); + pdp->mm = NULL; + + /* stop timer 3395 */ + pdpctx_timer_stop(pdp, 3395); +} + #if 0 static void msgb_put_pdp_addr_ipv4(struct msgb *msg, uint32_t ipaddr) { diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c index 26d992a..d8ac095 100644 --- a/src/gprs/gprs_sgsn.c +++ b/src/gprs/gprs_sgsn.c @@ -443,9 +443,7 @@ osmo_signal_dispatch(SS_SGSN, S_SGSN_PDP_TERMINATE, &sig_data); /* Detach from MM context */ - llist_del(&pdp->list); - pdp->mm = NULL; - + pdp_ctx_detach_mm_ctx(pdp); sgsn_delete_pdp_ctx(pdp); } -- To view, visit https://gerrit.osmocom.org/9935 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I2120e53ade6cabad37f9bd99e6680a453411821b Gerrit-Change-Number: 9935 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 9 19:13:00 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 9 Jul 2018 19:13:00 +0000 Subject: Change in osmo-sgsn[master]: examples: Enable by default echo req towards active GGSNs Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9936 Change subject: examples: Enable by default echo req towards active GGSNs ...................................................................... examples: Enable by default echo req towards active GGSNs 60 seconds is used by default, which is the minimum accepted value for this timer as per 3GPP TS 29.060 section "7.2.1 Echo Request". Having it low by default is good for lab use in which a lot of stuff changes over time. Change-Id: Ia1898d172482bf6a25d829f8fc9a47824f49456f --- M doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg M doc/examples/osmo-sgsn/osmo-sgsn.cfg 2 files changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/36/9936/1 diff --git a/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg b/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg index 5e64342..b47878a 100644 --- a/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg +++ b/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg @@ -9,6 +9,7 @@ gtp local-ip 127.0.0.1 ggsn 0 remote-ip 127.0.0.2 ggsn 0 gtp-version 1 + ggsn 0 echo-interval 60 auth-policy accept-all ! ns diff --git a/doc/examples/osmo-sgsn/osmo-sgsn.cfg b/doc/examples/osmo-sgsn/osmo-sgsn.cfg index 06f035f..263bd00 100644 --- a/doc/examples/osmo-sgsn/osmo-sgsn.cfg +++ b/doc/examples/osmo-sgsn/osmo-sgsn.cfg @@ -9,6 +9,7 @@ gtp local-ip 127.0.0.1 ggsn 0 remote-ip 127.0.0.2 ggsn 0 gtp-version 1 + ggsn 0 echo-interval 60 auth-policy remote gsup remote-ip 127.0.0.1 gsup remote-port 4222 -- To view, visit https://gerrit.osmocom.org/9936 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ia1898d172482bf6a25d829f8fc9a47824f49456f Gerrit-Change-Number: 9936 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 9 19:21:16 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 9 Jul 2018 19:21:16 +0000 Subject: Change in osmo-sgsn[master]: Maintain per ggsn pdp ctx list In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9933 ) Change subject: Maintain per ggsn pdp ctx list ...................................................................... Patch Set 1: I'll work on adding some TTCN3 tests and/or unit tests starting from tomorrow. So far I tested by playing start/stopping osmo-ggsn and connecting/disconnecting the phone. -- To view, visit https://gerrit.osmocom.org/9933 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3bbcc0883df2bf1290ba8d4bd70db8baa494087a Gerrit-Change-Number: 9933 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Mon, 09 Jul 2018 19:21:16 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 9 22:02:28 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 9 Jul 2018 22:02:28 +0000 Subject: Change in libosmocore[master]: vty/command.c: talloc from tall_vty_cmd_ctx, not NULL Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/9937 Change subject: vty/command.c: talloc from tall_vty_cmd_ctx, not NULL ...................................................................... vty/command.c: talloc from tall_vty_cmd_ctx, not NULL Change-Id: Iaa409b4f63557c8fb028bbb322b5e7253393c05c --- M src/vty/command.c 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/37/9937/1 diff --git a/src/vty/command.c b/src/vty/command.c index 66cf6a8..689609c 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -514,7 +514,7 @@ } } - out = talloc_size(NULL, len + 1); + out = talloc_size(tall_vty_cmd_ctx, len + 1); if (!out) return NULL; @@ -574,7 +574,7 @@ } } - out = talloc_size(NULL, len + 1); + out = talloc_size(tall_vty_cmd_ctx, len + 1); if (!out) return NULL; @@ -1317,7 +1317,7 @@ return NULL; /* tmp will hold a string of len-2 chars, so 'len' size is fine */ - tmp = talloc_size(NULL, len); + tmp = talloc_size(tall_vty_cmd_ctx, len); memcpy(tmp, (str + 1), len - 2); tmp[len - 2] = '\0'; -- To view, visit https://gerrit.osmocom.org/9937 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iaa409b4f63557c8fb028bbb322b5e7253393c05c Gerrit-Change-Number: 9937 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 9 22:02:29 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 9 Jul 2018 22:02:29 +0000 Subject: Change in libosmocore[master]: vty: cosmetic: cmd_deopt(): use talloc_strndup(), not memcpy() Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/9938 Change subject: vty: cosmetic: cmd_deopt(): use talloc_strndup(), not memcpy() ...................................................................... vty: cosmetic: cmd_deopt(): use talloc_strndup(), not memcpy() Change-Id: Ibf870ae02be706f802482f7cff6589a70cde8320 --- M src/vty/command.c 1 file changed, 1 insertion(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/38/9938/1 diff --git a/src/vty/command.c b/src/vty/command.c index 689609c..51dece3 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -1311,18 +1311,11 @@ * match check for "blah" */ size_t len = strlen(str); - char *tmp; if (len < 3) return NULL; - /* tmp will hold a string of len-2 chars, so 'len' size is fine */ - tmp = talloc_size(tall_vty_cmd_ctx, len); - - memcpy(tmp, (str + 1), len - 2); - tmp[len - 2] = '\0'; - - return tmp; + return talloc_strndup(tall_vty_cmd_ctx, str + 1, len - 2); } static enum match_type -- To view, visit https://gerrit.osmocom.org/9938 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ibf870ae02be706f802482f7cff6589a70cde8320 Gerrit-Change-Number: 9938 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 9 22:02:29 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 9 Jul 2018 22:02:29 +0000 Subject: Change in libosmocore[master]: vty: fix use-after-free and memleaks in is_cmd_ambiguous() Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/9939 Change subject: vty: fix use-after-free and memleaks in is_cmd_ambiguous() ...................................................................... vty: fix use-after-free and memleaks in is_cmd_ambiguous() vty_test: add test against ambiguous cmd causing use-after-free and memory leaks. Add this test along with the fix, because the new test triggers the memory use-after-free and leaks, causing build failures. Add cmd_deopt_with_ctx() to allow passing a specific talloc ctx. is_cmd_ambiguous(): keep all cmd_deopt() allocations until the function exits. Add a comment explaining why. Before this, if a command matched an optional "[arg]" with square brackets, we would keep it in local var 'matched', but we would free the string it points to at the end of that loop iteration; upon encountering another match, we would attempt to strcmp against the freed 'matched'. Instead of adding hard-to-read and -verify free/alloc dances to keep the 'matched' accurately freed/non-freed/..., just keep all cmd_deopt() string allocated until done. Needless to say that this should have been implemented on a lower level upon inventing optional args, but at least this is fixing a program crash. Related: OS#33903390 Change-Id: Ia71ba742108b5ff020997bfb612ad5eb30d04fcd --- M src/vty/command.c M tests/vty/vty_test.c M tests/vty/vty_test.ok 3 files changed, 129 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/39/9939/1 diff --git a/src/vty/command.c b/src/vty/command.c index 51dece3..caa5ea1 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -1305,7 +1305,7 @@ /* helper to retrieve the 'real' argument string from an optional argument */ static char * -cmd_deopt(const char *str) +cmd_deopt_with_ctx(void *ctx, const char *str) { /* we've got "[blah]". We want to strip off the []s and redo the * match check for "blah" @@ -1315,7 +1315,13 @@ if (len < 3) return NULL; - return talloc_strndup(tall_vty_cmd_ctx, str + 1, len - 2); + return talloc_strndup(ctx, str + 1, len - 2); +} + +static char * +cmd_deopt(const char *str) +{ + return cmd_deopt_with_ctx(tall_vty_cmd_ctx, str); } static enum match_type @@ -1475,6 +1481,7 @@ static int is_cmd_ambiguous(char *command, vector v, int index, enum match_type type) { + int ret = 0; unsigned int i; unsigned int j; struct cmd_element *cmd_element; @@ -1482,6 +1489,16 @@ vector descvec; struct desc *desc; + /* In this loop, when a match is found, 'matched' points to it. If on a later iteration, an + * identical match is found, the command is ambiguous. The trickiness is that a string may be + * enclosed in '[str]' square brackets, which get removed by a talloc_strndup(), via cmd_deopt(). + * Such a string is usually needed for one loop iteration, except when 'matched' points to it. In + * that case, the string must remain allocated until this function exits or another match comes + * around. This is sufficiently confusing to justify a separate talloc tree to store all of the + * odd allocations, and to free them all at the end. We are not expecting too many optional args + * or ambiguities to cause a noticeable memory footprint from keeping all allocations. */ + void *cmd_deopt_ctx = NULL; + for (i = 0; i < vector_active(v); i++) if ((cmd_element = vector_slot(v, i)) != NULL) { int match = 0; @@ -1493,9 +1510,15 @@ enum match_type ret; const char *str = desc->cmd; - if (CMD_OPTION(str)) - if ((str = cmd_deopt(str)) == NULL) + if (CMD_OPTION(str)) { + if (!cmd_deopt_ctx) + cmd_deopt_ctx = + talloc_named_const(tall_vty_cmd_ctx, 0, + __func__); + str = cmd_deopt_with_ctx(cmd_deopt_ctx, str); + if (str == NULL) continue; + } switch (type) { case exact_match: @@ -1509,9 +1532,10 @@ { if (matched && strcmp(matched, - str) != 0) - return 1; /* There is ambiguous match. */ - else + str) != 0) { + ret = 1; /* There is ambiguous match. */ + goto free_and_return; + } else matched = str; match++; } @@ -1521,9 +1545,10 @@ (str, command)) { if (matched && strcmp(matched, - str) != 0) - return 1; - else + str) != 0) { + ret = 1; + goto free_and_return; + } else matched = str; match++; } @@ -1537,8 +1562,10 @@ if ((ret = cmd_ipv6_prefix_match (command)) != no_match) { - if (ret == partly_match) - return 2; /* There is incomplete match. */ + if (ret == partly_match) { + ret = 2; /* There is incomplete match. */ + goto free_and_return; + } match++; } @@ -1552,8 +1579,10 @@ if ((ret = cmd_ipv4_prefix_match (command)) != no_match) { - if (ret == partly_match) - return 2; /* There is incomplete match. */ + if (ret == partly_match) { + ret = 2; /* There is incomplete match. */ + goto free_and_return; + } match++; } @@ -1566,14 +1595,15 @@ default: break; } - - if (CMD_OPTION(desc->cmd)) - talloc_free((void*)str); } if (!match) vector_slot(v, i) = NULL; } - return 0; + +free_and_return: + if (cmd_deopt_ctx) + talloc_free(cmd_deopt_ctx); + return ret; } /* If src matches dst return dst string, otherwise return NULL */ diff --git a/tests/vty/vty_test.c b/tests/vty/vty_test.c index a3478e1..30efb9a 100644 --- a/tests/vty/vty_test.c +++ b/tests/vty/vty_test.c @@ -385,6 +385,42 @@ return CMD_SUCCESS; } +DEFUN(cfg_ambiguous_nr_1, cfg_ambiguous_nr_1_cmd, + "ambiguous_nr [<0-23>]", + "testing is_cmd_ambiguous()\n" + "optional number arg\n") +{ + printf("Called: 'ambiguous_nr [<0-23>]' (argc=%d)\n", argc); + return CMD_SUCCESS; +} + +DEFUN(cfg_ambiguous_nr_2, cfg_ambiguous_nr_2_cmd, + "ambiguous_nr <0-23> keyword", + "testing is_cmd_ambiguous()\n" + "optional number arg\n") +{ + printf("Called: 'ambiguous_nr <0-23> keyword'\n"); + return CMD_SUCCESS; +} + +DEFUN(cfg_ambiguous_str_1, cfg_ambiguous_str_1_cmd, + "ambiguous_str [ARG]", + "testing is_cmd_ambiguous()\n" + "optional string arg\n") +{ + printf("Called: 'ambiguous_str [ARG]' (argc=%d)\n", argc); + return CMD_SUCCESS; +} + +DEFUN(cfg_ambiguous_str_2, cfg_ambiguous_str_2_cmd, + "ambiguous_str ARG keyword", + "testing is_cmd_ambiguous()\n" + "optional string arg\n") +{ + printf("Called: 'ambiguous_str ARG keyword'\n"); + return CMD_SUCCESS; +} + void test_vty_add_cmds() { install_element(CONFIG_NODE, &cfg_level1_cmd); @@ -398,6 +434,30 @@ install_node(&level3_node, NULL); install_element(LEVEL3_NODE, &cfg_level3_child_cmd); + + install_element_ve(&cfg_ambiguous_nr_1_cmd); + install_element_ve(&cfg_ambiguous_nr_2_cmd); + install_element_ve(&cfg_ambiguous_str_1_cmd); + install_element_ve(&cfg_ambiguous_str_2_cmd); +} + +void test_is_cmd_ambiguous() +{ + struct vty *vty; + struct vty_test test; + + printf("Going to test is_cmd_ambiguous()\n"); + vty = create_test_vty(&test); + + OSMO_ASSERT(do_vty_command(vty, "ambiguous_nr") == CMD_SUCCESS); + OSMO_ASSERT(do_vty_command(vty, "ambiguous_nr 23") == CMD_SUCCESS); + OSMO_ASSERT(do_vty_command(vty, "ambiguous_nr 23 keyword") == CMD_SUCCESS); + + OSMO_ASSERT(do_vty_command(vty, "ambiguous_str") == CMD_SUCCESS); + OSMO_ASSERT(do_vty_command(vty, "ambiguous_str arg") == CMD_SUCCESS); + OSMO_ASSERT(do_vty_command(vty, "ambiguous_str arg keyword") == CMD_SUCCESS); + + destroy_test_vty(&test, vty); } static int go_parent_cb(struct vty *vty) @@ -465,6 +525,8 @@ test_exit_by_indent("ok_indented_root.cfg", 0); test_exit_by_indent("ok_empty_parent.cfg", 0); + test_is_cmd_ambiguous(); + /* Leak check */ OSMO_ASSERT(talloc_total_blocks(stats_ctx) == 1); diff --git a/tests/vty/vty_test.ok b/tests/vty/vty_test.ok index bd6c5d6..2f76ff9 100644 --- a/tests/vty/vty_test.ok +++ b/tests/vty/vty_test.ok @@ -286,4 +286,23 @@ called level3 node k called level1 child cmd k got rc=0 +Going to test is_cmd_ambiguous() +Going to execute 'ambiguous_nr' +Called: 'ambiguous_nr [<0-23>]' (argc=0) +Returned: 0, Current node: 1 '%s> ' +Going to execute 'ambiguous_nr 23' +Called: 'ambiguous_nr [<0-23>]' (argc=1) +Returned: 0, Current node: 1 '%s> ' +Going to execute 'ambiguous_nr 23 keyword' +Called: 'ambiguous_nr <0-23> keyword' +Returned: 0, Current node: 1 '%s> ' +Going to execute 'ambiguous_str' +Called: 'ambiguous_str [ARG]' (argc=0) +Returned: 0, Current node: 1 '%s> ' +Going to execute 'ambiguous_str arg' +Called: 'ambiguous_str [ARG]' (argc=1) +Returned: 0, Current node: 1 '%s> ' +Going to execute 'ambiguous_str arg keyword' +Called: 'ambiguous_str ARG keyword' +Returned: 0, Current node: 1 '%s> ' All tests passed -- To view, visit https://gerrit.osmocom.org/9939 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ia71ba742108b5ff020997bfb612ad5eb30d04fcd Gerrit-Change-Number: 9939 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 9 23:41:56 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 9 Jul 2018 23:41:56 +0000 Subject: Change in osmo-bsc[master]: inter-BSC HO: add neighbor_ident API to manage neighbor-BSS-cells In-Reply-To: References: Message-ID: Hello Pau Espin Pedrol, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9666 to look at the new patch set (#8). Change subject: inter-BSC HO: add neighbor_ident API to manage neighbor-BSS-cells ...................................................................... inter-BSC HO: add neighbor_ident API to manage neighbor-BSS-cells Change-Id: I0153d7069817fba9146ddc11214de2757d7d37bf --- M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/handover.h A include/osmocom/bsc/neighbor_ident.h M src/osmo-bsc/Makefile.am M src/osmo-bsc/bsc_init.c M src/osmo-bsc/bsc_vty.c M src/osmo-bsc/gsm_data.c M src/osmo-bsc/handover_logic.c A src/osmo-bsc/neighbor_ident.c A src/osmo-bsc/neighbor_ident_vty.c M src/osmo-bsc/net_init.c M src/osmo-bsc/system_information.c M tests/bsc/Makefile.am M tests/gsm0408/Makefile.am M tests/handover/Makefile.am A tests/handover/neighbor_ident_test.c A tests/handover/neighbor_ident_test.err A tests/handover/neighbor_ident_test.ok A tests/neighbor_ident.vty M tests/testsuite.at 21 files changed, 1,968 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/66/9666/8 -- To view, visit https://gerrit.osmocom.org/9666 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0153d7069817fba9146ddc11214de2757d7d37bf Gerrit-Change-Number: 9666 Gerrit-PatchSet: 8 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 9 23:41:56 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 9 Jul 2018 23:41:56 +0000 Subject: Change in osmo-bsc[master]: move RSL and RR related functions to abis_rsl.[hc] In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9669 to look at the new patch set (#8). Change subject: move RSL and RR related functions to abis_rsl.[hc] ...................................................................... move RSL and RR related functions to abis_rsl.[hc] It doesn't make sense to spread them all over the place, and introduces odd dependencies from utility programs or regression test linkages. This is a cosmetic patch preparing for lchan activation refactoring. Change-Id: Ie8ee334145bf7bc3a601d395ea7ab9b2009b61c7 --- M include/osmocom/bsc/abis_rsl.h M include/osmocom/bsc/bsc_api.h M include/osmocom/bsc/gsm_04_08_utils.h M src/osmo-bsc/abis_rsl.c M src/osmo-bsc/bsc_api.c M src/osmo-bsc/gsm_04_08_utils.c 6 files changed, 594 insertions(+), 593 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/69/9669/8 -- To view, visit https://gerrit.osmocom.org/9669 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie8ee334145bf7bc3a601d395ea7ab9b2009b61c7 Gerrit-Change-Number: 9669 Gerrit-PatchSet: 8 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 9 23:41:56 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 9 Jul 2018 23:41:56 +0000 Subject: Change in osmo-bsc[master]: add gsm_timers, for Tnnn definitions usable by FSMs In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9670 to look at the new patch set (#8). Change subject: add gsm_timers, for Tnnn definitions usable by FSMs ...................................................................... add gsm_timers, for Tnnn definitions usable by FSMs Change-Id: If212fcd042051b6fa53484254223614c5b93a9c6 --- M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/gsm_data.h A include/osmocom/bsc/gsm_timers.h M src/ipaccess/Makefile.am M src/osmo-bsc/Makefile.am M src/osmo-bsc/abis_om2000.c M src/osmo-bsc/abis_rsl.c M src/osmo-bsc/bsc_subscr_conn_fsm.c M src/osmo-bsc/bsc_vty.c M src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c M src/osmo-bsc/bts_siemens_bs11.c M src/osmo-bsc/gsm_data.c A src/osmo-bsc/gsm_timers.c A src/osmo-bsc/gsm_timers_vty.c M src/osmo-bsc/net_init.c M src/osmo-bsc/paging.c M src/utils/Makefile.am M tests/abis/Makefile.am M tests/bsc/Makefile.am M tests/gsm0408/Makefile.am M tests/handover/Makefile.am M tests/nanobts_omlattr/Makefile.am M tests/nanobts_omlattr/nanobts_omlattr_test.c 23 files changed, 513 insertions(+), 180 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/70/9670/8 -- To view, visit https://gerrit.osmocom.org/9670 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If212fcd042051b6fa53484254223614c5b93a9c6 Gerrit-Change-Number: 9670 Gerrit-PatchSet: 8 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 9 23:43:13 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 9 Jul 2018 23:43:13 +0000 Subject: Change in osmo-bsc[master]: inter-BSC HO: add neighbor_ident API to manage neighbor-BSS-cells In-Reply-To: References: Message-ID: Hello Pau Espin Pedrol, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9666 to look at the new patch set (#9). Change subject: inter-BSC HO: add neighbor_ident API to manage neighbor-BSS-cells ...................................................................... inter-BSC HO: add neighbor_ident API to manage neighbor-BSS-cells Depends: Ia71ba742108b5ff020997bfb612ad5eb30d04fcd (libosmocore) Change-Id: I0153d7069817fba9146ddc11214de2757d7d37bf --- M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/handover.h A include/osmocom/bsc/neighbor_ident.h M src/osmo-bsc/Makefile.am M src/osmo-bsc/bsc_init.c M src/osmo-bsc/bsc_vty.c M src/osmo-bsc/gsm_data.c M src/osmo-bsc/handover_logic.c A src/osmo-bsc/neighbor_ident.c A src/osmo-bsc/neighbor_ident_vty.c M src/osmo-bsc/net_init.c M src/osmo-bsc/system_information.c M tests/bsc/Makefile.am M tests/gsm0408/Makefile.am M tests/handover/Makefile.am A tests/handover/neighbor_ident_test.c A tests/handover/neighbor_ident_test.err A tests/handover/neighbor_ident_test.ok A tests/neighbor_ident.vty M tests/testsuite.at 21 files changed, 1,968 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/66/9666/9 -- To view, visit https://gerrit.osmocom.org/9666 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0153d7069817fba9146ddc11214de2757d7d37bf Gerrit-Change-Number: 9666 Gerrit-PatchSet: 9 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 9 23:44:18 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 9 Jul 2018 23:44:18 +0000 Subject: Change in osmo-bsc[master]: doc: update/fix FSM charts In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9667 to look at the new patch set (#9). Change subject: doc: update/fix FSM charts ...................................................................... doc: update/fix FSM charts Change-Id: I29e31b753e23a4207662e0e385a337e7df836f45 --- M doc/Makefile.am A doc/assignment-fsm.dot M doc/assignment.msc A doc/handover-inter-bsc-mo-fsm.dot A doc/handover-inter-bsc-mt-fsm.dot M doc/handover-inter-bsc-mt.msc A doc/handover-intra-bsc-fsm.dot M doc/handover.msc M doc/lchan-fsm.dot M doc/lchan-release.msc M doc/lchan.msc A doc/mgw-endpoint-fsm.dot M doc/ms-channel-request.msc M doc/ts-and-lchan-fsm-lifecycle.msc 14 files changed, 194 insertions(+), 35 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/67/9667/9 -- To view, visit https://gerrit.osmocom.org/9667 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I29e31b753e23a4207662e0e385a337e7df836f45 Gerrit-Change-Number: 9667 Gerrit-PatchSet: 9 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 9 23:44:18 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 9 Jul 2018 23:44:18 +0000 Subject: Change in osmo-bsc[master]: move RSL and RR related functions to abis_rsl.[hc] In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9669 to look at the new patch set (#9). Change subject: move RSL and RR related functions to abis_rsl.[hc] ...................................................................... move RSL and RR related functions to abis_rsl.[hc] It doesn't make sense to spread them all over the place, and introduces odd dependencies from utility programs or regression test linkages. This is a cosmetic patch preparing for lchan activation refactoring. Change-Id: Ie8ee334145bf7bc3a601d395ea7ab9b2009b61c7 --- M include/osmocom/bsc/abis_rsl.h M include/osmocom/bsc/bsc_api.h M include/osmocom/bsc/gsm_04_08_utils.h M src/osmo-bsc/abis_rsl.c M src/osmo-bsc/bsc_api.c M src/osmo-bsc/gsm_04_08_utils.c 6 files changed, 594 insertions(+), 593 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/69/9669/9 -- To view, visit https://gerrit.osmocom.org/9669 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie8ee334145bf7bc3a601d395ea7ab9b2009b61c7 Gerrit-Change-Number: 9669 Gerrit-PatchSet: 9 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 9 23:44:18 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 9 Jul 2018 23:44:18 +0000 Subject: Change in osmo-bsc[master]: add gsm_timers, for Tnnn definitions usable by FSMs In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9670 to look at the new patch set (#9). Change subject: add gsm_timers, for Tnnn definitions usable by FSMs ...................................................................... add gsm_timers, for Tnnn definitions usable by FSMs Change-Id: If212fcd042051b6fa53484254223614c5b93a9c6 --- M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/gsm_data.h A include/osmocom/bsc/gsm_timers.h M src/ipaccess/Makefile.am M src/osmo-bsc/Makefile.am M src/osmo-bsc/abis_om2000.c M src/osmo-bsc/abis_rsl.c M src/osmo-bsc/bsc_subscr_conn_fsm.c M src/osmo-bsc/bsc_vty.c M src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c M src/osmo-bsc/bts_siemens_bs11.c M src/osmo-bsc/gsm_data.c A src/osmo-bsc/gsm_timers.c A src/osmo-bsc/gsm_timers_vty.c M src/osmo-bsc/net_init.c M src/osmo-bsc/paging.c M src/utils/Makefile.am M tests/abis/Makefile.am M tests/bsc/Makefile.am M tests/gsm0408/Makefile.am M tests/handover/Makefile.am M tests/nanobts_omlattr/Makefile.am M tests/nanobts_omlattr/nanobts_omlattr_test.c 23 files changed, 513 insertions(+), 180 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/70/9670/9 -- To view, visit https://gerrit.osmocom.org/9670 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If212fcd042051b6fa53484254223614c5b93a9c6 Gerrit-Change-Number: 9670 Gerrit-PatchSet: 9 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 9 23:48:00 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 9 Jul 2018 23:48:00 +0000 Subject: Change in osmo-bsc[master]: add gsm_timers, for Tnnn definitions usable by FSMs In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9670 ) Change subject: add gsm_timers, for Tnnn definitions usable by FSMs ...................................................................... Patch Set 9: new patch set: fix minor comment errata and a string whitespace. -- To view, visit https://gerrit.osmocom.org/9670 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If212fcd042051b6fa53484254223614c5b93a9c6 Gerrit-Change-Number: 9670 Gerrit-PatchSet: 9 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Mon, 09 Jul 2018 23:48:00 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 9 23:57:17 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 9 Jul 2018 23:57:17 +0000 Subject: Change in osmo-bsc[master]: fix / clarify rsl dtap cache In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9668 ) Change subject: fix / clarify rsl dtap cache ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/9668 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6ffd7aa641c8905292c769400048c96aa0949585 Gerrit-Change-Number: 9668 Gerrit-PatchSet: 9 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Mon, 09 Jul 2018 23:57:17 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 9 23:58:16 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 9 Jul 2018 23:58:16 +0000 Subject: Change in docker-playground[master]: bsc master, ttcn3: mount external bsc sources for ttcn3 hacking In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. ( https://gerrit.osmocom.org/7388 ) Change subject: bsc master,ttcn3: mount external bsc sources for ttcn3 hacking ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/7388 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: I27bc5c0898d368db152e56baa124ba4941a10a4d Gerrit-Change-Number: 7388 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 10 09:16:45 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 10 Jul 2018 09:16:45 +0000 Subject: Change in libosmocore[master]: vty/command.c: talloc from tall_vty_cmd_ctx, not NULL In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/9937 ) Change subject: vty/command.c: talloc from tall_vty_cmd_ctx, not NULL ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/9937 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iaa409b4f63557c8fb028bbb322b5e7253393c05c Gerrit-Change-Number: 9937 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 10 Jul 2018 09:16:45 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 10 09:19:22 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 10 Jul 2018 09:19:22 +0000 Subject: Change in libosmocore[master]: vty: cosmetic: cmd_deopt(): use talloc_strndup(), not memcpy() In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/9938 ) Change subject: vty: cosmetic: cmd_deopt(): use talloc_strndup(), not memcpy() ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/9938 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ibf870ae02be706f802482f7cff6589a70cde8320 Gerrit-Change-Number: 9938 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 10 Jul 2018 09:19:22 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 10 09:27:24 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 10 Jul 2018 09:27:24 +0000 Subject: Change in libosmocore[master]: vty: fix use-after-free and memleaks in is_cmd_ambiguous() In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/9939 ) Change subject: vty: fix use-after-free and memleaks in is_cmd_ambiguous() ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/9939/1/src/vty/command.c File src/vty/command.c: https://gerrit.osmocom.org/#/c/9939/1/src/vty/command.c at 1322 PS1, Line 1322: cmd_deopt(const char *str) Do we really need this wrapper? Why not to pass the 'tall_vty_cmd_ctx' explicitly from callers? -- To view, visit https://gerrit.osmocom.org/9939 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia71ba742108b5ff020997bfb612ad5eb30d04fcd Gerrit-Change-Number: 9939 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 10 Jul 2018 09:27:24 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 10 09:34:56 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 10 Jul 2018 09:34:56 +0000 Subject: Change in simtrace2[master]: DFU: use central DFU override check In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9913 to look at the new patch set (#2). Change subject: DFU: use central DFU override check ...................................................................... DFU: use central DFU override check TRACE_INFO will also provide the DFU start reason, but TRACE_INFO (TRACE_LEVEL >= 4) should only be used for debugging. WARNING: With TRACE_LEVEL >= 4 the DFU binary is over the maximum of 16 kiB allocated for the DFU bootloader. Thus make combined will not boot the main application because its start if after the expecte 16 kiB address; and flashing using DFU will overwrite the DFU bootloader itself. Change-Id: I82323e0f76c03f67df7dc8f2b6783166cc25f3aa --- M firmware/apps/dfu/main.c M firmware/libboard/common/source/board_cstartup_gnu.c 2 files changed, 49 insertions(+), 28 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/13/9913/2 -- To view, visit https://gerrit.osmocom.org/9913 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I82323e0f76c03f67df7dc8f2b6783166cc25f3aa Gerrit-Change-Number: 9913 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 10 09:34:56 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 10 Jul 2018 09:34:56 +0000 Subject: Change in simtrace2[master]: host: set license to GPLv2+ In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9915 to look at the new patch set (#2). Change subject: host: set license to GPLv2+ ...................................................................... host: set license to GPLv2+ Change-Id: I0948d74874af1d3a0f1b4cbcb4a838e4ecd9fe3f --- M host/apdu_dispatch.c M host/apdu_dispatch.h M host/libusb_util.c M host/libusb_util.h M host/simtrace2-discovery.c M host/simtrace2-discovery.h M host/simtrace2-remsim.c M host/simtrace2-sniff.c M host/simtrace2_usb.c M host/usb2udp.c 10 files changed, 134 insertions(+), 30 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/15/9915/2 -- To view, visit https://gerrit.osmocom.org/9915 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0948d74874af1d3a0f1b4cbcb4a838e4ecd9fe3f Gerrit-Change-Number: 9915 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 10 09:34:56 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 10 Jul 2018 09:34:56 +0000 Subject: Change in simtrace2[master]: firmware: set license to GPLv2+ In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9916 to look at the new patch set (#2). Change subject: firmware: set license to GPLv2+ ...................................................................... firmware: set license to GPLv2+ Change-Id: Id4c00159f984976b6d8641900fb64e36a3a30407 --- M firmware/apps/cardem/main.c M firmware/apps/dfu/main.c M firmware/apps/trace/main.c M firmware/apps/triple_play/main.c M firmware/libboard/common/include/board_common.h M firmware/libboard/common/include/board_lowlevel.h M firmware/libboard/common/include/boardver_adc.h M firmware/libboard/common/include/led.h M firmware/libboard/common/include/manifest.h M firmware/libboard/common/include/sim_switch.h M firmware/libboard/common/include/uart_console.h M firmware/libboard/common/source/board_cstartup_gnu.c M firmware/libboard/common/source/boardver_adc.c M firmware/libboard/common/source/led.c M firmware/libboard/common/source/manifest.c M firmware/libboard/common/source/sim_switch.c M firmware/libboard/owhw/include/board.h M firmware/libboard/owhw/source/owhw.c M firmware/libboard/qmod/include/board.h M firmware/libboard/qmod/include/card_pres.h M firmware/libboard/qmod/include/i2c.h M firmware/libboard/qmod/include/wwan_led.h M firmware/libboard/qmod/include/wwan_perst.h M firmware/libboard/qmod/source/board_qmod.c M firmware/libboard/qmod/source/card_pres.c M firmware/libboard/qmod/source/i2c.c M firmware/libboard/qmod/source/wwan_led.c M firmware/libboard/qmod/source/wwan_perst.c M firmware/libboard/simtrace/include/board.h M firmware/libboard/simtrace/source/board_simtrace.c M firmware/libcommon/include/card_emu.h M firmware/libcommon/include/iso7816_fidi.h M firmware/libcommon/include/llist_irqsafe.h M firmware/libcommon/include/ringbuffer.h M firmware/libcommon/include/simtrace.h M firmware/libcommon/include/simtrace_prot.h M firmware/libcommon/include/simtrace_usb.h M firmware/libcommon/include/stdio.h M firmware/libcommon/include/talloc.h M firmware/libcommon/include/usb_buf.h M firmware/libcommon/include/utils.h M firmware/libcommon/source/card_emu.c M firmware/libcommon/source/fputs.c M firmware/libcommon/source/host_communication.c M firmware/libcommon/source/iso7816_fidi.c M firmware/libcommon/source/mode_cardemu.c M firmware/libcommon/source/pseudo_talloc.c M firmware/libcommon/source/ringbuffer.c M firmware/libcommon/source/sniffer.c M firmware/libcommon/source/tc_etu.c M firmware/libcommon/source/usb_buf.c 51 files changed, 791 insertions(+), 118 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/16/9916/2 -- To view, visit https://gerrit.osmocom.org/9916 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id4c00159f984976b6d8641900fb64e36a3a30407 Gerrit-Change-Number: 9916 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 10 09:34:56 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 10 Jul 2018 09:34:56 +0000 Subject: Change in simtrace2[master]: set linux end of line In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9917 to look at the new patch set (#2). Change subject: set linux end of line ...................................................................... set linux end of line Change-Id: I5200f0d6f39b0641cac26a4109a3cd33e8474b9b --- M firmware/atmel_softpack_libraries/libchip_sam3s/include/efc.h M firmware/atmel_softpack_libraries/libchip_sam3s/include/flashd.h M firmware/atmel_softpack_libraries/libchip_sam3s/source/USBD_HAL.c M firmware/atmel_softpack_libraries/libchip_sam3s/source/efc.c M firmware/atmel_softpack_libraries/libchip_sam3s/source/exceptions.c M firmware/atmel_softpack_libraries/libchip_sam3s/source/flashd.c M firmware/atmel_softpack_libraries/libchip_sam3s/source/pio.c M firmware/atmel_softpack_libraries/libchip_sam3s/source/pio_it.c M firmware/atmel_softpack_libraries/libchip_sam3s/source/pmc.c M firmware/atmel_softpack_libraries/libchip_sam3s/source/spi.c M firmware/atmel_softpack_libraries/libchip_sam3s/source/tc.c M firmware/atmel_softpack_libraries/libchip_sam3s/source/usart.c M firmware/atmel_softpack_libraries/libchip_sam3s/source/wdt.c M firmware/libboard/common/source/board_cstartup_gnu.c M firmware/libboard/common/source/board_lowlevel.c M firmware/libboard/common/source/uart_console.c 16 files changed, 6,071 insertions(+), 6,071 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/17/9917/2 -- To view, visit https://gerrit.osmocom.org/9917 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5200f0d6f39b0641cac26a4109a3cd33e8474b9b Gerrit-Change-Number: 9917 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 10 09:34:56 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 10 Jul 2018 09:34:56 +0000 Subject: Change in simtrace2[master]: replace leading spaces with tabs In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9918 to look at the new patch set (#2). Change subject: replace leading spaces with tabs ...................................................................... replace leading spaces with tabs Change-Id: I86783eba0827b58303b10310e9f6b9625e1a27f1 --- M firmware/apps/cardem/main.c M firmware/apps/dfu/main.c M firmware/apps/trace/main.c M firmware/apps/triple_play/main.c M firmware/libboard/common/source/board_cstartup_gnu.c M firmware/libboard/common/source/board_lowlevel.c M firmware/libboard/common/source/led.c M firmware/libboard/common/source/uart_console.c M firmware/libcommon/include/assert.h M firmware/libcommon/include/cciddriver.h M firmware/libcommon/include/iso7816_4.h M firmware/libcommon/include/simtrace.h M firmware/libcommon/source/cciddriver.c M firmware/libcommon/source/iso7816_4.c M firmware/libcommon/source/mode_cardemu.c M firmware/libcommon/source/mode_ccid.c M firmware/libcommon/source/stdio.c M firmware/libcommon/source/string.c 18 files changed, 1,727 insertions(+), 1,727 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/18/9918/2 -- To view, visit https://gerrit.osmocom.org/9918 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I86783eba0827b58303b10310e9f6b9625e1a27f1 Gerrit-Change-Number: 9918 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 10 09:34:56 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 10 Jul 2018 09:34:56 +0000 Subject: Change in simtrace2[master]: cosmetic: put spaces around operations In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9919 to look at the new patch set (#2). Change subject: cosmetic: put spaces around operations ...................................................................... cosmetic: put spaces around operations Change-Id: If5ba5f8d16680e8403944274336ea595017063db --- M firmware/libcommon/source/sniffer.c 1 file changed, 72 insertions(+), 72 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/19/9919/2 -- To view, visit https://gerrit.osmocom.org/9919 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If5ba5f8d16680e8403944274336ea595017063db Gerrit-Change-Number: 9919 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 10 09:34:56 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 10 Jul 2018 09:34:56 +0000 Subject: Change in simtrace2[master]: USB: add flags for sniff data and centralise transfer In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9920 to look at the new patch set (#2). Change subject: USB: add flags for sniff data and centralise transfer ...................................................................... USB: add flags for sniff data and centralise transfer Also fix issue in usb_msg_alloc_hdr and add cosmetic spaces around operations. Change-Id: I768a0ad639aa5e648a630af72d01f7b68082b6b6 --- M firmware/libcommon/include/simtrace_prot.h M firmware/libcommon/source/sniffer.c M host/simtrace2-sniff.c 3 files changed, 140 insertions(+), 142 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/20/9920/2 -- To view, visit https://gerrit.osmocom.org/9920 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I768a0ad639aa5e648a630af72d01f7b68082b6b6 Gerrit-Change-Number: 9920 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 10 09:38:52 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 10 Jul 2018 09:38:52 +0000 Subject: Change in libosmocore[master]: vty/command.c: talloc from tall_vty_cmd_ctx, not NULL In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9937 ) Change subject: vty/command.c: talloc from tall_vty_cmd_ctx, not NULL ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9937 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iaa409b4f63557c8fb028bbb322b5e7253393c05c Gerrit-Change-Number: 9937 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 10 Jul 2018 09:38:52 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 10 09:38:55 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 10 Jul 2018 09:38:55 +0000 Subject: Change in libosmocore[master]: vty: cosmetic: cmd_deopt(): use talloc_strndup(), not memcpy() In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9938 ) Change subject: vty: cosmetic: cmd_deopt(): use talloc_strndup(), not memcpy() ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9938 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ibf870ae02be706f802482f7cff6589a70cde8320 Gerrit-Change-Number: 9938 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 10 Jul 2018 09:38:55 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 10 09:47:19 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 10 Jul 2018 09:47:19 +0000 Subject: Change in libosmocore[master]: vty: fix use-after-free and memleaks in is_cmd_ambiguous() In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9939 ) Change subject: vty: fix use-after-free and memleaks in is_cmd_ambiguous() ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/9939/1/src/vty/command.c File src/vty/command.c: https://gerrit.osmocom.org/#/c/9939/1/src/vty/command.c at 1322 PS1, Line 1322: cmd_deopt(const char *str) > Do we really need this wrapper? [?] Agree. Furthermore, I think the way you are fixing the issue looks like killing a fly with a cannon (as in using a separate ctx for this function and freeing it at the end). Can we try to simply make sure to free stuff where needed, maybe refactor the function if required. -- To view, visit https://gerrit.osmocom.org/9939 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia71ba742108b5ff020997bfb612ad5eb30d04fcd Gerrit-Change-Number: 9939 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 10 Jul 2018 09:47:19 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Tue Jul 10 12:26:47 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Tue, 10 Jul 2018 12:26:47 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-gapk_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#16?= In-Reply-To: <1424480821.129.1531139207621.JavaMail.jenkins@jenkins.osmocom.org> References: <1424480821.129.1531139207621.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <143918282.138.1531225607656.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 127.18 KB...] checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether make supports nested variables... (cached) yes checking if gcc supports -fvisibility=hidden... yes checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking whether gcc understands -c and -o together... (cached) yes checking dependency style of gcc... (cached) gcc3 checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for LIBOSMOCORE... yes checking for LIBOSMOCODEC... yes checking for LIBALSA... yes checking for OPENCORE_AMRNB... yes checking gsm/gsm.h usability... yes checking gsm/gsm.h presence... yes checking for gsm/gsm.h... yes checking for gsm_create in -lgsm... yes checking for stdint.h... (cached) yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking for unistd.h... (cached) yes checking for inline... inline checking for int16_t... yes checking for int32_t... yes checking for uint16_t... yes checking for uint32_t... yes checking for uint64_t... yes checking for uint8_t... yes checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... yes checking for memset... yes checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating src/Makefile config.status: creating libgsmhr/Makefile config.status: creating include/Makefile config.status: creating include/gsmhr/Makefile config.status: creating libosmogapk.pc config.status: creating tests/atlocal config.status: creating tests/Makefile config.status: creating config.h config.status: executing depfiles commands config.status: executing libtool commands config.status: executing tests/atconfig commands make[1]: Entering directory ' make all-recursive make[2]: Entering directory ' Making all in include make[3]: Entering directory ' make[4]: Entering directory ' make[4]: Nothing to be done for 'all-am'. make[4]: Leaving directory ' make[3]: Leaving directory ' Making all in src make[3]: Entering directory ' CC procqueue.lo CC pq_format.lo CC pq_codec.lo CC pq_file.lo CC pq_alsa.lo CC pq_rtp.lo CC pq_ecu.lo CC ecu_fr.lo CC formats.lo CC fmt_ti.lo CC fmt_amr.lo CC fmt_gsm.lo CC fmt_hr_ref.lo CC fmt_racal.lo CC fmt_rawpcm.lo CC fmt_rtp_amr.lo CC fmt_rtp_efr.lo CC fmt_rtp_hr_etsi.lo CC fmt_rtp_hr_ietf.lo CC fmt_amr_opencore.lo CC codecs.lo CC codec_pcm.lo CC codec_hr.lo CC codec_fr.lo CC codec_efr.lo CC codec_amr.lo CC benchmark.lo CC common.lo CCLD libosmogapk.la CC app_osmo_gapk.o CCLD osmo-gapk make[3]: Leaving directory ' Making all in tests make[3]: Entering directory ' make[3]: Nothing to be done for 'all'. make[3]: Leaving directory ' make[3]: Entering directory ' make[3]: Leaving directory ' make[2]: Leaving directory ' make[1]: Leaving directory ' make[1]: Entering directory ' Making dvi in include make[2]: Entering directory ' make[3]: Entering directory ' make[3]: Nothing to be done for 'dvi-am'. make[3]: Leaving directory ' make[2]: Leaving directory ' Making dvi in src make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi'. make[2]: Leaving directory ' Making dvi in tests make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi'. make[2]: Leaving directory ' make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi-am'. make[2]: Leaving directory ' make[1]: Leaving directory ' make[1]: Entering directory ' Making check in include make[2]: Entering directory ' make[3]: Entering directory ' make[3]: Nothing to be done for 'check-am'. make[3]: Leaving directory ' make[2]: Leaving directory ' Making check in src make[2]: Entering directory ' make[2]: Nothing to be done for 'check'. make[2]: Leaving directory ' Making check in tests make[2]: Entering directory ' make procqueue/pq_test io/pq_file_test io/pq_rtp_test ecu/ecu_fr_test make[3]: Entering directory ' CC procqueue/pq_test.o CCLD procqueue/pq_test CC io/pq_file_test.o CCLD io/pq_file_test CC io/pq_rtp_test.o CCLD io/pq_rtp_test CC ecu/ecu_fr_test.o CCLD ecu/ecu_fr_test make[3]: Leaving directory ' make check-local make[3]: Entering directory ' /bin/bash '../../../tests/testsuite' ## ---------------------------- ## ## gapk 0.4.75-27bc test suite. ## ## ---------------------------- ## Regression tests. 1: procqueue ok 2: io/pq_file FAILED (testsuite.at:13) 3: io/pq_rtp ok 4: ecu/ecu_fr_test ok 5: conv/enc/amr_efr ok 6: conv/enc/gsm ok 7: conv/enc/racal_hr skipped (testsuite.at:58) 8: conv/enc/racal_fr ok 9: conv/enc/racal_efr ok 10: conv/enc/ti_hr skipped (testsuite.at:91) 11: conv/enc/ti_fr ok 12: conv/enc/ti_efr ok 13: conv/enc/rtp_efr ok 14: conv/enc/rtp_hr_etsi skipped (testsuite.at:135) 15: conv/enc/rtp_hr_ietf skipped (testsuite.at:146) 16: conv/dec/amr_efr ok 17: conv/dec/gsm ok 18: conv/dec/racal_hr skipped (testsuite.at:179) 19: conv/dec/racal_fr ok 20: conv/dec/racal_efr ok 21: conv/dec/ti_hr skipped (testsuite.at:212) 22: conv/dec/ti_fr ok 23: conv/dec/ti_efr ok 24: conv/dec/rtp_efr ok 25: conv/dec/rtp_hr_etsi skipped (testsuite.at:256) 26: conv/dec/rtp_hr_ietf skipped (testsuite.at:267) ## ------------- ## ## Test results. ## ## ------------- ## ERROR: 18 tests were run, 1 failed unexpectedly. 8 tests were skipped. ## -------------------------- ## ## testsuite.log was created. ## ## -------------------------- ## Please send `tests/testsuite.log' and all information you think might help: To: Subject: [gapk 0.4.75-27bc] testsuite: 2 failed You may investigate any problem if you feel able to do so, in which case the test suite provides a good starting point. Its output may be found below `tests/testsuite.dir'. Makefile:753: recipe for target 'check-local' failed make[3]: *** [check-local] Error 1 make[3]: Leaving directory ' Makefile:602: recipe for target 'check-am' failed make[2]: *** [check-am] Error 2 make[2]: Leaving directory ' Makefile:479: recipe for target 'check-recursive' failed make[1]: *** [check-recursive] Error 1 make[1]: Leaving directory ' Makefile:684: recipe for target 'distcheck' failed make: *** [distcheck] Error 1 + cat-testlogs.sh ======================== ./gapk-0.4.75-27bc/_build/sub/tests/testsuite.dir/02/testsuite.log # -*- compilation -*- 2. testsuite.at:10: testing io/pq_file ... ../../../tests/testsuite.at:13: $abs_top_builddir/tests/io/pq_file_test \ $abs_top_builddir/tests/io/io_sample.txt --- /dev/null 2018-03-27 19:17:06.212284948 +0000 +++ 2018-07-10 12:26:46.960421936 +0000 @@ -0,0 +1,2 @@ +pq_file_test: ../../../tests/io/pq_file_test.c:132: main: Assertion `sample_file != NULL' failed. +: line 29: 433 Aborted $abs_top_builddir/tests/io/pq_file_test $abs_top_builddir/tests/io/io_sample.txt --- expout 2018-07-10 12:26:46.948421989 +0000 +++ 2018-07-10 12:26:46.948421989 +0000 @@ -1,12 +0,0 @@ -Processing sample file with blk_len=2: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=4: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=8: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=16: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=32: -8217c8fb7675a95008f9089d883gapk - -chunk null_context: depth=0 ../../../tests/testsuite.at:13: exit code was 134, expected 0 2. testsuite.at:10: 2. io/pq_file (testsuite.at:10): FAILED (testsuite.at:13) Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Tue Jul 10 13:17:46 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 10 Jul 2018 13:17:46 +0000 Subject: Change in osmo-bsc[master]: lcls: do not LCLS call legs with different codecs Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/9940 Change subject: lcls: do not LCLS call legs with different codecs ...................................................................... lcls: do not LCLS call legs with different codecs It is theoretically possible to LCLS two legs that use different codecs. However, this requires transcoding capabilities on the local MGW. If the local MGW lacks transcoding features such a local circuit should be avoided. Enabeling LCLS under such coditions should be optional (VTY) - Add check to avoid LCLS on different codec/rate - Add VTY-Option to optionally override the check (MGW is able to transcode) Change-Id: I157549129a40c64364dc126f67195759e5f1d60f Related: OS#1602 --- M include/osmocom/bsc/bsc_msc_data.h M src/osmo-bsc/osmo_bsc_lcls.c M src/osmo-bsc/osmo_bsc_vty.c 3 files changed, 31 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/40/9940/1 diff --git a/include/osmocom/bsc/bsc_msc_data.h b/include/osmocom/bsc/bsc_msc_data.h index 7235fba..4b39526 100644 --- a/include/osmocom/bsc/bsc_msc_data.h +++ b/include/osmocom/bsc/bsc_msc_data.h @@ -92,6 +92,7 @@ struct gsm_audio_support **audio_support; int audio_length; enum bsc_lcls_mode lcls_mode; + bool lcls_codec_mismatch_allow; /* ussd welcome text */ char *ussd_welcome_txt; diff --git a/src/osmo-bsc/osmo_bsc_lcls.c b/src/osmo-bsc/osmo_bsc_lcls.c index b197e66..ab00418 100644 --- a/src/osmo-bsc/osmo_bsc_lcls.c +++ b/src/osmo-bsc/osmo_bsc_lcls.c @@ -273,6 +273,18 @@ return false; } + if (conn->user_plane.full_rate != conn->lcls.other->user_plane.full_rate + && conn->sccp.msc->lcls_codec_mismatch_allow == false) { + LOGPFSM(conn->lcls.fi, "Not enabling LS due to codec mismiatch (channel rate)\n"); + return false; + } + + if (conn->user_plane.chan_mode != conn->lcls.other->user_plane.chan_mode + && conn->sccp.msc->lcls_codec_mismatch_allow == false) { + LOGPFSM(conn->lcls.fi, "Not enabling LS due to codec mismiatch (channel mode)\n"); + return false; + } + return true; } diff --git a/src/osmo-bsc/osmo_bsc_vty.c b/src/osmo-bsc/osmo_bsc_vty.c index f6f1b8a..709e783 100644 --- a/src/osmo-bsc/osmo_bsc_vty.c +++ b/src/osmo-bsc/osmo_bsc_vty.c @@ -650,6 +650,23 @@ return CMD_SUCCESS; } +DEFUN(cfg_net_msc_lcls_mismtch, + cfg_net_msc_lcls_mismtch_cmd, + "lcls-codec-mismatch (allowed|forbidden)", + "Allow 3GPP LCLS (Local Call, Local Switch) when call legs use different codec/rate\n" + "Allow LCLS only only for calls that use the same codec/rate on both legs\n" + "Do not Allow LCLS for calls that use a different codec/rate on both legs\n") +{ + struct bsc_msc_data *data = bsc_msc_data(vty); + + if (strcmp(argv[0], "allowed") == 0) + data->lcls_codec_mismatch_allow = true; + else + data->lcls_codec_mismatch_allow = false; + + return CMD_SUCCESS; +} + DEFUN(cfg_net_bsc_mid_call_text, cfg_net_bsc_mid_call_text_cmd, "mid-call-text .TEXT", @@ -938,6 +955,7 @@ install_element(MSC_NODE, &cfg_net_msc_amr_5_15_cmd); install_element(MSC_NODE, &cfg_net_msc_amr_4_75_cmd); install_element(MSC_NODE, &cfg_net_msc_lcls_mode_cmd); + install_element(MSC_NODE, &cfg_net_msc_lcls_mismtch_cmd); install_element(MSC_NODE, &cfg_msc_acc_lst_name_cmd); install_element(MSC_NODE, &cfg_msc_no_acc_lst_name_cmd); install_element(MSC_NODE, &cfg_msc_cs7_bsc_addr_cmd); -- To view, visit https://gerrit.osmocom.org/9940 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I157549129a40c64364dc126f67195759e5f1d60f Gerrit-Change-Number: 9940 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 10 13:35:27 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 10 Jul 2018 13:35:27 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BSC_Tests_LCLS: try call legs with different codec/rate Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/9941 Change subject: BSC_Tests_LCLS: try call legs with different codec/rate ...................................................................... BSC_Tests_LCLS: try call legs with different codec/rate since the local MGW may not support transcoding, osmo-bsc should avoid to LCLS call legs that use different codec/rate. This test attemts to set up a call with different codec rate and checks if those legs do not get LCLSed Change-Id: I91b132306e530ad9ca03fb4a34012381be6b0b52 Depends: osmo-bsc I157549129a40c64364dc126f67195759e5f1d60f Related: OS#1602 --- M bsc/BSC_Tests_LCLS.ttcn M bsc/expected-results.xml 2 files changed, 38 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/41/9941/1 diff --git a/bsc/BSC_Tests_LCLS.ttcn b/bsc/BSC_Tests_LCLS.ttcn index da9fe94..dfbd946 100644 --- a/bsc/BSC_Tests_LCLS.ttcn +++ b/bsc/BSC_Tests_LCLS.ttcn @@ -303,6 +303,42 @@ f_tc_lcls_gcr_bway_connect(true) } +/* Unless explicitly enabled, osmo-bsc will avoid LCLSs when the codecs or rates + * of both legs are different */ +testcase TC_lcls_gcr_bway_codec_mismatch() runs on lcls_test_CT { + var TestHdlrParams pars_a := valueof(t_def_TestHdlrPars); + var TestHdlrParams pars_b; + var MSC_ConnHdlr vc_conn; + var MgcpCommand mgcp_cmd; + + f_lcls_init(); + + /* First call leg uses full rate */ + pars_a.ass_codec_list := valueof(ts_BSSMAP_IE_CodecList({ts_CodecFR})); + pars_a.lcls.gcr := valueof(ts_GCR('010203'O, '0405'O, '060708090a'O)); + pars_a.lcls.cfg := LCLS_CFG_both_way; + pars_a.lcls.csc := LCLS_CSC_connect; + + /* The second call leg uses half-rate */ + pars_b := pars_a; + pars_a.ass_codec_list := valueof(ts_BSSMAP_IE_CodecList({ts_CodecHR})); + + /* first call is not possible to be LS (no second leg yet) */ + pars_a.lcls.exp_sts := LCLS_STS_not_possible_ls; + + /* second call is also not possible to be LS (codec/rate does not match) */ + pars_b.lcls.exp_sts := LCLS_STS_not_yet_ls; + f_lcls_test_init(pars_a, pars_b); + + interleave { + [] CONN_A.receive(LclsCompSync:LCLS_COMP_SYNC_ASS_COMPL); + [] CONN_B.receive(LclsCompSync:LCLS_COMP_SYNC_ASS_COMPL); + [] CONN_A.receive(tr_BSSMAP_LclsNotificationSts(LCLS_STS_not_yet_ls)); + } + + f_lcls_test_fini(); +} + /* Send an ASSIGNMENT REQ with LCLS CFG+CSC enabling LCLS but GCR doesn't match! */ testcase TC_lcls_gcr_nomatch_bway_connect() runs on lcls_test_CT { var TestHdlrParams pars_a := valueof(t_def_TestHdlrPars); @@ -600,6 +636,7 @@ execute( TC_lcls_gcr_only() ); execute( TC_lcls_gcr_bway_connect() ); execute( TC_lcls_gcr_bway_connect_hr() ); + execute( TC_lcls_gcr_bway_codec_mismatch() ); execute( TC_lcls_gcr_nomatch_bway_connect() ); execute( TC_lcls_gcr_bway_dont_connect() ); execute( TC_lcls_gcr_unsuppported_cfg() ); diff --git a/bsc/expected-results.xml b/bsc/expected-results.xml index dbe3d2c..7339951 100644 --- a/bsc/expected-results.xml +++ b/bsc/expected-results.xml @@ -88,6 +88,7 @@ + -- To view, visit https://gerrit.osmocom.org/9941 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I91b132306e530ad9ca03fb4a34012381be6b0b52 Gerrit-Change-Number: 9941 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 10 13:47:54 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 10 Jul 2018 13:47:54 +0000 Subject: Change in osmo-pcu[master]: tbf: Replace '.' in counter names with ':' Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9942 Change subject: tbf: Replace '.' in counter names with ':' ...................................................................... tbf: Replace '.' in counter names with ':' The '.' is illegal character in counter names, as they are exported via CTRL interface, where '.' has a special meaning that cannot be used by strings comprising the variable name. Change-Id: Ieb7496e1a30ab4f2bfe36c7b664dcdc034010a15 --- M src/tbf.cpp 1 file changed, 32 insertions(+), 32 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/42/9942/1 diff --git a/src/tbf.cpp b/src/tbf.cpp index 76137df..71057db 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -98,49 +98,49 @@ }; static const struct rate_ctr_desc tbf_ctr_description[] = { - { "rlc.nacked", "RLC Nacked " }, + { "rlc:nacked", "RLC Nacked " }, }; static const struct rate_ctr_desc tbf_dl_gprs_ctr_description[] = { - { "gprs.downlink.cs1", "CS1 " }, - { "gprs.downlink.cs2", "CS2 " }, - { "gprs.downlink.cs3", "CS3 " }, - { "gprs.downlink.cs4", "CS4 " }, + { "gprs:downlink:cs1", "CS1 " }, + { "gprs:downlink:cs2", "CS2 " }, + { "gprs:downlink:cs3", "CS3 " }, + { "gprs:downlink:cs4", "CS4 " }, }; static const struct rate_ctr_desc tbf_dl_egprs_ctr_description[] = { - { "egprs.downlink.mcs1", "MCS1 " }, - { "egprs.downlink.mcs2", "MCS2 " }, - { "egprs.downlink.mcs3", "MCS3 " }, - { "egprs.downlink.mcs4", "MCS4 " }, - { "egprs.downlink.mcs5", "MCS5 " }, - { "egprs.downlink.mcs6", "MCS6 " }, - { "egprs.downlink.mcs7", "MCS7 " }, - { "egprs.downlink.mcs8", "MCS8 " }, - { "egprs.downlink.mcs9", "MCS9 " }, + { "egprs:downlink:mcs1", "MCS1 " }, + { "egprs:downlink:mcs2", "MCS2 " }, + { "egprs:downlink:mcs3", "MCS3 " }, + { "egprs:downlink:mcs4", "MCS4 " }, + { "egprs:downlink:mcs5", "MCS5 " }, + { "egprs:downlink:mcs6", "MCS6 " }, + { "egprs:downlink:mcs7", "MCS7 " }, + { "egprs:downlink:mcs8", "MCS8 " }, + { "egprs:downlink:mcs9", "MCS9 " }, }; static const struct rate_ctr_desc tbf_ul_gprs_ctr_description[] = { - { "gprs.uplink.cs1", "CS1 " }, - { "gprs.uplink.cs2", "CS2 " }, - { "gprs.uplink.cs3", "CS3 " }, - { "gprs.uplink.cs4", "CS4 " }, + { "gprs:uplink:cs1", "CS1 " }, + { "gprs:uplink:cs2", "CS2 " }, + { "gprs:uplink:cs3", "CS3 " }, + { "gprs:uplink:cs4", "CS4 " }, }; static const struct rate_ctr_desc tbf_ul_egprs_ctr_description[] = { - { "egprs.uplink.mcs1", "MCS1 " }, - { "egprs.uplink.mcs2", "MCS2 " }, - { "egprs.uplink.mcs3", "MCS3 " }, - { "egprs.uplink.mcs4", "MCS4 " }, - { "egprs.uplink.mcs5", "MCS5 " }, - { "egprs.uplink.mcs6", "MCS6 " }, - { "egprs.uplink.mcs7", "MCS7 " }, - { "egprs.uplink.mcs8", "MCS8 " }, - { "egprs.uplink.mcs9", "MCS9 " }, + { "egprs:uplink:mcs1", "MCS1 " }, + { "egprs:uplink:mcs2", "MCS2 " }, + { "egprs:uplink:mcs3", "MCS3 " }, + { "egprs:uplink:mcs4", "MCS4 " }, + { "egprs:uplink:mcs5", "MCS5 " }, + { "egprs:uplink:mcs6", "MCS6 " }, + { "egprs:uplink:mcs7", "MCS7 " }, + { "egprs:uplink:mcs8", "MCS8 " }, + { "egprs:uplink:mcs9", "MCS9 " }, }; static const struct rate_ctr_group_desc tbf_ctrg_desc = { - "pcu.tbf", + "pcu:tbf", "TBF Statistics", OSMO_STATS_CLASS_SUBSCRIBER, ARRAY_SIZE(tbf_ctr_description), @@ -148,7 +148,7 @@ }; static const struct rate_ctr_group_desc tbf_dl_gprs_ctrg_desc = { - "tbf.gprs", + "tbf:gprs", "Data Blocks", OSMO_STATS_CLASS_SUBSCRIBER, ARRAY_SIZE(tbf_dl_gprs_ctr_description), @@ -156,7 +156,7 @@ }; static const struct rate_ctr_group_desc tbf_dl_egprs_ctrg_desc = { - "tbf.egprs", + "tbf:egprs", "Data Blocks", OSMO_STATS_CLASS_SUBSCRIBER, ARRAY_SIZE(tbf_dl_egprs_ctr_description), @@ -164,7 +164,7 @@ }; static const struct rate_ctr_group_desc tbf_ul_gprs_ctrg_desc = { - "tbf.gprs", + "tbf:gprs", "Data Blocks", OSMO_STATS_CLASS_SUBSCRIBER, ARRAY_SIZE(tbf_ul_gprs_ctr_description), @@ -172,7 +172,7 @@ }; static const struct rate_ctr_group_desc tbf_ul_egprs_ctrg_desc = { - "tbf.egprs", + "tbf:egprs", "Data Blocks", OSMO_STATS_CLASS_SUBSCRIBER, ARRAY_SIZE(tbf_ul_egprs_ctr_description), -- To view, visit https://gerrit.osmocom.org/9942 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ieb7496e1a30ab4f2bfe36c7b664dcdc034010a15 Gerrit-Change-Number: 9942 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 10 13:47:55 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 10 Jul 2018 13:47:55 +0000 Subject: Change in osmo-pcu[master]: tbf: Use incrementing id for rate_ctr_group_alloc Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9943 Change subject: tbf: Use incrementing id for rate_ctr_group_alloc ...................................................................... tbf: Use incrementing id for rate_ctr_group_alloc Wrap-around of var handling next id will luckly happen long after initially assigned TBFs are already released. Change-Id: I90ef64133986c556c1a529f5b966e847e6cabbad --- M src/tbf.cpp 1 file changed, 18 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/43/9943/1 diff --git a/src/tbf.cpp b/src/tbf.cpp index 71057db..6792d08 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -51,6 +51,8 @@ extern void *tall_pcu_ctx; +static unsigned int next_tbf_ctr_group_id = 0; /* Incrementing group id */ + static void tbf_timer_cb(void *_tbf); const struct value_string gprs_rlcmac_tbf_poll_state_names[] = { @@ -922,7 +924,7 @@ "Allocated: trx = %d, ul_slots = %02x, dl_slots = %02x\n", tbf->trx->trx_no, tbf->ul_slots(), tbf->dl_slots()); - tbf->m_ctrs = rate_ctr_group_alloc(tbf, &tbf_ctrg_desc, 0); + tbf->m_ctrs = rate_ctr_group_alloc(tbf, &tbf_ctrg_desc, next_tbf_ctr_group_id++); if (!tbf->m_ctrs) { LOGPTBF(tbf, LOGL_ERROR, "Couldn't allocate TBF counters\n"); return -1; @@ -1005,8 +1007,10 @@ return NULL; } - tbf->m_ul_egprs_ctrs = rate_ctr_group_alloc(tbf, &tbf_ul_egprs_ctrg_desc, 0); - tbf->m_ul_gprs_ctrs = rate_ctr_group_alloc(tbf, &tbf_ul_gprs_ctrg_desc, 0); + tbf->m_ul_egprs_ctrs = rate_ctr_group_alloc(tbf, + &tbf_ul_egprs_ctrg_desc, tbf->m_ctrs->idx); + tbf->m_ul_gprs_ctrs = rate_ctr_group_alloc(tbf, + &tbf_ul_gprs_ctrg_desc, tbf->m_ctrs->idx); if (!tbf->m_ul_egprs_ctrs || !tbf->m_ul_gprs_ctrs) { LOGPTBF(tbf, LOGL_ERROR, "Couldn't allocate TBF UL counters\n"); talloc_free(tbf); @@ -1094,14 +1098,18 @@ if (tbf->is_egprs_enabled()) { tbf->set_window_size(); - tbf->m_dl_egprs_ctrs = rate_ctr_group_alloc(tbf, &tbf_dl_egprs_ctrg_desc, 0); + tbf->m_dl_egprs_ctrs = rate_ctr_group_alloc(tbf, + &tbf_dl_egprs_ctrg_desc, + tbf->m_ctrs->idx); if (!tbf->m_dl_egprs_ctrs) { LOGPTBF(tbf, LOGL_ERROR, "Couldn't allocate EGPRS DL counters\n"); talloc_free(tbf); return NULL; } } else { - tbf->m_dl_gprs_ctrs = rate_ctr_group_alloc(tbf, &tbf_dl_gprs_ctrg_desc, 0); + tbf->m_dl_gprs_ctrs = rate_ctr_group_alloc(tbf, + &tbf_dl_gprs_ctrg_desc, + tbf->m_ctrs->idx); if (!tbf->m_dl_gprs_ctrs) { LOGPTBF(tbf, LOGL_ERROR, "Couldn't allocate GPRS DL counters\n"); talloc_free(tbf); @@ -1569,11 +1577,13 @@ TBF_SET_ASS_STATE_UL(ul_tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ); ul_tbf->control_ts = ts; ul_tbf->trx = trx; - ul_tbf->m_ctrs = rate_ctr_group_alloc(ul_tbf, &tbf_ctrg_desc, 0); + ul_tbf->m_ctrs = rate_ctr_group_alloc(ul_tbf, &tbf_ctrg_desc, next_tbf_ctr_group_id++); ul_tbf->m_ul_egprs_ctrs = rate_ctr_group_alloc(ul_tbf, - &tbf_ul_egprs_ctrg_desc, 0); + &tbf_ul_egprs_ctrg_desc, + ul_tbf->m_ctrs->idx); ul_tbf->m_ul_gprs_ctrs = rate_ctr_group_alloc(ul_tbf, - &tbf_ul_gprs_ctrg_desc, 0); + &tbf_ul_gprs_ctrg_desc, + ul_tbf->m_ctrs->idx); if (!ul_tbf->m_ctrs || !ul_tbf->m_ul_egprs_ctrs || !ul_tbf->m_ul_gprs_ctrs) { LOGPTBF(ul_tbf, LOGL_ERROR, "Cound not allocate TBF UL rate counters\n"); talloc_free(ul_tbf); -- To view, visit https://gerrit.osmocom.org/9943 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I90ef64133986c556c1a529f5b966e847e6cabbad Gerrit-Change-Number: 9943 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 10 13:53:29 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 10 Jul 2018 13:53:29 +0000 Subject: Change in libosmocore[master]: rate_ctr: Improve logging In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9753 ) Change subject: rate_ctr: Improve logging ...................................................................... Patch Set 2: @Harald it seems it was you that added the "quiet" logic in ae510dc4a743e981b40fc5e1fdb4c109f2425e27. -- To view, visit https://gerrit.osmocom.org/9753 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I992d165cab5ee6ca9b5b7e4a2210a0951954bd34 Gerrit-Change-Number: 9753 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Harald Welte Gerrit-Comment-Date: Tue, 10 Jul 2018 13:53:29 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 10 14:04:07 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 10 Jul 2018 14:04:07 +0000 Subject: Change in simtrace2[master]: sniffer: fix inverted reset meaning Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9944 Change subject: sniffer: fix inverted reset meaning ...................................................................... sniffer: fix inverted reset meaning Change-Id: I860e2e29c059e1e0ec126695bb68d489891a17da --- M firmware/libcommon/source/sniffer.c 1 file changed, 7 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/44/9944/1 diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 0ca71a5..c58b047 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -832,11 +832,11 @@ TRACE_ERROR("Pin other than reset caused a interrupt\n\r"); return; } - /* Update the ISO state according to the reset change */ + /* Update the ISO state according to the reset change (reset is active low) */ if (PIO_Get(&pin_rst)) { - change_flags |= SNIFF_CHANGE_FLAG_RESET_HOLD; /* set flag and let main loop send it */ - } else { change_flags |= SNIFF_CHANGE_FLAG_RESET_RELEASE; /* set flag and let main loop send it */ + } else { + change_flags |= SNIFF_CHANGE_FLAG_RESET_HOLD; /* set flag and let main loop send it */ } } @@ -1011,13 +1011,13 @@ /* Handle flags */ if (change_flags) { /* WARNING this is not synced with the data buffer handling */ if (change_flags & SNIFF_CHANGE_FLAG_RESET_HOLD) { - if (ISO7816_S_WAIT_ATR != iso_state) { - change_state(ISO7816_S_WAIT_ATR); + if (ISO7816_S_RESET != iso_state) { + change_state(ISO7816_S_RESET); } } if (change_flags & SNIFF_CHANGE_FLAG_RESET_RELEASE) { - if (ISO7816_S_RESET != iso_state) { - change_state(ISO7816_S_RESET); + if (ISO7816_S_WAIT_ATR != iso_state) { + change_state(ISO7816_S_WAIT_ATR); } } if (change_flags & SNIFF_CHANGE_FLAG_TIMEOUT_WT) { -- To view, visit https://gerrit.osmocom.org/9944 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I860e2e29c059e1e0ec126695bb68d489891a17da Gerrit-Change-Number: 9944 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 10 14:04:08 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 10 Jul 2018 14:04:08 +0000 Subject: Change in simtrace2[master]: host sniff: process remaining usb messages in buffer Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9945 Change subject: host sniff: process remaining usb messages in buffer ...................................................................... host sniff: process remaining usb messages in buffer Change-Id: I1746c0187b2e5dbef44b4b336fee3bd9ded15079 --- M host/simtrace2-sniff.c 1 file changed, 6 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/45/9945/1 diff --git a/host/simtrace2-sniff.c b/host/simtrace2-sniff.c index eb547b0..d5fe48a 100644 --- a/host/simtrace2-sniff.c +++ b/host/simtrace2-sniff.c @@ -276,12 +276,15 @@ if (xfer_len > 0) { //printf("URB: %s\n", osmo_hexdump(&buf[buf_i], xfer_len)); buf_i += xfer_len; - if (buf_i>=sizeof(buf)) { + if (buf_i >= sizeof(buf)) { perror("preventing USB buffer overflow"); return; } - int processed = process_usb_msg(buf, buf_i); - if (processed > 0 && processed <= buf_i) { + int processed; + while ((processed = process_usb_msg(buf, buf_i)) > 0) { + if (processed > buf_i) { + break; + } for (i = processed; i < buf_i; i++) { buf[i-processed] = buf[i]; } -- To view, visit https://gerrit.osmocom.org/9945 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I1746c0187b2e5dbef44b4b336fee3bd9ded15079 Gerrit-Change-Number: 9945 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 10 14:04:08 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 10 Jul 2018 14:04:08 +0000 Subject: Change in simtrace2[master]: host sniff: add functions to print flags Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9946 Change subject: host sniff: add functions to print flags ...................................................................... host sniff: add functions to print flags Change-Id: If3c0a4790662bcc64db5ff03adcc033836e16ad0 --- M host/simtrace2-sniff.c 1 file changed, 58 insertions(+), 29 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/46/9946/1 diff --git a/host/simtrace2-sniff.c b/host/simtrace2-sniff.c index d5fe48a..765ced3 100644 --- a/host/simtrace2-sniff.c +++ b/host/simtrace2-sniff.c @@ -94,6 +94,58 @@ return 0; } +struct flag_meaning_t { + const uint32_t flag; + const char* meaning; +}; + +const struct flag_meaning_t change_flags[] = { + { + .flag = SNIFF_CHANGE_FLAG_CARD_INSERT, + .meaning = "card inserted", + }, + { + .flag = SNIFF_CHANGE_FLAG_CARD_EJECT, + .meaning = "card ejected", + }, + { + .flag = SNIFF_CHANGE_FLAG_RESET_HOLD, + .meaning = "reset hold", + }, + { + .flag = SNIFF_CHANGE_FLAG_RESET_RELEASE, + .meaning = "reset release", + }, + { + .flag = SNIFF_CHANGE_FLAG_TIMEOUT_WT, + .meaning = "data transfer timeout", + }, +}; + +const struct flag_meaning_t data_flags[] = { + { + .flag = SNIFF_DATA_FLAG_ERROR_INCOMPLETE, + .meaning = "incomplete", + }, + { + .flag = SNIFF_DATA_FLAG_ERROR_MALFORMED, + .meaning = "malformed", + }, +}; + +static void print_flags(const struct flag_meaning_t* flag_meanings, uint32_t nb_flags, uint32_t flags) { + uint32_t i; + for (i = 0; i < nb_flags; i++) { + if (flags & flag_meanings[i].flag) { + printf(flag_meanings[i].meaning); + flags &= ~flag_meanings[i].flag; + if (flags) { + printf(", "); + } + } + } +} + static int process_change(const uint8_t *buf, int len) { /* check if there is enough data for the structure */ @@ -103,22 +155,12 @@ struct sniff_change *change = (struct sniff_change *)buf; printf("Card state change: "); - if (change->flags&SNIFF_CHANGE_FLAG_CARD_INSERT) { - printf("card inserted "); + if (change->flags) { + print_flags(change_flags, ARRAY_SIZE(change_flags), change->flags); + printf("\n"); + } else { + printf("no changes\n"); } - if (change->flags&SNIFF_CHANGE_FLAG_CARD_EJECT) { - printf("card ejected "); - } - if (change->flags&SNIFF_CHANGE_FLAG_RESET_HOLD) { - printf("reset hold "); - } - if (change->flags&SNIFF_CHANGE_FLAG_RESET_RELEASE) { - printf("reset release "); - } - if (change->flags&SNIFF_CHANGE_FLAG_TIMEOUT_WT) { - printf("data transfer timeout "); - } - printf("\n"); return 0; } @@ -176,20 +218,7 @@ } if (data->flags) { printf(" ("); - if (data->flags & SNIFF_DATA_FLAG_ERROR_INCOMPLETE) { - printf("incomplete"); - data->flags &= ~SNIFF_DATA_FLAG_ERROR_INCOMPLETE; - if (data->flags) { - printf(", "); - } - } - if (data->flags & SNIFF_DATA_FLAG_ERROR_MALFORMED) { - printf("malformed"); - data->flags &= ~SNIFF_DATA_FLAG_ERROR_MALFORMED; - if (data->flags) { - printf(", "); - } - } + print_flags(data_flags, ARRAY_SIZE(data_flags), data->flags); printf(")"); } printf(": "); -- To view, visit https://gerrit.osmocom.org/9946 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: If3c0a4790662bcc64db5ff03adcc033836e16ad0 Gerrit-Change-Number: 9946 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 10 14:08:40 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 10 Jul 2018 14:08:40 +0000 Subject: Change in osmo-pcu[master]: tbf: Replace '.' in counter names with ':' In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9942 ) Change subject: tbf: Replace '.' in counter names with ':' ...................................................................... Patch Set 1: Build failure triggered is fixed in next commit, so this one we can Verify+2 manually and merge. -- To view, visit https://gerrit.osmocom.org/9942 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ieb7496e1a30ab4f2bfe36c7b664dcdc034010a15 Gerrit-Change-Number: 9942 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 10 Jul 2018 14:08:40 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 10 14:27:30 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 10 Jul 2018 14:27:30 +0000 Subject: Change in pysim[master]: tests: add test program to verify pysim-prog.py (and pysim-read.py) Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/9947 Change subject: tests: add test program to verify pysim-prog.py (and pysim-read.py) ...................................................................... tests: add test program to verify pysim-prog.py (and pysim-read.py) Pysim now supports quite a number of different cards. Estimating if changes in pysim introce regressions becomes increasingly difficult The script that is added with this patch is intended to run as atomated testsuit on real cards attached to a test system. However, it can also be used by developers locally to check for regressions. Change-Id: I8c6f95998272333bc757b34e3ab6be004e8cd674 Related: OS#3376 --- A tests/fakemagicsim.data.example A tests/pysim-test.sh A tests/sysmoUSIM-SJS1.data.example 3 files changed, 234 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/47/9947/1 diff --git a/tests/fakemagicsim.data.example b/tests/fakemagicsim.data.example new file mode 100644 index 0000000..deab2f7 --- /dev/null +++ b/tests/fakemagicsim.data.example @@ -0,0 +1,6 @@ +MCC=001 +MNC=01 +ICCID=1122334455667788990 +KI=FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +OPC=FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +IMSI=001010000000102 \ No newline at end of file diff --git a/tests/pysim-test.sh b/tests/pysim-test.sh new file mode 100755 index 0000000..0defcad --- /dev/null +++ b/tests/pysim-test.sh @@ -0,0 +1,221 @@ +#!/bin/bash + +# Utility to verify the functionality of pysim-prog.py +# +# (C) 2018 by Sysmocom s.f.m.c. GmbH +# All Rights Reserved +# +# Author: Philipp Maier +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +PYSIM_PROG=../pySim-prog.py +PYSIM_READ=../pySim-read.py +TEMPFILE=temp.tmp + +set -e + +echo "pysim-test - a test program to test pysim-prog.py" +echo "=================================================" + +# Generate a list of the cards we expect to see by checking which .ok files +# are present +function gen_card_list { + N_CARDS=0 + + echo "Expecting to see the following cards:" + + for I in *.data ; do + CARD_NAMES[$N_CARDS]=${I%.*} + CARD_SEEN[$N_CARDS]=0 + N_CARDS=$((N_CARDS+1)) + done + + for I in $(seq 0 $((N_CARDS-1))); do + echo ${CARD_NAMES[$I]} + done +} + +# Increment counter in card list for a specified card name (type) +function inc_card_list { + CARD_NAME=$1 + for I in $(seq 0 $((N_CARDS-1))); do + if [ $CARD_NAME = ${CARD_NAMES[$I]} ]; then + CARD_SEEN[$I]=$((${CARD_NAMES[$I]}+1)) + fi + done +} + +# Check the card list, each card must be seen exactly one times +function check_card_list { + for I in $(seq 0 $((N_CARDS-1))); do + if [ ${CARD_SEEN[$I]} -ne 1 ]; then + echo "Error: Card ${CARD_NAMES[$I]} seen ${CARD_SEEN[$I]} times!" + exit 1 + fi + done + + echo "All cards seen -- everything ok!" +} + +# Verify the contents of a card by reading them and then diffing against the +# previously created .ok file +function check_card { + TERMINAL=$1 + CARD_NAME=$2 + echo "Verifying card ..." + stat ./$CARD_NAME.ok > /dev/null + python $PYSIM_READ -p $TERMINAL > $TEMPFILE + set +e + CARD_DIFF=$(diff $TEMPFILE ./$CARD_NAME.ok) + set -e + + if [ "$CARD_DIFF" != "" ]; then + echo "Card contents do not match the test data:" + echo "Expected: $CARD_NAME.ok" + echo "------------8<------------" + cat "$CARD_NAME.ok" + echo "------------8<------------" + echo "Got:" + echo "------------8<------------" + cat $TEMPFILE + echo "------------8<------------" + exit 1 + fi + + inc_card_list $CARD_NAME + + echo "Card contents match the test data -- success!" + rm $TEMPFILE +} + +# Read out the card using pysim-read and store the result as .ok file. This +# data will be used later in order to verify the results of our write tests. +function gen_ok_file { + TERMINAL=$1 + CARD_NAME=$2 + python $PYSIM_READ -p $TERMINAL > "$CARD_NAME.ok" + echo "Generated file: $CARD_NAME.ok" + echo "------------8<------------" + cat "$CARD_NAME.ok" + echo "------------8<------------" +} + +# Find out the type (card name) of the card that is installed in the specified +# reader +function probe_card { + TERMINAL=$1 + RESULT=$(timeout 5 $PYSIM_PROG -p $TERMINAL -T | cut -d ":" -f 2 | tail -n 1 | xargs) + echo $RESULT +} + +# Read out all cards and store the results as .ok files +function gen_ok_files { + echo "== OK FILE GENERATION ==" + for I in $(seq 0 $((N_TERMINALS-1))); do + echo "Probing card in terminal #$I" + CARD_NAME=$(probe_card $I) + if [ -z "$CARD_NAME" ]; then + echo "Error: Unresponsive card!" + exit 1 + fi + echo "Card is of type: $CARD_NAME" + gen_ok_file $I $CARD_NAME + done +} + +# Execute tests. Each card is programmed and the contents are checked +# afterwards. +function run_test { + for I in $(seq 0 $((N_TERMINALS-1))); do + echo "== EXECUTING TEST ==" + echo "Probing card in terminal #$I" + CARD_NAME=$(probe_card $I) + if [ -z "$CARD_NAME" ]; then + echo "Error: Unresponsive card!" + exit 1 + fi + echo "Card is of type: $CARD_NAME" + + # Make sure some default data is set + MCC=001 + MNC=01 + ICCID=1122334455667788990 + KI=FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + OPC=FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + IMSI=001010000000001 + ADM=00000000 + + . "$CARD_NAME.data" + python $PYSIM_PROG -p $I -t $CARD_NAME -o $OPC -k $KI -x $MCC -y $MNC -i $IMSI -s $ICCID -a $ADM + check_card $I $CARD_NAME + echo "" + done +} + +function usage { + echo "Options:" + echo "-n: number of card terminals" + echo "-o: generate .ok files" +} + +# Make sure that the pathes to the python scripts always work, regardless from +# where the script is called. +CURDIR=$PWD +SCRIPTDIR=$(dirname $0) +cd $SCRIPTDIR +PYSIM_PROG=$(realpath $PYSIM_PROG) +PYSIM_READ=$(realpath $PYSIM_READ) +cd $CURDIR + +OPT_N_TERMINALS=0 +OPT_GEN_OK_FILES=0 +while getopts ":hon:" OPT; do + case $OPT in + h) + usage + exit 0 + ;; + o) + OPT_GEN_OK_FILES=1 + ;; + n) + OPT_N_TERMINALS=$OPTARG + ;; + \?) + echo "Invalid option: -$OPTARG" >&2 + exit 1 + ;; + esac +done + +N_TERMINALS=$OPT_N_TERMINALS + +# Generate a list of available cards, if no explicit reader number is given +# then the number of cards will be used as reader number. +gen_card_list +if [ $N_TERMINALS -eq 0 ]; then + N_TERMINALS=$N_CARDS +fi +echo "Number of card terminals installed: $N_TERMINALS" +echo "" + +if [ $OPT_GEN_OK_FILES -eq 1 ]; then + gen_ok_files + exit 0 +else + run_test + check_card_list + exit 0 +fi diff --git a/tests/sysmoUSIM-SJS1.data.example b/tests/sysmoUSIM-SJS1.data.example new file mode 100644 index 0000000..d711dcb --- /dev/null +++ b/tests/sysmoUSIM-SJS1.data.example @@ -0,0 +1,7 @@ +MCC=001 +MNC=01 +ICCID=1122334455667788990 +KI=FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +OPC=FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +IMSI=001010000000102 +ADM=12345678 -- To view, visit https://gerrit.osmocom.org/9947 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I8c6f95998272333bc757b34e3ab6be004e8cd674 Gerrit-Change-Number: 9947 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Tue Jul 10 15:10:06 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Tue, 10 Jul 2018 15:10:06 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-asn1c_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#180?= In-Reply-To: <1702930910.130.1531149006525.JavaMail.jenkins@jenkins.osmocom.org> References: <1702930910.130.1531149006525.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <1840759951.139.1531235406477.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 3.67 KB...] + ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for style of include used by make... GNU checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking how to run the C++ preprocessor... g++ -E checking for g77... no checking for f77... no checking for xlf... no checking for frt... no checking for pgf77... no checking for cf77... no checking for fort77... no checking for fl32... no checking for af77... no checking for f90... no checking for xlf90... no checking for pgf90... no checking for pghpf... no checking for epcf90... no checking for gfortran... no checking for g95... no checking for f95... no checking for fort... no checking for xlf95... no checking for ifort... no checking for ifc... no checking for efc... no checking for pgf95... no checking for lf95... no checking for ftn... no checking whether we are using the GNU Fortran 77 compiler... no checking whether accepts -g... no checking the maximum length of command line arguments... 32768 checking command to parse /usr/bin/nm -B output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes configure: creating libtool appending configuration tag "CXX" to libtool checking for ld used by g++... /usr/bin/ld -m elf_x86_64 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC checking if g++ PIC flag -fPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate appending configuration tag "F77" to libtool checking for autoconf... /usr/bin/autoconf checking for autoheader... /usr/bin/autoheader checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking dependency style of gcc... (cached) gcc3 checking how to run the C preprocessor... gcc -E checking for a BSD-compatible install... /usr/bin/install -c checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking for bison... bison -y checking for flex... flex checking for yywrap in -lfl... yes checking lex output file root... lex.yy checking whether yytext is a pointer... yes checking for ar... /usr/bin/ar checking for ANSI C header files... (cached) yes checking sys/param.h usability... yes checking sys/param.h presence... yes checking for sys/param.h... yes checking whether byte ordering is bigendian... no checking for off_t... yes checking for size_t... yes checking whether struct tm is in sys/time.h or time.h... time.h checking for intmax_t... yes checking for library containing getopt... none required checking for strtoimax... yes checking for strtoll... yes checking for mergesort... no checking for mkstemps... yes configure: creating ./config.status config.status: creating skeletons/standard-modules/Makefile config.status: creating skeletons/tests/Makefile config.status: creating libasn1compiler/Makefile config.status: creating libasn1parser/Makefile config.status: creating libasn1print/Makefile config.status: creating asn1c/webcgi/Makefile config.status: creating asn1c/tests/Makefile config.status: creating libasn1fix/Makefile config.status: creating skeletons/Makefile config.status: creating examples/Makefile config.status: creating tests/Makefile config.status: creating asn1c/Makefile config.status: creating doc/Makefile config.status: creating asn1c.spec config.status: creating Makefile config.status: creating config.h config.status: executing depfiles commands + make -j 8 make all-recursive make[1]: Entering directory ' Making all in libasn1parser make[2]: Entering directory ' if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF ".deps/asn1parser.Tpo" -c -o asn1parser.lo asn1parser.c; \ then mv -f ".deps/asn1parser.Tpo" ".deps/asn1parser.Plo"; else rm -f ".deps/asn1parser.Tpo"; exit 1; fi bison -y -p asn1p_ -d asn1p_y.y if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF ".deps/asn1p_l.Tpo" -c -o asn1p_l.lo asn1p_l.c; \ then mv -f ".deps/asn1p_l.Tpo" ".deps/asn1p_l.Plo"; else rm -f ".deps/asn1p_l.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF ".deps/asn1p_module.Tpo" -c -o asn1p_module.lo asn1p_module.c; \ then mv -f ".deps/asn1p_module.Tpo" ".deps/asn1p_module.Plo"; else rm -f ".deps/asn1p_module.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF ".deps/asn1p_oid.Tpo" -c -o asn1p_oid.lo asn1p_oid.c; \ then mv -f ".deps/asn1p_oid.Tpo" ".deps/asn1p_oid.Plo"; else rm -f ".deps/asn1p_oid.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF ".deps/asn1p_value.Tpo" -c -o asn1p_value.lo asn1p_value.c; \ then mv -f ".deps/asn1p_value.Tpo" ".deps/asn1p_value.Plo"; else rm -f ".deps/asn1p_value.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF ".deps/asn1p_expr.Tpo" -c -o asn1p_expr.lo asn1p_expr.c; \ then mv -f ".deps/asn1p_expr.Tpo" ".deps/asn1p_expr.Plo"; else rm -f ".deps/asn1p_expr.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF ".deps/asn1p_xports.Tpo" -c -o asn1p_xports.lo asn1p_xports.c; \ then mv -f ".deps/asn1p_xports.Tpo" ".deps/asn1p_xports.Plo"; else rm -f ".deps/asn1p_xports.Tpo"; exit 1; fi asn1p_y.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] mkdir .libs gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -fPIC -DPIC -o .libs/asn1p_module.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -fPIC -DPIC -o .libs/asn1p_l.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -fPIC -DPIC -o .libs/asn1p_expr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -fPIC -DPIC -o .libs/asn1p_value.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -fPIC -DPIC -o .libs/asn1parser.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -fPIC -DPIC -o .libs/asn1p_xports.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -fPIC -DPIC -o .libs/asn1p_oid.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -o asn1p_module.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -o asn1p_xports.o >/dev/null 2>&1 asn1p_l.c:3521:12: warning: 'input' defined but not used [-Wunused-function] static int input() ^~~~~ gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -o asn1parser.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -o asn1p_oid.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF ".deps/asn1p_constr.Tpo" -c -o asn1p_constr.lo asn1p_constr.c; \ then mv -f ".deps/asn1p_constr.Tpo" ".deps/asn1p_constr.Plo"; else rm -f ".deps/asn1p_constr.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -o asn1p_value.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF ".deps/asn1p_param.Tpo" -c -o asn1p_param.lo asn1p_param.c; \ then mv -f ".deps/asn1p_param.Tpo" ".deps/asn1p_param.Plo"; else rm -f ".deps/asn1p_param.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -o asn1p_expr.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF ".deps/asn1p_class.Tpo" -c -o asn1p_class.lo asn1p_class.c; \ then mv -f ".deps/asn1p_class.Tpo" ".deps/asn1p_class.Plo"; else rm -f ".deps/asn1p_class.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF ".deps/asn1p_ref.Tpo" -c -o asn1p_ref.lo asn1p_ref.c; \ then mv -f ".deps/asn1p_ref.Tpo" ".deps/asn1p_ref.Plo"; else rm -f ".deps/asn1p_ref.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -fPIC -DPIC -o .libs/asn1p_param.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -fPIC -DPIC -o .libs/asn1p_constr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -o asn1p_param.o >/dev/null 2>&1 if test -f y.tab.h; then \ to=`echo "asn1p_y_H" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \ sed -e "/^#/!b" -e "s/Y_TAB_H/$to/g" -e "s|y\.tab\.h|asn1p_y.h|" \ y.tab.h >asn1p_y.ht; \ rm -f y.tab.h; \ if cmp -s asn1p_y.ht asn1p_y.h; then \ rm -f asn1p_y.ht ;\ else \ mv asn1p_y.ht asn1p_y.h; \ fi; \ fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -fPIC -DPIC -o .libs/asn1p_class.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -fPIC -DPIC -o .libs/asn1p_ref.o if test -f y.output; then \ mv y.output asn1p_y.output; \ fi sed '/^#/ s|y\.tab\.c|asn1p_y.c|' y.tab.c >asn1p_y.ct && mv asn1p_y.ct asn1p_y.c rm -f y.tab.c gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -o asn1p_constr.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF ".deps/asn1p_y.Tpo" -c -o asn1p_y.lo asn1p_y.c; \ then mv -f ".deps/asn1p_y.Tpo" ".deps/asn1p_y.Plo"; else rm -f ".deps/asn1p_y.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -o asn1p_ref.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF .deps/asn1p_y.Tpo -c asn1p_y.c -fPIC -DPIC -o .libs/asn1p_y.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -o asn1p_class.o >/dev/null 2>&1 asn1p_y.y: In function 'asn1p_parse': asn1p_y.y:357:13: error: 'param' undeclared (first use in this function) *(void **)param = $1; ^~~~~ asn1p_y.y:357:13: note: each undeclared identifier is reported only once for each function it appears in Makefile:299: recipe for target 'asn1p_y.lo' failed make[2]: *** [asn1p_y.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -o asn1p_l.o >/dev/null 2>&1 make[2]: Leaving directory ' Makefile:302: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory ' Makefile:212: recipe for target 'all' failed make: *** [all] Error 2 Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Tue Jul 10 16:37:22 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 10 Jul 2018 16:37:22 +0000 Subject: Change in osmo-sgsn[master]: vty: Add cmd to disable echo loop explictly Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9948 Change subject: vty: Add cmd to disable echo loop explictly ...................................................................... vty: Add cmd to disable echo loop explictly Change-Id: I0598427257533ce8ae9e9afa787293d7c98fed15 --- M src/gprs/sgsn_vty.c 1 file changed, 17 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/48/9948/1 diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c index 9f9332c..8092158 100644 --- a/src/gprs/sgsn_vty.c +++ b/src/gprs/sgsn_vty.c @@ -185,6 +185,9 @@ if (gctx->echo_interval != -1) vty_out(vty, " ggsn %u echo-interval %"PRId32"%s", gctx->id, gctx->echo_interval, VTY_NEWLINE); + else + vty_out(vty, " ggsn %u no echo-interval%s", + gctx->id, VTY_NEWLINE); } if (sgsn->cfg.dynamic_lookup) @@ -380,6 +383,19 @@ return CMD_SUCCESS; } +DEFUN(cfg_ggsn_no_echo_interval, cfg_ggsn_no_echo_interval_cmd, + "ggsn <0-255> no echo-interval", + GGSN_STR "GGSN Number\n" + NO_STR "Send an echo request to this static GGSN every interval.\n") +{ + uint32_t id = atoi(argv[0]); + struct sgsn_ggsn_ctx *ggc = sgsn_ggsn_ctx_find_alloc(id); + + ggc->echo_interval = -1; + + return CMD_SUCCESS; +} + DEFUN(cfg_ggsn_dynamic_lookup, cfg_ggsn_dynamic_lookup_cmd, "ggsn dynamic", GGSN_STR @@ -1302,6 +1318,7 @@ //install_element(SGSN_NODE, &cfg_ggsn_remote_port_cmd); install_element(SGSN_NODE, &cfg_ggsn_gtp_version_cmd); install_element(SGSN_NODE, &cfg_ggsn_echo_interval_cmd); + install_element(SGSN_NODE, &cfg_ggsn_no_echo_interval_cmd); install_element(SGSN_NODE, &cfg_imsi_acl_cmd); install_element(SGSN_NODE, &cfg_auth_policy_cmd); install_element(SGSN_NODE, &cfg_encrypt_cmd); -- To view, visit https://gerrit.osmocom.org/9948 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I0598427257533ce8ae9e9afa787293d7c98fed15 Gerrit-Change-Number: 9948 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 10 16:44:29 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 10 Jul 2018 16:44:29 +0000 Subject: Change in osmo-ttcn3-hacks[master]: lib: GTP_Emulation: Allow receiving packets with TEID 0 Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9949 Change subject: lib: GTP_Emulation: Allow receiving packets with TEID 0 ...................................................................... lib: GTP_Emulation: Allow receiving packets with TEID 0 Some GTP messages like Echo Request, Echo Reply and Ind Error don't use the TEID value. According to 3GPP TS 29.060 sec 9.3.1 in those cases the TEID is set to 0: """ - TEID: Contains the Tunnel Endpoint Identifier for the tunnel to which this T-PDU belongs. The TEID shall be used by the receiving entity to find the PDP context, except for the following cases: - The Echo Request/Response and Supported Extension Headers notification messages, where the Tunnel Endpoint Identifier shall be set to all zeroes. - The Error Indication message where the Tunnel Endpoint Identifier shall be set to all zeros. """ Change-Id: Ic702b78028e850ed961ef805f35e10a42da34e56 --- M library/GTP_Emulation.ttcn 1 file changed, 11 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/49/9949/1 diff --git a/library/GTP_Emulation.ttcn b/library/GTP_Emulation.ttcn index 534fdef..615309a 100644 --- a/library/GTP_Emulation.ttcn +++ b/library/GTP_Emulation.ttcn @@ -185,10 +185,19 @@ var template hexstring imsi_t := f_gtpc_extract_imsi(g1c_ud.gtpc); if (isvalue(imsi_t)) { vc_conn := f_comp_by_imsi(valueof(imsi_t)); - } else { + CLIENT.send(g1c_ud) to vc_conn; + } else if(g1c_ud.gtpc.teid != int2oct(0, 4)) { vc_conn := f_comp_by_teid(g1c_ud.gtpc.teid); + CLIENT.send(g1c_ud) to vc_conn; + } else { + /* Send to all clients */ + var integer i; + for (i := 0; i < sizeof(TidTable); i := i+1) { + if (isbound(TidTable[i].teid) and TidTable[i].teid == teid) { + CLIENT.send(g1c_ud) to TidTable[i].vc_conn; + } + } } - CLIENT.send(g1c_ud) to vc_conn; } [] GTPU.receive(Gtp1uUnitdata:?) -> value g1u_ud { vc_conn := f_comp_by_teid(g1u_ud.gtpu.teid); -- To view, visit https://gerrit.osmocom.org/9949 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ic702b78028e850ed961ef805f35e10a42da34e56 Gerrit-Change-Number: 9949 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 10 16:44:31 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 10 Jul 2018 16:44:31 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: Add test to verify restart_ctr during echo req/reply. Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9950 Change subject: sgsn: Add test to verify restart_ctr during echo req/reply. ...................................................................... sgsn: Add test to verify restart_ctr during echo req/reply. Currently test doesn't fully work because it doesn't match the PDP CTX DEL REQ correctly. Change-Id: I1dcb250dba2079c14b857c0b89a02ac21d1c591f --- M sgsn/SGSN_Tests.ttcn 1 file changed, 59 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/50/9950/1 diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 017c724..8c3d8de 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -64,6 +64,7 @@ port TELNETasp_PT SGSNVTY; var boolean g_initialized := false; + var boolean g_use_echo := false; }; type component BSSGP_ConnHdlr extends BSSGP_Client_CT, GSUP_ConnHdlr, GTP_ConnHdlr { @@ -160,6 +161,14 @@ f_vty_config(SGSNVTY, "sgsn", "auth-policy remote"); } +private function f_vty_enable_echo_interval(boolean enable) runs on test_CT { + if (enable) { + f_vty_config(SGSNVTY, "sgsn", "ggsn 0 echo-interval 5"); + } else { + f_vty_config(SGSNVTY, "sgsn", "ggsn 0 no echo-interval"); + } +} + function f_init(BcdMccMnc mcc_mnc := '26242F'H) runs on test_CT { if (g_initialized == true) { @@ -184,6 +193,7 @@ f_init_gsup("SGSN_Test"); f_init_gtp("SGSN_Test"); f_init_vty(); + f_vty_enable_echo_interval(g_use_echo); } type function void_fn(charstring id) runs on BSSGP_ConnHdlr; @@ -874,6 +884,7 @@ OCT4 ggsn_tei_u, /* GGSN TEI User */ octetstring ggsn_ip_c, /* GGSN IP Control */ octetstring ggsn_ip_u, /* GGSN IP User */ + OCT1 ggsn_restart_ctr, /* GGSN Restart Counter */ OCT4 sgsn_tei_c optional, /* SGSN TEI Control */ OCT4 sgsn_tei_u optional, /* SGSN TEI User */ @@ -1025,6 +1036,7 @@ ggsn_tei_u := f_rnd_octstring(4), ggsn_ip_c := f_inet_addr(ggsn_ip), ggsn_ip_u := f_inet_addr(ggsn_ip), + ggsn_restart_ctr := int2oct(2, 1), sgsn_tei_c := omit, sgsn_tei_u := omit, @@ -1251,6 +1263,52 @@ vc_conn.done; } +private function f_TC_attach_restart_ctr_dettach(charstring id) runs on BSSGP_ConnHdlr { + var Gtp1cUnitdata g_ud; + var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip)); + + /* first perform regular attach */ + f_TC_attach(id); + /* Activate a pdp context against the GGSN */ + f_pdp_ctx_act(apars); + /* Wait to receive first echo request and send initial Restart counter */ + log("PESPIN: before 1st GTAP receive"); + GTP.receive(tr_GTPC_MsgType(?, echoRequest, ?)) -> value g_ud { + log("PESPIN: inside 1st GTAP receive"); + var integer seq_nr := oct2int(g_ud.gtpc.opt_part.sequenceNumber); + GTP.send(ts_GTPC_PONG(g_ud.peer, seq_nr, apars.ggsn_restart_ctr)); + } + log("PESPIN: after 1st GTAP receive"); + /* Wait to receive second echo request and send incremented Restart + counter. This will fake a restarted GGSN, and pdp ctx allocated + should be released by SGSN */ + apars.ggsn_restart_ctr := int2oct(oct2int(apars.ggsn_restart_ctr) + 1, 1); + GTP.receive(tr_GTPC_MsgType(?, echoRequest, ?)) -> value g_ud { + log("PESPIN: inside 2nd GTAP receive"); + var integer seq_nr := oct2int(g_ud.gtpc.opt_part.sequenceNumber); + GTP.send(ts_GTPC_PONG(g_ud.peer, seq_nr, apars.ggsn_restart_ctr)); + } + log("PESPIN: waiting for PDP DEACT on tid ", apars.tid); + var OCT1 cause_network_failure := int2oct(38, 1) + alt { + [] BSSGP.receive(tr_BD_L3_MT(tr_SM_DEACT_PDP_REQ_MT(apars.tid, ?))) { + log("PESPIN: received PDP DEACT"); + BSSGP.send(ts_SM_DEACT_PDP_ACCEPT_MO(apars.tid)); + setverdict(pass); + } + [] as_xid(apars); + } + log("PESPIN: DONE SUCCESS"); +} +testcase TC_attach_restart_ctr_dettach() runs on test_CT { + var BSSGP_ConnHdlr vc_conn; + g_use_echo := true + f_init(); + vc_conn := f_start_handler(refers(f_TC_attach_restart_ctr_dettach), testcasename(), g_gb[0], 17, 30.0); + vc_conn.done; + g_use_echo := false +} + private function f_TC_hlr_location_cancel_request_update(charstring id) runs on BSSGP_ConnHdlr { /* MS: perform regular attach */ f_TC_attach(id); @@ -1625,6 +1683,7 @@ execute( TC_attach_pdp_act_user_deact_mo() ); execute( TC_attach_pdp_act_user_deact_mt() ); execute( TC_attach_second_attempt() ); + execute( TC_attach_restart_ctr_dettach() ); } -- To view, visit https://gerrit.osmocom.org/9950 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I1dcb250dba2079c14b857c0b89a02ac21d1c591f Gerrit-Change-Number: 9950 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 00:36:04 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Jul 2018 00:36:04 +0000 Subject: Change in libosmo-sccp[master]: fix memleak in ipa_rx_msg_sccp Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/9951 Change subject: fix memleak in ipa_rx_msg_sccp ...................................................................... fix memleak in ipa_rx_msg_sccp After m3ua_xfer_from_data() has copied the msgb data, we need to free the msgb. Change-Id: I2263751c0aa3ae32455847c7622af8be0a1e7802 --- M src/ipa.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/51/9951/1 diff --git a/src/ipa.c b/src/ipa.c index 0e6f683..e15b1d8 100644 --- a/src/ipa.c +++ b/src/ipa.c @@ -258,6 +258,7 @@ data_hdr.dpc = osmo_htonl(dpc); /* Create M3UA message in XUA structure */ xua = m3ua_xfer_from_data(&data_hdr, msgb_l2(msg), msgb_l2len(msg)); + msgb_free(msg); /* Update xua->mtp with values from data_hdr */ m3ua_dh_to_xfer_param(&xua->mtp, &data_hdr); -- To view, visit https://gerrit.osmocom.org/9951 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I2263751c0aa3ae32455847c7622af8be0a1e7802 Gerrit-Change-Number: 9951 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 00:36:05 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Jul 2018 00:36:05 +0000 Subject: Change in libosmo-sccp[master]: cosmetic: sccp2sua.c: log the IEI for parsed SCCP addr Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/9952 Change subject: cosmetic: sccp2sua.c: log the IEI for parsed SCCP addr ...................................................................... cosmetic: sccp2sua.c: log the IEI for parsed SCCP addr Before this, the log looked like it parsed the same address twice with differing results: DLSUA DEBUG sccp2sua.c:333 Parsed Addr: RI=2,PC=1196,SSN=254 DLSUA DEBUG sccp2sua.c:333 Parsed Addr: RI=2,PC=100,SSN=254 Adding the IEI clarifies this: DLSUA DEBUG sccp2sua.c:333 IEI 259: Parsed Addr: RI=2,PC=1196,SSN=254 DLSUA DEBUG sccp2sua.c:333 IEI 258: Parsed Addr: RI=2,PC=100,SSN=254 (I'd have liked to print the IEI name from sua_iei_names, but I frankly can't figure out how to reach that value_string array "hidden" behind a xua_msg_class struct, and neither can I find any other code doing so.) Change-Id: I64adb31129684b2eb66fff581040017ce2f6d163 --- M src/sccp2sua.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/52/9952/1 diff --git a/src/sccp2sua.c b/src/sccp2sua.c index afc38c7..2f5b687 100644 --- a/src/sccp2sua.c +++ b/src/sccp2sua.c @@ -330,7 +330,7 @@ if (rc < 0) return rc; - LOGP(DLSUA, LOGL_DEBUG, "Parsed Addr: %s\n", osmo_sccp_addr_dump(&osa)); + LOGP(DLSUA, LOGL_DEBUG, "IEI %u: Parsed Addr: %s\n", iei, osmo_sccp_addr_dump(&osa)); /* Then re-encode it as SUA address */ return xua_msg_add_sccp_addr(xua, iei, &osa); -- To view, visit https://gerrit.osmocom.org/9952 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I64adb31129684b2eb66fff581040017ce2f6d163 Gerrit-Change-Number: 9952 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 02:25:32 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Jul 2018 02:25:32 +0000 Subject: Change in libosmo-sccp[master]: add osmo_xua_msg_tall_ctx_init() Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/9953 Change subject: add osmo_xua_msg_tall_ctx_init() ...................................................................... add osmo_xua_msg_tall_ctx_init() So far the tall_xua ctx used to allocate from in xua_msg_alloc() was never initialized, actually hiding memory leaks from the talloc report. Add this API to allow branching the xua_msg ctx off a sane root ctx. Explicitly initialize tall_xua to NULL, so that, if xua_msg_ctx_init() isn't called, tall_xua is still guaranteed to not be a random pointer. The convention should actually be that only libosmocore exposes API with the osmo_ prefix, but libosmo-sigtran explicitly exposes only symbols starting with osmo_, forcing me to use this prefix. osmo-bsc will use this function to hook the tall_xua ctx to osmo-bsc's own root ctx. Change-Id: I618878680a096a7f7fc2d83098590f2e4cb08870 --- M include/osmocom/sigtran/xua_msg.h M src/xua_msg.c 2 files changed, 9 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/53/9953/1 diff --git a/include/osmocom/sigtran/xua_msg.h b/include/osmocom/sigtran/xua_msg.h index 423adbc..e912e02 100644 --- a/include/osmocom/sigtran/xua_msg.h +++ b/include/osmocom/sigtran/xua_msg.h @@ -69,6 +69,8 @@ extern const struct xua_dialect xua_dialect_sua; extern const struct xua_dialect xua_dialect_m3ua; +void osmo_xua_msg_tall_ctx_init(void *ctx); + struct xua_msg *xua_msg_alloc(void); void xua_msg_free(struct xua_msg *msg); diff --git a/src/xua_msg.c b/src/xua_msg.c index d56009f..ed0cdc7 100644 --- a/src/xua_msg.c +++ b/src/xua_msg.c @@ -33,7 +33,13 @@ #include #include -static void *tall_xua; +static void *tall_xua = NULL; + +/* Allocate the root talloc context used for xua_msg_alloc(). */ +void osmo_xua_msg_tall_ctx_init(void *ctx) +{ + tall_xua = talloc_named_const(ctx, 0, "xua_msg"); +} struct xua_msg *xua_msg_alloc(void) { -- To view, visit https://gerrit.osmocom.org/9953 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I618878680a096a7f7fc2d83098590f2e4cb08870 Gerrit-Change-Number: 9953 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 02:29:26 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Jul 2018 02:29:26 +0000 Subject: Change in osmo-bsc[master]: cosmetic: name osmo-bsc's root ctx 'osmo-bsc', not 'openbsc' Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/9954 Change subject: cosmetic: name osmo-bsc's root ctx 'osmo-bsc', not 'openbsc' ...................................................................... cosmetic: name osmo-bsc's root ctx 'osmo-bsc', not 'openbsc' Change-Id: Ie038bbed436069e7849ba78c3c77c80a68bc3dad --- M src/osmo-bsc/osmo_bsc_main.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/54/9954/1 diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index 9ee5147..622070b 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -772,7 +772,7 @@ struct osmo_bsc_data *data; int rc; - tall_bsc_ctx = talloc_named_const(NULL, 1, "openbsc"); + tall_bsc_ctx = talloc_named_const(NULL, 1, "osmo-bsc"); msgb_talloc_ctx_init(tall_bsc_ctx, 0); vty_info.tall_ctx = tall_bsc_ctx; -- To view, visit https://gerrit.osmocom.org/9954 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ie038bbed436069e7849ba78c3c77c80a68bc3dad Gerrit-Change-Number: 9954 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 02:29:27 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Jul 2018 02:29:27 +0000 Subject: Change in osmo-bsc[master]: call osmo_xua_msg_tall_ctx_init() Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/9955 Change subject: call osmo_xua_msg_tall_ctx_init() ...................................................................... call osmo_xua_msg_tall_ctx_init() xua_msg allocations should not go unnoticed by our root ctx. libosmo-sigtran recently added this API to fix that. Depends: I618878680a096a7f7fc2d83098590f2e4cb08870 (libosmo-sccp) Change-Id: I8d5edda17be82e0cb4a1af3e2a62cbcb3a2ddda3 --- M src/osmo-bsc/osmo_bsc_main.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/55/9955/1 diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index 622070b..65e82f5 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -56,6 +56,8 @@ #include +#include + #define _GNU_SOURCE #include @@ -774,6 +776,7 @@ tall_bsc_ctx = talloc_named_const(NULL, 1, "osmo-bsc"); msgb_talloc_ctx_init(tall_bsc_ctx, 0); + osmo_xua_msg_tall_ctx_init(tall_bsc_ctx); vty_info.tall_ctx = tall_bsc_ctx; tall_paging_ctx = talloc_named_const(tall_bsc_ctx, 0, "paging_request"); -- To view, visit https://gerrit.osmocom.org/9955 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I8d5edda17be82e0cb4a1af3e2a62cbcb3a2ddda3 Gerrit-Change-Number: 9955 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 03:20:05 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Jul 2018 03:20:05 +0000 Subject: Change in libosmo-sccp[master]: fix two memleaks in ipa_rx_msg_sccp() Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/9956 Change subject: fix two memleaks in ipa_rx_msg_sccp() ...................................................................... fix two memleaks in ipa_rx_msg_sccp() 1: Do not call xua_msg_alloc() which is later bluntly overwritten by m3ua_xfer_from_data(). 2: After dispatching to m3ua_hmdc_rx_from_l2(), call xua_msg_free(). Related: OS#3393 Change-Id: I0918f9bbc15b036619f1c25a133b69819b2a30fa --- M src/ipa.c 1 file changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/56/9956/1 diff --git a/src/ipa.c b/src/ipa.c index e15b1d8..f3a7a52 100644 --- a/src/ipa.c +++ b/src/ipa.c @@ -202,8 +202,9 @@ static int ipa_rx_msg_sccp(struct osmo_ss7_asp *asp, struct msgb *msg) { + int rc; struct m3ua_data_hdr data_hdr; - struct xua_msg *xua = xua_msg_alloc(); + struct xua_msg *xua; struct osmo_ss7_as *as = find_as_for_asp(asp); uint32_t opc, dpc; @@ -263,7 +264,9 @@ m3ua_dh_to_xfer_param(&xua->mtp, &data_hdr); /* Pass on as if we had received it from an M3UA ASP */ - return m3ua_hmdc_rx_from_l2(asp->inst, xua); + rc = m3ua_hmdc_rx_from_l2(asp->inst, xua); + xua_msg_free(xua); + return rc; } /*! \brief process M3UA message received from socket -- To view, visit https://gerrit.osmocom.org/9956 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I0918f9bbc15b036619f1c25a133b69819b2a30fa Gerrit-Change-Number: 9956 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 03:20:05 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Jul 2018 03:20:05 +0000 Subject: Change in libosmo-sccp[master]: fix memleaks in mtp_user_prim_cb() Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/9957 Change subject: fix memleaks in mtp_user_prim_cb() ...................................................................... fix memleaks in mtp_user_prim_cb() After dispatching to scrc_rx_mtp_xfer_ind_xua(), free the xua_msg. Do not free the xua_msg in any of the code paths triggered within scrc_rx_mtp_xfer_ind_xua(), i.e. remove xua_msg_free() from: sccp_scoc_rx_from_scrc() +->sccp_scoc_rx_unass_local_ref() +->tx_coerr_from_xua() +->tx_relco_from_xua() Before this, some code paths would free the xua_msg, while most code paths would not, causing mem leaks. Change-Id: I72b3c6a6f57ba32d9ba191af33b4b236492174e0 --- M src/sccp_scoc.c M src/sccp_user.c 2 files changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/57/9957/1 diff --git a/src/sccp_scoc.c b/src/sccp_scoc.c index 3de986d..d7e1d08 100644 --- a/src/sccp_scoc.c +++ b/src/sccp_scoc.c @@ -1316,7 +1316,6 @@ /* sent to SCRC for transmission */ sccp_scrc_rx_scoc_conn_msg(inst, xua); - xua_msg_free(xua); } /* Generate a RELCO based in input arguments */ @@ -1354,7 +1353,6 @@ /* send to SCRC for transmission */ sccp_scrc_rx_scoc_conn_msg(inst, xua); - xua_msg_free(xua); } /* Generate a RLSD based in input arguments */ diff --git a/src/sccp_user.c b/src/sccp_user.c index 99ed96e..ab9cb64 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -174,6 +174,7 @@ xua->mtp = omp->u.transfer; /* hand this primitive into SCCP via the SCRC code */ rc = scrc_rx_mtp_xfer_ind_xua(inst, xua); + xua_msg_free(xua); break; default: LOGP(DLSCCP, LOGL_ERROR, "Unknown primitive %u:%u receivd\n", -- To view, visit https://gerrit.osmocom.org/9957 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I72b3c6a6f57ba32d9ba191af33b4b236492174e0 Gerrit-Change-Number: 9957 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 03:23:27 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Jul 2018 03:23:27 +0000 Subject: Change in libosmo-sccp[master]: fix memleak in m3ua_rx_xfer() Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/9958 Change subject: fix memleak in m3ua_rx_xfer() ...................................................................... fix memleak in m3ua_rx_xfer() Change-Id: I6211c8809eefeb94289c4c497553561b043ee619 --- M src/m3ua.c 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/58/9958/1 diff --git a/src/m3ua.c b/src/m3ua.c index f1fe3f1..06ccd6e 100644 --- a/src/m3ua.c +++ b/src/m3ua.c @@ -534,6 +534,7 @@ static int m3ua_rx_xfer(struct osmo_ss7_asp *asp, struct xua_msg *xua) { + int rc; uint32_t rctx = xua_msg_get_u32(xua, M3UA_IEI_ROUTE_CTX); struct m3ua_data_hdr *dh; struct osmo_ss7_as *as; @@ -583,7 +584,9 @@ * routing context on the outbound side */ xua_msg_free_tag(xua, M3UA_IEI_ROUTE_CTX); - return m3ua_hmdc_rx_from_l2(asp->inst, xua); + rc = m3ua_hmdc_rx_from_l2(asp->inst, xua); + xua_msg_free(xua); + return rc; } static int m3ua_rx_mgmt_err(struct osmo_ss7_asp *asp, struct xua_msg *xua) -- To view, visit https://gerrit.osmocom.org/9958 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I6211c8809eefeb94289c4c497553561b043ee619 Gerrit-Change-Number: 9958 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 03:24:53 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Jul 2018 03:24:53 +0000 Subject: Change in libosmo-sccp[master]: fix memleaks in mtp_user_prim_cb() In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9957 ) Change subject: fix memleaks in mtp_user_prim_cb() ...................................................................... Patch Set 1: NOTE: I AM NOT 100% SURE ABOUT THIS ONE. Please look closely whether I missed something; am not sure how to test for this. -- To view, visit https://gerrit.osmocom.org/9957 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I72b3c6a6f57ba32d9ba191af33b4b236492174e0 Gerrit-Change-Number: 9957 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Wed, 11 Jul 2018 03:24:53 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 03:25:05 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Jul 2018 03:25:05 +0000 Subject: Change in libosmo-sccp[master]: fix memleak in m3ua_rx_xfer() In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9958 ) Change subject: fix memleak in m3ua_rx_xfer() ...................................................................... Patch Set 1: NOTE: I AM NOT 100% SURE ABOUT THIS ONE. Please look closely whether I missed something; am not sure how to test for this. -- To view, visit https://gerrit.osmocom.org/9958 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6211c8809eefeb94289c4c497553561b043ee619 Gerrit-Change-Number: 9958 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Wed, 11 Jul 2018 03:25:05 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 08:57:49 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 11 Jul 2018 08:57:49 +0000 Subject: Change in libosmo-sccp[master]: fix memleak in ipa_rx_msg_sccp In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9951 ) Change subject: fix memleak in ipa_rx_msg_sccp ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/9951 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2263751c0aa3ae32455847c7622af8be0a1e7802 Gerrit-Change-Number: 9951 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 11 Jul 2018 08:57:49 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 09:03:30 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 11 Jul 2018 09:03:30 +0000 Subject: Change in libosmo-sccp[master]: sua: Export IEI value_string names Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9959 Change subject: sua: Export IEI value_string names ...................................................................... sua: Export IEI value_string names Change-Id: I0b34eaa2cb4109879324dc9ba6c7dacd53b1a28f --- M include/osmocom/sigtran/protocol/sua.h M src/sua.c 2 files changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/59/9959/1 diff --git a/include/osmocom/sigtran/protocol/sua.h b/include/osmocom/sigtran/protocol/sua.h index 70c16ba..592ad1c 100644 --- a/include/osmocom/sigtran/protocol/sua.h +++ b/include/osmocom/sigtran/protocol/sua.h @@ -158,3 +158,5 @@ #define SUA_ERR_NO_CONFGD_AS_FOR_ASP M3UA_ERR_NO_CONFGD_AS_FOR_ASP #define SUA_ERR_SUBSYS_STATUS_UNKN 0x1b #define SUA_ERR_INVAL_LOADSH_LEVEL 0x1c + +extern const struct value_string sua_iei_names[]; diff --git a/src/sua.c b/src/sua.c index 4835665..f9c6acd 100644 --- a/src/sua.c +++ b/src/sua.c @@ -77,7 +77,7 @@ * Protocol Definition (string tables, mandatory IE checking) ***********************************************************************/ -static const struct value_string sua_iei_names[] = { +const struct value_string sua_iei_names[] = { { SUA_IEI_ROUTE_CTX, "Routing Context" }, { SUA_IEI_CORR_ID, "Correlation Id" }, { SUA_IEI_REG_RESULT, "Registration Result" }, -- To view, visit https://gerrit.osmocom.org/9959 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I0b34eaa2cb4109879324dc9ba6c7dacd53b1a28f Gerrit-Change-Number: 9959 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 09:04:50 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 11 Jul 2018 09:04:50 +0000 Subject: Change in libosmo-sccp[master]: cosmetic: sccp2sua.c: log the IEI for parsed SCCP addr In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9952 ) Change subject: cosmetic: sccp2sua.c: log the IEI for parsed SCCP addr ...................................................................... Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/9952/1/src/sccp2sua.c File src/sccp2sua.c: https://gerrit.osmocom.org/#/c/9952/1/src/sccp2sua.c at 333 PS1, Line 333: LOGP(DLSUA, LOGL_DEBUG, "IEI %u: Parsed Addr: %s\n", iei, osmo_sccp_addr_dump(&osa)); You can give this a try: https://gerrit.osmocom.org/#/c/libosmo-sccp/+/9959 LOGP(DLSUA, LOGL_DEBUG, "IEI %s: Parsed Addr: %s\n", get_value_string(sua_iei_names, iei);, osmo_sccp_addr_dump(&osa)); -- To view, visit https://gerrit.osmocom.org/9952 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I64adb31129684b2eb66fff581040017ce2f6d163 Gerrit-Change-Number: 9952 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 11 Jul 2018 09:04:50 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 09:12:19 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 11 Jul 2018 09:12:19 +0000 Subject: Change in libosmo-sccp[master]: fix two memleaks in ipa_rx_msg_sccp() In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9956 ) Change subject: fix two memleaks in ipa_rx_msg_sccp() ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/9956/1/src/ipa.c File src/ipa.c: https://gerrit.osmocom.org/#/c/9956/1/src/ipa.c at 268 PS1, Line 268: xua_msg_free(xua); Shouldn't upper layers be owning and thus freeing the message? -- To view, visit https://gerrit.osmocom.org/9956 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0918f9bbc15b036619f1c25a133b69819b2a30fa Gerrit-Change-Number: 9956 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 11 Jul 2018 09:12:19 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 09:14:40 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 11 Jul 2018 09:14:40 +0000 Subject: Change in libosmo-sccp[master]: fix memleak in m3ua_rx_xfer() In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9958 ) Change subject: fix memleak in m3ua_rx_xfer() ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/9958/1/src/m3ua.c File src/m3ua.c: https://gerrit.osmocom.org/#/c/9958/1/src/m3ua.c at 588 PS1, Line 588: xua_msg_free(xua); Same here, why not freed by the next layer becoming the owner? which free/ownership policy do we usually follow? -- To view, visit https://gerrit.osmocom.org/9958 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6211c8809eefeb94289c4c497553561b043ee619 Gerrit-Change-Number: 9958 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 11 Jul 2018 09:14:40 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 09:15:45 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 11 Jul 2018 09:15:45 +0000 Subject: Change in osmo-bsc[master]: cosmetic: name osmo-bsc's root ctx 'osmo-bsc', not 'openbsc' In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9954 ) Change subject: cosmetic: name osmo-bsc's root ctx 'osmo-bsc', not 'openbsc' ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9954 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie038bbed436069e7849ba78c3c77c80a68bc3dad Gerrit-Change-Number: 9954 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 11 Jul 2018 09:15:45 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 09:16:15 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 11 Jul 2018 09:16:15 +0000 Subject: Change in osmo-bsc[master]: call osmo_xua_msg_tall_ctx_init() In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9955 ) Change subject: call osmo_xua_msg_tall_ctx_init() ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/9955 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8d5edda17be82e0cb4a1af3e2a62cbcb3a2ddda3 Gerrit-Change-Number: 9955 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 11 Jul 2018 09:16:15 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 09:16:32 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 11 Jul 2018 09:16:32 +0000 Subject: Change in libosmo-sccp[master]: add osmo_xua_msg_tall_ctx_init() In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9953 ) Change subject: add osmo_xua_msg_tall_ctx_init() ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/9953 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I618878680a096a7f7fc2d83098590f2e4cb08870 Gerrit-Change-Number: 9953 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 11 Jul 2018 09:16:32 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 12:05:40 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 11 Jul 2018 12:05:40 +0000 Subject: Change in python/osmo-python-tests[master]: Move twisted_ipa.py to osmopy lib Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9960 Change subject: Move twisted_ipa.py to osmopy lib ...................................................................... Move twisted_ipa.py to osmopy lib twisted_ipa is a module expected to be used by other python scripts, so move it to osmopy dir to be installed as a lib (in python path) so it can be later used. twisted_ipa has some features to use it standalone for testing purposes. This feature can still be used from new installation path. Change-Id: I33a0c4263297abd9e111bf43e6e9967c06474318 --- M osmopy/__init__.py R osmopy/twisted_ipa.py M scripts/soap.py M setup.py 4 files changed, 2 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests refs/changes/60/9960/1 diff --git a/osmopy/__init__.py b/osmopy/__init__.py index 4e818ed..2195498 100644 --- a/osmopy/__init__.py +++ b/osmopy/__init__.py @@ -1,4 +1,4 @@ #!/usr/bin/env python __version__ = '0.0.9' -__all__ = ['obscvty', 'osmoutil', 'osmo_ipa', 'osmo_interact'] +__all__ = ['obscvty', 'osmoutil', 'osmo_ipa', 'osmo_interact', 'twisted_ipa'] diff --git a/scripts/twisted_ipa.py b/osmopy/twisted_ipa.py similarity index 100% rename from scripts/twisted_ipa.py rename to osmopy/twisted_ipa.py diff --git a/scripts/soap.py b/scripts/soap.py index f1da8f2..dc06e1e 100755 --- a/scripts/soap.py +++ b/scripts/soap.py @@ -25,7 +25,7 @@ __version__ = "0.7.1" # bump this on every non-trivial change from twisted.internet import defer, reactor -from twisted_ipa import CTRL, IPAFactory, __version__ as twisted_ipa_version +from osmopy.twisted_ipa import CTRL, IPAFactory, __version__ as twisted_ipa_version from osmopy.osmo_ipa import Ctrl from treq import post, collect from suds.client import Client diff --git a/setup.py b/setup.py index a8fd6e9..1d785e7 100755 --- a/setup.py +++ b/setup.py @@ -30,7 +30,6 @@ "scripts/osmo_ctrl.py", "scripts/osmo_rate_ctr2csv.py", "scripts/soap.py", - "scripts/twisted_ipa.py", "scripts/osmo_interact_vty.py", "scripts/osmo_interact_ctrl.py", "scripts/osmo_verify_transcript_vty.py", -- To view, visit https://gerrit.osmocom.org/9960 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I33a0c4263297abd9e111bf43e6e9967c06474318 Gerrit-Change-Number: 9960 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Wed Jul 11 12:26:47 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Wed, 11 Jul 2018 12:26:47 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-gapk_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#17?= In-Reply-To: <143918282.138.1531225607656.JavaMail.jenkins@jenkins.osmocom.org> References: <143918282.138.1531225607656.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <569750565.147.1531312007491.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 127.14 KB...] checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether make supports nested variables... (cached) yes checking if gcc supports -fvisibility=hidden... yes checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking whether gcc understands -c and -o together... (cached) yes checking dependency style of gcc... (cached) gcc3 checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for LIBOSMOCORE... yes checking for LIBOSMOCODEC... yes checking for LIBALSA... yes checking for OPENCORE_AMRNB... yes checking gsm/gsm.h usability... yes checking gsm/gsm.h presence... yes checking for gsm/gsm.h... yes checking for gsm_create in -lgsm... yes checking for stdint.h... (cached) yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking for unistd.h... (cached) yes checking for inline... inline checking for int16_t... yes checking for int32_t... yes checking for uint16_t... yes checking for uint32_t... yes checking for uint64_t... yes checking for uint8_t... yes checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... yes checking for memset... yes checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating src/Makefile config.status: creating libgsmhr/Makefile config.status: creating include/Makefile config.status: creating include/gsmhr/Makefile config.status: creating libosmogapk.pc config.status: creating tests/atlocal config.status: creating tests/Makefile config.status: creating config.h config.status: executing depfiles commands config.status: executing libtool commands config.status: executing tests/atconfig commands make[1]: Entering directory ' make all-recursive make[2]: Entering directory ' Making all in include make[3]: Entering directory ' make[4]: Entering directory ' make[4]: Nothing to be done for 'all-am'. make[4]: Leaving directory ' make[3]: Leaving directory ' Making all in src make[3]: Entering directory ' CC procqueue.lo CC pq_format.lo CC pq_codec.lo CC pq_file.lo CC pq_alsa.lo CC pq_rtp.lo CC pq_ecu.lo CC ecu_fr.lo CC formats.lo CC fmt_ti.lo CC fmt_amr.lo CC fmt_gsm.lo CC fmt_hr_ref.lo CC fmt_racal.lo CC fmt_rawpcm.lo CC fmt_rtp_amr.lo CC fmt_rtp_efr.lo CC fmt_rtp_hr_etsi.lo CC fmt_rtp_hr_ietf.lo CC fmt_amr_opencore.lo CC codecs.lo CC codec_pcm.lo CC codec_hr.lo CC codec_fr.lo CC codec_efr.lo CC codec_amr.lo CC benchmark.lo CC common.lo CCLD libosmogapk.la CC app_osmo_gapk.o CCLD osmo-gapk make[3]: Leaving directory ' Making all in tests make[3]: Entering directory ' make[3]: Nothing to be done for 'all'. make[3]: Leaving directory ' make[3]: Entering directory ' make[3]: Nothing to be done for 'all-am'. make[3]: Leaving directory ' make[2]: Leaving directory ' make[1]: Leaving directory ' make[1]: Entering directory ' Making dvi in include make[2]: Entering directory ' make[3]: Entering directory ' make[3]: Nothing to be done for 'dvi-am'. make[3]: Leaving directory ' make[2]: Leaving directory ' Making dvi in src make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi'. make[2]: Leaving directory ' Making dvi in tests make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi'. make[2]: Leaving directory ' make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi-am'. make[2]: Leaving directory ' make[1]: Leaving directory ' make[1]: Entering directory ' Making check in include make[2]: Entering directory ' make[3]: Entering directory ' make[3]: Nothing to be done for 'check-am'. make[3]: Leaving directory ' make[2]: Leaving directory ' Making check in src make[2]: Entering directory ' make[2]: Nothing to be done for 'check'. make[2]: Leaving directory ' Making check in tests make[2]: Entering directory ' make procqueue/pq_test io/pq_file_test io/pq_rtp_test ecu/ecu_fr_test make[3]: Entering directory ' CC procqueue/pq_test.o CCLD procqueue/pq_test CC io/pq_file_test.o CCLD io/pq_file_test CC io/pq_rtp_test.o CCLD io/pq_rtp_test CC ecu/ecu_fr_test.o CCLD ecu/ecu_fr_test make[3]: Leaving directory ' make check-local make[3]: Entering directory ' /bin/bash '../../../tests/testsuite' ## ---------------------------- ## ## gapk 0.4.75-27bc test suite. ## ## ---------------------------- ## Regression tests. 1: procqueue ok 2: io/pq_file FAILED (testsuite.at:13) 3: io/pq_rtp ok 4: ecu/ecu_fr_test ok 5: conv/enc/amr_efr ok 6: conv/enc/gsm ok 7: conv/enc/racal_hr skipped (testsuite.at:58) 8: conv/enc/racal_fr ok 9: conv/enc/racal_efr ok 10: conv/enc/ti_hr skipped (testsuite.at:91) 11: conv/enc/ti_fr ok 12: conv/enc/ti_efr ok 13: conv/enc/rtp_efr ok 14: conv/enc/rtp_hr_etsi skipped (testsuite.at:135) 15: conv/enc/rtp_hr_ietf skipped (testsuite.at:146) 16: conv/dec/amr_efr ok 17: conv/dec/gsm ok 18: conv/dec/racal_hr skipped (testsuite.at:179) 19: conv/dec/racal_fr ok 20: conv/dec/racal_efr ok 21: conv/dec/ti_hr skipped (testsuite.at:212) 22: conv/dec/ti_fr ok 23: conv/dec/ti_efr ok 24: conv/dec/rtp_efr ok 25: conv/dec/rtp_hr_etsi skipped (testsuite.at:256) 26: conv/dec/rtp_hr_ietf skipped (testsuite.at:267) ## ------------- ## ## Test results. ## ## ------------- ## ERROR: 18 tests were run, 1 failed unexpectedly. 8 tests were skipped. ## -------------------------- ## ## testsuite.log was created. ## ## -------------------------- ## Please send `tests/testsuite.log' and all information you think might help: To: Subject: [gapk 0.4.75-27bc] testsuite: 2 failed You may investigate any problem if you feel able to do so, in which case the test suite provides a good starting point. Its output may be found below `tests/testsuite.dir'. Makefile:753: recipe for target 'check-local' failed make[3]: *** [check-local] Error 1 make[3]: Leaving directory ' Makefile:602: recipe for target 'check-am' failed make[2]: *** [check-am] Error 2 make[2]: Leaving directory ' Makefile:479: recipe for target 'check-recursive' failed make[1]: *** [check-recursive] Error 1 make[1]: Leaving directory ' Makefile:684: recipe for target 'distcheck' failed make: *** [distcheck] Error 1 + cat-testlogs.sh ======================== ./gapk-0.4.75-27bc/_build/sub/tests/testsuite.dir/02/testsuite.log # -*- compilation -*- 2. testsuite.at:10: testing io/pq_file ... ../../../tests/testsuite.at:13: $abs_top_builddir/tests/io/pq_file_test \ $abs_top_builddir/tests/io/io_sample.txt --- /dev/null 2018-03-27 19:17:06.212284948 +0000 +++ 2018-07-11 12:26:46.811075648 +0000 @@ -0,0 +1,2 @@ +pq_file_test: ../../../tests/io/pq_file_test.c:132: main: Assertion `sample_file != NULL' failed. +: line 29: 27493 Aborted $abs_top_builddir/tests/io/pq_file_test $abs_top_builddir/tests/io/io_sample.txt --- expout 2018-07-11 12:26:46.803075684 +0000 +++ 2018-07-11 12:26:46.803075684 +0000 @@ -1,12 +0,0 @@ -Processing sample file with blk_len=2: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=4: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=8: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=16: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=32: -8217c8fb7675a95008f9089d883gapk - -chunk null_context: depth=0 ../../../tests/testsuite.at:13: exit code was 134, expected 0 2. testsuite.at:10: 2. io/pq_file (testsuite.at:10): FAILED (testsuite.at:13) Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Wed Jul 11 13:47:12 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Jul 2018 13:47:12 +0000 Subject: Change in libosmocore[master]: vty: fix use-after-free and memleaks in is_cmd_ambiguous() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9939 to look at the new patch set (#2). Change subject: vty: fix use-after-free and memleaks in is_cmd_ambiguous() ...................................................................... vty: fix use-after-free and memleaks in is_cmd_ambiguous() vty_test: add test against ambiguous cmd causing use-after-free and memory leaks. Add this test along with the fix, because the new test triggers the memory use-after-free and leaks, causing build failures. Add cmd_deopt_with_ctx() to allow passing a specific talloc ctx. is_cmd_ambiguous(): keep all cmd_deopt() allocations until the function exits. Add a comment explaining why. Before this, if a command matched an optional "[arg]" with square brackets, we would keep it in local var 'matched', but we would free the string it points to at the end of that loop iteration; upon encountering another match, we would attempt to strcmp against the freed 'matched'. Instead of adding hard-to-read and -verify free/alloc dances to keep the 'matched' accurately freed/non-freed/..., just keep all cmd_deopt() string allocated until done. Needless to say that this should have been implemented on a lower level upon inventing optional args, but at least this is fixing a program crash. Related: OS#33903390 Change-Id: Ia71ba742108b5ff020997bfb612ad5eb30d04fcd --- M src/vty/command.c M tests/vty/vty_test.c M tests/vty/vty_test.ok 3 files changed, 124 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/39/9939/2 -- To view, visit https://gerrit.osmocom.org/9939 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia71ba742108b5ff020997bfb612ad5eb30d04fcd Gerrit-Change-Number: 9939 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 13:48:53 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Jul 2018 13:48:53 +0000 Subject: Change in libosmocore[master]: vty: fix use-after-free and memleaks in is_cmd_ambiguous() In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9939 ) Change subject: vty: fix use-after-free and memleaks in is_cmd_ambiguous() ...................................................................... Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/9939/1/src/vty/command.c File src/vty/command.c: https://gerrit.osmocom.org/#/c/9939/1/src/vty/command.c at 1322 PS1, Line 1322: enum match_type min, bool recur) > Agree. [?] I started out trying to free when needed, but hell, it is so stupidly confusing (especially with that 'matched' variable being set in different places, each needing a decision whether the pointer is a char* to free or not to free) that I decided: to have any degree of readable code, just talloc and then free all of it at the end. I think a talloc ctx is a lean little tool that fits the task pretty nicely. Refactor: how!? the design is so broken that there is no easy way to do it. We could always copy to 'matched', but we hardly ever have optional args and it feels dumb to copy all strings all the time (for string comparison!) just because of some rare corner case. The only other thing I can think of is to very early during string parsing get rid of those stupid square brackets and flip a flag that says 'optional'. But that would be a largeish refactoring of the vty code, and I'm having enough of large refactorings right now. I desperately need this/a fix to get on with the endless osmo-bsc inter-bsc HO, I really think this fix is good enough, and I frankly feel like bikeshed syndrome here: the large important patch has seen review only by laforge, while this easy bit here gets all sorts of tangents... :P (sheesh, have I really written 3 paragraphs on this now!?) -- To view, visit https://gerrit.osmocom.org/9939 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia71ba742108b5ff020997bfb612ad5eb30d04fcd Gerrit-Change-Number: 9939 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 11 Jul 2018 13:48:53 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 13:52:34 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Jul 2018 13:52:34 +0000 Subject: Change in libosmo-sccp[master]: cosmetic: sccp2sua.c: log the IEI for parsed SCCP addr In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9952 ) Change subject: cosmetic: sccp2sua.c: log the IEI for parsed SCCP addr ...................................................................... Patch Set 1: yes, sure, but it seems the intention of the API is to have IEI name definitions based on the xua_msg_type, so that the IEIs can differ based on the underlying transport layer. I'd love to use that, but all I get is a uint8_t msg_type from the xua_msg, and can't find API to get to the struct xua_msg_type from that. Publishing sua_iei_names bypasses the apparently carefully crafted API to avoid exactly that. (See where sua_iei_names gets used) -- To view, visit https://gerrit.osmocom.org/9952 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I64adb31129684b2eb66fff581040017ce2f6d163 Gerrit-Change-Number: 9952 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 11 Jul 2018 13:52:34 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 13:53:30 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Jul 2018 13:53:30 +0000 Subject: Change in libosmo-sccp[master]: sua: Export IEI value_string names In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9959 ) Change subject: sua: Export IEI value_string names ...................................................................... Patch Set 1: Code-Review-1 it seems the intention of the API is to have IEI name definitions based on the xua_msg_type, so that the IEIs can differ based on the underlying transport layer. Publishing sua_iei_names bypasses the apparently carefully crafted API to avoid exactly that. (See where sua_iei_names gets used) -- To view, visit https://gerrit.osmocom.org/9959 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0b34eaa2cb4109879324dc9ba6c7dacd53b1a28f Gerrit-Change-Number: 9959 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Wed, 11 Jul 2018 13:53:30 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 13:56:24 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Jul 2018 13:56:24 +0000 Subject: Change in osmo-bsc[master]: cosmetic: name osmo-bsc's root ctx 'osmo-bsc', not 'openbsc' In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/9954 ) Change subject: cosmetic: name osmo-bsc's root ctx 'osmo-bsc', not 'openbsc' ...................................................................... cosmetic: name osmo-bsc's root ctx 'osmo-bsc', not 'openbsc' Change-Id: Ie038bbed436069e7849ba78c3c77c80a68bc3dad --- M src/osmo-bsc/osmo_bsc_main.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index 9ee5147..622070b 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -772,7 +772,7 @@ struct osmo_bsc_data *data; int rc; - tall_bsc_ctx = talloc_named_const(NULL, 1, "openbsc"); + tall_bsc_ctx = talloc_named_const(NULL, 1, "osmo-bsc"); msgb_talloc_ctx_init(tall_bsc_ctx, 0); vty_info.tall_ctx = tall_bsc_ctx; -- To view, visit https://gerrit.osmocom.org/9954 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ie038bbed436069e7849ba78c3c77c80a68bc3dad Gerrit-Change-Number: 9954 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 13:56:34 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Jul 2018 13:56:34 +0000 Subject: Change in libosmocore[master]: vty/command.c: talloc from tall_vty_cmd_ctx, not NULL In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/9937 ) Change subject: vty/command.c: talloc from tall_vty_cmd_ctx, not NULL ...................................................................... vty/command.c: talloc from tall_vty_cmd_ctx, not NULL Change-Id: Iaa409b4f63557c8fb028bbb322b5e7253393c05c --- M src/vty/command.c 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Jenkins Builder: Verified Vadim Yanitskiy: Looks good to me, but someone else must approve Pau Espin Pedrol: Looks good to me, approved diff --git a/src/vty/command.c b/src/vty/command.c index 66cf6a8..689609c 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -514,7 +514,7 @@ } } - out = talloc_size(NULL, len + 1); + out = talloc_size(tall_vty_cmd_ctx, len + 1); if (!out) return NULL; @@ -574,7 +574,7 @@ } } - out = talloc_size(NULL, len + 1); + out = talloc_size(tall_vty_cmd_ctx, len + 1); if (!out) return NULL; @@ -1317,7 +1317,7 @@ return NULL; /* tmp will hold a string of len-2 chars, so 'len' size is fine */ - tmp = talloc_size(NULL, len); + tmp = talloc_size(tall_vty_cmd_ctx, len); memcpy(tmp, (str + 1), len - 2); tmp[len - 2] = '\0'; -- To view, visit https://gerrit.osmocom.org/9937 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iaa409b4f63557c8fb028bbb322b5e7253393c05c Gerrit-Change-Number: 9937 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 13:56:34 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Jul 2018 13:56:34 +0000 Subject: Change in libosmocore[master]: vty: cosmetic: cmd_deopt(): use talloc_strndup(), not memcpy() In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/9938 ) Change subject: vty: cosmetic: cmd_deopt(): use talloc_strndup(), not memcpy() ...................................................................... vty: cosmetic: cmd_deopt(): use talloc_strndup(), not memcpy() Change-Id: Ibf870ae02be706f802482f7cff6589a70cde8320 --- M src/vty/command.c 1 file changed, 1 insertion(+), 8 deletions(-) Approvals: Jenkins Builder: Verified Vadim Yanitskiy: Looks good to me, but someone else must approve Pau Espin Pedrol: Looks good to me, approved diff --git a/src/vty/command.c b/src/vty/command.c index 689609c..51dece3 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -1311,18 +1311,11 @@ * match check for "blah" */ size_t len = strlen(str); - char *tmp; if (len < 3) return NULL; - /* tmp will hold a string of len-2 chars, so 'len' size is fine */ - tmp = talloc_size(tall_vty_cmd_ctx, len); - - memcpy(tmp, (str + 1), len - 2); - tmp[len - 2] = '\0'; - - return tmp; + return talloc_strndup(tall_vty_cmd_ctx, str + 1, len - 2); } static enum match_type -- To view, visit https://gerrit.osmocom.org/9938 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ibf870ae02be706f802482f7cff6589a70cde8320 Gerrit-Change-Number: 9938 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 14:00:13 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Jul 2018 14:00:13 +0000 Subject: Change in libosmo-sccp[master]: fix two memleaks in ipa_rx_msg_sccp() In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9956 ) Change subject: fix two memleaks in ipa_rx_msg_sccp() ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/9956/1/src/ipa.c File src/ipa.c: https://gerrit.osmocom.org/#/c/9956/1/src/ipa.c at 268 PS1, Line 268: xua_msg_free(xua); > Shouldn't upper layers be owning and thus freeing the message? this is the uppermost layer: the xua_msg gets allocated in m3ua_xfer_from_data() above. (maybe you're mixing it up with the msgb? that also gets freed here, and is unrelated to the patch) -- To view, visit https://gerrit.osmocom.org/9956 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0918f9bbc15b036619f1c25a133b69819b2a30fa Gerrit-Change-Number: 9956 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 11 Jul 2018 14:00:13 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 14:01:34 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Jul 2018 14:01:34 +0000 Subject: Change in libosmo-sccp[master]: sccp vty: be fatal for addressbook entry errors In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/4723 ) Change subject: sccp vty: be fatal for addressbook entry errors ...................................................................... Patch Set 2: what the... -- To view, visit https://gerrit.osmocom.org/4723 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2f71b9c4dd30f919d2054da81283dd7035f44f60 Gerrit-Change-Number: 4723 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Wed, 11 Jul 2018 14:01:34 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 14:01:39 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Jul 2018 14:01:39 +0000 Subject: Change in libosmo-sccp[master]: sccp vty: be fatal for addressbook entry errors In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. ( https://gerrit.osmocom.org/4723 ) Change subject: sccp vty: be fatal for addressbook entry errors ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/4723 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: I2f71b9c4dd30f919d2054da81283dd7035f44f60 Gerrit-Change-Number: 4723 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 14:08:22 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 11 Jul 2018 14:08:22 +0000 Subject: Change in libosmocore[master]: vty: fix use-after-free and memleaks in is_cmd_ambiguous() In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9939 ) Change subject: vty: fix use-after-free and memleaks in is_cmd_ambiguous() ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/9939 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia71ba742108b5ff020997bfb612ad5eb30d04fcd Gerrit-Change-Number: 9939 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 11 Jul 2018 14:08:22 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 14:14:43 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 11 Jul 2018 14:14:43 +0000 Subject: Change in libosmo-sccp[master]: fix two memleaks in ipa_rx_msg_sccp() In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9956 ) Change subject: fix two memleaks in ipa_rx_msg_sccp() ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/9956 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0918f9bbc15b036619f1c25a133b69819b2a30fa Gerrit-Change-Number: 9956 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 11 Jul 2018 14:14:43 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 14:14:52 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 11 Jul 2018 14:14:52 +0000 Subject: Change in libosmo-sccp[master]: fix memleak in m3ua_rx_xfer() In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9958 ) Change subject: fix memleak in m3ua_rx_xfer() ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/9958 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6211c8809eefeb94289c4c497553561b043ee619 Gerrit-Change-Number: 9958 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 11 Jul 2018 14:14:52 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 14:41:21 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Jul 2018 14:41:21 +0000 Subject: Change in libosmo-sccp[master]: comment: explain xua_msg free in m3ua_rx_xfer() In-Reply-To: References: Message-ID: Hello Pau Espin Pedrol, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9958 to look at the new patch set (#2). Change subject: comment: explain xua_msg free in m3ua_rx_xfer() ...................................................................... comment: explain xua_msg free in m3ua_rx_xfer() Change-Id: I6211c8809eefeb94289c4c497553561b043ee619 --- M src/m3ua.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/58/9958/2 -- To view, visit https://gerrit.osmocom.org/9958 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6211c8809eefeb94289c4c497553561b043ee619 Gerrit-Change-Number: 9958 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 14:43:57 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Jul 2018 14:43:57 +0000 Subject: Change in libosmo-sccp[master]: comment: explain xua_msg free in m3ua_rx_xfer() In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9958 ) Change subject: comment: explain xua_msg free in m3ua_rx_xfer() ...................................................................... Patch Set 2: re free policy: with struct xua_msg, throughout the code, the function that creates the struct xua_msg also frees it. (with a few exceptions that seem erratic and are being fixed by these patches.) If the lower layers had to free the xua_msg, each and every error handling code path would need an explicit xua_msg_free(). The xua_msg is never enqueued anywhere, it merely exists to pass a message down a code path. -- To view, visit https://gerrit.osmocom.org/9958 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6211c8809eefeb94289c4c497553561b043ee619 Gerrit-Change-Number: 9958 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 11 Jul 2018 14:43:57 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 14:44:11 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 11 Jul 2018 14:44:11 +0000 Subject: Change in libosmo-sccp[master]: comment: explain xua_msg free in m3ua_rx_xfer() In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9958 ) Change subject: comment: explain xua_msg free in m3ua_rx_xfer() ...................................................................... Patch Set 2: And this particular patch was actually wrong. -- To view, visit https://gerrit.osmocom.org/9958 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6211c8809eefeb94289c4c497553561b043ee619 Gerrit-Change-Number: 9958 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 11 Jul 2018 14:44:11 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Wed Jul 11 15:10:06 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Wed, 11 Jul 2018 15:10:06 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-asn1c_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#181?= In-Reply-To: <1840759951.139.1531235406477.JavaMail.jenkins@jenkins.osmocom.org> References: <1840759951.139.1531235406477.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <118393673.148.1531321806512.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 3.67 KB...] + ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for style of include used by make... GNU checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking how to run the C++ preprocessor... g++ -E checking for g77... no checking for f77... no checking for xlf... no checking for frt... no checking for pgf77... no checking for cf77... no checking for fort77... no checking for fl32... no checking for af77... no checking for f90... no checking for xlf90... no checking for pgf90... no checking for pghpf... no checking for epcf90... no checking for gfortran... no checking for g95... no checking for f95... no checking for fort... no checking for xlf95... no checking for ifort... no checking for ifc... no checking for efc... no checking for pgf95... no checking for lf95... no checking for ftn... no checking whether we are using the GNU Fortran 77 compiler... no checking whether accepts -g... no checking the maximum length of command line arguments... 32768 checking command to parse /usr/bin/nm -B output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes configure: creating libtool appending configuration tag "CXX" to libtool checking for ld used by g++... /usr/bin/ld -m elf_x86_64 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC checking if g++ PIC flag -fPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate appending configuration tag "F77" to libtool checking for autoconf... /usr/bin/autoconf checking for autoheader... /usr/bin/autoheader checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking dependency style of gcc... (cached) gcc3 checking how to run the C preprocessor... gcc -E checking for a BSD-compatible install... /usr/bin/install -c checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking for bison... bison -y checking for flex... flex checking for yywrap in -lfl... yes checking lex output file root... lex.yy checking whether yytext is a pointer... yes checking for ar... /usr/bin/ar checking for ANSI C header files... (cached) yes checking sys/param.h usability... yes checking sys/param.h presence... yes checking for sys/param.h... yes checking whether byte ordering is bigendian... no checking for off_t... yes checking for size_t... yes checking whether struct tm is in sys/time.h or time.h... time.h checking for intmax_t... yes checking for library containing getopt... none required checking for strtoimax... yes checking for strtoll... yes checking for mergesort... no checking for mkstemps... yes configure: creating ./config.status config.status: creating skeletons/standard-modules/Makefile config.status: creating skeletons/tests/Makefile config.status: creating libasn1compiler/Makefile config.status: creating libasn1parser/Makefile config.status: creating libasn1print/Makefile config.status: creating asn1c/webcgi/Makefile config.status: creating asn1c/tests/Makefile config.status: creating libasn1fix/Makefile config.status: creating skeletons/Makefile config.status: creating examples/Makefile config.status: creating tests/Makefile config.status: creating asn1c/Makefile config.status: creating doc/Makefile config.status: creating asn1c.spec config.status: creating Makefile config.status: creating config.h config.status: executing depfiles commands + make -j 8 make all-recursive make[1]: Entering directory ' Making all in libasn1parser make[2]: Entering directory ' if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF ".deps/asn1parser.Tpo" -c -o asn1parser.lo asn1parser.c; \ then mv -f ".deps/asn1parser.Tpo" ".deps/asn1parser.Plo"; else rm -f ".deps/asn1parser.Tpo"; exit 1; fi bison -y -p asn1p_ -d asn1p_y.y if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF ".deps/asn1p_l.Tpo" -c -o asn1p_l.lo asn1p_l.c; \ then mv -f ".deps/asn1p_l.Tpo" ".deps/asn1p_l.Plo"; else rm -f ".deps/asn1p_l.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF ".deps/asn1p_module.Tpo" -c -o asn1p_module.lo asn1p_module.c; \ then mv -f ".deps/asn1p_module.Tpo" ".deps/asn1p_module.Plo"; else rm -f ".deps/asn1p_module.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF ".deps/asn1p_oid.Tpo" -c -o asn1p_oid.lo asn1p_oid.c; \ then mv -f ".deps/asn1p_oid.Tpo" ".deps/asn1p_oid.Plo"; else rm -f ".deps/asn1p_oid.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF ".deps/asn1p_value.Tpo" -c -o asn1p_value.lo asn1p_value.c; \ then mv -f ".deps/asn1p_value.Tpo" ".deps/asn1p_value.Plo"; else rm -f ".deps/asn1p_value.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF ".deps/asn1p_expr.Tpo" -c -o asn1p_expr.lo asn1p_expr.c; \ then mv -f ".deps/asn1p_expr.Tpo" ".deps/asn1p_expr.Plo"; else rm -f ".deps/asn1p_expr.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF ".deps/asn1p_xports.Tpo" -c -o asn1p_xports.lo asn1p_xports.c; \ then mv -f ".deps/asn1p_xports.Tpo" ".deps/asn1p_xports.Plo"; else rm -f ".deps/asn1p_xports.Tpo"; exit 1; fi asn1p_y.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] mkdir .libs gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -fPIC -DPIC -o .libs/asn1parser.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -fPIC -DPIC -o .libs/asn1p_xports.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -fPIC -DPIC -o .libs/asn1p_module.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -fPIC -DPIC -o .libs/asn1p_value.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -fPIC -DPIC -o .libs/asn1p_expr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -fPIC -DPIC -o .libs/asn1p_oid.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -fPIC -DPIC -o .libs/asn1p_l.o asn1p_l.c:3521:12: warning: 'input' defined but not used [-Wunused-function] static int input() ^~~~~ gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -o asn1p_module.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -o asn1p_xports.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -o asn1p_oid.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -o asn1parser.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -o asn1p_value.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF ".deps/asn1p_constr.Tpo" -c -o asn1p_constr.lo asn1p_constr.c; \ then mv -f ".deps/asn1p_constr.Tpo" ".deps/asn1p_constr.Plo"; else rm -f ".deps/asn1p_constr.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -o asn1p_expr.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF ".deps/asn1p_param.Tpo" -c -o asn1p_param.lo asn1p_param.c; \ then mv -f ".deps/asn1p_param.Tpo" ".deps/asn1p_param.Plo"; else rm -f ".deps/asn1p_param.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF ".deps/asn1p_class.Tpo" -c -o asn1p_class.lo asn1p_class.c; \ then mv -f ".deps/asn1p_class.Tpo" ".deps/asn1p_class.Plo"; else rm -f ".deps/asn1p_class.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF ".deps/asn1p_ref.Tpo" -c -o asn1p_ref.lo asn1p_ref.c; \ then mv -f ".deps/asn1p_ref.Tpo" ".deps/asn1p_ref.Plo"; else rm -f ".deps/asn1p_ref.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -fPIC -DPIC -o .libs/asn1p_constr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -fPIC -DPIC -o .libs/asn1p_param.o if test -f y.tab.h; then \ to=`echo "asn1p_y_H" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \ sed -e "/^#/!b" -e "s/Y_TAB_H/$to/g" -e "s|y\.tab\.h|asn1p_y.h|" \ y.tab.h >asn1p_y.ht; \ rm -f y.tab.h; \ if cmp -s asn1p_y.ht asn1p_y.h; then \ rm -f asn1p_y.ht ;\ else \ mv asn1p_y.ht asn1p_y.h; \ fi; \ fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -fPIC -DPIC -o .libs/asn1p_class.o if test -f y.output; then \ mv y.output asn1p_y.output; \ fi sed '/^#/ s|y\.tab\.c|asn1p_y.c|' y.tab.c >asn1p_y.ct && mv asn1p_y.ct asn1p_y.c rm -f y.tab.c if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF ".deps/asn1p_y.Tpo" -c -o asn1p_y.lo asn1p_y.c; \ then mv -f ".deps/asn1p_y.Tpo" ".deps/asn1p_y.Plo"; else rm -f ".deps/asn1p_y.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -fPIC -DPIC -o .libs/asn1p_ref.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -o asn1p_param.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -o asn1p_constr.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF .deps/asn1p_y.Tpo -c asn1p_y.c -fPIC -DPIC -o .libs/asn1p_y.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -o asn1p_class.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -o asn1p_ref.o >/dev/null 2>&1 asn1p_y.y: In function 'asn1p_parse': asn1p_y.y:357:13: error: 'param' undeclared (first use in this function) *(void **)param = $1; ^~~~~ asn1p_y.y:357:13: note: each undeclared identifier is reported only once for each function it appears in Makefile:299: recipe for target 'asn1p_y.lo' failed make[2]: *** [asn1p_y.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -o asn1p_l.o >/dev/null 2>&1 make[2]: Leaving directory ' Makefile:302: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory ' Makefile:212: recipe for target 'all' failed make: *** [all] Error 2 Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Wed Jul 11 15:59:24 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 11 Jul 2018 15:59:24 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_ConnectionHandler: split up as_media into separate altsteps Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/9961 Change subject: MSC_ConnectionHandler: split up as_media into separate altsteps ...................................................................... MSC_ConnectionHandler: split up as_media into separate altsteps as_media() tests both, IPACC/RSL media handling and MGCP media handling. These two domains are technically quite separate, which means we can split them up into two separate altsteps in order to increase readability of the code. - Split as_media() into as_Media_ipacc() and as_Media_mgw() Change-Id: I539e8ffdb9f99d5a8e730dd918df502614b9e84d Related: OS#3292 --- M bsc/MSC_ConnectionHandler.ttcn 1 file changed, 17 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/61/9961/1 diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index 1261a4d..f38a3e9 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -149,12 +149,10 @@ self.stop; } - -/* altstep for handling of IPA + MGCP media related commands. Can be activated by a given - * test case if it expects to see media related handling (i.e. voice calls */ -altstep as_Media() runs on MSC_ConnHdlr { +/* altstep for handling of IPACC media related commands. Activated by as_Media() to test + * RSL level media handling */ +altstep as_Media_ipacc() runs on MSC_ConnHdlr { var RSL_Message rsl; - var MgcpCommand mgcp_cmd; var RSL_IE_Body ie; var boolean b_unused; [not g_media.bts.ipa_crcx_seen] RSL.receive(tr_RSL_IPA_CRCX(g_chan_nr)) -> value rsl { @@ -243,6 +241,14 @@ repeat; } + +} + +/* altstep for handling of MGCP media related commands. Activated by as_Media() to test + * MGW level media handling */ +altstep as_Media_mgw() runs on MSC_ConnHdlr { + var MgcpCommand mgcp_cmd; + [] MGCP.receive(tr_CRCX) -> value mgcp_cmd { var SDP_Message sdp; var integer cid := f_get_free_mgcp_conn(); @@ -298,8 +304,12 @@ } } - - +/* Altsteps for handling of media related commands. Can be activated by a given + * test case if it expects to see media related handling (i.e. voice calls) */ +altstep as_Media() runs on MSC_ConnHdlr { + [] as_Media_ipacc(); + [] as_Media_mgw(); +} /* this component represents a single subscriber connection at the MSC. * There is a 1:1 mapping between SCCP connections and BSSAP_ConnHdlr components. -- To view, visit https://gerrit.osmocom.org/9961 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I539e8ffdb9f99d5a8e730dd918df502614b9e84d Gerrit-Change-Number: 9961 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 15:59:25 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 11 Jul 2018 15:59:25 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BSC_Tests: count MGCP operations in as_media Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/9962 Change subject: BSC_Tests: count MGCP operations in as_media ...................................................................... BSC_Tests: count MGCP operations in as_media as_media handles the MGCP interaction for most of the tests. However, it does not make sure if transactions are missing or if too many transactions are performed (e.g. if an SCCP-Lite tests still creates the connections pointing to the core network, even if they must not created by the BSC in this case). So lets make sure that the MGCP transactions are performed as expected by counting them. - Add counters to count CRCX and MDCX transactions - Check those counters after call establishment and handover Change-Id: Ib073b097a840ca3a8ee99c4ed41f59f574191d98 Related: OS#3292 --- M bsc/BSC_Tests.ttcn M bsc/MSC_ConnectionHandler.ttcn 2 files changed, 74 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/62/9962/1 diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 149d5b7..2897a0b 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -2122,10 +2122,19 @@ f_vty_handover(0, 0, g_chan_nr, 1); /* temporarily suspend DChan processing on BTS1 to avoid race with RSLEM_register */ f_rslem_suspend(RSL1_PROC); + + /* From the MGW perspective, a handover is is characterized by + * performing one MDCX operation with the MGW. So we expect to see + * one more MDCX during handover. */ + g_media.mgcp_conn[0].mdcx_seen_exp := g_media.mgcp_conn[0].crcx_seen_exp + 1; + alt { [] as_handover(hs); - /* FIXME: somehow determine that the hand-over has completed, by MGCP MDCX? */ } + + /* Check the amount of MGCP transactions is still consistant with the + * test expectation */ + f_check_mgcp_expectations() } testcase TC_ho_int() runs on test_CT { diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index f38a3e9..ba4d19d 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -58,7 +58,10 @@ /* State encapsulating one MGCP Connection */ type record MgcpConnState { - boolean crcx_seen, + integer crcx_seen, /* Counts how many CRCX operations happend */ + integer mdcx_seen, /* Counts how many MDCX operations happend C */ + integer crcx_seen_exp, /* Sets the expected number of CRCX operations */ + integer mdcx_seen_exp, /* Sets the expected number of MDCX operations */ MgcpConnectionId conn_id, charstring mime_type, /* e.g. AMR */ integer sample_rate, /* 8000 */ @@ -115,7 +118,10 @@ g_media.mgcp_conn[i].sample_rate := 8000; g_media.mgcp_conn[i].ptime := 20; g_media.mgcp_conn[i].rtp_pt := enum2int(f_get_mgcp_pt(codecType)); - g_media.mgcp_conn[i].crcx_seen := false; + g_media.mgcp_conn[i].crcx_seen := 0; + g_media.mgcp_conn[i].mdcx_seen := 0; + g_media.mgcp_conn[i].crcx_seen_exp := 0; + g_media.mgcp_conn[i].mdcx_seen_exp := 0; g_media.mgcp_conn[i].conn_id := f_mgcp_alloc_conn_id(); } @@ -129,9 +135,11 @@ } } +/* Helper function to get the next free MGCP connection identifier. We can + * recognize free connection identifiers by the fact that no CRCX happend yet */ private function f_get_free_mgcp_conn() runs on MSC_ConnHdlr return integer { for (var integer i:= 0; i < sizeof(g_media.mgcp_conn); i := i+1) { - if (not g_media.mgcp_conn[i].crcx_seen) { + if (not g_media.mgcp_conn[i].crcx_seen >= 1) { return i; } } @@ -139,9 +147,12 @@ self.stop; } +/* Helper function to pick a specific connection by its cid. Since we reach out + * for a connection that is in-use we also check if there was already exactly + * one CRCX happening on that connection. */ private function f_get_mgcp_conn(MgcpConnectionId cid) runs on MSC_ConnHdlr return integer { for (var integer i:= 0; i < sizeof(g_media.mgcp_conn); i := i+1) { - if (g_media.mgcp_conn[i].conn_id == cid and g_media.mgcp_conn[i].crcx_seen) { + if (g_media.mgcp_conn[i].conn_id == cid and g_media.mgcp_conn[i].crcx_seen == 1) { return i; } } @@ -278,7 +289,7 @@ mgcp_resp := ts_CRCX_ACK(mgcp_cmd.line.trans_id, mgcp_conn.conn_id, sdp); f_mgcp_par_append(mgcp_resp.params, ts_MgcpParSpecEP(g_media.mgcp_ep)); MGCP.send(mgcp_resp); - g_media.mgcp_conn[cid].crcx_seen := true; + g_media.mgcp_conn[cid].crcx_seen := g_media.mgcp_conn[cid].crcx_seen + 1; repeat; } [] MGCP.receive(tr_MDCX) -> value mgcp_cmd { @@ -299,7 +310,7 @@ int2str(mgcp_conn.sample_rate))), valueof(ts_SDP_ptime(mgcp_conn.ptime)) } )); MGCP.send(ts_MDCX_ACK(mgcp_cmd.line.trans_id, mgcp_conn.conn_id, sdp)); - //g_media.mgcp_mdcx_seen := true; + g_media.mgcp_conn[cid].mdcx_seen := g_media.mgcp_conn[cid].mdcx_seen + 1; repeat; } } @@ -781,11 +792,31 @@ } } +/* Helper function to check if the activity on the MGCP matches what we + * expected */ +function f_check_mgcp_expectations() runs on MSC_ConnHdlr { + for (var integer i:= 0; i < sizeof(g_media.mgcp_conn); i := i+1) { + if(g_media.mgcp_conn[i].crcx_seen != g_media.mgcp_conn[i].crcx_seen_exp) { + setverdict(fail, "unexpected number of MGW-CRCX transactions"); + } + if(g_media.mgcp_conn[i].mdcx_seen != g_media.mgcp_conn[i].mdcx_seen_exp) { + setverdict(fail, "unexpected number of MGW-MDCX transactions"); + } + } +} + /* establish a channel fully, expecting an assignment matching 'exp' */ function f_establish_fully(template (omit) PDU_BSSAP ass_tpl, template PDU_BSSAP exp_ass_cpl) runs on MSC_ConnHdlr { var BSSMAP_FIELD_CodecType codecType; + var boolean sccplite := false; + + /* Check if we run on SCCPLITE instead of SCCP by looking if a CIC is + * present or not. */ + if (isvalue(ass_tpl.pdu.bssmap.assignmentRequest.circuitIdentityCode)) { + sccplite := true; + } if (isvalue(ass_tpl.pdu.bssmap.assignmentRequest.codecList)) { codecType := valueof(ass_tpl.pdu.bssmap.assignmentRequest.codecList.codecElements[0].codecType); @@ -847,6 +878,31 @@ exp_modify := f_channel_needs_modify(ass_cmd.pdu.bssmap.assignmentRequest.channelType, g_chan_nr); } + /* Some test situations will involve MGCP transactions on a media + * gateway. Depending on the situation, we set up how many of each MGCP + * message type are expected to be exchanged. */ + if (isbound(exp_ass_cpl.pdu.bssmap.assignmentFailure)) { + /* For tests that expect the assignment to fail, assume that + * there will be no MGW communication as well. */ + g_media.mgcp_conn[0].crcx_seen_exp := 0; + g_media.mgcp_conn[0].mdcx_seen_exp := 0; + g_media.mgcp_conn[1].crcx_seen_exp := 0; + g_media.mgcp_conn[1].mdcx_seen_exp := 0; + } else if (st.voice_call) { + /* For voice calls we expect the following MGCP activity */ + if (sccplite) { + g_media.mgcp_conn[0].crcx_seen_exp := 1; + g_media.mgcp_conn[0].mdcx_seen_exp := 1; + g_media.mgcp_conn[1].crcx_seen_exp := 0; + g_media.mgcp_conn[1].mdcx_seen_exp := 0; + } else { + g_media.mgcp_conn[0].crcx_seen_exp := 1; + g_media.mgcp_conn[0].mdcx_seen_exp := 1; + g_media.mgcp_conn[1].crcx_seen_exp := 1; + g_media.mgcp_conn[1].mdcx_seen_exp := 0; + } + } + f_create_mgcp_expect(mgcpcrit); BSSAP.send(ass_cmd); @@ -890,6 +946,8 @@ if (not isbound(bssap)) { self.stop; } + + f_check_mgcp_expectations(); } type record HandoverState { -- To view, visit https://gerrit.osmocom.org/9962 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ib073b097a840ca3a8ee99c4ed41f59f574191d98 Gerrit-Change-Number: 9962 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 16:03:19 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 11 Jul 2018 16:03:19 +0000 Subject: Change in python/osmo-python-tests[master]: Introduce script ctrl2cgi.py Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9963 Change subject: Introduce script ctrl2cgi.py ...................................................................... Introduce script ctrl2cgi.py This scripts implements a similar proxy to the one already available in soapy.py, but aiming at converting CTRl into a regular HTTP POST Request to be handled by a CGI script in the HTTP server. Furthermore, it includes several improvements over the soapy.py script, such as using a token to authenticate users and capability to read some parameters from a cfg file. Change-Id: I7a83ecb379835e295c8cb4c27c39883783746544 --- M README A scripts/ctrl2cgi.py M setup.py 3 files changed, 249 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests refs/changes/63/9963/1 diff --git a/README b/README index 2c04047..37cd847 100644 --- a/README +++ b/README @@ -9,6 +9,7 @@ There are currently following scripts in this package: osmotestconfig.py - test that apps start/write with example configs soap.py - implementation of SOAP <-> Ctrl proxy implemented on top of Twisted +ctrl2cgi.py - implementation of CGI <-> Ctrl proxy implemented on top of Twisted osmo_rate_ctr2csv.py - rate counter dumper on top of osmo_ipa osmo_interact_vty.py - pipe stdin/stdout to a VTY session osmo_interact_ctrl.py - pipe stdin/stdout to a CTRL port diff --git a/scripts/ctrl2cgi.py b/scripts/ctrl2cgi.py new file mode 100755 index 0000000..20293af --- /dev/null +++ b/scripts/ctrl2cgi.py @@ -0,0 +1,247 @@ +#!/usr/bin/python3 +# -*- mode: python-mode; py-indent-tabs-mode: nil -*- +""" +/* + * Copyright (C) 2016 sysmocom s.f.m.c. GmbH + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +""" + +__version__ = "0.0.1" # bump this on every non-trivial change + +from twisted.internet import defer, reactor +from osmopy.twisted_ipa import CTRL, IPAFactory, __version__ as twisted_ipa_version +from osmopy.osmo_ipa import Ctrl +from treq import post, collect +from functools import partial +from distutils.version import StrictVersion as V # FIXME: use NormalizedVersion from PEP-386 when available +import argparse, datetime, signal, sys, os, logging, logging.handlers +import hashlib +import json +import configparser + +# we don't support older versions of TwistedIPA module +assert V(twisted_ipa_version) > V('0.4') + +# keys from OpenBSC openbsc/src/libbsc/bsc_rf_ctrl.c, values CGI-specific +oper = { 'inoperational' : 0, 'operational' : 1 } +admin = { 'locked' : 0, 'unlocked' : 1 } +policy = { 'off' : 0, 'on' : 1, 'grace' : 2, 'unknown' : 3 } + +# keys from OpenBSC openbsc/src/libbsc/bsc_vty.c +fix = { 'invalid' : 0, 'fix2d' : 1, 'fix3d' : 1 } # CGI server treats it as boolean but expects int + +def patch_cgi_resp(r): + str = r.decode('utf-8') + lines = str.splitlines() + i = 0 + #search for empty line, marks start of body + for l in lines: + i += 1 + if l == '': + break + print('i="%r"' % i) + json_lines = lines[i:] + json_str = '\n'.join(json_lines) + return json.loads(json_str) + + at defer.inlineCallbacks +def handle_reply(f, log, resp): + """ + Reply handler: process raw CGI server response, function f to run for each command + """ + #log.debug('HANDLE_REPLY: code=%r' % (resp.code)) + #for key,val in resp.headers.getAllRawHeaders(): + # log.debug('HANDLE_REPLY: key=%r val=%r' % (key, val)) + if resp.code != 200: + resp_body = yield resp.text() + log.critical('Received HTTP response %d: %s' % (resp.code, resp_body)) + return + + parsed = yield resp.json() + #log.debug("RESPONSE: %r" % (parsed)) + bsc_id = parsed.get('commands')[0].split()[0].split('.')[3] # we expect 1st command to have net.0.bsc.666.bts.2.trx.1 location prefix format + log.info("Received CGI response for BSC %s with %d commands, error status: %s" % (bsc_id, len(parsed.get('commands')), parsed.get('error'))) + log.debug("BSC %s commands: %r" % (bsc_id, parsed.get('commands'))) + for t in parsed.get('commands'): # Process commands format + (_, m) = Ctrl().cmd(*t.split()) + f(m) + +def gen_hash(params, skey): + input = '' + for key in ['time_stamp','position_validity','admin_status','policy_status']: + input += str(params.get(key)) + input += skey + for key in ['bsc_id','lat','lon','position_validity']: + input += str(params.get(key)) + m = hashlib.md5() + m.update(input.encode('utf-8')) + res = m.hexdigest() + #print('HASH: \nparams="%r"\ninput="%s" \nres="%s"' %(params, input, res)) + return res + +class Trap(CTRL): + """ + TRAP handler (agnostic to factory's client object) + """ + def ctrl_TRAP(self, data, op_id, v): + """ + Parse CTRL TRAP and dispatch to appropriate handler after normalization + """ + (l, r) = v.split() + loc = l.split('.') + t_type = loc[-1] + p = partial(lambda a, i: a[i] if len(a) > i else None, loc) # parse helper + method = getattr(self, 'handle_' + t_type.replace('-', ''), lambda: "Unhandled %s trap" % t_type) + method(p(1), p(3), p(5), p(7), r) # we expect net.0.bsc.666.bts.2.trx.1 format for trap prefix + + def ctrl_SET_REPLY(self, data, _, v): + """ + Debug log for replies to our commands + """ + self.factory.log.debug('SET REPLY %s' % v) + + def ctrl_ERROR(self, data, op_id, v): + """ + We want to know if smth went wrong + """ + self.factory.log.debug('CTRL ERROR [%s] %s' % (op_id, v)) + + def connectionMade(self): + """ + Logging wrapper, calling super() is necessary not to break reconnection logic + """ + self.factory.log.info("Connected to CTRL@%s:%d" % (self.factory.host, self.factory.port)) + super(CTRL, self).connectionMade() + + @defer.inlineCallbacks + def handle_locationstate(self, net, bsc, bts, trx, data): + """ + Handle location-state TRAP: parse trap content, build CGI Request and use treq's routines to post it while setting up async handlers + """ + (ts, fx, lat, lon, height, opr, adm, pol, mcc, mnc) = data.split(',') + tstamp = datetime.datetime.fromtimestamp(float(ts)).isoformat() + self.factory.log.debug('location-state@%s.%s.%s.%s (%s) [%s/%s] => %s' % (net, bsc, bts, trx, tstamp, mcc, mnc, data)) + params = {'bsc_id': bsc, 'lon': lon, 'lat': lat, 'position_validity': fix.get(fx, 0), 'time_stamp': tstamp, 'oper_status': oper.get(opr, 2), 'admin_status': admin.get(adm, 2), 'policy_status': policy.get(pol, 3) } + params['h'] = gen_hash(params, self.factory.secret_key) + d = post(self.factory.location, None, params=params) + d.addCallback(partial(handle_reply, self.transport.write, self.factory.log)) # treq's collect helper is handy to get all reply content at once using closure on ctx + d.addErrback(lambda e, bsc: self.factory.log.critical("HTTP POST error %s while trying to register BSC %s" % (e, bsc)), bsc) # handle HTTP errors + # Ensure that we run only limited number of requests in parallel: + yield self.factory.semaphore.acquire() + yield d # we end up here only if semaphore is available which means it's ok to fire the request without exceeding the limit + self.factory.semaphore.release() + + def handle_notificationrejectionv1(self, net, bsc, bts, trx, data): + """ + Handle notification-rejection-v1 TRAP: just an example to show how more message types can be handled + """ + self.factory.log.debug('notification-rejection-v1 at bsc-id %s => %s' % (bsc, data)) + + +class TrapFactory(IPAFactory): + """ + Store CGI information so TRAP handler can use it for requests + """ + location = None + log = None + semaphore = None + client = None + host = None + port = None + secret_key = None + def __init__(self, host, port, proto, semaphore, log, location, secret_key): + self.host = host # for logging only, + self.port = port # seems to be no way to get it from ReconnectingClientFactory + self.log = log + self.semaphore = semaphore + self.location = location + self.secret_key = secret_key + level = self.log.getEffectiveLevel() + self.log.setLevel(logging.WARNING) # we do not need excessive debug from lower levels + super(TrapFactory, self).__init__(proto, self.log) + self.log.setLevel(level) + self.log.debug("Using IPA %s, CGI server: %s" % (Ctrl.version, self.location)) + + +def reloader(path, script, log, dbg1, dbg2, signum, _): + """ + Signal handler: we have to use execl() because twisted's reactor is not restartable due to some bug in twisted implementation + """ + log.info("Received Signal %d - restarting..." % signum) + if signum == signal.SIGUSR1 and dbg1 not in sys.argv and dbg2 not in sys.argv: + sys.argv.append(dbg1) # enforce debug + if signum == signal.SIGUSR2 and (dbg1 in sys.argv or dbg2 in sys.argv): # disable debug + if dbg1 in sys.argv: + sys.argv.remove(dbg1) + if dbg2 in sys.argv: + sys.argv.remove(dbg2) + os.execl(path, script, *sys.argv[1:]) + + +if __name__ == '__main__': + p = argparse.ArgumentParser(description='Proxy between given GCI service and Osmocom CTRL protocol.') + p.add_argument('-v', '--version', action='version', version=("%(prog)s v" + __version__)) + p.add_argument('-a', '--addr-ctrl', default='localhost', help="Adress to use for CTRL interface, defaults to localhost") + p.add_argument('-p', '--port-ctrl', type=int, default=4250, help="Port to use for CTRL interface, defaults to 4250") + p.add_argument('-n', '--num-max-conn', type=int, default=5, help="Max number of concurrent HTTP requests to CGI server") + p.add_argument('-d', '--debug', action='store_true', help="Enable debug log") + p.add_argument('-o', '--output', action='store_true', help="Log to STDOUT in addition to SYSLOG") + p.add_argument('-l', '--location', help="Location URL of the CGI server") + p.add_argument('-s', '--secret-key', help="Secret key used to generate verification token") + p.add_argument('-c', '--config-file', help="Path Config file. Cmd line args override values in config file") + args = p.parse_args() + + log = logging.getLogger('CTRL2CGI') + if args.debug: + log.setLevel(logging.DEBUG) + else: + log.setLevel(logging.INFO) + log.addHandler(logging.handlers.SysLogHandler('/dev/log')) + if args.output: + log.addHandler(logging.StreamHandler(sys.stdout)) + + reboot = partial(reloader, os.path.abspath(__file__), os.path.basename(__file__), log, '-d', '--debug') # keep in sync with add_argument() call above + signal.signal(signal.SIGHUP, reboot) + signal.signal(signal.SIGQUIT, reboot) + signal.signal(signal.SIGUSR1, reboot) # restart and enabled debug output + signal.signal(signal.SIGUSR2, reboot) # restart and disable debug output + + location_cfgfile = None + secret_key_cfgfile = None + port_ctrl_cfgfile = None + addr_ctrl_cfgfile = None + num_max_conn_cfgfile = None + if args.config_file: + config = configparser.ConfigParser() + config.read(args.config_file) + if 'main' in config: + location_cfgfile = config['main'].get('location', None) + secret_key_cfgfile = config['main'].get('secret_key', None) + addr_ctrl_cfgfile = config['main'].get('addr_ctrl', None) + port_ctrl_cfgfile = config['main'].get('port_ctrl', None) + num_max_conn_cfgfile = config['main'].get('num_max_conn', None) + location = args.location if args.location is not None else location_cfgfile + secret_key = args.secret_key if args.secret_key is not None else secret_key_cfgfile + addr_ctrl = args.addr_ctrl if args.addr_ctrl is not None else addr_ctrl_cfgfile + port_ctrl = args.port_ctrl if args.port_ctrl is not None else port_ctrl_cfgfile + num_max_conn = args.num_max_conn if args.num_max_conn is not None else num_max_conn_cfgfile + + log.info("CGI proxy %s starting with PID %d ..." % (__version__, os.getpid())) + reactor.connectTCP(addr_ctrl, port_ctrl, TrapFactory(addr_ctrl, port_ctrl, Trap, defer.DeferredSemaphore(num_max_conn), log, location, secret_key)) + reactor.run() diff --git a/setup.py b/setup.py index 1d785e7..061e5df 100755 --- a/setup.py +++ b/setup.py @@ -30,6 +30,7 @@ "scripts/osmo_ctrl.py", "scripts/osmo_rate_ctr2csv.py", "scripts/soap.py", + "scripts/ctrl2cgi.py", "scripts/osmo_interact_vty.py", "scripts/osmo_interact_ctrl.py", "scripts/osmo_verify_transcript_vty.py", -- To view, visit https://gerrit.osmocom.org/9963 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I7a83ecb379835e295c8cb4c27c39883783746544 Gerrit-Change-Number: 9963 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Wed Jul 11 16:06:44 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Wed, 11 Jul 2018 16:06:44 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_mast?= =?UTF-8?Q?er-osmo-mgw_=C2=BB_--enable-mgcp-tr?= =?UTF-8?Q?anscoding,a2=3Ddefault,a3=3Ddefaul?= =?UTF-8?Q?t,osmocom-master-debian9_#1107?= Message-ID: <1040827793.149.1531325204289.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 20.84 KB...] CC logging.lo CC logging_syslog.lo CC logging_gsmtap.lo CC rate_ctr.lo CC gsmtap_util.lo CC crc16.lo CC panic.lo CC backtrace.lo CC conv.lo CC application.lo CC rbtree.lo CC strrb.lo CC loggingrb.lo CC crc8gen.lo CC crc16gen.lo CC crc32gen.lo CC crc64gen.lo CC macaddr.lo CC stat_item.lo CC stats.lo CC stats_statsd.lo CC prim.lo CC conv_acc.lo CC conv_acc_generic.lo CC sercomm.lo CC prbs.lo CC isdnhdlc.lo CC conv_acc_sse.lo CC conv_acc_sse_avx.lo CC plugin.lo CC msgfile.lo CC serial.lo CCLD libosmocore.la make[4]: Entering directory '/build/deps/libosmocore/src' make[4]: Nothing to be done for 'install-data-am'. /bin/mkdir -p '/build/deps/install/stow/libosmocore/lib' /bin/bash ../libtool --mode=install /usr/bin/install -c libosmocore.la '/build/deps/install/stow/libosmocore/lib' libtool: install: /usr/bin/install -c .libs/libosmocore.so.10.0.0 /build/deps/install/stow/libosmocore/lib/libosmocore.so.10.0.0 libtool: install: (cd /build/deps/install/stow/libosmocore/lib && { ln -s -f libosmocore.so.10.0.0 libosmocore.so.10 || { rm -f libosmocore.so.10 && ln -s libosmocore.so.10.0.0 libosmocore.so.10; }; }) libtool: install: (cd /build/deps/install/stow/libosmocore/lib && { ln -s -f libosmocore.so.10.0.0 libosmocore.so || { rm -f libosmocore.so && ln -s libosmocore.so.10.0.0 libosmocore.so; }; }) libtool: install: /usr/bin/install -c .libs/libosmocore.lai /build/deps/install/stow/libosmocore/lib/libosmocore.la libtool: finish: PATH="/usr/local/bin:/usr/bin:/bin:/usr/games:/home/osmocom-build/bin:/build_bin:/sbin" ldconfig -n /build/deps/install/stow/libosmocore/lib ---------------------------------------------------------------------- Libraries have been installed in: /build/deps/install/stow/libosmocore/lib If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the `-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the `LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the `LD_RUN_PATH' environment variable during linking - use the `-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to `/etc/ld.so.conf' See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- make[4]: Leaving directory '/build/deps/libosmocore/src' make[3]: Leaving directory '/build/deps/libosmocore/src' make[2]: Leaving directory '/build/deps/libosmocore/src' Making install in src/vty make[2]: Entering directory '/build/deps/libosmocore/src/vty' CC buffer.lo CC vty.lo CC command.lo CC vector.lo CC logging_vty.lo CC utils.lo CC telnet_interface.lo CC stats_vty.lo CC fsm_vty.lo CC talloc_ctx_vty.lo CCLD libosmovty.la make[3]: Entering directory '/build/deps/libosmocore/src/vty' make[3]: Nothing to be done for 'install-data-am'. /bin/mkdir -p '/build/deps/install/stow/libosmocore/lib' /bin/bash ../../libtool --mode=install /usr/bin/install -c libosmovty.la '/build/deps/install/stow/libosmocore/lib' libtool: install: warning: relinking `libosmovty.la' libtool: install: (cd /build/deps/libosmocore/src/vty; /bin/bash /build/deps/libosmocore/libtool --silent --tag CC --mode=relink gcc -Wall -g -O2 -DBUILDING_LIBOSMOCORE -Wall -version-info 4:1:0 -no-undefined -o libosmovty.la -rpath /build/deps/install/stow/libosmocore/lib buffer.lo command.lo vty.lo vector.lo utils.lo telnet_interface.lo logging_vty.lo stats_vty.lo fsm_vty.lo talloc_ctx_vty.lo ../../src/libosmocore.la -ltalloc ) libtool: install: /usr/bin/install -c .libs/libosmovty.so.4.0.1T /build/deps/install/stow/libosmocore/lib/libosmovty.so.4.0.1 libtool: install: (cd /build/deps/install/stow/libosmocore/lib && { ln -s -f libosmovty.so.4.0.1 libosmovty.so.4 || { rm -f libosmovty.so.4 && ln -s libosmovty.so.4.0.1 libosmovty.so.4; }; }) libtool: install: (cd /build/deps/install/stow/libosmocore/lib && { ln -s -f libosmovty.so.4.0.1 libosmovty.so || { rm -f libosmovty.so && ln -s libosmovty.so.4.0.1 libosmovty.so; }; }) libtool: install: /usr/bin/install -c .libs/libosmovty.lai /build/deps/install/stow/libosmocore/lib/libosmovty.la libtool: finish: PATH="/usr/local/bin:/usr/bin:/bin:/usr/games:/home/osmocom-build/bin:/build_bin:/sbin" ldconfig -n /build/deps/install/stow/libosmocore/lib ---------------------------------------------------------------------- Libraries have been installed in: /build/deps/install/stow/libosmocore/lib If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the `-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the `LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the `LD_RUN_PATH' environment variable during linking - use the `-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to `/etc/ld.so.conf' See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- make[3]: Leaving directory '/build/deps/libosmocore/src/vty' make[2]: Leaving directory '/build/deps/libosmocore/src/vty' Making install in src/codec make[2]: Entering directory '/build/deps/libosmocore/src/codec' CC gsm620.lo CC gsm610.lo CC gsm660.lo CC gsm690.lo CC ecu_fr.lo CCLD libosmocodec.la make[3]: Entering directory '/build/deps/libosmocore/src/codec' make[3]: Nothing to be done for 'install-data-am'. /bin/mkdir -p '/build/deps/install/stow/libosmocore/lib' /bin/bash ../../libtool --mode=install /usr/bin/install -c libosmocodec.la '/build/deps/install/stow/libosmocore/lib' libtool: install: warning: relinking `libosmocodec.la' libtool: install: (cd /build/deps/libosmocore/src/codec; /bin/bash /build/deps/libosmocore/libtool --silent --tag CC --mode=relink gcc -Wall -g -O2 -DBUILDING_LIBOSMOCORE -Wall -version-info 1:0:1 -no-undefined -o libosmocodec.la -rpath /build/deps/install/stow/libosmocore/lib gsm610.lo gsm620.lo gsm660.lo gsm690.lo ecu_fr.lo ../../src/libosmocore.la ) libtool: install: /usr/bin/install -c .libs/libosmocodec.so.0.1.0T /build/deps/install/stow/libosmocore/lib/libosmocodec.so.0.1.0 libtool: install: (cd /build/deps/install/stow/libosmocore/lib && { ln -s -f libosmocodec.so.0.1.0 libosmocodec.so.0 || { rm -f libosmocodec.so.0 && ln -s libosmocodec.so.0.1.0 libosmocodec.so.0; }; }) libtool: install: (cd /build/deps/install/stow/libosmocore/lib && { ln -s -f libosmocodec.so.0.1.0 libosmocodec.so || { rm -f libosmocodec.so && ln -s libosmocodec.so.0.1.0 libosmocodec.so; }; }) libtool: install: /usr/bin/install -c .libs/libosmocodec.lai /build/deps/install/stow/libosmocore/lib/libosmocodec.la libtool: finish: PATH="/usr/local/bin:/usr/bin:/bin:/usr/games:/home/osmocom-build/bin:/build_bin:/sbin" ldconfig -n /build/deps/install/stow/libosmocore/lib ---------------------------------------------------------------------- Libraries have been installed in: /build/deps/install/stow/libosmocore/lib If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the `-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the `LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the `LD_RUN_PATH' environment variable during linking - use the `-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to `/etc/ld.so.conf' See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- make[3]: Leaving directory '/build/deps/libosmocore/src/codec' make[2]: Leaving directory '/build/deps/libosmocore/src/codec' Making install in src/gsm make[2]: Entering directory '/build/deps/libosmocore/src/gsm' GEN gsm0503_conv.c Generating convolutional codes... Generate 'xcch' definition Generate 'rach' definition Generate 'rach_ext' definition Generate 'sch' definition Generate 'cs2' definition Generate 'cs3' definition Generate 'cs2_np' definition Generate 'cs3_np' definition Generate 'tch_afs_12_2' definition Generate 'tch_afs_10_2' definition Generate 'tch_afs_7_95' definition Generate 'tch_afs_7_4' definition Generate 'tch_afs_6_7' definition Generate 'tch_afs_5_9' definition Generate 'tch_afs_5_15' definition Generate 'tch_afs_4_75' definition Generate 'tch_fr' definition Generate 'tch_hr' definition Generate 'tch_ahs_7_95' definition Generate 'tch_ahs_7_4' definition Generate 'tch_ahs_6_7' definition Generate 'tch_ahs_5_9' definition Generate 'tch_ahs_5_15' definition Generate 'tch_ahs_4_75' definition Generate 'mcs1_dl_hdr' definition Generate 'mcs1_ul_hdr' definition Generate 'mcs1' definition Generate 'mcs2' definition Generate 'mcs3' definition Generate 'mcs4' definition Generate 'mcs5_dl_hdr' definition Generate 'mcs5_ul_hdr' definition Generate 'mcs5' definition Generate 'mcs6' definition Generate 'mcs7_dl_hdr' definition Generate 'mcs7_ul_hdr' definition Generate 'mcs7' definition Generate 'mcs8' definition Generate 'mcs9' definition Generation complete. make install-am make[3]: Entering directory '/build/deps/libosmocore/src/gsm' CC a5.lo CC rxlev_stat.lo CC tlv_parser.lo CC comp128.lo CC comp128v23.lo CC gsm_utils.lo CC rsl.lo CC gsm48.lo gsm_utils.c:112:9: note: #pragma message: including GnuTLS for getrandom fallback. #pragma message ("including GnuTLS for getrandom fallback.") ^ gsm_utils.c: In function 'osmo_get_rand_id': gsm_utils.c:456:9: note: #pragma message: Secure random failed: using GnuTLS fallback. #pragma message ("Secure random failed: using GnuTLS fallback.") ^ CC gsm48_ie.lo CC gsm0808.lo CC sysinfo.lo CC gprs_cipher_core.lo CC gprs_rlc.lo CC gsm0480.lo CC abis_nm.lo CC gsm0502.lo CC gsm0411_utils.lo CC gsm0411_smc.lo CC gsm0411_smr.lo CC gsm0414.lo CC lapd_core.lo CC lapdm.lo CC kasumi.lo CC gsm_04_08_gprs.lo CC auth_core.lo CC auth_comp128v1.lo CC auth_comp128v23.lo CC auth_milenage.lo CC gea.lo CC milenage/aes-internal.lo CC milenage/aes-internal-enc.lo CC milenage/milenage.lo CC ipa.lo CC gan.lo CC gsm0341.lo /bin/bash: line 2: 6154 Segmentation fault (core dumped) /bin/bash ../../libtool --silent --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../include -I/usr/include/p11-kit-1 -DBUILDING_LIBOSMOCORE -Wall -Wall -g -O2 -DBUILDING_LIBOSMOCORE -Wall -MT ipa.lo -MD -MP -MF $depbase.Tpo -c -o ipa.lo ipa.c make[3]: *** [ipa.lo] Error 139 make[3]: *** Waiting for unfinished jobs.... Makefile:568: recipe for target 'ipa.lo' failed make[3]: Leaving directory '/build/deps/libosmocore/src/gsm' Makefile:673: recipe for target 'install' failed make[2]: Leaving directory '/build/deps/libosmocore/src/gsm' make[2]: *** [install] Error 2 make[1]: *** [install-recursive] Error 1 Makefile:593: recipe for target 'install-recursive' failed make[1]: Leaving directory '/build/deps/libosmocore' Makefile:892: recipe for target 'install' failed make: *** [install] Error 2 Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Wed Jul 11 17:07:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 17:07:41 +0000 Subject: Change in python/osmo-python-tests[master]: Introduce script ctrl2cgi.py In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9963 ) Change subject: Introduce script ctrl2cgi.py ...................................................................... Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/9963/1/scripts/ctrl2cgi.py File scripts/ctrl2cgi.py: https://gerrit.osmocom.org/#/c/9963/1/scripts/ctrl2cgi.py at 5 PS1, Line 5: 2016 was this really written in 2016 (only)? -- To view, visit https://gerrit.osmocom.org/9963 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7a83ecb379835e295c8cb4c27c39883783746544 Gerrit-Change-Number: 9963 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 11 Jul 2018 17:07:41 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 18:22:42 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 11 Jul 2018 18:22:42 +0000 Subject: Change in simtrace2[master]: DFU: use central DFU override check In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9913 to look at the new patch set (#3). Change subject: DFU: use central DFU override check ...................................................................... DFU: use central DFU override check TRACE_INFO will also provide the DFU start reason, but TRACE_INFO (TRACE_LEVEL >= 4) should only be used for debugging. WARNING: With TRACE_LEVEL >= 4 the DFU binary is over the maximum of 16 kiB allocated for the DFU bootloader. Thus make combined will not boot the main application because its start if after the expecte 16 kiB address; and flashing using DFU will overwrite the DFU bootloader itself. Change-Id: I82323e0f76c03f67df7dc8f2b6783166cc25f3aa --- M firmware/apps/dfu/main.c M firmware/libboard/common/source/board_cstartup_gnu.c 2 files changed, 51 insertions(+), 28 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/13/9913/3 -- To view, visit https://gerrit.osmocom.org/9913 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I82323e0f76c03f67df7dc8f2b6783166cc25f3aa Gerrit-Change-Number: 9913 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 18:22:42 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 11 Jul 2018 18:22:42 +0000 Subject: Change in simtrace2[master]: replace leading spaces with tabs In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9918 to look at the new patch set (#3). Change subject: replace leading spaces with tabs ...................................................................... replace leading spaces with tabs Change-Id: I86783eba0827b58303b10310e9f6b9625e1a27f1 --- M firmware/apps/cardem/main.c M firmware/apps/trace/main.c M firmware/apps/triple_play/main.c M firmware/libboard/common/source/board_cstartup_gnu.c M firmware/libboard/common/source/board_lowlevel.c M firmware/libboard/common/source/led.c M firmware/libboard/common/source/uart_console.c M firmware/libcommon/include/assert.h M firmware/libcommon/include/cciddriver.h M firmware/libcommon/include/iso7816_4.h M firmware/libcommon/include/simtrace.h M firmware/libcommon/source/cciddriver.c M firmware/libcommon/source/iso7816_4.c M firmware/libcommon/source/mode_cardemu.c M firmware/libcommon/source/mode_ccid.c M firmware/libcommon/source/stdio.c M firmware/libcommon/source/string.c 17 files changed, 1,726 insertions(+), 1,726 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/18/9918/3 -- To view, visit https://gerrit.osmocom.org/9918 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I86783eba0827b58303b10310e9f6b9625e1a27f1 Gerrit-Change-Number: 9918 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 18:22:44 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 11 Jul 2018 18:22:44 +0000 Subject: Change in simtrace2[master]: make adc2uv common Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9964 Change subject: make adc2uv common ...................................................................... make adc2uv common when building the trace app for the simtrace board gcc was outputing the following error: libboard/common/source/boardver_adc.c:20:17: warning: 'adc2uv' defined but not used [-Wunused-function] static uint32_t adc2uv(uint16_t adc) adc2uv is used by qmod, and defined in two places: in boardver_adc.c and mode_cardemu.c. this change will have adc2uv only defined in boardver_adc.c and make available in the header to be used by mode_cardemu.c. Change-Id: I8a772638fa8dd02d8bc8b7631de5af5a22647c55 --- M firmware/libboard/common/include/boardver_adc.h M firmware/libboard/common/source/boardver_adc.c M firmware/libcommon/source/mode_cardemu.c 3 files changed, 3 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/64/9964/1 diff --git a/firmware/libboard/common/include/boardver_adc.h b/firmware/libboard/common/include/boardver_adc.h index 9b01d0a..956c302 100644 --- a/firmware/libboard/common/include/boardver_adc.h +++ b/firmware/libboard/common/include/boardver_adc.h @@ -15,3 +15,4 @@ #pragma once int get_board_version_adc(void); +uint32_t adc2uv(uint16_t adc); diff --git a/firmware/libboard/common/source/boardver_adc.c b/firmware/libboard/common/source/boardver_adc.c index f204aa1..51db929 100644 --- a/firmware/libboard/common/source/boardver_adc.c +++ b/firmware/libboard/common/source/boardver_adc.c @@ -15,9 +15,8 @@ #include "board.h" #include "boardver_adc.h" -/* FIXME: share this with mode_cardemu.c */ #define UV_PER_LSB ((3300 * 1000) / 4096) -static uint32_t adc2uv(uint16_t adc) +uint32_t adc2uv(uint16_t adc) { uint32_t uv = (uint32_t) adc * UV_PER_LSB; return uv; diff --git a/firmware/libcommon/source/mode_cardemu.c b/firmware/libcommon/source/mode_cardemu.c index c7362cf..b1d9c7a 100644 --- a/firmware/libcommon/source/mode_cardemu.c +++ b/firmware/libcommon/source/mode_cardemu.c @@ -17,6 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA */ #include "board.h" +#include "boardver_adc.h" #include "simtrace.h" #include "ringbuffer.h" #include "card_emu.h" @@ -296,7 +297,6 @@ return 0; } -#define UV_PER_LSB ((3300 * 1000) / 4096) #define VCC_UV_THRESH_1V8 1500000 #define VCC_UV_THRESH_3V 2800000 @@ -316,12 +316,6 @@ ci->vcc_uv_last = ci->vcc_uv; } -static uint32_t adc2uv(uint16_t adc) -{ - uint32_t uv = (uint32_t) adc * UV_PER_LSB; - return uv; -} - void ADC_IrqHandler(void) { #ifdef CARDEMU_SECOND_UART -- To view, visit https://gerrit.osmocom.org/9964 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I8a772638fa8dd02d8bc8b7631de5af5a22647c55 Gerrit-Change-Number: 9964 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 18:22:45 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 11 Jul 2018 18:22:45 +0000 Subject: Change in simtrace2[master]: fix 'ISO_S_IN_ATR not handled' gcc warning Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9965 Change subject: fix 'ISO_S_IN_ATR not handled' gcc warning ...................................................................... fix 'ISO_S_IN_ATR not handled' gcc warning when building the cardem application GCC would output the following warning: libcommon/source/card_emu.c: In function 'card_emu_process_rx_byte': libcommon/source/card_emu.c:764:2: warning: enumeration value 'ISO_S_IN_ATR' not handled in switch [-Wswitch] switch (ch->state) { ^~~~~~ in card emulation the reader should not send data while the card is sending its ATR. this is true for other states already handled (RESET, ...). in these cases an error message is output. this behaviour is now the default case as data from the reader is only expected in 3 cases: ISO_S_WAIT_TPDU, ISO_S_IN_TPDU, and ISO_S_IN_PTS. Change-Id: Ifbc8dbe1c9f176343304f211c7e6068fb977961e --- M firmware/libcommon/source/card_emu.c 1 file changed, 4 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/65/9965/1 diff --git a/firmware/libcommon/source/card_emu.c b/firmware/libcommon/source/card_emu.c index 9291064..94a601a 100644 --- a/firmware/libcommon/source/card_emu.c +++ b/firmware/libcommon/source/card_emu.c @@ -762,14 +762,6 @@ ch->stats.rx_bytes++; switch (ch->state) { - case ISO_S_WAIT_POWER: - case ISO_S_WAIT_CLK: - case ISO_S_WAIT_RST: - case ISO_S_WAIT_ATR: - TRACE_ERROR("%u: Received UART char in invalid 7816 state " - "%u\r\n", ch->num, ch->state); - /* we shouldn't receive any data from the reader yet! */ - break; case ISO_S_WAIT_TPDU: if (byte == 0xff) { new_state = process_byte_pts(ch, byte); @@ -783,6 +775,10 @@ case ISO_S_IN_PTS: new_state = process_byte_pts(ch, byte); goto out_silent; + default: + TRACE_ERROR("%u: Received UART char in invalid 7816 state " + "%u\r\n", ch->num, ch->state); + break; } out_silent: -- To view, visit https://gerrit.osmocom.org/9965 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ifbc8dbe1c9f176343304f211c7e6068fb977961e Gerrit-Change-Number: 9965 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 18:22:46 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 11 Jul 2018 18:22:46 +0000 Subject: Change in simtrace2[master]: sniff: add checksum verification for ATR and PPS Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9966 Change subject: sniff: add checksum verification for ATR and PPS ...................................................................... sniff: add checksum verification for ATR and PPS a checksum error is only signaled in the USB message with the corresponding flag. Change-Id: I277868267c3199eea216ab47bdd09fb2fb944b06 --- M firmware/libcommon/include/simtrace_prot.h M firmware/libcommon/source/sniffer.c M host/simtrace2-sniff.c 3 files changed, 28 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/66/9966/1 diff --git a/firmware/libcommon/include/simtrace_prot.h b/firmware/libcommon/include/simtrace_prot.h index f1f736b..58e51be 100644 --- a/firmware/libcommon/include/simtrace_prot.h +++ b/firmware/libcommon/include/simtrace_prot.h @@ -297,6 +297,7 @@ /* SIMTRACE_MSGT_SNIFF_ATR, SIMTRACE_MSGT_SNIFF_PPS, SIMTRACE_MSGT_SNIFF_TPDU flags */ #define SNIFF_DATA_FLAG_ERROR_INCOMPLETE (1<<5) #define SNIFF_DATA_FLAG_ERROR_MALFORMED (1<<6) +#define SNIFF_DATA_FLAG_ERROR_CHECKSUM (1<<7) /* SIMTRACE_MSGT_SNIFF_CHANGE */ struct sniff_change { diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index c58b047..f99c25a 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -394,6 +394,7 @@ static uint8_t atr_hist_len = 0; /* store the number of expected historical bytes */ static uint8_t y = 0; /* last mask of the upcoming TA, TB, TC, TD interface bytes */ static uint8_t i = 0; /* interface byte subgroup number */ + static uint32_t flags = 0; /* error flag */ /* sanity check */ if (ISO7816_S_IN_ATR != iso_state) { @@ -411,6 +412,7 @@ /* handle ATR byte depending on current state */ switch (atr_state) { case ATR_S_WAIT_TS: /* see ISO/IEC 7816-3:2006 section 8.1 */ + flags = 0; switch (byte) { case 0x23: /* direct convention used, but decoded using inverse convention (a parity error should also have occurred) */ case 0x30: /* inverse convention used, but decoded using direct convention (a parity error should also have occurred) */ @@ -480,8 +482,21 @@ break; } case ATR_S_WAIT_TCK: /* see ISO/IEC 7816-3:2006 section 8.2.5 */ - /* we could verify the checksum, but we are just here to sniff */ - usb_send_atr(0); /* send ATR to host software using USB */ + /* verify checksum if present */ + if (ATR_S_WAIT_TCK == atr_state) { + uint8_t ui; + uint8_t checksum = 0; + for (ui = 1; ui < atr_i; atr_i++) { + checksum ^= atr[ui]; + } + if (checksum) { + flags |= SNIFF_DATA_FLAG_ERROR_CHECKSUM; + /* We still consider the data as valid (e.g. for WT) even is the checksum is wrong. + * It is up to the reader to handle this error (e.g. by resetting) + */ + } + } + usb_send_atr(flags); /* send ATR to host software using USB */ change_state(ISO7816_S_WAIT_TPDU); /* go to next state */ break; default: @@ -551,6 +566,7 @@ static void process_byte_pps(uint8_t byte) { uint8_t *pps_cur; /* current PPS (request or response) */ + static uint32_t flags = 0; /* error flag */ /* sanity check */ if (ISO7816_S_IN_PPS_REQ == iso_state) { @@ -565,6 +581,7 @@ /* handle PPS byte depending on current state */ switch (pps_state) { /* see ISO/IEC 7816-3:2006 section 9.2 */ case PPS_S_WAIT_PPSS: /*!< initial byte */ + flags = 0; if (0xff) { pps_cur[0] = byte; pps_state = PPS_S_WAIT_PPS0; /* go to next state */ @@ -613,8 +630,11 @@ check ^= pps_cur[4]; } check ^= pps_cur[5]; + if (check) { + flags |= SNIFF_DATA_FLAG_ERROR_CHECKSUM; + } pps_state = PPS_S_WAIT_END; - usb_send_pps(0); /* send PPS to host software using USB */ + usb_send_pps(flags); /* send PPS to host software using USB */ if (ISO7816_S_IN_PPS_REQ == iso_state) { if (0 == check) { /* checksum is valid */ change_state(ISO7816_S_WAIT_PPS_RSP); /* go to next state */ diff --git a/host/simtrace2-sniff.c b/host/simtrace2-sniff.c index 765ced3..64cc354 100644 --- a/host/simtrace2-sniff.c +++ b/host/simtrace2-sniff.c @@ -131,6 +131,10 @@ .flag = SNIFF_DATA_FLAG_ERROR_MALFORMED, .meaning = "malformed", }, + { + .flag = SNIFF_DATA_FLAG_ERROR_CHECKSUM, + .meaning = "checksum error", + }, }; static void print_flags(const struct flag_meaning_t* flag_meanings, uint32_t nb_flags, uint32_t flags) { -- To view, visit https://gerrit.osmocom.org/9966 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I277868267c3199eea216ab47bdd09fb2fb944b06 Gerrit-Change-Number: 9966 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 18:42:59 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 11 Jul 2018 18:42:59 +0000 Subject: Change in simtrace2[master]: replace leading spaces with tabs In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9918 to look at the new patch set (#4). Change subject: replace leading spaces with tabs ...................................................................... replace leading spaces with tabs Change-Id: I86783eba0827b58303b10310e9f6b9625e1a27f1 --- M firmware/apps/cardem/main.c M firmware/apps/dfu/main.c M firmware/apps/trace/main.c M firmware/apps/triple_play/main.c M firmware/libboard/common/source/board_cstartup_gnu.c M firmware/libboard/common/source/board_lowlevel.c M firmware/libboard/common/source/led.c M firmware/libboard/common/source/uart_console.c M firmware/libcommon/include/assert.h M firmware/libcommon/include/cciddriver.h M firmware/libcommon/include/iso7816_4.h M firmware/libcommon/include/simtrace.h M firmware/libcommon/source/cciddriver.c M firmware/libcommon/source/iso7816_4.c M firmware/libcommon/source/mode_cardemu.c M firmware/libcommon/source/mode_ccid.c M firmware/libcommon/source/stdio.c M firmware/libcommon/source/string.c 18 files changed, 1,727 insertions(+), 1,727 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/18/9918/4 -- To view, visit https://gerrit.osmocom.org/9918 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I86783eba0827b58303b10310e9f6b9625e1a27f1 Gerrit-Change-Number: 9918 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 18:48:33 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 11 Jul 2018 18:48:33 +0000 Subject: Change in simtrace2[master]: cosmetic: put spaces around operations In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9919 to look at the new patch set (#5). Change subject: cosmetic: put spaces around operations ...................................................................... cosmetic: put spaces around operations Change-Id: If5ba5f8d16680e8403944274336ea595017063db --- M firmware/libcommon/source/sniffer.c 1 file changed, 72 insertions(+), 72 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/19/9919/5 -- To view, visit https://gerrit.osmocom.org/9919 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If5ba5f8d16680e8403944274336ea595017063db Gerrit-Change-Number: 9919 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 18:48:33 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 11 Jul 2018 18:48:33 +0000 Subject: Change in simtrace2[master]: USB: add flags for sniff data and centralise transfer In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9920 to look at the new patch set (#5). Change subject: USB: add flags for sniff data and centralise transfer ...................................................................... USB: add flags for sniff data and centralise transfer Also fix issue in usb_msg_alloc_hdr and add cosmetic spaces around operations. Change-Id: I768a0ad639aa5e648a630af72d01f7b68082b6b6 --- M firmware/libcommon/include/simtrace_prot.h M firmware/libcommon/source/sniffer.c M host/simtrace2-sniff.c 3 files changed, 140 insertions(+), 142 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/20/9920/5 -- To view, visit https://gerrit.osmocom.org/9920 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I768a0ad639aa5e648a630af72d01f7b68082b6b6 Gerrit-Change-Number: 9920 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 18:48:33 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 11 Jul 2018 18:48:33 +0000 Subject: Change in simtrace2[master]: DFU: use central DFU override check In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9913 to look at the new patch set (#4). Change subject: DFU: use central DFU override check ...................................................................... DFU: use central DFU override check TRACE_INFO will also provide the DFU start reason, but TRACE_INFO (TRACE_LEVEL >= 4) should only be used for debugging. WARNING: With TRACE_LEVEL >= 4 the DFU binary is over the maximum of 16 kiB allocated for the DFU bootloader. Thus make combined will not boot the main application because its start if after the expecte 16 kiB address; and flashing using DFU will overwrite the DFU bootloader itself. Change-Id: I82323e0f76c03f67df7dc8f2b6783166cc25f3aa --- M firmware/apps/dfu/main.c M firmware/libboard/common/source/board_cstartup_gnu.c 2 files changed, 51 insertions(+), 28 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/13/9913/4 -- To view, visit https://gerrit.osmocom.org/9913 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I82323e0f76c03f67df7dc8f2b6783166cc25f3aa Gerrit-Change-Number: 9913 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 18:48:33 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 11 Jul 2018 18:48:33 +0000 Subject: Change in simtrace2[master]: sniffer: move data print before USB send In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9921 to look at the new patch set (#5). Change subject: sniffer: move data print before USB send ...................................................................... sniffer: move data print before USB send when the host software does not retrieve the USB messages the memory is filled and no new USB messages can be allocated, preventing the following code to print the message Change-Id: Ie8946894a84cb853b45555f7abb1ca6f32111425 --- M firmware/libcommon/source/sniffer.c 1 file changed, 13 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/21/9921/5 -- To view, visit https://gerrit.osmocom.org/9921 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie8946894a84cb853b45555f7abb1ca6f32111425 Gerrit-Change-Number: 9921 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 18:48:33 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 11 Jul 2018 18:48:33 +0000 Subject: Change in simtrace2[master]: sniffer: move reset handling from ISR to main loop In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9922 to look at the new patch set (#5). Change subject: sniffer: move reset handling from ISR to main loop ...................................................................... sniffer: move reset handling from ISR to main loop Change-Id: Ia88fb4baf49017524bb201123da3511e5342ba48 --- M firmware/libcommon/source/sniffer.c 1 file changed, 16 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/22/9922/5 -- To view, visit https://gerrit.osmocom.org/9922 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia88fb4baf49017524bb201123da3511e5342ba48 Gerrit-Change-Number: 9922 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 18:48:33 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 11 Jul 2018 18:48:33 +0000 Subject: Change in simtrace2[master]: sniffer: set LED pattern In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9924 to look at the new patch set (#5). Change subject: sniffer: set LED pattern ...................................................................... sniffer: set LED pattern The red and green LEDs are now used as follows: - red on = power (firmware is running) - red blink = error detected (e.g. during ISO-7816 parsing) - green on = running (sniffer mode is running) - green blink = activity (e.g. USB message sent) Change-Id: Ib1b6ff87fb92d6ed3ecae4bc89386206aaab508e --- M firmware/apps/trace/main.c M firmware/libcommon/source/sniffer.c 2 files changed, 8 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/24/9924/5 -- To view, visit https://gerrit.osmocom.org/9924 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib1b6ff87fb92d6ed3ecae4bc89386206aaab508e Gerrit-Change-Number: 9924 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 18:48:33 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 11 Jul 2018 18:48:33 +0000 Subject: Change in simtrace2[master]: LED: add need pattern In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9923 to look at the new patch set (#5). Change subject: LED: add need pattern ...................................................................... LED: add need pattern new LED pattern: off for 200 ms and then on Change-Id: Id2c40dc20d75ed6f38b735164ad1eb2860dc480c --- M firmware/libboard/common/include/led.h M firmware/libboard/common/source/led.c 2 files changed, 13 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/23/9923/5 -- To view, visit https://gerrit.osmocom.org/9923 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id2c40dc20d75ed6f38b735164ad1eb2860dc480c Gerrit-Change-Number: 9923 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 18:48:33 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 11 Jul 2018 18:48:33 +0000 Subject: Change in simtrace2[master]: minor: fix linker warning In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9925 to look at the new patch set (#5). Change subject: minor: fix linker warning ...................................................................... minor: fix linker warning linker warning: obj/simtrace/dfu_sniffer.o: In function `usb_send_data': /media/data/work/simtrace2/simtrace2/firmware/libcommon/source/sniffer.c:338: warning: undefined reference to `putchar' Change-Id: I934f3fcb474d4046e921511a024c3a0b8533c782 --- M firmware/libcommon/source/sniffer.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/25/9925/5 -- To view, visit https://gerrit.osmocom.org/9925 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I934f3fcb474d4046e921511a024c3a0b8533c782 Gerrit-Change-Number: 9925 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 18:48:33 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 11 Jul 2018 18:48:33 +0000 Subject: Change in simtrace2[master]: sniffer: also send malformed message over USB In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9926 to look at the new patch set (#5). Change subject: sniffer: also send malformed message over USB ...................................................................... sniffer: also send malformed message over USB Change-Id: I124c8db1d2f836e185630bbe8b5e52eb085d702a --- M firmware/libcommon/source/sniffer.c 1 file changed, 15 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/26/9926/5 -- To view, visit https://gerrit.osmocom.org/9926 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I124c8db1d2f836e185630bbe8b5e52eb085d702a Gerrit-Change-Number: 9926 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 18:48:33 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 11 Jul 2018 18:48:33 +0000 Subject: Change in simtrace2[master]: sniffer: only allocate USB message if queue is not too long In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9927 to look at the new patch set (#5). Change subject: sniffer: only allocate USB message if queue is not too long ...................................................................... sniffer: only allocate USB message if queue is not too long When the host does not retrieved the USB messages, they keep getting queue in the firmware, filling the RAM, and preventing further memory to be allocated. Change-Id: I0e447acdf757dcb5dc5c4d8b84a4235866914cad --- M firmware/libcommon/source/sniffer.c 1 file changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/27/9927/5 -- To view, visit https://gerrit.osmocom.org/9927 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0e447acdf757dcb5dc5c4d8b84a4235866914cad Gerrit-Change-Number: 9927 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 18:48:33 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 11 Jul 2018 18:48:33 +0000 Subject: Change in simtrace2[master]: sniffer: fix inverted reset meaning In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9944 to look at the new patch set (#4). Change subject: sniffer: fix inverted reset meaning ...................................................................... sniffer: fix inverted reset meaning Change-Id: I860e2e29c059e1e0ec126695bb68d489891a17da --- M firmware/libcommon/source/sniffer.c 1 file changed, 7 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/44/9944/4 -- To view, visit https://gerrit.osmocom.org/9944 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I860e2e29c059e1e0ec126695bb68d489891a17da Gerrit-Change-Number: 9944 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 18:48:33 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 11 Jul 2018 18:48:33 +0000 Subject: Change in simtrace2[master]: host sniff: process remaining usb messages in buffer In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9945 to look at the new patch set (#4). Change subject: host sniff: process remaining usb messages in buffer ...................................................................... host sniff: process remaining usb messages in buffer Change-Id: I1746c0187b2e5dbef44b4b336fee3bd9ded15079 --- M host/simtrace2-sniff.c 1 file changed, 6 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/45/9945/4 -- To view, visit https://gerrit.osmocom.org/9945 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1746c0187b2e5dbef44b4b336fee3bd9ded15079 Gerrit-Change-Number: 9945 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 18:48:33 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 11 Jul 2018 18:48:33 +0000 Subject: Change in simtrace2[master]: host sniff: add functions to print flags In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9946 to look at the new patch set (#4). Change subject: host sniff: add functions to print flags ...................................................................... host sniff: add functions to print flags Change-Id: If3c0a4790662bcc64db5ff03adcc033836e16ad0 --- M host/simtrace2-sniff.c 1 file changed, 58 insertions(+), 29 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/46/9946/4 -- To view, visit https://gerrit.osmocom.org/9946 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If3c0a4790662bcc64db5ff03adcc033836e16ad0 Gerrit-Change-Number: 9946 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 18:48:33 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 11 Jul 2018 18:48:33 +0000 Subject: Change in simtrace2[master]: make adc2uv common In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9964 to look at the new patch set (#3). Change subject: make adc2uv common ...................................................................... make adc2uv common when building the trace app for the simtrace board gcc was outputing the following error: libboard/common/source/boardver_adc.c:20:17: warning: 'adc2uv' defined but not used [-Wunused-function] static uint32_t adc2uv(uint16_t adc) adc2uv is used by qmod, and defined in two places: in boardver_adc.c and mode_cardemu.c. this change will have adc2uv only defined in boardver_adc.c and make available in the header to be used by mode_cardemu.c. Change-Id: I8a772638fa8dd02d8bc8b7631de5af5a22647c55 --- M firmware/libboard/common/include/boardver_adc.h M firmware/libboard/common/source/boardver_adc.c M firmware/libcommon/source/mode_cardemu.c 3 files changed, 3 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/64/9964/3 -- To view, visit https://gerrit.osmocom.org/9964 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8a772638fa8dd02d8bc8b7631de5af5a22647c55 Gerrit-Change-Number: 9964 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 18:48:33 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 11 Jul 2018 18:48:33 +0000 Subject: Change in simtrace2[master]: fix 'ISO_S_IN_ATR not handled' gcc warning In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9965 to look at the new patch set (#3). Change subject: fix 'ISO_S_IN_ATR not handled' gcc warning ...................................................................... fix 'ISO_S_IN_ATR not handled' gcc warning when building the cardem application GCC would output the following warning: libcommon/source/card_emu.c: In function 'card_emu_process_rx_byte': libcommon/source/card_emu.c:764:2: warning: enumeration value 'ISO_S_IN_ATR' not handled in switch [-Wswitch] switch (ch->state) { ^~~~~~ in card emulation the reader should not send data while the card is sending its ATR. this is true for other states already handled (RESET, ...). in these cases an error message is output. this behaviour is now the default case as data from the reader is only expected in 3 cases: ISO_S_WAIT_TPDU, ISO_S_IN_TPDU, and ISO_S_IN_PTS. Change-Id: Ifbc8dbe1c9f176343304f211c7e6068fb977961e --- M firmware/libcommon/source/card_emu.c 1 file changed, 4 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/65/9965/3 -- To view, visit https://gerrit.osmocom.org/9965 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ifbc8dbe1c9f176343304f211c7e6068fb977961e Gerrit-Change-Number: 9965 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 18:48:33 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 11 Jul 2018 18:48:33 +0000 Subject: Change in simtrace2[master]: sniff: add checksum verification for ATR and PPS In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9966 to look at the new patch set (#3). Change subject: sniff: add checksum verification for ATR and PPS ...................................................................... sniff: add checksum verification for ATR and PPS a checksum error is only signaled in the USB message with the corresponding flag. Change-Id: I277868267c3199eea216ab47bdd09fb2fb944b06 --- M firmware/libcommon/include/simtrace_prot.h M firmware/libcommon/source/sniffer.c M host/simtrace2-sniff.c 3 files changed, 28 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/66/9966/3 -- To view, visit https://gerrit.osmocom.org/9966 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I277868267c3199eea216ab47bdd09fb2fb944b06 Gerrit-Change-Number: 9966 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 19:49:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 19:49:55 +0000 Subject: Change in python/osmo-python-tests[master]: Move twisted_ipa.py to osmopy lib In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9960 ) Change subject: Move twisted_ipa.py to osmopy lib ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9960 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I33a0c4263297abd9e111bf43e6e9967c06474318 Gerrit-Change-Number: 9960 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 11 Jul 2018 19:49:55 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 19:50:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 19:50:41 +0000 Subject: Change in simtrace2[master]: DFU: use central DFU override check In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9913 ) Change subject: DFU: use central DFU override check ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9913 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I82323e0f76c03f67df7dc8f2b6783166cc25f3aa Gerrit-Change-Number: 9913 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 11 Jul 2018 19:50:41 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 19:51:37 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 19:51:37 +0000 Subject: Change in simtrace2[master]: host: set license to GPLv2+ In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9915 ) Change subject: host: set license to GPLv2+ ...................................................................... Patch Set 4: Code-Review-1 I'm sorry, but as mentioned several times, it should be "version 2 or later", while your patch now adds "version 2" (only) -- To view, visit https://gerrit.osmocom.org/9915 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0948d74874af1d3a0f1b4cbcb4a838e4ecd9fe3f Gerrit-Change-Number: 9915 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 11 Jul 2018 19:51:37 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 19:52:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 19:52:29 +0000 Subject: Change in simtrace2[master]: firmware: set license to GPLv2+ In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9916 ) Change subject: firmware: set license to GPLv2+ ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9916 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id4c00159f984976b6d8641900fb64e36a3a30407 Gerrit-Change-Number: 9916 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 11 Jul 2018 19:52:29 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 19:52:40 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 19:52:40 +0000 Subject: Change in simtrace2[master]: set linux end of line In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9917 ) Change subject: set linux end of line ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9917 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5200f0d6f39b0641cac26a4109a3cd33e8474b9b Gerrit-Change-Number: 9917 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 11 Jul 2018 19:52:40 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 19:53:00 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 19:53:00 +0000 Subject: Change in simtrace2[master]: replace leading spaces with tabs In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9918 ) Change subject: replace leading spaces with tabs ...................................................................... Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9918 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I86783eba0827b58303b10310e9f6b9625e1a27f1 Gerrit-Change-Number: 9918 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 11 Jul 2018 19:53:00 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 19:53:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 19:53:14 +0000 Subject: Change in simtrace2[master]: cosmetic: put spaces around operations In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9919 ) Change subject: cosmetic: put spaces around operations ...................................................................... Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9919 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If5ba5f8d16680e8403944274336ea595017063db Gerrit-Change-Number: 9919 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 11 Jul 2018 19:53:14 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 19:53:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 19:53:44 +0000 Subject: Change in simtrace2[master]: USB: add flags for sniff data and centralise transfer In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9920 ) Change subject: USB: add flags for sniff data and centralise transfer ...................................................................... Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9920 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I768a0ad639aa5e648a630af72d01f7b68082b6b6 Gerrit-Change-Number: 9920 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 11 Jul 2018 19:53:44 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 19:54:19 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 19:54:19 +0000 Subject: Change in simtrace2[master]: sniffer: move data print before USB send In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9921 ) Change subject: sniffer: move data print before USB send ...................................................................... Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9921 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie8946894a84cb853b45555f7abb1ca6f32111425 Gerrit-Change-Number: 9921 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 11 Jul 2018 19:54:19 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 19:54:39 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 19:54:39 +0000 Subject: Change in simtrace2[master]: sniffer: move reset handling from ISR to main loop In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9922 ) Change subject: sniffer: move reset handling from ISR to main loop ...................................................................... Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9922 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia88fb4baf49017524bb201123da3511e5342ba48 Gerrit-Change-Number: 9922 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 11 Jul 2018 19:54:39 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 19:54:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 19:54:54 +0000 Subject: Change in simtrace2[master]: LED: add need pattern In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9923 ) Change subject: LED: add need pattern ...................................................................... Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9923 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id2c40dc20d75ed6f38b735164ad1eb2860dc480c Gerrit-Change-Number: 9923 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 11 Jul 2018 19:54:54 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 19:55:07 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 19:55:07 +0000 Subject: Change in simtrace2[master]: sniffer: set LED pattern In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9924 ) Change subject: sniffer: set LED pattern ...................................................................... Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9924 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib1b6ff87fb92d6ed3ecae4bc89386206aaab508e Gerrit-Change-Number: 9924 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 11 Jul 2018 19:55:07 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 19:55:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 19:55:17 +0000 Subject: Change in simtrace2[master]: minor: fix linker warning In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9925 ) Change subject: minor: fix linker warning ...................................................................... Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9925 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I934f3fcb474d4046e921511a024c3a0b8533c782 Gerrit-Change-Number: 9925 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 11 Jul 2018 19:55:17 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 19:55:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 19:55:29 +0000 Subject: Change in simtrace2[master]: sniffer: also send malformed message over USB In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9926 ) Change subject: sniffer: also send malformed message over USB ...................................................................... Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9926 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I124c8db1d2f836e185630bbe8b5e52eb085d702a Gerrit-Change-Number: 9926 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 11 Jul 2018 19:55:29 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 19:55:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 19:55:44 +0000 Subject: Change in simtrace2[master]: sniffer: only allocate USB message if queue is not too long In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9927 ) Change subject: sniffer: only allocate USB message if queue is not too long ...................................................................... Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9927 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0e447acdf757dcb5dc5c4d8b84a4235866914cad Gerrit-Change-Number: 9927 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 11 Jul 2018 19:55:44 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 19:56:04 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 19:56:04 +0000 Subject: Change in simtrace2[master]: sniffer: fix inverted reset meaning In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9944 ) Change subject: sniffer: fix inverted reset meaning ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9944 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I860e2e29c059e1e0ec126695bb68d489891a17da Gerrit-Change-Number: 9944 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 11 Jul 2018 19:56:04 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 19:56:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 19:56:18 +0000 Subject: Change in simtrace2[master]: host sniff: process remaining usb messages in buffer In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9945 ) Change subject: host sniff: process remaining usb messages in buffer ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9945 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1746c0187b2e5dbef44b4b336fee3bd9ded15079 Gerrit-Change-Number: 9945 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 11 Jul 2018 19:56:18 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 19:57:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 19:57:24 +0000 Subject: Change in simtrace2[master]: host sniff: add functions to print flags In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9946 ) Change subject: host sniff: add functions to print flags ...................................................................... Patch Set 4: (1 comment) https://gerrit.osmocom.org/#/c/9946/4/host/simtrace2-sniff.c File host/simtrace2-sniff.c: https://gerrit.osmocom.org/#/c/9946/4/host/simtrace2-sniff.c at 97 PS4, Line 97: struct flag_meaning_t { we typically use 'struct value_string' here and the corresponding 'get_value_string() and 'get_string_value()' functions from libosmocore. Unless you need something those functions don't provide, please use the existing ones. -- To view, visit https://gerrit.osmocom.org/9946 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If3c0a4790662bcc64db5ff03adcc033836e16ad0 Gerrit-Change-Number: 9946 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Harald Welte Gerrit-Comment-Date: Wed, 11 Jul 2018 19:57:24 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 19:57:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 19:57:47 +0000 Subject: Change in simtrace2[master]: make adc2uv common In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9964 ) Change subject: make adc2uv common ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9964 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8a772638fa8dd02d8bc8b7631de5af5a22647c55 Gerrit-Change-Number: 9964 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 11 Jul 2018 19:57:47 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 19:58:03 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 19:58:03 +0000 Subject: Change in simtrace2[master]: fix 'ISO_S_IN_ATR not handled' gcc warning In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9965 ) Change subject: fix 'ISO_S_IN_ATR not handled' gcc warning ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9965 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ifbc8dbe1c9f176343304f211c7e6068fb977961e Gerrit-Change-Number: 9965 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 11 Jul 2018 19:58:03 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 19:58:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 19:58:32 +0000 Subject: Change in simtrace2[master]: sniff: add checksum verification for ATR and PPS In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9966 ) Change subject: sniff: add checksum verification for ATR and PPS ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9966 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I277868267c3199eea216ab47bdd09fb2fb944b06 Gerrit-Change-Number: 9966 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 11 Jul 2018 19:58:32 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 19:59:12 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 19:59:12 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BSC_Tests: Also test LCLS with halfrate codecs In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9900 ) Change subject: BSC_Tests: Also test LCLS with halfrate codecs ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9900 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2421519a642bdb7453ae4a9058e177845690a489 Gerrit-Change-Number: 9900 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 11 Jul 2018 19:59:12 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 19:59:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 19:59:41 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BSC_Tests_LCLS: try call legs with different codec/rate In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9941 ) Change subject: BSC_Tests_LCLS: try call legs with different codec/rate ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9941 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I91b132306e530ad9ca03fb4a34012381be6b0b52 Gerrit-Change-Number: 9941 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 11 Jul 2018 19:59:41 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:00:06 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:00:06 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_ConnectionHandler: split up as_media into separate altsteps In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9961 ) Change subject: MSC_ConnectionHandler: split up as_media into separate altsteps ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9961 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I539e8ffdb9f99d5a8e730dd918df502614b9e84d Gerrit-Change-Number: 9961 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 11 Jul 2018 20:00:06 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:00:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:00:44 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BSC_Tests: count MGCP operations in as_media In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9962 ) Change subject: BSC_Tests: count MGCP operations in as_media ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9962 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib073b097a840ca3a8ee99c4ed41f59f574191d98 Gerrit-Change-Number: 9962 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 11 Jul 2018 20:00:44 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:00:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:00:46 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BSC_Tests: Also test LCLS with halfrate codecs In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9900 ) Change subject: BSC_Tests: Also test LCLS with halfrate codecs ...................................................................... BSC_Tests: Also test LCLS with halfrate codecs At the moment LCLS is only tested using GSM-FR. There are not LCLS tests that test with GSM-HR yet. Lets make GSM-HR available and see what happens when we run BSC_Tests_LCLS.TC_lcls_gcr_bway_connect on HR instead of FR. - set channelType depending on g_pars.ass_codec_list.codecElements[0] - add testcase TC_lcls_gcr_bway_connect_hr Related OS#1602 Change-Id: I2421519a642bdb7453ae4a9058e177845690a489 --- M bsc/BSC_Tests.ttcn M bsc/BSC_Tests_LCLS.ttcn M bsc/expected-results.xml 3 files changed, 24 insertions(+), 4 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 2a8ad5f..149d5b7 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -1735,7 +1735,7 @@ } /* determine BSSMAP_IE_ChannelType from *first* element of BSSMAP_FIELD_CodecElement */ -private function f_BSSMAP_chtype_from_codec(BSSMAP_FIELD_CodecElement a_elem) +function f_BSSMAP_chtype_from_codec(BSSMAP_FIELD_CodecElement a_elem) return BSSMAP_IE_ChannelType { /* FIXME: actually look at all elements of BSSMAP_IE_SpeechCodecList */ var BSSMAP_IE_ChannelType ret := valueof(ts_BSSMAP_IE_ChannelType); diff --git a/bsc/BSC_Tests_LCLS.ttcn b/bsc/BSC_Tests_LCLS.ttcn index b99ba58..da9fe94 100644 --- a/bsc/BSC_Tests_LCLS.ttcn +++ b/bsc/BSC_Tests_LCLS.ttcn @@ -128,8 +128,12 @@ private function f_lcls_connhdlr_main(charstring id) runs on LCLS_MSC_ConnHdlr { /* 1) establish the connection between RSL and BSSAP side */ var PDU_BSSAP ass_req := f_gen_ass_req(); + var template PDU_BSSAP ass_compl := f_gen_exp_compl(); ass_req.pdu.bssmap.assignmentRequest.codecList := g_pars.ass_codec_list; + ass_req.pdu.bssmap.assignmentRequest.channelType := + f_BSSMAP_chtype_from_codec(g_pars.ass_codec_list.codecElements[0]); + f_establish_fully(ass_req, ass_compl); /* 2) notify master that assignment has completed */ @@ -251,8 +255,7 @@ f_lcls_test_fini(); } -/* Send an ASSIGNMENT REQ with LCLS GCR+CFG+CSC; expect connect both-way */ -testcase TC_lcls_gcr_bway_connect() runs on lcls_test_CT { +private function f_tc_lcls_gcr_bway_connect(boolean hr) runs on lcls_test_CT { var TestHdlrParams pars_a := valueof(t_def_TestHdlrPars); var TestHdlrParams pars_b; var MSC_ConnHdlr vc_conn; @@ -260,7 +263,11 @@ f_lcls_init(); - pars_a.ass_codec_list := valueof(ts_BSSMAP_IE_CodecList({ts_CodecFR})); + if (hr == true) { + pars_a.ass_codec_list := valueof(ts_BSSMAP_IE_CodecList({ts_CodecHR})); + } else { + pars_a.ass_codec_list := valueof(ts_BSSMAP_IE_CodecList({ts_CodecFR})); + } pars_a.lcls.gcr := valueof(ts_GCR('010203'O, '0405'O, '060708090a'O)); pars_a.lcls.cfg := LCLS_CFG_both_way; pars_a.lcls.csc := LCLS_CSC_connect; @@ -272,6 +279,7 @@ pars_b.lcls.exp_sts := LCLS_STS_locally_switched; f_lcls_test_init(pars_a, pars_b); + CONN_A.receive(LclsCompSync:LCLS_COMP_SYNC_ASS_COMPL); interleave { [] CONN_A.receive(tr_BSSMAP_LclsNotificationSts(LCLS_STS_not_yet_ls)); @@ -285,6 +293,16 @@ f_lcls_test_fini(); } +/* Send an ASSIGNMENT REQ with LCLS GCR+CFG+CSC; expect connect both-way (full rate)*/ +testcase TC_lcls_gcr_bway_connect() runs on lcls_test_CT { + f_tc_lcls_gcr_bway_connect(false) +} + +/* Send an ASSIGNMENT REQ with LCLS GCR+CFG+CSC; expect connect both-way (half rate) */ +testcase TC_lcls_gcr_bway_connect_hr() runs on lcls_test_CT { + f_tc_lcls_gcr_bway_connect(true) +} + /* Send an ASSIGNMENT REQ with LCLS CFG+CSC enabling LCLS but GCR doesn't match! */ testcase TC_lcls_gcr_nomatch_bway_connect() runs on lcls_test_CT { var TestHdlrParams pars_a := valueof(t_def_TestHdlrPars); @@ -581,6 +599,7 @@ execute( TC_lcls_gcr_only() ); execute( TC_lcls_gcr_bway_connect() ); + execute( TC_lcls_gcr_bway_connect_hr() ); execute( TC_lcls_gcr_nomatch_bway_connect() ); execute( TC_lcls_gcr_bway_dont_connect() ); execute( TC_lcls_gcr_unsuppported_cfg() ); diff --git a/bsc/expected-results.xml b/bsc/expected-results.xml index 969660e..dbe3d2c 100644 --- a/bsc/expected-results.xml +++ b/bsc/expected-results.xml @@ -87,6 +87,7 @@ + -- To view, visit https://gerrit.osmocom.org/9900 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I2421519a642bdb7453ae4a9058e177845690a489 Gerrit-Change-Number: 9900 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:00:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:00:47 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BSC_Tests_LCLS: try call legs with different codec/rate In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9941 ) Change subject: BSC_Tests_LCLS: try call legs with different codec/rate ...................................................................... BSC_Tests_LCLS: try call legs with different codec/rate since the local MGW may not support transcoding, osmo-bsc should avoid to LCLS call legs that use different codec/rate. This test attemts to set up a call with different codec rate and checks if those legs do not get LCLSed Change-Id: I91b132306e530ad9ca03fb4a34012381be6b0b52 Depends: osmo-bsc I157549129a40c64364dc126f67195759e5f1d60f Related: OS#1602 --- M bsc/BSC_Tests_LCLS.ttcn M bsc/expected-results.xml 2 files changed, 38 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/bsc/BSC_Tests_LCLS.ttcn b/bsc/BSC_Tests_LCLS.ttcn index da9fe94..dfbd946 100644 --- a/bsc/BSC_Tests_LCLS.ttcn +++ b/bsc/BSC_Tests_LCLS.ttcn @@ -303,6 +303,42 @@ f_tc_lcls_gcr_bway_connect(true) } +/* Unless explicitly enabled, osmo-bsc will avoid LCLSs when the codecs or rates + * of both legs are different */ +testcase TC_lcls_gcr_bway_codec_mismatch() runs on lcls_test_CT { + var TestHdlrParams pars_a := valueof(t_def_TestHdlrPars); + var TestHdlrParams pars_b; + var MSC_ConnHdlr vc_conn; + var MgcpCommand mgcp_cmd; + + f_lcls_init(); + + /* First call leg uses full rate */ + pars_a.ass_codec_list := valueof(ts_BSSMAP_IE_CodecList({ts_CodecFR})); + pars_a.lcls.gcr := valueof(ts_GCR('010203'O, '0405'O, '060708090a'O)); + pars_a.lcls.cfg := LCLS_CFG_both_way; + pars_a.lcls.csc := LCLS_CSC_connect; + + /* The second call leg uses half-rate */ + pars_b := pars_a; + pars_a.ass_codec_list := valueof(ts_BSSMAP_IE_CodecList({ts_CodecHR})); + + /* first call is not possible to be LS (no second leg yet) */ + pars_a.lcls.exp_sts := LCLS_STS_not_possible_ls; + + /* second call is also not possible to be LS (codec/rate does not match) */ + pars_b.lcls.exp_sts := LCLS_STS_not_yet_ls; + f_lcls_test_init(pars_a, pars_b); + + interleave { + [] CONN_A.receive(LclsCompSync:LCLS_COMP_SYNC_ASS_COMPL); + [] CONN_B.receive(LclsCompSync:LCLS_COMP_SYNC_ASS_COMPL); + [] CONN_A.receive(tr_BSSMAP_LclsNotificationSts(LCLS_STS_not_yet_ls)); + } + + f_lcls_test_fini(); +} + /* Send an ASSIGNMENT REQ with LCLS CFG+CSC enabling LCLS but GCR doesn't match! */ testcase TC_lcls_gcr_nomatch_bway_connect() runs on lcls_test_CT { var TestHdlrParams pars_a := valueof(t_def_TestHdlrPars); @@ -600,6 +636,7 @@ execute( TC_lcls_gcr_only() ); execute( TC_lcls_gcr_bway_connect() ); execute( TC_lcls_gcr_bway_connect_hr() ); + execute( TC_lcls_gcr_bway_codec_mismatch() ); execute( TC_lcls_gcr_nomatch_bway_connect() ); execute( TC_lcls_gcr_bway_dont_connect() ); execute( TC_lcls_gcr_unsuppported_cfg() ); diff --git a/bsc/expected-results.xml b/bsc/expected-results.xml index dbe3d2c..7339951 100644 --- a/bsc/expected-results.xml +++ b/bsc/expected-results.xml @@ -88,6 +88,7 @@ + -- To view, visit https://gerrit.osmocom.org/9941 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I91b132306e530ad9ca03fb4a34012381be6b0b52 Gerrit-Change-Number: 9941 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:00:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:00:47 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_ConnectionHandler: split up as_media into separate altsteps In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9961 ) Change subject: MSC_ConnectionHandler: split up as_media into separate altsteps ...................................................................... MSC_ConnectionHandler: split up as_media into separate altsteps as_media() tests both, IPACC/RSL media handling and MGCP media handling. These two domains are technically quite separate, which means we can split them up into two separate altsteps in order to increase readability of the code. - Split as_media() into as_Media_ipacc() and as_Media_mgw() Change-Id: I539e8ffdb9f99d5a8e730dd918df502614b9e84d Related: OS#3292 --- M bsc/MSC_ConnectionHandler.ttcn 1 file changed, 17 insertions(+), 7 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index 1261a4d..f38a3e9 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -149,12 +149,10 @@ self.stop; } - -/* altstep for handling of IPA + MGCP media related commands. Can be activated by a given - * test case if it expects to see media related handling (i.e. voice calls */ -altstep as_Media() runs on MSC_ConnHdlr { +/* altstep for handling of IPACC media related commands. Activated by as_Media() to test + * RSL level media handling */ +altstep as_Media_ipacc() runs on MSC_ConnHdlr { var RSL_Message rsl; - var MgcpCommand mgcp_cmd; var RSL_IE_Body ie; var boolean b_unused; [not g_media.bts.ipa_crcx_seen] RSL.receive(tr_RSL_IPA_CRCX(g_chan_nr)) -> value rsl { @@ -243,6 +241,14 @@ repeat; } + +} + +/* altstep for handling of MGCP media related commands. Activated by as_Media() to test + * MGW level media handling */ +altstep as_Media_mgw() runs on MSC_ConnHdlr { + var MgcpCommand mgcp_cmd; + [] MGCP.receive(tr_CRCX) -> value mgcp_cmd { var SDP_Message sdp; var integer cid := f_get_free_mgcp_conn(); @@ -298,8 +304,12 @@ } } - - +/* Altsteps for handling of media related commands. Can be activated by a given + * test case if it expects to see media related handling (i.e. voice calls) */ +altstep as_Media() runs on MSC_ConnHdlr { + [] as_Media_ipacc(); + [] as_Media_mgw(); +} /* this component represents a single subscriber connection at the MSC. * There is a 1:1 mapping between SCCP connections and BSSAP_ConnHdlr components. -- To view, visit https://gerrit.osmocom.org/9961 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I539e8ffdb9f99d5a8e730dd918df502614b9e84d Gerrit-Change-Number: 9961 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:00:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:00:48 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BSC_Tests: count MGCP operations in as_media In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9962 ) Change subject: BSC_Tests: count MGCP operations in as_media ...................................................................... BSC_Tests: count MGCP operations in as_media as_media handles the MGCP interaction for most of the tests. However, it does not make sure if transactions are missing or if too many transactions are performed (e.g. if an SCCP-Lite tests still creates the connections pointing to the core network, even if they must not created by the BSC in this case). So lets make sure that the MGCP transactions are performed as expected by counting them. - Add counters to count CRCX and MDCX transactions - Check those counters after call establishment and handover Change-Id: Ib073b097a840ca3a8ee99c4ed41f59f574191d98 Related: OS#3292 --- M bsc/BSC_Tests.ttcn M bsc/MSC_ConnectionHandler.ttcn 2 files changed, 74 insertions(+), 7 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 149d5b7..2897a0b 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -2122,10 +2122,19 @@ f_vty_handover(0, 0, g_chan_nr, 1); /* temporarily suspend DChan processing on BTS1 to avoid race with RSLEM_register */ f_rslem_suspend(RSL1_PROC); + + /* From the MGW perspective, a handover is is characterized by + * performing one MDCX operation with the MGW. So we expect to see + * one more MDCX during handover. */ + g_media.mgcp_conn[0].mdcx_seen_exp := g_media.mgcp_conn[0].crcx_seen_exp + 1; + alt { [] as_handover(hs); - /* FIXME: somehow determine that the hand-over has completed, by MGCP MDCX? */ } + + /* Check the amount of MGCP transactions is still consistant with the + * test expectation */ + f_check_mgcp_expectations() } testcase TC_ho_int() runs on test_CT { diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index f38a3e9..ba4d19d 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -58,7 +58,10 @@ /* State encapsulating one MGCP Connection */ type record MgcpConnState { - boolean crcx_seen, + integer crcx_seen, /* Counts how many CRCX operations happend */ + integer mdcx_seen, /* Counts how many MDCX operations happend C */ + integer crcx_seen_exp, /* Sets the expected number of CRCX operations */ + integer mdcx_seen_exp, /* Sets the expected number of MDCX operations */ MgcpConnectionId conn_id, charstring mime_type, /* e.g. AMR */ integer sample_rate, /* 8000 */ @@ -115,7 +118,10 @@ g_media.mgcp_conn[i].sample_rate := 8000; g_media.mgcp_conn[i].ptime := 20; g_media.mgcp_conn[i].rtp_pt := enum2int(f_get_mgcp_pt(codecType)); - g_media.mgcp_conn[i].crcx_seen := false; + g_media.mgcp_conn[i].crcx_seen := 0; + g_media.mgcp_conn[i].mdcx_seen := 0; + g_media.mgcp_conn[i].crcx_seen_exp := 0; + g_media.mgcp_conn[i].mdcx_seen_exp := 0; g_media.mgcp_conn[i].conn_id := f_mgcp_alloc_conn_id(); } @@ -129,9 +135,11 @@ } } +/* Helper function to get the next free MGCP connection identifier. We can + * recognize free connection identifiers by the fact that no CRCX happend yet */ private function f_get_free_mgcp_conn() runs on MSC_ConnHdlr return integer { for (var integer i:= 0; i < sizeof(g_media.mgcp_conn); i := i+1) { - if (not g_media.mgcp_conn[i].crcx_seen) { + if (not g_media.mgcp_conn[i].crcx_seen >= 1) { return i; } } @@ -139,9 +147,12 @@ self.stop; } +/* Helper function to pick a specific connection by its cid. Since we reach out + * for a connection that is in-use we also check if there was already exactly + * one CRCX happening on that connection. */ private function f_get_mgcp_conn(MgcpConnectionId cid) runs on MSC_ConnHdlr return integer { for (var integer i:= 0; i < sizeof(g_media.mgcp_conn); i := i+1) { - if (g_media.mgcp_conn[i].conn_id == cid and g_media.mgcp_conn[i].crcx_seen) { + if (g_media.mgcp_conn[i].conn_id == cid and g_media.mgcp_conn[i].crcx_seen == 1) { return i; } } @@ -278,7 +289,7 @@ mgcp_resp := ts_CRCX_ACK(mgcp_cmd.line.trans_id, mgcp_conn.conn_id, sdp); f_mgcp_par_append(mgcp_resp.params, ts_MgcpParSpecEP(g_media.mgcp_ep)); MGCP.send(mgcp_resp); - g_media.mgcp_conn[cid].crcx_seen := true; + g_media.mgcp_conn[cid].crcx_seen := g_media.mgcp_conn[cid].crcx_seen + 1; repeat; } [] MGCP.receive(tr_MDCX) -> value mgcp_cmd { @@ -299,7 +310,7 @@ int2str(mgcp_conn.sample_rate))), valueof(ts_SDP_ptime(mgcp_conn.ptime)) } )); MGCP.send(ts_MDCX_ACK(mgcp_cmd.line.trans_id, mgcp_conn.conn_id, sdp)); - //g_media.mgcp_mdcx_seen := true; + g_media.mgcp_conn[cid].mdcx_seen := g_media.mgcp_conn[cid].mdcx_seen + 1; repeat; } } @@ -781,11 +792,31 @@ } } +/* Helper function to check if the activity on the MGCP matches what we + * expected */ +function f_check_mgcp_expectations() runs on MSC_ConnHdlr { + for (var integer i:= 0; i < sizeof(g_media.mgcp_conn); i := i+1) { + if(g_media.mgcp_conn[i].crcx_seen != g_media.mgcp_conn[i].crcx_seen_exp) { + setverdict(fail, "unexpected number of MGW-CRCX transactions"); + } + if(g_media.mgcp_conn[i].mdcx_seen != g_media.mgcp_conn[i].mdcx_seen_exp) { + setverdict(fail, "unexpected number of MGW-MDCX transactions"); + } + } +} + /* establish a channel fully, expecting an assignment matching 'exp' */ function f_establish_fully(template (omit) PDU_BSSAP ass_tpl, template PDU_BSSAP exp_ass_cpl) runs on MSC_ConnHdlr { var BSSMAP_FIELD_CodecType codecType; + var boolean sccplite := false; + + /* Check if we run on SCCPLITE instead of SCCP by looking if a CIC is + * present or not. */ + if (isvalue(ass_tpl.pdu.bssmap.assignmentRequest.circuitIdentityCode)) { + sccplite := true; + } if (isvalue(ass_tpl.pdu.bssmap.assignmentRequest.codecList)) { codecType := valueof(ass_tpl.pdu.bssmap.assignmentRequest.codecList.codecElements[0].codecType); @@ -847,6 +878,31 @@ exp_modify := f_channel_needs_modify(ass_cmd.pdu.bssmap.assignmentRequest.channelType, g_chan_nr); } + /* Some test situations will involve MGCP transactions on a media + * gateway. Depending on the situation, we set up how many of each MGCP + * message type are expected to be exchanged. */ + if (isbound(exp_ass_cpl.pdu.bssmap.assignmentFailure)) { + /* For tests that expect the assignment to fail, assume that + * there will be no MGW communication as well. */ + g_media.mgcp_conn[0].crcx_seen_exp := 0; + g_media.mgcp_conn[0].mdcx_seen_exp := 0; + g_media.mgcp_conn[1].crcx_seen_exp := 0; + g_media.mgcp_conn[1].mdcx_seen_exp := 0; + } else if (st.voice_call) { + /* For voice calls we expect the following MGCP activity */ + if (sccplite) { + g_media.mgcp_conn[0].crcx_seen_exp := 1; + g_media.mgcp_conn[0].mdcx_seen_exp := 1; + g_media.mgcp_conn[1].crcx_seen_exp := 0; + g_media.mgcp_conn[1].mdcx_seen_exp := 0; + } else { + g_media.mgcp_conn[0].crcx_seen_exp := 1; + g_media.mgcp_conn[0].mdcx_seen_exp := 1; + g_media.mgcp_conn[1].crcx_seen_exp := 1; + g_media.mgcp_conn[1].mdcx_seen_exp := 0; + } + } + f_create_mgcp_expect(mgcpcrit); BSSAP.send(ass_cmd); @@ -890,6 +946,8 @@ if (not isbound(bssap)) { self.stop; } + + f_check_mgcp_expectations(); } type record HandoverState { -- To view, visit https://gerrit.osmocom.org/9962 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ib073b097a840ca3a8ee99c4ed41f59f574191d98 Gerrit-Change-Number: 9962 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:01:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:01:44 +0000 Subject: Change in libosmo-sccp[master]: fix memleak in ipa_rx_msg_sccp In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9951 ) Change subject: fix memleak in ipa_rx_msg_sccp ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9951 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2263751c0aa3ae32455847c7622af8be0a1e7802 Gerrit-Change-Number: 9951 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 11 Jul 2018 20:01:44 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:02:05 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 11 Jul 2018 20:02:05 +0000 Subject: Change in simtrace2[master]: host: set license to GPLv2+ In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9915 to look at the new patch set (#5). Change subject: host: set license to GPLv2+ ...................................................................... host: set license to GPLv2+ Change-Id: I0948d74874af1d3a0f1b4cbcb4a838e4ecd9fe3f --- M host/apdu_dispatch.c M host/apdu_dispatch.h M host/libusb_util.c M host/libusb_util.h M host/simtrace2-discovery.c M host/simtrace2-discovery.h M host/simtrace2-remsim.c M host/simtrace2-sniff.c M host/simtrace2_usb.c M host/usb2udp.c 10 files changed, 153 insertions(+), 40 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/15/9915/5 -- To view, visit https://gerrit.osmocom.org/9915 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0948d74874af1d3a0f1b4cbcb4a838e4ecd9fe3f Gerrit-Change-Number: 9915 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:02:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:02:08 +0000 Subject: Change in libosmo-sccp[master]: cosmetic: sccp2sua.c: log the IEI for parsed SCCP addr In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9952 ) Change subject: cosmetic: sccp2sua.c: log the IEI for parsed SCCP addr ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9952 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I64adb31129684b2eb66fff581040017ce2f6d163 Gerrit-Change-Number: 9952 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 11 Jul 2018 20:02:08 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:03:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:03:21 +0000 Subject: Change in libosmo-sccp[master]: add osmo_xua_msg_tall_ctx_init() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9953 ) Change subject: add osmo_xua_msg_tall_ctx_init() ...................................................................... Patch Set 1: Code-Review-1 (1 comment) let's please remove the misleading part from the commitlog message. thanks! https://gerrit.osmocom.org/#/c/9953/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/9953/1//COMMIT_MSG at 16 PS1, Line 16: The convention should actually be that only libosmocore exposes API with the : osmo_ prefix, but libosmo-sigtran explicitly exposes only symbols starting with : osmo_, forcing me to use this prefix. this is not correct. All libosmo* may expose API with osmo_ prefix. -- To view, visit https://gerrit.osmocom.org/9953 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I618878680a096a7f7fc2d83098590f2e4cb08870 Gerrit-Change-Number: 9953 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 11 Jul 2018 20:03:21 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:04:10 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:04:10 +0000 Subject: Change in libosmo-sccp[master]: fix two memleaks in ipa_rx_msg_sccp() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9956 ) Change subject: fix two memleaks in ipa_rx_msg_sccp() ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9956 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0918f9bbc15b036619f1c25a133b69819b2a30fa Gerrit-Change-Number: 9956 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 11 Jul 2018 20:04:10 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:04:39 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 11 Jul 2018 20:04:39 +0000 Subject: Change in simtrace2[master]: host: set license to GPLv2+ In-Reply-To: References: Message-ID: K?vin Redon has posted comments on this change. ( https://gerrit.osmocom.org/9915 ) Change subject: host: set license to GPLv2+ ...................................................................... Patch Set 5: argh, wrong copy paste. now fixed -- To view, visit https://gerrit.osmocom.org/9915 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0948d74874af1d3a0f1b4cbcb4a838e4ecd9fe3f Gerrit-Change-Number: 9915 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon Gerrit-Comment-Date: Wed, 11 Jul 2018 20:04:39 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:05:37 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:05:37 +0000 Subject: Change in libosmo-sccp[master]: fix memleaks in mtp_user_prim_cb() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9957 ) Change subject: fix memleaks in mtp_user_prim_cb() ...................................................................... Patch Set 1: Code-Review+1 looks fine to me, but should be thoroughly tested -- To view, visit https://gerrit.osmocom.org/9957 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I72b3c6a6f57ba32d9ba191af33b4b236492174e0 Gerrit-Change-Number: 9957 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Wed, 11 Jul 2018 20:05:37 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:06:38 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 11 Jul 2018 20:06:38 +0000 Subject: Change in python/osmo-python-tests[master]: Move twisted_ipa.py to osmopy lib In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/9960 ) Change subject: Move twisted_ipa.py to osmopy lib ...................................................................... Move twisted_ipa.py to osmopy lib twisted_ipa is a module expected to be used by other python scripts, so move it to osmopy dir to be installed as a lib (in python path) so it can be later used. twisted_ipa has some features to use it standalone for testing purposes. This feature can still be used from new installation path. Change-Id: I33a0c4263297abd9e111bf43e6e9967c06474318 --- M osmopy/__init__.py R osmopy/twisted_ipa.py M scripts/soap.py M setup.py 4 files changed, 2 insertions(+), 3 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/osmopy/__init__.py b/osmopy/__init__.py index 4e818ed..2195498 100644 --- a/osmopy/__init__.py +++ b/osmopy/__init__.py @@ -1,4 +1,4 @@ #!/usr/bin/env python __version__ = '0.0.9' -__all__ = ['obscvty', 'osmoutil', 'osmo_ipa', 'osmo_interact'] +__all__ = ['obscvty', 'osmoutil', 'osmo_ipa', 'osmo_interact', 'twisted_ipa'] diff --git a/scripts/twisted_ipa.py b/osmopy/twisted_ipa.py similarity index 100% rename from scripts/twisted_ipa.py rename to osmopy/twisted_ipa.py diff --git a/scripts/soap.py b/scripts/soap.py index f1da8f2..dc06e1e 100755 --- a/scripts/soap.py +++ b/scripts/soap.py @@ -25,7 +25,7 @@ __version__ = "0.7.1" # bump this on every non-trivial change from twisted.internet import defer, reactor -from twisted_ipa import CTRL, IPAFactory, __version__ as twisted_ipa_version +from osmopy.twisted_ipa import CTRL, IPAFactory, __version__ as twisted_ipa_version from osmopy.osmo_ipa import Ctrl from treq import post, collect from suds.client import Client diff --git a/setup.py b/setup.py index a8fd6e9..1d785e7 100755 --- a/setup.py +++ b/setup.py @@ -30,7 +30,6 @@ "scripts/osmo_ctrl.py", "scripts/osmo_rate_ctr2csv.py", "scripts/soap.py", - "scripts/twisted_ipa.py", "scripts/osmo_interact_vty.py", "scripts/osmo_interact_ctrl.py", "scripts/osmo_verify_transcript_vty.py", -- To view, visit https://gerrit.osmocom.org/9960 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I33a0c4263297abd9e111bf43e6e9967c06474318 Gerrit-Change-Number: 9960 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:06:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:06:57 +0000 Subject: Change in libosmocore[master]: gsm0808: Add value_string for encryption algorithms In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9901 ) Change subject: gsm0808: Add value_string for encryption algorithms ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9901 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iadf6460c438d02c53c2eaa9e42d51844ad28859a Gerrit-Change-Number: 9901 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 11 Jul 2018 20:06:57 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:08:58 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:08:58 +0000 Subject: Change in osmo-ttcn3-hacks[master]: lib: GTP_Emulation: Allow receiving packets with TEID 0 In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9949 ) Change subject: lib: GTP_Emulation: Allow receiving packets with TEID 0 ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9949 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic702b78028e850ed961ef805f35e10a42da34e56 Gerrit-Change-Number: 9949 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 11 Jul 2018 20:08:58 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:09:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:09:36 +0000 Subject: Change in osmo-sgsn[master]: examples: Enable by default echo req towards active GGSNs In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9936 ) Change subject: examples: Enable by default echo req towards active GGSNs ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9936 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia1898d172482bf6a25d829f8fc9a47824f49456f Gerrit-Change-Number: 9936 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 11 Jul 2018 20:09:36 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:09:49 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:09:49 +0000 Subject: Change in osmo-sgsn[master]: vty: Add cmd to disable echo loop explictly In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9948 ) Change subject: vty: Add cmd to disable echo loop explictly ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9948 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0598427257533ce8ae9e9afa787293d7c98fed15 Gerrit-Change-Number: 9948 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 11 Jul 2018 20:09:49 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:10:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:10:29 +0000 Subject: Change in osmo-pcu[master]: tbf: Use incrementing id for rate_ctr_group_alloc In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9943 ) Change subject: tbf: Use incrementing id for rate_ctr_group_alloc ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9943 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I90ef64133986c556c1a529f5b966e847e6cabbad Gerrit-Change-Number: 9943 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 11 Jul 2018 20:10:29 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:10:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:10:47 +0000 Subject: Change in osmo-pcu[master]: tbf: Replace '.' in counter names with ':' In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9942 ) Change subject: tbf: Replace '.' in counter names with ':' ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9942 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ieb7496e1a30ab4f2bfe36c7b664dcdc034010a15 Gerrit-Change-Number: 9942 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 11 Jul 2018 20:10:47 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:12:25 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:12:25 +0000 Subject: Change in pysim[master]: tests: add test program to verify pysim-prog.py (and pysim-read.py) In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9947 ) Change subject: tests: add test program to verify pysim-prog.py (and pysim-read.py) ...................................................................... Patch Set 1: (1 comment) fine except the whitespace issues https://gerrit.osmocom.org/#/c/9947/1/tests/pysim-test.sh File tests/pysim-test.sh: https://gerrit.osmocom.org/#/c/9947/1/tests/pysim-test.sh at 93 PS1, Line 93: echo "------------8<------------" let's fix all those whitespace issues that are highlightedhere (7 issues, if I counted correctly) -- To view, visit https://gerrit.osmocom.org/9947 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8c6f95998272333bc757b34e3ab6be004e8cd674 Gerrit-Change-Number: 9947 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-CC: Harald Welte Gerrit-Comment-Date: Wed, 11 Jul 2018 20:12:25 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:16:34 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 11 Jul 2018 20:16:34 +0000 Subject: Change in osmo-ttcn3-hacks[master]: lib: GTP_Emulation: Allow receiving packets with TEID 0 In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/9949 ) Change subject: lib: GTP_Emulation: Allow receiving packets with TEID 0 ...................................................................... lib: GTP_Emulation: Allow receiving packets with TEID 0 Some GTP messages like Echo Request, Echo Reply and Ind Error don't use the TEID value. According to 3GPP TS 29.060 sec 9.3.1 in those cases the TEID is set to 0: """ - TEID: Contains the Tunnel Endpoint Identifier for the tunnel to which this T-PDU belongs. The TEID shall be used by the receiving entity to find the PDP context, except for the following cases: - The Echo Request/Response and Supported Extension Headers notification messages, where the Tunnel Endpoint Identifier shall be set to all zeroes. - The Error Indication message where the Tunnel Endpoint Identifier shall be set to all zeros. """ Change-Id: Ic702b78028e850ed961ef805f35e10a42da34e56 --- M library/GTP_Emulation.ttcn 1 file changed, 11 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/GTP_Emulation.ttcn b/library/GTP_Emulation.ttcn index 534fdef..615309a 100644 --- a/library/GTP_Emulation.ttcn +++ b/library/GTP_Emulation.ttcn @@ -185,10 +185,19 @@ var template hexstring imsi_t := f_gtpc_extract_imsi(g1c_ud.gtpc); if (isvalue(imsi_t)) { vc_conn := f_comp_by_imsi(valueof(imsi_t)); - } else { + CLIENT.send(g1c_ud) to vc_conn; + } else if(g1c_ud.gtpc.teid != int2oct(0, 4)) { vc_conn := f_comp_by_teid(g1c_ud.gtpc.teid); + CLIENT.send(g1c_ud) to vc_conn; + } else { + /* Send to all clients */ + var integer i; + for (i := 0; i < sizeof(TidTable); i := i+1) { + if (isbound(TidTable[i].teid) and TidTable[i].teid == teid) { + CLIENT.send(g1c_ud) to TidTable[i].vc_conn; + } + } } - CLIENT.send(g1c_ud) to vc_conn; } [] GTPU.receive(Gtp1uUnitdata:?) -> value g1u_ud { vc_conn := f_comp_by_teid(g1u_ud.gtpu.teid); -- To view, visit https://gerrit.osmocom.org/9949 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ic702b78028e850ed961ef805f35e10a42da34e56 Gerrit-Change-Number: 9949 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:17:25 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 11 Jul 2018 20:17:25 +0000 Subject: Change in osmo-pcu[master]: tbf: Replace '.' in counter names with ':' In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9942 ) Change subject: tbf: Replace '.' in counter names with ':' ...................................................................... Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/9942 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ieb7496e1a30ab4f2bfe36c7b664dcdc034010a15 Gerrit-Change-Number: 9942 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 11 Jul 2018 20:17:25 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:23:45 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 11 Jul 2018 20:23:45 +0000 Subject: Change in osmo-sgsn[master]: osmo-sgsn: ping GGSN periodically and check for restart counter In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9934 ) Change subject: osmo-sgsn: ping GGSN periodically and check for restart counter ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/9934 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9d714726785407859f26bbef052cd0efc28e8dae Gerrit-Change-Number: 9934 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 11 Jul 2018 20:23:45 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:24:42 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:24:42 +0000 Subject: Change in simtrace2[master]: host: set license to GPLv2+ In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9915 ) Change subject: host: set license to GPLv2+ ...................................................................... Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9915 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0948d74874af1d3a0f1b4cbcb4a838e4ecd9fe3f Gerrit-Change-Number: 9915 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon Gerrit-Comment-Date: Wed, 11 Jul 2018 20:24:42 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:24:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:24:53 +0000 Subject: Change in simtrace2[master]: DFU: use central DFU override check In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9913 ) Change subject: DFU: use central DFU override check ...................................................................... DFU: use central DFU override check TRACE_INFO will also provide the DFU start reason, but TRACE_INFO (TRACE_LEVEL >= 4) should only be used for debugging. WARNING: With TRACE_LEVEL >= 4 the DFU binary is over the maximum of 16 kiB allocated for the DFU bootloader. Thus make combined will not boot the main application because its start if after the expecte 16 kiB address; and flashing using DFU will overwrite the DFU bootloader itself. Change-Id: I82323e0f76c03f67df7dc8f2b6783166cc25f3aa --- M firmware/apps/dfu/main.c M firmware/libboard/common/source/board_cstartup_gnu.c 2 files changed, 51 insertions(+), 28 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/apps/dfu/main.c b/firmware/apps/dfu/main.c index 26cbb8c..467b7dd 100644 --- a/firmware/apps/dfu/main.c +++ b/firmware/apps/dfu/main.c @@ -159,22 +159,30 @@ int USBDFU_OverrideEnterDFU(void) { uint32_t *app_part = (uint32_t *)FLASH_ADDR(0); + /* at the first call we are before the text segment has been relocated, + * so g_dfu is not initialized yet */ + g_dfu = &_g_dfu; + if (USB_DFU_MAGIC == g_dfu->magic) { + return 1; + } /* If the loopback jumper is set, we enter DFU mode */ - if (board_override_enter_dfu()) - return 1; + if (board_override_enter_dfu()) { + return 2; + } /* if the first word of the application partition doesn't look * like a stack pointer (i.e. point to RAM), enter DFU mode */ - if ((app_part[0] < IRAM_ADDR) || - ((uint8_t *)app_part[0] > IRAM_END)) - return 1; + if ((app_part[0] < IRAM_ADDR) || ((uint8_t *)app_part[0] > IRAM_END)) { + return 3; + } /* if the second word of the application partition doesn't look * like a function from flash (reset vector), enter DFU mode */ if (((uint32_t *)app_part[1] < app_part) || - ((uint8_t *)app_part[1] > IFLASH_END)) - return 1; + ((uint8_t *)app_part[1] > IFLASH_END)) { + return 4; + } return 0; } @@ -218,7 +226,7 @@ EEFC_ReadUniqueID(g_unique_id); - printf("\n\r\n\r" + printf("\n\r\n\r" "=============================================================================\n\r" "DFU bootloader %s for board %s (C) 2010-2017 by Harald Welte\n\r" "=============================================================================\n\r", @@ -230,6 +238,35 @@ g_unique_id[2], g_unique_id[3]); TRACE_INFO("Reset Cause: 0x%x\n\r", reset_cause); +#if (TRACE_LEVEL >= TRACE_LEVEL_INFO) + /* Find out why we are in the DFU bootloader, and not the main application */ + TRACE_INFO("DFU bootloader start reason: "); + switch (USBDFU_OverrideEnterDFU()) { + case 0: + /* 0 normally means that there is no override, but we are in the bootloader, + * thus the first check in board_cstartup_gnu did return something else than 0. + * this can only be g_dfu->magic which is erased when the segment are + * relocated, which happens in board_cstartup_gnu just after USBDFU_OverrideEnterDFU. + * no static variable can be used to store this case since this will also be overwritten + */ + case 1: + TRACE_INFO_WP("DFU switch requested by main application\n\r"); + break; + case 2: + TRACE_INFO_WP("bootloader forced (button pressed or jumper set)\n\r"); + break; + case 3: + TRACE_INFO_WP("stack pointer (first application word) does no point in RAM\n\r"); + break; + case 4: // the is no reason + TRACE_INFO_WP("reset vector (second application word) does no point in flash\n\r"); + break; + default: + TRACE_INFO_WP("unknown\n\r"); + break; + } +#endif + /* clear g_dfu on power-up reset */ if (reset_cause == 0) memset(g_dfu, 0, sizeof(*g_dfu)); diff --git a/firmware/libboard/common/source/board_cstartup_gnu.c b/firmware/libboard/common/source/board_cstartup_gnu.c index 42231fb..bfe59ad 100644 --- a/firmware/libboard/common/source/board_cstartup_gnu.c +++ b/firmware/libboard/common/source/board_cstartup_gnu.c @@ -159,26 +159,12 @@ #if defined(BOARD_USB_DFU) && defined(APPLICATION_dfu) - /* we are before the text segment has been relocated, so g_dfu is - * not initialized yet */ - g_dfu = &_g_dfu; - if ((g_dfu->magic != USB_DFU_MAGIC) && !USBDFU_OverrideEnterDFU()) { - /* start application if valid - * the application starts with the vector table - * the first entry in the vector table is the initial stack pointer (SP) address - * the stack will be placed in RAM, which begins at 0x2000 0000 - * there is up to 48 KB of RAM (0xc000) - * since the stack grown "downwards" it should start at the end of the RAM: max 0x2000 c000 - * if the SP is not in this range (e.g. flash has been erased) there is no valid application - * the second entry in the vector table is the reset address, corresponding to the application start - */ - if (((*((uint32_t*)(IFLASH_ADDR+BOARD_DFU_BOOT_SIZE)))&0xFFFF0000)==0x20000000) { - UART_Exit(); - __disable_irq(); - BootIntoApp(); - /* Infinite loop */ - while ( 1 ) ; - } + if (!USBDFU_OverrideEnterDFU()) { + UART_Exit(); + __disable_irq(); + BootIntoApp(); + /* Infinite loop */ + while ( 1 ) ; } #endif -- To view, visit https://gerrit.osmocom.org/9913 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I82323e0f76c03f67df7dc8f2b6783166cc25f3aa Gerrit-Change-Number: 9913 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:24:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:24:54 +0000 Subject: Change in simtrace2[master]: host: set license to GPLv2+ In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9915 ) Change subject: host: set license to GPLv2+ ...................................................................... host: set license to GPLv2+ Change-Id: I0948d74874af1d3a0f1b4cbcb4a838e4ecd9fe3f --- M host/apdu_dispatch.c M host/apdu_dispatch.h M host/libusb_util.c M host/libusb_util.h M host/simtrace2-discovery.c M host/simtrace2-discovery.h M host/simtrace2-remsim.c M host/simtrace2-sniff.c M host/simtrace2_usb.c M host/usb2udp.c 10 files changed, 153 insertions(+), 40 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/host/apdu_dispatch.c b/host/apdu_dispatch.c index 6bdba9f..7c7ed01 100644 --- a/host/apdu_dispatch.c +++ b/host/apdu_dispatch.c @@ -2,20 +2,20 @@ * * (C) 2016 by Harald Welte * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 - * as published by the Free Software Foundation + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. * - * This program 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 General Public License for more details. + * This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; 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 General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - #include #include #include diff --git a/host/apdu_dispatch.h b/host/apdu_dispatch.h index c76c8ec..2c99858 100644 --- a/host/apdu_dispatch.h +++ b/host/apdu_dispatch.h @@ -1,3 +1,21 @@ +/* apdu_dispatch - State machine to determine Rx/Tx phases of APDU + * + * (C) 2016 by Harald Welte + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ #pragma once #include diff --git a/host/libusb_util.c b/host/libusb_util.c index 5ee685e..8565372 100644 --- a/host/libusb_util.c +++ b/host/libusb_util.c @@ -1,3 +1,21 @@ +/* libisb utilities + * + * (C) 2010-2016 by Harald Welte + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ #include #include #include diff --git a/host/libusb_util.h b/host/libusb_util.h index 5bbe3cb..2b2d92e 100644 --- a/host/libusb_util.h +++ b/host/libusb_util.h @@ -1,3 +1,21 @@ +/* libisb utilities + * + * (C) 2010-2016 by Harald Welte + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ #pragma once #include diff --git a/host/simtrace2-discovery.c b/host/simtrace2-discovery.c index 38868fb..a7306ce 100644 --- a/host/simtrace2-discovery.c +++ b/host/simtrace2-discovery.c @@ -1,3 +1,22 @@ +/* simtrace2-discovery - host PC library to scan for matching USB + * devices + * + * (C) 2016 by Harald Welte + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ #include #include diff --git a/host/simtrace2-discovery.h b/host/simtrace2-discovery.h index 539b471..cfba956 100644 --- a/host/simtrace2-discovery.h +++ b/host/simtrace2-discovery.h @@ -1,3 +1,22 @@ +/* simtrace2-discovery - host PC library to scan for matching USB + * devices + * + * (C) 2016 by Harald Welte + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ #pragma once #include diff --git a/host/simtrace2-remsim.c b/host/simtrace2-remsim.c index df38f77..462f73e 100644 --- a/host/simtrace2-remsim.c +++ b/host/simtrace2-remsim.c @@ -1,21 +1,22 @@ -/* simtrace2-remsim - main program for the host PC +/* simtrace2-remsim - main program for the host PC to provide a remote SIM + * using the SIMtrace 2 firmware in card emulation mode * - * (C) 2010-2017 by Harald Welte + * (C) 2016 by Harald Welte * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 - * as published by the Free Software Foundation + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. * - * This program 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 General Public License for more details. + * This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; 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 General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - #include #include #include diff --git a/host/simtrace2-sniff.c b/host/simtrace2-sniff.c index 67bfb79..b61b7d0 100644 --- a/host/simtrace2-sniff.c +++ b/host/simtrace2-sniff.c @@ -1,5 +1,10 @@ -/* simtrace2-sniff - main program for the host PC to communicate with the SIMtrace 2 firmware in sniffer mode */ -/* This program is free software; you can redistribute it and/or +/* simtrace2-sniff - main program for the host PC to communicate with the + * SIMtrace 2 firmware in sniffer mode + * + * (C) 2016 by Harald Welte + * (C) 2018 by sysmocom -s.f.m.c. GmbH, Author: Kevin Redon + * + * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. @@ -12,9 +17,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * (C) 2010-2017 by Harald Welte - * (C) 2018 by Kevin Redon */ #include #include diff --git a/host/simtrace2_usb.c b/host/simtrace2_usb.c index 2016670..cdfe29e 100644 --- a/host/simtrace2_usb.c +++ b/host/simtrace2_usb.c @@ -1,3 +1,21 @@ +/* simtrace2_usb - host PC application to list found SIMtrace 2 USB devices + * + * (C) 2016 by Harald Welte + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ #include #include #include diff --git a/host/usb2udp.c b/host/usb2udp.c index 7a1e4a3..c25920f 100644 --- a/host/usb2udp.c +++ b/host/usb2udp.c @@ -2,20 +2,20 @@ * * (C) 2010-2016 by Harald Welte * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 - * as published by the Free Software Foundation + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. * - * This program 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 General Public License for more details. + * This program 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 General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; 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 General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - #include #include #include -- To view, visit https://gerrit.osmocom.org/9915 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I0948d74874af1d3a0f1b4cbcb4a838e4ecd9fe3f Gerrit-Change-Number: 9915 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:24:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:24:55 +0000 Subject: Change in simtrace2[master]: firmware: set license to GPLv2+ In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9916 ) Change subject: firmware: set license to GPLv2+ ...................................................................... firmware: set license to GPLv2+ Change-Id: Id4c00159f984976b6d8641900fb64e36a3a30407 --- M firmware/apps/cardem/main.c M firmware/apps/dfu/main.c M firmware/apps/trace/main.c M firmware/apps/triple_play/main.c M firmware/libboard/common/include/board_common.h M firmware/libboard/common/include/board_lowlevel.h M firmware/libboard/common/include/boardver_adc.h M firmware/libboard/common/include/led.h M firmware/libboard/common/include/manifest.h M firmware/libboard/common/include/sim_switch.h M firmware/libboard/common/include/uart_console.h M firmware/libboard/common/source/board_cstartup_gnu.c M firmware/libboard/common/source/boardver_adc.c M firmware/libboard/common/source/led.c M firmware/libboard/common/source/manifest.c M firmware/libboard/common/source/sim_switch.c M firmware/libboard/owhw/include/board.h M firmware/libboard/owhw/source/owhw.c M firmware/libboard/qmod/include/board.h M firmware/libboard/qmod/include/card_pres.h M firmware/libboard/qmod/include/i2c.h M firmware/libboard/qmod/include/wwan_led.h M firmware/libboard/qmod/include/wwan_perst.h M firmware/libboard/qmod/source/board_qmod.c M firmware/libboard/qmod/source/card_pres.c M firmware/libboard/qmod/source/i2c.c M firmware/libboard/qmod/source/wwan_led.c M firmware/libboard/qmod/source/wwan_perst.c M firmware/libboard/simtrace/include/board.h M firmware/libboard/simtrace/source/board_simtrace.c M firmware/libcommon/include/card_emu.h M firmware/libcommon/include/iso7816_fidi.h M firmware/libcommon/include/llist_irqsafe.h M firmware/libcommon/include/ringbuffer.h M firmware/libcommon/include/simtrace.h M firmware/libcommon/include/simtrace_prot.h M firmware/libcommon/include/simtrace_usb.h M firmware/libcommon/include/stdio.h M firmware/libcommon/include/talloc.h M firmware/libcommon/include/usb_buf.h M firmware/libcommon/include/utils.h M firmware/libcommon/source/card_emu.c M firmware/libcommon/source/fputs.c M firmware/libcommon/source/host_communication.c M firmware/libcommon/source/iso7816_fidi.c M firmware/libcommon/source/mode_cardemu.c M firmware/libcommon/source/pseudo_talloc.c M firmware/libcommon/source/ringbuffer.c M firmware/libcommon/source/sniffer.c M firmware/libcommon/source/tc_etu.c M firmware/libcommon/source/usb_buf.c 51 files changed, 791 insertions(+), 118 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/apps/cardem/main.c b/firmware/apps/cardem/main.c index 2114901..9241c06 100644 --- a/firmware/apps/cardem/main.c +++ b/firmware/apps/cardem/main.c @@ -1,4 +1,21 @@ -// FIXME: Copyright license here +/* SIMtrace 2 firmware card emulation application + * + * (C) 2015-2017 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ /*------------------------------------------------------------------------------ * Headers *------------------------------------------------------------------------------*/ diff --git a/firmware/apps/dfu/main.c b/firmware/apps/dfu/main.c index 467b7dd..74268ad 100644 --- a/firmware/apps/dfu/main.c +++ b/firmware/apps/dfu/main.c @@ -1,3 +1,22 @@ +/* SIMtrace 2 firmware USB DFU bootloader + * + * (C) 2015-2017 by Harald Welte + * (C) 2018 by sysmocom -s.f.m.c. GmbH, Author: Kevin Redon + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ #include "board.h" #include "utils.h" #include "usb/device/dfu/dfu.h" diff --git a/firmware/apps/trace/main.c b/firmware/apps/trace/main.c index 754e905..d2fddf9 100644 --- a/firmware/apps/trace/main.c +++ b/firmware/apps/trace/main.c @@ -1,4 +1,22 @@ -// FIXME: Copyright license here +/* SIMtrace 2 firmware sniffer application + * + * (C) 2015-2017 by Harald Welte + * (C) 2018 by sysmocom -s.f.m.c. GmbH, Author: Kevin Redon + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ /*------------------------------------------------------------------------------ * Headers *------------------------------------------------------------------------------*/ diff --git a/firmware/apps/triple_play/main.c b/firmware/apps/triple_play/main.c index 75fcb36..47d53af 100644 --- a/firmware/apps/triple_play/main.c +++ b/firmware/apps/triple_play/main.c @@ -1,4 +1,21 @@ -// FIXME: Copyright license here +/* SIMtrace 2 firmware card emulation, CCID, and sniffer application + * + * (C) 2015-2017 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ /*------------------------------------------------------------------------------ * Headers *------------------------------------------------------------------------------*/ diff --git a/firmware/libboard/common/include/board_common.h b/firmware/libboard/common/include/board_common.h index a995d88..06d3d6a 100644 --- a/firmware/libboard/common/include/board_common.h +++ b/firmware/libboard/common/include/board_common.h @@ -1,3 +1,19 @@ +/* SIMtrace 2 common board pin definitions + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #ifndef _BOARD_ #define _BOARD_ diff --git a/firmware/libboard/common/include/board_lowlevel.h b/firmware/libboard/common/include/board_lowlevel.h index cc6cdbe..19d4f9e 100644 --- a/firmware/libboard/common/include/board_lowlevel.h +++ b/firmware/libboard/common/include/board_lowlevel.h @@ -26,7 +26,6 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ---------------------------------------------------------------------------- */ - /** * \file * diff --git a/firmware/libboard/common/include/boardver_adc.h b/firmware/libboard/common/include/boardver_adc.h index a89d630..9b01d0a 100644 --- a/firmware/libboard/common/include/boardver_adc.h +++ b/firmware/libboard/common/include/boardver_adc.h @@ -1,3 +1,17 @@ +/* This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #pragma once int get_board_version_adc(void); diff --git a/firmware/libboard/common/include/led.h b/firmware/libboard/common/include/led.h index 4e29c0e..0c851f0 100644 --- a/firmware/libboard/common/include/led.h +++ b/firmware/libboard/common/include/led.h @@ -1,3 +1,17 @@ +/* This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #pragma once enum led { diff --git a/firmware/libboard/common/include/manifest.h b/firmware/libboard/common/include/manifest.h index 6c1b202..b29c1aa 100644 --- a/firmware/libboard/common/include/manifest.h +++ b/firmware/libboard/common/include/manifest.h @@ -1,4 +1,17 @@ - +/* This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #ifndef _MANIFEST_H #define _MANIFEST_H diff --git a/firmware/libboard/common/include/sim_switch.h b/firmware/libboard/common/include/sim_switch.h index 16c5aa3..3d131f2 100644 --- a/firmware/libboard/common/include/sim_switch.h +++ b/firmware/libboard/common/include/sim_switch.h @@ -1,3 +1,17 @@ +/* This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #pragma once int sim_switch_use_physical(unsigned int nr, int physical); diff --git a/firmware/libboard/common/include/uart_console.h b/firmware/libboard/common/include/uart_console.h index 0e49bfd..c0ee3a7 100644 --- a/firmware/libboard/common/include/uart_console.h +++ b/firmware/libboard/common/include/uart_console.h @@ -2,6 +2,7 @@ * ATMEL Microcontroller Software Support * ---------------------------------------------------------------------------- * Copyright (c) 2009, Atmel Corporation + * Copyright (c) 2018, sysmocom -s.f.m.c. GmbH, Author: Kevin Redon * * All rights reserved. * @@ -26,8 +27,6 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ---------------------------------------------------------------------------- */ - - #ifndef _UART_CONSOLE_ #define _UART_CONSOLE_ diff --git a/firmware/libboard/common/source/board_cstartup_gnu.c b/firmware/libboard/common/source/board_cstartup_gnu.c index bfe59ad..c46d42f 100644 --- a/firmware/libboard/common/source/board_cstartup_gnu.c +++ b/firmware/libboard/common/source/board_cstartup_gnu.c @@ -2,7 +2,8 @@ * ATMEL Microcontroller Software Support * ---------------------------------------------------------------------------- * Copyright (c) 2010, Atmel Corporation - * Copyright (C) 2017, Harald Welte + * Copyright (c) 2017, Harald Welte + * Copyright (c) 2018, sysmocom -s.f.m.c. GmbH, Author: Kevin Redon * * All rights reserved. * diff --git a/firmware/libboard/common/source/boardver_adc.c b/firmware/libboard/common/source/boardver_adc.c index ca3d1fe..f204aa1 100644 --- a/firmware/libboard/common/source/boardver_adc.c +++ b/firmware/libboard/common/source/boardver_adc.c @@ -1,3 +1,17 @@ +/* This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #include "board.h" #include "boardver_adc.h" diff --git a/firmware/libboard/common/source/led.c b/firmware/libboard/common/source/led.c index 00082e2..cffff70 100644 --- a/firmware/libboard/common/source/led.c +++ b/firmware/libboard/common/source/led.c @@ -1,3 +1,22 @@ +/* LED control + * + * (C) 2015-2017 by Harald Welte + * (C) 2018 by sysmocom -s.f.m.c. GmbH, Author: Kevin Redon + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #include #include #include diff --git a/firmware/libboard/common/source/manifest.c b/firmware/libboard/common/source/manifest.c index e6d8d59..0ad537c 100644 --- a/firmware/libboard/common/source/manifest.c +++ b/firmware/libboard/common/source/manifest.c @@ -1,4 +1,17 @@ - +/* This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #include "manifest.h" const char *manifest_application = APPLICATION; diff --git a/firmware/libboard/common/source/sim_switch.c b/firmware/libboard/common/source/sim_switch.c index bad7291..59513ad 100644 --- a/firmware/libboard/common/source/sim_switch.c +++ b/firmware/libboard/common/source/sim_switch.c @@ -1,5 +1,21 @@ -/* Code to switch between local (physical) and remote (emulated) SIM */ - +/* Code to switch between local (physical) and remote (emulated) SIM + * + * (C) 2015-2017 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #include "board.h" #include "trace.h" #include "led.h" diff --git a/firmware/libboard/owhw/include/board.h b/firmware/libboard/owhw/include/board.h index def3d8b..be6bb17 100644 --- a/firmware/libboard/owhw/include/board.h +++ b/firmware/libboard/owhw/include/board.h @@ -1,3 +1,21 @@ +/* OWHW board definition + * + * (C) 2015-2017 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #pragma once #include "board_common.h" #include "simtrace_usb.h" diff --git a/firmware/libboard/owhw/source/owhw.c b/firmware/libboard/owhw/source/owhw.c index d1e54e6..c5cbf7b 100644 --- a/firmware/libboard/owhw/source/owhw.c +++ b/firmware/libboard/owhw/source/owhw.c @@ -1,20 +1,20 @@ -/* Card simulator specific functions */ -/* (C) 2015 by Harald Welte +/* Card simulator specific functions * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * (C) 2015-2017 by Harald Welte * - * This program 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 General Public License for more details. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program 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 General Public License for more details. * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA */ #include "chip.h" diff --git a/firmware/libboard/qmod/include/board.h b/firmware/libboard/qmod/include/board.h index 2db94ab..c23ad50 100644 --- a/firmware/libboard/qmod/include/board.h +++ b/firmware/libboard/qmod/include/board.h @@ -1,3 +1,21 @@ +/* sysmocom quad-modem sysmoQMOD board definition + * + * (C) 2016-2017 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #pragma once #include "board_common.h" #include "simtrace_usb.h" diff --git a/firmware/libboard/qmod/include/card_pres.h b/firmware/libboard/qmod/include/card_pres.h index fd7f065..81f0613 100644 --- a/firmware/libboard/qmod/include/card_pres.h +++ b/firmware/libboard/qmod/include/card_pres.h @@ -1,3 +1,21 @@ +/* card presence utilities + * + * (C) 2016-2017 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #pragma once int is_card_present(int port); diff --git a/firmware/libboard/qmod/include/i2c.h b/firmware/libboard/qmod/include/i2c.h index 15e4b37..30f57ce 100644 --- a/firmware/libboard/qmod/include/i2c.h +++ b/firmware/libboard/qmod/include/i2c.h @@ -1,3 +1,19 @@ +/* I2C EEPROM memory read and write utilities + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #pragma once void i2c_pin_init(void); diff --git a/firmware/libboard/qmod/include/wwan_led.h b/firmware/libboard/qmod/include/wwan_led.h index 7ba72ea..77887c7 100644 --- a/firmware/libboard/qmod/include/wwan_led.h +++ b/firmware/libboard/qmod/include/wwan_led.h @@ -1,3 +1,19 @@ +/* Code to read/track the status of the WWAN LEDs of attached modems + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #pragma once int wwan_led_active(int wwan); diff --git a/firmware/libboard/qmod/include/wwan_perst.h b/firmware/libboard/qmod/include/wwan_perst.h index 979fe83..c934afc 100644 --- a/firmware/libboard/qmod/include/wwan_perst.h +++ b/firmware/libboard/qmod/include/wwan_perst.h @@ -1,3 +1,19 @@ +/* Code to control the PERST lines of attached modems + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #pragma once int wwan_perst_set(int modem_nr, int active); diff --git a/firmware/libboard/qmod/source/board_qmod.c b/firmware/libboard/qmod/source/board_qmod.c index 0eda1ef..7ae1978 100644 --- a/firmware/libboard/qmod/source/board_qmod.c +++ b/firmware/libboard/qmod/source/board_qmod.c @@ -1,6 +1,21 @@ -/* Quad-modem speciic application code */ -/* (C) 2016-2016 by Harald Welte */ - +/* sysmocom quad-modem sysmoQMOD application code + * + * (C) 2016-2017 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #include "board.h" #include "simtrace.h" #include "utils.h" diff --git a/firmware/libboard/qmod/source/card_pres.c b/firmware/libboard/qmod/source/card_pres.c index 0cd34f0..7a32b57 100644 --- a/firmware/libboard/qmod/source/card_pres.c +++ b/firmware/libboard/qmod/source/card_pres.c @@ -1,3 +1,21 @@ +/* card presence utilities + * + * (C) 2016-2017 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #include #include "board.h" #include "utils.h" diff --git a/firmware/libboard/qmod/source/i2c.c b/firmware/libboard/qmod/source/i2c.c index 607f247..06c7565 100644 --- a/firmware/libboard/qmod/source/i2c.c +++ b/firmware/libboard/qmod/source/i2c.c @@ -1,3 +1,19 @@ +/* I2C EEPROM memory read and write utilities + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #include "board.h" #include diff --git a/firmware/libboard/qmod/source/wwan_led.c b/firmware/libboard/qmod/source/wwan_led.c index d95b31c..b3b5693 100644 --- a/firmware/libboard/qmod/source/wwan_led.c +++ b/firmware/libboard/qmod/source/wwan_led.c @@ -1,11 +1,24 @@ /* Code to read/track the status of the WWAN LEDs of attached modems * - * Depending on the board this is running on, it might be possible + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ +/* Depending on the board this is running on, it might be possible * for the controller to read the status of the WWAN LED output lines of * the cellular modem. If the board supports this, it sets the * PIN_WWAN1 and/or PIN_WWAN2 defines in its board.h file. */ - #include "board.h" #include "wwan_led.h" diff --git a/firmware/libboard/qmod/source/wwan_perst.c b/firmware/libboard/qmod/source/wwan_perst.c index a6d7dd2..95a7c7b 100644 --- a/firmware/libboard/qmod/source/wwan_perst.c +++ b/firmware/libboard/qmod/source/wwan_perst.c @@ -1,11 +1,24 @@ /* Code to control the PERST lines of attached modems * - * Depending on the board this is running on, it might be possible + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ +/* Depending on the board this is running on, it might be possible * for the controller to set the status of the PERST input line of * the cellular modem. If the board supports this, it sets the * PIN_PERST1 and/or PIN_PERST2 defines in its board.h file. */ - #include "board.h" #include "trace.h" #include "wwan_perst.h" diff --git a/firmware/libboard/simtrace/include/board.h b/firmware/libboard/simtrace/include/board.h index b21d4fb..db3a925 100644 --- a/firmware/libboard/simtrace/include/board.h +++ b/firmware/libboard/simtrace/include/board.h @@ -1,3 +1,22 @@ +/* SIMtrace with SAM3S board definition + * + * (C) 2016-2017 by Harald Welte + * (C) 2018 by sysmocom -s.f.m.c. GmbH, Author: Kevin Redon + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #pragma once #include "board_common.h" #include "simtrace_usb.h" diff --git a/firmware/libboard/simtrace/source/board_simtrace.c b/firmware/libboard/simtrace/source/board_simtrace.c index 90bf9bc..9d323cf 100644 --- a/firmware/libboard/simtrace/source/board_simtrace.c +++ b/firmware/libboard/simtrace/source/board_simtrace.c @@ -1,6 +1,22 @@ -/* SIMtrace specific application code */ -/* (C) 2017 by Harald Welte */ - +/* SIMtrace with SAM3S specific application code + * + * (C) 2017 by Harald Welte + * (C) 2018 by sysmocom -s.f.m.c. GmbH, Author: Kevin Redon + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #include "board.h" #include "simtrace.h" #include "utils.h" diff --git a/firmware/libcommon/include/card_emu.h b/firmware/libcommon/include/card_emu.h index 43279f8..7144168 100644 --- a/firmware/libcommon/include/card_emu.h +++ b/firmware/libcommon/include/card_emu.h @@ -1,3 +1,21 @@ +/* ISO7816-3 state machine for the card side + * + * (C) 2010-2017 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #pragma once #include diff --git a/firmware/libcommon/include/iso7816_fidi.h b/firmware/libcommon/include/iso7816_fidi.h index 3b4b451..c56478b 100644 --- a/firmware/libcommon/include/iso7816_fidi.h +++ b/firmware/libcommon/include/iso7816_fidi.h @@ -1,3 +1,21 @@ +/* ISO7816-3 Fi/Di tables + computation + * + * (C) 2010-2015 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #pragma once #include diff --git a/firmware/libcommon/include/llist_irqsafe.h b/firmware/libcommon/include/llist_irqsafe.h index d9c003d..9171ccf 100644 --- a/firmware/libcommon/include/llist_irqsafe.h +++ b/firmware/libcommon/include/llist_irqsafe.h @@ -1,3 +1,21 @@ +/* IRQ-safe linked lists + * + * (C) 2015-2017 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #pragma once #include diff --git a/firmware/libcommon/include/ringbuffer.h b/firmware/libcommon/include/ringbuffer.h index aa200ba..a6eddc9 100644 --- a/firmware/libcommon/include/ringbuffer.h +++ b/firmware/libcommon/include/ringbuffer.h @@ -1,3 +1,19 @@ +/* Ring buffer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #ifndef SIMTRACE_RINGBUF_H #define SIMTRACE_RINGBUF_H diff --git a/firmware/libcommon/include/simtrace.h b/firmware/libcommon/include/simtrace.h index 3c414bc..5edea17 100644 --- a/firmware/libcommon/include/simtrace.h +++ b/firmware/libcommon/include/simtrace.h @@ -1,3 +1,21 @@ +/* SIMtrace 2 mode definitions + * + * (C) 2015-2017 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #ifndef SIMTRACE_H #define SIMTRACE_H diff --git a/firmware/libcommon/include/simtrace_prot.h b/firmware/libcommon/include/simtrace_prot.h index a43ac72..1e9d72f 100644 --- a/firmware/libcommon/include/simtrace_prot.h +++ b/firmware/libcommon/include/simtrace_prot.h @@ -1,21 +1,21 @@ -/* SIMtrace2 USB protocol */ - -/* (C) 2015-2017 by Harald Welte +/* SIMtrace2 USB protocol * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * (C) 2015-2017 by Harald Welte + * (C) 2018 by sysmocom -s.f.m.c. GmbH, Author: Kevin Redon * - * This program 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 General Public License for more details. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program 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 General Public License for more details. * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA */ #pragma once diff --git a/firmware/libcommon/include/simtrace_usb.h b/firmware/libcommon/include/simtrace_usb.h index 969d890..c0da9c5 100644 --- a/firmware/libcommon/include/simtrace_usb.h +++ b/firmware/libcommon/include/simtrace_usb.h @@ -1,7 +1,11 @@ -/* This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. +/* SIMtrace 2 USB definitions + * + * (C) 2018 by sysmocom -s.f.m.c. GmbH, Author: Kevin Redon + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -10,12 +14,8 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * (C) 2018 by sysmocom -s.f.m.c. GmbH, Author: Kevin Redon - * All Rights Reserved + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA */ - /* SIMtrace USB IDs */ #define USB_VENDOR_OPENMOKO 0x1d50 #define USB_PRODUCT_OWHW_SAM3_DFU 0x4001 /* was 0x4000 */ diff --git a/firmware/libcommon/include/stdio.h b/firmware/libcommon/include/stdio.h index 24bf861..7695d20 100644 --- a/firmware/libcommon/include/stdio.h +++ b/firmware/libcommon/include/stdio.h @@ -1,3 +1,31 @@ +/* ---------------------------------------------------------------------------- + * ATMEL Microcontroller Software Support + * ---------------------------------------------------------------------------- + * Copyright (c) 2008, Atmel Corporation + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the disclaimer below. + * + * Atmel's name may not be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * ---------------------------------------------------------------------------- + */ #pragma once #include #include diff --git a/firmware/libcommon/include/talloc.h b/firmware/libcommon/include/talloc.h index f2d9666..0bd75d2 100644 --- a/firmware/libcommon/include/talloc.h +++ b/firmware/libcommon/include/talloc.h @@ -1,3 +1,19 @@ +/* Memory allocation library + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #pragma once #include diff --git a/firmware/libcommon/include/usb_buf.h b/firmware/libcommon/include/usb_buf.h index 7171c68..bd6947b 100644 --- a/firmware/libcommon/include/usb_buf.h +++ b/firmware/libcommon/include/usb_buf.h @@ -1,3 +1,19 @@ +/* USB buffer library + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #pragma once #include diff --git a/firmware/libcommon/include/utils.h b/firmware/libcommon/include/utils.h index b9af1f6..2c966f9 100644 --- a/firmware/libcommon/include/utils.h +++ b/firmware/libcommon/include/utils.h @@ -1,3 +1,19 @@ +/* General utilities + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #pragma once #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) diff --git a/firmware/libcommon/source/card_emu.c b/firmware/libcommon/source/card_emu.c index 7aa3fc0..9291064 100644 --- a/firmware/libcommon/source/card_emu.c +++ b/firmware/libcommon/source/card_emu.c @@ -1,24 +1,21 @@ -/* ISO7816-3 state machine for the card side */ -/* (C) 2010-2017 by Harald Welte +/* ISO7816-3 state machine for the card side * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * (C) 2010-2017 by Harald Welte * - * This program 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 General Public License for more details. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program 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 General Public License for more details. * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA */ - -//#define TRACE_LEVEL 6 - #include #include #include diff --git a/firmware/libcommon/source/fputs.c b/firmware/libcommon/source/fputs.c index f7add10..ca6f851 100644 --- a/firmware/libcommon/source/fputs.c +++ b/firmware/libcommon/source/fputs.c @@ -1,3 +1,19 @@ +/* UART print output + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #include #include "uart_console.h" diff --git a/firmware/libcommon/source/host_communication.c b/firmware/libcommon/source/host_communication.c index 75e1779..783c976 100644 --- a/firmware/libcommon/source/host_communication.c +++ b/firmware/libcommon/source/host_communication.c @@ -1,3 +1,19 @@ +/* USB communication methods + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #include "board.h" #include "llist_irqsafe.h" #include "usb_buf.h" diff --git a/firmware/libcommon/source/iso7816_fidi.c b/firmware/libcommon/source/iso7816_fidi.c index bdccd55..1c70467 100644 --- a/firmware/libcommon/source/iso7816_fidi.c +++ b/firmware/libcommon/source/iso7816_fidi.c @@ -1,22 +1,21 @@ -/* ISO7816-3 Fi/Di tables + computation */ -/* (C) 2010-2015 by Harald Welte +/* ISO7816-3 Fi/Di tables + computation * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * (C) 2010-2015 by Harald Welte * - * This program 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 General Public License for more details. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program 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 General Public License for more details. * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA */ - #include #include diff --git a/firmware/libcommon/source/mode_cardemu.c b/firmware/libcommon/source/mode_cardemu.c index 104691f..bc91273 100644 --- a/firmware/libcommon/source/mode_cardemu.c +++ b/firmware/libcommon/source/mode_cardemu.c @@ -1,5 +1,21 @@ -//#define TRACE_LEVEL 6 - +/* card emulation mode + * + * (C) 2015-2017 by Harald Welte + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #include "board.h" #include "simtrace.h" #include "ringbuffer.h" diff --git a/firmware/libcommon/source/pseudo_talloc.c b/firmware/libcommon/source/pseudo_talloc.c index c9722ba..564c3ef 100644 --- a/firmware/libcommon/source/pseudo_talloc.c +++ b/firmware/libcommon/source/pseudo_talloc.c @@ -1,3 +1,19 @@ +/* Memory allocation library + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #include #include "talloc.h" diff --git a/firmware/libcommon/source/ringbuffer.c b/firmware/libcommon/source/ringbuffer.c index b8cd5c6..70747a1 100644 --- a/firmware/libcommon/source/ringbuffer.c +++ b/firmware/libcommon/source/ringbuffer.c @@ -1,8 +1,24 @@ +/* Ring buffer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #include "ringbuffer.h" #include "trace.h" #include "utils.h" -/* WARNINGI: Since console output is internally using this ringbuffer to implement +/* WARNING: Since console output is internally using this ringbuffer to implement * buffered writes, we cannot use any TRACE_*() or printf() style functions here, * as it would create infinite recursion! */ diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 87e6d32..5ab60bb 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -1,25 +1,29 @@ -/* - * (C) 2010-2017 by Harald Welte - * (C) 2018 by Kevin Redon - * All Rights Reserved +/* SIMtrace 2 sniffer mode + * + * (C) 2016-2017 by Harald Welte + * (C) 2018 by sysmocom -s.f.m.c. GmbH, Author: Kevin Redon * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 Affero General Public License for more details. + * GNU General Public License for more details. * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA */ -/* This code implement the Sniffer mode to sniff the communication between a SIM card (or any ISO 7816 smart card) and a phone (or any ISO 7816 card reader). - * For historical reasons (i.e. SIMtrace hardware) the USART peripheral connected to the SIM card is used. - * TODO put common ISO7816-3 code is separate library (and combine clean with iso7816_4) +/* This code implement the Sniffer mode to sniff the communication between a + * SIM card (or any ISO 7816 smart card) and a phone (or any ISO 7816 card + * reader). + * For historical reasons (i.e. SIMtrace hardware) the USART peripheral + * connected to the SIM card is used. + * TODO put common ISO7816-3 code is separate library (and combine clean with + * iso7816_4) */ #include "board.h" #include "simtrace.h" diff --git a/firmware/libcommon/source/tc_etu.c b/firmware/libcommon/source/tc_etu.c index f3eb039..04a7324 100644 --- a/firmware/libcommon/source/tc_etu.c +++ b/firmware/libcommon/source/tc_etu.c @@ -1,23 +1,21 @@ -/* SIMtrace TC (Timer / Clock) code for ETU tracking */ - -/* (C) 2006-2016 by Harald Welte +/* SIMtrace TC (Timer / Clock) code for ETU tracking * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * (C) 2006-2016 by Harald Welte * - * This program 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 General Public License for more details. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * This program 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 General Public License for more details. * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA */ - #include #include "utils.h" diff --git a/firmware/libcommon/source/usb_buf.c b/firmware/libcommon/source/usb_buf.c index b8d4dd7..418569e 100644 --- a/firmware/libcommon/source/usb_buf.c +++ b/firmware/libcommon/source/usb_buf.c @@ -1,3 +1,19 @@ +/* USB buffer library + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ #include "board.h" #include "trace.h" #include "usb_buf.h" -- To view, visit https://gerrit.osmocom.org/9916 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Id4c00159f984976b6d8641900fb64e36a3a30407 Gerrit-Change-Number: 9916 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:24:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:24:57 +0000 Subject: Change in simtrace2[master]: set linux end of line In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9917 ) Change subject: set linux end of line ...................................................................... set linux end of line Change-Id: I5200f0d6f39b0641cac26a4109a3cd33e8474b9b --- M firmware/atmel_softpack_libraries/libchip_sam3s/include/efc.h M firmware/atmel_softpack_libraries/libchip_sam3s/include/flashd.h M firmware/atmel_softpack_libraries/libchip_sam3s/source/USBD_HAL.c M firmware/atmel_softpack_libraries/libchip_sam3s/source/efc.c M firmware/atmel_softpack_libraries/libchip_sam3s/source/exceptions.c M firmware/atmel_softpack_libraries/libchip_sam3s/source/flashd.c M firmware/atmel_softpack_libraries/libchip_sam3s/source/pio.c M firmware/atmel_softpack_libraries/libchip_sam3s/source/pio_it.c M firmware/atmel_softpack_libraries/libchip_sam3s/source/pmc.c M firmware/atmel_softpack_libraries/libchip_sam3s/source/spi.c M firmware/atmel_softpack_libraries/libchip_sam3s/source/tc.c M firmware/atmel_softpack_libraries/libchip_sam3s/source/usart.c M firmware/atmel_softpack_libraries/libchip_sam3s/source/wdt.c M firmware/libboard/common/source/board_cstartup_gnu.c M firmware/libboard/common/source/board_lowlevel.c M firmware/libboard/common/source/uart_console.c 16 files changed, 6,071 insertions(+), 6,071 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved -- To view, visit https://gerrit.osmocom.org/9917 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I5200f0d6f39b0641cac26a4109a3cd33e8474b9b Gerrit-Change-Number: 9917 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:24:59 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:24:59 +0000 Subject: Change in simtrace2[master]: cosmetic: put spaces around operations In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9919 ) Change subject: cosmetic: put spaces around operations ...................................................................... cosmetic: put spaces around operations Change-Id: If5ba5f8d16680e8403944274336ea595017063db --- M firmware/libcommon/source/sniffer.c 1 file changed, 72 insertions(+), 72 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 5ab60bb..81a6712 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -208,10 +208,10 @@ static uint8_t wt_wi = 10; /* Waiting time Integer (WI), used to calculate the Waiting Time (WT) */ static uint8_t wt_d = 1; /* baud rate adjustment integer (the actual value, not the table index) */ - if (0!=wi) { + if (0 != wi) { wt_wi = wi; } - if (0!=d) { + if (0 != d) { wt_d = d; } wt = wt_wi*960UL*wt_d; @@ -257,7 +257,7 @@ static void change_state(enum iso7816_3_sniff_state iso_state_new) { /* sanity check */ - if (iso_state_new==iso_state) { + if (iso_state_new == iso_state) { TRACE_WARNING("Already in ISO 7816 state %u\n\r", iso_state); return; } @@ -303,11 +303,11 @@ static void usb_send_atr(bool complete) { /* Check state */ - if (ISO7816_S_IN_ATR!=iso_state) { + if (ISO7816_S_IN_ATR != iso_state) { TRACE_WARNING("Can't print ATR in ISO 7816-3 state %u\n\r", iso_state); return; } - if (atr_i>=ARRAY_SIZE(atr)) { + if (atr_i >= ARRAY_SIZE(atr)) { TRACE_ERROR("ATR buffer overflow\n\r"); return; } @@ -346,11 +346,11 @@ static uint8_t i = 0; /* interface byte subgroup number */ /* sanity check */ - if (ISO7816_S_IN_ATR!=iso_state) { + if (ISO7816_S_IN_ATR != iso_state) { TRACE_ERROR("Processing ATR data in wrong ISO 7816-3 state %u\n\r", iso_state); return; } - if (atr_i>=ARRAY_SIZE(atr)) { + if (atr_i >= ARRAY_SIZE(atr)) { TRACE_ERROR("ATR data overflow\n\r"); return; } @@ -377,37 +377,37 @@ break; case ATR_S_WAIT_T0: /* see ISO/IEC 7816-3:2006 section 8.2.2 */ case ATR_S_WAIT_TD: /* see ISO/IEC 7816-3:2006 section 8.2.3 */ - if (ATR_S_WAIT_T0==atr_state) { - atr_hist_len = (byte&0x0f); /* save the number of historical bytes */ - } else if (ATR_S_WAIT_TD==atr_state) { - t_protocol_support |= (1<<(byte&0x0f)); /* remember supported protocol to know if TCK will be present */ + if (ATR_S_WAIT_T0 == atr_state) { + atr_hist_len = (byte & 0x0f); /* save the number of historical bytes */ + } else if (ATR_S_WAIT_TD == atr_state) { + t_protocol_support |= (1<<(byte & 0x0f)); /* remember supported protocol to know if TCK will be present */ } - y = (byte&0xf0); /* remember upcoming interface bytes */ + y = (byte & 0xf0); /* remember upcoming interface bytes */ i++; /* next interface byte sub-group is coming */ - if (y&0x10) { + if (y & 0x10) { atr_state = ATR_S_WAIT_TA; /* wait for interface byte TA */ break; } case ATR_S_WAIT_TA: /* see ISO/IEC 7816-3:2006 section 8.2.3 */ - if (y&0x20) { + if (y & 0x20) { atr_state = ATR_S_WAIT_TB; /* wait for interface byte TB */ break; } case ATR_S_WAIT_TB: /* see ISO/IEC 7816-3:2006 section 8.2.3 */ - if (y&0x40) { + if (y & 0x40) { atr_state = ATR_S_WAIT_TC; /* wait for interface byte TC */ break; } case ATR_S_WAIT_TC: /* see ISO/IEC 7816-3:2006 section 8.2.3 */ /* retrieve WI encoded in TC2*/ if (ATR_S_WAIT_TC==atr_state && 2==i) { - if (0==byte) { + if (0 == byte) { update_wt(10, 0); } else { update_wt(byte, 0); } } - if (y&0x80) { + if (y & 0x80) { atr_state = ATR_S_WAIT_TD; /* wait for interface byte TD */ break; } else if (atr_hist_len) { @@ -418,8 +418,8 @@ if (atr_hist_len) { atr_hist_len--; } - if (0==atr_hist_len) { - if (t_protocol_support>1) { + if (0 == atr_hist_len) { + if (t_protocol_support > 1) { atr_state = ATR_S_WAIT_TCK; /* wait for check bytes */ break; } @@ -445,9 +445,9 @@ uint8_t *pps_cur; /* current PPS (request or response) */ /* Sanity check */ - if (ISO7816_S_IN_PPS_REQ==iso_state) { + if (ISO7816_S_IN_PPS_REQ == iso_state) { pps_cur = pps_req; - } else if (ISO7816_S_IN_PPS_RSP==iso_state) { + } else if (ISO7816_S_IN_PPS_RSP == iso_state) { pps_cur = pps_rsp; } else { TRACE_ERROR("Can't print PPS in ISO 7816-3 state %u\n\r", iso_state); @@ -457,22 +457,22 @@ /* Get only relevant data */ uint8_t pps[6]; uint8_t pps_i = 0; - if (pps_state>PPS_S_WAIT_PPSS) { + if (pps_state > PPS_S_WAIT_PPSS) { pps[pps_i++] = pps_cur[0]; } - if (pps_state>PPS_S_WAIT_PPS0) { + if (pps_state > PPS_S_WAIT_PPS0) { pps[pps_i++] = pps_cur[1]; } - if (pps_state>PPS_S_WAIT_PPS1 && pps_cur[1]&0x10) { + if (pps_state > PPS_S_WAIT_PPS1 && pps_cur[1] & 0x10) { pps[pps_i++] = pps_cur[2]; } - if (pps_state>PPS_S_WAIT_PPS2 && pps_cur[1]&0x20) { + if (pps_state > PPS_S_WAIT_PPS2 && pps_cur[1] & 0x20) { pps[pps_i++] = pps_cur[3]; } - if (pps_state>PPS_S_WAIT_PPS3 && pps_cur[1]&0x40) { + if (pps_state > PPS_S_WAIT_PPS3 && pps_cur[1] & 0x40) { pps[pps_i++] = pps_cur[4]; } - if (pps_state>PPS_S_WAIT_PCK) { + if (pps_state > PPS_S_WAIT_PCK) { pps[pps_i++] = pps_cur[5]; } @@ -520,9 +520,9 @@ uint8_t *pps_cur; /* current PPS (request or response) */ /* sanity check */ - if (ISO7816_S_IN_PPS_REQ==iso_state) { + if (ISO7816_S_IN_PPS_REQ == iso_state) { pps_cur = pps_req; - } else if (ISO7816_S_IN_PPS_RSP==iso_state) { + } else if (ISO7816_S_IN_PPS_RSP == iso_state) { pps_cur = pps_rsp; } else { TRACE_ERROR("Processing PPS data in wrong ISO 7816-3 state %u\n\r", iso_state); @@ -542,19 +542,19 @@ break; case PPS_S_WAIT_PPS0: /*!< format byte */ pps_cur[1] = byte; - if (pps_cur[1]&0x10) { + if (pps_cur[1] & 0x10) { pps_state = PPS_S_WAIT_PPS1; /* go to next state */ break; } case PPS_S_WAIT_PPS1: /*!< first parameter byte */ pps_cur[2] = byte; /* not always right but doesn't affect the process */ - if (pps_cur[1]&0x20) { + if (pps_cur[1] & 0x20) { pps_state = PPS_S_WAIT_PPS2; /* go to next state */ break; } case PPS_S_WAIT_PPS2: /*!< second parameter byte */ pps_cur[3] = byte; /* not always right but doesn't affect the process */ - if (pps_cur[1]&0x40) { + if (pps_cur[1] & 0x40) { pps_state = PPS_S_WAIT_PPS3; /* go to next state */ break; } @@ -568,30 +568,30 @@ uint8_t check = 0; check ^= pps_cur[0]; check ^= pps_cur[1]; - if (pps_cur[1]&0x10) { + if (pps_cur[1] & 0x10) { check ^= pps_cur[2]; } - if (pps_cur[1]&0x20) { + if (pps_cur[1] & 0x20) { check ^= pps_cur[3]; } - if (pps_cur[1]&0x40) { + if (pps_cur[1] & 0x40) { check ^= pps_cur[4]; } check ^= pps_cur[5]; pps_state = PPS_S_WAIT_END; usb_send_pps(true); /* send PPS to host software using USB */ - if (ISO7816_S_IN_PPS_REQ==iso_state) { - if (0==check) { /* checksum is valid */ + if (ISO7816_S_IN_PPS_REQ == iso_state) { + if (0 == check) { /* checksum is valid */ change_state(ISO7816_S_WAIT_PPS_RSP); /* go to next state */ } else { /* checksum is invalid */ change_state(ISO7816_S_WAIT_TPDU); /* go to next state */ } - } else if (ISO7816_S_IN_PPS_RSP==iso_state) { - if (0==check) { /* checksum is valid */ + } else if (ISO7816_S_IN_PPS_RSP == iso_state) { + if (0 == check) { /* checksum is valid */ uint8_t fn, dn; - if (pps_cur[1]&0x10) { - fn = (pps_cur[2]>>4); - dn = (pps_cur[2]&0x0f); + if (pps_cur[1] & 0x10) { + fn = (pps_cur[2] >> 4); + dn = (pps_cur[2] & 0x0f); } else { fn = 1; dn = 1; @@ -622,7 +622,7 @@ static void usb_send_tpdu(bool complete) { /* Check state */ - if (ISO7816_S_IN_TPDU!=iso_state) { + if (ISO7816_S_IN_TPDU != iso_state) { TRACE_WARNING("Can't print TPDU in ISO 7816-3 state %u\n\r", iso_state); return; } @@ -654,11 +654,11 @@ static void process_byte_tpdu(uint8_t byte) { /* sanity check */ - if (ISO7816_S_IN_TPDU!=iso_state) { + if (ISO7816_S_IN_TPDU != iso_state) { TRACE_ERROR("Processing TPDU data in wrong ISO 7816-3 state %u\n\r", iso_state); return; } - if (tpdu_packet_i>=ARRAY_SIZE(tpdu_packet)) { + if (tpdu_packet_i >= ARRAY_SIZE(tpdu_packet)) { TRACE_ERROR("TPDU data overflow\n\r"); return; } @@ -666,7 +666,7 @@ /* handle TPDU byte depending on current state */ switch (tpdu_state) { case TPDU_S_CLA: - if (0xff==byte) { + if (0xff == byte) { TRACE_WARNING("0xff is not a valid class byte\n\r"); change_state(ISO7816_S_WAIT_TPDU); /* go back to TPDU state */ return; @@ -676,7 +676,7 @@ tpdu_state = TPDU_S_INS; break; case TPDU_S_INS: - if ((0x60==(byte&0xf0)) || (0x90==(byte&0xf0))) { + if ((0x60 == (byte & 0xf0)) || (0x90 == (byte & 0xf0))) { TRACE_WARNING("invalid CLA 0x%02x\n\r", byte); change_state(ISO7816_S_WAIT_TPDU); /* go back to TPDU state */ return; @@ -701,17 +701,17 @@ tpdu_state = TPDU_S_PROCEDURE; break; case TPDU_S_PROCEDURE: - if (0x60==byte) { /* wait for next procedure byte */ + if (0x60 == byte) { /* wait for next procedure byte */ break; - } else if (tpdu_packet[1]==byte) { /* get all remaining data bytes */ + } else if (tpdu_packet[1] == byte) { /* get all remaining data bytes */ tpdu_state = TPDU_S_DATA_REMAINING; break; - } else if ((~tpdu_packet[1])==byte) { /* get single data byte */ + } else if ((~tpdu_packet[1]) == byte) { /* get single data byte */ tpdu_state = TPDU_S_DATA_SINGLE; break; } case TPDU_S_SW1: - if ((0x60==(byte&0xf0)) || (0x90==(byte&0xf0))) { /* this procedure byte is SW1 */ + if ((0x60 == (byte & 0xf0)) || (0x90 == (byte & 0xf0))) { /* this procedure byte is SW1 */ tpdu_packet[tpdu_packet_i++] = byte; tpdu_state = TPDU_S_SW2; } else { @@ -728,16 +728,16 @@ case TPDU_S_DATA_SINGLE: case TPDU_S_DATA_REMAINING: tpdu_packet[tpdu_packet_i++] = byte; - if (0==tpdu_packet[4]) { - if (5+256<=tpdu_packet_i) { + if (0 == tpdu_packet[4]) { + if (5+256 <= tpdu_packet_i) { tpdu_state = TPDU_S_PROCEDURE; } } else { - if (5+tpdu_packet[4]<=tpdu_packet_i) { + if (5+tpdu_packet[4] <= tpdu_packet_i) { tpdu_state = TPDU_S_PROCEDURE; } } - if (TPDU_S_DATA_SINGLE==tpdu_state) { + if (TPDU_S_DATA_SINGLE == tpdu_state) { tpdu_state = TPDU_S_PROCEDURE; } break; @@ -780,15 +780,15 @@ /* Verify it WT timeout occurred, to detect unresponsive card */ if (csr & US_CSR_TIMEOUT) { - if (wt_remaining<=(sniff_usart.base->US_RTOR&0xffff)) { + if (wt_remaining <= (sniff_usart.base->US_RTOR & 0xffff)) { /* Just set the flag and let the main loop handle it */ change_flags |= SNIFF_CHANGE_FLAG_TIMEOUT_WT; /* Reset timeout value */ wt_remaining = wt; } else { - wt_remaining -= (sniff_usart.base->US_RTOR&0xffff); /* be sure to subtract the actual timeout since the new might not have been set and reloaded yet */ + wt_remaining -= (sniff_usart.base->US_RTOR & 0xffff); /* be sure to subtract the actual timeout since the new might not have been set and reloaded yet */ } - if (wt_remaining>0xffff) { + if (wt_remaining > 0xffff) { sniff_usart.base->US_RTOR = 0xffff; } else { sniff_usart.base->US_RTOR = wt_remaining; @@ -807,17 +807,17 @@ static void Sniffer_reset_isr(const Pin* pPin) { /* Ensure an edge on the reset pin cause the interrupt */ - if (pPin->id!=pin_rst.id || 0==(pPin->mask&pin_rst.mask)) { + if (pPin->id != pin_rst.id || 0 == (pPin->mask & pin_rst.mask)) { TRACE_ERROR("Pin other than reset caused a interrupt\n\r"); return; } /* Update the ISO state according to the reset change */ if (PIO_Get(&pin_rst)) { - if (ISO7816_S_WAIT_ATR!=iso_state) { + if (ISO7816_S_WAIT_ATR != iso_state) { change_state(ISO7816_S_WAIT_ATR); } } else { - if (ISO7816_S_RESET!=iso_state) { + if (ISO7816_S_RESET != iso_state) { change_state(ISO7816_S_RESET); } } @@ -829,14 +829,14 @@ void Sniffer_usart1_irq(void) { - if (ID_USART1==sniff_usart.id) { + if (ID_USART1 == sniff_usart.id) { Sniffer_usart_isr(); } } void Sniffer_usart0_irq(void) { - if (ID_USART0==sniff_usart.id) { + if (ID_USART0 == sniff_usart.id) { Sniffer_usart_isr(); } } @@ -894,14 +894,14 @@ /* Enable interrupt to indicate when data has been received or timeout occurred */ USART_EnableIt(sniff_usart.base, US_IER_RXRDY | US_IER_TIMEOUT); /* Set USB priority lower than USART to not miss sniffing data (both at 0 per default) */ - if (NVIC_GetPriority(IRQ_USART_SIM)>=NVIC_GetPriority(UDP_IRQn)) { - NVIC_SetPriority(UDP_IRQn, NVIC_GetPriority(IRQ_USART_SIM)+2); + if (NVIC_GetPriority(IRQ_USART_SIM) >= NVIC_GetPriority(UDP_IRQn)) { + NVIC_SetPriority(UDP_IRQn, NVIC_GetPriority(IRQ_USART_SIM) + 2); } /* Enable interrupt requests for the USART peripheral */ NVIC_EnableIRQ(IRQ_USART_SIM); /* Reset state */ - if (ISO7816_S_RESET!=iso_state) { + if (ISO7816_S_RESET != iso_state) { change_state(ISO7816_S_RESET); } } @@ -912,11 +912,11 @@ static void usb_send_change(uint32_t flags) { /* Check flags */ - if(0==flags) { /* no changes */ + if(0 == flags) { /* no changes */ return; } - if (flags&SNIFF_CHANGE_FLAG_TIMEOUT_WT) { + if (flags & SNIFF_CHANGE_FLAG_TIMEOUT_WT) { printf("waiting time (WT) timeout\n\r"); } @@ -963,8 +963,8 @@ break; case ISO7816_S_WAIT_TPDU: /* After the ATR we expect TPDU or PPS data */ case ISO7816_S_WAIT_PPS_RSP: - if (byte == 0xff) { - if (ISO7816_S_WAIT_PPS_RSP==iso_state) { + if (0xff == byte) { + if (ISO7816_S_WAIT_PPS_RSP == iso_state) { change_state(ISO7816_S_IN_PPS_RSP); /* Go to PPS state */ } else { change_state(ISO7816_S_IN_PPS_REQ); /* Go to PPS state */ @@ -973,7 +973,7 @@ break; } case ISO7816_S_IN_TPDU: /* More TPDU data incoming */ - if (ISO7816_S_WAIT_TPDU==iso_state) { + if (ISO7816_S_WAIT_TPDU == iso_state) { change_state(ISO7816_S_IN_TPDU); } process_byte_tpdu(byte); @@ -989,7 +989,7 @@ /* Handle flags */ if (change_flags) { /* WARNING this is not synced with the data buffer handling */ - if (change_flags&SNIFF_CHANGE_FLAG_TIMEOUT_WT) { + if (change_flags & SNIFF_CHANGE_FLAG_TIMEOUT_WT) { /* Use timeout to detect interrupted data transmission */ switch (iso_state) { case ISO7816_S_IN_ATR: -- To view, visit https://gerrit.osmocom.org/9919 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: If5ba5f8d16680e8403944274336ea595017063db Gerrit-Change-Number: 9919 Gerrit-PatchSet: 6 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:25:00 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:25:00 +0000 Subject: Change in simtrace2[master]: USB: add flags for sniff data and centralise transfer In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9920 ) Change subject: USB: add flags for sniff data and centralise transfer ...................................................................... USB: add flags for sniff data and centralise transfer Also fix issue in usb_msg_alloc_hdr and add cosmetic spaces around operations. Change-Id: I768a0ad639aa5e648a630af72d01f7b68082b6b6 --- M firmware/libcommon/include/simtrace_prot.h M firmware/libcommon/source/sniffer.c M host/simtrace2-sniff.c 3 files changed, 140 insertions(+), 142 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libcommon/include/simtrace_prot.h b/firmware/libcommon/include/simtrace_prot.h index 1e9d72f..f1f736b 100644 --- a/firmware/libcommon/include/simtrace_prot.h +++ b/firmware/libcommon/include/simtrace_prot.h @@ -294,6 +294,9 @@ #define SNIFF_CHANGE_FLAG_RESET_HOLD (1<<2) #define SNIFF_CHANGE_FLAG_RESET_RELEASE (1<<3) #define SNIFF_CHANGE_FLAG_TIMEOUT_WT (1<<4) +/* SIMTRACE_MSGT_SNIFF_ATR, SIMTRACE_MSGT_SNIFF_PPS, SIMTRACE_MSGT_SNIFF_TPDU flags */ +#define SNIFF_DATA_FLAG_ERROR_INCOMPLETE (1<<5) +#define SNIFF_DATA_FLAG_ERROR_MALFORMED (1<<6) /* SIMTRACE_MSGT_SNIFF_CHANGE */ struct sniff_change { @@ -309,8 +312,8 @@ /* SIMTRACE_MSGT_SNIFF_ATR, SIMTRACE_MSGT_SNIFF_PPS, SIMTRACE_MSGT_SNIFF_TPDU */ struct sniff_data { - /* if the data is complete (an error might have occurred during transmission */ - bool complete; + /* data flags */ + uint32_t flags; /* data length */ uint16_t length; /* data */ diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 81a6712..4ec56d9 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -234,8 +234,8 @@ usb_msg->l1h = msgb_put(usb_msg, sizeof(*usb_msg_header)); usb_msg_header = (struct simtrace_msg_hdr *) usb_msg->l1h; memset(usb_msg_header, 0, sizeof(*usb_msg_header)); - usb_msg_header->msg_class = SIMTRACE_MSGC_SNIFF; - usb_msg_header->msg_type = SIMTRACE_MSGT_SNIFF_CHANGE; + usb_msg_header->msg_class = msg_class; + usb_msg_header->msg_type = msg_type; usb_msg->l2h = usb_msg->l1h + sizeof(*usb_msg_header); return usb_msg; @@ -296,11 +296,74 @@ //TRACE_INFO("Changed to ISO 7816-3 state %u\n\r", iso_state); /* don't print since this is function is also called by ISRs */ } +static void usb_send_data(enum simtrace_msg_type_sniff type, const uint8_t* data, uint16_t length, uint32_t flags) +{ + /* Sanity check */ + if (type != SIMTRACE_MSGT_SNIFF_ATR && type != SIMTRACE_MSGT_SNIFF_PPS && type != SIMTRACE_MSGT_SNIFF_TPDU) { + return; + } + + /* Show activity on LED */ + led_blink(LED_GREEN, BLINK_2O_F); + + /* Send data over USB */ + struct msgb *usb_msg = usb_msg_alloc_hdr(SIMTRACE_USB_EP_CARD_DATAIN, SIMTRACE_MSGC_SNIFF, type); + if (!usb_msg) { + return; + } + struct sniff_data *usb_sniff_data = (struct sniff_data *) msgb_put(usb_msg, sizeof(*usb_sniff_data)); + usb_sniff_data->flags = flags; + usb_sniff_data->length = length; + uint8_t *sniff_data = msgb_put(usb_msg, usb_sniff_data->length); + memcpy(sniff_data, data, length); + usb_msg_upd_len_and_submit(usb_msg); + + /* Print message */ + switch (type) { + case SIMTRACE_MSGT_SNIFF_ATR: + printf("ATR"); + break; + case SIMTRACE_MSGT_SNIFF_PPS: + printf("PPS"); + break; + case SIMTRACE_MSGT_SNIFF_TPDU: + printf("TPDU"); + break; + default: + printf("???"); + break; + } + if (flags) { + printf(" ("); + if (flags & SNIFF_DATA_FLAG_ERROR_INCOMPLETE) { + printf("incomplete"); + flags &= ~SNIFF_DATA_FLAG_ERROR_INCOMPLETE; + if (flags) { + printf(", "); + } + } + if (flags & SNIFF_DATA_FLAG_ERROR_MALFORMED) { + printf("malformed"); + flags &= ~SNIFF_DATA_FLAG_ERROR_MALFORMED; + if (flags) { + printf(", "); + } + } + printf(")"); + } + printf(": "); + uint16_t i; + for (i = 0; i < length; i++) { + printf("%02x ", data[i]); + } + printf("\n\r"); +} + /*! Send current ATR over USB - * @param[in] complete if the ATR is complete + * @param[in] flags SNIFF_DATA_FLAG_ data flags * @note Also print the ATR to debug console */ -static void usb_send_atr(bool complete) +static void usb_send_atr(uint32_t flags) { /* Check state */ if (ISO7816_S_IN_ATR != iso_state) { @@ -312,28 +375,8 @@ return; } - /* Show activity on LED */ - led_blink(LED_GREEN, BLINK_2O_F); - - /* Print ATR */ - printf("ATR%s: ", complete ? "" : " (incomplete)"); - uint8_t i; - for (i = 0; i < atr_i; i++) { - printf("%02x ", atr[i]); - } - printf("\n\r"); - /* Send ATR over USB */ - struct msgb *usb_msg = usb_msg_alloc_hdr(SIMTRACE_USB_EP_CARD_DATAIN, SIMTRACE_MSGC_SNIFF, SIMTRACE_MSGT_SNIFF_ATR); - if (!usb_msg) { - return; - } - struct sniff_data *usb_sniff_data_atr = (struct sniff_data *) msgb_put(usb_msg, sizeof(*usb_sniff_data_atr)); - usb_sniff_data_atr->complete = complete; - usb_sniff_data_atr->length = atr_i; - uint8_t *data = msgb_put(usb_msg, usb_sniff_data_atr->length); - memcpy(data, atr, atr_i); - usb_msg_upd_len_and_submit(usb_msg); + usb_send_data(SIMTRACE_MSGT_SNIFF_ATR, atr, atr_i, flags); } /*! Process ATR byte @@ -428,7 +471,7 @@ } case ATR_S_WAIT_TCK: /* see ISO/IEC 7816-3:2006 section 8.2.5 */ /* we could verify the checksum, but we are just here to sniff */ - usb_send_atr(true); /* send ATR to host software using USB */ + usb_send_atr(0); /* send ATR to host software using USB */ change_state(ISO7816_S_WAIT_TPDU); /* go to next state */ break; default: @@ -437,10 +480,10 @@ } /*! Send current PPS over USB - * @param[in] complete if the PPS is complete + * @param[in] flags SNIFF_DATA_FLAG_ data flags * @note Also print the PPS over the debug console */ -static void usb_send_pps(bool complete) +static void usb_send_pps(uint32_t flags) { uint8_t *pps_cur; /* current PPS (request or response) */ @@ -475,29 +518,9 @@ if (pps_state > PPS_S_WAIT_PCK) { pps[pps_i++] = pps_cur[5]; } - - /* Show activity on LED */ - led_blink(LED_GREEN, BLINK_2O_F); - - /* Print PPS */ - printf("PPS%s: ", complete ? "" : " (incomplete)"); - uint8_t i; - for (i = 0; i < pps_i; i++) { - printf("%02x ", pps[i]); - } - printf("\n\r"); /* Send message over USB */ - struct msgb *usb_msg = usb_msg_alloc_hdr(SIMTRACE_USB_EP_CARD_DATAIN, SIMTRACE_MSGC_SNIFF, SIMTRACE_MSGT_SNIFF_PPS); - if (!usb_msg) { - return; - } - struct sniff_data *usb_sniff_data_pps = (struct sniff_data *) msgb_put(usb_msg, sizeof(*usb_sniff_data_pps)); - usb_sniff_data_pps->complete = complete; - usb_sniff_data_pps->length = pps_i; - uint8_t *data = msgb_put(usb_msg, usb_sniff_data_pps->length); - memcpy(data, pps, pps_i); - usb_msg_upd_len_and_submit(usb_msg); + usb_send_data(SIMTRACE_MSGT_SNIFF_PPS, pps, pps_i, flags); } /*! Send Fi/Di change over USB @@ -579,7 +602,7 @@ } check ^= pps_cur[5]; pps_state = PPS_S_WAIT_END; - usb_send_pps(true); /* send PPS to host software using USB */ + usb_send_pps(0); /* send PPS to host software using USB */ if (ISO7816_S_IN_PPS_REQ == iso_state) { if (0 == check) { /* checksum is valid */ change_state(ISO7816_S_WAIT_PPS_RSP); /* go to next state */ @@ -616,10 +639,10 @@ } /*! Send current TPDU over USB - * @param[in] complete if the TPDU is complete + * @param[in] flags SNIFF_DATA_FLAG_ data flags * @note Also print the TPDU over the debug console */ -static void usb_send_tpdu(bool complete) +static void usb_send_tpdu(uint32_t flags) { /* Check state */ if (ISO7816_S_IN_TPDU != iso_state) { @@ -627,28 +650,8 @@ return; } - /* Show activity on LED */ - led_blink(LED_GREEN, BLINK_2O_F); - - /* Print TPDU */ - printf("TPDU%s: ", complete ? "" : " (incomplete)"); - uint16_t i; - for (i = 0; i < tpdu_packet_i && i < ARRAY_SIZE(tpdu_packet); i++) { - printf("%02x ", tpdu_packet[i]); - } - printf("\n\r"); - /* Send ATR over USB */ - struct msgb *usb_msg = usb_msg_alloc_hdr(SIMTRACE_USB_EP_CARD_DATAIN, SIMTRACE_MSGC_SNIFF, SIMTRACE_MSGT_SNIFF_TPDU); - if (!usb_msg) { - return; - } - struct sniff_data *usb_sniff_data_tpdu = (struct sniff_data *) msgb_put(usb_msg, sizeof(*usb_sniff_data_tpdu)); - usb_sniff_data_tpdu->complete = complete; - usb_sniff_data_tpdu->length = tpdu_packet_i; - uint8_t *data = msgb_put(usb_msg, usb_sniff_data_tpdu->length); - memcpy(data, tpdu_packet, tpdu_packet_i); - usb_msg_upd_len_and_submit(usb_msg); + usb_send_data(SIMTRACE_MSGT_SNIFF_TPDU, tpdu_packet, tpdu_packet_i, flags); } static void process_byte_tpdu(uint8_t byte) @@ -722,7 +725,7 @@ break; case TPDU_S_SW2: tpdu_packet[tpdu_packet_i++] = byte; - usb_send_tpdu(true); /* send TPDU to host software using USB */ + usb_send_tpdu(0); /* send TPDU to host software using USB */ change_state(ISO7816_S_WAIT_TPDU); /* this is the end of the TPDU */ break; case TPDU_S_DATA_SINGLE: @@ -993,16 +996,16 @@ /* Use timeout to detect interrupted data transmission */ switch (iso_state) { case ISO7816_S_IN_ATR: - usb_send_atr(false); /* send incomplete ATR to host software using USB */ + usb_send_atr(SNIFF_DATA_FLAG_ERROR_INCOMPLETE); /* send incomplete ATR to host software using USB */ change_state(ISO7816_S_WAIT_ATR); break; case ISO7816_S_IN_TPDU: - usb_send_tpdu(false); /* send incomplete PPS to host software using USB */ + usb_send_tpdu(SNIFF_DATA_FLAG_ERROR_INCOMPLETE); /* send incomplete PPS to host software using USB */ change_state(ISO7816_S_WAIT_TPDU); break; case ISO7816_S_IN_PPS_REQ: case ISO7816_S_IN_PPS_RSP: - usb_send_pps(false); /* send incomplete TPDU to host software using USB */ + usb_send_pps(SNIFF_DATA_FLAG_ERROR_INCOMPLETE); /* send incomplete TPDU to host software using USB */ change_state(ISO7816_S_WAIT_TPDU); break; default: diff --git a/host/simtrace2-sniff.c b/host/simtrace2-sniff.c index b61b7d0..eb547b0 100644 --- a/host/simtrace2-sniff.c +++ b/host/simtrace2-sniff.c @@ -97,7 +97,7 @@ static int process_change(const uint8_t *buf, int len) { /* check if there is enough data for the structure */ - if (lenlength) { + if (len < sizeof(struct sniff_data) + data->length) { return -2; } - printf("ATR%s: ", atr->complete ? "" : " (incomplete)"); + /* check type */ + if (type != SIMTRACE_MSGT_SNIFF_ATR && type != SIMTRACE_MSGT_SNIFF_PPS && type != SIMTRACE_MSGT_SNIFF_TPDU) { + return -3; + } + + /* Print message */ + switch (type) { + case SIMTRACE_MSGT_SNIFF_ATR: + printf("ATR"); + break; + case SIMTRACE_MSGT_SNIFF_PPS: + printf("PPS"); + break; + case SIMTRACE_MSGT_SNIFF_TPDU: + printf("TPDU"); + break; + default: + printf("???"); + break; + } + if (data->flags) { + printf(" ("); + if (data->flags & SNIFF_DATA_FLAG_ERROR_INCOMPLETE) { + printf("incomplete"); + data->flags &= ~SNIFF_DATA_FLAG_ERROR_INCOMPLETE; + if (data->flags) { + printf(", "); + } + } + if (data->flags & SNIFF_DATA_FLAG_ERROR_MALFORMED) { + printf("malformed"); + data->flags &= ~SNIFF_DATA_FLAG_ERROR_MALFORMED; + if (data->flags) { + printf(", "); + } + } + printf(")"); + } + printf(": "); uint16_t i; - for (i = 0; i < atr->length; i++) { - printf("%02x ", atr->data[i]); - } - printf("\n"); - return 0; -} - -static int process_pps(const uint8_t *buf, int len) -{ - /* check if there is enough data for the structure */ - if (lenlength) { - return -2; - } - - printf("PPS%s: ", pps->complete ? "" : " (incomplete) "); - uint16_t i; - for (i = 0; i < pps->length; i++) { - printf("%02x ", pps->data[i]); - } - printf("\n"); - return 0; -} - -static int process_tpdu(const uint8_t *buf, int len) -{ - /* check if there is enough data for the structure */ - if (lenlength) { - return -2; - } - - /* print TPDU */ - printf("TPDU%s: ", tpdu->complete ? "" : " (incomplete)"); - uint16_t i; - for (i = 0; i < tpdu->length; i++) { - printf("%02x ", tpdu->data[i]); + for (i = 0; i < data->length; i++) { + printf("%02x ", data->data[i]); } printf("\n"); - /* send TPDU (now considered as APDU) to GSMTAP */ - gsmtap_send_sim(tpdu->data, tpdu->length); + if (SIMTRACE_MSGT_SNIFF_TPDU == type) { + /* send TPDU (now considered as APDU) to GSMTAP */ + gsmtap_send_sim(data->data, data->length); + } + return 0; } @@ -215,19 +211,19 @@ static int process_usb_msg(const uint8_t *buf, int len) { /* check if enough data for the header is present */ - if (lenmsg_len) { + if (len < msg_hdr->msg_len) { return 0; } //printf("msg: %s\n", osmo_hexdump(buf, msg_hdr->msg_len)); /* check for message class */ - if (SIMTRACE_MSGC_SNIFF!=msg_hdr->msg_class) { /* we only care about sniffing messages */ + if (SIMTRACE_MSGC_SNIFF != msg_hdr->msg_class) { /* we only care about sniffing messages */ return msg_hdr->msg_len; /* discard non-sniffing messaged */ } @@ -242,13 +238,9 @@ process_fidi(buf, len); break; case SIMTRACE_MSGT_SNIFF_ATR: - process_atr(buf, len); - break; case SIMTRACE_MSGT_SNIFF_PPS: - process_pps(buf, len); - break; case SIMTRACE_MSGT_SNIFF_TPDU: - process_tpdu(buf, len); + process_data(msg_hdr->msg_type, buf, len); break; default: printf("unknown SIMtrace msg type 0x%02x\n", msg_hdr->msg_type); -- To view, visit https://gerrit.osmocom.org/9920 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I768a0ad639aa5e648a630af72d01f7b68082b6b6 Gerrit-Change-Number: 9920 Gerrit-PatchSet: 6 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:25:01 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:25:01 +0000 Subject: Change in simtrace2[master]: sniffer: move data print before USB send In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9921 ) Change subject: sniffer: move data print before USB send ...................................................................... sniffer: move data print before USB send when the host software does not retrieve the USB messages the memory is filled and no new USB messages can be allocated, preventing the following code to print the message Change-Id: Ie8946894a84cb853b45555f7abb1ca6f32111425 --- M firmware/libcommon/source/sniffer.c 1 file changed, 13 insertions(+), 12 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 4ec56d9..07bc82d 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -306,18 +306,6 @@ /* Show activity on LED */ led_blink(LED_GREEN, BLINK_2O_F); - /* Send data over USB */ - struct msgb *usb_msg = usb_msg_alloc_hdr(SIMTRACE_USB_EP_CARD_DATAIN, SIMTRACE_MSGC_SNIFF, type); - if (!usb_msg) { - return; - } - struct sniff_data *usb_sniff_data = (struct sniff_data *) msgb_put(usb_msg, sizeof(*usb_sniff_data)); - usb_sniff_data->flags = flags; - usb_sniff_data->length = length; - uint8_t *sniff_data = msgb_put(usb_msg, usb_sniff_data->length); - memcpy(sniff_data, data, length); - usb_msg_upd_len_and_submit(usb_msg); - /* Print message */ switch (type) { case SIMTRACE_MSGT_SNIFF_ATR: @@ -357,6 +345,19 @@ printf("%02x ", data[i]); } printf("\n\r"); + + /* Send data over USB */ + struct msgb *usb_msg = usb_msg_alloc_hdr(SIMTRACE_USB_EP_CARD_DATAIN, SIMTRACE_MSGC_SNIFF, type); + if (!usb_msg) { + return; + } + struct sniff_data *usb_sniff_data = (struct sniff_data *) msgb_put(usb_msg, sizeof(*usb_sniff_data)); + usb_sniff_data->flags = flags; + usb_sniff_data->length = length; + uint8_t *sniff_data = msgb_put(usb_msg, usb_sniff_data->length); + memcpy(sniff_data, data, length); + usb_msg_upd_len_and_submit(usb_msg); + } /*! Send current ATR over USB -- To view, visit https://gerrit.osmocom.org/9921 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ie8946894a84cb853b45555f7abb1ca6f32111425 Gerrit-Change-Number: 9921 Gerrit-PatchSet: 6 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:25:02 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:25:02 +0000 Subject: Change in simtrace2[master]: sniffer: move reset handling from ISR to main loop In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9922 ) Change subject: sniffer: move reset handling from ISR to main loop ...................................................................... sniffer: move reset handling from ISR to main loop Change-Id: Ia88fb4baf49017524bb201123da3511e5342ba48 --- M firmware/libcommon/source/sniffer.c 1 file changed, 16 insertions(+), 8 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 07bc82d..8262bec 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -267,11 +267,9 @@ case ISO7816_S_RESET: update_fidi(&sniff_usart, 0x11); /* reset baud rate to default Di/Fi values */ update_wt(10, 1); /* reset WT time-out */ - change_flags |= SNIFF_CHANGE_FLAG_RESET_HOLD; /* set flag and let main loop send it */ break; case ISO7816_S_WAIT_ATR: rbuf_reset(&sniff_buffer); /* reset buffer for new communication */ - change_flags |= SNIFF_CHANGE_FLAG_RESET_RELEASE; /* set flag and let main loop send it */ break; case ISO7816_S_IN_ATR: atr_i = 0; @@ -817,13 +815,9 @@ } /* Update the ISO state according to the reset change */ if (PIO_Get(&pin_rst)) { - if (ISO7816_S_WAIT_ATR != iso_state) { - change_state(ISO7816_S_WAIT_ATR); - } + change_flags |= SNIFF_CHANGE_FLAG_RESET_HOLD; /* set flag and let main loop send it */ } else { - if (ISO7816_S_RESET != iso_state) { - change_state(ISO7816_S_RESET); - } + change_flags |= SNIFF_CHANGE_FLAG_RESET_RELEASE; /* set flag and let main loop send it */ } } @@ -949,6 +943,10 @@ process_any_usb_commands(queue); */ + /* WARNING: the signal data and flags are not synchronized. We have to hope + * the processing is fast enough to not land in the wrong state while data + * is remaining + */ /* Handle sniffed data */ if (!rbuf_is_empty(&sniff_buffer)) { /* use if instead of while to let the main loop restart the watchdog */ uint8_t byte = rbuf_read(&sniff_buffer); @@ -993,6 +991,16 @@ /* Handle flags */ if (change_flags) { /* WARNING this is not synced with the data buffer handling */ + if (change_flags & SNIFF_CHANGE_FLAG_RESET_HOLD) { + if (ISO7816_S_WAIT_ATR != iso_state) { + change_state(ISO7816_S_WAIT_ATR); + } + } + if (change_flags & SNIFF_CHANGE_FLAG_RESET_RELEASE) { + if (ISO7816_S_RESET != iso_state) { + change_state(ISO7816_S_RESET); + } + } if (change_flags & SNIFF_CHANGE_FLAG_TIMEOUT_WT) { /* Use timeout to detect interrupted data transmission */ switch (iso_state) { -- To view, visit https://gerrit.osmocom.org/9922 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ia88fb4baf49017524bb201123da3511e5342ba48 Gerrit-Change-Number: 9922 Gerrit-PatchSet: 6 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:25:03 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:25:03 +0000 Subject: Change in simtrace2[master]: LED: add need pattern In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9923 ) Change subject: LED: add need pattern ...................................................................... LED: add need pattern new LED pattern: off for 200 ms and then on Change-Id: Id2c40dc20d75ed6f38b735164ad1eb2860dc480c --- M firmware/libboard/common/include/led.h M firmware/libboard/common/source/led.c 2 files changed, 13 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libboard/common/include/led.h b/firmware/libboard/common/include/led.h index 0c851f0..339702d 100644 --- a/firmware/libboard/common/include/led.h +++ b/firmware/libboard/common/include/led.h @@ -31,6 +31,7 @@ BLINK_200O_F = 7, BLINK_600O_F = 8, BLINK_CUSTOM = 9, + BLINK_2F_O, _NUM_LED_BLINK }; diff --git a/firmware/libboard/common/source/led.c b/firmware/libboard/common/source/led.c index e3293b6..6772007 100644 --- a/firmware/libboard/common/source/led.c +++ b/firmware/libboard/common/source/led.c @@ -73,16 +73,23 @@ static const struct blink_state bs_3on_1off_3on_1off_3on_30off[] = { { 300, 1 }, { 100, 0 }, { 300, 1 }, { 100, 0 }, { 300, 1 }, { 3000, 0 } }; + static const struct blink_state bs_2on_off[] = { { 200, 1 }, { 0, 0 }, }; + static const struct blink_state bs_200on_off[] = { { 20000, 1 }, { 0, 0 }, }; + static const struct blink_state bs_600on_off[] = { { 60000, 1 }, { 0, 0 }, }; +static const struct blink_state bs_2off_on[] = { + { 200, 0 }, { 0, 1 }, +}; + /* a blink pattern is an array of blink_states */ struct blink_pattern { @@ -128,6 +135,11 @@ .states = bs_600on_off, .size = ARRAY_SIZE(bs_600on_off), }, + [BLINK_2F_O] = { + .states = bs_2off_on, + .size = ARRAY_SIZE(bs_2off_on), + }, + }; struct led_state { -- To view, visit https://gerrit.osmocom.org/9923 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Id2c40dc20d75ed6f38b735164ad1eb2860dc480c Gerrit-Change-Number: 9923 Gerrit-PatchSet: 6 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:25:04 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:25:04 +0000 Subject: Change in simtrace2[master]: sniffer: set LED pattern In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9924 ) Change subject: sniffer: set LED pattern ...................................................................... sniffer: set LED pattern The red and green LEDs are now used as follows: - red on = power (firmware is running) - red blink = error detected (e.g. during ISO-7816 parsing) - green on = running (sniffer mode is running) - green blink = activity (e.g. USB message sent) Change-Id: Ib1b6ff87fb92d6ed3ecae4bc89386206aaab508e --- M firmware/apps/trace/main.c M firmware/libcommon/source/sniffer.c 2 files changed, 8 insertions(+), 3 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/apps/trace/main.c b/firmware/apps/trace/main.c index 6b6d70b..f7eb15d 100644 --- a/firmware/apps/trace/main.c +++ b/firmware/apps/trace/main.c @@ -142,10 +142,15 @@ enum confNum last_simtrace_config = simtrace_config; unsigned int i = 0; - /* Configure LED output (red = on, green = activity */ + /* Configure LED output + * red on = power + * red blink = error + * green on = running + * green blink = activity + */ led_init(); led_blink(LED_RED, BLINK_ALWAYS_ON); - led_blink(LED_GREEN, BLINK_ALWAYS_OFF); + led_blink(LED_GREEN, BLINK_ALWAYS_ON); /* Enable watchdog for 2000 ms, with no window */ WDT_Enable(WDT, WDT_MR_WDRSTEN | WDT_MR_WDDBGHLT | WDT_MR_WDIDLEHLT | diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 8262bec..9202d8e 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -302,7 +302,7 @@ } /* Show activity on LED */ - led_blink(LED_GREEN, BLINK_2O_F); + led_blink(LED_GREEN, BLINK_2F_O); /* Print message */ switch (type) { -- To view, visit https://gerrit.osmocom.org/9924 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ib1b6ff87fb92d6ed3ecae4bc89386206aaab508e Gerrit-Change-Number: 9924 Gerrit-PatchSet: 6 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:25:05 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:25:05 +0000 Subject: Change in simtrace2[master]: minor: fix linker warning In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9925 ) Change subject: minor: fix linker warning ...................................................................... minor: fix linker warning linker warning: obj/simtrace/dfu_sniffer.o: In function `usb_send_data': /media/data/work/simtrace2/simtrace2/firmware/libcommon/source/sniffer.c:338: warning: undefined reference to `putchar' Change-Id: I934f3fcb474d4046e921511a024c3a0b8533c782 --- M firmware/libcommon/source/sniffer.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 9202d8e..be57d54 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -335,7 +335,7 @@ printf(", "); } } - printf(")"); + putchar(')'); } printf(": "); uint16_t i; -- To view, visit https://gerrit.osmocom.org/9925 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I934f3fcb474d4046e921511a024c3a0b8533c782 Gerrit-Change-Number: 9925 Gerrit-PatchSet: 6 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:25:06 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:25:06 +0000 Subject: Change in simtrace2[master]: sniffer: also send malformed message over USB In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9926 ) Change subject: sniffer: also send malformed message over USB ...................................................................... sniffer: also send malformed message over USB Change-Id: I124c8db1d2f836e185630bbe8b5e52eb085d702a --- M firmware/libcommon/source/sniffer.c 1 file changed, 15 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index be57d54..1c691af 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -412,8 +412,11 @@ atr_state = ATR_S_WAIT_T0; /* wait for format byte */ break; default: - atr_i--; /* revert last byte */ TRACE_WARNING("Invalid TS received\n\r"); + led_blink(LED_RED, BLINK_2F_O); /* indicate error to user */ + usb_send_atr(SNIFF_DATA_FLAG_ERROR_MALFORMED); /* send ATR to host software using USB */ + change_state(ISO7816_S_WAIT_ATR); /* reset state */ + break; } i = 0; /* first interface byte sub-group is coming (T0 is kind of TD0) */ break; @@ -559,6 +562,8 @@ pps_state = PPS_S_WAIT_PPS0; /* go to next state */ } else { TRACE_INFO("Invalid PPSS received\n\r"); + led_blink(LED_RED, BLINK_2F_O); /* indicate error to user */ + usb_send_pps(SNIFF_DATA_FLAG_ERROR_MALFORMED); /* send ATR to host software using USB */ change_state(ISO7816_S_WAIT_TPDU); /* go back to TPDU state */ } break; @@ -670,6 +675,8 @@ case TPDU_S_CLA: if (0xff == byte) { TRACE_WARNING("0xff is not a valid class byte\n\r"); + led_blink(LED_RED, BLINK_2F_O); /* indicate error to user */ + usb_send_tpdu(SNIFF_DATA_FLAG_ERROR_MALFORMED); /* send ATR to host software using USB */ change_state(ISO7816_S_WAIT_TPDU); /* go back to TPDU state */ return; } @@ -680,6 +687,8 @@ case TPDU_S_INS: if ((0x60 == (byte & 0xf0)) || (0x90 == (byte & 0xf0))) { TRACE_WARNING("invalid CLA 0x%02x\n\r", byte); + led_blink(LED_RED, BLINK_2F_O); /* indicate error to user */ + usb_send_tpdu(SNIFF_DATA_FLAG_ERROR_MALFORMED); /* send ATR to host software using USB */ change_state(ISO7816_S_WAIT_TPDU); /* go back to TPDU state */ return; } @@ -718,6 +727,8 @@ tpdu_state = TPDU_S_SW2; } else { TRACE_WARNING("invalid SW1 0x%02x\n\r", byte); + led_blink(LED_RED, BLINK_2F_O); /* indicate error to user */ + usb_send_tpdu(SNIFF_DATA_FLAG_ERROR_MALFORMED); /* send ATR to host software using USB */ change_state(ISO7816_S_WAIT_TPDU); /* go back to TPDU state */ return; } @@ -1005,15 +1016,18 @@ /* Use timeout to detect interrupted data transmission */ switch (iso_state) { case ISO7816_S_IN_ATR: + led_blink(LED_RED, BLINK_2F_O); /* indicate error to user */ usb_send_atr(SNIFF_DATA_FLAG_ERROR_INCOMPLETE); /* send incomplete ATR to host software using USB */ change_state(ISO7816_S_WAIT_ATR); break; case ISO7816_S_IN_TPDU: + led_blink(LED_RED, BLINK_2F_O); /* indicate error to user */ usb_send_tpdu(SNIFF_DATA_FLAG_ERROR_INCOMPLETE); /* send incomplete PPS to host software using USB */ change_state(ISO7816_S_WAIT_TPDU); break; case ISO7816_S_IN_PPS_REQ: case ISO7816_S_IN_PPS_RSP: + led_blink(LED_RED, BLINK_2F_O); /* indicate error to user */ usb_send_pps(SNIFF_DATA_FLAG_ERROR_INCOMPLETE); /* send incomplete TPDU to host software using USB */ change_state(ISO7816_S_WAIT_TPDU); break; -- To view, visit https://gerrit.osmocom.org/9926 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I124c8db1d2f836e185630bbe8b5e52eb085d702a Gerrit-Change-Number: 9926 Gerrit-PatchSet: 6 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:25:07 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:25:07 +0000 Subject: Change in simtrace2[master]: sniffer: only allocate USB message if queue is not too long In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9927 ) Change subject: sniffer: only allocate USB message if queue is not too long ...................................................................... sniffer: only allocate USB message if queue is not too long When the host does not retrieved the USB messages, they keep getting queue in the firmware, filling the RAM, and preventing further memory to be allocated. Change-Id: I0e447acdf757dcb5dc5c4d8b84a4235866914cad --- M firmware/libcommon/source/sniffer.c 1 file changed, 8 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 1c691af..0ca71a5 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -226,6 +226,14 @@ */ static struct msgb *usb_msg_alloc_hdr(uint8_t ep, uint8_t msg_class, uint8_t msg_type) { + /* Only allocate message if not too many are already in the queue */ + struct llist_head *head = usb_get_queue(SIMTRACE_USB_EP_CARD_DATAIN); + if (!head) { + return NULL; + } + if (llist_count(head) > 5) { + return NULL; + } struct msgb *usb_msg = usb_buf_alloc(SIMTRACE_USB_EP_CARD_DATAIN); if (!usb_msg) { return NULL; -- To view, visit https://gerrit.osmocom.org/9927 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I0e447acdf757dcb5dc5c4d8b84a4235866914cad Gerrit-Change-Number: 9927 Gerrit-PatchSet: 6 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:25:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:25:08 +0000 Subject: Change in simtrace2[master]: sniffer: fix inverted reset meaning In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9944 ) Change subject: sniffer: fix inverted reset meaning ...................................................................... sniffer: fix inverted reset meaning Change-Id: I860e2e29c059e1e0ec126695bb68d489891a17da --- M firmware/libcommon/source/sniffer.c 1 file changed, 7 insertions(+), 7 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 0ca71a5..c58b047 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -832,11 +832,11 @@ TRACE_ERROR("Pin other than reset caused a interrupt\n\r"); return; } - /* Update the ISO state according to the reset change */ + /* Update the ISO state according to the reset change (reset is active low) */ if (PIO_Get(&pin_rst)) { - change_flags |= SNIFF_CHANGE_FLAG_RESET_HOLD; /* set flag and let main loop send it */ - } else { change_flags |= SNIFF_CHANGE_FLAG_RESET_RELEASE; /* set flag and let main loop send it */ + } else { + change_flags |= SNIFF_CHANGE_FLAG_RESET_HOLD; /* set flag and let main loop send it */ } } @@ -1011,13 +1011,13 @@ /* Handle flags */ if (change_flags) { /* WARNING this is not synced with the data buffer handling */ if (change_flags & SNIFF_CHANGE_FLAG_RESET_HOLD) { - if (ISO7816_S_WAIT_ATR != iso_state) { - change_state(ISO7816_S_WAIT_ATR); + if (ISO7816_S_RESET != iso_state) { + change_state(ISO7816_S_RESET); } } if (change_flags & SNIFF_CHANGE_FLAG_RESET_RELEASE) { - if (ISO7816_S_RESET != iso_state) { - change_state(ISO7816_S_RESET); + if (ISO7816_S_WAIT_ATR != iso_state) { + change_state(ISO7816_S_WAIT_ATR); } } if (change_flags & SNIFF_CHANGE_FLAG_TIMEOUT_WT) { -- To view, visit https://gerrit.osmocom.org/9944 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I860e2e29c059e1e0ec126695bb68d489891a17da Gerrit-Change-Number: 9944 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:25:09 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:25:09 +0000 Subject: Change in simtrace2[master]: host sniff: process remaining usb messages in buffer In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9945 ) Change subject: host sniff: process remaining usb messages in buffer ...................................................................... host sniff: process remaining usb messages in buffer Change-Id: I1746c0187b2e5dbef44b4b336fee3bd9ded15079 --- M host/simtrace2-sniff.c 1 file changed, 6 insertions(+), 3 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/host/simtrace2-sniff.c b/host/simtrace2-sniff.c index eb547b0..d5fe48a 100644 --- a/host/simtrace2-sniff.c +++ b/host/simtrace2-sniff.c @@ -276,12 +276,15 @@ if (xfer_len > 0) { //printf("URB: %s\n", osmo_hexdump(&buf[buf_i], xfer_len)); buf_i += xfer_len; - if (buf_i>=sizeof(buf)) { + if (buf_i >= sizeof(buf)) { perror("preventing USB buffer overflow"); return; } - int processed = process_usb_msg(buf, buf_i); - if (processed > 0 && processed <= buf_i) { + int processed; + while ((processed = process_usb_msg(buf, buf_i)) > 0) { + if (processed > buf_i) { + break; + } for (i = processed; i < buf_i; i++) { buf[i-processed] = buf[i]; } -- To view, visit https://gerrit.osmocom.org/9945 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I1746c0187b2e5dbef44b4b336fee3bd9ded15079 Gerrit-Change-Number: 9945 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:25:15 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 11 Jul 2018 20:25:15 +0000 Subject: Change in simtrace2[master]: host sniff: add functions to print flags In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9946 to look at the new patch set (#6). Change subject: host sniff: add functions to print flags ...................................................................... host sniff: add functions to print flags Change-Id: If3c0a4790662bcc64db5ff03adcc033836e16ad0 --- M host/simtrace2-sniff.c 1 file changed, 61 insertions(+), 29 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/46/9946/6 -- To view, visit https://gerrit.osmocom.org/9946 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If3c0a4790662bcc64db5ff03adcc033836e16ad0 Gerrit-Change-Number: 9946 Gerrit-PatchSet: 6 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:27:51 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 11 Jul 2018 20:27:51 +0000 Subject: Change in simtrace2[master]: host sniff: add functions to print flags In-Reply-To: References: Message-ID: K?vin Redon has posted comments on this change. ( https://gerrit.osmocom.org/9946 ) Change subject: host sniff: add functions to print flags ...................................................................... Patch Set 6: thanks for pointing it out. I wasn't aware of it. I only used struct value_string and not get_value_string() because I an not comparing the end values, but the individual bits (e.g. flags) -- To view, visit https://gerrit.osmocom.org/9946 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If3c0a4790662bcc64db5ff03adcc033836e16ad0 Gerrit-Change-Number: 9946 Gerrit-PatchSet: 6 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon Gerrit-CC: Harald Welte Gerrit-Comment-Date: Wed, 11 Jul 2018 20:27:51 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:32:38 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:32:38 +0000 Subject: Change in simtrace2[master]: host sniff: add functions to print flags In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9946 ) Change subject: host sniff: add functions to print flags ...................................................................... Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9946 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If3c0a4790662bcc64db5ff03adcc033836e16ad0 Gerrit-Change-Number: 9946 Gerrit-PatchSet: 6 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon Gerrit-Comment-Date: Wed, 11 Jul 2018 20:32:38 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:32:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:32:46 +0000 Subject: Change in simtrace2[master]: host sniff: add functions to print flags In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9946 ) Change subject: host sniff: add functions to print flags ...................................................................... host sniff: add functions to print flags Change-Id: If3c0a4790662bcc64db5ff03adcc033836e16ad0 --- M host/simtrace2-sniff.c 1 file changed, 61 insertions(+), 29 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/host/simtrace2-sniff.c b/host/simtrace2-sniff.c index d5fe48a..efb986f 100644 --- a/host/simtrace2-sniff.c +++ b/host/simtrace2-sniff.c @@ -94,6 +94,61 @@ return 0; } +const struct value_string change_flags[] = { + { + .value = SNIFF_CHANGE_FLAG_CARD_INSERT, + .str = "card inserted", + }, + { + .value = SNIFF_CHANGE_FLAG_CARD_EJECT, + .str = "card ejected", + }, + { + .value = SNIFF_CHANGE_FLAG_RESET_HOLD, + .str = "reset hold", + }, + { + .value = SNIFF_CHANGE_FLAG_RESET_RELEASE, + .str = "reset release", + }, + { + .value = SNIFF_CHANGE_FLAG_TIMEOUT_WT, + .str = "data transfer timeout", + }, + { + .value = 0, + .str = NULL, + }, +}; + +const struct value_string data_flags[] = { + { + .value = SNIFF_DATA_FLAG_ERROR_INCOMPLETE, + .str = "incomplete", + }, + { + .value = SNIFF_DATA_FLAG_ERROR_MALFORMED, + .str = "malformed", + }, + { + .value = 0, + .str = NULL, + }, +}; + +static void print_flags(const struct value_string* flag_meanings, uint32_t nb_flags, uint32_t flags) { + uint32_t i; + for (i = 0; i < nb_flags; i++) { + if (flags & flag_meanings[i].value) { + printf(flag_meanings[i].str); + flags &= ~flag_meanings[i].value; + if (flags) { + printf(", "); + } + } + } +} + static int process_change(const uint8_t *buf, int len) { /* check if there is enough data for the structure */ @@ -103,22 +158,12 @@ struct sniff_change *change = (struct sniff_change *)buf; printf("Card state change: "); - if (change->flags&SNIFF_CHANGE_FLAG_CARD_INSERT) { - printf("card inserted "); + if (change->flags) { + print_flags(change_flags, ARRAY_SIZE(change_flags), change->flags); + printf("\n"); + } else { + printf("no changes\n"); } - if (change->flags&SNIFF_CHANGE_FLAG_CARD_EJECT) { - printf("card ejected "); - } - if (change->flags&SNIFF_CHANGE_FLAG_RESET_HOLD) { - printf("reset hold "); - } - if (change->flags&SNIFF_CHANGE_FLAG_RESET_RELEASE) { - printf("reset release "); - } - if (change->flags&SNIFF_CHANGE_FLAG_TIMEOUT_WT) { - printf("data transfer timeout "); - } - printf("\n"); return 0; } @@ -176,20 +221,7 @@ } if (data->flags) { printf(" ("); - if (data->flags & SNIFF_DATA_FLAG_ERROR_INCOMPLETE) { - printf("incomplete"); - data->flags &= ~SNIFF_DATA_FLAG_ERROR_INCOMPLETE; - if (data->flags) { - printf(", "); - } - } - if (data->flags & SNIFF_DATA_FLAG_ERROR_MALFORMED) { - printf("malformed"); - data->flags &= ~SNIFF_DATA_FLAG_ERROR_MALFORMED; - if (data->flags) { - printf(", "); - } - } + print_flags(data_flags, ARRAY_SIZE(data_flags), data->flags); printf(")"); } printf(": "); -- To view, visit https://gerrit.osmocom.org/9946 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: If3c0a4790662bcc64db5ff03adcc033836e16ad0 Gerrit-Change-Number: 9946 Gerrit-PatchSet: 6 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:32:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:32:47 +0000 Subject: Change in simtrace2[master]: make adc2uv common In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9964 ) Change subject: make adc2uv common ...................................................................... make adc2uv common when building the trace app for the simtrace board gcc was outputing the following error: libboard/common/source/boardver_adc.c:20:17: warning: 'adc2uv' defined but not used [-Wunused-function] static uint32_t adc2uv(uint16_t adc) adc2uv is used by qmod, and defined in two places: in boardver_adc.c and mode_cardemu.c. this change will have adc2uv only defined in boardver_adc.c and make available in the header to be used by mode_cardemu.c. Change-Id: I8a772638fa8dd02d8bc8b7631de5af5a22647c55 --- M firmware/libboard/common/include/boardver_adc.h M firmware/libboard/common/source/boardver_adc.c M firmware/libcommon/source/mode_cardemu.c 3 files changed, 3 insertions(+), 9 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libboard/common/include/boardver_adc.h b/firmware/libboard/common/include/boardver_adc.h index 9b01d0a..956c302 100644 --- a/firmware/libboard/common/include/boardver_adc.h +++ b/firmware/libboard/common/include/boardver_adc.h @@ -15,3 +15,4 @@ #pragma once int get_board_version_adc(void); +uint32_t adc2uv(uint16_t adc); diff --git a/firmware/libboard/common/source/boardver_adc.c b/firmware/libboard/common/source/boardver_adc.c index f204aa1..51db929 100644 --- a/firmware/libboard/common/source/boardver_adc.c +++ b/firmware/libboard/common/source/boardver_adc.c @@ -15,9 +15,8 @@ #include "board.h" #include "boardver_adc.h" -/* FIXME: share this with mode_cardemu.c */ #define UV_PER_LSB ((3300 * 1000) / 4096) -static uint32_t adc2uv(uint16_t adc) +uint32_t adc2uv(uint16_t adc) { uint32_t uv = (uint32_t) adc * UV_PER_LSB; return uv; diff --git a/firmware/libcommon/source/mode_cardemu.c b/firmware/libcommon/source/mode_cardemu.c index c7362cf..b1d9c7a 100644 --- a/firmware/libcommon/source/mode_cardemu.c +++ b/firmware/libcommon/source/mode_cardemu.c @@ -17,6 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA */ #include "board.h" +#include "boardver_adc.h" #include "simtrace.h" #include "ringbuffer.h" #include "card_emu.h" @@ -296,7 +297,6 @@ return 0; } -#define UV_PER_LSB ((3300 * 1000) / 4096) #define VCC_UV_THRESH_1V8 1500000 #define VCC_UV_THRESH_3V 2800000 @@ -316,12 +316,6 @@ ci->vcc_uv_last = ci->vcc_uv; } -static uint32_t adc2uv(uint16_t adc) -{ - uint32_t uv = (uint32_t) adc * UV_PER_LSB; - return uv; -} - void ADC_IrqHandler(void) { #ifdef CARDEMU_SECOND_UART -- To view, visit https://gerrit.osmocom.org/9964 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I8a772638fa8dd02d8bc8b7631de5af5a22647c55 Gerrit-Change-Number: 9964 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:32:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:32:47 +0000 Subject: Change in simtrace2[master]: fix 'ISO_S_IN_ATR not handled' gcc warning In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9965 ) Change subject: fix 'ISO_S_IN_ATR not handled' gcc warning ...................................................................... fix 'ISO_S_IN_ATR not handled' gcc warning when building the cardem application GCC would output the following warning: libcommon/source/card_emu.c: In function 'card_emu_process_rx_byte': libcommon/source/card_emu.c:764:2: warning: enumeration value 'ISO_S_IN_ATR' not handled in switch [-Wswitch] switch (ch->state) { ^~~~~~ in card emulation the reader should not send data while the card is sending its ATR. this is true for other states already handled (RESET, ...). in these cases an error message is output. this behaviour is now the default case as data from the reader is only expected in 3 cases: ISO_S_WAIT_TPDU, ISO_S_IN_TPDU, and ISO_S_IN_PTS. Change-Id: Ifbc8dbe1c9f176343304f211c7e6068fb977961e --- M firmware/libcommon/source/card_emu.c 1 file changed, 4 insertions(+), 8 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libcommon/source/card_emu.c b/firmware/libcommon/source/card_emu.c index 9291064..94a601a 100644 --- a/firmware/libcommon/source/card_emu.c +++ b/firmware/libcommon/source/card_emu.c @@ -762,14 +762,6 @@ ch->stats.rx_bytes++; switch (ch->state) { - case ISO_S_WAIT_POWER: - case ISO_S_WAIT_CLK: - case ISO_S_WAIT_RST: - case ISO_S_WAIT_ATR: - TRACE_ERROR("%u: Received UART char in invalid 7816 state " - "%u\r\n", ch->num, ch->state); - /* we shouldn't receive any data from the reader yet! */ - break; case ISO_S_WAIT_TPDU: if (byte == 0xff) { new_state = process_byte_pts(ch, byte); @@ -783,6 +775,10 @@ case ISO_S_IN_PTS: new_state = process_byte_pts(ch, byte); goto out_silent; + default: + TRACE_ERROR("%u: Received UART char in invalid 7816 state " + "%u\r\n", ch->num, ch->state); + break; } out_silent: -- To view, visit https://gerrit.osmocom.org/9965 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ifbc8dbe1c9f176343304f211c7e6068fb977961e Gerrit-Change-Number: 9965 Gerrit-PatchSet: 5 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:33:31 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Wed, 11 Jul 2018 20:33:31 +0000 Subject: Change in simtrace2[master]: sniff: add checksum verification for ATR and PPS In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9966 to look at the new patch set (#6). Change subject: sniff: add checksum verification for ATR and PPS ...................................................................... sniff: add checksum verification for ATR and PPS a checksum error is only signaled in the USB message with the corresponding flag. Change-Id: I277868267c3199eea216ab47bdd09fb2fb944b06 --- M firmware/libcommon/include/simtrace_prot.h M firmware/libcommon/source/sniffer.c M host/simtrace2-sniff.c 3 files changed, 28 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/66/9966/6 -- To view, visit https://gerrit.osmocom.org/9966 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I277868267c3199eea216ab47bdd09fb2fb944b06 Gerrit-Change-Number: 9966 Gerrit-PatchSet: 6 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:43:52 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 11 Jul 2018 20:43:52 +0000 Subject: Change in osmo-pcu[master]: tbf: Use incrementing id for rate_ctr_group_alloc In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/9943 ) Change subject: tbf: Use incrementing id for rate_ctr_group_alloc ...................................................................... tbf: Use incrementing id for rate_ctr_group_alloc Wrap-around of var handling next id will luckly happen long after initially assigned TBFs are already released. Change-Id: I90ef64133986c556c1a529f5b966e847e6cabbad --- M src/tbf.cpp 1 file changed, 18 insertions(+), 8 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/tbf.cpp b/src/tbf.cpp index 76137df..4b89a43 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -51,6 +51,8 @@ extern void *tall_pcu_ctx; +static unsigned int next_tbf_ctr_group_id = 0; /* Incrementing group id */ + static void tbf_timer_cb(void *_tbf); const struct value_string gprs_rlcmac_tbf_poll_state_names[] = { @@ -922,7 +924,7 @@ "Allocated: trx = %d, ul_slots = %02x, dl_slots = %02x\n", tbf->trx->trx_no, tbf->ul_slots(), tbf->dl_slots()); - tbf->m_ctrs = rate_ctr_group_alloc(tbf, &tbf_ctrg_desc, 0); + tbf->m_ctrs = rate_ctr_group_alloc(tbf, &tbf_ctrg_desc, next_tbf_ctr_group_id++); if (!tbf->m_ctrs) { LOGPTBF(tbf, LOGL_ERROR, "Couldn't allocate TBF counters\n"); return -1; @@ -1005,8 +1007,10 @@ return NULL; } - tbf->m_ul_egprs_ctrs = rate_ctr_group_alloc(tbf, &tbf_ul_egprs_ctrg_desc, 0); - tbf->m_ul_gprs_ctrs = rate_ctr_group_alloc(tbf, &tbf_ul_gprs_ctrg_desc, 0); + tbf->m_ul_egprs_ctrs = rate_ctr_group_alloc(tbf, + &tbf_ul_egprs_ctrg_desc, tbf->m_ctrs->idx); + tbf->m_ul_gprs_ctrs = rate_ctr_group_alloc(tbf, + &tbf_ul_gprs_ctrg_desc, tbf->m_ctrs->idx); if (!tbf->m_ul_egprs_ctrs || !tbf->m_ul_gprs_ctrs) { LOGPTBF(tbf, LOGL_ERROR, "Couldn't allocate TBF UL counters\n"); talloc_free(tbf); @@ -1094,14 +1098,18 @@ if (tbf->is_egprs_enabled()) { tbf->set_window_size(); - tbf->m_dl_egprs_ctrs = rate_ctr_group_alloc(tbf, &tbf_dl_egprs_ctrg_desc, 0); + tbf->m_dl_egprs_ctrs = rate_ctr_group_alloc(tbf, + &tbf_dl_egprs_ctrg_desc, + tbf->m_ctrs->idx); if (!tbf->m_dl_egprs_ctrs) { LOGPTBF(tbf, LOGL_ERROR, "Couldn't allocate EGPRS DL counters\n"); talloc_free(tbf); return NULL; } } else { - tbf->m_dl_gprs_ctrs = rate_ctr_group_alloc(tbf, &tbf_dl_gprs_ctrg_desc, 0); + tbf->m_dl_gprs_ctrs = rate_ctr_group_alloc(tbf, + &tbf_dl_gprs_ctrg_desc, + tbf->m_ctrs->idx); if (!tbf->m_dl_gprs_ctrs) { LOGPTBF(tbf, LOGL_ERROR, "Couldn't allocate GPRS DL counters\n"); talloc_free(tbf); @@ -1569,11 +1577,13 @@ TBF_SET_ASS_STATE_UL(ul_tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ); ul_tbf->control_ts = ts; ul_tbf->trx = trx; - ul_tbf->m_ctrs = rate_ctr_group_alloc(ul_tbf, &tbf_ctrg_desc, 0); + ul_tbf->m_ctrs = rate_ctr_group_alloc(ul_tbf, &tbf_ctrg_desc, next_tbf_ctr_group_id++); ul_tbf->m_ul_egprs_ctrs = rate_ctr_group_alloc(ul_tbf, - &tbf_ul_egprs_ctrg_desc, 0); + &tbf_ul_egprs_ctrg_desc, + ul_tbf->m_ctrs->idx); ul_tbf->m_ul_gprs_ctrs = rate_ctr_group_alloc(ul_tbf, - &tbf_ul_gprs_ctrg_desc, 0); + &tbf_ul_gprs_ctrg_desc, + ul_tbf->m_ctrs->idx); if (!ul_tbf->m_ctrs || !ul_tbf->m_ul_egprs_ctrs || !ul_tbf->m_ul_gprs_ctrs) { LOGPTBF(ul_tbf, LOGL_ERROR, "Cound not allocate TBF UL rate counters\n"); talloc_free(ul_tbf); -- To view, visit https://gerrit.osmocom.org/9943 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I90ef64133986c556c1a529f5b966e847e6cabbad Gerrit-Change-Number: 9943 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:43:54 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 11 Jul 2018 20:43:54 +0000 Subject: Change in osmo-pcu[master]: tbf: Replace '.' in counter names with ':' In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/9942 ) Change subject: tbf: Replace '.' in counter names with ':' ...................................................................... tbf: Replace '.' in counter names with ':' The '.' is illegal character in counter names, as they are exported via CTRL interface, where '.' has a special meaning that cannot be used by strings comprising the variable name. Change-Id: Ieb7496e1a30ab4f2bfe36c7b664dcdc034010a15 --- M src/tbf.cpp 1 file changed, 32 insertions(+), 32 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/tbf.cpp b/src/tbf.cpp index 4b89a43..6792d08 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -100,49 +100,49 @@ }; static const struct rate_ctr_desc tbf_ctr_description[] = { - { "rlc.nacked", "RLC Nacked " }, + { "rlc:nacked", "RLC Nacked " }, }; static const struct rate_ctr_desc tbf_dl_gprs_ctr_description[] = { - { "gprs.downlink.cs1", "CS1 " }, - { "gprs.downlink.cs2", "CS2 " }, - { "gprs.downlink.cs3", "CS3 " }, - { "gprs.downlink.cs4", "CS4 " }, + { "gprs:downlink:cs1", "CS1 " }, + { "gprs:downlink:cs2", "CS2 " }, + { "gprs:downlink:cs3", "CS3 " }, + { "gprs:downlink:cs4", "CS4 " }, }; static const struct rate_ctr_desc tbf_dl_egprs_ctr_description[] = { - { "egprs.downlink.mcs1", "MCS1 " }, - { "egprs.downlink.mcs2", "MCS2 " }, - { "egprs.downlink.mcs3", "MCS3 " }, - { "egprs.downlink.mcs4", "MCS4 " }, - { "egprs.downlink.mcs5", "MCS5 " }, - { "egprs.downlink.mcs6", "MCS6 " }, - { "egprs.downlink.mcs7", "MCS7 " }, - { "egprs.downlink.mcs8", "MCS8 " }, - { "egprs.downlink.mcs9", "MCS9 " }, + { "egprs:downlink:mcs1", "MCS1 " }, + { "egprs:downlink:mcs2", "MCS2 " }, + { "egprs:downlink:mcs3", "MCS3 " }, + { "egprs:downlink:mcs4", "MCS4 " }, + { "egprs:downlink:mcs5", "MCS5 " }, + { "egprs:downlink:mcs6", "MCS6 " }, + { "egprs:downlink:mcs7", "MCS7 " }, + { "egprs:downlink:mcs8", "MCS8 " }, + { "egprs:downlink:mcs9", "MCS9 " }, }; static const struct rate_ctr_desc tbf_ul_gprs_ctr_description[] = { - { "gprs.uplink.cs1", "CS1 " }, - { "gprs.uplink.cs2", "CS2 " }, - { "gprs.uplink.cs3", "CS3 " }, - { "gprs.uplink.cs4", "CS4 " }, + { "gprs:uplink:cs1", "CS1 " }, + { "gprs:uplink:cs2", "CS2 " }, + { "gprs:uplink:cs3", "CS3 " }, + { "gprs:uplink:cs4", "CS4 " }, }; static const struct rate_ctr_desc tbf_ul_egprs_ctr_description[] = { - { "egprs.uplink.mcs1", "MCS1 " }, - { "egprs.uplink.mcs2", "MCS2 " }, - { "egprs.uplink.mcs3", "MCS3 " }, - { "egprs.uplink.mcs4", "MCS4 " }, - { "egprs.uplink.mcs5", "MCS5 " }, - { "egprs.uplink.mcs6", "MCS6 " }, - { "egprs.uplink.mcs7", "MCS7 " }, - { "egprs.uplink.mcs8", "MCS8 " }, - { "egprs.uplink.mcs9", "MCS9 " }, + { "egprs:uplink:mcs1", "MCS1 " }, + { "egprs:uplink:mcs2", "MCS2 " }, + { "egprs:uplink:mcs3", "MCS3 " }, + { "egprs:uplink:mcs4", "MCS4 " }, + { "egprs:uplink:mcs5", "MCS5 " }, + { "egprs:uplink:mcs6", "MCS6 " }, + { "egprs:uplink:mcs7", "MCS7 " }, + { "egprs:uplink:mcs8", "MCS8 " }, + { "egprs:uplink:mcs9", "MCS9 " }, }; static const struct rate_ctr_group_desc tbf_ctrg_desc = { - "pcu.tbf", + "pcu:tbf", "TBF Statistics", OSMO_STATS_CLASS_SUBSCRIBER, ARRAY_SIZE(tbf_ctr_description), @@ -150,7 +150,7 @@ }; static const struct rate_ctr_group_desc tbf_dl_gprs_ctrg_desc = { - "tbf.gprs", + "tbf:gprs", "Data Blocks", OSMO_STATS_CLASS_SUBSCRIBER, ARRAY_SIZE(tbf_dl_gprs_ctr_description), @@ -158,7 +158,7 @@ }; static const struct rate_ctr_group_desc tbf_dl_egprs_ctrg_desc = { - "tbf.egprs", + "tbf:egprs", "Data Blocks", OSMO_STATS_CLASS_SUBSCRIBER, ARRAY_SIZE(tbf_dl_egprs_ctr_description), @@ -166,7 +166,7 @@ }; static const struct rate_ctr_group_desc tbf_ul_gprs_ctrg_desc = { - "tbf.gprs", + "tbf:gprs", "Data Blocks", OSMO_STATS_CLASS_SUBSCRIBER, ARRAY_SIZE(tbf_ul_gprs_ctr_description), @@ -174,7 +174,7 @@ }; static const struct rate_ctr_group_desc tbf_ul_egprs_ctrg_desc = { - "tbf.egprs", + "tbf:egprs", "Data Blocks", OSMO_STATS_CLASS_SUBSCRIBER, ARRAY_SIZE(tbf_ul_egprs_ctr_description), -- To view, visit https://gerrit.osmocom.org/9942 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ieb7496e1a30ab4f2bfe36c7b664dcdc034010a15 Gerrit-Change-Number: 9942 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:48:06 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 11 Jul 2018 20:48:06 +0000 Subject: Change in python/osmo-python-tests[master]: Introduce script ctrl2cgi.py In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9963 to look at the new patch set (#2). Change subject: Introduce script ctrl2cgi.py ...................................................................... Introduce script ctrl2cgi.py This scripts implements a similar proxy to the one already available in soapy.py, but aiming at converting CTRl into a regular HTTP POST Request to be handled by a CGI script in the HTTP server. Furthermore, it includes several improvements over the soapy.py script, such as using a token to authenticate users and capability to read some parameters from a cfg file. Change-Id: I7a83ecb379835e295c8cb4c27c39883783746544 --- M README A scripts/ctrl2cgi.py M setup.py 3 files changed, 249 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests refs/changes/63/9963/2 -- To view, visit https://gerrit.osmocom.org/9963 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7a83ecb379835e295c8cb4c27c39883783746544 Gerrit-Change-Number: 9963 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 21:08:47 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 11 Jul 2018 21:08:47 +0000 Subject: Change in pysim[master]: cosmetic: fix excess space in log output (typo) Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/9967 Change subject: cosmetic: fix excess space in log output (typo) ...................................................................... cosmetic: fix excess space in log output (typo) There shouldn't be a space between the end of a sentence and a punctuation mark. Change-Id: I33f9b8c803ccd185ffa370d235363423d82ba9c7 --- M pySim/transport/__init__.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/67/9967/1 diff --git a/pySim/transport/__init__.py b/pySim/transport/__init__.py index 9cd23d0..4b932cd 100644 --- a/pySim/transport/__init__.py +++ b/pySim/transport/__init__.py @@ -101,5 +101,5 @@ sw_masked = sw_masked + rv[1][i].lower() if sw.lower() != sw_masked: - raise RuntimeError("SW match failed ! Expected %s and got %s." % (sw.lower(), rv[1])) + raise RuntimeError("SW match failed! Expected %s and got %s." % (sw.lower(), rv[1])) return rv -- To view, visit https://gerrit.osmocom.org/9967 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I33f9b8c803ccd185ffa370d235363423d82ba9c7 Gerrit-Change-Number: 9967 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 21:08:48 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 11 Jul 2018 21:08:48 +0000 Subject: Change in pysim[master]: pySim-read: Print exception when reading of EF.MSISDN fails Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/9968 Change subject: pySim-read: Print exception when reading of EF.MSISDN fails ...................................................................... pySim-read: Print exception when reading of EF.MSISDN fails At the moment the exception is catched, but there is only a vague error message printed. However, the exception string usually tells us the status word, so it is very valuable to see it. Lets make sure that the exception string is printed here. Change-Id: Icb30470b1c0eee6a15fc028da820e92bf9ded27a --- M pySim-read.py 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/68/9968/1 diff --git a/pySim-read.py b/pySim-read.py index 5ca39ee..561a498 100755 --- a/pySim-read.py +++ b/pySim-read.py @@ -134,8 +134,8 @@ print("MSISDN: Not available") else: print("MSISDN: Can't read, response code = %s" % (sw,)) - except: - print "MSISDN: Can't read. Probably not existing file" + except Exception as e: + print "HPLMNAcT: Can't read file -- " + str(e) # Done for this card and maybe for everything ? print "Done !\n" -- To view, visit https://gerrit.osmocom.org/9968 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Icb30470b1c0eee6a15fc028da820e92bf9ded27a Gerrit-Change-Number: 9968 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 21:08:49 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 11 Jul 2018 21:08:49 +0000 Subject: Change in pysim[master]: pySim-read: read contents of PLMN related files. Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/9969 Change subject: pySim-read: read contents of PLMN related files. ...................................................................... pySim-read: read contents of PLMN related files. The files EF.PLMNsel, EF.PLMNwAcT, EF.OPLMNwAcT, EF.HPLMNAcT are not yet printed by pysim-read. Lets add support for those files. Change-Id: Ice802033adfa6fc1bccc76da47495eb29c3aef6c Related: SYS#4245 --- M pySim-read.py 1 file changed, 39 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/69/9969/1 diff --git a/pySim-read.py b/pySim-read.py index 561a498..247a4b4 100755 --- a/pySim-read.py +++ b/pySim-read.py @@ -107,14 +107,45 @@ else: print("SMSP: Can't read, response code = %s" % (sw,)) - # EF.HPLMN -# (res, sw) = scc.read_binary(['3f00', '7f20', '6f30']) -# if sw == '9000': -# print("HPLMN: %s" % (res)) -# print("HPLMN: %s" % (dec_hplmn(res),)) -# else: -# print("HPLMN: Can't read, response code = %s" % (sw,)) - # FIXME + # EF.PLMNsel + try: + (res, sw) = scc.read_binary(EF['PLMNsel']) + if sw == '9000': + print("PLMNsel: %s" % (res)) + else: + print("PLMNsel: Can't read, response code = %s" % (sw,)) + except Exception as e: + print "HPLMNAcT: Can't read file -- " + str(e) + + # EF.PLMNwAcT + try: + (res, sw) = scc.read_binary(EF['PLMNwAcT']) + if sw == '9000': + print("PLMNwAcT: %s" % (res)) + else: + print("PLMNwAcT: Can't read, response code = %s" % (sw,)) + except Exception as e: + print "HPLMNAcT: Can't read file -- " + str(e) + + # EF.OPLMNwAcT + try: + (res, sw) = scc.read_binary(EF['OPLMNwAcT']) + if sw == '9000': + print("OPLMNwAcT: %s" % (res)) + else: + print("OPLMNwAcT: Can't read, response code = %s" % (sw,)) + except Exception as e: + print "HPLMNAcT: Can't read file -- " + str(e) + + # EF.HPLMNAcT + try: + (res, sw) = scc.read_binary(EF['HPLMNAcT']) + if sw == '9000': + print("HPLMNAcT: %s" % (res)) + else: + print("HPLMNAcT: Can't read, response code = %s" % (sw,)) + except Exception as e: + print "HPLMNAcT: Can't read file -- " + str(e) # EF.ACC (res, sw) = scc.read_binary(['3f00', '7f20', '6f78']) -- To view, visit https://gerrit.osmocom.org/9969 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ice802033adfa6fc1bccc76da47495eb29c3aef6c Gerrit-Change-Number: 9969 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 21:13:07 2018 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 11 Jul 2018 21:13:07 +0000 Subject: Change in osmocom-bb[master]: Move from libc random() to osmo_get_rand_id In-Reply-To: References: Message-ID: Holger Freyther has posted comments on this change. ( https://gerrit.osmocom.org/9914 ) Change subject: Move from libc random() to osmo_get_rand_id ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9914 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie0cc64663cd4b90c027b79545dc5d3ac9d87b9dd Gerrit-Change-Number: 9914 Gerrit-PatchSet: 2 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 11 Jul 2018 21:13:07 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 21:13:11 2018 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 11 Jul 2018 21:13:11 +0000 Subject: Change in osmocom-bb[master]: Move from libc random() to osmo_get_rand_id In-Reply-To: References: Message-ID: Holger Freyther has submitted this change and it was merged. ( https://gerrit.osmocom.org/9914 ) Change subject: Move from libc random() to osmo_get_rand_id ...................................................................... Move from libc random() to osmo_get_rand_id When starting multiple mobile in the same second, the libc random number generator will be seeded to exactly the same value. The random bits inside the RACH request(s) will be exactly the same across multiple mobile and when the channel fails they all pick the same randomized back-off timing. Use stronger random numbers and replace all calls to random(2) with osmo_get_rand_id. Add a fallback to try random(). Change-Id: Ie0cc64663cd4b90c027b79545dc5d3ac9d87b9dd --- M src/host/layer23/src/mobile/gsm322.c M src/host/layer23/src/mobile/gsm48_mm.c M src/host/layer23/src/mobile/gsm48_rr.c M src/host/layer23/src/mobile/settings.c 4 files changed, 18 insertions(+), 5 deletions(-) Approvals: Holger Freyther: Looks good to me, approved Vadim Yanitskiy: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/src/host/layer23/src/mobile/gsm322.c b/src/host/layer23/src/mobile/gsm322.c index c3485b6..ce25cd5 100644 --- a/src/host/layer23/src/mobile/gsm322.c +++ b/src/host/layer23/src/mobile/gsm322.c @@ -959,7 +959,9 @@ entries++; } while(entries) { - move = random() % entries; + if (osmo_get_rand_id((uint8_t *) &move, sizeof(move)) != 0) + move = random(); + move = move % entries; i = 0; llist_for_each_entry(temp, &temp_list, entry) { if (rxlev2dbm(temp->rxlev) > -85) { diff --git a/src/host/layer23/src/mobile/gsm48_mm.c b/src/host/layer23/src/mobile/gsm48_mm.c index a7af1f5..a36e7e8 100644 --- a/src/host/layer23/src/mobile/gsm48_mm.c +++ b/src/host/layer23/src/mobile/gsm48_mm.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -2099,7 +2100,9 @@ mm->t3212.timeout.tv_sec = current_time.tv_sec + (t % s->t3212); } else { - uint32_t rand = random(); + uint32_t rand; + if (osmo_get_rand_id((uint8_t *) &rand, sizeof(rand)) != 0) + rand = random(); LOGP(DMM, LOGL_INFO, "New T3212 while timer is not " "running (value %d)\n", s->t3212); diff --git a/src/host/layer23/src/mobile/gsm48_rr.c b/src/host/layer23/src/mobile/gsm48_rr.c index dd3fe93..db2cb5e 100644 --- a/src/host/layer23/src/mobile/gsm48_rr.c +++ b/src/host/layer23/src/mobile/gsm48_rr.c @@ -71,6 +71,7 @@ #include #include #include +#include #include #include @@ -1628,7 +1629,8 @@ } } - chan_req = random(); + if (osmo_get_rand_id((uint8_t *) &chan_req, sizeof(chan_req)) != 0) + chan_req = random(); chan_req &= rr->chan_req_mask; chan_req |= rr->chan_req_val; diff --git a/src/host/layer23/src/mobile/settings.c b/src/host/layer23/src/mobile/settings.c index 7370b0a..80b0b48 100644 --- a/src/host/layer23/src/mobile/settings.c +++ b/src/host/layer23/src/mobile/settings.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -178,14 +179,19 @@ { int digits = set->imei_random; char rand[16]; + long rand_num; if (digits <= 0) return 0; if (digits > 15) digits = 15; - sprintf(rand, "%08ld", random() % 100000000); - sprintf(rand + 8, "%07ld", random() % 10000000); + if (osmo_get_rand_id((uint8_t *) &rand_num, sizeof(rand_num)) != 0) + rand_num = random(); + sprintf(rand, "%08ld", rand_num % 100000000); + if (osmo_get_rand_id((uint8_t *) &rand_num, sizeof(rand_num)) != 0) + rand_num = random(); + sprintf(rand + 8, "%07ld", rand_num % 10000000); strcpy(set->imei + 15 - digits, rand + 15 - digits); strncpy(set->imeisv, set->imei, 15); -- To view, visit https://gerrit.osmocom.org/9914 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ie0cc64663cd4b90c027b79545dc5d3ac9d87b9dd Gerrit-Change-Number: 9914 Gerrit-PatchSet: 3 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 21:21:18 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 11 Jul 2018 21:21:18 +0000 Subject: Change in pysim[master]: pySim-read: read contents of PLMN related files. In-Reply-To: References: Message-ID: dexter has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/9969 ) Change subject: pySim-read: read contents of PLMN related files. ...................................................................... pySim-read: read contents of PLMN related files. The files EF.PLMNsel, EF.PLMNwAcT, EF.OPLMNwAcT, EF.HPLMNAcT are not yet printed by pysim-read. Lets add support for those files. Change-Id: Ice802033adfa6fc1bccc76da47495eb29c3aef6c Related: SYS#4245 --- M pySim-read.py 1 file changed, 40 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/69/9969/2 -- To view, visit https://gerrit.osmocom.org/9969 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ice802033adfa6fc1bccc76da47495eb29c3aef6c Gerrit-Change-Number: 9969 Gerrit-PatchSet: 2 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 21:26:08 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 11 Jul 2018 21:26:08 +0000 Subject: Change in pysim[master]: cards: add update method for EF:PLMNsel to Card class Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/9970 Change subject: cards: add update method for EF:PLMNsel to Card class ...................................................................... cards: add update method for EF:PLMNsel to Card class The Card class offers update methods for various EF, but for PLMNsel there is no update method available yet. Lets add one. Change-Id: I832f7bef70c92dc101b94ad871b6cafaa626e134 Related: SYS#4245 --- M pySim/cards.py 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/70/9970/1 diff --git a/pySim/cards.py b/pySim/cards.py index 0c9c2b8..3577d8d 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -83,6 +83,12 @@ data, sw = self._scc.update_binary(EF['HPLMNwAcT'], content + 'ffffff0000' * (size/5-1)) return sw + def update_plmnsel(self, mcc, mnc): + data = self._scc.read_binary(EF['PLMNsel'], length=None, offset=0) + size = len(data[0])/2 + hplmn = enc_plmn(mcc, mnc) + self._scc.update_binary(EF['PLMNsel'], hplmn + 'ff' * (size-3)) + def update_smsp(self, smsp): data, sw = self._scc.update_record(EF['SMSP'], 1, rpad(smsp, 84)) return sw -- To view, visit https://gerrit.osmocom.org/9970 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I832f7bef70c92dc101b94ad871b6cafaa626e134 Gerrit-Change-Number: 9970 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Thu Jul 12 00:05:56 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Thu, 12 Jul 2018 00:05:56 +0000 (UTC) Subject: =?UTF-8?Q?Jenkins_build_is_back_to_normal_?= =?UTF-8?Q?:_master-osmo-mgw_=C2=BB_--enable-mgc?= =?UTF-8?Q?p-transcoding,a2=3Ddefault,a3=3Ddefa?= =?UTF-8?Q?ult,osmocom-master-debian9_#1108?= In-Reply-To: <1040827793.149.1531325204289.JavaMail.jenkins@jenkins.osmocom.org> References: <1040827793.149.1531325204289.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <1919127237.150.1531353956426.JavaMail.jenkins@jenkins.osmocom.org> See From jenkins at lists.osmocom.org Thu Jul 12 00:11:04 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Thu, 12 Jul 2018 00:11:04 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-osmo-sgsn_=C2=BB_--enable-?= =?UTF-8?Q?iu,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#4159?= Message-ID: <278543636.151.1531354264423.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 992.49 KB...] void (*free)(type *); \ ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_PLMNs-in-shared-network.h:27:2: note: in expansion of macro 'A_SEQUENCE_OF' A_SEQUENCE_OF(struct MemberM { ^ CC gprs_sgsn.o /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_RABDataVolumeReport.h:27:23: warning: 'struct MemberN' declared inside parameter list A_SEQUENCE_OF(struct MemberN { ^ /build/deps/install/stow/libasn1c/include/asn1c/asn_SET_OF.h:17:16: note: in definition of macro 'A_SET_OF' void (*free)(type *); \ ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_RABDataVolumeReport.h:27:2: note: in expansion of macro 'A_SEQUENCE_OF' A_SEQUENCE_OF(struct MemberN { ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_RABParametersList.h:29:23: warning: 'struct MemberB' declared inside parameter list A_SEQUENCE_OF(struct MemberB { ^ /build/deps/install/stow/libasn1c/include/asn1c/asn_SET_OF.h:17:16: note: in definition of macro 'A_SET_OF' void (*free)(type *); \ ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_RABParametersList.h:29:2: note: in expansion of macro 'A_SEQUENCE_OF' A_SEQUENCE_OF(struct MemberB { ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_UnsuccessfulLinking-IEs.h:27:23: warning: 'struct MemberD' declared inside parameter list A_SEQUENCE_OF(struct MemberD { ^ /build/deps/install/stow/libasn1c/include/asn1c/asn_SET_OF.h:17:16: note: in definition of macro 'A_SET_OF' void (*free)(type *); \ ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_UnsuccessfulLinking-IEs.h:27:2: note: in expansion of macro 'A_SEQUENCE_OF' A_SEQUENCE_OF(struct MemberD { ^ In file included from /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/ranap_common.h:592:0, from /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/ranap_ies_defs.h:7, from gprs_gmm.c:50: /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/ranap_ies_defs.h:126:0: warning: "ENHANCEDRELOCATIONCOMPLETEREQUESTIES_RANAP_EXTENDEDRNC_ID_PRESENT" redefined #define ENHANCEDRELOCATIONCOMPLETEREQUESTIES_RANAP_EXTENDEDRNC_ID_PRESENT (1 << 1) ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/ranap_ies_defs.h:125:0: note: this is the location of the previous definition #define ENHANCEDRELOCATIONCOMPLETEREQUESTIES_RANAP_EXTENDEDRNC_ID_PRESENT (1 << 0) ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/ranap_ies_defs.h:436:0: warning: "RANAP_ENHANCEDRELOCATIONINFORMATIONREQUESTIES_RANAP_IUSIGNALLINGCONNECTIONIDENTIFIER_PRESENT" redefined #define RANAP_ENHANCEDRELOCATIONINFORMATIONREQUESTIES_RANAP_IUSIGNALLINGCONNECTIONIDENTIFIER_PRESENT (1 << 2) ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/ranap_ies_defs.h:434:0: note: this is the location of the previous definition #define RANAP_ENHANCEDRELOCATIONINFORMATIONREQUESTIES_RANAP_IUSIGNALLINGCONNECTIONIDENTIFIER_PRESENT (1 << 0) ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/ranap_ies_defs.h:437:0: warning: "RANAP_ENHANCEDRELOCATIONINFORMATIONREQUESTIES_RANAP_GLOBALCN_ID_PRESENT" redefined #define RANAP_ENHANCEDRELOCATIONINFORMATIONREQUESTIES_RANAP_GLOBALCN_ID_PRESENT (1 << 3) ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/ranap_ies_defs.h:435:0: note: this is the location of the previous definition #define RANAP_ENHANCEDRELOCATIONINFORMATIONREQUESTIES_RANAP_GLOBALCN_ID_PRESENT (1 << 1) ^ CC gprs_sndcp.o gprs_gmm.c: In function 'gsm0408_gprs_rcvmsg_iu': gprs_gmm.c:2823:9: note: #pragma message: set drop_cipherable arg for gsm0408_rcv_gmm() from IuPS? #pragma message "set drop_cipherable arg for gsm0408_rcv_gmm() from IuPS?" ^ CC gprs_sndcp_comp.o CC gprs_sndcp_dcomp.o CC gprs_sndcp_pcomp.o CC gprs_sndcp_vty.o CC gprs_sndcp_xid.o CC sgsn_main.o CC sgsn_vty.o CC sgsn_libgtp.o In file included from /build/deps/install/stow/libosmocore/include/osmocom/core/talloc.h:5:0, from sgsn_main.c:37: /usr/include/talloc.h:1313:1: internal compiler error: Segmentation fault void *talloc_realloc_fn(const void *context, void *ptr, size_t size); ^ Please submit a full bug report, with preprocessed source if appropriate. See for instructions. In file included from /build/deps/install/stow/libasn1c/include/asn1c/asn_SEQUENCE_OF.h:8:0, from /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_IE-Extensions.h:15, from /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_AllocationOrRetentionPriority.h:18, from /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/ranap_common.h:8, from /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/ranap_ies_defs.h:7, from sgsn_libgtp.c:56: /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_GA-Polygon.h:26:23: warning: 'struct Member' declared inside parameter list A_SEQUENCE_OF(struct Member { ^ /build/deps/install/stow/libasn1c/include/asn1c/asn_SET_OF.h:17:16: note: in definition of macro 'A_SET_OF' void (*free)(type *); \ ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_GA-Polygon.h:26:2: note: in expansion of macro 'A_SEQUENCE_OF' A_SEQUENCE_OF(struct Member { ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_GA-Polygon.h:26:23: warning: its scope is only this definition or declaration, which is probably not what you want A_SEQUENCE_OF(struct Member { ^ /build/deps/install/stow/libasn1c/include/asn1c/asn_SET_OF.h:17:16: note: in definition of macro 'A_SET_OF' void (*free)(type *); \ ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_GA-Polygon.h:26:2: note: in expansion of macro 'A_SEQUENCE_OF' A_SEQUENCE_OF(struct Member { ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_AuthorisedPLMNs.h:27:23: warning: 'struct MemberC' declared inside parameter list A_SEQUENCE_OF(struct MemberC { ^ /build/deps/install/stow/libasn1c/include/asn1c/asn_SET_OF.h:17:16: note: in definition of macro 'A_SET_OF' void (*free)(type *); \ ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_AuthorisedPLMNs.h:27:2: note: in expansion of macro 'A_SEQUENCE_OF' A_SEQUENCE_OF(struct MemberC { ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_JoinedMBMSBearerService-IEs.h:27:23: warning: 'struct MemberF' declared inside parameter list A_SEQUENCE_OF(struct MemberF { ^ /build/deps/install/stow/libasn1c/include/asn1c/asn_SET_OF.h:17:16: note: in definition of macro 'A_SET_OF' void (*free)(type *); \ ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_JoinedMBMSBearerService-IEs.h:27:2: note: in expansion of macro 'A_SEQUENCE_OF' A_SEQUENCE_OF(struct MemberF { ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_CriticalityDiagnostics-IE-List.h:28:23: warning: 'struct MemberG' declared inside parameter list A_SEQUENCE_OF(struct MemberG { ^ /build/deps/install/stow/libasn1c/include/asn1c/asn_SET_OF.h:17:16: note: in definition of macro 'A_SET_OF' void (*free)(type *); \ ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_CriticalityDiagnostics-IE-List.h:28:2: note: in expansion of macro 'A_SEQUENCE_OF' A_SEQUENCE_OF(struct MemberG { ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_DataVolumeList.h:27:23: warning: 'struct MemberH' declared inside parameter list A_SEQUENCE_OF(struct MemberH { ^ /build/deps/install/stow/libasn1c/include/asn1c/asn_SET_OF.h:17:16: note: in definition of macro 'A_SET_OF' void (*free)(type *); \ ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_DataVolumeList.h:27:2: note: in expansion of macro 'A_SEQUENCE_OF' A_SEQUENCE_OF(struct MemberH { ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_EUTRANFrequencies.h:27:23: warning: 'struct MemberJ' declared inside parameter list A_SEQUENCE_OF(struct MemberJ { ^ /build/deps/install/stow/libasn1c/include/asn1c/asn_SET_OF.h:17:16: note: in definition of macro 'A_SET_OF' void (*free)(type *); \ ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_EUTRANFrequencies.h:27:2: note: in expansion of macro 'A_SEQUENCE_OF' A_SEQUENCE_OF(struct MemberJ { ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_LA-LIST.h:27:23: warning: 'struct MemberA' declared inside parameter list A_SEQUENCE_OF(struct MemberA { ^ /build/deps/install/stow/libasn1c/include/asn1c/asn_SET_OF.h:17:16: note: in definition of macro 'A_SET_OF' void (*free)(type *); \ ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_LA-LIST.h:27:2: note: in expansion of macro 'A_SEQUENCE_OF' A_SEQUENCE_OF(struct MemberA { ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_LeftMBMSBearerService-IEs.h:26:23: warning: 'struct MemberK' declared inside parameter list A_SEQUENCE_OF(struct MemberK { ^ /build/deps/install/stow/libasn1c/include/asn1c/asn_SET_OF.h:17:16: note: in definition of macro 'A_SET_OF' void (*free)(type *); \ ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_LeftMBMSBearerService-IEs.h:26:2: note: in expansion of macro 'A_SEQUENCE_OF' A_SEQUENCE_OF(struct MemberK { ^ In file included from /build/deps/install/stow/libasn1c/include/asn1c/asn_SEQUENCE_OF.h:8:0, from /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_IE-Extensions.h:15, from /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_AllocationOrRetentionPriority.h:18, from /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/ranap_common.h:8, from /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/ranap_ies_defs.h:7, from sgsn_libgtp.c:56: /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_MessageStructure.h:27:23: warning: 'struct MemberL' declared inside parameter list A_SEQUENCE_OF(struct MemberL { ^ /build/deps/install/stow/libasn1c/include/asn1c/asn_SET_OF.h:17:16: note: in definition of macro 'A_SET_OF' void (*free)(type *); \ ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_MessageStructure.h:27:2: note: in expansion of macro 'A_SEQUENCE_OF' A_SEQUENCE_OF(struct MemberL { ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_PLMNs-in-shared-network.h:27:23: warning: 'struct MemberM' declared inside parameter list A_SEQUENCE_OF(struct MemberM { ^ /build/deps/install/stow/libasn1c/include/asn1c/asn_SET_OF.h:17:16: note: in definition of macro 'A_SET_OF' void (*free)(type *); \ ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_PLMNs-in-shared-network.h:27:2: note: in expansion of macro 'A_SEQUENCE_OF' A_SEQUENCE_OF(struct MemberM { ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_RABDataVolumeReport.h:27:23: warning: 'struct MemberN' declared inside parameter list A_SEQUENCE_OF(struct MemberN { ^ /build/deps/install/stow/libasn1c/include/asn1c/asn_SET_OF.h:17:16: note: in definition of macro 'A_SET_OF' void (*free)(type *); \ ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_RABDataVolumeReport.h:27:2: note: in expansion of macro 'A_SEQUENCE_OF' A_SEQUENCE_OF(struct MemberN { ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_RABParametersList.h:29:23: warning: 'struct MemberB' declared inside parameter list A_SEQUENCE_OF(struct MemberB { ^ /build/deps/install/stow/libasn1c/include/asn1c/asn_SET_OF.h:17:16: note: in definition of macro 'A_SET_OF' void (*free)(type *); \ ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_RABParametersList.h:29:2: note: in expansion of macro 'A_SEQUENCE_OF' A_SEQUENCE_OF(struct MemberB { ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_UnsuccessfulLinking-IEs.h:27:23: warning: 'struct MemberD' declared inside parameter list A_SEQUENCE_OF(struct MemberD { ^ /build/deps/install/stow/libasn1c/include/asn1c/asn_SET_OF.h:17:16: note: in definition of macro 'A_SET_OF' void (*free)(type *); \ ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/RANAP_UnsuccessfulLinking-IEs.h:27:2: note: in expansion of macro 'A_SEQUENCE_OF' A_SEQUENCE_OF(struct MemberD { ^ In file included from /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/ranap_common.h:592:0, from /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/ranap_ies_defs.h:7, from sgsn_libgtp.c:56: /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/ranap_ies_defs.h:126:0: warning: "ENHANCEDRELOCATIONCOMPLETEREQUESTIES_RANAP_EXTENDEDRNC_ID_PRESENT" redefined #define ENHANCEDRELOCATIONCOMPLETEREQUESTIES_RANAP_EXTENDEDRNC_ID_PRESENT (1 << 1) ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/ranap_ies_defs.h:125:0: note: this is the location of the previous definition #define ENHANCEDRELOCATIONCOMPLETEREQUESTIES_RANAP_EXTENDEDRNC_ID_PRESENT (1 << 0) ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/ranap_ies_defs.h:436:0: warning: "RANAP_ENHANCEDRELOCATIONINFORMATIONREQUESTIES_RANAP_IUSIGNALLINGCONNECTIONIDENTIFIER_PRESENT" redefined #define RANAP_ENHANCEDRELOCATIONINFORMATIONREQUESTIES_RANAP_IUSIGNALLINGCONNECTIONIDENTIFIER_PRESENT (1 << 2) ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/ranap_ies_defs.h:434:0: note: this is the location of the previous definition #define RANAP_ENHANCEDRELOCATIONINFORMATIONREQUESTIES_RANAP_IUSIGNALLINGCONNECTIONIDENTIFIER_PRESENT (1 << 0) ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/ranap_ies_defs.h:437:0: warning: "RANAP_ENHANCEDRELOCATIONINFORMATIONREQUESTIES_RANAP_GLOBALCN_ID_PRESENT" redefined #define RANAP_ENHANCEDRELOCATIONINFORMATIONREQUESTIES_RANAP_GLOBALCN_ID_PRESENT (1 << 3) ^ /build/deps/install/stow/osmo-iuh/include/osmocom/ranap/ranap_ies_defs.h:435:0: note: this is the location of the previous definition #define RANAP_ENHANCEDRELOCATIONINFORMATIONREQUESTIES_RANAP_GLOBALCN_ID_PRESENT (1 << 1) ^ The bug is not reproducible, so it is likely a hardware or OS problem. Makefile:596: recipe for target 'sgsn_main.o' failed make[3]: *** [sgsn_main.o] Error 1 make[3]: *** Waiting for unfinished jobs.... make[3]: Leaving directory '/build/src/gprs' Makefile:375: recipe for target 'all-recursive' failed make[2]: Leaving directory '/build/src' make[2]: *** [all-recursive] Error 1 Makefile:489: recipe for target 'all-recursive' failed make[1]: Leaving directory '/build' make[1]: *** [all-recursive] Error 1 Makefile:397: recipe for target 'all' failed make: *** [all] Error 2 Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From jenkins at lists.osmocom.org Thu Jul 12 00:20:26 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Thu, 12 Jul 2018 00:20:26 +0000 (UTC) Subject: =?UTF-8?Q?Jenkins_build_is_back_to_normal_:_master-osmo-sgsn_=C2=BB_--en?= =?UTF-8?Q?able-iu,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#4160?= In-Reply-To: <278543636.151.1531354264423.JavaMail.jenkins@jenkins.osmocom.org> References: <278543636.151.1531354264423.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <546381940.152.1531354826085.JavaMail.jenkins@jenkins.osmocom.org> See From gerrit-no-reply at lists.osmocom.org Thu Jul 12 02:01:25 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 12 Jul 2018 02:01:25 +0000 Subject: Change in osmo-ttcn3-hacks[master]: log / comment tweaks In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9627 ) Change subject: log / comment tweaks ...................................................................... Patch Set 3: ok, so the package summary shows "RSL ip.access CRCX ACK" but in the packet details I only see the bytes, no RTP port information: " RSLRSL ip.access CRCX ACK Frame 4107: 84 bytes on wire (672 bits), 84 bytes captured (672 bits) on interface 0 Ethernet II, Src: Technolo_08:02:bc (00:d0:cc:08:02:bc), Dst: WistronI_52:68:b5 (3c:97:0e:52:68:b5) Internet Protocol Version 4, Src: 192.168.0.125, Dst: 192.168.0.6 Transmission Control Protocol, Src Port: 60192, Dst Port: 3003, Seq: 1086, Ack: 387, Len: 18 IPA protocol ip.access, type: RSL Radio Signalling Link (RSL) Data (15 bytes) 0000 7e 71 01 0a f8 00 00 f5 c0 a8 00 7d f3 bf 69 ~q.........}..i Data: 7e71010af80000f5c0a8007df3bf69 [Length: 15] " To see what port number was communicated I had to rely on logging. ip.access CRCX ACK Frame 4107: 84 bytes on wire (672 bits), 84 bytes captured (672 bits) on interface 0 Ethernet II, Src: Technolo_08:02:bc (00:d0:cc:08:02:bc), Dst: WistronI_52:68:b5 (3c:97:0e:52:68:b5) Internet Protocol Version 4, Src: 192.168.0.125, Dst: 192.168.0.6 Transmission Control Protocol, Src Port: 60192, Dst Port: 3003, Seq: 1086, Ack: 387, Len: 18 IPA protocol ip.access, type: RSL Radio Signalling Link (RSL) Data (15 bytes) 0000 7e 71 01 0a f8 00 00 f5 c0 a8 00 7d f3 bf 69 ~q.........}..i Data: 7e71010af80000f5c0a8007df3bf69 [Length: 15] -- To view, visit https://gerrit.osmocom.org/9627 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I93c2914e766e200d89308cc81dd803e939b9b28c Gerrit-Change-Number: 9627 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte Gerrit-Comment-Date: Thu, 12 Jul 2018 02:01:25 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 02:02:08 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 12 Jul 2018 02:02:08 +0000 Subject: Change in osmo-ttcn3-hacks[master]: log / comment tweaks In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9627 ) Change subject: log / comment tweaks ...................................................................... Patch Set 3: (exuse the double pasting typo) -- To view, visit https://gerrit.osmocom.org/9627 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I93c2914e766e200d89308cc81dd803e939b9b28c Gerrit-Change-Number: 9627 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte Gerrit-Comment-Date: Thu, 12 Jul 2018 02:02:08 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 03:27:40 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 12 Jul 2018 03:27:40 +0000 Subject: Change in libosmo-sccp[master]: add osmo_xua_msg_tall_ctx_init() In-Reply-To: References: Message-ID: Hello Pau Espin Pedrol, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9953 to look at the new patch set (#2). Change subject: add osmo_xua_msg_tall_ctx_init() ...................................................................... add osmo_xua_msg_tall_ctx_init() So far the tall_xua ctx used to allocate from in xua_msg_alloc() was never initialized, actually hiding memory leaks from the talloc report. Add this API to allow branching the xua_msg ctx off a sane root ctx. Explicitly initialize tall_xua to NULL, so that, if xua_msg_ctx_init() isn't called, tall_xua is still guaranteed to not be a random pointer. osmo-bsc will use this function to hook the tall_xua ctx to osmo-bsc's own root ctx. Change-Id: I618878680a096a7f7fc2d83098590f2e4cb08870 --- M include/osmocom/sigtran/xua_msg.h M src/xua_msg.c 2 files changed, 9 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/53/9953/2 -- To view, visit https://gerrit.osmocom.org/9953 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I618878680a096a7f7fc2d83098590f2e4cb08870 Gerrit-Change-Number: 9953 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 03:27:40 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 12 Jul 2018 03:27:40 +0000 Subject: Change in libosmo-sccp[master]: fix two memleaks in ipa_rx_msg_sccp() In-Reply-To: References: Message-ID: Hello Pau Espin Pedrol, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9956 to look at the new patch set (#2). Change subject: fix two memleaks in ipa_rx_msg_sccp() ...................................................................... fix two memleaks in ipa_rx_msg_sccp() 1: Do not call xua_msg_alloc() which is later bluntly overwritten by m3ua_xfer_from_data(). 2: After dispatching to m3ua_hmdc_rx_from_l2(), call xua_msg_free(). Related: OS#3393 Change-Id: I0918f9bbc15b036619f1c25a133b69819b2a30fa --- M src/ipa.c 1 file changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/56/9956/2 -- To view, visit https://gerrit.osmocom.org/9956 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0918f9bbc15b036619f1c25a133b69819b2a30fa Gerrit-Change-Number: 9956 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 03:27:40 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 12 Jul 2018 03:27:40 +0000 Subject: Change in libosmo-sccp[master]: fix memleaks in mtp_user_prim_cb() In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9957 to look at the new patch set (#2). Change subject: fix memleaks in mtp_user_prim_cb() ...................................................................... fix memleaks in mtp_user_prim_cb() After dispatching to scrc_rx_mtp_xfer_ind_xua(), free the xua_msg. Do not free the xua_msg in any of the code paths triggered within scrc_rx_mtp_xfer_ind_xua(), i.e. remove xua_msg_free() from: sccp_scoc_rx_from_scrc() +->sccp_scoc_rx_unass_local_ref() +->tx_coerr_from_xua() +->tx_relco_from_xua() Before this, some code paths would free the xua_msg, while most code paths would not, causing mem leaks. Change-Id: I72b3c6a6f57ba32d9ba191af33b4b236492174e0 --- M src/sccp_scoc.c M src/sccp_user.c 2 files changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/57/9957/2 -- To view, visit https://gerrit.osmocom.org/9957 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I72b3c6a6f57ba32d9ba191af33b4b236492174e0 Gerrit-Change-Number: 9957 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 03:27:40 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 12 Jul 2018 03:27:40 +0000 Subject: Change in libosmo-sccp[master]: comment: explain xua_msg free in m3ua_rx_xfer() In-Reply-To: References: Message-ID: Hello Pau Espin Pedrol, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9958 to look at the new patch set (#3). Change subject: comment: explain xua_msg free in m3ua_rx_xfer() ...................................................................... comment: explain xua_msg free in m3ua_rx_xfer() Change-Id: I6211c8809eefeb94289c4c497553561b043ee619 --- M src/m3ua.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/58/9958/3 -- To view, visit https://gerrit.osmocom.org/9958 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6211c8809eefeb94289c4c497553561b043ee619 Gerrit-Change-Number: 9958 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 03:27:57 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 12 Jul 2018 03:27:57 +0000 Subject: Change in libosmo-sccp[master]: fix memleak in ipa_rx_msg_sccp In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/9951 ) Change subject: fix memleak in ipa_rx_msg_sccp ...................................................................... fix memleak in ipa_rx_msg_sccp After m3ua_xfer_from_data() has copied the msgb data, we need to free the msgb. Change-Id: I2263751c0aa3ae32455847c7622af8be0a1e7802 --- M src/ipa.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/src/ipa.c b/src/ipa.c index 0e6f683..e15b1d8 100644 --- a/src/ipa.c +++ b/src/ipa.c @@ -258,6 +258,7 @@ data_hdr.dpc = osmo_htonl(dpc); /* Create M3UA message in XUA structure */ xua = m3ua_xfer_from_data(&data_hdr, msgb_l2(msg), msgb_l2len(msg)); + msgb_free(msg); /* Update xua->mtp with values from data_hdr */ m3ua_dh_to_xfer_param(&xua->mtp, &data_hdr); -- To view, visit https://gerrit.osmocom.org/9951 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I2263751c0aa3ae32455847c7622af8be0a1e7802 Gerrit-Change-Number: 9951 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 03:27:58 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 12 Jul 2018 03:27:58 +0000 Subject: Change in libosmo-sccp[master]: cosmetic: sccp2sua.c: log the IEI for parsed SCCP addr In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/9952 ) Change subject: cosmetic: sccp2sua.c: log the IEI for parsed SCCP addr ...................................................................... cosmetic: sccp2sua.c: log the IEI for parsed SCCP addr Before this, the log looked like it parsed the same address twice with differing results: DLSUA DEBUG sccp2sua.c:333 Parsed Addr: RI=2,PC=1196,SSN=254 DLSUA DEBUG sccp2sua.c:333 Parsed Addr: RI=2,PC=100,SSN=254 Adding the IEI clarifies this: DLSUA DEBUG sccp2sua.c:333 IEI 259: Parsed Addr: RI=2,PC=1196,SSN=254 DLSUA DEBUG sccp2sua.c:333 IEI 258: Parsed Addr: RI=2,PC=100,SSN=254 (I'd have liked to print the IEI name from sua_iei_names, but I frankly can't figure out how to reach that value_string array "hidden" behind a xua_msg_class struct, and neither can I find any other code doing so.) Change-Id: I64adb31129684b2eb66fff581040017ce2f6d163 --- M src/sccp2sua.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/src/sccp2sua.c b/src/sccp2sua.c index afc38c7..2f5b687 100644 --- a/src/sccp2sua.c +++ b/src/sccp2sua.c @@ -330,7 +330,7 @@ if (rc < 0) return rc; - LOGP(DLSUA, LOGL_DEBUG, "Parsed Addr: %s\n", osmo_sccp_addr_dump(&osa)); + LOGP(DLSUA, LOGL_DEBUG, "IEI %u: Parsed Addr: %s\n", iei, osmo_sccp_addr_dump(&osa)); /* Then re-encode it as SUA address */ return xua_msg_add_sccp_addr(xua, iei, &osa); -- To view, visit https://gerrit.osmocom.org/9952 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I64adb31129684b2eb66fff581040017ce2f6d163 Gerrit-Change-Number: 9952 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 03:28:42 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 12 Jul 2018 03:28:42 +0000 Subject: Change in libosmo-sccp[master]: add osmo_xua_msg_tall_ctx_init() In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9953 ) Change subject: add osmo_xua_msg_tall_ctx_init() ...................................................................... Patch Set 2: ok, thought it was only libosmocore... -- To view, visit https://gerrit.osmocom.org/9953 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I618878680a096a7f7fc2d83098590f2e4cb08870 Gerrit-Change-Number: 9953 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 12 Jul 2018 03:28:42 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 03:34:32 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 12 Jul 2018 03:34:32 +0000 Subject: Change in libosmocore[master]: vty: fix use-after-free and memleaks in is_cmd_ambiguous() In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9939 ) Change subject: vty: fix use-after-free and memleaks in is_cmd_ambiguous() ...................................................................... Patch Set 2: looking at my earlier comment it sounds like a pretty bad rant, was meant more friendly, sorry about that... I need this (or a similar fix) to make https://gerrit.osmocom.org/9666 pass. -- To view, visit https://gerrit.osmocom.org/9939 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia71ba742108b5ff020997bfb612ad5eb30d04fcd Gerrit-Change-Number: 9939 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 12 Jul 2018 03:34:32 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 03:35:55 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 12 Jul 2018 03:35:55 +0000 Subject: Change in libosmo-sccp[master]: add osmo_xua_msg_tall_ctx_init() In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9953 ) Change subject: add osmo_xua_msg_tall_ctx_init() ...................................................................... Patch Set 2: I need this for https://gerrit.osmocom.org/9955 -- To view, visit https://gerrit.osmocom.org/9953 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I618878680a096a7f7fc2d83098590f2e4cb08870 Gerrit-Change-Number: 9953 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 12 Jul 2018 03:35:55 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 07:38:57 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 12 Jul 2018 07:38:57 +0000 Subject: Change in pysim[master]: tests: add test program to verify pysim-prog.py (and pysim-read.py) In-Reply-To: References: Message-ID: dexter has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/9947 ) Change subject: tests: add test program to verify pysim-prog.py (and pysim-read.py) ...................................................................... tests: add test program to verify pysim-prog.py (and pysim-read.py) Pysim now supports quite a number of different cards. Estimating if changes in pysim introce regressions becomes increasingly difficult The script that is added with this patch is intended to run as atomated testsuit on real cards attached to a test system. However, it can also be used by developers locally to check for regressions. Change-Id: I8c6f95998272333bc757b34e3ab6be004e8cd674 Related: OS#3376 --- A tests/fakemagicsim.data.example A tests/pysim-test.sh A tests/sysmoUSIM-SJS1.data.example 3 files changed, 234 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/47/9947/2 -- To view, visit https://gerrit.osmocom.org/9947 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8c6f95998272333bc757b34e3ab6be004e8cd674 Gerrit-Change-Number: 9947 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-CC: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 07:41:05 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 12 Jul 2018 07:41:05 +0000 Subject: Change in pysim[master]: tests: add test program to verify pysim-prog.py (and pysim-read.py) In-Reply-To: References: Message-ID: dexter has uploaded a new patch set (#3). ( https://gerrit.osmocom.org/9947 ) Change subject: tests: add test program to verify pysim-prog.py (and pysim-read.py) ...................................................................... tests: add test program to verify pysim-prog.py (and pysim-read.py) Pysim now supports quite a number of different cards. Estimating if changes in pysim introce regressions becomes increasingly difficult The script that is added with this patch is intended to run as atomated testsuit on real cards attached to a test system. However, it can also be used by developers locally to check for regressions. Change-Id: I8c6f95998272333bc757b34e3ab6be004e8cd674 Related: OS#3376 --- A tests/fakemagicsim.data.example A tests/pysim-test.sh A tests/sysmoUSIM-SJS1.data.example 3 files changed, 234 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/47/9947/3 -- To view, visit https://gerrit.osmocom.org/9947 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8c6f95998272333bc757b34e3ab6be004e8cd674 Gerrit-Change-Number: 9947 Gerrit-PatchSet: 3 Gerrit-Owner: dexter Gerrit-CC: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 07:47:38 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 12 Jul 2018 07:47:38 +0000 Subject: Change in pysim[master]: tests: add test program to verify pysim-prog.py (and pysim-read.py) In-Reply-To: References: Message-ID: dexter has posted comments on this change. ( https://gerrit.osmocom.org/9947 ) Change subject: tests: add test program to verify pysim-prog.py (and pysim-read.py) ...................................................................... Patch Set 3: (1 comment) The whitespace issues are now fixed. https://gerrit.osmocom.org/#/c/9947/1/tests/pysim-test.sh File tests/pysim-test.sh: https://gerrit.osmocom.org/#/c/9947/1/tests/pysim-test.sh at 93 PS1, Line 93: echo "------------8<------------" > let's fix all those whitespace issues that are highlightedhere (7 issues, if I counted correctly) Done -- To view, visit https://gerrit.osmocom.org/9947 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8c6f95998272333bc757b34e3ab6be004e8cd674 Gerrit-Change-Number: 9947 Gerrit-PatchSet: 3 Gerrit-Owner: dexter Gerrit-Reviewer: dexter Gerrit-CC: Harald Welte Gerrit-Comment-Date: Thu, 12 Jul 2018 07:47:38 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 08:10:29 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 12 Jul 2018 08:10:29 +0000 Subject: Change in pysim[master]: pySim-read: Print exception when reading of EF.MSISDN fails In-Reply-To: References: Message-ID: dexter has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/9968 ) Change subject: pySim-read: Print exception when reading of EF.MSISDN fails ...................................................................... pySim-read: Print exception when reading of EF.MSISDN fails At the moment the exception is catched, but there is only a vague error message printed. However, the exception string usually tells us the status word, so it is very valuable to see it. Lets make sure that the exception string is printed here. Change-Id: Icb30470b1c0eee6a15fc028da820e92bf9ded27a --- M pySim-read.py 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/68/9968/2 -- To view, visit https://gerrit.osmocom.org/9968 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icb30470b1c0eee6a15fc028da820e92bf9ded27a Gerrit-Change-Number: 9968 Gerrit-PatchSet: 2 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 08:10:29 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 12 Jul 2018 08:10:29 +0000 Subject: Change in pysim[master]: pySim-read: read contents of PLMN related files. In-Reply-To: References: Message-ID: dexter has uploaded a new patch set (#3). ( https://gerrit.osmocom.org/9969 ) Change subject: pySim-read: read contents of PLMN related files. ...................................................................... pySim-read: read contents of PLMN related files. The files EF.PLMNsel, EF.PLMNwAcT, EF.OPLMNwAcT, EF.HPLMNAcT are not yet printed by pysim-read. Lets add support for those files. Change-Id: Ice802033adfa6fc1bccc76da47495eb29c3aef6c Related: SYS#4245 --- M pySim-read.py 1 file changed, 40 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/69/9969/3 -- To view, visit https://gerrit.osmocom.org/9969 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ice802033adfa6fc1bccc76da47495eb29c3aef6c Gerrit-Change-Number: 9969 Gerrit-PatchSet: 3 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 09:13:09 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Jul 2018 09:13:09 +0000 Subject: Change in libosmo-sccp[master]: sua: Export IEI value_string names In-Reply-To: References: Message-ID: Pau Espin Pedrol has abandoned this change. ( https://gerrit.osmocom.org/9959 ) Change subject: sua: Export IEI value_string names ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/9959 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: I0b34eaa2cb4109879324dc9ba6c7dacd53b1a28f Gerrit-Change-Number: 9959 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 09:16:23 2018 From: gerrit-no-reply at lists.osmocom.org (Piotr Krysik) Date: Thu, 12 Jul 2018 09:16:23 +0000 Subject: Change in gr-gsm[master]: Foobar change to test gerrit again Message-ID: Piotr Krysik has uploaded this change for review. ( https://gerrit.osmocom.org/9971 Change subject: Foobar change to test gerrit again ...................................................................... Foobar change to test gerrit again Change-Id: I818b5296e2a208df9f096bcc9d13b88ffe01379c --- M README.md 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/gr-gsm refs/changes/71/9971/1 diff --git a/README.md b/README.md index b6decde..999ea85 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -The gr-gsm project +The gr-gsm project ================== The *gr-gsm* project is based on the *gsm-receiver* written by Piotr Krysik (also the main author of *gr-gsm*) for the *Airprobe* project. -- To view, visit https://gerrit.osmocom.org/9971 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gr-gsm Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I818b5296e2a208df9f096bcc9d13b88ffe01379c Gerrit-Change-Number: 9971 Gerrit-PatchSet: 1 Gerrit-Owner: Piotr Krysik -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 09:17:50 2018 From: gerrit-no-reply at lists.osmocom.org (Piotr Krysik) Date: Thu, 12 Jul 2018 09:17:50 +0000 Subject: Change in gr-gsm[master]: Foobar change to test gerrit again In-Reply-To: References: Message-ID: Piotr Krysik has posted comments on this change. ( https://gerrit.osmocom.org/9971 ) Change subject: Foobar change to test gerrit again ...................................................................... Patch Set 1: Code-Review-2 -- To view, visit https://gerrit.osmocom.org/9971 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gr-gsm Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I818b5296e2a208df9f096bcc9d13b88ffe01379c Gerrit-Change-Number: 9971 Gerrit-PatchSet: 1 Gerrit-Owner: Piotr Krysik Gerrit-Reviewer: Piotr Krysik Gerrit-Comment-Date: Thu, 12 Jul 2018 09:17:50 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 09:25:04 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Jul 2018 09:25:04 +0000 Subject: Change in gr-gsm[master]: Foobar change to test gerrit again In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9971 ) Change subject: Foobar change to test gerrit again ...................................................................... Patch Set 1: You probably want to "Abandon" this patch I guess (there's a button with that name). -- To view, visit https://gerrit.osmocom.org/9971 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gr-gsm Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I818b5296e2a208df9f096bcc9d13b88ffe01379c Gerrit-Change-Number: 9971 Gerrit-PatchSet: 1 Gerrit-Owner: Piotr Krysik Gerrit-Reviewer: Piotr Krysik Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 12 Jul 2018 09:25:04 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 09:38:38 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 12 Jul 2018 09:38:38 +0000 Subject: Change in gr-gsm[master]: README.md: fix white space In-Reply-To: References: Message-ID: Vadim Yanitskiy has uploaded a new patch set (#2) to the change originally created by Piotr Krysik. ( https://gerrit.osmocom.org/9971 ) Change subject: README.md: fix white space ...................................................................... README.md: fix white space Change-Id: I818b5296e2a208df9f096bcc9d13b88ffe01379c --- M README.md 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/gr-gsm refs/changes/71/9971/2 -- To view, visit https://gerrit.osmocom.org/9971 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gr-gsm Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I818b5296e2a208df9f096bcc9d13b88ffe01379c Gerrit-Change-Number: 9971 Gerrit-PatchSet: 2 Gerrit-Owner: Piotr Krysik Gerrit-Reviewer: Piotr Krysik Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 09:38:58 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 12 Jul 2018 09:38:58 +0000 Subject: Change in gr-gsm[master]: README.md: fix white space In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/9971 ) Change subject: README.md: fix white space ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/9971 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gr-gsm Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I818b5296e2a208df9f096bcc9d13b88ffe01379c Gerrit-Change-Number: 9971 Gerrit-PatchSet: 2 Gerrit-Owner: Piotr Krysik Gerrit-Reviewer: Piotr Krysik Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 12 Jul 2018 09:38:58 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 11:04:12 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Jul 2018 11:04:12 +0000 Subject: Change in libosmocore[master]: ctrl: Log CMD TYPE on invalid ID number Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9972 Change subject: ctrl: Log CMD TYPE on invalid ID number ...................................................................... ctrl: Log CMD TYPE on invalid ID number Change-Id: Ia890d4b841ef02342cc1cf7f5926866b040dc8ab --- M src/ctrl/control_cmd.c 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/72/9972/1 diff --git a/src/ctrl/control_cmd.c b/src/ctrl/control_cmd.c index bff4d17..c5924b2 100644 --- a/src/ctrl/control_cmd.c +++ b/src/ctrl/control_cmd.c @@ -363,10 +363,11 @@ } if (!id_str_valid(tmp)) { + LOGP(DLCTRL, LOGL_NOTICE, "Invalid %s message ID number: \"%s\"\n", + get_value_string(ctrl_type_vals, cmd->type), osmo_escape_str(tmp, -1)); cmd->type = CTRL_TYPE_ERROR; cmd->id = "err"; cmd->reply = "Invalid message ID number"; - LOGP(DLCTRL, LOGL_NOTICE, "Invalid message ID number: \"%s\"\n", osmo_escape_str(tmp, -1)); goto err; } cmd->id = talloc_strdup(cmd, tmp); -- To view, visit https://gerrit.osmocom.org/9972 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ia890d4b841ef02342cc1cf7f5926866b040dc8ab Gerrit-Change-Number: 9972 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 11:26:03 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Jul 2018 11:26:03 +0000 Subject: Change in openbsc[master]: nat: ctrl: Use ctrl_cmd_parse2 to obtain detailed error Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9973 Change subject: nat: ctrl: Use ctrl_cmd_parse2 to obtain detailed error ...................................................................... nat: ctrl: Use ctrl_cmd_parse2 to obtain detailed error Instead of always logging/sending same error, use the new ctrl_cmd_parse2 API which always returns a cmd structure with a specific error description. Change-Id: I6ef2b6e309632ed9cb296e8a1e71f879007a36ae --- M openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c 1 file changed, 2 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/73/9973/1 diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c b/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c index 61ac887..af110a2 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c @@ -103,20 +103,11 @@ struct bsc_cmd_list *pending; char *var; - cmd = ctrl_cmd_parse(bsc, msg); + cmd = ctrl_cmd_parse2(bsc, msg); msgb_free(msg); - if (!cmd) { - cmd = talloc_zero(bsc, struct ctrl_cmd); - if (!cmd) { - LOGP(DNAT, LOGL_ERROR, "OOM!\n"); - return -ENOMEM; - } - cmd->type = CTRL_TYPE_ERROR; - cmd->id = "err"; - cmd->reply = "Failed to parse command."; + if (cmd->type == CTRL_TYPE_ERROR) goto err; - } if (bsc->cfg && !llist_empty(&bsc->cfg->lac_list)) { if (cmd->variable) { -- To view, visit https://gerrit.osmocom.org/9973 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I6ef2b6e309632ed9cb296e8a1e71f879007a36ae Gerrit-Change-Number: 9973 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 11:38:11 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Jul 2018 11:38:11 +0000 Subject: Change in openbsc[master]: bsc: ctrl: Use ctrl_cmd_parse2 to obtain detailed error Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9974 Change subject: bsc: ctrl: Use ctrl_cmd_parse2 to obtain detailed error ...................................................................... bsc: ctrl: Use ctrl_cmd_parse2 to obtain detailed error Instead of always logging/sending same error, use the new ctrl_cmd_parse2 API which always returns a cmd structure with a specific error description. Change-Id: Ie111bec46b664768fe3c3feff906f91e8ee8b1d4 --- M openbsc/src/osmo-bsc/osmo_bsc_msc.c 1 file changed, 2 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/74/9974/1 diff --git a/openbsc/src/osmo-bsc/osmo_bsc_msc.c b/openbsc/src/osmo-bsc/osmo_bsc_msc.c index b2f8806..4395c3b 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_msc.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_msc.c @@ -225,17 +225,9 @@ int ret; struct ctrl_cmd *cmd; - cmd = ctrl_cmd_parse(msc->msc_con, msg); - if (!cmd) { + cmd = ctrl_cmd_parse2(msc->msc_con, msg); + if (cmd->type == CTRL_TYPE_ERROR) { LOGP(DMSC, LOGL_ERROR, "Failed to parse control message.\n"); - cmd = talloc_zero(msc->msc_con, struct ctrl_cmd); - if (!cmd) { - LOGP(DMSC, LOGL_ERROR, "OOM!\n"); - return; - } - cmd->type = CTRL_TYPE_ERROR; - cmd->id = "err"; - cmd->reply = "Failed to parse control message."; ctrl_cmd_send(&msc->msc_con->write_queue, cmd); talloc_free(cmd); -- To view, visit https://gerrit.osmocom.org/9974 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ie111bec46b664768fe3c3feff906f91e8ee8b1d4 Gerrit-Change-Number: 9974 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 11:51:35 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Jul 2018 11:51:35 +0000 Subject: Change in openbsc[master]: nat: ctrl: Use ctrl_cmd_parse2 to obtain detailed error In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9973 ) Change subject: nat: ctrl: Use ctrl_cmd_parse2 to obtain detailed error ...................................................................... Patch Set 1: Relaed: https://osmocom.org/issues/3394 -- To view, visit https://gerrit.osmocom.org/9973 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6ef2b6e309632ed9cb296e8a1e71f879007a36ae Gerrit-Change-Number: 9973 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 12 Jul 2018 11:51:35 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 11:51:40 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Jul 2018 11:51:40 +0000 Subject: Change in openbsc[master]: bsc: ctrl: Use ctrl_cmd_parse2 to obtain detailed error In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9974 ) Change subject: bsc: ctrl: Use ctrl_cmd_parse2 to obtain detailed error ...................................................................... Patch Set 1: Related: https://osmocom.org/issues/3394 -- To view, visit https://gerrit.osmocom.org/9974 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie111bec46b664768fe3c3feff906f91e8ee8b1d4 Gerrit-Change-Number: 9974 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 12 Jul 2018 11:51:40 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Thu Jul 12 12:26:47 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Thu, 12 Jul 2018 12:26:47 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-gapk_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#18?= In-Reply-To: <569750565.147.1531312007491.JavaMail.jenkins@jenkins.osmocom.org> References: <569750565.147.1531312007491.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <586524233.160.1531398407692.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 127.42 KB...] checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether make supports nested variables... (cached) yes checking if gcc supports -fvisibility=hidden... yes checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking whether gcc understands -c and -o together... (cached) yes checking dependency style of gcc... (cached) gcc3 checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for LIBOSMOCORE... yes checking for LIBOSMOCODEC... yes checking for LIBALSA... yes checking for OPENCORE_AMRNB... yes checking gsm/gsm.h usability... yes checking gsm/gsm.h presence... yes checking for gsm/gsm.h... yes checking for gsm_create in -lgsm... yes checking for stdint.h... (cached) yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking for unistd.h... (cached) yes checking for inline... inline checking for int16_t... yes checking for int32_t... yes checking for uint16_t... yes checking for uint32_t... yes checking for uint64_t... yes checking for uint8_t... yes checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... yes checking for memset... yes checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating src/Makefile config.status: creating libgsmhr/Makefile config.status: creating include/Makefile config.status: creating include/gsmhr/Makefile config.status: creating libosmogapk.pc config.status: creating tests/atlocal config.status: creating tests/Makefile config.status: creating config.h config.status: executing depfiles commands config.status: executing libtool commands config.status: executing tests/atconfig commands make[1]: Entering directory ' make all-recursive make[2]: Entering directory ' Making all in include make[3]: Entering directory ' make[4]: Entering directory ' make[4]: Nothing to be done for 'all-am'. make[4]: Leaving directory ' make[3]: Leaving directory ' Making all in src make[3]: Entering directory ' CC procqueue.lo CC pq_format.lo CC pq_codec.lo CC pq_file.lo CC pq_alsa.lo CC pq_rtp.lo CC pq_ecu.lo CC ecu_fr.lo CC formats.lo CC fmt_ti.lo CC fmt_amr.lo CC fmt_gsm.lo CC fmt_hr_ref.lo CC fmt_racal.lo CC fmt_rawpcm.lo CC fmt_rtp_amr.lo CC fmt_rtp_efr.lo CC fmt_rtp_hr_etsi.lo CC fmt_rtp_hr_ietf.lo CC fmt_amr_opencore.lo CC codecs.lo CC codec_pcm.lo CC codec_hr.lo CC codec_fr.lo CC codec_efr.lo CC codec_amr.lo CC benchmark.lo CC common.lo CCLD libosmogapk.la CC app_osmo_gapk.o CCLD osmo-gapk make[3]: Leaving directory ' Making all in tests make[3]: Entering directory ' make[3]: Nothing to be done for 'all'. make[3]: Leaving directory ' make[3]: Entering directory ' make[3]: Nothing to be done for 'all-am'. make[3]: Leaving directory ' make[2]: Leaving directory ' make[1]: Leaving directory ' make[1]: Entering directory ' Making dvi in include make[2]: Entering directory ' make[3]: Entering directory ' make[3]: Nothing to be done for 'dvi-am'. make[3]: Leaving directory ' make[2]: Leaving directory ' Making dvi in src make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi'. make[2]: Leaving directory ' Making dvi in tests make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi'. make[2]: Leaving directory ' make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi-am'. make[2]: Leaving directory ' make[1]: Leaving directory ' make[1]: Entering directory ' Making check in include make[2]: Entering directory ' make[3]: Entering directory ' make[3]: Nothing to be done for 'check-am'. make[3]: Leaving directory ' make[2]: Leaving directory ' Making check in src make[2]: Entering directory ' make[2]: Nothing to be done for 'check'. make[2]: Leaving directory ' Making check in tests make[2]: Entering directory ' make procqueue/pq_test io/pq_file_test io/pq_rtp_test ecu/ecu_fr_test make[3]: Entering directory ' CC procqueue/pq_test.o CCLD procqueue/pq_test CC io/pq_file_test.o CCLD io/pq_file_test CC io/pq_rtp_test.o CCLD io/pq_rtp_test CC ecu/ecu_fr_test.o CCLD ecu/ecu_fr_test make[3]: Leaving directory ' make check-local make[3]: Entering directory ' /bin/bash '../../../tests/testsuite' ## ---------------------------- ## ## gapk 0.4.75-27bc test suite. ## ## ---------------------------- ## Regression tests. 1: procqueue ok 2: io/pq_file FAILED (testsuite.at:13) 3: io/pq_rtp ok 4: ecu/ecu_fr_test ok 5: conv/enc/amr_efr ok 6: conv/enc/gsm ok 7: conv/enc/racal_hr skipped (testsuite.at:58) 8: conv/enc/racal_fr ok 9: conv/enc/racal_efr ok 10: conv/enc/ti_hr skipped (testsuite.at:91) 11: conv/enc/ti_fr ok 12: conv/enc/ti_efr ok 13: conv/enc/rtp_efr ok 14: conv/enc/rtp_hr_etsi skipped (testsuite.at:135) 15: conv/enc/rtp_hr_ietf skipped (testsuite.at:146) 16: conv/dec/amr_efr ok 17: conv/dec/gsm ok 18: conv/dec/racal_hr skipped (testsuite.at:179) 19: conv/dec/racal_fr ok 20: conv/dec/racal_efr ok 21: conv/dec/ti_hr skipped (testsuite.at:212) 22: conv/dec/ti_fr ok 23: conv/dec/ti_efr ok 24: conv/dec/rtp_efr ok 25: conv/dec/rtp_hr_etsi skipped (testsuite.at:256) 26: conv/dec/rtp_hr_ietf skipped (testsuite.at:267) ## ------------- ## ## Test results. ## ## ------------- ## ERROR: 18 tests were run, 1 failed unexpectedly. 8 tests were skipped. ## -------------------------- ## ## testsuite.log was created. ## ## -------------------------- ## Please send `tests/testsuite.log' and all information you think might help: To: Subject: [gapk 0.4.75-27bc] testsuite: 2 failed You may investigate any problem if you feel able to do so, in which case the test suite provides a good starting point. Its output may be found below `tests/testsuite.dir'. Makefile:753: recipe for target 'check-local' failed make[3]: *** [check-local] Error 1 make[3]: Leaving directory ' Makefile:602: recipe for target 'check-am' failed make[2]: *** [check-am] Error 2 make[2]: Leaving directory ' Makefile:479: recipe for target 'check-recursive' failed make[1]: *** [check-recursive] Error 1 make[1]: Leaving directory ' Makefile:684: recipe for target 'distcheck' failed make: *** [distcheck] Error 1 + cat-testlogs.sh ======================== ./gapk-0.4.75-27bc/_build/sub/tests/testsuite.dir/02/testsuite.log # -*- compilation -*- 2. testsuite.at:10: testing io/pq_file ... ../../../tests/testsuite.at:13: $abs_top_builddir/tests/io/pq_file_test \ $abs_top_builddir/tests/io/io_sample.txt --- /dev/null 2018-03-27 19:17:06.212284948 +0000 +++ 2018-07-12 12:26:47.007989878 +0000 @@ -0,0 +1,2 @@ +pq_file_test: ../../../tests/io/pq_file_test.c:132: main: Assertion `sample_file != NULL' failed. +: line 29: 31836 Aborted $abs_top_builddir/tests/io/pq_file_test $abs_top_builddir/tests/io/io_sample.txt --- expout 2018-07-12 12:26:46.999989925 +0000 +++ 2018-07-12 12:26:46.999989925 +0000 @@ -1,12 +0,0 @@ -Processing sample file with blk_len=2: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=4: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=8: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=16: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=32: -8217c8fb7675a95008f9089d883gapk - -chunk null_context: depth=0 ../../../tests/testsuite.at:13: exit code was 134, expected 0 2. testsuite.at:10: 2. io/pq_file (testsuite.at:10): FAILED (testsuite.at:13) Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Thu Jul 12 12:57:30 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 12 Jul 2018 12:57:30 +0000 Subject: Change in libosmocore[master]: vty: fix use-after-free and memleaks in is_cmd_ambiguous() In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9939 ) Change subject: vty: fix use-after-free and memleaks in is_cmd_ambiguous() ...................................................................... Patch Set 2: Code-Review+2 After a similar problem came up on IRC, I am growing impatient and want this error gone. I am giving myself a +2 now, but if something needs to change there, I'm still open for that and will follow up with another patch. -- To view, visit https://gerrit.osmocom.org/9939 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia71ba742108b5ff020997bfb612ad5eb30d04fcd Gerrit-Change-Number: 9939 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 12 Jul 2018 12:57:30 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 12:57:33 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 12 Jul 2018 12:57:33 +0000 Subject: Change in libosmocore[master]: vty: fix use-after-free and memleaks in is_cmd_ambiguous() In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/9939 ) Change subject: vty: fix use-after-free and memleaks in is_cmd_ambiguous() ...................................................................... vty: fix use-after-free and memleaks in is_cmd_ambiguous() vty_test: add test against ambiguous cmd causing use-after-free and memory leaks. Add this test along with the fix, because the new test triggers the memory use-after-free and leaks, causing build failures. Add cmd_deopt_with_ctx() to allow passing a specific talloc ctx. is_cmd_ambiguous(): keep all cmd_deopt() allocations until the function exits. Add a comment explaining why. Before this, if a command matched an optional "[arg]" with square brackets, we would keep it in local var 'matched', but we would free the string it points to at the end of that loop iteration; upon encountering another match, we would attempt to strcmp against the freed 'matched'. Instead of adding hard-to-read and -verify free/alloc dances to keep the 'matched' accurately freed/non-freed/..., just keep all cmd_deopt() string allocated until done. Needless to say that this should have been implemented on a lower level upon inventing optional args, but at least this is fixing a program crash. Related: OS#33903390 Change-Id: Ia71ba742108b5ff020997bfb612ad5eb30d04fcd --- M src/vty/command.c M tests/vty/vty_test.c M tests/vty/vty_test.ok 3 files changed, 124 insertions(+), 20 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, but someone else must approve Neels Hofmeyr: Looks good to me, approved diff --git a/src/vty/command.c b/src/vty/command.c index 51dece3..43f974c 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -1304,8 +1304,7 @@ } /* helper to retrieve the 'real' argument string from an optional argument */ -static char * -cmd_deopt(const char *str) +static char *cmd_deopt(void *ctx, const char *str) { /* we've got "[blah]". We want to strip off the []s and redo the * match check for "blah" @@ -1315,7 +1314,7 @@ if (len < 3) return NULL; - return talloc_strndup(tall_vty_cmd_ctx, str + 1, len - 2); + return talloc_strndup(ctx, str + 1, len - 2); } static enum match_type @@ -1326,7 +1325,7 @@ if (recur && CMD_OPTION(str)) { enum match_type ret; - char *tmp = cmd_deopt(str); + char *tmp = cmd_deopt(tall_vty_cmd_ctx, str); /* this would be a bug in a command, however handle it gracefully * as it we only discover it if a user tries to run it @@ -1475,6 +1474,7 @@ static int is_cmd_ambiguous(char *command, vector v, int index, enum match_type type) { + int ret = 0; unsigned int i; unsigned int j; struct cmd_element *cmd_element; @@ -1482,6 +1482,16 @@ vector descvec; struct desc *desc; + /* In this loop, when a match is found, 'matched' points to it. If on a later iteration, an + * identical match is found, the command is ambiguous. The trickiness is that a string may be + * enclosed in '[str]' square brackets, which get removed by a talloc_strndup(), via cmd_deopt(). + * Such a string is usually needed for one loop iteration, except when 'matched' points to it. In + * that case, the string must remain allocated until this function exits or another match comes + * around. This is sufficiently confusing to justify a separate talloc tree to store all of the + * odd allocations, and to free them all at the end. We are not expecting too many optional args + * or ambiguities to cause a noticeable memory footprint from keeping all allocations. */ + void *cmd_deopt_ctx = NULL; + for (i = 0; i < vector_active(v); i++) if ((cmd_element = vector_slot(v, i)) != NULL) { int match = 0; @@ -1493,9 +1503,15 @@ enum match_type ret; const char *str = desc->cmd; - if (CMD_OPTION(str)) - if ((str = cmd_deopt(str)) == NULL) + if (CMD_OPTION(str)) { + if (!cmd_deopt_ctx) + cmd_deopt_ctx = + talloc_named_const(tall_vty_cmd_ctx, 0, + __func__); + str = cmd_deopt(cmd_deopt_ctx, str); + if (str == NULL) continue; + } switch (type) { case exact_match: @@ -1509,9 +1525,10 @@ { if (matched && strcmp(matched, - str) != 0) - return 1; /* There is ambiguous match. */ - else + str) != 0) { + ret = 1; /* There is ambiguous match. */ + goto free_and_return; + } else matched = str; match++; } @@ -1521,9 +1538,10 @@ (str, command)) { if (matched && strcmp(matched, - str) != 0) - return 1; - else + str) != 0) { + ret = 1; + goto free_and_return; + } else matched = str; match++; } @@ -1537,8 +1555,10 @@ if ((ret = cmd_ipv6_prefix_match (command)) != no_match) { - if (ret == partly_match) - return 2; /* There is incomplete match. */ + if (ret == partly_match) { + ret = 2; /* There is incomplete match. */ + goto free_and_return; + } match++; } @@ -1552,8 +1572,10 @@ if ((ret = cmd_ipv4_prefix_match (command)) != no_match) { - if (ret == partly_match) - return 2; /* There is incomplete match. */ + if (ret == partly_match) { + ret = 2; /* There is incomplete match. */ + goto free_and_return; + } match++; } @@ -1566,14 +1588,15 @@ default: break; } - - if (CMD_OPTION(desc->cmd)) - talloc_free((void*)str); } if (!match) vector_slot(v, i) = NULL; } - return 0; + +free_and_return: + if (cmd_deopt_ctx) + talloc_free(cmd_deopt_ctx); + return ret; } /* If src matches dst return dst string, otherwise return NULL */ diff --git a/tests/vty/vty_test.c b/tests/vty/vty_test.c index a3478e1..30efb9a 100644 --- a/tests/vty/vty_test.c +++ b/tests/vty/vty_test.c @@ -385,6 +385,42 @@ return CMD_SUCCESS; } +DEFUN(cfg_ambiguous_nr_1, cfg_ambiguous_nr_1_cmd, + "ambiguous_nr [<0-23>]", + "testing is_cmd_ambiguous()\n" + "optional number arg\n") +{ + printf("Called: 'ambiguous_nr [<0-23>]' (argc=%d)\n", argc); + return CMD_SUCCESS; +} + +DEFUN(cfg_ambiguous_nr_2, cfg_ambiguous_nr_2_cmd, + "ambiguous_nr <0-23> keyword", + "testing is_cmd_ambiguous()\n" + "optional number arg\n") +{ + printf("Called: 'ambiguous_nr <0-23> keyword'\n"); + return CMD_SUCCESS; +} + +DEFUN(cfg_ambiguous_str_1, cfg_ambiguous_str_1_cmd, + "ambiguous_str [ARG]", + "testing is_cmd_ambiguous()\n" + "optional string arg\n") +{ + printf("Called: 'ambiguous_str [ARG]' (argc=%d)\n", argc); + return CMD_SUCCESS; +} + +DEFUN(cfg_ambiguous_str_2, cfg_ambiguous_str_2_cmd, + "ambiguous_str ARG keyword", + "testing is_cmd_ambiguous()\n" + "optional string arg\n") +{ + printf("Called: 'ambiguous_str ARG keyword'\n"); + return CMD_SUCCESS; +} + void test_vty_add_cmds() { install_element(CONFIG_NODE, &cfg_level1_cmd); @@ -398,6 +434,30 @@ install_node(&level3_node, NULL); install_element(LEVEL3_NODE, &cfg_level3_child_cmd); + + install_element_ve(&cfg_ambiguous_nr_1_cmd); + install_element_ve(&cfg_ambiguous_nr_2_cmd); + install_element_ve(&cfg_ambiguous_str_1_cmd); + install_element_ve(&cfg_ambiguous_str_2_cmd); +} + +void test_is_cmd_ambiguous() +{ + struct vty *vty; + struct vty_test test; + + printf("Going to test is_cmd_ambiguous()\n"); + vty = create_test_vty(&test); + + OSMO_ASSERT(do_vty_command(vty, "ambiguous_nr") == CMD_SUCCESS); + OSMO_ASSERT(do_vty_command(vty, "ambiguous_nr 23") == CMD_SUCCESS); + OSMO_ASSERT(do_vty_command(vty, "ambiguous_nr 23 keyword") == CMD_SUCCESS); + + OSMO_ASSERT(do_vty_command(vty, "ambiguous_str") == CMD_SUCCESS); + OSMO_ASSERT(do_vty_command(vty, "ambiguous_str arg") == CMD_SUCCESS); + OSMO_ASSERT(do_vty_command(vty, "ambiguous_str arg keyword") == CMD_SUCCESS); + + destroy_test_vty(&test, vty); } static int go_parent_cb(struct vty *vty) @@ -465,6 +525,8 @@ test_exit_by_indent("ok_indented_root.cfg", 0); test_exit_by_indent("ok_empty_parent.cfg", 0); + test_is_cmd_ambiguous(); + /* Leak check */ OSMO_ASSERT(talloc_total_blocks(stats_ctx) == 1); diff --git a/tests/vty/vty_test.ok b/tests/vty/vty_test.ok index bd6c5d6..2f76ff9 100644 --- a/tests/vty/vty_test.ok +++ b/tests/vty/vty_test.ok @@ -286,4 +286,23 @@ called level3 node k called level1 child cmd k got rc=0 +Going to test is_cmd_ambiguous() +Going to execute 'ambiguous_nr' +Called: 'ambiguous_nr [<0-23>]' (argc=0) +Returned: 0, Current node: 1 '%s> ' +Going to execute 'ambiguous_nr 23' +Called: 'ambiguous_nr [<0-23>]' (argc=1) +Returned: 0, Current node: 1 '%s> ' +Going to execute 'ambiguous_nr 23 keyword' +Called: 'ambiguous_nr <0-23> keyword' +Returned: 0, Current node: 1 '%s> ' +Going to execute 'ambiguous_str' +Called: 'ambiguous_str [ARG]' (argc=0) +Returned: 0, Current node: 1 '%s> ' +Going to execute 'ambiguous_str arg' +Called: 'ambiguous_str [ARG]' (argc=1) +Returned: 0, Current node: 1 '%s> ' +Going to execute 'ambiguous_str arg keyword' +Called: 'ambiguous_str ARG keyword' +Returned: 0, Current node: 1 '%s> ' All tests passed -- To view, visit https://gerrit.osmocom.org/9939 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ia71ba742108b5ff020997bfb612ad5eb30d04fcd Gerrit-Change-Number: 9939 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 13:08:43 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 12 Jul 2018 13:08:43 +0000 Subject: Change in libosmocore[master]: vty: fix use-after-free and memleaks in is_cmd_ambiguous() In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/9939 ) Change subject: vty: fix use-after-free and memleaks in is_cmd_ambiguous() ...................................................................... Patch Set 2: (3 comments) https://gerrit.osmocom.org/#/c/9939/2//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/9939/2//COMMIT_MSG at 13 PS2, Line 13: Add cmd_deopt_with_ctx() to allow passing a specific talloc ctx. Since we decided to modify the existing cmd_deopt(), makes sense to update this part ;) https://gerrit.osmocom.org/#/c/9939/2/tests/vty/vty_test.c File tests/vty/vty_test.c: https://gerrit.osmocom.org/#/c/9939/2/tests/vty/vty_test.c at 402 PS2, Line 402: printf("Called: 'ambiguous_nr <0-23> keyword'\n"); Would be great to have the '(argc=%d)' debug here too. https://gerrit.osmocom.org/#/c/9939/2/tests/vty/vty_test.c at 420 PS2, Line 420: printf("Called: 'ambiguous_str ARG keyword'\n"); And here too, just to be sure. -- To view, visit https://gerrit.osmocom.org/9939 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia71ba742108b5ff020997bfb612ad5eb30d04fcd Gerrit-Change-Number: 9939 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 12 Jul 2018 13:08:43 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 13:11:29 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 12 Jul 2018 13:11:29 +0000 Subject: Change in libosmocore[master]: vty: fix use-after-free and memleaks in is_cmd_ambiguous() In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9939 ) Change subject: vty: fix use-after-free and memleaks in is_cmd_ambiguous() ...................................................................... Patch Set 2: (2 comments) https://gerrit.osmocom.org/#/c/9939/2//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/9939/2//COMMIT_MSG at 13 PS2, Line 13: Add cmd_deopt_with_ctx() to allow passing a specific talloc ctx. > Since we decided to modify the existing cmd_deopt(), [?] meh, sorry about that. svn would have allowed me to fix the log message without a force-push :) https://gerrit.osmocom.org/#/c/9939/2/tests/vty/vty_test.c File tests/vty/vty_test.c: https://gerrit.osmocom.org/#/c/9939/2/tests/vty/vty_test.c at 402 PS2, Line 402: printf("Called: 'ambiguous_nr <0-23> keyword'\n"); > Would be great to have the '(argc=%d)' debug here too. doesn't apply, the argc is *always* 1 here. It's only in above cmd where the argc may be 0 or 1 due to the optional arg -- To view, visit https://gerrit.osmocom.org/9939 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia71ba742108b5ff020997bfb612ad5eb30d04fcd Gerrit-Change-Number: 9939 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 12 Jul 2018 13:11:29 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Thu Jul 12 15:10:06 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Thu, 12 Jul 2018 15:10:06 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-asn1c_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#182?= In-Reply-To: <118393673.148.1531321806512.JavaMail.jenkins@jenkins.osmocom.org> References: <118393673.148.1531321806512.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <1356761077.161.1531408206393.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 3.67 KB...] + ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for style of include used by make... GNU checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking how to run the C++ preprocessor... g++ -E checking for g77... no checking for f77... no checking for xlf... no checking for frt... no checking for pgf77... no checking for cf77... no checking for fort77... no checking for fl32... no checking for af77... no checking for f90... no checking for xlf90... no checking for pgf90... no checking for pghpf... no checking for epcf90... no checking for gfortran... no checking for g95... no checking for f95... no checking for fort... no checking for xlf95... no checking for ifort... no checking for ifc... no checking for efc... no checking for pgf95... no checking for lf95... no checking for ftn... no checking whether we are using the GNU Fortran 77 compiler... no checking whether accepts -g... no checking the maximum length of command line arguments... 32768 checking command to parse /usr/bin/nm -B output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes configure: creating libtool appending configuration tag "CXX" to libtool checking for ld used by g++... /usr/bin/ld -m elf_x86_64 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC checking if g++ PIC flag -fPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate appending configuration tag "F77" to libtool checking for autoconf... /usr/bin/autoconf checking for autoheader... /usr/bin/autoheader checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking dependency style of gcc... (cached) gcc3 checking how to run the C preprocessor... gcc -E checking for a BSD-compatible install... /usr/bin/install -c checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking for bison... bison -y checking for flex... flex checking for yywrap in -lfl... yes checking lex output file root... lex.yy checking whether yytext is a pointer... yes checking for ar... /usr/bin/ar checking for ANSI C header files... (cached) yes checking sys/param.h usability... yes checking sys/param.h presence... yes checking for sys/param.h... yes checking whether byte ordering is bigendian... no checking for off_t... yes checking for size_t... yes checking whether struct tm is in sys/time.h or time.h... time.h checking for intmax_t... yes checking for library containing getopt... none required checking for strtoimax... yes checking for strtoll... yes checking for mergesort... no checking for mkstemps... yes configure: creating ./config.status config.status: creating skeletons/standard-modules/Makefile config.status: creating skeletons/tests/Makefile config.status: creating libasn1compiler/Makefile config.status: creating libasn1parser/Makefile config.status: creating libasn1print/Makefile config.status: creating asn1c/webcgi/Makefile config.status: creating asn1c/tests/Makefile config.status: creating libasn1fix/Makefile config.status: creating skeletons/Makefile config.status: creating examples/Makefile config.status: creating tests/Makefile config.status: creating asn1c/Makefile config.status: creating doc/Makefile config.status: creating asn1c.spec config.status: creating Makefile config.status: creating config.h config.status: executing depfiles commands + make -j 8 make all-recursive make[1]: Entering directory ' Making all in libasn1parser make[2]: Entering directory ' if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF ".deps/asn1parser.Tpo" -c -o asn1parser.lo asn1parser.c; \ then mv -f ".deps/asn1parser.Tpo" ".deps/asn1parser.Plo"; else rm -f ".deps/asn1parser.Tpo"; exit 1; fi bison -y -p asn1p_ -d asn1p_y.y if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF ".deps/asn1p_l.Tpo" -c -o asn1p_l.lo asn1p_l.c; \ then mv -f ".deps/asn1p_l.Tpo" ".deps/asn1p_l.Plo"; else rm -f ".deps/asn1p_l.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF ".deps/asn1p_module.Tpo" -c -o asn1p_module.lo asn1p_module.c; \ then mv -f ".deps/asn1p_module.Tpo" ".deps/asn1p_module.Plo"; else rm -f ".deps/asn1p_module.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF ".deps/asn1p_oid.Tpo" -c -o asn1p_oid.lo asn1p_oid.c; \ then mv -f ".deps/asn1p_oid.Tpo" ".deps/asn1p_oid.Plo"; else rm -f ".deps/asn1p_oid.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF ".deps/asn1p_value.Tpo" -c -o asn1p_value.lo asn1p_value.c; \ then mv -f ".deps/asn1p_value.Tpo" ".deps/asn1p_value.Plo"; else rm -f ".deps/asn1p_value.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF ".deps/asn1p_expr.Tpo" -c -o asn1p_expr.lo asn1p_expr.c; \ then mv -f ".deps/asn1p_expr.Tpo" ".deps/asn1p_expr.Plo"; else rm -f ".deps/asn1p_expr.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF ".deps/asn1p_xports.Tpo" -c -o asn1p_xports.lo asn1p_xports.c; \ then mv -f ".deps/asn1p_xports.Tpo" ".deps/asn1p_xports.Plo"; else rm -f ".deps/asn1p_xports.Tpo"; exit 1; fi asn1p_y.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] mkdir .libs gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -fPIC -DPIC -o .libs/asn1p_oid.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -fPIC -DPIC -o .libs/asn1p_module.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -fPIC -DPIC -o .libs/asn1p_l.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -fPIC -DPIC -o .libs/asn1parser.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -fPIC -DPIC -o .libs/asn1p_value.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -fPIC -DPIC -o .libs/asn1p_expr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -fPIC -DPIC -o .libs/asn1p_xports.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -o asn1p_module.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -o asn1p_xports.o >/dev/null 2>&1 asn1p_l.c:3521:12: warning: 'input' defined but not used [-Wunused-function] static int input() ^~~~~ gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -o asn1p_oid.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -o asn1parser.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -o asn1p_value.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF ".deps/asn1p_constr.Tpo" -c -o asn1p_constr.lo asn1p_constr.c; \ then mv -f ".deps/asn1p_constr.Tpo" ".deps/asn1p_constr.Plo"; else rm -f ".deps/asn1p_constr.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF ".deps/asn1p_param.Tpo" -c -o asn1p_param.lo asn1p_param.c; \ then mv -f ".deps/asn1p_param.Tpo" ".deps/asn1p_param.Plo"; else rm -f ".deps/asn1p_param.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -o asn1p_expr.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF ".deps/asn1p_class.Tpo" -c -o asn1p_class.lo asn1p_class.c; \ then mv -f ".deps/asn1p_class.Tpo" ".deps/asn1p_class.Plo"; else rm -f ".deps/asn1p_class.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF ".deps/asn1p_ref.Tpo" -c -o asn1p_ref.lo asn1p_ref.c; \ then mv -f ".deps/asn1p_ref.Tpo" ".deps/asn1p_ref.Plo"; else rm -f ".deps/asn1p_ref.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -fPIC -DPIC -o .libs/asn1p_constr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -fPIC -DPIC -o .libs/asn1p_param.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -fPIC -DPIC -o .libs/asn1p_class.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -fPIC -DPIC -o .libs/asn1p_ref.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -o asn1p_param.o >/dev/null 2>&1 if test -f y.tab.h; then \ to=`echo "asn1p_y_H" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \ sed -e "/^#/!b" -e "s/Y_TAB_H/$to/g" -e "s|y\.tab\.h|asn1p_y.h|" \ y.tab.h >asn1p_y.ht; \ rm -f y.tab.h; \ if cmp -s asn1p_y.ht asn1p_y.h; then \ rm -f asn1p_y.ht ;\ else \ mv asn1p_y.ht asn1p_y.h; \ fi; \ fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -o asn1p_constr.o >/dev/null 2>&1 if test -f y.output; then \ mv y.output asn1p_y.output; \ fi sed '/^#/ s|y\.tab\.c|asn1p_y.c|' y.tab.c >asn1p_y.ct && mv asn1p_y.ct asn1p_y.c rm -f y.tab.c if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF ".deps/asn1p_y.Tpo" -c -o asn1p_y.lo asn1p_y.c; \ then mv -f ".deps/asn1p_y.Tpo" ".deps/asn1p_y.Plo"; else rm -f ".deps/asn1p_y.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -o asn1p_ref.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -o asn1p_class.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -o asn1p_l.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF .deps/asn1p_y.Tpo -c asn1p_y.c -fPIC -DPIC -o .libs/asn1p_y.o asn1p_y.y: In function 'asn1p_parse': asn1p_y.y:357:13: error: 'param' undeclared (first use in this function) *(void **)param = $1; ^~~~~ asn1p_y.y:357:13: note: each undeclared identifier is reported only once for each function it appears in Makefile:299: recipe for target 'asn1p_y.lo' failed make[2]: *** [asn1p_y.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory ' Makefile:302: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory ' Makefile:212: recipe for target 'all' failed make: *** [all] Error 2 Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Thu Jul 12 15:52:40 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 12 Jul 2018 15:52:40 +0000 Subject: Change in libosmocore[master]: gsm_04_08: add function to get value string Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/9975 Change subject: gsm_04_08: add function to get value string ...................................................................... gsm_04_08: add function to get value string The value string table gsm48_chan_mode_names[] lacks a function to get the value string by a value. Lets add one. Change-Id: I0757bcc278c140e18249e35864338e19cdaa3cf7 --- M include/osmocom/gsm/protocol/gsm_04_08.h 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/75/9975/1 diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h index 4c98ff2..4635014 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08.h +++ b/include/osmocom/gsm/protocol/gsm_04_08.h @@ -553,6 +553,8 @@ }; extern const struct value_string gsm48_chan_mode_names[]; +static inline const char *gsm48_chan_mode_name(enum gsm48_chan_mode val) +{ return get_value_string(gsm48_chan_mode_names, val); } /* Chapter 9.1.2 */ struct gsm48_ass_cmd { -- To view, visit https://gerrit.osmocom.org/9975 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I0757bcc278c140e18249e35864338e19cdaa3cf7 Gerrit-Change-Number: 9975 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 16:06:16 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Jul 2018 16:06:16 +0000 Subject: Change in libosmocore[master]: gsm_04_08: add function to get value string In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9975 ) Change subject: gsm_04_08: add function to get value string ...................................................................... Patch Set 1: Code-Review-1 I think it was somehow decided that we don't want to add more helper functions for new value_string arrays. Use get_value_string() directly with the already exported gsm48_chan_mode_names. -- To view, visit https://gerrit.osmocom.org/9975 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0757bcc278c140e18249e35864338e19cdaa3cf7 Gerrit-Change-Number: 9975 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 12 Jul 2018 16:06:16 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 16:06:48 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Jul 2018 16:06:48 +0000 Subject: Change in libosmocore[master]: gsm_04_08: add function to get value string In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9975 ) Change subject: gsm_04_08: add function to get value string ...................................................................... Patch Set 1: I'm not against doing it one way or the other, but I think we should clarify the policy before blindly merging. -- To view, visit https://gerrit.osmocom.org/9975 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0757bcc278c140e18249e35864338e19cdaa3cf7 Gerrit-Change-Number: 9975 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 12 Jul 2018 16:06:48 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 16:23:42 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 12 Jul 2018 16:23:42 +0000 Subject: Change in libosmocore[master]: gsm_08_08: gsm0808_permitted_speech does not have value strings Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/9976 Change subject: gsm_08_08: gsm0808_permitted_speech does not have value strings ...................................................................... gsm_08_08: gsm0808_permitted_speech does not have value strings enum gsm0808_permitted_speech does not have any value strings. Lets add value strings to make debugging easier. Change-Id: I5b5612a5df2758b0137a34c17f7c8c2b3f07c806 --- M include/osmocom/gsm/protocol/gsm_08_08.h M src/gsm/gsm0808.c M src/gsm/libosmogsm.map 3 files changed, 19 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/76/9976/1 diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h index db5f7fa..bd5705f 100644 --- a/include/osmocom/gsm/protocol/gsm_08_08.h +++ b/include/osmocom/gsm/protocol/gsm_08_08.h @@ -430,6 +430,10 @@ GSM0808_PERM_HR6 = 0x45, /*!< OHR AMR */ }; +extern const struct value_string gsm0808_permitted_speech_names[]; +static inline const char *gsm0808_permitted_speech_name(enum gsm0808_permitted_speech val) +{ return get_value_string(gsm0808_permitted_speech_names, val); } + /*! 3GPP TS 48.008, 3.2.2.103 Speech Codec Type */ enum gsm0808_speech_codec_type { GSM0808_SCT_FR1 = 0x0, /*!< GSM FR */ diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c index 625de81..a26addd 100644 --- a/src/gsm/gsm0808.c +++ b/src/gsm/gsm0808.c @@ -1153,6 +1153,20 @@ { 0, NULL } }; +const struct value_string gsm0808_permitted_speech_names[] = { + { GSM0808_PERM_FR1, "FR1" }, + { GSM0808_PERM_FR2, "FR2" }, + { GSM0808_PERM_FR3, "FR3" }, + { GSM0808_PERM_FR4, "FR4" }, + { GSM0808_PERM_FR5, "FR5" }, + { GSM0808_PERM_HR1, "HR1" }, + { GSM0808_PERM_HR2, "HR2" }, + { GSM0808_PERM_HR3, "HR3" }, + { GSM0808_PERM_HR4, "HR4" }, + { GSM0808_PERM_HR6, "HR6" }, + { 0, NULL } +}; + static const struct value_string gsm0808_cause_names[] = { { GSM0808_CAUSE_RADIO_INTERFACE_MESSAGE_FAILURE, "RADIO INTERFACE MESSAGE FAILURE" }, { GSM0808_CAUSE_RADIO_INTERFACE_FAILURE, "RADIO INTERFACE FAILURE" }, diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 96779d2..5eed5b5 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -201,6 +201,7 @@ gsm0808_chan_type_to_speech_codec; gsm0808_speech_codec_from_chan_type; gsm0808_speech_codec_type_names; +gsm0808_permitted_speech_names; gsm0808_channel_type_name; gsm0808_lcls_config_names; gsm0808_lcls_control_names; -- To view, visit https://gerrit.osmocom.org/9976 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I5b5612a5df2758b0137a34c17f7c8c2b3f07c806 Gerrit-Change-Number: 9976 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 16:32:55 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Jul 2018 16:32:55 +0000 Subject: Change in libosmocore[master]: gsm_08_08: gsm0808_permitted_speech does not have value strings In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9976 ) Change subject: gsm_08_08: gsm0808_permitted_speech does not have value strings ...................................................................... Patch Set 1: Same for this one. Do we want to have an extra inline function? -- To view, visit https://gerrit.osmocom.org/9976 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5b5612a5df2758b0137a34c17f7c8c2b3f07c806 Gerrit-Change-Number: 9976 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 12 Jul 2018 16:32:55 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 16:40:40 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Jul 2018 16:40:40 +0000 Subject: Change in libosmocore[master]: ctrl: Fix parsing of ERROR recvd msgs with id=err Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9977 Change subject: ctrl: Fix parsing of ERROR recvd msgs with id=err ...................................................................... ctrl: Fix parsing of ERROR recvd msgs with id=err Our implementation generates ERROR CTRL messages with ID=error when it is unable to parse a CMD. However, it doesn't account for them when trying to receive and parse this kind of message. As a result, it will return an ERROR message with a different description. This commit fixes the old behaviour to success at parsing and returning the received description to the caller. Change-Id: I564ab1a7e845388f87accda44fbf165e5adc2480 --- M src/ctrl/control_cmd.c 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/77/9977/1 diff --git a/src/ctrl/control_cmd.c b/src/ctrl/control_cmd.c index c5924b2..14ff906 100644 --- a/src/ctrl/control_cmd.c +++ b/src/ctrl/control_cmd.c @@ -362,7 +362,8 @@ goto err; } - if (!id_str_valid(tmp)) { + if (!id_str_valid(tmp) && + !(cmd->type == CTRL_TYPE_ERROR && strcmp(tmp, "err") == 0)) { LOGP(DLCTRL, LOGL_NOTICE, "Invalid %s message ID number: \"%s\"\n", get_value_string(ctrl_type_vals, cmd->type), osmo_escape_str(tmp, -1)); cmd->type = CTRL_TYPE_ERROR; -- To view, visit https://gerrit.osmocom.org/9977 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I564ab1a7e845388f87accda44fbf165e5adc2480 Gerrit-Change-Number: 9977 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 16:40:40 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Jul 2018 16:40:40 +0000 Subject: Change in libosmocore[master]: ctrl: Introduce ctrl_cmd_parse3 API Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9978 Change subject: ctrl: Introduce ctrl_cmd_parse3 API ...................................................................... ctrl: Introduce ctrl_cmd_parse3 API Callers require to know whether the returned ERROR cmd was received or generated locally, in order to send it or do something with it locally. Related: OS#3394 Change-Id: Ide9170e5c31967c353f8fe4e8227e64130b91eae --- M include/osmocom/ctrl/control_cmd.h M src/ctrl/control_cmd.c M src/ctrl/libosmoctrl.map 3 files changed, 22 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/78/9978/1 diff --git a/include/osmocom/ctrl/control_cmd.h b/include/osmocom/ctrl/control_cmd.h index 08376f3..93055c7 100644 --- a/include/osmocom/ctrl/control_cmd.h +++ b/include/osmocom/ctrl/control_cmd.h @@ -124,6 +124,7 @@ int ctrl_cmd_install(enum ctrl_node_type node, struct ctrl_cmd_element *cmd); int ctrl_cmd_send(struct osmo_wqueue *queue, struct ctrl_cmd *cmd); int ctrl_cmd_send_to_all(struct ctrl_handle *ctrl, struct ctrl_cmd *cmd); +struct ctrl_cmd *ctrl_cmd_parse3(void *ctx, struct msgb *msg, bool *parse_failed); struct ctrl_cmd *ctrl_cmd_parse2(void *ctx, struct msgb *msg); struct ctrl_cmd *ctrl_cmd_parse(void *ctx, struct msgb *msg); struct msgb *ctrl_cmd_make(struct ctrl_cmd *cmd); diff --git a/src/ctrl/control_cmd.c b/src/ctrl/control_cmd.c index 14ff906..33496bd 100644 --- a/src/ctrl/control_cmd.c +++ b/src/ctrl/control_cmd.c @@ -316,9 +316,25 @@ * \param[in] msg message buffer containing command to be decoded * \returns callee-allocated decoded CTRL command; NULL on allocation failure, * ctrl->type == CTRL_TYPE_ERROR and an error message in ctrl->reply on any error. - * The caller is responsible to talloc_free() the returned struct pointer. */ + * The caller is responsible to talloc_free() the returned struct pointer. + * If information of the origin of the ERROR cmd returned is required (received + * or local parsing failure), use \ref ctrl_cmd_parse3 instead. */ struct ctrl_cmd *ctrl_cmd_parse2(void *ctx, struct msgb *msg) { + bool unused; + return ctrl_cmd_parse3(ctx, msg, &unused); +} + +/*! Parse/Decode CTRL from \ref msgb into command struct. + * \param[in] ctx talloc context from which to allocate + * \param[in] msg message buffer containing command to be decoded + * \param[out] parse_failed Whether returned ERROR cmd was generatd locally + * (due to parse failure) or was received. + * \returns callee-allocated decoded CTRL command; NULL on allocation failure, + * ctrl->type == CTRL_TYPE_ERROR and an error message in ctrl->reply on any error. + * The caller is responsible to talloc_free() the returned struct pointer. */ +struct ctrl_cmd *ctrl_cmd_parse3(void *ctx, struct msgb *msg, bool *parse_failed) +{ char *str, *tmp, *saveptr = NULL; char *var, *val; struct ctrl_cmd *cmd; @@ -326,6 +342,7 @@ cmd = talloc_zero(ctx, struct ctrl_cmd); if (!cmd) { LOGP(DLCTRL, LOGL_ERROR, "Failed to allocate.\n"); + *parse_failed = true; return NULL; } @@ -483,12 +500,14 @@ goto err; } + *parse_failed = false; return cmd; oom: cmd->type = CTRL_TYPE_ERROR; cmd->id = "err"; cmd->reply = "OOM"; err: + *parse_failed = true; return cmd; } diff --git a/src/ctrl/libosmoctrl.map b/src/ctrl/libosmoctrl.map index 5b888a2..f995467 100644 --- a/src/ctrl/libosmoctrl.map +++ b/src/ctrl/libosmoctrl.map @@ -13,6 +13,7 @@ ctrl_cmd_make; ctrl_cmd_parse; ctrl_cmd_parse2; +ctrl_cmd_parse3; ctrl_cmd_send; ctrl_cmd_send_to_all; ctrl_cmd_send_trap; -- To view, visit https://gerrit.osmocom.org/9978 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ide9170e5c31967c353f8fe4e8227e64130b91eae Gerrit-Change-Number: 9978 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 16:41:02 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Jul 2018 16:41:02 +0000 Subject: Change in openbsc[master]: nat: ctrl: use strtol instead of atoi as it has explicit error docume... Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9979 Change subject: nat: ctrl: use strtol instead of atoi as it has explicit error documentation ...................................................................... nat: ctrl: use strtol instead of atoi as it has explicit error documentation In some cases id can be non-digit such as "err" for ERROR cmds generated from parsing failures. Change-Id: Ief0b203efbcf2be04253b5056840be94d58a9994 --- M openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/79/9979/1 diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c b/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c index af110a2..e244827 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c @@ -85,8 +85,9 @@ static struct bsc_cmd_list *bsc_get_pending(struct bsc_connection *bsc, char *id_str) { struct bsc_cmd_list *cmd_entry; - int id = atoi(id_str); - if (id == 0) + char * endptr = NULL; + int id = (long int) strtol(id_str, &endptr, 10); + if (id_str[0] == '\0' || endptr[0] != '\0') return NULL; llist_for_each_entry(cmd_entry, &bsc->cmd_pending, list_entry) { -- To view, visit https://gerrit.osmocom.org/9979 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ief0b203efbcf2be04253b5056840be94d58a9994 Gerrit-Change-Number: 9979 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 16:41:03 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Jul 2018 16:41:03 +0000 Subject: Change in openbsc[master]: nat: ctrl: Avoid sending back received ERROR msgs Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9980 Change subject: nat: ctrl: Avoid sending back received ERROR msgs ...................................................................... nat: ctrl: Avoid sending back received ERROR msgs We only send back if we had an error parsing the message locally. If we receive an ERROR message from a bsc, we try to forward it if the ID is valid, otherwise only log the received error description locally. Related: OS#3394 Change-Id: I7b4d20aea7a16c4b4e5add7c274a4ed34a7f6b8d --- M openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c 1 file changed, 11 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/80/9980/1 diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c b/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c index e244827..e806731 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c @@ -101,13 +101,14 @@ int bsc_nat_handle_ctrlif_msg(struct bsc_connection *bsc, struct msgb *msg) { struct ctrl_cmd *cmd; + bool parse_failed; struct bsc_cmd_list *pending; char *var; - cmd = ctrl_cmd_parse2(bsc, msg); + cmd = ctrl_cmd_parse3(bsc, msg, &parse_failed); msgb_free(msg); - if (cmd->type == CTRL_TYPE_ERROR) + if (cmd->type == CTRL_TYPE_ERROR && parse_failed) goto err; if (bsc->cfg && !llist_empty(&bsc->cfg->lac_list)) { @@ -142,11 +143,14 @@ ctrl_cmd_send(&pending->cmd->ccon->write_queue, cmd); bsc_nat_ctrl_del_pending(pending); } else { - /* We need to handle TRAPS here */ - if ((cmd->type != CTRL_TYPE_ERROR) && - (cmd->type != CTRL_TYPE_TRAP)) { - LOGP(DNAT, LOGL_NOTICE, "Got control message " - "from BSC without pending entry\n"); + if ((cmd->type == CTRL_TYPE_ERROR)) { + LOGP(DNAT, LOGL_NOTICE, "Got ERROR CTRL message " + "from BSC without pending/valid ID %s: %s\n", + cmd->id, cmd->reply); + } else { + LOGP(DNAT, LOGL_NOTICE, "Got %s CTRL message " + "from BSC without pending entry\n", + get_value_string(ctrl_type_vals, cmd->type)); cmd->type = CTRL_TYPE_ERROR; cmd->reply = "No request outstanding"; goto err; -- To view, visit https://gerrit.osmocom.org/9980 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I7b4d20aea7a16c4b4e5add7c274a4ed34a7f6b8d Gerrit-Change-Number: 9980 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 16:41:42 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Jul 2018 16:41:42 +0000 Subject: Change in openbsc[master]: nat: ctrl: Avoid sending back received ERROR msgs In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9980 ) Change subject: nat: ctrl: Avoid sending back received ERROR msgs ...................................................................... Patch Set 1: Requires libosmocore https://gerrit.osmocom.org/#/c/libosmocore/+/9978/ to build correctly. -- To view, visit https://gerrit.osmocom.org/9980 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7b4d20aea7a16c4b4e5add7c274a4ed34a7f6b8d Gerrit-Change-Number: 9980 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Jenkins Builder Gerrit-Comment-Date: Thu, 12 Jul 2018 16:41:42 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 16:47:45 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 12 Jul 2018 16:47:45 +0000 Subject: Change in libosmocore[master]: gsm_04_08: add function to get value string In-Reply-To: References: Message-ID: dexter has posted comments on this change. ( https://gerrit.osmocom.org/9975 ) Change subject: gsm_04_08: add function to get value string ...................................................................... Patch Set 1: > I'm not against doing it one way or the other, but I think we > should clarify the policy before blindly merging. As far as I know the policy was that the each value string table should have an inline function like this. Probably because this is shorter when its used with printf or maybe because we can add some logic lateron by defining a real function. Maybe we should wait for haralds comment. -- To view, visit https://gerrit.osmocom.org/9975 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0757bcc278c140e18249e35864338e19cdaa3cf7 Gerrit-Change-Number: 9975 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: dexter Gerrit-Comment-Date: Thu, 12 Jul 2018 16:47:45 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 16:55:23 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Jul 2018 16:55:23 +0000 Subject: Change in openbsc[master]: bsc: ctrl: Avoid sending back received ERROR msgs Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9981 Change subject: bsc: ctrl: Avoid sending back received ERROR msgs ...................................................................... bsc: ctrl: Avoid sending back received ERROR msgs Change-Id: Ib5963e4d15a4a6b077d7a97fbbde6e5134c77e9a --- M openbsc/src/osmo-bsc/osmo_bsc_msc.c 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/81/9981/1 diff --git a/openbsc/src/osmo-bsc/osmo_bsc_msc.c b/openbsc/src/osmo-bsc/osmo_bsc_msc.c index 4395c3b..b179ff1 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_msc.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_msc.c @@ -224,9 +224,10 @@ { int ret; struct ctrl_cmd *cmd; + bool parse_failed; - cmd = ctrl_cmd_parse2(msc->msc_con, msg); - if (cmd->type == CTRL_TYPE_ERROR) { + cmd = ctrl_cmd_parse3(msc->msc_con, msg, &parse_failed); + if (cmd->type == CTRL_TYPE_ERROR && parse_failed) { LOGP(DMSC, LOGL_ERROR, "Failed to parse control message.\n"); ctrl_cmd_send(&msc->msc_con->write_queue, cmd); -- To view, visit https://gerrit.osmocom.org/9981 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ib5963e4d15a4a6b077d7a97fbbde6e5134c77e9a Gerrit-Change-Number: 9981 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 17:01:48 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Jul 2018 17:01:48 +0000 Subject: Change in openbsc[master]: bsc: ctrl: Avoid sending back received ERROR msgs In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9981 ) Change subject: bsc: ctrl: Avoid sending back received ERROR msgs ...................................................................... Patch Set 1: Requires libosmocore https://gerrit.osmocom.org/#/c/libosmocore/+/9978/ to build correctly. -- To view, visit https://gerrit.osmocom.org/9981 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib5963e4d15a4a6b077d7a97fbbde6e5134c77e9a Gerrit-Change-Number: 9981 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 12 Jul 2018 17:01:48 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 17:02:49 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Jul 2018 17:02:49 +0000 Subject: Change in osmo-bsc[master]: ctrl: Avoid sending back received ERROR msgs Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9982 Change subject: ctrl: Avoid sending back received ERROR msgs ...................................................................... ctrl: Avoid sending back received ERROR msgs Change-Id: If0cd4d435acd13dd132248c521e6bb0182de0deb --- M src/osmo-bsc/osmo_bsc_ctrl.c 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/82/9982/1 diff --git a/src/osmo-bsc/osmo_bsc_ctrl.c b/src/osmo-bsc/osmo_bsc_ctrl.c index 13cf98d..77087c5 100644 --- a/src/osmo-bsc/osmo_bsc_ctrl.c +++ b/src/osmo-bsc/osmo_bsc_ctrl.c @@ -110,16 +110,17 @@ int bsc_sccplite_rx_ctrl(struct osmo_ss7_asp *asp, struct msgb *msg) { struct ctrl_cmd *cmd; + bool parse_failed; int rc; /* caller has already ensured ipaccess_head + ipaccess_head_ext */ OSMO_ASSERT(msg->l2h); /* prase raw (ASCII) CTRL command into ctrl_cmd */ - cmd = ctrl_cmd_parse2(asp, msg); + cmd = ctrl_cmd_parse3(asp, msg, &parse_failed); OSMO_ASSERT(cmd); msgb_free(msg); - if (cmd->type == CTRL_TYPE_ERROR) + if (cmd->type == CTRL_TYPE_ERROR && parse_failed) goto send_reply; /* handle the CTRL command */ -- To view, visit https://gerrit.osmocom.org/9982 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: If0cd4d435acd13dd132248c521e6bb0182de0deb Gerrit-Change-Number: 9982 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 17:03:00 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Jul 2018 17:03:00 +0000 Subject: Change in osmo-bsc[master]: ctrl: Avoid sending back received ERROR msgs In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9982 ) Change subject: ctrl: Avoid sending back received ERROR msgs ...................................................................... Patch Set 1: Requires libosmocore https://gerrit.osmocom.org/#/c/libosmocore/+/9978/ to build correctly. -- To view, visit https://gerrit.osmocom.org/9982 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If0cd4d435acd13dd132248c521e6bb0182de0deb Gerrit-Change-Number: 9982 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Jenkins Builder Gerrit-Comment-Date: Thu, 12 Jul 2018 17:03:00 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:13:25 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 12 Jul 2018 18:13:25 +0000 Subject: Change in openbsc[master]: nat: ctrl: use strtol instead of atoi as it has explicit error docume... In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9979 ) Change subject: nat: ctrl: use strtol instead of atoi as it has explicit error documentation ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/9979/1/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c File openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c: https://gerrit.osmocom.org/#/c/9979/1/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c at 89 PS1, Line 89: int id = (long int) strtol(id_str, &endptr, 10); according to my man, strol() returns long int. What's the point of the cast? particularly when it gets assigned to int right after that? I thought the point of using strol() is to check errno afterwards? -- To view, visit https://gerrit.osmocom.org/9979 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ief0b203efbcf2be04253b5056840be94d58a9994 Gerrit-Change-Number: 9979 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Neels Hofmeyr Gerrit-Comment-Date: Thu, 12 Jul 2018 18:13:25 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:16:51 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Jul 2018 18:16:51 +0000 Subject: Change in openbsc[master]: nat: ctrl: use strtol instead of atoi as it has explicit error docume... In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9979 ) Change subject: nat: ctrl: use strtol instead of atoi as it has explicit error documentation ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/9979/1/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c File openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c: https://gerrit.osmocom.org/#/c/9979/1/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c at 89 PS1, Line 89: int id = (long int) strtol(id_str, &endptr, 10); > according to my man, strol() returns long int. [?] Sorry my bad, I wanted to cast to (int) since it's intended to get an int and avoid a compiler warning. -- To view, visit https://gerrit.osmocom.org/9979 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ief0b203efbcf2be04253b5056840be94d58a9994 Gerrit-Change-Number: 9979 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Neels Hofmeyr Gerrit-Comment-Date: Thu, 12 Jul 2018 18:16:51 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:17:16 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 12 Jul 2018 18:17:16 +0000 Subject: Change in libosmocore[master]: ctrl: Log CMD TYPE on invalid ID number In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9972 ) Change subject: ctrl: Log CMD TYPE on invalid ID number ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9972 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia890d4b841ef02342cc1cf7f5926866b040dc8ab Gerrit-Change-Number: 9972 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Thu, 12 Jul 2018 18:17:16 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:18:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 12 Jul 2018 18:18:17 +0000 Subject: Change in libosmocore[master]: gsm_04_08: add function to get value string In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9975 ) Change subject: gsm_04_08: add function to get value string ...................................................................... Patch Set 1: Code-Review+2 the policy is that we add inline functions excatly as this patch adds. -- To view, visit https://gerrit.osmocom.org/9975 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0757bcc278c140e18249e35864338e19cdaa3cf7 Gerrit-Change-Number: 9975 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: dexter Gerrit-Comment-Date: Thu, 12 Jul 2018 18:18:17 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:18:34 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 12 Jul 2018 18:18:34 +0000 Subject: Change in libosmocore[master]: gsm_08_08: gsm0808_permitted_speech does not have value strings In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9976 ) Change subject: gsm_08_08: gsm0808_permitted_speech does not have value strings ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9976 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5b5612a5df2758b0137a34c17f7c8c2b3f07c806 Gerrit-Change-Number: 9976 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 12 Jul 2018 18:18:34 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:18:39 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 12 Jul 2018 18:18:39 +0000 Subject: Change in libosmocore[master]: gsm_04_08: add function to get value string In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9975 ) Change subject: gsm_04_08: add function to get value string ...................................................................... gsm_04_08: add function to get value string The value string table gsm48_chan_mode_names[] lacks a function to get the value string by a value. Lets add one. Change-Id: I0757bcc278c140e18249e35864338e19cdaa3cf7 --- M include/osmocom/gsm/protocol/gsm_04_08.h 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified Objections: Pau Espin Pedrol: I would prefer this is not merged as is diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h index 4c98ff2..4635014 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08.h +++ b/include/osmocom/gsm/protocol/gsm_04_08.h @@ -553,6 +553,8 @@ }; extern const struct value_string gsm48_chan_mode_names[]; +static inline const char *gsm48_chan_mode_name(enum gsm48_chan_mode val) +{ return get_value_string(gsm48_chan_mode_names, val); } /* Chapter 9.1.2 */ struct gsm48_ass_cmd { -- To view, visit https://gerrit.osmocom.org/9975 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I0757bcc278c140e18249e35864338e19cdaa3cf7 Gerrit-Change-Number: 9975 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:18:40 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 12 Jul 2018 18:18:40 +0000 Subject: Change in libosmocore[master]: gsm_08_08: gsm0808_permitted_speech does not have value strings In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9976 ) Change subject: gsm_08_08: gsm0808_permitted_speech does not have value strings ...................................................................... gsm_08_08: gsm0808_permitted_speech does not have value strings enum gsm0808_permitted_speech does not have any value strings. Lets add value strings to make debugging easier. Change-Id: I5b5612a5df2758b0137a34c17f7c8c2b3f07c806 --- M include/osmocom/gsm/protocol/gsm_08_08.h M src/gsm/gsm0808.c M src/gsm/libosmogsm.map 3 files changed, 19 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h index db5f7fa..bd5705f 100644 --- a/include/osmocom/gsm/protocol/gsm_08_08.h +++ b/include/osmocom/gsm/protocol/gsm_08_08.h @@ -430,6 +430,10 @@ GSM0808_PERM_HR6 = 0x45, /*!< OHR AMR */ }; +extern const struct value_string gsm0808_permitted_speech_names[]; +static inline const char *gsm0808_permitted_speech_name(enum gsm0808_permitted_speech val) +{ return get_value_string(gsm0808_permitted_speech_names, val); } + /*! 3GPP TS 48.008, 3.2.2.103 Speech Codec Type */ enum gsm0808_speech_codec_type { GSM0808_SCT_FR1 = 0x0, /*!< GSM FR */ diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c index 625de81..a26addd 100644 --- a/src/gsm/gsm0808.c +++ b/src/gsm/gsm0808.c @@ -1153,6 +1153,20 @@ { 0, NULL } }; +const struct value_string gsm0808_permitted_speech_names[] = { + { GSM0808_PERM_FR1, "FR1" }, + { GSM0808_PERM_FR2, "FR2" }, + { GSM0808_PERM_FR3, "FR3" }, + { GSM0808_PERM_FR4, "FR4" }, + { GSM0808_PERM_FR5, "FR5" }, + { GSM0808_PERM_HR1, "HR1" }, + { GSM0808_PERM_HR2, "HR2" }, + { GSM0808_PERM_HR3, "HR3" }, + { GSM0808_PERM_HR4, "HR4" }, + { GSM0808_PERM_HR6, "HR6" }, + { 0, NULL } +}; + static const struct value_string gsm0808_cause_names[] = { { GSM0808_CAUSE_RADIO_INTERFACE_MESSAGE_FAILURE, "RADIO INTERFACE MESSAGE FAILURE" }, { GSM0808_CAUSE_RADIO_INTERFACE_FAILURE, "RADIO INTERFACE FAILURE" }, diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 96779d2..5eed5b5 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -201,6 +201,7 @@ gsm0808_chan_type_to_speech_codec; gsm0808_speech_codec_from_chan_type; gsm0808_speech_codec_type_names; +gsm0808_permitted_speech_names; gsm0808_channel_type_name; gsm0808_lcls_config_names; gsm0808_lcls_control_names; -- To view, visit https://gerrit.osmocom.org/9976 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I5b5612a5df2758b0137a34c17f7c8c2b3f07c806 Gerrit-Change-Number: 9976 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:18:50 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 12 Jul 2018 18:18:50 +0000 Subject: Change in libosmocore[master]: ctrl: Fix parsing of ERROR recvd msgs with id=err In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9977 ) Change subject: ctrl: Fix parsing of ERROR recvd msgs with id=err ...................................................................... Patch Set 1: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/9977/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/9977/1//COMMIT_MSG at 9 PS1, Line 9: Our implementation generates ERROR CTRL messages with ID=error when it ID='err'? -- To view, visit https://gerrit.osmocom.org/9977 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I564ab1a7e845388f87accda44fbf165e5adc2480 Gerrit-Change-Number: 9977 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Thu, 12 Jul 2018 18:18:50 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:18:51 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Jul 2018 18:18:51 +0000 Subject: Change in libosmocore[master]: ctrl: Log CMD TYPE on invalid ID number In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9972 to look at the new patch set (#3). Change subject: ctrl: Log CMD TYPE on invalid ID number ...................................................................... ctrl: Log CMD TYPE on invalid ID number Change-Id: Ia890d4b841ef02342cc1cf7f5926866b040dc8ab --- M src/ctrl/control_cmd.c 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/72/9972/3 -- To view, visit https://gerrit.osmocom.org/9972 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia890d4b841ef02342cc1cf7f5926866b040dc8ab Gerrit-Change-Number: 9972 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:18:51 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Jul 2018 18:18:51 +0000 Subject: Change in libosmocore[master]: ctrl: Fix parsing of ERROR recvd msgs with id=err In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9977 to look at the new patch set (#2). Change subject: ctrl: Fix parsing of ERROR recvd msgs with id=err ...................................................................... ctrl: Fix parsing of ERROR recvd msgs with id=err Our implementation generates ERROR CTRL messages with ID=error when it is unable to parse a CMD. However, it doesn't account for them when trying to receive and parse this kind of message. As a result, it will return an ERROR message with a different description. This commit fixes the old behaviour to success at parsing and returning the received description to the caller. Change-Id: I564ab1a7e845388f87accda44fbf165e5adc2480 --- M src/ctrl/control_cmd.c 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/77/9977/2 -- To view, visit https://gerrit.osmocom.org/9977 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I564ab1a7e845388f87accda44fbf165e5adc2480 Gerrit-Change-Number: 9977 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:18:51 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Jul 2018 18:18:51 +0000 Subject: Change in libosmocore[master]: ctrl: Introduce ctrl_cmd_parse3 API In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9978 to look at the new patch set (#2). Change subject: ctrl: Introduce ctrl_cmd_parse3 API ...................................................................... ctrl: Introduce ctrl_cmd_parse3 API Callers require to know whether the returned ERROR cmd was received or generated locally, in order to send it or do something with it locally. Related: OS#3394 Change-Id: Ide9170e5c31967c353f8fe4e8227e64130b91eae --- M include/osmocom/ctrl/control_cmd.h M src/ctrl/control_cmd.c M src/ctrl/libosmoctrl.map 3 files changed, 22 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/78/9978/2 -- To view, visit https://gerrit.osmocom.org/9978 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ide9170e5c31967c353f8fe4e8227e64130b91eae Gerrit-Change-Number: 9978 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:18:54 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Jul 2018 18:18:54 +0000 Subject: Change in libosmocore[master]: ctrl: ctrl_handle_msg: Avoid sending back received ERROR msgs Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9983 Change subject: ctrl: ctrl_handle_msg: Avoid sending back received ERROR msgs ...................................................................... ctrl: ctrl_handle_msg: Avoid sending back received ERROR msgs Change-Id: I396fd1e7548beea31b2b7aa9f764edb765b02941 --- M src/ctrl/control_if.c 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/83/9983/1 diff --git a/src/ctrl/control_if.c b/src/ctrl/control_if.c index d3e6fac..5962f7e 100644 --- a/src/ctrl/control_if.c +++ b/src/ctrl/control_if.c @@ -384,6 +384,7 @@ int ctrl_handle_msg(struct ctrl_handle *ctrl, struct ctrl_connection *ccon, struct msgb *msg) { struct ctrl_cmd *cmd; + bool parse_failed; struct ipaccess_head *iph; struct ipaccess_head_ext *iph_ext; int result; @@ -407,7 +408,7 @@ msg->l2h = iph_ext->data; - cmd = ctrl_cmd_parse2(ccon, msg); + cmd = ctrl_cmd_parse3(ccon, msg, &parse_failed); if (!cmd) { /* should never happen */ @@ -421,7 +422,7 @@ } /* In case of error, reply with the error message right away. */ - if (cmd->type == CTRL_TYPE_ERROR) + if (cmd->type == CTRL_TYPE_ERROR && parse_failed) goto send_reply; cmd->ccon = ccon; -- To view, visit https://gerrit.osmocom.org/9983 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I396fd1e7548beea31b2b7aa9f764edb765b02941 Gerrit-Change-Number: 9983 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:18:55 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Jul 2018 18:18:55 +0000 Subject: Change in libosmocore[master]: tests: ctrl: Test received ERROR messages are handled correctly Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9984 Change subject: tests: ctrl: Test received ERROR messages are handled correctly ...................................................................... tests: ctrl: Test received ERROR messages are handled correctly Change-Id: I3c8e95aaa1ca222d4cd1395e548f8461bf9d4cd6 --- M tests/ctrl/ctrl_test.c M tests/ctrl/ctrl_test.ok 2 files changed, 55 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/84/9984/1 diff --git a/tests/ctrl/ctrl_test.c b/tests/ctrl/ctrl_test.c index 8bb917b..cffb803 100644 --- a/tests/ctrl/ctrl_test.c +++ b/tests/ctrl/ctrl_test.c @@ -70,18 +70,23 @@ static void assert_test(struct ctrl_handle *ctrl, struct ctrl_connection *ccon, const struct one_test *t) { struct ctrl_cmd *cmd; + bool parse_failed; struct msgb *msg = msgb_from_string(t->cmd_str); int ctx_size_was; printf("test: '%s'\n", osmo_escape_str(t->cmd_str, -1)); printf("parsing:\n"); - cmd = ctrl_cmd_parse2(ctx, msg); + cmd = ctrl_cmd_parse3(ctx, msg, &parse_failed); OSMO_ASSERT(cmd); if (t->expect_parsed.type != cmd->type) { printf("type mismatch: got %s\n", get_value_string(ctrl_type_vals, cmd->type)); OSMO_ASSERT(t->expect_parsed.type == cmd->type); + } else { + printf("type = '%s'%s\n", get_value_string(ctrl_type_vals, cmd->type), + cmd->type != CTRL_TYPE_ERROR ? "" : + (parse_failed ? " (parse failure)" : " (error received)")); } #define ASSERT_SAME_STR(field) \ @@ -310,7 +315,20 @@ .reply = "OK", }, }, - + { "ERROR 1 some error message", + { + .type = CTRL_TYPE_ERROR, + .id = "1", + .reply = "some error message", + }, + }, + { "ERROR err some error message", + { + .type = CTRL_TYPE_ERROR, + .id = "err", + .reply = "some error message", + }, + }, }; static void test_messages() diff --git a/tests/ctrl/ctrl_test.ok b/tests/ctrl/ctrl_test.ok index 07f4aac..0705d69 100644 --- a/tests/ctrl/ctrl_test.ok +++ b/tests/ctrl/ctrl_test.ok @@ -9,6 +9,7 @@ ctrl type 64 is unknown 0x40 [PARSE FAILED] test: 'GET 1 variable' parsing: +type = 'GET' id = '1' variable = 'variable' value = '(null)' @@ -18,6 +19,7 @@ ok test: 'GET 1 variable\n' parsing: +type = 'GET' id = '1' variable = 'variable' value = '(null)' @@ -27,6 +29,7 @@ ok test: 'GET 1 var\ni\nable' parsing: +type = 'ERROR' (parse failure) id = '1' reply = 'GET with trailing characters' handling: @@ -34,6 +37,7 @@ ok test: 'GET 1 var\ti\table' parsing: +type = 'ERROR' (parse failure) id = '1' reply = 'GET variable contains invalid characters' handling: @@ -41,6 +45,7 @@ ok test: 'GET 1 var\ri\rable' parsing: +type = 'ERROR' (parse failure) id = '1' reply = 'GET variable contains invalid characters' handling: @@ -48,6 +53,7 @@ ok test: 'GET 1 variable value' parsing: +type = 'ERROR' (parse failure) id = '1' reply = 'GET with trailing characters' handling: @@ -55,6 +61,7 @@ ok test: 'GET 1 variable value\n' parsing: +type = 'ERROR' (parse failure) id = '1' reply = 'GET with trailing characters' handling: @@ -62,6 +69,7 @@ ok test: 'GET 1 variable multiple value tokens' parsing: +type = 'ERROR' (parse failure) id = '1' reply = 'GET with trailing characters' handling: @@ -69,6 +77,7 @@ ok test: 'GET 1 variable multiple value tokens\n' parsing: +type = 'ERROR' (parse failure) id = '1' reply = 'GET with trailing characters' handling: @@ -76,6 +85,7 @@ ok test: 'SET 1 variable value' parsing: +type = 'SET' id = '1' variable = 'variable' value = 'value' @@ -85,6 +95,7 @@ ok test: 'SET 1 variable value\n' parsing: +type = 'SET' id = '1' variable = 'variable' value = 'value' @@ -94,6 +105,7 @@ ok test: 'SET weird_id variable value' parsing: +type = 'ERROR' (parse failure) id = 'err' reply = 'Invalid message ID number' handling: @@ -101,6 +113,7 @@ ok test: 'SET weird_id variable value\n' parsing: +type = 'ERROR' (parse failure) id = 'err' reply = 'Invalid message ID number' handling: @@ -108,6 +121,7 @@ ok test: 'SET 1 variable multiple value tokens' parsing: +type = 'SET' id = '1' variable = 'variable' value = 'multiple value tokens' @@ -117,6 +131,7 @@ ok test: 'SET 1 variable multiple value tokens\n' parsing: +type = 'SET' id = '1' variable = 'variable' value = 'multiple value tokens' @@ -126,6 +141,7 @@ ok test: 'SET 1 variable value_with_trailing_spaces ' parsing: +type = 'SET' id = '1' variable = 'variable' value = 'value_with_trailing_spaces ' @@ -135,6 +151,7 @@ ok test: 'SET 1 variable value_with_trailing_spaces \n' parsing: +type = 'SET' id = '1' variable = 'variable' value = 'value_with_trailing_spaces ' @@ -144,6 +161,7 @@ ok test: 'SET \n special_char_id value' parsing: +type = 'ERROR' (parse failure) id = 'err' reply = 'Invalid message ID number' handling: @@ -151,6 +169,7 @@ ok test: 'SET \t special_char_id value' parsing: +type = 'ERROR' (parse failure) id = 'err' reply = 'Invalid message ID number' handling: @@ -158,6 +177,7 @@ ok test: 'GET_REPLY 1 variable OK' parsing: +type = 'GET_REPLY' id = '1' variable = 'variable' value = '(null)' @@ -166,12 +186,27 @@ ok test: 'SET_REPLY 1 variable OK' parsing: +type = 'SET_REPLY' id = '1' variable = 'variable' value = '(null)' reply = 'OK' handling: ok +test: 'ERROR 1 some error message' +parsing: +type = 'ERROR' (error received) +id = '1' +reply = 'some error message' +handling: +ok +test: 'ERROR err some error message' +parsing: +type = 'ERROR' (error received) +id = 'err' +reply = 'some error message' +handling: +ok test_deferred_cmd get_test_defer called -- To view, visit https://gerrit.osmocom.org/9984 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I3c8e95aaa1ca222d4cd1395e548f8461bf9d4cd6 Gerrit-Change-Number: 9984 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:20:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 12 Jul 2018 18:20:21 +0000 Subject: Change in pysim[master]: cosmetic: fix excess space in log output (typo) In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9967 ) Change subject: cosmetic: fix excess space in log output (typo) ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9967 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I33f9b8c803ccd185ffa370d235363423d82ba9c7 Gerrit-Change-Number: 9967 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Thu, 12 Jul 2018 18:20:21 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:20:44 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 12 Jul 2018 18:20:44 +0000 Subject: Change in openbsc[master]: nat: ctrl: Use ctrl_cmd_parse2 to obtain detailed error In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9973 ) Change subject: nat: ctrl: Use ctrl_cmd_parse2 to obtain detailed error ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9973 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6ef2b6e309632ed9cb296e8a1e71f879007a36ae Gerrit-Change-Number: 9973 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 12 Jul 2018 18:20:44 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:21:29 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Jul 2018 18:21:29 +0000 Subject: Change in openbsc[master]: nat: ctrl: use strtol instead of atoi as it has explicit error docume... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9979 to look at the new patch set (#2). Change subject: nat: ctrl: use strtol instead of atoi as it has explicit error documentation ...................................................................... nat: ctrl: use strtol instead of atoi as it has explicit error documentation In some cases id can be non-digit such as "err" for ERROR cmds generated from parsing failures. Change-Id: Ief0b203efbcf2be04253b5056840be94d58a9994 --- M openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/79/9979/2 -- To view, visit https://gerrit.osmocom.org/9979 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ief0b203efbcf2be04253b5056840be94d58a9994 Gerrit-Change-Number: 9979 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:22:24 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 12 Jul 2018 18:22:24 +0000 Subject: Change in openbsc[master]: nat: ctrl: Use ctrl_cmd_parse2 to obtain detailed error In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9973 ) Change subject: nat: ctrl: Use ctrl_cmd_parse2 to obtain detailed error ...................................................................... Patch Set 1: -Code-Review (1 comment) https://gerrit.osmocom.org/#/c/9973/1/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c File openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c: https://gerrit.osmocom.org/#/c/9973/1/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c at 106 PS1, Line 106: cmd = ctrl_cmd_parse2(bsc, msg); so below, we send the cmd out again, shouldn't this then use ctrl_cmd_parse3() and not send cmds that failed to parse? -- To view, visit https://gerrit.osmocom.org/9973 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6ef2b6e309632ed9cb296e8a1e71f879007a36ae Gerrit-Change-Number: 9973 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 12 Jul 2018 18:22:24 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:22:31 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 12 Jul 2018 18:22:31 +0000 Subject: Change in openbsc[master]: bsc: ctrl: Use ctrl_cmd_parse2 to obtain detailed error In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9974 ) Change subject: bsc: ctrl: Use ctrl_cmd_parse2 to obtain detailed error ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/9974/1/openbsc/src/osmo-bsc/osmo_bsc_msc.c File openbsc/src/osmo-bsc/osmo_bsc_msc.c: https://gerrit.osmocom.org/#/c/9974/1/openbsc/src/osmo-bsc/osmo_bsc_msc.c at 228 PS1, Line 228: cmd = ctrl_cmd_parse2(msc->msc_con, msg); so below, we send the cmd out again, shouldn't this then use ctrl_cmd_parse3() and not send cmds that failed to parse? -- To view, visit https://gerrit.osmocom.org/9974 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie111bec46b664768fe3c3feff906f91e8ee8b1d4 Gerrit-Change-Number: 9974 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Neels Hofmeyr Gerrit-Comment-Date: Thu, 12 Jul 2018 18:22:31 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:23:11 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 12 Jul 2018 18:23:11 +0000 Subject: Change in openbsc[master]: nat: ctrl: use strtol instead of atoi as it has explicit error docume... In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9979 ) Change subject: nat: ctrl: use strtol instead of atoi as it has explicit error documentation ...................................................................... Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/9979/2/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c File openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c: https://gerrit.osmocom.org/#/c/9979/2/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c at 90 PS2, Line 90: if (id_str[0] == '\0' || endptr[0] != '\0') what about errno? -- To view, visit https://gerrit.osmocom.org/9979 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ief0b203efbcf2be04253b5056840be94d58a9994 Gerrit-Change-Number: 9979 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Neels Hofmeyr Gerrit-Comment-Date: Thu, 12 Jul 2018 18:23:11 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:24:23 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Jul 2018 18:24:23 +0000 Subject: Change in openbsc[master]: nat: ctrl: Use ctrl_cmd_parse2 to obtain detailed error In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9973 ) Change subject: nat: ctrl: Use ctrl_cmd_parse2 to obtain detailed error ...................................................................... Patch Set 1: This is a patch previous to introduction of ctrl_cmd_parse3 and its aim is to fix a different issue (getting specific parsing failure message instead of recreated one). -- To view, visit https://gerrit.osmocom.org/9973 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6ef2b6e309632ed9cb296e8a1e71f879007a36ae Gerrit-Change-Number: 9973 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 12 Jul 2018 18:24:23 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:24:26 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Jul 2018 18:24:26 +0000 Subject: Change in openbsc[master]: bsc: ctrl: Use ctrl_cmd_parse2 to obtain detailed error In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9974 ) Change subject: bsc: ctrl: Use ctrl_cmd_parse2 to obtain detailed error ...................................................................... Patch Set 1: This is a patch previous to introduction of ctrl_cmd_parse3 and its aim is to fix a different issue (getting specific parsing failure message instead of recreated one). -- To view, visit https://gerrit.osmocom.org/9974 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie111bec46b664768fe3c3feff906f91e8ee8b1d4 Gerrit-Change-Number: 9974 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Neels Hofmeyr Gerrit-Comment-Date: Thu, 12 Jul 2018 18:24:26 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:26:12 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 12 Jul 2018 18:26:12 +0000 Subject: Change in openbsc[master]: nat: ctrl: Avoid sending back received ERROR msgs In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9980 ) Change subject: nat: ctrl: Avoid sending back received ERROR msgs ...................................................................... Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/9980/2//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/9980/2//COMMIT_MSG at 13 PS2, Line 13: Related: OS#3394 Depends: ... -- To view, visit https://gerrit.osmocom.org/9980 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7b4d20aea7a16c4b4e5add7c274a4ed34a7f6b8d Gerrit-Change-Number: 9980 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Neels Hofmeyr Gerrit-Comment-Date: Thu, 12 Jul 2018 18:26:12 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:27:26 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 12 Jul 2018 18:27:26 +0000 Subject: Change in openbsc[master]: nat: ctrl: Use ctrl_cmd_parse2 to obtain detailed error In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9973 ) Change subject: nat: ctrl: Use ctrl_cmd_parse2 to obtain detailed error ...................................................................... Patch Set 1: Code-Review+2 ah ok wait, so when the peer sent an ERROR, we don't send back, but when we locally had an error, we send an ERROR to the peer. -- To view, visit https://gerrit.osmocom.org/9973 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6ef2b6e309632ed9cb296e8a1e71f879007a36ae Gerrit-Change-Number: 9973 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 12 Jul 2018 18:27:26 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:27:36 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 12 Jul 2018 18:27:36 +0000 Subject: Change in openbsc[master]: bsc: ctrl: Use ctrl_cmd_parse2 to obtain detailed error In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9974 ) Change subject: bsc: ctrl: Use ctrl_cmd_parse2 to obtain detailed error ...................................................................... Patch Set 1: Code-Review+2 ah ok wait, so when the peer sent an ERROR, we don't send back, but when we locally had an error, we send an ERROR to the peer. -- To view, visit https://gerrit.osmocom.org/9974 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie111bec46b664768fe3c3feff906f91e8ee8b1d4 Gerrit-Change-Number: 9974 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 12 Jul 2018 18:27:36 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:28:09 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Jul 2018 18:28:09 +0000 Subject: Change in openbsc[master]: nat: ctrl: use strtol instead of atoi as it has explicit error docume... In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9979 ) Change subject: nat: ctrl: use strtol instead of atoi as it has explicit error documentation ...................................................................... Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/9979/2/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c File openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c: https://gerrit.osmocom.org/#/c/9979/2/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c at 90 PS2, Line 90: if (id_str[0] == '\0' || endptr[0] != '\0') > what about errno? No need to check it for our purposes here as far as I understand. -- To view, visit https://gerrit.osmocom.org/9979 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ief0b203efbcf2be04253b5056840be94d58a9994 Gerrit-Change-Number: 9979 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Neels Hofmeyr Gerrit-Comment-Date: Thu, 12 Jul 2018 18:28:09 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:30:22 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 12 Jul 2018 18:30:22 +0000 Subject: Change in openbsc[master]: nat: ctrl: Avoid sending back received ERROR msgs In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9980 ) Change subject: nat: ctrl: Avoid sending back received ERROR msgs ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9980 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7b4d20aea7a16c4b4e5add7c274a4ed34a7f6b8d Gerrit-Change-Number: 9980 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 12 Jul 2018 18:30:22 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:31:53 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 12 Jul 2018 18:31:53 +0000 Subject: Change in openbsc[master]: nat: ctrl: use strtol instead of atoi as it has explicit error docume... In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9979 ) Change subject: nat: ctrl: use strtol instead of atoi as it has explicit error documentation ...................................................................... Patch Set 2: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/9979/2/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c File openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c: https://gerrit.osmocom.org/#/c/9979/2/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c at 90 PS2, Line 90: if (id_str[0] == '\0' || endptr[0] != '\0') > No need to check it for our purposes here as far as I understand. EINVAL (not in C99) The given base contains an unsupported value. ERANGE The resulting value was out of range. rather check those, right? we might also want to check that the returned long int is <= INT_MAX. -- To view, visit https://gerrit.osmocom.org/9979 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ief0b203efbcf2be04253b5056840be94d58a9994 Gerrit-Change-Number: 9979 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 12 Jul 2018 18:31:53 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:32:44 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 12 Jul 2018 18:32:44 +0000 Subject: Change in osmo-bsc[master]: ctrl: Avoid sending back received ERROR msgs In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9982 ) Change subject: ctrl: Avoid sending back received ERROR msgs ...................................................................... Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/9982/1/src/osmo-bsc/osmo_bsc_ctrl.c File src/osmo-bsc/osmo_bsc_ctrl.c: https://gerrit.osmocom.org/#/c/9982/1/src/osmo-bsc/osmo_bsc_ctrl.c at 123 PS1, Line 123: if (cmd->type == CTRL_TYPE_ERROR && parse_failed) (parse_failed always comes with CTRL_TYPE_ERROR, right?) -- To view, visit https://gerrit.osmocom.org/9982 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If0cd4d435acd13dd132248c521e6bb0182de0deb Gerrit-Change-Number: 9982 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 12 Jul 2018 18:32:44 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:36:44 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 12 Jul 2018 18:36:44 +0000 Subject: Change in openbsc[master]: nat: ctrl: use strtol instead of atoi as it has explicit error docume... In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9979 ) Change subject: nat: ctrl: use strtol instead of atoi as it has explicit error documentation ...................................................................... Patch Set 2: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/9979/2/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c File openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c: https://gerrit.osmocom.org/#/c/9979/2/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c at 90 PS2, Line 90: if (id_str[0] == '\0' || endptr[0] != '\0') > EINVAL (not in C99) The given base contains an unsupported value. [?] "In particular, if *nptr is not '\0' but **endptr is '\0' on return, the entire string is valid." -- To view, visit https://gerrit.osmocom.org/9979 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ief0b203efbcf2be04253b5056840be94d58a9994 Gerrit-Change-Number: 9979 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 12 Jul 2018 18:36:44 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:45:42 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 12 Jul 2018 18:45:42 +0000 Subject: Change in pysim[master]: pySim-read: Print exception when reading of EF.MSISDN fails In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9968 ) Change subject: pySim-read: Print exception when reading of EF.MSISDN fails ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9968 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Icb30470b1c0eee6a15fc028da820e92bf9ded27a Gerrit-Change-Number: 9968 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Thu, 12 Jul 2018 18:45:42 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:46:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 12 Jul 2018 18:46:11 +0000 Subject: Change in pysim[master]: cards: add update method for EF:PLMNsel to Card class In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9970 ) Change subject: cards: add update method for EF:PLMNsel to Card class ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9970 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I832f7bef70c92dc101b94ad871b6cafaa626e134 Gerrit-Change-Number: 9970 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: daniel Gerrit-Comment-Date: Thu, 12 Jul 2018 18:46:11 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:46:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 12 Jul 2018 18:46:41 +0000 Subject: Change in pysim[master]: pySim-read: read contents of PLMN related files. In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9969 ) Change subject: pySim-read: read contents of PLMN related files. ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9969 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ice802033adfa6fc1bccc76da47495eb29c3aef6c Gerrit-Change-Number: 9969 Gerrit-PatchSet: 3 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Thu, 12 Jul 2018 18:46:41 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:47:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 12 Jul 2018 18:47:14 +0000 Subject: Change in libosmocore[master]: ctrl: Log CMD TYPE on invalid ID number In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9972 ) Change subject: ctrl: Log CMD TYPE on invalid ID number ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9972 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia890d4b841ef02342cc1cf7f5926866b040dc8ab Gerrit-Change-Number: 9972 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Thu, 12 Jul 2018 18:47:14 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:47:49 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Jul 2018 18:47:49 +0000 Subject: Change in osmo-bsc[master]: ctrl: Avoid sending back received ERROR msgs In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9982 ) Change subject: ctrl: Avoid sending back received ERROR msgs ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/9982/1/src/osmo-bsc/osmo_bsc_ctrl.c File src/osmo-bsc/osmo_bsc_ctrl.c: https://gerrit.osmocom.org/#/c/9982/1/src/osmo-bsc/osmo_bsc_ctrl.c at 123 PS1, Line 123: if (cmd->type == CTRL_TYPE_ERROR && parse_failed) > (parse_failed always comes with CTRL_TYPE_ERROR, right?) Yes, API wise only makes sense if cmd->type=ERROR is returned. -- To view, visit https://gerrit.osmocom.org/9982 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If0cd4d435acd13dd132248c521e6bb0182de0deb Gerrit-Change-Number: 9982 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 12 Jul 2018 18:47:49 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:47:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 12 Jul 2018 18:47:55 +0000 Subject: Change in libosmocore[master]: ctrl: Fix parsing of ERROR recvd msgs with id=err In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9977 ) Change subject: ctrl: Fix parsing of ERROR recvd msgs with id=err ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9977 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I564ab1a7e845388f87accda44fbf165e5adc2480 Gerrit-Change-Number: 9977 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Thu, 12 Jul 2018 18:47:55 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:47:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 12 Jul 2018 18:47:57 +0000 Subject: Change in libosmocore[master]: ctrl: Log CMD TYPE on invalid ID number In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9972 ) Change subject: ctrl: Log CMD TYPE on invalid ID number ...................................................................... ctrl: Log CMD TYPE on invalid ID number Change-Id: Ia890d4b841ef02342cc1cf7f5926866b040dc8ab --- M src/ctrl/control_cmd.c 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/ctrl/control_cmd.c b/src/ctrl/control_cmd.c index bff4d17..c5924b2 100644 --- a/src/ctrl/control_cmd.c +++ b/src/ctrl/control_cmd.c @@ -363,10 +363,11 @@ } if (!id_str_valid(tmp)) { + LOGP(DLCTRL, LOGL_NOTICE, "Invalid %s message ID number: \"%s\"\n", + get_value_string(ctrl_type_vals, cmd->type), osmo_escape_str(tmp, -1)); cmd->type = CTRL_TYPE_ERROR; cmd->id = "err"; cmd->reply = "Invalid message ID number"; - LOGP(DLCTRL, LOGL_NOTICE, "Invalid message ID number: \"%s\"\n", osmo_escape_str(tmp, -1)); goto err; } cmd->id = talloc_strdup(cmd, tmp); -- To view, visit https://gerrit.osmocom.org/9972 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ia890d4b841ef02342cc1cf7f5926866b040dc8ab Gerrit-Change-Number: 9972 Gerrit-PatchSet: 4 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:47:58 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 12 Jul 2018 18:47:58 +0000 Subject: Change in libosmocore[master]: ctrl: Fix parsing of ERROR recvd msgs with id=err In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9977 ) Change subject: ctrl: Fix parsing of ERROR recvd msgs with id=err ...................................................................... ctrl: Fix parsing of ERROR recvd msgs with id=err Our implementation generates ERROR CTRL messages with ID=error when it is unable to parse a CMD. However, it doesn't account for them when trying to receive and parse this kind of message. As a result, it will return an ERROR message with a different description. This commit fixes the old behaviour to success at parsing and returning the received description to the caller. Change-Id: I564ab1a7e845388f87accda44fbf165e5adc2480 --- M src/ctrl/control_cmd.c 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/ctrl/control_cmd.c b/src/ctrl/control_cmd.c index c5924b2..14ff906 100644 --- a/src/ctrl/control_cmd.c +++ b/src/ctrl/control_cmd.c @@ -362,7 +362,8 @@ goto err; } - if (!id_str_valid(tmp)) { + if (!id_str_valid(tmp) && + !(cmd->type == CTRL_TYPE_ERROR && strcmp(tmp, "err") == 0)) { LOGP(DLCTRL, LOGL_NOTICE, "Invalid %s message ID number: \"%s\"\n", get_value_string(ctrl_type_vals, cmd->type), osmo_escape_str(tmp, -1)); cmd->type = CTRL_TYPE_ERROR; -- To view, visit https://gerrit.osmocom.org/9977 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I564ab1a7e845388f87accda44fbf165e5adc2480 Gerrit-Change-Number: 9977 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:48:23 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Jul 2018 18:48:23 +0000 Subject: Change in openbsc[master]: nat: ctrl: use strtol instead of atoi as it has explicit error docume... In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9979 to look at the new patch set (#3). Change subject: nat: ctrl: use strtol instead of atoi as it has explicit error documentation ...................................................................... nat: ctrl: use strtol instead of atoi as it has explicit error documentation In some cases id can be non-digit such as "err" for ERROR cmds generated from parsing failures. Change-Id: Ief0b203efbcf2be04253b5056840be94d58a9994 --- M openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c 1 file changed, 13 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/79/9979/3 -- To view, visit https://gerrit.osmocom.org/9979 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ief0b203efbcf2be04253b5056840be94d58a9994 Gerrit-Change-Number: 9979 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:52:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 12 Jul 2018 18:52:29 +0000 Subject: Change in libosmocore[master]: rate_ctr: Improve logging In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9753 ) Change subject: rate_ctr: Improve logging ...................................................................... Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/9753/3//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/9753/3//COMMIT_MSG at 10 PS3, Line 10: rate_ctr groups made it difficult to debug when an issue occurrs. can you elaborate here in the commitlog? I see what your patch is doing, but I fail to understand why. The "quiet" logic was introduced in order to not splatter the log files with messages about mangled counter names in "normal" use cases. -- To view, visit https://gerrit.osmocom.org/9753 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I992d165cab5ee6ca9b5b7e4a2210a0951954bd34 Gerrit-Change-Number: 9753 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Harald Welte Gerrit-Comment-Date: Thu, 12 Jul 2018 18:52:29 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:53:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 12 Jul 2018 18:53:29 +0000 Subject: Change in osmo-bsc[master]: call osmo_xua_msg_tall_ctx_init() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9955 ) Change subject: call osmo_xua_msg_tall_ctx_init() ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9955 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8d5edda17be82e0cb4a1af3e2a62cbcb3a2ddda3 Gerrit-Change-Number: 9955 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 12 Jul 2018 18:53:29 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:53:38 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 12 Jul 2018 18:53:38 +0000 Subject: Change in libosmo-sccp[master]: add osmo_xua_msg_tall_ctx_init() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9953 ) Change subject: add osmo_xua_msg_tall_ctx_init() ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9953 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I618878680a096a7f7fc2d83098590f2e4cb08870 Gerrit-Change-Number: 9953 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 12 Jul 2018 18:53:38 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:53:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 12 Jul 2018 18:53:54 +0000 Subject: Change in libosmo-sccp[master]: add osmo_xua_msg_tall_ctx_init() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9953 ) Change subject: add osmo_xua_msg_tall_ctx_init() ...................................................................... add osmo_xua_msg_tall_ctx_init() So far the tall_xua ctx used to allocate from in xua_msg_alloc() was never initialized, actually hiding memory leaks from the talloc report. Add this API to allow branching the xua_msg ctx off a sane root ctx. Explicitly initialize tall_xua to NULL, so that, if xua_msg_ctx_init() isn't called, tall_xua is still guaranteed to not be a random pointer. osmo-bsc will use this function to hook the tall_xua ctx to osmo-bsc's own root ctx. Change-Id: I618878680a096a7f7fc2d83098590f2e4cb08870 --- M include/osmocom/sigtran/xua_msg.h M src/xua_msg.c 2 files changed, 9 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/sigtran/xua_msg.h b/include/osmocom/sigtran/xua_msg.h index 423adbc..e912e02 100644 --- a/include/osmocom/sigtran/xua_msg.h +++ b/include/osmocom/sigtran/xua_msg.h @@ -69,6 +69,8 @@ extern const struct xua_dialect xua_dialect_sua; extern const struct xua_dialect xua_dialect_m3ua; +void osmo_xua_msg_tall_ctx_init(void *ctx); + struct xua_msg *xua_msg_alloc(void); void xua_msg_free(struct xua_msg *msg); diff --git a/src/xua_msg.c b/src/xua_msg.c index d56009f..ed0cdc7 100644 --- a/src/xua_msg.c +++ b/src/xua_msg.c @@ -33,7 +33,13 @@ #include #include -static void *tall_xua; +static void *tall_xua = NULL; + +/* Allocate the root talloc context used for xua_msg_alloc(). */ +void osmo_xua_msg_tall_ctx_init(void *ctx) +{ + tall_xua = talloc_named_const(ctx, 0, "xua_msg"); +} struct xua_msg *xua_msg_alloc(void) { -- To view, visit https://gerrit.osmocom.org/9953 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I618878680a096a7f7fc2d83098590f2e4cb08870 Gerrit-Change-Number: 9953 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:53:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 12 Jul 2018 18:53:55 +0000 Subject: Change in libosmo-sccp[master]: fix two memleaks in ipa_rx_msg_sccp() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9956 ) Change subject: fix two memleaks in ipa_rx_msg_sccp() ...................................................................... fix two memleaks in ipa_rx_msg_sccp() 1: Do not call xua_msg_alloc() which is later bluntly overwritten by m3ua_xfer_from_data(). 2: After dispatching to m3ua_hmdc_rx_from_l2(), call xua_msg_free(). Related: OS#3393 Change-Id: I0918f9bbc15b036619f1c25a133b69819b2a30fa --- M src/ipa.c 1 file changed, 5 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/src/ipa.c b/src/ipa.c index e15b1d8..f3a7a52 100644 --- a/src/ipa.c +++ b/src/ipa.c @@ -202,8 +202,9 @@ static int ipa_rx_msg_sccp(struct osmo_ss7_asp *asp, struct msgb *msg) { + int rc; struct m3ua_data_hdr data_hdr; - struct xua_msg *xua = xua_msg_alloc(); + struct xua_msg *xua; struct osmo_ss7_as *as = find_as_for_asp(asp); uint32_t opc, dpc; @@ -263,7 +264,9 @@ m3ua_dh_to_xfer_param(&xua->mtp, &data_hdr); /* Pass on as if we had received it from an M3UA ASP */ - return m3ua_hmdc_rx_from_l2(asp->inst, xua); + rc = m3ua_hmdc_rx_from_l2(asp->inst, xua); + xua_msg_free(xua); + return rc; } /*! \brief process M3UA message received from socket -- To view, visit https://gerrit.osmocom.org/9956 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I0918f9bbc15b036619f1c25a133b69819b2a30fa Gerrit-Change-Number: 9956 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:55:00 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 12 Jul 2018 18:55:00 +0000 Subject: Change in libosmo-sccp[master]: comment: explain xua_msg free in m3ua_rx_xfer() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9958 ) Change subject: comment: explain xua_msg free in m3ua_rx_xfer() ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9958 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6211c8809eefeb94289c4c497553561b043ee619 Gerrit-Change-Number: 9958 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 12 Jul 2018 18:55:00 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 18:58:29 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Jul 2018 18:58:29 +0000 Subject: Change in libosmocore[master]: gsm0808: Add value_string for encryption algorithms In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9901 to look at the new patch set (#3). Change subject: gsm0808: Add value_string for encryption algorithms ...................................................................... gsm0808: Add value_string for encryption algorithms Change-Id: Iadf6460c438d02c53c2eaa9e42d51844ad28859a --- M include/osmocom/gsm/protocol/gsm_08_08.h M src/gsm/gsm0808.c M src/gsm/libosmogsm.map 3 files changed, 14 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/01/9901/3 -- To view, visit https://gerrit.osmocom.org/9901 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iadf6460c438d02c53c2eaa9e42d51844ad28859a Gerrit-Change-Number: 9901 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 19:03:10 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Jul 2018 19:03:10 +0000 Subject: Change in openbsc[master]: nat: ctrl: Use ctrl_cmd_parse2 to obtain detailed error In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/9973 ) Change subject: nat: ctrl: Use ctrl_cmd_parse2 to obtain detailed error ...................................................................... nat: ctrl: Use ctrl_cmd_parse2 to obtain detailed error Instead of always logging/sending same error, use the new ctrl_cmd_parse2 API which always returns a cmd structure with a specific error description. Change-Id: I6ef2b6e309632ed9cb296e8a1e71f879007a36ae --- M openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c 1 file changed, 2 insertions(+), 11 deletions(-) Approvals: Jenkins Builder: Verified Neels Hofmeyr: Looks good to me, approved diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c b/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c index 61ac887..af110a2 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c @@ -103,20 +103,11 @@ struct bsc_cmd_list *pending; char *var; - cmd = ctrl_cmd_parse(bsc, msg); + cmd = ctrl_cmd_parse2(bsc, msg); msgb_free(msg); - if (!cmd) { - cmd = talloc_zero(bsc, struct ctrl_cmd); - if (!cmd) { - LOGP(DNAT, LOGL_ERROR, "OOM!\n"); - return -ENOMEM; - } - cmd->type = CTRL_TYPE_ERROR; - cmd->id = "err"; - cmd->reply = "Failed to parse command."; + if (cmd->type == CTRL_TYPE_ERROR) goto err; - } if (bsc->cfg && !llist_empty(&bsc->cfg->lac_list)) { if (cmd->variable) { -- To view, visit https://gerrit.osmocom.org/9973 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I6ef2b6e309632ed9cb296e8a1e71f879007a36ae Gerrit-Change-Number: 9973 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 12 19:03:11 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 12 Jul 2018 19:03:11 +0000 Subject: Change in openbsc[master]: bsc: ctrl: Use ctrl_cmd_parse2 to obtain detailed error In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/9974 ) Change subject: bsc: ctrl: Use ctrl_cmd_parse2 to obtain detailed error ...................................................................... bsc: ctrl: Use ctrl_cmd_parse2 to obtain detailed error Instead of always logging/sending same error, use the new ctrl_cmd_parse2 API which always returns a cmd structure with a specific error description. Change-Id: Ie111bec46b664768fe3c3feff906f91e8ee8b1d4 --- M openbsc/src/osmo-bsc/osmo_bsc_msc.c 1 file changed, 2 insertions(+), 10 deletions(-) Approvals: Jenkins Builder: Verified Neels Hofmeyr: Looks good to me, approved diff --git a/openbsc/src/osmo-bsc/osmo_bsc_msc.c b/openbsc/src/osmo-bsc/osmo_bsc_msc.c index b2f8806..4395c3b 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_msc.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_msc.c @@ -225,17 +225,9 @@ int ret; struct ctrl_cmd *cmd; - cmd = ctrl_cmd_parse(msc->msc_con, msg); - if (!cmd) { + cmd = ctrl_cmd_parse2(msc->msc_con, msg); + if (cmd->type == CTRL_TYPE_ERROR) { LOGP(DMSC, LOGL_ERROR, "Failed to parse control message.\n"); - cmd = talloc_zero(msc->msc_con, struct ctrl_cmd); - if (!cmd) { - LOGP(DMSC, LOGL_ERROR, "OOM!\n"); - return; - } - cmd->type = CTRL_TYPE_ERROR; - cmd->id = "err"; - cmd->reply = "Failed to parse control message."; ctrl_cmd_send(&msc->msc_con->write_queue, cmd); talloc_free(cmd); -- To view, visit https://gerrit.osmocom.org/9974 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ie111bec46b664768fe3c3feff906f91e8ee8b1d4 Gerrit-Change-Number: 9974 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 04:59:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Jul 2018 04:59:27 +0000 Subject: Change in libosmocore[master]: gsm0808: Add value_string for encryption algorithms In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9901 ) Change subject: gsm0808: Add value_string for encryption algorithms ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9901 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iadf6460c438d02c53c2eaa9e42d51844ad28859a Gerrit-Change-Number: 9901 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Fri, 13 Jul 2018 04:59:27 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 05:01:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Jul 2018 05:01:28 +0000 Subject: Change in openbsc[master]: nat: ctrl: use strtol instead of atoi as it has explicit error docume... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9979 ) Change subject: nat: ctrl: use strtol instead of atoi as it has explicit error documentation ...................................................................... Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/9979 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ief0b203efbcf2be04253b5056840be94d58a9994 Gerrit-Change-Number: 9979 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 13 Jul 2018 05:01:28 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 05:01:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Jul 2018 05:01:46 +0000 Subject: Change in openbsc[master]: nat: ctrl: Avoid sending back received ERROR msgs In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9980 ) Change subject: nat: ctrl: Avoid sending back received ERROR msgs ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9980 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7b4d20aea7a16c4b4e5add7c274a4ed34a7f6b8d Gerrit-Change-Number: 9980 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 13 Jul 2018 05:01:46 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 05:02:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Jul 2018 05:02:08 +0000 Subject: Change in openbsc[master]: bsc: ctrl: Avoid sending back received ERROR msgs In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9981 ) Change subject: bsc: ctrl: Avoid sending back received ERROR msgs ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9981 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib5963e4d15a4a6b077d7a97fbbde6e5134c77e9a Gerrit-Change-Number: 9981 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 13 Jul 2018 05:02:08 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 05:06:03 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Jul 2018 05:06:03 +0000 Subject: Change in libosmocore[master]: ctrl: Introduce ctrl_cmd_parse3 API In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9978 ) Change subject: ctrl: Introduce ctrl_cmd_parse3 API ...................................................................... Patch Set 2: I'm not sure if the API shouldn't be redesigned completely. The entire idea of returning an ERROR cmd on a parse error seems like it's mixing two independent tasks: parsing the message + generating an error message on parser error. I think a clean API would separate those two, e.g. by returning an parser error code (as integer), which then can be used by another function to generate an error message, if so desired. What do you think? -- To view, visit https://gerrit.osmocom.org/9978 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ide9170e5c31967c353f8fe4e8227e64130b91eae Gerrit-Change-Number: 9978 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Harald Welte Gerrit-Comment-Date: Fri, 13 Jul 2018 05:06:03 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 05:06:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Jul 2018 05:06:23 +0000 Subject: Change in libosmocore[master]: ctrl: ctrl_handle_msg: Avoid sending back received ERROR msgs In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9983 ) Change subject: ctrl: ctrl_handle_msg: Avoid sending back received ERROR msgs ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/9983 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I396fd1e7548beea31b2b7aa9f764edb765b02941 Gerrit-Change-Number: 9983 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Fri, 13 Jul 2018 05:06:23 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 05:06:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Jul 2018 05:06:29 +0000 Subject: Change in libosmocore[master]: tests: ctrl: Test received ERROR messages are handled correctly In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9984 ) Change subject: tests: ctrl: Test received ERROR messages are handled correctly ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/9984 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3c8e95aaa1ca222d4cd1395e548f8461bf9d4cd6 Gerrit-Change-Number: 9984 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Fri, 13 Jul 2018 05:06:29 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 05:07:03 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Jul 2018 05:07:03 +0000 Subject: Change in python/osmo-python-tests[master]: Introduce script ctrl2cgi.py In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9963 ) Change subject: Introduce script ctrl2cgi.py ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9963 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7a83ecb379835e295c8cb4c27c39883783746544 Gerrit-Change-Number: 9963 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Fri, 13 Jul 2018 05:07:03 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 05:15:25 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Jul 2018 05:15:25 +0000 Subject: Change in simtrace2[master]: sniff: add checksum verification for ATR and PPS In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9966 ) Change subject: sniff: add checksum verification for ATR and PPS ...................................................................... Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9966 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I277868267c3199eea216ab47bdd09fb2fb944b06 Gerrit-Change-Number: 9966 Gerrit-PatchSet: 6 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Fri, 13 Jul 2018 05:15:25 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 05:15:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Jul 2018 05:15:28 +0000 Subject: Change in simtrace2[master]: sniff: add checksum verification for ATR and PPS In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9966 ) Change subject: sniff: add checksum verification for ATR and PPS ...................................................................... sniff: add checksum verification for ATR and PPS a checksum error is only signaled in the USB message with the corresponding flag. Change-Id: I277868267c3199eea216ab47bdd09fb2fb944b06 --- M firmware/libcommon/include/simtrace_prot.h M firmware/libcommon/source/sniffer.c M host/simtrace2-sniff.c 3 files changed, 28 insertions(+), 3 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libcommon/include/simtrace_prot.h b/firmware/libcommon/include/simtrace_prot.h index f1f736b..58e51be 100644 --- a/firmware/libcommon/include/simtrace_prot.h +++ b/firmware/libcommon/include/simtrace_prot.h @@ -297,6 +297,7 @@ /* SIMTRACE_MSGT_SNIFF_ATR, SIMTRACE_MSGT_SNIFF_PPS, SIMTRACE_MSGT_SNIFF_TPDU flags */ #define SNIFF_DATA_FLAG_ERROR_INCOMPLETE (1<<5) #define SNIFF_DATA_FLAG_ERROR_MALFORMED (1<<6) +#define SNIFF_DATA_FLAG_ERROR_CHECKSUM (1<<7) /* SIMTRACE_MSGT_SNIFF_CHANGE */ struct sniff_change { diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index c58b047..f99c25a 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -394,6 +394,7 @@ static uint8_t atr_hist_len = 0; /* store the number of expected historical bytes */ static uint8_t y = 0; /* last mask of the upcoming TA, TB, TC, TD interface bytes */ static uint8_t i = 0; /* interface byte subgroup number */ + static uint32_t flags = 0; /* error flag */ /* sanity check */ if (ISO7816_S_IN_ATR != iso_state) { @@ -411,6 +412,7 @@ /* handle ATR byte depending on current state */ switch (atr_state) { case ATR_S_WAIT_TS: /* see ISO/IEC 7816-3:2006 section 8.1 */ + flags = 0; switch (byte) { case 0x23: /* direct convention used, but decoded using inverse convention (a parity error should also have occurred) */ case 0x30: /* inverse convention used, but decoded using direct convention (a parity error should also have occurred) */ @@ -480,8 +482,21 @@ break; } case ATR_S_WAIT_TCK: /* see ISO/IEC 7816-3:2006 section 8.2.5 */ - /* we could verify the checksum, but we are just here to sniff */ - usb_send_atr(0); /* send ATR to host software using USB */ + /* verify checksum if present */ + if (ATR_S_WAIT_TCK == atr_state) { + uint8_t ui; + uint8_t checksum = 0; + for (ui = 1; ui < atr_i; atr_i++) { + checksum ^= atr[ui]; + } + if (checksum) { + flags |= SNIFF_DATA_FLAG_ERROR_CHECKSUM; + /* We still consider the data as valid (e.g. for WT) even is the checksum is wrong. + * It is up to the reader to handle this error (e.g. by resetting) + */ + } + } + usb_send_atr(flags); /* send ATR to host software using USB */ change_state(ISO7816_S_WAIT_TPDU); /* go to next state */ break; default: @@ -551,6 +566,7 @@ static void process_byte_pps(uint8_t byte) { uint8_t *pps_cur; /* current PPS (request or response) */ + static uint32_t flags = 0; /* error flag */ /* sanity check */ if (ISO7816_S_IN_PPS_REQ == iso_state) { @@ -565,6 +581,7 @@ /* handle PPS byte depending on current state */ switch (pps_state) { /* see ISO/IEC 7816-3:2006 section 9.2 */ case PPS_S_WAIT_PPSS: /*!< initial byte */ + flags = 0; if (0xff) { pps_cur[0] = byte; pps_state = PPS_S_WAIT_PPS0; /* go to next state */ @@ -613,8 +630,11 @@ check ^= pps_cur[4]; } check ^= pps_cur[5]; + if (check) { + flags |= SNIFF_DATA_FLAG_ERROR_CHECKSUM; + } pps_state = PPS_S_WAIT_END; - usb_send_pps(0); /* send PPS to host software using USB */ + usb_send_pps(flags); /* send PPS to host software using USB */ if (ISO7816_S_IN_PPS_REQ == iso_state) { if (0 == check) { /* checksum is valid */ change_state(ISO7816_S_WAIT_PPS_RSP); /* go to next state */ diff --git a/host/simtrace2-sniff.c b/host/simtrace2-sniff.c index efb986f..776253a 100644 --- a/host/simtrace2-sniff.c +++ b/host/simtrace2-sniff.c @@ -134,6 +134,10 @@ .value = 0, .str = NULL, }, + { + .value = SNIFF_DATA_FLAG_ERROR_CHECKSUM, + .str = "checksum error", + }, }; static void print_flags(const struct value_string* flag_meanings, uint32_t nb_flags, uint32_t flags) { -- To view, visit https://gerrit.osmocom.org/9966 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I277868267c3199eea216ab47bdd09fb2fb944b06 Gerrit-Change-Number: 9966 Gerrit-PatchSet: 6 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 05:24:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Jul 2018 05:24:20 +0000 Subject: Change in osmo-gsm-tester[master]: ms: Quit early when all tests concluded.. In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9716 ) Change subject: ms: Quit early when all tests concluded.. ...................................................................... Patch Set 3: @pespin: Please review the latest version of this patch. Your review is wat's holding back all 5 pending patches. thanks! -- To view, visit https://gerrit.osmocom.org/9716 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3575ee7618c35e3b66d25fa31844d267489d9179 Gerrit-Change-Number: 9716 Gerrit-PatchSet: 3 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 13 Jul 2018 05:24:20 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 05:25:40 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Jul 2018 05:25:40 +0000 Subject: Change in osmo-sgsn[master]: sgsn_libgtp.c: Log pointer of deleted context In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9932 ) Change subject: sgsn_libgtp.c: Log pointer of deleted context ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9932 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8a4627b54090e72f86a9c5a781670be52522062b Gerrit-Change-Number: 9932 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Fri, 13 Jul 2018 05:25:40 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 05:27:58 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Jul 2018 05:27:58 +0000 Subject: Change in osmo-sgsn[master]: Maintain per ggsn pdp ctx list In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9933 ) Change subject: Maintain per ggsn pdp ctx list ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/9933/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/9933/1//COMMIT_MSG at 10 PS1, Line 10: some scenarios care to elaborate here? The only scenario visible from the patch is the "delete all PDP contexts for one GGSN" which is a rather rare use case in normal operation, i.e. nothing that I think makes sense to optimize for. -- To view, visit https://gerrit.osmocom.org/9933 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3bbcc0883df2bf1290ba8d4bd70db8baa494087a Gerrit-Change-Number: 9933 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Harald Welte Gerrit-Comment-Date: Fri, 13 Jul 2018 05:27:58 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 05:32:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Jul 2018 05:32:53 +0000 Subject: Change in osmo-sgsn[master]: osmo-sgsn: ping GGSN periodically and check for restart counter In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9934 ) Change subject: osmo-sgsn: ping GGSN periodically and check for restart counter ...................................................................... Patch Set 2: (3 comments) https://gerrit.osmocom.org/#/c/9934/2/include/osmocom/sgsn/gprs_sgsn.h File include/osmocom/sgsn/gprs_sgsn.h: https://gerrit.osmocom.org/#/c/9934/2/include/osmocom/sgsn/gprs_sgsn.h at 357 PS2, Line 357: int32_t echo_interval; I would just use an "int" here, as this is what osmo_timer_schedule() uses https://gerrit.osmocom.org/#/c/9934/2/src/gprs/gprs_sgsn.c File src/gprs/gprs_sgsn.c: https://gerrit.osmocom.org/#/c/9934/2/src/gprs/gprs_sgsn.c at 736 PS2, Line 736: osmo_timer_schedule(&ggc->echo_timer, ggc->echo_interval, 0); is this some gerrit visualization issue or is there one tab too much? https://gerrit.osmocom.org/#/c/9934/2/src/gprs/gprs_sgsn.c at 743 PS2, Line 743: osmo_timer_del(&ggc->echo_timer); same as above -- To view, visit https://gerrit.osmocom.org/9934 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9d714726785407859f26bbef052cd0efc28e8dae Gerrit-Change-Number: 9934 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Harald Welte Gerrit-Comment-Date: Fri, 13 Jul 2018 05:32:53 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 07:08:47 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 13 Jul 2018 07:08:47 +0000 Subject: Change in pysim[master]: cards: add update method for EF:PLMNsel to Card class In-Reply-To: References: Message-ID: dexter has posted comments on this change. ( https://gerrit.osmocom.org/9970 ) Change subject: cards: add update method for EF:PLMNsel to Card class ...................................................................... Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/9970 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I832f7bef70c92dc101b94ad871b6cafaa626e134 Gerrit-Change-Number: 9970 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: daniel Gerrit-Reviewer: dexter Gerrit-Comment-Date: Fri, 13 Jul 2018 07:08:47 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 07:08:50 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 13 Jul 2018 07:08:50 +0000 Subject: Change in pysim[master]: cards: add update method for EF:PLMNsel to Card class In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. ( https://gerrit.osmocom.org/9970 ) Change subject: cards: add update method for EF:PLMNsel to Card class ...................................................................... cards: add update method for EF:PLMNsel to Card class The Card class offers update methods for various EF, but for PLMNsel there is no update method available yet. Lets add one. Change-Id: I832f7bef70c92dc101b94ad871b6cafaa626e134 Related: SYS#4245 --- M pySim/cards.py 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved dexter: Verified diff --git a/pySim/cards.py b/pySim/cards.py index 0c9c2b8..3577d8d 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -83,6 +83,12 @@ data, sw = self._scc.update_binary(EF['HPLMNwAcT'], content + 'ffffff0000' * (size/5-1)) return sw + def update_plmnsel(self, mcc, mnc): + data = self._scc.read_binary(EF['PLMNsel'], length=None, offset=0) + size = len(data[0])/2 + hplmn = enc_plmn(mcc, mnc) + self._scc.update_binary(EF['PLMNsel'], hplmn + 'ff' * (size-3)) + def update_smsp(self, smsp): data, sw = self._scc.update_record(EF['SMSP'], 1, rpad(smsp, 84)) return sw -- To view, visit https://gerrit.osmocom.org/9970 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I832f7bef70c92dc101b94ad871b6cafaa626e134 Gerrit-Change-Number: 9970 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: daniel Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 08:50:32 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 13 Jul 2018 08:50:32 +0000 Subject: Change in pysim[master]: cosmetic: fix excess space in log output (typo) In-Reply-To: References: Message-ID: dexter has posted comments on this change. ( https://gerrit.osmocom.org/9967 ) Change subject: cosmetic: fix excess space in log output (typo) ...................................................................... Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/9967 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I33f9b8c803ccd185ffa370d235363423d82ba9c7 Gerrit-Change-Number: 9967 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: dexter Gerrit-Comment-Date: Fri, 13 Jul 2018 08:50:32 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 08:50:33 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 13 Jul 2018 08:50:33 +0000 Subject: Change in pysim[master]: cosmetic: fix excess space in log output (typo) In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. ( https://gerrit.osmocom.org/9967 ) Change subject: cosmetic: fix excess space in log output (typo) ...................................................................... cosmetic: fix excess space in log output (typo) There shouldn't be a space between the end of a sentence and a punctuation mark. Change-Id: I33f9b8c803ccd185ffa370d235363423d82ba9c7 --- M pySim/transport/__init__.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved dexter: Verified diff --git a/pySim/transport/__init__.py b/pySim/transport/__init__.py index 9cd23d0..4b932cd 100644 --- a/pySim/transport/__init__.py +++ b/pySim/transport/__init__.py @@ -101,5 +101,5 @@ sw_masked = sw_masked + rv[1][i].lower() if sw.lower() != sw_masked: - raise RuntimeError("SW match failed ! Expected %s and got %s." % (sw.lower(), rv[1])) + raise RuntimeError("SW match failed! Expected %s and got %s." % (sw.lower(), rv[1])) return rv -- To view, visit https://gerrit.osmocom.org/9967 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I33f9b8c803ccd185ffa370d235363423d82ba9c7 Gerrit-Change-Number: 9967 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 08:56:41 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 13 Jul 2018 08:56:41 +0000 Subject: Change in pysim[master]: pySim-read: Print exception when reading of EF.MSISDN fails In-Reply-To: References: Message-ID: dexter has posted comments on this change. ( https://gerrit.osmocom.org/9968 ) Change subject: pySim-read: Print exception when reading of EF.MSISDN fails ...................................................................... Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/9968 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Icb30470b1c0eee6a15fc028da820e92bf9ded27a Gerrit-Change-Number: 9968 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: dexter Gerrit-Comment-Date: Fri, 13 Jul 2018 08:56:41 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 08:56:58 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 13 Jul 2018 08:56:58 +0000 Subject: Change in pysim[master]: pySim-read: Print exception when reading of EF.MSISDN fails In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. ( https://gerrit.osmocom.org/9968 ) Change subject: pySim-read: Print exception when reading of EF.MSISDN fails ...................................................................... pySim-read: Print exception when reading of EF.MSISDN fails At the moment the exception is catched, but there is only a vague error message printed. However, the exception string usually tells us the status word, so it is very valuable to see it. Lets make sure that the exception string is printed here. Change-Id: Icb30470b1c0eee6a15fc028da820e92bf9ded27a --- M pySim-read.py 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved dexter: Verified diff --git a/pySim-read.py b/pySim-read.py index 5ca39ee..f55b256 100755 --- a/pySim-read.py +++ b/pySim-read.py @@ -134,8 +134,8 @@ print("MSISDN: Not available") else: print("MSISDN: Can't read, response code = %s" % (sw,)) - except: - print "MSISDN: Can't read. Probably not existing file" + except Exception as e: + print "MSISDN: Can't read file -- " + str(e) # Done for this card and maybe for everything ? print "Done !\n" -- To view, visit https://gerrit.osmocom.org/9968 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Icb30470b1c0eee6a15fc028da820e92bf9ded27a Gerrit-Change-Number: 9968 Gerrit-PatchSet: 3 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 08:57:18 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 13 Jul 2018 08:57:18 +0000 Subject: Change in pysim[master]: pySim-read: read contents of PLMN related files. In-Reply-To: References: Message-ID: dexter has posted comments on this change. ( https://gerrit.osmocom.org/9969 ) Change subject: pySim-read: read contents of PLMN related files. ...................................................................... Patch Set 3: Verified+1 -- To view, visit https://gerrit.osmocom.org/9969 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ice802033adfa6fc1bccc76da47495eb29c3aef6c Gerrit-Change-Number: 9969 Gerrit-PatchSet: 3 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: dexter Gerrit-Comment-Date: Fri, 13 Jul 2018 08:57:18 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 08:57:20 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 13 Jul 2018 08:57:20 +0000 Subject: Change in pysim[master]: pySim-read: read contents of PLMN related files. In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. ( https://gerrit.osmocom.org/9969 ) Change subject: pySim-read: read contents of PLMN related files. ...................................................................... pySim-read: read contents of PLMN related files. The files EF.PLMNsel, EF.PLMNwAcT, EF.OPLMNwAcT, EF.HPLMNAcT are not yet printed by pysim-read. Lets add support for those files. Change-Id: Ice802033adfa6fc1bccc76da47495eb29c3aef6c Related: SYS#4245 --- M pySim-read.py 1 file changed, 40 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved dexter: Verified diff --git a/pySim-read.py b/pySim-read.py index f55b256..e807e3e 100755 --- a/pySim-read.py +++ b/pySim-read.py @@ -28,6 +28,7 @@ import random import re import sys +from pySim.ts_51_011 import EF, DF try: import json @@ -107,14 +108,45 @@ else: print("SMSP: Can't read, response code = %s" % (sw,)) - # EF.HPLMN -# (res, sw) = scc.read_binary(['3f00', '7f20', '6f30']) -# if sw == '9000': -# print("HPLMN: %s" % (res)) -# print("HPLMN: %s" % (dec_hplmn(res),)) -# else: -# print("HPLMN: Can't read, response code = %s" % (sw,)) - # FIXME + # EF.PLMNsel + try: + (res, sw) = scc.read_binary(EF['PLMNsel']) + if sw == '9000': + print("PLMNsel: %s" % (res)) + else: + print("PLMNsel: Can't read, response code = %s" % (sw,)) + except Exception as e: + print "HPLMNAcT: Can't read file -- " + str(e) + + # EF.PLMNwAcT + try: + (res, sw) = scc.read_binary(EF['PLMNwAcT']) + if sw == '9000': + print("PLMNwAcT: %s" % (res)) + else: + print("PLMNwAcT: Can't read, response code = %s" % (sw,)) + except Exception as e: + print "PLMNwAcT: Can't read file -- " + str(e) + + # EF.OPLMNwAcT + try: + (res, sw) = scc.read_binary(EF['OPLMNwAcT']) + if sw == '9000': + print("OPLMNwAcT: %s" % (res)) + else: + print("OPLMNwAcT: Can't read, response code = %s" % (sw,)) + except Exception as e: + print "OPLMNwAcT: Can't read file -- " + str(e) + + # EF.HPLMNAcT + try: + (res, sw) = scc.read_binary(EF['HPLMNAcT']) + if sw == '9000': + print("HPLMNAcT: %s" % (res)) + else: + print("HPLMNAcT: Can't read, response code = %s" % (sw,)) + except Exception as e: + print "HPLMNAcT: Can't read file -- " + str(e) # EF.ACC (res, sw) = scc.read_binary(['3f00', '7f20', '6f78']) -- To view, visit https://gerrit.osmocom.org/9969 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ice802033adfa6fc1bccc76da47495eb29c3aef6c Gerrit-Change-Number: 9969 Gerrit-PatchSet: 4 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 09:33:11 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 13 Jul 2018 09:33:11 +0000 Subject: Change in libosmocore[master]: gsm0808: Add value_string for encryption algorithms In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/9901 ) Change subject: gsm0808: Add value_string for encryption algorithms ...................................................................... gsm0808: Add value_string for encryption algorithms Change-Id: Iadf6460c438d02c53c2eaa9e42d51844ad28859a --- M include/osmocom/gsm/protocol/gsm_08_08.h M src/gsm/gsm0808.c M src/gsm/libosmogsm.map 3 files changed, 14 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h index bd5705f..69007b5 100644 --- a/include/osmocom/gsm/protocol/gsm_08_08.h +++ b/include/osmocom/gsm/protocol/gsm_08_08.h @@ -463,6 +463,7 @@ GSM0808_ALG_ID_A5_6 = 0x07, GSM0808_ALG_ID_A5_7 = 0x08, }; +extern const struct value_string gsm0808_chosen_enc_alg_names[]; /* GSM 08.08 3.2.2.85 Paging Information */ enum gsm0808_paging_info { diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c index a26addd..a90aa22 100644 --- a/src/gsm/gsm0808.c +++ b/src/gsm/gsm0808.c @@ -1167,6 +1167,18 @@ { 0, NULL } }; +const struct value_string gsm0808_chosen_enc_alg_names[] = { + { GSM0808_ALG_ID_A5_0, "A5/0" }, + { GSM0808_ALG_ID_A5_1, "A5/1" }, + { GSM0808_ALG_ID_A5_2, "A5/2" }, + { GSM0808_ALG_ID_A5_3, "A5/3" }, + { GSM0808_ALG_ID_A5_4, "A5/4" }, + { GSM0808_ALG_ID_A5_5, "A5/5" }, + { GSM0808_ALG_ID_A5_6, "A5/6" }, + { GSM0808_ALG_ID_A5_7, "A5/7" }, + { 0, NULL } +}; + static const struct value_string gsm0808_cause_names[] = { { GSM0808_CAUSE_RADIO_INTERFACE_MESSAGE_FAILURE, "RADIO INTERFACE MESSAGE FAILURE" }, { GSM0808_CAUSE_RADIO_INTERFACE_FAILURE, "RADIO INTERFACE FAILURE" }, diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 5eed5b5..3b403c2 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -202,6 +202,7 @@ gsm0808_speech_codec_from_chan_type; gsm0808_speech_codec_type_names; gsm0808_permitted_speech_names; +gsm0808_chosen_enc_alg_names; gsm0808_channel_type_name; gsm0808_lcls_config_names; gsm0808_lcls_control_names; -- To view, visit https://gerrit.osmocom.org/9901 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iadf6460c438d02c53c2eaa9e42d51844ad28859a Gerrit-Change-Number: 9901 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 09:36:17 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 13 Jul 2018 09:36:17 +0000 Subject: Change in python/osmo-python-tests[master]: Introduce script ctrl2cgi.py In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/9963 ) Change subject: Introduce script ctrl2cgi.py ...................................................................... Introduce script ctrl2cgi.py This scripts implements a similar proxy to the one already available in soapy.py, but aiming at converting CTRl into a regular HTTP POST Request to be handled by a CGI script in the HTTP server. Furthermore, it includes several improvements over the soapy.py script, such as using a token to authenticate users and capability to read some parameters from a cfg file. Change-Id: I7a83ecb379835e295c8cb4c27c39883783746544 --- M README A scripts/ctrl2cgi.py M setup.py 3 files changed, 249 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/README b/README index 2c04047..37cd847 100644 --- a/README +++ b/README @@ -9,6 +9,7 @@ There are currently following scripts in this package: osmotestconfig.py - test that apps start/write with example configs soap.py - implementation of SOAP <-> Ctrl proxy implemented on top of Twisted +ctrl2cgi.py - implementation of CGI <-> Ctrl proxy implemented on top of Twisted osmo_rate_ctr2csv.py - rate counter dumper on top of osmo_ipa osmo_interact_vty.py - pipe stdin/stdout to a VTY session osmo_interact_ctrl.py - pipe stdin/stdout to a CTRL port diff --git a/scripts/ctrl2cgi.py b/scripts/ctrl2cgi.py new file mode 100755 index 0000000..6be36c4 --- /dev/null +++ b/scripts/ctrl2cgi.py @@ -0,0 +1,247 @@ +#!/usr/bin/python3 +# -*- mode: python-mode; py-indent-tabs-mode: nil -*- +""" +/* + * Copyright (C) 2018 sysmocom s.f.m.c. GmbH + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +""" + +__version__ = "0.0.1" # bump this on every non-trivial change + +from twisted.internet import defer, reactor +from osmopy.twisted_ipa import CTRL, IPAFactory, __version__ as twisted_ipa_version +from osmopy.osmo_ipa import Ctrl +from treq import post, collect +from functools import partial +from distutils.version import StrictVersion as V # FIXME: use NormalizedVersion from PEP-386 when available +import argparse, datetime, signal, sys, os, logging, logging.handlers +import hashlib +import json +import configparser + +# we don't support older versions of TwistedIPA module +assert V(twisted_ipa_version) > V('0.4') + +# keys from OpenBSC openbsc/src/libbsc/bsc_rf_ctrl.c, values CGI-specific +oper = { 'inoperational' : 0, 'operational' : 1 } +admin = { 'locked' : 0, 'unlocked' : 1 } +policy = { 'off' : 0, 'on' : 1, 'grace' : 2, 'unknown' : 3 } + +# keys from OpenBSC openbsc/src/libbsc/bsc_vty.c +fix = { 'invalid' : 0, 'fix2d' : 1, 'fix3d' : 1 } # CGI server treats it as boolean but expects int + +def patch_cgi_resp(r): + str = r.decode('utf-8') + lines = str.splitlines() + i = 0 + #search for empty line, marks start of body + for l in lines: + i += 1 + if l == '': + break + print('i="%r"' % i) + json_lines = lines[i:] + json_str = '\n'.join(json_lines) + return json.loads(json_str) + + at defer.inlineCallbacks +def handle_reply(f, log, resp): + """ + Reply handler: process raw CGI server response, function f to run for each command + """ + #log.debug('HANDLE_REPLY: code=%r' % (resp.code)) + #for key,val in resp.headers.getAllRawHeaders(): + # log.debug('HANDLE_REPLY: key=%r val=%r' % (key, val)) + if resp.code != 200: + resp_body = yield resp.text() + log.critical('Received HTTP response %d: %s' % (resp.code, resp_body)) + return + + parsed = yield resp.json() + #log.debug("RESPONSE: %r" % (parsed)) + bsc_id = parsed.get('commands')[0].split()[0].split('.')[3] # we expect 1st command to have net.0.bsc.666.bts.2.trx.1 location prefix format + log.info("Received CGI response for BSC %s with %d commands, error status: %s" % (bsc_id, len(parsed.get('commands')), parsed.get('error'))) + log.debug("BSC %s commands: %r" % (bsc_id, parsed.get('commands'))) + for t in parsed.get('commands'): # Process commands format + (_, m) = Ctrl().cmd(*t.split()) + f(m) + +def gen_hash(params, skey): + input = '' + for key in ['time_stamp','position_validity','admin_status','policy_status']: + input += str(params.get(key)) + input += skey + for key in ['bsc_id','lat','lon','position_validity']: + input += str(params.get(key)) + m = hashlib.md5() + m.update(input.encode('utf-8')) + res = m.hexdigest() + #print('HASH: \nparams="%r"\ninput="%s" \nres="%s"' %(params, input, res)) + return res + +class Trap(CTRL): + """ + TRAP handler (agnostic to factory's client object) + """ + def ctrl_TRAP(self, data, op_id, v): + """ + Parse CTRL TRAP and dispatch to appropriate handler after normalization + """ + (l, r) = v.split() + loc = l.split('.') + t_type = loc[-1] + p = partial(lambda a, i: a[i] if len(a) > i else None, loc) # parse helper + method = getattr(self, 'handle_' + t_type.replace('-', ''), lambda: "Unhandled %s trap" % t_type) + method(p(1), p(3), p(5), p(7), r) # we expect net.0.bsc.666.bts.2.trx.1 format for trap prefix + + def ctrl_SET_REPLY(self, data, _, v): + """ + Debug log for replies to our commands + """ + self.factory.log.debug('SET REPLY %s' % v) + + def ctrl_ERROR(self, data, op_id, v): + """ + We want to know if smth went wrong + """ + self.factory.log.debug('CTRL ERROR [%s] %s' % (op_id, v)) + + def connectionMade(self): + """ + Logging wrapper, calling super() is necessary not to break reconnection logic + """ + self.factory.log.info("Connected to CTRL@%s:%d" % (self.factory.host, self.factory.port)) + super(CTRL, self).connectionMade() + + @defer.inlineCallbacks + def handle_locationstate(self, net, bsc, bts, trx, data): + """ + Handle location-state TRAP: parse trap content, build CGI Request and use treq's routines to post it while setting up async handlers + """ + (ts, fx, lat, lon, height, opr, adm, pol, mcc, mnc) = data.split(',') + tstamp = datetime.datetime.fromtimestamp(float(ts)).isoformat() + self.factory.log.debug('location-state@%s.%s.%s.%s (%s) [%s/%s] => %s' % (net, bsc, bts, trx, tstamp, mcc, mnc, data)) + params = {'bsc_id': bsc, 'lon': lon, 'lat': lat, 'position_validity': fix.get(fx, 0), 'time_stamp': tstamp, 'oper_status': oper.get(opr, 2), 'admin_status': admin.get(adm, 2), 'policy_status': policy.get(pol, 3) } + params['h'] = gen_hash(params, self.factory.secret_key) + d = post(self.factory.location, None, params=params) + d.addCallback(partial(handle_reply, self.transport.write, self.factory.log)) # treq's collect helper is handy to get all reply content at once using closure on ctx + d.addErrback(lambda e, bsc: self.factory.log.critical("HTTP POST error %s while trying to register BSC %s" % (e, bsc)), bsc) # handle HTTP errors + # Ensure that we run only limited number of requests in parallel: + yield self.factory.semaphore.acquire() + yield d # we end up here only if semaphore is available which means it's ok to fire the request without exceeding the limit + self.factory.semaphore.release() + + def handle_notificationrejectionv1(self, net, bsc, bts, trx, data): + """ + Handle notification-rejection-v1 TRAP: just an example to show how more message types can be handled + """ + self.factory.log.debug('notification-rejection-v1 at bsc-id %s => %s' % (bsc, data)) + + +class TrapFactory(IPAFactory): + """ + Store CGI information so TRAP handler can use it for requests + """ + location = None + log = None + semaphore = None + client = None + host = None + port = None + secret_key = None + def __init__(self, host, port, proto, semaphore, log, location, secret_key): + self.host = host # for logging only, + self.port = port # seems to be no way to get it from ReconnectingClientFactory + self.log = log + self.semaphore = semaphore + self.location = location + self.secret_key = secret_key + level = self.log.getEffectiveLevel() + self.log.setLevel(logging.WARNING) # we do not need excessive debug from lower levels + super(TrapFactory, self).__init__(proto, self.log) + self.log.setLevel(level) + self.log.debug("Using IPA %s, CGI server: %s" % (Ctrl.version, self.location)) + + +def reloader(path, script, log, dbg1, dbg2, signum, _): + """ + Signal handler: we have to use execl() because twisted's reactor is not restartable due to some bug in twisted implementation + """ + log.info("Received Signal %d - restarting..." % signum) + if signum == signal.SIGUSR1 and dbg1 not in sys.argv and dbg2 not in sys.argv: + sys.argv.append(dbg1) # enforce debug + if signum == signal.SIGUSR2 and (dbg1 in sys.argv or dbg2 in sys.argv): # disable debug + if dbg1 in sys.argv: + sys.argv.remove(dbg1) + if dbg2 in sys.argv: + sys.argv.remove(dbg2) + os.execl(path, script, *sys.argv[1:]) + + +if __name__ == '__main__': + p = argparse.ArgumentParser(description='Proxy between given GCI service and Osmocom CTRL protocol.') + p.add_argument('-v', '--version', action='version', version=("%(prog)s v" + __version__)) + p.add_argument('-a', '--addr-ctrl', default='localhost', help="Adress to use for CTRL interface, defaults to localhost") + p.add_argument('-p', '--port-ctrl', type=int, default=4250, help="Port to use for CTRL interface, defaults to 4250") + p.add_argument('-n', '--num-max-conn', type=int, default=5, help="Max number of concurrent HTTP requests to CGI server") + p.add_argument('-d', '--debug', action='store_true', help="Enable debug log") + p.add_argument('-o', '--output', action='store_true', help="Log to STDOUT in addition to SYSLOG") + p.add_argument('-l', '--location', help="Location URL of the CGI server") + p.add_argument('-s', '--secret-key', help="Secret key used to generate verification token") + p.add_argument('-c', '--config-file', help="Path Config file. Cmd line args override values in config file") + args = p.parse_args() + + log = logging.getLogger('CTRL2CGI') + if args.debug: + log.setLevel(logging.DEBUG) + else: + log.setLevel(logging.INFO) + log.addHandler(logging.handlers.SysLogHandler('/dev/log')) + if args.output: + log.addHandler(logging.StreamHandler(sys.stdout)) + + reboot = partial(reloader, os.path.abspath(__file__), os.path.basename(__file__), log, '-d', '--debug') # keep in sync with add_argument() call above + signal.signal(signal.SIGHUP, reboot) + signal.signal(signal.SIGQUIT, reboot) + signal.signal(signal.SIGUSR1, reboot) # restart and enabled debug output + signal.signal(signal.SIGUSR2, reboot) # restart and disable debug output + + location_cfgfile = None + secret_key_cfgfile = None + port_ctrl_cfgfile = None + addr_ctrl_cfgfile = None + num_max_conn_cfgfile = None + if args.config_file: + config = configparser.ConfigParser() + config.read(args.config_file) + if 'main' in config: + location_cfgfile = config['main'].get('location', None) + secret_key_cfgfile = config['main'].get('secret_key', None) + addr_ctrl_cfgfile = config['main'].get('addr_ctrl', None) + port_ctrl_cfgfile = config['main'].get('port_ctrl', None) + num_max_conn_cfgfile = config['main'].get('num_max_conn', None) + location = args.location if args.location is not None else location_cfgfile + secret_key = args.secret_key if args.secret_key is not None else secret_key_cfgfile + addr_ctrl = args.addr_ctrl if args.addr_ctrl is not None else addr_ctrl_cfgfile + port_ctrl = args.port_ctrl if args.port_ctrl is not None else port_ctrl_cfgfile + num_max_conn = args.num_max_conn if args.num_max_conn is not None else num_max_conn_cfgfile + + log.info("CGI proxy %s starting with PID %d ..." % (__version__, os.getpid())) + reactor.connectTCP(addr_ctrl, port_ctrl, TrapFactory(addr_ctrl, port_ctrl, Trap, defer.DeferredSemaphore(num_max_conn), log, location, secret_key)) + reactor.run() diff --git a/setup.py b/setup.py index 1d785e7..061e5df 100755 --- a/setup.py +++ b/setup.py @@ -30,6 +30,7 @@ "scripts/osmo_ctrl.py", "scripts/osmo_rate_ctr2csv.py", "scripts/soap.py", + "scripts/ctrl2cgi.py", "scripts/osmo_interact_vty.py", "scripts/osmo_interact_ctrl.py", "scripts/osmo_verify_transcript_vty.py", -- To view, visit https://gerrit.osmocom.org/9963 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I7a83ecb379835e295c8cb4c27c39883783746544 Gerrit-Change-Number: 9963 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 09:36:35 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 13 Jul 2018 09:36:35 +0000 Subject: Change in python/osmo-python-tests[master]: debian: Add python module deps for python3-osmopy-utils In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9838 ) Change subject: debian: Add python module deps for python3-osmopy-utils ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/9838 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I97adcb156205389a75d13a53ecab5638c4672436 Gerrit-Change-Number: 9838 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-Comment-Date: Fri, 13 Jul 2018 09:36:35 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 09:36:42 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 13 Jul 2018 09:36:42 +0000 Subject: Change in python/osmo-python-tests[master]: debian: Add python module deps for python3-osmopy-utils In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/9838 ) Change subject: debian: Add python module deps for python3-osmopy-utils ...................................................................... debian: Add python module deps for python3-osmopy-utils Change-Id: I97adcb156205389a75d13a53ecab5638c4672436 --- M debian/control 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/debian/control b/debian/control index f0df4c0..8bea167 100644 --- a/debian/control +++ b/debian/control @@ -31,7 +31,7 @@ Package: python3-osmopy-utils Architecture: all -Depends: ${python3:Depends}, ${misc:Depends}, python3-osmopy-libs +Depends: ${python3:Depends}, ${misc:Depends}, python3-osmopy-libs, python3-twisted, python3-treq Description: Python code (not only) for testing of Osmocom programs . This package contains the Python 3 version of osmopy utils. -- To view, visit https://gerrit.osmocom.org/9838 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I97adcb156205389a75d13a53ecab5638c4672436 Gerrit-Change-Number: 9838 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 09:46:37 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 13 Jul 2018 09:46:37 +0000 Subject: Change in osmo-sgsn[master]: Maintain per ggsn pdp ctx list In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9933 ) Change subject: Maintain per ggsn pdp ctx list ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/9933/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/9933/1//COMMIT_MSG at 10 PS1, Line 10: some scenarios > care to elaborate here? The only scenario visible from the patch is the "delete all PDP contexts fo [?] That's the only explicit existing scenario at the time of doing this commit, true. I should have explained better. I t's useful in scenario implemented in next commit, in which specs references that GSNs should ping only other GSNs with at least one pdp ctx in common. So the list of pdp ctx per GGSN is really useful too (and cheap computationally) to check if we should arm or disarm the echo procedure. So this commit can be seen as a preparation for next commit. -- To view, visit https://gerrit.osmocom.org/9933 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3bbcc0883df2bf1290ba8d4bd70db8baa494087a Gerrit-Change-Number: 9933 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Harald Welte Gerrit-Comment-Date: Fri, 13 Jul 2018 09:46:37 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 09:47:59 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 13 Jul 2018 09:47:59 +0000 Subject: Change in pysim[master]: cosmetic: fix cut and paste error in comment Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/9985 Change subject: cosmetic: fix cut and paste error in comment ...................................................................... cosmetic: fix cut and paste error in comment Change-Id: I506585f8b300bb7a3e20edad7eca134374581d76 --- M pySim/cards.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/85/9985/1 diff --git a/pySim/cards.py b/pySim/cards.py index 3577d8d..9be04ff 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -533,7 +533,7 @@ # set Ki in proprietary file data, sw = self._scc.update_binary('00FF', p['ki']) - # set Ki in proprietary file + # set OPc in proprietary file content = "01" + p['opc'] data, sw = self._scc.update_binary('00F7', content) -- To view, visit https://gerrit.osmocom.org/9985 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I506585f8b300bb7a3e20edad7eca134374581d76 Gerrit-Change-Number: 9985 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 09:47:59 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 13 Jul 2018 09:47:59 +0000 Subject: Change in pysim[master]: cards: return SW in method update_plmnsel() of class Card Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/9986 Change subject: cards: return SW in method update_plmnsel() of class Card ...................................................................... cards: return SW in method update_plmnsel() of class Card The method update_plmnsel() does not return the status word yet, which causes pysim-prog.py to print an error message that does not influence the functionality but does not look nice. - preserve the status word that is returned with update_binary() and return it properly like the other methods do. Change-Id: I54e8e165f87365e8162b36d24efc8f0db62b66da Related: SYS#4245 --- M pySim/cards.py 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/86/9986/1 diff --git a/pySim/cards.py b/pySim/cards.py index 9be04ff..a72a52f 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -87,7 +87,8 @@ data = self._scc.read_binary(EF['PLMNsel'], length=None, offset=0) size = len(data[0])/2 hplmn = enc_plmn(mcc, mnc) - self._scc.update_binary(EF['PLMNsel'], hplmn + 'ff' * (size-3)) + data, sw = self._scc.update_binary(EF['PLMNsel'], hplmn + 'ff' * (size-3)) + return sw def update_smsp(self, smsp): data, sw = self._scc.update_record(EF['SMSP'], 1, rpad(smsp, 84)) -- To view, visit https://gerrit.osmocom.org/9986 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I54e8e165f87365e8162b36d24efc8f0db62b66da Gerrit-Change-Number: 9986 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 09:51:56 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 13 Jul 2018 09:51:56 +0000 Subject: Change in osmo-sgsn[master]: Maintain per ggsn pdp ctx list In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9933 to look at the new patch set (#2). Change subject: Maintain per ggsn pdp ctx list ...................................................................... Maintain per ggsn pdp ctx list This way we can easily track all pdp context associated to a specific ggsn, which is useful to handle some scenarios, such as the one implemented in next commit, in which specs references that GSNs should ping only other GSNs with at least one pdp ctx in common. So the list of pdp ctx per GGSN is really useful too (and cheap computationally) to check if we should arm or disarm the echo procedure timer. So this commit can be seen as a preparation for next commit. Change-Id: I3bbcc0883df2bf1290ba8d4bd70db8baa494087a --- M include/osmocom/sgsn/gprs_sgsn.h M src/gprs/gprs_sgsn.c M src/gprs/sgsn_libgtp.c 3 files changed, 18 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/33/9933/2 -- To view, visit https://gerrit.osmocom.org/9933 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3bbcc0883df2bf1290ba8d4bd70db8baa494087a Gerrit-Change-Number: 9933 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 09:51:56 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 13 Jul 2018 09:51:56 +0000 Subject: Change in osmo-sgsn[master]: osmo-sgsn: ping GGSN periodically and check for restart counter In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9934 to look at the new patch set (#3). Change subject: osmo-sgsn: ping GGSN periodically and check for restart counter ...................................................................... osmo-sgsn: ping GGSN periodically and check for restart counter Before this commit, echo req/rsp logic was implemented in libgtp but never used in osmo-sgsn. This commit adds a timer which periodically sends a GTP ECHO Request to every GGSN if there's at least one pdpd context associated with it. This way by checking the restart counter in the ECHO Reply it can be known if the GGSN was restarted. In this case, logic already present in osmo-sgsn will terminate all pdp contexts associated with that GGSN. Change-Id: I9d714726785407859f26bbef052cd0efc28e8dae --- M include/osmocom/sgsn/gprs_sgsn.h M include/osmocom/sgsn/sgsn.h M src/gprs/gprs_sgsn.c M src/gprs/sgsn_libgtp.c M src/gprs/sgsn_vty.c 5 files changed, 58 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/34/9934/3 -- To view, visit https://gerrit.osmocom.org/9934 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9d714726785407859f26bbef052cd0efc28e8dae Gerrit-Change-Number: 9934 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 10:05:16 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 13 Jul 2018 10:05:16 +0000 Subject: Change in libosmocore[master]: ctrl: Introduce ctrl_cmd_parse3 API In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9978 ) Change subject: ctrl: Introduce ctrl_cmd_parse3 API ...................................................................... Patch Set 2: While I first like the idea, it has some drawbacks which pushes me back. Basically because errors can happen at different stages during parsing, which means sometimes you can acquire the ID while sometimes you cannot, so it's not only the error message type you want to return but also the ID if available, so you can route back the error to match the corresponding request on the other side. So at the end, returning a filled in cmd is handy in order not to loose information. Another option would be differentiating the parsing errors from received errors by using a different cmd->type, like using type=CTRL_TYPE_UNKNOWN, but that would require to change logic of all users of the CTRL iface since it would need to account for a new type instead of just extending it like done in this commit. So while I agree that I would probably have taken the patch to have a different cmd->type for parse errors, I think it's easier and handy to keep current API and only extend it with this parse_failed flag. -- To view, visit https://gerrit.osmocom.org/9978 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ide9170e5c31967c353f8fe4e8227e64130b91eae Gerrit-Change-Number: 9978 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Harald Welte Gerrit-Comment-Date: Fri, 13 Jul 2018 10:05:16 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 10:10:55 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 13 Jul 2018 10:10:55 +0000 Subject: Change in osmo-gsm-tester[master]: ms: Quit early when all tests concluded.. In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9716 ) Change subject: ms: Quit early when all tests concluded.. ...................................................................... Patch Set 3: Code-Review+2 (1 comment) Sorry, I didn't realize this one was pending. https://gerrit.osmocom.org/#/c/9716/3/src/osmo_ms_driver/location_update_test.py File src/osmo_ms_driver/location_update_test.py: https://gerrit.osmocom.org/#/c/9716/3/src/osmo_ms_driver/location_update_test.py at 82 PS3, Line 82: self._outstanding = len(self._unstarted) I'd say using number_of_ms would be more clear here, but fine anyway :) -- To view, visit https://gerrit.osmocom.org/9716 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3575ee7618c35e3b66d25fa31844d267489d9179 Gerrit-Change-Number: 9716 Gerrit-PatchSet: 3 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 13 Jul 2018 10:10:55 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 11:46:08 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 13 Jul 2018 11:46:08 +0000 Subject: Change in osmo-bts[master]: rsl: Use value_string to print encryption algo name In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/9902 ) Change subject: rsl: Use value_string to print encryption algo name ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/9902 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8303364270e73718e57f8efc2f375817b9496ffc Gerrit-Change-Number: 9902 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Fri, 13 Jul 2018 11:46:08 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Fri Jul 13 12:26:47 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Fri, 13 Jul 2018 12:26:47 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-gapk_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#19?= In-Reply-To: <586524233.160.1531398407692.JavaMail.jenkins@jenkins.osmocom.org> References: <586524233.160.1531398407692.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <1894305807.170.1531484807953.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 127.25 KB...] checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether make supports nested variables... (cached) yes checking if gcc supports -fvisibility=hidden... yes checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking whether gcc understands -c and -o together... (cached) yes checking dependency style of gcc... (cached) gcc3 checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for LIBOSMOCORE... yes checking for LIBOSMOCODEC... yes checking for LIBALSA... yes checking for OPENCORE_AMRNB... yes checking gsm/gsm.h usability... yes checking gsm/gsm.h presence... yes checking for gsm/gsm.h... yes checking for gsm_create in -lgsm... yes checking for stdint.h... (cached) yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking for unistd.h... (cached) yes checking for inline... inline checking for int16_t... yes checking for int32_t... yes checking for uint16_t... yes checking for uint32_t... yes checking for uint64_t... yes checking for uint8_t... yes checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... yes checking for memset... yes checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating src/Makefile config.status: creating libgsmhr/Makefile config.status: creating include/Makefile config.status: creating include/gsmhr/Makefile config.status: creating libosmogapk.pc config.status: creating tests/atlocal config.status: creating tests/Makefile config.status: creating config.h config.status: executing depfiles commands config.status: executing libtool commands config.status: executing tests/atconfig commands make[1]: Entering directory ' make all-recursive make[2]: Entering directory ' Making all in include make[3]: Entering directory ' make[4]: Entering directory ' make[4]: Nothing to be done for 'all-am'. make[4]: Leaving directory ' make[3]: Leaving directory ' Making all in src make[3]: Entering directory ' CC procqueue.lo CC pq_format.lo CC pq_codec.lo CC pq_file.lo CC pq_alsa.lo CC pq_rtp.lo CC pq_ecu.lo CC ecu_fr.lo CC formats.lo CC fmt_ti.lo CC fmt_amr.lo CC fmt_gsm.lo CC fmt_hr_ref.lo CC fmt_racal.lo CC fmt_rawpcm.lo CC fmt_rtp_amr.lo CC fmt_rtp_efr.lo CC fmt_rtp_hr_etsi.lo CC fmt_rtp_hr_ietf.lo CC fmt_amr_opencore.lo CC codecs.lo CC codec_pcm.lo CC codec_hr.lo CC codec_fr.lo CC codec_efr.lo CC codec_amr.lo CC benchmark.lo CC common.lo CCLD libosmogapk.la CC app_osmo_gapk.o CCLD osmo-gapk make[3]: Leaving directory ' Making all in tests make[3]: Entering directory ' make[3]: Nothing to be done for 'all'. make[3]: Leaving directory ' make[3]: Entering directory ' make[3]: Leaving directory ' make[2]: Leaving directory ' make[1]: Leaving directory ' make[1]: Entering directory ' Making dvi in include make[2]: Entering directory ' make[3]: Entering directory ' make[3]: Nothing to be done for 'dvi-am'. make[3]: Leaving directory ' make[2]: Leaving directory ' Making dvi in src make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi'. make[2]: Leaving directory ' Making dvi in tests make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi'. make[2]: Leaving directory ' make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi-am'. make[2]: Leaving directory ' make[1]: Leaving directory ' make[1]: Entering directory ' Making check in include make[2]: Entering directory ' make[3]: Entering directory ' make[3]: Nothing to be done for 'check-am'. make[3]: Leaving directory ' make[2]: Leaving directory ' Making check in src make[2]: Entering directory ' make[2]: Nothing to be done for 'check'. make[2]: Leaving directory ' Making check in tests make[2]: Entering directory ' make procqueue/pq_test io/pq_file_test io/pq_rtp_test ecu/ecu_fr_test make[3]: Entering directory ' CC procqueue/pq_test.o CCLD procqueue/pq_test CC io/pq_file_test.o CCLD io/pq_file_test CC io/pq_rtp_test.o CCLD io/pq_rtp_test CC ecu/ecu_fr_test.o CCLD ecu/ecu_fr_test make[3]: Leaving directory ' make check-local make[3]: Entering directory ' /bin/bash '../../../tests/testsuite' ## ---------------------------- ## ## gapk 0.4.75-27bc test suite. ## ## ---------------------------- ## Regression tests. 1: procqueue ok 2: io/pq_file FAILED (testsuite.at:13) 3: io/pq_rtp ok 4: ecu/ecu_fr_test ok 5: conv/enc/amr_efr ok 6: conv/enc/gsm ok 7: conv/enc/racal_hr skipped (testsuite.at:58) 8: conv/enc/racal_fr ok 9: conv/enc/racal_efr ok 10: conv/enc/ti_hr skipped (testsuite.at:91) 11: conv/enc/ti_fr ok 12: conv/enc/ti_efr ok 13: conv/enc/rtp_efr ok 14: conv/enc/rtp_hr_etsi skipped (testsuite.at:135) 15: conv/enc/rtp_hr_ietf skipped (testsuite.at:146) 16: conv/dec/amr_efr ok 17: conv/dec/gsm ok 18: conv/dec/racal_hr skipped (testsuite.at:179) 19: conv/dec/racal_fr ok 20: conv/dec/racal_efr ok 21: conv/dec/ti_hr skipped (testsuite.at:212) 22: conv/dec/ti_fr ok 23: conv/dec/ti_efr ok 24: conv/dec/rtp_efr ok 25: conv/dec/rtp_hr_etsi skipped (testsuite.at:256) 26: conv/dec/rtp_hr_ietf skipped (testsuite.at:267) ## ------------- ## ## Test results. ## ## ------------- ## ERROR: 18 tests were run, 1 failed unexpectedly. 8 tests were skipped. ## -------------------------- ## ## testsuite.log was created. ## ## -------------------------- ## Please send `tests/testsuite.log' and all information you think might help: To: Subject: [gapk 0.4.75-27bc] testsuite: 2 failed You may investigate any problem if you feel able to do so, in which case the test suite provides a good starting point. Its output may be found below `tests/testsuite.dir'. Makefile:753: recipe for target 'check-local' failed make[3]: *** [check-local] Error 1 make[3]: Leaving directory ' Makefile:602: recipe for target 'check-am' failed make[2]: *** [check-am] Error 2 make[2]: Leaving directory ' Makefile:479: recipe for target 'check-recursive' failed make[1]: *** [check-recursive] Error 1 make[1]: Leaving directory ' Makefile:684: recipe for target 'distcheck' failed make: *** [distcheck] Error 1 + cat-testlogs.sh ======================== ./gapk-0.4.75-27bc/_build/sub/tests/testsuite.dir/02/testsuite.log # -*- compilation -*- 2. testsuite.at:10: testing io/pq_file ... ../../../tests/testsuite.at:13: $abs_top_builddir/tests/io/pq_file_test \ $abs_top_builddir/tests/io/io_sample.txt --- /dev/null 2018-03-27 19:17:06.212284948 +0000 +++ 2018-07-13 12:26:47.230850281 +0000 @@ -0,0 +1,2 @@ +pq_file_test: ../../../tests/io/pq_file_test.c:132: main: Assertion `sample_file != NULL' failed. +: line 29: 32347 Aborted $abs_top_builddir/tests/io/pq_file_test $abs_top_builddir/tests/io/io_sample.txt --- expout 2018-07-13 12:26:47.222850335 +0000 +++ 2018-07-13 12:26:47.222850335 +0000 @@ -1,12 +0,0 @@ -Processing sample file with blk_len=2: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=4: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=8: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=16: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=32: -8217c8fb7675a95008f9089d883gapk - -chunk null_context: depth=0 ../../../tests/testsuite.at:13: exit code was 134, expected 0 2. testsuite.at:10: 2. io/pq_file (testsuite.at:10): FAILED (testsuite.at:13) Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From jenkins at lists.osmocom.org Fri Jul 13 15:10:06 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Fri, 13 Jul 2018 15:10:06 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-asn1c_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#183?= In-Reply-To: <1356761077.161.1531408206393.JavaMail.jenkins@jenkins.osmocom.org> References: <1356761077.161.1531408206393.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <1814298009.171.1531494606449.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 3.67 KB...] + ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for style of include used by make... GNU checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking how to run the C++ preprocessor... g++ -E checking for g77... no checking for f77... no checking for xlf... no checking for frt... no checking for pgf77... no checking for cf77... no checking for fort77... no checking for fl32... no checking for af77... no checking for f90... no checking for xlf90... no checking for pgf90... no checking for pghpf... no checking for epcf90... no checking for gfortran... no checking for g95... no checking for f95... no checking for fort... no checking for xlf95... no checking for ifort... no checking for ifc... no checking for efc... no checking for pgf95... no checking for lf95... no checking for ftn... no checking whether we are using the GNU Fortran 77 compiler... no checking whether accepts -g... no checking the maximum length of command line arguments... 32768 checking command to parse /usr/bin/nm -B output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes configure: creating libtool appending configuration tag "CXX" to libtool checking for ld used by g++... /usr/bin/ld -m elf_x86_64 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC checking if g++ PIC flag -fPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate appending configuration tag "F77" to libtool checking for autoconf... /usr/bin/autoconf checking for autoheader... /usr/bin/autoheader checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking dependency style of gcc... (cached) gcc3 checking how to run the C preprocessor... gcc -E checking for a BSD-compatible install... /usr/bin/install -c checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking for bison... bison -y checking for flex... flex checking for yywrap in -lfl... yes checking lex output file root... lex.yy checking whether yytext is a pointer... yes checking for ar... /usr/bin/ar checking for ANSI C header files... (cached) yes checking sys/param.h usability... yes checking sys/param.h presence... yes checking for sys/param.h... yes checking whether byte ordering is bigendian... no checking for off_t... yes checking for size_t... yes checking whether struct tm is in sys/time.h or time.h... time.h checking for intmax_t... yes checking for library containing getopt... none required checking for strtoimax... yes checking for strtoll... yes checking for mergesort... no checking for mkstemps... yes configure: creating ./config.status config.status: creating skeletons/standard-modules/Makefile config.status: creating skeletons/tests/Makefile config.status: creating libasn1compiler/Makefile config.status: creating libasn1parser/Makefile config.status: creating libasn1print/Makefile config.status: creating asn1c/webcgi/Makefile config.status: creating asn1c/tests/Makefile config.status: creating libasn1fix/Makefile config.status: creating skeletons/Makefile config.status: creating examples/Makefile config.status: creating tests/Makefile config.status: creating asn1c/Makefile config.status: creating doc/Makefile config.status: creating asn1c.spec config.status: creating Makefile config.status: creating config.h config.status: executing depfiles commands + make -j 8 make all-recursive make[1]: Entering directory ' Making all in libasn1parser make[2]: Entering directory ' if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF ".deps/asn1parser.Tpo" -c -o asn1parser.lo asn1parser.c; \ then mv -f ".deps/asn1parser.Tpo" ".deps/asn1parser.Plo"; else rm -f ".deps/asn1parser.Tpo"; exit 1; fi bison -y -p asn1p_ -d asn1p_y.y if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF ".deps/asn1p_l.Tpo" -c -o asn1p_l.lo asn1p_l.c; \ then mv -f ".deps/asn1p_l.Tpo" ".deps/asn1p_l.Plo"; else rm -f ".deps/asn1p_l.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF ".deps/asn1p_module.Tpo" -c -o asn1p_module.lo asn1p_module.c; \ then mv -f ".deps/asn1p_module.Tpo" ".deps/asn1p_module.Plo"; else rm -f ".deps/asn1p_module.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF ".deps/asn1p_oid.Tpo" -c -o asn1p_oid.lo asn1p_oid.c; \ then mv -f ".deps/asn1p_oid.Tpo" ".deps/asn1p_oid.Plo"; else rm -f ".deps/asn1p_oid.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF ".deps/asn1p_value.Tpo" -c -o asn1p_value.lo asn1p_value.c; \ then mv -f ".deps/asn1p_value.Tpo" ".deps/asn1p_value.Plo"; else rm -f ".deps/asn1p_value.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF ".deps/asn1p_expr.Tpo" -c -o asn1p_expr.lo asn1p_expr.c; \ then mv -f ".deps/asn1p_expr.Tpo" ".deps/asn1p_expr.Plo"; else rm -f ".deps/asn1p_expr.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF ".deps/asn1p_xports.Tpo" -c -o asn1p_xports.lo asn1p_xports.c; \ then mv -f ".deps/asn1p_xports.Tpo" ".deps/asn1p_xports.Plo"; else rm -f ".deps/asn1p_xports.Tpo"; exit 1; fi asn1p_y.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] mkdir .libs gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -fPIC -DPIC -o .libs/asn1parser.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -fPIC -DPIC -o .libs/asn1p_oid.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -fPIC -DPIC -o .libs/asn1p_module.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -fPIC -DPIC -o .libs/asn1p_l.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -fPIC -DPIC -o .libs/asn1p_value.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -fPIC -DPIC -o .libs/asn1p_xports.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -fPIC -DPIC -o .libs/asn1p_expr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -o asn1p_module.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -o asn1p_xports.o >/dev/null 2>&1 asn1p_l.c:3521:12: warning: 'input' defined but not used [-Wunused-function] static int input() ^~~~~ gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -o asn1parser.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -o asn1p_oid.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF ".deps/asn1p_constr.Tpo" -c -o asn1p_constr.lo asn1p_constr.c; \ then mv -f ".deps/asn1p_constr.Tpo" ".deps/asn1p_constr.Plo"; else rm -f ".deps/asn1p_constr.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -o asn1p_value.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF ".deps/asn1p_param.Tpo" -c -o asn1p_param.lo asn1p_param.c; \ then mv -f ".deps/asn1p_param.Tpo" ".deps/asn1p_param.Plo"; else rm -f ".deps/asn1p_param.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -o asn1p_expr.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF ".deps/asn1p_class.Tpo" -c -o asn1p_class.lo asn1p_class.c; \ then mv -f ".deps/asn1p_class.Tpo" ".deps/asn1p_class.Plo"; else rm -f ".deps/asn1p_class.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF ".deps/asn1p_ref.Tpo" -c -o asn1p_ref.lo asn1p_ref.c; \ then mv -f ".deps/asn1p_ref.Tpo" ".deps/asn1p_ref.Plo"; else rm -f ".deps/asn1p_ref.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -fPIC -DPIC -o .libs/asn1p_param.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -fPIC -DPIC -o .libs/asn1p_constr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -fPIC -DPIC -o .libs/asn1p_class.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -fPIC -DPIC -o .libs/asn1p_ref.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -o asn1p_param.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -o asn1p_constr.o >/dev/null 2>&1 if test -f y.tab.h; then \ to=`echo "asn1p_y_H" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \ sed -e "/^#/!b" -e "s/Y_TAB_H/$to/g" -e "s|y\.tab\.h|asn1p_y.h|" \ y.tab.h >asn1p_y.ht; \ rm -f y.tab.h; \ if cmp -s asn1p_y.ht asn1p_y.h; then \ rm -f asn1p_y.ht ;\ else \ mv asn1p_y.ht asn1p_y.h; \ fi; \ fi if test -f y.output; then \ mv y.output asn1p_y.output; \ fi sed '/^#/ s|y\.tab\.c|asn1p_y.c|' y.tab.c >asn1p_y.ct && mv asn1p_y.ct asn1p_y.c rm -f y.tab.c if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF ".deps/asn1p_y.Tpo" -c -o asn1p_y.lo asn1p_y.c; \ then mv -f ".deps/asn1p_y.Tpo" ".deps/asn1p_y.Plo"; else rm -f ".deps/asn1p_y.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -o asn1p_ref.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -o asn1p_class.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF .deps/asn1p_y.Tpo -c asn1p_y.c -fPIC -DPIC -o .libs/asn1p_y.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -o asn1p_l.o >/dev/null 2>&1 asn1p_y.y: In function 'asn1p_parse': asn1p_y.y:357:13: error: 'param' undeclared (first use in this function) *(void **)param = $1; ^~~~~ asn1p_y.y:357:13: note: each undeclared identifier is reported only once for each function it appears in Makefile:299: recipe for target 'asn1p_y.lo' failed make[2]: *** [asn1p_y.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory ' Makefile:302: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory ' Makefile:212: recipe for target 'all' failed make: *** [all] Error 2 Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Fri Jul 13 16:32:49 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 13 Jul 2018 16:32:49 +0000 Subject: Change in osmo-ggsn[master]: gtp: Log type name of unexpected signalling message Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9987 Change subject: gtp: Log type name of unexpected signalling message ...................................................................... gtp: Log type name of unexpected signalling message Change-Id: Iae0f045e4128cf97aa7824d7d774b59bf966cbe8 --- M gtp/gtp.c 1 file changed, 8 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/87/9987/1 diff --git a/gtp/gtp.c b/gtp/gtp.c index 42e84a7..ac3ec99 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -2835,7 +2835,8 @@ gsn->unexpect++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, - "Unexpected GTPv0 Signalling Message\n"); + "Unexpected GTPv0 Signalling Message '%s'\n", + get_value_string(gtp_type_names, pheader->type)); continue; /* Silently discard 29.60: 11.1.4 */ } @@ -2846,7 +2847,8 @@ gsn->unexpect++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, - "Unexpected GTPv0 Signalling Message\n"); + "Unexpected GTPv0 Signalling Message '%s'\n", + get_value_string(gtp_type_names, pheader->type)); continue; /* Silently discard 29.60: 11.1.4 */ } @@ -3012,7 +3014,8 @@ gsn->unexpect++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, - "Unexpected GTPv1 Signalling Message\n"); + "Unexpected GTPv1 Signalling Message '%s'\n", + get_value_string(gtp_type_names, pheader->type)); continue; /* Silently discard 29.60: 11.1.4 */ } @@ -3023,7 +3026,8 @@ gsn->unexpect++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, - "Unexpected GTPv1 Signalling Message\n"); + "Unexpected GTPv1 Signalling Message '%s'\n", + get_value_string(gtp_type_names, pheader->type)); continue; /* Silently discard 29.60: 11.1.4 */ } -- To view, visit https://gerrit.osmocom.org/9987 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iae0f045e4128cf97aa7824d7d774b59bf966cbe8 Gerrit-Change-Number: 9987 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 16:52:31 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Jul 2018 16:52:31 +0000 Subject: Change in osmo-sgsn[master]: Maintain per ggsn pdp ctx list In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9933 ) Change subject: Maintain per ggsn pdp ctx list ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9933 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3bbcc0883df2bf1290ba8d4bd70db8baa494087a Gerrit-Change-Number: 9933 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 13 Jul 2018 16:52:31 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 16:53:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 13 Jul 2018 16:53:52 +0000 Subject: Change in osmo-sgsn[master]: Disarm T3395 when dettaching mmctx from pdpctx In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9935 ) Change subject: Disarm T3395 when dettaching mmctx from pdpctx ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9935 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2120e53ade6cabad37f9bd99e6680a453411821b Gerrit-Change-Number: 9935 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Fri, 13 Jul 2018 16:53:52 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 17:06:56 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 13 Jul 2018 17:06:56 +0000 Subject: Change in osmo-ggsn[master]: gtp: Allow recv DEL CTX REQ in sgsn and DEL CTX RSP in ggsn Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9988 Change subject: gtp: Allow recv DEL CTX REQ in sgsn and DEL CTX RSP in ggsn ...................................................................... gtp: Allow recv DEL CTX REQ in sgsn and DEL CTX RSP in ggsn According to 3GPP TS 29.060 section "7.3.5 Delete PDP Context Request", both directions are valid in both GSNs. This allows osmo-sgsn receive delete ctx indication (cb_delete_context) in order to implement GGSN initiated requests. Change-Id: I6927c07be4ddf74defe338d01d947056e15cd14d --- M gtp/gtp.c 1 file changed, 4 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/88/9988/1 diff --git a/gtp/gtp.c b/gtp/gtp.c index ac3ec99..5b83d20 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -2830,8 +2830,7 @@ if ((gsn->mode == GTP_MODE_GGSN) && ((pheader->type == GTP_CREATE_PDP_RSP) || - (pheader->type == GTP_UPDATE_PDP_RSP) || - (pheader->type == GTP_DELETE_PDP_RSP))) { + (pheader->type == GTP_UPDATE_PDP_RSP))) { gsn->unexpect++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, @@ -2842,8 +2841,7 @@ if ((gsn->mode == GTP_MODE_SGSN) && ((pheader->type == GTP_CREATE_PDP_REQ) || - (pheader->type == GTP_UPDATE_PDP_REQ) || - (pheader->type == GTP_DELETE_PDP_REQ))) { + (pheader->type == GTP_UPDATE_PDP_REQ))) { gsn->unexpect++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, @@ -3009,8 +3007,7 @@ if ((gsn->mode == GTP_MODE_GGSN) && ((pheader->type == GTP_CREATE_PDP_RSP) || - (pheader->type == GTP_UPDATE_PDP_RSP) || - (pheader->type == GTP_DELETE_PDP_RSP))) { + (pheader->type == GTP_UPDATE_PDP_RSP))) { gsn->unexpect++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, @@ -3021,8 +3018,7 @@ if ((gsn->mode == GTP_MODE_SGSN) && ((pheader->type == GTP_CREATE_PDP_REQ) || - (pheader->type == GTP_UPDATE_PDP_REQ) || - (pheader->type == GTP_DELETE_PDP_REQ))) { + (pheader->type == GTP_UPDATE_PDP_REQ))) { gsn->unexpect++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, -- To view, visit https://gerrit.osmocom.org/9988 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I6927c07be4ddf74defe338d01d947056e15cd14d Gerrit-Change-Number: 9988 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 17:12:16 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 13 Jul 2018 17:12:16 +0000 Subject: Change in osmo-ggsn[master]: gtp: Log ignore CTX DEL REQ due to no teardown and only 1 ctx active Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9989 Change subject: gtp: Log ignore CTX DEL REQ due to no teardown and only 1 ctx active ...................................................................... gtp: Log ignore CTX DEL REQ due to no teardown and only 1 ctx active Change-Id: Ic950c04d309d5686bfbeab332f79c48678e743ae --- M gtp/gtp.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/89/9989/1 diff --git a/gtp/gtp.c b/gtp/gtp.c index 5b83d20..1309cb5 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -2553,6 +2553,9 @@ if (linked_pdp->secondary_tei[n]) count++; if (count <= 1) { + GTP_LOGPKG(LOGL_NOTICE, peer, pack, len, + "Ignoring CTX DEL without teardown and count=%d\n", + count); return 0; /* 29.060 7.3.5 Ignore message */ } } -- To view, visit https://gerrit.osmocom.org/9989 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ic950c04d309d5686bfbeab332f79c48678e743ae Gerrit-Change-Number: 9989 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 17:16:27 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 13 Jul 2018 17:16:27 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: f_pdp_ctx_deact_mt: force teardown to avoid sgsn ignoring msg Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9990 Change subject: sgsn: f_pdp_ctx_deact_mt: force teardown to avoid sgsn ignoring msg ...................................................................... sgsn: f_pdp_ctx_deact_mt: force teardown to avoid sgsn ignoring msg According to """ If a GSN receives a Delete PDP context without a Teardown In dicator or with a Teardown Indicator with value set to "0" and only that PDP context is active for a PDN connection, then the GSN shall ignore the message. """ Change-Id: Id5d4774d719685631e4b467dff833ae886c90145 --- M sgsn/SGSN_Tests.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/90/9990/1 diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 017c724..cfe2d3f 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -948,7 +948,7 @@ var GtpPeer peer := valueof(ts_GtpPeerC(apars.sgsn_ip_c)); BSSGP.clear; - GTP.send(ts_GTPC_DeletePDP(peer, seq_nr, apars.sgsn_tei_c, apars.nsapi, omit)); + GTP.send(ts_GTPC_DeletePDP(peer, seq_nr, apars.sgsn_tei_c, apars.nsapi, '1'B)); interleave { [] BSSGP.receive(tr_BD_L3_MT(tr_SM_DEACT_PDP_REQ_MT(apars.tid, ?))) { -- To view, visit https://gerrit.osmocom.org/9990 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id5d4774d719685631e4b467dff833ae886c90145 Gerrit-Change-Number: 9990 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 17:16:27 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 13 Jul 2018 17:16:27 +0000 Subject: Change in osmo-ttcn3-hacks[master]: lib: L3_Templates: Fix DEACT PDP REQ msg type and make tearDownInd op... Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9991 Change subject: lib: L3_Templates: Fix DEACT PDP REQ msg type and make tearDownInd optional ...................................................................... lib: L3_Templates: Fix DEACT PDP REQ msg type and make tearDownInd optional Specs state in 3GPP TS 24.008 that TearDownInd IE is optional, so allow possibility to omit it. Also fix protocolConfigOpts being passed as parameter but not being used in template tr_SM_DEACT_PDP_REQ_MT. Change-Id: I006d64f51c17a22a42a225ddfa4119933e48a022 --- M library/L3_Templates.ttcn 1 file changed, 33 insertions(+), 34 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/91/9991/1 diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index 9d6d3c3..44d9e73 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -2254,6 +2254,22 @@ } } +function ts_TearDownIndicatorTV(in template (omit) boolean ind) + return template (omit) TearDownIndicatorTV { + if (istemplatekind(ind, "omit")) { + return omit; + } else { + var template (omit) TearDownIndicatorTV ret := { + tearDownIndicatorV := { + tdi_flag := bool2bit(valueof(ind)), + spare := '000'B + }, + elementIdentifier := '1001'B + } + return ret; + } +} + template (value) PDU_L3_MS_SGSN ts_SM_ACT_PDP_REQ(BIT3 tid, BIT4 nsapi, BIT4 sapi, QoSV qos, PDPAddressV addr, template (omit) octetstring apn := omit, @@ -2348,10 +2364,11 @@ } } -template (value) PDU_L3_MS_SGSN ts_SM_DEACT_PDP_REQ_MO(BIT3 tid, OCT1 cause, boolean tdown := false, +template (value) PDU_L3_MS_SGSN ts_SM_DEACT_PDP_REQ_MO(BIT3 tid, OCT1 cause, + template (omit) boolean tdown := omit, template (omit) ProtocolConfigOptionsV pco := omit ) := { - discriminator := '0000'B, /* overwritten */ + discriminator := '1010'B, tiOrSkip := { transactionId := { tio := tid, @@ -2362,15 +2379,9 @@ msgs := { gprs_sm := { deactivatePDPContextRequest := { - messageType := '00000000'B, /* overwritten */ + messageType := '01000110'B, smCause := cause, - tearDownIndicator := { - tearDownIndicatorV := { - tdi_flag := bool2bit(tdown), - spare := '000'B - }, - elementIdentifier := '1001'B - }, + tearDownIndicator := ts_TearDownIndicatorTV(tdown), protocolConfigOpts := ts_PcoTLV(pco), mBMSprotocolConfigOptions := omit, t3396 := omit, @@ -2381,10 +2392,11 @@ } } -template (value) PDU_L3_SGSN_MS ts_SM_DEACT_PDP_REQ_MT(BIT3 tid, OCT1 cause, boolean tdown := false, +template (value) PDU_L3_SGSN_MS ts_SM_DEACT_PDP_REQ_MT(BIT3 tid, OCT1 cause, + template (omit) boolean tdown := omit, template (omit) ProtocolConfigOptionsV pco := omit ) := { - discriminator := '0000'B, /* overwritten */ + discriminator := '1010'B, tiOrSkip := { transactionId := { tio := tid, @@ -2395,15 +2407,9 @@ msgs := { gprs_sm := { deactivatePDPContextRequest := { - messageType := '00000000'B, /* overwritten */ + messageType := '01000110'B, smCause := cause, - tearDownIndicator := { - tearDownIndicatorV := { - tdi_flag := bool2bit(tdown), - spare := '000'B - }, - elementIdentifier := '1001'B - }, + tearDownIndicator := ts_TearDownIndicatorTV(tdown), protocolConfigOpts := ts_PcoTLV(pco), mBMSprotocolConfigOptions := omit, t3396 := omit, @@ -2415,10 +2421,10 @@ } template PDU_L3_SGSN_MS tr_SM_DEACT_PDP_REQ_MT(template BIT3 tid, template OCT1 cause, - template boolean tdown := false, - template (omit) ProtocolConfigOptionsV pco := omit - ) := { - discriminator := '0000'B, /* overwritten */ + template (omit) boolean tdown := omit, + template (omit) ProtocolConfigOptionsV pco := omit + ) := { + discriminator := '1010'B, tiOrSkip := { transactionId := { tio := tid, @@ -2429,16 +2435,10 @@ msgs := { gprs_sm := { deactivatePDPContextRequest := { - messageType := '00000000'B, /* overwritten */ + messageType := '01000110'B, smCause := cause, - tearDownIndicator := { - tearDownIndicatorV := { - tdi_flag := bool2bit_tmpl(tdown), - spare := '000'B - }, - elementIdentifier := '1001'B - }, - protocolConfigOpts := *, + tearDownIndicator := ts_TearDownIndicatorTV(tdown), + protocolConfigOpts := ts_PcoTLV(pco), mBMSprotocolConfigOptions := *, t3396 := *, wLANOffloadIndication := *, @@ -2448,7 +2448,6 @@ } } - template PDU_L3_SGSN_MS tr_SM_DEACT_PDP_ACCEPT_MT(template BIT3 tid := ?) := { discriminator := '1010'B, -- To view, visit https://gerrit.osmocom.org/9991 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I006d64f51c17a22a42a225ddfa4119933e48a022 Gerrit-Change-Number: 9991 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 17:17:14 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 13 Jul 2018 17:17:14 +0000 Subject: Change in osmo-sgsn[master]: Add optional TearDownInd IE in PDP DEACT REQ towards PCU Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9992 Change subject: Add optional TearDownInd IE in PDP DEACT REQ towards PCU ...................................................................... Add optional TearDownInd IE in PDP DEACT REQ towards PCU Change-Id: Ia9bc2d0e93362a8473eac5cf4c7e8ffa41c79e5b --- M include/osmocom/sgsn/gprs_gmm.h M src/gprs/gprs_gmm.c M src/gprs/gprs_sgsn.c 3 files changed, 8 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/92/9992/1 diff --git a/include/osmocom/sgsn/gprs_gmm.h b/include/osmocom/sgsn/gprs_gmm.h index 28c96ce..d12eaf9 100644 --- a/include/osmocom/sgsn/gprs_gmm.h +++ b/include/osmocom/sgsn/gprs_gmm.h @@ -6,7 +6,7 @@ #include -int gsm48_tx_gsm_deact_pdp_req(struct sgsn_pdp_ctx *pdp, uint8_t sm_cause); +int gsm48_tx_gsm_deact_pdp_req(struct sgsn_pdp_ctx *pdp, uint8_t sm_cause, bool teardown); int gsm48_tx_gsm_act_pdp_rej(struct sgsn_mm_ctx *mm, uint8_t tid, uint8_t cause, uint8_t pco_len, uint8_t *pco_v); int gsm48_tx_gsm_act_pdp_acc(struct sgsn_pdp_ctx *pdp); diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index 9d8a869..d06fa6c 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -2295,11 +2295,12 @@ /* Section 9.5.8: Deactivate PDP Context Request */ static int _gsm48_tx_gsm_deact_pdp_req(struct sgsn_mm_ctx *mm, uint8_t tid, - uint8_t sm_cause) + uint8_t sm_cause, bool teardown) { struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 PDP DET REQ"); struct gsm48_hdr *gh; uint8_t transaction_id = tid ^ 0x8; /* flip */ + uint8_t tear_down_ind = (0x9 << 4) | (!!teardown); LOGMMCTXP(LOGL_INFO, mm, "<- DEACTIVATE PDP CONTEXT REQ\n"); rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_PDP_DL_DEACTIVATE_REQUEST]); @@ -2311,14 +2312,15 @@ gh->msg_type = GSM48_MT_GSM_DEACT_PDP_REQ; msgb_v_put(msg, sm_cause); + msgb_v_put(msg, tear_down_ind); return gsm48_gmm_sendmsg(msg, 0, mm, true); } -int gsm48_tx_gsm_deact_pdp_req(struct sgsn_pdp_ctx *pdp, uint8_t sm_cause) +int gsm48_tx_gsm_deact_pdp_req(struct sgsn_pdp_ctx *pdp, uint8_t sm_cause, bool teardown) { pdpctx_timer_start(pdp, 3395, sgsn->cfg.timers.T3395); - return _gsm48_tx_gsm_deact_pdp_req(pdp->mm, pdp->ti, sm_cause); + return _gsm48_tx_gsm_deact_pdp_req(pdp->mm, pdp->ti, sm_cause, teardown); } /* Section 9.5.9: Deactivate PDP Context Accept */ @@ -2724,7 +2726,7 @@ sgsn_delete_pdp_ctx(pdp); break; } - gsm48_tx_gsm_deact_pdp_req(pdp, GSM_CAUSE_NET_FAIL); + gsm48_tx_gsm_deact_pdp_req(pdp, GSM_CAUSE_NET_FAIL, true); break; default: LOGPDPCTXP(LOGL_ERROR, pdp, "timer expired in unknown mode %u\n", diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c index ab5e79a..35479fb 100644 --- a/src/gprs/gprs_sgsn.c +++ b/src/gprs/gprs_sgsn.c @@ -703,7 +703,7 @@ static void drop_one_pdp(struct sgsn_pdp_ctx *pdp) { if (pdp->mm->gmm_state == GMM_REGISTERED_NORMAL) - gsm48_tx_gsm_deact_pdp_req(pdp, GSM_CAUSE_NET_FAIL); + gsm48_tx_gsm_deact_pdp_req(pdp, GSM_CAUSE_NET_FAIL, true); else { /* FIXME: GPRS paging in case MS is SUSPENDED */ LOGPDPCTXP(LOGL_NOTICE, pdp, "Hard-dropping PDP ctx due to GGSN " @@ -954,4 +954,3 @@ osmo_timer_setup(&sgsn->llme_timer, sgsn_llme_check_cb, NULL); osmo_timer_schedule(&sgsn->llme_timer, GPRS_LLME_CHECK_TICK, 0); } - -- To view, visit https://gerrit.osmocom.org/9992 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ia9bc2d0e93362a8473eac5cf4c7e8ffa41c79e5b Gerrit-Change-Number: 9992 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 17:17:15 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 13 Jul 2018 17:17:15 +0000 Subject: Change in osmo-sgsn[master]: sgsn: Don't attempt to delete GTP pdp ctx if GGSN was restarted Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/9993 Change subject: sgsn: Don't attempt to delete GTP pdp ctx if GGSN was restarted ...................................................................... sgsn: Don't attempt to delete GTP pdp ctx if GGSN was restarted Scenario and behaviour before this commit: - Received Echo Reply from GGSN has incremented RestartCounter - func sgsn_ggsn_ctx_drop_all_pdp() is called to dettach all pdp ctx from GGSN and request the MS to deact all related ctx. - DEACT ACCEPT is received from MS, and then it tries to send DEL PDP CTX to GGSN, expecting to receive a Confirmation and only then freeing the pdp ctx. The problem is that since the initial cause of triggering was a GGSN restart, the GGSN doesn't know anything about that pdp ctx anymore, so it's not useful sending it. We can instead dettach the GGSN and libgtp ref at drop_all_pdp() time and then when we receive DEACT ACCEPT from MS we can free the pdp ctx directly. Change-Id: I1c74098e181552c218e152bf4ac5035cea770428 --- M src/gprs/gprs_gmm.c M src/gprs/gprs_sgsn.c 2 files changed, 17 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/93/9993/1 diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index d06fa6c..166c0ad 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -2699,7 +2699,11 @@ } /* stop timer 3395 */ pdpctx_timer_stop(pdp, 3395); - return sgsn_delete_pdp_ctx(pdp); + if (pdp->ggsn) + return sgsn_delete_pdp_ctx(pdp); + /* GTP side already detached, freeing */ + sgsn_pdp_ctx_free(pdp); + return 0; } static int gsm48_rx_gsm_status(struct sgsn_mm_ctx *ctx, struct msgb *msg) diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c index 35479fb..ef0cc23 100644 --- a/src/gprs/gprs_sgsn.c +++ b/src/gprs/gprs_sgsn.c @@ -444,7 +444,8 @@ /* Detach from MM context */ pdp_ctx_detach_mm_ctx(pdp); - sgsn_delete_pdp_ctx(pdp); + if (pdp->ggsn) + sgsn_delete_pdp_ctx(pdp); } /* @@ -479,8 +480,6 @@ lib->priv = NULL; } - if (pdp->destroy_ggsn) - sgsn_ggsn_ctx_free(pdp->ggsn); talloc_free(pdp); } @@ -702,9 +701,10 @@ static void drop_one_pdp(struct sgsn_pdp_ctx *pdp) { - if (pdp->mm->gmm_state == GMM_REGISTERED_NORMAL) + if (pdp->mm->gmm_state == GMM_REGISTERED_NORMAL) { gsm48_tx_gsm_deact_pdp_req(pdp, GSM_CAUSE_NET_FAIL, true); - else { + sgsn_ggsn_ctx_remove_pdp(pdp->ggsn, pdp); + } else { /* FIXME: GPRS paging in case MS is SUSPENDED */ LOGPDPCTXP(LOGL_NOTICE, pdp, "Hard-dropping PDP ctx due to GGSN " "recovery\n"); @@ -739,6 +739,13 @@ llist_del(&pdp->ggsn_list); if (llist_empty(&ggc->pdp_list) && osmo_timer_pending(&ggc->echo_timer)) osmo_timer_del(&ggc->echo_timer); + if (pdp->destroy_ggsn) + sgsn_ggsn_ctx_free(pdp->ggsn); + pdp->ggsn = NULL; + /* Drop references to libgtp since the conn is down */ + if (pdp->lib) + pdp_freepdp(pdp->lib); + pdp->lib = NULL; } void sgsn_update_subscriber_data(struct sgsn_mm_ctx *mmctx) -- To view, visit https://gerrit.osmocom.org/9993 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I1c74098e181552c218e152bf4ac5035cea770428 Gerrit-Change-Number: 9993 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 17:19:14 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 13 Jul 2018 17:19:14 +0000 Subject: Change in osmo-sgsn[master]: sgsn_libgtp.c: Log pointer of deleted context In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/9932 ) Change subject: sgsn_libgtp.c: Log pointer of deleted context ...................................................................... sgsn_libgtp.c: Log pointer of deleted context Change-Id: I8a4627b54090e72f86a9c5a781670be52522062b --- M src/gprs/sgsn_libgtp.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 4061e7a..70112cb 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -635,7 +635,7 @@ /* Called whenever a PDP context is deleted for any reason */ static int cb_delete_context(struct pdp_t *pdp) { - LOGPDPX(DGPRS, LOGL_INFO, pdp, "Context was deleted\n"); + LOGPDPX(DGPRS, LOGL_INFO, pdp, "Context %p was deleted\n", pdp); return 0; } -- To view, visit https://gerrit.osmocom.org/9932 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I8a4627b54090e72f86a9c5a781670be52522062b Gerrit-Change-Number: 9932 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 13 17:19:16 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 13 Jul 2018 17:19:16 +0000 Subject: Change in osmo-sgsn[master]: Maintain per ggsn pdp ctx list In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/9933 ) Change subject: Maintain per ggsn pdp ctx list ...................................................................... Maintain per ggsn pdp ctx list This way we can easily track all pdp context associated to a specific ggsn, which is useful to handle some scenarios, such as the one implemented in next commit, in which specs references that GSNs should ping only other GSNs with at least one pdp ctx in common. So the list of pdp ctx per GGSN is really useful too (and cheap computationally) to check if we should arm or disarm the echo procedure timer. So this commit can be seen as a preparation for next commit. Change-Id: I3bbcc0883df2bf1290ba8d4bd70db8baa494087a --- M include/osmocom/sgsn/gprs_sgsn.h M src/gprs/gprs_sgsn.c M src/gprs/sgsn_libgtp.c 3 files changed, 18 insertions(+), 17 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/sgsn/gprs_sgsn.h b/include/osmocom/sgsn/gprs_sgsn.h index 64e5619..33b12dc 100644 --- a/include/osmocom/sgsn/gprs_sgsn.h +++ b/include/osmocom/sgsn/gprs_sgsn.h @@ -296,6 +296,7 @@ struct sgsn_mm_ctx *mm; /* back pointer to MM CTX */ int destroy_ggsn; /* destroy it on destruction */ struct sgsn_ggsn_ctx *ggsn; /* which GGSN serves this PDP */ + struct llist_head ggsn_list; /* list_head for ggsn->pdp_list */ struct rate_ctr_group *ctrg; //unsigned int id; @@ -338,6 +339,7 @@ uint8_t tid); struct sgsn_pdp_ctx *sgsn_pdp_ctx_alloc(struct sgsn_mm_ctx *mm, + struct sgsn_ggsn_ctx *ggsn, uint8_t nsapi); void sgsn_pdp_ctx_terminate(struct sgsn_pdp_ctx *pdp); void sgsn_pdp_ctx_free(struct sgsn_pdp_ctx *pdp); @@ -350,12 +352,14 @@ struct in_addr remote_addr; int remote_restart_ctr; struct gsn_t *gsn; + struct llist_head pdp_list; /* list of associated pdp ctx (struct sgsn_pdp_ctx*) */ }; struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_alloc(uint32_t id); void sgsn_ggsn_ctx_free(struct sgsn_ggsn_ctx *ggc); struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_id(uint32_t id); struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_addr(struct in_addr *addr); struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_find_alloc(uint32_t id); +int sgsn_ggsn_ctx_drop_all_pdp(struct sgsn_ggsn_ctx *ggsn); struct apn_ctx { struct llist_head list; @@ -378,10 +382,6 @@ uint32_t sgsn_alloc_ptmsi(void); void sgsn_inst_init(void); -/* High-level function to be called in case a GGSN has disappeared or - * ottherwise lost state (recovery procedure) */ -int drop_all_pdp_for_ggsn(struct sgsn_ggsn_ctx *ggsn); - char *gprs_pdpaddr2str(uint8_t *pdpa, uint8_t len); /* diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c index 688eaed..a58e504 100644 --- a/src/gprs/gprs_sgsn.c +++ b/src/gprs/gprs_sgsn.c @@ -388,6 +388,7 @@ /* you don't want to use this directly, call sgsn_create_pdp_ctx() */ struct sgsn_pdp_ctx *sgsn_pdp_ctx_alloc(struct sgsn_mm_ctx *mm, + struct sgsn_ggsn_ctx *ggsn, uint8_t nsapi) { struct sgsn_pdp_ctx *pdp; @@ -401,6 +402,7 @@ return NULL; pdp->mm = mm; + pdp->ggsn = ggsn; pdp->nsapi = nsapi; pdp->ctrg = rate_ctr_group_alloc(pdp, &pdpctx_ctrg_desc, nsapi); if (!pdp->ctrg) { @@ -409,6 +411,7 @@ return NULL; } llist_add(&pdp->list, &mm->pdp_list); + llist_add(&pdp->ggsn_list, &ggsn->pdp_list); llist_add(&pdp->g_list, &sgsn_pdp_ctxts); return pdp; @@ -462,6 +465,8 @@ rate_ctr_group_free(pdp->ctrg); if (pdp->mm) llist_del(&pdp->list); + if (pdp->ggsn) + llist_del(&pdp->ggsn_list); llist_del(&pdp->g_list); /* _if_ we still have a library handle, at least set it to NULL @@ -496,6 +501,7 @@ ggc->remote_restart_ctr = -1; /* if we are called from config file parse, this gsn doesn't exist yet */ ggc->gsn = sgsn->gsn; + INIT_LLIST_HEAD(&ggc->pdp_list); llist_add(&ggc->list, &sgsn_ggsn_ctxts); return ggc; @@ -503,6 +509,7 @@ void sgsn_ggsn_ctx_free(struct sgsn_ggsn_ctx *ggc) { + OSMO_ASSERT(llist_empty(&ggc->pdp_list)); llist_del(&ggc->list); talloc_free(ggc); } @@ -702,19 +709,14 @@ /* High-level function to be called in case a GGSN has disappeared or * otherwise lost state (recovery procedure) */ -int drop_all_pdp_for_ggsn(struct sgsn_ggsn_ctx *ggsn) +int sgsn_ggsn_ctx_drop_all_pdp(struct sgsn_ggsn_ctx *ggsn) { - struct sgsn_mm_ctx *mm; int num = 0; - llist_for_each_entry(mm, &sgsn_mm_ctxts, list) { - struct sgsn_pdp_ctx *pdp; - llist_for_each_entry(pdp, &mm->pdp_list, list) { - if (pdp->ggsn == ggsn) { - drop_one_pdp(pdp); - num++; - } - } + struct sgsn_pdp_ctx *pdp, *pdp2; + llist_for_each_entry_safe(pdp, pdp2, &ggsn->pdp_list, ggsn_list) { + drop_one_pdp(pdp); + num++; } return num; diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 70112cb..2da8c4a 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -145,7 +145,7 @@ const uint8_t *qos; int rc; - pctx = sgsn_pdp_ctx_alloc(mmctx, nsapi); + pctx = sgsn_pdp_ctx_alloc(mmctx, ggsn, nsapi); if (!pctx) { LOGP(DGPRS, LOGL_ERROR, "Couldn't allocate PDP Ctx\n"); return NULL; @@ -160,7 +160,6 @@ } pdp->priv = pctx; pctx->lib = pdp; - pctx->ggsn = ggsn; //pdp->peer = /* sockaddr_in of GGSN (receive) */ //pdp->ipif = /* not used by library */ @@ -603,7 +602,7 @@ "releasing all PDP contexts\n", ggsn->remote_restart_ctr, recovery); ggsn->remote_restart_ctr = recovery; - drop_all_pdp_for_ggsn(ggsn); + sgsn_ggsn_ctx_drop_all_pdp(ggsn); } return 0; } -- To view, visit https://gerrit.osmocom.org/9933 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I3bbcc0883df2bf1290ba8d4bd70db8baa494087a Gerrit-Change-Number: 9933 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Sat Jul 14 12:26:47 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Sat, 14 Jul 2018 12:26:47 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-gapk_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#20?= In-Reply-To: <1894305807.170.1531484807953.JavaMail.jenkins@jenkins.osmocom.org> References: <1894305807.170.1531484807953.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <1532392046.180.1531571207977.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 127.19 KB...] checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether make supports nested variables... (cached) yes checking if gcc supports -fvisibility=hidden... yes checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking whether gcc understands -c and -o together... (cached) yes checking dependency style of gcc... (cached) gcc3 checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for LIBOSMOCORE... yes checking for LIBOSMOCODEC... yes checking for LIBALSA... yes checking for OPENCORE_AMRNB... yes checking gsm/gsm.h usability... yes checking gsm/gsm.h presence... yes checking for gsm/gsm.h... yes checking for gsm_create in -lgsm... yes checking for stdint.h... (cached) yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking for unistd.h... (cached) yes checking for inline... inline checking for int16_t... yes checking for int32_t... yes checking for uint16_t... yes checking for uint32_t... yes checking for uint64_t... yes checking for uint8_t... yes checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... yes checking for memset... yes checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating src/Makefile config.status: creating libgsmhr/Makefile config.status: creating include/Makefile config.status: creating include/gsmhr/Makefile config.status: creating libosmogapk.pc config.status: creating tests/atlocal config.status: creating tests/Makefile config.status: creating config.h config.status: executing depfiles commands config.status: executing libtool commands config.status: executing tests/atconfig commands make[1]: Entering directory ' make all-recursive make[2]: Entering directory ' Making all in include make[3]: Entering directory ' make[4]: Entering directory ' make[4]: Nothing to be done for 'all-am'. make[4]: Leaving directory ' make[3]: Leaving directory ' Making all in src make[3]: Entering directory ' CC procqueue.lo CC pq_format.lo CC pq_codec.lo CC pq_file.lo CC pq_alsa.lo CC pq_rtp.lo CC pq_ecu.lo CC ecu_fr.lo CC formats.lo CC fmt_ti.lo CC fmt_amr.lo CC fmt_gsm.lo CC fmt_hr_ref.lo CC fmt_racal.lo CC fmt_rawpcm.lo CC fmt_rtp_amr.lo CC fmt_rtp_efr.lo CC fmt_rtp_hr_etsi.lo CC fmt_rtp_hr_ietf.lo CC fmt_amr_opencore.lo CC codecs.lo CC codec_pcm.lo CC codec_hr.lo CC codec_fr.lo CC codec_efr.lo CC codec_amr.lo CC benchmark.lo CC common.lo CCLD libosmogapk.la CC app_osmo_gapk.o CCLD osmo-gapk make[3]: Leaving directory ' Making all in tests make[3]: Entering directory ' make[3]: Nothing to be done for 'all'. make[3]: Leaving directory ' make[3]: Entering directory ' make[3]: Leaving directory ' make[2]: Leaving directory ' make[1]: Leaving directory ' make[1]: Entering directory ' Making dvi in include make[2]: Entering directory ' make[3]: Entering directory ' make[3]: Nothing to be done for 'dvi-am'. make[3]: Leaving directory ' make[2]: Leaving directory ' Making dvi in src make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi'. make[2]: Leaving directory ' Making dvi in tests make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi'. make[2]: Leaving directory ' make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi-am'. make[2]: Leaving directory ' make[1]: Leaving directory ' make[1]: Entering directory ' Making check in include make[2]: Entering directory ' make[3]: Entering directory ' make[3]: Nothing to be done for 'check-am'. make[3]: Leaving directory ' make[2]: Leaving directory ' Making check in src make[2]: Entering directory ' make[2]: Nothing to be done for 'check'. make[2]: Leaving directory ' Making check in tests make[2]: Entering directory ' make procqueue/pq_test io/pq_file_test io/pq_rtp_test ecu/ecu_fr_test make[3]: Entering directory ' CC procqueue/pq_test.o CCLD procqueue/pq_test CC io/pq_file_test.o CCLD io/pq_file_test CC io/pq_rtp_test.o CCLD io/pq_rtp_test CC ecu/ecu_fr_test.o CCLD ecu/ecu_fr_test make[3]: Leaving directory ' make check-local make[3]: Entering directory ' /bin/bash '../../../tests/testsuite' ## ---------------------------- ## ## gapk 0.4.75-27bc test suite. ## ## ---------------------------- ## Regression tests. 1: procqueue ok 2: io/pq_file FAILED (testsuite.at:13) 3: io/pq_rtp ok 4: ecu/ecu_fr_test ok 5: conv/enc/amr_efr ok 6: conv/enc/gsm ok 7: conv/enc/racal_hr skipped (testsuite.at:58) 8: conv/enc/racal_fr ok 9: conv/enc/racal_efr ok 10: conv/enc/ti_hr skipped (testsuite.at:91) 11: conv/enc/ti_fr ok 12: conv/enc/ti_efr ok 13: conv/enc/rtp_efr ok 14: conv/enc/rtp_hr_etsi skipped (testsuite.at:135) 15: conv/enc/rtp_hr_ietf skipped (testsuite.at:146) 16: conv/dec/amr_efr ok 17: conv/dec/gsm ok 18: conv/dec/racal_hr skipped (testsuite.at:179) 19: conv/dec/racal_fr ok 20: conv/dec/racal_efr ok 21: conv/dec/ti_hr skipped (testsuite.at:212) 22: conv/dec/ti_fr ok 23: conv/dec/ti_efr ok 24: conv/dec/rtp_efr ok 25: conv/dec/rtp_hr_etsi skipped (testsuite.at:256) 26: conv/dec/rtp_hr_ietf skipped (testsuite.at:267) ## ------------- ## ## Test results. ## ## ------------- ## ERROR: 18 tests were run, 1 failed unexpectedly. 8 tests were skipped. ## -------------------------- ## ## testsuite.log was created. ## ## -------------------------- ## Please send `tests/testsuite.log' and all information you think might help: To: Subject: [gapk 0.4.75-27bc] testsuite: 2 failed You may investigate any problem if you feel able to do so, in which case the test suite provides a good starting point. Its output may be found below `tests/testsuite.dir'. Makefile:753: recipe for target 'check-local' failed make[3]: *** [check-local] Error 1 make[3]: Leaving directory ' Makefile:602: recipe for target 'check-am' failed make[2]: *** [check-am] Error 2 make[2]: Leaving directory ' Makefile:479: recipe for target 'check-recursive' failed make[1]: *** [check-recursive] Error 1 make[1]: Leaving directory ' Makefile:684: recipe for target 'distcheck' failed make: *** [distcheck] Error 1 + cat-testlogs.sh ======================== ./gapk-0.4.75-27bc/_build/sub/tests/testsuite.dir/02/testsuite.log # -*- compilation -*- 2. testsuite.at:10: testing io/pq_file ... ../../../tests/testsuite.at:13: $abs_top_builddir/tests/io/pq_file_test \ $abs_top_builddir/tests/io/io_sample.txt --- /dev/null 2018-03-27 19:17:06.212284948 +0000 +++ 2018-07-14 12:26:47.274680921 +0000 @@ -0,0 +1,2 @@ +pq_file_test: ../../../tests/io/pq_file_test.c:132: main: Assertion `sample_file != NULL' failed. +: line 29: 4697 Aborted $abs_top_builddir/tests/io/pq_file_test $abs_top_builddir/tests/io/io_sample.txt --- expout 2018-07-14 12:26:47.266680992 +0000 +++ 2018-07-14 12:26:47.266680992 +0000 @@ -1,12 +0,0 @@ -Processing sample file with blk_len=2: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=4: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=8: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=16: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=32: -8217c8fb7675a95008f9089d883gapk - -chunk null_context: depth=0 ../../../tests/testsuite.at:13: exit code was 134, expected 0 2. testsuite.at:10: 2. io/pq_file (testsuite.at:10): FAILED (testsuite.at:13) Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Sat Jul 14 14:22:34 2018 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sat, 14 Jul 2018 14:22:34 +0000 Subject: Change in osmo-sgsn[master]: sgsn: Don't attempt to delete GTP pdp ctx if GGSN was restarted In-Reply-To: References: Message-ID: Holger Freyther has posted comments on this change. ( https://gerrit.osmocom.org/9993 ) Change subject: sgsn: Don't attempt to delete GTP pdp ctx if GGSN was restarted ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/9993/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/9993/1//COMMIT_MSG at 20 PS1, Line 20: when What happens if the MS doesn't respond? -- To view, visit https://gerrit.osmocom.org/9993 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1c74098e181552c218e152bf4ac5035cea770428 Gerrit-Change-Number: 9993 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Holger Freyther Gerrit-Comment-Date: Sat, 14 Jul 2018 14:22:34 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 14 14:36:29 2018 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sat, 14 Jul 2018 14:36:29 +0000 Subject: Change in osmo-gsm-tester[master]: ms: Quit early when all tests concluded.. In-Reply-To: References: Message-ID: Holger Freyther has posted comments on this change. ( https://gerrit.osmocom.org/9716 ) Change subject: ms: Quit early when all tests concluded.. ...................................................................... Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/9716/3/src/osmo_ms_driver/location_update_test.py File src/osmo_ms_driver/location_update_test.py: https://gerrit.osmocom.org/#/c/9716/3/src/osmo_ms_driver/location_update_test.py at 82 PS3, Line 82: self._outstanding = len(self._unstarted) > I'd say using number_of_ms would be more clear here, but fine anyway :) Why? Would you mind to elaborate of why this is the better number? -- To view, visit https://gerrit.osmocom.org/9716 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3575ee7618c35e3b66d25fa31844d267489d9179 Gerrit-Change-Number: 9716 Gerrit-PatchSet: 3 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Sat, 14 Jul 2018 14:36:29 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 14 14:37:32 2018 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sat, 14 Jul 2018 14:37:32 +0000 Subject: Change in osmo-bts[master]: rsl: Use value_string to print encryption algo name In-Reply-To: References: Message-ID: Holger Freyther has posted comments on this change. ( https://gerrit.osmocom.org/9902 ) Change subject: rsl: Use value_string to print encryption algo name ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9902 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8303364270e73718e57f8efc2f375817b9496ffc Gerrit-Change-Number: 9902 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Sat, 14 Jul 2018 14:37:32 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Sat Jul 14 15:10:06 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Sat, 14 Jul 2018 15:10:06 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-asn1c_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#184?= In-Reply-To: <1814298009.171.1531494606449.JavaMail.jenkins@jenkins.osmocom.org> References: <1814298009.171.1531494606449.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <1939936555.181.1531581006387.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 3.67 KB...] + ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for style of include used by make... GNU checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking how to run the C++ preprocessor... g++ -E checking for g77... no checking for f77... no checking for xlf... no checking for frt... no checking for pgf77... no checking for cf77... no checking for fort77... no checking for fl32... no checking for af77... no checking for f90... no checking for xlf90... no checking for pgf90... no checking for pghpf... no checking for epcf90... no checking for gfortran... no checking for g95... no checking for f95... no checking for fort... no checking for xlf95... no checking for ifort... no checking for ifc... no checking for efc... no checking for pgf95... no checking for lf95... no checking for ftn... no checking whether we are using the GNU Fortran 77 compiler... no checking whether accepts -g... no checking the maximum length of command line arguments... 32768 checking command to parse /usr/bin/nm -B output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes configure: creating libtool appending configuration tag "CXX" to libtool checking for ld used by g++... /usr/bin/ld -m elf_x86_64 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC checking if g++ PIC flag -fPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate appending configuration tag "F77" to libtool checking for autoconf... /usr/bin/autoconf checking for autoheader... /usr/bin/autoheader checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking dependency style of gcc... (cached) gcc3 checking how to run the C preprocessor... gcc -E checking for a BSD-compatible install... /usr/bin/install -c checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking for bison... bison -y checking for flex... flex checking for yywrap in -lfl... yes checking lex output file root... lex.yy checking whether yytext is a pointer... yes checking for ar... /usr/bin/ar checking for ANSI C header files... (cached) yes checking sys/param.h usability... yes checking sys/param.h presence... yes checking for sys/param.h... yes checking whether byte ordering is bigendian... no checking for off_t... yes checking for size_t... yes checking whether struct tm is in sys/time.h or time.h... time.h checking for intmax_t... yes checking for library containing getopt... none required checking for strtoimax... yes checking for strtoll... yes checking for mergesort... no checking for mkstemps... yes configure: creating ./config.status config.status: creating skeletons/standard-modules/Makefile config.status: creating skeletons/tests/Makefile config.status: creating libasn1compiler/Makefile config.status: creating libasn1parser/Makefile config.status: creating libasn1print/Makefile config.status: creating asn1c/webcgi/Makefile config.status: creating asn1c/tests/Makefile config.status: creating libasn1fix/Makefile config.status: creating skeletons/Makefile config.status: creating examples/Makefile config.status: creating tests/Makefile config.status: creating asn1c/Makefile config.status: creating doc/Makefile config.status: creating asn1c.spec config.status: creating Makefile config.status: creating config.h config.status: executing depfiles commands + make -j 8 make all-recursive make[1]: Entering directory ' Making all in libasn1parser make[2]: Entering directory ' if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF ".deps/asn1parser.Tpo" -c -o asn1parser.lo asn1parser.c; \ then mv -f ".deps/asn1parser.Tpo" ".deps/asn1parser.Plo"; else rm -f ".deps/asn1parser.Tpo"; exit 1; fi bison -y -p asn1p_ -d asn1p_y.y if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF ".deps/asn1p_l.Tpo" -c -o asn1p_l.lo asn1p_l.c; \ then mv -f ".deps/asn1p_l.Tpo" ".deps/asn1p_l.Plo"; else rm -f ".deps/asn1p_l.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF ".deps/asn1p_module.Tpo" -c -o asn1p_module.lo asn1p_module.c; \ then mv -f ".deps/asn1p_module.Tpo" ".deps/asn1p_module.Plo"; else rm -f ".deps/asn1p_module.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF ".deps/asn1p_oid.Tpo" -c -o asn1p_oid.lo asn1p_oid.c; \ then mv -f ".deps/asn1p_oid.Tpo" ".deps/asn1p_oid.Plo"; else rm -f ".deps/asn1p_oid.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF ".deps/asn1p_value.Tpo" -c -o asn1p_value.lo asn1p_value.c; \ then mv -f ".deps/asn1p_value.Tpo" ".deps/asn1p_value.Plo"; else rm -f ".deps/asn1p_value.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF ".deps/asn1p_expr.Tpo" -c -o asn1p_expr.lo asn1p_expr.c; \ then mv -f ".deps/asn1p_expr.Tpo" ".deps/asn1p_expr.Plo"; else rm -f ".deps/asn1p_expr.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF ".deps/asn1p_xports.Tpo" -c -o asn1p_xports.lo asn1p_xports.c; \ then mv -f ".deps/asn1p_xports.Tpo" ".deps/asn1p_xports.Plo"; else rm -f ".deps/asn1p_xports.Tpo"; exit 1; fi asn1p_y.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] mkdir .libs gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -fPIC -DPIC -o .libs/asn1p_module.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -fPIC -DPIC -o .libs/asn1p_l.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -fPIC -DPIC -o .libs/asn1p_expr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -fPIC -DPIC -o .libs/asn1p_oid.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -fPIC -DPIC -o .libs/asn1p_value.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -fPIC -DPIC -o .libs/asn1parser.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -fPIC -DPIC -o .libs/asn1p_xports.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -o asn1p_xports.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -o asn1p_module.o >/dev/null 2>&1 asn1p_l.c:3521:12: warning: 'input' defined but not used [-Wunused-function] static int input() ^~~~~ gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -o asn1p_oid.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -o asn1parser.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -o asn1p_expr.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF ".deps/asn1p_constr.Tpo" -c -o asn1p_constr.lo asn1p_constr.c; \ then mv -f ".deps/asn1p_constr.Tpo" ".deps/asn1p_constr.Plo"; else rm -f ".deps/asn1p_constr.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -o asn1p_value.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF ".deps/asn1p_param.Tpo" -c -o asn1p_param.lo asn1p_param.c; \ then mv -f ".deps/asn1p_param.Tpo" ".deps/asn1p_param.Plo"; else rm -f ".deps/asn1p_param.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF ".deps/asn1p_class.Tpo" -c -o asn1p_class.lo asn1p_class.c; \ then mv -f ".deps/asn1p_class.Tpo" ".deps/asn1p_class.Plo"; else rm -f ".deps/asn1p_class.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF ".deps/asn1p_ref.Tpo" -c -o asn1p_ref.lo asn1p_ref.c; \ then mv -f ".deps/asn1p_ref.Tpo" ".deps/asn1p_ref.Plo"; else rm -f ".deps/asn1p_ref.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -fPIC -DPIC -o .libs/asn1p_constr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -fPIC -DPIC -o .libs/asn1p_param.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -fPIC -DPIC -o .libs/asn1p_class.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -fPIC -DPIC -o .libs/asn1p_ref.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -o asn1p_param.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -o asn1p_constr.o >/dev/null 2>&1 if test -f y.tab.h; then \ to=`echo "asn1p_y_H" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \ sed -e "/^#/!b" -e "s/Y_TAB_H/$to/g" -e "s|y\.tab\.h|asn1p_y.h|" \ y.tab.h >asn1p_y.ht; \ rm -f y.tab.h; \ if cmp -s asn1p_y.ht asn1p_y.h; then \ rm -f asn1p_y.ht ;\ else \ mv asn1p_y.ht asn1p_y.h; \ fi; \ fi if test -f y.output; then \ mv y.output asn1p_y.output; \ fi sed '/^#/ s|y\.tab\.c|asn1p_y.c|' y.tab.c >asn1p_y.ct && mv asn1p_y.ct asn1p_y.c gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -o asn1p_ref.o >/dev/null 2>&1 rm -f y.tab.c if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF ".deps/asn1p_y.Tpo" -c -o asn1p_y.lo asn1p_y.c; \ then mv -f ".deps/asn1p_y.Tpo" ".deps/asn1p_y.Plo"; else rm -f ".deps/asn1p_y.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -o asn1p_class.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -o asn1p_l.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF .deps/asn1p_y.Tpo -c asn1p_y.c -fPIC -DPIC -o .libs/asn1p_y.o asn1p_y.y: In function 'asn1p_parse': asn1p_y.y:357:13: error: 'param' undeclared (first use in this function) *(void **)param = $1; ^~~~~ asn1p_y.y:357:13: note: each undeclared identifier is reported only once for each function it appears in Makefile:299: recipe for target 'asn1p_y.lo' failed make[2]: *** [asn1p_y.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory ' Makefile:302: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory ' Makefile:212: recipe for target 'all' failed make: *** [all] Error 2 Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Sat Jul 14 19:13:10 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sat, 14 Jul 2018 19:13:10 +0000 Subject: Change in libosmocore[master]: coding: Fix (E)GPRS BER calculation to correctly account for puncturing. Message-ID: Alexander Chemeris has uploaded this change for review. ( https://gerrit.osmocom.org/9994 Change subject: coding: Fix (E)GPRS BER calculation to correctly account for puncturing. ...................................................................... coding: Fix (E)GPRS BER calculation to correctly account for puncturing. Previously we didn't take into account puncturing and BER was always around 30% for GPRS/EDGE bursts because of they use puncturing coding unlike "classical" GSM bursts. Change-Id: I9da22e7051522d06d923fcec3b63cbed8db93910 --- M src/coding/gsm0503_coding.c 1 file changed, 24 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/94/9994/1 diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index 215cc6d..1d06adb 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -528,16 +528,18 @@ }, }; -/*! Convolutional Decode + compute BER +/*! Convolutional Decode + compute BER for punctured codes * \param[in] code Description of Convolutional Code * \param[in] input Input soft-bits (-127...127) * \param[out] output bits * \param[out] n_errors Number of bit-errors * \param[out] n_bits_total Number of bits + * \param[in] data_punc Puncturing mask array. Can be NULL. */ -static int osmo_conv_decode_ber(const struct osmo_conv_code *code, +static int osmo_conv_decode_ber_punctured(const struct osmo_conv_code *code, const sbit_t *input, ubit_t *output, - int *n_errors, int *n_bits_total) + int *n_errors, int *n_bits_total, + const uint8_t *data_punc) { int res, i, coded_len; ubit_t recoded[EGPRS_DATA_C_MAX]; @@ -553,7 +555,8 @@ if (n_errors) { *n_errors = 0; for (i = 0; i < coded_len; i++) { - if (!((recoded[i] && input[i] < 0) || + if (((!data_punc) || (data_punc && !data_punc[i])) && + !((recoded[i] && input[i] < 0) || (!recoded[i] && input[i] > 0)) ) *n_errors += 1; } @@ -565,6 +568,21 @@ return res; } +/*! Convolutional Decode + compute BER for non-punctured codes + * \param[in] code Description of Convolutional Code + * \param[in] input Input soft-bits (-127...127) + * \param[out] output bits + * \param[out] n_errors Number of bit-errors + * \param[out] n_bits_total Number of bits + */ +static int osmo_conv_decode_ber(const struct osmo_conv_code *code, + const sbit_t *input, ubit_t *output, + int *n_errors, int *n_bits_total) +{ + return osmo_conv_decode_ber_punctured(code, input, output, + n_errors, n_bits_total, NULL); +} + /*! convenience wrapper for decoding coded bits * \param[out] l2_data caller-allocated buffer for L2 Frame * \param[in] cB 456 coded (soft) bits as per TS 05.03 4.1.3 @@ -884,7 +902,8 @@ C[i] = 0; } - osmo_conv_decode_ber(code->data_conv, C, u, n_errors, n_bits_total); + osmo_conv_decode_ber_punctured(code->data_conv, C, u, + n_errors, n_bits_total, code->data_punc[p]); rc = osmo_crc16gen_check_bits(&gsm0503_mcs_crc12, u, data_len, u + data_len); if (rc) -- To view, visit https://gerrit.osmocom.org/9994 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I9da22e7051522d06d923fcec3b63cbed8db93910 Gerrit-Change-Number: 9994 Gerrit-PatchSet: 1 Gerrit-Owner: Alexander Chemeris -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 14 19:13:11 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sat, 14 Jul 2018 19:13:11 +0000 Subject: Change in libosmocore[master]: coding: Documentation typo fix. Message-ID: Alexander Chemeris has uploaded this change for review. ( https://gerrit.osmocom.org/9995 Change subject: coding: Documentation typo fix. ...................................................................... coding: Documentation typo fix. Change-Id: I6ca873b3decaf50e7b79b5ab2269919c862a4fe0 --- M src/coding/gsm0503_coding.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/95/9995/1 diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index 1d06adb..2eb8cba 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -927,7 +927,7 @@ * \param[in] nbits number of bits in \a bursts * \param usf_p unused argument ?!? * \param[out] n_errors number of detected bit-errors - * \param[out] n_bits_total total number of dcoded bits + * \param[out] n_bits_total total number of decoded bits * \returns 0 on success; negative on error */ int gsm0503_pdtch_egprs_decode(uint8_t *l2_data, const sbit_t *bursts, uint16_t nbits, uint8_t *usf_p, int *n_errors, int *n_bits_total) -- To view, visit https://gerrit.osmocom.org/9995 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I6ca873b3decaf50e7b79b5ab2269919c862a4fe0 Gerrit-Change-Number: 9995 Gerrit-PatchSet: 1 Gerrit-Owner: Alexander Chemeris -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 14 19:13:11 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sat, 14 Jul 2018 19:13:11 +0000 Subject: Change in libosmocore[master]: coding: Always initialize bit counters in gsm0503_pdtch_egprs_decode(). Message-ID: Alexander Chemeris has uploaded this change for review. ( https://gerrit.osmocom.org/9996 Change subject: coding: Always initialize bit counters in gsm0503_pdtch_egprs_decode(). ...................................................................... coding: Always initialize bit counters in gsm0503_pdtch_egprs_decode(). Previsouly there were a lot of valid code paths which returned from the function before setting bit counters which led to bogus BER output in osmo-bts-trx logs when those code paths were hit. Change-Id: I4722cae3794ccbb12001113c991d9cf345a52a96 --- M src/coding/gsm0503_coding.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/96/9996/1 diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index 2eb8cba..6be4001 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -938,6 +938,9 @@ struct egprs_cps cps; union gprs_rlc_ul_hdr_egprs *hdr; + if (n_errors) *n_errors = 0; + if (n_bits_total) *n_bits_total = 0; + if ((nbits != GSM0503_GPRS_BURSTS_NBITS) && (nbits != GSM0503_EGPRS_BURSTS_NBITS)) { /* Invalid EGPRS bit length */ -- To view, visit https://gerrit.osmocom.org/9996 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I4722cae3794ccbb12001113c991d9cf345a52a96 Gerrit-Change-Number: 9996 Gerrit-PatchSet: 1 Gerrit-Owner: Alexander Chemeris -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 14 19:13:12 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sat, 14 Jul 2018 19:13:12 +0000 Subject: Change in libosmocore[master]: coding: Correctly count bits when decoding EDGE bursts with MCS >= 7. Message-ID: Alexander Chemeris has uploaded this change for review. ( https://gerrit.osmocom.org/9997 Change subject: coding: Correctly count bits when decoding EDGE bursts with MCS >= 7. ...................................................................... coding: Correctly count bits when decoding EDGE bursts with MCS >= 7. They consist of two blocks, so we should count both blocks. Change-Id: I560de192212dae4705054a1665726369b83d213a --- M src/coding/gsm0503_coding.c 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/97/9997/1 diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index 6be4001..527e9cb 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -982,6 +982,9 @@ if (rc < 0) return -EFAULT; } else { + /* Bit counters for the second block */ + int n_errors2, n_bits_total2; + /* MCS-7,8,9 block 1 */ rc = egprs_decode_data(l2_data, c1, cps.mcs, cps.p[0], 0, n_errors, n_bits_total); @@ -991,6 +994,8 @@ /* MCS-7,8,9 block 2 */ rc = egprs_decode_data(l2_data, c2, cps.mcs, cps.p[1], 1, n_errors, n_bits_total); + if (n_errors) *n_errors += n_errors2; + if (n_bits_total) *n_bits_total += n_bits_total2; if (rc < 0) return -EFAULT; } -- To view, visit https://gerrit.osmocom.org/9997 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I560de192212dae4705054a1665726369b83d213a Gerrit-Change-Number: 9997 Gerrit-PatchSet: 1 Gerrit-Owner: Alexander Chemeris -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 14 19:27:36 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sat, 14 Jul 2018 19:27:36 +0000 Subject: Change in libosmocore[master]: coding: Correctly count bits when decoding EDGE bursts with MCS >= 7. In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9997 to look at the new patch set (#2). Change subject: coding: Correctly count bits when decoding EDGE bursts with MCS >= 7. ...................................................................... coding: Correctly count bits when decoding EDGE bursts with MCS >= 7. They consist of two blocks, so we should count both blocks. Change-Id: I560de192212dae4705054a1665726369b83d213a --- M src/coding/gsm0503_coding.c 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/97/9997/2 -- To view, visit https://gerrit.osmocom.org/9997 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I560de192212dae4705054a1665726369b83d213a Gerrit-Change-Number: 9997 Gerrit-PatchSet: 2 Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 14 21:49:05 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 14 Jul 2018 21:49:05 +0000 Subject: Change in osmo-ttcn3-hacks[master]: bsc: fix f_gen_ass_req(): populate codec list Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/9998 Change subject: bsc: fix f_gen_ass_req(): populate codec list ...................................................................... bsc: fix f_gen_ass_req(): populate codec list f_gen_ass_req() looks like it generates a valid assignment request, but actually lacks the Speech Codec List IE. At least the following tests dispatch an erratic Assignment Request and expect failure, but were so far failing just because the Speech Codec List IE was missing: * TC_assignment_csd() * TC_assignment_ctm() The same bit me when I was trying to add TC_assignment_chan_act_nack(). Rather set some default codec list in f_gen_ass_req(). Callers that explicitly want a specific or omitted Speech Codec List (e.g. TC_assignment_fr_a5_1_codec_missing()) may still modify the returned template. Change-Id: Ia18e44e93b0328ad26d741a3317753118fc57f9f --- M bsc/BSC_Tests.ttcn 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/98/9998/1 diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 2897a0b..f407e58 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -572,6 +572,7 @@ var BSSMAP_IE_CircuitIdentityCode cic := valueof(ts_BSSMAP_IE_CIC(0,1)); ass_cmd := valueof(ts_BSSMAP_AssignmentReq(cic, omit)); } + ass_cmd.pdu.bssmap.assignmentRequest.codecList := valueof(ts_BSSMAP_IE_CodecList({ts_CodecFR})); return ass_cmd; } @@ -1630,6 +1631,7 @@ const OCT8 kc := '0001020304050607'O; ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelType); + ass_cmd.pdu.bssmap.assignmentRequest.codecList := omit; f_establish_fully(ass_cmd, exp_fail); } testcase TC_assignment_fr_a5_1_codec_missing() runs on test_CT { -- To view, visit https://gerrit.osmocom.org/9998 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ia18e44e93b0328ad26d741a3317753118fc57f9f Gerrit-Change-Number: 9998 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 14 21:49:05 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 14 Jul 2018 21:49:05 +0000 Subject: Change in osmo-ttcn3-hacks[master]: bsc: fix f_establish_fully(): first RSL should be EST IND, not DATA Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/9999 Change subject: bsc: fix f_establish_fully(): first RSL should be EST IND, not DATA ...................................................................... bsc: fix f_establish_fully(): first RSL should be EST IND, not DATA Change-Id: Ia609b67c28ce07fa3bf33e3c4a5658046474d60a --- M bsc/MSC_ConnectionHandler.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/99/9999/1 diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index ba4d19d..794fcda 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -650,7 +650,7 @@ f_rslem_register(0, new_chan_nr); var PDU_ML3_MS_NW l3_tx := valueof(ts_RRM_AssignmentComplete('00'O)); /* send assignment complete over the new channel */ - RSL.send(ts_RSL_DATA_IND(new_chan_nr, valueof(ts_RslLinkID_DCCH(0)), + RSL.send(ts_RSL_EST_IND(new_chan_nr, valueof(ts_RslLinkID_DCCH(0)), enc_PDU_ML3_MS_NW(l3_tx))); /* by default, send via the new channel from now */ st.old_chan_nr := g_chan_nr; -- To view, visit https://gerrit.osmocom.org/9999 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ia609b67c28ce07fa3bf33e3c4a5658046474d60a Gerrit-Change-Number: 9999 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 14 21:49:08 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 14 Jul 2018 21:49:08 +0000 Subject: Change in osmo-ttcn3-hacks[master]: bsc: fix as_handover(): first RSL should be EST IND, not DATA Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10000 Change subject: bsc: fix as_handover(): first RSL should be EST IND, not DATA ...................................................................... bsc: fix as_handover(): first RSL should be EST IND, not DATA Change-Id: I41b395eb7dbdd56796706722d79c7a3bc5a0b5b0 --- M bsc/MSC_ConnectionHandler.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/00/10000/1 diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index 794fcda..daa4caf 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -982,7 +982,7 @@ /* send handover complete over the new channel */ var PDU_ML3_MS_NW l3_tx := valueof(ts_RRM_HandoverComplete('00'O)); - RSL1.send(ts_RSL_DATA_IND(new_chan_nr, valueof(ts_RslLinkID_DCCH(0)), + RSL1.send(ts_RSL_EST_IND(new_chan_nr, valueof(ts_RslLinkID_DCCH(0)), enc_PDU_ML3_MS_NW(l3_tx))); /* by default, send via the new channel from now */ st.old_chan_nr := g_chan_nr; -- To view, visit https://gerrit.osmocom.org/10000 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I41b395eb7dbdd56796706722d79c7a3bc5a0b5b0 Gerrit-Change-Number: 10000 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Sat Jul 14 23:58:08 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Sat, 14 Jul 2018 23:58:08 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-osmo-sip-connector_=C2=BB_a1=3D?= =?UTF-8?Q?default,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#519?= Message-ID: <581095494.182.1531612688564.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 9.23 KB...] checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking for objdir... .libs checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC -DPIC checking if gcc PIC flag -fPIC -DPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.o... (cached) yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking for pkg-config... /usr/bin/pkg-config checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.20... yes checking for ANSI C header files... (cached) yes checking execinfo.h usability... yes checking execinfo.h presence... yes checking for execinfo.h... yes checking sys/select.h usability... yes checking sys/select.h presence... yes checking for sys/select.h... yes checking sys/socket.h usability... yes checking sys/socket.h presence... yes checking for sys/socket.h... yes checking sys/timerfd.h usability... yes checking sys/timerfd.h presence... yes checking for sys/timerfd.h... yes checking syslog.h usability... yes checking syslog.h presence... yes checking for syslog.h... yes checking ctype.h usability... yes checking ctype.h presence... yes checking for ctype.h... yes checking netinet/tcp.h usability... yes checking netinet/tcp.h presence... yes checking for netinet/tcp.h... yes checking for size_t... yes checking for working alloca.h... yes checking for alloca... yes checking for library containing dlopen... -ldl checking for library containing dlsym... -ldl checking for backtrace in -lexecinfo... no checking for doxygen... /usr/bin/doxygen checking whether SYS_getrandom is declared... yes checking if gcc supports -fvisibility=hidden... yes checking for clock_gettime... yes checking for localtime_r... yes checking whether struct tm has tm_gmtoff member... yes checking for TALLOC... yes checking for PCSC... yes checking for LIBGNUTLS... yes checking whether C compiler accepts -mavx2... yes checking whether C compiler accepts -mssse3... yes checking whether C compiler accepts -msse4.1... yes checking whether gcc has __builtin_cpu_supports built-in... yes CFLAGS="-g -O2 -DBUILDING_LIBOSMOCORE -Wall" CPPFLAGS=" -DBUILDING_LIBOSMOCORE -Wall" checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating libosmocore.pc config.status: creating libosmocodec.pc config.status: creating libosmocoding.pc config.status: creating libosmovty.pc config.status: creating libosmogsm.pc config.status: creating libosmogb.pc config.status: creating libosmoctrl.pc config.status: creating libosmosim.pc config.status: creating include/Makefile config.status: creating src/Makefile config.status: creating src/vty/Makefile config.status: creating src/codec/Makefile config.status: creating src/coding/Makefile config.status: creating src/sim/Makefile config.status: creating src/gsm/Makefile config.status: creating src/gb/Makefile config.status: creating src/ctrl/Makefile config.status: creating src/pseudotalloc/Makefile config.status: creating tests/Makefile config.status: creating tests/atlocal config.status: creating utils/Makefile config.status: creating Doxyfile.core config.status: creating Doxyfile.gsm config.status: creating Doxyfile.vty config.status: creating Doxyfile.codec config.status: creating Doxyfile.coding config.status: creating Doxyfile.gb config.status: creating Doxyfile.ctrl config.status: creating Makefile config.status: creating config.h config.status: executing tests/atconfig commands config.status: executing depfiles commands config.status: executing libtool commands + make -j 8 install echo 0.11.0.71-f2cda > .version-t && mv .version-t .version make install-recursive make[1]: Entering directory ' Making install in include make[2]: Entering directory ' GEN osmocom/gsm/gsm0503.h Generating header file... Generate 'xcch' declaration Generate 'rach' declaration Generate 'rach_ext' declaration Generate 'sch' declaration Generate 'cs2' declaration Generate 'cs3' declaration Generate 'cs2_np' declaration Generate 'cs3_np' declaration Generate 'tch_afs_12_2' declaration Generate 'tch_afs_10_2' declaration Generate 'tch_afs_7_95' declaration Generate 'tch_afs_7_4' declaration Generate 'tch_afs_6_7' declaration Generate 'tch_afs_5_9' declaration Generate 'tch_afs_5_15' declaration Generate 'tch_afs_4_75' declaration Generate 'tch_fr' declaration Generate 'tch_hr' declaration Generate 'tch_ahs_7_95' declaration Generate 'tch_ahs_7_4' declaration Generate 'tch_ahs_6_7' declaration Generate 'tch_ahs_5_9' declaration Generate 'tch_ahs_5_15' declaration Generate 'tch_ahs_4_75' declaration Generate 'mcs1_dl_hdr' declaration Generate 'mcs1_ul_hdr' declaration Generate 'mcs1' declaration Generate 'mcs2' declaration Generate 'mcs3' declaration Generate 'mcs4' declaration Generate 'mcs5_dl_hdr' declaration Generate 'mcs5_ul_hdr' declaration Generate 'mcs5' declaration Generate 'mcs6' declaration Generate 'mcs7_dl_hdr' declaration Generate 'mcs7_ul_hdr' declaration Generate 'mcs7' declaration Generate 'mcs8' declaration Generate 'mcs9' declaration Generation complete. make install-am make[3]: Entering directory ' GEN osmocom/core/bit32gen.h GEN osmocom/core/bit16gen.h GEN osmocom/core/bit64gen.h GEN osmocom/core/crc16gen.h GEN osmocom/core/crc32gen.h GEN osmocom/core/crc64gen.h GEN osmocom/core/bit32gen.h GEN osmocom/core/bit64gen.h GEN osmocom/core/crc8gen.h GEN osmocom/core/crc32gen.h GEN osmocom/core/crc8gen.h GEN osmocom/core/crc16gen.h GEN osmocom/core/crc64gen.h GEN osmocom/core/bit16gen.h make[4]: Entering directory ' make[4]: Nothing to be done for 'install-exec-am'. /bin/mkdir -p ' /bin/mkdir -p ' /usr/bin/install -c -m 644 osmocom/core/application.h osmocom/core/backtrace.h osmocom/core/bit16gen.h osmocom/core/bit32gen.h osmocom/core/bit64gen.h osmocom/core/bits.h osmocom/core/bitvec.h osmocom/core/bitcomp.h osmocom/core/byteswap.h osmocom/core/conv.h osmocom/core/counter.h osmocom/core/crc16.h osmocom/core/crc16gen.h osmocom/core/crc32gen.h osmocom/core/crc64gen.h osmocom/core/crc8gen.h osmocom/core/crcgen.h osmocom/core/endian.h osmocom/core/defs.h osmocom/core/fsm.h osmocom/core/gsmtap.h osmocom/core/gsmtap_util.h osmocom/core/isdnhdlc.h osmocom/core/linuxlist.h osmocom/core/linuxrbtree.h osmocom/core/logging.h osmocom/core/loggingrb.h osmocom/core/stats.h osmocom/core/macaddr.h osmocom/core/msgb.h osmocom/core/panic.h osmocom/core/prbs.h osmocom/core/prim.h osmocom/core/process.h osmocom/core/rate_ctr.h osmocom/core/stat_item.h osmocom/core/select.h osmocom/core/sercomm.h osmocom/core/signal.h osmocom/core/socket.h ' /bin/mkdir -p ' /usr/bin/install -c -m 644 osmocom/coding/gsm0503_tables.h osmocom/coding/gsm0503_parity.h osmocom/coding/gsm0503_mapping.h osmocom/coding/gsm0503_interleaving.h osmocom/coding/gsm0503_coding.h ' /bin/mkdir -p ' /usr/bin/install -c -m 644 osmocom/core/statistics.h osmocom/core/strrb.h osmocom/core/talloc.h osmocom/core/timer.h osmocom/core/timer_compat.h osmocom/core/utils.h osmocom/core/write_queue.h osmocom/core/plugin.h osmocom/core/msgfile.h osmocom/core/serial.h ' /bin/mkdir -p ' /usr/bin/install -c -m 644 osmocom/vty/buffer.h osmocom/vty/command.h osmocom/vty/logging.h osmocom/vty/stats.h osmocom/vty/misc.h osmocom/vty/telnet_interface.h osmocom/vty/vector.h osmocom/vty/vty.h osmocom/vty/ports.h ' /bin/mkdir -p ' /usr/bin/install -c -m 644 osmocom/gsm/protocol/gsm_03_40.h osmocom/gsm/protocol/gsm_03_41.h osmocom/gsm/protocol/gsm_04_08.h osmocom/gsm/protocol/gsm_04_08_gprs.h osmocom/gsm/protocol/gsm_04_11.h osmocom/gsm/protocol/gsm_04_12.h osmocom/gsm/protocol/gsm_04_14.h osmocom/gsm/protocol/gsm_04_80.h osmocom/gsm/protocol/gsm_08_08.h osmocom/gsm/protocol/gsm_08_58.h osmocom/gsm/protocol/gsm_09_02.h osmocom/gsm/protocol/gsm_12_21.h osmocom/gsm/protocol/gsm_23_003.h osmocom/gsm/protocol/gsm_44_318.h osmocom/gsm/protocol/ipaccess.h osmocom/gsm/protocol/smpp34_osmocom.h ' /bin/mkdir -p ' /usr/bin/install -c -m 644 osmocom/sim/class_tables.h osmocom/sim/sim.h ' /bin/mkdir -p ' /usr/bin/install -c -m 644 osmocom/gprs/gprs_bssgp.h osmocom/gprs/gprs_bssgp_bss.h osmocom/gprs/gprs_msgb.h osmocom/gprs/gprs_ns.h osmocom/gprs/gprs_ns_frgre.h osmocom/gprs/gprs_rlc.h ' /bin/mkdir -p ' /usr/bin/install -c -m 644 osmocom/crypt/auth.h osmocom/crypt/gprs_cipher.h ' /bin/mkdir -p ' /usr/bin/install -c -m 644 osmocom/gsm/a5.h osmocom/gsm/abis_nm.h osmocom/gsm/apn.h osmocom/gsm/bts_features.h osmocom/gsm/comp128.h osmocom/gsm/comp128v23.h osmocom/gsm/bitvec_gsm.h osmocom/gsm/gan.h osmocom/gsm/gsm0341.h osmocom/gsm/gsm0411_smc.h osmocom/gsm/gsm0411_smr.h osmocom/gsm/gsm0411_utils.h osmocom/gsm/gsm0480.h osmocom/gsm/gsm0502.h osmocom/gsm/gsm0503.h osmocom/gsm/gsm0808.h osmocom/gsm/gsm0808_utils.h osmocom/gsm/gsm23003.h osmocom/gsm/gsm48.h osmocom/gsm/gsm48_ie.h osmocom/gsm/gsm_utils.h osmocom/gsm/gsup.h osmocom/gsm/ipa.h osmocom/gsm/lapd_core.h osmocom/gsm/lapdm.h osmocom/gsm/meas_rep.h osmocom/gsm/mncc.h osmocom/gsm/prim.h osmocom/gsm/l1sap.h osmocom/gsm/oap.h osmocom/gsm/rsl.h osmocom/gsm/rxlev_stat.h osmocom/gsm/sysinfo.h osmocom/gsm/tlv.h ' /bin/mkdir -p ' /usr/bin/install -c -m 644 osmocom/ctrl/control_cmd.h osmocom/ctrl/control_if.h osmocom/ctrl/ports.h osmocom/ctrl/control_vty.h ' /bin/mkdir -p ' /usr/bin/install -c -m 644 osmocom/gprs/protocol/gsm_04_60.h osmocom/gprs/protocol/gsm_08_16.h osmocom/gprs/protocol/gsm_08_18.h ' /bin/mkdir -p ' /usr/bin/install -c -m 644 osmocom/codec/ecu.h osmocom/codec/codec.h osmocom/codec/gsm610_bits.h ' make[4]: Leaving directory ' make[3]: Leaving directory ' make[2]: Leaving directory ' Making install in src make[2]: Entering directory ' GEN crc16gen.c GEN crc8gen.c GEN crc64gen.c GEN crc32gen.c make install-am make[3]: Entering directory ' CC timer.lo CC timer_gettimeofday.lo CC bits.lo CC select.lo CC bitvec.lo CC signal.lo CC timer_clockgettime.lo CC msgb.lo CC bitcomp.lo CC counter.lo CC fsm.lo CC write_queue.lo CC utils.lo CC socket.lo CC logging.lo CC logging_syslog.lo CC logging_gsmtap.lo CC rate_ctr.lo CC gsmtap_util.lo CC crc16.lo CC panic.lo CC backtrace.lo CC conv.lo CC application.lo CC rbtree.lo CC strrb.lo CC loggingrb.lo CC crc8gen.lo CC crc16gen.lo CC crc32gen.lo malloc: .././dispose_cmd.c:249: assertion botched free: start and end chunk sizes differ Aborting.../bin/bash: line 2: 4174 Aborted /bin/bash ../libtool --silent --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I../include -I../include -DBUILDING_LIBOSMOCORE -Wall -Wall -g -O2 -DBUILDING_LIBOSMOCORE -Wall -MT crc8gen.lo -MD -MP -MF $depbase.Tpo -c -o crc8gen.lo crc8gen.c Makefile:548: recipe for target 'crc8gen.lo' failed make[3]: *** [crc8gen.lo] Error 134 make[3]: *** Waiting for unfinished jobs.... make[3]: Leaving directory ' Makefile:652: recipe for target 'install' failed make[2]: *** [install] Error 2 make[2]: Leaving directory ' Makefile:604: recipe for target 'install-recursive' failed make[1]: *** [install-recursive] Error 1 make[1]: Leaving directory ' Makefile:903: recipe for target 'install' failed make: *** [install] Error 2 Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From jenkins at lists.osmocom.org Sun Jul 15 03:09:32 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Sun, 15 Jul 2018 03:09:32 +0000 (UTC) Subject: =?UTF-8?Q?Jenkins_build_is_back_to_norma?= =?UTF-8?Q?l_:_master-osmo-sip-connector_=C2=BB?= =?UTF-8?Q?_a1=3Ddefault,a2=3Ddefault,a3=3Ddefa?= =?UTF-8?Q?ult,osmocom-master-debian9_#520?= In-Reply-To: <581095494.182.1531612688564.JavaMail.jenkins@jenkins.osmocom.org> References: <581095494.182.1531612688564.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <1178356802.183.1531624172811.JavaMail.jenkins@jenkins.osmocom.org> See From gerrit-no-reply at lists.osmocom.org Sun Jul 15 11:27:00 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 15 Jul 2018 11:27:00 +0000 Subject: Change in libosmocore[master]: coding: Fix (E)GPRS BER calculation to correctly account for puncturing. In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/9994 ) Change subject: coding: Fix (E)GPRS BER calculation to correctly account for puncturing. ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/9994 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9da22e7051522d06d923fcec3b63cbed8db93910 Gerrit-Change-Number: 9994 Gerrit-PatchSet: 1 Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Sun, 15 Jul 2018 11:27:00 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 15 11:27:18 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 15 Jul 2018 11:27:18 +0000 Subject: Change in libosmocore[master]: coding: Documentation typo fix. In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/9995 ) Change subject: coding: Documentation typo fix. ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/9995 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6ca873b3decaf50e7b79b5ab2269919c862a4fe0 Gerrit-Change-Number: 9995 Gerrit-PatchSet: 1 Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Sun, 15 Jul 2018 11:27:18 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 15 11:31:58 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 15 Jul 2018 11:31:58 +0000 Subject: Change in libosmocore[master]: coding: Always initialize bit counters in gsm0503_pdtch_egprs_decode(). In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/9996 ) Change subject: coding: Always initialize bit counters in gsm0503_pdtch_egprs_decode(). ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/9996/1/src/coding/gsm0503_coding.c File src/coding/gsm0503_coding.c: https://gerrit.osmocom.org/#/c/9996/1/src/coding/gsm0503_coding.c at 942 PS1, Line 942: if (n_bits_total) *n_bits_total = 0; Do we also initialize both variables on other decoding functions? And why not to initialize both by caller? -- To view, visit https://gerrit.osmocom.org/9996 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4722cae3794ccbb12001113c991d9cf345a52a96 Gerrit-Change-Number: 9996 Gerrit-PatchSet: 1 Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Sun, 15 Jul 2018 11:31:58 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Sun Jul 15 12:26:48 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Sun, 15 Jul 2018 12:26:48 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-gapk_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#21?= In-Reply-To: <1532392046.180.1531571207977.JavaMail.jenkins@jenkins.osmocom.org> References: <1532392046.180.1531571207977.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <254839191.192.1531657608108.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 127.15 KB...] checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether make supports nested variables... (cached) yes checking if gcc supports -fvisibility=hidden... yes checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking whether gcc understands -c and -o together... (cached) yes checking dependency style of gcc... (cached) gcc3 checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for LIBOSMOCORE... yes checking for LIBOSMOCODEC... yes checking for LIBALSA... yes checking for OPENCORE_AMRNB... yes checking gsm/gsm.h usability... yes checking gsm/gsm.h presence... yes checking for gsm/gsm.h... yes checking for gsm_create in -lgsm... yes checking for stdint.h... (cached) yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking for unistd.h... (cached) yes checking for inline... inline checking for int16_t... yes checking for int32_t... yes checking for uint16_t... yes checking for uint32_t... yes checking for uint64_t... yes checking for uint8_t... yes checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... yes checking for memset... yes checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating src/Makefile config.status: creating libgsmhr/Makefile config.status: creating include/Makefile config.status: creating include/gsmhr/Makefile config.status: creating libosmogapk.pc config.status: creating tests/atlocal config.status: creating tests/Makefile config.status: creating config.h config.status: executing depfiles commands config.status: executing libtool commands config.status: executing tests/atconfig commands make[1]: Entering directory ' make all-recursive make[2]: Entering directory ' Making all in include make[3]: Entering directory ' make[4]: Entering directory ' make[4]: Nothing to be done for 'all-am'. make[4]: Leaving directory ' make[3]: Leaving directory ' Making all in src make[3]: Entering directory ' CC procqueue.lo CC pq_format.lo CC pq_codec.lo CC pq_file.lo CC pq_alsa.lo CC pq_rtp.lo CC pq_ecu.lo CC ecu_fr.lo CC formats.lo CC fmt_ti.lo CC fmt_amr.lo CC fmt_gsm.lo CC fmt_hr_ref.lo CC fmt_racal.lo CC fmt_rawpcm.lo CC fmt_rtp_amr.lo CC fmt_rtp_efr.lo CC fmt_rtp_hr_etsi.lo CC fmt_rtp_hr_ietf.lo CC fmt_amr_opencore.lo CC codecs.lo CC codec_pcm.lo CC codec_hr.lo CC codec_fr.lo CC codec_efr.lo CC codec_amr.lo CC benchmark.lo CC common.lo CCLD libosmogapk.la CC app_osmo_gapk.o CCLD osmo-gapk make[3]: Leaving directory ' Making all in tests make[3]: Entering directory ' make[3]: Nothing to be done for 'all'. make[3]: Leaving directory ' make[3]: Entering directory ' make[3]: Leaving directory ' make[2]: Leaving directory ' make[1]: Leaving directory ' make[1]: Entering directory ' Making dvi in include make[2]: Entering directory ' make[3]: Entering directory ' make[3]: Nothing to be done for 'dvi-am'. make[3]: Leaving directory ' make[2]: Leaving directory ' Making dvi in src make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi'. make[2]: Leaving directory ' Making dvi in tests make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi'. make[2]: Leaving directory ' make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi-am'. make[2]: Leaving directory ' make[1]: Leaving directory ' make[1]: Entering directory ' Making check in include make[2]: Entering directory ' make[3]: Entering directory ' make[3]: Nothing to be done for 'check-am'. make[3]: Leaving directory ' make[2]: Leaving directory ' Making check in src make[2]: Entering directory ' make[2]: Nothing to be done for 'check'. make[2]: Leaving directory ' Making check in tests make[2]: Entering directory ' make procqueue/pq_test io/pq_file_test io/pq_rtp_test ecu/ecu_fr_test make[3]: Entering directory ' CC procqueue/pq_test.o CCLD procqueue/pq_test CC io/pq_file_test.o CCLD io/pq_file_test CC io/pq_rtp_test.o CCLD io/pq_rtp_test CC ecu/ecu_fr_test.o CCLD ecu/ecu_fr_test make[3]: Leaving directory ' make check-local make[3]: Entering directory ' /bin/bash '../../../tests/testsuite' ## ---------------------------- ## ## gapk 0.4.75-27bc test suite. ## ## ---------------------------- ## Regression tests. 1: procqueue ok 2: io/pq_file FAILED (testsuite.at:13) 3: io/pq_rtp ok 4: ecu/ecu_fr_test ok 5: conv/enc/amr_efr ok 6: conv/enc/gsm ok 7: conv/enc/racal_hr skipped (testsuite.at:58) 8: conv/enc/racal_fr ok 9: conv/enc/racal_efr ok 10: conv/enc/ti_hr skipped (testsuite.at:91) 11: conv/enc/ti_fr ok 12: conv/enc/ti_efr ok 13: conv/enc/rtp_efr ok 14: conv/enc/rtp_hr_etsi skipped (testsuite.at:135) 15: conv/enc/rtp_hr_ietf skipped (testsuite.at:146) 16: conv/dec/amr_efr ok 17: conv/dec/gsm ok 18: conv/dec/racal_hr skipped (testsuite.at:179) 19: conv/dec/racal_fr ok 20: conv/dec/racal_efr ok 21: conv/dec/ti_hr skipped (testsuite.at:212) 22: conv/dec/ti_fr ok 23: conv/dec/ti_efr ok 24: conv/dec/rtp_efr ok 25: conv/dec/rtp_hr_etsi skipped (testsuite.at:256) 26: conv/dec/rtp_hr_ietf skipped (testsuite.at:267) ## ------------- ## ## Test results. ## ## ------------- ## ERROR: 18 tests were run, 1 failed unexpectedly. 8 tests were skipped. ## -------------------------- ## ## testsuite.log was created. ## ## -------------------------- ## Please send `tests/testsuite.log' and all information you think might help: To: Subject: [gapk 0.4.75-27bc] testsuite: 2 failed You may investigate any problem if you feel able to do so, in which case the test suite provides a good starting point. Its output may be found below `tests/testsuite.dir'. Makefile:753: recipe for target 'check-local' failed make[3]: *** [check-local] Error 1 make[3]: Leaving directory ' Makefile:602: recipe for target 'check-am' failed make[2]: *** [check-am] Error 2 make[2]: Leaving directory ' Makefile:479: recipe for target 'check-recursive' failed make[1]: *** [check-recursive] Error 1 make[1]: Leaving directory ' Makefile:684: recipe for target 'distcheck' failed make: *** [distcheck] Error 1 + cat-testlogs.sh ======================== ./gapk-0.4.75-27bc/_build/sub/tests/testsuite.dir/02/testsuite.log # -*- compilation -*- 2. testsuite.at:10: testing io/pq_file ... ../../../tests/testsuite.at:13: $abs_top_builddir/tests/io/pq_file_test \ $abs_top_builddir/tests/io/io_sample.txt --- /dev/null 2018-03-27 19:17:06.212284948 +0000 +++ 2018-07-15 12:26:47.393630084 +0000 @@ -0,0 +1,2 @@ +pq_file_test: ../../../tests/io/pq_file_test.c:132: main: Assertion `sample_file != NULL' failed. +: line 29: 30177 Aborted $abs_top_builddir/tests/io/pq_file_test $abs_top_builddir/tests/io/io_sample.txt --- expout 2018-07-15 12:26:47.385630148 +0000 +++ 2018-07-15 12:26:47.385630148 +0000 @@ -1,12 +0,0 @@ -Processing sample file with blk_len=2: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=4: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=8: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=16: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=32: -8217c8fb7675a95008f9089d883gapk - -chunk null_context: depth=0 ../../../tests/testsuite.at:13: exit code was 134, expected 0 2. testsuite.at:10: 2. io/pq_file (testsuite.at:10): FAILED (testsuite.at:13) Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From jenkins at lists.osmocom.org Sun Jul 15 15:10:06 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Sun, 15 Jul 2018 15:10:06 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-asn1c_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#185?= In-Reply-To: <1939936555.181.1531581006387.JavaMail.jenkins@jenkins.osmocom.org> References: <1939936555.181.1531581006387.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <698968748.193.1531667406459.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 3.67 KB...] + ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for style of include used by make... GNU checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking how to run the C++ preprocessor... g++ -E checking for g77... no checking for f77... no checking for xlf... no checking for frt... no checking for pgf77... no checking for cf77... no checking for fort77... no checking for fl32... no checking for af77... no checking for f90... no checking for xlf90... no checking for pgf90... no checking for pghpf... no checking for epcf90... no checking for gfortran... no checking for g95... no checking for f95... no checking for fort... no checking for xlf95... no checking for ifort... no checking for ifc... no checking for efc... no checking for pgf95... no checking for lf95... no checking for ftn... no checking whether we are using the GNU Fortran 77 compiler... no checking whether accepts -g... no checking the maximum length of command line arguments... 32768 checking command to parse /usr/bin/nm -B output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes configure: creating libtool appending configuration tag "CXX" to libtool checking for ld used by g++... /usr/bin/ld -m elf_x86_64 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC checking if g++ PIC flag -fPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate appending configuration tag "F77" to libtool checking for autoconf... /usr/bin/autoconf checking for autoheader... /usr/bin/autoheader checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking dependency style of gcc... (cached) gcc3 checking how to run the C preprocessor... gcc -E checking for a BSD-compatible install... /usr/bin/install -c checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking for bison... bison -y checking for flex... flex checking for yywrap in -lfl... yes checking lex output file root... lex.yy checking whether yytext is a pointer... yes checking for ar... /usr/bin/ar checking for ANSI C header files... (cached) yes checking sys/param.h usability... yes checking sys/param.h presence... yes checking for sys/param.h... yes checking whether byte ordering is bigendian... no checking for off_t... yes checking for size_t... yes checking whether struct tm is in sys/time.h or time.h... time.h checking for intmax_t... yes checking for library containing getopt... none required checking for strtoimax... yes checking for strtoll... yes checking for mergesort... no checking for mkstemps... yes configure: creating ./config.status config.status: creating skeletons/standard-modules/Makefile config.status: creating skeletons/tests/Makefile config.status: creating libasn1compiler/Makefile config.status: creating libasn1parser/Makefile config.status: creating libasn1print/Makefile config.status: creating asn1c/webcgi/Makefile config.status: creating asn1c/tests/Makefile config.status: creating libasn1fix/Makefile config.status: creating skeletons/Makefile config.status: creating examples/Makefile config.status: creating tests/Makefile config.status: creating asn1c/Makefile config.status: creating doc/Makefile config.status: creating asn1c.spec config.status: creating Makefile config.status: creating config.h config.status: executing depfiles commands + make -j 8 make all-recursive make[1]: Entering directory ' Making all in libasn1parser make[2]: Entering directory ' if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF ".deps/asn1parser.Tpo" -c -o asn1parser.lo asn1parser.c; \ then mv -f ".deps/asn1parser.Tpo" ".deps/asn1parser.Plo"; else rm -f ".deps/asn1parser.Tpo"; exit 1; fi bison -y -p asn1p_ -d asn1p_y.y if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF ".deps/asn1p_l.Tpo" -c -o asn1p_l.lo asn1p_l.c; \ then mv -f ".deps/asn1p_l.Tpo" ".deps/asn1p_l.Plo"; else rm -f ".deps/asn1p_l.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF ".deps/asn1p_module.Tpo" -c -o asn1p_module.lo asn1p_module.c; \ then mv -f ".deps/asn1p_module.Tpo" ".deps/asn1p_module.Plo"; else rm -f ".deps/asn1p_module.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF ".deps/asn1p_oid.Tpo" -c -o asn1p_oid.lo asn1p_oid.c; \ then mv -f ".deps/asn1p_oid.Tpo" ".deps/asn1p_oid.Plo"; else rm -f ".deps/asn1p_oid.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF ".deps/asn1p_value.Tpo" -c -o asn1p_value.lo asn1p_value.c; \ then mv -f ".deps/asn1p_value.Tpo" ".deps/asn1p_value.Plo"; else rm -f ".deps/asn1p_value.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF ".deps/asn1p_expr.Tpo" -c -o asn1p_expr.lo asn1p_expr.c; \ then mv -f ".deps/asn1p_expr.Tpo" ".deps/asn1p_expr.Plo"; else rm -f ".deps/asn1p_expr.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF ".deps/asn1p_xports.Tpo" -c -o asn1p_xports.lo asn1p_xports.c; \ then mv -f ".deps/asn1p_xports.Tpo" ".deps/asn1p_xports.Plo"; else rm -f ".deps/asn1p_xports.Tpo"; exit 1; fi asn1p_y.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] mkdir .libs gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -fPIC -DPIC -o .libs/asn1p_module.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -fPIC -DPIC -o .libs/asn1p_xports.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -fPIC -DPIC -o .libs/asn1p_value.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -fPIC -DPIC -o .libs/asn1parser.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -fPIC -DPIC -o .libs/asn1p_l.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -fPIC -DPIC -o .libs/asn1p_oid.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -fPIC -DPIC -o .libs/asn1p_expr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -o asn1p_xports.o >/dev/null 2>&1 asn1p_l.c:3521:12: warning: 'input' defined but not used [-Wunused-function] static int input() ^~~~~ gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -o asn1p_module.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -o asn1parser.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -o asn1p_oid.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF ".deps/asn1p_constr.Tpo" -c -o asn1p_constr.lo asn1p_constr.c; \ then mv -f ".deps/asn1p_constr.Tpo" ".deps/asn1p_constr.Plo"; else rm -f ".deps/asn1p_constr.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -o asn1p_value.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF ".deps/asn1p_param.Tpo" -c -o asn1p_param.lo asn1p_param.c; \ then mv -f ".deps/asn1p_param.Tpo" ".deps/asn1p_param.Plo"; else rm -f ".deps/asn1p_param.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -o asn1p_expr.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF ".deps/asn1p_class.Tpo" -c -o asn1p_class.lo asn1p_class.c; \ then mv -f ".deps/asn1p_class.Tpo" ".deps/asn1p_class.Plo"; else rm -f ".deps/asn1p_class.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF ".deps/asn1p_ref.Tpo" -c -o asn1p_ref.lo asn1p_ref.c; \ then mv -f ".deps/asn1p_ref.Tpo" ".deps/asn1p_ref.Plo"; else rm -f ".deps/asn1p_ref.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -fPIC -DPIC -o .libs/asn1p_constr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -fPIC -DPIC -o .libs/asn1p_param.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -fPIC -DPIC -o .libs/asn1p_ref.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -fPIC -DPIC -o .libs/asn1p_class.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -o asn1p_constr.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -o asn1p_param.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -o asn1p_ref.o >/dev/null 2>&1 if test -f y.tab.h; then \ to=`echo "asn1p_y_H" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \ sed -e "/^#/!b" -e "s/Y_TAB_H/$to/g" -e "s|y\.tab\.h|asn1p_y.h|" \ y.tab.h >asn1p_y.ht; \ rm -f y.tab.h; \ if cmp -s asn1p_y.ht asn1p_y.h; then \ rm -f asn1p_y.ht ;\ else \ mv asn1p_y.ht asn1p_y.h; \ fi; \ fi if test -f y.output; then \ mv y.output asn1p_y.output; \ fi sed '/^#/ s|y\.tab\.c|asn1p_y.c|' y.tab.c >asn1p_y.ct && mv asn1p_y.ct asn1p_y.c rm -f y.tab.c gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -o asn1p_class.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF ".deps/asn1p_y.Tpo" -c -o asn1p_y.lo asn1p_y.c; \ then mv -f ".deps/asn1p_y.Tpo" ".deps/asn1p_y.Plo"; else rm -f ".deps/asn1p_y.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -o asn1p_l.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF .deps/asn1p_y.Tpo -c asn1p_y.c -fPIC -DPIC -o .libs/asn1p_y.o asn1p_y.y: In function 'asn1p_parse': asn1p_y.y:357:13: error: 'param' undeclared (first use in this function) *(void **)param = $1; ^~~~~ asn1p_y.y:357:13: note: each undeclared identifier is reported only once for each function it appears in Makefile:299: recipe for target 'asn1p_y.lo' failed make[2]: *** [asn1p_y.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory ' Makefile:302: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory ' Makefile:212: recipe for target 'all' failed make: *** [all] Error 2 Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Sun Jul 15 22:06:20 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 15 Jul 2018 22:06:20 +0000 Subject: Change in osmo-gsm-tester[master]: ms: Quit early when all tests concluded.. In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9716 ) Change subject: ms: Quit early when all tests concluded.. ...................................................................... Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/9716/3/src/osmo_ms_driver/location_update_test.py File src/osmo_ms_driver/location_update_test.py: https://gerrit.osmocom.org/#/c/9716/3/src/osmo_ms_driver/location_update_test.py at 82 PS3, Line 82: self._outstanding = len(self._unstarted) > Why? Would you mind to elaborate of why this is the better number? Because you already have the value in a variable, so no need to calculate or get it from a function. And it's also easier to find out where the final value comes from, without having to look at the loop to find out it comes from a parameter. But as I said, it's fine too the way you did it, so no need to change the commit. I was just giving my opinion/thoughts after seeing the code. -- To view, visit https://gerrit.osmocom.org/9716 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3575ee7618c35e3b66d25fa31844d267489d9179 Gerrit-Change-Number: 9716 Gerrit-PatchSet: 3 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Sun, 15 Jul 2018 22:06:20 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 15 22:06:38 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 15 Jul 2018 22:06:38 +0000 Subject: Change in osmo-bts[master]: rsl: Use value_string to print encryption algo name In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/9902 ) Change subject: rsl: Use value_string to print encryption algo name ...................................................................... rsl: Use value_string to print encryption algo name Change-Id: I8303364270e73718e57f8efc2f375817b9496ffc --- M src/common/rsl.c 1 file changed, 5 insertions(+), 4 deletions(-) Approvals: Jenkins Builder: Verified Vadim Yanitskiy: Looks good to me, but someone else must approve Holger Freyther: Looks good to me, approved diff --git a/src/common/rsl.c b/src/common/rsl.c index 8bbf73c..9295240 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -865,12 +865,13 @@ { int rc; struct gsm_bts *bts = lchan->ts->trx->bts; + const char *ciph_name = get_value_string(gsm0808_chosen_enc_alg_names, *val); /* check if the encryption algorithm sent by BSC is supported! */ rc = bts_supports_cipher(bts, *val); if (rc != 1) { - LOGP(DRSL, LOGL_ERROR, "%s: BTS doesn't support cipher 0x%02x\n", - gsm_lchan_name(lchan), *val); + LOGP(DRSL, LOGL_ERROR, "%s: BTS doesn't support cipher %s\n", + gsm_lchan_name(lchan), ciph_name); return -EINVAL; } @@ -886,8 +887,8 @@ if (lchan->encr.key_len > sizeof(lchan->encr.key)) lchan->encr.key_len = sizeof(lchan->encr.key); memcpy(lchan->encr.key, val, lchan->encr.key_len); - DEBUGP(DRSL, "%s: Setting lchan cipher algorithm 0x%02x\n", - gsm_lchan_name(lchan), lchan->encr.alg_id); + DEBUGP(DRSL, "%s: Setting lchan cipher algorithm %s\n", + gsm_lchan_name(lchan), ciph_name); return 0; } -- To view, visit https://gerrit.osmocom.org/9902 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I8303364270e73718e57f8efc2f375817b9496ffc Gerrit-Change-Number: 9902 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 07:20:32 2018 From: gerrit-no-reply at lists.osmocom.org (Piotr Krysik) Date: Mon, 16 Jul 2018 07:20:32 +0000 Subject: Change in osmocom-bb[master]: trxcon: fix tail bits at the front of Access burst Message-ID: Piotr Krysik has uploaded this change for review. ( https://gerrit.osmocom.org/10001 Change subject: trxcon: fix tail bits at the front of Access burst ...................................................................... trxcon: fix tail bits at the front of Access burst Currently Access Burst generated by trxcon has 8 zero bits at the beginning. According to the 3GPP 05.02 specification (Chapter 5.2.7 Access burst) custom 8-bit extended tail bits sequence should be used: (BN0, BN1, BN2 ... BN7) = (0,0,1,1,1,0,1,0) After this fix trxcon sets correct 8-bit sequence at the front of Access burst. Change-Id: I1f624e783de6c585d2e292965c9e5810b0a4f27d --- M src/host/trxcon/sched_lchan_rach.c 1 file changed, 10 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/01/10001/1 diff --git a/src/host/trxcon/sched_lchan_rach.c b/src/host/trxcon/sched_lchan_rach.c index 2a09a37..3f6e2e1 100644 --- a/src/host/trxcon/sched_lchan_rach.c +++ b/src/host/trxcon/sched_lchan_rach.c @@ -42,6 +42,15 @@ #include "l1ctl.h" /** + * 8-bit RACH extended tail bits + * GSM 05.02 Chapter 5.2.7 Access burst (AB) + */ + +static ubit_t rach_ext_tail_bits[] = { + 0, 0, 1, 1, 1, 0, 1, 0, +}; + +/** * 41-bit RACH synchronization sequence * GSM 05.02 Chapter 5.2.7 Access burst (AB) */ @@ -79,7 +88,7 @@ } /* Compose RACH burst */ - memset(burst, 0, 8); /* TB */ + memcpy(burst, rach_ext_tail_bits, 8); /* TB */ memcpy(burst + 8, rach_synch_seq, 41); /* sync seq */ memcpy(burst + 49, payload, 36); /* payload */ memset(burst + 85, 0, 63); /* TB + GP */ -- To view, visit https://gerrit.osmocom.org/10001 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I1f624e783de6c585d2e292965c9e5810b0a4f27d Gerrit-Change-Number: 10001 Gerrit-PatchSet: 1 Gerrit-Owner: Piotr Krysik -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 08:09:39 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 08:09:39 +0000 Subject: Change in osmocom-bb[master]: trxcon: fix tail bits at the front of Access burst In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10001 ) Change subject: trxcon: fix tail bits at the front of Access burst ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10001 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1f624e783de6c585d2e292965c9e5810b0a4f27d Gerrit-Change-Number: 10001 Gerrit-PatchSet: 1 Gerrit-Owner: Piotr Krysik Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 16 Jul 2018 08:09:39 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 08:09:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 08:09:41 +0000 Subject: Change in osmocom-bb[master]: trxcon: fix tail bits at the front of Access burst In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10001 ) Change subject: trxcon: fix tail bits at the front of Access burst ...................................................................... trxcon: fix tail bits at the front of Access burst Currently Access Burst generated by trxcon has 8 zero bits at the beginning. According to the 3GPP 05.02 specification (Chapter 5.2.7 Access burst) custom 8-bit extended tail bits sequence should be used: (BN0, BN1, BN2 ... BN7) = (0,0,1,1,1,0,1,0) After this fix trxcon sets correct 8-bit sequence at the front of Access burst. Change-Id: I1f624e783de6c585d2e292965c9e5810b0a4f27d --- M src/host/trxcon/sched_lchan_rach.c 1 file changed, 10 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/host/trxcon/sched_lchan_rach.c b/src/host/trxcon/sched_lchan_rach.c index 2a09a37..3f6e2e1 100644 --- a/src/host/trxcon/sched_lchan_rach.c +++ b/src/host/trxcon/sched_lchan_rach.c @@ -42,6 +42,15 @@ #include "l1ctl.h" /** + * 8-bit RACH extended tail bits + * GSM 05.02 Chapter 5.2.7 Access burst (AB) + */ + +static ubit_t rach_ext_tail_bits[] = { + 0, 0, 1, 1, 1, 0, 1, 0, +}; + +/** * 41-bit RACH synchronization sequence * GSM 05.02 Chapter 5.2.7 Access burst (AB) */ @@ -79,7 +88,7 @@ } /* Compose RACH burst */ - memset(burst, 0, 8); /* TB */ + memcpy(burst, rach_ext_tail_bits, 8); /* TB */ memcpy(burst + 8, rach_synch_seq, 41); /* sync seq */ memcpy(burst + 49, payload, 36); /* payload */ memset(burst + 85, 0, 63); /* TB + GP */ -- To view, visit https://gerrit.osmocom.org/10001 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I1f624e783de6c585d2e292965c9e5810b0a4f27d Gerrit-Change-Number: 10001 Gerrit-PatchSet: 1 Gerrit-Owner: Piotr Krysik Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 08:11:56 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 08:11:56 +0000 Subject: Change in libosmocore[master]: coding: Fix (E)GPRS BER calculation to correctly account for puncturing. In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9994 ) Change subject: coding: Fix (E)GPRS BER calculation to correctly account for puncturing. ...................................................................... Patch Set 1: Code-Review+1 looks great. Hoewver, you will need to introduce an entry in libosmocoding.map in order to export the new symbol. -- To view, visit https://gerrit.osmocom.org/9994 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9da22e7051522d06d923fcec3b63cbed8db93910 Gerrit-Change-Number: 9994 Gerrit-PatchSet: 1 Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 16 Jul 2018 08:11:56 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 08:12:07 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 08:12:07 +0000 Subject: Change in libosmocore[master]: coding: Documentation typo fix. In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9995 ) Change subject: coding: Documentation typo fix. ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9995 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6ca873b3decaf50e7b79b5ab2269919c862a4fe0 Gerrit-Change-Number: 9995 Gerrit-PatchSet: 1 Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 16 Jul 2018 08:12:07 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 08:14:10 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 16 Jul 2018 08:14:10 +0000 Subject: Change in osmo-sgsn[master]: sgsn: Don't attempt to delete GTP pdp ctx if GGSN was restarted In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9993 ) Change subject: sgsn: Don't attempt to delete GTP pdp ctx if GGSN was restarted ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/9993/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/9993/1//COMMIT_MSG at 20 PS1, Line 20: when > What happens if the MS doesn't respond? When the PDP CTX DEACT is sent to the MS (gsm48_tx_gsm_deact_pdp_req), timer 3395 is armed. The first 4 times the timer fires, a retrans is sent (pdpctx_timer_cb). 5th time, sgsn_delete_pdp_ctx() is called, which will attempt to send a DEACT REQ towards the GGSN but not free the ctx if ggsn is not available. So indeed I think we need to check in the 5th time code path if ggsn is available or not and then free if not available. Good point there. -- To view, visit https://gerrit.osmocom.org/9993 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1c74098e181552c218e152bf4ac5035cea770428 Gerrit-Change-Number: 9993 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Holger Freyther Gerrit-Comment-Date: Mon, 16 Jul 2018 08:14:10 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 08:17:58 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Mon, 16 Jul 2018 08:17:58 +0000 Subject: Change in libosmocore[master]: coding: Fix (E)GPRS BER calculation to correctly account for puncturing. In-Reply-To: References: Message-ID: Alexander Chemeris has posted comments on this change. ( https://gerrit.osmocom.org/9994 ) Change subject: coding: Fix (E)GPRS BER calculation to correctly account for puncturing. ...................................................................... Patch Set 1: Hi, Harald. This is an internal function, it's not exported and is not declared in .h -- To view, visit https://gerrit.osmocom.org/9994 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9da22e7051522d06d923fcec3b63cbed8db93910 Gerrit-Change-Number: 9994 Gerrit-PatchSet: 1 Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 16 Jul 2018 08:17:58 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 08:23:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 08:23:55 +0000 Subject: Change in libosmocore[master]: coding: Always initialize bit counters in gsm0503_pdtch_egprs_decode(). In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9996 ) Change subject: coding: Always initialize bit counters in gsm0503_pdtch_egprs_decode(). ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/9996/1/src/coding/gsm0503_coding.c File src/coding/gsm0503_coding.c: https://gerrit.osmocom.org/#/c/9996/1/src/coding/gsm0503_coding.c at 942 PS1, Line 942: if (n_bits_total) *n_bits_total = 0; > Do we also initialize both variables on other decoding functions? And why not to initialize both by [?] I think if we initialize in the callee (i.e. here), then we should do in _all_ *_decode functions. Whether to initialize in the caller or callee (us): I think in general it's safest to do it here (callee), as we then do 'the right thing' no matter if the caller is lazy and forgets about proper initialization. However, if there are valid use cases where the counter should be preserved (i.e. incremented) over multiple calls, and each call should increment the counter, we must place the burden of zero-initialization on the caller. In any case, coding style should be observed (if clause on separate line). -- To view, visit https://gerrit.osmocom.org/9996 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4722cae3794ccbb12001113c991d9cf345a52a96 Gerrit-Change-Number: 9996 Gerrit-PatchSet: 1 Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Harald Welte Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 16 Jul 2018 08:23:55 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 08:26:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 08:26:24 +0000 Subject: Change in libosmocore[master]: coding: Correctly count bits when decoding EDGE bursts with MCS >= 7. In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9997 ) Change subject: coding: Correctly count bits when decoding EDGE bursts with MCS >= 7. ...................................................................... Patch Set 2: Code-Review+1 (1 comment) fine except for cosmetics https://gerrit.osmocom.org/#/c/9997/2/src/coding/gsm0503_coding.c File src/coding/gsm0503_coding.c: https://gerrit.osmocom.org/#/c/9997/2/src/coding/gsm0503_coding.c at 997 PS2, Line 997: if (n_errors) *n_errors += n_errors2; : if (n_bits_total) *n_bits_total += n_bits_total2; please observe coding style (separate line for if clause and statements inside the clause) -- To view, visit https://gerrit.osmocom.org/9997 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I560de192212dae4705054a1665726369b83d213a Gerrit-Change-Number: 9997 Gerrit-PatchSet: 2 Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 16 Jul 2018 08:26:24 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 10:05:52 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 16 Jul 2018 10:05:52 +0000 Subject: Change in osmocom-bb[master]: trxcon: fix tail bits at the front of Access burst In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/10001 ) Change subject: trxcon: fix tail bits at the front of Access burst ...................................................................... Patch Set 1: Code-Review+1 Amazing! Thanks! I missed this part of the specs... Moreover, I have seen that the bursts generated by Calypso-based phones have extended tail bits, but I thought that this is a side-effect of power ramping. Does the MS tester now accept such bursts? -- To view, visit https://gerrit.osmocom.org/10001 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1f624e783de6c585d2e292965c9e5810b0a4f27d Gerrit-Change-Number: 10001 Gerrit-PatchSet: 1 Gerrit-Owner: Piotr Krysik Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 16 Jul 2018 10:05:52 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 10:17:30 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 10:17:30 +0000 Subject: Change in libosmocore[master]: coding: Fix (E)GPRS BER calculation to correctly account for puncturing. In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9994 ) Change subject: coding: Fix (E)GPRS BER calculation to correctly account for puncturing. ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9994 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9da22e7051522d06d923fcec3b63cbed8db93910 Gerrit-Change-Number: 9994 Gerrit-PatchSet: 1 Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 16 Jul 2018 10:17:30 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 10:17:39 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 10:17:39 +0000 Subject: Change in libosmocore[master]: coding: Fix (E)GPRS BER calculation to correctly account for puncturing. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9994 ) Change subject: coding: Fix (E)GPRS BER calculation to correctly account for puncturing. ...................................................................... coding: Fix (E)GPRS BER calculation to correctly account for puncturing. Previously we didn't take into account puncturing and BER was always around 30% for GPRS/EDGE bursts because of they use puncturing coding unlike "classical" GSM bursts. Change-Id: I9da22e7051522d06d923fcec3b63cbed8db93910 --- M src/coding/gsm0503_coding.c 1 file changed, 24 insertions(+), 5 deletions(-) Approvals: Jenkins Builder: Verified Vadim Yanitskiy: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index 215cc6d..1d06adb 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -528,16 +528,18 @@ }, }; -/*! Convolutional Decode + compute BER +/*! Convolutional Decode + compute BER for punctured codes * \param[in] code Description of Convolutional Code * \param[in] input Input soft-bits (-127...127) * \param[out] output bits * \param[out] n_errors Number of bit-errors * \param[out] n_bits_total Number of bits + * \param[in] data_punc Puncturing mask array. Can be NULL. */ -static int osmo_conv_decode_ber(const struct osmo_conv_code *code, +static int osmo_conv_decode_ber_punctured(const struct osmo_conv_code *code, const sbit_t *input, ubit_t *output, - int *n_errors, int *n_bits_total) + int *n_errors, int *n_bits_total, + const uint8_t *data_punc) { int res, i, coded_len; ubit_t recoded[EGPRS_DATA_C_MAX]; @@ -553,7 +555,8 @@ if (n_errors) { *n_errors = 0; for (i = 0; i < coded_len; i++) { - if (!((recoded[i] && input[i] < 0) || + if (((!data_punc) || (data_punc && !data_punc[i])) && + !((recoded[i] && input[i] < 0) || (!recoded[i] && input[i] > 0)) ) *n_errors += 1; } @@ -565,6 +568,21 @@ return res; } +/*! Convolutional Decode + compute BER for non-punctured codes + * \param[in] code Description of Convolutional Code + * \param[in] input Input soft-bits (-127...127) + * \param[out] output bits + * \param[out] n_errors Number of bit-errors + * \param[out] n_bits_total Number of bits + */ +static int osmo_conv_decode_ber(const struct osmo_conv_code *code, + const sbit_t *input, ubit_t *output, + int *n_errors, int *n_bits_total) +{ + return osmo_conv_decode_ber_punctured(code, input, output, + n_errors, n_bits_total, NULL); +} + /*! convenience wrapper for decoding coded bits * \param[out] l2_data caller-allocated buffer for L2 Frame * \param[in] cB 456 coded (soft) bits as per TS 05.03 4.1.3 @@ -884,7 +902,8 @@ C[i] = 0; } - osmo_conv_decode_ber(code->data_conv, C, u, n_errors, n_bits_total); + osmo_conv_decode_ber_punctured(code->data_conv, C, u, + n_errors, n_bits_total, code->data_punc[p]); rc = osmo_crc16gen_check_bits(&gsm0503_mcs_crc12, u, data_len, u + data_len); if (rc) -- To view, visit https://gerrit.osmocom.org/9994 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I9da22e7051522d06d923fcec3b63cbed8db93910 Gerrit-Change-Number: 9994 Gerrit-PatchSet: 1 Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 10:17:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 10:17:41 +0000 Subject: Change in libosmocore[master]: coding: Documentation typo fix. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9995 ) Change subject: coding: Documentation typo fix. ...................................................................... coding: Documentation typo fix. Change-Id: I6ca873b3decaf50e7b79b5ab2269919c862a4fe0 --- M src/coding/gsm0503_coding.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Vadim Yanitskiy: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index 1d06adb..2eb8cba 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -927,7 +927,7 @@ * \param[in] nbits number of bits in \a bursts * \param usf_p unused argument ?!? * \param[out] n_errors number of detected bit-errors - * \param[out] n_bits_total total number of dcoded bits + * \param[out] n_bits_total total number of decoded bits * \returns 0 on success; negative on error */ int gsm0503_pdtch_egprs_decode(uint8_t *l2_data, const sbit_t *bursts, uint16_t nbits, uint8_t *usf_p, int *n_errors, int *n_bits_total) -- To view, visit https://gerrit.osmocom.org/9995 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I6ca873b3decaf50e7b79b5ab2269919c862a4fe0 Gerrit-Change-Number: 9995 Gerrit-PatchSet: 1 Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 10:23:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 10:23:22 +0000 Subject: Change in osmo-sgsn[master]: Add optional TearDownInd IE in PDP DEACT REQ towards PCU In-Reply-To: References: Message-ID: Harald Welte has uploaded a new patch set (#2) to the change originally created by Pau Espin Pedrol. ( https://gerrit.osmocom.org/9992 ) Change subject: Add optional TearDownInd IE in PDP DEACT REQ towards PCU ...................................................................... Add optional TearDownInd IE in PDP DEACT REQ towards PCU According to 3GPP TS 24.008 Section 6.1.3.4, the tear down indicator IE maybe included in the DEACTIVATE PDP CONTEXT REQUEST message in order to indicate whether only the PDP context associated with this specific TI or all active PDP contexts sharing the same PDP address and APN as the PDP context associated with this specific TI shall be deactivated. As we don't permit/support establishing multiple PDP contexts using the same APN and PDP address, it shouldn't really make any difference. Nevertheless, we want to clear everything, so let's include it. Change-Id: Ia9bc2d0e93362a8473eac5cf4c7e8ffa41c79e5b --- M include/osmocom/sgsn/gprs_gmm.h M src/gprs/gprs_gmm.c M src/gprs/gprs_sgsn.c 3 files changed, 8 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/92/9992/2 -- To view, visit https://gerrit.osmocom.org/9992 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia9bc2d0e93362a8473eac5cf4c7e8ffa41c79e5b Gerrit-Change-Number: 9992 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 10:23:45 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 10:23:45 +0000 Subject: Change in osmo-sgsn[master]: Add optional TearDownInd IE in PDP DEACT REQ towards PCU In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9992 ) Change subject: Add optional TearDownInd IE in PDP DEACT REQ towards PCU ...................................................................... Patch Set 2: Code-Review+1 I extended the commit log message. Please review and/or correct and feel free to give +2. -- To view, visit https://gerrit.osmocom.org/9992 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia9bc2d0e93362a8473eac5cf4c7e8ffa41c79e5b Gerrit-Change-Number: 9992 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 16 Jul 2018 10:23:45 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Mon Jul 16 12:26:47 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Mon, 16 Jul 2018 12:26:47 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-gapk_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#22?= In-Reply-To: <254839191.192.1531657608108.JavaMail.jenkins@jenkins.osmocom.org> References: <254839191.192.1531657608108.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <2018024132.201.1531744007975.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 127.22 KB...] checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether make supports nested variables... (cached) yes checking if gcc supports -fvisibility=hidden... yes checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking whether gcc understands -c and -o together... (cached) yes checking dependency style of gcc... (cached) gcc3 checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for LIBOSMOCORE... yes checking for LIBOSMOCODEC... yes checking for LIBALSA... yes checking for OPENCORE_AMRNB... yes checking gsm/gsm.h usability... yes checking gsm/gsm.h presence... yes checking for gsm/gsm.h... yes checking for gsm_create in -lgsm... yes checking for stdint.h... (cached) yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking for unistd.h... (cached) yes checking for inline... inline checking for int16_t... yes checking for int32_t... yes checking for uint16_t... yes checking for uint32_t... yes checking for uint64_t... yes checking for uint8_t... yes checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... yes checking for memset... yes checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating src/Makefile config.status: creating libgsmhr/Makefile config.status: creating include/Makefile config.status: creating include/gsmhr/Makefile config.status: creating libosmogapk.pc config.status: creating tests/atlocal config.status: creating tests/Makefile config.status: creating config.h config.status: executing depfiles commands config.status: executing libtool commands config.status: executing tests/atconfig commands make[1]: Entering directory ' make all-recursive make[2]: Entering directory ' Making all in include make[3]: Entering directory ' make[4]: Entering directory ' make[4]: Nothing to be done for 'all-am'. make[4]: Leaving directory ' make[3]: Leaving directory ' Making all in src make[3]: Entering directory ' CC procqueue.lo CC pq_format.lo CC pq_codec.lo CC pq_file.lo CC pq_alsa.lo CC pq_rtp.lo CC pq_ecu.lo CC ecu_fr.lo CC formats.lo CC fmt_ti.lo CC fmt_amr.lo CC fmt_gsm.lo CC fmt_hr_ref.lo CC fmt_racal.lo CC fmt_rawpcm.lo CC fmt_rtp_amr.lo CC fmt_rtp_efr.lo CC fmt_rtp_hr_etsi.lo CC fmt_rtp_hr_ietf.lo CC fmt_amr_opencore.lo CC codecs.lo CC codec_pcm.lo CC codec_hr.lo CC codec_fr.lo CC codec_efr.lo CC codec_amr.lo CC benchmark.lo CC common.lo CCLD libosmogapk.la CC app_osmo_gapk.o CCLD osmo-gapk make[3]: Leaving directory ' Making all in tests make[3]: Entering directory ' make[3]: Nothing to be done for 'all'. make[3]: Leaving directory ' make[3]: Entering directory ' make[3]: Leaving directory ' make[2]: Leaving directory ' make[1]: Leaving directory ' make[1]: Entering directory ' Making dvi in include make[2]: Entering directory ' make[3]: Entering directory ' make[3]: Nothing to be done for 'dvi-am'. make[3]: Leaving directory ' make[2]: Leaving directory ' Making dvi in src make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi'. make[2]: Leaving directory ' Making dvi in tests make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi'. make[2]: Leaving directory ' make[2]: Entering directory ' make[2]: Nothing to be done for 'dvi-am'. make[2]: Leaving directory ' make[1]: Leaving directory ' make[1]: Entering directory ' Making check in include make[2]: Entering directory ' make[3]: Entering directory ' make[3]: Nothing to be done for 'check-am'. make[3]: Leaving directory ' make[2]: Leaving directory ' Making check in src make[2]: Entering directory ' make[2]: Nothing to be done for 'check'. make[2]: Leaving directory ' Making check in tests make[2]: Entering directory ' make procqueue/pq_test io/pq_file_test io/pq_rtp_test ecu/ecu_fr_test make[3]: Entering directory ' CC procqueue/pq_test.o CCLD procqueue/pq_test CC io/pq_file_test.o CCLD io/pq_file_test CC io/pq_rtp_test.o CCLD io/pq_rtp_test CC ecu/ecu_fr_test.o CCLD ecu/ecu_fr_test make[3]: Leaving directory ' make check-local make[3]: Entering directory ' /bin/bash '../../../tests/testsuite' ## ---------------------------- ## ## gapk 0.4.75-27bc test suite. ## ## ---------------------------- ## Regression tests. 1: procqueue ok 2: io/pq_file FAILED (testsuite.at:13) 3: io/pq_rtp ok 4: ecu/ecu_fr_test ok 5: conv/enc/amr_efr ok 6: conv/enc/gsm ok 7: conv/enc/racal_hr skipped (testsuite.at:58) 8: conv/enc/racal_fr ok 9: conv/enc/racal_efr ok 10: conv/enc/ti_hr skipped (testsuite.at:91) 11: conv/enc/ti_fr ok 12: conv/enc/ti_efr ok 13: conv/enc/rtp_efr ok 14: conv/enc/rtp_hr_etsi skipped (testsuite.at:135) 15: conv/enc/rtp_hr_ietf skipped (testsuite.at:146) 16: conv/dec/amr_efr ok 17: conv/dec/gsm ok 18: conv/dec/racal_hr skipped (testsuite.at:179) 19: conv/dec/racal_fr ok 20: conv/dec/racal_efr ok 21: conv/dec/ti_hr skipped (testsuite.at:212) 22: conv/dec/ti_fr ok 23: conv/dec/ti_efr ok 24: conv/dec/rtp_efr ok 25: conv/dec/rtp_hr_etsi skipped (testsuite.at:256) 26: conv/dec/rtp_hr_ietf skipped (testsuite.at:267) ## ------------- ## ## Test results. ## ## ------------- ## ERROR: 18 tests were run, 1 failed unexpectedly. 8 tests were skipped. ## -------------------------- ## ## testsuite.log was created. ## ## -------------------------- ## Please send `tests/testsuite.log' and all information you think might help: To: Subject: [gapk 0.4.75-27bc] testsuite: 2 failed You may investigate any problem if you feel able to do so, in which case the test suite provides a good starting point. Its output may be found below `tests/testsuite.dir'. Makefile:753: recipe for target 'check-local' failed make[3]: *** [check-local] Error 1 make[3]: Leaving directory ' Makefile:602: recipe for target 'check-am' failed make[2]: *** [check-am] Error 2 make[2]: Leaving directory ' Makefile:479: recipe for target 'check-recursive' failed make[1]: *** [check-recursive] Error 1 make[1]: Leaving directory ' Makefile:684: recipe for target 'distcheck' failed make: *** [distcheck] Error 1 + cat-testlogs.sh ======================== ./gapk-0.4.75-27bc/_build/sub/tests/testsuite.dir/02/testsuite.log # -*- compilation -*- 2. testsuite.at:10: testing io/pq_file ... ../../../tests/testsuite.at:13: $abs_top_builddir/tests/io/pq_file_test \ $abs_top_builddir/tests/io/io_sample.txt --- /dev/null 2018-03-27 19:17:06.212284948 +0000 +++ 2018-07-16 12:26:47.261793696 +0000 @@ -0,0 +1,2 @@ +pq_file_test: ../../../tests/io/pq_file_test.c:132: main: Assertion `sample_file != NULL' failed. +: line 29: 27735 Aborted $abs_top_builddir/tests/io/pq_file_test $abs_top_builddir/tests/io/io_sample.txt --- expout 2018-07-16 12:26:47.253793750 +0000 +++ 2018-07-16 12:26:47.253793750 +0000 @@ -1,12 +0,0 @@ -Processing sample file with blk_len=2: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=4: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=8: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=16: -8217c8fb7675a95008f9089d883gapk -Processing sample file with blk_len=32: -8217c8fb7675a95008f9089d883gapk - -chunk null_context: depth=0 ../../../tests/testsuite.at:13: exit code was 134, expected 0 2. testsuite.at:10: 2. io/pq_file (testsuite.at:10): FAILED (testsuite.at:13) Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Mon Jul 16 13:17:42 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 16 Jul 2018 13:17:42 +0000 Subject: Change in osmo-sgsn[master]: Add optional TearDownInd IE in PDP DEACT REQ towards PCU In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9992 to look at the new patch set (#3). Change subject: Add optional TearDownInd IE in PDP DEACT REQ towards PCU ...................................................................... Add optional TearDownInd IE in PDP DEACT REQ towards PCU According to 3GPP TS 24.008 Section 6.1.3.4, the tear down indicator IE maybe included in the DEACTIVATE PDP CONTEXT REQUEST message in order to indicate whether only the PDP context associated with this specific TI or all active PDP contexts sharing the same PDP address and APN as the PDP context associated with this specific TI shall be deactivated. As we don't permit/support establishing multiple PDP contexts using the same APN and PDP address, it shouldn't really make any difference. Nevertheless, we want to clear everything, so let's include it. Change-Id: Ia9bc2d0e93362a8473eac5cf4c7e8ffa41c79e5b --- M include/osmocom/sgsn/gprs_gmm.h M src/gprs/gprs_gmm.c M src/gprs/gprs_sgsn.c 3 files changed, 8 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/92/9992/3 -- To view, visit https://gerrit.osmocom.org/9992 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia9bc2d0e93362a8473eac5cf4c7e8ffa41c79e5b Gerrit-Change-Number: 9992 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 13:17:42 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 16 Jul 2018 13:17:42 +0000 Subject: Change in osmo-sgsn[master]: sgsn: Don't attempt to delete GTP pdp ctx if GGSN was restarted In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9993 to look at the new patch set (#2). Change subject: sgsn: Don't attempt to delete GTP pdp ctx if GGSN was restarted ...................................................................... sgsn: Don't attempt to delete GTP pdp ctx if GGSN was restarted Scenario and behaviour before this commit: - Received Echo Reply from GGSN has incremented RestartCounter - func sgsn_ggsn_ctx_drop_all_pdp() is called to dettach all pdp ctx from GGSN and request the MS to deact all related ctx. - DEACT ACCEPT is received from MS, and then it tries to send DEL PDP CTX to GGSN, expecting to receive a Confirmation and only then freeing the pdp ctx. The problem is that since the initial cause of triggering was a GGSN restart, the GGSN doesn't know anything about that pdp ctx anymore, so it's not useful sending it. We can instead dettach the GGSN and libgtp ref at drop_all_pdp() time and then when we receive DEACT ACCEPT from MS we can free the pdp ctx directly. Change-Id: I1c74098e181552c218e152bf4ac5035cea770428 --- M src/gprs/gprs_gmm.c M src/gprs/gprs_sgsn.c 2 files changed, 21 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/93/9993/2 -- To view, visit https://gerrit.osmocom.org/9993 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1c74098e181552c218e152bf4ac5035cea770428 Gerrit-Change-Number: 9993 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Holger Freyther -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 13:17:44 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 16 Jul 2018 13:17:44 +0000 Subject: Change in osmo-sgsn[master]: Forward GGSN originated DEACT PDP CTX REQ Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10002 Change subject: Forward GGSN originated DEACT PDP CTX REQ ...................................................................... Forward GGSN originated DEACT PDP CTX REQ This commit fixes TTCN3 sgsn test TC_attach_pdp_act_user_deact_mt. Change-Id: I204209c017aac8a8402cbb8d0a0200540abcc954 --- M include/osmocom/sgsn/gprs_sgsn.h M src/gprs/gprs_sgsn.c M src/gprs/sgsn_libgtp.c 3 files changed, 15 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/02/10002/1 diff --git a/include/osmocom/sgsn/gprs_sgsn.h b/include/osmocom/sgsn/gprs_sgsn.h index 5f30889..8eba2d4 100644 --- a/include/osmocom/sgsn/gprs_sgsn.h +++ b/include/osmocom/sgsn/gprs_sgsn.h @@ -361,6 +361,7 @@ struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_id(uint32_t id); struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_addr(struct in_addr *addr); struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_find_alloc(uint32_t id); +void sgsn_ggsn_ctx_drop_pdp(struct sgsn_pdp_ctx *pctx); int sgsn_ggsn_ctx_drop_all_pdp(struct sgsn_ggsn_ctx *ggsn); void sgsn_ggsn_ctx_add_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx *pdp); void sgsn_ggsn_ctx_remove_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx *pdp); diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c index ef0cc23..e6d88e3 100644 --- a/src/gprs/gprs_sgsn.c +++ b/src/gprs/gprs_sgsn.c @@ -699,17 +699,17 @@ return GSM_RESERVED_TMSI; } -static void drop_one_pdp(struct sgsn_pdp_ctx *pdp) +void sgsn_ggsn_ctx_drop_pdp(struct sgsn_pdp_ctx *pctx) { - if (pdp->mm->gmm_state == GMM_REGISTERED_NORMAL) { - gsm48_tx_gsm_deact_pdp_req(pdp, GSM_CAUSE_NET_FAIL, true); - sgsn_ggsn_ctx_remove_pdp(pdp->ggsn, pdp); + if (pctx->mm->gmm_state == GMM_REGISTERED_NORMAL) { + gsm48_tx_gsm_deact_pdp_req(pctx, GSM_CAUSE_NET_FAIL, true); + sgsn_ggsn_ctx_remove_pdp(pctx->ggsn, pctx); } else { /* FIXME: GPRS paging in case MS is SUSPENDED */ - LOGPDPCTXP(LOGL_NOTICE, pdp, "Hard-dropping PDP ctx due to GGSN " + LOGPDPCTXP(LOGL_NOTICE, pctx, "Hard-dropping PDP ctx due to GGSN " "recovery\n"); /* FIXME: how to tell this to libgtp? */ - sgsn_pdp_ctx_free(pdp); + sgsn_pdp_ctx_free(pctx); } } @@ -721,7 +721,7 @@ struct sgsn_pdp_ctx *pdp, *pdp2; llist_for_each_entry_safe(pdp, pdp2, &ggsn->pdp_list, ggsn_list) { - drop_one_pdp(pdp); + sgsn_ggsn_ctx_drop_pdp(pdp); num++; } diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 88cea5d..659392e 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -639,8 +639,15 @@ /* Called whenever a PDP context is deleted for any reason */ static int cb_delete_context(struct pdp_t *pdp) { + struct sgsn_pdp_ctx *pctx = pdp->priv; + LOGPDPX(DGPRS, LOGL_INFO, pdp, "Context %p was deleted\n", pdp); + /* unlink the now non-existing library handle from the pdp + * context */ + pctx->lib = NULL; + + sgsn_ggsn_ctx_drop_pdp(pctx); return 0; } -- To view, visit https://gerrit.osmocom.org/10002 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I204209c017aac8a8402cbb8d0a0200540abcc954 Gerrit-Change-Number: 10002 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 13:17:45 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 16 Jul 2018 13:17:45 +0000 Subject: Change in osmo-sgsn[master]: sgsn: Fix T3395 firing forever Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10003 Change subject: sgsn: Fix T3395 firing forever ...................................................................... sgsn: Fix T3395 firing forever Change-Id: Iacce3c66f61578ebee37abaa287f7e183f985c1c --- M src/gprs/gprs_gmm.c 1 file changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/03/10003/1 diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index ad56c60..59fcbad 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -2720,11 +2720,11 @@ { struct sgsn_pdp_ctx *pdp = _pdp; - pdp->num_T_exp++; + unsigned int num_expired = pdp->num_T_exp + 1; switch (pdp->T) { case 3395: /* waiting for PDP CTX DEACT ACK */ - if (pdp->num_T_exp >= 4) { + if (num_expired >= 5) { LOGPDPCTXP(LOGL_NOTICE, pdp, "T3395 expired >= 5 times\n"); pdp->state = PDP_STATE_INACTIVE; if (pdp->ggsn) @@ -2734,6 +2734,8 @@ break; } gsm48_tx_gsm_deact_pdp_req(pdp, GSM_CAUSE_NET_FAIL, true); + /* num_T_exp is reset by above function */ + pdp->num_T_exp = num_expired; break; default: LOGPDPCTXP(LOGL_ERROR, pdp, "timer expired in unknown mode %u\n", -- To view, visit https://gerrit.osmocom.org/10003 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iacce3c66f61578ebee37abaa287f7e183f985c1c Gerrit-Change-Number: 10003 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 13:18:54 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 16 Jul 2018 13:18:54 +0000 Subject: Change in osmo-sgsn[master]: Add optional TearDownInd IE in PDP DEACT REQ towards PCU In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9992 ) Change subject: Add optional TearDownInd IE in PDP DEACT REQ towards PCU ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9992 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia9bc2d0e93362a8473eac5cf4c7e8ffa41c79e5b Gerrit-Change-Number: 9992 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Mon, 16 Jul 2018 13:18:54 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 14:20:56 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Mon, 16 Jul 2018 14:20:56 +0000 Subject: Change in osmo-sgsn[master]: sgsn: Fix T3395 firing forever In-Reply-To: References: Message-ID: lynxis lazus has posted comments on this change. ( https://gerrit.osmocom.org/10003 ) Change subject: sgsn: Fix T3395 firing forever ...................................................................... Patch Set 1: how about using _gsm48_tx_gsm_deact_pdp_req()? -- To view, visit https://gerrit.osmocom.org/10003 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iacce3c66f61578ebee37abaa287f7e183f985c1c Gerrit-Change-Number: 10003 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-CC: lynxis lazus Gerrit-Comment-Date: Mon, 16 Jul 2018 14:20:56 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 14:45:18 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 16 Jul 2018 14:45:18 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_ConnectionHandler: more verbosity for f_check_mgcp_expectations() Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/10004 Change subject: MSC_ConnectionHandler: more verbosity for f_check_mgcp_expectations() ...................................................................... MSC_ConnectionHandler: more verbosity for f_check_mgcp_expectations() The function f_check_mgcp_expectations() checks the counters that count the occurrence of MDCX and CRCX messages against computed expected values. At the moment it is not easy to spot where exactly the deviation occurred. Lets add some log output so that we can see which type of message on which connection was missing or too much. Also add a string parameter that is set to the calling functions name so that we know from where the check has been triggered. - Add more verbose log output for counters - Add parameter to prepend to the log line Change-Id: Ida0eba4ef3c1db977d392267ef76ec37b87133b3 Related: OS#3292 --- M bsc/BSC_Tests.ttcn M bsc/MSC_ConnectionHandler.ttcn 2 files changed, 7 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/04/10004/1 diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 2897a0b..ef37a7f 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -2134,7 +2134,7 @@ /* Check the amount of MGCP transactions is still consistant with the * test expectation */ - f_check_mgcp_expectations() + f_check_mgcp_expectations("f_tc_ho_int") } testcase TC_ho_int() runs on test_CT { diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index ba4d19d..dd13ee2 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -794,8 +794,12 @@ /* Helper function to check if the activity on the MGCP matches what we * expected */ -function f_check_mgcp_expectations() runs on MSC_ConnHdlr { +function f_check_mgcp_expectations(charstring caller) runs on MSC_ConnHdlr { for (var integer i:= 0; i < sizeof(g_media.mgcp_conn); i := i+1) { + log(caller, ": Check MGCP test expectations for g_media.mgcp_conn[", i , "]:", + " crcx_seen=", g_media.mgcp_conn[i].crcx_seen, ", crcx_seen_exp=", g_media.mgcp_conn[i].crcx_seen_exp, + ", mdcx_seen=", g_media.mgcp_conn[i].mdcx_seen, ", mdcx_seen_exp=", g_media.mgcp_conn[i].mdcx_seen_exp); + if(g_media.mgcp_conn[i].crcx_seen != g_media.mgcp_conn[i].crcx_seen_exp) { setverdict(fail, "unexpected number of MGW-CRCX transactions"); } @@ -947,7 +951,7 @@ self.stop; } - f_check_mgcp_expectations(); + f_check_mgcp_expectations("f_establish_fully"); } type record HandoverState { -- To view, visit https://gerrit.osmocom.org/10004 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ida0eba4ef3c1db977d392267ef76ec37b87133b3 Gerrit-Change-Number: 10004 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 14:45:20 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 16 Jul 2018 14:45:20 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_ConnectionHandler: expect additional MDCX when call is LCLS Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/10005 Change subject: MSC_ConnectionHandler: expect additional MDCX when call is LCLS ...................................................................... MSC_ConnectionHandler: expect additional MDCX when call is LCLS The function f_establish_f_establish_fully does not yet handle the case where calls get switched locally. In those cases we expect to see one additional MDCX before the BSSMAP ASSIGNMENT COMPLETE is sent. - Check exp_ass_cpl if the call is expected to be LCLS and expect another MDCX for those cases. Change-Id: I55fae5ab03980cd810ed7dc38208550686b1659e Related: OS#3292 --- M bsc/MSC_ConnectionHandler.ttcn 1 file changed, 12 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/05/10005/1 diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index dd13ee2..794e573 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -951,6 +951,18 @@ self.stop; } + /* When the BSC detects that LCLS is possible it will cross the + * connetions that point to the PBX side of the MGW. In our case this + * is mgcp_conn[1]. The BSC performs this operation already before the + * assignment complete is generated. This means we expect another MDCX + * at mgcp_conn[1] when LCLS is expected. */ + if (ispresent(exp_ass_cpl.pdu.bssmap.assignmentComplete.lCLS_BSS_Status.lCLS_BSS_StatusValue)) { + if (valueof(exp_ass_cpl.pdu.bssmap.assignmentComplete.lCLS_BSS_Status.lCLS_BSS_StatusValue) == LCLS_STS_locally_switched) { + g_media.mgcp_conn[1].mdcx_seen_exp := g_media.mgcp_conn[1].mdcx_seen_exp + 1; + + } + } + f_check_mgcp_expectations("f_establish_fully"); } -- To view, visit https://gerrit.osmocom.org/10005 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I55fae5ab03980cd810ed7dc38208550686b1659e Gerrit-Change-Number: 10005 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 15:01:31 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 16 Jul 2018 15:01:31 +0000 Subject: Change in osmo-ggsn[master]: gtp: Avoid freeing pdp contexts during DEL CTX REQ Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10006 Change subject: gtp: Avoid freeing pdp contexts during DEL CTX REQ ...................................................................... gtp: Avoid freeing pdp contexts during DEL CTX REQ This may still be useful during REPLY time, for instance to hook to delete_cb in order to know when the pdp ctx has really been deleted. Change-Id: I29d366253bb98dcba328c7ce8aa3e4daf8f75e6c --- M gtp/gtp.c 1 file changed, 0 insertions(+), 32 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/06/10006/1 diff --git a/gtp/gtp.c b/gtp/gtp.c index 1309cb5..77d7c56 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -2346,7 +2346,6 @@ get_default_gtp(pdp->version, GTP_DELETE_PDP_REQ, &packet); struct in_addr addr; struct pdp_t *linked_pdp; - struct pdp_t *secondary_pdp; int n; int count = 0; @@ -2383,37 +2382,6 @@ gtp_req(gsn, pdp->version, pdp, &packet, length, &addr, cbp); - if (teardown) { /* Remove all contexts */ - for (n = 0; n < PDP_MAXNSAPI; n++) { - if (linked_pdp->secondary_tei[n]) { - if (pdp_getgtp1 - (&secondary_pdp, - linked_pdp->secondary_tei[n])) { - LOGP(DLGTP, LOGL_ERROR, - "Unknown secondary PDP context\n"); - return EOF; - } - if (linked_pdp != secondary_pdp) { - if (gsn->cb_delete_context) - gsn->cb_delete_context - (secondary_pdp); - pdp_freepdp(secondary_pdp); - } - } - } - if (gsn->cb_delete_context) - gsn->cb_delete_context(linked_pdp); - pdp_freepdp(linked_pdp); - } else { - if (gsn->cb_delete_context) - gsn->cb_delete_context(pdp); - if (pdp == linked_pdp) { - linked_pdp->secondary_tei[pdp->nsapi & 0xf0] = 0; - linked_pdp->nodata = 1; - } else - pdp_freepdp(pdp); - } - return 0; } -- To view, visit https://gerrit.osmocom.org/10006 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I29d366253bb98dcba328c7ce8aa3e4daf8f75e6c Gerrit-Change-Number: 10006 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 15:02:46 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 16 Jul 2018 15:02:46 +0000 Subject: Change in osmo-sgsn[master]: Forward GGSN originated DEACT PDP CTX REQ In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10002 ) Change subject: Forward GGSN originated DEACT PDP CTX REQ ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/10002 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I204209c017aac8a8402cbb8d0a0200540abcc954 Gerrit-Change-Number: 10002 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Mon, 16 Jul 2018 15:02:46 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 15:02:55 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 16 Jul 2018 15:02:55 +0000 Subject: Change in osmo-sgsn[master]: osmo-sgsn: ping GGSN periodically and check for restart counter In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9934 ) Change subject: osmo-sgsn: ping GGSN periodically and check for restart counter ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/9934 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9d714726785407859f26bbef052cd0efc28e8dae Gerrit-Change-Number: 9934 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 16 Jul 2018 15:02:55 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Mon Jul 16 15:10:06 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Mon, 16 Jul 2018 15:10:06 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-asn1c_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#186?= In-Reply-To: <698968748.193.1531667406459.JavaMail.jenkins@jenkins.osmocom.org> References: <698968748.193.1531667406459.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <1647670113.202.1531753806499.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 3.74 KB...] checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for style of include used by make... GNU checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking how to run the C++ preprocessor... g++ -E checking for g77... no checking for f77... no checking for xlf... no checking for frt... no checking for pgf77... no checking for cf77... no checking for fort77... no checking for fl32... no checking for af77... no checking for f90... no checking for xlf90... no checking for pgf90... no checking for pghpf... no checking for epcf90... no checking for gfortran... no checking for g95... no checking for f95... no checking for fort... no checking for xlf95... no checking for ifort... no checking for ifc... no checking for efc... no checking for pgf95... no checking for lf95... no checking for ftn... no checking whether we are using the GNU Fortran 77 compiler... no checking whether accepts -g... no checking the maximum length of command line arguments... 32768 checking command to parse /usr/bin/nm -B output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes configure: creating libtool appending configuration tag "CXX" to libtool checking for ld used by g++... /usr/bin/ld -m elf_x86_64 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC checking if g++ PIC flag -fPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate appending configuration tag "F77" to libtool checking for autoconf... /usr/bin/autoconf checking for autoheader... /usr/bin/autoheader checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking dependency style of gcc... (cached) gcc3 checking how to run the C preprocessor... gcc -E checking for a BSD-compatible install... /usr/bin/install -c checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking for bison... bison -y checking for flex... flex checking for yywrap in -lfl... yes checking lex output file root... lex.yy checking whether yytext is a pointer... yes checking for ar... /usr/bin/ar checking for ANSI C header files... (cached) yes checking sys/param.h usability... yes checking sys/param.h presence... yes checking for sys/param.h... yes checking whether byte ordering is bigendian... no checking for off_t... yes checking for size_t... yes checking whether struct tm is in sys/time.h or time.h... time.h checking for intmax_t... yes checking for library containing getopt... none required checking for strtoimax... yes checking for strtoll... yes checking for mergesort... no checking for mkstemps... yes configure: creating ./config.status config.status: creating skeletons/standard-modules/Makefile config.status: creating skeletons/tests/Makefile config.status: creating libasn1compiler/Makefile config.status: creating libasn1parser/Makefile config.status: creating libasn1print/Makefile config.status: creating asn1c/webcgi/Makefile config.status: creating asn1c/tests/Makefile config.status: creating libasn1fix/Makefile config.status: creating skeletons/Makefile config.status: creating examples/Makefile config.status: creating tests/Makefile config.status: creating asn1c/Makefile config.status: creating doc/Makefile config.status: creating asn1c.spec config.status: creating Makefile config.status: creating config.h config.status: executing depfiles commands + make -j 8 make all-recursive make[1]: Entering directory ' Making all in libasn1parser make[2]: Entering directory ' if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF ".deps/asn1parser.Tpo" -c -o asn1parser.lo asn1parser.c; \ then mv -f ".deps/asn1parser.Tpo" ".deps/asn1parser.Plo"; else rm -f ".deps/asn1parser.Tpo"; exit 1; fi bison -y -p asn1p_ -d asn1p_y.y if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF ".deps/asn1p_l.Tpo" -c -o asn1p_l.lo asn1p_l.c; \ then mv -f ".deps/asn1p_l.Tpo" ".deps/asn1p_l.Plo"; else rm -f ".deps/asn1p_l.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF ".deps/asn1p_module.Tpo" -c -o asn1p_module.lo asn1p_module.c; \ then mv -f ".deps/asn1p_module.Tpo" ".deps/asn1p_module.Plo"; else rm -f ".deps/asn1p_module.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF ".deps/asn1p_oid.Tpo" -c -o asn1p_oid.lo asn1p_oid.c; \ then mv -f ".deps/asn1p_oid.Tpo" ".deps/asn1p_oid.Plo"; else rm -f ".deps/asn1p_oid.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF ".deps/asn1p_value.Tpo" -c -o asn1p_value.lo asn1p_value.c; \ then mv -f ".deps/asn1p_value.Tpo" ".deps/asn1p_value.Plo"; else rm -f ".deps/asn1p_value.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF ".deps/asn1p_expr.Tpo" -c -o asn1p_expr.lo asn1p_expr.c; \ then mv -f ".deps/asn1p_expr.Tpo" ".deps/asn1p_expr.Plo"; else rm -f ".deps/asn1p_expr.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF ".deps/asn1p_xports.Tpo" -c -o asn1p_xports.lo asn1p_xports.c; \ then mv -f ".deps/asn1p_xports.Tpo" ".deps/asn1p_xports.Plo"; else rm -f ".deps/asn1p_xports.Tpo"; exit 1; fi asn1p_y.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] mkdir .libs mkdir .libs mkdir: cannot create directory '.libs': File exists gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -fPIC -DPIC -o .libs/asn1p_module.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -fPIC -DPIC -o .libs/asn1p_expr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -fPIC -DPIC -o .libs/asn1p_value.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -fPIC -DPIC -o .libs/asn1parser.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -fPIC -DPIC -o .libs/asn1p_l.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -fPIC -DPIC -o .libs/asn1p_xports.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -fPIC -DPIC -o .libs/asn1p_oid.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -o asn1p_xports.o >/dev/null 2>&1 asn1p_l.c:3521:12: warning: 'input' defined but not used [-Wunused-function] static int input() ^~~~~ gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -o asn1p_module.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -o asn1p_oid.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -o asn1parser.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -o asn1p_value.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF ".deps/asn1p_constr.Tpo" -c -o asn1p_constr.lo asn1p_constr.c; \ then mv -f ".deps/asn1p_constr.Tpo" ".deps/asn1p_constr.Plo"; else rm -f ".deps/asn1p_constr.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -o asn1p_expr.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF ".deps/asn1p_param.Tpo" -c -o asn1p_param.lo asn1p_param.c; \ then mv -f ".deps/asn1p_param.Tpo" ".deps/asn1p_param.Plo"; else rm -f ".deps/asn1p_param.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF ".deps/asn1p_class.Tpo" -c -o asn1p_class.lo asn1p_class.c; \ then mv -f ".deps/asn1p_class.Tpo" ".deps/asn1p_class.Plo"; else rm -f ".deps/asn1p_class.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF ".deps/asn1p_ref.Tpo" -c -o asn1p_ref.lo asn1p_ref.c; \ then mv -f ".deps/asn1p_ref.Tpo" ".deps/asn1p_ref.Plo"; else rm -f ".deps/asn1p_ref.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -fPIC -DPIC -o .libs/asn1p_constr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -fPIC -DPIC -o .libs/asn1p_param.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -fPIC -DPIC -o .libs/asn1p_class.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -fPIC -DPIC -o .libs/asn1p_ref.o if test -f y.tab.h; then \ to=`echo "asn1p_y_H" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \ sed -e "/^#/!b" -e "s/Y_TAB_H/$to/g" -e "s|y\.tab\.h|asn1p_y.h|" \ y.tab.h >asn1p_y.ht; \ rm -f y.tab.h; \ if cmp -s asn1p_y.ht asn1p_y.h; then \ rm -f asn1p_y.ht ;\ else \ mv asn1p_y.ht asn1p_y.h; \ fi; \ fi if test -f y.output; then \ mv y.output asn1p_y.output; \ fi sed '/^#/ s|y\.tab\.c|asn1p_y.c|' y.tab.c >asn1p_y.ct && mv asn1p_y.ct asn1p_y.c rm -f y.tab.c if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF ".deps/asn1p_y.Tpo" -c -o asn1p_y.lo asn1p_y.c; \ then mv -f ".deps/asn1p_y.Tpo" ".deps/asn1p_y.Plo"; else rm -f ".deps/asn1p_y.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -o asn1p_constr.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -o asn1p_param.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -o asn1p_ref.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -o asn1p_class.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF .deps/asn1p_y.Tpo -c asn1p_y.c -fPIC -DPIC -o .libs/asn1p_y.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -o asn1p_l.o >/dev/null 2>&1 asn1p_y.y: In function 'asn1p_parse': asn1p_y.y:357:13: error: 'param' undeclared (first use in this function) *(void **)param = $1; ^~~~~ asn1p_y.y:357:13: note: each undeclared identifier is reported only once for each function it appears in Makefile:299: recipe for target 'asn1p_y.lo' failed make[2]: *** [asn1p_y.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory ' Makefile:302: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory ' Makefile:212: recipe for target 'all' failed make: *** [all] Error 2 Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Mon Jul 16 15:22:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 15:22:46 +0000 Subject: Change in osmo-sgsn[master]: osmo-sgsn: ping GGSN periodically and check for restart counter In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9934 ) Change subject: osmo-sgsn: ping GGSN periodically and check for restart counter ...................................................................... osmo-sgsn: ping GGSN periodically and check for restart counter Before this commit, echo req/rsp logic was implemented in libgtp but never used in osmo-sgsn. This commit adds a timer which periodically sends a GTP ECHO Request to every GGSN if there's at least one pdpd context associated with it. This way by checking the restart counter in the ECHO Reply it can be known if the GGSN was restarted. In this case, logic already present in osmo-sgsn will terminate all pdp contexts associated with that GGSN. Change-Id: I9d714726785407859f26bbef052cd0efc28e8dae --- M include/osmocom/sgsn/gprs_sgsn.h M include/osmocom/sgsn/sgsn.h M src/gprs/gprs_sgsn.c M src/gprs/sgsn_libgtp.c M src/gprs/sgsn_vty.c 5 files changed, 58 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmocom/sgsn/gprs_sgsn.h b/include/osmocom/sgsn/gprs_sgsn.h index 33b12dc..5f30889 100644 --- a/include/osmocom/sgsn/gprs_sgsn.h +++ b/include/osmocom/sgsn/gprs_sgsn.h @@ -353,6 +353,8 @@ int remote_restart_ctr; struct gsn_t *gsn; struct llist_head pdp_list; /* list of associated pdp ctx (struct sgsn_pdp_ctx*) */ + struct osmo_timer_list echo_timer; + int echo_interval; }; struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_alloc(uint32_t id); void sgsn_ggsn_ctx_free(struct sgsn_ggsn_ctx *ggc); @@ -360,6 +362,8 @@ struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_addr(struct in_addr *addr); struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_find_alloc(uint32_t id); int sgsn_ggsn_ctx_drop_all_pdp(struct sgsn_ggsn_ctx *ggsn); +void sgsn_ggsn_ctx_add_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx *pdp); +void sgsn_ggsn_ctx_remove_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx *pdp); struct apn_ctx { struct llist_head list; diff --git a/include/osmocom/sgsn/sgsn.h b/include/osmocom/sgsn/sgsn.h index 829a8fc..dae9d12 100644 --- a/include/osmocom/sgsn/sgsn.h +++ b/include/osmocom/sgsn/sgsn.h @@ -171,6 +171,7 @@ struct tlv_parsed *tp); int sgsn_delete_pdp_ctx(struct sgsn_pdp_ctx *pctx); void sgsn_pdp_upd_gtp_u(struct sgsn_pdp_ctx *pdp, void *addr, size_t alen); +void sgsn_ggsn_echo_req(struct sgsn_ggsn_ctx *ggc); /* gprs_sndcp.c */ diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c index a58e504..55ce096 100644 --- a/src/gprs/gprs_sgsn.c +++ b/src/gprs/gprs_sgsn.c @@ -411,7 +411,7 @@ return NULL; } llist_add(&pdp->list, &mm->pdp_list); - llist_add(&pdp->ggsn_list, &ggsn->pdp_list); + sgsn_ggsn_ctx_add_pdp(pdp->ggsn, pdp); llist_add(&pdp->g_list, &sgsn_pdp_ctxts); return pdp; @@ -466,7 +466,7 @@ if (pdp->mm) llist_del(&pdp->list); if (pdp->ggsn) - llist_del(&pdp->ggsn_list); + sgsn_ggsn_ctx_remove_pdp(pdp->ggsn, pdp); llist_del(&pdp->g_list); /* _if_ we still have a library handle, at least set it to NULL @@ -487,6 +487,12 @@ } /* GGSN contexts */ +static void echo_timer_cb(void *data) +{ + struct sgsn_ggsn_ctx *ggc = (struct sgsn_ggsn_ctx *) data; + sgsn_ggsn_echo_req(ggc); + osmo_timer_schedule(&ggc->echo_timer, ggc->echo_interval, 0); +} struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_alloc(uint32_t id) { @@ -499,9 +505,11 @@ ggc->id = id; ggc->gtp_version = 1; ggc->remote_restart_ctr = -1; + ggc->echo_interval = -1; /* if we are called from config file parse, this gsn doesn't exist yet */ ggc->gsn = sgsn->gsn; INIT_LLIST_HEAD(&ggc->pdp_list); + osmo_timer_setup(&ggc->echo_timer, echo_timer_cb, ggc); llist_add(&ggc->list, &sgsn_ggsn_ctxts); return ggc; @@ -722,6 +730,19 @@ return num; } +void sgsn_ggsn_ctx_add_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx *pdp) +{ + if (llist_empty(&ggc->pdp_list) && ggc->echo_interval > 0) + osmo_timer_schedule(&ggc->echo_timer, ggc->echo_interval, 0); + llist_add(&pdp->ggsn_list, &ggc->pdp_list); +} +void sgsn_ggsn_ctx_remove_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx *pdp) +{ + llist_del(&pdp->ggsn_list); + if (llist_empty(&ggc->pdp_list) && osmo_timer_pending(&ggc->echo_timer)) + osmo_timer_del(&ggc->echo_timer); +} + void sgsn_update_subscriber_data(struct sgsn_mm_ctx *mmctx) { OSMO_ASSERT(mmctx != NULL); diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 2da8c4a..88cea5d 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -460,6 +460,11 @@ gtp_update_context(pdp->ggsn->gsn, pdp->lib, pdp, &pdp->lib->hisaddr0); } +void sgsn_ggsn_echo_req(struct sgsn_ggsn_ctx *ggc) +{ + gtp_echo_req(ggc->gsn, ggc->gtp_version, NULL, &ggc->remote_addr); +} + #ifdef BUILD_IU /* Callback for RAB assignment response */ int sgsn_ranap_rab_ass_resp(struct sgsn_mm_ctx *ctx, RANAP_RAB_SetupOrModifiedItemIEs_t *setup_ies) diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c index 07d4293..9f9332c 100644 --- a/src/gprs/sgsn_vty.c +++ b/src/gprs/sgsn_vty.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -181,6 +182,9 @@ inet_ntoa(gctx->remote_addr), VTY_NEWLINE); vty_out(vty, " ggsn %u gtp-version %u%s", gctx->id, gctx->gtp_version, VTY_NEWLINE); + if (gctx->echo_interval != -1) + vty_out(vty, " ggsn %u echo-interval %"PRId32"%s", + gctx->id, gctx->echo_interval, VTY_NEWLINE); } if (sgsn->cfg.dynamic_lookup) @@ -356,6 +360,26 @@ return CMD_SUCCESS; } +/* Seee 3GPP TS 29.060 section 7.2.1 */ +DEFUN(cfg_ggsn_echo_interval, cfg_ggsn_echo_interval_cmd, + "ggsn <0-255> echo-interval <1-36000>", + GGSN_STR "GGSN Number\n" + "Send an echo request to this static GGSN every interval.\n" + "Interval between echo requests in seconds.\n") +{ + uint32_t id = atoi(argv[0]); + struct sgsn_ggsn_ctx *ggc = sgsn_ggsn_ctx_find_alloc(id); + + ggc->echo_interval = atoi(argv[1]); + + if (ggc->echo_interval < 60) + vty_out(vty, "%% 3GPP TS 29.060 section states inteval should " \ + "not be lower than 60 seconds, use this value for " \ + "testing purposes only!%s", VTY_NEWLINE); + + return CMD_SUCCESS; +} + DEFUN(cfg_ggsn_dynamic_lookup, cfg_ggsn_dynamic_lookup_cmd, "ggsn dynamic", GGSN_STR @@ -1277,6 +1301,7 @@ install_element(SGSN_NODE, &cfg_ggsn_remote_ip_cmd); //install_element(SGSN_NODE, &cfg_ggsn_remote_port_cmd); install_element(SGSN_NODE, &cfg_ggsn_gtp_version_cmd); + install_element(SGSN_NODE, &cfg_ggsn_echo_interval_cmd); install_element(SGSN_NODE, &cfg_imsi_acl_cmd); install_element(SGSN_NODE, &cfg_auth_policy_cmd); install_element(SGSN_NODE, &cfg_encrypt_cmd); -- To view, visit https://gerrit.osmocom.org/9934 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I9d714726785407859f26bbef052cd0efc28e8dae Gerrit-Change-Number: 9934 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 15:22:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 15:22:47 +0000 Subject: Change in osmo-sgsn[master]: Disarm T3395 when dettaching mmctx from pdpctx In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9935 ) Change subject: Disarm T3395 when dettaching mmctx from pdpctx ...................................................................... Disarm T3395 when dettaching mmctx from pdpctx In sgsn_pdp_ctx_terminate, a pdp ctx is terminated and the mm ctx is detached. However, T3395 may still be armed and then pdpctx_timer_cb will trigger, and attempt to use the pdp->mm ctx which was already detached (set to NULL) when calling gsm48_tx_gsm_deact_pdp_req()->mmctx2msgid(). Following list of log lines shows the scenario+crash, in which osmo-sgsn is trying to deactivate the ctx all the time but the PCU doesn't ACK it, and then at some point the PDP context is forced released. osmo-sgsn/src/gprs/gprs_gmm.c:2294 MM(901700000015254/d7e9ab95) <- DEACTIVATE PDP CONTEXT REQ osmo-sgsn/src/gprs/gprs_gmm.c:1464 MM(901700000015254/d7e9ab95) -> GMM DETACH REQUEST TLLI=0xd7e9ab95 type=GPRS detach Power-off osmo-sgsn/src/gprs/gprs_gmm.c:313 MM(901700000015254/d7e9ab95) Cleaning MM context due to GPRS DETACH REQUEST osmo-sgsn/src/gprs/gprs_sgsn.c:332 MM(901700000015254/d7e9ab95) Dropping PDP context for NSAPI=5 osmo-sgsn/src/gprs/gprs_sgsn.c:434 PDP(901700000015254/0) Forcing release of PDP context osmo-sgsn/src/gprs/gprs_sndcp.c:508 SNSM-DEACTIVATE.ind (lle=0x62100001bca0, TLLI=d7e9ab95, SAPI=3, NSAPI=5) osmo-sgsn/src/gprs/sgsn_libgtp.c:310 PDP(---/0) Delete PDP Context osmo-sgsn/src/gprs/gprs_gmm.c:2294 MM(---/ffffffff) <- DEACTIVATE PDP CONTEXT REQ osmo-sgsn/src/gprs/gprs_gmm.c:305:25: runtime error: member access within null pointer of type 'const struct sgsn_mm_ctx' Program received signal SIGSEGV, Segmentation fault. 0x0000555555698c1b in mmctx2msgid (msg=0x61d0000172e0, mm=0x0) at /home/pespin/dev/sysmocom/git/osmo-sgsn/src/gprs/gprs_gmm.c:305 305 msgb_tlli(msg) = mm->gb.tlli; (gdb) bt #0 0x0000555555698c1b in mmctx2msgid (msg=0x61d0000172e0, mm=0x0) at osmo-sgsn/src/gprs/gprs_gmm.c:305 #1 0x00005555556b170a in _gsm48_tx_gsm_deact_pdp_req (mm=0x0, tid=0 '\000', sm_cause=38 '&') at osmo-sgsn/src/gprs/gprs_gmm.c:2297 #2 0x00005555556b1a2e in gsm48_tx_gsm_deact_pdp_req (pdp=0x6140000008a0, sm_cause=38 '&') at osmo-sgsn/src/gprs/gprs_gmm.c:2311 #3 0x00005555556b876c in pdpctx_timer_cb (_pdp=0x6140000008a0) at osmo-sgsn/src/gprs/gprs_gmm.c:2717 #4 0x00007ffff355eb3e in osmo_timers_update () at libosmocore/src/timer.c:257 #5 0x00007ffff356255c in osmo_select_main (polling=0) at libosmocore/src/select.c:254 #6 0x00005555556f17cb in main (argc=3, argv=0x7fffffffe298) at osmo-sgsn/src/gprs/sgsn_main.c:531 Change-Id: I2120e53ade6cabad37f9bd99e6680a453411821b --- M include/osmocom/sgsn/gprs_gmm.h M src/gprs/gprs_gmm.c M src/gprs/gprs_sgsn.c 3 files changed, 13 insertions(+), 3 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmocom/sgsn/gprs_gmm.h b/include/osmocom/sgsn/gprs_gmm.h index 3c93efc..28c96ce 100644 --- a/include/osmocom/sgsn/gprs_gmm.h +++ b/include/osmocom/sgsn/gprs_gmm.h @@ -43,4 +43,6 @@ /* TODO: move extract_subscr_* when gsm48_gmm_authorize() got removed */ void extract_subscr_msisdn(struct sgsn_mm_ctx *ctx); void extract_subscr_hlr(struct sgsn_mm_ctx *ctx); + +void pdp_ctx_detach_mm_ctx(struct sgsn_pdp_ctx *pdp); #endif /* _GPRS_GMM_H */ diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index 6a5c5d9..9d8a869 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -2192,6 +2192,16 @@ osmo_timer_del(&pdp->timer); } +void pdp_ctx_detach_mm_ctx(struct sgsn_pdp_ctx *pdp) +{ + /* Detach from MM context */ + llist_del(&pdp->list); + pdp->mm = NULL; + + /* stop timer 3395 */ + pdpctx_timer_stop(pdp, 3395); +} + #if 0 static void msgb_put_pdp_addr_ipv4(struct msgb *msg, uint32_t ipaddr) { diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c index 55ce096..ab5e79a 100644 --- a/src/gprs/gprs_sgsn.c +++ b/src/gprs/gprs_sgsn.c @@ -443,9 +443,7 @@ osmo_signal_dispatch(SS_SGSN, S_SGSN_PDP_TERMINATE, &sig_data); /* Detach from MM context */ - llist_del(&pdp->list); - pdp->mm = NULL; - + pdp_ctx_detach_mm_ctx(pdp); sgsn_delete_pdp_ctx(pdp); } -- To view, visit https://gerrit.osmocom.org/9935 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I2120e53ade6cabad37f9bd99e6680a453411821b Gerrit-Change-Number: 9935 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 15:22:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 15:22:47 +0000 Subject: Change in osmo-sgsn[master]: examples: Enable by default echo req towards active GGSNs In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9936 ) Change subject: examples: Enable by default echo req towards active GGSNs ...................................................................... examples: Enable by default echo req towards active GGSNs 60 seconds is used by default, which is the minimum accepted value for this timer as per 3GPP TS 29.060 section "7.2.1 Echo Request". Having it low by default is good for lab use in which a lot of stuff changes over time. Change-Id: Ia1898d172482bf6a25d829f8fc9a47824f49456f --- M doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg M doc/examples/osmo-sgsn/osmo-sgsn.cfg 2 files changed, 2 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg b/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg index 5e64342..b47878a 100644 --- a/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg +++ b/doc/examples/osmo-sgsn/osmo-sgsn-accept-all.cfg @@ -9,6 +9,7 @@ gtp local-ip 127.0.0.1 ggsn 0 remote-ip 127.0.0.2 ggsn 0 gtp-version 1 + ggsn 0 echo-interval 60 auth-policy accept-all ! ns diff --git a/doc/examples/osmo-sgsn/osmo-sgsn.cfg b/doc/examples/osmo-sgsn/osmo-sgsn.cfg index 06f035f..263bd00 100644 --- a/doc/examples/osmo-sgsn/osmo-sgsn.cfg +++ b/doc/examples/osmo-sgsn/osmo-sgsn.cfg @@ -9,6 +9,7 @@ gtp local-ip 127.0.0.1 ggsn 0 remote-ip 127.0.0.2 ggsn 0 gtp-version 1 + ggsn 0 echo-interval 60 auth-policy remote gsup remote-ip 127.0.0.1 gsup remote-port 4222 -- To view, visit https://gerrit.osmocom.org/9936 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ia1898d172482bf6a25d829f8fc9a47824f49456f Gerrit-Change-Number: 9936 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 15:22:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 15:22:47 +0000 Subject: Change in osmo-sgsn[master]: vty: Add cmd to disable echo loop explictly In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9948 ) Change subject: vty: Add cmd to disable echo loop explictly ...................................................................... vty: Add cmd to disable echo loop explictly Change-Id: I0598427257533ce8ae9e9afa787293d7c98fed15 --- M src/gprs/sgsn_vty.c 1 file changed, 17 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c index 9f9332c..8092158 100644 --- a/src/gprs/sgsn_vty.c +++ b/src/gprs/sgsn_vty.c @@ -185,6 +185,9 @@ if (gctx->echo_interval != -1) vty_out(vty, " ggsn %u echo-interval %"PRId32"%s", gctx->id, gctx->echo_interval, VTY_NEWLINE); + else + vty_out(vty, " ggsn %u no echo-interval%s", + gctx->id, VTY_NEWLINE); } if (sgsn->cfg.dynamic_lookup) @@ -380,6 +383,19 @@ return CMD_SUCCESS; } +DEFUN(cfg_ggsn_no_echo_interval, cfg_ggsn_no_echo_interval_cmd, + "ggsn <0-255> no echo-interval", + GGSN_STR "GGSN Number\n" + NO_STR "Send an echo request to this static GGSN every interval.\n") +{ + uint32_t id = atoi(argv[0]); + struct sgsn_ggsn_ctx *ggc = sgsn_ggsn_ctx_find_alloc(id); + + ggc->echo_interval = -1; + + return CMD_SUCCESS; +} + DEFUN(cfg_ggsn_dynamic_lookup, cfg_ggsn_dynamic_lookup_cmd, "ggsn dynamic", GGSN_STR @@ -1302,6 +1318,7 @@ //install_element(SGSN_NODE, &cfg_ggsn_remote_port_cmd); install_element(SGSN_NODE, &cfg_ggsn_gtp_version_cmd); install_element(SGSN_NODE, &cfg_ggsn_echo_interval_cmd); + install_element(SGSN_NODE, &cfg_ggsn_no_echo_interval_cmd); install_element(SGSN_NODE, &cfg_imsi_acl_cmd); install_element(SGSN_NODE, &cfg_auth_policy_cmd); install_element(SGSN_NODE, &cfg_encrypt_cmd); -- To view, visit https://gerrit.osmocom.org/9948 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I0598427257533ce8ae9e9afa787293d7c98fed15 Gerrit-Change-Number: 9948 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 15:22:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 15:22:48 +0000 Subject: Change in osmo-sgsn[master]: Add optional TearDownInd IE in PDP DEACT REQ towards PCU In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9992 ) Change subject: Add optional TearDownInd IE in PDP DEACT REQ towards PCU ...................................................................... Add optional TearDownInd IE in PDP DEACT REQ towards PCU According to 3GPP TS 24.008 Section 6.1.3.4, the tear down indicator IE maybe included in the DEACTIVATE PDP CONTEXT REQUEST message in order to indicate whether only the PDP context associated with this specific TI or all active PDP contexts sharing the same PDP address and APN as the PDP context associated with this specific TI shall be deactivated. As we don't permit/support establishing multiple PDP contexts using the same APN and PDP address, it shouldn't really make any difference. Nevertheless, we want to clear everything, so let's include it. Change-Id: Ia9bc2d0e93362a8473eac5cf4c7e8ffa41c79e5b --- M include/osmocom/sgsn/gprs_gmm.h M src/gprs/gprs_gmm.c M src/gprs/gprs_sgsn.c 3 files changed, 8 insertions(+), 7 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/sgsn/gprs_gmm.h b/include/osmocom/sgsn/gprs_gmm.h index 28c96ce..d12eaf9 100644 --- a/include/osmocom/sgsn/gprs_gmm.h +++ b/include/osmocom/sgsn/gprs_gmm.h @@ -6,7 +6,7 @@ #include -int gsm48_tx_gsm_deact_pdp_req(struct sgsn_pdp_ctx *pdp, uint8_t sm_cause); +int gsm48_tx_gsm_deact_pdp_req(struct sgsn_pdp_ctx *pdp, uint8_t sm_cause, bool teardown); int gsm48_tx_gsm_act_pdp_rej(struct sgsn_mm_ctx *mm, uint8_t tid, uint8_t cause, uint8_t pco_len, uint8_t *pco_v); int gsm48_tx_gsm_act_pdp_acc(struct sgsn_pdp_ctx *pdp); diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index 9d8a869..d06fa6c 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -2295,11 +2295,12 @@ /* Section 9.5.8: Deactivate PDP Context Request */ static int _gsm48_tx_gsm_deact_pdp_req(struct sgsn_mm_ctx *mm, uint8_t tid, - uint8_t sm_cause) + uint8_t sm_cause, bool teardown) { struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 PDP DET REQ"); struct gsm48_hdr *gh; uint8_t transaction_id = tid ^ 0x8; /* flip */ + uint8_t tear_down_ind = (0x9 << 4) | (!!teardown); LOGMMCTXP(LOGL_INFO, mm, "<- DEACTIVATE PDP CONTEXT REQ\n"); rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_PDP_DL_DEACTIVATE_REQUEST]); @@ -2311,14 +2312,15 @@ gh->msg_type = GSM48_MT_GSM_DEACT_PDP_REQ; msgb_v_put(msg, sm_cause); + msgb_v_put(msg, tear_down_ind); return gsm48_gmm_sendmsg(msg, 0, mm, true); } -int gsm48_tx_gsm_deact_pdp_req(struct sgsn_pdp_ctx *pdp, uint8_t sm_cause) +int gsm48_tx_gsm_deact_pdp_req(struct sgsn_pdp_ctx *pdp, uint8_t sm_cause, bool teardown) { pdpctx_timer_start(pdp, 3395, sgsn->cfg.timers.T3395); - return _gsm48_tx_gsm_deact_pdp_req(pdp->mm, pdp->ti, sm_cause); + return _gsm48_tx_gsm_deact_pdp_req(pdp->mm, pdp->ti, sm_cause, teardown); } /* Section 9.5.9: Deactivate PDP Context Accept */ @@ -2724,7 +2726,7 @@ sgsn_delete_pdp_ctx(pdp); break; } - gsm48_tx_gsm_deact_pdp_req(pdp, GSM_CAUSE_NET_FAIL); + gsm48_tx_gsm_deact_pdp_req(pdp, GSM_CAUSE_NET_FAIL, true); break; default: LOGPDPCTXP(LOGL_ERROR, pdp, "timer expired in unknown mode %u\n", diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c index ab5e79a..35479fb 100644 --- a/src/gprs/gprs_sgsn.c +++ b/src/gprs/gprs_sgsn.c @@ -703,7 +703,7 @@ static void drop_one_pdp(struct sgsn_pdp_ctx *pdp) { if (pdp->mm->gmm_state == GMM_REGISTERED_NORMAL) - gsm48_tx_gsm_deact_pdp_req(pdp, GSM_CAUSE_NET_FAIL); + gsm48_tx_gsm_deact_pdp_req(pdp, GSM_CAUSE_NET_FAIL, true); else { /* FIXME: GPRS paging in case MS is SUSPENDED */ LOGPDPCTXP(LOGL_NOTICE, pdp, "Hard-dropping PDP ctx due to GGSN " @@ -954,4 +954,3 @@ osmo_timer_setup(&sgsn->llme_timer, sgsn_llme_check_cb, NULL); osmo_timer_schedule(&sgsn->llme_timer, GPRS_LLME_CHECK_TICK, 0); } - -- To view, visit https://gerrit.osmocom.org/9992 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ia9bc2d0e93362a8473eac5cf4c7e8ffa41c79e5b Gerrit-Change-Number: 9992 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 15:28:34 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 16 Jul 2018 15:28:34 +0000 Subject: Change in osmo-sgsn[master]: sgsn: Fix T3395 firing forever In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10003 to look at the new patch set (#2). Change subject: sgsn: Fix T3395 firing forever ...................................................................... sgsn: Fix T3395 firing forever field pdp->num_T_exp was being reset to 0 every time pdpctx_timer_start() was called from gsm48_tx_gsm_deact_pdp_req(). Take the chance to test max amount of retrans to 4 as detailed in specs. Change-Id: Iacce3c66f61578ebee37abaa287f7e183f985c1c --- M src/gprs/gprs_gmm.c 1 file changed, 13 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/03/10003/2 -- To view, visit https://gerrit.osmocom.org/10003 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iacce3c66f61578ebee37abaa287f7e183f985c1c Gerrit-Change-Number: 10003 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-CC: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 15:31:07 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 16 Jul 2018 15:31:07 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: Fix TC_attach_pdp_act_user_deact_mt Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10007 Change subject: sgsn: Fix TC_attach_pdp_act_user_deact_mt ...................................................................... sgsn: Fix TC_attach_pdp_act_user_deact_mt Expect to receive a TearDown Indicator. Change-Id: I37dafb5e93ac06b3bd9cab2c06aa3735a8429f2f --- M sgsn/SGSN_Tests.ttcn M sgsn/expected-results.xml 2 files changed, 3 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/07/10007/1 diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index e76ed09..214239e 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -962,7 +962,7 @@ GTP.send(ts_GTPC_DeletePDP(peer, seq_nr, apars.sgsn_tei_c, apars.nsapi, '1'B)); interleave { - [] BSSGP.receive(tr_BD_L3_MT(tr_SM_DEACT_PDP_REQ_MT(apars.tid, ?))) { + [] BSSGP.receive(tr_BD_L3_MT(tr_SM_DEACT_PDP_REQ_MT(apars.tid, ?, true))) { BSSGP.send(ts_SM_DEACT_PDP_ACCEPT_MO(apars.tid)); } [] GTP.receive(tr_GTPC_MsgType(?, deletePDPContextResponse, apars.ggsn_tei_c)) { } diff --git a/sgsn/expected-results.xml b/sgsn/expected-results.xml index f2f2500..2d7063b 100644 --- a/sgsn/expected-results.xml +++ b/sgsn/expected-results.xml @@ -1,5 +1,5 @@ - + @@ -56,12 +56,7 @@ - - Tguard timeout - SGSN_Tests.ttcn:MASKED SGSN_Tests control part - SGSN_Tests.ttcn:MASKED TC_attach_pdp_act_user_deact_mt testcase - - + -- To view, visit https://gerrit.osmocom.org/10007 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I37dafb5e93ac06b3bd9cab2c06aa3735a8429f2f Gerrit-Change-Number: 10007 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 15:31:10 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 16 Jul 2018 15:31:10 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: Fix TC_attach_second_attempt Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10008 Change subject: sgsn: Fix TC_attach_second_attempt ...................................................................... sgsn: Fix TC_attach_second_attempt Use a different IMSI first time in order to get a AUTH Req and LU from osmo-sgsn, like other tests do. During second attach, don't expect to receie an AUTH + LU since osmo-sgsn remembers us. Change-Id: I0989bf8d258c5def3c7f325de2053f62288b9897 --- M sgsn/SGSN_Tests.ttcn M sgsn/expected-results.xml 2 files changed, 12 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/08/10008/1 diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 214239e..c9e407f 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -456,7 +456,7 @@ GSUP.send(ts_GSUP_UL_RES(g_pars.imsi)); } -private function f_gmm_attach(boolean umts_aka_challenge, boolean force_gsm_sres) runs on BSSGP_ConnHdlr { +private function f_gmm_attach(boolean umts_aka_challenge, boolean force_gsm_sres, boolean already_attached := false) runs on BSSGP_ConnHdlr { var BssgpDecoded bd; var RoutingAreaIdentificationV old_ra := f_random_RAI(); var template PDU_L3_MS_SGSN attach_req := ts_GMM_ATTACH_REQ(f_mi_get_lv(), old_ra, false, false, omit, omit); @@ -469,9 +469,11 @@ attach_req.msgs.gprs_mm.attachRequest.msNetworkCapability.msNetworkCapabilityV.solSACapability := '0'B; BSSGP.send(attach_req); - f_gmm_auth(umts_aka_challenge, force_gsm_sres); - /* Expect SGSN to perform LU with HLR */ - f_gmm_gsup_lu_isd(); + if (not already_attached) { + f_gmm_auth(umts_aka_challenge, force_gsm_sres); + /* Expect SGSN to perform LU with HLR */ + f_gmm_gsup_lu_isd(); + } BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?))) -> value bd { f_process_attach_accept(bd.l3_mt.msgs.gprs_mm.attachAccept); @@ -481,7 +483,7 @@ } private function f_TC_attach(charstring id) runs on BSSGP_ConnHdlr { - f_gmm_attach(false, false); + f_gmm_attach(false, false, false); setverdict(pass); } @@ -1251,15 +1253,15 @@ /* first perform regular attach */ f_TC_attach(id); - /* second to perform regular attach */ - f_TC_attach(id); + /* second to perform regular attach, don't expect AUTH or LU */ + f_gmm_attach(false, false, true); } testcase TC_attach_second_attempt() runs on test_CT { var BSSGP_ConnHdlr vc_conn; f_init(); - vc_conn := f_start_handler(refers(f_TC_attach_forget_tlli_attach), testcasename(), g_gb[0], 22); + vc_conn := f_start_handler(refers(f_TC_attach_forget_tlli_attach), testcasename(), g_gb[0], 24); vc_conn.done; } diff --git a/sgsn/expected-results.xml b/sgsn/expected-results.xml index 2d7063b..bc00aac 100644 --- a/sgsn/expected-results.xml +++ b/sgsn/expected-results.xml @@ -1,5 +1,5 @@ - + @@ -57,8 +57,6 @@ - - - + -- To view, visit https://gerrit.osmocom.org/10008 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I0989bf8d258c5def3c7f325de2053f62288b9897 Gerrit-Change-Number: 10008 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 15:31:10 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 16 Jul 2018 15:31:10 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: Add Test to verify timer t3395 Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10009 Change subject: sgsn: Add Test to verify timer t3395 ...................................................................... sgsn: Add Test to verify timer t3395 Change-Id: I9ec0863603692045b0d8da376e65080150066173 --- M sgsn/SGSN_Tests.ttcn M sgsn/expected-results.xml 2 files changed, 39 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/09/10009/1 diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index c9e407f..e7588fb 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -1305,6 +1305,42 @@ g_use_echo := false } +/* ATTACH + PDP CTX ACT + user plane traffic + PDP CTX DEACT in MT direction + trigger T3395 */ +private function f_TC_attach_pdp_act_deact_mt_t3395_expire(charstring id) runs on BSSGP_ConnHdlr { + var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip)); + var integer seq_nr := 23; + var GtpPeer peer; + var integer i; + + /* first perform regular attach */ + f_TC_attach(id); + /* then activate PDP context */ + f_pdp_ctx_act(apars); + + BSSGP.clear; + peer := valueof(ts_GtpPeerC(apars.sgsn_ip_c)); + GTP.send(ts_GTPC_DeletePDP(peer, seq_nr, apars.sgsn_tei_c, apars.nsapi, '1'B)); + + for (i := 0; i < 5; i := i+1) { + alt { + [] BSSGP.receive(tr_BD_L3_MT(tr_SM_DEACT_PDP_REQ_MT(apars.tid, ?, true))) {} + [] as_xid(apars); + } + } + + GTP.receive(tr_GTPC_MsgType(?, deletePDPContextResponse, apars.ggsn_tei_c)) {} + + BSSGP.send(ts_SM_DEACT_PDP_ACCEPT_MO(apars.tid)); + setverdict(pass); +} +testcase TC_attach_pdp_act_deact_mt_t3395_expire() runs on test_CT { + var BSSGP_ConnHdlr vc_conn; + f_init(); + f_sleep(1.0); + vc_conn := f_start_handler(refers(f_TC_attach_pdp_act_deact_mt_t3395_expire), testcasename(), g_gb[0], 25, 60.0); + vc_conn.done; +} + private function f_TC_hlr_location_cancel_request_update(charstring id) runs on BSSGP_ConnHdlr { /* MS: perform regular attach */ f_TC_attach(id); @@ -1680,6 +1716,7 @@ execute( TC_attach_pdp_act_user_deact_mt() ); execute( TC_attach_second_attempt() ); execute( TC_attach_restart_ctr_dettach() ); + execute( TC_attach_pdp_act_deact_mt_t3395_expire() ); } diff --git a/sgsn/expected-results.xml b/sgsn/expected-results.xml index bc00aac..3422403 100644 --- a/sgsn/expected-results.xml +++ b/sgsn/expected-results.xml @@ -1,5 +1,5 @@ - + @@ -59,4 +59,5 @@ + -- To view, visit https://gerrit.osmocom.org/10009 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I9ec0863603692045b0d8da376e65080150066173 Gerrit-Change-Number: 10009 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 15:39:54 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 16 Jul 2018 15:39:54 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: Fix TC_attach_second_attempt In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10008 ) Change subject: sgsn: Fix TC_attach_second_attempt ...................................................................... Patch Set 1: Abandoning, see OS#2958 -- To view, visit https://gerrit.osmocom.org/10008 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0989bf8d258c5def3c7f325de2053f62288b9897 Gerrit-Change-Number: 10008 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Mon, 16 Jul 2018 15:39:54 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 15:40:00 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 16 Jul 2018 15:40:00 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: Fix TC_attach_second_attempt In-Reply-To: References: Message-ID: Pau Espin Pedrol has abandoned this change. ( https://gerrit.osmocom.org/10008 ) Change subject: sgsn: Fix TC_attach_second_attempt ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/10008 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: I0989bf8d258c5def3c7f325de2053f62288b9897 Gerrit-Change-Number: 10008 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 15:54:53 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 16 Jul 2018 15:54:53 +0000 Subject: Change in osmo-bsc[master]: codec_pref: move match_codec_pref() to separate c-file and add unit-test Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/10010 Change subject: codec_pref: move match_codec_pref() to separate c-file and add unit-test ...................................................................... codec_pref: move match_codec_pref() to separate c-file and add unit-test At the moment there are three sources that may advertise a list of supported audio codec/rate settings. There is the MS that advertises advertises a speech codec list and the MSC that sends a channel type information element over A and there are also settings in the bsc configuration file that may restrict the codec/rate types that are allowed to use. The function match_codec_pref() looks at all of the three buckets and selects a codec that satisfies all three. This is already a somewhat complicated process, overit is very isolated, so lets give it its own c-file. Due to the lack of unit-tests it is very hard to make changes here so lets add also unit-test to make sure that regressions are catched early. - Put match_codec_pref() and all its helper functions into a separate c-file. - Add a unit test. Change-Id: Iabedfdcec8b99a319f2d57cbea45c5e36c7b6e29 Related: OS#3361 --- M configure.ac M include/osmocom/bsc/Makefile.am A include/osmocom/bsc/codec_pref.h M src/osmo-bsc/Makefile.am A src/osmo-bsc/codec_pref.c M src/osmo-bsc/osmo_bsc_bssap.c M tests/Makefile.am A tests/codec_pref/Makefile.am A tests/codec_pref/codec_pref_test.c A tests/codec_pref/codec_pref_test.ok M tests/testsuite.at 11 files changed, 1,428 insertions(+), 160 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/10/10010/1 diff --git a/configure.ac b/configure.ac index 25bcad7..a99e143 100644 --- a/configure.ac +++ b/configure.ac @@ -176,6 +176,7 @@ tests/atlocal tests/gsm0408/Makefile tests/bsc/Makefile + tests/codec_pref/Makefile tests/abis/Makefile tests/subscr/Makefile tests/nanobts_omlattr/Makefile diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am index 5fa39eb..dfab592 100644 --- a/include/osmocom/bsc/Makefile.am +++ b/include/osmocom/bsc/Makefile.am @@ -12,6 +12,7 @@ bss.h \ bts_ipaccess_nanobts_omlattr.h \ chan_alloc.h \ + codec_pref.h \ ctrl.h \ debug.h \ e1_config.h \ diff --git a/include/osmocom/bsc/codec_pref.h b/include/osmocom/bsc/codec_pref.h new file mode 100644 index 0000000..6933cea --- /dev/null +++ b/include/osmocom/bsc/codec_pref.h @@ -0,0 +1,6 @@ +#pragma once + +int match_codec_pref(int *full_rate, enum gsm48_chan_mode *chan_mode, + const struct gsm0808_channel_type *ct, + const struct gsm0808_speech_codec_list *scl, + const struct bsc_msc_data *msc); diff --git a/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am index a459a92..db63a99 100644 --- a/src/osmo-bsc/Makefile.am +++ b/src/osmo-bsc/Makefile.am @@ -53,6 +53,7 @@ bts_sysmobts.c \ bts_unknown.c \ chan_alloc.c \ + codec_pref.c \ e1_config.c \ gsm_04_08_utils.c \ gsm_04_80_utils.c \ diff --git a/src/osmo-bsc/codec_pref.c b/src/osmo-bsc/codec_pref.c new file mode 100644 index 0000000..db4fee4 --- /dev/null +++ b/src/osmo-bsc/codec_pref.c @@ -0,0 +1,174 @@ +/* + * (C) 2017-2018 by sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Philipp Maier + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include + +/* Helper function for match_codec_pref(), looks up a matching chan mode for + * a given permitted speech value */ +enum gsm48_chan_mode gsm88_to_chan_mode(enum gsm0808_permitted_speech speech) +{ + switch (speech) { + case GSM0808_PERM_HR1: + case GSM0808_PERM_FR1: + return GSM48_CMODE_SPEECH_V1; + break; + case GSM0808_PERM_HR2: + case GSM0808_PERM_FR2: + return GSM48_CMODE_SPEECH_EFR; + break; + case GSM0808_PERM_HR3: + case GSM0808_PERM_FR3: + return GSM48_CMODE_SPEECH_AMR; + break; + default: + LOGP(DMSC, LOGL_FATAL, "Unsupported permitted speech selected, assuming AMR as channel mode...\n"); + return GSM48_CMODE_SPEECH_AMR; + } +} + +/* Helper function for match_codec_pref(), looks up a matching permitted speech + * value for a given msc audio codec pref */ +enum gsm0808_permitted_speech audio_support_to_gsm88(struct gsm_audio_support *audio) +{ + if (audio->hr) { + switch (audio->ver) { + case 1: + return GSM0808_PERM_HR1; + break; + case 2: + return GSM0808_PERM_HR2; + break; + case 3: + return GSM0808_PERM_HR3; + break; + default: + LOGP(DMSC, LOGL_ERROR, "Wrong speech mode: hr%d, using hr1 instead\n", audio->ver); + return GSM0808_PERM_HR1; + } + } else { + switch (audio->ver) { + case 1: + return GSM0808_PERM_FR1; + break; + case 2: + return GSM0808_PERM_FR2; + break; + case 3: + return GSM0808_PERM_FR3; + break; + default: + LOGP(DMSC, LOGL_ERROR, "Wrong speech mode: fr%d, using fr1 instead\n", audio->ver); + return GSM0808_PERM_FR1; + } + } +} + +/* Helper function for match_codec_pref(), tests if a given audio support + * matches one of the permitted speech settings of the channel type element. + * The matched permitted speech value is then also compared against the + * speech codec list. (optional, only relevant for AoIP) */ +static bool test_codec_pref(const struct gsm0808_channel_type *ct, + const struct gsm0808_speech_codec_list *scl, uint8_t perm_spch) +{ + unsigned int i; + bool match = false; + struct gsm0808_speech_codec sc; + int rc; + + /* Try to find the given permitted speech value in the + * codec list of the channel type element */ + for (i = 0; i < ct->perm_spch_len; i++) { + if (ct->perm_spch[i] == perm_spch) { + match = true; + break; + } + } + + /* If we do not have a speech codec list to test against, + * we just exit early (will be always the case in non-AoIP networks) */ + if (!scl) + return match; + + /* If we failed to match until here, there is no + * point in testing further */ + if (match == false) + return false; + + /* Extrapolate speech codec data */ + rc = gsm0808_speech_codec_from_chan_type(&sc, perm_spch); + if (rc < 0) + return false; + + /* Try to find extrapolated speech codec data in + * the speech codec list */ + for (i = 0; i < scl->len; i++) { + if (sc.type == scl->codec[i].type) + return true; + } + + return false; +} + +/*! Helper function for bssmap_handle_assignm_req(), matches the codec + * preferences from the MSC with the codec preferences + * \param[out] full_rate '1' if full-rate, '0' if half-rate, '-1' if no match + * \param[out] chan_mode GSM 04.08 channel mode + * \param[in] ct GSM 08.08 channel type + * \param[in] scl GSM 08.08 speech codec list + * \param[in] msc MSC data [for configuration] + * \returns 0 on success, -1 in case no match was found */ +int match_codec_pref(int *full_rate, enum gsm48_chan_mode *chan_mode, + const struct gsm0808_channel_type *ct, + const struct gsm0808_speech_codec_list *scl, const struct bsc_msc_data *msc) +{ + unsigned int i; + uint8_t perm_spch; + bool match = false; + + for (i = 0; i < msc->audio_length; i++) { + perm_spch = audio_support_to_gsm88(msc->audio_support[i]); + if (test_codec_pref(ct, scl, perm_spch)) { + match = true; + break; + } + } + + /* Exit without result, in case no match can be deteched */ + if (!match) { + *full_rate = -1; + *chan_mode = GSM48_CMODE_SIGN; + return -1; + } + + /* Check if the result is a half or full rate codec */ + if (perm_spch == GSM0808_PERM_HR1 || perm_spch == GSM0808_PERM_HR2 || perm_spch == GSM0808_PERM_HR3 + || perm_spch == GSM0808_PERM_HR4 || perm_spch == GSM0808_PERM_HR6) + *full_rate = 0; + else + *full_rate = 1; + + /* Lookup a channel mode for the selected codec */ + *chan_mode = gsm88_to_chan_mode(perm_spch); + + return 0; +} diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index c2d51b5..96cc2c5 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -22,17 +22,13 @@ #include #include #include -#include #include #include #include #include #include - -#include +#include #include -#include -#include #include #include #include @@ -45,161 +41,6 @@ * helpers for the assignment command */ -/* Helper function for match_codec_pref(), looks up a matching permitted speech - * value for a given msc audio codec pref */ -enum gsm0808_permitted_speech audio_support_to_gsm88(struct gsm_audio_support *audio) -{ - if (audio->hr) { - switch (audio->ver) { - case 1: - return GSM0808_PERM_HR1; - break; - case 2: - return GSM0808_PERM_HR2; - break; - case 3: - return GSM0808_PERM_HR3; - break; - default: - LOGP(DMSC, LOGL_ERROR, "Wrong speech mode: hr%d, using hr1 instead\n", - audio->ver); - return GSM0808_PERM_HR1; - } - } else { - switch (audio->ver) { - case 1: - return GSM0808_PERM_FR1; - break; - case 2: - return GSM0808_PERM_FR2; - break; - case 3: - return GSM0808_PERM_FR3; - break; - default: - LOGP(DMSC, LOGL_ERROR, "Wrong speech mode: fr%d, using fr1 instead\n", - audio->ver); - return GSM0808_PERM_FR1; - } - } -} - -/* Helper function for match_codec_pref(), looks up a matching chan mode for - * a given permitted speech value */ -enum gsm48_chan_mode gsm88_to_chan_mode(enum gsm0808_permitted_speech speech) -{ - switch (speech) { - case GSM0808_PERM_HR1: - case GSM0808_PERM_FR1: - return GSM48_CMODE_SPEECH_V1; - break; - case GSM0808_PERM_HR2: - case GSM0808_PERM_FR2: - return GSM48_CMODE_SPEECH_EFR; - break; - case GSM0808_PERM_HR3: - case GSM0808_PERM_FR3: - return GSM48_CMODE_SPEECH_AMR; - break; - default: - LOGP(DMSC, LOGL_FATAL, - "Unsupported permitted speech selected, assuming AMR as channel mode...\n"); - return GSM48_CMODE_SPEECH_AMR; - } -} - -/* Helper function for match_codec_pref(), tests if a given audio support - * matches one of the permitted speech settings of the channel type element. - * The matched permitted speech value is then also compared against the - * speech codec list. (optional, only relevant for AoIP) */ -static bool test_codec_pref(const struct gsm0808_channel_type *ct, - const struct gsm0808_speech_codec_list *scl, - uint8_t perm_spch) -{ - unsigned int i; - bool match = false; - struct gsm0808_speech_codec sc; - int rc; - - /* Try to finde the given permitted speech value in the - * codec list of the channel type element */ - for (i = 0; i < ct->perm_spch_len; i++) { - if (ct->perm_spch[i] == perm_spch) { - match = true; - break; - } - } - - /* If we do not have a speech codec list to test against, - * we just exit early (will be always the case in non-AoIP networks) */ - if (!scl) - return match; - - /* If we failed to match until here, there is no - * point in testing further */ - if (match == false) - return false; - - /* Extrapolate speech codec data */ - rc = gsm0808_speech_codec_from_chan_type(&sc, perm_spch); - if (rc < 0) - return false; - - /* Try to find extrapolated speech codec data in - * the speech codec list */ - for (i = 0; i < scl->len; i++) { - if (sc.type == scl->codec[i].type) - return true; - } - - return false; -} - -/*! Helper function for bssmap_handle_assignm_req(), matches the codec - * preferences from the MSC with the codec preferences - * \param[out] full_rate '1' if full-rate, '0' if half-rate, '-1' if no match - * \param[out] chan_mode GSM 04.08 channel mode - * \param[in] ct GSM 08.08 channel type - * \param[in] scl GSM 08.08 speech codec list - * \param[in] msc MSC data [for configuration] - * \returns 0 on success, -1 in case no match was found */ -static int match_codec_pref(int *full_rate, enum gsm48_chan_mode *chan_mode, - const struct gsm0808_channel_type *ct, - const struct gsm0808_speech_codec_list *scl, - const struct bsc_msc_data *msc) -{ - unsigned int i; - uint8_t perm_spch; - bool match = false; - - for (i = 0; i < msc->audio_length; i++) { - perm_spch = audio_support_to_gsm88(msc->audio_support[i]); - if (test_codec_pref(ct, scl, perm_spch)) { - match = true; - break; - } - } - - /* Exit without result, in case no match can be deteched */ - if (!match) { - *full_rate = -1; - *chan_mode = GSM48_CMODE_SIGN; - return -1; - } - - /* Check if the result is a half or full rate codec */ - if (perm_spch == GSM0808_PERM_HR1 || perm_spch == GSM0808_PERM_HR2 - || perm_spch == GSM0808_PERM_HR3 || perm_spch == GSM0808_PERM_HR4 - || perm_spch == GSM0808_PERM_HR6) - *full_rate = 0; - else - *full_rate = 1; - - /* Lookup a channel mode for the selected codec */ - *chan_mode = gsm88_to_chan_mode(perm_spch); - - return 0; -} static int bssmap_handle_reset_ack(struct bsc_msc_data *msc, struct msgb *msg, unsigned int length) diff --git a/tests/Makefile.am b/tests/Makefile.am index 95d836b..9b4cfe4 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,5 +1,6 @@ SUBDIRS = \ bsc \ + codec_pref \ gsm0408 \ abis \ subscr \ diff --git a/tests/codec_pref/Makefile.am b/tests/codec_pref/Makefile.am new file mode 100644 index 0000000..0dac8d8 --- /dev/null +++ b/tests/codec_pref/Makefile.am @@ -0,0 +1,31 @@ +AM_CPPFLAGS = \ + $(all_includes) \ + -I$(top_srcdir)/include \ + $(NULL) + +AM_CFLAGS = \ + -Wall \ + -ggdb3 \ + $(NULL) + +AM_LDFLAGS = \ + $(NULL) + +EXTRA_DIST = \ + codec_pref_test.ok \ + $(NULL) + +noinst_PROGRAMS = \ + codec_pref_test \ + $(NULL) + +codec_pref_test_SOURCES = \ + codec_pref_test.c \ + $(NULL) + +codec_pref_test_LDADD = \ + $(top_builddir)/src/osmo-bsc/codec_pref.o \ + $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOGSM_LIBS) \ + -lrt \ + $(NULL) diff --git a/tests/codec_pref/codec_pref_test.c b/tests/codec_pref/codec_pref_test.c new file mode 100644 index 0000000..3c86081 --- /dev/null +++ b/tests/codec_pref/codec_pref_test.c @@ -0,0 +1,499 @@ +/* + * (C) 2018 by sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Philipp Maier + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include +#include +#include + +#include + +void *ctx = NULL; + +#define MSC_AUDIO_SUPPORT_MAX 5 +#define N_CONFIG_VARIANTS 9 + +/* Make sure that there is some memory to put our test configuration. */ +static void init_msc_config(struct bsc_msc_data *msc) +{ + unsigned int i; + + msc->audio_support = talloc_zero_array(ctx, struct gsm_audio_support *, MSC_AUDIO_SUPPORT_MAX); + msc->audio_length = MSC_AUDIO_SUPPORT_MAX; + for (i = 0; i < MSC_AUDIO_SUPPORT_MAX; i++) { + msc->audio_support[i] = talloc_zero(msc->audio_support, struct gsm_audio_support); + } +} + +/* Free memory that we have used for the test configuration. */ +static void free_msc_config(struct bsc_msc_data *msc) +{ + talloc_free(msc->audio_support); +} + +/* The speech codec list is sent by the MS and lists the voice codec settings + * that the MS is able to support. The BSC must select one of this codecs + * depending on what the MSC is able to support. The following function + * generates some realistically made up speech codec lists. */ +static void make_scl_config(struct gsm0808_speech_codec_list *scl, uint8_t config_no) +{ + OSMO_ASSERT(config_no < N_CONFIG_VARIANTS); + + switch (config_no) { + case 0: + /* FR1 only */ + scl->codec[0].type = GSM0808_SCT_FR1; + scl->len = 1; + break; + case 1: + /* HR1 only */ + scl->codec[0].type = GSM0808_SCT_HR1; + scl->len = 1; + break; + case 2: + /* FR2 only */ + scl->codec[0].type = GSM0808_SCT_FR2; + scl->len = 1; + break; + case 3: + /* FR3 only */ + scl->codec[0].type = GSM0808_SCT_FR3; + scl->len = 1; + break; + case 4: + /* HR3 only */ + scl->codec[0].type = GSM0808_SCT_HR3; + scl->len = 1; + break; + case 5: + /* FR1 and HR1 */ + scl->codec[0].type = GSM0808_SCT_FR1; + scl->codec[1].type = GSM0808_SCT_HR1; + scl->len = 2; + break; + case 6: + /* FR1, FR2 and HR1 */ + scl->codec[0].type = GSM0808_SCT_FR1; + scl->codec[1].type = GSM0808_SCT_FR2; + scl->codec[2].type = GSM0808_SCT_HR1; + scl->len = 3; + break; + case 7: + /* FR1, FR3 and HR3 */ + scl->codec[0].type = GSM0808_SCT_FR1; + scl->codec[1].type = GSM0808_SCT_FR3; + scl->codec[2].type = GSM0808_SCT_HR3; + scl->len = 3; + break; + case 8: + /* FR1, FR2, FR3, HR1 and HR3 */ + scl->codec[0].type = GSM0808_SCT_FR1; + scl->codec[1].type = GSM0808_SCT_FR2; + scl->codec[2].type = GSM0808_SCT_FR3; + scl->codec[3].type = GSM0808_SCT_HR1; + scl->codec[4].type = GSM0808_SCT_HR3; + scl->len = 5; + break; + } +} + +/* The channel type element which is sent to the BSC by the MSC lists all the + * codecs that the MSC is able to support. The following function generates + * a realistic permitted speech settings */ +static void make_ct_config(struct gsm0808_channel_type *ct, uint8_t config_no) +{ + OSMO_ASSERT(config_no < N_CONFIG_VARIANTS); + + switch (config_no) { + case 0: + /* FR1 only */ + ct->perm_spch[0] = GSM0808_PERM_FR1; + ct->perm_spch_len = 1; + break; + case 1: + /* HR1 only */ + ct->perm_spch[0] = GSM0808_PERM_HR1; + ct->perm_spch_len = 1; + break; + case 2: + /* FR2 only */ + ct->perm_spch[0] = GSM0808_PERM_FR2; + ct->perm_spch_len = 1; + break; + case 3: + /* FR3 only */ + ct->perm_spch[0] = GSM0808_PERM_FR3; + ct->perm_spch_len = 1; + break; + case 4: + /* HR3 only */ + ct->perm_spch[0] = GSM0808_PERM_HR3; + ct->perm_spch_len = 1; + break; + case 5: + /* FR1 and HR1 */ + ct->perm_spch[0] = GSM0808_PERM_FR1; + ct->perm_spch[1] = GSM0808_PERM_HR1; + ct->perm_spch_len = 2; + break; + case 6: + /* FR1, FR2 and HR1 */ + ct->perm_spch[0] = GSM0808_PERM_FR1; + ct->perm_spch[1] = GSM0808_PERM_FR2; + ct->perm_spch[2] = GSM0808_PERM_HR1; + ct->perm_spch_len = 3; + break; + case 7: + /* FR1, FR3 and HR3 */ + ct->perm_spch[0] = GSM0808_PERM_FR1; + ct->perm_spch[1] = GSM0808_PERM_FR3; + ct->perm_spch[2] = GSM0808_PERM_HR3; + ct->perm_spch_len = 3; + break; + case 8: + /* FR1, FR2, FR3, HR1 and HR3 */ + ct->perm_spch[0] = GSM0808_PERM_FR1; + ct->perm_spch[1] = GSM0808_PERM_FR2; + ct->perm_spch[2] = GSM0808_PERM_FR3; + ct->perm_spch[3] = GSM0808_PERM_HR1; + ct->perm_spch[4] = GSM0808_PERM_HR3; + ct->perm_spch_len = 5; + break; + } +} + +/* Generate some realistic MSC configuration which one also could find in the + * real world. This configuration acts as a filter. While the MSC could in + * theory advertise codecs more codecs as we are able to support we have to + * make sure that only the codecs we have support for are considered. */ +static void make_msc_config(struct bsc_msc_data *msc, uint8_t config_no) +{ + /* 1 = FR1/HR1 + * 2 = FR2/HR2 + * 3 = FR2/HR3 + * Note: HR2 is deprecated */ + + OSMO_ASSERT(config_no < N_CONFIG_VARIANTS); + + switch (config_no) { + case 0: + /* FR1 only */ + msc->audio_support[0]->ver = 1; + msc->audio_support[0]->hr = 0; + msc->audio_length = 1; + break; + case 1: + /* HR1 only */ + msc->audio_support[0]->ver = 1; + msc->audio_support[0]->hr = 1; + msc->audio_length = 1; + break; + case 2: + /* FR2 only */ + msc->audio_support[0]->ver = 2; + msc->audio_support[0]->hr = 0; + msc->audio_length = 1; + break; + case 3: + /* FR3 only */ + msc->audio_support[0]->ver = 3; + msc->audio_support[0]->hr = 0; + msc->audio_length = 1; + break; + case 4: + /* HR3 only */ + msc->audio_support[0]->ver = 3; + msc->audio_support[0]->hr = 1; + msc->audio_length = 1; + break; + case 5: + /* FR1 and HR1 */ + msc->audio_support[0]->ver = 1; + msc->audio_support[0]->hr = 0; + msc->audio_support[1]->ver = 1; + msc->audio_support[1]->hr = 1; + msc->audio_length = 2; + break; + case 6: + /* FR1, FR2 and HR1 */ + msc->audio_support[0]->ver = 1; + msc->audio_support[0]->hr = 0; + msc->audio_support[1]->ver = 2; + msc->audio_support[1]->hr = 0; + msc->audio_support[2]->ver = 1; + msc->audio_support[2]->hr = 1; + msc->audio_length = 3; + break; + case 7: + /* FR1, FR3 and HR3 */ + msc->audio_support[0]->ver = 1; + msc->audio_support[0]->hr = 0; + msc->audio_support[1]->ver = 3; + msc->audio_support[1]->hr = 0; + msc->audio_support[2]->ver = 3; + msc->audio_support[2]->hr = 1; + msc->audio_length = 3; + break; + case 8: + /* FR1, FR2, FR3, HR1 and HR3 */ + msc->audio_support[0]->ver = 1; + msc->audio_support[0]->hr = 0; + msc->audio_support[1]->ver = 2; + msc->audio_support[1]->hr = 0; + msc->audio_support[2]->ver = 3; + msc->audio_support[2]->hr = 0; + msc->audio_support[3]->ver = 1; + msc->audio_support[3]->hr = 1; + msc->audio_support[4]->ver = 3; + msc->audio_support[4]->hr = 1; + msc->audio_length = 5; + break; + } +} + +/* Try execute match_codec_pref(), display input and output parameters */ +static int test_match_codec_pref(const struct gsm0808_channel_type *ct, + const struct gsm0808_speech_codec_list *scl, const struct bsc_msc_data *msc) +{ + int rc; + unsigned int i; + int full_rate; + enum gsm48_chan_mode chan_mode; + + printf("Determining channel mode and rate:\n"); + + printf(" * MS: speech codec list (%u items):\n", scl->len); + for (i = 0; i < scl->len; i++) + printf(" codec[%u]->type=%s\n", i, gsm0808_speech_codec_type_name(scl->codec[i].type)); + + printf(" * MSC: channel type permitted speech (%u items):\n", ct->perm_spch_len); + for (i = 0; i < ct->perm_spch_len; i++) + printf(" perm_spch[%u]=%s\n", i, gsm0808_permitted_speech_name(ct->perm_spch[i])); + + printf(" * BSS: audio support settings (%u items):\n", msc->audio_length); + for (i = 0; i < msc->audio_length; i++) + if (msc->audio_support[i]->hr) + printf(" audio_support[%u]=HR%u\n", i, msc->audio_support[i]->ver); + else + printf(" audio_support[%u]=FR%u\n", i, msc->audio_support[i]->ver); + + rc = match_codec_pref(&full_rate, &chan_mode, ct, scl, msc); + printf(" * result: rc=%i, full_rate=%i, chan_mode=%s\n", rc, full_rate, gsm48_chan_mode_name(chan_mode)); + + printf("\n"); + + return rc; +} + +/* MS, MSC and local MSC settings are the same */ +static void test_one_to_one(void) +{ + unsigned int i; + struct gsm0808_channel_type ct_msc; + struct gsm0808_speech_codec_list scl_ms; + struct bsc_msc_data msc_local; + int rc; + + printf("============== test_one_to_one ==============\n\n"); + + init_msc_config(&msc_local); + + for (i = 0; i < N_CONFIG_VARIANTS; i++) { + make_msc_config(&msc_local, i); + make_scl_config(&scl_ms, i); + make_ct_config(&ct_msc, i); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + OSMO_ASSERT(rc == 0); + } + + free_msc_config(&msc_local); +} + +/* Network supports all combinations, MS varies */ +static void test_ms(void) +{ + unsigned int i; + struct gsm0808_channel_type ct_msc; + struct gsm0808_speech_codec_list scl_ms; + struct bsc_msc_data msc_local; + int rc; + + printf("============== test_ms ==============\n\n"); + + init_msc_config(&msc_local); + + make_msc_config(&msc_local, 8); + make_ct_config(&ct_msc, 8); + for (i = 0; i < N_CONFIG_VARIANTS; i++) { + make_scl_config(&scl_ms, i); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + OSMO_ASSERT(rc == 0); + } + + free_msc_config(&msc_local); +} + +/* BSS and MS support all combinations, MSC varies */ +static void test_ct(void) +{ + unsigned int i; + struct gsm0808_channel_type ct_msc; + struct gsm0808_speech_codec_list scl_ms; + struct bsc_msc_data msc_local; + int rc; + + printf("============== test_ct ==============\n\n"); + + init_msc_config(&msc_local); + + make_msc_config(&msc_local, 8); + make_scl_config(&scl_ms, 8); + for (i = 0; i < N_CONFIG_VARIANTS; i++) { + make_ct_config(&ct_msc, i); + test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + OSMO_ASSERT(rc == 0); + } + + free_msc_config(&msc_local); +} + +/* MSC and MS support all combinations, BSS varies */ +static void test_msc(void) +{ + unsigned int i; + struct gsm0808_channel_type ct_msc; + struct gsm0808_speech_codec_list scl_ms; + struct bsc_msc_data msc_local; + int rc; + + printf("============== test_msc ==============\n\n"); + + init_msc_config(&msc_local); + + make_ct_config(&ct_msc, 8); + make_scl_config(&scl_ms, 8); + for (i = 0; i < N_CONFIG_VARIANTS; i++) { + make_msc_config(&msc_local, 8); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + OSMO_ASSERT(rc == 0); + } + + free_msc_config(&msc_local); +} + +/* Some mixed configurations that are supposed to work */ +static void test_selected_working(void) +{ + struct gsm0808_channel_type ct_msc; + struct gsm0808_speech_codec_list scl_ms; + struct bsc_msc_data msc_local; + int rc; + + printf("============== test_selected_working ==============\n\n"); + + init_msc_config(&msc_local); + + make_scl_config(&scl_ms, 6); + make_ct_config(&ct_msc, 5); + make_msc_config(&msc_local, 7); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + OSMO_ASSERT(rc == 0); + + make_scl_config(&scl_ms, 0); + make_ct_config(&ct_msc, 5); + make_msc_config(&msc_local, 7); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + OSMO_ASSERT(rc == 0); + + make_scl_config(&scl_ms, 1); + make_ct_config(&ct_msc, 5); + make_msc_config(&msc_local, 6); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + OSMO_ASSERT(rc == 0); + + free_msc_config(&msc_local); +} + +/* Some mixed configurations that can not work */ +static void test_selected_non_working(void) +{ + struct gsm0808_channel_type ct_msc; + struct gsm0808_speech_codec_list scl_ms; + struct bsc_msc_data msc_local; + int rc; + + printf("============== test_selected_non_working ==============\n\n"); + + init_msc_config(&msc_local); + + make_scl_config(&scl_ms, 1); + make_ct_config(&ct_msc, 5); + make_msc_config(&msc_local, 7); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + OSMO_ASSERT(rc == -1); + + make_scl_config(&scl_ms, 1); + make_ct_config(&ct_msc, 5); + make_msc_config(&msc_local, 7); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + OSMO_ASSERT(rc == -1); + + make_scl_config(&scl_ms, 1); + make_ct_config(&ct_msc, 4); + make_msc_config(&msc_local, 6); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + OSMO_ASSERT(rc == -1); + + free_msc_config(&msc_local); +} + +static const struct log_info_cat log_categories[] = { + [DMSC] = { + .name = "DMSC", + .description = "Mobile Switching Center", + .enabled = 1,.loglevel = LOGL_NOTICE, + }, +}; + +static const struct log_info log_info = { + .cat = log_categories, + .num_cat = ARRAY_SIZE(log_categories), +}; + +int main(int argc, char **argv) +{ + ctx = talloc_named_const(NULL, 0, "codec_pref_test"); + msgb_talloc_ctx_init(ctx, 0); + osmo_init_logging2(ctx, &log_info); + + test_one_to_one(); + test_ms(); + test_ct(); + test_msc(); + test_selected_working(); + test_selected_non_working(); + + printf("Testing execution completed.\n"); + talloc_free(ctx); + return 0; +} diff --git a/tests/codec_pref/codec_pref_test.ok b/tests/codec_pref/codec_pref_test.ok new file mode 100644 index 0000000..f97fbb1 --- /dev/null +++ b/tests/codec_pref/codec_pref_test.ok @@ -0,0 +1,707 @@ +============== test_one_to_one ============== + +Determining channel mode and rate: + * MS: speech codec list (1 items): + codec[0]->type=FR1 + * MSC: channel type permitted speech (1 items): + perm_spch[0]=FR1 + * BSS: audio support settings (1 items): + audio_support[0]=FR1 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (1 items): + codec[0]->type=HR1 + * MSC: channel type permitted speech (1 items): + perm_spch[0]=HR1 + * BSS: audio support settings (1 items): + audio_support[0]=HR1 + * result: rc=0, full_rate=0, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (1 items): + codec[0]->type=FR2 + * MSC: channel type permitted speech (1 items): + perm_spch[0]=FR2 + * BSS: audio support settings (1 items): + audio_support[0]=FR2 + * result: rc=0, full_rate=1, chan_mode=SPEECH_EFR + +Determining channel mode and rate: + * MS: speech codec list (1 items): + codec[0]->type=FR3 + * MSC: channel type permitted speech (1 items): + perm_spch[0]=FR3 + * BSS: audio support settings (1 items): + audio_support[0]=FR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_AMR + +Determining channel mode and rate: + * MS: speech codec list (1 items): + codec[0]->type=HR3 + * MSC: channel type permitted speech (1 items): + perm_spch[0]=HR3 + * BSS: audio support settings (1 items): + audio_support[0]=HR3 + * result: rc=0, full_rate=0, chan_mode=SPEECH_AMR + +Determining channel mode and rate: + * MS: speech codec list (2 items): + codec[0]->type=FR1 + codec[1]->type=HR1 + * MSC: channel type permitted speech (2 items): + perm_spch[0]=FR1 + perm_spch[1]=HR1 + * BSS: audio support settings (2 items): + audio_support[0]=FR1 + audio_support[1]=HR1 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (3 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=HR1 + * MSC: channel type permitted speech (3 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=HR1 + * BSS: audio support settings (3 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=HR1 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (3 items): + codec[0]->type=FR1 + codec[1]->type=FR3 + codec[2]->type=HR3 + * MSC: channel type permitted speech (3 items): + perm_spch[0]=FR1 + perm_spch[1]=FR3 + perm_spch[2]=HR3 + * BSS: audio support settings (3 items): + audio_support[0]=FR1 + audio_support[1]=FR3 + audio_support[2]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +============== test_ms ============== + +Determining channel mode and rate: + * MS: speech codec list (1 items): + codec[0]->type=FR1 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (1 items): + codec[0]->type=HR1 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=0, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (1 items): + codec[0]->type=FR2 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_EFR + +Determining channel mode and rate: + * MS: speech codec list (1 items): + codec[0]->type=FR3 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_AMR + +Determining channel mode and rate: + * MS: speech codec list (1 items): + codec[0]->type=HR3 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=0, chan_mode=SPEECH_AMR + +Determining channel mode and rate: + * MS: speech codec list (2 items): + codec[0]->type=FR1 + codec[1]->type=HR1 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (3 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=HR1 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (3 items): + codec[0]->type=FR1 + codec[1]->type=FR3 + codec[2]->type=HR3 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +============== test_ct ============== + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (1 items): + perm_spch[0]=FR1 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (1 items): + perm_spch[0]=HR1 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=0, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (1 items): + perm_spch[0]=FR2 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_EFR + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (1 items): + perm_spch[0]=FR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_AMR + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (1 items): + perm_spch[0]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=0, chan_mode=SPEECH_AMR + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (2 items): + perm_spch[0]=FR1 + perm_spch[1]=HR1 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (3 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=HR1 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (3 items): + perm_spch[0]=FR1 + perm_spch[1]=FR3 + perm_spch[2]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +============== test_msc ============== + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +============== test_selected_working ============== + +Determining channel mode and rate: + * MS: speech codec list (3 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=HR1 + * MSC: channel type permitted speech (2 items): + perm_spch[0]=FR1 + perm_spch[1]=HR1 + * BSS: audio support settings (3 items): + audio_support[0]=FR1 + audio_support[1]=FR3 + audio_support[2]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (1 items): + codec[0]->type=FR1 + * MSC: channel type permitted speech (2 items): + perm_spch[0]=FR1 + perm_spch[1]=HR1 + * BSS: audio support settings (3 items): + audio_support[0]=FR1 + audio_support[1]=FR3 + audio_support[2]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (1 items): + codec[0]->type=HR1 + * MSC: channel type permitted speech (2 items): + perm_spch[0]=FR1 + perm_spch[1]=HR1 + * BSS: audio support settings (3 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=HR1 + * result: rc=0, full_rate=0, chan_mode=SPEECH_V1 + +============== test_selected_non_working ============== + +Determining channel mode and rate: + * MS: speech codec list (1 items): + codec[0]->type=HR1 + * MSC: channel type permitted speech (2 items): + perm_spch[0]=FR1 + perm_spch[1]=HR1 + * BSS: audio support settings (3 items): + audio_support[0]=FR1 + audio_support[1]=FR3 + audio_support[2]=HR3 + * result: rc=-1, full_rate=-1, chan_mode=SIGNALLING + +Determining channel mode and rate: + * MS: speech codec list (1 items): + codec[0]->type=HR1 + * MSC: channel type permitted speech (2 items): + perm_spch[0]=FR1 + perm_spch[1]=HR1 + * BSS: audio support settings (3 items): + audio_support[0]=FR1 + audio_support[1]=FR3 + audio_support[2]=HR3 + * result: rc=-1, full_rate=-1, chan_mode=SIGNALLING + +Determining channel mode and rate: + * MS: speech codec list (1 items): + codec[0]->type=HR1 + * MSC: channel type permitted speech (1 items): + perm_spch[0]=HR3 + * BSS: audio support settings (3 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=HR1 + * result: rc=-1, full_rate=-1, chan_mode=SIGNALLING + +Testing execution completed. diff --git a/tests/testsuite.at b/tests/testsuite.at index 515ffa0..f384655 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -26,6 +26,12 @@ AT_CHECK([$abs_top_builddir/tests/bsc/bsc_test], [], [expout], [ignore]) AT_CLEANUP +AT_SETUP([codec_pref]) +AT_KEYWORDS([codec_pref]) +cat $abs_srcdir/codec_pref/codec_pref_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/codec_pref/codec_pref_test], [], [expout], [ignore]) +AT_CLEANUP + AT_SETUP([nanobts_omlattr]) AT_KEYWORDS([nanobts_omlattr]) cat $abs_srcdir/nanobts_omlattr/nanobts_omlattr_test.ok > expout -- To view, visit https://gerrit.osmocom.org/10010 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iabedfdcec8b99a319f2d57cbea45c5e36c7b6e29 Gerrit-Change-Number: 10010 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 15:54:53 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 16 Jul 2018 15:54:53 +0000 Subject: Change in osmo-bsc[master]: codec_pref: check bts codec support Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/10011 Change subject: codec_pref: check bts codec support ...................................................................... codec_pref: check bts codec support The vty option bts->codec-support allows the user to set the supported codecs per BTS level. However, those values are currently only used to make the handover decision but the logic that handles the BSSMAP ASSIGNMENT REQUEST does not check those flags. - Do not ignore bts->codec-support flags on BSSMAP ASSIGNMENT REQUEST Change-Id: I285234e9c81de74d9fb9907fca2c443b08537435 Closes: OS#3361 --- M include/osmocom/bsc/codec_pref.h M src/osmo-bsc/codec_pref.c M src/osmo-bsc/osmo_bsc_bssap.c M tests/codec_pref/codec_pref_test.c M tests/codec_pref/codec_pref_test.ok 5 files changed, 490 insertions(+), 21 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/11/10011/1 diff --git a/include/osmocom/bsc/codec_pref.h b/include/osmocom/bsc/codec_pref.h index 6933cea..bbda14e 100644 --- a/include/osmocom/bsc/codec_pref.h +++ b/include/osmocom/bsc/codec_pref.h @@ -1,6 +1,6 @@ #pragma once -int match_codec_pref(int *full_rate, enum gsm48_chan_mode *chan_mode, - const struct gsm0808_channel_type *ct, - const struct gsm0808_speech_codec_list *scl, - const struct bsc_msc_data *msc); +struct gsm_bts; + +int match_codec_pref(int *full_rate, enum gsm48_chan_mode *chan_mode, const struct gsm0808_channel_type *ct, + const struct gsm0808_speech_codec_list *scl, const struct bsc_msc_data *msc, struct gsm_bts *bts); diff --git a/src/osmo-bsc/codec_pref.c b/src/osmo-bsc/codec_pref.c index db4fee4..6a5604f 100644 --- a/src/osmo-bsc/codec_pref.c +++ b/src/osmo-bsc/codec_pref.c @@ -22,6 +22,7 @@ #include #include #include +#include /* Helper function for match_codec_pref(), looks up a matching chan mode for * a given permitted speech value */ @@ -129,6 +130,34 @@ return false; } +/* Helper function to check if the given permitted speech value is supported + * by the BTS. (vty option bts->codec-support). */ +static bool test_codec_support_bts(struct gsm_bts *bts, uint8_t perm_spch) +{ + switch (perm_spch) { + case GSM0808_PERM_FR1: + /* GSM-FR is always supported by all BTSs. There is also no way to + * selectively disable GSM-RF per BTS via VTY. */ + return true; + case GSM0808_PERM_FR2: + if (bts->codec.efr) + return true; + case GSM0808_PERM_FR3: + if (bts->codec.amr) + return true; + case GSM0808_PERM_HR1: + if (bts->codec.hr) + return true; + case GSM0808_PERM_HR3: + if (bts->codec.amr) + return true; + default: + return false; + } + + return false; +} + /*! Helper function for bssmap_handle_assignm_req(), matches the codec * preferences from the MSC with the codec preferences * \param[out] full_rate '1' if full-rate, '0' if half-rate, '-1' if no match @@ -136,17 +165,26 @@ * \param[in] ct GSM 08.08 channel type * \param[in] scl GSM 08.08 speech codec list * \param[in] msc MSC data [for configuration] + * \param[in] bts BTS data [for configuration] * \returns 0 on success, -1 in case no match was found */ -int match_codec_pref(int *full_rate, enum gsm48_chan_mode *chan_mode, - const struct gsm0808_channel_type *ct, - const struct gsm0808_speech_codec_list *scl, const struct bsc_msc_data *msc) +int match_codec_pref(int *full_rate, enum gsm48_chan_mode *chan_mode, const struct gsm0808_channel_type *ct, + const struct gsm0808_speech_codec_list *scl, const struct bsc_msc_data *msc, struct gsm_bts *bts) { unsigned int i; uint8_t perm_spch; bool match = false; for (i = 0; i < msc->audio_length; i++) { + /* Pick a permitted speech value from the global codec configuration list */ perm_spch = audio_support_to_gsm88(msc->audio_support[i]); + + /* Check this permitted speech value against the BTS specific parameters. + * if the BTS does not support the codec, try the next one */ + if (test_codec_support_bts(bts, perm_spch) == false) + continue; + + /* Match the permitted speech value against the codec lists that were + * advertised by the MS and the MSC */ if (test_codec_pref(ct, scl, perm_spch)) { match = true; break; diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 96cc2c5..887a866 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -680,7 +680,7 @@ /* Match codec information from the assignment command against the * local preferences of the BSC */ - rc = match_codec_pref(&full_rate, &chan_mode, &ct, scl_ptr, msc); + rc = match_codec_pref(&full_rate, &chan_mode, &ct, scl_ptr, msc, conn_get_bts(conn)); if (rc < 0) { LOGP(DMSC, LOGL_ERROR, "No supported audio type found for channel_type =" " { ch_indctr=0x%x, ch_rate_type=0x%x, perm_spch=[ %s] }\n", diff --git a/tests/codec_pref/codec_pref_test.c b/tests/codec_pref/codec_pref_test.c index 3c86081..66403bf 100644 --- a/tests/codec_pref/codec_pref_test.c +++ b/tests/codec_pref/codec_pref_test.c @@ -271,9 +271,62 @@ } } +/* Generate a realitically looking bts codec configuration */ +static void make_bts_config(struct gsm_bts *bts, uint8_t config_no) +{ + /* Note: FR is supported by all BTSs, so there is no flag for it */ + + OSMO_ASSERT(config_no < N_CONFIG_VARIANTS); + + bts->codec.hr = 0; + bts->codec.efr = 0; + bts->codec.amr = 0; + + switch (config_no) { + case 0: + /* FR1 (implicit) only */ + break; + case 1: + /* HR1 only (+FR implicit) */ + bts->codec.hr = 1; + break; + case 2: + /* FR2 only (+FR implicit) */ + bts->codec.efr = 1; + break; + case 3: + /* FR3 only (+FR implicit) */ + bts->codec.amr = 1; + break; + case 4: + /* HR3 only (+FR implicit) */ + bts->codec.amr = 1; + break; + case 5: + /* FR1 (implicit) and HR1 */ + bts->codec.hr = 1; + break; + case 6: + /* FR1 (implicit), FR2 and HR1 */ + bts->codec.efr = 1; + bts->codec.hr = 1; + break; + case 7: + /* FR1 (implicit), FR3 and HR3 */ + bts->codec.amr = 1; + break; + case 8: + /* FR1 (implicit), FR2, FR3, HR1 and HR3 */ + bts->codec.hr = 1; + bts->codec.efr = 1; + bts->codec.amr = 1; + break; + } +} + /* Try execute match_codec_pref(), display input and output parameters */ -static int test_match_codec_pref(const struct gsm0808_channel_type *ct, - const struct gsm0808_speech_codec_list *scl, const struct bsc_msc_data *msc) +static int test_match_codec_pref(const struct gsm0808_channel_type *ct, const struct gsm0808_speech_codec_list *scl, + const struct bsc_msc_data *msc, struct gsm_bts *bts) { int rc; unsigned int i; @@ -297,7 +350,13 @@ else printf(" audio_support[%u]=FR%u\n", i, msc->audio_support[i]->ver); - rc = match_codec_pref(&full_rate, &chan_mode, ct, scl, msc); + printf(" * BTS: audio support settings:\n"); + printf(" (GSM-FR implicitly supported)\n"); + printf(" codec->hr=%u\n", bts->codec.hr); + printf(" codec->efr=%u\n", bts->codec.efr); + printf(" codec->amr=%u\n", bts->codec.amr); + + rc = match_codec_pref(&full_rate, &chan_mode, ct, scl, msc, bts); printf(" * result: rc=%i, full_rate=%i, chan_mode=%s\n", rc, full_rate, gsm48_chan_mode_name(chan_mode)); printf("\n"); @@ -312,6 +371,7 @@ struct gsm0808_channel_type ct_msc; struct gsm0808_speech_codec_list scl_ms; struct bsc_msc_data msc_local; + struct gsm_bts bts_local; int rc; printf("============== test_one_to_one ==============\n\n"); @@ -322,7 +382,8 @@ make_msc_config(&msc_local, i); make_scl_config(&scl_ms, i); make_ct_config(&ct_msc, i); - rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + make_bts_config(&bts_local, i); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local, &bts_local); OSMO_ASSERT(rc == 0); } @@ -336,6 +397,7 @@ struct gsm0808_channel_type ct_msc; struct gsm0808_speech_codec_list scl_ms; struct bsc_msc_data msc_local; + struct gsm_bts bts_local; int rc; printf("============== test_ms ==============\n\n"); @@ -344,9 +406,10 @@ make_msc_config(&msc_local, 8); make_ct_config(&ct_msc, 8); + make_bts_config(&bts_local, 8); for (i = 0; i < N_CONFIG_VARIANTS; i++) { make_scl_config(&scl_ms, i); - rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local, &bts_local); OSMO_ASSERT(rc == 0); } @@ -360,6 +423,7 @@ struct gsm0808_channel_type ct_msc; struct gsm0808_speech_codec_list scl_ms; struct bsc_msc_data msc_local; + struct gsm_bts bts_local; int rc; printf("============== test_ct ==============\n\n"); @@ -368,9 +432,10 @@ make_msc_config(&msc_local, 8); make_scl_config(&scl_ms, 8); + make_bts_config(&bts_local, 8); for (i = 0; i < N_CONFIG_VARIANTS; i++) { make_ct_config(&ct_msc, i); - test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + test_match_codec_pref(&ct_msc, &scl_ms, &msc_local, &bts_local); OSMO_ASSERT(rc == 0); } @@ -384,6 +449,7 @@ struct gsm0808_channel_type ct_msc; struct gsm0808_speech_codec_list scl_ms; struct bsc_msc_data msc_local; + struct gsm_bts bts_local; int rc; printf("============== test_msc ==============\n\n"); @@ -392,9 +458,10 @@ make_ct_config(&ct_msc, 8); make_scl_config(&scl_ms, 8); + make_bts_config(&bts_local, 8); for (i = 0; i < N_CONFIG_VARIANTS; i++) { make_msc_config(&msc_local, 8); - rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local, &bts_local); OSMO_ASSERT(rc == 0); } @@ -407,6 +474,7 @@ struct gsm0808_channel_type ct_msc; struct gsm0808_speech_codec_list scl_ms; struct bsc_msc_data msc_local; + struct gsm_bts bts_local; int rc; printf("============== test_selected_working ==============\n\n"); @@ -416,19 +484,43 @@ make_scl_config(&scl_ms, 6); make_ct_config(&ct_msc, 5); make_msc_config(&msc_local, 7); - rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + make_bts_config(&bts_local, 8); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local, &bts_local); OSMO_ASSERT(rc == 0); make_scl_config(&scl_ms, 0); make_ct_config(&ct_msc, 5); make_msc_config(&msc_local, 7); - rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + make_bts_config(&bts_local, 8); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local, &bts_local); OSMO_ASSERT(rc == 0); make_scl_config(&scl_ms, 1); make_ct_config(&ct_msc, 5); make_msc_config(&msc_local, 6); - rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + make_bts_config(&bts_local, 8); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local, &bts_local); + OSMO_ASSERT(rc == 0); + + make_scl_config(&scl_ms, 6); + make_ct_config(&ct_msc, 5); + make_msc_config(&msc_local, 7); + make_bts_config(&bts_local, 4); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local, &bts_local); + OSMO_ASSERT(rc == 0); + + make_scl_config(&scl_ms, 0); + make_ct_config(&ct_msc, 5); + make_msc_config(&msc_local, 7); + make_bts_config(&bts_local, 2); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local, &bts_local); + OSMO_ASSERT(rc == 0); + + make_scl_config(&scl_ms, 1); + make_ct_config(&ct_msc, 5); + make_msc_config(&msc_local, 6); + make_bts_config(&bts_local, 1); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local, &bts_local); OSMO_ASSERT(rc == 0); free_msc_config(&msc_local); @@ -440,6 +532,7 @@ struct gsm0808_channel_type ct_msc; struct gsm0808_speech_codec_list scl_ms; struct bsc_msc_data msc_local; + struct gsm_bts bts_local; int rc; printf("============== test_selected_non_working ==============\n\n"); @@ -449,19 +542,43 @@ make_scl_config(&scl_ms, 1); make_ct_config(&ct_msc, 5); make_msc_config(&msc_local, 7); - rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + make_bts_config(&bts_local, 8); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local, &bts_local); OSMO_ASSERT(rc == -1); make_scl_config(&scl_ms, 1); make_ct_config(&ct_msc, 5); make_msc_config(&msc_local, 7); - rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + make_bts_config(&bts_local, 8); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local, &bts_local); OSMO_ASSERT(rc == -1); make_scl_config(&scl_ms, 1); make_ct_config(&ct_msc, 4); make_msc_config(&msc_local, 6); - rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + make_bts_config(&bts_local, 8); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local, &bts_local); + OSMO_ASSERT(rc == -1); + + make_scl_config(&scl_ms, 1); + make_ct_config(&ct_msc, 2); + make_msc_config(&msc_local, 7); + make_bts_config(&bts_local, 8); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local, &bts_local); + OSMO_ASSERT(rc == -1); + + make_scl_config(&scl_ms, 1); + make_ct_config(&ct_msc, 5); + make_msc_config(&msc_local, 4); + make_bts_config(&bts_local, 8); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local, &bts_local); + OSMO_ASSERT(rc == -1); + + make_scl_config(&scl_ms, 8); + make_ct_config(&ct_msc, 4); + make_msc_config(&msc_local, 6); + make_bts_config(&bts_local, 7); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local, &bts_local); OSMO_ASSERT(rc == -1); free_msc_config(&msc_local); diff --git a/tests/codec_pref/codec_pref_test.ok b/tests/codec_pref/codec_pref_test.ok index f97fbb1..d3cd028 100644 --- a/tests/codec_pref/codec_pref_test.ok +++ b/tests/codec_pref/codec_pref_test.ok @@ -7,6 +7,11 @@ perm_spch[0]=FR1 * BSS: audio support settings (1 items): audio_support[0]=FR1 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=0 + codec->efr=0 + codec->amr=0 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -16,6 +21,11 @@ perm_spch[0]=HR1 * BSS: audio support settings (1 items): audio_support[0]=HR1 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=0 + codec->amr=0 * result: rc=0, full_rate=0, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -25,6 +35,11 @@ perm_spch[0]=FR2 * BSS: audio support settings (1 items): audio_support[0]=FR2 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=0 + codec->efr=1 + codec->amr=0 * result: rc=0, full_rate=1, chan_mode=SPEECH_EFR Determining channel mode and rate: @@ -34,6 +49,11 @@ perm_spch[0]=FR3 * BSS: audio support settings (1 items): audio_support[0]=FR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=0 + codec->efr=0 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_AMR Determining channel mode and rate: @@ -43,6 +63,11 @@ perm_spch[0]=HR3 * BSS: audio support settings (1 items): audio_support[0]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=0 + codec->efr=0 + codec->amr=1 * result: rc=0, full_rate=0, chan_mode=SPEECH_AMR Determining channel mode and rate: @@ -55,6 +80,11 @@ * BSS: audio support settings (2 items): audio_support[0]=FR1 audio_support[1]=HR1 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=0 + codec->amr=0 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -70,6 +100,11 @@ audio_support[0]=FR1 audio_support[1]=FR2 audio_support[2]=HR1 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=0 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -85,6 +120,11 @@ audio_support[0]=FR1 audio_support[1]=FR3 audio_support[2]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=0 + codec->efr=0 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -106,6 +146,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 ============== test_ms ============== @@ -125,6 +170,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -142,6 +192,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=0, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -159,6 +214,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_EFR Determining channel mode and rate: @@ -176,6 +236,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_AMR Determining channel mode and rate: @@ -193,6 +258,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=0, chan_mode=SPEECH_AMR Determining channel mode and rate: @@ -211,6 +281,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -230,6 +305,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -249,6 +329,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -270,6 +355,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 ============== test_ct ============== @@ -289,6 +379,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -306,6 +401,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=0, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -323,6 +423,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_EFR Determining channel mode and rate: @@ -340,6 +445,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_AMR Determining channel mode and rate: @@ -357,6 +467,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=0, chan_mode=SPEECH_AMR Determining channel mode and rate: @@ -375,6 +490,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -394,6 +514,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -413,6 +538,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -434,6 +564,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 ============== test_msc ============== @@ -457,6 +592,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -478,6 +618,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -499,6 +644,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -520,6 +670,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -541,6 +696,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -562,6 +722,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -583,6 +748,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -604,6 +774,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -625,6 +800,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 ============== test_selected_working ============== @@ -641,6 +821,11 @@ audio_support[0]=FR1 audio_support[1]=FR3 audio_support[2]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -653,6 +838,11 @@ audio_support[0]=FR1 audio_support[1]=FR3 audio_support[2]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -665,6 +855,64 @@ audio_support[0]=FR1 audio_support[1]=FR2 audio_support[2]=HR1 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 + * result: rc=0, full_rate=0, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (3 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=HR1 + * MSC: channel type permitted speech (2 items): + perm_spch[0]=FR1 + perm_spch[1]=HR1 + * BSS: audio support settings (3 items): + audio_support[0]=FR1 + audio_support[1]=FR3 + audio_support[2]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=0 + codec->efr=0 + codec->amr=1 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (1 items): + codec[0]->type=FR1 + * MSC: channel type permitted speech (2 items): + perm_spch[0]=FR1 + perm_spch[1]=HR1 + * BSS: audio support settings (3 items): + audio_support[0]=FR1 + audio_support[1]=FR3 + audio_support[2]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=0 + codec->efr=1 + codec->amr=0 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (1 items): + codec[0]->type=HR1 + * MSC: channel type permitted speech (2 items): + perm_spch[0]=FR1 + perm_spch[1]=HR1 + * BSS: audio support settings (3 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=HR1 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=0 + codec->amr=0 * result: rc=0, full_rate=0, chan_mode=SPEECH_V1 ============== test_selected_non_working ============== @@ -679,6 +927,11 @@ audio_support[0]=FR1 audio_support[1]=FR3 audio_support[2]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=-1, full_rate=-1, chan_mode=SIGNALLING Determining channel mode and rate: @@ -691,6 +944,11 @@ audio_support[0]=FR1 audio_support[1]=FR3 audio_support[2]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=-1, full_rate=-1, chan_mode=SIGNALLING Determining channel mode and rate: @@ -702,6 +960,62 @@ audio_support[0]=FR1 audio_support[1]=FR2 audio_support[2]=HR1 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 + * result: rc=-1, full_rate=-1, chan_mode=SIGNALLING + +Determining channel mode and rate: + * MS: speech codec list (1 items): + codec[0]->type=HR1 + * MSC: channel type permitted speech (1 items): + perm_spch[0]=FR2 + * BSS: audio support settings (3 items): + audio_support[0]=FR1 + audio_support[1]=FR3 + audio_support[2]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 + * result: rc=-1, full_rate=-1, chan_mode=SIGNALLING + +Determining channel mode and rate: + * MS: speech codec list (1 items): + codec[0]->type=HR1 + * MSC: channel type permitted speech (2 items): + perm_spch[0]=FR1 + perm_spch[1]=HR1 + * BSS: audio support settings (1 items): + audio_support[0]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 + * result: rc=-1, full_rate=-1, chan_mode=SIGNALLING + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (1 items): + perm_spch[0]=HR3 + * BSS: audio support settings (3 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=HR1 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=0 + codec->efr=0 + codec->amr=1 * result: rc=-1, full_rate=-1, chan_mode=SIGNALLING Testing execution completed. -- To view, visit https://gerrit.osmocom.org/10011 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I285234e9c81de74d9fb9907fca2c443b08537435 Gerrit-Change-Number: 10011 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 15:56:49 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 16 Jul 2018 15:56:49 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: Add test to verify restart_ctr during echo req/reply. In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9950 ) Change subject: sgsn: Add test to verify restart_ctr during echo req/reply. ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/9950 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1dcb250dba2079c14b857c0b89a02ac21d1c591f Gerrit-Change-Number: 9950 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Mon, 16 Jul 2018 15:56:49 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 16:02:44 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 16 Jul 2018 16:02:44 +0000 Subject: Change in osmo-bsc[master]: codec_pref: move match_codec_pref() to separate c-file and add unit-test In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10010 to look at the new patch set (#2). Change subject: codec_pref: move match_codec_pref() to separate c-file and add unit-test ...................................................................... codec_pref: move match_codec_pref() to separate c-file and add unit-test At the moment there are three sources that may advertise a list of supported audio codec/rate settings. There is the MS that advertises advertises a speech codec list and the MSC that sends a channel type information element over A and there are also settings in the bsc configuration file that may restrict the codec/rate types that are allowed to use. The function match_codec_pref() looks at all of the three buckets and selects a codec that satisfies all three. This is already a somewhat complicated process, overit is very isolated, so lets give it its own c-file. Due to the lack of unit-tests it is very hard to make changes here so lets add also unit-test to make sure that regressions are catched early. - Put match_codec_pref() and all its helper functions into a separate c-file. - Add a unit test. Change-Id: Iabedfdcec8b99a319f2d57cbea45c5e36c7b6e29 Related: OS#3361 --- M configure.ac M include/osmocom/bsc/Makefile.am A include/osmocom/bsc/codec_pref.h M src/osmo-bsc/Makefile.am A src/osmo-bsc/codec_pref.c M src/osmo-bsc/osmo_bsc_bssap.c M tests/Makefile.am A tests/codec_pref/Makefile.am A tests/codec_pref/codec_pref_test.c A tests/codec_pref/codec_pref_test.ok M tests/testsuite.at 11 files changed, 1,430 insertions(+), 160 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/10/10010/2 -- To view, visit https://gerrit.osmocom.org/10010 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iabedfdcec8b99a319f2d57cbea45c5e36c7b6e29 Gerrit-Change-Number: 10010 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 17:35:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 17:35:53 +0000 Subject: Change in osmo-sgsn[master]: Forward GGSN originated DEACT PDP CTX REQ In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10002 ) Change subject: Forward GGSN originated DEACT PDP CTX REQ ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10002 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I204209c017aac8a8402cbb8d0a0200540abcc954 Gerrit-Change-Number: 10002 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Mon, 16 Jul 2018 17:35:53 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 17:36:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 17:36:27 +0000 Subject: Change in osmo-sgsn[master]: sgsn: Fix T3395 firing forever In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10003 ) Change subject: sgsn: Fix T3395 firing forever ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10003 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iacce3c66f61578ebee37abaa287f7e183f985c1c Gerrit-Change-Number: 10003 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-CC: lynxis lazus Gerrit-Comment-Date: Mon, 16 Jul 2018 17:36:27 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 17:40:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 17:40:57 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_ConnectionHandler: more verbosity for f_check_mgcp_expectations() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10004 ) Change subject: MSC_ConnectionHandler: more verbosity for f_check_mgcp_expectations() ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/10004/1/bsc/MSC_ConnectionHandler.ttcn File bsc/MSC_ConnectionHandler.ttcn: https://gerrit.osmocom.org/#/c/10004/1/bsc/MSC_ConnectionHandler.ttcn at 797 PS1, Line 797: function f_check_mgcp_expectations(charstring caller) runs on MSC_ConnHdlr { rather than explicitly passing a hand-written string as function argument, you could possibly use "testcasename()" which always expands to the name of the currently running testcase. However, this may not be what you actually want here, in case the function is called via different paths during the same test case. -- To view, visit https://gerrit.osmocom.org/10004 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ida0eba4ef3c1db977d392267ef76ec37b87133b3 Gerrit-Change-Number: 10004 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Harald Welte Gerrit-Comment-Date: Mon, 16 Jul 2018 17:40:57 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 17:41:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 17:41:52 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_ConnectionHandler: expect additional MDCX when call is LCLS In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10005 ) Change subject: MSC_ConnectionHandler: expect additional MDCX when call is LCLS ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10005 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I55fae5ab03980cd810ed7dc38208550686b1659e Gerrit-Change-Number: 10005 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 16 Jul 2018 17:41:52 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 17:41:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 17:41:57 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_ConnectionHandler: more verbosity for f_check_mgcp_expectations() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10004 ) Change subject: MSC_ConnectionHandler: more verbosity for f_check_mgcp_expectations() ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/10004 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ida0eba4ef3c1db977d392267ef76ec37b87133b3 Gerrit-Change-Number: 10004 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 16 Jul 2018 17:41:57 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 17:42:45 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 17:42:45 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: f_pdp_ctx_deact_mt: force teardown to avoid sgsn ignoring msg In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9990 ) Change subject: sgsn: f_pdp_ctx_deact_mt: force teardown to avoid sgsn ignoring msg ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9990 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id5d4774d719685631e4b467dff833ae886c90145 Gerrit-Change-Number: 9990 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 16 Jul 2018 17:42:45 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 17:43:50 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 17:43:50 +0000 Subject: Change in osmo-ttcn3-hacks[master]: lib: L3_Templates: Fix DEACT PDP REQ msg type and make tearDownInd op... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9991 ) Change subject: lib: L3_Templates: Fix DEACT PDP REQ msg type and make tearDownInd optional ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9991 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I006d64f51c17a22a42a225ddfa4119933e48a022 Gerrit-Change-Number: 9991 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 16 Jul 2018 17:43:50 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 17:44:56 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 17:44:56 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: Add test to verify restart_ctr during echo req/reply. In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9950 ) Change subject: sgsn: Add test to verify restart_ctr during echo req/reply. ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9950 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1dcb250dba2079c14b857c0b89a02ac21d1c591f Gerrit-Change-Number: 9950 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Mon, 16 Jul 2018 17:44:56 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 17:45:10 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 17:45:10 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: Fix TC_attach_pdp_act_user_deact_mt In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10007 ) Change subject: sgsn: Fix TC_attach_pdp_act_user_deact_mt ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10007 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I37dafb5e93ac06b3bd9cab2c06aa3735a8429f2f Gerrit-Change-Number: 10007 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 16 Jul 2018 17:45:10 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 17:46:12 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 17:46:12 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: Add Test to verify timer t3395 In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10009 ) Change subject: sgsn: Add Test to verify timer t3395 ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10009 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9ec0863603692045b0d8da376e65080150066173 Gerrit-Change-Number: 10009 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 16 Jul 2018 17:46:12 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 17:46:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 17:46:18 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: f_pdp_ctx_deact_mt: force teardown to avoid sgsn ignoring msg In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9990 ) Change subject: sgsn: f_pdp_ctx_deact_mt: force teardown to avoid sgsn ignoring msg ...................................................................... sgsn: f_pdp_ctx_deact_mt: force teardown to avoid sgsn ignoring msg According to """ If a GSN receives a Delete PDP context without a Teardown In dicator or with a Teardown Indicator with value set to "0" and only that PDP context is active for a PDN connection, then the GSN shall ignore the message. """ Change-Id: Id5d4774d719685631e4b467dff833ae886c90145 --- M sgsn/SGSN_Tests.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 017c724..cfe2d3f 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -948,7 +948,7 @@ var GtpPeer peer := valueof(ts_GtpPeerC(apars.sgsn_ip_c)); BSSGP.clear; - GTP.send(ts_GTPC_DeletePDP(peer, seq_nr, apars.sgsn_tei_c, apars.nsapi, omit)); + GTP.send(ts_GTPC_DeletePDP(peer, seq_nr, apars.sgsn_tei_c, apars.nsapi, '1'B)); interleave { [] BSSGP.receive(tr_BD_L3_MT(tr_SM_DEACT_PDP_REQ_MT(apars.tid, ?))) { -- To view, visit https://gerrit.osmocom.org/9990 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Id5d4774d719685631e4b467dff833ae886c90145 Gerrit-Change-Number: 9990 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 17:46:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 17:46:18 +0000 Subject: Change in osmo-ttcn3-hacks[master]: lib: L3_Templates: Fix DEACT PDP REQ msg type and make tearDownInd op... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9991 ) Change subject: lib: L3_Templates: Fix DEACT PDP REQ msg type and make tearDownInd optional ...................................................................... lib: L3_Templates: Fix DEACT PDP REQ msg type and make tearDownInd optional Specs state in 3GPP TS 24.008 that TearDownInd IE is optional, so allow possibility to omit it. Also fix protocolConfigOpts being passed as parameter but not being used in template tr_SM_DEACT_PDP_REQ_MT. Change-Id: I006d64f51c17a22a42a225ddfa4119933e48a022 --- M library/L3_Templates.ttcn 1 file changed, 33 insertions(+), 34 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index 9d6d3c3..44d9e73 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -2254,6 +2254,22 @@ } } +function ts_TearDownIndicatorTV(in template (omit) boolean ind) + return template (omit) TearDownIndicatorTV { + if (istemplatekind(ind, "omit")) { + return omit; + } else { + var template (omit) TearDownIndicatorTV ret := { + tearDownIndicatorV := { + tdi_flag := bool2bit(valueof(ind)), + spare := '000'B + }, + elementIdentifier := '1001'B + } + return ret; + } +} + template (value) PDU_L3_MS_SGSN ts_SM_ACT_PDP_REQ(BIT3 tid, BIT4 nsapi, BIT4 sapi, QoSV qos, PDPAddressV addr, template (omit) octetstring apn := omit, @@ -2348,10 +2364,11 @@ } } -template (value) PDU_L3_MS_SGSN ts_SM_DEACT_PDP_REQ_MO(BIT3 tid, OCT1 cause, boolean tdown := false, +template (value) PDU_L3_MS_SGSN ts_SM_DEACT_PDP_REQ_MO(BIT3 tid, OCT1 cause, + template (omit) boolean tdown := omit, template (omit) ProtocolConfigOptionsV pco := omit ) := { - discriminator := '0000'B, /* overwritten */ + discriminator := '1010'B, tiOrSkip := { transactionId := { tio := tid, @@ -2362,15 +2379,9 @@ msgs := { gprs_sm := { deactivatePDPContextRequest := { - messageType := '00000000'B, /* overwritten */ + messageType := '01000110'B, smCause := cause, - tearDownIndicator := { - tearDownIndicatorV := { - tdi_flag := bool2bit(tdown), - spare := '000'B - }, - elementIdentifier := '1001'B - }, + tearDownIndicator := ts_TearDownIndicatorTV(tdown), protocolConfigOpts := ts_PcoTLV(pco), mBMSprotocolConfigOptions := omit, t3396 := omit, @@ -2381,10 +2392,11 @@ } } -template (value) PDU_L3_SGSN_MS ts_SM_DEACT_PDP_REQ_MT(BIT3 tid, OCT1 cause, boolean tdown := false, +template (value) PDU_L3_SGSN_MS ts_SM_DEACT_PDP_REQ_MT(BIT3 tid, OCT1 cause, + template (omit) boolean tdown := omit, template (omit) ProtocolConfigOptionsV pco := omit ) := { - discriminator := '0000'B, /* overwritten */ + discriminator := '1010'B, tiOrSkip := { transactionId := { tio := tid, @@ -2395,15 +2407,9 @@ msgs := { gprs_sm := { deactivatePDPContextRequest := { - messageType := '00000000'B, /* overwritten */ + messageType := '01000110'B, smCause := cause, - tearDownIndicator := { - tearDownIndicatorV := { - tdi_flag := bool2bit(tdown), - spare := '000'B - }, - elementIdentifier := '1001'B - }, + tearDownIndicator := ts_TearDownIndicatorTV(tdown), protocolConfigOpts := ts_PcoTLV(pco), mBMSprotocolConfigOptions := omit, t3396 := omit, @@ -2415,10 +2421,10 @@ } template PDU_L3_SGSN_MS tr_SM_DEACT_PDP_REQ_MT(template BIT3 tid, template OCT1 cause, - template boolean tdown := false, - template (omit) ProtocolConfigOptionsV pco := omit - ) := { - discriminator := '0000'B, /* overwritten */ + template (omit) boolean tdown := omit, + template (omit) ProtocolConfigOptionsV pco := omit + ) := { + discriminator := '1010'B, tiOrSkip := { transactionId := { tio := tid, @@ -2429,16 +2435,10 @@ msgs := { gprs_sm := { deactivatePDPContextRequest := { - messageType := '00000000'B, /* overwritten */ + messageType := '01000110'B, smCause := cause, - tearDownIndicator := { - tearDownIndicatorV := { - tdi_flag := bool2bit_tmpl(tdown), - spare := '000'B - }, - elementIdentifier := '1001'B - }, - protocolConfigOpts := *, + tearDownIndicator := ts_TearDownIndicatorTV(tdown), + protocolConfigOpts := ts_PcoTLV(pco), mBMSprotocolConfigOptions := *, t3396 := *, wLANOffloadIndication := *, @@ -2448,7 +2448,6 @@ } } - template PDU_L3_SGSN_MS tr_SM_DEACT_PDP_ACCEPT_MT(template BIT3 tid := ?) := { discriminator := '1010'B, -- To view, visit https://gerrit.osmocom.org/9991 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I006d64f51c17a22a42a225ddfa4119933e48a022 Gerrit-Change-Number: 9991 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 17:46:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 17:46:18 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: Add test to verify restart_ctr during echo req/reply. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9950 ) Change subject: sgsn: Add test to verify restart_ctr during echo req/reply. ...................................................................... sgsn: Add test to verify restart_ctr during echo req/reply. Currently test doesn't fully work because it doesn't match the PDP CTX DEL REQ correctly. Change-Id: I1dcb250dba2079c14b857c0b89a02ac21d1c591f --- M sgsn/SGSN_Tests.ttcn M sgsn/expected-results.xml 2 files changed, 55 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index cfe2d3f..e76ed09 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -64,6 +64,7 @@ port TELNETasp_PT SGSNVTY; var boolean g_initialized := false; + var boolean g_use_echo := false; }; type component BSSGP_ConnHdlr extends BSSGP_Client_CT, GSUP_ConnHdlr, GTP_ConnHdlr { @@ -160,6 +161,14 @@ f_vty_config(SGSNVTY, "sgsn", "auth-policy remote"); } +private function f_vty_enable_echo_interval(boolean enable) runs on test_CT { + if (enable) { + f_vty_config(SGSNVTY, "sgsn", "ggsn 0 echo-interval 5"); + } else { + f_vty_config(SGSNVTY, "sgsn", "ggsn 0 no echo-interval"); + } +} + function f_init(BcdMccMnc mcc_mnc := '26242F'H) runs on test_CT { if (g_initialized == true) { @@ -184,6 +193,7 @@ f_init_gsup("SGSN_Test"); f_init_gtp("SGSN_Test"); f_init_vty(); + f_vty_enable_echo_interval(g_use_echo); } type function void_fn(charstring id) runs on BSSGP_ConnHdlr; @@ -874,6 +884,7 @@ OCT4 ggsn_tei_u, /* GGSN TEI User */ octetstring ggsn_ip_c, /* GGSN IP Control */ octetstring ggsn_ip_u, /* GGSN IP User */ + OCT1 ggsn_restart_ctr, /* GGSN Restart Counter */ OCT4 sgsn_tei_c optional, /* SGSN TEI Control */ OCT4 sgsn_tei_u optional, /* SGSN TEI User */ @@ -1025,6 +1036,7 @@ ggsn_tei_u := f_rnd_octstring(4), ggsn_ip_c := f_inet_addr(ggsn_ip), ggsn_ip_u := f_inet_addr(ggsn_ip), + ggsn_restart_ctr := int2oct(2, 1), sgsn_tei_c := omit, sgsn_tei_u := omit, @@ -1251,6 +1263,46 @@ vc_conn.done; } +private function f_TC_attach_restart_ctr_dettach(charstring id) runs on BSSGP_ConnHdlr { + var Gtp1cUnitdata g_ud; + var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip)); + + /* first perform regular attach */ + f_TC_attach(id); + /* Activate a pdp context against the GGSN */ + f_pdp_ctx_act(apars); + /* Wait to receive first echo request and send initial Restart counter */ + GTP.receive(tr_GTPC_MsgType(?, echoRequest, ?)) -> value g_ud { + var integer seq_nr := oct2int(g_ud.gtpc.opt_part.sequenceNumber); + GTP.send(ts_GTPC_PONG(g_ud.peer, seq_nr, apars.ggsn_restart_ctr)); + } + /* Wait to receive second echo request and send incremented Restart + counter. This will fake a restarted GGSN, and pdp ctx allocated + should be released by SGSN */ + apars.ggsn_restart_ctr := int2oct(oct2int(apars.ggsn_restart_ctr) + 1, 1); + GTP.receive(tr_GTPC_MsgType(?, echoRequest, ?)) -> value g_ud { + var integer seq_nr := oct2int(g_ud.gtpc.opt_part.sequenceNumber); + GTP.send(ts_GTPC_PONG(g_ud.peer, seq_nr, apars.ggsn_restart_ctr)); + } + var OCT1 cause_network_failure := int2oct(38, 1) + alt { + [] BSSGP.receive(tr_BD_L3_MT(tr_SM_DEACT_PDP_REQ_MT(apars.tid, cause_network_failure, true))) { + BSSGP.send(ts_SM_DEACT_PDP_ACCEPT_MO(apars.tid)); + setverdict(pass); + } + [] as_xid(apars); + } + setverdict(pass); +} +testcase TC_attach_restart_ctr_dettach() runs on test_CT { + var BSSGP_ConnHdlr vc_conn; + g_use_echo := true + f_init(); + vc_conn := f_start_handler(refers(f_TC_attach_restart_ctr_dettach), testcasename(), g_gb[0], 23, 30.0); + vc_conn.done; + g_use_echo := false +} + private function f_TC_hlr_location_cancel_request_update(charstring id) runs on BSSGP_ConnHdlr { /* MS: perform regular attach */ f_TC_attach(id); @@ -1625,6 +1677,7 @@ execute( TC_attach_pdp_act_user_deact_mo() ); execute( TC_attach_pdp_act_user_deact_mt() ); execute( TC_attach_second_attempt() ); + execute( TC_attach_restart_ctr_dettach() ); } diff --git a/sgsn/expected-results.xml b/sgsn/expected-results.xml index 1949199..f2f2500 100644 --- a/sgsn/expected-results.xml +++ b/sgsn/expected-results.xml @@ -1,5 +1,5 @@ - + @@ -65,4 +65,5 @@ + -- To view, visit https://gerrit.osmocom.org/9950 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I1dcb250dba2079c14b857c0b89a02ac21d1c591f Gerrit-Change-Number: 9950 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 17:46:19 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 17:46:19 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: Fix TC_attach_pdp_act_user_deact_mt In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10007 ) Change subject: sgsn: Fix TC_attach_pdp_act_user_deact_mt ...................................................................... sgsn: Fix TC_attach_pdp_act_user_deact_mt Expect to receive a TearDown Indicator. Change-Id: I37dafb5e93ac06b3bd9cab2c06aa3735a8429f2f --- M sgsn/SGSN_Tests.ttcn M sgsn/expected-results.xml 2 files changed, 3 insertions(+), 8 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index e76ed09..214239e 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -962,7 +962,7 @@ GTP.send(ts_GTPC_DeletePDP(peer, seq_nr, apars.sgsn_tei_c, apars.nsapi, '1'B)); interleave { - [] BSSGP.receive(tr_BD_L3_MT(tr_SM_DEACT_PDP_REQ_MT(apars.tid, ?))) { + [] BSSGP.receive(tr_BD_L3_MT(tr_SM_DEACT_PDP_REQ_MT(apars.tid, ?, true))) { BSSGP.send(ts_SM_DEACT_PDP_ACCEPT_MO(apars.tid)); } [] GTP.receive(tr_GTPC_MsgType(?, deletePDPContextResponse, apars.ggsn_tei_c)) { } diff --git a/sgsn/expected-results.xml b/sgsn/expected-results.xml index f2f2500..2d7063b 100644 --- a/sgsn/expected-results.xml +++ b/sgsn/expected-results.xml @@ -1,5 +1,5 @@ - + @@ -56,12 +56,7 @@ - - Tguard timeout - SGSN_Tests.ttcn:MASKED SGSN_Tests control part - SGSN_Tests.ttcn:MASKED TC_attach_pdp_act_user_deact_mt testcase - - + -- To view, visit https://gerrit.osmocom.org/10007 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I37dafb5e93ac06b3bd9cab2c06aa3735a8429f2f Gerrit-Change-Number: 10007 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 17:46:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 17:46:44 +0000 Subject: Change in osmo-ggsn[master]: gtp: Log type name of unexpected signalling message In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9987 ) Change subject: gtp: Log type name of unexpected signalling message ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9987 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iae0f045e4128cf97aa7824d7d774b59bf966cbe8 Gerrit-Change-Number: 9987 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 16 Jul 2018 17:46:44 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 17:47:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 17:47:14 +0000 Subject: Change in osmo-ggsn[master]: gtp: Allow recv DEL CTX REQ in sgsn and DEL CTX RSP in ggsn In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9988 ) Change subject: gtp: Allow recv DEL CTX REQ in sgsn and DEL CTX RSP in ggsn ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9988 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6927c07be4ddf74defe338d01d947056e15cd14d Gerrit-Change-Number: 9988 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 16 Jul 2018 17:47:14 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 17:47:25 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 17:47:25 +0000 Subject: Change in osmo-ggsn[master]: gtp: Log ignore CTX DEL REQ due to no teardown and only 1 ctx active In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9989 ) Change subject: gtp: Log ignore CTX DEL REQ due to no teardown and only 1 ctx active ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9989 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic950c04d309d5686bfbeab332f79c48678e743ae Gerrit-Change-Number: 9989 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 16 Jul 2018 17:47:25 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 17:48:10 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 17:48:10 +0000 Subject: Change in osmo-ggsn[master]: gtp: Log type name of unexpected signalling message In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9987 ) Change subject: gtp: Log type name of unexpected signalling message ...................................................................... gtp: Log type name of unexpected signalling message Change-Id: Iae0f045e4128cf97aa7824d7d774b59bf966cbe8 --- M gtp/gtp.c 1 file changed, 8 insertions(+), 4 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/gtp/gtp.c b/gtp/gtp.c index 42e84a7..ac3ec99 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -2835,7 +2835,8 @@ gsn->unexpect++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, - "Unexpected GTPv0 Signalling Message\n"); + "Unexpected GTPv0 Signalling Message '%s'\n", + get_value_string(gtp_type_names, pheader->type)); continue; /* Silently discard 29.60: 11.1.4 */ } @@ -2846,7 +2847,8 @@ gsn->unexpect++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, - "Unexpected GTPv0 Signalling Message\n"); + "Unexpected GTPv0 Signalling Message '%s'\n", + get_value_string(gtp_type_names, pheader->type)); continue; /* Silently discard 29.60: 11.1.4 */ } @@ -3012,7 +3014,8 @@ gsn->unexpect++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, - "Unexpected GTPv1 Signalling Message\n"); + "Unexpected GTPv1 Signalling Message '%s'\n", + get_value_string(gtp_type_names, pheader->type)); continue; /* Silently discard 29.60: 11.1.4 */ } @@ -3023,7 +3026,8 @@ gsn->unexpect++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, - "Unexpected GTPv1 Signalling Message\n"); + "Unexpected GTPv1 Signalling Message '%s'\n", + get_value_string(gtp_type_names, pheader->type)); continue; /* Silently discard 29.60: 11.1.4 */ } -- To view, visit https://gerrit.osmocom.org/9987 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iae0f045e4128cf97aa7824d7d774b59bf966cbe8 Gerrit-Change-Number: 9987 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 17:48:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 17:48:11 +0000 Subject: Change in osmo-ggsn[master]: gtp: Allow recv DEL CTX REQ in sgsn and DEL CTX RSP in ggsn In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9988 ) Change subject: gtp: Allow recv DEL CTX REQ in sgsn and DEL CTX RSP in ggsn ...................................................................... gtp: Allow recv DEL CTX REQ in sgsn and DEL CTX RSP in ggsn According to 3GPP TS 29.060 section "7.3.5 Delete PDP Context Request", both directions are valid in both GSNs. This allows osmo-sgsn receive delete ctx indication (cb_delete_context) in order to implement GGSN initiated requests. Change-Id: I6927c07be4ddf74defe338d01d947056e15cd14d --- M gtp/gtp.c 1 file changed, 4 insertions(+), 8 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/gtp/gtp.c b/gtp/gtp.c index ac3ec99..5b83d20 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -2830,8 +2830,7 @@ if ((gsn->mode == GTP_MODE_GGSN) && ((pheader->type == GTP_CREATE_PDP_RSP) || - (pheader->type == GTP_UPDATE_PDP_RSP) || - (pheader->type == GTP_DELETE_PDP_RSP))) { + (pheader->type == GTP_UPDATE_PDP_RSP))) { gsn->unexpect++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, @@ -2842,8 +2841,7 @@ if ((gsn->mode == GTP_MODE_SGSN) && ((pheader->type == GTP_CREATE_PDP_REQ) || - (pheader->type == GTP_UPDATE_PDP_REQ) || - (pheader->type == GTP_DELETE_PDP_REQ))) { + (pheader->type == GTP_UPDATE_PDP_REQ))) { gsn->unexpect++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, @@ -3009,8 +3007,7 @@ if ((gsn->mode == GTP_MODE_GGSN) && ((pheader->type == GTP_CREATE_PDP_RSP) || - (pheader->type == GTP_UPDATE_PDP_RSP) || - (pheader->type == GTP_DELETE_PDP_RSP))) { + (pheader->type == GTP_UPDATE_PDP_RSP))) { gsn->unexpect++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, @@ -3021,8 +3018,7 @@ if ((gsn->mode == GTP_MODE_SGSN) && ((pheader->type == GTP_CREATE_PDP_REQ) || - (pheader->type == GTP_UPDATE_PDP_REQ) || - (pheader->type == GTP_DELETE_PDP_REQ))) { + (pheader->type == GTP_UPDATE_PDP_REQ))) { gsn->unexpect++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, -- To view, visit https://gerrit.osmocom.org/9988 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I6927c07be4ddf74defe338d01d947056e15cd14d Gerrit-Change-Number: 9988 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 17:48:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 17:48:11 +0000 Subject: Change in osmo-ggsn[master]: gtp: Log ignore CTX DEL REQ due to no teardown and only 1 ctx active In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9989 ) Change subject: gtp: Log ignore CTX DEL REQ due to no teardown and only 1 ctx active ...................................................................... gtp: Log ignore CTX DEL REQ due to no teardown and only 1 ctx active Change-Id: Ic950c04d309d5686bfbeab332f79c48678e743ae --- M gtp/gtp.c 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/gtp/gtp.c b/gtp/gtp.c index 5b83d20..1309cb5 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -2553,6 +2553,9 @@ if (linked_pdp->secondary_tei[n]) count++; if (count <= 1) { + GTP_LOGPKG(LOGL_NOTICE, peer, pack, len, + "Ignoring CTX DEL without teardown and count=%d\n", + count); return 0; /* 29.060 7.3.5 Ignore message */ } } -- To view, visit https://gerrit.osmocom.org/9989 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ic950c04d309d5686bfbeab332f79c48678e743ae Gerrit-Change-Number: 9989 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 17:51:43 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 17:51:43 +0000 Subject: Change in osmo-ttcn3-hacks[master]: bsc: fix f_gen_ass_req(): populate codec list In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9998 ) Change subject: bsc: fix f_gen_ass_req(): populate codec list ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/9998/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/9998/1//COMMIT_MSG at 16 PS1, Line 16: TC_assignment_csd() : * TC_assignment_ctm() are you sure a circuit switched data call (which has no voice, and hence no voice codecs) needs/wants a Speech Codec List IE? I don't recall the details, but I *think* the speech codec list IE is intentionally not set by f_gen_ass_req() so the callers must set it, _if they want one_. In the end, it's a question of API design/policy, and I don't care either way. We just need to make sure that only voice call assignments have the IEs that relate to voice calls (only) -- To view, visit https://gerrit.osmocom.org/9998 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia18e44e93b0328ad26d741a3317753118fc57f9f Gerrit-Change-Number: 9998 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Harald Welte Gerrit-Comment-Date: Mon, 16 Jul 2018 17:51:43 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 17:52:43 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 17:52:43 +0000 Subject: Change in osmo-ttcn3-hacks[master]: bsc: fix f_establish_fully(): first RSL should be EST IND, not DATA In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9999 ) Change subject: bsc: fix f_establish_fully(): first RSL should be EST IND, not DATA ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9999 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia609b67c28ce07fa3bf33e3c4a5658046474d60a Gerrit-Change-Number: 9999 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 16 Jul 2018 17:52:43 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 17:52:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 17:52:57 +0000 Subject: Change in osmo-ttcn3-hacks[master]: bsc: fix as_handover(): first RSL should be EST IND, not DATA In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10000 ) Change subject: bsc: fix as_handover(): first RSL should be EST IND, not DATA ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10000 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I41b395eb7dbdd56796706722d79c7a3bc5a0b5b0 Gerrit-Change-Number: 10000 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 16 Jul 2018 17:52:57 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 17:53:32 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 16 Jul 2018 17:53:32 +0000 Subject: Change in osmo-ci[master]: add scripts/verify_log_statements.py Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10012 Change subject: add scripts/verify_log_statements.py ...................................................................... add scripts/verify_log_statements.py This came up in https://gerrit.osmocom.org/#/c/osmo-bsc/+/9671/6//COMMIT_MSG at 36 The errors it finds in the current code base are numerous, and many are intended LOGP .. LOGPC calls. It doesn't make sense to enforce this, but so far this can be used manually. Change-Id: Id79389f090a2fded7ff01dc7e3fe9774e7f22ca0 --- A scripts/verify_log_statements.py 1 file changed, 87 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/12/10012/1 diff --git a/scripts/verify_log_statements.py b/scripts/verify_log_statements.py new file mode 100755 index 0000000..e7752e1 --- /dev/null +++ b/scripts/verify_log_statements.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python3 +__doc__ = ''' +With regex magic, try to pinpoint all LOG* macro calls that lack a final newline. +Also find those that have non-printable characters or extra newlines. + +Usage: + + ./verify_log_statements.py [-d|--debug] [dir] [file] [...] + +Without args, default to '.' +''' + +import re +import sys +import codecs +import os.path + +# This regex matches the entire LOGxx(...) statement over multiple lines. +# It pinpoints the format string by looking for the first arg that contains quotes. +# It then matches any number of separate quoted strings, and accepts 0 or more args after that. +log_statement_re = re.compile(r'^[ \t]*LOG[_A-Z]+\(([^";,]*,)* *(("[^"]*"[^";,]*)*)(,[^;]*|)\);', + re.MULTILINE | re.DOTALL) +fmt_re = re.compile(r'("[^"]*".*)*fmt') + +errors_found = 0 +debug = ('-d' in sys.argv) or ('--debug' in sys.argv) + +args = [x for x in sys.argv[1:] if not (x == '-d' or x == '--debug')] +if not args: + args = ['.'] + + +def check_file(f): + global errors_found + if not (f.endswith('.h') or f.endswith('.c') or f.endswith('.cpp')): + return + + for log in log_statement_re.finditer(codecs.open(f, "r", "utf-8").read()): + quoted = log.group(2) + + # Skip 'LOG("bla" fmt )' strings that typically appear as #defines. + if fmt_re.match(quoted): + if debug: + print('Skipping define:', f, '\n'+log.group(0)) + continue + + # Drop PRI* parts of 'LOG("bla %"PRIu64" foo")' + for n in (16,32,64): + quoted = quoted.replace('PRIu' + str(n), '') + quoted = quoted.replace('PRId' + str(n), '') + + # Use py eval to join separate string constants: drop any tabs/newlines + # that are not in quotes, between separate string constants. + try: + quoted = eval('(' + quoted + '\n)' ) + except: + # hopefully eval broke because of some '## args' macro def + if debug: + print('Ignoring:', f, '\n'+log.group(0)) + continue + + # check for errors... + + # final newline + if not quoted.endswith('\n'): + print('Missing final newline:', f, '\n'+log.group(0)) + errors_found += 1 + + # disallowed chars and extra newlines + for c in quoted[:-1]: + if not c.isprintable() and not c == '\t': + if c == '\n': + msg = 'Extraneous newline' + else: + msg = 'Illegal char' + print('%s %r in' % (msg, c), f, '\n' + log.group(0)) + errors_found += 1 + +for f in args: + if os.path.isdir(f): + for parent_path, subdirs, files in os.walk(f, None, None): + for ff in files: + check_file(os.path.join(parent_path, ff)) + else: + check_file(f) + +sys.exit(errors_found) -- To view, visit https://gerrit.osmocom.org/10012 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id79389f090a2fded7ff01dc7e3fe9774e7f22ca0 Gerrit-Change-Number: 10012 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 17:53:40 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 17:53:40 +0000 Subject: Change in osmo-sgsn[master]: sgsn: Don't attempt to delete GTP pdp ctx if GGSN was restarted In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9993 ) Change subject: sgsn: Don't attempt to delete GTP pdp ctx if GGSN was restarted ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9993 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1c74098e181552c218e152bf4ac5035cea770428 Gerrit-Change-Number: 9993 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Holger Freyther Gerrit-Comment-Date: Mon, 16 Jul 2018 17:53:40 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 17:53:45 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 17:53:45 +0000 Subject: Change in osmo-sgsn[master]: sgsn: Don't attempt to delete GTP pdp ctx if GGSN was restarted In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9993 ) Change subject: sgsn: Don't attempt to delete GTP pdp ctx if GGSN was restarted ...................................................................... sgsn: Don't attempt to delete GTP pdp ctx if GGSN was restarted Scenario and behaviour before this commit: - Received Echo Reply from GGSN has incremented RestartCounter - func sgsn_ggsn_ctx_drop_all_pdp() is called to dettach all pdp ctx from GGSN and request the MS to deact all related ctx. - DEACT ACCEPT is received from MS, and then it tries to send DEL PDP CTX to GGSN, expecting to receive a Confirmation and only then freeing the pdp ctx. The problem is that since the initial cause of triggering was a GGSN restart, the GGSN doesn't know anything about that pdp ctx anymore, so it's not useful sending it. We can instead dettach the GGSN and libgtp ref at drop_all_pdp() time and then when we receive DEACT ACCEPT from MS we can free the pdp ctx directly. Change-Id: I1c74098e181552c218e152bf4ac5035cea770428 --- M src/gprs/gprs_gmm.c M src/gprs/gprs_sgsn.c 2 files changed, 21 insertions(+), 7 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index d06fa6c..ad56c60 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -2699,7 +2699,11 @@ } /* stop timer 3395 */ pdpctx_timer_stop(pdp, 3395); - return sgsn_delete_pdp_ctx(pdp); + if (pdp->ggsn) + return sgsn_delete_pdp_ctx(pdp); + /* GTP side already detached, freeing */ + sgsn_pdp_ctx_free(pdp); + return 0; } static int gsm48_rx_gsm_status(struct sgsn_mm_ctx *ctx, struct msgb *msg) @@ -2723,7 +2727,10 @@ if (pdp->num_T_exp >= 4) { LOGPDPCTXP(LOGL_NOTICE, pdp, "T3395 expired >= 5 times\n"); pdp->state = PDP_STATE_INACTIVE; - sgsn_delete_pdp_ctx(pdp); + if (pdp->ggsn) + sgsn_delete_pdp_ctx(pdp); + else + sgsn_pdp_ctx_free(pdp); break; } gsm48_tx_gsm_deact_pdp_req(pdp, GSM_CAUSE_NET_FAIL, true); diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c index 35479fb..ef0cc23 100644 --- a/src/gprs/gprs_sgsn.c +++ b/src/gprs/gprs_sgsn.c @@ -444,7 +444,8 @@ /* Detach from MM context */ pdp_ctx_detach_mm_ctx(pdp); - sgsn_delete_pdp_ctx(pdp); + if (pdp->ggsn) + sgsn_delete_pdp_ctx(pdp); } /* @@ -479,8 +480,6 @@ lib->priv = NULL; } - if (pdp->destroy_ggsn) - sgsn_ggsn_ctx_free(pdp->ggsn); talloc_free(pdp); } @@ -702,9 +701,10 @@ static void drop_one_pdp(struct sgsn_pdp_ctx *pdp) { - if (pdp->mm->gmm_state == GMM_REGISTERED_NORMAL) + if (pdp->mm->gmm_state == GMM_REGISTERED_NORMAL) { gsm48_tx_gsm_deact_pdp_req(pdp, GSM_CAUSE_NET_FAIL, true); - else { + sgsn_ggsn_ctx_remove_pdp(pdp->ggsn, pdp); + } else { /* FIXME: GPRS paging in case MS is SUSPENDED */ LOGPDPCTXP(LOGL_NOTICE, pdp, "Hard-dropping PDP ctx due to GGSN " "recovery\n"); @@ -739,6 +739,13 @@ llist_del(&pdp->ggsn_list); if (llist_empty(&ggc->pdp_list) && osmo_timer_pending(&ggc->echo_timer)) osmo_timer_del(&ggc->echo_timer); + if (pdp->destroy_ggsn) + sgsn_ggsn_ctx_free(pdp->ggsn); + pdp->ggsn = NULL; + /* Drop references to libgtp since the conn is down */ + if (pdp->lib) + pdp_freepdp(pdp->lib); + pdp->lib = NULL; } void sgsn_update_subscriber_data(struct sgsn_mm_ctx *mmctx) -- To view, visit https://gerrit.osmocom.org/9993 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I1c74098e181552c218e152bf4ac5035cea770428 Gerrit-Change-Number: 9993 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Holger Freyther -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 17:53:45 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 17:53:45 +0000 Subject: Change in osmo-sgsn[master]: Forward GGSN originated DEACT PDP CTX REQ In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10002 ) Change subject: Forward GGSN originated DEACT PDP CTX REQ ...................................................................... Forward GGSN originated DEACT PDP CTX REQ This commit fixes TTCN3 sgsn test TC_attach_pdp_act_user_deact_mt. Change-Id: I204209c017aac8a8402cbb8d0a0200540abcc954 --- M include/osmocom/sgsn/gprs_sgsn.h M src/gprs/gprs_sgsn.c M src/gprs/sgsn_libgtp.c 3 files changed, 15 insertions(+), 7 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmocom/sgsn/gprs_sgsn.h b/include/osmocom/sgsn/gprs_sgsn.h index 5f30889..8eba2d4 100644 --- a/include/osmocom/sgsn/gprs_sgsn.h +++ b/include/osmocom/sgsn/gprs_sgsn.h @@ -361,6 +361,7 @@ struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_id(uint32_t id); struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_addr(struct in_addr *addr); struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_find_alloc(uint32_t id); +void sgsn_ggsn_ctx_drop_pdp(struct sgsn_pdp_ctx *pctx); int sgsn_ggsn_ctx_drop_all_pdp(struct sgsn_ggsn_ctx *ggsn); void sgsn_ggsn_ctx_add_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx *pdp); void sgsn_ggsn_ctx_remove_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx *pdp); diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c index ef0cc23..e6d88e3 100644 --- a/src/gprs/gprs_sgsn.c +++ b/src/gprs/gprs_sgsn.c @@ -699,17 +699,17 @@ return GSM_RESERVED_TMSI; } -static void drop_one_pdp(struct sgsn_pdp_ctx *pdp) +void sgsn_ggsn_ctx_drop_pdp(struct sgsn_pdp_ctx *pctx) { - if (pdp->mm->gmm_state == GMM_REGISTERED_NORMAL) { - gsm48_tx_gsm_deact_pdp_req(pdp, GSM_CAUSE_NET_FAIL, true); - sgsn_ggsn_ctx_remove_pdp(pdp->ggsn, pdp); + if (pctx->mm->gmm_state == GMM_REGISTERED_NORMAL) { + gsm48_tx_gsm_deact_pdp_req(pctx, GSM_CAUSE_NET_FAIL, true); + sgsn_ggsn_ctx_remove_pdp(pctx->ggsn, pctx); } else { /* FIXME: GPRS paging in case MS is SUSPENDED */ - LOGPDPCTXP(LOGL_NOTICE, pdp, "Hard-dropping PDP ctx due to GGSN " + LOGPDPCTXP(LOGL_NOTICE, pctx, "Hard-dropping PDP ctx due to GGSN " "recovery\n"); /* FIXME: how to tell this to libgtp? */ - sgsn_pdp_ctx_free(pdp); + sgsn_pdp_ctx_free(pctx); } } @@ -721,7 +721,7 @@ struct sgsn_pdp_ctx *pdp, *pdp2; llist_for_each_entry_safe(pdp, pdp2, &ggsn->pdp_list, ggsn_list) { - drop_one_pdp(pdp); + sgsn_ggsn_ctx_drop_pdp(pdp); num++; } diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 88cea5d..659392e 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -639,8 +639,15 @@ /* Called whenever a PDP context is deleted for any reason */ static int cb_delete_context(struct pdp_t *pdp) { + struct sgsn_pdp_ctx *pctx = pdp->priv; + LOGPDPX(DGPRS, LOGL_INFO, pdp, "Context %p was deleted\n", pdp); + /* unlink the now non-existing library handle from the pdp + * context */ + pctx->lib = NULL; + + sgsn_ggsn_ctx_drop_pdp(pctx); return 0; } -- To view, visit https://gerrit.osmocom.org/10002 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I204209c017aac8a8402cbb8d0a0200540abcc954 Gerrit-Change-Number: 10002 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 17:53:45 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 17:53:45 +0000 Subject: Change in osmo-sgsn[master]: sgsn: Fix T3395 firing forever In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10003 ) Change subject: sgsn: Fix T3395 firing forever ...................................................................... sgsn: Fix T3395 firing forever field pdp->num_T_exp was being reset to 0 every time pdpctx_timer_start() was called from gsm48_tx_gsm_deact_pdp_req(). Take the chance to test max amount of retrans to 4 as detailed in specs. Change-Id: Iacce3c66f61578ebee37abaa287f7e183f985c1c --- M src/gprs/gprs_gmm.c 1 file changed, 13 insertions(+), 4 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index ad56c60..91f769d 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -2170,6 +2170,15 @@ static void pdpctx_timer_cb(void *_mm); + +static void pdpctx_timer_rearm(struct sgsn_pdp_ctx *pdp, unsigned int T, unsigned int seconds) +{ + if (osmo_timer_pending(&pdp->timer)) + LOGPDPCTXP(LOGL_ERROR, pdp, "Scheduling PDP timer %u while old " + "timer %u pending\n", T, pdp->T); + osmo_timer_schedule(&pdp->timer, seconds, 0); +} + static void pdpctx_timer_start(struct sgsn_pdp_ctx *pdp, unsigned int T, unsigned int seconds) { @@ -2179,9 +2188,8 @@ pdp->T = T; pdp->num_T_exp = 0; - /* FIXME: we should do this only once ? */ osmo_timer_setup(&pdp->timer, pdpctx_timer_cb, pdp); - osmo_timer_schedule(&pdp->timer, seconds, 0); + pdpctx_timer_rearm(pdp, pdp->T, seconds); } static void pdpctx_timer_stop(struct sgsn_pdp_ctx *pdp, unsigned int T) @@ -2724,7 +2732,7 @@ switch (pdp->T) { case 3395: /* waiting for PDP CTX DEACT ACK */ - if (pdp->num_T_exp >= 4) { + if (pdp->num_T_exp >= 5) { LOGPDPCTXP(LOGL_NOTICE, pdp, "T3395 expired >= 5 times\n"); pdp->state = PDP_STATE_INACTIVE; if (pdp->ggsn) @@ -2733,7 +2741,8 @@ sgsn_pdp_ctx_free(pdp); break; } - gsm48_tx_gsm_deact_pdp_req(pdp, GSM_CAUSE_NET_FAIL, true); + _gsm48_tx_gsm_deact_pdp_req(pdp->mm, pdp->ti, GSM_CAUSE_NET_FAIL, true); + pdpctx_timer_rearm(pdp, 3395, sgsn->cfg.timers.T3395); break; default: LOGPDPCTXP(LOGL_ERROR, pdp, "timer expired in unknown mode %u\n", -- To view, visit https://gerrit.osmocom.org/10003 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iacce3c66f61578ebee37abaa287f7e183f985c1c Gerrit-Change-Number: 10003 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-CC: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 17:54:35 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 17:54:35 +0000 Subject: Change in osmo-ci[master]: add scripts/verify_log_statements.py In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10012 ) Change subject: add scripts/verify_log_statements.py ...................................................................... Patch Set 1: Verified+1 Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10012 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id79389f090a2fded7ff01dc7e3fe9774e7f22ca0 Gerrit-Change-Number: 10012 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Mon, 16 Jul 2018 17:54:35 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 17:56:13 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 17:56:13 +0000 Subject: Change in libosmocore[master]: ctrl: Introduce ctrl_cmd_parse3 API In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9978 ) Change subject: ctrl: Introduce ctrl_cmd_parse3 API ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9978 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ide9170e5c31967c353f8fe4e8227e64130b91eae Gerrit-Change-Number: 9978 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Mon, 16 Jul 2018 17:56:13 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 17:56:19 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 17:56:19 +0000 Subject: Change in libosmocore[master]: ctrl: ctrl_handle_msg: Avoid sending back received ERROR msgs In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9983 ) Change subject: ctrl: ctrl_handle_msg: Avoid sending back received ERROR msgs ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9983 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I396fd1e7548beea31b2b7aa9f764edb765b02941 Gerrit-Change-Number: 9983 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 16 Jul 2018 17:56:19 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 17:56:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 17:56:23 +0000 Subject: Change in libosmocore[master]: tests: ctrl: Test received ERROR messages are handled correctly In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9984 ) Change subject: tests: ctrl: Test received ERROR messages are handled correctly ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9984 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3c8e95aaa1ca222d4cd1395e548f8461bf9d4cd6 Gerrit-Change-Number: 9984 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 16 Jul 2018 17:56:23 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 17:56:25 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 17:56:25 +0000 Subject: Change in libosmocore[master]: ctrl: Introduce ctrl_cmd_parse3 API In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9978 ) Change subject: ctrl: Introduce ctrl_cmd_parse3 API ...................................................................... ctrl: Introduce ctrl_cmd_parse3 API Callers require to know whether the returned ERROR cmd was received or generated locally, in order to send it or do something with it locally. Related: OS#3394 Change-Id: Ide9170e5c31967c353f8fe4e8227e64130b91eae --- M include/osmocom/ctrl/control_cmd.h M src/ctrl/control_cmd.c M src/ctrl/libosmoctrl.map 3 files changed, 22 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/ctrl/control_cmd.h b/include/osmocom/ctrl/control_cmd.h index 08376f3..93055c7 100644 --- a/include/osmocom/ctrl/control_cmd.h +++ b/include/osmocom/ctrl/control_cmd.h @@ -124,6 +124,7 @@ int ctrl_cmd_install(enum ctrl_node_type node, struct ctrl_cmd_element *cmd); int ctrl_cmd_send(struct osmo_wqueue *queue, struct ctrl_cmd *cmd); int ctrl_cmd_send_to_all(struct ctrl_handle *ctrl, struct ctrl_cmd *cmd); +struct ctrl_cmd *ctrl_cmd_parse3(void *ctx, struct msgb *msg, bool *parse_failed); struct ctrl_cmd *ctrl_cmd_parse2(void *ctx, struct msgb *msg); struct ctrl_cmd *ctrl_cmd_parse(void *ctx, struct msgb *msg); struct msgb *ctrl_cmd_make(struct ctrl_cmd *cmd); diff --git a/src/ctrl/control_cmd.c b/src/ctrl/control_cmd.c index 14ff906..33496bd 100644 --- a/src/ctrl/control_cmd.c +++ b/src/ctrl/control_cmd.c @@ -316,9 +316,25 @@ * \param[in] msg message buffer containing command to be decoded * \returns callee-allocated decoded CTRL command; NULL on allocation failure, * ctrl->type == CTRL_TYPE_ERROR and an error message in ctrl->reply on any error. - * The caller is responsible to talloc_free() the returned struct pointer. */ + * The caller is responsible to talloc_free() the returned struct pointer. + * If information of the origin of the ERROR cmd returned is required (received + * or local parsing failure), use \ref ctrl_cmd_parse3 instead. */ struct ctrl_cmd *ctrl_cmd_parse2(void *ctx, struct msgb *msg) { + bool unused; + return ctrl_cmd_parse3(ctx, msg, &unused); +} + +/*! Parse/Decode CTRL from \ref msgb into command struct. + * \param[in] ctx talloc context from which to allocate + * \param[in] msg message buffer containing command to be decoded + * \param[out] parse_failed Whether returned ERROR cmd was generatd locally + * (due to parse failure) or was received. + * \returns callee-allocated decoded CTRL command; NULL on allocation failure, + * ctrl->type == CTRL_TYPE_ERROR and an error message in ctrl->reply on any error. + * The caller is responsible to talloc_free() the returned struct pointer. */ +struct ctrl_cmd *ctrl_cmd_parse3(void *ctx, struct msgb *msg, bool *parse_failed) +{ char *str, *tmp, *saveptr = NULL; char *var, *val; struct ctrl_cmd *cmd; @@ -326,6 +342,7 @@ cmd = talloc_zero(ctx, struct ctrl_cmd); if (!cmd) { LOGP(DLCTRL, LOGL_ERROR, "Failed to allocate.\n"); + *parse_failed = true; return NULL; } @@ -483,12 +500,14 @@ goto err; } + *parse_failed = false; return cmd; oom: cmd->type = CTRL_TYPE_ERROR; cmd->id = "err"; cmd->reply = "OOM"; err: + *parse_failed = true; return cmd; } diff --git a/src/ctrl/libosmoctrl.map b/src/ctrl/libosmoctrl.map index 5b888a2..f995467 100644 --- a/src/ctrl/libosmoctrl.map +++ b/src/ctrl/libosmoctrl.map @@ -13,6 +13,7 @@ ctrl_cmd_make; ctrl_cmd_parse; ctrl_cmd_parse2; +ctrl_cmd_parse3; ctrl_cmd_send; ctrl_cmd_send_to_all; ctrl_cmd_send_trap; -- To view, visit https://gerrit.osmocom.org/9978 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ide9170e5c31967c353f8fe4e8227e64130b91eae Gerrit-Change-Number: 9978 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 17:56:26 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 17:56:26 +0000 Subject: Change in libosmocore[master]: ctrl: ctrl_handle_msg: Avoid sending back received ERROR msgs In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9983 ) Change subject: ctrl: ctrl_handle_msg: Avoid sending back received ERROR msgs ...................................................................... ctrl: ctrl_handle_msg: Avoid sending back received ERROR msgs Change-Id: I396fd1e7548beea31b2b7aa9f764edb765b02941 --- M src/ctrl/control_if.c 1 file changed, 3 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/ctrl/control_if.c b/src/ctrl/control_if.c index d3e6fac..5962f7e 100644 --- a/src/ctrl/control_if.c +++ b/src/ctrl/control_if.c @@ -384,6 +384,7 @@ int ctrl_handle_msg(struct ctrl_handle *ctrl, struct ctrl_connection *ccon, struct msgb *msg) { struct ctrl_cmd *cmd; + bool parse_failed; struct ipaccess_head *iph; struct ipaccess_head_ext *iph_ext; int result; @@ -407,7 +408,7 @@ msg->l2h = iph_ext->data; - cmd = ctrl_cmd_parse2(ccon, msg); + cmd = ctrl_cmd_parse3(ccon, msg, &parse_failed); if (!cmd) { /* should never happen */ @@ -421,7 +422,7 @@ } /* In case of error, reply with the error message right away. */ - if (cmd->type == CTRL_TYPE_ERROR) + if (cmd->type == CTRL_TYPE_ERROR && parse_failed) goto send_reply; cmd->ccon = ccon; -- To view, visit https://gerrit.osmocom.org/9983 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I396fd1e7548beea31b2b7aa9f764edb765b02941 Gerrit-Change-Number: 9983 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 17:56:26 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 17:56:26 +0000 Subject: Change in libosmocore[master]: tests: ctrl: Test received ERROR messages are handled correctly In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9984 ) Change subject: tests: ctrl: Test received ERROR messages are handled correctly ...................................................................... tests: ctrl: Test received ERROR messages are handled correctly Change-Id: I3c8e95aaa1ca222d4cd1395e548f8461bf9d4cd6 --- M tests/ctrl/ctrl_test.c M tests/ctrl/ctrl_test.ok 2 files changed, 55 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/ctrl/ctrl_test.c b/tests/ctrl/ctrl_test.c index 8bb917b..cffb803 100644 --- a/tests/ctrl/ctrl_test.c +++ b/tests/ctrl/ctrl_test.c @@ -70,18 +70,23 @@ static void assert_test(struct ctrl_handle *ctrl, struct ctrl_connection *ccon, const struct one_test *t) { struct ctrl_cmd *cmd; + bool parse_failed; struct msgb *msg = msgb_from_string(t->cmd_str); int ctx_size_was; printf("test: '%s'\n", osmo_escape_str(t->cmd_str, -1)); printf("parsing:\n"); - cmd = ctrl_cmd_parse2(ctx, msg); + cmd = ctrl_cmd_parse3(ctx, msg, &parse_failed); OSMO_ASSERT(cmd); if (t->expect_parsed.type != cmd->type) { printf("type mismatch: got %s\n", get_value_string(ctrl_type_vals, cmd->type)); OSMO_ASSERT(t->expect_parsed.type == cmd->type); + } else { + printf("type = '%s'%s\n", get_value_string(ctrl_type_vals, cmd->type), + cmd->type != CTRL_TYPE_ERROR ? "" : + (parse_failed ? " (parse failure)" : " (error received)")); } #define ASSERT_SAME_STR(field) \ @@ -310,7 +315,20 @@ .reply = "OK", }, }, - + { "ERROR 1 some error message", + { + .type = CTRL_TYPE_ERROR, + .id = "1", + .reply = "some error message", + }, + }, + { "ERROR err some error message", + { + .type = CTRL_TYPE_ERROR, + .id = "err", + .reply = "some error message", + }, + }, }; static void test_messages() diff --git a/tests/ctrl/ctrl_test.ok b/tests/ctrl/ctrl_test.ok index 07f4aac..0705d69 100644 --- a/tests/ctrl/ctrl_test.ok +++ b/tests/ctrl/ctrl_test.ok @@ -9,6 +9,7 @@ ctrl type 64 is unknown 0x40 [PARSE FAILED] test: 'GET 1 variable' parsing: +type = 'GET' id = '1' variable = 'variable' value = '(null)' @@ -18,6 +19,7 @@ ok test: 'GET 1 variable\n' parsing: +type = 'GET' id = '1' variable = 'variable' value = '(null)' @@ -27,6 +29,7 @@ ok test: 'GET 1 var\ni\nable' parsing: +type = 'ERROR' (parse failure) id = '1' reply = 'GET with trailing characters' handling: @@ -34,6 +37,7 @@ ok test: 'GET 1 var\ti\table' parsing: +type = 'ERROR' (parse failure) id = '1' reply = 'GET variable contains invalid characters' handling: @@ -41,6 +45,7 @@ ok test: 'GET 1 var\ri\rable' parsing: +type = 'ERROR' (parse failure) id = '1' reply = 'GET variable contains invalid characters' handling: @@ -48,6 +53,7 @@ ok test: 'GET 1 variable value' parsing: +type = 'ERROR' (parse failure) id = '1' reply = 'GET with trailing characters' handling: @@ -55,6 +61,7 @@ ok test: 'GET 1 variable value\n' parsing: +type = 'ERROR' (parse failure) id = '1' reply = 'GET with trailing characters' handling: @@ -62,6 +69,7 @@ ok test: 'GET 1 variable multiple value tokens' parsing: +type = 'ERROR' (parse failure) id = '1' reply = 'GET with trailing characters' handling: @@ -69,6 +77,7 @@ ok test: 'GET 1 variable multiple value tokens\n' parsing: +type = 'ERROR' (parse failure) id = '1' reply = 'GET with trailing characters' handling: @@ -76,6 +85,7 @@ ok test: 'SET 1 variable value' parsing: +type = 'SET' id = '1' variable = 'variable' value = 'value' @@ -85,6 +95,7 @@ ok test: 'SET 1 variable value\n' parsing: +type = 'SET' id = '1' variable = 'variable' value = 'value' @@ -94,6 +105,7 @@ ok test: 'SET weird_id variable value' parsing: +type = 'ERROR' (parse failure) id = 'err' reply = 'Invalid message ID number' handling: @@ -101,6 +113,7 @@ ok test: 'SET weird_id variable value\n' parsing: +type = 'ERROR' (parse failure) id = 'err' reply = 'Invalid message ID number' handling: @@ -108,6 +121,7 @@ ok test: 'SET 1 variable multiple value tokens' parsing: +type = 'SET' id = '1' variable = 'variable' value = 'multiple value tokens' @@ -117,6 +131,7 @@ ok test: 'SET 1 variable multiple value tokens\n' parsing: +type = 'SET' id = '1' variable = 'variable' value = 'multiple value tokens' @@ -126,6 +141,7 @@ ok test: 'SET 1 variable value_with_trailing_spaces ' parsing: +type = 'SET' id = '1' variable = 'variable' value = 'value_with_trailing_spaces ' @@ -135,6 +151,7 @@ ok test: 'SET 1 variable value_with_trailing_spaces \n' parsing: +type = 'SET' id = '1' variable = 'variable' value = 'value_with_trailing_spaces ' @@ -144,6 +161,7 @@ ok test: 'SET \n special_char_id value' parsing: +type = 'ERROR' (parse failure) id = 'err' reply = 'Invalid message ID number' handling: @@ -151,6 +169,7 @@ ok test: 'SET \t special_char_id value' parsing: +type = 'ERROR' (parse failure) id = 'err' reply = 'Invalid message ID number' handling: @@ -158,6 +177,7 @@ ok test: 'GET_REPLY 1 variable OK' parsing: +type = 'GET_REPLY' id = '1' variable = 'variable' value = '(null)' @@ -166,12 +186,27 @@ ok test: 'SET_REPLY 1 variable OK' parsing: +type = 'SET_REPLY' id = '1' variable = 'variable' value = '(null)' reply = 'OK' handling: ok +test: 'ERROR 1 some error message' +parsing: +type = 'ERROR' (error received) +id = '1' +reply = 'some error message' +handling: +ok +test: 'ERROR err some error message' +parsing: +type = 'ERROR' (error received) +id = 'err' +reply = 'some error message' +handling: +ok test_deferred_cmd get_test_defer called -- To view, visit https://gerrit.osmocom.org/9984 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I3c8e95aaa1ca222d4cd1395e548f8461bf9d4cd6 Gerrit-Change-Number: 9984 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 17:56:37 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 17:56:37 +0000 Subject: Change in osmo-ci[master]: add scripts/verify_log_statements.py In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10012 ) Change subject: add scripts/verify_log_statements.py ...................................................................... add scripts/verify_log_statements.py This came up in https://gerrit.osmocom.org/#/c/osmo-bsc/+/9671/6//COMMIT_MSG at 36 The errors it finds in the current code base are numerous, and many are intended LOGP .. LOGPC calls. It doesn't make sense to enforce this, but so far this can be used manually. Change-Id: Id79389f090a2fded7ff01dc7e3fe9774e7f22ca0 --- A scripts/verify_log_statements.py 1 file changed, 87 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/scripts/verify_log_statements.py b/scripts/verify_log_statements.py new file mode 100755 index 0000000..e7752e1 --- /dev/null +++ b/scripts/verify_log_statements.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python3 +__doc__ = ''' +With regex magic, try to pinpoint all LOG* macro calls that lack a final newline. +Also find those that have non-printable characters or extra newlines. + +Usage: + + ./verify_log_statements.py [-d|--debug] [dir] [file] [...] + +Without args, default to '.' +''' + +import re +import sys +import codecs +import os.path + +# This regex matches the entire LOGxx(...) statement over multiple lines. +# It pinpoints the format string by looking for the first arg that contains quotes. +# It then matches any number of separate quoted strings, and accepts 0 or more args after that. +log_statement_re = re.compile(r'^[ \t]*LOG[_A-Z]+\(([^";,]*,)* *(("[^"]*"[^";,]*)*)(,[^;]*|)\);', + re.MULTILINE | re.DOTALL) +fmt_re = re.compile(r'("[^"]*".*)*fmt') + +errors_found = 0 +debug = ('-d' in sys.argv) or ('--debug' in sys.argv) + +args = [x for x in sys.argv[1:] if not (x == '-d' or x == '--debug')] +if not args: + args = ['.'] + + +def check_file(f): + global errors_found + if not (f.endswith('.h') or f.endswith('.c') or f.endswith('.cpp')): + return + + for log in log_statement_re.finditer(codecs.open(f, "r", "utf-8").read()): + quoted = log.group(2) + + # Skip 'LOG("bla" fmt )' strings that typically appear as #defines. + if fmt_re.match(quoted): + if debug: + print('Skipping define:', f, '\n'+log.group(0)) + continue + + # Drop PRI* parts of 'LOG("bla %"PRIu64" foo")' + for n in (16,32,64): + quoted = quoted.replace('PRIu' + str(n), '') + quoted = quoted.replace('PRId' + str(n), '') + + # Use py eval to join separate string constants: drop any tabs/newlines + # that are not in quotes, between separate string constants. + try: + quoted = eval('(' + quoted + '\n)' ) + except: + # hopefully eval broke because of some '## args' macro def + if debug: + print('Ignoring:', f, '\n'+log.group(0)) + continue + + # check for errors... + + # final newline + if not quoted.endswith('\n'): + print('Missing final newline:', f, '\n'+log.group(0)) + errors_found += 1 + + # disallowed chars and extra newlines + for c in quoted[:-1]: + if not c.isprintable() and not c == '\t': + if c == '\n': + msg = 'Extraneous newline' + else: + msg = 'Illegal char' + print('%s %r in' % (msg, c), f, '\n' + log.group(0)) + errors_found += 1 + +for f in args: + if os.path.isdir(f): + for parent_path, subdirs, files in os.walk(f, None, None): + for ff in files: + check_file(os.path.join(parent_path, ff)) + else: + check_file(f) + +sys.exit(errors_found) -- To view, visit https://gerrit.osmocom.org/10012 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Id79389f090a2fded7ff01dc7e3fe9774e7f22ca0 Gerrit-Change-Number: 10012 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 17:57:56 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 17:57:56 +0000 Subject: Change in pysim[master]: tests: add test program to verify pysim-prog.py (and pysim-read.py) In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9947 ) Change subject: tests: add test program to verify pysim-prog.py (and pysim-read.py) ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9947 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8c6f95998272333bc757b34e3ab6be004e8cd674 Gerrit-Change-Number: 9947 Gerrit-PatchSet: 3 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: dexter Gerrit-Comment-Date: Mon, 16 Jul 2018 17:57:56 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 17:59:09 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 17:59:09 +0000 Subject: Change in pysim[master]: cosmetic: fix cut and paste error in comment In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9985 ) Change subject: cosmetic: fix cut and paste error in comment ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9985 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I506585f8b300bb7a3e20edad7eca134374581d76 Gerrit-Change-Number: 9985 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Mon, 16 Jul 2018 17:59:09 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 18:00:07 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 18:00:07 +0000 Subject: Change in pysim[master]: cards: return SW in method update_plmnsel() of class Card In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9986 ) Change subject: cards: return SW in method update_plmnsel() of class Card ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9986 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I54e8e165f87365e8162b36d24efc8f0db62b66da Gerrit-Change-Number: 9986 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Mon, 16 Jul 2018 18:00:07 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 18:02:49 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Mon, 16 Jul 2018 18:02:49 +0000 Subject: Change in osmo-ci[master]: ansible: osmocom-jenkins-slave: add variables to the README.md Message-ID: lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/10013 Change subject: ansible: osmocom-jenkins-slave: add variables to the README.md ...................................................................... ansible: osmocom-jenkins-slave: add variables to the README.md Change-Id: I878ed30ee2f44d98635511011c17f0f0e986bcc9 --- M ansible/roles/osmocom-jenkins-slave/README.md 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/13/10013/1 diff --git a/ansible/roles/osmocom-jenkins-slave/README.md b/ansible/roles/osmocom-jenkins-slave/README.md index e55d1be..51bf6a1 100644 --- a/ansible/roles/osmocom-jenkins-slave/README.md +++ b/ansible/roles/osmocom-jenkins-slave/README.md @@ -1,2 +1,7 @@ # Setup a usual jenkins slave +Support the following variables: + +* `generic_slave`: (true) contains tasks used by the most osmocom jenkins slaves +* `osmocom_jenkins_slave_fstrim`: (false) calls fstrim periodical +* `ttcn3_slave`: (true) install titan ttcn3 compiler and prepares the docker-playground -- To view, visit https://gerrit.osmocom.org/10013 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I878ed30ee2f44d98635511011c17f0f0e986bcc9 Gerrit-Change-Number: 10013 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 18:02:50 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Mon, 16 Jul 2018 18:02:50 +0000 Subject: Change in osmo-ci[master]: ansible: osmocom-jenkins-slave: move installing build + runtime deps ... Message-ID: lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/10014 Change subject: ansible: osmocom-jenkins-slave: move installing build + runtime deps into own file ...................................................................... ansible: osmocom-jenkins-slave: move installing build + runtime deps into own file For small nodes (e.g. simtester) the full blown packages are not required nor supported. In this case only the jenkins user and the ssh keys will be setted up. Change-Id: I469a8012b124516bfd9c4d4dd3a3fe0e1ff80bb6 --- M ansible/roles/osmocom-jenkins-slave/README.md M ansible/roles/osmocom-jenkins-slave/defaults/main.yml M ansible/roles/osmocom-jenkins-slave/tasks/main.yml A ansible/roles/osmocom-jenkins-slave/tasks/osmocom_build_deps.yml 4 files changed, 93 insertions(+), 85 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/14/10014/1 diff --git a/ansible/roles/osmocom-jenkins-slave/README.md b/ansible/roles/osmocom-jenkins-slave/README.md index 51bf6a1..de02b43 100644 --- a/ansible/roles/osmocom-jenkins-slave/README.md +++ b/ansible/roles/osmocom-jenkins-slave/README.md @@ -2,6 +2,7 @@ Support the following variables: +* `install_osmocom_build_deps`: (true) install all osmocom runtime and build time dependencies * `generic_slave`: (true) contains tasks used by the most osmocom jenkins slaves * `osmocom_jenkins_slave_fstrim`: (false) calls fstrim periodical * `ttcn3_slave`: (true) install titan ttcn3 compiler and prepares the docker-playground diff --git a/ansible/roles/osmocom-jenkins-slave/defaults/main.yml b/ansible/roles/osmocom-jenkins-slave/defaults/main.yml index e32b5a0..bdc13b4 100644 --- a/ansible/roles/osmocom-jenkins-slave/defaults/main.yml +++ b/ansible/roles/osmocom-jenkins-slave/defaults/main.yml @@ -3,6 +3,9 @@ # OS user jenkins_user: jenkins +# install all osmocom runtime and build time dependencies +install_osmocom_build_deps: true + # E.g. a generic_slave requires different tasks as a # special slave including the gsm-tester generic_slave: true diff --git a/ansible/roles/osmocom-jenkins-slave/tasks/main.yml b/ansible/roles/osmocom-jenkins-slave/tasks/main.yml index cca3704..072792d 100644 --- a/ansible/roles/osmocom-jenkins-slave/tasks/main.yml +++ b/ansible/roles/osmocom-jenkins-slave/tasks/main.yml @@ -4,91 +4,6 @@ include_tasks: debian.yml when: ansible_distribution == 'Debian' -- name: install build utilities - apt: - name: "{{ item }}" - cache_valid_time: 3600 - update_cache: yes - with_items: - - asciidoc - - autoconf - - autoconf-archive - - automake - - bc - - bison - - coccinelle - - cppcheck - - debhelper - - devscripts - - dh-autoreconf - - dh-systemd - - doxygen - - flex - - g++ - - gawk - - gcc - - gcc-arm-none-eabi - - git - - git-buildpackage - - graphviz - - libtool - - libboost-all-dev - - make - - mscgen - - osc - - pkgconf - - python-minimal - - python-setuptools - - python3 - - python3-setuptools - - stow - - texinfo - # by gsm-manuals - - python-nwdiag - - python-pychart - # by gapk - - libasound-dev - - libopencore-amrnb-dev - -- name: install build dependencies and libraries - apt: - name: "{{ item }}" - cache_valid_time: 3600 - update_cache: yes - install_recommends: no - with_items: - - docbook5-xml - - libboost-dev - - libc-ares-dev - - libdbd-sqlite3 - - libdbi-dev - - libffi-dev - - libffi-dev - - libfftw3-dev - - libgmp-dev - - libgnutls28-dev - - libgps-dev - - libgsm1-dev - - libmnl-dev - - libncurses5-dev - - libortp-dev - - libpcap-dev - - libpcsclite-dev - - libreadline-dev - - libsctp-dev - - libsigsegv-dev - - libsnmp-dev - - libsofia-sip-ua-glib-dev - - libsqlite3-dev - - libssl-dev - - libsystemd-dev - - libtalloc-dev - - libuhd-dev - - libusb-1.0-0-dev - - libusb-dev - - libzmq3-dev - - sqlite3 - - name: add user jenkins user: name: "{{ jenkins_user }}" @@ -102,6 +17,10 @@ user: "{{ jenkins_user }}" key: "{{ lookup('file', 'jenkins.osmocom.org.pub') }}" +- name: include osmocom_build_deps.yml + include_tasks: osmocom_build_deps.yml + when: install_osmocom_build_deps + - name: include generic slave include_tasks: generic-slave.yml when: generic_slave diff --git a/ansible/roles/osmocom-jenkins-slave/tasks/osmocom_build_deps.yml b/ansible/roles/osmocom-jenkins-slave/tasks/osmocom_build_deps.yml new file mode 100644 index 0000000..733866c --- /dev/null +++ b/ansible/roles/osmocom-jenkins-slave/tasks/osmocom_build_deps.yml @@ -0,0 +1,85 @@ +--- +- name: install build utilities + apt: + name: "{{ item }}" + cache_valid_time: 3600 + update_cache: yes + with_items: + - asciidoc + - autoconf + - autoconf-archive + - automake + - bc + - bison + - coccinelle + - cppcheck + - debhelper + - devscripts + - dh-autoreconf + - dh-systemd + - doxygen + - flex + - g++ + - gawk + - gcc + - gcc-arm-none-eabi + - git + - git-buildpackage + - graphviz + - libtool + - libboost-all-dev + - make + - mscgen + - osc + - pkgconf + - python-minimal + - python-setuptools + - python3 + - python3-setuptools + - stow + - texinfo + # by gsm-manuals + - python-nwdiag + - python-pychart + # by gapk + - libasound-dev + - libopencore-amrnb-dev + +- name: install build dependencies and libraries + apt: + name: "{{ item }}" + cache_valid_time: 3600 + update_cache: yes + install_recommends: no + with_items: + - docbook5-xml + - libboost-dev + - libc-ares-dev + - libdbd-sqlite3 + - libdbi-dev + - libffi-dev + - libffi-dev + - libfftw3-dev + - libgmp-dev + - libgnutls28-dev + - libgps-dev + - libgsm1-dev + - libmnl-dev + - libncurses5-dev + - libortp-dev + - libpcap-dev + - libpcsclite-dev + - libreadline-dev + - libsctp-dev + - libsigsegv-dev + - libsnmp-dev + - libsofia-sip-ua-glib-dev + - libsqlite3-dev + - libssl-dev + - libsystemd-dev + - libtalloc-dev + - libuhd-dev + - libusb-1.0-0-dev + - libusb-dev + - libzmq3-dev + - sqlite3 -- To view, visit https://gerrit.osmocom.org/10014 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I469a8012b124516bfd9c4d4dd3a3fe0e1ff80bb6 Gerrit-Change-Number: 10014 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 18:02:50 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Mon, 16 Jul 2018 18:02:50 +0000 Subject: Change in osmo-ci[master]: ansible: osmocom-jenkins-slave: debian.yml: don't install recommends Message-ID: lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/10015 Change subject: ansible: osmocom-jenkins-slave: debian.yml: don't install recommends ...................................................................... ansible: osmocom-jenkins-slave: debian.yml: don't install recommends Pulls a lot of packages Change-Id: I894455ea779ece84c403f768a1260a1cf2528389 --- M ansible/roles/osmocom-jenkins-slave/tasks/debian.yml 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/15/10015/1 diff --git a/ansible/roles/osmocom-jenkins-slave/tasks/debian.yml b/ansible/roles/osmocom-jenkins-slave/tasks/debian.yml index a1f8574..43b1263 100644 --- a/ansible/roles/osmocom-jenkins-slave/tasks/debian.yml +++ b/ansible/roles/osmocom-jenkins-slave/tasks/debian.yml @@ -5,6 +5,7 @@ name: "{{ item }}" cache_valid_time: 3600 update_cache: yes + install_recommends: no with_items: - htop - virt-manager @@ -26,6 +27,7 @@ name: openjdk-8-jre-headless cache_valid_time: 3600 update_cache: yes + install_recommends: no default_release: jessie-backports when: ansible_distribution == 'Debian' and ansible_distribution_release == 'jessie' @@ -34,6 +36,7 @@ name: "{{ item }}" cache_valid_time: 3600 update_cache: yes + install_recommends: no with_items: - openjdk-8-jre-headless when: ansible_distribution == 'Debian' and ansible_distribution_release == 'stretch' -- To view, visit https://gerrit.osmocom.org/10015 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I894455ea779ece84c403f768a1260a1cf2528389 Gerrit-Change-Number: 10015 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 18:02:51 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Mon, 16 Jul 2018 18:02:51 +0000 Subject: Change in osmo-ci[master]: ansible: osmocom-jenkins-slave: add var install_jenkins_utilities Message-ID: lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/10016 Change subject: ansible: osmocom-jenkins-slave: add var install_jenkins_utilities ...................................................................... ansible: osmocom-jenkins-slave: add var install_jenkins_utilities To select if some utilities including qemu/debootstrap/fakeroot will be installed. Usefull for small setups e.g. simtester Change-Id: I72f4460b8550da191e74a44be0ee3eeb3b2d7769 --- M ansible/roles/osmocom-jenkins-slave/README.md M ansible/roles/osmocom-jenkins-slave/defaults/main.yml M ansible/roles/osmocom-jenkins-slave/tasks/debian.yml 3 files changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/16/10016/1 diff --git a/ansible/roles/osmocom-jenkins-slave/README.md b/ansible/roles/osmocom-jenkins-slave/README.md index de02b43..50aed16 100644 --- a/ansible/roles/osmocom-jenkins-slave/README.md +++ b/ansible/roles/osmocom-jenkins-slave/README.md @@ -2,6 +2,7 @@ Support the following variables: +* `install_jenkins_utilities`: (true) install usefull utilities including qemu/debootstrap/fakeroot * `install_osmocom_build_deps`: (true) install all osmocom runtime and build time dependencies * `generic_slave`: (true) contains tasks used by the most osmocom jenkins slaves * `osmocom_jenkins_slave_fstrim`: (false) calls fstrim periodical diff --git a/ansible/roles/osmocom-jenkins-slave/defaults/main.yml b/ansible/roles/osmocom-jenkins-slave/defaults/main.yml index bdc13b4..4e1f179 100644 --- a/ansible/roles/osmocom-jenkins-slave/defaults/main.yml +++ b/ansible/roles/osmocom-jenkins-slave/defaults/main.yml @@ -3,6 +3,9 @@ # OS user jenkins_user: jenkins +# install usefull utilities including qemu/debootstrap/fakeroot +install_jenkins_utilities: true + # install all osmocom runtime and build time dependencies install_osmocom_build_deps: true diff --git a/ansible/roles/osmocom-jenkins-slave/tasks/debian.yml b/ansible/roles/osmocom-jenkins-slave/tasks/debian.yml index 43b1263..ad9f5c2 100644 --- a/ansible/roles/osmocom-jenkins-slave/tasks/debian.yml +++ b/ansible/roles/osmocom-jenkins-slave/tasks/debian.yml @@ -15,6 +15,7 @@ - proot - debootstrap - fakeroot + when: install_jenkins_utilities - name: enable backports for jessie apt_repository: -- To view, visit https://gerrit.osmocom.org/10016 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I72f4460b8550da191e74a44be0ee3eeb3b2d7769 Gerrit-Change-Number: 10016 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 18:02:51 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Mon, 16 Jul 2018 18:02:51 +0000 Subject: Change in osmo-ci[master]: ansible: add playbook setup-simtest Message-ID: lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/10017 Change subject: ansible: add playbook setup-simtest ...................................................................... ansible: add playbook setup-simtest Change-Id: Iab74a2b3fc3148bce815b2dadd1fd683c4b64c44 --- M ansible/hosts A ansible/setup-simtest.yml 2 files changed, 40 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/17/10017/1 diff --git a/ansible/hosts b/ansible/hosts index 4767b0c..85b25d6 100644 --- a/ansible/hosts +++ b/ansible/hosts @@ -14,3 +14,6 @@ build2-deb9build-ansible ansible_host=2a01:4f8:10b:2ad9::1:6 osmocom_jenkins_slave_fstrim=True host2-deb8build-ansible ansible_host=2a01:4f8:120:8470::1:2 host2-deb9build-ansible ansible_host=2a01:4f8:120:8470::1:3 osmocom_jenkins_slave_fstrim=True + +[simtester] +simtest ansible_host=10.9.25.80 diff --git a/ansible/setup-simtest.yml b/ansible/setup-simtest.yml new file mode 100644 index 0000000..b521f51 --- /dev/null +++ b/ansible/setup-simtest.yml @@ -0,0 +1,37 @@ +--- +- name: setup jenkins slaves + hosts: simtester + user: root + tasks: + - name: apt-get update + apt: + cache_valid_time: 3600 + update_cache: yes + + - name: install common utilities + apt: + name: "{{ item }}" + install_recommends: no + with_items: + - vim + - ca-certificates + - python-minimal + - python-setuptools + - python-pip + - python-serial + - virtualenv + # required to build python-smartcard + - libpython2.7-dev + - build-essential + - swig + # jenkisn + - openjdk-8-jre-headless + + roles: + - name: osmocom-jenkins-slave + generic_slave: false + install_jenkins_utilities: false + install_osmocom_build_deps: false + ttcn3_slave: false + tags: + - jenkins-slave -- To view, visit https://gerrit.osmocom.org/10017 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iab74a2b3fc3148bce815b2dadd1fd683c4b64c44 Gerrit-Change-Number: 10017 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 18:02:51 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Mon, 16 Jul 2018 18:02:51 +0000 Subject: Change in osmo-ci[master]: jobs: add pysim.yml Message-ID: lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/10018 Change subject: jobs: add pysim.yml ...................................................................... jobs: add pysim.yml Change-Id: I180cc4a83a41f3ef2e4b1e316ea0371cc83be654 --- A jobs/pysim.yml 1 file changed, 31 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/18/10018/1 diff --git a/jobs/pysim.yml b/jobs/pysim.yml new file mode 100644 index 0000000..df09671 --- /dev/null +++ b/jobs/pysim.yml @@ -0,0 +1,31 @@ +--- +- project: + name: pysim + jobs: + - pysim-hardware-test + +- job-template: + name: 'pysim-hardware-test' + project-type: freestyle + defaults: global + description: 'Generated by job-builder' + node: simtester + builders: + - shell: | + virtualenv -p python2 venv + . venv/bin/activate + pip install pyscard pytlv + ./tests/pysim-test.sh + + scm: + - git: + url: git://git.osmocom.org/pysim + git-config-name: 'Jenkins Builder' + git-config-email: 'jenkins at osmocom.org' + branches: + - pmaier/simtest + + triggers: + - timed: "@midnight" + +# vim: expandtab tabstop=2 shiftwidth=2 -- To view, visit https://gerrit.osmocom.org/10018 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I180cc4a83a41f3ef2e4b1e316ea0371cc83be654 Gerrit-Change-Number: 10018 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 18:14:35 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 18:14:35 +0000 Subject: Change in osmo-ci[master]: jobs: add pysim.yml In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10018 ) Change subject: jobs: add pysim.yml ...................................................................... Patch Set 1: as just mentioned on jabber: When installing the "python-pyscard" debian package, we can deal without locally building it via pip (and hence save any build deps like build-essential,...) -- To view, visit https://gerrit.osmocom.org/10018 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I180cc4a83a41f3ef2e4b1e316ea0371cc83be654 Gerrit-Change-Number: 10018 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus Gerrit-CC: Harald Welte Gerrit-Comment-Date: Mon, 16 Jul 2018 18:14:35 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 18:14:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 18:14:54 +0000 Subject: Change in osmo-ci[master]: ansible: osmocom-jenkins-slave: add variables to the README.md In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10013 ) Change subject: ansible: osmocom-jenkins-slave: add variables to the README.md ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10013 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I878ed30ee2f44d98635511011c17f0f0e986bcc9 Gerrit-Change-Number: 10013 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Mon, 16 Jul 2018 18:14:54 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 18:15:40 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 18:15:40 +0000 Subject: Change in osmo-ci[master]: ansible: osmocom-jenkins-slave: debian.yml: don't install recommends In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10015 ) Change subject: ansible: osmocom-jenkins-slave: debian.yml: don't install recommends ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10015 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I894455ea779ece84c403f768a1260a1cf2528389 Gerrit-Change-Number: 10015 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Mon, 16 Jul 2018 18:15:40 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 18:16:23 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Mon, 16 Jul 2018 18:16:23 +0000 Subject: Change in osmo-ci[master]: ansible: add playbook setup-simtest In-Reply-To: References: Message-ID: lynxis lazus has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/10017 ) Change subject: ansible: add playbook setup-simtest ...................................................................... ansible: add playbook setup-simtest Change-Id: Iab74a2b3fc3148bce815b2dadd1fd683c4b64c44 --- M ansible/hosts A ansible/setup-simtest.yml 2 files changed, 34 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/17/10017/2 -- To view, visit https://gerrit.osmocom.org/10017 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iab74a2b3fc3148bce815b2dadd1fd683c4b64c44 Gerrit-Change-Number: 10017 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 18:16:23 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Mon, 16 Jul 2018 18:16:23 +0000 Subject: Change in osmo-ci[master]: jobs: add pysim.yml In-Reply-To: References: Message-ID: lynxis lazus has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/10018 ) Change subject: jobs: add pysim.yml ...................................................................... jobs: add pysim.yml Change-Id: I180cc4a83a41f3ef2e4b1e316ea0371cc83be654 --- A jobs/pysim.yml 1 file changed, 31 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/18/10018/2 -- To view, visit https://gerrit.osmocom.org/10018 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I180cc4a83a41f3ef2e4b1e316ea0371cc83be654 Gerrit-Change-Number: 10018 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus Gerrit-CC: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 18:16:25 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 18:16:25 +0000 Subject: Change in osmo-ci[master]: ansible: osmocom-jenkins-slave: add var install_jenkins_utilities In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10016 ) Change subject: ansible: osmocom-jenkins-slave: add var install_jenkins_utilities ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10016 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I72f4460b8550da191e74a44be0ee3eeb3b2d7769 Gerrit-Change-Number: 10016 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Mon, 16 Jul 2018 18:16:25 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 18:22:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 18:22:36 +0000 Subject: Change in gapk[master]: Make RTP payload type configurable In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9928 ) Change subject: Make RTP payload type configurable ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9928 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gapk Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia07ed4e13b4a70c8bb4181564a8190861fd269da Gerrit-Change-Number: 9928 Gerrit-PatchSet: 4 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 16 Jul 2018 18:22:36 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 18:23:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 18:23:22 +0000 Subject: Change in gapk[master]: build: fix packaging problems and make distcheck happy In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9930 ) Change subject: build: fix packaging problems and make distcheck happy ...................................................................... Patch Set 1: I'll let pespin fight it out with fixeria ;) -- To view, visit https://gerrit.osmocom.org/9930 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gapk Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ieb8f6a2a81f9b75c8c6c5db443b0e7be02bc4153 Gerrit-Change-Number: 9930 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: Harald Welte Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Mon, 16 Jul 2018 18:23:22 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 18:34:10 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 16 Jul 2018 18:34:10 +0000 Subject: Change in gapk[master]: build: fix packaging problems and make distcheck happy In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9930 ) Change subject: build: fix packaging problems and make distcheck happy ...................................................................... Patch Set 1: (4 comments) No fight today, fine for me :-) Maybe only check the new comment I added about clean-local vs distclean-local. https://gerrit.osmocom.org/#/c/9930/1/libgsmhr/Makefile.am File libgsmhr/Makefile.am: https://gerrit.osmocom.org/#/c/9930/1/libgsmhr/Makefile.am at 15 PS1, Line 15: $(srcdir)/fetch_sources.py "${REFSRC_PATH}" > Hmm, in libosmocore we use exactly 'srcdir'... [?] I would not use *_PYTHON stuff as that seems more related to python stuff you want to install and not use at build time. Fine to keep srcdir if it works. https://gerrit.osmocom.org/#/c/9930/1/libgsmhr/Makefile.am at 31 PS1, Line 31: -rm -rf ${REFSRC_PATH}/ Why is distclean-local different than clean-local? https://gerrit.osmocom.org/#/c/9930/1/tests/Makefile.am File tests/Makefile.am: https://gerrit.osmocom.org/#/c/9930/1/tests/Makefile.am at 82 PS1, Line 82: ref-files \ > For some reason, having 'dir/' breaks the build... [?] Ugh, ok, no idea. https://gerrit.osmocom.org/#/c/9930/1/tests/testsuite.at File tests/testsuite.at: https://gerrit.osmocom.org/#/c/9930/1/tests/testsuite.at at 15 PS1, Line 15: $abs_srcdir/io/io_sample.txt], > There is EXTRA_DIST definition in tests/Makefile.am. Ah too bad sorry, I confused this file with the makefile.am one :) -- To view, visit https://gerrit.osmocom.org/9930 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gapk Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ieb8f6a2a81f9b75c8c6c5db443b0e7be02bc4153 Gerrit-Change-Number: 9930 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: Harald Welte Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Mon, 16 Jul 2018 18:34:10 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 19:09:22 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 16 Jul 2018 19:09:22 +0000 Subject: Change in gapk[master]: build: fix packaging problems and make distcheck happy In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/9930 ) Change subject: build: fix packaging problems and make distcheck happy ...................................................................... Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/9930/1/libgsmhr/Makefile.am File libgsmhr/Makefile.am: https://gerrit.osmocom.org/#/c/9930/1/libgsmhr/Makefile.am at 31 PS1, Line 31: -rm -rf ${REFSRC_PATH}/ > Why is distclean-local different than clean-local? Here I am also following the way of libosmocore, introduced by Neels some time ago ;) So, `make distclean` removes all downloaded files, otherwise they would remain there even if the build is reconfigured without libgsmhr. -- To view, visit https://gerrit.osmocom.org/9930 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gapk Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ieb8f6a2a81f9b75c8c6c5db443b0e7be02bc4153 Gerrit-Change-Number: 9930 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: Harald Welte Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Mon, 16 Jul 2018 19:09:22 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 19:18:02 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 16 Jul 2018 19:18:02 +0000 Subject: Change in gapk[master]: build: fix packaging problems and make distcheck happy In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9930 ) Change subject: build: fix packaging problems and make distcheck happy ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9930 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gapk Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ieb8f6a2a81f9b75c8c6c5db443b0e7be02bc4153 Gerrit-Change-Number: 9930 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: Harald Welte Gerrit-Comment-Date: Mon, 16 Jul 2018 19:18:02 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 19:55:10 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 16 Jul 2018 19:55:10 +0000 Subject: Change in osmo-sgsn[master]: sgsn: gtp: Avoid leaking pdp ctx in libgtp Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10019 Change subject: sgsn: gtp: Avoid leaking pdp ctx in libgtp ...................................................................... sgsn: gtp: Avoid leaking pdp ctx in libgtp Nowadays sgsn_pdp_ctx_free() takes care of freeing the underlaying gtp object if available. Don't bypass this check, as libgtp sgsn_pdp_ctx_free() doesn't free the pdp ctx obj after the osmo-sgsn cb_conf callback is called, so it needs to be freed with pdp_freepdp. Change-Id: I304c59de5d137b81de3c6df0fdbe911ae3dbd1f3 --- M src/gprs/sgsn_libgtp.c 1 file changed, 0 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/19/10019/1 diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 659392e..6d5b9df 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -566,10 +566,6 @@ "is not available\n"); } - /* unlink the now non-existing library handle from the pdp - * context */ - pctx->lib = NULL; - sgsn_pdp_ctx_free(pctx); return rc; -- To view, visit https://gerrit.osmocom.org/10019 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I304c59de5d137b81de3c6df0fdbe911ae3dbd1f3 Gerrit-Change-Number: 10019 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 20:05:05 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 16 Jul 2018 20:05:05 +0000 Subject: Change in gapk[master]: build: fix packaging problems and make distcheck happy In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. ( https://gerrit.osmocom.org/9930 ) Change subject: build: fix packaging problems and make distcheck happy ...................................................................... build: fix packaging problems and make distcheck happy The 'distcheck' rule performs all of the operations associated with packaging a distribution and verifying that the distribution works. There were several problems: - libgsmhr/Makefile.am: 'patches' dir was not listed in EXTRA_DIST - libgsmhr/Makefile.am: (dist)clean targets wan't defined properly - tests/Makefile.am: 'ref-files' dir was not listed in EXTRA_DIST - tests/testsuite.at: wrong path was used for io_sample.txt Change-Id: Ieb8f6a2a81f9b75c8c6c5db443b0e7be02bc4153 --- M libgsmhr/Makefile.am M tests/Makefile.am M tests/testsuite.at 3 files changed, 10 insertions(+), 4 deletions(-) Approvals: Jenkins Builder: Verified Vadim Yanitskiy: Looks good to me, but someone else must approve Pau Espin Pedrol: Looks good to me, approved diff --git a/libgsmhr/Makefile.am b/libgsmhr/Makefile.am index e6d246d..f36d759 100644 --- a/libgsmhr/Makefile.am +++ b/libgsmhr/Makefile.am @@ -1,7 +1,10 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir) AM_CFLAGS = -fPIC -Wall ${SYMBOL_VISIBILITY} -EXTRA_DIST=fetch_sources.py +EXTRA_DIST = \ + fetch_sources.py \ + patches \ + $(NULL) LIBVERSION=0:0:0 @@ -22,4 +25,7 @@ libgsmhr_la_LIBADD = -ldl clean-local: - -rm -rf ${REFSRC_PATH}/*.{c,h} ${REFSRC_PATH}/.downloaded + -rm -rf ${REFSRC_PATH}/*.lo + +distclean-local: + -rm -rf ${REFSRC_PATH}/ diff --git a/tests/Makefile.am b/tests/Makefile.am index 4f7c4be..dee4060 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -79,7 +79,7 @@ io/pq_file_test.ok \ io/pq_rtp_test.ok \ io/io_sample.txt \ - ref-files/* \ + ref-files \ $(NULL) DISTCLEANFILES = atconfig atlocal diff --git a/tests/testsuite.at b/tests/testsuite.at index 5946661..1edd077 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -12,7 +12,7 @@ cat $abs_srcdir/io/pq_file_test.ok > expout AT_CHECK([ $abs_top_builddir/tests/io/pq_file_test \ - $abs_top_builddir/tests/io/io_sample.txt], + $abs_srcdir/io/io_sample.txt], [0], [expout]) AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/9930 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gapk Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ieb8f6a2a81f9b75c8c6c5db443b0e7be02bc4153 Gerrit-Change-Number: 9930 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 20:05:07 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 16 Jul 2018 20:05:07 +0000 Subject: Change in gapk[master]: Make RTP payload type configurable In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. ( https://gerrit.osmocom.org/9928 ) Change subject: Make RTP payload type configurable ...................................................................... Make RTP payload type configurable For a long time the RTP payload type was hard-coded for outgoing frames. The problem is that according to RFC 3551 only GSM FR has a static payload type value (see table 4, value 3). For other codecs the payload type may be negotiated between the both sides dynamically (i.e. in range 96-127). Let's allow a binary/API user to configure this manually. Change-Id: Ia07ed4e13b4a70c8bb4181564a8190861fd269da Closes: OS#2482 --- M include/osmocom/gapk/procqueue.h M src/app_osmo_gapk.c M src/pq_rtp.c M tests/io/pq_rtp_test.c 4 files changed, 64 insertions(+), 18 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmocom/gapk/procqueue.h b/include/osmocom/gapk/procqueue.h index ac9253b..82c1cf9 100644 --- a/include/osmocom/gapk/procqueue.h +++ b/include/osmocom/gapk/procqueue.h @@ -89,8 +89,10 @@ int osmo_gapk_pq_queue_file_output(struct osmo_gapk_pq *pq, FILE *dst, unsigned int block_len); /* RTP */ -int osmo_gapk_pq_queue_rtp_input(struct osmo_gapk_pq *pq, int rtp_fd, unsigned int block_len); -int osmo_gapk_pq_queue_rtp_output(struct osmo_gapk_pq *pq, int rtp_fd, unsigned int block_len); +int osmo_gapk_pq_queue_rtp_input(struct osmo_gapk_pq *pq, int rtp_fd, + unsigned int block_len, uint8_t pt); +int osmo_gapk_pq_queue_rtp_output(struct osmo_gapk_pq *pq, int rtp_fd, + unsigned int block_len, uint8_t pt); /* ALSA */ int osmo_gapk_pq_queue_alsa_input(struct osmo_gapk_pq *pq, const char *hwdev, unsigned int blk_len); diff --git a/src/app_osmo_gapk.c b/src/app_osmo_gapk.c index a4b93ef..91647ee 100644 --- a/src/app_osmo_gapk.c +++ b/src/app_osmo_gapk.c @@ -64,6 +64,9 @@ const char *alsa_out; const struct osmo_gapk_format_desc *fmt_out; + /* RTP payload type */ + uint8_t rtp_pt_in, rtp_pt_out; + int benchmark; int verbose; }; @@ -133,6 +136,8 @@ #endif fprintf(stdout, " -f, --input-format=FMT\tInput format (see below)\n"); fprintf(stdout, " -g, --output-format=FMT\tOutput format (see below)\n"); + fprintf(stdout, " -p --rtp-pt-in=TYPE\t\tRTP payload type for incoming frames\n"); + fprintf(stdout, " -P --rtp-pt-out=TYPE\t\tRTP payload type for outgoing frames\n"); fprintf(stdout, " -b, --enable-benchmark\tEnable codec benchmarking\n"); fprintf(stdout, " -v, --verbose\t\t\tEnable debug messages\n"); fprintf(stdout, "\n"); @@ -203,11 +208,13 @@ #endif {"input-format", 1, 0, 'f'}, {"output-format", 1, 0, 'g'}, + {"rtp-pt-in", 1, 0, 'p'}, + {"rtp-pt-out", 1, 0, 'P'}, {"enable-benchmark", 0, 0, 'b'}, {"verbose", 0, 0, 'v'}, {"help", 0, 0, 'h'}, }; - const char *short_options = "i:o:I:O:f:g:bvh" + const char *short_options = "i:o:I:O:f:g:p:P:bvh" #ifdef HAVE_ALSA "a:A:" #endif @@ -218,6 +225,10 @@ /* Set some defaults */ memset(opt, 0x00, sizeof(*opt)); + /* Default RTP payload type (GSM FR, see RFC 3551) */ + opt->rtp_pt_in = 3; + opt->rtp_pt_out = 3; + /* Parse */ while (1) { int c, rv; @@ -279,6 +290,24 @@ } break; + case 'p': + rv = atoi(optarg); + if (rv < 0 || rv > 0xff) { + LOGP(DAPP, LOGL_ERROR, "Invalid RTP payload type: %d\n", rv); + return -EINVAL; + } + opt->rtp_pt_in = rv; + break; + + case 'P': + rv = atoi(optarg); + if (rv < 0 || rv > 0xff) { + LOGP(DAPP, LOGL_ERROR, "Invalid RTP payload type: %d\n", rv); + return -EINVAL; + } + opt->rtp_pt_out = rv; + break; + case 'b': opt->benchmark = 1; break; @@ -540,7 +569,8 @@ if (gs->in.file.fh) osmo_gapk_pq_queue_file_input(gs->pq, gs->in.file.fh, fmt_in->frame_len); else if (gs->in.rtp.fd != -1) - osmo_gapk_pq_queue_rtp_input(gs->pq, gs->in.rtp.fd, fmt_in->frame_len); + osmo_gapk_pq_queue_rtp_input(gs->pq, gs->in.rtp.fd, + fmt_in->frame_len, gs->opts.rtp_pt_in); #ifdef HAVE_ALSA else if (gs->opts.alsa_in) osmo_gapk_pq_queue_alsa_input(gs->pq, gs->opts.alsa_in, fmt_in->frame_len); @@ -618,7 +648,8 @@ if (gs->out.file.fh) osmo_gapk_pq_queue_file_output(gs->pq, gs->out.file.fh, fmt_out->frame_len); else if (gs->out.rtp.fd != -1) - osmo_gapk_pq_queue_rtp_output(gs->pq, gs->out.rtp.fd, fmt_out->frame_len); + osmo_gapk_pq_queue_rtp_output(gs->pq, gs->out.rtp.fd, + fmt_out->frame_len, gs->opts.rtp_pt_out); #ifdef HAVE_ALSA else if (gs->opts.alsa_out) osmo_gapk_pq_queue_alsa_output(gs->pq, gs->opts.alsa_out, fmt_out->frame_len); diff --git a/src/pq_rtp.c b/src/pq_rtp.c index a50013a..81eeb19 100644 --- a/src/pq_rtp.c +++ b/src/pq_rtp.c @@ -70,8 +70,6 @@ #define RTP_VERSION 2 -#define RTP_PT_GSM_FULL 3 - struct pq_state_rtp { int fd; int blk_len; @@ -193,7 +191,8 @@ } static int -pq_queue_rtp_op(struct osmo_gapk_pq *pq, int udp_fd, unsigned int blk_len, int in_out_n) +pq_queue_rtp_op(struct osmo_gapk_pq *pq, int udp_fd, + unsigned int blk_len, int in_out_n, uint8_t pt) { struct osmo_gapk_pq_item *item; struct pq_state_rtp *state; @@ -210,12 +209,20 @@ * per RTP frame */ state->duration = 160; + /** + * RTP payload type according to RFC 3551, + * section "6. Payload Type Definitions". + * + * Only GSM FR has a static payload type value (see table 4). + * For other codecs the payload type may be negotiated + * between the both sides dynamically (i.e. in range 96-127). + */ + state->payload_type = pt; + if (in_out_n == 0) { state->ssrc = rand(); state->sequence = random(); state->timestamp = random(); - /* FIXME: other payload types!! */ - state->payload_type = RTP_PT_GSM_FULL; } item = osmo_gapk_pq_add_item(pq); @@ -248,24 +255,30 @@ * This typically only makes sense as first item in the queue * \param pq Processing Queue to add this RTP input to * \param[in] udp_fd UDP file descriptor for the RTP input - * \param[in] blk_len Block Length to read from RTP */ + * \param[in] blk_len Block Length to read from RTP + * \param[in] pt Payload type according to RFC 3551 + */ int -osmo_gapk_pq_queue_rtp_input(struct osmo_gapk_pq *pq, int udp_fd, unsigned int blk_len) +osmo_gapk_pq_queue_rtp_input(struct osmo_gapk_pq *pq, int udp_fd, + unsigned int blk_len, uint8_t pt) { LOGPGAPK(LOGL_DEBUG, "PQ '%s': Adding RTP input (blk_len=%u)\n", pq->name, blk_len); - return pq_queue_rtp_op(pq, udp_fd, blk_len, 1); + return pq_queue_rtp_op(pq, udp_fd, blk_len, 1, pt); } /*! Add RTP output to processing queue. * This typically only makes sense as last item in the queue * \param pq Processing Queue to add this RTP output to * \param[in] udp_fd UDP file descriptor for the RTP output - * \param[in] blk_len Block Length to read from RTP */ + * \param[in] blk_len Block Length to read from RTP + * \param[in] pt Payload type according to RFC 3551 + */ int -osmo_gapk_pq_queue_rtp_output(struct osmo_gapk_pq *pq, int udp_fd, unsigned int blk_len) +osmo_gapk_pq_queue_rtp_output(struct osmo_gapk_pq *pq, int udp_fd, + unsigned int blk_len, uint8_t pt) { LOGPGAPK(LOGL_DEBUG, "PQ '%s': Adding RTP output (blk_len=%u)\n", pq->name, blk_len); - return pq_queue_rtp_op(pq, udp_fd, blk_len, 0); + return pq_queue_rtp_op(pq, udp_fd, blk_len, 0, pt); } diff --git a/tests/io/pq_rtp_test.c b/tests/io/pq_rtp_test.c index 2c1bd41..76f59d2 100644 --- a/tests/io/pq_rtp_test.c +++ b/tests/io/pq_rtp_test.c @@ -173,7 +173,7 @@ } /* Init an RTP sink */ - rc = osmo_gapk_pq_queue_rtp_output(pq, state->rtp_dst_fd, payload_len); + rc = osmo_gapk_pq_queue_rtp_output(pq, state->rtp_dst_fd, payload_len, 0x00); if (rc) { printf("Could not init an RTP sink\n"); return rc; @@ -210,7 +210,7 @@ } /* Init an RTP source on any available port */ - rc = osmo_gapk_pq_queue_rtp_input(pq, state->rtp_src_fd, payload_len); + rc = osmo_gapk_pq_queue_rtp_input(pq, state->rtp_src_fd, payload_len, 0x00); if (rc) { printf("Could not init an RTP sink\n"); return rc; -- To view, visit https://gerrit.osmocom.org/9928 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gapk Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ia07ed4e13b4a70c8bb4181564a8190861fd269da Gerrit-Change-Number: 9928 Gerrit-PatchSet: 4 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Mon Jul 16 20:06:58 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Mon, 16 Jul 2018 20:06:58 +0000 (UTC) Subject: =?UTF-8?Q?Jenkins_build_is_back_to_normal_:_master-gapk_=C2=BB_a1=3Dde?= =?UTF-8?Q?fault,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#23?= In-Reply-To: <2018024132.201.1531744007975.JavaMail.jenkins@jenkins.osmocom.org> References: <2018024132.201.1531744007975.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <233398808.203.1531771618484.JavaMail.jenkins@jenkins.osmocom.org> See From gerrit-no-reply at lists.osmocom.org Mon Jul 16 20:54:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 16 Jul 2018 20:54:54 +0000 Subject: Change in osmo-ggsn[master]: gtp: Avoid freeing pdp contexts during DEL CTX REQ In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10006 ) Change subject: gtp: Avoid freeing pdp contexts during DEL CTX REQ ...................................................................... Patch Set 1: Code-Review-1 I'm not entirely happy about this, as it introudces a huge semantic break of the API/ABI. This means that old users of libgtp will still compile + link fine against new libtp, but then at runtime fail in strange ways during PDP DEL CTX REQ. This is quite different from "syntactic" API breakage which will make compilation of old apps against new library fail. We can also not resolve this with libversion, IMHO. Please try to consider this and come up with a solution that will (preferably) make old apps still compile against new libgtp versions, or (if really neccessary) make such old applications break when attempting to compile against new libgtp. -- To view, visit https://gerrit.osmocom.org/10006 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I29d366253bb98dcba328c7ce8aa3e4daf8f75e6c Gerrit-Change-Number: 10006 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 16 Jul 2018 20:54:54 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 22:05:38 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 16 Jul 2018 22:05:38 +0000 Subject: Change in osmocom-bb[master]: Revert "Move from libc random() to osmo_get_rand_id" Message-ID: Hello Jenkins Builder, Holger Freyther, I'd like you to do a code review. Please visit https://gerrit.osmocom.org/10020 to review the following change. Change subject: Revert "Move from libc random() to osmo_get_rand_id" ...................................................................... Revert "Move from libc random() to osmo_get_rand_id" It was decided to migrate to osmo_get_rand_id() and use random() as a fall-back. But there is a critical difference between both functions: osmo_get_rand_id() fills an input buffer with random bytes (0x00 - 0xff), while *random() returns a value in range between 0 and RAND_MAX. osmo_get_rand_id() was used in a wrong way, so in some cases we could get a negative value (how about IMEI starting from '-'?), what isn't expected in many cases and could lead to unexpected behaviour and segmentation faults... This reverts commit 6d49b049ee304f1ea0e4801df61e69713b01f0f8. Change-Id: I7b2a8a5c63cf64360a824926a2219fd7e419b1bb --- M src/host/layer23/src/mobile/gsm322.c M src/host/layer23/src/mobile/gsm48_mm.c M src/host/layer23/src/mobile/gsm48_rr.c M src/host/layer23/src/mobile/settings.c 4 files changed, 5 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/20/10020/1 diff --git a/src/host/layer23/src/mobile/gsm322.c b/src/host/layer23/src/mobile/gsm322.c index ce25cd5..c3485b6 100644 --- a/src/host/layer23/src/mobile/gsm322.c +++ b/src/host/layer23/src/mobile/gsm322.c @@ -959,9 +959,7 @@ entries++; } while(entries) { - if (osmo_get_rand_id((uint8_t *) &move, sizeof(move)) != 0) - move = random(); - move = move % entries; + move = random() % entries; i = 0; llist_for_each_entry(temp, &temp_list, entry) { if (rxlev2dbm(temp->rxlev) > -85) { diff --git a/src/host/layer23/src/mobile/gsm48_mm.c b/src/host/layer23/src/mobile/gsm48_mm.c index a36e7e8..a7af1f5 100644 --- a/src/host/layer23/src/mobile/gsm48_mm.c +++ b/src/host/layer23/src/mobile/gsm48_mm.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include @@ -2100,9 +2099,7 @@ mm->t3212.timeout.tv_sec = current_time.tv_sec + (t % s->t3212); } else { - uint32_t rand; - if (osmo_get_rand_id((uint8_t *) &rand, sizeof(rand)) != 0) - rand = random(); + uint32_t rand = random(); LOGP(DMM, LOGL_INFO, "New T3212 while timer is not " "running (value %d)\n", s->t3212); diff --git a/src/host/layer23/src/mobile/gsm48_rr.c b/src/host/layer23/src/mobile/gsm48_rr.c index db2cb5e..dd3fe93 100644 --- a/src/host/layer23/src/mobile/gsm48_rr.c +++ b/src/host/layer23/src/mobile/gsm48_rr.c @@ -71,7 +71,6 @@ #include #include #include -#include #include #include @@ -1629,8 +1628,7 @@ } } - if (osmo_get_rand_id((uint8_t *) &chan_req, sizeof(chan_req)) != 0) - chan_req = random(); + chan_req = random(); chan_req &= rr->chan_req_mask; chan_req |= rr->chan_req_val; diff --git a/src/host/layer23/src/mobile/settings.c b/src/host/layer23/src/mobile/settings.c index 80b0b48..7370b0a 100644 --- a/src/host/layer23/src/mobile/settings.c +++ b/src/host/layer23/src/mobile/settings.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include @@ -179,19 +178,14 @@ { int digits = set->imei_random; char rand[16]; - long rand_num; if (digits <= 0) return 0; if (digits > 15) digits = 15; - if (osmo_get_rand_id((uint8_t *) &rand_num, sizeof(rand_num)) != 0) - rand_num = random(); - sprintf(rand, "%08ld", rand_num % 100000000); - if (osmo_get_rand_id((uint8_t *) &rand_num, sizeof(rand_num)) != 0) - rand_num = random(); - sprintf(rand + 8, "%07ld", rand_num % 10000000); + sprintf(rand, "%08ld", random() % 100000000); + sprintf(rand + 8, "%07ld", random() % 10000000); strcpy(set->imei + 15 - digits, rand + 15 - digits); strncpy(set->imeisv, set->imei, 15); -- To view, visit https://gerrit.osmocom.org/10020 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I7b2a8a5c63cf64360a824926a2219fd7e419b1bb Gerrit-Change-Number: 10020 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 22:05:39 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 16 Jul 2018 22:05:39 +0000 Subject: Change in osmocom-bb[master]: Move from libc random() to osmo_get_rand_id In-Reply-To: References: Message-ID: Vadim Yanitskiy has reverted this change. ( https://gerrit.osmocom.org/9914 ) Change subject: Move from libc random() to osmo_get_rand_id ...................................................................... -- To view, visit https://gerrit.osmocom.org/9914 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: revert Gerrit-Change-Id: Ie0cc64663cd4b90c027b79545dc5d3ac9d87b9dd Gerrit-Change-Number: 9914 Gerrit-PatchSet: 3 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 22:18:25 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 16 Jul 2018 22:18:25 +0000 Subject: Change in osmocom-bb[master]: mobile: use osmo_init_logging2 with proper talloc context Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/10021 Change subject: mobile: use osmo_init_logging2 with proper talloc context ...................................................................... mobile: use osmo_init_logging2 with proper talloc context Change-Id: I231ac9987ff3c13fafcd272b7d9aae3938ab5972 --- M src/host/layer23/src/mobile/main.c 1 file changed, 5 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/21/10021/1 diff --git a/src/host/layer23/src/mobile/main.c b/src/host/layer23/src/mobile/main.c index 5a28be8..115ac41 100644 --- a/src/host/layer23/src/mobile/main.c +++ b/src/host/layer23/src/mobile/main.c @@ -46,8 +46,6 @@ #include #include -struct log_target *stderr_target; - void *l23_ctx = NULL; struct llist_head ms_list; static char *gsmtap_ip = 0; @@ -55,7 +53,6 @@ struct gsmtap_inst *gsmtap_inst = NULL; static char *vty_ip = "127.0.0.1"; unsigned short vty_port = 4247; -int debug_set = 0; char *config_dir = NULL; int use_mncc_sock = 0; int daemonize = 0; @@ -142,8 +139,7 @@ vty_port = atoi(optarg); break; case 'd': - log_parse_category_mask(stderr_target, optarg); - debug_set = 1; + log_parse_category_mask(osmo_stderr_target, optarg); break; case 'D': daemonize = 1; @@ -214,20 +210,15 @@ srand(time(NULL)); INIT_LLIST_HEAD(&ms_list); - log_init(&log_info, NULL); - stderr_target = log_target_create_stderr(); - log_add_target(stderr_target); - log_set_all_filter(stderr_target, 1); l23_ctx = talloc_named_const(NULL, 1, "layer2 context"); /* TODO: measure and choose a proper pool size */ msgb_talloc_ctx_init(l23_ctx, 0); - handle_options(argc, argv); + /* Init default stderr logging */ + osmo_init_logging2(l23_ctx, &log_info); - if (!debug_set) - log_parse_category_mask(stderr_target, debug_default); - log_set_log_level(stderr_target, LOGL_DEBUG); + handle_options(argc, argv); if (gsmtap_ip) { gsmtap_inst = gsmtap_source_init(gsmtap_ip, GSMTAP_UDP_PORT, 1); @@ -287,6 +278,7 @@ } l23_app_exit(); + log_fini(); talloc_free(config_file); talloc_free(config_dir); -- To view, visit https://gerrit.osmocom.org/10021 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I231ac9987ff3c13fafcd272b7d9aae3938ab5972 Gerrit-Change-Number: 10021 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 16 23:36:45 2018 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 16 Jul 2018 23:36:45 +0000 Subject: Change in osmocom-bb[master]: Revert "Move from libc random() to osmo_get_rand_id" In-Reply-To: References: Message-ID: Holger Freyther has posted comments on this change. ( https://gerrit.osmocom.org/10020 ) Change subject: Revert "Move from libc random() to osmo_get_rand_id" ...................................................................... Patch Set 2: Code-Review+2 This is something I didn't consider. What's the bigger picture is that if we don't want negative numbers. We shouldn't store the result in a signed variable. But it might be easier to to just & ~0x7F...and return ints from 0 to ... N. Feel free to push the revert and I will try to have a timely fix. -- To view, visit https://gerrit.osmocom.org/10020 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7b2a8a5c63cf64360a824926a2219fd7e419b1bb Gerrit-Change-Number: 10020 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 16 Jul 2018 23:36:45 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 07:46:19 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 17 Jul 2018 07:46:19 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_ConnectionHandler: more verbosity for f_check_mgcp_expectations() In-Reply-To: References: Message-ID: dexter has posted comments on this change. ( https://gerrit.osmocom.org/10004 ) Change subject: MSC_ConnectionHandler: more verbosity for f_check_mgcp_expectations() ...................................................................... Patch Set 1: yes, the argument its a bit ugly and I have removed it now. I now use testcasename(). Unfortunately there is no callername() or something. I have checked the quick-reference. -- To view, visit https://gerrit.osmocom.org/10004 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ida0eba4ef3c1db977d392267ef76ec37b87133b3 Gerrit-Change-Number: 10004 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-Comment-Date: Tue, 17 Jul 2018 07:46:19 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 07:47:36 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 17 Jul 2018 07:47:36 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_ConnectionHandler: expect additional MDCX when call is LCLS In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10005 to look at the new patch set (#2). Change subject: MSC_ConnectionHandler: expect additional MDCX when call is LCLS ...................................................................... MSC_ConnectionHandler: expect additional MDCX when call is LCLS The function f_establish_f_establish_fully does not yet handle the case where calls get switched locally. In those cases we expect to see one additional MDCX before the BSSMAP ASSIGNMENT COMPLETE is sent. - Check exp_ass_cpl if the call is expected to be LCLS and expect another MDCX for those cases. Change-Id: I55fae5ab03980cd810ed7dc38208550686b1659e Related: OS#3292 --- M bsc/MSC_ConnectionHandler.ttcn 1 file changed, 12 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/05/10005/2 -- To view, visit https://gerrit.osmocom.org/10005 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I55fae5ab03980cd810ed7dc38208550686b1659e Gerrit-Change-Number: 10005 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 07:47:36 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 17 Jul 2018 07:47:36 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_ConnectionHandler: more verbosity for f_check_mgcp_expectations() In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10004 to look at the new patch set (#2). Change subject: MSC_ConnectionHandler: more verbosity for f_check_mgcp_expectations() ...................................................................... MSC_ConnectionHandler: more verbosity for f_check_mgcp_expectations() The function f_check_mgcp_expectations() checks the counters that count the occurrence of MDCX and CRCX messages against computed expected values. At the moment it is not easy to spot where exactly the deviation occurred. Lets add some log output so that we can see which type of message on which connection was missing or too much. Also add a string parameter that is set to the calling functions name so that we know from where the check has been triggered. - Add more verbose log output for counters - Add parameter to prepend to the log line Change-Id: Ida0eba4ef3c1db977d392267ef76ec37b87133b3 Related: OS#3292 --- M bsc/MSC_ConnectionHandler.ttcn 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/04/10004/2 -- To view, visit https://gerrit.osmocom.org/10004 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ida0eba4ef3c1db977d392267ef76ec37b87133b3 Gerrit-Change-Number: 10004 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 09:29:11 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 17 Jul 2018 09:29:11 +0000 Subject: Change in osmo-bsc[master]: codec_pref: move match_codec_pref() to separate c-file and add unit-test In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10010 to look at the new patch set (#3). Change subject: codec_pref: move match_codec_pref() to separate c-file and add unit-test ...................................................................... codec_pref: move match_codec_pref() to separate c-file and add unit-test At the moment there are three sources that may advertise a list of supported audio codec/rate settings. There is the MS that advertises advertises a speech codec list and the MSC that sends a channel type information element over A and there are also settings in the bsc configuration file that may restrict the codec/rate types that are allowed to use. The function match_codec_pref() looks at all of the three buckets and selects a codec that satisfies all three. This is already a somewhat complicated process, overit is very isolated, so lets give it its own c-file. Due to the lack of unit-tests it is very hard to make changes here so lets add also unit-test to make sure that regressions are catched early. - Put match_codec_pref() and all its helper functions into a separate c-file. - Add a unit test. Change-Id: Iabedfdcec8b99a319f2d57cbea45c5e36c7b6e29 Related: OS#3361 --- M configure.ac M include/osmocom/bsc/Makefile.am A include/osmocom/bsc/codec_pref.h M src/osmo-bsc/Makefile.am A src/osmo-bsc/codec_pref.c M src/osmo-bsc/osmo_bsc_bssap.c M tests/Makefile.am A tests/codec_pref/Makefile.am A tests/codec_pref/codec_pref_test.c A tests/codec_pref/codec_pref_test.ok M tests/testsuite.at 11 files changed, 1,429 insertions(+), 160 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/10/10010/3 -- To view, visit https://gerrit.osmocom.org/10010 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iabedfdcec8b99a319f2d57cbea45c5e36c7b6e29 Gerrit-Change-Number: 10010 Gerrit-PatchSet: 3 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 09:37:48 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 17 Jul 2018 09:37:48 +0000 Subject: Change in osmo-bsc[master]: codec_pref: move match_codec_pref() to separate c-file and add unit-test In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10010 to look at the new patch set (#4). Change subject: codec_pref: move match_codec_pref() to separate c-file and add unit-test ...................................................................... codec_pref: move match_codec_pref() to separate c-file and add unit-test At the moment there are three sources that may advertise a list of supported audio codec/rate settings. There is the MS that advertises advertises a speech codec list and the MSC that sends a channel type information element over A and there are also settings in the bsc configuration file that may restrict the codec/rate types that are allowed to use. The function match_codec_pref() looks at all of the three buckets and selects a codec that satisfies all three. This is already a somewhat complicated process, overit is very isolated, so lets give it its own c-file. Due to the lack of unit-tests it is very hard to make changes here so lets add also unit-test to make sure that regressions are catched early. - Put match_codec_pref() and all its helper functions into a separate c-file. - Add a unit test. Change-Id: Iabedfdcec8b99a319f2d57cbea45c5e36c7b6e29 Related: OS#3361 --- M configure.ac M include/osmocom/bsc/Makefile.am A include/osmocom/bsc/codec_pref.h M src/osmo-bsc/Makefile.am A src/osmo-bsc/codec_pref.c M src/osmo-bsc/osmo_bsc_bssap.c M tests/Makefile.am A tests/codec_pref/Makefile.am A tests/codec_pref/codec_pref_test.c A tests/codec_pref/codec_pref_test.ok M tests/testsuite.at 11 files changed, 1,430 insertions(+), 160 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/10/10010/4 -- To view, visit https://gerrit.osmocom.org/10010 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iabedfdcec8b99a319f2d57cbea45c5e36c7b6e29 Gerrit-Change-Number: 10010 Gerrit-PatchSet: 4 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 09:42:25 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 17 Jul 2018 09:42:25 +0000 Subject: Change in osmo-bsc[master]: codec_pref: move match_codec_pref() to separate c-file and add unit-test In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10010 to look at the new patch set (#5). Change subject: codec_pref: move match_codec_pref() to separate c-file and add unit-test ...................................................................... codec_pref: move match_codec_pref() to separate c-file and add unit-test At the moment there are three sources that may advertise a list of supported audio codec/rate settings. There is the MS that advertises advertises a speech codec list and the MSC that sends a channel type information element over A and there are also settings in the bsc configuration file that may restrict the codec/rate types that are allowed to use. The function match_codec_pref() looks at all of the three buckets and selects a codec that satisfies all three. This is already a somewhat complicated process, overit is very isolated, so lets give it its own c-file. Due to the lack of unit-tests it is very hard to make changes here so lets add also unit-test to make sure that regressions are catched early. - Put match_codec_pref() and all its helper functions into a separate c-file. - Add a unit test. Change-Id: Iabedfdcec8b99a319f2d57cbea45c5e36c7b6e29 Related: OS#3361 --- M configure.ac M include/osmocom/bsc/Makefile.am A include/osmocom/bsc/codec_pref.h M src/osmo-bsc/Makefile.am A src/osmo-bsc/codec_pref.c M src/osmo-bsc/osmo_bsc_bssap.c M tests/Makefile.am A tests/codec_pref/Makefile.am A tests/codec_pref/codec_pref_test.c A tests/codec_pref/codec_pref_test.ok M tests/testsuite.at 11 files changed, 1,432 insertions(+), 160 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/10/10010/5 -- To view, visit https://gerrit.osmocom.org/10010 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iabedfdcec8b99a319f2d57cbea45c5e36c7b6e29 Gerrit-Change-Number: 10010 Gerrit-PatchSet: 5 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 09:47:32 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 17 Jul 2018 09:47:32 +0000 Subject: Change in osmo-bsc[master]: codec_pref: move match_codec_pref() to separate c-file and add unit-test In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10010 to look at the new patch set (#6). Change subject: codec_pref: move match_codec_pref() to separate c-file and add unit-test ...................................................................... codec_pref: move match_codec_pref() to separate c-file and add unit-test At the moment there are three sources that may advertise a list of supported audio codec/rate settings. There is the MS that advertises advertises a speech codec list and the MSC that sends a channel type information element over A and there are also settings in the bsc configuration file that may restrict the codec/rate types that are allowed to use. The function match_codec_pref() looks at all of the three buckets and selects a codec that satisfies all three. This is already a somewhat complicated process, overit is very isolated, so lets give it its own c-file. Due to the lack of unit-tests it is very hard to make changes here so lets add also unit-test to make sure that regressions are catched early. - Put match_codec_pref() and all its helper functions into a separate c-file. - Add a unit test. Change-Id: Iabedfdcec8b99a319f2d57cbea45c5e36c7b6e29 Related: OS#3361 --- M configure.ac M include/osmocom/bsc/Makefile.am A include/osmocom/bsc/codec_pref.h M src/osmo-bsc/Makefile.am A src/osmo-bsc/codec_pref.c M src/osmo-bsc/osmo_bsc_bssap.c M tests/Makefile.am A tests/codec_pref/Makefile.am A tests/codec_pref/codec_pref_test.c A tests/codec_pref/codec_pref_test.ok M tests/testsuite.at 11 files changed, 1,432 insertions(+), 160 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/10/10010/6 -- To view, visit https://gerrit.osmocom.org/10010 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iabedfdcec8b99a319f2d57cbea45c5e36c7b6e29 Gerrit-Change-Number: 10010 Gerrit-PatchSet: 6 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 10:03:53 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 17 Jul 2018 10:03:53 +0000 Subject: Change in osmocom-bb[master]: Revert "Move from libc random() to osmo_get_rand_id" In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. ( https://gerrit.osmocom.org/10020 ) Change subject: Revert "Move from libc random() to osmo_get_rand_id" ...................................................................... Revert "Move from libc random() to osmo_get_rand_id" It was decided to migrate to osmo_get_rand_id() and use random() as a fall-back. But there is a critical difference between both functions: osmo_get_rand_id() fills an input buffer with random bytes (0x00 - 0xff), while *random() returns a value in range between 0 and RAND_MAX. osmo_get_rand_id() was used in a wrong way, so in some cases we could get a negative value (how about IMEI starting from '-'?), what isn't expected in many cases and could lead to unexpected behaviour and segmentation faults... This reverts commit 6d49b049ee304f1ea0e4801df61e69713b01f0f8. Change-Id: I7b2a8a5c63cf64360a824926a2219fd7e419b1bb --- M src/host/layer23/src/mobile/gsm322.c M src/host/layer23/src/mobile/gsm48_mm.c M src/host/layer23/src/mobile/gsm48_rr.c M src/host/layer23/src/mobile/settings.c 4 files changed, 5 insertions(+), 18 deletions(-) Approvals: Jenkins Builder: Verified Holger Freyther: Looks good to me, approved diff --git a/src/host/layer23/src/mobile/gsm322.c b/src/host/layer23/src/mobile/gsm322.c index ce25cd5..c3485b6 100644 --- a/src/host/layer23/src/mobile/gsm322.c +++ b/src/host/layer23/src/mobile/gsm322.c @@ -959,9 +959,7 @@ entries++; } while(entries) { - if (osmo_get_rand_id((uint8_t *) &move, sizeof(move)) != 0) - move = random(); - move = move % entries; + move = random() % entries; i = 0; llist_for_each_entry(temp, &temp_list, entry) { if (rxlev2dbm(temp->rxlev) > -85) { diff --git a/src/host/layer23/src/mobile/gsm48_mm.c b/src/host/layer23/src/mobile/gsm48_mm.c index a36e7e8..a7af1f5 100644 --- a/src/host/layer23/src/mobile/gsm48_mm.c +++ b/src/host/layer23/src/mobile/gsm48_mm.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include @@ -2100,9 +2099,7 @@ mm->t3212.timeout.tv_sec = current_time.tv_sec + (t % s->t3212); } else { - uint32_t rand; - if (osmo_get_rand_id((uint8_t *) &rand, sizeof(rand)) != 0) - rand = random(); + uint32_t rand = random(); LOGP(DMM, LOGL_INFO, "New T3212 while timer is not " "running (value %d)\n", s->t3212); diff --git a/src/host/layer23/src/mobile/gsm48_rr.c b/src/host/layer23/src/mobile/gsm48_rr.c index db2cb5e..dd3fe93 100644 --- a/src/host/layer23/src/mobile/gsm48_rr.c +++ b/src/host/layer23/src/mobile/gsm48_rr.c @@ -71,7 +71,6 @@ #include #include #include -#include #include #include @@ -1629,8 +1628,7 @@ } } - if (osmo_get_rand_id((uint8_t *) &chan_req, sizeof(chan_req)) != 0) - chan_req = random(); + chan_req = random(); chan_req &= rr->chan_req_mask; chan_req |= rr->chan_req_val; diff --git a/src/host/layer23/src/mobile/settings.c b/src/host/layer23/src/mobile/settings.c index 80b0b48..7370b0a 100644 --- a/src/host/layer23/src/mobile/settings.c +++ b/src/host/layer23/src/mobile/settings.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include @@ -179,19 +178,14 @@ { int digits = set->imei_random; char rand[16]; - long rand_num; if (digits <= 0) return 0; if (digits > 15) digits = 15; - if (osmo_get_rand_id((uint8_t *) &rand_num, sizeof(rand_num)) != 0) - rand_num = random(); - sprintf(rand, "%08ld", rand_num % 100000000); - if (osmo_get_rand_id((uint8_t *) &rand_num, sizeof(rand_num)) != 0) - rand_num = random(); - sprintf(rand + 8, "%07ld", rand_num % 10000000); + sprintf(rand, "%08ld", random() % 100000000); + sprintf(rand + 8, "%07ld", random() % 10000000); strcpy(set->imei + 15 - digits, rand + 15 - digits); strncpy(set->imeisv, set->imei, 15); -- To view, visit https://gerrit.osmocom.org/10020 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I7b2a8a5c63cf64360a824926a2219fd7e419b1bb Gerrit-Change-Number: 10020 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 10:11:22 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Jul 2018 10:11:22 +0000 Subject: Change in openbsc[master]: nat: ctrl: use strtol instead of atoi as it has explicit error docume... In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9979 ) Change subject: nat: ctrl: use strtol instead of atoi as it has explicit error documentation ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9979 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ief0b203efbcf2be04253b5056840be94d58a9994 Gerrit-Change-Number: 9979 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 17 Jul 2018 10:11:22 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 10:11:27 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Jul 2018 10:11:27 +0000 Subject: Change in openbsc[master]: nat: ctrl: use strtol instead of atoi as it has explicit error docume... In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/9979 ) Change subject: nat: ctrl: use strtol instead of atoi as it has explicit error documentation ...................................................................... nat: ctrl: use strtol instead of atoi as it has explicit error documentation In some cases id can be non-digit such as "err" for ERROR cmds generated from parsing failures. Change-Id: Ief0b203efbcf2be04253b5056840be94d58a9994 --- M openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c 1 file changed, 13 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, but someone else must approve Pau Espin Pedrol: Looks good to me, approved diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c b/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c index af110a2..7a5e9d0 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c @@ -36,6 +36,7 @@ #include #include #include +#include #define NAT_MAX_CTRL_ID 65535 @@ -85,10 +86,20 @@ static struct bsc_cmd_list *bsc_get_pending(struct bsc_connection *bsc, char *id_str) { struct bsc_cmd_list *cmd_entry; - int id = atoi(id_str); - if (id == 0) + char * endptr = NULL; + long int long_id; + int id; + + errno = 0; + long_id = (int) strtol(id_str, &endptr, 10); + /* check parse errors */ + if (id_str[0] == '\0' || endptr[0] != '\0') + return NULL; + /* check value store errors */ + if (errno == ERANGE || long_id > INT_MAX || long_id < 0) return NULL; + id = (int) long_id; llist_for_each_entry(cmd_entry, &bsc->cmd_pending, list_entry) { if (cmd_entry->nat_id == id) { return cmd_entry; -- To view, visit https://gerrit.osmocom.org/9979 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ief0b203efbcf2be04253b5056840be94d58a9994 Gerrit-Change-Number: 9979 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 10:11:27 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Jul 2018 10:11:27 +0000 Subject: Change in openbsc[master]: nat: ctrl: Avoid sending back received ERROR msgs In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/9980 ) Change subject: nat: ctrl: Avoid sending back received ERROR msgs ...................................................................... nat: ctrl: Avoid sending back received ERROR msgs We only send back if we had an error parsing the message locally. If we receive an ERROR message from a bsc, we try to forward it if the ID is valid, otherwise only log the received error description locally. Related: OS#3394 Change-Id: I7b4d20aea7a16c4b4e5add7c274a4ed34a7f6b8d --- M openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c 1 file changed, 11 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c b/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c index 7a5e9d0..152929c 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c @@ -111,13 +111,14 @@ int bsc_nat_handle_ctrlif_msg(struct bsc_connection *bsc, struct msgb *msg) { struct ctrl_cmd *cmd; + bool parse_failed; struct bsc_cmd_list *pending; char *var; - cmd = ctrl_cmd_parse2(bsc, msg); + cmd = ctrl_cmd_parse3(bsc, msg, &parse_failed); msgb_free(msg); - if (cmd->type == CTRL_TYPE_ERROR) + if (cmd->type == CTRL_TYPE_ERROR && parse_failed) goto err; if (bsc->cfg && !llist_empty(&bsc->cfg->lac_list)) { @@ -152,11 +153,14 @@ ctrl_cmd_send(&pending->cmd->ccon->write_queue, cmd); bsc_nat_ctrl_del_pending(pending); } else { - /* We need to handle TRAPS here */ - if ((cmd->type != CTRL_TYPE_ERROR) && - (cmd->type != CTRL_TYPE_TRAP)) { - LOGP(DNAT, LOGL_NOTICE, "Got control message " - "from BSC without pending entry\n"); + if ((cmd->type == CTRL_TYPE_ERROR)) { + LOGP(DNAT, LOGL_NOTICE, "Got ERROR CTRL message " + "from BSC without pending/valid ID %s: %s\n", + cmd->id, cmd->reply); + } else { + LOGP(DNAT, LOGL_NOTICE, "Got %s CTRL message " + "from BSC without pending entry\n", + get_value_string(ctrl_type_vals, cmd->type)); cmd->type = CTRL_TYPE_ERROR; cmd->reply = "No request outstanding"; goto err; -- To view, visit https://gerrit.osmocom.org/9980 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I7b4d20aea7a16c4b4e5add7c274a4ed34a7f6b8d Gerrit-Change-Number: 9980 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 10:11:28 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Jul 2018 10:11:28 +0000 Subject: Change in openbsc[master]: bsc: ctrl: Avoid sending back received ERROR msgs In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/9981 ) Change subject: bsc: ctrl: Avoid sending back received ERROR msgs ...................................................................... bsc: ctrl: Avoid sending back received ERROR msgs Change-Id: Ib5963e4d15a4a6b077d7a97fbbde6e5134c77e9a --- M openbsc/src/osmo-bsc/osmo_bsc_msc.c 1 file changed, 3 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/osmo-bsc/osmo_bsc_msc.c b/openbsc/src/osmo-bsc/osmo_bsc_msc.c index 4395c3b..b179ff1 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_msc.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_msc.c @@ -224,9 +224,10 @@ { int ret; struct ctrl_cmd *cmd; + bool parse_failed; - cmd = ctrl_cmd_parse2(msc->msc_con, msg); - if (cmd->type == CTRL_TYPE_ERROR) { + cmd = ctrl_cmd_parse3(msc->msc_con, msg, &parse_failed); + if (cmd->type == CTRL_TYPE_ERROR && parse_failed) { LOGP(DMSC, LOGL_ERROR, "Failed to parse control message.\n"); ctrl_cmd_send(&msc->msc_con->write_queue, cmd); -- To view, visit https://gerrit.osmocom.org/9981 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ib5963e4d15a4a6b077d7a97fbbde6e5134c77e9a Gerrit-Change-Number: 9981 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 10:40:50 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Jul 2018 10:40:50 +0000 Subject: Change in osmo-ggsn[master]: gtp: Add new API to avoid freeing pdp contexts during DEL CTX REQ In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10006 to look at the new patch set (#2). Change subject: gtp: Add new API to avoid freeing pdp contexts during DEL CTX REQ ...................................................................... gtp: Add new API to avoid freeing pdp contexts during DEL CTX REQ With this API, user is expectd to free the PDP ctx when the confirmation for the release has been received (cb_conf time). This way user can maintain the pdp ctx alive during all this time. Extra code is added to gtp_delete_pdp_resp() since it's now possible to match it and push it up to the user cb_conf. This way, cb_conf() can be used for locally-initiated DEL CTX REQ, while delete_context() cb is left for remotely-initiated DEL CTX REQ. In this later case, when the DEL CTX RESP is sent the ctx is deleted and the delete_context() is called, where the user can do related actions or trigger consequence events (in the case of SGSN, it will drop all related GGSN bits for that PDP ctx and forward the DEACT PDP CTX to the MS). Change-Id: I29d366253bb98dcba328c7ce8aa3e4daf8f75e6c --- M gtp/gtp.c M gtp/gtp.h 2 files changed, 74 insertions(+), 38 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/06/10006/2 -- To view, visit https://gerrit.osmocom.org/10006 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I29d366253bb98dcba328c7ce8aa3e4daf8f75e6c Gerrit-Change-Number: 10006 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 10:52:25 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Jul 2018 10:52:25 +0000 Subject: Change in osmo-sgsn[master]: sgsn: gtp: Use new API to send PDP DEL CTX REQ without freeing ctx lo... In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10019 ) Change subject: sgsn: gtp: Use new API to send PDP DEL CTX REQ without freeing ctx locally ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/10019 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I304c59de5d137b81de3c6df0fdbe911ae3dbd1f3 Gerrit-Change-Number: 10019 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 17 Jul 2018 10:52:25 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 10:55:05 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Jul 2018 10:55:05 +0000 Subject: Change in osmo-sgsn[master]: sgsn: gtp: Use new API to send PDP DEL CTX REQ without freeing ctx lo... In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10019 ) Change subject: sgsn: gtp: Use new API to send PDP DEL CTX REQ without freeing ctx locally ...................................................................... Patch Set 2: Requires https://gerrit.osmocom.org/#/c/osmo-ggsn/+/10006 to build correctly. -- To view, visit https://gerrit.osmocom.org/10019 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I304c59de5d137b81de3c6df0fdbe911ae3dbd1f3 Gerrit-Change-Number: 10019 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 17 Jul 2018 10:55:05 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 11:16:18 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 17 Jul 2018 11:16:18 +0000 Subject: Change in osmo-bsc[master]: codec_pref: move match_codec_pref() to separate c-file and add unit-test In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10010 to look at the new patch set (#7). Change subject: codec_pref: move match_codec_pref() to separate c-file and add unit-test ...................................................................... codec_pref: move match_codec_pref() to separate c-file and add unit-test At the moment there are three sources that may advertise a list of supported audio codec/rate settings. There is the MS that advertises advertises a speech codec list and the MSC that sends a channel type information element over A and there are also settings in the bsc configuration file that may restrict the codec/rate types that are allowed to use. The function match_codec_pref() looks at all of the three buckets and selects a codec that satisfies all three. This is already a somewhat complicated process, overit is very isolated, so lets give it its own c-file. Due to the lack of unit-tests it is very hard to make changes here so lets add also unit-test to make sure that regressions are catched early. - Put match_codec_pref() and all its helper functions into a separate c-file. - Add a unit test. Change-Id: Iabedfdcec8b99a319f2d57cbea45c5e36c7b6e29 Related: OS#3361 --- M configure.ac M include/osmocom/bsc/Makefile.am A include/osmocom/bsc/codec_pref.h M src/osmo-bsc/Makefile.am A src/osmo-bsc/codec_pref.c M src/osmo-bsc/osmo_bsc_bssap.c M tests/Makefile.am A tests/codec_pref/Makefile.am A tests/codec_pref/codec_pref_test.c A tests/codec_pref/codec_pref_test.ok M tests/testsuite.at 11 files changed, 1,432 insertions(+), 160 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/10/10010/7 -- To view, visit https://gerrit.osmocom.org/10010 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iabedfdcec8b99a319f2d57cbea45c5e36c7b6e29 Gerrit-Change-Number: 10010 Gerrit-PatchSet: 7 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 11:37:38 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 17 Jul 2018 11:37:38 +0000 Subject: Change in osmo-bsc[master]: codec_pref: move match_codec_pref() to separate c-file and add unit-test In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10010 to look at the new patch set (#8). Change subject: codec_pref: move match_codec_pref() to separate c-file and add unit-test ...................................................................... codec_pref: move match_codec_pref() to separate c-file and add unit-test At the moment there are three sources that may advertise a list of supported audio codec/rate settings. There is the MS that advertises advertises a speech codec list and the MSC that sends a channel type information element over A and there are also settings in the bsc configuration file that may restrict the codec/rate types that are allowed to use. The function match_codec_pref() looks at all of the three buckets and selects a codec that satisfies all three. This is already a somewhat complicated process, overit is very isolated, so lets give it its own c-file. Due to the lack of unit-tests it is very hard to make changes here so lets add also unit-test to make sure that regressions are catched early. - Put match_codec_pref() and all its helper functions into a separate c-file. - Add a unit test. Change-Id: Iabedfdcec8b99a319f2d57cbea45c5e36c7b6e29 Related: OS#3361 --- M configure.ac M include/osmocom/bsc/Makefile.am A include/osmocom/bsc/codec_pref.h M src/osmo-bsc/Makefile.am A src/osmo-bsc/codec_pref.c M src/osmo-bsc/osmo_bsc_bssap.c M tests/Makefile.am A tests/codec_pref/Makefile.am A tests/codec_pref/codec_pref_test.c A tests/codec_pref/codec_pref_test.ok M tests/testsuite.at 11 files changed, 1,432 insertions(+), 160 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/10/10010/8 -- To view, visit https://gerrit.osmocom.org/10010 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iabedfdcec8b99a319f2d57cbea45c5e36c7b6e29 Gerrit-Change-Number: 10010 Gerrit-PatchSet: 8 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 11:37:38 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 17 Jul 2018 11:37:38 +0000 Subject: Change in osmo-bsc[master]: codec_pref: check bts codec support In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10011 to look at the new patch set (#8). Change subject: codec_pref: check bts codec support ...................................................................... codec_pref: check bts codec support The vty option bts->codec-support allows the user to set the supported codecs per BTS level. However, those values are currently only used to make the handover decision but the logic that handles the BSSMAP ASSIGNMENT REQUEST does not check those flags. - Do not ignore bts->codec-support flags on BSSMAP ASSIGNMENT REQUEST Change-Id: I285234e9c81de74d9fb9907fca2c443b08537435 Closes: OS#3361 --- M include/osmocom/bsc/codec_pref.h M src/osmo-bsc/codec_pref.c M src/osmo-bsc/osmo_bsc_bssap.c M tests/codec_pref/codec_pref_test.c M tests/codec_pref/codec_pref_test.ok 5 files changed, 490 insertions(+), 21 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/11/10011/8 -- To view, visit https://gerrit.osmocom.org/10011 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I285234e9c81de74d9fb9907fca2c443b08537435 Gerrit-Change-Number: 10011 Gerrit-PatchSet: 8 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 12:30:35 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 17 Jul 2018 12:30:35 +0000 Subject: Change in osmo-bsc[master]: codec_pref: move match_codec_pref() to separate c-file and add unit-test In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10010 to look at the new patch set (#9). Change subject: codec_pref: move match_codec_pref() to separate c-file and add unit-test ...................................................................... codec_pref: move match_codec_pref() to separate c-file and add unit-test At the moment there are three sources that may advertise a list of supported audio codec/rate settings. There is the MS that advertises advertises a speech codec list and the MSC that sends a channel type information element over A and there are also settings in the bsc configuration file that may restrict the codec/rate types that are allowed to use. The function match_codec_pref() looks at all of the three buckets and selects a codec that satisfies all three. This is already a somewhat complicated process, overit is very isolated, so lets give it its own c-file. Due to the lack of unit-tests it is very hard to make changes here so lets add also unit-test to make sure that regressions are catched early. - Put match_codec_pref() and all its helper functions into a separate c-file. - Add a unit test. Change-Id: Iabedfdcec8b99a319f2d57cbea45c5e36c7b6e29 Related: OS#3361 --- M configure.ac M include/osmocom/bsc/Makefile.am A include/osmocom/bsc/codec_pref.h M src/osmo-bsc/Makefile.am A src/osmo-bsc/codec_pref.c M src/osmo-bsc/osmo_bsc_bssap.c M tests/Makefile.am A tests/codec_pref/Makefile.am A tests/codec_pref/codec_pref_test.c A tests/codec_pref/codec_pref_test.ok M tests/testsuite.at 11 files changed, 1,430 insertions(+), 160 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/10/10010/9 -- To view, visit https://gerrit.osmocom.org/10010 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iabedfdcec8b99a319f2d57cbea45c5e36c7b6e29 Gerrit-Change-Number: 10010 Gerrit-PatchSet: 9 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 12:34:49 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 17 Jul 2018 12:34:49 +0000 Subject: Change in osmo-bsc[master]: codec_pref: move match_codec_pref() to separate c-file and add unit-test In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10010 to look at the new patch set (#10). Change subject: codec_pref: move match_codec_pref() to separate c-file and add unit-test ...................................................................... codec_pref: move match_codec_pref() to separate c-file and add unit-test At the moment there are three sources that may advertise a list of supported audio codec/rate settings. There is the MS that advertises advertises a speech codec list and the MSC that sends a channel type information element over A and there are also settings in the bsc configuration file that may restrict the codec/rate types that are allowed to use. The function match_codec_pref() looks at all of the three buckets and selects a codec that satisfies all three. This is already a somewhat complicated process, overit is very isolated, so lets give it its own c-file. Due to the lack of unit-tests it is very hard to make changes here so lets add also unit-test to make sure that regressions are catched early. - Put match_codec_pref() and all its helper functions into a separate c-file. - Add a unit test. Change-Id: Iabedfdcec8b99a319f2d57cbea45c5e36c7b6e29 Related: OS#3361 --- M configure.ac M include/osmocom/bsc/Makefile.am A include/osmocom/bsc/codec_pref.h M src/osmo-bsc/Makefile.am A src/osmo-bsc/codec_pref.c M src/osmo-bsc/osmo_bsc_bssap.c M tests/Makefile.am A tests/codec_pref/Makefile.am A tests/codec_pref/codec_pref_test.c A tests/codec_pref/codec_pref_test.ok M tests/testsuite.at 11 files changed, 1,431 insertions(+), 160 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/10/10010/10 -- To view, visit https://gerrit.osmocom.org/10010 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iabedfdcec8b99a319f2d57cbea45c5e36c7b6e29 Gerrit-Change-Number: 10010 Gerrit-PatchSet: 10 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 13:18:12 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Tue, 17 Jul 2018 13:18:12 +0000 Subject: Change in osmo-mgw[master]: add a VTY command which shows a specific mgcp endpoint Message-ID: Stefan Sperling has uploaded this change for review. ( https://gerrit.osmocom.org/10022 Change subject: add a VTY command which shows a specific mgcp endpoint ...................................................................... add a VTY command which shows a specific mgcp endpoint Add a new VTY command "show mgcp trunk <0-64> endpoint NAME" which shows detailed information about a specific endpoint. Change-Id: I5330e697ec34bf215de91d44209048a8dc226d51 Related: OS#2660 --- M src/libosmo-mgcp/mgcp_vty.c 1 file changed, 76 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/22/10022/1 diff --git a/src/libosmo-mgcp/mgcp_vty.c b/src/libosmo-mgcp/mgcp_vty.c index ad462b7..22dd8ae 100644 --- a/src/libosmo-mgcp/mgcp_vty.c +++ b/src/libosmo-mgcp/mgcp_vty.c @@ -31,6 +31,7 @@ #include #include +#include #define RTCP_OMIT_STR "Drop RTCP packets in both directions\n" #define RTP_PATCH_STR "Modify RTP packet header in both directions\n" @@ -184,11 +185,32 @@ end->force_output_ptime, VTY_NEWLINE); } -static void dump_trunk(struct vty *vty, struct mgcp_trunk_config *cfg, - int verbose) +static void dump_endpoint(struct vty *vty, struct mgcp_endpoint *endp, int epidx, + enum mgcp_trunk_type trunk_type, int show_stats) +{ + struct mgcp_conn *conn; + + vty_out(vty, "Endpoint %s0x%.2x:%s", + trunk_type == MGCP_TRUNK_VIRTUAL ? MGCP_ENDPOINT_PREFIX_VIRTUAL_TRUNK : "", + epidx, VTY_NEWLINE); + + llist_for_each_entry(conn, &endp->conns, entry) { + vty_out(vty, " CONN: %s%s", mgcp_conn_dump(conn), VTY_NEWLINE); + + if (show_stats) { + /* FIXME: Also add verbosity for other + * connection types (E1) as soon as + * the implementation is available */ + if (conn->type == MGCP_CONN_TYPE_RTP) { + dump_rtp_end(vty, &conn->u.rtp); + } + } + } +} + +static void dump_trunk(struct vty *vty, struct mgcp_trunk_config *cfg, int show_stats) { int i; - struct mgcp_conn *conn; vty_out(vty, "%s trunk nr %d with %d endpoints:%s", cfg->trunk_type == MGCP_TRUNK_VIRTUAL ? "Virtual" : "E1", @@ -201,22 +223,9 @@ for (i = 1; i < cfg->number_endpoints; ++i) { struct mgcp_endpoint *endp = &cfg->endpoints[i]; - - vty_out(vty, "Endpoint 0x%.2x:%s", i, VTY_NEWLINE); - - llist_for_each_entry(conn, &endp->conns, entry) { - vty_out(vty, " CONN: %s%s", - mgcp_conn_dump(conn), VTY_NEWLINE); - - if (verbose) { - /* FIXME: Also add verbosity for other - * connection types (E1) as soon as - * the implementation is available */ - if (conn->type == MGCP_CONN_TYPE_RTP) { - dump_rtp_end(vty, &conn->u.rtp); - } - } - } + dump_endpoint(vty, endp, i, cfg->trunk_type, show_stats); + if (i < cfg->number_endpoints - 1) + vty_out(vty, "%s", VTY_NEWLINE); } } @@ -241,6 +250,53 @@ return CMD_SUCCESS; } +DEFUN(show_mcgp_endpoint, show_mgcp_endpoint_cmd, + "show mgcp trunk <0-64> endpoint NAME", + SHOW_STR + "Display information about an MGCP Media Gateway endpoint\n" + "Display information about a specific trunk only\n" "Trunk number\n" + "Display information about an endpoint\n" "The name of the endpoint in hex\n") +{ + struct mgcp_trunk_config *trunk; + int trunkidx = atoi(argv[1]); + const char *epidxstr; + unsigned long epidx; + char *ep; + int i; + const size_t virt_prefix_len = sizeof(MGCP_ENDPOINT_PREFIX_VIRTUAL_TRUNK) - 1; + + trunk = find_trunk(g_cfg, trunkidx); + if (!trunk) { + vty_out(vty, "trunk %d not found%s", trunkidx, VTY_NEWLINE); + return CMD_WARNING; + } + + epidxstr = argv[1]; + if (strncmp(epidxstr, MGCP_ENDPOINT_PREFIX_VIRTUAL_TRUNK, virt_prefix_len) == 0) + epidxstr += virt_prefix_len; + errno = 0; + epidx = strtoul(epidxstr, &ep, 16); + if (argv[1][0] == '\0' || *ep != '\0') { + vty_out(vty, "endpoint name '%s' is not a hex number%s", argv[1], VTY_NEWLINE); + return CMD_WARNING; + } + if ((errno == ERANGE && epidx == ULONG_MAX) /* parsed value out of range */ + || epidx >= trunk->number_endpoints) { + vty_out(vty, "endpoint 0x%.2lx not configured%s", epidx, VTY_NEWLINE); + return CMD_WARNING; + } + + for (i = 0; i < trunk->number_endpoints; ++i) { + struct mgcp_endpoint *endp = &trunk->endpoints[i]; + if (i == epidx) { + dump_endpoint(vty, endp, i, trunk->trunk_type, true); + break; + } + } + + return CMD_SUCCESS; +} + DEFUN(cfg_mgcp, cfg_mgcp_cmd, "mgcp", "Configure the MGCP") { vty->node = MGCP_NODE; @@ -1217,6 +1273,7 @@ int mgcp_vty_init(void) { install_element_ve(&show_mgcp_cmd); + install_element_ve(&show_mgcp_endpoint_cmd); install_element(ENABLE_NODE, &loop_conn_cmd); install_element(ENABLE_NODE, &tap_rtp_cmd); install_element(ENABLE_NODE, &free_endp_cmd); -- To view, visit https://gerrit.osmocom.org/10022 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I5330e697ec34bf215de91d44209048a8dc226d51 Gerrit-Change-Number: 10022 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 13:50:33 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Jul 2018 13:50:33 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: Add Test to verify timer t3395 In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10009 to look at the new patch set (#2). Change subject: sgsn: Add Test to verify timer t3395 ...................................................................... sgsn: Add Test to verify timer t3395 Change-Id: I9ec0863603692045b0d8da376e65080150066173 --- M sgsn/SGSN_Tests.ttcn M sgsn/expected-results.xml 2 files changed, 39 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/09/10009/2 -- To view, visit https://gerrit.osmocom.org/10009 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9ec0863603692045b0d8da376e65080150066173 Gerrit-Change-Number: 10009 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 13:50:34 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Jul 2018 13:50:34 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: Add Test to verify Recovery procedure during CreatePdpResp Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10023 Change subject: sgsn: Add Test to verify Recovery procedure during CreatePdpResp ...................................................................... sgsn: Add Test to verify Recovery procedure during CreatePdpResp Change-Id: Ic81b854967492194367b7ce8a667c29c777791bf --- M library/GTP_Templates.ttcn M sgsn/SGSN_Tests.ttcn M sgsn/expected-results.xml 3 files changed, 60 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/23/10023/1 diff --git a/library/GTP_Templates.ttcn b/library/GTP_Templates.ttcn index a222b2e..a9d2394 100644 --- a/library/GTP_Templates.ttcn +++ b/library/GTP_Templates.ttcn @@ -308,11 +308,12 @@ template GTPC_PDUs ts_CreatePdpRespPDU(OCT1 cause, OCT4 teid_data, OCT4 teid_ctrl, BIT4 nsapi, octetstring ggsn_ip_sign, octetstring ggsn_ip_data, OCT4 chg_id, template EndUserAddress eua := omit, + template Recovery_gtpc recovery := omit, template ProtConfigOptions pco := omit) := { createPDPContextResponse := { cause := { '00'O, cause }, reorderingRequired := ts_ReorderReq(false), - recovery := omit, + recovery := recovery, teidDataI := { type_gtpc := '00'O, teidDataI := teid_data @@ -352,12 +353,13 @@ BIT4 nsapi, octetstring ggsn_ip_sign, octetstring ggsn_ip_data, OCT4 chg_id, template EndUserAddress eua := omit, + template Recovery_gtpc recovery := omit, template ProtConfigOptions pco := omit) := { peer := peer, gtpc := ts_GTP1C_PDU(createPDPContextResponse, teid, valueof(ts_CreatePdpRespPDU(cause, teid_data, teid_ctrl, nsapi, ggsn_ip_sign, ggsn_ip_data, chg_id, - eua, pco)), seq) + eua, recovery, pco)), seq) } /* PCO send base template */ diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 782d89c..d7e956f 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -903,9 +903,14 @@ f_gtp_register_teid(apars.ggsn_tei_u); } -function f_pdp_ctx_act(inout PdpActPars apars) runs on BSSGP_ConnHdlr { +function f_pdp_ctx_act(inout PdpActPars apars, boolean send_recovery := false) runs on BSSGP_ConnHdlr { var boolean exp_rej := ispresent(apars.exp_rej_cause); var Gtp1cUnitdata g_ud; + var template Recovery_gtpc recovery := omit; + + if (send_recovery) { + recovery := ts_Recovery(apars.ggsn_restart_ctr); + } BSSGP.send(ts_SM_ACT_PDP_REQ(apars.tid, apars.nsapi, apars.sapi, apars.qos, apars.addr, apars.apn, apars.pco)); @@ -916,7 +921,8 @@ apars.sgsn_tei_c, apars.gtp_resp_cause, apars.ggsn_tei_c, apars.ggsn_tei_u, apars.nsapi, - apars.ggsn_ip_c, apars.ggsn_ip_u, apars.chg_id)); + apars.ggsn_ip_c, apars.ggsn_ip_u, apars.chg_id, + omit, recovery)); } alt { [exp_rej] BSSGP.receive(tr_BD_L3_MT(tr_SM_ACT_PDP_REJ(apars.tid, apars.exp_rej_cause))) { @@ -1263,7 +1269,7 @@ vc_conn.done; } -private function f_TC_attach_restart_ctr_dettach(charstring id) runs on BSSGP_ConnHdlr { +private function f_TC_attach_restart_ctr_echo(charstring id) runs on BSSGP_ConnHdlr { var Gtp1cUnitdata g_ud; var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip)); @@ -1294,15 +1300,55 @@ } setverdict(pass); } -testcase TC_attach_restart_ctr_dettach() runs on test_CT { +/* ATTACH + trigger Recovery procedure through EchoResp */ +testcase TC_attach_restart_ctr_echo() runs on test_CT { var BSSGP_ConnHdlr vc_conn; g_use_echo := true f_init(); - vc_conn := f_start_handler(refers(f_TC_attach_restart_ctr_dettach), testcasename(), g_gb[0], 23, 30.0); + vc_conn := f_start_handler(refers(f_TC_attach_restart_ctr_echo), testcasename(), g_gb[0], 23, 30.0); vc_conn.done; g_use_echo := false } +private function f_TC_attach_restart_ctr_create(charstring id) runs on BSSGP_ConnHdlr { + var Gtp1cUnitdata g_ud; + var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip)); + var integer seq_nr := 23; + var GtpPeer peer; + /* first perform regular attach */ + f_TC_attach(id); + + /* Use this CTX ACT to send initial Restart counter to SGSN. */ + apars.gtp_resp_cause := int2oct(199, 1); /* no resources available */ + apars.exp_rej_cause := '1a'O; /* insufficient resources */ + f_pdp_ctx_act(apars, true); + + /* Increment restart_ctr. This will fake a restarted GGSN when CreatePdpResp is +/* received. */ + apars.ggsn_restart_ctr := int2oct(oct2int(apars.ggsn_restart_ctr) + 1, 1); + + /* FIXME: Once we can easily handle different pdp ctx simultaneously, it + would be great to have an active pdp context here before triggering + Recovery, and making sure the the DEACT request is sent by the SGSN. + */ + + /* Activate a pdp context against the GGSN, send incremented Recovery + IE. This should trigger the recovery path, but still this specific + CTX activation should work. */ + apars.exp_rej_cause := omit; /* default value for tests */ + apars.gtp_resp_cause := int2oct(128, 1); /* default value for tests */ + f_pdp_ctx_act(apars, true); + + setverdict(pass); +} +/* ATTACH + trigger Recovery procedure through CreatePdpResp */ +testcase TC_attach_restart_ctr_create() runs on test_CT { + var BSSGP_ConnHdlr vc_conn; + f_init(); + vc_conn := f_start_handler(refers(f_TC_attach_restart_ctr_create), testcasename(), g_gb[0], 24, 30.0); + vc_conn.done; +} + /* ATTACH + PDP CTX ACT + user plane traffic + PDP CTX DEACT in MT direction + trigger T3395 */ private function f_TC_attach_pdp_act_deact_mt_t3395_expire(charstring id) runs on BSSGP_ConnHdlr { var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip)); @@ -1713,7 +1759,8 @@ execute( TC_attach_pdp_act_user_deact_mo() ); execute( TC_attach_pdp_act_user_deact_mt() ); execute( TC_attach_second_attempt() ); - execute( TC_attach_restart_ctr_dettach() ); + execute( TC_attach_restart_ctr_echo() ); + execute( TC_attach_restart_ctr_create() ); execute( TC_attach_pdp_act_deact_mt_t3395_expire() ); } diff --git a/sgsn/expected-results.xml b/sgsn/expected-results.xml index f2bf327..5b756cd 100644 --- a/sgsn/expected-results.xml +++ b/sgsn/expected-results.xml @@ -1,5 +1,5 @@ - + @@ -60,6 +60,7 @@ - + + -- To view, visit https://gerrit.osmocom.org/10023 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ic81b854967492194367b7ce8a667c29c777791bf Gerrit-Change-Number: 10023 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 13:54:41 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Jul 2018 13:54:41 +0000 Subject: Change in osmo-ggsn[master]: gtp: Pass originating pdp ctx to recovery_cb Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10024 Change subject: gtp: Pass originating pdp ctx to recovery_cb ...................................................................... gtp: Pass originating pdp ctx to recovery_cb This commit breaks API and old apps will fail to compile if using the cb_recovery. Sometimes the originating pdp ctx causing the Recovery Procedure is required, in order to drop all pdp ctx but this one, which specs specify should be handled as valid: """ The SGSN receiving the Recovery information element shall handle it as when an Echo Response message is received but shall consider the PDP context being created as active if the response indicates successful context activation at the GGSN. """ Change-Id: I53e92298f2f6b84d662a3300d922e8c2ccb178bc --- M gtp/gtp.c M gtp/gtp.h 2 files changed, 18 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/24/10024/1 diff --git a/gtp/gtp.c b/gtp/gtp.c index 95abbef..a495943 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -190,10 +190,17 @@ return 0; } +/* cb_recovery() + * pdp may be NULL if Recovery IE was received from a message indepenendent + * of any PDP ctx (such as Echo Response), or because pdp ctx is unknown to the + * local setup. In case pdp is known, user may want to keep that pdp alive to + * handle subsequent msg cb as this specific pdp ctx is still valid according to + * specs. + */ int gtp_set_cb_recovery(struct gsn_t *gsn, - int (*cb) (struct sockaddr_in * peer, uint8_t recovery)) + int (*cb_recovery) (struct sockaddr_in * peer, struct pdp_t * pdp, uint8_t recovery)) { - gsn->cb_recovery = cb; + gsn->cb_recovery = cb_recovery; return 0; } @@ -978,7 +985,7 @@ gsn->cb_conf(type, recovery, NULL, cbp); if (gsn->cb_recovery) - gsn->cb_recovery(peer, recovery); + gsn->cb_recovery(peer, NULL, recovery); return 0; } @@ -1410,8 +1417,9 @@ /* Recovery (optional) */ if (!gtpie_gettv1(ie, GTPIE_RECOVERY, 0, &recovery)) { + /* pass null pdp since new ctx is still not known to upper layers */ if (gsn->cb_recovery) - gsn->cb_recovery(peer, recovery); + gsn->cb_recovery(peer, NULL, recovery); } /* Selection mode (conditional) */ @@ -1697,7 +1705,7 @@ /* Extract recovery (optional) */ if (!gtpie_gettv1(ie, GTPIE_RECOVERY, 0, &recovery)) { if (gsn->cb_recovery) - gsn->cb_recovery(peer, recovery); + gsn->cb_recovery(peer, pdp, recovery); } /* Extract protocol configuration options (optional) */ @@ -2107,7 +2115,7 @@ /* Recovery (optional) */ if (!gtpie_gettv1(ie, GTPIE_RECOVERY, 0, &recovery)) { if (gsn->cb_recovery) - gsn->cb_recovery(peer, recovery); + gsn->cb_recovery(peer, pdp, recovery); } if (version == 0) { @@ -2268,7 +2276,7 @@ /* Extract recovery (optional) */ if (!gtpie_gettv1(ie, GTPIE_RECOVERY, 0, &recovery)) { if (gsn->cb_recovery) - gsn->cb_recovery(peer, recovery); + gsn->cb_recovery(peer, pdp, recovery); } /* Check all conditional information elements */ diff --git a/gtp/gtp.h b/gtp/gtp.h index f185424..f5ce517 100644 --- a/gtp/gtp.h +++ b/gtp/gtp.h @@ -270,7 +270,7 @@ int (*cb_extheader_ind) (struct sockaddr_in * peer); int (*cb_conf) (int type, int cause, struct pdp_t * pdp, void *cbp); int (*cb_data_ind) (struct pdp_t * pdp, void *pack, unsigned len); - int (*cb_recovery) (struct sockaddr_in * peer, uint8_t recovery); + int (*cb_recovery) (struct sockaddr_in * peer, struct pdp_t * pdp, uint8_t recovery); /* Counters */ @@ -360,7 +360,8 @@ void *cbp)); int gtp_set_cb_recovery(struct gsn_t *gsn, - int (*cb) (struct sockaddr_in * peer, + int (*cb_recovery) (struct sockaddr_in * peer, + struct pdp_t * pdp, uint8_t recovery)); /* Internal functions (not part of the API */ -- To view, visit https://gerrit.osmocom.org/10024 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I53e92298f2f6b84d662a3300d922e8c2ccb178bc Gerrit-Change-Number: 10024 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 14:03:31 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Jul 2018 14:03:31 +0000 Subject: Change in osmo-sgsn[master]: gtp: Fix crash using new libgtp cb_recovery API Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10025 Change subject: gtp: Fix crash using new libgtp cb_recovery API ...................................................................... gtp: Fix crash using new libgtp cb_recovery API When PDP CTX CREATE ACK is received with an increased RestartCtr, cb_recovery is called first, which will dettach ggsn from al pdp ctx (free the pdp_t). But when giving control back from the ctrl, libgtp still uses that freed ctx and sends it back to osmo-sgsn through cb_conf(). As specs state in any case that we need to handle the message containing the increased RestartCtr as valid, we then need to avoid freeing the pdp ctx and leave handling for later in cb_conf. Change-Id: I0989c00e18ca95a099e1a312940eaac71957b444 --- M include/osmocom/sgsn/gprs_sgsn.h M src/gprs/gprs_sgsn.c M src/gprs/sgsn_libgtp.c 3 files changed, 13 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/25/10025/1 diff --git a/include/osmocom/sgsn/gprs_sgsn.h b/include/osmocom/sgsn/gprs_sgsn.h index 8eba2d4..6f16dc7 100644 --- a/include/osmocom/sgsn/gprs_sgsn.h +++ b/include/osmocom/sgsn/gprs_sgsn.h @@ -362,7 +362,7 @@ struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_addr(struct in_addr *addr); struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_find_alloc(uint32_t id); void sgsn_ggsn_ctx_drop_pdp(struct sgsn_pdp_ctx *pctx); -int sgsn_ggsn_ctx_drop_all_pdp(struct sgsn_ggsn_ctx *ggsn); +int sgsn_ggsn_ctx_drop_all_pdp_except(struct sgsn_ggsn_ctx *ggsn, struct sgsn_pdp_ctx *except); void sgsn_ggsn_ctx_add_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx *pdp); void sgsn_ggsn_ctx_remove_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx *pdp); diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c index e6d88e3..9046157 100644 --- a/src/gprs/gprs_sgsn.c +++ b/src/gprs/gprs_sgsn.c @@ -714,13 +714,17 @@ } /* High-level function to be called in case a GGSN has disappeared or - * otherwise lost state (recovery procedure) */ -int sgsn_ggsn_ctx_drop_all_pdp(struct sgsn_ggsn_ctx *ggsn) + * otherwise lost state (recovery procedure). It will detach all related pdp ctx + * from a ggsn and communicate deact to MS. Optionally (!NULL), one pdp ctx can + * be kept alive to allow handling later message which contained the Recovery IE. */ +int sgsn_ggsn_ctx_drop_all_pdp_except(struct sgsn_ggsn_ctx *ggsn, struct sgsn_pdp_ctx *except) { int num = 0; struct sgsn_pdp_ctx *pdp, *pdp2; llist_for_each_entry_safe(pdp, pdp2, &ggsn->pdp_list, ggsn_list) { + if (pdp == except) + continue; sgsn_ggsn_ctx_drop_pdp(pdp); num++; } diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 2a9ba05..f042ddb 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -584,9 +584,10 @@ } /* Any message received by GGSN contains a recovery IE */ -static int cb_recovery(struct sockaddr_in *peer, uint8_t recovery) +static int cb_recovery(struct sockaddr_in *peer, struct pdp_t *pdp, uint8_t recovery) { struct sgsn_ggsn_ctx *ggsn; + struct sgsn_pdp_ctx *pctx; ggsn = sgsn_ggsn_ctx_by_addr(&peer->sin_addr); if (!ggsn) { @@ -599,11 +600,12 @@ ggsn->remote_restart_ctr = recovery; } else if (ggsn->remote_restart_ctr != recovery) { /* counter has changed (GGSN restart): release all PDP */ - LOGP(DGPRS, LOGL_NOTICE, "GGSN recovery (%u->%u), " + LOGP(DGPRS, LOGL_NOTICE, "GGSN recovery (%u->%u) pdp=%p, " "releasing all PDP contexts\n", - ggsn->remote_restart_ctr, recovery); + ggsn->remote_restart_ctr, recovery, pdp); ggsn->remote_restart_ctr = recovery; - sgsn_ggsn_ctx_drop_all_pdp(ggsn); + pctx = pdp->priv; + sgsn_ggsn_ctx_drop_all_pdp_except(ggsn, pctx); } return 0; } -- To view, visit https://gerrit.osmocom.org/10025 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I0989c00e18ca95a099e1a312940eaac71957b444 Gerrit-Change-Number: 10025 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 14:08:44 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Tue, 17 Jul 2018 14:08:44 +0000 Subject: Change in osmo-bsc[master]: fix handling of invalid pchan names in vty Message-ID: Stefan Sperling has uploaded this change for review. ( https://gerrit.osmocom.org/10026 Change subject: fix handling of invalid pchan names in vty ...................................................................... fix handling of invalid pchan names in vty If an invalid phys_chan_config is specified in osmo-bsc.cfg, raise a parsing error at program startup. If an invalid phys_chan_config is specified in in the VTY while the program is running, show a warning to inform the user that the configuration change was not applied. Change-Id: I97baa359464a0e94de2497bc9214b99ed2a24041 Related: OS#1876 --- M src/osmo-bsc/bsc_vty.c 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/26/10026/1 diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c index 57c5363..dd4396d 100644 --- a/src/osmo-bsc/bsc_vty.c +++ b/src/osmo-bsc/bsc_vty.c @@ -4032,8 +4032,12 @@ int pchanc; pchanc = gsm_pchan_parse(argv[0]); - if (pchanc < 0) + if (pchanc < 0) { + vty_out(vty, "Unknown physical channel name '%s'%s", argv[0], VTY_NEWLINE); + if (vty->type == VTY_FILE) + return CMD_ERR_NO_MATCH; return CMD_WARNING; + } ts->pchan = pchanc; -- To view, visit https://gerrit.osmocom.org/10026 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I97baa359464a0e94de2497bc9214b99ed2a24041 Gerrit-Change-Number: 10026 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 14:09:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Jul 2018 14:09:48 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_ConnectionHandler: more verbosity for f_check_mgcp_expectations() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10004 ) Change subject: MSC_ConnectionHandler: more verbosity for f_check_mgcp_expectations() ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10004 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ida0eba4ef3c1db977d392267ef76ec37b87133b3 Gerrit-Change-Number: 10004 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-Comment-Date: Tue, 17 Jul 2018 14:09:48 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 14:10:13 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Jul 2018 14:10:13 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_ConnectionHandler: expect additional MDCX when call is LCLS In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10005 ) Change subject: MSC_ConnectionHandler: expect additional MDCX when call is LCLS ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10005 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I55fae5ab03980cd810ed7dc38208550686b1659e Gerrit-Change-Number: 10005 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Tue, 17 Jul 2018 14:10:13 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 14:10:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Jul 2018 14:10:16 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_ConnectionHandler: expect additional MDCX when call is LCLS In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10005 ) Change subject: MSC_ConnectionHandler: expect additional MDCX when call is LCLS ...................................................................... MSC_ConnectionHandler: expect additional MDCX when call is LCLS The function f_establish_f_establish_fully does not yet handle the case where calls get switched locally. In those cases we expect to see one additional MDCX before the BSSMAP ASSIGNMENT COMPLETE is sent. - Check exp_ass_cpl if the call is expected to be LCLS and expect another MDCX for those cases. Change-Id: I55fae5ab03980cd810ed7dc38208550686b1659e Related: OS#3292 --- M bsc/MSC_ConnectionHandler.ttcn 1 file changed, 12 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index ba4d19d..94cd9ef 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -947,6 +947,18 @@ self.stop; } + /* When the BSC detects that LCLS is possible it will cross the + * connetions that point to the PBX side of the MGW. In our case this + * is mgcp_conn[1]. The BSC performs this operation already before the + * assignment complete is generated. This means we expect another MDCX + * at mgcp_conn[1] when LCLS is expected. */ + if (ispresent(exp_ass_cpl.pdu.bssmap.assignmentComplete.lCLS_BSS_Status.lCLS_BSS_StatusValue)) { + if (valueof(exp_ass_cpl.pdu.bssmap.assignmentComplete.lCLS_BSS_Status.lCLS_BSS_StatusValue) == LCLS_STS_locally_switched) { + g_media.mgcp_conn[1].mdcx_seen_exp := g_media.mgcp_conn[1].mdcx_seen_exp + 1; + + } + } + f_check_mgcp_expectations(); } -- To view, visit https://gerrit.osmocom.org/10005 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I55fae5ab03980cd810ed7dc38208550686b1659e Gerrit-Change-Number: 10005 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 14:10:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 17 Jul 2018 14:10:16 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_ConnectionHandler: more verbosity for f_check_mgcp_expectations() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10004 ) Change subject: MSC_ConnectionHandler: more verbosity for f_check_mgcp_expectations() ...................................................................... MSC_ConnectionHandler: more verbosity for f_check_mgcp_expectations() The function f_check_mgcp_expectations() checks the counters that count the occurrence of MDCX and CRCX messages against computed expected values. At the moment it is not easy to spot where exactly the deviation occurred. Lets add some log output so that we can see which type of message on which connection was missing or too much. Also add a string parameter that is set to the calling functions name so that we know from where the check has been triggered. - Add more verbose log output for counters - Add parameter to prepend to the log line Change-Id: Ida0eba4ef3c1db977d392267ef76ec37b87133b3 Related: OS#3292 --- M bsc/MSC_ConnectionHandler.ttcn 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index 94cd9ef..63d017f 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -796,6 +796,10 @@ * expected */ function f_check_mgcp_expectations() runs on MSC_ConnHdlr { for (var integer i:= 0; i < sizeof(g_media.mgcp_conn); i := i+1) { + log(testcasename(), ": Check MGCP test expectations for g_media.mgcp_conn[", i , "]:", + " crcx_seen=", g_media.mgcp_conn[i].crcx_seen, ", crcx_seen_exp=", g_media.mgcp_conn[i].crcx_seen_exp, + ", mdcx_seen=", g_media.mgcp_conn[i].mdcx_seen, ", mdcx_seen_exp=", g_media.mgcp_conn[i].mdcx_seen_exp); + if(g_media.mgcp_conn[i].crcx_seen != g_media.mgcp_conn[i].crcx_seen_exp) { setverdict(fail, "unexpected number of MGW-CRCX transactions"); } -- To view, visit https://gerrit.osmocom.org/10004 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ida0eba4ef3c1db977d392267ef76ec37b87133b3 Gerrit-Change-Number: 10004 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 14:12:47 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Jul 2018 14:12:47 +0000 Subject: Change in osmo-sgsn[master]: gtp: Fix crash using new libgtp cb_recovery API In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10025 to look at the new patch set (#2). Change subject: gtp: Fix crash using new libgtp cb_recovery API ...................................................................... gtp: Fix crash using new libgtp cb_recovery API When PDP CTX CREATE ACK is received with an increased RestartCtr, cb_recovery is called first, which will dettach ggsn from al pdp ctx (free the pdp_t). But when giving control back from the ctrl, libgtp still uses that freed ctx and sends it back to osmo-sgsn through cb_conf(). As specs state in any case that we need to handle the message containing the increased RestartCtr as valid, we then need to avoid freeing the pdp ctx and leave handling for later in cb_conf. Change-Id: I0989c00e18ca95a099e1a312940eaac71957b444 --- M include/osmocom/sgsn/gprs_sgsn.h M src/gprs/gprs_sgsn.c M src/gprs/sgsn_libgtp.c 3 files changed, 14 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/25/10025/2 -- To view, visit https://gerrit.osmocom.org/10025 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0989c00e18ca95a099e1a312940eaac71957b444 Gerrit-Change-Number: 10025 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 14:19:09 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Jul 2018 14:19:09 +0000 Subject: Change in osmo-sgsn[master]: gtp: Fix crash using new libgtp cb_recovery API In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10025 ) Change subject: gtp: Fix crash using new libgtp cb_recovery API ...................................................................... Patch Set 2: Requires osmo-ggsn libgtp https://gerrit.osmocom.org/#/c/osmo-ggsn/+/10024/ to build correctly. -- To view, visit https://gerrit.osmocom.org/10025 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0989c00e18ca95a099e1a312940eaac71957b444 Gerrit-Change-Number: 10025 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 17 Jul 2018 14:19:09 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 14:26:47 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Tue, 17 Jul 2018 14:26:47 +0000 Subject: Change in osmo-ggsn[master]: fix unaligned access in build_ipcp_pco() Message-ID: Stefan Sperling has uploaded this change for review. ( https://gerrit.osmocom.org/10027 Change subject: fix unaligned access in build_ipcp_pco() ...................................................................... fix unaligned access in build_ipcp_pco() Copy a struct ipcp_hdr to the stack, where it will be appropriately aligned by the compiler, rather than accessing the data through a potentially misaligned pointer. Change-Id: Ifc1a2b623dee99ecf188df14a0808fe8219a98bf Related: OS#3194 --- M ggsn/ggsn.c 1 file changed, 7 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/27/10027/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 6d879c0..8e0e934 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -504,31 +504,33 @@ { const struct in46_addr *dns1 = &apn->v4.cfg.dns[0]; const struct in46_addr *dns2 = &apn->v4.cfg.dns[1]; - struct ipcp_hdr *ipcp; + struct ipcp_hdr ipcp; uint8_t *len1, *len2, *pco_ipcp; uint8_t *start = msg->tail; unsigned int len_appended; if (!(pco_ipcp = pco_contains_proto(&pdp->pco_req, PCO_P_IPCP))) return 0; - ipcp = (struct ipcp_hdr*) (pco_ipcp + 3); /* 2=type + 1=len */ + + /* Copy to stack avoids unaligned access on some platforms. */ + memcpy(&ipcp, pco_ipcp + 3, sizeof(ipcp)); /* 2=type + 1=len */ /* Three byte T16L header */ msgb_put_u16(msg, 0x8021); /* IPCP */ len1 = msgb_put(msg, 1); /* Length of contents: delay */ msgb_put_u8(msg, 0x02); /* ACK */ - msgb_put_u8(msg, ipcp->id); /* ID: Needs to match request */ + msgb_put_u8(msg, ipcp.id); /* ID: Needs to match request */ msgb_put_u8(msg, 0x00); /* Length MSB */ len2 = msgb_put(msg, 1); /* Length LSB: delay */ - if (dns1->len == 4 && ipcp_contains_option(ipcp, IPCP_OPT_PRIMARY_DNS)) { + if (dns1->len == 4 && ipcp_contains_option(&ipcp, IPCP_OPT_PRIMARY_DNS)) { msgb_put_u8(msg, 0x81); /* DNS1 Tag */ msgb_put_u8(msg, 2 + dns1->len);/* DNS1 Length, incl. TL */ msgb_put_u32(msg, ntohl(dns1->v4.s_addr)); } - if (dns2->len == 4 && ipcp_contains_option(ipcp, IPCP_OPT_SECONDARY_DNS)) { + if (dns2->len == 4 && ipcp_contains_option(&ipcp, IPCP_OPT_SECONDARY_DNS)) { msgb_put_u8(msg, 0x83); /* DNS2 Tag */ msgb_put_u8(msg, 2 + dns2->len);/* DNS2 Length, incl. TL */ msgb_put_u32(msg, ntohl(dns2->v4.s_addr)); -- To view, visit https://gerrit.osmocom.org/10027 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ifc1a2b623dee99ecf188df14a0808fe8219a98bf Gerrit-Change-Number: 10027 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 14:43:46 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Tue, 17 Jul 2018 14:43:46 +0000 Subject: Change in osmo-ggsn[master]: fix unaligned access in build_ipcp_pco() In-Reply-To: References: Message-ID: Stefan Sperling has abandoned this change. ( https://gerrit.osmocom.org/10027 ) Change subject: fix unaligned access in build_ipcp_pco() ...................................................................... Abandoned This patch is wrong, it only copies the header portion of the packet and no options, then passes a pointer to just the header to a function which processes the options. -- To view, visit https://gerrit.osmocom.org/10027 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: Ifc1a2b623dee99ecf188df14a0808fe8219a98bf Gerrit-Change-Number: 10027 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 15:02:15 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Tue, 17 Jul 2018 15:02:15 +0000 Subject: Change in osmo-ggsn[master]: fix unaligned access in build_ipcp_pco() Message-ID: Stefan Sperling has uploaded this change for review. ( https://gerrit.osmocom.org/10028 Change subject: fix unaligned access in build_ipcp_pco() ...................................................................... fix unaligned access in build_ipcp_pco() Include PDP Protocol Configuration Options header bytes (2 type, 1 length) in our struct ipcp_hdr definition, and rename this struct accordingly. This should allow the compiler to produce properly aligned accesses. The previous code caused an unaligned access on some platforms because PDP options are two-byte aligned in the received packet, and the IPCP data we want to read starts at an offset of 3 bytes into the packet. Change-Id: Ia75ee0f64e660f6ff6d81d808f9c460b7cac93d2 Related: OS#3194 --- M ggsn/ggsn.c 1 file changed, 8 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/28/10028/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 6d879c0..6a0c1b5 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -405,7 +405,9 @@ uint8_t data[0]; } __attribute__ ((packed)); -struct ipcp_hdr { +struct pco_ipcp_hdr { + uint16_t pco_type; + uint8_t pco_len; uint8_t code; uint8_t id; uint16_t len; @@ -413,7 +415,7 @@ } __attribute__ ((packed)); /* determine if IPCP contains given option */ -static struct ipcp_option_hdr *ipcp_contains_option(struct ipcp_hdr *ipcp, enum ipcp_options opt) +static struct ipcp_option_hdr *ipcp_contains_option(struct pco_ipcp_hdr *ipcp, enum ipcp_options opt) { uint8_t *cur = ipcp->options; @@ -504,14 +506,14 @@ { const struct in46_addr *dns1 = &apn->v4.cfg.dns[0]; const struct in46_addr *dns2 = &apn->v4.cfg.dns[1]; - struct ipcp_hdr *ipcp; - uint8_t *len1, *len2, *pco_ipcp; + struct pco_ipcp_hdr *ipcp; + uint8_t *len1, *len2; uint8_t *start = msg->tail; unsigned int len_appended; - if (!(pco_ipcp = pco_contains_proto(&pdp->pco_req, PCO_P_IPCP))) + ipcp = (struct pco_ipcp_hdr *)pco_contains_proto(&pdp->pco_req, PCO_P_IPCP); + if (ipcp == NULL) return 0; - ipcp = (struct ipcp_hdr*) (pco_ipcp + 3); /* 2=type + 1=len */ /* Three byte T16L header */ msgb_put_u16(msg, 0x8021); /* IPCP */ -- To view, visit https://gerrit.osmocom.org/10028 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ia75ee0f64e660f6ff6d81d808f9c460b7cac93d2 Gerrit-Change-Number: 10028 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Tue Jul 17 15:10:06 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Tue, 17 Jul 2018 15:10:06 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-asn1c_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#187?= In-Reply-To: <1647670113.202.1531753806499.JavaMail.jenkins@jenkins.osmocom.org> References: <1647670113.202.1531753806499.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <857769140.213.1531840206360.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 3.67 KB...] + ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for style of include used by make... GNU checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking how to run the C++ preprocessor... g++ -E checking for g77... no checking for f77... no checking for xlf... no checking for frt... no checking for pgf77... no checking for cf77... no checking for fort77... no checking for fl32... no checking for af77... no checking for f90... no checking for xlf90... no checking for pgf90... no checking for pghpf... no checking for epcf90... no checking for gfortran... no checking for g95... no checking for f95... no checking for fort... no checking for xlf95... no checking for ifort... no checking for ifc... no checking for efc... no checking for pgf95... no checking for lf95... no checking for ftn... no checking whether we are using the GNU Fortran 77 compiler... no checking whether accepts -g... no checking the maximum length of command line arguments... 32768 checking command to parse /usr/bin/nm -B output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes configure: creating libtool appending configuration tag "CXX" to libtool checking for ld used by g++... /usr/bin/ld -m elf_x86_64 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC checking if g++ PIC flag -fPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate appending configuration tag "F77" to libtool checking for autoconf... /usr/bin/autoconf checking for autoheader... /usr/bin/autoheader checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking dependency style of gcc... (cached) gcc3 checking how to run the C preprocessor... gcc -E checking for a BSD-compatible install... /usr/bin/install -c checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking for bison... bison -y checking for flex... flex checking for yywrap in -lfl... yes checking lex output file root... lex.yy checking whether yytext is a pointer... yes checking for ar... /usr/bin/ar checking for ANSI C header files... (cached) yes checking sys/param.h usability... yes checking sys/param.h presence... yes checking for sys/param.h... yes checking whether byte ordering is bigendian... no checking for off_t... yes checking for size_t... yes checking whether struct tm is in sys/time.h or time.h... time.h checking for intmax_t... yes checking for library containing getopt... none required checking for strtoimax... yes checking for strtoll... yes checking for mergesort... no checking for mkstemps... yes configure: creating ./config.status config.status: creating skeletons/standard-modules/Makefile config.status: creating skeletons/tests/Makefile config.status: creating libasn1compiler/Makefile config.status: creating libasn1parser/Makefile config.status: creating libasn1print/Makefile config.status: creating asn1c/webcgi/Makefile config.status: creating asn1c/tests/Makefile config.status: creating libasn1fix/Makefile config.status: creating skeletons/Makefile config.status: creating examples/Makefile config.status: creating tests/Makefile config.status: creating asn1c/Makefile config.status: creating doc/Makefile config.status: creating asn1c.spec config.status: creating Makefile config.status: creating config.h config.status: executing depfiles commands + make -j 8 make all-recursive make[1]: Entering directory ' Making all in libasn1parser make[2]: Entering directory ' if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF ".deps/asn1parser.Tpo" -c -o asn1parser.lo asn1parser.c; \ then mv -f ".deps/asn1parser.Tpo" ".deps/asn1parser.Plo"; else rm -f ".deps/asn1parser.Tpo"; exit 1; fi bison -y -p asn1p_ -d asn1p_y.y if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF ".deps/asn1p_l.Tpo" -c -o asn1p_l.lo asn1p_l.c; \ then mv -f ".deps/asn1p_l.Tpo" ".deps/asn1p_l.Plo"; else rm -f ".deps/asn1p_l.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF ".deps/asn1p_module.Tpo" -c -o asn1p_module.lo asn1p_module.c; \ then mv -f ".deps/asn1p_module.Tpo" ".deps/asn1p_module.Plo"; else rm -f ".deps/asn1p_module.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF ".deps/asn1p_oid.Tpo" -c -o asn1p_oid.lo asn1p_oid.c; \ then mv -f ".deps/asn1p_oid.Tpo" ".deps/asn1p_oid.Plo"; else rm -f ".deps/asn1p_oid.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF ".deps/asn1p_value.Tpo" -c -o asn1p_value.lo asn1p_value.c; \ then mv -f ".deps/asn1p_value.Tpo" ".deps/asn1p_value.Plo"; else rm -f ".deps/asn1p_value.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF ".deps/asn1p_expr.Tpo" -c -o asn1p_expr.lo asn1p_expr.c; \ then mv -f ".deps/asn1p_expr.Tpo" ".deps/asn1p_expr.Plo"; else rm -f ".deps/asn1p_expr.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF ".deps/asn1p_xports.Tpo" -c -o asn1p_xports.lo asn1p_xports.c; \ then mv -f ".deps/asn1p_xports.Tpo" ".deps/asn1p_xports.Plo"; else rm -f ".deps/asn1p_xports.Tpo"; exit 1; fi asn1p_y.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] mkdir .libs gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -fPIC -DPIC -o .libs/asn1p_expr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -fPIC -DPIC -o .libs/asn1parser.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -fPIC -DPIC -o .libs/asn1p_l.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -fPIC -DPIC -o .libs/asn1p_value.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -fPIC -DPIC -o .libs/asn1p_oid.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -fPIC -DPIC -o .libs/asn1p_module.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -fPIC -DPIC -o .libs/asn1p_xports.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -o asn1p_xports.o >/dev/null 2>&1 asn1p_l.c:3521:12: warning: 'input' defined but not used [-Wunused-function] static int input() ^~~~~ gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -o asn1p_module.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -o asn1parser.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -o asn1p_oid.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -o asn1p_expr.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -o asn1p_value.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF ".deps/asn1p_constr.Tpo" -c -o asn1p_constr.lo asn1p_constr.c; \ then mv -f ".deps/asn1p_constr.Tpo" ".deps/asn1p_constr.Plo"; else rm -f ".deps/asn1p_constr.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF ".deps/asn1p_param.Tpo" -c -o asn1p_param.lo asn1p_param.c; \ then mv -f ".deps/asn1p_param.Tpo" ".deps/asn1p_param.Plo"; else rm -f ".deps/asn1p_param.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF ".deps/asn1p_class.Tpo" -c -o asn1p_class.lo asn1p_class.c; \ then mv -f ".deps/asn1p_class.Tpo" ".deps/asn1p_class.Plo"; else rm -f ".deps/asn1p_class.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF ".deps/asn1p_ref.Tpo" -c -o asn1p_ref.lo asn1p_ref.c; \ then mv -f ".deps/asn1p_ref.Tpo" ".deps/asn1p_ref.Plo"; else rm -f ".deps/asn1p_ref.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -fPIC -DPIC -o .libs/asn1p_constr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -fPIC -DPIC -o .libs/asn1p_param.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -fPIC -DPIC -o .libs/asn1p_class.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -fPIC -DPIC -o .libs/asn1p_ref.o if test -f y.tab.h; then \ to=`echo "asn1p_y_H" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \ sed -e "/^#/!b" -e "s/Y_TAB_H/$to/g" -e "s|y\.tab\.h|asn1p_y.h|" \ y.tab.h >asn1p_y.ht; \ rm -f y.tab.h; \ if cmp -s asn1p_y.ht asn1p_y.h; then \ rm -f asn1p_y.ht ;\ else \ mv asn1p_y.ht asn1p_y.h; \ fi; \ fi if test -f y.output; then \ mv y.output asn1p_y.output; \ fi sed '/^#/ s|y\.tab\.c|asn1p_y.c|' y.tab.c >asn1p_y.ct && mv asn1p_y.ct asn1p_y.c rm -f y.tab.c if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF ".deps/asn1p_y.Tpo" -c -o asn1p_y.lo asn1p_y.c; \ then mv -f ".deps/asn1p_y.Tpo" ".deps/asn1p_y.Plo"; else rm -f ".deps/asn1p_y.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -o asn1p_param.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -o asn1p_constr.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -o asn1p_ref.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -o asn1p_class.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF .deps/asn1p_y.Tpo -c asn1p_y.c -fPIC -DPIC -o .libs/asn1p_y.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -o asn1p_l.o >/dev/null 2>&1 asn1p_y.y: In function 'asn1p_parse': asn1p_y.y:357:13: error: 'param' undeclared (first use in this function) *(void **)param = $1; ^~~~~ asn1p_y.y:357:13: note: each undeclared identifier is reported only once for each function it appears in Makefile:299: recipe for target 'asn1p_y.lo' failed make[2]: *** [asn1p_y.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory ' Makefile:302: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory ' Makefile:212: recipe for target 'all' failed make: *** [all] Error 2 Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Tue Jul 17 15:13:45 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Jul 2018 15:13:45 +0000 Subject: Change in osmo-ggsn[master]: fix unaligned access in build_ipcp_pco() In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10028 ) Change subject: fix unaligned access in build_ipcp_pco() ...................................................................... Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/10028/1/ggsn/ggsn.c File ggsn/ggsn.c: https://gerrit.osmocom.org/#/c/10028/1/ggsn/ggsn.c at 514 PS1, Line 514: ipcp = (struct pco_ipcp_hdr *)pco_contains_proto(&pdp->pco_req, PCO_P_IPCP); So we increased size of the struct prepending bytes, but we still pass same pointer here and didn't change implementation of that function? This smells being wrong. -- To view, visit https://gerrit.osmocom.org/10028 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia75ee0f64e660f6ff6d81d808f9c460b7cac93d2 Gerrit-Change-Number: 10028 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 17 Jul 2018 15:13:45 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 15:42:05 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Jul 2018 15:42:05 +0000 Subject: Change in osmo-sgsn[master]: sgsn: cdr: Fix uninitialized string access if ggsn is dettached Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10029 Change subject: sgsn: cdr: Fix uninitialized string access if ggsn is dettached ...................................................................... sgsn: cdr: Fix uninitialized string access if ggsn is dettached if pdp->ggsn==NULL, sgsn_addr was not initialized and caused asan report during snprintf: ==19459==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fffffffbe31 at pc 0x7ffff6e563fe bp 0x7fffffffb130 sp 0x7fffffffa8a8 READ of size 31 at 0x7fffffffbe31 thread T0 ... Address 0x7fffffffbe31 is located in stack of thread T0 at offset 337 in frame #0 0x55555573a7b0 in cdr_snprintf_pdp osmo-sgsn/src/gprs/sgsn_cdr.c:154 ... [320, 337) 'sgsn_addr' <== Memory access at offset 337 overflows this variable ... Change-Id: I97bc56a4e3e76725eb2717b74b3ac125b68bbf0a --- M src/gprs/sgsn_cdr.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/29/10029/1 diff --git a/src/gprs/sgsn_cdr.c b/src/gprs/sgsn_cdr.c index 55aa664..7380e74 100644 --- a/src/gprs/sgsn_cdr.c +++ b/src/gprs/sgsn_cdr.c @@ -164,6 +164,7 @@ memset(apni, 0, sizeof(apni)); memset(ggsn_addr, 0, sizeof(ggsn_addr)); + memset(sgsn_addr, 0, sizeof(sgsn_addr)); memset(eua_addr, 0, sizeof(eua_addr)); -- To view, visit https://gerrit.osmocom.org/10029 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I97bc56a4e3e76725eb2717b74b3ac125b68bbf0a Gerrit-Change-Number: 10029 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 16:26:56 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 17 Jul 2018 16:26:56 +0000 Subject: Change in osmo-sgsn[master]: sgsn: subscriber: Avoid calling memcpy with NULL src Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10030 Change subject: sgsn: subscriber: Avoid calling memcpy with NULL src ...................................................................... sgsn: subscriber: Avoid calling memcpy with NULL src Fixes: OS#3389 Change-Id: I2d1c01ed8b8d2233ced6d70972183ed4fc99007a --- M src/gprs/gprs_subscriber.c M src/gprs/sgsn_libgtp.c 2 files changed, 22 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/30/10030/1 diff --git a/src/gprs/gprs_subscriber.c b/src/gprs/gprs_subscriber.c index 1bebc65..dfd697b 100644 --- a/src/gprs/gprs_subscriber.c +++ b/src/gprs/gprs_subscriber.c @@ -374,7 +374,11 @@ pdp_data->pdp_type = pdp_info->pdp_type; osmo_apn_to_str(pdp_data->apn_str, pdp_info->apn_enc, pdp_info->apn_enc_len); - memcpy(pdp_data->qos_subscribed, pdp_info->qos_enc, pdp_info->qos_enc_len); + + if (pdp_info->qos_enc) { + memcpy(&pdp_data->qos_subscribed[0], pdp_info->qos_enc, + pdp_info->qos_enc_len); + } pdp_data->qos_subscribed_len = pdp_info->qos_enc_len; if (pdp_info->pdp_charg_enc && pdp_info->pdp_charg_enc_len >= sizeof(pdp_data->pdp_charg)) { diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 659392e..23b8811 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -198,18 +198,25 @@ pdp->eua.v[0] |= 0xf0; /* APN name from GMM */ - pdp->apn_use.l = TLVP_LEN(tp, GSM48_IE_GSM_APN); - if (pdp->apn_use.l > sizeof(pdp->apn_use.v)) - pdp->apn_use.l = sizeof(pdp->apn_use.v); - memcpy(pdp->apn_use.v, TLVP_VAL(tp, GSM48_IE_GSM_APN), - pdp->apn_use.l); + if (TLVP_PRESENT(tp, GSM48_IE_GSM_APN)) { + pdp->apn_use.l = TLVP_LEN(tp, GSM48_IE_GSM_APN); + if (pdp->apn_use.l > sizeof(pdp->apn_use.v)) + pdp->apn_use.l = sizeof(pdp->apn_use.v); + memcpy(pdp->apn_use.v, TLVP_VAL(tp, GSM48_IE_GSM_APN), pdp->apn_use.l); + } else { + pdp->apn_use.l = 0; + } /* Protocol Configuration Options from GMM */ - pdp->pco_req.l = TLVP_LEN(tp, GSM48_IE_GSM_PROTO_CONF_OPT); - if (pdp->pco_req.l > sizeof(pdp->pco_req.v)) - pdp->pco_req.l = sizeof(pdp->pco_req.v); - memcpy(pdp->pco_req.v, TLVP_VAL(tp, GSM48_IE_GSM_PROTO_CONF_OPT), - pdp->pco_req.l); + if (TLVP_PRESENT(tp, GSM48_IE_GSM_PROTO_CONF_OPT)) { + pdp->pco_req.l = TLVP_LEN(tp, GSM48_IE_GSM_PROTO_CONF_OPT); + if (pdp->pco_req.l > sizeof(pdp->pco_req.v)) + pdp->pco_req.l = sizeof(pdp->pco_req.v); + memcpy(pdp->pco_req.v, TLVP_VAL(tp, GSM48_IE_GSM_PROTO_CONF_OPT), + pdp->pco_req.l); + } else { + pdp->pco_req.l = 0; + } /* QoS options from GMM or remote */ if (TLVP_LEN(tp, OSMO_IE_GSM_SUB_QOS) > 0) { -- To view, visit https://gerrit.osmocom.org/10030 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I2d1c01ed8b8d2233ced6d70972183ed4fc99007a Gerrit-Change-Number: 10030 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 16:43:29 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 17 Jul 2018 16:43:29 +0000 Subject: Change in libosmocore[master]: ctrl/vty: fsm: use correct element when iterating over fsm->proc.chil... Message-ID: lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/10031 Change subject: ctrl/vty: fsm: use correct element when iterating over fsm->proc.children ...................................................................... ctrl/vty: fsm: use correct element when iterating over fsm->proc.children Fixes crashs when using vty `show fsm-instances all` when fsm childs are present. Change-Id: I4ae0bee7f7f57ec6675cfb52ca6cf0d523d15362 --- M src/ctrl/fsm_ctrl_commands.c M src/vty/fsm_vty.c 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/31/10031/1 diff --git a/src/ctrl/fsm_ctrl_commands.c b/src/ctrl/fsm_ctrl_commands.c index 3c7e1bd..c93d3a5 100644 --- a/src/ctrl/fsm_ctrl_commands.c +++ b/src/ctrl/fsm_ctrl_commands.c @@ -156,7 +156,7 @@ if (fi->proc.parent) cmd->reply = talloc_asprintf_append(cmd->reply, ",parent='%s'", fi->proc.parent->name); - llist_for_each_entry(child, &fi->proc.children, list) { + llist_for_each_entry(child, &fi->proc.children, proc.child) { cmd->reply = talloc_asprintf_append(cmd->reply, ",child='%s'", child->name); } diff --git a/src/vty/fsm_vty.c b/src/vty/fsm_vty.c index 8628d15..9bde241 100644 --- a/src/vty/fsm_vty.c +++ b/src/vty/fsm_vty.c @@ -102,7 +102,7 @@ fsmi->proc.parent_term_event), VTY_NEWLINE); } - llist_for_each_entry(child, &fsmi->proc.children, list) { + llist_for_each_entry(child, &fsmi->proc.children, proc.child) { vty_out(vty, " Child: '%s'%s", child->name, VTY_NEWLINE); } } -- To view, visit https://gerrit.osmocom.org/10031 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I4ae0bee7f7f57ec6675cfb52ca6cf0d523d15362 Gerrit-Change-Number: 10031 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 17:05:20 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 17 Jul 2018 17:05:20 +0000 Subject: Change in libosmocore[master]: vty: initialize termios before using it Message-ID: lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/10032 Change subject: vty: initialize termios before using it ...................................................................... vty: initialize termios before using it valgrind complains about using unitialised bytes in syscalls. I could imagine this happens when tcgetattr fails to set termios. Change-Id: I9d165911fa3127afa8f836fa5c5c2e14a949474a --- M src/vty/vty.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/32/10032/1 diff --git a/src/vty/vty.c b/src/vty/vty.c index 08258e7..4d5ffea 100644 --- a/src/vty/vty.c +++ b/src/vty/vty.c @@ -1506,7 +1506,7 @@ { struct vty *vty; - struct termios t; + struct termios t = { 0 }; tcgetattr(vty_sock, &t); cfmakeraw(&t); -- To view, visit https://gerrit.osmocom.org/10032 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I9d165911fa3127afa8f836fa5c5c2e14a949474a Gerrit-Change-Number: 10032 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 18:23:32 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 17 Jul 2018 18:23:32 +0000 Subject: Change in osmo-sgsn[master]: gprs_gmm: dont answer unknown IMSI/TMSI on Service Requests NET_FAIL Message-ID: lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/10033 Change subject: gprs_gmm: dont answer unknown IMSI/TMSI on Service Requests NET_FAIL ...................................................................... gprs_gmm: dont answer unknown IMSI/TMSI on Service Requests NET_FAIL NET_FAIL will result in asking again and again. Reject with IMPL_DETACHED to drop the MS completely. Change-Id: I195d533e330a4b577cad80c7e757d481f9c837df --- M src/gprs/gprs_gmm.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/33/10033/1 diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index 91f769d..6ad076a 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -1834,7 +1834,7 @@ ctx = sgsn_mm_ctx_by_imsi(mi_string); if (!ctx) { /* FIXME: We need to have a context for service request? */ - reject_cause = GMM_CAUSE_NET_FAIL; + reject_cause = GMM_CAUSE_IMPL_DETACHED; goto rejected; } msgid2mmctx(ctx, msg); @@ -1847,7 +1847,7 @@ ctx = sgsn_mm_ctx_by_ptmsi(tmsi); if (!ctx) { /* FIXME: We need to have a context for service request? */ - reject_cause = GMM_CAUSE_NET_FAIL; + reject_cause = GMM_CAUSE_IMPL_DETACHED; goto rejected; } msgid2mmctx(ctx, msg); -- To view, visit https://gerrit.osmocom.org/10033 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I195d533e330a4b577cad80c7e757d481f9c837df Gerrit-Change-Number: 10033 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 17 18:24:28 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 17 Jul 2018 18:24:28 +0000 Subject: Change in osmo-sgsn[master]: gprs_gmm: dont answer unknown IMSI/TMSI on Service Requests NET_FAIL In-Reply-To: References: Message-ID: lynxis lazus has posted comments on this change. ( https://gerrit.osmocom.org/10033 ) Change subject: gprs_gmm: dont answer unknown IMSI/TMSI on Service Requests NET_FAIL ...................................................................... Patch Set 1: This is untested. -- To view, visit https://gerrit.osmocom.org/10033 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I195d533e330a4b577cad80c7e757d481f9c837df Gerrit-Change-Number: 10033 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: lynxis lazus Gerrit-CC: Jenkins Builder Gerrit-Comment-Date: Tue, 17 Jul 2018 18:24:28 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 18 02:02:46 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 18 Jul 2018 02:02:46 +0000 Subject: Change in libosmocore[master]: Introduce info / features negotiation helper functions Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/10034 Change subject: Introduce info / features negotiation helper functions ...................................................................... Introduce info / features negotiation helper functions In some projects, such as OsmocomBB and SIMTrace, where the host software needs to communicate with different HW / SW back-ends (e.g. OsmocomBB/mobile and Calypso firmware), it is important to have a possibility to negotiate some information between the both sides, for example, a list of supported features, or some meta-information about a hardware back-end. This change introduces the new API exactly for that, and can be used in order to avoid code duplication, and implementing the wheel again and again. At the moment, there are two kinds of information that can be negotiated: - TLV-based text chunks, - feature flags. First kind of info can be used to describe some meta-information, for example, HW board name, FW or SW version. Also, it can be used to describe some non-binary properties, for example, a preferred TCH frame format. The feature flags can be used to indicate that one or more features from a set shared between the both sides is/are supported. If particular flag is preset in the encoded message, the associated feature is supported, otherwise it is not supported, or not implemented. Basic usage examples can be found in implementation of the unit test: tests/nego/nego_test.c. Change-Id: I6fd5b6be6755d4aa735a510e95459180225389ba --- M include/Makefile.am A include/osmocom/core/negotiation.h M src/Makefile.am A src/negotiation.c M tests/Makefile.am A tests/nego/nego_test.c A tests/nego/nego_test.ok M tests/testsuite.at 8 files changed, 428 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/34/10034/1 diff --git a/include/Makefile.am b/include/Makefile.am index 38ba14c..158a1b8 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -51,6 +51,7 @@ osmocom/core/timer_compat.h \ osmocom/core/utils.h \ osmocom/core/write_queue.h \ + osmocom/core/negotiation.h \ osmocom/crypt/auth.h \ osmocom/crypt/gprs_cipher.h \ osmocom/ctrl/control_cmd.h \ diff --git a/include/osmocom/core/negotiation.h b/include/osmocom/core/negotiation.h new file mode 100644 index 0000000..86096f0 --- /dev/null +++ b/include/osmocom/core/negotiation.h @@ -0,0 +1,13 @@ +#pragma once + +#include +#include + +#include +#include + +int osmo_nego_enc_info(struct msgb *msg, const struct value_string *info); +const char *osmo_nego_get_info(const uint8_t *buf, size_t buf_len, uint8_t info_tag); + +void osmo_nego_add_feature(struct msgb *msg, uint8_t feature); +bool osmo_nego_check_feature(const uint8_t *buf, size_t buf_len, uint8_t feature); diff --git a/src/Makefile.am b/src/Makefile.am index 45fb89d..91cdefb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -23,7 +23,7 @@ loggingrb.c crc8gen.c crc16gen.c crc32gen.c crc64gen.c \ macaddr.c stat_item.c stats.c stats_statsd.c prim.c \ conv_acc.c conv_acc_generic.c sercomm.c prbs.c \ - isdnhdlc.c + isdnhdlc.c negotiation.c if HAVE_SSSE3 libosmocore_la_SOURCES += conv_acc_sse.c diff --git a/src/negotiation.c b/src/negotiation.c new file mode 100644 index 0000000..5aa5d34 --- /dev/null +++ b/src/negotiation.c @@ -0,0 +1,138 @@ +/*! \file negotiation.c + * Helper functions for info / feature negotiation. */ +/* + * (C) 2018 by Vadim Yanitskiy + * + * All Rights Reserved + * + * SPDX-License-Identifier: GPL-2.0+ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include +#include +#include + +#include +#include +#include + +/*! Encode given list of information into a TLV-based message buffer + * + * The given list of information is represented by \ref value_string + * structure, where value defines a kind of information (e.g. firmware + * version, board name), and string in its turn defines the information + * itself (e.g. '0.8.1.28-91e7b', 'AT91SAM7S'). + * + * Limitations: Tag and Length values occupy one byte each, so it's + * possible to encode up to 256 unique information chunks, up to + * 256 bytes long each. This should be enough for the most cases. + * Exceeding T and V values are not permitted. + * + * Note: strings are encoded with '\0'! + * + * \param[out] msg caller allocated message buffer + * \param[in] info list of information to be encoded + * \returns how many info chunks were encoded + */ +int osmo_nego_enc_info(struct msgb *msg, const struct value_string *info) +{ + size_t len; + int i; + + /* Iterate over a given info list */ + for (i = 0;; i++) { + if (info[i].value == 0 && info[i].str == NULL) + break; + + /* Encoding limitations */ + OSMO_ASSERT(info[i].value <= 0xff); + OSMO_ASSERT(info[i].str != NULL); + + /* Strings are encoded with '\0' */ + len = strlen(info[i].str) + 1; + OSMO_ASSERT(len <= 0xff); + + msgb_tlv_put(msg, info[i].value, len, + (const uint8_t *) info[i].str); + } + + return i; +} + +/*! Get info chunk corresponding to a given tag + * + * \param[in] buf TLV-encoded buffer to be parsed + * \param[in] buf_len TLV-encoded buffer length + * \param[in] info_tag tag of required info + * \returns pointer to info string or NULL + */ +const char *osmo_nego_get_info(const uint8_t *buf, size_t buf_len, uint8_t info_tag) +{ + const uint8_t *pos = buf; + uint8_t tag, len; + + while ((pos + 2) < (buf + buf_len)) { + tag = pos[0]; + len = pos[1]; + + /* Prevent string out of bounds */ + if ((pos + 2 + len) > (buf + buf_len)) + break; + + /* Match info tag */ + if (tag == info_tag) + return (char *)(pos + 2); + + /* Seek the pointer */ + pos += len + 2; + } + + return NULL; +} + +/*! Append a new feature to a given list of features + * + * Limitations: up to 256 features can be encoded. + * + * \param[out] msg caller allocated message buffer + * \param[in] feature a new feature to be added + */ +void osmo_nego_add_feature(struct msgb *msg, uint8_t feature) +{ + uint8_t *byte = msgb_put(msg, 1); + *byte = feature; +} + +/*! Append a new feature to a given list of features + * + * \param[in] buf feature list to be parsed + * \param[in] buf_len feature list length + * \param[in] feature the feature to be checked + * \returns true if the feature is preset, + * false otherwise + */ +bool osmo_nego_check_feature(const uint8_t *buf, size_t buf_len, uint8_t feature) +{ + size_t i; + + for (i = 0; i < buf_len; i++) + if (buf[i] == feature) + return true; + + return false; +} diff --git a/tests/Makefile.am b/tests/Makefile.am index db4e520..9e75dcf 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -23,7 +23,8 @@ coding/coding_test conv/conv_gsm0503_test \ abis/abis_test endian/endian_test sercomm/sercomm_test \ prbs/prbs_test gsm23003/gsm23003_test \ - codec/codec_ecu_fr_test timer/clk_override_test + codec/codec_ecu_fr_test timer/clk_override_test \ + nego/nego_test if ENABLE_MSGFILE check_PROGRAMS += msgfile/msgfile_test @@ -194,6 +195,9 @@ gsm23003_gsm23003_test_SOURCES = gsm23003/gsm23003_test.c gsm23003_gsm23003_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la +nego_nego_test_SOURCES = nego/nego_test.c +nego_nego_test_LDADD = $(LDADD) + # The `:;' works around a Bash 3.2 bug when the output is not writeable. $(srcdir)/package.m4: $(top_srcdir)/configure.ac :;{ \ @@ -253,7 +257,7 @@ conv/conv_gsm0503_test.ok endian/endian_test.ok \ sercomm/sercomm_test.ok prbs/prbs_test.ok \ gsm23003/gsm23003_test.ok \ - timer/clk_override_test.ok + timer/clk_override_test.ok nego/nego_test.ok DISTCLEANFILES = atconfig atlocal conv/gsm0503_test_vectors.c BUILT_SOURCES = conv/gsm0503_test_vectors.c diff --git a/tests/nego/nego_test.c b/tests/nego/nego_test.c new file mode 100644 index 0000000..ec19f16 --- /dev/null +++ b/tests/nego/nego_test.c @@ -0,0 +1,170 @@ +/* + * (C) 2018 by Vadim Yanitskiy + * + * All Rights Reserved + * + * SPDX-License-Identifier: GPL-2.0+ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include +#include +#include +#include + +#define NEGO_MSGB_SIZE 256 + +enum nego_test_feature_tag { + NEGO_TEST_FEATURE_F0 = 0, + NEGO_TEST_FEATURE_F1, + NEGO_TEST_FEATURE_F2, + NEGO_TEST_FEATURE_F3, + NEGO_TEST_FEATURE_F4, + NEGO_TEST_FEATURE_F5, + _NEGO_TEST_FEATURE_MAX +}; + +void nego_test_features(void) +{ + struct msgb *msg; + bool check; + + printf("[T] Testing negotiation of features...\n"); + + msg = msgb_alloc(NEGO_MSGB_SIZE, "nego_features"); + OSMO_ASSERT(msg); + + printf("[i] Encoding a few features\n"); + osmo_nego_add_feature(msg, NEGO_TEST_FEATURE_F2); + osmo_nego_add_feature(msg, NEGO_TEST_FEATURE_F5); + printf("[?] Message: %s\n", msgb_hexdump(msg)); + + printf("[i] Verifying recently encoded features...\n"); + check = osmo_nego_check_feature(msg->data, + msgb_length(msg), NEGO_TEST_FEATURE_F2); + OSMO_ASSERT(check); + check = osmo_nego_check_feature(msg->data, + msgb_length(msg), NEGO_TEST_FEATURE_F5); + OSMO_ASSERT(check); + printf("[+] Expected features preset\n"); + + printf("[i] Verifying non-existing features...\n"); + check = osmo_nego_check_feature(msg->data, + msgb_length(msg), NEGO_TEST_FEATURE_F1); + OSMO_ASSERT(!check); + check = osmo_nego_check_feature(msg->data, + msgb_length(msg), NEGO_TEST_FEATURE_F3); + OSMO_ASSERT(!check); + check = osmo_nego_check_feature(msg->data, + msgb_length(msg), NEGO_TEST_FEATURE_F4); + OSMO_ASSERT(!check); + printf("[+] Unexpected features not preset\n"); + + printf("[i] Adding some more features...\n"); + osmo_nego_add_feature(msg, NEGO_TEST_FEATURE_F1); + osmo_nego_add_feature(msg, NEGO_TEST_FEATURE_F3); + printf("[?] Message: %s\n", msgb_hexdump(msg)); + + msgb_free(msg); + printf("\n"); +} + +enum nego_test_info_tag { + NEGO_TEST_INFO_PROP0 = 0, + NEGO_TEST_INFO_PROP1, + NEGO_TEST_INFO_PROP2, + NEGO_TEST_INFO_PROP3, + _NEGO_TEST_INFO_MAX +}; + +static const struct value_string info_list[] = { + OSMO_VALUE_STRING(NEGO_TEST_INFO_PROP0), + OSMO_VALUE_STRING(NEGO_TEST_INFO_PROP1), + /* NEGO_TEST_INFO_PROP2 is intentionally not included */ + OSMO_VALUE_STRING(NEGO_TEST_INFO_PROP3), + { 0, NULL } +}; + +int dump_encoded_info(struct msgb *msg, bool print_info) +{ + const char *info_str; + int count = 0; + uint8_t tag; + + for (tag = 0; tag < _NEGO_TEST_INFO_MAX; tag++) { + info_str = osmo_nego_get_info(msg->data, msgb_length(msg), tag); + if (!info_str) + continue; + + if (print_info) + printf("[?] Decoded info: tag 0x%02x, value '%s'\n", tag, info_str); + + count++; + } + + return count; +} + +void nego_test_info(void) +{ + const char *info_str; + struct msgb *msg; + int rc, len; + + printf("[T] Testing info negotiation...\n"); + + msg = msgb_alloc(NEGO_MSGB_SIZE, "nego_info"); + OSMO_ASSERT(msg); + + printf("[i] Encoding info list...\n"); + rc = osmo_nego_enc_info(msg, info_list); + OSMO_ASSERT(rc > 0); + printf("[?] Encoded %d chunks\n", rc); + printf("[?] Message: %s\n", msgb_hexdump(msg)); + + printf("[i] Checking encoded info...\n"); + dump_encoded_info(msg, true); + + printf("[i] Trying to get missing info...\n"); + info_str = osmo_nego_get_info(msg->data, + msgb_length(msg), NEGO_TEST_INFO_PROP2); + OSMO_ASSERT(info_str == NULL); + printf("[+] Unexpected info not preset\n"); + + printf("[i] Checking buffer limiting...\n"); + len = msgb_length(msg); + do { + msgb_trim(msg, len); + rc = dump_encoded_info(msg, false); + printf("[?] Buffer len=%d, decoded=%d\n", len, rc); + } while (--len >= 0); + + msgb_free(msg); + printf("\n"); +} + +int main(int argc, char **argv) +{ + void *ctx = talloc_init("nego_test"); + msgb_talloc_ctx_init(ctx, 0); + + nego_test_features(); + nego_test_info(); + + printf("[i] Success!\n"); + return 0; +} diff --git a/tests/nego/nego_test.ok b/tests/nego/nego_test.ok new file mode 100644 index 0000000..285b089 --- /dev/null +++ b/tests/nego/nego_test.ok @@ -0,0 +1,93 @@ +[T] Testing negotiation of features... +[i] Encoding a few features +[?] Message: 02 05 +[i] Verifying recently encoded features... +[+] Expected features preset +[i] Verifying non-existing features... +[+] Unexpected features not preset +[i] Adding some more features... +[?] Message: 02 05 01 03 + +[T] Testing info negotiation... +[i] Encoding info list... +[?] Encoded 3 chunks +[?] Message: 00 15 4e 45 47 4f 5f 54 45 53 54 5f 49 4e 46 4f 5f 50 52 4f 50 30 00 01 15 4e 45 47 4f 5f 54 45 53 54 5f 49 4e 46 4f 5f 50 52 4f 50 31 00 03 15 4e 45 47 4f 5f 54 45 53 54 5f 49 4e 46 4f 5f 50 52 4f 50 33 00 +[i] Checking encoded info... +[?] Decoded info: tag 0x00, value 'NEGO_TEST_INFO_PROP0' +[?] Decoded info: tag 0x01, value 'NEGO_TEST_INFO_PROP1' +[?] Decoded info: tag 0x03, value 'NEGO_TEST_INFO_PROP3' +[i] Trying to get missing info... +[+] Unexpected info not preset +[i] Checking buffer limiting... +[?] Buffer len=69, decoded=3 +[?] Buffer len=68, decoded=2 +[?] Buffer len=67, decoded=2 +[?] Buffer len=66, decoded=2 +[?] Buffer len=65, decoded=2 +[?] Buffer len=64, decoded=2 +[?] Buffer len=63, decoded=2 +[?] Buffer len=62, decoded=2 +[?] Buffer len=61, decoded=2 +[?] Buffer len=60, decoded=2 +[?] Buffer len=59, decoded=2 +[?] Buffer len=58, decoded=2 +[?] Buffer len=57, decoded=2 +[?] Buffer len=56, decoded=2 +[?] Buffer len=55, decoded=2 +[?] Buffer len=54, decoded=2 +[?] Buffer len=53, decoded=2 +[?] Buffer len=52, decoded=2 +[?] Buffer len=51, decoded=2 +[?] Buffer len=50, decoded=2 +[?] Buffer len=49, decoded=2 +[?] Buffer len=48, decoded=2 +[?] Buffer len=47, decoded=2 +[?] Buffer len=46, decoded=2 +[?] Buffer len=45, decoded=1 +[?] Buffer len=44, decoded=1 +[?] Buffer len=43, decoded=1 +[?] Buffer len=42, decoded=1 +[?] Buffer len=41, decoded=1 +[?] Buffer len=40, decoded=1 +[?] Buffer len=39, decoded=1 +[?] Buffer len=38, decoded=1 +[?] Buffer len=37, decoded=1 +[?] Buffer len=36, decoded=1 +[?] Buffer len=35, decoded=1 +[?] Buffer len=34, decoded=1 +[?] Buffer len=33, decoded=1 +[?] Buffer len=32, decoded=1 +[?] Buffer len=31, decoded=1 +[?] Buffer len=30, decoded=1 +[?] Buffer len=29, decoded=1 +[?] Buffer len=28, decoded=1 +[?] Buffer len=27, decoded=1 +[?] Buffer len=26, decoded=1 +[?] Buffer len=25, decoded=1 +[?] Buffer len=24, decoded=1 +[?] Buffer len=23, decoded=1 +[?] Buffer len=22, decoded=0 +[?] Buffer len=21, decoded=0 +[?] Buffer len=20, decoded=0 +[?] Buffer len=19, decoded=0 +[?] Buffer len=18, decoded=0 +[?] Buffer len=17, decoded=0 +[?] Buffer len=16, decoded=0 +[?] Buffer len=15, decoded=0 +[?] Buffer len=14, decoded=0 +[?] Buffer len=13, decoded=0 +[?] Buffer len=12, decoded=0 +[?] Buffer len=11, decoded=0 +[?] Buffer len=10, decoded=0 +[?] Buffer len=9, decoded=0 +[?] Buffer len=8, decoded=0 +[?] Buffer len=7, decoded=0 +[?] Buffer len=6, decoded=0 +[?] Buffer len=5, decoded=0 +[?] Buffer len=4, decoded=0 +[?] Buffer len=3, decoded=0 +[?] Buffer len=2, decoded=0 +[?] Buffer len=1, decoded=0 +[?] Buffer len=0, decoded=0 + +[i] Success! diff --git a/tests/testsuite.at b/tests/testsuite.at index 15a89b6..5ab3373 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -311,3 +311,9 @@ cat $abs_srcdir/gsm23003/gsm23003_test.ok > expout AT_CHECK([$abs_top_builddir/tests/gsm23003/gsm23003_test], [0], [expout], [ignore]) AT_CLEANUP + +AT_SETUP([nego]) +AT_KEYWORDS([nego]) +cat $abs_srcdir/nego/nego_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/nego/nego_test], [0], [expout], [ignore]) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/10034 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I6fd5b6be6755d4aa735a510e95459180225389ba Gerrit-Change-Number: 10034 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 18 02:14:00 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 18 Jul 2018 02:14:00 +0000 Subject: Change in libosmocore[master]: Introduce info / features negotiation helper functions In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10034 to look at the new patch set (#2). Change subject: Introduce info / features negotiation helper functions ...................................................................... Introduce info / features negotiation helper functions In some projects, such as OsmocomBB and SIMTrace, where the host software needs to communicate with different HW / SW back-ends (e.g. OsmocomBB/mobile and Calypso firmware), it is important to have a possibility to negotiate some information between the both sides, for example, a list of supported features, or some meta-information about a hardware back-end. This change introduces the new API exactly for that, and can be used in order to avoid code duplication, and implementing the wheel again and again. At the moment, there are two kinds of information that can be negotiated: - TLV-based text chunks, - feature flags. First kind of info can be used to describe some meta-information, for example, HW board name, FW or SW version. Also, it can be used to describe some non-binary properties, for example, a preferred TCH frame format. The feature flags can be used to indicate that one or more features from a set shared between the both sides is/are supported. If particular flag is preset in the encoded message, the associated feature is supported, otherwise it is not supported, or not implemented. Basic usage examples can be found in implementation of the unit test: tests/nego/nego_test.c. Change-Id: I6fd5b6be6755d4aa735a510e95459180225389ba --- M include/Makefile.am A include/osmocom/core/negotiation.h M src/Makefile.am A src/negotiation.c M tests/Makefile.am A tests/nego/nego_test.c A tests/nego/nego_test.ok M tests/testsuite.at 8 files changed, 429 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/34/10034/2 -- To view, visit https://gerrit.osmocom.org/10034 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6fd5b6be6755d4aa735a510e95459180225389ba Gerrit-Change-Number: 10034 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 18 02:24:02 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 18 Jul 2018 02:24:02 +0000 Subject: Change in libosmocore[master]: Introduce info / features negotiation helper functions In-Reply-To: References: Message-ID: Hello K?vin Redon, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10034 to look at the new patch set (#3). Change subject: Introduce info / features negotiation helper functions ...................................................................... Introduce info / features negotiation helper functions In some projects, such as OsmocomBB and SIMTrace, where the host software needs to communicate with different HW / SW back-ends (e.g. OsmocomBB/mobile and Calypso firmware), it is important to have a possibility to negotiate some information between the both sides, for example, a list of supported features, or some meta-information about a hardware back-end. This change introduces the new API exactly for that, and can be used in order to avoid code duplication, and implementing the wheel again and again. At the moment, there are two kinds of information that can be negotiated: - TLV-based text chunks, - feature flags. First kind of info can be used to describe some meta-information, for example, HW board name, FW or SW version. Also, it can be used to describe some non-binary properties, for example, a preferred TCH frame format. The feature flags can be used to indicate that one or more features from a set shared between the both sides is/are supported. If particular flag is preset in the encoded message, the associated feature is supported, otherwise it is not supported, or not implemented. Basic usage examples can be found in implementation of the unit test: tests/nego/nego_test.c. Change-Id: I6fd5b6be6755d4aa735a510e95459180225389ba Related: OS#1460, OS#1461 --- M include/Makefile.am A include/osmocom/core/negotiation.h M src/Makefile.am A src/negotiation.c M tests/Makefile.am A tests/nego/nego_test.c A tests/nego/nego_test.ok M tests/testsuite.at 8 files changed, 429 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/34/10034/3 -- To view, visit https://gerrit.osmocom.org/10034 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6fd5b6be6755d4aa735a510e95459180225389ba Gerrit-Change-Number: 10034 Gerrit-PatchSet: 3 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 18 09:36:01 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 18 Jul 2018 09:36:01 +0000 Subject: Change in osmo-ttcn3-hacks[master]: Stop tests after failures In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9907 ) Change subject: Stop tests after failures ...................................................................... Patch Set 1: It seems TTCN3 doesn't like passing variables in the middle at log() time. Compilation files at this line: Notify: Parsing TTCN-3 module `Test.ttcn'... Test.ttcn:142.20: error: at or before token `,': syntax error, unexpected ',' Looking at the file: log("Fail: No ", key, " in TC=", tc, "!"); -- To view, visit https://gerrit.osmocom.org/9907 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9b618235939fa41160b9be6677b121963d3ec857 Gerrit-Change-Number: 9907 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 18 Jul 2018 09:36:01 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 18 09:41:54 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 18 Jul 2018 09:41:54 +0000 Subject: Change in osmo-ttcn3-hacks[master]: library: Ensure setverdict(fail is followed by mtc.stop In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9905 ) Change subject: library: Ensure setverdict(fail is followed by mtc.stop ...................................................................... Patch Set 1: (9 comments) https://gerrit.osmocom.org/#/c/9905/1/library/BSSGP_Emulation.ttcn File library/BSSGP_Emulation.ttcn: https://gerrit.osmocom.org/#/c/9905/1/library/BSSGP_Emulation.ttcn at 291 PS1, Line 291: testcase.stop("Client Table full"); Why do you use testcase.stop instead of setverdict(fail) + mtc.stop here? https://gerrit.osmocom.org/#/c/9905/1/library/BSSMAP_Emulation.ttcn File library/BSSMAP_Emulation.ttcn: https://gerrit.osmocom.org/#/c/9905/1/library/BSSMAP_Emulation.ttcn at 322 PS1, Line 322: testcase.stop("BSSMAP Connection table full!"); Same here. https://gerrit.osmocom.org/#/c/9905/1/library/BSSMAP_Emulation.ttcn at 796 PS1, Line 796: testcase.stop("No space left in ExpectTable"); Same https://gerrit.osmocom.org/#/c/9905/1/library/BSSMAP_Emulation.ttcn at 810 PS1, Line 810: testcase.stop("No space left in ImsiTable"); Same https://gerrit.osmocom.org/#/c/9905/1/library/GSUP_Emulation.ttcn File library/GSUP_Emulation.ttcn: https://gerrit.osmocom.org/#/c/9905/1/library/GSUP_Emulation.ttcn at 143 PS1, Line 143: testcase.stop("GSUP IMSI table full!"); Same https://gerrit.osmocom.org/#/c/9905/1/library/GSUP_Emulation.ttcn at 286 PS1, Line 286: testcase.stop("No space left in GsupExpectTable"); Same https://gerrit.osmocom.org/#/c/9905/1/library/GTP_Emulation.ttcn File library/GTP_Emulation.ttcn: https://gerrit.osmocom.org/#/c/9905/1/library/GTP_Emulation.ttcn at 88 PS1, Line 88: testcase.stop("No Space in TidTable for ", teid); Same https://gerrit.osmocom.org/#/c/9905/1/library/GTP_Emulation.ttcn at 100 PS1, Line 100: testcase.stop("No Space in IMSI Table for ", imsi); Same https://gerrit.osmocom.org/#/c/9905/1/library/Osmocom_Types.ttcn File library/Osmocom_Types.ttcn: https://gerrit.osmocom.org/#/c/9905/1/library/Osmocom_Types.ttcn at 98 PS1, Line 98: setverdict(fail, "Unsupported template", inp); I'd say this one cannot be reached, so we can drop it. -- To view, visit https://gerrit.osmocom.org/9905 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Idc6819aaf0b01e70c38fad828dd44dcec6bdd778 Gerrit-Change-Number: 9905 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 18 Jul 2018 09:41:54 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 18 09:59:06 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 18 Jul 2018 09:59:06 +0000 Subject: Change in osmo-ttcn3-hacks[master]: Stop tests after failures In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/9907 ) Change subject: Stop tests after failures ...................................................................... Patch Set 1: > log("Fail: No ", key, " in TC=", tc, "!"); Most likely it should be written in the following way: > log("Fail: No " & key & " in TC=" & tc & "!"); -- To view, visit https://gerrit.osmocom.org/9907 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9b618235939fa41160b9be6677b121963d3ec857 Gerrit-Change-Number: 9907 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 18 Jul 2018 09:59:06 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 18 11:48:58 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 18 Jul 2018 11:48:58 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: Remove uneeded f_gtpu_send in f_gtpu_xceive_mo Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10035 Change subject: sgsn: Remove uneeded f_gtpu_send in f_gtpu_xceive_mo ...................................................................... sgsn: Remove uneeded f_gtpu_send in f_gtpu_xceive_mo It's not needed for the functionality/scenario of f_gtpu_xceive_mo. It probably was left in when creating it from f_gtpu_xceive_mo. Change-Id: Ide226f8501c4598e2bfaa5f1ea62c3ff20807ce4 --- M sgsn/SGSN_Tests.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/35/10035/1 diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index d7e956f..d76c182 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -1117,12 +1117,12 @@ } } +/* Transceive given 'payload' as MT message from Gb -> OsmoSGSN -> GTP */ private function f_gtpu_xceive_mo(inout PdpActPars apars, octetstring payload) runs on BSSGP_ConnHdlr { /* Send PDU via SNDCP/LLC/BSSGP/NS via simulated MS/PCU to the SGSN */ var GtpPeer peer := valueof(ts_GtpPeerU(apars.sgsn_ip_u)); var PDU_SN sndcp := valueof(ts_SN_UD(apars.nsapi, payload)); BSSGP.send(ts_LLC_UI(enc_PDU_SN(sndcp), apars.sapi, '0'B, 0)); - f_gtpu_send(apars, payload); /* Expect PDU via GTP from SGSN on simulated GGSN */ alt { [] GTP.receive(tr_GTPU_GPDU(peer, apars.ggsn_tei_u, payload)); -- To view, visit https://gerrit.osmocom.org/10035 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ide226f8501c4598e2bfaa5f1ea62c3ff20807ce4 Gerrit-Change-Number: 10035 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 18 11:48:58 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 18 Jul 2018 11:48:58 +0000 Subject: Change in osmo-ttcn3-hacks[master]: lib: gtp: Add templates to send ErrorIndiciation Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10036 Change subject: lib: gtp: Add templates to send ErrorIndiciation ...................................................................... lib: gtp: Add templates to send ErrorIndiciation Change-Id: I7c20bc3b62a953efe57eb05a8ba89f9f0830a816 --- M library/GTP_Templates.ttcn 1 file changed, 25 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/36/10036/1 diff --git a/library/GTP_Templates.ttcn b/library/GTP_Templates.ttcn index a9d2394..d0a87e3 100644 --- a/library/GTP_Templates.ttcn +++ b/library/GTP_Templates.ttcn @@ -667,6 +667,31 @@ gtpu := ts_GTP1U_PDU(echoResponse, seq, '00000000'O, valueof(ts_UEchoRespPDU(rest_ctr))) } + template GSNAddress_gtpu ts_UGsnAddr(octetstring ip_addr) := { + type_gtpu := '85'O, + lengthf := lengthof(ip_addr), + gSNAddressValue := ip_addr + } + + template TeidDataI_gtpu ts_UteidDataI(OCT4 teid) := { + type_gtpu := '10'O, + teidDataI := teid + } + + template GTPU_IEs ts_UErrorIndication(OCT4 teid, octetstring gsn_addr) := { + errorIndication_IEs := { + teidDataI_gtpu := ts_UteidDataI(teid), + gSNAddress_gtpu := ts_UGsnAddr(gsn_addr), + private_extension_gtpu := omit + } + } + + /* master template for sending a GTP-U Error indication */ + template Gtp1uUnitdata ts_GTPU_ErrorIndication(GtpPeer peer, uint16_t seq, OCT4 teid, octetstring gsn_addr) := { + peer := peer, + gtpu := ts_GTP1U_PDU('1A'O, seq, '00000000'O, valueof(ts_UErrorIndication(teid, gsn_addr))) + } + /* master template for sending a GTP-U user plane data */ template Gtp1uUnitdata ts_GTP1U_GPDU(GtpPeer peer, template (omit) uint16_t seq, OCT4 teid, octetstring data) := { peer := peer, -- To view, visit https://gerrit.osmocom.org/10036 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I7c20bc3b62a953efe57eb05a8ba89f9f0830a816 Gerrit-Change-Number: 10036 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 18 11:49:00 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 18 Jul 2018 11:49:00 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: Add test to verify GPRS ctx deact caused by GTP ErrorInd Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10037 Change subject: sgsn: Add test to verify GPRS ctx deact caused by GTP ErrorInd ...................................................................... sgsn: Add test to verify GPRS ctx deact caused by GTP ErrorInd Change-Id: I40e877f4126e62a731b071ae1d6d855fed210433 --- M sgsn/SGSN_Tests.ttcn M sgsn/expected-results.xml 2 files changed, 33 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/37/10037/1 diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index d76c182..78086af 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -959,19 +959,22 @@ } } -function f_pdp_ctx_deact_mt(inout PdpActPars apars, OCT1 cause) runs on BSSGP_ConnHdlr { +function f_pdp_ctx_deact_mt(inout PdpActPars apars, boolean error_ind := false) runs on BSSGP_ConnHdlr { var Gtp1cUnitdata g_ud; var integer seq_nr := 23; var GtpPeer peer := valueof(ts_GtpPeerC(apars.sgsn_ip_c)); BSSGP.clear; - GTP.send(ts_GTPC_DeletePDP(peer, seq_nr, apars.sgsn_tei_c, apars.nsapi, '1'B)); - - interleave { + if (error_ind) { + GTP.send(ts_GTPU_ErrorIndication(peer, 0 /* seq */, apars.ggsn_tei_u, apars.ggsn_ip_u)); + } else { + GTP.send(ts_GTPC_DeletePDP(peer, seq_nr, apars.sgsn_tei_c, apars.nsapi, '1'B)); + } + alt { [] BSSGP.receive(tr_BD_L3_MT(tr_SM_DEACT_PDP_REQ_MT(apars.tid, ?, true))) { BSSGP.send(ts_SM_DEACT_PDP_ACCEPT_MO(apars.tid)); } - [] GTP.receive(tr_GTPC_MsgType(?, deletePDPContextResponse, apars.ggsn_tei_c)) { } + [not error_ind] GTP.receive(tr_GTPC_MsgType(?, deletePDPContextResponse, apars.ggsn_tei_c)) { } } } @@ -1241,7 +1244,7 @@ f_gtpu_xceive_mt(apars, f_rnd_octstring(100)); f_gtpu_xceive_mo(apars, f_rnd_octstring(200)); - f_pdp_ctx_deact_mt(apars, '00'O); + f_pdp_ctx_deact_mt(apars, false); } testcase TC_attach_pdp_act_user_deact_mt() runs on test_CT { var BSSGP_ConnHdlr vc_conn; @@ -1411,6 +1414,27 @@ } } +/* ATTACH + PDP CTX ACT + user plane traffic + ERROR IND in MT direction */ +private function f_TC_attach_pdp_act_user_error_ind_ggsn(charstring id) runs on BSSGP_ConnHdlr { + var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip)); + + /* first perform regular attach */ + f_TC_attach(id); + /* then activate PDP context */ + f_pdp_ctx_act(apars); + /* then transceive a downlink PDU */ + f_gtpu_xceive_mo(apars, f_rnd_octstring(200)); + + /* Send Error indication as response from upload PDU and expect deact towards MS */ + f_pdp_ctx_deact_mt(apars, true); +} +testcase TC_attach_pdp_act_user_error_ind_ggsn() runs on test_CT { + var BSSGP_ConnHdlr vc_conn; + f_init(); + vc_conn := f_start_handler(refers(f_TC_attach_pdp_act_user_error_ind_ggsn), testcasename(), g_gb[0], 26); + vc_conn.done; +} + testcase TC_hlr_location_cancel_request_update() runs on test_CT { /* MS <-> SGSN: GMM Attach * HLR -> SGSN: Cancel Location Request @@ -1762,6 +1786,7 @@ execute( TC_attach_restart_ctr_echo() ); execute( TC_attach_restart_ctr_create() ); execute( TC_attach_pdp_act_deact_mt_t3395_expire() ); + execute( TC_attach_pdp_act_user_error_ind_ggsn() ); } diff --git a/sgsn/expected-results.xml b/sgsn/expected-results.xml index 5b756cd..bb38a7c 100644 --- a/sgsn/expected-results.xml +++ b/sgsn/expected-results.xml @@ -1,5 +1,5 @@ - + @@ -63,4 +63,5 @@ + -- To view, visit https://gerrit.osmocom.org/10037 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I40e877f4126e62a731b071ae1d6d855fed210433 Gerrit-Change-Number: 10037 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Wed Jul 18 15:10:06 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Wed, 18 Jul 2018 15:10:06 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-asn1c_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#188?= In-Reply-To: <857769140.213.1531840206360.JavaMail.jenkins@jenkins.osmocom.org> References: <857769140.213.1531840206360.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <2095671232.222.1531926606514.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 3.67 KB...] + ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for style of include used by make... GNU checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking how to run the C++ preprocessor... g++ -E checking for g77... no checking for f77... no checking for xlf... no checking for frt... no checking for pgf77... no checking for cf77... no checking for fort77... no checking for fl32... no checking for af77... no checking for f90... no checking for xlf90... no checking for pgf90... no checking for pghpf... no checking for epcf90... no checking for gfortran... no checking for g95... no checking for f95... no checking for fort... no checking for xlf95... no checking for ifort... no checking for ifc... no checking for efc... no checking for pgf95... no checking for lf95... no checking for ftn... no checking whether we are using the GNU Fortran 77 compiler... no checking whether accepts -g... no checking the maximum length of command line arguments... 32768 checking command to parse /usr/bin/nm -B output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes configure: creating libtool appending configuration tag "CXX" to libtool checking for ld used by g++... /usr/bin/ld -m elf_x86_64 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC checking if g++ PIC flag -fPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate appending configuration tag "F77" to libtool checking for autoconf... /usr/bin/autoconf checking for autoheader... /usr/bin/autoheader checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking dependency style of gcc... (cached) gcc3 checking how to run the C preprocessor... gcc -E checking for a BSD-compatible install... /usr/bin/install -c checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking for bison... bison -y checking for flex... flex checking for yywrap in -lfl... yes checking lex output file root... lex.yy checking whether yytext is a pointer... yes checking for ar... /usr/bin/ar checking for ANSI C header files... (cached) yes checking sys/param.h usability... yes checking sys/param.h presence... yes checking for sys/param.h... yes checking whether byte ordering is bigendian... no checking for off_t... yes checking for size_t... yes checking whether struct tm is in sys/time.h or time.h... time.h checking for intmax_t... yes checking for library containing getopt... none required checking for strtoimax... yes checking for strtoll... yes checking for mergesort... no checking for mkstemps... yes configure: creating ./config.status config.status: creating skeletons/standard-modules/Makefile config.status: creating skeletons/tests/Makefile config.status: creating libasn1compiler/Makefile config.status: creating libasn1parser/Makefile config.status: creating libasn1print/Makefile config.status: creating asn1c/webcgi/Makefile config.status: creating asn1c/tests/Makefile config.status: creating libasn1fix/Makefile config.status: creating skeletons/Makefile config.status: creating examples/Makefile config.status: creating tests/Makefile config.status: creating asn1c/Makefile config.status: creating doc/Makefile config.status: creating asn1c.spec config.status: creating Makefile config.status: creating config.h config.status: executing depfiles commands + make -j 8 make all-recursive make[1]: Entering directory ' Making all in libasn1parser make[2]: Entering directory ' if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF ".deps/asn1parser.Tpo" -c -o asn1parser.lo asn1parser.c; \ then mv -f ".deps/asn1parser.Tpo" ".deps/asn1parser.Plo"; else rm -f ".deps/asn1parser.Tpo"; exit 1; fi bison -y -p asn1p_ -d asn1p_y.y if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF ".deps/asn1p_l.Tpo" -c -o asn1p_l.lo asn1p_l.c; \ then mv -f ".deps/asn1p_l.Tpo" ".deps/asn1p_l.Plo"; else rm -f ".deps/asn1p_l.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF ".deps/asn1p_module.Tpo" -c -o asn1p_module.lo asn1p_module.c; \ then mv -f ".deps/asn1p_module.Tpo" ".deps/asn1p_module.Plo"; else rm -f ".deps/asn1p_module.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF ".deps/asn1p_oid.Tpo" -c -o asn1p_oid.lo asn1p_oid.c; \ then mv -f ".deps/asn1p_oid.Tpo" ".deps/asn1p_oid.Plo"; else rm -f ".deps/asn1p_oid.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF ".deps/asn1p_value.Tpo" -c -o asn1p_value.lo asn1p_value.c; \ then mv -f ".deps/asn1p_value.Tpo" ".deps/asn1p_value.Plo"; else rm -f ".deps/asn1p_value.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF ".deps/asn1p_expr.Tpo" -c -o asn1p_expr.lo asn1p_expr.c; \ then mv -f ".deps/asn1p_expr.Tpo" ".deps/asn1p_expr.Plo"; else rm -f ".deps/asn1p_expr.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF ".deps/asn1p_xports.Tpo" -c -o asn1p_xports.lo asn1p_xports.c; \ then mv -f ".deps/asn1p_xports.Tpo" ".deps/asn1p_xports.Plo"; else rm -f ".deps/asn1p_xports.Tpo"; exit 1; fi asn1p_y.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] mkdir .libs gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -fPIC -DPIC -o .libs/asn1p_value.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -fPIC -DPIC -o .libs/asn1parser.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -fPIC -DPIC -o .libs/asn1p_module.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -fPIC -DPIC -o .libs/asn1p_xports.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -fPIC -DPIC -o .libs/asn1p_oid.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -fPIC -DPIC -o .libs/asn1p_l.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -fPIC -DPIC -o .libs/asn1p_expr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -o asn1p_module.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -o asn1p_xports.o >/dev/null 2>&1 asn1p_l.c:3521:12: warning: 'input' defined but not used [-Wunused-function] static int input() ^~~~~ gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -o asn1p_oid.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -o asn1parser.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -o asn1p_value.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF ".deps/asn1p_constr.Tpo" -c -o asn1p_constr.lo asn1p_constr.c; \ then mv -f ".deps/asn1p_constr.Tpo" ".deps/asn1p_constr.Plo"; else rm -f ".deps/asn1p_constr.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF ".deps/asn1p_param.Tpo" -c -o asn1p_param.lo asn1p_param.c; \ then mv -f ".deps/asn1p_param.Tpo" ".deps/asn1p_param.Plo"; else rm -f ".deps/asn1p_param.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -o asn1p_expr.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF ".deps/asn1p_class.Tpo" -c -o asn1p_class.lo asn1p_class.c; \ then mv -f ".deps/asn1p_class.Tpo" ".deps/asn1p_class.Plo"; else rm -f ".deps/asn1p_class.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF ".deps/asn1p_ref.Tpo" -c -o asn1p_ref.lo asn1p_ref.c; \ then mv -f ".deps/asn1p_ref.Tpo" ".deps/asn1p_ref.Plo"; else rm -f ".deps/asn1p_ref.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -fPIC -DPIC -o .libs/asn1p_constr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -fPIC -DPIC -o .libs/asn1p_param.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -fPIC -DPIC -o .libs/asn1p_ref.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -fPIC -DPIC -o .libs/asn1p_class.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -o asn1p_param.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -o asn1p_constr.o >/dev/null 2>&1 if test -f y.tab.h; then \ to=`echo "asn1p_y_H" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \ sed -e "/^#/!b" -e "s/Y_TAB_H/$to/g" -e "s|y\.tab\.h|asn1p_y.h|" \ y.tab.h >asn1p_y.ht; \ rm -f y.tab.h; \ if cmp -s asn1p_y.ht asn1p_y.h; then \ rm -f asn1p_y.ht ;\ else \ mv asn1p_y.ht asn1p_y.h; \ fi; \ fi if test -f y.output; then \ mv y.output asn1p_y.output; \ fi sed '/^#/ s|y\.tab\.c|asn1p_y.c|' y.tab.c >asn1p_y.ct && mv asn1p_y.ct asn1p_y.c gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -o asn1p_ref.o >/dev/null 2>&1 rm -f y.tab.c if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF ".deps/asn1p_y.Tpo" -c -o asn1p_y.lo asn1p_y.c; \ then mv -f ".deps/asn1p_y.Tpo" ".deps/asn1p_y.Plo"; else rm -f ".deps/asn1p_y.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -o asn1p_class.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -o asn1p_l.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF .deps/asn1p_y.Tpo -c asn1p_y.c -fPIC -DPIC -o .libs/asn1p_y.o asn1p_y.y: In function 'asn1p_parse': asn1p_y.y:357:13: error: 'param' undeclared (first use in this function) *(void **)param = $1; ^~~~~ asn1p_y.y:357:13: note: each undeclared identifier is reported only once for each function it appears in Makefile:299: recipe for target 'asn1p_y.lo' failed make[2]: *** [asn1p_y.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory ' Makefile:302: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory ' Makefile:212: recipe for target 'all' failed make: *** [all] Error 2 Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Wed Jul 18 15:20:00 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 18 Jul 2018 15:20:00 +0000 Subject: Change in osmo-bsc[master]: chan_alloc: delete rtp voice related in lchan_free() Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/10038 Change subject: chan_alloc: delete rtp voice related in lchan_free() ...................................................................... chan_alloc: delete rtp voice related in lchan_free() The function lchan_free() is supposed to reset the lchan so that it can be used by another connection. This function does not yet delete the struct memebers in lchan->abis_ip. This may lead to confusion if some other end re-uses that lchan and finds old RTP voice port/ip settings there. Those data must be deleted to ensure it does accidently migrate into an unrelated conext. - do a memset to 0 on lchan->abis_ip in lchan_free() Change-Id: I0c99494292cd1d058a19a21413d0ddb51471c6be Related: OS#3396 --- M src/osmo-bsc/chan_alloc.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/38/10038/1 diff --git a/src/osmo-bsc/chan_alloc.c b/src/osmo-bsc/chan_alloc.c index a24fbea..9674c69 100644 --- a/src/osmo-bsc/chan_alloc.c +++ b/src/osmo-bsc/chan_alloc.c @@ -539,6 +539,9 @@ /* FIXME: ts_free() the timeslot, if we're the last logical * channel using it */ + + /* delete RTP voice connection related data */ + memset(&lchan->abis_ip, 0, sizeof(lchan->abis_ip)); } /* -- To view, visit https://gerrit.osmocom.org/10038 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I0c99494292cd1d058a19a21413d0ddb51471c6be Gerrit-Change-Number: 10038 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 18 15:20:01 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 18 Jul 2018 15:20:01 +0000 Subject: Change in osmo-bsc[master]: handover_logic: make sure IPACC is done before MGCP Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/10039 Change subject: handover_logic: make sure IPACC is done before MGCP ...................................................................... handover_logic: make sure IPACC is done before MGCP During handover, the IPACC negotiaton on RSL level must be done at least to the point where the BSC knows the IP-Address and the Port of the new BTS. Only when this data is known the handover logic may emit the GSCON_EV_HO_COMPL to tell the GSCON FSM that the handover is complete (including IPACC) - Add a signal handler that listens to SS_ABISIP signals. - In cases where IPACC has not been done yet, postpone GSCON_EV_HO_COMPL and let it send by the signal handler as soon as S_ABISIP_CRCX_ACK arrives. Change-Id: I01f05f5d8abe07a0d063e84a1984ac5797afb4f7 Related: OS#3396 --- M include/osmocom/bsc/gsm_data.h M src/osmo-bsc/handover_logic.c M tests/handover/handover_test.c 3 files changed, 47 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/39/10039/1 diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 5794617..1106176 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -428,6 +428,12 @@ uint8_t rr_cause; bool valid; } ass_compl; + + /* info we need to postpone the GSCON_EV_HO_COMPL event + * (see also handover_logic.c, function ho_gsm48_ho_compl() */ + struct { + bool postponed; + } ho_compl; } abis_ip; uint8_t rqd_ta; diff --git a/src/osmo-bsc/handover_logic.c b/src/osmo-bsc/handover_logic.c index 960bf69..ebc80b2 100644 --- a/src/osmo-bsc/handover_logic.c +++ b/src/osmo-bsc/handover_logic.c @@ -329,8 +329,19 @@ handover_free(ho); new_lchan->conn->ho = NULL; - /* Inform the GSCON FSM that the handover is complete */ - osmo_fsm_inst_dispatch(new_lchan->conn->fi, GSCON_EV_HO_COMPL, NULL); + /* It may be that the RSL RTP port/IP negotiation is not done yet. In + * this case we may not acknowledge the handover as completed yet. We + * must postpone GSCON_EV_HO_COMPL and wait for S_ABISIP_CRCX_ACK in + * order to be sure that the RTP port/IP information inside + * lchan->abis_ip is populated with valid data. + * (see also callback function: abisip_sig_cb()) */ + if (new_lchan->abis_ip.bound_port != 0) { + /* Inform the GSCON FSM that the handover is complete */ + osmo_fsm_inst_dispatch(new_lchan->conn->fi, GSCON_EV_HO_COMPL, NULL); + new_lchan->abis_ip.ho_compl.postponed = false; + } else + new_lchan->abis_ip.ho_compl.postponed = true; + return 0; } @@ -392,6 +403,25 @@ return 0; } +static int abisip_sig_cb(unsigned int subsys, unsigned int signal, + void *handler_data, void *signal_data) +{ + struct gsm_lchan *lchan = signal_data; + + if (subsys != SS_ABISIP) + return 0; + + switch (signal) { + case S_ABISIP_CRCX_ACK: + if (lchan->abis_ip.ho_compl.postponed) { + lchan->abis_ip.ho_compl.postponed = false; + osmo_fsm_inst_dispatch(lchan->conn->fi, GSCON_EV_HO_COMPL, NULL); + } + break; + } + return 0; +} + static int ho_logic_sig_cb(unsigned int subsys, unsigned int signal, void *handler_data, void *signal_data) { @@ -437,6 +467,11 @@ static __attribute__((constructor)) void on_dso_load_ho_logic(void) { osmo_signal_register_handler(SS_LCHAN, ho_logic_sig_cb, NULL); + + /* Note: We must also listen to ABISIP events to make sure that all + * RTP port/IP negotiation with the BTS is done before we acknowledge + * the handover as completed. */ + osmo_signal_register_handler(SS_ABISIP, abisip_sig_cb, NULL); } /* Count number of currently ongoing handovers diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c index 769fd06..57e7c11 100644 --- a/tests/handover/handover_test.c +++ b/tests/handover/handover_test.c @@ -416,6 +416,10 @@ msg->l2h = (unsigned char *)rh; msg->l3h = (unsigned char *)gh; + /* Pretend that the the IPACC negotiation has been done already */ + lchan->abis_ip.bound_port = 1; + lchan->abis_ip.ho_compl.postponed = false; + abis_rsl_rcvmsg(msg); } -- To view, visit https://gerrit.osmocom.org/10039 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I01f05f5d8abe07a0d063e84a1984ac5797afb4f7 Gerrit-Change-Number: 10039 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 18 15:27:44 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 18 Jul 2018 15:27:44 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_ConnectionHandler: make as_handover more race robust Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/10040 Change subject: MSC_ConnectionHandler: make as_handover more race robust ...................................................................... MSC_ConnectionHandler: make as_handover more race robust The IPACC and MDCX interaction happens nearly in parallel to the normal RSL connection that handles the handover, in particular the channel relase from the old BTS may arrive in between IPACC and MGCP operations. - When the channel release arrives, check if MGCP and IPACC operations are done (we have seen one MDCX on MGCP and an CRCX plus an MDCX on IPACC level) Change-Id: I207e9ece48ec53f872f82d981435cee7c2d0b094 Related: OS#3396 --- M bsc/MSC_ConnectionHandler.ttcn 1 file changed, 32 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/40/10040/1 diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index 63d017f..0d83f7b 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -74,6 +74,7 @@ /* BTS media state */ type record BtsMediaState { boolean ipa_crcx_seen, + boolean ipa_mdcx_seen, uint16_t conn_id, uint7_t rtp_pt, HostPort bts, @@ -91,6 +92,7 @@ /* BTS Side */ g_media.bts := { ipa_crcx_seen := false, + ipa_mdcx_seen := false, conn_id := nr, rtp_pt := 0, bts := { @@ -102,6 +104,7 @@ g_media.bts1 := { ipa_crcx_seen := false, + ipa_mdcx_seen := false, conn_id := nr, rtp_pt := 0, bts := { @@ -204,7 +207,7 @@ oct2int(f_inet_addr(g_media.bts.peer.host)), g_media.bts.peer.port_nr, g_media.bts.rtp_pt)); - //g_media.bts.ipa_mdcx_seen := true; + g_media.bts.ipa_mdcx_seen := true; repeat; } @@ -248,7 +251,7 @@ oct2int(f_inet_addr(g_media.bts1.peer.host)), g_media.bts1.peer.port_nr, g_media.bts1.rtp_pt)); - //g_media.bts1.ipa_mdcx_seen := true; + g_media.bts1.ipa_mdcx_seen := true; repeat; } @@ -257,7 +260,7 @@ /* altstep for handling of MGCP media related commands. Activated by as_Media() to test * MGW level media handling */ -altstep as_Media_mgw() runs on MSC_ConnHdlr { +altstep as_Media_mgw(boolean norepeat := false) runs on MSC_ConnHdlr { var MgcpCommand mgcp_cmd; [] MGCP.receive(tr_CRCX) -> value mgcp_cmd { @@ -290,7 +293,9 @@ f_mgcp_par_append(mgcp_resp.params, ts_MgcpParSpecEP(g_media.mgcp_ep)); MGCP.send(mgcp_resp); g_media.mgcp_conn[cid].crcx_seen := g_media.mgcp_conn[cid].crcx_seen + 1; - repeat; + if(norepeat == false) { + repeat; + } } [] MGCP.receive(tr_MDCX) -> value mgcp_cmd { var SDP_Message sdp; @@ -311,7 +316,9 @@ valueof(ts_SDP_ptime(mgcp_conn.ptime)) } )); MGCP.send(ts_MDCX_ACK(mgcp_cmd.line.trans_id, mgcp_conn.conn_id, sdp)); g_media.mgcp_conn[cid].mdcx_seen := g_media.mgcp_conn[cid].mdcx_seen + 1; - repeat; + if(norepeat == false) { + repeat; + } } } @@ -969,6 +976,7 @@ type record HandoverState { /* Assignment related bits */ boolean rr_ho_cmpl_seen, + integer mdcx_seen_before_ho, boolean handover_done, RslChannelNr old_chan_nr }; @@ -1004,13 +1012,18 @@ st.old_chan_nr := g_chan_nr; g_chan_nr := new_chan_nr; st.rr_ho_cmpl_seen := true; + + /* Memorize how many MDCX we have seen before. We need this number to detect + * that we have received the handover related MDCX */ + st.mdcx_seen_before_ho := g_media.mgcp_conn[0].mdcx_seen; repeat; } else { setverdict(fail, "Unexpected L3 received", l3); self.stop; } } - [st.rr_ho_cmpl_seen] as_Media(); + [st.rr_ho_cmpl_seen] as_Media_ipacc(); + [st.rr_ho_cmpl_seen] as_Media_mgw(true); [st.rr_ho_cmpl_seen] RSL.receive(tr_RSL_REL_REQ(st.old_chan_nr, tr_RslLinkID_DCCH(0))) { RSL.send(ts_RSL_REL_CONF(st.old_chan_nr, valueof(ts_RslLinkID_DCCH(0)))); repeat; @@ -1020,7 +1033,19 @@ /* unregister for old channel number in RSL emulation */ /* FIXME: Determine TRX NR by ARFCN, instead of hard-coded TRX0! */ f_rslem_unregister(0, st.old_chan_nr); - st.handover_done := true; + + /* The channel release must not necessarly be synchronized to the RSL handover + * procedure since those events may happen independently nearly at the same + * time. When we receive the RSL_RF_CHAN_REL command the media negotiation on + * IPACC or MGCP level may be still in progress. In order to make sure that + * we do only stop when we have seen an MDCX on MGCP level and another a CRCX + * as well as an MDCX on IPACC level. */ + if (g_media.mgcp_conn[0].mdcx_seen <= st.mdcx_seen_before_ho or + g_media.bts1.ipa_mdcx_seen == false or g_media.bts1.ipa_crcx_seen == false) { + repeat; + } else { + st.handover_done := true; + } } } -- To view, visit https://gerrit.osmocom.org/10040 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I207e9ece48ec53f872f82d981435cee7c2d0b094 Gerrit-Change-Number: 10040 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 18 22:08:32 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 18 Jul 2018 22:08:32 +0000 Subject: Change in osmo-ttcn3-hacks[master]: bsc: fix f_gen_ass_req(): populate codec list In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9998 ) Change subject: bsc: fix f_gen_ass_req(): populate codec list ...................................................................... Patch Set 1: Hmm. CSD and Speech Codec List: I assumed we wanted to see osmo-bsc rejecting on the grounds of it being a CSD, and not on grounds of lacking a speech codec list IE, didn't actually realize that a CSD has no Speech Codecs. Maybe a mandatory flag should enforce that the caller is aware of Speech Codec List presence... I need to take another look. -- To view, visit https://gerrit.osmocom.org/9998 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia18e44e93b0328ad26d741a3317753118fc57f9f Gerrit-Change-Number: 9998 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte Gerrit-Comment-Date: Wed, 18 Jul 2018 22:08:32 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 18 22:11:03 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 18 Jul 2018 22:11:03 +0000 Subject: Change in osmo-ttcn3-hacks[master]: bsc: fix f_establish_fully(): first RSL should be EST IND, not DATA In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/9999 ) Change subject: bsc: fix f_establish_fully(): first RSL should be EST IND, not DATA ...................................................................... bsc: fix f_establish_fully(): first RSL should be EST IND, not DATA Change-Id: Ia609b67c28ce07fa3bf33e3c4a5658046474d60a --- M bsc/MSC_ConnectionHandler.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index 63d017f..022cc63 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -650,7 +650,7 @@ f_rslem_register(0, new_chan_nr); var PDU_ML3_MS_NW l3_tx := valueof(ts_RRM_AssignmentComplete('00'O)); /* send assignment complete over the new channel */ - RSL.send(ts_RSL_DATA_IND(new_chan_nr, valueof(ts_RslLinkID_DCCH(0)), + RSL.send(ts_RSL_EST_IND(new_chan_nr, valueof(ts_RslLinkID_DCCH(0)), enc_PDU_ML3_MS_NW(l3_tx))); /* by default, send via the new channel from now */ st.old_chan_nr := g_chan_nr; -- To view, visit https://gerrit.osmocom.org/9999 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ia609b67c28ce07fa3bf33e3c4a5658046474d60a Gerrit-Change-Number: 9999 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 18 22:11:04 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 18 Jul 2018 22:11:04 +0000 Subject: Change in osmo-ttcn3-hacks[master]: bsc: fix as_handover(): first RSL should be EST IND, not DATA In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10000 ) Change subject: bsc: fix as_handover(): first RSL should be EST IND, not DATA ...................................................................... bsc: fix as_handover(): first RSL should be EST IND, not DATA Change-Id: I41b395eb7dbdd56796706722d79c7a3bc5a0b5b0 --- M bsc/MSC_ConnectionHandler.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index 022cc63..589ccf1 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -998,7 +998,7 @@ /* send handover complete over the new channel */ var PDU_ML3_MS_NW l3_tx := valueof(ts_RRM_HandoverComplete('00'O)); - RSL1.send(ts_RSL_DATA_IND(new_chan_nr, valueof(ts_RslLinkID_DCCH(0)), + RSL1.send(ts_RSL_EST_IND(new_chan_nr, valueof(ts_RslLinkID_DCCH(0)), enc_PDU_ML3_MS_NW(l3_tx))); /* by default, send via the new channel from now */ st.old_chan_nr := g_chan_nr; -- To view, visit https://gerrit.osmocom.org/10000 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I41b395eb7dbdd56796706722d79c7a3bc5a0b5b0 Gerrit-Change-Number: 10000 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 18 22:20:12 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 18 Jul 2018 22:20:12 +0000 Subject: Change in osmo-bsc[master]: call osmo_xua_msg_tall_ctx_init() In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/9955 ) Change subject: call osmo_xua_msg_tall_ctx_init() ...................................................................... call osmo_xua_msg_tall_ctx_init() xua_msg allocations should not go unnoticed by our root ctx. libosmo-sigtran recently added this API to fix that. Depends: I618878680a096a7f7fc2d83098590f2e4cb08870 (libosmo-sccp) Change-Id: I8d5edda17be82e0cb4a1af3e2a62cbcb3a2ddda3 --- M src/osmo-bsc/osmo_bsc_main.c 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index 622070b..65e82f5 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -56,6 +56,8 @@ #include +#include + #define _GNU_SOURCE #include @@ -774,6 +776,7 @@ tall_bsc_ctx = talloc_named_const(NULL, 1, "osmo-bsc"); msgb_talloc_ctx_init(tall_bsc_ctx, 0); + osmo_xua_msg_tall_ctx_init(tall_bsc_ctx); vty_info.tall_ctx = tall_bsc_ctx; tall_paging_ctx = talloc_named_const(tall_bsc_ctx, 0, "paging_request"); -- To view, visit https://gerrit.osmocom.org/9955 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I8d5edda17be82e0cb4a1af3e2a62cbcb3a2ddda3 Gerrit-Change-Number: 9955 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 18 22:20:19 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 18 Jul 2018 22:20:19 +0000 Subject: Change in libosmo-sccp[master]: comment: explain xua_msg free in m3ua_rx_xfer() In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/9958 ) Change subject: comment: explain xua_msg free in m3ua_rx_xfer() ...................................................................... comment: explain xua_msg free in m3ua_rx_xfer() Change-Id: I6211c8809eefeb94289c4c497553561b043ee619 --- M src/m3ua.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/m3ua.c b/src/m3ua.c index f1fe3f1..d7ede40 100644 --- a/src/m3ua.c +++ b/src/m3ua.c @@ -584,6 +584,7 @@ xua_msg_free_tag(xua, M3UA_IEI_ROUTE_CTX); return m3ua_hmdc_rx_from_l2(asp->inst, xua); + /* xua will be freed by caller m3ua_rx_msg() */ } static int m3ua_rx_mgmt_err(struct osmo_ss7_asp *asp, struct xua_msg *xua) -- To view, visit https://gerrit.osmocom.org/9958 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I6211c8809eefeb94289c4c497553561b043ee619 Gerrit-Change-Number: 9958 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 18 22:24:51 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 18 Jul 2018 22:24:51 +0000 Subject: Change in sandbox[master]: y Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10041 Change subject: y ...................................................................... y Change-Id: If4a168d0cc63ebb2422e0309f9078dce5968d358 --- A y 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/41/10041/1 diff --git a/y b/y new file mode 100644 index 0000000..cf813d4 --- /dev/null +++ b/y @@ -0,0 +1 @@ +this is y -- To view, visit https://gerrit.osmocom.org/10041 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: If4a168d0cc63ebb2422e0309f9078dce5968d358 Gerrit-Change-Number: 10041 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 18 22:32:25 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 18 Jul 2018 22:32:25 +0000 Subject: Change in sandbox[master]: y1 Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10042 Change subject: y1 ...................................................................... y1 Change-Id: I48244c4829714c0b212c0936396d87a167427675 --- M y 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/42/10042/1 diff --git a/y b/y index cf813d4..cff4ba9 100644 --- a/y +++ b/y @@ -1 +1,2 @@ this is y +1 -- To view, visit https://gerrit.osmocom.org/10042 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I48244c4829714c0b212c0936396d87a167427675 Gerrit-Change-Number: 10042 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 18 22:32:26 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 18 Jul 2018 22:32:26 +0000 Subject: Change in sandbox[master]: y2 Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10043 Change subject: y2 ...................................................................... y2 Change-Id: I37479150e108ec855707d5bfeccb8284709f4adf --- M y 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/43/10043/1 diff --git a/y b/y index cff4ba9..e5a1b4a 100644 --- a/y +++ b/y @@ -1,2 +1,3 @@ this is y 1 +2 -- To view, visit https://gerrit.osmocom.org/10043 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I37479150e108ec855707d5bfeccb8284709f4adf Gerrit-Change-Number: 10043 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 18 22:32:26 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 18 Jul 2018 22:32:26 +0000 Subject: Change in sandbox[master]: y (2) Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10044 Change subject: y (2) ...................................................................... y (2) Change-Id: I536651396d2e52e75d96a5e5e7ae6ad61a60746b --- 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/44/10044/1 -- To view, visit https://gerrit.osmocom.org/10044 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I536651396d2e52e75d96a5e5e7ae6ad61a60746b Gerrit-Change-Number: 10044 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 18 22:34:47 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 18 Jul 2018 22:34:47 +0000 Subject: Change in sandbox[master]: y (2) In-Reply-To: References: Message-ID: Neels Hofmeyr has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/10044 ) Change subject: y (2) ...................................................................... y (2) Change-Id: I536651396d2e52e75d96a5e5e7ae6ad61a60746b --- 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/44/10044/2 -- To view, visit https://gerrit.osmocom.org/10044 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I536651396d2e52e75d96a5e5e7ae6ad61a60746b Gerrit-Change-Number: 10044 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 18 22:34:48 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 18 Jul 2018 22:34:48 +0000 Subject: Change in sandbox[master]: x Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10045 Change subject: x ...................................................................... x Change-Id: If2fbe863f297ba2fded461717f72532ac32dba37 --- M x 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/sandbox refs/changes/45/10045/1 diff --git a/x b/x index 8c6b72e..ec710a9 100644 --- a/x +++ b/x @@ -14,6 +14,7 @@ 5 6 6 +a change 7 7 8 -- To view, visit https://gerrit.osmocom.org/10045 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: If2fbe863f297ba2fded461717f72532ac32dba37 Gerrit-Change-Number: 10045 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 18 22:36:31 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 18 Jul 2018 22:36:31 +0000 Subject: Change in sandbox[master]: y (2) In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10044 ) Change subject: y (2) ...................................................................... Patch Set 2: Verified+1 Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10044 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I536651396d2e52e75d96a5e5e7ae6ad61a60746b Gerrit-Change-Number: 10044 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Wed, 18 Jul 2018 22:36:31 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 18 22:36:43 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 18 Jul 2018 22:36:43 +0000 Subject: Change in sandbox[master]: x In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10045 ) Change subject: x ...................................................................... Patch Set 1: Verified+1 Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10045 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If2fbe863f297ba2fded461717f72532ac32dba37 Gerrit-Change-Number: 10045 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Wed, 18 Jul 2018 22:36:43 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 18 22:36:58 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 18 Jul 2018 22:36:58 +0000 Subject: Change in sandbox[master]: y In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10041 ) Change subject: y ...................................................................... Patch Set 2: Verified+1 Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10041 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If4a168d0cc63ebb2422e0309f9078dce5968d358 Gerrit-Change-Number: 10041 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Wed, 18 Jul 2018 22:36:58 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 18 22:37:03 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 18 Jul 2018 22:37:03 +0000 Subject: Change in sandbox[master]: y1 In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10042 ) Change subject: y1 ...................................................................... Patch Set 1: Verified-1 Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10042 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I48244c4829714c0b212c0936396d87a167427675 Gerrit-Change-Number: 10042 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Wed, 18 Jul 2018 22:37:03 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 18 22:37:08 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 18 Jul 2018 22:37:08 +0000 Subject: Change in sandbox[master]: y1 In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10042 ) Change subject: y1 ...................................................................... Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/10042 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I48244c4829714c0b212c0936396d87a167427675 Gerrit-Change-Number: 10042 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Wed, 18 Jul 2018 22:37:08 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 18 22:37:13 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 18 Jul 2018 22:37:13 +0000 Subject: Change in sandbox[master]: y In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10041 ) Change subject: y ...................................................................... y Change-Id: If4a168d0cc63ebb2422e0309f9078dce5968d358 --- A y 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/y b/y new file mode 100644 index 0000000..cf813d4 --- /dev/null +++ b/y @@ -0,0 +1 @@ +this is y -- To view, visit https://gerrit.osmocom.org/10041 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: If4a168d0cc63ebb2422e0309f9078dce5968d358 Gerrit-Change-Number: 10041 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 18 22:37:13 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 18 Jul 2018 22:37:13 +0000 Subject: Change in sandbox[master]: y1 In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10042 ) Change subject: y1 ...................................................................... y1 Change-Id: I48244c4829714c0b212c0936396d87a167427675 --- M y 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/y b/y index cf813d4..cff4ba9 100644 --- a/y +++ b/y @@ -1 +1,2 @@ this is y +1 -- To view, visit https://gerrit.osmocom.org/10042 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I48244c4829714c0b212c0936396d87a167427675 Gerrit-Change-Number: 10042 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 18 22:37:45 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 18 Jul 2018 22:37:45 +0000 Subject: Change in sandbox[master]: y2 In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10043 ) Change subject: y2 ...................................................................... Patch Set 1: Verified+1 Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10043 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I37479150e108ec855707d5bfeccb8284709f4adf Gerrit-Change-Number: 10043 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Wed, 18 Jul 2018 22:37:45 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 18 22:37:56 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 18 Jul 2018 22:37:56 +0000 Subject: Change in sandbox[master]: y2 In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10043 ) Change subject: y2 ...................................................................... y2 Change-Id: I37479150e108ec855707d5bfeccb8284709f4adf --- M y 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/y b/y index cff4ba9..e5a1b4a 100644 --- a/y +++ b/y @@ -1,2 +1,3 @@ this is y 1 +2 -- To view, visit https://gerrit.osmocom.org/10043 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I37479150e108ec855707d5bfeccb8284709f4adf Gerrit-Change-Number: 10043 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 18 22:37:56 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 18 Jul 2018 22:37:56 +0000 Subject: Change in sandbox[master]: x In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10045 ) Change subject: x ...................................................................... x Change-Id: If2fbe863f297ba2fded461717f72532ac32dba37 --- M x 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/x b/x index 8c6b72e..ec710a9 100644 --- a/x +++ b/x @@ -14,6 +14,7 @@ 5 6 6 +a change 7 7 8 -- To view, visit https://gerrit.osmocom.org/10045 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: If2fbe863f297ba2fded461717f72532ac32dba37 Gerrit-Change-Number: 10045 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 18 22:57:21 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 18 Jul 2018 22:57:21 +0000 Subject: Change in sandbox[master]: y (2) In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10044 ) Change subject: y (2) ...................................................................... y (2) Change-Id: I536651396d2e52e75d96a5e5e7ae6ad61a60746b --- 1 file changed, 0 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified -- To view, visit https://gerrit.osmocom.org/10044 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: sandbox Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I536651396d2e52e75d96a5e5e7ae6ad61a60746b Gerrit-Change-Number: 10044 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 18 23:15:09 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 18 Jul 2018 23:15:09 +0000 Subject: Change in osmo-bsc[master]: fix handling of invalid pchan names in vty In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10026 ) Change subject: fix handling of invalid pchan names in vty ...................................................................... Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/10026/1/src/osmo-bsc/bsc_vty.c File src/osmo-bsc/bsc_vty.c: https://gerrit.osmocom.org/#/c/10026/1/src/osmo-bsc/bsc_vty.c at 4037 PS1, Line 4037: if (vty->type == VTY_FILE) nice, with CMD_ERR_NO_MATCH, you've found a way of aborting program startup without aborting a running application from telnet vty. For that you don't actually need to check vty->type == VTY_FILE, just always return CMD_ERR_NO_MATCH. (Checking for VTY_FILE allows to exit(-1) or OSMO_ASSERT(false) except when in telnet mode, but CMD_ERR_NO_MATCH actually has exactly the desired effect, and my hint at VTY_FILE on redmine was just confusing you) (only now do I actually fully realize that the entire issue exists only with uppercase pchan types, and that one gets proper command matching with the lower case ones; weird hysterical raisins I guess.) -- To view, visit https://gerrit.osmocom.org/10026 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I97baa359464a0e94de2497bc9214b99ed2a24041 Gerrit-Change-Number: 10026 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Wed, 18 Jul 2018 23:15:09 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 18 23:21:06 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 18 Jul 2018 23:21:06 +0000 Subject: Change in osmo-ggsn[master]: fix unaligned access in build_ipcp_pco() In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10028 ) Change subject: fix unaligned access in build_ipcp_pco() ...................................................................... Patch Set 1: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/10028/1/ggsn/ggsn.c File ggsn/ggsn.c: https://gerrit.osmocom.org/#/c/10028/1/ggsn/ggsn.c at 517 PS1, Line 517: @pespin, notice this line being dropped, making it all right again. -- To view, visit https://gerrit.osmocom.org/10028 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia75ee0f64e660f6ff6d81d808f9c460b7cac93d2 Gerrit-Change-Number: 10028 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Wed, 18 Jul 2018 23:21:06 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 00:02:19 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 00:02:19 +0000 Subject: Change in osmo-mgw[master]: add a VTY command which shows a specific mgcp endpoint In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10022 ) Change subject: add a VTY command which shows a specific mgcp endpoint ...................................................................... Patch Set 1: Code-Review-1 (4 comments) tldr: yes, but let's discuss UI vs implementation quirks with pmaier first. https://gerrit.osmocom.org/#/c/10022/1/src/libosmo-mgcp/mgcp_vty.c File src/libosmo-mgcp/mgcp_vty.c: https://gerrit.osmocom.org/#/c/10022/1/src/libosmo-mgcp/mgcp_vty.c at 193 PS1, Line 193: vty_out(vty, "Endpoint %s0x%.2x:%s", not sure if we should include a 0x here (I remember there has been confusion around decimal vs hex on that topic before, and I used to argue for a 0x in log output; which doesn't really make sense to me anymore). Rather stay with the exact syntax sent via MGCP? Interesting, what does the '.2' do for %x? edit 1: Ah I see now you're just moving previous code. These remain interesting questions but not related to this patch then. edit 2: wait no, you are actually changing the format to prepend "rtpbridge/". So again yes, with this change let's copy the code from actual MGCP message composition? (it's sent as character string) https://gerrit.osmocom.org/#/c/10022/1/src/libosmo-mgcp/mgcp_vty.c at 201 PS1, Line 201: /* FIXME: Also add verbosity for other use the line width instead of breaking lines? edit: also just moved code https://gerrit.osmocom.org/#/c/10022/1/src/libosmo-mgcp/mgcp_vty.c at 256 PS1, Line 256: "Display information about an MGCP Media Gateway endpoint\n" Common prefix with other commands, here 'show mgcp', should share similar doc strings. This means that here it should also say "..about the MGCP Media Gateway" like above, and in fact it's a candidate for a common #define like the SHOW_STR. What is the trunk number for the user? is it what follows "rtpbridge/" in the endpoint name we got from the MGW? No, that's part of the endpoint NAME, is it?? Looks to me like also allowing to omit 'endpoint NAME' would be good, to show one entire trunk? and/or to allow passing an endpoint name without having to pass a trunk number? (I think I'm confused on what a trunk is) e.g. when reading osmo-bsc logs, AFAICT an endpoint name looks like "rtpbridge/2 at mgw", I think we should use similar syntax here to cut out conversions that the user needs to understand to use this command. The command should be so that we can seamlessly add e1 endpoints in the future, hiding weird implementation details (like a hex number) we might have at the moment. Would be nice if pmaier could say something here. The idea: just printing out a listing is less critical than exposing VTY commands; we should try to not require to incompatibly change the vty command UI in the future. So we may prefer to not glorify the weird hex number as proper VTY UI, when the MGCP protocol only ever has character strings. Am I making sense? (also thinking, connections on each endpoint have long random generated ids, CI, extremely likely to be unique across all the MGW. Could be nice to be able to query by CI without having to also pass the endpoint name? oh well, maybe not that useful, querying by endpoint name should suffice. What does pmaier think?) https://gerrit.osmocom.org/#/c/10022/1/src/libosmo-mgcp/mgcp_vty.c at 280 PS1, Line 280: vty_out(vty, "endpoint name '%s' is not a hex number%s", argv[1], VTY_NEWLINE); (re "rtpbridge/2 at mgw" above) -- To view, visit https://gerrit.osmocom.org/10022 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5330e697ec34bf215de91d44209048a8dc226d51 Gerrit-Change-Number: 10022 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Thu, 19 Jul 2018 00:02:19 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 00:13:11 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 00:13:11 +0000 Subject: Change in libosmo-sccp[master]: tweak the default point codes used by sccp_demo_user In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9652 ) Change subject: tweak the default point codes used by sccp_demo_user ...................................................................... Patch Set 3: Code-Review+1 (2 comments) https://gerrit.osmocom.org/#/c/9652/3//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/9652/3//COMMIT_MSG at 8 PS3, Line 8: Easier to understand: "sccp demo: use point code 23 for server and 1 for client. Fix previous commit 4dc... which broke this by using -1 for local and 23 for remote PC, for both server and client." That's all, is it? https://gerrit.osmocom.org/#/c/9652/3//COMMIT_MSG at 27 PS3, Line 27: While here, remove unused -p option from getopt() argument list. hm, maybe rather separate -- To view, visit https://gerrit.osmocom.org/9652 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7432e6fc2617e0fd77a098fcd7d14abc40db7229 Gerrit-Change-Number: 9652 Gerrit-PatchSet: 3 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Stefan Sperling Gerrit-Comment-Date: Thu, 19 Jul 2018 00:13:11 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 00:23:02 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 00:23:02 +0000 Subject: Change in osmo-sgsn[master]: sgsn: subscriber: Avoid calling memcpy with NULL src In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10030 ) Change subject: sgsn: subscriber: Avoid calling memcpy with NULL src ...................................................................... Patch Set 1: Code-Review+2 one point deducted for not mentioning that these are three separate issues fixed in one commit ;) -- To view, visit https://gerrit.osmocom.org/10030 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2d1c01ed8b8d2233ced6d70972183ed4fc99007a Gerrit-Change-Number: 10030 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Thu, 19 Jul 2018 00:23:02 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 00:25:39 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 00:25:39 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: Add test to verify GPRS ctx deact caused by GTP ErrorInd In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10037 ) Change subject: sgsn: Add test to verify GPRS ctx deact caused by GTP ErrorInd ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/10037 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I40e877f4126e62a731b071ae1d6d855fed210433 Gerrit-Change-Number: 10037 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Thu, 19 Jul 2018 00:25:39 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 00:26:01 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 00:26:01 +0000 Subject: Change in osmo-ttcn3-hacks[master]: lib: gtp: Add templates to send ErrorIndiciation In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10036 ) Change subject: lib: gtp: Add templates to send ErrorIndiciation ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/10036 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7c20bc3b62a953efe57eb05a8ba89f9f0830a816 Gerrit-Change-Number: 10036 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Thu, 19 Jul 2018 00:26:01 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 00:27:22 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 00:27:22 +0000 Subject: Change in osmo-sgsn[master]: sgsn: cdr: Fix uninitialized string access if ggsn is dettached In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10029 ) Change subject: sgsn: cdr: Fix uninitialized string access if ggsn is dettached ...................................................................... Patch Set 1: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/10029/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/10029/1//COMMIT_MSG at 7 PS1, Line 7: sgsn: cdr: Fix uninitialized string access if ggsn is dettached "detached" -- To view, visit https://gerrit.osmocom.org/10029 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I97bc56a4e3e76725eb2717b74b3ac125b68bbf0a Gerrit-Change-Number: 10029 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Thu, 19 Jul 2018 00:27:22 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 00:27:55 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 00:27:55 +0000 Subject: Change in osmo-sgsn[master]: gtp: Fix crash using new libgtp cb_recovery API In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10025 ) Change subject: gtp: Fix crash using new libgtp cb_recovery API ...................................................................... Patch Set 2: > Requires osmo-ggsn libgtp https://gerrit.osmocom.org/#/c/osmo-ggsn/+/10024/ > to build correctly. mention "Depends: ..." in commit msg -- To view, visit https://gerrit.osmocom.org/10025 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0989c00e18ca95a099e1a312940eaac71957b444 Gerrit-Change-Number: 10025 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Neels Hofmeyr Gerrit-Comment-Date: Thu, 19 Jul 2018 00:27:55 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 00:32:43 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 00:32:43 +0000 Subject: Change in osmo-ggsn[master]: gtp: Pass originating pdp ctx to recovery_cb In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10024 ) Change subject: gtp: Pass originating pdp ctx to recovery_cb ...................................................................... Patch Set 1: Code-Review+1 (2 comments) https://gerrit.osmocom.org/#/c/10024/1/gtp/gtp.c File gtp/gtp.c: https://gerrit.osmocom.org/#/c/10024/1/gtp/gtp.c at 194 PS1, Line 194: * pdp may be NULL if Recovery IE was received from a message indepenendent indepenenenenendent https://gerrit.osmocom.org/#/c/10024/1/gtp/gtp.c at 196 PS1, Line 196: * local setup. In case pdp is known, user may want to keep that pdp alive to user; did you mean caller? -- To view, visit https://gerrit.osmocom.org/10024 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I53e92298f2f6b84d662a3300d922e8c2ccb178bc Gerrit-Change-Number: 10024 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Thu, 19 Jul 2018 00:32:43 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 00:33:25 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 00:33:25 +0000 Subject: Change in osmo-sgsn[master]: sgsn: gtp: Use new API to send PDP DEL CTX REQ without freeing ctx lo... In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10019 ) Change subject: sgsn: gtp: Use new API to send PDP DEL CTX REQ without freeing ctx locally ...................................................................... Patch Set 2: > Requires https://gerrit.osmocom.org/#/c/osmo-ggsn/+/10006 to build > correctly. "Depends: ..." -- To view, visit https://gerrit.osmocom.org/10019 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I304c59de5d137b81de3c6df0fdbe911ae3dbd1f3 Gerrit-Change-Number: 10019 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Neels Hofmeyr Gerrit-Comment-Date: Thu, 19 Jul 2018 00:33:25 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 00:36:20 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 00:36:20 +0000 Subject: Change in osmo-ggsn[master]: gtp: Add new API to avoid freeing pdp contexts during DEL CTX REQ In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10006 ) Change subject: gtp: Add new API to avoid freeing pdp contexts during DEL CTX REQ ...................................................................... Patch Set 2: Code-Review+1 (can't say I understand the semantics though) -- To view, visit https://gerrit.osmocom.org/10006 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I29d366253bb98dcba328c7ce8aa3e4daf8f75e6c Gerrit-Change-Number: 10006 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Thu, 19 Jul 2018 00:36:20 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 00:37:56 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 00:37:56 +0000 Subject: Change in osmo-sgsn[master]: gprs_gmm: dont answer unknown IMSI/TMSI on Service Requests NET_FAIL In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10033 ) Change subject: gprs_gmm: dont answer unknown IMSI/TMSI on Service Requests NET_FAIL ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10033 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I195d533e330a4b577cad80c7e757d481f9c837df Gerrit-Change-Number: 10033 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Thu, 19 Jul 2018 00:37:56 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 00:40:13 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 00:40:13 +0000 Subject: Change in libosmocore[master]: vty: initialize termios before using it In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10032 ) Change subject: vty: initialize termios before using it ...................................................................... Patch Set 1: Code-Review+2 (2 comments) https://gerrit.osmocom.org/#/c/10032/1/src/vty/vty.c File src/vty/vty.c: https://gerrit.osmocom.org/#/c/10032/1/src/vty/vty.c at 1509 PS1, Line 1509: struct termios t = { 0 }; ( I like and often use the empty braces to indicate all members to be zero-initialized: struct termios t = {}; ) https://gerrit.osmocom.org/#/c/10032/1/src/vty/vty.c at 1513 PS1, Line 1513: tcsetattr(vty_sock, TCSANOW, &t); (wow, what's up with the indenting here, lol) -- To view, visit https://gerrit.osmocom.org/10032 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9d165911fa3127afa8f836fa5c5c2e14a949474a Gerrit-Change-Number: 10032 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Thu, 19 Jul 2018 00:40:13 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 00:42:32 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 00:42:32 +0000 Subject: Change in libosmocore[master]: ctrl/vty: fsm: use correct element when iterating over fsm->proc.chil... In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10031 ) Change subject: ctrl/vty: fsm: use correct element when iterating over fsm->proc.children ...................................................................... Patch Set 1: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/10031/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/10031/1//COMMIT_MSG at 10 PS1, Line 10: when fsm childs are present. crashes and children -- To view, visit https://gerrit.osmocom.org/10031 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4ae0bee7f7f57ec6675cfb52ca6cf0d523d15362 Gerrit-Change-Number: 10031 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Thu, 19 Jul 2018 00:42:32 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 00:44:09 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 00:44:09 +0000 Subject: Change in osmo-ci[master]: ansible: osmocom-jenkins-slave: add var install_jenkins_utilities In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10016 ) Change subject: ansible: osmocom-jenkins-slave: add var install_jenkins_utilities ...................................................................... Patch Set 1: (in case you're waiting for a V+1, I guess you just have to verify manually and vote V+1 yourself to merge) -- To view, visit https://gerrit.osmocom.org/10016 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I72f4460b8550da191e74a44be0ee3eeb3b2d7769 Gerrit-Change-Number: 10016 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-CC: Neels Hofmeyr Gerrit-Comment-Date: Thu, 19 Jul 2018 00:44:09 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 07:54:24 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 19 Jul 2018 07:54:24 +0000 Subject: Change in pysim[master]: cards: return SW in method update_plmnsel() of class Card In-Reply-To: References: Message-ID: dexter has posted comments on this change. ( https://gerrit.osmocom.org/9986 ) Change subject: cards: return SW in method update_plmnsel() of class Card ...................................................................... Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/9986 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I54e8e165f87365e8162b36d24efc8f0db62b66da Gerrit-Change-Number: 9986 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: dexter Gerrit-Comment-Date: Thu, 19 Jul 2018 07:54:24 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 07:54:48 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 19 Jul 2018 07:54:48 +0000 Subject: Change in pysim[master]: cosmetic: fix cut and paste error in comment In-Reply-To: References: Message-ID: dexter has posted comments on this change. ( https://gerrit.osmocom.org/9985 ) Change subject: cosmetic: fix cut and paste error in comment ...................................................................... Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/9985 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I506585f8b300bb7a3e20edad7eca134374581d76 Gerrit-Change-Number: 9985 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: dexter Gerrit-Comment-Date: Thu, 19 Jul 2018 07:54:48 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 07:54:50 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 19 Jul 2018 07:54:50 +0000 Subject: Change in pysim[master]: cosmetic: fix cut and paste error in comment In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. ( https://gerrit.osmocom.org/9985 ) Change subject: cosmetic: fix cut and paste error in comment ...................................................................... cosmetic: fix cut and paste error in comment Change-Id: I506585f8b300bb7a3e20edad7eca134374581d76 --- M pySim/cards.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved dexter: Verified diff --git a/pySim/cards.py b/pySim/cards.py index 3577d8d..9be04ff 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -533,7 +533,7 @@ # set Ki in proprietary file data, sw = self._scc.update_binary('00FF', p['ki']) - # set Ki in proprietary file + # set OPc in proprietary file content = "01" + p['opc'] data, sw = self._scc.update_binary('00F7', content) -- To view, visit https://gerrit.osmocom.org/9985 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I506585f8b300bb7a3e20edad7eca134374581d76 Gerrit-Change-Number: 9985 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 07:54:59 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 19 Jul 2018 07:54:59 +0000 Subject: Change in pysim[master]: cards: return SW in method update_plmnsel() of class Card In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. ( https://gerrit.osmocom.org/9986 ) Change subject: cards: return SW in method update_plmnsel() of class Card ...................................................................... cards: return SW in method update_plmnsel() of class Card The method update_plmnsel() does not return the status word yet, which causes pysim-prog.py to print an error message that does not influence the functionality but does not look nice. - preserve the status word that is returned with update_binary() and return it properly like the other methods do. Change-Id: I54e8e165f87365e8162b36d24efc8f0db62b66da Related: SYS#4245 --- M pySim/cards.py 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved dexter: Verified diff --git a/pySim/cards.py b/pySim/cards.py index 9be04ff..a72a52f 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -87,7 +87,8 @@ data = self._scc.read_binary(EF['PLMNsel'], length=None, offset=0) size = len(data[0])/2 hplmn = enc_plmn(mcc, mnc) - self._scc.update_binary(EF['PLMNsel'], hplmn + 'ff' * (size-3)) + data, sw = self._scc.update_binary(EF['PLMNsel'], hplmn + 'ff' * (size-3)) + return sw def update_smsp(self, smsp): data, sw = self._scc.update_record(EF['SMSP'], 1, rpad(smsp, 84)) -- To view, visit https://gerrit.osmocom.org/9986 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I54e8e165f87365e8162b36d24efc8f0db62b66da Gerrit-Change-Number: 9986 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 07:55:15 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 19 Jul 2018 07:55:15 +0000 Subject: Change in pysim[master]: tests: add test program to verify pysim-prog.py (and pysim-read.py) In-Reply-To: References: Message-ID: dexter has posted comments on this change. ( https://gerrit.osmocom.org/9947 ) Change subject: tests: add test program to verify pysim-prog.py (and pysim-read.py) ...................................................................... Patch Set 3: Verified+1 -- To view, visit https://gerrit.osmocom.org/9947 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8c6f95998272333bc757b34e3ab6be004e8cd674 Gerrit-Change-Number: 9947 Gerrit-PatchSet: 3 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: dexter Gerrit-Comment-Date: Thu, 19 Jul 2018 07:55:15 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 07:55:42 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 19 Jul 2018 07:55:42 +0000 Subject: Change in pysim[master]: tests: add test program to verify pysim-prog.py (and pysim-read.py) In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. ( https://gerrit.osmocom.org/9947 ) Change subject: tests: add test program to verify pysim-prog.py (and pysim-read.py) ...................................................................... tests: add test program to verify pysim-prog.py (and pysim-read.py) Pysim now supports quite a number of different cards. Estimating if changes in pysim introce regressions becomes increasingly difficult The script that is added with this patch is intended to run as atomated testsuit on real cards attached to a test system. However, it can also be used by developers locally to check for regressions. Change-Id: I8c6f95998272333bc757b34e3ab6be004e8cd674 Related: OS#3376 --- A tests/fakemagicsim.data.example A tests/pysim-test.sh A tests/sysmoUSIM-SJS1.data.example 3 files changed, 234 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved dexter: Verified diff --git a/tests/fakemagicsim.data.example b/tests/fakemagicsim.data.example new file mode 100644 index 0000000..deab2f7 --- /dev/null +++ b/tests/fakemagicsim.data.example @@ -0,0 +1,6 @@ +MCC=001 +MNC=01 +ICCID=1122334455667788990 +KI=FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +OPC=FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +IMSI=001010000000102 \ No newline at end of file diff --git a/tests/pysim-test.sh b/tests/pysim-test.sh new file mode 100755 index 0000000..5af7a93 --- /dev/null +++ b/tests/pysim-test.sh @@ -0,0 +1,221 @@ +#!/bin/bash + +# Utility to verify the functionality of pysim-prog.py +# +# (C) 2018 by Sysmocom s.f.m.c. GmbH +# All Rights Reserved +# +# Author: Philipp Maier +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +PYSIM_PROG=../pySim-prog.py +PYSIM_READ=../pySim-read.py +TEMPFILE=temp.tmp + +set -e + +echo "pysim-test - a test program to test pysim-prog.py" +echo "=================================================" + +# Generate a list of the cards we expect to see by checking which .ok files +# are present +function gen_card_list { + N_CARDS=0 + + echo "Expecting to see the following cards:" + + for I in *.data ; do + CARD_NAMES[$N_CARDS]=${I%.*} + CARD_SEEN[$N_CARDS]=0 + N_CARDS=$((N_CARDS+1)) + done + + for I in $(seq 0 $((N_CARDS-1))); do + echo ${CARD_NAMES[$I]} + done +} + +# Increment counter in card list for a specified card name (type) +function inc_card_list { + CARD_NAME=$1 + for I in $(seq 0 $((N_CARDS-1))); do + if [ $CARD_NAME = ${CARD_NAMES[$I]} ]; then + CARD_SEEN[$I]=$((${CARD_NAMES[$I]}+1)) + fi + done +} + +# Check the card list, each card must be seen exactly one times +function check_card_list { + for I in $(seq 0 $((N_CARDS-1))); do + if [ ${CARD_SEEN[$I]} -ne 1 ]; then + echo "Error: Card ${CARD_NAMES[$I]} seen ${CARD_SEEN[$I]} times!" + exit 1 + fi + done + + echo "All cards seen -- everything ok!" +} + +# Verify the contents of a card by reading them and then diffing against the +# previously created .ok file +function check_card { + TERMINAL=$1 + CARD_NAME=$2 + echo "Verifying card ..." + stat ./$CARD_NAME.ok > /dev/null + python $PYSIM_READ -p $TERMINAL > $TEMPFILE + set +e + CARD_DIFF=$(diff $TEMPFILE ./$CARD_NAME.ok) + set -e + + if [ "$CARD_DIFF" != "" ]; then + echo "Card contents do not match the test data:" + echo "Expected: $CARD_NAME.ok" + echo "------------8<------------" + cat "$CARD_NAME.ok" + echo "------------8<------------" + echo "Got:" + echo "------------8<------------" + cat $TEMPFILE + echo "------------8<------------" + exit 1 + fi + + inc_card_list $CARD_NAME + + echo "Card contents match the test data -- success!" + rm $TEMPFILE +} + +# Read out the card using pysim-read and store the result as .ok file. This +# data will be used later in order to verify the results of our write tests. +function gen_ok_file { + TERMINAL=$1 + CARD_NAME=$2 + python $PYSIM_READ -p $TERMINAL > "$CARD_NAME.ok" + echo "Generated file: $CARD_NAME.ok" + echo "------------8<------------" + cat "$CARD_NAME.ok" + echo "------------8<------------" +} + +# Find out the type (card name) of the card that is installed in the specified +# reader +function probe_card { + TERMINAL=$1 + RESULT=$(timeout 5 $PYSIM_PROG -p $TERMINAL -T | cut -d ":" -f 2 | tail -n 1 | xargs) + echo $RESULT +} + +# Read out all cards and store the results as .ok files +function gen_ok_files { + echo "== OK FILE GENERATION ==" + for I in $(seq 0 $((N_TERMINALS-1))); do + echo "Probing card in terminal #$I" + CARD_NAME=$(probe_card $I) + if [ -z "$CARD_NAME" ]; then + echo "Error: Unresponsive card!" + exit 1 + fi + echo "Card is of type: $CARD_NAME" + gen_ok_file $I $CARD_NAME + done +} + +# Execute tests. Each card is programmed and the contents are checked +# afterwards. +function run_test { + for I in $(seq 0 $((N_TERMINALS-1))); do + echo "== EXECUTING TEST ==" + echo "Probing card in terminal #$I" + CARD_NAME=$(probe_card $I) + if [ -z "$CARD_NAME" ]; then + echo "Error: Unresponsive card!" + exit 1 + fi + echo "Card is of type: $CARD_NAME" + + # Make sure some default data is set + MCC=001 + MNC=01 + ICCID=1122334455667788990 + KI=FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + OPC=FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + IMSI=001010000000001 + ADM=00000000 + + . "$CARD_NAME.data" + python $PYSIM_PROG -p $I -t $CARD_NAME -o $OPC -k $KI -x $MCC -y $MNC -i $IMSI -s $ICCID -a $ADM + check_card $I $CARD_NAME + echo "" + done +} + +function usage { + echo "Options:" + echo "-n: number of card terminals" + echo "-o: generate .ok files" +} + +# Make sure that the pathes to the python scripts always work, regardless from +# where the script is called. +CURDIR=$PWD +SCRIPTDIR=$(dirname $0) +cd $SCRIPTDIR +PYSIM_PROG=$(realpath $PYSIM_PROG) +PYSIM_READ=$(realpath $PYSIM_READ) +cd $CURDIR + +OPT_N_TERMINALS=0 +OPT_GEN_OK_FILES=0 +while getopts ":hon:" OPT; do + case $OPT in + h) + usage + exit 0 + ;; + o) + OPT_GEN_OK_FILES=1 + ;; + n) + OPT_N_TERMINALS=$OPTARG + ;; + \?) + echo "Invalid option: -$OPTARG" >&2 + exit 1 + ;; + esac +done + +N_TERMINALS=$OPT_N_TERMINALS + +# Generate a list of available cards, if no explicit reader number is given +# then the number of cards will be used as reader number. +gen_card_list +if [ $N_TERMINALS -eq 0 ]; then + N_TERMINALS=$N_CARDS +fi +echo "Number of card terminals installed: $N_TERMINALS" +echo "" + +if [ $OPT_GEN_OK_FILES -eq 1 ]; then + gen_ok_files + exit 0 +else + run_test + check_card_list + exit 0 +fi diff --git a/tests/sysmoUSIM-SJS1.data.example b/tests/sysmoUSIM-SJS1.data.example new file mode 100644 index 0000000..d711dcb --- /dev/null +++ b/tests/sysmoUSIM-SJS1.data.example @@ -0,0 +1,7 @@ +MCC=001 +MNC=01 +ICCID=1122334455667788990 +KI=FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +OPC=FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +IMSI=001010000000102 +ADM=12345678 -- To view, visit https://gerrit.osmocom.org/9947 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I8c6f95998272333bc757b34e3ab6be004e8cd674 Gerrit-Change-Number: 9947 Gerrit-PatchSet: 4 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 09:39:57 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 19 Jul 2018 09:39:57 +0000 Subject: Change in pysim[master]: readme: add info about dependencies Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/10046 Change subject: readme: add info about dependencies ...................................................................... readme: add info about dependencies So far, the README.md file does not mention much about the dependencies. This commt adds at lest the most important ones Change-Id: I912bbf787e1408100183cade2113bf7617b86ffa --- M README.md 1 file changed, 9 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/46/10046/1 diff --git a/README.md b/README.md index 10ec568..e098700 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,15 @@ There is a cgit interface at + +Dependencies +------------ +pysim requires pyscard and pytlv. Both can be installed using python-pip: + +pip install pytlv +pip install pyscard + + Mailing List ------------ -- To view, visit https://gerrit.osmocom.org/10046 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I912bbf787e1408100183cade2113bf7617b86ffa Gerrit-Change-Number: 10046 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 09:39:58 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 19 Jul 2018 09:39:58 +0000 Subject: Change in pysim[master]: cards: Add support for Wavemobile SIM Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/10047 Change subject: cards: Add support for Wavemobile SIM ...................................................................... cards: Add support for Wavemobile SIM Add support to handle Wavemobile sim cards. The support excludes some parameters. For example it is not possible to write own KI keys yet. Support covers the following files: EF.SMSP EF.IMSI EF.ACC EF.PLMNsel EF.PLMNwAcT EF.OPLMNwAcT Not yet supported are: EF.ICCID KI (propretary file) OPc (propritary file) Change-Id: Ida3f37bd6e3ac995812aeddc9770f1ccd54ecf3f Related: SYS#4245 --- M pySim/cards.py 1 file changed, 112 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/47/10047/1 diff --git a/pySim/cards.py b/pySim/cards.py index a72a52f..d729f07 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -83,6 +83,30 @@ data, sw = self._scc.update_binary(EF['HPLMNwAcT'], content + 'ffffff0000' * (size/5-1)) return sw + def update_oplmn_act(self, mcc, mnc, access_tech='FFFF'): + """ + See note in update_hplmn_act() + """ + # get size and write EF.OPLMNwAcT + data = self._scc.read_binary(EF['OPLMNwAcT'], length=None, offset=0) + size = len(data[0])/2 + hplmn = enc_plmn(mcc, mnc) + content = hplmn + access_tech + data, sw = self._scc.update_binary(EF['OPLMNwAcT'], content + 'ffffff0000' * (size/5-1)) + return sw + + def update_plmn_act(self, mcc, mnc, access_tech='FFFF'): + """ + See note in update_hplmn_act() + """ + # get size and write EF.PLMNwAcT + data = self._scc.read_binary(EF['PLMNwAcT'], length=None, offset=0) + size = len(data[0])/2 + hplmn = enc_plmn(mcc, mnc) + content = hplmn + access_tech + data, sw = self._scc.update_binary(EF['PLMNwAcT'], content + 'ffffff0000' * (size/5-1)) + return sw + def update_plmnsel(self, mcc, mnc): data = self._scc.read_binary(EF['PLMNsel'], length=None, offset=0) size = len(data[0])/2 @@ -743,11 +767,98 @@ # write EF.IMSI data, sw = self._scc.update_binary('6f07', enc_imsi(p['imsi'])) +class WavemobileSim(Card): + """ + WavemobileSim + + """ + + name = 'Wavemobile-SIM' + + def __init__(self, ssc): + super(WavemobileSim, self).__init__(ssc) + self._adm_chv_num = 0x0A + self._scc.cla_byte = "00" + self._scc.sel_ctrl = "0004" #request an FCP + + @classmethod + def autodetect(kls, scc): + try: + # Look for ATR + if scc.get_atr() == toBytes("3B 9F 95 80 1F C7 80 31 E0 73 F6 21 13 67 4D 45 16 00 43 01 00 8F"): + return kls(scc) + except: + return None + return None + + def program(self, p): + if not p['pin_adm']: + raise ValueError("Please provide a PIN-ADM as there is no default one") + sw = self.verify_adm(h2b(p['pin_adm'])) + if sw != '9000': + raise RuntimeError('Failed to authenticate with ADM key %s'%(p['pin_adm'],)) + + # EF.ICCID + # TODO: Add programming of the ICCID + if p.get('iccid'): + print("Warning: Programming of the ICCID is not implemented for this type of card.") + + # KI (Presumably a propritary file) + # TODO: Add programming of KI + if p.get('ki'): + print("Warning: Programming of the KI is not implemented for this type of card.") + + # OPc (Presumably a propritary file) + # TODO: Add programming of OPc + if p.get('opc'): + print("Warning: Programming of the OPc is not implemented for this type of card.") + + # EF.SMSP + if p.get('smsp'): + sw = self.update_smsp(p['smsp']) + if sw != '9000': + print("Programming SMSP failed with code %s"%sw) + + # EF.IMSI + if p.get('imsi'): + sw = self.update_imsi(p['imsi']) + if sw != '9000': + print("Programming IMSI failed with code %s"%sw) + + # EF.ACC + if p.get('acc'): + sw = self.update_acc(p['acc']) + if sw != '9000': + print("Programming ACC failed with code %s"%sw) + + # EF.PLMNsel + if p.get('mcc') and p.get('mnc'): + sw = self.update_plmnsel(p['mcc'], p['mnc']) + if sw != '9000': + print("Programming PLMNsel failed with code %s"%sw) + + # EF.PLMNwAcT + if p.get('mcc') and p.get('mnc'): + sw = self.update_plmn_act(p['mcc'], p['mnc']) + if sw != '9000': + print("Programming PLMNwAcT failed with code %s"%sw) + + # EF.OPLMNwAcT + if p.get('mcc') and p.get('mnc'): + sw = self.update_oplmn_act(p['mcc'], p['mnc']) + if sw != '9000': + print("Programming OPLMNwAcT failed with code %s"%sw) + + return None + + def erase(self): + return + # In order for autodetection ... _cards_classes = [ FakeMagicSim, SuperSim, MagicSim, GrcardSim, SysmoSIMgr1, SysmoSIMgr2, SysmoUSIMgr1, SysmoUSIMSJS1, - FairwavesSIM, OpenCellsSim ] + FairwavesSIM, OpenCellsSim, WavemobileSim ] def card_autodetect(scc): for kls in _cards_classes: -- To view, visit https://gerrit.osmocom.org/10047 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ida3f37bd6e3ac995812aeddc9770f1ccd54ecf3f Gerrit-Change-Number: 10047 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 10:03:40 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 19 Jul 2018 10:03:40 +0000 Subject: Change in pysim[master]: commands: depend on pytlv only when it is actually needed Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/10048 Change subject: commands: depend on pytlv only when it is actually needed ...................................................................... commands: depend on pytlv only when it is actually needed Some of the USIM-Card programming implementations do not need to look at card responses, which means they also do not have to parse TLV data. Lets depend on pytlv only in cases where TLV data has to be parsed so that useser of cards that do not need at can go without installing pytlv. Change-Id: Ida841d74d9581e7f395751b0f74556a06a038de6 --- M pySim/commands.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/48/10048/1 diff --git a/pySim/commands.py b/pySim/commands.py index 9e16b0e..73c2247 100644 --- a/pySim/commands.py +++ b/pySim/commands.py @@ -23,7 +23,6 @@ # from pySim.utils import rpad, b2h -from pytlv.TLV import * class SimCardCommands(object): def __init__(self, transport): @@ -35,6 +34,7 @@ def __get_len_from_tlv(self, fcp): # see also: ETSI TS 102 221, chapter 11.1.1.3.1 Response for MF, # DF or ADF + from pytlv.TLV import TLV tlvparser = TLV(['82', '83', '84', 'A5', '8a', '8b', '8c', '80', 'ab', 'c6', '81', '88']) # pytlv is case sensitive! -- To view, visit https://gerrit.osmocom.org/10048 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ida841d74d9581e7f395751b0f74556a06a038de6 Gerrit-Change-Number: 10048 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 10:04:00 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 19 Jul 2018 10:04:00 +0000 Subject: Change in osmo-sgsn[master]: sgsn: subscriber: Avoid calling memcpy with NULL src In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10030 ) Change subject: sgsn: subscriber: Avoid calling memcpy with NULL src ...................................................................... Patch Set 1: Or same kind of issue in 3 different places :P -- To view, visit https://gerrit.osmocom.org/10030 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2d1c01ed8b8d2233ced6d70972183ed4fc99007a Gerrit-Change-Number: 10030 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 19 Jul 2018 10:04:00 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 10:04:04 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 19 Jul 2018 10:04:04 +0000 Subject: Change in osmo-sgsn[master]: sgsn: subscriber: Avoid calling memcpy with NULL src In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/10030 ) Change subject: sgsn: subscriber: Avoid calling memcpy with NULL src ...................................................................... sgsn: subscriber: Avoid calling memcpy with NULL src Fixes: OS#3389 Change-Id: I2d1c01ed8b8d2233ced6d70972183ed4fc99007a --- M src/gprs/gprs_subscriber.c M src/gprs/sgsn_libgtp.c 2 files changed, 22 insertions(+), 11 deletions(-) Approvals: Jenkins Builder: Verified Neels Hofmeyr: Looks good to me, approved diff --git a/src/gprs/gprs_subscriber.c b/src/gprs/gprs_subscriber.c index 1bebc65..dfd697b 100644 --- a/src/gprs/gprs_subscriber.c +++ b/src/gprs/gprs_subscriber.c @@ -374,7 +374,11 @@ pdp_data->pdp_type = pdp_info->pdp_type; osmo_apn_to_str(pdp_data->apn_str, pdp_info->apn_enc, pdp_info->apn_enc_len); - memcpy(pdp_data->qos_subscribed, pdp_info->qos_enc, pdp_info->qos_enc_len); + + if (pdp_info->qos_enc) { + memcpy(&pdp_data->qos_subscribed[0], pdp_info->qos_enc, + pdp_info->qos_enc_len); + } pdp_data->qos_subscribed_len = pdp_info->qos_enc_len; if (pdp_info->pdp_charg_enc && pdp_info->pdp_charg_enc_len >= sizeof(pdp_data->pdp_charg)) { diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 659392e..23b8811 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -198,18 +198,25 @@ pdp->eua.v[0] |= 0xf0; /* APN name from GMM */ - pdp->apn_use.l = TLVP_LEN(tp, GSM48_IE_GSM_APN); - if (pdp->apn_use.l > sizeof(pdp->apn_use.v)) - pdp->apn_use.l = sizeof(pdp->apn_use.v); - memcpy(pdp->apn_use.v, TLVP_VAL(tp, GSM48_IE_GSM_APN), - pdp->apn_use.l); + if (TLVP_PRESENT(tp, GSM48_IE_GSM_APN)) { + pdp->apn_use.l = TLVP_LEN(tp, GSM48_IE_GSM_APN); + if (pdp->apn_use.l > sizeof(pdp->apn_use.v)) + pdp->apn_use.l = sizeof(pdp->apn_use.v); + memcpy(pdp->apn_use.v, TLVP_VAL(tp, GSM48_IE_GSM_APN), pdp->apn_use.l); + } else { + pdp->apn_use.l = 0; + } /* Protocol Configuration Options from GMM */ - pdp->pco_req.l = TLVP_LEN(tp, GSM48_IE_GSM_PROTO_CONF_OPT); - if (pdp->pco_req.l > sizeof(pdp->pco_req.v)) - pdp->pco_req.l = sizeof(pdp->pco_req.v); - memcpy(pdp->pco_req.v, TLVP_VAL(tp, GSM48_IE_GSM_PROTO_CONF_OPT), - pdp->pco_req.l); + if (TLVP_PRESENT(tp, GSM48_IE_GSM_PROTO_CONF_OPT)) { + pdp->pco_req.l = TLVP_LEN(tp, GSM48_IE_GSM_PROTO_CONF_OPT); + if (pdp->pco_req.l > sizeof(pdp->pco_req.v)) + pdp->pco_req.l = sizeof(pdp->pco_req.v); + memcpy(pdp->pco_req.v, TLVP_VAL(tp, GSM48_IE_GSM_PROTO_CONF_OPT), + pdp->pco_req.l); + } else { + pdp->pco_req.l = 0; + } /* QoS options from GMM or remote */ if (TLVP_LEN(tp, OSMO_IE_GSM_SUB_QOS) > 0) { -- To view, visit https://gerrit.osmocom.org/10030 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I2d1c01ed8b8d2233ced6d70972183ed4fc99007a Gerrit-Change-Number: 10030 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 10:05:55 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 19 Jul 2018 10:05:55 +0000 Subject: Change in osmo-ggsn[master]: gtp: Pass originating pdp ctx to recovery_cb In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10024 ) Change subject: gtp: Pass originating pdp ctx to recovery_cb ...................................................................... Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/10024/1/gtp/gtp.c File gtp/gtp.c: https://gerrit.osmocom.org/#/c/10024/1/gtp/gtp.c at 194 PS1, Line 194: * pdp may be NULL if Recovery IE was received from a message indepenendent > indepenenenenendent lol good catch. https://gerrit.osmocom.org/#/c/10024/1/gtp/gtp.c at 196 PS1, Line 196: * local setup. In case pdp is known, user may want to keep that pdp alive to > user; did you mean caller? caller, user of the API, whatever. -- To view, visit https://gerrit.osmocom.org/10024 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I53e92298f2f6b84d662a3300d922e8c2ccb178bc Gerrit-Change-Number: 10024 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 19 Jul 2018 10:05:55 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 10:08:33 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 19 Jul 2018 10:08:33 +0000 Subject: Change in osmo-sgsn[master]: sgsn: cdr: Fix uninitialized string access if ggsn is detached In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10029 to look at the new patch set (#2). Change subject: sgsn: cdr: Fix uninitialized string access if ggsn is detached ...................................................................... sgsn: cdr: Fix uninitialized string access if ggsn is detached if pdp->ggsn==NULL, sgsn_addr was not initialized and caused asan report during snprintf: ==19459==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fffffffbe31 at pc 0x7ffff6e563fe bp 0x7fffffffb130 sp 0x7fffffffa8a8 READ of size 31 at 0x7fffffffbe31 thread T0 ... Address 0x7fffffffbe31 is located in stack of thread T0 at offset 337 in frame #0 0x55555573a7b0 in cdr_snprintf_pdp osmo-sgsn/src/gprs/sgsn_cdr.c:154 ... [320, 337) 'sgsn_addr' <== Memory access at offset 337 overflows this variable ... Change-Id: I97bc56a4e3e76725eb2717b74b3ac125b68bbf0a --- M src/gprs/sgsn_cdr.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/29/10029/2 -- To view, visit https://gerrit.osmocom.org/10029 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I97bc56a4e3e76725eb2717b74b3ac125b68bbf0a Gerrit-Change-Number: 10029 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 10:09:08 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 19 Jul 2018 10:09:08 +0000 Subject: Change in osmo-sgsn[master]: sgsn: cdr: Fix uninitialized string access if ggsn is detached In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10029 ) Change subject: sgsn: cdr: Fix uninitialized string access if ggsn is detached ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10029 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I97bc56a4e3e76725eb2717b74b3ac125b68bbf0a Gerrit-Change-Number: 10029 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 19 Jul 2018 10:09:08 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 10:09:11 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 19 Jul 2018 10:09:11 +0000 Subject: Change in osmo-sgsn[master]: sgsn: cdr: Fix uninitialized string access if ggsn is detached In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/10029 ) Change subject: sgsn: cdr: Fix uninitialized string access if ggsn is detached ...................................................................... sgsn: cdr: Fix uninitialized string access if ggsn is detached if pdp->ggsn==NULL, sgsn_addr was not initialized and caused asan report during snprintf: ==19459==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fffffffbe31 at pc 0x7ffff6e563fe bp 0x7fffffffb130 sp 0x7fffffffa8a8 READ of size 31 at 0x7fffffffbe31 thread T0 ... Address 0x7fffffffbe31 is located in stack of thread T0 at offset 337 in frame #0 0x55555573a7b0 in cdr_snprintf_pdp osmo-sgsn/src/gprs/sgsn_cdr.c:154 ... [320, 337) 'sgsn_addr' <== Memory access at offset 337 overflows this variable ... Change-Id: I97bc56a4e3e76725eb2717b74b3ac125b68bbf0a --- M src/gprs/sgsn_cdr.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gprs/sgsn_cdr.c b/src/gprs/sgsn_cdr.c index 55aa664..7380e74 100644 --- a/src/gprs/sgsn_cdr.c +++ b/src/gprs/sgsn_cdr.c @@ -164,6 +164,7 @@ memset(apni, 0, sizeof(apni)); memset(ggsn_addr, 0, sizeof(ggsn_addr)); + memset(sgsn_addr, 0, sizeof(sgsn_addr)); memset(eua_addr, 0, sizeof(eua_addr)); -- To view, visit https://gerrit.osmocom.org/10029 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I97bc56a4e3e76725eb2717b74b3ac125b68bbf0a Gerrit-Change-Number: 10029 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 10:19:16 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 19 Jul 2018 10:19:16 +0000 Subject: Change in osmo-ggsn[master]: gtp: Pass originating pdp ctx to recovery_cb In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10024 to look at the new patch set (#2). Change subject: gtp: Pass originating pdp ctx to recovery_cb ...................................................................... gtp: Pass originating pdp ctx to recovery_cb This commit breaks API and old apps will fail to compile if using the cb_recovery. Sometimes the originating pdp ctx causing the Recovery Procedure is required, in order to drop all pdp ctx but this one, which specs specify should be handled as valid: """ The SGSN receiving the Recovery information element shall handle it as when an Echo Response message is received but shall consider the PDP context being created as active if the response indicates successful context activation at the GGSN. """ Change-Id: I53e92298f2f6b84d662a3300d922e8c2ccb178bc --- M gtp/gtp.c M gtp/gtp.h 2 files changed, 18 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/24/10024/2 -- To view, visit https://gerrit.osmocom.org/10024 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I53e92298f2f6b84d662a3300d922e8c2ccb178bc Gerrit-Change-Number: 10024 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 10:26:12 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 19 Jul 2018 10:26:12 +0000 Subject: Change in osmo-sgsn[master]: sgsn: gtp: Use new API to send PDP DEL CTX REQ without freeing ctx lo... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10019 to look at the new patch set (#3). Change subject: sgsn: gtp: Use new API to send PDP DEL CTX REQ without freeing ctx locally ...................................................................... sgsn: gtp: Use new API to send PDP DEL CTX REQ without freeing ctx locally Previous API freed the ctx immediatelly after sending the packet, which triggered a call to cb_delete_context() and dropped the entire sgsn_pdp_ctx before the PDP DEL CTX ACCEPT was received. This new API won't free the pdp ctx and we can tear down everything once we receive the ACCEPT in cb_conf. cb_conf is not automatically freed at cb_conf, user needs to free it, so we need to remove setting pctx->lib to NULL in cb_conf to avoid leaking the pdp ctx, as it needs to be freed inside sgsn_pdp_ctx_free(). Depends: osmo-ggsn (libgtp) Change-Id I29d366253bb98dcba328c7ce8aa3e4daf8f75e6c. Change-Id: I304c59de5d137b81de3c6df0fdbe911ae3dbd1f3 --- M src/gprs/sgsn_libgtp.c 1 file changed, 2 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/19/10019/3 -- To view, visit https://gerrit.osmocom.org/10019 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I304c59de5d137b81de3c6df0fdbe911ae3dbd1f3 Gerrit-Change-Number: 10019 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 10:26:12 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 19 Jul 2018 10:26:12 +0000 Subject: Change in osmo-sgsn[master]: gtp: Fix crash using new libgtp cb_recovery API In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10025 to look at the new patch set (#3). Change subject: gtp: Fix crash using new libgtp cb_recovery API ...................................................................... gtp: Fix crash using new libgtp cb_recovery API When PDP CTX CREATE ACK is received with an increased RestartCtr, cb_recovery is called first, which will dettach ggsn from al pdp ctx (free the pdp_t). But when giving control back from the ctrl, libgtp still uses that freed ctx and sends it back to osmo-sgsn through cb_conf(). As specs state in any case that we need to handle the message containing the increased RestartCtr as valid, we then need to avoid freeing the pdp ctx and leave handling for later in cb_conf. Depends: osmo-ggsn (libgtp) Change-Id I53e92298f2f6b84d662a3300d922e8c2ccb178bc. Change-Id: I0989c00e18ca95a099e1a312940eaac71957b444 --- M include/osmocom/sgsn/gprs_sgsn.h M src/gprs/gprs_sgsn.c M src/gprs/sgsn_libgtp.c 3 files changed, 14 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/25/10025/3 -- To view, visit https://gerrit.osmocom.org/10025 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0989c00e18ca95a099e1a312940eaac71957b444 Gerrit-Change-Number: 10025 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 11:49:44 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 19 Jul 2018 11:49:44 +0000 Subject: Change in libosmocore[master]: coding: gsm0503: Update some func API doc to state negative ret val o... Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10049 Change subject: coding: gsm0503: Update some func API doc to state negative ret val on error ...................................................................... coding: gsm0503: Update some func API doc to state negative ret val on error Change-Id: I7d6c61e6a1b5d1fae26f385b420ff55246c4b62f --- M src/coding/gsm0503_coding.c 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/49/10049/1 diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index 2eb8cba..b0a8e79 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -1792,7 +1792,7 @@ * \param[in] efr Is this channel using EFR (1) or FR (0) * \param[out] n_errors Number of detected bit errors * \param[out] n_bits_total Total number of bits - * \returns length of bytes used in \a tch_data output buffer */ + * \returns length of bytes used in \a tch_data output buffer; negative on error */ int gsm0503_tch_fr_decode(uint8_t *tch_data, const sbit_t *bursts, int net_order, int efr, int *n_errors, int *n_bits_total) { @@ -1941,7 +1941,7 @@ * \param[in] odd Odd (1) or even (0) frame number * \param[out] n_errors Number of detected bit errors * \param[out] n_bits_total Total number of bits - * \returns length of bytes used in \a tch_data output buffer */ + * \returns length of bytes used in \a tch_data output buffer; negative on error */ int gsm0503_tch_hr_decode(uint8_t *tch_data, const sbit_t *bursts, int odd, int *n_errors, int *n_bits_total) { @@ -2082,7 +2082,7 @@ * \param[out] cmr Output in \a codec_mode_req = 1 * \param[out] n_errors Number of detected bit errors * \param[out] n_bits_total Total number of bits - * \returns length of bytes used in \a tch_data output buffer */ + * \returns length of bytes used in \a tch_data output buffer; negative on error */ int gsm0503_tch_afs_decode(uint8_t *tch_data, const sbit_t *bursts, int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft, uint8_t *cmr, int *n_errors, int *n_bits_total) @@ -2459,7 +2459,7 @@ * \param[out] cmr Output in \a codec_mode_req = 1 * \param[out] n_errors Number of detected bit errors * \param[out] n_bits_total Total number of bits - * \returns length of bytes used in \a tch_data output buffer */ + * \returns length of bytes used in \a tch_data output buffer; negative on error */ int gsm0503_tch_ahs_decode(uint8_t *tch_data, const sbit_t *bursts, int odd, int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft, uint8_t *cmr, int *n_errors, int *n_bits_total) -- To view, visit https://gerrit.osmocom.org/10049 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I7d6c61e6a1b5d1fae26f385b420ff55246c4b62f Gerrit-Change-Number: 10049 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 11:57:19 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 19 Jul 2018 11:57:19 +0000 Subject: Change in libosmocore[master]: coding: gsm0503: tch_*_decode: Return negative value in error case Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10050 Change subject: coding: gsm0503: tch_*_decode: Return negative value in error case ...................................................................... coding: gsm0503: tch_*_decode: Return negative value in error case id is positive but it's still returned without the buffer being properly decoded. As such, it has to be seen as an error and not mask it as a correctly returned len. Change-Id: I9a7bb2513e3e6301b0fb7d70acc1a153123311d3 --- M src/coding/gsm0503_coding.c 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/50/10050/1 diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index b0a8e79..190f9c8 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -2121,8 +2121,8 @@ /* Check if indicated codec fits into range of codecs */ if (id >= codecs) { - /* Codec mode out of range, return id */ - return id; + /* Codec mode out of range, return id as error */ + return -id; } switch ((codec_mode_req) ? codec[*ft] : codec[id]) { @@ -2522,8 +2522,8 @@ /* Check if indicated codec fits into range of codecs */ if (id >= codecs) { - /* Codec mode out of range, return id */ - return id; + /* Codec mode out of range, return id as error */ + return -id; } switch ((codec_mode_req) ? codec[*ft] : codec[id]) { -- To view, visit https://gerrit.osmocom.org/10050 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I9a7bb2513e3e6301b0fb7d70acc1a153123311d3 Gerrit-Change-Number: 10050 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 12:15:49 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 19 Jul 2018 12:15:49 +0000 Subject: Change in libosmocore[master]: coding: gsm0503: tch_*_decode: Return negative value in error case In-Reply-To: References: Message-ID: Pau Espin Pedrol has abandoned this change. ( https://gerrit.osmocom.org/10050 ) Change subject: coding: gsm0503: tch_*_decode: Return negative value in error case ...................................................................... Abandoned This commit is wrong, dropping. -- To view, visit https://gerrit.osmocom.org/10050 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: I9a7bb2513e3e6301b0fb7d70acc1a153123311d3 Gerrit-Change-Number: 10050 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 12:34:46 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 19 Jul 2018 12:34:46 +0000 Subject: Change in osmo-ggsn[master]: fix unaligned access in build_ipcp_pco() In-Reply-To: References: Message-ID: Stefan Sperling has posted comments on this change. ( https://gerrit.osmocom.org/10028 ) Change subject: fix unaligned access in build_ipcp_pco() ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/10028/1/ggsn/ggsn.c File ggsn/ggsn.c: https://gerrit.osmocom.org/#/c/10028/1/ggsn/ggsn.c at 514 PS1, Line 514: ipcp = (struct pco_ipcp_hdr *)pco_contains_proto(&pdp->pco_req, PCO_P_IPCP); > So we increased size of the struct prepending bytes, but we still pass same pointer here and didn't [?] The alignment problem occurs because of the + 3 addition to the pointer value in the old code. The pointer is 2-byte aligned before this addition, but is unaligned after + 3. The new code uses an aligned struct pointer only, and passes it on, whereas the old code manually created an unaligned struct pointer and passed it on. Accessing a struct through an unaligned pointer is a problem. Depending on the generated assembly and the platform, the consequences range from inefficiency to a fatal CPU trap exception. But accessing any element of the struct through an aligned struct pointer is OK, and the new code makes that happen. -- To view, visit https://gerrit.osmocom.org/10028 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia75ee0f64e660f6ff6d81d808f9c460b7cac93d2 Gerrit-Change-Number: 10028 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling Gerrit-Comment-Date: Thu, 19 Jul 2018 12:34:46 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 12:38:23 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 12:38:23 +0000 Subject: Change in pysim[master]: commands: depend on pytlv only when it is actually needed In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10048 ) Change subject: commands: depend on pytlv only when it is actually needed ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10048 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ida841d74d9581e7f395751b0f74556a06a038de6 Gerrit-Change-Number: 10048 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Thu, 19 Jul 2018 12:38:23 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 12:44:00 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 12:44:00 +0000 Subject: Change in pysim[master]: commands: depend on pytlv only when it is actually needed In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10048 ) Change subject: commands: depend on pytlv only when it is actually needed ...................................................................... Patch Set 1: Verified+1 Code-Review+1 verified that running with this patch works for sysmousim-sjs1 without pytlv installed. -- To view, visit https://gerrit.osmocom.org/10048 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ida841d74d9581e7f395751b0f74556a06a038de6 Gerrit-Change-Number: 10048 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Thu, 19 Jul 2018 12:44:00 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 12:44:34 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 12:44:34 +0000 Subject: Change in pysim[master]: commands: depend on pytlv only when it is actually needed In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10048 ) Change subject: commands: depend on pytlv only when it is actually needed ...................................................................... Patch Set 1: now the readme should probably say "requires pytlv for " :) -- To view, visit https://gerrit.osmocom.org/10048 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ida841d74d9581e7f395751b0f74556a06a038de6 Gerrit-Change-Number: 10048 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Thu, 19 Jul 2018 12:44:34 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 12:48:07 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 19 Jul 2018 12:48:07 +0000 Subject: Change in osmo-ggsn[master]: fix unaligned access in build_ipcp_pco() In-Reply-To: References: Message-ID: Stefan Sperling has posted comments on this change. ( https://gerrit.osmocom.org/10028 ) Change subject: fix unaligned access in build_ipcp_pco() ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/10028/1/ggsn/ggsn.c File ggsn/ggsn.c: https://gerrit.osmocom.org/#/c/10028/1/ggsn/ggsn.c at 514 PS1, Line 514: ipcp = (struct pco_ipcp_hdr *)pco_contains_proto(&pdp->pco_req, PCO_P_IPCP); > The alignment problem occurs because of the + 3 addition to the pointer value in the old code. [?] I realize now your question boils down to whether the pointer returned from pco_contains_proto() is already aligned or not. Hmm.. -- To view, visit https://gerrit.osmocom.org/10028 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia75ee0f64e660f6ff6d81d808f9c460b7cac93d2 Gerrit-Change-Number: 10028 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling Gerrit-Comment-Date: Thu, 19 Jul 2018 12:48:07 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 12:49:28 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 12:49:28 +0000 Subject: Change in pysim[master]: readme: add 'serial' dep, cosmetically rearrange Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10051 Change subject: readme: add 'serial' dep, cosmetically rearrange ...................................................................... readme: add 'serial' dep, cosmetically rearrange Change-Id: I414b897ba4911b7428ddf807cb04a93700ee0193 --- M README.md 1 file changed, 10 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/51/10051/1 diff --git a/README.md b/README.md index e098700..60e3a1b 100644 --- a/README.md +++ b/README.md @@ -31,10 +31,17 @@ Dependencies ------------ -pysim requires pyscard and pytlv. Both can be installed using python-pip: -pip install pytlv -pip install pyscard +pysim requires: + +- pyscard +- serial +- pytlv (for specific card types) + +Example for Debian: + + apt-get install python-pyscard python-serial pip + pip install pytlv Mailing List -- To view, visit https://gerrit.osmocom.org/10051 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I414b897ba4911b7428ddf807cb04a93700ee0193 Gerrit-Change-Number: 10051 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 13:06:44 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 19 Jul 2018 13:06:44 +0000 Subject: Change in osmo-ggsn[master]: fix unaligned access in build_ipcp_pco() In-Reply-To: References: Message-ID: Stefan Sperling has posted comments on this change. ( https://gerrit.osmocom.org/10028 ) Change subject: fix unaligned access in build_ipcp_pco() ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/10028/1/ggsn/ggsn.c File ggsn/ggsn.c: https://gerrit.osmocom.org/#/c/10028/1/ggsn/ggsn.c at 514 PS1, Line 514: ipcp = (struct pco_ipcp_hdr *)pco_contains_proto(&pdp->pco_req, PCO_P_IPCP); > I realize now your question boils down to whether the pointer returned from pco_contains_proto() is [?] The answer is "it depends" because the pointer value returned from pco_contains_proto() is calculated based on the length field of IEs inside the packet. In this function, pco->v is 2-byte aligned, and pco->v + 1 + 3 is aligned. But we cannot know whether pco->v + 1 + cur_len + 3 is aligned. Maybe this code should be parsing the data via uint8_t* pointers only. -- To view, visit https://gerrit.osmocom.org/10028 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia75ee0f64e660f6ff6d81d808f9c460b7cac93d2 Gerrit-Change-Number: 10028 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling Gerrit-Comment-Date: Thu, 19 Jul 2018 13:06:44 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 13:38:40 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 13:38:40 +0000 Subject: Change in osmo-ggsn[master]: fix unaligned access in build_ipcp_pco() In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10028 ) Change subject: fix unaligned access in build_ipcp_pco() ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/10028 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia75ee0f64e660f6ff6d81d808f9c460b7cac93d2 Gerrit-Change-Number: 10028 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling Gerrit-Comment-Date: Thu, 19 Jul 2018 13:38:40 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 14:27:38 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 19 Jul 2018 14:27:38 +0000 Subject: Change in osmo-ggsn[master]: fix unaligned access in build_ipcp_pco() In-Reply-To: References: Message-ID: Stefan Sperling has abandoned this change. ( https://gerrit.osmocom.org/10028 ) Change subject: fix unaligned access in build_ipcp_pco() ...................................................................... Abandoned Doesn't fix the problem. -- To view, visit https://gerrit.osmocom.org/10028 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: Ia75ee0f64e660f6ff6d81d808f9c460b7cac93d2 Gerrit-Change-Number: 10028 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 15:04:51 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 19 Jul 2018 15:04:51 +0000 Subject: Change in pysim[master]: commands: depend on pytlv only when it is actually needed In-Reply-To: References: Message-ID: dexter has posted comments on this change. ( https://gerrit.osmocom.org/10048 ) Change subject: commands: depend on pytlv only when it is actually needed ...................................................................... Patch Set 1: > now the readme should probably say "requires pytlv for " > :) Probably not, if we do so we also need to keep the info up to date. -- To view, visit https://gerrit.osmocom.org/10048 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ida841d74d9581e7f395751b0f74556a06a038de6 Gerrit-Change-Number: 10048 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-Comment-Date: Thu, 19 Jul 2018 15:04:51 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 15:05:31 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 19 Jul 2018 15:05:31 +0000 Subject: Change in osmo-bts[master]: l1sap: add_l1sap_header: Compact msgb_push ret assignment Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10052 Change subject: l1sap: add_l1sap_header: Compact msgb_push ret assignment ...................................................................... l1sap: add_l1sap_header: Compact msgb_push ret assignment Change-Id: Ia427c216cd096d313b234ca244eb71837450e2a9 --- M src/common/l1sap.c 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/52/10052/1 diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 3a40949..8936674 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -139,8 +139,7 @@ gsm_lchan_name(lchan), osmo_hexdump(rmsg->data, rmsg->len)); rmsg->l2h = rmsg->data; - msgb_push(rmsg, sizeof(*l1sap)); - rmsg->l1h = rmsg->data; + rmsg->l1h = msgb_push(rmsg, sizeof(*l1sap)); l1sap = msgb_l1sap_prim(rmsg); osmo_prim_init(&l1sap->oph, SAP_GSM_PH, PRIM_TCH, PRIM_OP_INDICATION, rmsg); -- To view, visit https://gerrit.osmocom.org/10052 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ia427c216cd096d313b234ca244eb71837450e2a9 Gerrit-Change-Number: 10052 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 15:05:32 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 19 Jul 2018 15:05:32 +0000 Subject: Change in osmo-bts[master]: sched: Log RX->RTP packet like we do in add_l1sap_header Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10053 Change subject: sched: Log RX->RTP packet like we do in add_l1sap_header ...................................................................... sched: Log RX->RTP packet like we do in add_l1sap_header Other backends use already msgb in lower layers and eventually call add_l1sap_header to push TCH data up the stack. backends using common/scheduler.c (bts-trx, bts-virt) are the only ones not yet using msgb in lower layer but only creating the msgb immediatelly before sending it in _sched_compose_tch_ind. Let's add a log message there too to have similar output in all BTS backends. Change-Id: Ia90b051f308abcd8b88b84e861da593844b0d81a --- M src/common/scheduler.c 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/53/10053/1 diff --git a/src/common/scheduler.c b/src/common/scheduler.c index 8c9d30d..a32dfdf 100644 --- a/src/common/scheduler.c +++ b/src/common/scheduler.c @@ -380,14 +380,17 @@ { struct msgb *msg; struct osmo_phsap_prim *l1sap; + struct gsm_bts_trx *trx = l1t->trx; struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, tn); + uint8_t chan_nr = trx_chan_desc[chan].chan_nr | tn; + struct gsm_lchan *lchan = &trx->ts[L1SAP_CHAN2TS(chan_nr)].lchan[l1sap_chan2ss(chan_nr)]; /* compose primitive */ msg = l1sap_msgb_alloc(tch_len); l1sap = msgb_l1sap_prim(msg); osmo_prim_init(&l1sap->oph, SAP_GSM_PH, PRIM_TCH, PRIM_OP_INDICATION, msg); - l1sap->u.tch.chan_nr = trx_chan_desc[chan].chan_nr | tn; + l1sap->u.tch.chan_nr = chan_nr; l1sap->u.tch.fn = fn; msg->l2h = msgb_put(msg, tch_len); if (tch_len) @@ -396,6 +399,8 @@ if (l1ts->chan_state[chan].lost) l1ts->chan_state[chan].lost--; + LOGP(DL1P, LOGL_DEBUG, "%s Rx -> RTP: %s\n", + gsm_lchan_name(lchan), osmo_hexdump(msg->data, msg->len)); /* forward primitive */ l1sap_up(l1t->trx, l1sap); -- To view, visit https://gerrit.osmocom.org/10053 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ia90b051f308abcd8b88b84e861da593844b0d81a Gerrit-Change-Number: 10053 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 15:09:29 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 19 Jul 2018 15:09:29 +0000 Subject: Change in pysim[master]: readme: add 'serial' dep, cosmetically rearrange In-Reply-To: References: Message-ID: dexter has posted comments on this change. ( https://gerrit.osmocom.org/10051 ) Change subject: readme: add 'serial' dep, cosmetically rearrange ...................................................................... Patch Set 1: (1 comment) > Uploaded patch set 1. Looks good to me. https://gerrit.osmocom.org/#/c/10051/1/README.md File README.md: https://gerrit.osmocom.org/#/c/10051/1/README.md at 43 PS1, Line 43: apt-get install python-pyscard python-serial pip my package manger says that the package is called "python-pip" -- To view, visit https://gerrit.osmocom.org/10051 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I414b897ba4911b7428ddf807cb04a93700ee0193 Gerrit-Change-Number: 10051 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-Comment-Date: Thu, 19 Jul 2018 15:09:29 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Thu Jul 19 15:13:17 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Thu, 19 Jul 2018 15:13:17 +0000 (UTC) Subject: =?UTF-8?Q?Jenkins_build_is_back_to_normal_:_master-asn1c_=C2=BB_a1=3Dde?= =?UTF-8?Q?fault,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#189?= In-Reply-To: <2095671232.222.1531926606514.JavaMail.jenkins@jenkins.osmocom.org> References: <2095671232.222.1531926606514.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <47160950.230.1532013197791.JavaMail.jenkins@jenkins.osmocom.org> See From gerrit-no-reply at lists.osmocom.org Thu Jul 19 15:52:21 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 19 Jul 2018 15:52:21 +0000 Subject: Change in osmo-ggsn[master]: fix unaligned access in build_ipcp_pco() Message-ID: Stefan Sperling has uploaded this change for review. ( https://gerrit.osmocom.org/10054 Change subject: fix unaligned access in build_ipcp_pco() ...................................................................... fix unaligned access in build_ipcp_pco() IPCP data can begin at any byte location in the pco_req->v array. Casting to a 'struct ipcp_hdr' pointer could lead to unaligned access. Parse IPCP data with u_int8_t pointers instead to avoid this problem. Add some length checks while here. pco_contains_proto() and ipcp_contains_option() now receive the minimum size of the data the caller is looking for, and only return pointers to items of sufficient size. Change-Id: Ia1410abb216831864042f95679330f4508e1af3d Related: OS#3194 --- M ggsn/ggsn.c 1 file changed, 29 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/54/10054/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 6d879c0..144eced 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -413,16 +413,17 @@ } __attribute__ ((packed)); /* determine if IPCP contains given option */ -static struct ipcp_option_hdr *ipcp_contains_option(struct ipcp_hdr *ipcp, enum ipcp_options opt) +static uint8_t *ipcp_contains_option(uint8_t *ipcp, size_t ipcp_len, enum ipcp_options opt, size_t opt_minlen) { - uint8_t *cur = ipcp->options; + uint8_t *cur_opt = ipcp + sizeof(struct ipcp_hdr); /* iterate over Options and check if protocol contained */ - while (cur + 2 <= ((uint8_t *)ipcp) + ntohs(ipcp->len)) { - struct ipcp_option_hdr *cur_opt = (struct ipcp_option_hdr *) cur; - if (cur_opt->type == opt) + while (cur_opt + 2 <= ipcp + ipcp_len) { + uint8_t type = cur_opt[0]; + uint8_t len = cur_opt[1]; /* length value includes 2 bytes type/length */ + if (type == opt && len >= 2 + opt_minlen) return cur_opt; - cur += cur_opt->len; + cur_opt += OSMO_MAX(len, 2); } return NULL; } @@ -460,7 +461,7 @@ }; /* determine if PCO contains given protocol */ -static uint8_t *pco_contains_proto(struct ul255_t *pco, uint16_t prot) +static uint8_t *pco_contains_proto(struct ul255_t *pco, uint16_t prot, size_t prot_minlen) { uint8_t *cur = pco->v + 1; @@ -468,7 +469,7 @@ while (cur + 3 <= pco->v + pco->l) { uint16_t cur_prot = osmo_load16be(cur); uint8_t cur_len = cur[2]; - if (cur_prot == prot) + if (cur_prot == prot && cur_len >= prot_minlen) return cur; cur += cur_len + 3; } @@ -500,35 +501,45 @@ } /* construct an IPCP PCO response from request*/ -static int build_ipcp_pco(struct apn_ctx *apn, struct pdp_t *pdp, struct msgb *msg) +static void build_ipcp_pco(struct apn_ctx *apn, struct pdp_t *pdp, struct msgb *msg) { const struct in46_addr *dns1 = &apn->v4.cfg.dns[0]; const struct in46_addr *dns2 = &apn->v4.cfg.dns[1]; - struct ipcp_hdr *ipcp; + uint8_t *ipcp; + uint16_t options_len; uint8_t *len1, *len2, *pco_ipcp; uint8_t *start = msg->tail; unsigned int len_appended; + ptrdiff_t consumed; + size_t remain; - if (!(pco_ipcp = pco_contains_proto(&pdp->pco_req, PCO_P_IPCP))) - return 0; - ipcp = (struct ipcp_hdr*) (pco_ipcp + 3); /* 2=type + 1=len */ + /* pco_contains_proto() returns a potentially unaligned pointer into pco_req->v (see OS#3194) */ + if (!(pco_ipcp = pco_contains_proto(&pdp->pco_req, PCO_P_IPCP, sizeof(struct ipcp_hdr)))) + return; + + ipcp = (pco_ipcp + 3); /* 2=type + 1=len */ + consumed = (ipcp - &pdp->pco_req.v[0]); + remain = ARRAY_SIZE(pdp->pco_req.v) - consumed; + options_len = osmo_load16be(ipcp + 2); /* 1=code + 1=id */ + if (remain < 0 || remain < sizeof(struct ipcp_hdr) + options_len) + return; /* Three byte T16L header */ msgb_put_u16(msg, 0x8021); /* IPCP */ len1 = msgb_put(msg, 1); /* Length of contents: delay */ msgb_put_u8(msg, 0x02); /* ACK */ - msgb_put_u8(msg, ipcp->id); /* ID: Needs to match request */ + msgb_put_u8(msg, ipcp[1]); /* ID: Needs to match request */ msgb_put_u8(msg, 0x00); /* Length MSB */ len2 = msgb_put(msg, 1); /* Length LSB: delay */ - if (dns1->len == 4 && ipcp_contains_option(ipcp, IPCP_OPT_PRIMARY_DNS)) { + if (dns1->len == 4 && ipcp_contains_option(ipcp, sizeof(struct ipcp_hdr) + options_len, IPCP_OPT_PRIMARY_DNS, 4)) { msgb_put_u8(msg, 0x81); /* DNS1 Tag */ msgb_put_u8(msg, 2 + dns1->len);/* DNS1 Length, incl. TL */ msgb_put_u32(msg, ntohl(dns1->v4.s_addr)); } - if (dns2->len == 4 && ipcp_contains_option(ipcp, IPCP_OPT_SECONDARY_DNS)) { + if (dns2->len == 4 && ipcp_contains_option(ipcp, sizeof(struct ipcp_hdr) + options_len, IPCP_OPT_SECONDARY_DNS, 4)) { msgb_put_u8(msg, 0x83); /* DNS2 Tag */ msgb_put_u8(msg, 2 + dns2->len);/* DNS2 Length, incl. TL */ msgb_put_u32(msg, ntohl(dns2->v4.s_addr)); @@ -538,8 +549,6 @@ len_appended = msg->tail - start; *len1 = len_appended - 3; *len2 = len_appended - 3; - - return 0; } /* process one PCO request from a MS/UE, putting together the proper responses */ @@ -555,7 +564,7 @@ if (peer_v4) build_ipcp_pco(apn, pdp, msg); - if (pco_contains_proto(&pdp->pco_req, PCO_P_DNS_IPv6_ADDR)) { + if (pco_contains_proto(&pdp->pco_req, PCO_P_DNS_IPv6_ADDR, 0)) { for (i = 0; i < ARRAY_SIZE(apn->v6.cfg.dns); i++) { struct in46_addr *i46a = &apn->v6.cfg.dns[i]; if (i46a->len != 16) @@ -564,7 +573,7 @@ } } - if (pco_contains_proto(&pdp->pco_req, PCO_P_DNS_IPv4_ADDR)) { + if (pco_contains_proto(&pdp->pco_req, PCO_P_DNS_IPv4_ADDR, 0)) { for (i = 0; i < ARRAY_SIZE(apn->v4.cfg.dns); i++) { struct in46_addr *i46a = &apn->v4.cfg.dns[i]; if (i46a->len != 4) -- To view, visit https://gerrit.osmocom.org/10054 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ia1410abb216831864042f95679330f4508e1af3d Gerrit-Change-Number: 10054 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 16:20:48 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 19 Jul 2018 16:20:48 +0000 Subject: Change in osmo-mgw[master]: protocol: prevent unnecessary null pointer deref Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/10055 Change subject: protocol: prevent unnecessary null pointer deref ...................................................................... protocol: prevent unnecessary null pointer deref The function setup_rtp_processing() in mgcp_protocol.c executes a function pointer setup_rtp_processing_cb(). The function pointer gets two struct mgcp_rtp_end pointers as parameter. To get those parameters it has to dereference them from struct mgcp_conn_rtp pointers. The variable conn_src is such a struct pointer and there are conditions where this pointer may be NULL. The function at the function pointer should get the conn pointers directly instead of the dereferenced end (rtp) pointers. This also gives additional flexibility to the implementation behind the function pointer, which is not yet defined (the function pointer points always to a stub function since we donot support transcoding yet. - give conn pointers directly to setup_rtp_processing_cb() insed of dereferencing conn_src->end Change-Id: Id46e9bfba88613387026639eb4957221cce6820a Closes OS#3406 --- M include/osmocom/mgcp/mgcp.h M include/osmocom/mgcp/mgcp_internal.h M src/libosmo-mgcp/mgcp_network.c M src/libosmo-mgcp/mgcp_protocol.c 4 files changed, 12 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/55/10055/1 diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h index bdc8f87..bdc86fc 100644 --- a/include/osmocom/mgcp/mgcp.h +++ b/include/osmocom/mgcp/mgcp.h @@ -74,11 +74,13 @@ typedef int (*mgcp_processing)(struct mgcp_endpoint *endp, struct mgcp_rtp_end *dst_end, char *data, int *len, int buf_size); -typedef int (*mgcp_processing_setup)(struct mgcp_endpoint *endp, - struct mgcp_rtp_end *dst_end, - struct mgcp_rtp_end *src_end); struct mgcp_conn_rtp; + +typedef int (*mgcp_processing_setup)(struct mgcp_endpoint *endp, + struct mgcp_conn_rtp *conn_dst, + struct mgcp_conn_rtp *conn_src); + typedef void (*mgcp_get_format)(struct mgcp_endpoint *endp, int *payload_type, const char**subtype_name, diff --git a/include/osmocom/mgcp/mgcp_internal.h b/include/osmocom/mgcp/mgcp_internal.h index 38b687c..06883dd 100644 --- a/include/osmocom/mgcp/mgcp_internal.h +++ b/include/osmocom/mgcp/mgcp_internal.h @@ -290,8 +290,8 @@ char *data, int *len, int buf_size); int mgcp_setup_rtp_processing_default(struct mgcp_endpoint *endp, - struct mgcp_rtp_end *dst_end, - struct mgcp_rtp_end *src_end); + struct mgcp_conn_rtp *conn_dst, + struct mgcp_conn_rtp *conn_src); void mgcp_get_net_downlink_format_default(struct mgcp_endpoint *endp, int *payload_type, diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c index 494156d..870a4de 100644 --- a/src/libosmo-mgcp/mgcp_network.c +++ b/src/libosmo-mgcp/mgcp_network.c @@ -399,12 +399,12 @@ /*! dummy callback to disable transcoding (see also cfg->setup_rtp_processing_cb). * \param[in] associated endpoint - * \param[in] destination RTP end - * \param[in] source RTP end + * \param[in] destination RTP connnection + * \param[in] source RTP connection * \returns ignores input parameters, return always 0 */ int mgcp_setup_rtp_processing_default(struct mgcp_endpoint *endp, - struct mgcp_rtp_end *dst_end, - struct mgcp_rtp_end *src_end) + struct mgcp_conn_rtp *conn_dst, + struct mgcp_conn_rtp *conn_src) { LOGP(DRTP, LOGL_DEBUG, "endpoint:0x%x transcoding disabled\n", ENDPOINT_NUMBER(endp)); diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index eea67a6..ea80907 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -89,8 +89,7 @@ } } - return cfg->setup_rtp_processing_cb(endp, &conn_dst->end, - &conn_src->end); + return cfg->setup_rtp_processing_cb(endp, conn_dst, conn_src); } /* array of function pointers for handling various -- To view, visit https://gerrit.osmocom.org/10055 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id46e9bfba88613387026639eb4957221cce6820a Gerrit-Change-Number: 10055 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 16:24:41 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 19 Jul 2018 16:24:41 +0000 Subject: Change in osmo-ggsn[master]: fix unaligned access in build_ipcp_pco() In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10054 ) Change subject: fix unaligned access in build_ipcp_pco() ...................................................................... Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/10054/1/ggsn/ggsn.c File ggsn/ggsn.c: https://gerrit.osmocom.org/#/c/10054/1/ggsn/ggsn.c at 426 PS1, Line 426: cur_opt += OSMO_MAX(len, 2); would probably make sense to return NULL and print an error if len==0 is found. Why is 1 not valid? because it would mean an empty value? https://gerrit.osmocom.org/#/c/10054/1/ggsn/ggsn.c at 522 PS1, Line 522: remain = ARRAY_SIZE(pdp->pco_req.v) - consumed; why array size? isn't that in elements? I think we want to count bytes here, so sizeof() makes more sense. -- To view, visit https://gerrit.osmocom.org/10054 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia1410abb216831864042f95679330f4508e1af3d Gerrit-Change-Number: 10054 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 19 Jul 2018 16:24:41 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 16:28:54 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 19 Jul 2018 16:28:54 +0000 Subject: Change in osmo-mgw[master]: protocol: prevent unnecessary null pointer deref In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10055 ) Change subject: protocol: prevent unnecessary null pointer deref ...................................................................... Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/10055/1/include/osmocom/mgcp/mgcp.h File include/osmocom/mgcp/mgcp.h: https://gerrit.osmocom.org/#/c/10055/1/include/osmocom/mgcp/mgcp.h at 80 PS1, Line 80: typedef int (*mgcp_processing_setup)(struct mgcp_endpoint *endp, Are you breaking the API with this change? Looks like it does. Please state so in the commit description (compatibility with old apps is broken here). -- To view, visit https://gerrit.osmocom.org/10055 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id46e9bfba88613387026639eb4957221cce6820a Gerrit-Change-Number: 10055 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 19 Jul 2018 16:28:54 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 16:28:55 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 16:28:55 +0000 Subject: Change in osmo-bsc[master]: inter-BSC HO: add neighbor_ident API to manage neighbor-BSS-cells In-Reply-To: References: Message-ID: Hello Pau Espin Pedrol, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9666 to look at the new patch set (#10). Change subject: inter-BSC HO: add neighbor_ident API to manage neighbor-BSS-cells ...................................................................... inter-BSC HO: add neighbor_ident API to manage neighbor-BSS-cells Depends: Ia71ba742108b5ff020997bfb612ad5eb30d04fcd (libosmocore) Change-Id: I0153d7069817fba9146ddc11214de2757d7d37bf --- M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/handover.h A include/osmocom/bsc/neighbor_ident.h M src/osmo-bsc/Makefile.am M src/osmo-bsc/bsc_init.c M src/osmo-bsc/bsc_vty.c M src/osmo-bsc/gsm_data.c M src/osmo-bsc/handover_logic.c A src/osmo-bsc/neighbor_ident.c A src/osmo-bsc/neighbor_ident_vty.c M src/osmo-bsc/net_init.c M src/osmo-bsc/system_information.c M tests/bsc/Makefile.am M tests/gsm0408/Makefile.am M tests/handover/Makefile.am A tests/handover/neighbor_ident_test.c A tests/handover/neighbor_ident_test.err A tests/handover/neighbor_ident_test.ok A tests/neighbor_ident.vty M tests/testsuite.at 21 files changed, 1,983 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/66/9666/10 -- To view, visit https://gerrit.osmocom.org/9666 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0153d7069817fba9146ddc11214de2757d7d37bf Gerrit-Change-Number: 9666 Gerrit-PatchSet: 10 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 16:28:56 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 16:28:56 +0000 Subject: Change in osmo-bsc[master]: fix handover start: dealloc ho if event not permitted Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10056 Change subject: fix handover start: dealloc ho if event not permitted ...................................................................... fix handover start: dealloc ho if event not permitted Before this, a handover request in a conn state that disallows it would leave a lingering handover state in the conn, also thwarting any future handover attempts. (It would be deallocated on conn teardown, so no memleak.) Change-Id: I839a05495ae93c5dbbd1616efa2469e5b1990a61 --- M src/osmo-bsc/handover_logic.c 1 file changed, 9 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/56/10056/1 diff --git a/src/osmo-bsc/handover_logic.c b/src/osmo-bsc/handover_logic.c index 960bf69..064615c 100644 --- a/src/osmo-bsc/handover_logic.c +++ b/src/osmo-bsc/handover_logic.c @@ -82,6 +82,7 @@ int bsc_handover_start(enum hodec_id from_hodec_id, struct gsm_lchan *old_lchan, struct gsm_bts *new_bts, enum gsm_chan_t new_lchan_type) { + int rc; struct gsm_subscriber_connection *conn; struct bsc_handover *ho; static uint8_t ho_ref = 0; @@ -132,7 +133,14 @@ gsm_lchant_name(new_lchan_type), do_assignment ? "Assignment" : "Handover"); - return osmo_fsm_inst_dispatch(conn->fi, GSCON_EV_HO_START, NULL); + rc = osmo_fsm_inst_dispatch(conn->fi, GSCON_EV_HO_START, NULL); + + if (rc < 0) { + LOGPHO(ho, LOGL_ERROR, "Failed to trigger handover, conn state does not allow it\n"); + conn->ho = NULL; + talloc_free(ho); + } + return rc; } /*! Start actual handover. Call bsc_handover_start() instead; The only legal caller is the GSCON FSM in -- To view, visit https://gerrit.osmocom.org/10056 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I839a05495ae93c5dbbd1616efa2469e5b1990a61 Gerrit-Change-Number: 10056 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 16:28:57 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 16:28:57 +0000 Subject: Change in osmo-bsc[master]: ho cfg: fix unit strings Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10057 Change subject: ho cfg: fix unit strings ...................................................................... ho cfg: fix unit strings Change-Id: Ie98a68de207aea69befd24af3f302b6ef9e6f8e4 --- M include/osmocom/bsc/handover_cfg.h M tests/handover_cfg.vty 2 files changed, 21 insertions(+), 21 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/57/10057/1 diff --git a/include/osmocom/bsc/handover_cfg.h b/include/osmocom/bsc/handover_cfg.h index 2321fcf..865fab9 100644 --- a/include/osmocom/bsc/handover_cfg.h +++ b/include/osmocom/bsc/handover_cfg.h @@ -126,8 +126,8 @@ "handover1 ", "power budget hysteresis", "<0-999>", atoi, "%u", as_is, \ HO_CFG_STR_HANDOVER1 \ HO_CFG_STR_POWER_BUDGET \ - "How many dBm stronger must a neighbor be to become a HO candidate\n" \ - "Neighbor's strength difference in dBm\n") \ + "How many dB stronger must a neighbor be to become a HO candidate\n" \ + "Neighbor's strength difference in dB\n") \ \ HO_CFG_ONE_MEMBER(unsigned int, hodec1_max_distance, 9999, \ "handover1 ", "maximum distance" , "<0-9999>", atoi, "%u", as_is, \ @@ -172,8 +172,8 @@ "handover2 ", "power budget hysteresis", "<0-999>", atoi, "%u", as_is, \ HO_CFG_STR_HANDOVER2 \ HO_CFG_STR_POWER_BUDGET \ - "How many dBm stronger must a neighbor be to become a HO candidate\n" \ - "Neighbor's strength difference in dBm\n") \ + "How many dB stronger must a neighbor be to become a HO candidate\n" \ + "Neighbor's strength difference in dB\n") \ \ HO_CFG_ONE_MEMBER(unsigned int, hodec2_max_distance, 9999, \ "handover2 ", "maximum distance" , "<0-9999>", atoi, "%u", as_is, \ @@ -208,21 +208,21 @@ HO_CFG_STR_HANDOVER2 \ HO_CFG_STR_MIN \ "How bad may RxQual of an MS become before triggering HO\n" \ - "minimum RxQual (dBm)\n") \ + "minimum RxQual\n") \ \ HO_CFG_ONE_MEMBER(int, hodec2_afs_bias_rxlev, 0, \ "handover2 ", "afs-bias rxlev", "<0-20>", atoi, "%d", as_is, \ HO_CFG_STR_HANDOVER2 \ HO_CFG_STR_AFS_BIAS \ "RxLev improvement bias for AFS over other codecs\n" \ - "Virtual RxLev improvement (dBm)\n") \ + "Virtual RxLev improvement (dB)\n") \ \ HO_CFG_ONE_MEMBER(int, hodec2_afs_bias_rxqual, 0, \ "handover2 ", "afs-bias rxqual", "<0-7>", atoi, "%d", as_is, \ HO_CFG_STR_HANDOVER2 \ HO_CFG_STR_AFS_BIAS \ "RxQual improvement bias for AFS over other codecs\n" \ - "Virtual RxQual improvement (dBm)\n") \ + "Virtual RxQual improvement\n") \ \ HO_CFG_ONE_MEMBER(int, hodec2_tchf_min_slots, 0, \ "handover2 ", "min-free-slots tch/f", "<0-9999>", atoi, "%d", as_is, \ diff --git a/tests/handover_cfg.vty b/tests/handover_cfg.vty index 3ad44d8..119eaf5 100644 --- a/tests/handover_cfg.vty +++ b/tests/handover_cfg.vty @@ -264,14 +264,14 @@ OsmoBSC(config-net)# handover1 power budget ? interval How often to check for a better cell (SACCH frames) - hysteresis How many dBm stronger must a neighbor be to become a HO candidate + hysteresis How many dB stronger must a neighbor be to become a HO candidate OsmoBSC(config-net)# handover1 power budget interval ? <1-99> Check for stronger neighbor every N number of SACCH frames default Use default (6), remove explicit setting on this node OsmoBSC(config-net)# handover1 power budget hysteresis ? - <0-999> Neighbor's strength difference in dBm + <0-999> Neighbor's strength difference in dB default Use default (3), remove explicit setting on this node OsmoBSC(config-net)# handover1 maximum ? @@ -312,14 +312,14 @@ OsmoBSC(config-net)# handover2 power budget ? interval How often to check for a better cell (SACCH frames) - hysteresis How many dBm stronger must a neighbor be to become a HO candidate + hysteresis How many dB stronger must a neighbor be to become a HO candidate OsmoBSC(config-net)# handover2 power budget interval ? <1-99> Check for stronger neighbor every N number of SACCH frames default Use default (6), remove explicit setting on this node OsmoBSC(config-net)# handover2 power budget hysteresis ? - <0-999> Neighbor's strength difference in dBm + <0-999> Neighbor's strength difference in dB default Use default (3), remove explicit setting on this node OsmoBSC(config-net)# handover2 maximum ? @@ -348,7 +348,7 @@ default Use default (-100), remove explicit setting on this node OsmoBSC(config-net)# handover2 min rxqual ? - <0-7> minimum RxQual (dBm) + <0-7> minimum RxQual default Use default (5), remove explicit setting on this node OsmoBSC(config-net)# handover2 afs-bias ? @@ -356,11 +356,11 @@ rxqual RxQual improvement bias for AFS over other codecs OsmoBSC(config-net)# handover2 afs-bias rxlev ? - <0-20> Virtual RxLev improvement (dBm) + <0-20> Virtual RxLev improvement (dB) default Use default (0), remove explicit setting on this node OsmoBSC(config-net)# handover2 afs-bias rxqual ? - <0-7> Virtual RxQual improvement (dBm) + <0-7> Virtual RxQual improvement default Use default (0), remove explicit setting on this node OsmoBSC(config-net)# handover2 min-free-slots ? @@ -482,14 +482,14 @@ OsmoBSC(config-net-bts)# handover1 power budget ? interval How often to check for a better cell (SACCH frames) - hysteresis How many dBm stronger must a neighbor be to become a HO candidate + hysteresis How many dB stronger must a neighbor be to become a HO candidate OsmoBSC(config-net-bts)# handover1 power budget interval ? <1-99> Check for stronger neighbor every N number of SACCH frames default Use default (6), remove explicit setting on this node OsmoBSC(config-net-bts)# handover1 power budget hysteresis ? - <0-999> Neighbor's strength difference in dBm + <0-999> Neighbor's strength difference in dB default Use default (3), remove explicit setting on this node OsmoBSC(config-net-bts)# handover1 maximum ? @@ -530,14 +530,14 @@ OsmoBSC(config-net-bts)# handover2 power budget ? interval How often to check for a better cell (SACCH frames) - hysteresis How many dBm stronger must a neighbor be to become a HO candidate + hysteresis How many dB stronger must a neighbor be to become a HO candidate OsmoBSC(config-net-bts)# handover2 power budget interval ? <1-99> Check for stronger neighbor every N number of SACCH frames default Use default (6), remove explicit setting on this node OsmoBSC(config-net-bts)# handover2 power budget hysteresis ? - <0-999> Neighbor's strength difference in dBm + <0-999> Neighbor's strength difference in dB default Use default (3), remove explicit setting on this node OsmoBSC(config-net-bts)# handover2 maximum ? @@ -566,7 +566,7 @@ default Use default (-100), remove explicit setting on this node OsmoBSC(config-net-bts)# handover2 min rxqual ? - <0-7> minimum RxQual (dBm) + <0-7> minimum RxQual default Use default (5), remove explicit setting on this node OsmoBSC(config-net-bts)# handover2 afs-bias ? @@ -574,11 +574,11 @@ rxqual RxQual improvement bias for AFS over other codecs OsmoBSC(config-net-bts)# handover2 afs-bias rxlev ? - <0-20> Virtual RxLev improvement (dBm) + <0-20> Virtual RxLev improvement (dB) default Use default (0), remove explicit setting on this node OsmoBSC(config-net-bts)# handover2 afs-bias rxqual ? - <0-7> Virtual RxQual improvement (dBm) + <0-7> Virtual RxQual improvement default Use default (0), remove explicit setting on this node OsmoBSC(config-net-bts)# handover2 min-free-slots ? -- To view, visit https://gerrit.osmocom.org/10057 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ie98a68de207aea69befd24af3f302b6ef9e6f8e4 Gerrit-Change-Number: 10057 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 16:28:57 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 16:28:57 +0000 Subject: Change in osmo-bsc[master]: hodec2 log: less verbose, more concise logging Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10058 Change subject: hodec2 log: less verbose, more concise logging ...................................................................... hodec2 log: less verbose, more concise logging Drop numerous log statements that merely bloat the ho decision log. Logging HO candidates: log more compact in a single line, do not use LOGPC and multiline output. The result is more useful information in a quarter of the log lines. LOGPHOLCHAN(), LOGPHOLCHANTOBTS(): - log lchan->type instead of lchan->ts->pchan - always log the speech mode ===== Before ===== DHODEC handover_decision_2.c:1131 (lchan 0.010 TCH/F) (subscr IMSI:000001) MEASUREMENT REPORT (1 neighbors) DHODEC handover_decision_2.c:1136 (lchan 0.010 TCH/F) (subscr IMSI:000001) 0: arfcn=871 bsic=63 neigh_idx=0 rxlev=30 flags=0 DHODEC handover_decision_2.c:261 (lchan 0.010 TCH/F) (subscr IMSI:000001) neigh 871 rxlev=30 last_seen_nr=3 DHODEC handover_decision_2.c:1158 (lchan 0.010 TCH/F) (subscr IMSI:000001) HODEC2: evaluating measurement report DHODEC handover_decision_2.c:1175 (lchan 0.010 TCH/F) (subscr IMSI:000001) Measurement report: average RX level = -110 DHODEC handover_decision_2.c:1190 (lchan 0.010 TCH/F) (subscr IMSI:000001) Virtually improving RX level from -110 to -105, due to AFS bias DHODEC handover_decision_2.c:1220 (lchan 0.010 TCH/F) (subscr IMSI:000001) Attempting handover/assignment due to low rxlev DHODEC handover_decision_2.c:899 (lchan 0.010 TCH/F) (subscr IMSI:000001) Collecting candidates for Assignment and Handover DHODEC handover_decision_2.c:407 (lchan 0.010 TCH/F)->(BTS 0) (subscr IMSI:000001) tch_mode='SPEECH_AMR' type='TCH_F' DHODEC handover_decision_2.c:313 (lchan 0.010 TCH/F) (subscr IMSI:000001) FR3 supported DHODEC handover_decision_2.c:313 (lchan 0.010 TCH/F) (subscr IMSI:000001) HR3 supported DHODEC handover_decision_2.c:489 (lchan 0.010 TCH/F)->(BTS 0) (subscr IMSI:000001) removing TCH/F, already on TCH/F in this cell DHODEC handover_decision_2.c:573 (lchan 0.010 TCH/F)->(BTS 0) (subscr IMSI:000001) TCH/H would not be congested after HO DHODEC handover_decision_2.c:605 (lchan 0.010 TCH/F)->(BTS 0) (subscr IMSI:000001) TCH/H would not be less congested in target than source cell after HO DHODEC handover_decision_2.c:609 (lchan 0.010 TCH/F)->(BTS 0) (subscr IMSI:000001) requirements=0x30 DHODEC handover_decision_2.c:704 - current BTS 0, RX level -110 DHODEC handover_decision_2.c:707 o free TCH/F slots 3, minimum required 0 DHODEC handover_decision_2.c:709 o free TCH/H slots 4, minimum required 0 DHODEC handover_decision_2.c:714 o no requirement fulfilled for TCHF (no assignment possible) DHODEC handover_decision_2.c:737 o requirement A B fulfilled for TCHH (not congested after assignment) DHODEC handover_decision_2.c:407 (lchan 0.010 TCH/F)->(BTS 1) (subscr IMSI:000001) tch_mode='SPEECH_AMR' type='TCH_F' DHODEC handover_decision_2.c:313 (lchan 0.010 TCH/F) (subscr IMSI:000001) FR3 supported DHODEC handover_decision_2.c:313 (lchan 0.010 TCH/F) (subscr IMSI:000001) HR3 supported DHODEC handover_decision_2.c:563 (lchan 0.010 TCH/F)->(BTS 1) (subscr IMSI:000001) TCH/F would not be congested after HO DHODEC handover_decision_2.c:573 (lchan 0.010 TCH/F)->(BTS 1) (subscr IMSI:000001) TCH/H would not be congested after HO DHODEC handover_decision_2.c:595 (lchan 0.010 TCH/F)->(BTS 1) (subscr IMSI:000001) TCH/F would not be less congested in target than source cell after HO DHODEC handover_decision_2.c:605 (lchan 0.010 TCH/F)->(BTS 1) (subscr IMSI:000001) TCH/H would not be less congested in target than source cell after HO DHODEC handover_decision_2.c:609 (lchan 0.010 TCH/F)->(BTS 1) (subscr IMSI:000001) requirements=0x33 DHODEC handover_decision_2.c:701 - neighbor BTS 1, RX level -110 -> -80 DHODEC handover_decision_2.c:707 o free TCH/F slots 4, minimum required 0 DHODEC handover_decision_2.c:709 o free TCH/H slots 4, minimum required 0 DHODEC handover_decision_2.c:712 o requirement A B fulfilled for TCHF (not congested after handover) DHODEC handover_decision_2.c:737 o requirement A B fulfilled for TCHH (not congested after handover) DHODEC handover_decision_2.c:914 (lchan 0.010 TCH/F) (subscr IMSI:000001) adding 2 candidates from 1 neighbors, total 2 DHODEC handover_decision_2.c:1020 (lchan 0.010 TCH/F)->(BTS 1) (subscr IMSI:000001) Best candidate, RX level -80 DHODEC handover_decision_2.c:625 (lchan 0.010 TCH/F)->(BTS 1) (subscr IMSI:000001) Triggering Handover DHODEC handover_decision_2.c:688 (lchan 0.010 TCH/F)->(BTS 1) (subscr IMSI:000001) Triggering handover to TCH/F, due to low rxlevel DHO handover_logic.c:133 (BTS 0 trx 0 ts 1 lchan 0 TCH/F)->(BTS 1 lchan TCH_F) Initiating Handover... DMSC handover_logic.c:135 SUBSCR_CONN[0x612000000520]{ACTIVE}: Received Event HO_START DHODEC handover_logic.c:172 (BTS 0 trx 0 arfcn 870 ts 1 lchan 0 TCH/F)->(BTS 1 trx 0 arfcn 871 ts 1 lchan 0 TCH/F) (subscr IMSI:000001) Triggering Handover ===== After ===== DHODEC handover_decision_2.c:1039 (lchan 0.010 TCH_F SPEECH_AMR) (subscr IMSI:000001) MEASUREMENT REPORT (1 neighbors) DHODEC handover_decision_2.c:1044 (lchan 0.010 TCH_F SPEECH_AMR) (subscr IMSI:000001) 0: arfcn=871 bsic=63 neigh_idx=0 rxlev=30 flags=0 DHODEC handover_decision_2.c:1097 (lchan 0.010 TCH_F SPEECH_AMR) (subscr IMSI:000001) Avg RX level = -110 dBm, +5 dBm AFS bias = -105 dBm; Avg RX quality = -1 (invalid), +0 AFS bias = -1 DHODEC handover_decision_2.c:1122 (lchan 0.010 TCH_F SPEECH_AMR) (subscr IMSI:000001) RX level is TOO LOW: -105 < -100 DHODEC handover_decision_2.c:677 (lchan 0.010 TCH_F SPEECH_AMR)->(BTS 0) (subscr IMSI:000001) RX level -110; TCH/F={free 3 (want 0), [-] not a candidate}; TCH/H={free 4 (want 0), [ABC] good} DHODEC handover_decision_2.c:671 (lchan 0.010 TCH_F SPEECH_AMR)->(BTS 1) (subscr IMSI:000001) RX level -110 -> -80; TCH/F={free 4 (want 0), [ABC] good}; TCH/H={free 4 (want 0), [ABC] good} DHODEC handover_decision_2.c:928 (lchan 0.010 TCH_F SPEECH_AMR)->(BTS 1) (subscr IMSI:000001) Best candidate, RX level -80 DHODEC handover_decision_2.c:641 (lchan 0.010 TCH_F SPEECH_AMR)->(BTS 1) (subscr IMSI:000001) Triggering handover to TCH/F, due to low rxlevel DMSC handover_logic.c:125 SUBSCR_CONN[0x612000000520]{ACTIVE}: Received Event HO_START DHODEC handover_logic.c:169 (BTS 0 trx 0 arfcn 870 ts 1 lchan 0 TCH_F SPEECH_AMR)->(BTS 1 trx 0 arfcn 871 ts 1 lchan 0 TCH/F) (subscr IMSI:000001) Triggering Handover Change-Id: If1add9b57a051d32b67a4a08ab47a9655aa9dd17 --- M include/osmocom/bsc/handover.h M src/osmo-bsc/handover_decision_2.c M src/osmo-bsc/handover_logic.c 3 files changed, 76 insertions(+), 199 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/58/10058/1 diff --git a/include/osmocom/bsc/handover.h b/include/osmocom/bsc/handover.h index eb03f6a..772ab98 100644 --- a/include/osmocom/bsc/handover.h +++ b/include/osmocom/bsc/handover.h @@ -12,13 +12,14 @@ struct gsm_meas_rep mr; #define LOGPHOLCHANTOLCHAN(old_lchan, new_lchan, level, fmt, args...) \ - LOGP(DHODEC, level, "(BTS %u trx %u arfcn %u ts %u lchan %u %s)->(BTS %u trx %u arfcn %u ts %u lchan %u %s) (subscr %s) " fmt, \ + LOGP(DHODEC, level, "(BTS %u trx %u arfcn %u ts %u lchan %u %s %s)->(BTS %u trx %u arfcn %u ts %u lchan %u %s) (subscr %s) " fmt, \ old_lchan->ts->trx->bts->nr, \ old_lchan->ts->trx->nr, \ old_lchan->ts->trx->arfcn, \ old_lchan->ts->nr, \ old_lchan->nr, \ - gsm_pchan_name(old_lchan->ts->pchan), \ + gsm_lchant_name(old_lchan->type), \ + gsm48_chan_mode_name(old_lchan->tch_mode), \ new_lchan->ts->trx->bts->nr, \ new_lchan->ts->trx->nr, \ new_lchan->ts->trx->arfcn, \ diff --git a/src/osmo-bsc/handover_decision_2.c b/src/osmo-bsc/handover_decision_2.c index 7ac54df..e514b6c 100644 --- a/src/osmo-bsc/handover_decision_2.c +++ b/src/osmo-bsc/handover_decision_2.c @@ -40,22 +40,24 @@ LOGP(DHODEC, level, "(BTS %u) " fmt, bts->nr, ## args) #define LOGPHOLCHAN(lchan, level, fmt, args...) \ - LOGP(DHODEC, level, "(lchan %u.%u%u%u %s) (subscr %s) " fmt, \ + LOGP(DHODEC, level, "(lchan %u.%u%u%u %s %s) (subscr %s) " fmt, \ lchan->ts->trx->bts->nr, \ lchan->ts->trx->nr, \ lchan->ts->nr, \ lchan->nr, \ - gsm_pchan_name(lchan->ts->pchan), \ + gsm_lchant_name(lchan->type), \ + gsm48_chan_mode_name(lchan->tch_mode), \ bsc_subscr_name(lchan->conn? lchan->conn->bsub : NULL), \ ## args) #define LOGPHOLCHANTOBTS(lchan, new_bts, level, fmt, args...) \ - LOGP(DHODEC, level, "(lchan %u.%u%u%u %s)->(BTS %u) (subscr %s) " fmt, \ + LOGP(DHODEC, level, "(lchan %u.%u%u%u %s %s)->(BTS %u) (subscr %s) " fmt, \ lchan->ts->trx->bts->nr, \ lchan->ts->trx->nr, \ lchan->ts->nr, \ lchan->nr, \ - gsm_pchan_name(lchan->ts->pchan), \ + gsm_lchant_name(lchan->type), \ + gsm48_chan_mode_name(lchan->tch_mode), \ new_bts->nr, \ bsc_subscr_name(lchan->conn? lchan->conn->bsub : NULL), \ ## args) @@ -257,13 +259,9 @@ if (mrc) { nmp->rxlev[idx] = mrc->rxlev; nmp->last_seen_nr = mr->nr; - LOGPHOLCHAN(mr->lchan, LOGL_DEBUG, "neigh %u rxlev=%d last_seen_nr=%u\n", - nmp->arfcn, mrc->rxlev, nmp->last_seen_nr); mrc->flags |= MRC_F_PROCESSED; } else { nmp->rxlev[idx] = 0; - LOGPHOLCHAN(mr->lchan, LOGL_DEBUG, "neigh %u not in report (last_seen_nr=%u)\n", - nmp->arfcn, nmp->last_seen_nr); } nmp->rxlev_cnt++; } @@ -308,11 +306,8 @@ } for (i = 0; i < clist->len; i++) { - if (clist->codec[i].type == type) { - LOGPHOLCHAN(conn->lchan, LOGL_DEBUG, "%s supported\n", - gsm0808_speech_codec_type_name(type)); + if (clist->codec[i].type == type) return true; - } } LOGPHOLCHAN(conn->lchan, LOGL_DEBUG, "Codec not supported by MS or not allowed by MSC: %s\n", gsm0808_speech_codec_type_name(type)); @@ -402,10 +397,6 @@ return 0; } - LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "tch_mode='%s' type='%s'\n", - get_value_string(gsm48_chan_mode_names, lchan->tch_mode), - gsm_lchant_name(lchan->type)); - /* compatibility check for codecs. * if so, the candidates for full rate and half rate are selected */ switch (lchan->tch_mode) { @@ -413,9 +404,6 @@ switch (lchan->type) { case GSM_LCHAN_TCH_F: /* mandatory */ requirement |= REQUIREMENT_A_TCHF; - LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "tch_mode='%s' type='%s' supported\n", - get_value_string(gsm48_chan_mode_names, lchan->tch_mode), - gsm_lchant_name(lchan->type)); break; case GSM_LCHAN_TCH_H: if (!bts->codec.hr) { @@ -485,13 +473,9 @@ if (bts == current_bts) { switch (lchan->type) { case GSM_LCHAN_TCH_F: - LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, - "removing TCH/F, already on TCH/F in this cell\n"); requirement &= ~(REQUIREMENT_A_TCHF); break; case GSM_LCHAN_TCH_H: - LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, - "removing TCH/H, already on TCH/H in this cell\n"); requirement &= ~(REQUIREMENT_A_TCHH); break; default: @@ -558,24 +542,12 @@ /* the minimum free timeslots that are defined for this cell must * be maintained _after_ handover/assignment */ if (requirement & REQUIREMENT_A_TCHF) { - if (tchf_count - 1 >= ho_get_hodec2_tchf_min_slots(bts->ho)) { - LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, - "TCH/F would not be congested after HO\n"); + if (tchf_count - 1 >= ho_get_hodec2_tchf_min_slots(bts->ho)) requirement |= REQUIREMENT_B_TCHF; - } else { - LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, - "TCH/F would be congested after HO\n"); - } } if (requirement & REQUIREMENT_A_TCHH) { - if (tchh_count - 1 >= ho_get_hodec2_tchh_min_slots(bts->ho)) { - LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, - "TCH/H would not be congested after HO\n"); + if (tchh_count - 1 >= ho_get_hodec2_tchh_min_slots(bts->ho)) requirement |= REQUIREMENT_B_TCHH; - } else { - LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, - "TCH/H would be congested after HO\n"); - } } /* Requirement C */ @@ -584,30 +556,16 @@ * free slots of the current cell _after_ handover/assignment */ count = bts_count_free_ts(current_bts, (lchan->type == GSM_LCHAN_TCH_H) ? - GSM_PCHAN_TCH_H : GSM_PCHAN_TCH_F); + GSM_PCHAN_TCH_H : GSM_PCHAN_TCH_F); if (requirement & REQUIREMENT_A_TCHF) { - if (tchf_count - 1 >= count + 1) { - LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, - "TCH/F would be less congested in target than source cell after HO\n"); + if (tchf_count - 1 >= count + 1) requirement |= REQUIREMENT_C_TCHF; - } else { - LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, - "TCH/F would not be less congested in target than source cell after HO\n"); - } } if (requirement & REQUIREMENT_A_TCHH) { - if (tchh_count - 1 >= count + 1) { - LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, - "TCH/H would be less congested in target than source cell after HO\n"); + if (tchh_count - 1 >= count + 1) requirement |= REQUIREMENT_C_TCHH; - } else { - LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, - "TCH/H would not be less congested in target than source cell after HO\n"); - } } - LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "requirements=0x%x\n", requirement); - /* return mask of fulfilled requirements */ return requirement; } @@ -619,11 +577,6 @@ int afs_bias = 0; bool full_rate = false; - if (current_bts == new_bts) - LOGPHOLCHAN(lchan, LOGL_NOTICE, "Triggering Assignment\n"); - else - LOGPHOLCHANTOBTS(lchan, new_bts, LOGL_NOTICE, "Triggering Handover\n"); - /* afs_bias becomes > 0, if AFS is used and is improved */ if (lchan->tch_mode == GSM48_CMODE_SPEECH_AMR) afs_bias = ho_get_hodec2_afs_bias_rxlev(new_bts->ho); @@ -682,7 +635,7 @@ full_rate ? "TCH/F" : "TCH/H", ho_reason_name(global_ho_reason)); else - LOGPHOLCHANTOBTS(lchan, new_bts, LOGL_NOTICE, + LOGPHOLCHANTOBTS(lchan, new_bts, LOGL_INFO, "Triggering handover to %s, due to %s\n", full_rate ? "TCH/F" : "TCH/H", ho_reason_name(global_ho_reason)); @@ -692,71 +645,36 @@ } /* debug collected candidates */ -static inline void debug_candidate(struct ho_candidate *candidate, - int neighbor, int8_t rxlev, int tchf_count, int tchh_count) +static inline void debug_candidate(struct gsm_lchan *lchan, struct ho_candidate *candidate, + struct gsm_bts *neighbor, int8_t rxlev, int tchf_count, int tchh_count) { +#define HO_CANDIDATE_FMT(tchx, TCHX) "TCH/" #TCHX "={free %d (want %d), [%s%s%s]%s}" +#define HO_CANDIDATE_ARGS(tchx, TCHX) \ + tch##tchx##_count, ho_get_hodec2_tch##tchx##_min_slots(candidate->bts->ho), \ + candidate->requirements & REQUIREMENT_A_TCH##TCHX ? "A" : \ + (candidate->requirements & REQUIREMENT_TCH##TCHX##_MASK) == 0? "-" : "", \ + candidate->requirements & REQUIREMENT_B_TCH##TCHX ? "B" : "", \ + candidate->requirements & REQUIREMENT_B_TCH##TCHX ? "C" : "", \ + (candidate->requirements & REQUIREMENT_TCH##TCHX##_MASK) == 0 ? " not a candidate" : \ + ((candidate->requirements & REQUIREMENT_TCH##TCHX##_MASK) == REQUIREMENT_A_TCH##TCHX ? \ + " more congestion" : \ + (candidate->requirements & REQUIREMENT_B_TCH##TCHX ? \ + " good" : \ + /* now has to be candidate->requirements & REQUIREMENT_C_TCHX != 0: */ \ + " less-or-equal congestion")) + if (neighbor) - LOGP(DHODEC, LOGL_DEBUG, " - neighbor BTS %d, RX level " - "%d -> %d\n", candidate->bts->nr, rxlev2dbm(rxlev), - rxlev2dbm(candidate->avg)); + LOGPHOLCHANTOBTS(lchan, neighbor, LOGL_DEBUG, + "RX level %d -> %d; " + HO_CANDIDATE_FMT(f, F) "; " HO_CANDIDATE_FMT(h, H) "\n", + rxlev2dbm(rxlev), rxlev2dbm(candidate->avg), + HO_CANDIDATE_ARGS(f, F), HO_CANDIDATE_ARGS(h, H)); else - LOGP(DHODEC, LOGL_DEBUG, " - current BTS %d, RX level %d\n", - candidate->bts->nr, rxlev2dbm(candidate->avg)); - - LOGP(DHODEC, LOGL_DEBUG, " o free TCH/F slots %d, minimum required " - "%d\n", tchf_count, ho_get_hodec2_tchf_min_slots(candidate->bts->ho)); - LOGP(DHODEC, LOGL_DEBUG, " o free TCH/H slots %d, minimum required " - "%d\n", tchh_count, ho_get_hodec2_tchh_min_slots(candidate->bts->ho)); - - if ((candidate->requirements & REQUIREMENT_TCHF_MASK)) - LOGP(DHODEC, LOGL_DEBUG, " o requirement "); - else - LOGP(DHODEC, LOGL_DEBUG, " o no requirement "); - if ((candidate->requirements & REQUIREMENT_A_TCHF)) - LOGPC(DHODEC, LOGL_DEBUG, "A "); - if ((candidate->requirements & REQUIREMENT_B_TCHF)) - LOGPC(DHODEC, LOGL_DEBUG, "B "); - if ((candidate->requirements & REQUIREMENT_C_TCHF)) - LOGPC(DHODEC, LOGL_DEBUG, "C "); - LOGPC(DHODEC, LOGL_DEBUG, "fulfilled for TCHF"); - if (!(candidate->requirements & REQUIREMENT_TCHF_MASK)) /* nothing */ - LOGPC(DHODEC, LOGL_DEBUG, " (no %s possible)\n", - (neighbor) ? "handover" : "assignment"); - else if ((candidate->requirements & REQUIREMENT_TCHF_MASK) - == REQUIREMENT_A_TCHF) /* only A */ - LOGPC(DHODEC, LOGL_DEBUG, " (more congestion after %s)\n", - (neighbor) ? "handover" : "assignment"); - else if ((candidate->requirements & REQUIREMENT_B_TCHF)) /* B incl. */ - LOGPC(DHODEC, LOGL_DEBUG, " (not congested after %s)\n", - (neighbor) ? "handover" : "assignment"); - else /* so it must include C */ - LOGPC(DHODEC, LOGL_DEBUG, " (less or equally congested after " - "%s)\n", (neighbor) ? "handover" : "assignment"); - - if ((candidate->requirements & REQUIREMENT_TCHH_MASK)) - LOGP(DHODEC, LOGL_DEBUG, " o requirement "); - else - LOGP(DHODEC, LOGL_DEBUG, " o no requirement "); - if ((candidate->requirements & REQUIREMENT_A_TCHH)) - LOGPC(DHODEC, LOGL_DEBUG, "A "); - if ((candidate->requirements & REQUIREMENT_B_TCHH)) - LOGPC(DHODEC, LOGL_DEBUG, "B "); - if ((candidate->requirements & REQUIREMENT_C_TCHH)) - LOGPC(DHODEC, LOGL_DEBUG, "C "); - LOGPC(DHODEC, LOGL_DEBUG, "fulfilled for TCHH"); - if (!(candidate->requirements & REQUIREMENT_TCHH_MASK)) /* nothing */ - LOGPC(DHODEC, LOGL_DEBUG, " (no %s possible)\n", - (neighbor) ? "handover" : "assignment"); - else if ((candidate->requirements & REQUIREMENT_TCHH_MASK) - == REQUIREMENT_A_TCHH) /* only A */ - LOGPC(DHODEC, LOGL_DEBUG, " (more congestion after %s)\n", - (neighbor) ? "handover" : "assignment"); - else if ((candidate->requirements & REQUIREMENT_B_TCHH)) /* B incl. */ - LOGPC(DHODEC, LOGL_DEBUG, " (not congested after %s)\n", - (neighbor) ? "handover" : "assignment"); - else /* so it must include C */ - LOGPC(DHODEC, LOGL_DEBUG, " (less or equally congested after " - "%s)\n", (neighbor) ? "handover" : "assignment"); + LOGPHOLCHANTOBTS(lchan, lchan->ts->trx->bts, LOGL_DEBUG, + "RX level %d; " + HO_CANDIDATE_FMT(f, F) "; " HO_CANDIDATE_FMT(h, H) "\n", + rxlev2dbm(candidate->avg), + HO_CANDIDATE_ARGS(f, F), HO_CANDIDATE_ARGS(h, H)); } /* add candidate for re-assignment within the current cell */ @@ -775,7 +693,7 @@ c->bts = bts; c->requirements = check_requirements(lchan, bts, tchf_count, tchh_count); c->avg = av_rxlev; - debug_candidate(c, 0, 0, tchf_count, tchh_count); + debug_candidate(lchan, c, NULL, 0, tchf_count, tchh_count); (*candidates)++; } @@ -855,7 +773,7 @@ c->requirements = check_requirements(lchan, neighbor_bts, tchf_count, tchh_count); c->avg = avg; - debug_candidate(c, 1, av_rxlev, tchf_count, tchh_count); + debug_candidate(lchan, c, neighbor_bts, av_rxlev, tchf_count, tchh_count); (*candidates)++; } @@ -865,14 +783,12 @@ { struct gsm_bts *bts = lchan->ts->trx->bts; int av_rxlev; - unsigned int candidates_was; bool assignment; bool handover; int neighbors_count = 0; unsigned int rxlev_avg_win = ho_get_hodec2_rxlev_avg_win(bts->ho); OSMO_ASSERT(candidates); - candidates_was = *candidates; /* caculate average rxlev for this cell over the window */ av_rxlev = get_meas_rep_avg(lchan, @@ -893,11 +809,6 @@ assignment = ho_get_hodec2_as_active(bts->ho); handover = ho_get_ho_active(bts->ho); - LOGPHOLCHAN(lchan, LOGL_DEBUG, "Collecting candidates for%s%s%s\n", - assignment ? " Assignment" : "", - assignment && handover ? " and" : "", - handover ? " Handover" : ""); - if (assignment) collect_assignment_candidate(lchan, clist, candidates, av_rxlev); @@ -909,9 +820,6 @@ include_weaker_rxlev, av_rxlev, &neighbors_count); } } - - LOGPHOLCHAN(lchan, LOGL_DEBUG, "adding %u candidates from %u neighbors, total %u\n", - *candidates - candidates_was, neighbors_count, *candidates); } /* @@ -1155,8 +1063,6 @@ return; } - LOGPHOLCHAN(lchan, LOGL_DEBUG, "HODEC2: evaluating measurement report\n"); - /* get average levels. if not enought measurements yet, value is < 0 */ av_rxlev = get_meas_rep_avg(lchan, ho_get_hodec2_full_tdma(bts->ho) ? @@ -1170,34 +1076,29 @@ LOGPHOLCHAN(lchan, LOGL_INFO, "Skipping, Not enough recent measurements\n"); return; } - if (av_rxlev >= 0) { - LOGPHOLCHAN(lchan, LOGL_DEBUG, "Measurement report: average RX level = %d\n", - rxlev2dbm(av_rxlev)); - } - if (av_rxqual >= 0) { - LOGPHOLCHAN(lchan, LOGL_DEBUG, "Measurement report: average RX quality = %d\n", - av_rxqual); - } /* improve levels in case of AFS, if defined */ if (lchan->type == GSM_LCHAN_TCH_F && lchan->tch_mode == GSM48_CMODE_SPEECH_AMR) { + int av_rxlev_was = av_rxlev; + int av_rxqual_was = av_rxqual; int rxlev_bias = ho_get_hodec2_afs_bias_rxlev(bts->ho); int rxqual_bias = ho_get_hodec2_afs_bias_rxqual(bts->ho); - if (av_rxlev >= 0 && rxlev_bias) { - int imp = av_rxlev + rxlev_bias; - LOGPHOLCHAN(lchan, LOGL_INFO, "Virtually improving RX level from %d to %d," - " due to AFS bias\n", rxlev2dbm(av_rxlev), rxlev2dbm(imp)); - av_rxlev = imp; - } - if (av_rxqual >= 0 && rxqual_bias) { - int imp = av_rxqual - rxqual_bias; - if (imp < 0) - imp = 0; - LOGPHOLCHAN(lchan, LOGL_INFO, "Virtually improving RX quality from %d to %d," - " due to AFS bias\n", rxlev2dbm(av_rxqual), rxlev2dbm(imp)); - av_rxqual = imp; - } + if (av_rxlev >= 0) + av_rxlev = av_rxlev + rxlev_bias; + if (av_rxqual >= 0) + av_rxqual = OSMO_MAX(0, av_rxqual - rxqual_bias); + + LOGPHOLCHAN(lchan, LOGL_DEBUG, + "Avg RX level = %d dBm, %+d dBm AFS bias = %d dBm;" + " Avg RX quality = %d%s, %+d AFS bias = %d\n", + rxlev2dbm(av_rxlev_was), rxlev_bias, rxlev2dbm(av_rxlev), + OSMO_MAX(-1, av_rxqual_was), av_rxqual_was < 0 ? " (invalid)" : "", + -rxqual_bias, OSMO_MAX(-1, av_rxqual)); + } else { + LOGPHOLCHAN(lchan, LOGL_DEBUG, "Avg RX level = %d dBm; Avg RX quality = %d%s\n", + rxlev2dbm(av_rxlev), + OSMO_MAX(-1, av_rxqual), av_rxqual < 0 ? " (invalid)" : ""); } /* Bad Quality */ @@ -1217,7 +1118,8 @@ /* Low Level */ if (av_rxlev >= 0 && rxlev2dbm(av_rxlev) < ho_get_hodec2_min_rxlev(bts->ho)) { global_ho_reason = HO_REASON_LOW_RXLEVEL; - LOGPHOLCHAN(lchan, LOGL_INFO, "Attempting handover/assignment due to low rxlev\n"); + LOGPHOLCHAN(lchan, LOGL_NOTICE, "RX level is TOO LOW: %d < %d\n", + rxlev2dbm(av_rxlev), ho_get_hodec2_min_rxlev(bts->ho)); find_alternative_lchan(lchan, true); return; } @@ -1226,7 +1128,8 @@ if (lchan->meas_rep_count > 0 && lchan->rqd_ta > ho_get_hodec2_max_distance(bts->ho)) { global_ho_reason = HO_REASON_MAX_DISTANCE; - LOGPHOLCHAN(lchan, LOGL_INFO, "Attempting handover due to high TA\n"); + LOGPHOLCHAN(lchan, LOGL_NOTICE, "TA is TOO HIGH: %u > %d\n", + lchan->rqd_ta, ho_get_hodec2_max_distance(bts->ho)); /* start penalty timer to prevent comming back too * early. it must be started before selecting a better cell, * so there is no assignment selected, due to running @@ -1242,7 +1145,6 @@ /* try handover to a better cell */ if (av_rxlev >= 0 && (mr->nr % pwr_interval) == 0) { - LOGPHOLCHAN(lchan, LOGL_INFO, "Looking whether a cell has better RXLEV\n"); global_ho_reason = HO_REASON_BETTER_CELL; find_alternative_lchan(lchan, false); } @@ -1439,12 +1341,10 @@ /* perform handover, if there is a candidate */ if (best_cand) { any_ho = 1; - LOGPHOLCHAN(best_cand->lchan, LOGL_INFO, - "Best candidate BTS %u (RX level %d) without congestion found\n", - best_cand->bts->nr, rxlev2dbm(best_cand->avg)); - if (is_improved) - LOGP(DHODEC, LOGL_INFO, "(is improved due to " - "AHS -> AFS)\n"); + LOGPHOLCHAN(best_cand->lchan, LOGL_DEBUG, + "Best candidate BTS %u (RX level %d%s) without congestion found\n", + best_cand->bts->nr, rxlev2dbm(best_cand->avg), + is_improved ? ", RX quality improved by AHS->AFS" : ""); trigger_handover_or_assignment(best_cand->lchan, best_cand->bts, best_cand->requirements & REQUIREMENT_B_MASK); #if 0 @@ -1468,9 +1368,6 @@ goto exit; } - LOGPHOBTS(bts, LOGL_DEBUG, "Did not find a best candidate that fulfills requirement B" - " (omitting change from AHS to AFS)\n"); - #if 0 next_b2: #endif @@ -1504,8 +1401,6 @@ is_improved = 1; } else is_improved = 0; - LOGP(DHODEC, LOGL_DEBUG, "candidate %d: avg=%d worst_avg_db=%d\n", i, avg, - worst_avg_db); if (avg < worst_avg_db) { worst_cand = &clist[i]; worst_avg_db = avg; @@ -1517,11 +1412,9 @@ if (worst_cand) { any_ho = 1; LOGP(DHODEC, LOGL_INFO, "Worst candidate for assignment " - "(RX level %d) from TCH/H -> TCH/F without congestion " - "found\n", rxlev2dbm(worst_cand->avg)); - if (is_improved) - LOGP(DHODEC, LOGL_INFO, "(is improved due to " - "AHS -> AFS)\n"); + "(RX level %d%s) from TCH/H -> TCH/F without congestion " + "found\n", rxlev2dbm(worst_cand->avg), + is_improved ? ", RX quality improved by AHS->AFS" : ""); trigger_handover_or_assignment(worst_cand->lchan, worst_cand->bts, worst_cand->requirements & REQUIREMENT_B_MASK); @@ -1543,9 +1436,6 @@ goto exit; } - LOGPHOBTS(bts, LOGL_DEBUG, "Did not find a worst candidate that fulfills requirement B," - " selecting candidates that change from AHS to AFS only\n"); - #if 0 next_c1: #endif @@ -1584,7 +1474,6 @@ is_improved = 1; } else is_improved = 0; - LOGP(DHODEC, LOGL_DEBUG, "candidate %d: avg=%d best_avg_db=%d\n", i, avg, best_avg_db); if (avg > best_avg_db) { best_cand = &clist[i]; best_avg_db = avg; @@ -1672,11 +1561,9 @@ if (worst_cand) { any_ho = 1; LOGP(DHODEC, LOGL_INFO, "Worst candidate for assignment " - "(RX level %d) from TCH/H -> TCH/F with less or equal " - "congestion found\n", rxlev2dbm(worst_cand->avg)); - if (is_improved) - LOGP(DHODEC, LOGL_INFO, "(is improved due to " - "AHS -> AFS)\n"); + "(RX level %d%s) from TCH/H -> TCH/F with less or equal " + "congestion found\n", rxlev2dbm(worst_cand->avg), + is_improved ? ", RX quality improved by AHS->AFS" : ""); trigger_handover_or_assignment(worst_cand->lchan, worst_cand->bts, worst_cand->requirements & REQUIREMENT_C_MASK); diff --git a/src/osmo-bsc/handover_logic.c b/src/osmo-bsc/handover_logic.c index 064615c..509de53 100644 --- a/src/osmo-bsc/handover_logic.c +++ b/src/osmo-bsc/handover_logic.c @@ -122,17 +122,6 @@ llist_add(&ho->list, &bsc_handovers); conn->ho = ho; - - DEBUGP(DHO, "(BTS %u trx %u ts %u lchan %u %s)->(BTS %u lchan %s) Initiating %s...\n", - old_lchan->ts->trx->bts->nr, - old_lchan->ts->trx->nr, - old_lchan->ts->nr, - old_lchan->nr, - gsm_pchan_name(old_lchan->ts->pchan), - new_bts->nr, - gsm_lchant_name(new_lchan_type), - do_assignment ? "Assignment" : "Handover"); - rc = osmo_fsm_inst_dispatch(conn->fi, GSCON_EV_HO_START, NULL); if (rc < 0) { -- To view, visit https://gerrit.osmocom.org/10058 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: If1add9b57a051d32b67a4a08ab47a9655aa9dd17 Gerrit-Change-Number: 10058 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 16:28:57 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 16:28:57 +0000 Subject: Change in osmo-bsc[master]: various logging: fix missing/extra newlines Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10059 Change subject: various logging: fix missing/extra newlines ...................................................................... various logging: fix missing/extra newlines Change-Id: Id2619d0d45eb2686246c03643b4a578392a54cfe --- M src/libfilter/bsc_msg_acc.c M src/osmo-bsc/abis_nm.c M src/osmo-bsc/abis_rsl.c M src/osmo-bsc/handover_decision_2.c M src/osmo-bsc/system_information.c 5 files changed, 9 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/59/10059/1 diff --git a/src/libfilter/bsc_msg_acc.c b/src/libfilter/bsc_msg_acc.c index 46077b3..de6c4d9 100644 --- a/src/libfilter/bsc_msg_acc.c +++ b/src/libfilter/bsc_msg_acc.c @@ -96,7 +96,7 @@ lst = talloc_zero(ctx, struct bsc_msg_acc_lst); if (!lst) { - LOGP(DNAT, LOGL_ERROR, "Failed to allocate access list"); + LOGP(DNAT, LOGL_ERROR, "Failed to allocate access list\n"); return NULL; } diff --git a/src/osmo-bsc/abis_nm.c b/src/osmo-bsc/abis_nm.c index cb1cc56..d056bc4 100644 --- a/src/osmo-bsc/abis_nm.c +++ b/src/osmo-bsc/abis_nm.c @@ -1214,11 +1214,11 @@ /* go back to the start as we checked the whole filesize.. */ lseek(sw->fd, 0l, SEEK_SET); - LOGP(DNM, LOGL_NOTICE, "The ipaccess SDP header is not fully understood.\n" - "There might be checksums in the file that are not\n" - "verified and incomplete firmware might be flashed.\n" - "There is absolutely no WARRANTY that flashing will\n" - "work.\n"); + LOGP(DNM, LOGL_NOTICE, "The ipaccess SDP header is not fully understood." + " There might be checksums in the file that are not" + " verified and incomplete firmware might be flashed." + " There is absolutely no WARRANTY that flashing will" + " work.\n"); return 0; } diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c index ab3658d..bcc56bc 100644 --- a/src/osmo-bsc/abis_rsl.c +++ b/src/osmo-bsc/abis_rsl.c @@ -2351,7 +2351,7 @@ break; } LOGP(DRSL, LOGL_ERROR, "Cannot determine ip.access rtp payload type for " - "tch_mode == 0x%02x\n & lchan_type == %d", + "tch_mode == 0x%02x & lchan_type == %d\n", lchan->tch_mode, lchan->type); return 0; } diff --git a/src/osmo-bsc/handover_decision_2.c b/src/osmo-bsc/handover_decision_2.c index e514b6c..826dcaa 100644 --- a/src/osmo-bsc/handover_decision_2.c +++ b/src/osmo-bsc/handover_decision_2.c @@ -1680,7 +1680,7 @@ struct gsm_subscriber_connection *conn = ho->old_lchan->conn; if (!conn) { - LOGPHO(ho, LOGL_ERROR, "HO failure, but no conn"); + LOGPHO(ho, LOGL_ERROR, "HO failure, but no conn\n"); return; } diff --git a/src/osmo-bsc/system_information.c b/src/osmo-bsc/system_information.c index d99153f..f810f52 100644 --- a/src/osmo-bsc/system_information.c +++ b/src/osmo-bsc/system_information.c @@ -556,7 +556,7 @@ return 0; LOGP(DRR, LOGL_ERROR, "min_arfcn=%u, max_arfcn=%u, arfcns=%d " - "can not generate ARFCN list", min, max, arfcns); + "can not generate ARFCN list\n", min, max, arfcns); return -EINVAL; } -- To view, visit https://gerrit.osmocom.org/10059 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id2619d0d45eb2686246c03643b4a578392a54cfe Gerrit-Change-Number: 10059 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 16:36:01 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 16:36:01 +0000 Subject: Change in osmo-bsc[master]: fix handover start: dealloc ho if event not permitted In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10056 ) Change subject: fix handover start: dealloc ho if event not permitted ...................................................................... Patch Set 1: well, this fix is a bit moot since the "large refactoring" patch fixes even more nicely... but, if someone needs to use the osmo-bsc version before the refactoring for some reason, they can benefit from this. -- To view, visit https://gerrit.osmocom.org/10056 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I839a05495ae93c5dbbd1616efa2469e5b1990a61 Gerrit-Change-Number: 10056 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Thu, 19 Jul 2018 16:36:01 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 16:36:40 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 19 Jul 2018 16:36:40 +0000 Subject: Change in osmo-ggsn[master]: fix unaligned access in build_ipcp_pco() In-Reply-To: References: Message-ID: Stefan Sperling has posted comments on this change. ( https://gerrit.osmocom.org/10054 ) Change subject: fix unaligned access in build_ipcp_pco() ...................................................................... Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/10054/1/ggsn/ggsn.c File ggsn/ggsn.c: https://gerrit.osmocom.org/#/c/10054/1/ggsn/ggsn.c at 426 PS1, Line 426: cur_opt += OSMO_MAX(len, 2); > would probably make sense to return NULL and print an error if len==0 is found. [?] Length 0 and 1 make no sense because the value includes type and length field (2 bytes). I am not sure if we should stop looking for valid options if length zero or one is encountered in one of the options. "Be liberal in what you accept" probably applies. https://gerrit.osmocom.org/#/c/10054/1/ggsn/ggsn.c at 522 PS1, Line 522: remain = ARRAY_SIZE(pdp->pco_req.v) - consumed; > why array size? isn't that in elements? I think we want to count bytes here, so sizeof() makes more [?] Yes, indeed, we want to use sizeof here. -- To view, visit https://gerrit.osmocom.org/10054 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia1410abb216831864042f95679330f4508e1af3d Gerrit-Change-Number: 10054 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 19 Jul 2018 16:36:40 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 16:52:05 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 19 Jul 2018 16:52:05 +0000 Subject: Change in osmo-ggsn[master]: fix unaligned access in build_ipcp_pco() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10054 to look at the new patch set (#2). Change subject: fix unaligned access in build_ipcp_pco() ...................................................................... fix unaligned access in build_ipcp_pco() IPCP data can begin at any byte location in the pco_req->v array. Casting to a 'struct ipcp_hdr' pointer could lead to unaligned access. Parse IPCP data with u_int8_t pointers instead to avoid this problem. Add some length checks while here. pco_contains_proto() and ipcp_contains_option() now receive the minimum size of the data the caller is looking for, and only return pointers to items of sufficient size. Change-Id: Ia1410abb216831864042f95679330f4508e1af3d Related: OS#3194 --- M ggsn/ggsn.c 1 file changed, 29 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/54/10054/2 -- To view, visit https://gerrit.osmocom.org/10054 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia1410abb216831864042f95679330f4508e1af3d Gerrit-Change-Number: 10054 Gerrit-PatchSet: 2 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 17:06:12 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 19 Jul 2018 17:06:12 +0000 Subject: Change in osmo-ggsn[master]: fix unaligned access in build_ipcp_pco() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10054 to look at the new patch set (#3). Change subject: fix unaligned access in build_ipcp_pco() ...................................................................... fix unaligned access in build_ipcp_pco() IPCP data can begin at any byte location in the pco_req->v array. Casting to a 'struct ipcp_hdr' pointer could lead to unaligned access. Parse IPCP data with u_int8_t pointers instead to avoid this problem. Add some length checks while here. pco_contains_proto() and ipcp_contains_option() now receive the minimum size of the data the caller is looking for, and only return pointers to items of sufficient size. Change-Id: Ia1410abb216831864042f95679330f4508e1af3d Related: OS#3194 --- M ggsn/ggsn.c 1 file changed, 29 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/54/10054/3 -- To view, visit https://gerrit.osmocom.org/10054 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia1410abb216831864042f95679330f4508e1af3d Gerrit-Change-Number: 10054 Gerrit-PatchSet: 3 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 17:26:10 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 19 Jul 2018 17:26:10 +0000 Subject: Change in osmo-ttcn3-hacks[master]: fix TC_pdp4_act_deact_with_separate_dns Message-ID: Stefan Sperling has uploaded this change for review. ( https://gerrit.osmocom.org/10060 Change subject: fix TC_pdp4_act_deact_with_separate_dns ...................................................................... fix TC_pdp4_act_deact_with_separate_dns Do not delete the PDP context too early, and look for the second DNS server in the correct place (2nd match on IPCP protocol, not 1st). Change-Id: I109491cc9ccb060792e29bf6b2999ef48723edbf Related: OS#3319 --- M ggsn_tests/GGSN_Tests.ttcn 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/60/10060/1 diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn index 6ae205f..5673a99 100644 --- a/ggsn_tests/GGSN_Tests.ttcn +++ b/ggsn_tests/GGSN_Tests.ttcn @@ -1017,11 +1017,10 @@ if (not match(pco_neg_dns, pco_neg_dns_expected)) { setverdict(fail, "Primary DNS IPv4 PCO option not found"); } - f_pdp_ctx_del(ctx, '1'B); /* Check if secondary DNS is contained */ /* Note: this check fill fail due to a bug in osmo-ggsn, see also OS#3381 */ - pco_neg_dns := f_PCO_extract_proto(ctx.pco_neg, '8021'O, 1); + pco_neg_dns := f_PCO_extract_proto(ctx.pco_neg, '8021'O, 2); pco_neg_dns_expected := '0200000A8306'O & ggsn_ip4_dns2 if (not match(pco_neg_dns, pco_neg_dns_expected)) { setverdict(fail, "Secondary DNS IPv4 PCO option not found"); -- To view, visit https://gerrit.osmocom.org/10060 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I109491cc9ccb060792e29bf6b2999ef48723edbf Gerrit-Change-Number: 10060 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 17:26:28 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 19 Jul 2018 17:26:28 +0000 Subject: Change in osmo-ggsn[master]: fix unaligned access in build_ipcp_pco() In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10054 ) Change subject: fix unaligned access in build_ipcp_pco() ...................................................................... Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/10054/1/ggsn/ggsn.c File ggsn/ggsn.c: https://gerrit.osmocom.org/#/c/10054/1/ggsn/ggsn.c at 426 PS1, Line 426: cur_opt += OSMO_MAX(len, 2); > Length 0 and 1 make no sense because the value includes type and length field (2 bytes). [?] "Be liberal in what you accept" doesn't mean assuming a random LEN value if the wrong one was encoded/received. From that point on you may be reading garbage. So I believe what we have here here is not the correct solution. -- To view, visit https://gerrit.osmocom.org/10054 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia1410abb216831864042f95679330f4508e1af3d Gerrit-Change-Number: 10054 Gerrit-PatchSet: 3 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 19 Jul 2018 17:26:28 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 17:32:26 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 19 Jul 2018 17:32:26 +0000 Subject: Change in osmo-ggsn[master]: fix support for multiple IPCP in PDP protocol configuration options Message-ID: Stefan Sperling has uploaded this change for review. ( https://gerrit.osmocom.org/10061 Change subject: fix support for multiple IPCP in PDP protocol configuration options ...................................................................... fix support for multiple IPCP in PDP protocol configuration options Parse multiple IPCP IEs embedded in Protocol Configuration Options, and return IPCP responses for all of them. Makes the associated TTCN3 GGSN test pass. Depends: Ia1410abb216831864042f95679330f4508e1af3d Change-Id: I51ecab4e35f3ee638e68ca773b0da90cc0294ab0 Related: OS#3319 --- M ggsn/ggsn.c 1 file changed, 40 insertions(+), 35 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/61/10061/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index b74056f..85f3690 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -461,9 +461,9 @@ }; /* determine if PCO contains given protocol */ -static uint8_t *pco_contains_proto(struct ul255_t *pco, uint16_t prot, size_t prot_minlen) +static uint8_t *pco_contains_proto(struct ul255_t *pco, size_t offset, uint16_t prot, size_t prot_minlen) { - uint8_t *cur = pco->v + 1; + uint8_t *cur = pco->v + 1 + offset; /* iterate over PCO and check if protocol contained */ while (cur + 3 <= pco->v + pco->l) { @@ -508,47 +508,52 @@ uint8_t *ipcp; uint16_t ipcp_len; uint8_t *len1, *len2, *pco_ipcp; - uint8_t *start = msg->tail; unsigned int len_appended; ptrdiff_t consumed; - size_t remain; + size_t remain, offset = 0; /* pco_contains_proto() returns a potentially unaligned pointer into pco_req->v (see OS#3194) */ - if (!(pco_ipcp = pco_contains_proto(&pdp->pco_req, PCO_P_IPCP, sizeof(struct ipcp_hdr)))) - return; + pco_ipcp = pco_contains_proto(&pdp->pco_req, offset, PCO_P_IPCP, sizeof(struct ipcp_hdr)); + while (pco_ipcp) { + uint8_t *start = msg->tail; - ipcp = (pco_ipcp + 3); /* 2=type + 1=len */ - consumed = (ipcp - &pdp->pco_req.v[0]); - remain = sizeof(pdp->pco_req.v) - consumed; - ipcp_len = osmo_load16be(ipcp + 2); /* 1=code + 1=id */ - if (remain < 0 || remain < ipcp_len) - return; + ipcp = (pco_ipcp + 3); /* 2=type + 1=len */ + consumed = (ipcp - &pdp->pco_req.v[0]); + remain = sizeof(pdp->pco_req.v) - consumed; + ipcp_len = osmo_load16be(ipcp + 2); /* 1=code + 1=id */ + if (remain < 0 || remain < ipcp_len) + return; - /* Three byte T16L header */ - msgb_put_u16(msg, 0x8021); /* IPCP */ - len1 = msgb_put(msg, 1); /* Length of contents: delay */ + /* Three byte T16L header */ + msgb_put_u16(msg, 0x8021); /* IPCP */ + len1 = msgb_put(msg, 1); /* Length of contents: delay */ - msgb_put_u8(msg, 0x02); /* ACK */ - msgb_put_u8(msg, ipcp[1]); /* ID: Needs to match request */ - msgb_put_u8(msg, 0x00); /* Length MSB */ - len2 = msgb_put(msg, 1); /* Length LSB: delay */ + msgb_put_u8(msg, 0x02); /* ACK */ + msgb_put_u8(msg, ipcp[1]); /* ID: Needs to match request */ + msgb_put_u8(msg, 0x00); /* Length MSB */ + len2 = msgb_put(msg, 1); /* Length LSB: delay */ - if (dns1->len == 4 && ipcp_contains_option(ipcp, ipcp_len, IPCP_OPT_PRIMARY_DNS, 4)) { - msgb_put_u8(msg, 0x81); /* DNS1 Tag */ - msgb_put_u8(msg, 2 + dns1->len);/* DNS1 Length, incl. TL */ - msgb_put_u32(msg, ntohl(dns1->v4.s_addr)); + if (dns1->len == 4 && ipcp_contains_option(ipcp, ipcp_len, IPCP_OPT_PRIMARY_DNS, 4)) { + msgb_put_u8(msg, 0x81); /* DNS1 Tag */ + msgb_put_u8(msg, 2 + dns1->len);/* DNS1 Length, incl. TL */ + msgb_put_u32(msg, ntohl(dns1->v4.s_addr)); + } + + if (dns2->len == 4 && ipcp_contains_option(ipcp, ipcp_len, IPCP_OPT_SECONDARY_DNS, 4)) { + msgb_put_u8(msg, 0x83); /* DNS2 Tag */ + msgb_put_u8(msg, 2 + dns2->len);/* DNS2 Length, incl. TL */ + msgb_put_u32(msg, ntohl(dns2->v4.s_addr)); + } + + /* patch in length values */ + len_appended = msg->tail - start; + *len1 = len_appended - 3; + *len2 = len_appended - 3; + + offset += 3 + ipcp_len; + pco_ipcp = pco_contains_proto(&pdp->pco_req, offset, PCO_P_IPCP, sizeof(struct ipcp_hdr)); } - if (dns2->len == 4 && ipcp_contains_option(ipcp, ipcp_len, IPCP_OPT_SECONDARY_DNS, 4)) { - msgb_put_u8(msg, 0x83); /* DNS2 Tag */ - msgb_put_u8(msg, 2 + dns2->len);/* DNS2 Length, incl. TL */ - msgb_put_u32(msg, ntohl(dns2->v4.s_addr)); - } - - /* patch in length values */ - len_appended = msg->tail - start; - *len1 = len_appended - 3; - *len2 = len_appended - 3; } /* process one PCO request from a MS/UE, putting together the proper responses */ @@ -564,7 +569,7 @@ if (peer_v4) build_ipcp_pco(apn, pdp, msg); - if (pco_contains_proto(&pdp->pco_req, PCO_P_DNS_IPv6_ADDR, 0)) { + if (pco_contains_proto(&pdp->pco_req, 0, PCO_P_DNS_IPv6_ADDR, 0)) { for (i = 0; i < ARRAY_SIZE(apn->v6.cfg.dns); i++) { struct in46_addr *i46a = &apn->v6.cfg.dns[i]; if (i46a->len != 16) @@ -573,7 +578,7 @@ } } - if (pco_contains_proto(&pdp->pco_req, PCO_P_DNS_IPv4_ADDR, 0)) { + if (pco_contains_proto(&pdp->pco_req, 0, PCO_P_DNS_IPv4_ADDR, 0)) { for (i = 0; i < ARRAY_SIZE(apn->v4.cfg.dns); i++) { struct in46_addr *i46a = &apn->v4.cfg.dns[i]; if (i46a->len != 4) -- To view, visit https://gerrit.osmocom.org/10061 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I51ecab4e35f3ee638e68ca773b0da90cc0294ab0 Gerrit-Change-Number: 10061 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 17:39:38 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 19 Jul 2018 17:39:38 +0000 Subject: Change in osmo-ggsn[master]: fix unaligned access in build_ipcp_pco() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10054 to look at the new patch set (#4). Change subject: fix unaligned access in build_ipcp_pco() ...................................................................... fix unaligned access in build_ipcp_pco() IPCP data can begin at any byte location in the pco_req->v array. Casting to a 'struct ipcp_hdr' pointer could lead to unaligned access. Parse IPCP data with u_int8_t pointers instead to avoid this problem. Add some length checks while here. pco_contains_proto() and ipcp_contains_option() now receive the minimum size of the data the caller is looking for, and only return pointers to items of sufficient size. Also fix an inifinite loop in ipcp_contains_option() by refusing IPCP options with length small than 2. Previously, a zero length option would trigger an infinite loop in the parser. Change-Id: Ia1410abb216831864042f95679330f4508e1af3d Related: OS#3194 --- M ggsn/ggsn.c 1 file changed, 31 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/54/10054/4 -- To view, visit https://gerrit.osmocom.org/10054 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia1410abb216831864042f95679330f4508e1af3d Gerrit-Change-Number: 10054 Gerrit-PatchSet: 4 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 17:46:49 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 19 Jul 2018 17:46:49 +0000 Subject: Change in osmo-ggsn[master]: fix unaligned access in build_ipcp_pco() In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10054 ) Change subject: fix unaligned access in build_ipcp_pco() ...................................................................... Patch Set 4: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/10054 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia1410abb216831864042f95679330f4508e1af3d Gerrit-Change-Number: 10054 Gerrit-PatchSet: 4 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling Gerrit-Comment-Date: Thu, 19 Jul 2018 17:46:49 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 17:48:41 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 17:48:41 +0000 Subject: Change in osmo-ci[master]: scripts/verify_log_statements.py: fix regex Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10062 Change subject: scripts/verify_log_statements.py: fix regex ...................................................................... scripts/verify_log_statements.py: fix regex Would miss those where the fmt string starts on a new line. Change-Id: If61a36a014a799b94030e5e08a50dfef4207a8a2 --- M scripts/verify_log_statements.py 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/62/10062/1 diff --git a/scripts/verify_log_statements.py b/scripts/verify_log_statements.py index e7752e1..48f406b 100755 --- a/scripts/verify_log_statements.py +++ b/scripts/verify_log_statements.py @@ -18,8 +18,8 @@ # This regex matches the entire LOGxx(...) statement over multiple lines. # It pinpoints the format string by looking for the first arg that contains quotes. # It then matches any number of separate quoted strings, and accepts 0 or more args after that. -log_statement_re = re.compile(r'^[ \t]*LOG[_A-Z]+\(([^";,]*,)* *(("[^"]*"[^";,]*)*)(,[^;]*|)\);', - re.MULTILINE | re.DOTALL) +log_statement_re = re.compile(r'^[ \t]*LOG[_A-Z]+\(([^";,]*,)*[ \t\r\n]*(("[^"]*"[^";,]*)*)(,[^;]*|)\);', + re.MULTILINE | re.DOTALL) fmt_re = re.compile(r'("[^"]*".*)*fmt') errors_found = 0 -- To view, visit https://gerrit.osmocom.org/10062 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: If61a36a014a799b94030e5e08a50dfef4207a8a2 Gerrit-Change-Number: 10062 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 17:48:41 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 17:48:41 +0000 Subject: Change in osmo-ci[master]: scripts/verify_log_statements.py: figure out line numbers Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10063 Change subject: scripts/verify_log_statements.py: figure out line numbers ...................................................................... scripts/verify_log_statements.py: figure out line numbers Change-Id: Ib75c8f5a99ed556d85896b7f8c65fb9446a2fbce --- M scripts/verify_log_statements.py 1 file changed, 61 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/63/10063/1 diff --git a/scripts/verify_log_statements.py b/scripts/verify_log_statements.py index 48f406b..6108c23 100755 --- a/scripts/verify_log_statements.py +++ b/scripts/verify_log_statements.py @@ -22,26 +22,57 @@ re.MULTILINE | re.DOTALL) fmt_re = re.compile(r'("[^"]*".*)*fmt') -errors_found = 0 debug = ('-d' in sys.argv) or ('--debug' in sys.argv) args = [x for x in sys.argv[1:] if not (x == '-d' or x == '--debug')] if not args: args = ['.'] +class error_found: + def __init__(self, f, charpos, msg, text): + self.f = f + self.charpos = charpos + self.msg = msg + self.text = text + self.line = None + +def make_line_idx(file_content): + line_idx = [] + pos = 0 + line_nr = 1 + line_idx.append((pos, line_nr)) + for line in file_content.split('\n'): + pos += len(line) + line_nr += 1 + line_idx.append((pos, line_nr)) + pos += 1 # newline char + return line_idx + +def char_pos_2_line(line_idx, sorted_char_positions): + r = [] + line_i = 0 + next_line_i = 1 + for char_pos in sorted_char_positions: + while (line_i+1) < len(line_idx) and char_pos > line_idx[line_i+1][0]: + line_i += 1 + r.append(line_idx[line_i][1]) + return r def check_file(f): - global errors_found if not (f.endswith('.h') or f.endswith('.c') or f.endswith('.cpp')): - return + return [] - for log in log_statement_re.finditer(codecs.open(f, "r", "utf-8").read()): + errors_found = [] + + file_content = codecs.open(f, "r", "utf-8").read() + + for log in log_statement_re.finditer(file_content): quoted = log.group(2) # Skip 'LOG("bla" fmt )' strings that typically appear as #defines. if fmt_re.match(quoted): if debug: - print('Skipping define:', f, '\n'+log.group(0)) + errors_found.append(error_found(f, log.start(), 'Skipping define', log.group(0))) continue # Drop PRI* parts of 'LOG("bla %"PRIu64" foo")' @@ -56,15 +87,14 @@ except: # hopefully eval broke because of some '## args' macro def if debug: - print('Ignoring:', f, '\n'+log.group(0)) + ignored.append(error_found(f, log.start(), 'Ignoring', log.group(0))) continue # check for errors... # final newline if not quoted.endswith('\n'): - print('Missing final newline:', f, '\n'+log.group(0)) - errors_found += 1 + errors_found.append(error_found(f, log.start(), 'Missing final newline', log.group(0))) # disallowed chars and extra newlines for c in quoted[:-1]: @@ -73,15 +103,33 @@ msg = 'Extraneous newline' else: msg = 'Illegal char' - print('%s %r in' % (msg, c), f, '\n' + log.group(0)) - errors_found += 1 + errors_found.append(error_found(f, log.start(), msg + ' %r' % c, log.group(0))) + if not error_found: + return [] + + line_idx = make_line_idx(file_content) + for r, line in zip(errors_found, char_pos_2_line(line_idx, [rr.charpos for rr in errors_found])): + r.line = line + + return errors_found + + +all_errors_found = [] for f in args: if os.path.isdir(f): for parent_path, subdirs, files in os.walk(f, None, None): for ff in files: - check_file(os.path.join(parent_path, ff)) + all_errors_found.extend(check_file(os.path.join(parent_path, ff))) else: - check_file(f) + all_errors_found.extend(check_file(f)) -sys.exit(errors_found) +def print_errors(errs): + for err in errs: + print('%s: %s:%d\n%s\n' % (err.msg, err.f, err.line or 0, err.text)) + +print_errors(all_errors_found) + +sys.exit(len(all_errors_found)) + +# vim: tabstop=2 shiftwidth=2 expandtab -- To view, visit https://gerrit.osmocom.org/10063 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ib75c8f5a99ed556d85896b7f8c65fb9446a2fbce Gerrit-Change-Number: 10063 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 17:51:13 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 19 Jul 2018 17:51:13 +0000 Subject: Change in osmo-ggsn[master]: fix support for multiple IPCP in PDP protocol configuration options In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10061 ) Change subject: fix support for multiple IPCP in PDP protocol configuration options ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/10061 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I51ecab4e35f3ee638e68ca773b0da90cc0294ab0 Gerrit-Change-Number: 10061 Gerrit-PatchSet: 2 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 19 Jul 2018 17:51:13 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 17:51:31 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 19 Jul 2018 17:51:31 +0000 Subject: Change in osmo-ttcn3-hacks[master]: fix TC_pdp4_act_deact_with_separate_dns In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10060 ) Change subject: fix TC_pdp4_act_deact_with_separate_dns ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/10060/1/ggsn_tests/GGSN_Tests.ttcn File ggsn_tests/GGSN_Tests.ttcn: https://gerrit.osmocom.org/#/c/10060/1/ggsn_tests/GGSN_Tests.ttcn at 1022 PS1, Line 1022: /* Note: this check fill fail due to a bug in osmo-ggsn, see also OS#3381 */ As you fixed the test, you can remove this line too :) -- To view, visit https://gerrit.osmocom.org/10060 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I109491cc9ccb060792e29bf6b2999ef48723edbf Gerrit-Change-Number: 10060 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 19 Jul 2018 17:51:31 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 17:52:42 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 19 Jul 2018 17:52:42 +0000 Subject: Change in osmo-ggsn[master]: fix unaligned access in build_ipcp_pco() In-Reply-To: References: Message-ID: Stefan Sperling has posted comments on this change. ( https://gerrit.osmocom.org/10054 ) Change subject: fix unaligned access in build_ipcp_pco() ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/10054/1/ggsn/ggsn.c File ggsn/ggsn.c: https://gerrit.osmocom.org/#/c/10054/1/ggsn/ggsn.c at 426 PS1, Line 426: cur_opt += OSMO_MAX(len, 2); > "Be liberal in what you accept" doesn't mean assuming a random LEN value if the wrong one was encode [?] OK, I am convinced now :) The latest patch set rejects short options. It does not log them. I would not want to add a log message that provides no context, and additional parameters would be required to acquire some context for a log message (e.g. PDP context request has the problem). In any case, this part could be improved in a follow-up patch. -- To view, visit https://gerrit.osmocom.org/10054 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia1410abb216831864042f95679330f4508e1af3d Gerrit-Change-Number: 10054 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling Gerrit-Comment-Date: Thu, 19 Jul 2018 17:52:42 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 17:56:50 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 19 Jul 2018 17:56:50 +0000 Subject: Change in osmo-ttcn3-hacks[master]: fix TC_pdp4_act_deact_with_separate_dns In-Reply-To: References: Message-ID: Stefan Sperling has posted comments on this change. ( https://gerrit.osmocom.org/10060 ) Change subject: fix TC_pdp4_act_deact_with_separate_dns ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/10060/1/ggsn_tests/GGSN_Tests.ttcn File ggsn_tests/GGSN_Tests.ttcn: https://gerrit.osmocom.org/#/c/10060/1/ggsn_tests/GGSN_Tests.ttcn at 1022 PS1, Line 1022: /* Note: this check fill fail due to a bug in osmo-ggsn, see also OS#3381 */ > As you fixed the test, you can remove this line too :) Keeping the issue number in there seems useful since it is not mentioned elsewhere. But I will edit the line. -- To view, visit https://gerrit.osmocom.org/10060 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I109491cc9ccb060792e29bf6b2999ef48723edbf Gerrit-Change-Number: 10060 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 19 Jul 2018 17:56:50 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 18:00:31 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 19 Jul 2018 18:00:31 +0000 Subject: Change in osmo-ttcn3-hacks[master]: fix TC_pdp4_act_deact_with_separate_dns In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10060 to look at the new patch set (#2). Change subject: fix TC_pdp4_act_deact_with_separate_dns ...................................................................... fix TC_pdp4_act_deact_with_separate_dns Do not delete the PDP context too early, and look for the second DNS server in the correct place (2nd match on IPCP protocol, not 1st). Update a comment which talks about a bug which has been fixed. Change-Id: I109491cc9ccb060792e29bf6b2999ef48723edbf Related: OS#3319 Related: OS#3381 --- M ggsn_tests/GGSN_Tests.ttcn 1 file changed, 2 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/60/10060/2 -- To view, visit https://gerrit.osmocom.org/10060 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I109491cc9ccb060792e29bf6b2999ef48723edbf Gerrit-Change-Number: 10060 Gerrit-PatchSet: 2 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 18:13:58 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 18:13:58 +0000 Subject: Change in osmo-ci[master]: scripts/verify_log_statements.py: strip OSMO_STRINGIFY() Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10064 Change subject: scripts/verify_log_statements.py: strip OSMO_STRINGIFY() ...................................................................... scripts/verify_log_statements.py: strip OSMO_STRINGIFY() Change-Id: I439ee65cd65cf42e1005ca71aa7d4b680b18c0e5 --- M scripts/verify_log_statements.py 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/64/10064/1 diff --git a/scripts/verify_log_statements.py b/scripts/verify_log_statements.py index 6108c23..567a96a 100755 --- a/scripts/verify_log_statements.py +++ b/scripts/verify_log_statements.py @@ -21,6 +21,7 @@ log_statement_re = re.compile(r'^[ \t]*LOG[_A-Z]+\(([^";,]*,)*[ \t\r\n]*(("[^"]*"[^";,]*)*)(,[^;]*|)\);', re.MULTILINE | re.DOTALL) fmt_re = re.compile(r'("[^"]*".*)*fmt') +osmo_stringify_re = re.compile("OSMO_STRINGIFY[_A-Z]*\([^)]*\)") debug = ('-d' in sys.argv) or ('--debug' in sys.argv) @@ -79,6 +80,7 @@ for n in (16,32,64): quoted = quoted.replace('PRIu' + str(n), '') quoted = quoted.replace('PRId' + str(n), '') + quoted = ''.join(osmo_stringify_re.split(quoted)) # Use py eval to join separate string constants: drop any tabs/newlines # that are not in quotes, between separate string constants. -- To view, visit https://gerrit.osmocom.org/10064 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I439ee65cd65cf42e1005ca71aa7d4b680b18c0e5 Gerrit-Change-Number: 10064 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 18:13:58 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 18:13:58 +0000 Subject: Change in osmo-ci[master]: scripts/verify_log_statements.py: on parse error, print file Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10065 Change subject: scripts/verify_log_statements.py: on parse error, print file ...................................................................... scripts/verify_log_statements.py: on parse error, print file If string eval encounters an uncovered parse error, it's useful to know which file it happened in. Change-Id: I5fe9a3bbdbfb8a995f24596bf09e70ca5bb3fe8a --- M scripts/verify_log_statements.py 1 file changed, 45 insertions(+), 42 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/65/10065/1 diff --git a/scripts/verify_log_statements.py b/scripts/verify_log_statements.py index 567a96a..9a9cd1b 100755 --- a/scripts/verify_log_statements.py +++ b/scripts/verify_log_statements.py @@ -63,59 +63,62 @@ if not (f.endswith('.h') or f.endswith('.c') or f.endswith('.cpp')): return [] - errors_found = [] + try: + errors_found = [] - file_content = codecs.open(f, "r", "utf-8").read() + file_content = codecs.open(f, "r", "utf-8").read() - for log in log_statement_re.finditer(file_content): - quoted = log.group(2) + for log in log_statement_re.finditer(file_content): + quoted = log.group(2) - # Skip 'LOG("bla" fmt )' strings that typically appear as #defines. - if fmt_re.match(quoted): - if debug: - errors_found.append(error_found(f, log.start(), 'Skipping define', log.group(0))) - continue + # Skip 'LOG("bla" fmt )' strings that typically appear as #defines. + if fmt_re.match(quoted): + if debug: + errors_found.append(error_found(f, log.start(), 'Skipping define', log.group(0))) + continue - # Drop PRI* parts of 'LOG("bla %"PRIu64" foo")' - for n in (16,32,64): - quoted = quoted.replace('PRIu' + str(n), '') - quoted = quoted.replace('PRId' + str(n), '') - quoted = ''.join(osmo_stringify_re.split(quoted)) + # Drop PRI* parts of 'LOG("bla %"PRIu64" foo")' + for n in (16,32,64): + quoted = quoted.replace('PRIu' + str(n), '') + quoted = quoted.replace('PRId' + str(n), '') + quoted = ''.join(osmo_stringify_re.split(quoted)) - # Use py eval to join separate string constants: drop any tabs/newlines - # that are not in quotes, between separate string constants. - try: - quoted = eval('(' + quoted + '\n)' ) - except: - # hopefully eval broke because of some '## args' macro def - if debug: - ignored.append(error_found(f, log.start(), 'Ignoring', log.group(0))) - continue + # Use py eval to join separate string constants: drop any tabs/newlines + # that are not in quotes, between separate string constants. + try: + quoted = eval('(' + quoted + '\n)' ) + except: + # hopefully eval broke because of some '## args' macro def + if debug: + ignored.append(error_found(f, log.start(), 'Ignoring', log.group(0))) + continue - # check for errors... + # check for errors... - # final newline - if not quoted.endswith('\n'): - errors_found.append(error_found(f, log.start(), 'Missing final newline', log.group(0))) + # final newline + if not quoted.endswith('\n'): + errors_found.append(error_found(f, log.start(), 'Missing final newline', log.group(0))) - # disallowed chars and extra newlines - for c in quoted[:-1]: - if not c.isprintable() and not c == '\t': - if c == '\n': - msg = 'Extraneous newline' - else: - msg = 'Illegal char' - errors_found.append(error_found(f, log.start(), msg + ' %r' % c, log.group(0))) + # disallowed chars and extra newlines + for c in quoted[:-1]: + if not c.isprintable() and not c == '\t': + if c == '\n': + msg = 'Extraneous newline' + else: + msg = 'Illegal char' + errors_found.append(error_found(f, log.start(), msg + ' %r' % c, log.group(0))) - if not error_found: - return [] + if not error_found: + return [] - line_idx = make_line_idx(file_content) - for r, line in zip(errors_found, char_pos_2_line(line_idx, [rr.charpos for rr in errors_found])): - r.line = line + line_idx = make_line_idx(file_content) + for r, line in zip(errors_found, char_pos_2_line(line_idx, [rr.charpos for rr in errors_found])): + r.line = line - return errors_found - + return errors_found + except: + print("ERROR WHILE PROCESSING %r" % f, file=sys.stderr) + raise all_errors_found = [] for f in args: -- To view, visit https://gerrit.osmocom.org/10065 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I5fe9a3bbdbfb8a995f24596bf09e70ca5bb3fe8a Gerrit-Change-Number: 10065 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 18:43:29 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 18:43:29 +0000 Subject: Change in osmo-bsc[master]: hodec2 log: less verbose, more concise logging In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10058 to look at the new patch set (#2). Change subject: hodec2 log: less verbose, more concise logging ...................................................................... hodec2 log: less verbose, more concise logging Drop numerous log statements that merely bloat the ho decision log. Logging HO candidates: log more compact in a single line, do not use LOGPC and multiline output. The result is more useful information in a quarter of the log lines. LOGPHOLCHAN(), LOGPHOLCHANTOBTS(): - log lchan->type instead of lchan->ts->pchan - always log the speech mode ===== Before ===== DHODEC handover_decision_2.c:1131 (lchan 0.010 TCH/F) (subscr IMSI:000001) MEASUREMENT REPORT (1 neighbors) DHODEC handover_decision_2.c:1136 (lchan 0.010 TCH/F) (subscr IMSI:000001) 0: arfcn=871 bsic=63 neigh_idx=0 rxlev=30 flags=0 DHODEC handover_decision_2.c:261 (lchan 0.010 TCH/F) (subscr IMSI:000001) neigh 871 rxlev=30 last_seen_nr=3 DHODEC handover_decision_2.c:1158 (lchan 0.010 TCH/F) (subscr IMSI:000001) HODEC2: evaluating measurement report DHODEC handover_decision_2.c:1175 (lchan 0.010 TCH/F) (subscr IMSI:000001) Measurement report: average RX level = -110 DHODEC handover_decision_2.c:1190 (lchan 0.010 TCH/F) (subscr IMSI:000001) Virtually improving RX level from -110 to -105, due to AFS bias DHODEC handover_decision_2.c:1220 (lchan 0.010 TCH/F) (subscr IMSI:000001) Attempting handover/assignment due to low rxlev DHODEC handover_decision_2.c:899 (lchan 0.010 TCH/F) (subscr IMSI:000001) Collecting candidates for Assignment and Handover DHODEC handover_decision_2.c:407 (lchan 0.010 TCH/F)->(BTS 0) (subscr IMSI:000001) tch_mode='SPEECH_AMR' type='TCH_F' DHODEC handover_decision_2.c:313 (lchan 0.010 TCH/F) (subscr IMSI:000001) FR3 supported DHODEC handover_decision_2.c:313 (lchan 0.010 TCH/F) (subscr IMSI:000001) HR3 supported DHODEC handover_decision_2.c:489 (lchan 0.010 TCH/F)->(BTS 0) (subscr IMSI:000001) removing TCH/F, already on TCH/F in this cell DHODEC handover_decision_2.c:573 (lchan 0.010 TCH/F)->(BTS 0) (subscr IMSI:000001) TCH/H would not be congested after HO DHODEC handover_decision_2.c:605 (lchan 0.010 TCH/F)->(BTS 0) (subscr IMSI:000001) TCH/H would not be less congested in target than source cell after HO DHODEC handover_decision_2.c:609 (lchan 0.010 TCH/F)->(BTS 0) (subscr IMSI:000001) requirements=0x30 DHODEC handover_decision_2.c:704 - current BTS 0, RX level -110 DHODEC handover_decision_2.c:707 o free TCH/F slots 3, minimum required 0 DHODEC handover_decision_2.c:709 o free TCH/H slots 4, minimum required 0 DHODEC handover_decision_2.c:714 o no requirement fulfilled for TCHF (no assignment possible) DHODEC handover_decision_2.c:737 o requirement A B fulfilled for TCHH (not congested after assignment) DHODEC handover_decision_2.c:407 (lchan 0.010 TCH/F)->(BTS 1) (subscr IMSI:000001) tch_mode='SPEECH_AMR' type='TCH_F' DHODEC handover_decision_2.c:313 (lchan 0.010 TCH/F) (subscr IMSI:000001) FR3 supported DHODEC handover_decision_2.c:313 (lchan 0.010 TCH/F) (subscr IMSI:000001) HR3 supported DHODEC handover_decision_2.c:563 (lchan 0.010 TCH/F)->(BTS 1) (subscr IMSI:000001) TCH/F would not be congested after HO DHODEC handover_decision_2.c:573 (lchan 0.010 TCH/F)->(BTS 1) (subscr IMSI:000001) TCH/H would not be congested after HO DHODEC handover_decision_2.c:595 (lchan 0.010 TCH/F)->(BTS 1) (subscr IMSI:000001) TCH/F would not be less congested in target than source cell after HO DHODEC handover_decision_2.c:605 (lchan 0.010 TCH/F)->(BTS 1) (subscr IMSI:000001) TCH/H would not be less congested in target than source cell after HO DHODEC handover_decision_2.c:609 (lchan 0.010 TCH/F)->(BTS 1) (subscr IMSI:000001) requirements=0x33 DHODEC handover_decision_2.c:701 - neighbor BTS 1, RX level -110 -> -80 DHODEC handover_decision_2.c:707 o free TCH/F slots 4, minimum required 0 DHODEC handover_decision_2.c:709 o free TCH/H slots 4, minimum required 0 DHODEC handover_decision_2.c:712 o requirement A B fulfilled for TCHF (not congested after handover) DHODEC handover_decision_2.c:737 o requirement A B fulfilled for TCHH (not congested after handover) DHODEC handover_decision_2.c:914 (lchan 0.010 TCH/F) (subscr IMSI:000001) adding 2 candidates from 1 neighbors, total 2 DHODEC handover_decision_2.c:1020 (lchan 0.010 TCH/F)->(BTS 1) (subscr IMSI:000001) Best candidate, RX level -80 DHODEC handover_decision_2.c:625 (lchan 0.010 TCH/F)->(BTS 1) (subscr IMSI:000001) Triggering Handover DHODEC handover_decision_2.c:688 (lchan 0.010 TCH/F)->(BTS 1) (subscr IMSI:000001) Triggering handover to TCH/F, due to low rxlevel DHO handover_logic.c:133 (BTS 0 trx 0 ts 1 lchan 0 TCH/F)->(BTS 1 lchan TCH_F) Initiating Handover... DMSC handover_logic.c:135 SUBSCR_CONN[0x612000000520]{ACTIVE}: Received Event HO_START DHODEC handover_logic.c:172 (BTS 0 trx 0 arfcn 870 ts 1 lchan 0 TCH/F)->(BTS 1 trx 0 arfcn 871 ts 1 lchan 0 TCH/F) (subscr IMSI:000001) Triggering Handover ===== After ===== DHODEC handover_decision_2.c:1039 (lchan 0.010 TCH_F SPEECH_AMR) (subscr IMSI:000001) MEASUREMENT REPORT (1 neighbors) DHODEC handover_decision_2.c:1044 (lchan 0.010 TCH_F SPEECH_AMR) (subscr IMSI:000001) 0: arfcn=871 bsic=63 neigh_idx=0 rxlev=30 flags=0 DHODEC handover_decision_2.c:1097 (lchan 0.010 TCH_F SPEECH_AMR) (subscr IMSI:000001) Avg RX level = -110 dBm, +5 dBm AFS bias = -105 dBm; Avg RX quality = -1 (invalid), +0 AFS bias = -1 DHODEC handover_decision_2.c:1122 (lchan 0.010 TCH_F SPEECH_AMR) (subscr IMSI:000001) RX level is TOO LOW: -105 < -100 DHODEC handover_decision_2.c:677 (lchan 0.010 TCH_F SPEECH_AMR)->(BTS 0) (subscr IMSI:000001) RX level -110; TCH/F={free 3 (want 0), [-] not a candidate}; TCH/H={free 4 (want 0), [ABC] good} DHODEC handover_decision_2.c:671 (lchan 0.010 TCH_F SPEECH_AMR)->(BTS 1) (subscr IMSI:000001) RX level -110 -> -80; TCH/F={free 4 (want 0), [ABC] good}; TCH/H={free 4 (want 0), [ABC] good} DHODEC handover_decision_2.c:928 (lchan 0.010 TCH_F SPEECH_AMR)->(BTS 1) (subscr IMSI:000001) Best candidate, RX level -80 DHODEC handover_decision_2.c:641 (lchan 0.010 TCH_F SPEECH_AMR)->(BTS 1) (subscr IMSI:000001) Triggering handover to TCH/F, due to low rxlevel DMSC handover_logic.c:125 SUBSCR_CONN[0x612000000520]{ACTIVE}: Received Event HO_START DHODEC handover_logic.c:169 (BTS 0 trx 0 arfcn 870 ts 1 lchan 0 TCH_F SPEECH_AMR)->(BTS 1 trx 0 arfcn 871 ts 1 lchan 0 TCH/F) (subscr IMSI:000001) Triggering Handover Change-Id: If1add9b57a051d32b67a4a08ab47a9655aa9dd17 --- M include/osmocom/bsc/handover.h M src/osmo-bsc/handover_decision.c M src/osmo-bsc/handover_decision_2.c M src/osmo-bsc/handover_logic.c 4 files changed, 81 insertions(+), 222 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/58/10058/2 -- To view, visit https://gerrit.osmocom.org/10058 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If1add9b57a051d32b67a4a08ab47a9655aa9dd17 Gerrit-Change-Number: 10058 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 18:51:20 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 18:51:20 +0000 Subject: Change in osmo-ci[master]: scripts/verify_log_statements.py: fix regex In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10062 ) Change subject: scripts/verify_log_statements.py: fix regex ...................................................................... Patch Set 1: Verified+1 Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10062 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If61a36a014a799b94030e5e08a50dfef4207a8a2 Gerrit-Change-Number: 10062 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Thu, 19 Jul 2018 18:51:20 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 18:51:26 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 18:51:26 +0000 Subject: Change in osmo-ci[master]: scripts/verify_log_statements.py: figure out line numbers In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10063 ) Change subject: scripts/verify_log_statements.py: figure out line numbers ...................................................................... Patch Set 1: Verified+1 Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10063 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib75c8f5a99ed556d85896b7f8c65fb9446a2fbce Gerrit-Change-Number: 10063 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Thu, 19 Jul 2018 18:51:26 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 18:51:32 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 18:51:32 +0000 Subject: Change in osmo-ci[master]: scripts/verify_log_statements.py: strip OSMO_STRINGIFY() In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10064 ) Change subject: scripts/verify_log_statements.py: strip OSMO_STRINGIFY() ...................................................................... Patch Set 1: Verified+1 Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10064 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I439ee65cd65cf42e1005ca71aa7d4b680b18c0e5 Gerrit-Change-Number: 10064 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Thu, 19 Jul 2018 18:51:32 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 18:51:37 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 18:51:37 +0000 Subject: Change in osmo-ci[master]: scripts/verify_log_statements.py: on parse error, print file In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10065 ) Change subject: scripts/verify_log_statements.py: on parse error, print file ...................................................................... Patch Set 1: Verified+1 Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10065 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5fe9a3bbdbfb8a995f24596bf09e70ca5bb3fe8a Gerrit-Change-Number: 10065 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Thu, 19 Jul 2018 18:51:37 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 18:51:40 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 18:51:40 +0000 Subject: Change in osmo-ci[master]: scripts/verify_log_statements.py: fix regex In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10062 ) Change subject: scripts/verify_log_statements.py: fix regex ...................................................................... scripts/verify_log_statements.py: fix regex Would miss those where the fmt string starts on a new line. Change-Id: If61a36a014a799b94030e5e08a50dfef4207a8a2 --- M scripts/verify_log_statements.py 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/scripts/verify_log_statements.py b/scripts/verify_log_statements.py index e7752e1..48f406b 100755 --- a/scripts/verify_log_statements.py +++ b/scripts/verify_log_statements.py @@ -18,8 +18,8 @@ # This regex matches the entire LOGxx(...) statement over multiple lines. # It pinpoints the format string by looking for the first arg that contains quotes. # It then matches any number of separate quoted strings, and accepts 0 or more args after that. -log_statement_re = re.compile(r'^[ \t]*LOG[_A-Z]+\(([^";,]*,)* *(("[^"]*"[^";,]*)*)(,[^;]*|)\);', - re.MULTILINE | re.DOTALL) +log_statement_re = re.compile(r'^[ \t]*LOG[_A-Z]+\(([^";,]*,)*[ \t\r\n]*(("[^"]*"[^";,]*)*)(,[^;]*|)\);', + re.MULTILINE | re.DOTALL) fmt_re = re.compile(r'("[^"]*".*)*fmt') errors_found = 0 -- To view, visit https://gerrit.osmocom.org/10062 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: If61a36a014a799b94030e5e08a50dfef4207a8a2 Gerrit-Change-Number: 10062 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 18:51:40 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 18:51:40 +0000 Subject: Change in osmo-ci[master]: scripts/verify_log_statements.py: figure out line numbers In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10063 ) Change subject: scripts/verify_log_statements.py: figure out line numbers ...................................................................... scripts/verify_log_statements.py: figure out line numbers Change-Id: Ib75c8f5a99ed556d85896b7f8c65fb9446a2fbce --- M scripts/verify_log_statements.py 1 file changed, 61 insertions(+), 13 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/scripts/verify_log_statements.py b/scripts/verify_log_statements.py index 48f406b..6108c23 100755 --- a/scripts/verify_log_statements.py +++ b/scripts/verify_log_statements.py @@ -22,26 +22,57 @@ re.MULTILINE | re.DOTALL) fmt_re = re.compile(r'("[^"]*".*)*fmt') -errors_found = 0 debug = ('-d' in sys.argv) or ('--debug' in sys.argv) args = [x for x in sys.argv[1:] if not (x == '-d' or x == '--debug')] if not args: args = ['.'] +class error_found: + def __init__(self, f, charpos, msg, text): + self.f = f + self.charpos = charpos + self.msg = msg + self.text = text + self.line = None + +def make_line_idx(file_content): + line_idx = [] + pos = 0 + line_nr = 1 + line_idx.append((pos, line_nr)) + for line in file_content.split('\n'): + pos += len(line) + line_nr += 1 + line_idx.append((pos, line_nr)) + pos += 1 # newline char + return line_idx + +def char_pos_2_line(line_idx, sorted_char_positions): + r = [] + line_i = 0 + next_line_i = 1 + for char_pos in sorted_char_positions: + while (line_i+1) < len(line_idx) and char_pos > line_idx[line_i+1][0]: + line_i += 1 + r.append(line_idx[line_i][1]) + return r def check_file(f): - global errors_found if not (f.endswith('.h') or f.endswith('.c') or f.endswith('.cpp')): - return + return [] - for log in log_statement_re.finditer(codecs.open(f, "r", "utf-8").read()): + errors_found = [] + + file_content = codecs.open(f, "r", "utf-8").read() + + for log in log_statement_re.finditer(file_content): quoted = log.group(2) # Skip 'LOG("bla" fmt )' strings that typically appear as #defines. if fmt_re.match(quoted): if debug: - print('Skipping define:', f, '\n'+log.group(0)) + errors_found.append(error_found(f, log.start(), 'Skipping define', log.group(0))) continue # Drop PRI* parts of 'LOG("bla %"PRIu64" foo")' @@ -56,15 +87,14 @@ except: # hopefully eval broke because of some '## args' macro def if debug: - print('Ignoring:', f, '\n'+log.group(0)) + ignored.append(error_found(f, log.start(), 'Ignoring', log.group(0))) continue # check for errors... # final newline if not quoted.endswith('\n'): - print('Missing final newline:', f, '\n'+log.group(0)) - errors_found += 1 + errors_found.append(error_found(f, log.start(), 'Missing final newline', log.group(0))) # disallowed chars and extra newlines for c in quoted[:-1]: @@ -73,15 +103,33 @@ msg = 'Extraneous newline' else: msg = 'Illegal char' - print('%s %r in' % (msg, c), f, '\n' + log.group(0)) - errors_found += 1 + errors_found.append(error_found(f, log.start(), msg + ' %r' % c, log.group(0))) + if not error_found: + return [] + + line_idx = make_line_idx(file_content) + for r, line in zip(errors_found, char_pos_2_line(line_idx, [rr.charpos for rr in errors_found])): + r.line = line + + return errors_found + + +all_errors_found = [] for f in args: if os.path.isdir(f): for parent_path, subdirs, files in os.walk(f, None, None): for ff in files: - check_file(os.path.join(parent_path, ff)) + all_errors_found.extend(check_file(os.path.join(parent_path, ff))) else: - check_file(f) + all_errors_found.extend(check_file(f)) -sys.exit(errors_found) +def print_errors(errs): + for err in errs: + print('%s: %s:%d\n%s\n' % (err.msg, err.f, err.line or 0, err.text)) + +print_errors(all_errors_found) + +sys.exit(len(all_errors_found)) + +# vim: tabstop=2 shiftwidth=2 expandtab -- To view, visit https://gerrit.osmocom.org/10063 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ib75c8f5a99ed556d85896b7f8c65fb9446a2fbce Gerrit-Change-Number: 10063 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 18:51:41 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 18:51:41 +0000 Subject: Change in osmo-ci[master]: scripts/verify_log_statements.py: strip OSMO_STRINGIFY() In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10064 ) Change subject: scripts/verify_log_statements.py: strip OSMO_STRINGIFY() ...................................................................... scripts/verify_log_statements.py: strip OSMO_STRINGIFY() Change-Id: I439ee65cd65cf42e1005ca71aa7d4b680b18c0e5 --- M scripts/verify_log_statements.py 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/scripts/verify_log_statements.py b/scripts/verify_log_statements.py index 6108c23..567a96a 100755 --- a/scripts/verify_log_statements.py +++ b/scripts/verify_log_statements.py @@ -21,6 +21,7 @@ log_statement_re = re.compile(r'^[ \t]*LOG[_A-Z]+\(([^";,]*,)*[ \t\r\n]*(("[^"]*"[^";,]*)*)(,[^;]*|)\);', re.MULTILINE | re.DOTALL) fmt_re = re.compile(r'("[^"]*".*)*fmt') +osmo_stringify_re = re.compile("OSMO_STRINGIFY[_A-Z]*\([^)]*\)") debug = ('-d' in sys.argv) or ('--debug' in sys.argv) @@ -79,6 +80,7 @@ for n in (16,32,64): quoted = quoted.replace('PRIu' + str(n), '') quoted = quoted.replace('PRId' + str(n), '') + quoted = ''.join(osmo_stringify_re.split(quoted)) # Use py eval to join separate string constants: drop any tabs/newlines # that are not in quotes, between separate string constants. -- To view, visit https://gerrit.osmocom.org/10064 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I439ee65cd65cf42e1005ca71aa7d4b680b18c0e5 Gerrit-Change-Number: 10064 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 18:51:42 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 18:51:42 +0000 Subject: Change in osmo-ci[master]: scripts/verify_log_statements.py: on parse error, print file In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10065 ) Change subject: scripts/verify_log_statements.py: on parse error, print file ...................................................................... scripts/verify_log_statements.py: on parse error, print file If string eval encounters an uncovered parse error, it's useful to know which file it happened in. Change-Id: I5fe9a3bbdbfb8a995f24596bf09e70ca5bb3fe8a --- M scripts/verify_log_statements.py 1 file changed, 45 insertions(+), 42 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/scripts/verify_log_statements.py b/scripts/verify_log_statements.py index 567a96a..9a9cd1b 100755 --- a/scripts/verify_log_statements.py +++ b/scripts/verify_log_statements.py @@ -63,59 +63,62 @@ if not (f.endswith('.h') or f.endswith('.c') or f.endswith('.cpp')): return [] - errors_found = [] + try: + errors_found = [] - file_content = codecs.open(f, "r", "utf-8").read() + file_content = codecs.open(f, "r", "utf-8").read() - for log in log_statement_re.finditer(file_content): - quoted = log.group(2) + for log in log_statement_re.finditer(file_content): + quoted = log.group(2) - # Skip 'LOG("bla" fmt )' strings that typically appear as #defines. - if fmt_re.match(quoted): - if debug: - errors_found.append(error_found(f, log.start(), 'Skipping define', log.group(0))) - continue + # Skip 'LOG("bla" fmt )' strings that typically appear as #defines. + if fmt_re.match(quoted): + if debug: + errors_found.append(error_found(f, log.start(), 'Skipping define', log.group(0))) + continue - # Drop PRI* parts of 'LOG("bla %"PRIu64" foo")' - for n in (16,32,64): - quoted = quoted.replace('PRIu' + str(n), '') - quoted = quoted.replace('PRId' + str(n), '') - quoted = ''.join(osmo_stringify_re.split(quoted)) + # Drop PRI* parts of 'LOG("bla %"PRIu64" foo")' + for n in (16,32,64): + quoted = quoted.replace('PRIu' + str(n), '') + quoted = quoted.replace('PRId' + str(n), '') + quoted = ''.join(osmo_stringify_re.split(quoted)) - # Use py eval to join separate string constants: drop any tabs/newlines - # that are not in quotes, between separate string constants. - try: - quoted = eval('(' + quoted + '\n)' ) - except: - # hopefully eval broke because of some '## args' macro def - if debug: - ignored.append(error_found(f, log.start(), 'Ignoring', log.group(0))) - continue + # Use py eval to join separate string constants: drop any tabs/newlines + # that are not in quotes, between separate string constants. + try: + quoted = eval('(' + quoted + '\n)' ) + except: + # hopefully eval broke because of some '## args' macro def + if debug: + ignored.append(error_found(f, log.start(), 'Ignoring', log.group(0))) + continue - # check for errors... + # check for errors... - # final newline - if not quoted.endswith('\n'): - errors_found.append(error_found(f, log.start(), 'Missing final newline', log.group(0))) + # final newline + if not quoted.endswith('\n'): + errors_found.append(error_found(f, log.start(), 'Missing final newline', log.group(0))) - # disallowed chars and extra newlines - for c in quoted[:-1]: - if not c.isprintable() and not c == '\t': - if c == '\n': - msg = 'Extraneous newline' - else: - msg = 'Illegal char' - errors_found.append(error_found(f, log.start(), msg + ' %r' % c, log.group(0))) + # disallowed chars and extra newlines + for c in quoted[:-1]: + if not c.isprintable() and not c == '\t': + if c == '\n': + msg = 'Extraneous newline' + else: + msg = 'Illegal char' + errors_found.append(error_found(f, log.start(), msg + ' %r' % c, log.group(0))) - if not error_found: - return [] + if not error_found: + return [] - line_idx = make_line_idx(file_content) - for r, line in zip(errors_found, char_pos_2_line(line_idx, [rr.charpos for rr in errors_found])): - r.line = line + line_idx = make_line_idx(file_content) + for r, line in zip(errors_found, char_pos_2_line(line_idx, [rr.charpos for rr in errors_found])): + r.line = line - return errors_found - + return errors_found + except: + print("ERROR WHILE PROCESSING %r" % f, file=sys.stderr) + raise all_errors_found = [] for f in args: -- To view, visit https://gerrit.osmocom.org/10065 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I5fe9a3bbdbfb8a995f24596bf09e70ca5bb3fe8a Gerrit-Change-Number: 10065 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 18:53:32 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 18:53:32 +0000 Subject: Change in pysim[master]: readme: add info about dependencies In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10046 ) Change subject: readme: add info about dependencies ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10046 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I912bbf787e1408100183cade2113bf7617b86ffa Gerrit-Change-Number: 10046 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Thu, 19 Jul 2018 18:53:32 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 18:53:42 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 18:53:42 +0000 Subject: Change in pysim[master]: commands: depend on pytlv only when it is actually needed In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10048 ) Change subject: commands: depend on pytlv only when it is actually needed ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10048 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ida841d74d9581e7f395751b0f74556a06a038de6 Gerrit-Change-Number: 10048 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-Comment-Date: Thu, 19 Jul 2018 18:53:42 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 18:55:06 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 18:55:06 +0000 Subject: Change in pysim[master]: readme: add 'serial' dep, cosmetically rearrange In-Reply-To: References: Message-ID: Hello dexter, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10051 to look at the new patch set (#2). Change subject: readme: add 'serial' dep, cosmetically rearrange ...................................................................... readme: add 'serial' dep, cosmetically rearrange Change-Id: I414b897ba4911b7428ddf807cb04a93700ee0193 --- M README.md 1 file changed, 10 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/51/10051/2 -- To view, visit https://gerrit.osmocom.org/10051 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I414b897ba4911b7428ddf807cb04a93700ee0193 Gerrit-Change-Number: 10051 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 20:16:30 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 20:16:30 +0000 Subject: Change in libosmocore[master]: utils_test: fix isqrt_test calculation range Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10066 Change subject: utils_test: fix isqrt_test calculation range ...................................................................... utils_test: fix isqrt_test calculation range Multiplying the uint16_t x by itself seems to default to be calculated in int32_t range, while it obviously needs uint32_t. This causes sporadic sanitizer barfs: Testing integer square-root utils_test.c:445:18: runtime error: signed integer overflow: 60369 * 60369 cannot be represented in type 'int' The final result is still correct, because it is in fact interpreted as uint32_t. Cast to uint32_t to make sure the sanitizer doesn't complain. Change-Id: I83c14e38deaa466d977ee43c9420534ed90f090d --- M tests/utils/utils_test.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/66/10066/1 diff --git a/tests/utils/utils_test.c b/tests/utils/utils_test.c index cb4e476..84964f5 100644 --- a/tests/utils/utils_test.c +++ b/tests/utils/utils_test.c @@ -439,7 +439,7 @@ x = r * (UINT16_MAX/RAND_MAX); else x = r; - uint32_t sq = x*x; + uint32_t sq = (uint32_t)x*x; uint32_t y = osmo_isqrt32(sq); if (y != x) printf("ERROR: x=%u, sq=%u, osmo_isqrt(%u) = %u\n", x, sq, sq, y); -- To view, visit https://gerrit.osmocom.org/10066 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I83c14e38deaa466d977ee43c9420534ed90f090d Gerrit-Change-Number: 10066 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 20:16:31 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 20:16:31 +0000 Subject: Change in libosmocore[master]: utils_test: check stderr to catch sanitizer issues Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10067 Change subject: utils_test: check stderr to catch sanitizer issues ...................................................................... utils_test: check stderr to catch sanitizer issues Recent OS#3407 shows that we should verify stderr to catch sanitizer failures. (They might not always be ignorable like that one.) Change-Id: Ic9e437a1cc96ae081e0fd6a9b6e3156987e14c0c --- M tests/Makefile.am M tests/testsuite.at A tests/utils/utils_test.err 3 files changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/67/10067/1 diff --git a/tests/Makefile.am b/tests/Makefile.am index db4e520..7d7902c 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -240,7 +240,7 @@ vty/ok_tabs_and_spaces.cfg \ vty/ok_tabs.cfg \ comp128/comp128_test.ok bits/bitfield_test.ok \ - utils/utils_test.ok stats/stats_test.ok \ + utils/utils_test.ok utils_test.err stats/stats_test.ok \ bitvec/bitvec_test.ok msgb/msgb_test.ok bits/bitcomp_test.ok \ sim/sim_test.ok tlv/tlv_test.ok abis/abis_test.ok \ gsup/gsup_test.ok gsup/gsup_test.err \ diff --git a/tests/testsuite.at b/tests/testsuite.at index 15a89b6..43b58e8 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -205,7 +205,8 @@ AT_SETUP([utils]) AT_KEYWORDS([utils]) cat $abs_srcdir/utils/utils_test.ok > expout -AT_CHECK([$abs_top_builddir/tests/utils/utils_test], [0], [expout], [ignore]) +cat $abs_srcdir/utils/utils_test.err > experr +AT_CHECK([$abs_top_builddir/tests/utils/utils_test], [0], [expout], [experr]) AT_CLEANUP AT_SETUP([stats]) diff --git a/tests/utils/utils_test.err b/tests/utils/utils_test.err new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/utils/utils_test.err -- To view, visit https://gerrit.osmocom.org/10067 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ic9e437a1cc96ae081e0fd6a9b6e3156987e14c0c Gerrit-Change-Number: 10067 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 20:16:35 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 20:16:35 +0000 Subject: Change in libosmocore[master]: add osmo_sockaddr_to_str_and_uint() Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10068 Change subject: add osmo_sockaddr_to_str_and_uint() ...................................................................... add osmo_sockaddr_to_str_and_uint() This came from osmo-bsc refactoring patch I82e3f918295daa83274a4cf803f046979f284366 https://gerrit.osmocom.org/#/c/osmo-bsc/+/9671/6/src/osmo-bsc/gsm_data.c at 1708 Add regression test in utils_test.c. Change-Id: I1f2918418c38918c5ac70acaa51a47adfca12b5e --- M include/osmocom/core/socket.h M src/socket.c M tests/utils/utils_test.c M tests/utils/utils_test.ok 4 files changed, 148 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/68/10068/1 diff --git a/include/osmocom/core/socket.h b/include/osmocom/core/socket.h index 47d9f30..3e95953 100644 --- a/include/osmocom/core/socket.h +++ b/include/osmocom/core/socket.h @@ -44,6 +44,9 @@ int osmo_sockaddr_is_local(struct sockaddr *addr, unsigned int addrlen); +size_t osmo_sockaddr_to_str_and_uint(char *addr, size_t addr_len, uint16_t *port, + const struct sockaddr *sa); + int osmo_sock_unix_init(uint16_t type, uint8_t proto, const char *socket_path, unsigned int flags); diff --git a/src/socket.c b/src/socket.c index cd73f17..168db35 100644 --- a/src/socket.c +++ b/src/socket.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -553,6 +554,25 @@ return 0; } +/*! Convert sockaddr to IP address as char string and port as uint16_t. + * \param[out] addr String buffer to write IP address to, or NULL. + * \param[out] addr_len Size of \a addr. + * \param[out] port Pointer to uint16_t to write the port number to, or NULL. + * \param[in] sa Sockaddr to convert. + * \returns the required string buffer size, like osmo_strlcpy(), or 0 if \a addr is NULL. + */ +size_t osmo_sockaddr_to_str_and_uint(char *addr, size_t addr_len, uint16_t *port, + const struct sockaddr *sa) +{ + const struct sockaddr_in *sin = (const struct sockaddr_in *)sa; + + if (port) + *port = ntohs(sin->sin_port); + if (addr) + return osmo_strlcpy(addr, inet_ntoa(sin->sin_addr), addr_len); + return 0; +} + /*! Initialize a unix domain socket (including bind/connect) * \param[in] type Socket type like SOCK_DGRAM, SOCK_STREAM * \param[in] proto Protocol like IPPROTO_TCP, IPPROTO_UDP diff --git a/tests/utils/utils_test.c b/tests/utils/utils_test.c index 84964f5..1b49ca7 100644 --- a/tests/utils/utils_test.c +++ b/tests/utils/utils_test.c @@ -24,10 +24,13 @@ #include #include +#include #include #include #include +#include +#include static void hexdump_test(void) { @@ -446,6 +449,117 @@ } } + +struct osmo_sockaddr_to_str_and_uint_test_case { + uint16_t port; + bool omit_port; + const char *addr; + size_t addr_len; + bool omit_addr; + size_t expect_rc; + const char *expect_returned_addr; +}; + +struct osmo_sockaddr_to_str_and_uint_test_case osmo_sockaddr_to_str_and_uint_test_data[] = { + { + .port = 0, + .addr = "0.0.0.0", + .addr_len = 20, + .expect_rc = 7, + }, + { + .port = 65535, + .addr = "255.255.255.255", + .addr_len = 20, + .expect_rc = 15, + }, + { + .port = 1234, + .addr = "234.23.42.123", + .addr_len = 20, + .expect_rc = 13, + }, + { + .port = 1234, + .addr = "234.23.42.123", + .addr_len = 10, + .expect_rc = 13, + .expect_returned_addr = "234.23.42", + }, + { + .port = 1234, + .omit_port = true, + .addr = "234.23.42.123", + .addr_len = 20, + .expect_rc = 13, + }, + { + .port = 1234, + .addr = "234.23.42.123", + .omit_addr = true, + .expect_rc = 0, + .expect_returned_addr = "", + }, + { + .port = 1234, + .addr = "234.23.42.123", + .addr_len = 0, + .expect_rc = 13, + .expect_returned_addr = "", + }, + { + .port = 1234, + .addr = "234.23.42.123", + .omit_port = true, + .omit_addr = true, + .expect_rc = 0, + .expect_returned_addr = "", + }, +}; + +static void osmo_sockaddr_to_str_and_uint_test(void) +{ + int i; + printf("\n%s\n", __func__); + + for (i = 0; i < ARRAY_SIZE(osmo_sockaddr_to_str_and_uint_test_data); i++) { + struct osmo_sockaddr_to_str_and_uint_test_case *t = + &osmo_sockaddr_to_str_and_uint_test_data[i]; + + struct sockaddr_in sin = { + .sin_family = AF_INET, + .sin_port = htons(t->port), + }; + inet_aton(t->addr, &sin.sin_addr); + + char addr[20] = {}; + uint16_t port = 0; + size_t rc; + + rc = osmo_sockaddr_to_str_and_uint( + t->omit_addr? NULL : addr, t->addr_len, + t->omit_port? NULL : &port, + (const struct sockaddr*)&sin); + + printf("[%d] %s:%u%s%s addr_len=%zu --> %s:%u rc=%zu\n", + i, + t->addr ? : "-", + t->port, + t->omit_addr ? " (omit addr)" : "", + t->omit_port ? " (omit port)" : "", + t->addr_len, + addr, port, rc); + if (rc != t->expect_rc) + printf("ERROR: Expected rc = %zu\n", t->expect_rc); + if (!t->expect_returned_addr) + t->expect_returned_addr = t->addr; + if (strcmp(t->expect_returned_addr, addr)) + printf("ERROR: Expected addr = '%s'\n", t->expect_returned_addr); + if (!t->omit_port && port != t->port) + printf("ERROR: Expected port = %u\n", t->port); + } +} + int main(int argc, char **argv) { static const struct log_info log_info = {}; @@ -459,5 +573,6 @@ str_escape_test(); str_quote_test(); isqrt_test(); + osmo_sockaddr_to_str_and_uint_test(); return 0; } diff --git a/tests/utils/utils_test.ok b/tests/utils/utils_test.ok index ea9216f..b158bf7 100644 --- a/tests/utils/utils_test.ok +++ b/tests/utils/utils_test.ok @@ -139,3 +139,13 @@ 'NULL' Testing integer square-root + +osmo_sockaddr_to_str_and_uint_test +[0] 0.0.0.0:0 addr_len=20 --> 0.0.0.0:0 rc=7 +[1] 255.255.255.255:65535 addr_len=20 --> 255.255.255.255:65535 rc=15 +[2] 234.23.42.123:1234 addr_len=20 --> 234.23.42.123:1234 rc=13 +[3] 234.23.42.123:1234 addr_len=10 --> 234.23.42:1234 rc=13 +[4] 234.23.42.123:1234 (omit port) addr_len=20 --> 234.23.42.123:0 rc=13 +[5] 234.23.42.123:1234 (omit addr) addr_len=0 --> :1234 rc=0 +[6] 234.23.42.123:1234 addr_len=0 --> :1234 rc=13 +[7] 234.23.42.123:1234 (omit addr) (omit port) addr_len=0 --> :0 rc=0 -- To view, visit https://gerrit.osmocom.org/10068 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I1f2918418c38918c5ac70acaa51a47adfca12b5e Gerrit-Change-Number: 10068 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 20:18:52 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 20:18:52 +0000 Subject: Change in libosmocore[master]: utils_test: fix isqrt_test calculation range In-Reply-To: References: Message-ID: Neels Hofmeyr has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/10066 ) Change subject: utils_test: fix isqrt_test calculation range ...................................................................... utils_test: fix isqrt_test calculation range Multiplying the uint16_t x by itself seems to default to be calculated in int32_t range, while it obviously needs uint32_t. This causes sporadic sanitizer barfs: Testing integer square-root utils_test.c:445:18: runtime error: signed integer overflow: 60369 * 60369 cannot be represented in type 'int' The final result is still correct, because it is in fact interpreted as uint32_t. Cast to uint32_t to make sure the sanitizer doesn't complain. Related: OS#3407 Change-Id: I83c14e38deaa466d977ee43c9420534ed90f090d --- M tests/utils/utils_test.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/66/10066/2 -- To view, visit https://gerrit.osmocom.org/10066 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I83c14e38deaa466d977ee43c9420534ed90f090d Gerrit-Change-Number: 10066 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-CC: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 20:18:52 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 20:18:52 +0000 Subject: Change in libosmocore[master]: utils_test: check stderr to catch sanitizer issues In-Reply-To: References: Message-ID: Neels Hofmeyr has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/10067 ) Change subject: utils_test: check stderr to catch sanitizer issues ...................................................................... utils_test: check stderr to catch sanitizer issues Recent OS#3407 shows that we should verify stderr to catch sanitizer failures. (They might not always be ignorable like that one.) Change-Id: Ic9e437a1cc96ae081e0fd6a9b6e3156987e14c0c --- M tests/Makefile.am M tests/testsuite.at A tests/utils/utils_test.err 3 files changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/67/10067/2 -- To view, visit https://gerrit.osmocom.org/10067 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic9e437a1cc96ae081e0fd6a9b6e3156987e14c0c Gerrit-Change-Number: 10067 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 20:18:52 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 20:18:52 +0000 Subject: Change in libosmocore[master]: add osmo_sockaddr_to_str_and_uint() In-Reply-To: References: Message-ID: Neels Hofmeyr has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/10068 ) Change subject: add osmo_sockaddr_to_str_and_uint() ...................................................................... add osmo_sockaddr_to_str_and_uint() This came from osmo-bsc refactoring patch I82e3f918295daa83274a4cf803f046979f284366 https://gerrit.osmocom.org/#/c/osmo-bsc/+/9671/6/src/osmo-bsc/gsm_data.c at 1708 Add regression test in utils_test.c. Change-Id: I1f2918418c38918c5ac70acaa51a47adfca12b5e --- M include/osmocom/core/socket.h M src/socket.c M tests/utils/utils_test.c M tests/utils/utils_test.ok 4 files changed, 148 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/68/10068/2 -- To view, visit https://gerrit.osmocom.org/10068 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1f2918418c38918c5ac70acaa51a47adfca12b5e Gerrit-Change-Number: 10068 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 20:25:42 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 19 Jul 2018 20:25:42 +0000 Subject: Change in libosmocore[master]: utils_test: check stderr to catch sanitizer issues In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/10067 ) Change subject: utils_test: check stderr to catch sanitizer issues ...................................................................... Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/10067/2/tests/Makefile.am File tests/Makefile.am: https://gerrit.osmocom.org/#/c/10067/2/tests/Makefile.am at 243 PS2, Line 243: utils_test.err You need to add the directory prefix here ;) -- To view, visit https://gerrit.osmocom.org/10067 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic9e437a1cc96ae081e0fd6a9b6e3156987e14c0c Gerrit-Change-Number: 10067 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 19 Jul 2018 20:25:42 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 20:28:59 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 19 Jul 2018 20:28:59 +0000 Subject: Change in libosmocore[master]: utils_test: check stderr to catch sanitizer issues In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/10067 ) Change subject: utils_test: check stderr to catch sanitizer issues ...................................................................... Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/10067/2/tests/testsuite.at File tests/testsuite.at: https://gerrit.osmocom.org/#/c/10067/2/tests/testsuite.at at 208 PS2, Line 208: cat $abs_srcdir/utils/utils_test.err > experr And BTW, wouldn't it work if you `cat /dev/null` here? This way you would avoid an empty useless file... -- To view, visit https://gerrit.osmocom.org/10067 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic9e437a1cc96ae081e0fd6a9b6e3156987e14c0c Gerrit-Change-Number: 10067 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 19 Jul 2018 20:28:59 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 20:58:56 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Thu, 19 Jul 2018 20:58:56 +0000 Subject: Change in libosmocore[master]: ctrl/vty: fsm: use correct element when iterating over fsm->proc.chil... In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10031 to look at the new patch set (#2). Change subject: ctrl/vty: fsm: use correct element when iterating over fsm->proc.children ...................................................................... ctrl/vty: fsm: use correct element when iterating over fsm->proc.children Fixes crashes when using vty `show fsm-instances all` when fsm children are present. Change-Id: I4ae0bee7f7f57ec6675cfb52ca6cf0d523d15362 --- M src/ctrl/fsm_ctrl_commands.c M src/vty/fsm_vty.c 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/31/10031/2 -- To view, visit https://gerrit.osmocom.org/10031 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4ae0bee7f7f57ec6675cfb52ca6cf0d523d15362 Gerrit-Change-Number: 10031 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 20:59:09 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Thu, 19 Jul 2018 20:59:09 +0000 Subject: Change in osmo-ci[master]: ansible: osmocom-jenkins-slave: add variables to the README.md In-Reply-To: References: Message-ID: lynxis lazus has posted comments on this change. ( https://gerrit.osmocom.org/10013 ) Change subject: ansible: osmocom-jenkins-slave: add variables to the README.md ...................................................................... Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/10013 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I878ed30ee2f44d98635511011c17f0f0e986bcc9 Gerrit-Change-Number: 10013 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Thu, 19 Jul 2018 20:59:09 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 20:59:33 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Thu, 19 Jul 2018 20:59:33 +0000 Subject: Change in osmo-ci[master]: ansible: osmocom-jenkins-slave: add var install_jenkins_utilities In-Reply-To: References: Message-ID: lynxis lazus has posted comments on this change. ( https://gerrit.osmocom.org/10016 ) Change subject: ansible: osmocom-jenkins-slave: add var install_jenkins_utilities ...................................................................... Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/10016 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I72f4460b8550da191e74a44be0ee3eeb3b2d7769 Gerrit-Change-Number: 10016 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: lynxis lazus Gerrit-CC: Neels Hofmeyr Gerrit-Comment-Date: Thu, 19 Jul 2018 20:59:33 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 21:00:41 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Thu, 19 Jul 2018 21:00:41 +0000 Subject: Change in osmo-ci[master]: ansible: osmocom-jenkins-slave: add variables to the README.md In-Reply-To: References: Message-ID: lynxis lazus has submitted this change and it was merged. ( https://gerrit.osmocom.org/10013 ) Change subject: ansible: osmocom-jenkins-slave: add variables to the README.md ...................................................................... ansible: osmocom-jenkins-slave: add variables to the README.md Change-Id: I878ed30ee2f44d98635511011c17f0f0e986bcc9 --- M ansible/roles/osmocom-jenkins-slave/README.md 1 file changed, 5 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved lynxis lazus: Verified diff --git a/ansible/roles/osmocom-jenkins-slave/README.md b/ansible/roles/osmocom-jenkins-slave/README.md index e55d1be..51bf6a1 100644 --- a/ansible/roles/osmocom-jenkins-slave/README.md +++ b/ansible/roles/osmocom-jenkins-slave/README.md @@ -1,2 +1,7 @@ # Setup a usual jenkins slave +Support the following variables: + +* `generic_slave`: (true) contains tasks used by the most osmocom jenkins slaves +* `osmocom_jenkins_slave_fstrim`: (false) calls fstrim periodical +* `ttcn3_slave`: (true) install titan ttcn3 compiler and prepares the docker-playground -- To view, visit https://gerrit.osmocom.org/10013 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I878ed30ee2f44d98635511011c17f0f0e986bcc9 Gerrit-Change-Number: 10013 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 21:04:37 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Thu, 19 Jul 2018 21:04:37 +0000 Subject: Change in osmo-ci[master]: ansible: add playbook setup-simtest In-Reply-To: References: Message-ID: lynxis lazus has uploaded a new patch set (#3). ( https://gerrit.osmocom.org/10017 ) Change subject: ansible: add playbook setup-simtest ...................................................................... ansible: add playbook setup-simtest Change-Id: Iab74a2b3fc3148bce815b2dadd1fd683c4b64c44 --- M ansible/hosts A ansible/setup-simtest.yml 2 files changed, 35 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/17/10017/3 -- To view, visit https://gerrit.osmocom.org/10017 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iab74a2b3fc3148bce815b2dadd1fd683c4b64c44 Gerrit-Change-Number: 10017 Gerrit-PatchSet: 3 Gerrit-Owner: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 21:10:12 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Thu, 19 Jul 2018 21:10:12 +0000 Subject: Change in libosmocore[master]: vty: initialize termios before using it In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10032 to look at the new patch set (#2). Change subject: vty: initialize termios before using it ...................................................................... vty: initialize termios before using it valgrind complains about using unitialised bytes in syscalls. I could imagine this happens when tcgetattr fails to set termios. Change-Id: I9d165911fa3127afa8f836fa5c5c2e14a949474a --- M src/vty/vty.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/32/10032/2 -- To view, visit https://gerrit.osmocom.org/10032 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9d165911fa3127afa8f836fa5c5c2e14a949474a Gerrit-Change-Number: 10032 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 21:51:53 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Thu, 19 Jul 2018 21:51:53 +0000 Subject: Change in pysim[master]: contrib: add jenkins.sh Message-ID: lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/10069 Change subject: contrib: add jenkins.sh ...................................................................... contrib: add jenkins.sh Run the tests. Change-Id: I9308f097bf77d82e5ef78d1be551baf127726f74 --- A contrib/jenkins.sh 1 file changed, 19 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/69/10069/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh new file mode 100755 index 0000000..94da198 --- /dev/null +++ b/contrib/jenkins.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +set -e + +if [ ! -d "$HOME/pysim-testdata/" ] ; then + echo "###############################################" + echo "Please create testdata in $HOME/pysim-testdata!" + echo "###############################################" + exit 1 +fi + +virtualenv -p python2 venv --system-site-packages +. venv/bin/activate +pip install pytlv + +cp -a "$HOME/pysim-testdata/" pysim-testdata/ +cd pysim-testdata +../tests/pysim-test.sh + -- To view, visit https://gerrit.osmocom.org/10069 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I9308f097bf77d82e5ef78d1be551baf127726f74 Gerrit-Change-Number: 10069 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 21:51:54 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Thu, 19 Jul 2018 21:51:54 +0000 Subject: Change in pysim[master]: add .gitreview Message-ID: lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/10070 Change subject: add .gitreview ...................................................................... add .gitreview git review uses this file to build the git url. Change-Id: Ia35aeb33d43ace3c71689d5acbb8d1259ccb7b42 --- A .gitreview 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/70/10070/1 diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..3637d15 --- /dev/null +++ b/.gitreview @@ -0,0 +1,3 @@ +[gerrit] +host=gerrit.osmocom.org +project=pysim -- To view, visit https://gerrit.osmocom.org/10070 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ia35aeb33d43ace3c71689d5acbb8d1259ccb7b42 Gerrit-Change-Number: 10070 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 22:14:04 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Thu, 19 Jul 2018 22:14:04 +0000 Subject: Change in pysim[master]: TEST-GERRIT: COPYING Message-ID: lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/10071 Change subject: TEST-GERRIT: COPYING ...................................................................... TEST-GERRIT: COPYING Change-Id: I435c8df54908f3b2fd7ea0d2e6e3feef203ac0b2 --- M COPYING 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/71/10071/1 diff --git a/COPYING b/COPYING index d511905..cb8bc6c 100644 --- a/COPYING +++ b/COPYING @@ -337,3 +337,6 @@ consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. + + + -- To view, visit https://gerrit.osmocom.org/10071 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I435c8df54908f3b2fd7ea0d2e6e3feef203ac0b2 Gerrit-Change-Number: 10071 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 22:30:09 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Thu, 19 Jul 2018 22:30:09 +0000 Subject: Change in osmo-ci[master]: jobs: add gerrit verification for pysim In-Reply-To: References: Message-ID: lynxis lazus has posted comments on this change. ( https://gerrit.osmocom.org/10018 ) Change subject: jobs: add gerrit verification for pysim ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/10018 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I180cc4a83a41f3ef2e4b1e316ea0371cc83be654 Gerrit-Change-Number: 10018 Gerrit-PatchSet: 3 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: lynxis lazus Gerrit-CC: Harald Welte Gerrit-Comment-Date: Thu, 19 Jul 2018 22:30:09 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 22:30:46 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Thu, 19 Jul 2018 22:30:46 +0000 Subject: Change in pysim[master]: TEST-GERRIT: COPYING In-Reply-To: References: Message-ID: lynxis lazus has abandoned this change. ( https://gerrit.osmocom.org/10071 ) Change subject: TEST-GERRIT: COPYING ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/10071 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: I435c8df54908f3b2fd7ea0d2e6e3feef203ac0b2 Gerrit-Change-Number: 10071 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 23:39:48 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 23:39:48 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: add TC_mo_cc_bssmap_clear to catch OS#3062 In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/7712 to look at the new patch set (#2). Change subject: msc: add TC_mo_cc_bssmap_clear to catch OS#3062 ...................................................................... msc: add TC_mo_cc_bssmap_clear to catch OS#3062 The test currently crashes osmo-msc, which is fixed by I5c30e0f9545fb76615776ff6cc16b56aeb5b043a (osmo-msc). Related: OS#3062 Change-Id: Ic80646e1fba37bb6163ca3a7eead7980b4ad7a51 --- M msc/MSC_Tests.ttcn 1 file changed, 43 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/12/7712/2 -- To view, visit https://gerrit.osmocom.org/7712 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic80646e1fba37bb6163ca3a7eead7980b4ad7a51 Gerrit-Change-Number: 7712 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 23:39:48 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 23:39:48 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MNCC: don't delete calls, provide del signature In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/7711 to look at the new patch set (#2). Change subject: MNCC: don't delete calls, provide del signature ...................................................................... MNCC: don't delete calls, provide del signature If we receive an MNCC_REL_ind, we still may want to reply with an MNCC_REL_cnf. If the REL_ind, however, already drops the call table entry, all I get is: "MNCC Call table not found by MNCC Call ID " The call table should be cleared on each f_mncc_init(), so I guess it's fine to just not delete entries during ongoing communication. Change-Id: I73ec066744475d3cc464e34854175f8cf14cf125 --- M library/MNCC_Emulation.ttcn M msc/MSC_Tests.ttcn 2 files changed, 18 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/11/7711/2 -- To view, visit https://gerrit.osmocom.org/7711 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I73ec066744475d3cc464e34854175f8cf14cf125 Gerrit-Change-Number: 7711 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 23:40:26 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 23:40:26 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MNCC: don't delete calls, provide del signature In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/7711 ) Change subject: MNCC: don't delete calls, provide del signature ...................................................................... Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/7711/1/library/MNCC_Emulation.ttcn File library/MNCC_Emulation.ttcn: https://gerrit.osmocom.org/#/c/7711/1/library/MNCC_Emulation.ttcn at 297 PS1, Line 297: /* MNCC -> Client: Release Indication / confirmation */ looking at this again; I now notice that it is not even required to send a REL_CNF back to osmo-msc after the REL_IND. The log merely says "Received 'MNCC_REL_CNF' from MNCC with unknown callref -2147483643". So the entire reason for me to implement this was moot from the start. Even though the motivation to follow through on it is pretty much gone now, for completeness' sake: I got the signature on the procedure port implemented ok and it seems to be working. I'm a bit lost on where to call it from: at the end of every test that has "MNCC" appearing in it? Different idea: when receiving an MNCC REL_IND, should we actually reply with a REL_CNF here before we (still do) delete the call table entry automatically? (putting this patch on ice for now) -- To view, visit https://gerrit.osmocom.org/7711 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I73ec066744475d3cc464e34854175f8cf14cf125 Gerrit-Change-Number: 7711 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Thu, 19 Jul 2018 23:40:26 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 19 23:41:56 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 19 Jul 2018 23:41:56 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: add TC_mo_cc_bssmap_clear to catch OS#3062 In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/7712 ) Change subject: msc: add TC_mo_cc_bssmap_clear to catch OS#3062 ...................................................................... Patch Set 2: turns out this works fine without https://gerrit.osmocom.org/#/c/osmo-ttcn3-hacks/+/7711 if I just don't send an MNCC REL_CNF. -- To view, visit https://gerrit.osmocom.org/7712 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic80646e1fba37bb6163ca3a7eead7980b4ad7a51 Gerrit-Change-Number: 7712 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Thu, 19 Jul 2018 23:41:56 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 00:33:17 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 20 Jul 2018 00:33:17 +0000 Subject: Change in libosmocore[master]: add osmo_sockaddr_to_str_and_uint() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10068 to look at the new patch set (#3). Change subject: add osmo_sockaddr_to_str_and_uint() ...................................................................... add osmo_sockaddr_to_str_and_uint() This came from osmo-bsc refactoring patch I82e3f918295daa83274a4cf803f046979f284366 https://gerrit.osmocom.org/#/c/osmo-bsc/+/9671/6/src/osmo-bsc/gsm_data.c at 1708 Add regression test in utils_test.c. Change-Id: I1f2918418c38918c5ac70acaa51a47adfca12b5e --- M include/osmocom/core/socket.h M src/socket.c M tests/utils/utils_test.c M tests/utils/utils_test.ok 4 files changed, 148 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/68/10068/3 -- To view, visit https://gerrit.osmocom.org/10068 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1f2918418c38918c5ac70acaa51a47adfca12b5e Gerrit-Change-Number: 10068 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 00:35:06 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 20 Jul 2018 00:35:06 +0000 Subject: Change in libosmocore[master]: add osmo_sockaddr_to_str_and_uint() In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10068 ) Change subject: add osmo_sockaddr_to_str_and_uint() ...................................................................... Patch Set 3: patch set 3: rather use unsigned int than size_t: osmo_sockaddr_is_local() already uses unsigned int as addrlen, and size_t would require including , which is otherwise unrelated to socket.h. -- To view, visit https://gerrit.osmocom.org/10068 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1f2918418c38918c5ac70acaa51a47adfca12b5e Gerrit-Change-Number: 10068 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Fri, 20 Jul 2018 00:35:06 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 00:37:45 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 20 Jul 2018 00:37:45 +0000 Subject: Change in libosmocore[master]: utils_test: check stderr to catch sanitizer issues In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10067 to look at the new patch set (#3). Change subject: utils_test: check stderr to catch sanitizer issues ...................................................................... utils_test: check stderr to catch sanitizer issues Recent OS#3407 shows that we should verify stderr to catch sanitizer failures. (They might not always be ignorable like that one.) Change-Id: Ic9e437a1cc96ae081e0fd6a9b6e3156987e14c0c --- M tests/Makefile.am M tests/testsuite.at A tests/utils/utils_test.err 3 files changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/67/10067/3 -- To view, visit https://gerrit.osmocom.org/10067 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic9e437a1cc96ae081e0fd6a9b6e3156987e14c0c Gerrit-Change-Number: 10067 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 04:55:30 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Jul 2018 04:55:30 +0000 Subject: Change in osmo-bsc[master]: lcls: do not LCLS call legs with different codecs In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9940 ) Change subject: lcls: do not LCLS call legs with different codecs ...................................................................... Patch Set 1: Code-Review-1 (1 comment) looks good to me but we need to save the VTY setting. https://gerrit.osmocom.org/#/c/9940/1/src/osmo-bsc/osmo_bsc_vty.c File src/osmo-bsc/osmo_bsc_vty.c: https://gerrit.osmocom.org/#/c/9940/1/src/osmo-bsc/osmo_bsc_vty.c at 655 PS1, Line 655: "lcls-codec-mismatch (allowed|forbidden)", you're not saving this VTY setting during config_write to the file. Let's add that missing part. -- To view, visit https://gerrit.osmocom.org/9940 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I157549129a40c64364dc126f67195759e5f1d60f Gerrit-Change-Number: 9940 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Fri, 20 Jul 2018 04:55:30 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 04:56:12 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Jul 2018 04:56:12 +0000 Subject: Change in libosmocore[master]: add osmo_sockaddr_to_str_and_uint() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10068 ) Change subject: add osmo_sockaddr_to_str_and_uint() ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10068 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1f2918418c38918c5ac70acaa51a47adfca12b5e Gerrit-Change-Number: 10068 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Fri, 20 Jul 2018 04:56:12 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 04:56:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Jul 2018 04:56:44 +0000 Subject: Change in libosmocore[master]: utils_test: check stderr to catch sanitizer issues In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10067 ) Change subject: utils_test: check stderr to catch sanitizer issues ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10067 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic9e437a1cc96ae081e0fd6a9b6e3156987e14c0c Gerrit-Change-Number: 10067 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Fri, 20 Jul 2018 04:56:44 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 04:57:25 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Jul 2018 04:57:25 +0000 Subject: Change in libosmocore[master]: utils_test: fix isqrt_test calculation range In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10066 ) Change subject: utils_test: fix isqrt_test calculation range ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10066 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I83c14e38deaa466d977ee43c9420534ed90f090d Gerrit-Change-Number: 10066 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Fri, 20 Jul 2018 04:57:25 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 04:58:10 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Jul 2018 04:58:10 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: add TC_mo_cc_bssmap_clear to catch OS#3062 In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/7712 ) Change subject: msc: add TC_mo_cc_bssmap_clear to catch OS#3062 ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/7712 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic80646e1fba37bb6163ca3a7eead7980b4ad7a51 Gerrit-Change-Number: 7712 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Fri, 20 Jul 2018 04:58:10 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 04:59:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Jul 2018 04:59:15 +0000 Subject: Change in pysim[master]: contrib: add jenkins.sh In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10069 ) Change subject: contrib: add jenkins.sh ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10069 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9308f097bf77d82e5ef78d1be551baf127726f74 Gerrit-Change-Number: 10069 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Fri, 20 Jul 2018 04:59:15 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 04:59:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Jul 2018 04:59:24 +0000 Subject: Change in pysim[master]: add .gitreview In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10070 ) Change subject: add .gitreview ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10070 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia35aeb33d43ace3c71689d5acbb8d1259ccb7b42 Gerrit-Change-Number: 10070 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Fri, 20 Jul 2018 04:59:24 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 05:00:13 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Jul 2018 05:00:13 +0000 Subject: Change in osmo-ci[master]: jobs: add gerrit verification for pysim In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10018 ) Change subject: jobs: add gerrit verification for pysim ...................................................................... Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/10018 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I180cc4a83a41f3ef2e4b1e316ea0371cc83be654 Gerrit-Change-Number: 10018 Gerrit-PatchSet: 3 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Fri, 20 Jul 2018 05:00:13 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 05:00:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Jul 2018 05:00:36 +0000 Subject: Change in osmo-ci[master]: ansible: add playbook setup-simtest In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10017 ) Change subject: ansible: add playbook setup-simtest ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10017 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iab74a2b3fc3148bce815b2dadd1fd683c4b64c44 Gerrit-Change-Number: 10017 Gerrit-PatchSet: 3 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Fri, 20 Jul 2018 05:00:36 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 05:01:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Jul 2018 05:01:14 +0000 Subject: Change in osmo-ci[master]: ansible: osmocom-jenkins-slave: move installing build + runtime deps ... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10014 ) Change subject: ansible: osmocom-jenkins-slave: move installing build + runtime deps into own file ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10014 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I469a8012b124516bfd9c4d4dd3a3fe0e1ff80bb6 Gerrit-Change-Number: 10014 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Fri, 20 Jul 2018 05:01:14 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 05:01:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Jul 2018 05:01:52 +0000 Subject: Change in libosmocore[master]: vty: initialize termios before using it In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10032 ) Change subject: vty: initialize termios before using it ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10032 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9d165911fa3127afa8f836fa5c5c2e14a949474a Gerrit-Change-Number: 10032 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Fri, 20 Jul 2018 05:01:52 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 05:03:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Jul 2018 05:03:27 +0000 Subject: Change in pysim[master]: cards: Add support for Wavemobile SIM In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10047 ) Change subject: cards: Add support for Wavemobile SIM ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10047 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ida3f37bd6e3ac995812aeddc9770f1ccd54ecf3f Gerrit-Change-Number: 10047 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Fri, 20 Jul 2018 05:03:27 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 05:05:40 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 20 Jul 2018 05:05:40 +0000 Subject: Change in osmo-mgw[master]: protocol: prevent unnecessary null pointer deref In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10055 ) Change subject: protocol: prevent unnecessary null pointer deref ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/10055/1/include/osmocom/mgcp/mgcp.h File include/osmocom/mgcp/mgcp.h: https://gerrit.osmocom.org/#/c/10055/1/include/osmocom/mgcp/mgcp.h at 80 PS1, Line 80: typedef int (*mgcp_processing_setup)(struct mgcp_endpoint *endp, > Are you breaking the API with this change? Looks like it does. [?] libosmo-mgcp is only used by osmo-mgw itself. In fact, I think for sanity we should simply male it a static library and link it only statically? Also, the call-back functionality here is only used *inside* two modules of libosmo-mgcp, so not even any change to osmo-mgw in this same repository is required. -- To view, visit https://gerrit.osmocom.org/10055 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id46e9bfba88613387026639eb4957221cce6820a Gerrit-Change-Number: 10055 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Harald Welte Gerrit-Comment-Date: Fri, 20 Jul 2018 05:05:40 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 07:28:56 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 20 Jul 2018 07:28:56 +0000 Subject: Change in pysim[master]: contrib: add jenkins.sh In-Reply-To: References: Message-ID: dexter has posted comments on this change. ( https://gerrit.osmocom.org/10069 ) Change subject: contrib: add jenkins.sh ...................................................................... Patch Set 1: Code-Review+1 > Patch Set 1: Code-Review+2 Looks good to me, lets merge it and see if it works. -- To view, visit https://gerrit.osmocom.org/10069 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9308f097bf77d82e5ef78d1be551baf127726f74 Gerrit-Change-Number: 10069 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-Comment-Date: Fri, 20 Jul 2018 07:28:56 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 07:34:38 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 20 Jul 2018 07:34:38 +0000 Subject: Change in osmo-ttcn3-hacks[master]: fix TC_pdp4_act_deact_with_separate_dns In-Reply-To: References: Message-ID: dexter has posted comments on this change. ( https://gerrit.osmocom.org/10060 ) Change subject: fix TC_pdp4_act_deact_with_separate_dns ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/10060 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I109491cc9ccb060792e29bf6b2999ef48723edbf Gerrit-Change-Number: 10060 Gerrit-PatchSet: 2 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-Reviewer: dexter Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 20 Jul 2018 07:34:38 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 07:43:07 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 20 Jul 2018 07:43:07 +0000 Subject: Change in osmo-ggsn[master]: fix support for multiple IPCP in PDP protocol configuration options In-Reply-To: References: Message-ID: dexter has posted comments on this change. ( https://gerrit.osmocom.org/10061 ) Change subject: fix support for multiple IPCP in PDP protocol configuration options ...................................................................... Patch Set 2: Code-Review+1 > Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/10061 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I51ecab4e35f3ee638e68ca773b0da90cc0294ab0 Gerrit-Change-Number: 10061 Gerrit-PatchSet: 2 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: dexter Gerrit-Comment-Date: Fri, 20 Jul 2018 07:43:07 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 09:39:54 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 20 Jul 2018 09:39:54 +0000 Subject: Change in osmo-ttcn3-hacks[master]: fix TC_pdp4_act_deact_with_separate_dns In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10060 ) Change subject: fix TC_pdp4_act_deact_with_separate_dns ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10060 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I109491cc9ccb060792e29bf6b2999ef48723edbf Gerrit-Change-Number: 10060 Gerrit-PatchSet: 2 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling Gerrit-Reviewer: dexter Gerrit-Comment-Date: Fri, 20 Jul 2018 09:39:54 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 09:41:07 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 20 Jul 2018 09:41:07 +0000 Subject: Change in libosmocore[master]: libosmocoding: clarify return values for TCH decoding functions In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10049 ) Change subject: libosmocoding: clarify return values for TCH decoding functions ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/10049 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7d6c61e6a1b5d1fae26f385b420ff55246c4b62f Gerrit-Change-Number: 10049 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Fri, 20 Jul 2018 09:41:07 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 09:41:12 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 20 Jul 2018 09:41:12 +0000 Subject: Change in libosmocore[master]: libosmocoding: clarify return values for TCH decoding functions In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/10049 ) Change subject: libosmocoding: clarify return values for TCH decoding functions ...................................................................... libosmocoding: clarify return values for TCH decoding functions Change-Id: I7d6c61e6a1b5d1fae26f385b420ff55246c4b62f --- M src/coding/gsm0503_coding.c 1 file changed, 8 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Vadim Yanitskiy: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index 2eb8cba..c72aabc 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -1792,7 +1792,7 @@ * \param[in] efr Is this channel using EFR (1) or FR (0) * \param[out] n_errors Number of detected bit errors * \param[out] n_bits_total Total number of bits - * \returns length of bytes used in \a tch_data output buffer */ + * \returns length of bytes used in \a tch_data output buffer; negative on error */ int gsm0503_tch_fr_decode(uint8_t *tch_data, const sbit_t *bursts, int net_order, int efr, int *n_errors, int *n_bits_total) { @@ -1941,7 +1941,7 @@ * \param[in] odd Odd (1) or even (0) frame number * \param[out] n_errors Number of detected bit errors * \param[out] n_bits_total Total number of bits - * \returns length of bytes used in \a tch_data output buffer */ + * \returns length of bytes used in \a tch_data output buffer; negative on error */ int gsm0503_tch_hr_decode(uint8_t *tch_data, const sbit_t *bursts, int odd, int *n_errors, int *n_bits_total) { @@ -2082,7 +2082,9 @@ * \param[out] cmr Output in \a codec_mode_req = 1 * \param[out] n_errors Number of detected bit errors * \param[out] n_bits_total Total number of bits - * \returns length of bytes used in \a tch_data output buffer */ + * \returns (>=4) length of bytes used in \a tch_data output buffer; ([0,3]) + * codec out of range; negative on error + */ int gsm0503_tch_afs_decode(uint8_t *tch_data, const sbit_t *bursts, int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft, uint8_t *cmr, int *n_errors, int *n_bits_total) @@ -2459,7 +2461,9 @@ * \param[out] cmr Output in \a codec_mode_req = 1 * \param[out] n_errors Number of detected bit errors * \param[out] n_bits_total Total number of bits - * \returns length of bytes used in \a tch_data output buffer */ + * \returns (>=4) length of bytes used in \a tch_data output buffer; ([0,3]) + * codec out of range; negative on error + */ int gsm0503_tch_ahs_decode(uint8_t *tch_data, const sbit_t *bursts, int odd, int codec_mode_req, uint8_t *codec, int codecs, uint8_t *ft, uint8_t *cmr, int *n_errors, int *n_bits_total) -- To view, visit https://gerrit.osmocom.org/10049 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I7d6c61e6a1b5d1fae26f385b420ff55246c4b62f Gerrit-Change-Number: 10049 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 09:49:09 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 20 Jul 2018 09:49:09 +0000 Subject: Change in libosmocore[master]: rate_ctr: Improve logging In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9753 ) Change subject: rate_ctr: Improve logging ...................................................................... Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/9753/3//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/9753/3//COMMIT_MSG at 10 PS3, Line 10: rate_ctr groups made it difficult to debug when an issue occurrs. > can you elaborate here in the commitlog? I see what your patch is doing, but I fail to understand w [?] Most users of this API already got the naming of the counters fixed nowadays, so it's better to log the ones still requiring change instead of silently mangling them. I ended up doing this patch in order to figure out what was going on and fixing some rate_ctr API caller issues in some other project, because if I remember correctly the fact of mangling names after the hood was preventing me to understand easily what was going on and finding how to best solve the issue. So I think this patch is going to be useful for people having similar issues in the future to what I had a few weeks ago. -- To view, visit https://gerrit.osmocom.org/9753 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I992d165cab5ee6ca9b5b7e4a2210a0951954bd34 Gerrit-Change-Number: 9753 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Harald Welte Gerrit-Comment-Date: Fri, 20 Jul 2018 09:49:09 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 10:40:11 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Fri, 20 Jul 2018 10:40:11 +0000 Subject: Change in osmo-ttcn3-hacks[master]: fix TC_pdp4_act_deact_with_separate_dns In-Reply-To: References: Message-ID: Stefan Sperling has submitted this change and it was merged. ( https://gerrit.osmocom.org/10060 ) Change subject: fix TC_pdp4_act_deact_with_separate_dns ...................................................................... fix TC_pdp4_act_deact_with_separate_dns Do not delete the PDP context too early, and look for the second DNS server in the correct place (2nd match on IPCP protocol, not 1st). Update a comment which talks about a bug which has been fixed. Change-Id: I109491cc9ccb060792e29bf6b2999ef48723edbf Related: OS#3319 Related: OS#3381 --- M ggsn_tests/GGSN_Tests.ttcn 1 file changed, 2 insertions(+), 3 deletions(-) Approvals: Jenkins Builder: Verified dexter: Looks good to me, but someone else must approve Pau Espin Pedrol: Looks good to me, approved diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn index 6ae205f..3c99fd9 100644 --- a/ggsn_tests/GGSN_Tests.ttcn +++ b/ggsn_tests/GGSN_Tests.ttcn @@ -1017,11 +1017,10 @@ if (not match(pco_neg_dns, pco_neg_dns_expected)) { setverdict(fail, "Primary DNS IPv4 PCO option not found"); } - f_pdp_ctx_del(ctx, '1'B); /* Check if secondary DNS is contained */ - /* Note: this check fill fail due to a bug in osmo-ggsn, see also OS#3381 */ - pco_neg_dns := f_PCO_extract_proto(ctx.pco_neg, '8021'O, 1); + /* This used to fail due to a bug in osmo-ggsn, see OS#3381 */ + pco_neg_dns := f_PCO_extract_proto(ctx.pco_neg, '8021'O, 2); pco_neg_dns_expected := '0200000A8306'O & ggsn_ip4_dns2 if (not match(pco_neg_dns, pco_neg_dns_expected)) { setverdict(fail, "Secondary DNS IPv4 PCO option not found"); -- To view, visit https://gerrit.osmocom.org/10060 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I109491cc9ccb060792e29bf6b2999ef48723edbf Gerrit-Change-Number: 10060 Gerrit-PatchSet: 2 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 11:20:26 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Fri, 20 Jul 2018 11:20:26 +0000 Subject: Change in osmo-mgw[master]: add a VTY command which shows a specific mgcp endpoint In-Reply-To: References: Message-ID: Stefan Sperling has posted comments on this change. ( https://gerrit.osmocom.org/10022 ) Change subject: add a VTY command which shows a specific mgcp endpoint ...................................................................... Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/10022/1/src/libosmo-mgcp/mgcp_vty.c File src/libosmo-mgcp/mgcp_vty.c: https://gerrit.osmocom.org/#/c/10022/1/src/libosmo-mgcp/mgcp_vty.c at 193 PS1, Line 193: vty_out(vty, "Endpoint %s0x%.2x:%s", > not sure if we should include a 0x here (I remember there has been confusion around decimal vs hex o [?] The idea to add rtpbridge/ prefix came from pmaier. I wrote this entire change sitting next to him and we were discussing it throughout the entire process. https://gerrit.osmocom.org/#/c/10022/1/src/libosmo-mgcp/mgcp_vty.c at 256 PS1, Line 256: "Display information about an MGCP Media Gateway endpoint\n" > Common prefix with other commands, here 'show mgcp', should share similar doc strings. [?] Conceptually, a trunk contains endpoints. A trunk corresponds to a physical wire bundle which contains several cables, and each end of a cable inside this conceptual trunk corresponds to an endpoint. See RFC 3435 for more details. Issue OS#2660 is asking for a way to list endpoints., but a command which lists all trunks and their endpoints already exists ('show mgcp'). So I'm working under the assumption that this issue is asking for something which has already been implemented since the issue was filed. However, since the current implementation doesn't allow for filtering, I decided to implement a command which provides filtering of the existing output such that the state of specific endpoints can be viewed in isolation. Because any endpoint is part of a trunk, the commands currently require a trunk number in addition to an endpoint name. The tweaks to existing output which sneaked into this change are based on discussion between me and Philip. Philip helped me a lot in making sense of the media gateway in general and also the evolution of this code and its inconsistencies. We also discussed the UI of the new command together. If you are merely concerned that some design discussion involving Philip should happen, rest assured that it has already occured. If instead your intention is to take part in this design discussion yourself, I'm happy to start the discussion over from the top with you and Philip. But I also think we should not drag this out forever because this topic doesn't seem to be worth a huge deal. -- To view, visit https://gerrit.osmocom.org/10022 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5330e697ec34bf215de91d44209048a8dc226d51 Gerrit-Change-Number: 10022 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Stefan Sperling Gerrit-Comment-Date: Fri, 20 Jul 2018 11:20:26 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 11:33:58 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Fri, 20 Jul 2018 11:33:58 +0000 Subject: Change in osmo-bsc[master]: fix handling of invalid pchan names in vty In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10026 to look at the new patch set (#2). Change subject: fix handling of invalid pchan names in vty ...................................................................... fix handling of invalid pchan names in vty If an invalid phys_chan_config is specified in osmo-bsc.cfg, raise a parsing error at program startup. If an invalid phys_chan_config is specified in in the VTY while the program is running, show a warning to inform the user that the configuration change was not applied. Change-Id: I97baa359464a0e94de2497bc9214b99ed2a24041 Related: OS#1876 --- M src/osmo-bsc/bsc_vty.c 1 file changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/26/10026/2 -- To view, visit https://gerrit.osmocom.org/10026 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I97baa359464a0e94de2497bc9214b99ed2a24041 Gerrit-Change-Number: 10026 Gerrit-PatchSet: 2 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 11:39:25 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Fri, 20 Jul 2018 11:39:25 +0000 Subject: Change in libosmo-sccp[master]: sccp_demo_user: use point code 23 for server and 1 for client In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9652 to look at the new patch set (#4). Change subject: sccp_demo_user: use point code 23 for server and 1 for client ...................................................................... sccp_demo_user: use point code 23 for server and 1 for client Fix previous commit 4dc9088cabedc40cb9072814237ad5926b12bd35 which broke this by using -1 for local and 23 for remote PC, for both server and client. Change-Id: I7432e6fc2617e0fd77a098fcd7d14abc40db7229 Related: OS#2666 --- M examples/sccp_demo_user.c 1 file changed, 48 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/52/9652/4 -- To view, visit https://gerrit.osmocom.org/9652 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7432e6fc2617e0fd77a098fcd7d14abc40db7229 Gerrit-Change-Number: 9652 Gerrit-PatchSet: 4 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Stefan Sperling -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 11:41:18 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Fri, 20 Jul 2018 11:41:18 +0000 Subject: Change in libosmo-sccp[master]: remove unused -p option from getopt() call in sccp_demo_user Message-ID: Stefan Sperling has uploaded this change for review. ( https://gerrit.osmocom.org/10072 Change subject: remove unused -p option from getopt() call in sccp_demo_user ...................................................................... remove unused -p option from getopt() call in sccp_demo_user Change-Id: I31f30d8c855cb5faf3173987bfe5b36f5a585d02 Depends: I7432e6fc2617e0fd77a098fcd7d14abc40db7229 --- M examples/sccp_demo_user.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/72/10072/1 diff --git a/examples/sccp_demo_user.c b/examples/sccp_demo_user.c index 9a9d6eb..28dd166 100644 --- a/examples/sccp_demo_user.c +++ b/examples/sccp_demo_user.c @@ -169,7 +169,7 @@ int remote_pc = DEFAULT_PC_CLIENT; bool lflag = false, rflag = false, Lflag = false, Rflag = false; - while ((ch = getopt(argc, argv, "cl:r:p:L:R:")) != -1) { + while ((ch = getopt(argc, argv, "cl:r:L:R:")) != -1) { switch (ch) { case 'c': client = true; -- To view, visit https://gerrit.osmocom.org/10072 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I31f30d8c855cb5faf3173987bfe5b36f5a585d02 Gerrit-Change-Number: 10072 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 12:04:18 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 20 Jul 2018 12:04:18 +0000 Subject: Change in libosmocore[master]: libosmocodec: FR err concealment: Fix too many silent frames generated Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10073 Change subject: libosmocodec: FR err concealment: Fix too many silent frames generated ...................................................................... libosmocodec: FR err concealment: Fix too many silent frames generated As stated in its own documentation, reduce_xmaxcr_all() should only return true when ALL XMAXC fields return true. However, previous implementation returned true when at least one of them returned true. As a result, if any of the sections is silent (for instance because one of the bursts was lost), the whole frame is silenced, returning a zeroed buffer. Related: OS#2700 Fixes: 40def49ac4b8babbd1b17c232137ce50a428706b ("libosmocodec: implement ECU (Error Concealment Unit) for FR") Change-Id: I1624b7c6574f53d0593a61645d4fdc5d56cabe96 --- M src/codec/ecu_fr.c 1 file changed, 5 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/73/10073/1 diff --git a/src/codec/ecu_fr.c b/src/codec/ecu_fr.c index d4ea741..784a5b8 100644 --- a/src/codec/ecu_fr.c +++ b/src/codec/ecu_fr.c @@ -64,16 +64,12 @@ */ static bool reduce_xmaxcr_all(struct bitvec *frame_bitvec) { - bool silent = false; + bool silent = true; - if (reduce_xmaxcr(frame_bitvec, GSM610_RTP_XMAXC00)) - silent = true; - if (reduce_xmaxcr(frame_bitvec, GSM610_RTP_XMAXC10)) - silent = true; - if (reduce_xmaxcr(frame_bitvec, GSM610_RTP_XMAXC20)) - silent = true; - if (reduce_xmaxcr(frame_bitvec, GSM610_RTP_XMAXC30)) - silent = true; + silent &= reduce_xmaxcr(frame_bitvec, GSM610_RTP_XMAXC00); + silent &= reduce_xmaxcr(frame_bitvec, GSM610_RTP_XMAXC10); + silent &= reduce_xmaxcr(frame_bitvec, GSM610_RTP_XMAXC20); + silent &= reduce_xmaxcr(frame_bitvec, GSM610_RTP_XMAXC30); return silent; } -- To view, visit https://gerrit.osmocom.org/10073 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I1624b7c6574f53d0593a61645d4fdc5d56cabe96 Gerrit-Change-Number: 10073 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 12:20:41 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 20 Jul 2018 12:20:41 +0000 Subject: Change in libosmocore[master]: libosmocodec: FR err concealment: Fix too many silent frames generated In-Reply-To: References: Message-ID: dexter has posted comments on this change. ( https://gerrit.osmocom.org/10073 ) Change subject: libosmocodec: FR err concealment: Fix too many silent frames generated ...................................................................... Patch Set 1: Code-Review+1 > Build Successful > > https://jenkins.osmocom.org/jenkins/job/gerrit-libosmocore/829/ : > SUCCESS' --verified 1 --code-review 0 -- To view, visit https://gerrit.osmocom.org/10073 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1624b7c6574f53d0593a61645d4fdc5d56cabe96 Gerrit-Change-Number: 10073 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-Comment-Date: Fri, 20 Jul 2018 12:20:41 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 13:04:02 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Fri, 20 Jul 2018 13:04:02 +0000 Subject: Change in libosmocore[master]: libosmocodec: FR err concealment: Fix too many silent frames generated In-Reply-To: References: Message-ID: Stefan Sperling has posted comments on this change. ( https://gerrit.osmocom.org/10073 ) Change subject: libosmocodec: FR err concealment: Fix too many silent frames generated ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/10073 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1624b7c6574f53d0593a61645d4fdc5d56cabe96 Gerrit-Change-Number: 10073 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-Reviewer: dexter Gerrit-Comment-Date: Fri, 20 Jul 2018 13:04:02 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 14:02:21 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 20 Jul 2018 14:02:21 +0000 Subject: Change in libosmocore[master]: utils_test: fix isqrt_test calculation range In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10066 ) Change subject: utils_test: fix isqrt_test calculation range ...................................................................... utils_test: fix isqrt_test calculation range Multiplying the uint16_t x by itself seems to default to be calculated in int32_t range, while it obviously needs uint32_t. This causes sporadic sanitizer barfs: Testing integer square-root utils_test.c:445:18: runtime error: signed integer overflow: 60369 * 60369 cannot be represented in type 'int' The final result is still correct, because it is in fact interpreted as uint32_t. Cast to uint32_t to make sure the sanitizer doesn't complain. Related: OS#3407 Change-Id: I83c14e38deaa466d977ee43c9420534ed90f090d --- M tests/utils/utils_test.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/utils/utils_test.c b/tests/utils/utils_test.c index cb4e476..84964f5 100644 --- a/tests/utils/utils_test.c +++ b/tests/utils/utils_test.c @@ -439,7 +439,7 @@ x = r * (UINT16_MAX/RAND_MAX); else x = r; - uint32_t sq = x*x; + uint32_t sq = (uint32_t)x*x; uint32_t y = osmo_isqrt32(sq); if (y != x) printf("ERROR: x=%u, sq=%u, osmo_isqrt(%u) = %u\n", x, sq, sq, y); -- To view, visit https://gerrit.osmocom.org/10066 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I83c14e38deaa466d977ee43c9420534ed90f090d Gerrit-Change-Number: 10066 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 14:02:22 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 20 Jul 2018 14:02:22 +0000 Subject: Change in libosmocore[master]: utils_test: check stderr to catch sanitizer issues In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10067 ) Change subject: utils_test: check stderr to catch sanitizer issues ...................................................................... utils_test: check stderr to catch sanitizer issues Recent OS#3407 shows that we should verify stderr to catch sanitizer failures. (They might not always be ignorable like that one.) Change-Id: Ic9e437a1cc96ae081e0fd6a9b6e3156987e14c0c --- M tests/Makefile.am M tests/testsuite.at A tests/utils/utils_test.err 3 files changed, 3 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/Makefile.am b/tests/Makefile.am index db4e520..eaaa8df 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -240,7 +240,7 @@ vty/ok_tabs_and_spaces.cfg \ vty/ok_tabs.cfg \ comp128/comp128_test.ok bits/bitfield_test.ok \ - utils/utils_test.ok stats/stats_test.ok \ + utils/utils_test.ok utils/utils_test.err stats/stats_test.ok \ bitvec/bitvec_test.ok msgb/msgb_test.ok bits/bitcomp_test.ok \ sim/sim_test.ok tlv/tlv_test.ok abis/abis_test.ok \ gsup/gsup_test.ok gsup/gsup_test.err \ diff --git a/tests/testsuite.at b/tests/testsuite.at index 15a89b6..43b58e8 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -205,7 +205,8 @@ AT_SETUP([utils]) AT_KEYWORDS([utils]) cat $abs_srcdir/utils/utils_test.ok > expout -AT_CHECK([$abs_top_builddir/tests/utils/utils_test], [0], [expout], [ignore]) +cat $abs_srcdir/utils/utils_test.err > experr +AT_CHECK([$abs_top_builddir/tests/utils/utils_test], [0], [expout], [experr]) AT_CLEANUP AT_SETUP([stats]) diff --git a/tests/utils/utils_test.err b/tests/utils/utils_test.err new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/utils/utils_test.err -- To view, visit https://gerrit.osmocom.org/10067 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ic9e437a1cc96ae081e0fd6a9b6e3156987e14c0c Gerrit-Change-Number: 10067 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 14:02:22 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 20 Jul 2018 14:02:22 +0000 Subject: Change in libosmocore[master]: add osmo_sockaddr_to_str_and_uint() In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10068 ) Change subject: add osmo_sockaddr_to_str_and_uint() ...................................................................... add osmo_sockaddr_to_str_and_uint() This came from osmo-bsc refactoring patch I82e3f918295daa83274a4cf803f046979f284366 https://gerrit.osmocom.org/#/c/osmo-bsc/+/9671/6/src/osmo-bsc/gsm_data.c at 1708 Add regression test in utils_test.c. Change-Id: I1f2918418c38918c5ac70acaa51a47adfca12b5e --- M include/osmocom/core/socket.h M src/socket.c M tests/utils/utils_test.c M tests/utils/utils_test.ok 4 files changed, 148 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/socket.h b/include/osmocom/core/socket.h index 47d9f30..20515b9 100644 --- a/include/osmocom/core/socket.h +++ b/include/osmocom/core/socket.h @@ -44,6 +44,9 @@ int osmo_sockaddr_is_local(struct sockaddr *addr, unsigned int addrlen); +unsigned int osmo_sockaddr_to_str_and_uint(char *addr, unsigned int addr_len, uint16_t *port, + const struct sockaddr *sa); + int osmo_sock_unix_init(uint16_t type, uint8_t proto, const char *socket_path, unsigned int flags); diff --git a/src/socket.c b/src/socket.c index cd73f17..0405847 100644 --- a/src/socket.c +++ b/src/socket.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -553,6 +554,25 @@ return 0; } +/*! Convert sockaddr to IP address as char string and port as uint16_t. + * \param[out] addr String buffer to write IP address to, or NULL. + * \param[out] addr_len Size of \a addr. + * \param[out] port Pointer to uint16_t to write the port number to, or NULL. + * \param[in] sa Sockaddr to convert. + * \returns the required string buffer size, like osmo_strlcpy(), or 0 if \a addr is NULL. + */ +unsigned int osmo_sockaddr_to_str_and_uint(char *addr, unsigned int addr_len, uint16_t *port, + const struct sockaddr *sa) +{ + const struct sockaddr_in *sin = (const struct sockaddr_in *)sa; + + if (port) + *port = ntohs(sin->sin_port); + if (addr) + return osmo_strlcpy(addr, inet_ntoa(sin->sin_addr), addr_len); + return 0; +} + /*! Initialize a unix domain socket (including bind/connect) * \param[in] type Socket type like SOCK_DGRAM, SOCK_STREAM * \param[in] proto Protocol like IPPROTO_TCP, IPPROTO_UDP diff --git a/tests/utils/utils_test.c b/tests/utils/utils_test.c index 84964f5..a146190 100644 --- a/tests/utils/utils_test.c +++ b/tests/utils/utils_test.c @@ -24,10 +24,13 @@ #include #include +#include #include #include #include +#include +#include static void hexdump_test(void) { @@ -446,6 +449,117 @@ } } + +struct osmo_sockaddr_to_str_and_uint_test_case { + uint16_t port; + bool omit_port; + const char *addr; + unsigned int addr_len; + bool omit_addr; + unsigned int expect_rc; + const char *expect_returned_addr; +}; + +struct osmo_sockaddr_to_str_and_uint_test_case osmo_sockaddr_to_str_and_uint_test_data[] = { + { + .port = 0, + .addr = "0.0.0.0", + .addr_len = 20, + .expect_rc = 7, + }, + { + .port = 65535, + .addr = "255.255.255.255", + .addr_len = 20, + .expect_rc = 15, + }, + { + .port = 1234, + .addr = "234.23.42.123", + .addr_len = 20, + .expect_rc = 13, + }, + { + .port = 1234, + .addr = "234.23.42.123", + .addr_len = 10, + .expect_rc = 13, + .expect_returned_addr = "234.23.42", + }, + { + .port = 1234, + .omit_port = true, + .addr = "234.23.42.123", + .addr_len = 20, + .expect_rc = 13, + }, + { + .port = 1234, + .addr = "234.23.42.123", + .omit_addr = true, + .expect_rc = 0, + .expect_returned_addr = "", + }, + { + .port = 1234, + .addr = "234.23.42.123", + .addr_len = 0, + .expect_rc = 13, + .expect_returned_addr = "", + }, + { + .port = 1234, + .addr = "234.23.42.123", + .omit_port = true, + .omit_addr = true, + .expect_rc = 0, + .expect_returned_addr = "", + }, +}; + +static void osmo_sockaddr_to_str_and_uint_test(void) +{ + int i; + printf("\n%s\n", __func__); + + for (i = 0; i < ARRAY_SIZE(osmo_sockaddr_to_str_and_uint_test_data); i++) { + struct osmo_sockaddr_to_str_and_uint_test_case *t = + &osmo_sockaddr_to_str_and_uint_test_data[i]; + + struct sockaddr_in sin = { + .sin_family = AF_INET, + .sin_port = htons(t->port), + }; + inet_aton(t->addr, &sin.sin_addr); + + char addr[20] = {}; + uint16_t port = 0; + unsigned int rc; + + rc = osmo_sockaddr_to_str_and_uint( + t->omit_addr? NULL : addr, t->addr_len, + t->omit_port? NULL : &port, + (const struct sockaddr*)&sin); + + printf("[%d] %s:%u%s%s addr_len=%u --> %s:%u rc=%u\n", + i, + t->addr ? : "-", + t->port, + t->omit_addr ? " (omit addr)" : "", + t->omit_port ? " (omit port)" : "", + t->addr_len, + addr, port, rc); + if (rc != t->expect_rc) + printf("ERROR: Expected rc = %u\n", t->expect_rc); + if (!t->expect_returned_addr) + t->expect_returned_addr = t->addr; + if (strcmp(t->expect_returned_addr, addr)) + printf("ERROR: Expected addr = '%s'\n", t->expect_returned_addr); + if (!t->omit_port && port != t->port) + printf("ERROR: Expected port = %u\n", t->port); + } +} + int main(int argc, char **argv) { static const struct log_info log_info = {}; @@ -459,5 +573,6 @@ str_escape_test(); str_quote_test(); isqrt_test(); + osmo_sockaddr_to_str_and_uint_test(); return 0; } diff --git a/tests/utils/utils_test.ok b/tests/utils/utils_test.ok index ea9216f..b158bf7 100644 --- a/tests/utils/utils_test.ok +++ b/tests/utils/utils_test.ok @@ -139,3 +139,13 @@ 'NULL' Testing integer square-root + +osmo_sockaddr_to_str_and_uint_test +[0] 0.0.0.0:0 addr_len=20 --> 0.0.0.0:0 rc=7 +[1] 255.255.255.255:65535 addr_len=20 --> 255.255.255.255:65535 rc=15 +[2] 234.23.42.123:1234 addr_len=20 --> 234.23.42.123:1234 rc=13 +[3] 234.23.42.123:1234 addr_len=10 --> 234.23.42:1234 rc=13 +[4] 234.23.42.123:1234 (omit port) addr_len=20 --> 234.23.42.123:0 rc=13 +[5] 234.23.42.123:1234 (omit addr) addr_len=0 --> :1234 rc=0 +[6] 234.23.42.123:1234 addr_len=0 --> :1234 rc=13 +[7] 234.23.42.123:1234 (omit addr) (omit port) addr_len=0 --> :0 rc=0 -- To view, visit https://gerrit.osmocom.org/10068 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I1f2918418c38918c5ac70acaa51a47adfca12b5e Gerrit-Change-Number: 10068 Gerrit-PatchSet: 5 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 14:03:03 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 20 Jul 2018 14:03:03 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: add TC_mo_cc_bssmap_clear to catch OS#3062 In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/7712 ) Change subject: msc: add TC_mo_cc_bssmap_clear to catch OS#3062 ...................................................................... msc: add TC_mo_cc_bssmap_clear to catch OS#3062 The test currently crashes osmo-msc, which is fixed by I5c30e0f9545fb76615776ff6cc16b56aeb5b043a (osmo-msc). Related: OS#3062 Change-Id: Ic80646e1fba37bb6163ca3a7eead7980b4ad7a51 --- M msc/MSC_Tests.ttcn 1 file changed, 43 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index dc3ad1e..a18b9b0 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -2234,6 +2234,48 @@ vc_conn.done; } +/* BSSMAP Clear Request in the middle of a call, see OS#3062 */ +private function f_tc_mo_cc_bssmap_clear(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + f_init_handler(pars); + var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); + var MNCC_PDU mncc; + var MgcpCommand mgcp_cmd; + + f_perform_lu(); + + f_establish_fully(); + f_create_mncc_expect(hex2str(cpars.called_party)); + f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit}); + + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_SETUP(cpars.transaction_id, cpars.called_party))); + MNCC.receive(tr_MNCC_SETUP_ind(?, tr_MNCC_number(hex2str(cpars.called_party)))) -> value mncc; + cpars.mncc_callref := mncc.u.signal.callref; + log("mncc_callref=", cpars.mncc_callref); + MNCC.send(ts_MNCC_CALL_PROC_req(cpars.mncc_callref, cpars.mncc_bearer_cap)); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_CALL_PROC(cpars.transaction_id))); + + MNCC.send(ts_MNCC_ALERT_req(cpars.mncc_callref)); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_ALERTING(cpars.transaction_id))); + MGCP.receive(tr_CRCX); + + f_sleep(1.0); + BSSAP.send(ts_BSSMAP_ClearRequest(0)); + + MNCC.receive(tr_MNCC_REL_ind(?, ?)) -> value mncc; + + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + + f_sleep(1.0); +} +testcase TC_mo_cc_bssmap_clear() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_mo_cc_bssmap_clear), 43); + vc_conn.done; +} + /* TODO (SMS): * different user data lengths * SMPP transaction mode with unsuccessful delivery @@ -2320,6 +2362,7 @@ /* Run this last: at the time of writing this test crashes the MSC */ execute( TC_lu_imsi_auth_tmsi_encr_3_1_log_msc_debug() ); + execute( TC_mo_cc_bssmap_clear() ); } -- To view, visit https://gerrit.osmocom.org/7712 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ic80646e1fba37bb6163ca3a7eead7980b4ad7a51 Gerrit-Change-Number: 7712 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 14:11:46 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 20 Jul 2018 14:11:46 +0000 Subject: Change in osmo-bts[master]: sched: Log RX->RTP packet like we do in add_l1sap_header In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10053 to look at the new patch set (#2). Change subject: sched: Log RX->RTP packet like we do in add_l1sap_header ...................................................................... sched: Log RX->RTP packet like we do in add_l1sap_header Other backends use already msgb in lower layers and eventually call add_l1sap_header to push TCH data up the stack. backends using common/scheduler.c (bts-trx, bts-virt) are the only ones not yet using msgb in lower layer but only creating the msgb immediatelly before sending it in _sched_compose_tch_ind. Let's add a log message there too to have similar output in all BTS backends. Change-Id: Ia90b051f308abcd8b88b84e861da593844b0d81a --- M src/common/scheduler.c 1 file changed, 7 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/53/10053/2 -- To view, visit https://gerrit.osmocom.org/10053 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia90b051f308abcd8b88b84e861da593844b0d81a Gerrit-Change-Number: 10053 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 14:21:48 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 20 Jul 2018 14:21:48 +0000 Subject: Change in osmo-bts[master]: scheduler: Log error on fn jump Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10074 Change subject: scheduler: Log error on fn jump ...................................................................... scheduler: Log error on fn jump Change-Id: I28f01e3f7fff6f1fb52a3c593a837f4f924bb2d9 --- M src/common/scheduler.c 1 file changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/74/10074/1 diff --git a/src/common/scheduler.c b/src/common/scheduler.c index 93839a2..d3575d4 100644 --- a/src/common/scheduler.c +++ b/src/common/scheduler.c @@ -870,10 +870,13 @@ /* start counting from last fn + 1, but only if not too many fn have * been elapsed */ - if (elapsed < 10) + if (elapsed < 10) { fn = (l1ts->mf_last_fn + 1) % GSM_HYPERFRAME; - else + } else { + LOGPFN(DL1P, LOGL_NOTICE, current_fn, + "Too many continuous elapsed fn, dropping %u\n", elapsed); fn = current_fn; + } while (42) { /* get frame from multiframe */ -- To view, visit https://gerrit.osmocom.org/10074 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I28f01e3f7fff6f1fb52a3c593a837f4f924bb2d9 Gerrit-Change-Number: 10074 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 14:42:44 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 20 Jul 2018 14:42:44 +0000 Subject: Change in osmo-bts[master]: sched: Log RX->RTP packet like we do in add_l1sap_header In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10053 to look at the new patch set (#3). Change subject: sched: Log RX->RTP packet like we do in add_l1sap_header ...................................................................... sched: Log RX->RTP packet like we do in add_l1sap_header Other backends use already msgb in lower layers and eventually call add_l1sap_header to push TCH data up the stack. backends using common/scheduler.c (bts-trx, bts-virt) are the only ones not yet using msgb in lower layer but only creating the msgb immediatelly before sending it in _sched_compose_tch_ind. Let's add a log message there too to have similar output in all BTS backends. Change-Id: Ia90b051f308abcd8b88b84e861da593844b0d81a --- M src/common/scheduler.c 1 file changed, 7 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/53/10053/3 -- To view, visit https://gerrit.osmocom.org/10053 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia90b051f308abcd8b88b84e861da593844b0d81a Gerrit-Change-Number: 10053 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 14:42:44 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 20 Jul 2018 14:42:44 +0000 Subject: Change in osmo-bts[master]: scheduler: Log error on fn jump In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10074 to look at the new patch set (#2). Change subject: scheduler: Log error on fn jump ...................................................................... scheduler: Log error on fn jump Change-Id: I28f01e3f7fff6f1fb52a3c593a837f4f924bb2d9 --- M src/common/scheduler.c 1 file changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/74/10074/2 -- To view, visit https://gerrit.osmocom.org/10074 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I28f01e3f7fff6f1fb52a3c593a837f4f924bb2d9 Gerrit-Change-Number: 10074 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 14:42:46 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 20 Jul 2018 14:42:46 +0000 Subject: Change in osmo-bts[master]: trx: scheduler: Keep RTP clock up to date while in DTXu pause Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10075 Change subject: trx: scheduler: Keep RTP clock up to date while in DTXu pause ...................................................................... trx: scheduler: Keep RTP clock up to date while in DTXu pause Upper layer requires us to trigger all events coming from lower layers in order to keep the RTP clock in sync. In this case, this is done by sending an empty payload to indicate there's no data to send. Change-Id: I0bdfb529f35253ca7e531bb9984a3839c3bfe7e8 --- M src/osmo-bts-trx/scheduler_trx.c 1 file changed, 12 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/75/10075/1 diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index 11c5c4e..a22b53f 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -1077,8 +1077,11 @@ /* indicate bad frame */ switch (tch_mode) { case GSM48_CMODE_SPEECH_V1: /* FR */ - if (lchan->tch.dtx.ul_sid) - return 0; /* DTXu: pause in progress */ + if (lchan->tch.dtx.ul_sid) { + /* DTXu: pause in progress. Push empty payload to upper layers */ + rc = 0; + goto compose_l1sap; + } /* Perform error concealment if possible */ rc = osmo_ecu_fr_conceal(&lchan->ecu_state.fr, tch_data); @@ -1119,6 +1122,7 @@ osmo_ecu_fr_reset(&lchan->ecu_state.fr, tch_data); /* TCH or BFI */ +compose_l1sap: return _sched_compose_tch_ind(l1t, tn, (fn + GSM_HYPERFRAME - 7) % GSM_HYPERFRAME, chan, tch_data, rc); } @@ -1265,8 +1269,11 @@ /* indicate bad frame */ switch (tch_mode) { case GSM48_CMODE_SPEECH_V1: /* HR */ - if (lchan->tch.dtx.ul_sid) - return 0; /* DTXu: pause in progress */ + if (lchan->tch.dtx.ul_sid) { + /* DTXu: pause in progress. Push empty payload to upper layers */ + rc = 0; + goto compose_l1sap; + } tch_data[0] = 0x70; /* F = 0, FT = 111 */ memset(tch_data + 1, 0, 14); rc = 15; @@ -1291,6 +1298,7 @@ if (rsl_cmode != RSL_CMOD_SPD_SPEECH) return 0; +compose_l1sap: /* TCH or BFI */ /* Note on FN 19 or 20: If we received the last burst of a frame, * it actually starts at FN 8 or 9. A burst starting there, overlaps -- To view, visit https://gerrit.osmocom.org/10075 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I0bdfb529f35253ca7e531bb9984a3839c3bfe7e8 Gerrit-Change-Number: 10075 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 15:18:18 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 20 Jul 2018 15:18:18 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MGCP_Test: Make sure PT in RTP-Stream and MGCP match up Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/10076 Change subject: MGCP_Test: Make sure PT in RTP-Stream and MGCP match up ...................................................................... MGCP_Test: Make sure PT in RTP-Stream and MGCP match up At the moment the RTP stream emulation is left in its default configuration, this means that the payload type that appears in the RTP stream is always 0. This may mismatch the payload type that is configured with MGCP. If nothing else is set, we should make sure that whan we create and modify flows, the RTP emulation is always reconfigured to use the payload-type that we set in the flow parameters. The other rtp-emulation parameters should be set to their defaults. - Make sure f_flow_modify and f_flow_create set the rtp flow parameters properly. Change-Id: Ie888424ac3e0bf0d960b6f071855b6dd43935a0e Related:OS#3384 --- M mgw/MGCP_Test.ttcn 1 file changed, 21 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/76/10076/1 diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn index d816a71..659d5f1 100644 --- a/mgw/MGCP_Test.ttcn +++ b/mgw/MGCP_Test.ttcn @@ -58,6 +58,7 @@ private function f_init(template MgcpEndpoint ep := omit) runs on dummy_CT { var Result res; var uint32_t ssrc; + if (initialized == false) { initialized := true; @@ -243,7 +244,8 @@ HostPort mgw, /* mgw side */ uint7_t pt, charstring codec, - MgcpConnectionId mgcp_conn_id optional + MgcpConnectionId mgcp_conn_id optional, + RtpemConfig rtp_cfg optional } /* Create an RTP flow (bidirectional, or receive-only) */ @@ -256,6 +258,15 @@ /* bind local RTP emulation socket */ f_rtpem_bind(pt, flow.em.hostname, flow.em.portnr); + /* configure rtp-emulation */ + if (ispresent(flow.rtp_cfg)) { + f_rtpem_configure(pt, flow.rtp_cfg); + } else { + var RtpemConfig rtp_cfg := c_RtpemDefaultCfg; + rtp_cfg.tx_payload_type := flow.pt + f_rtpem_configure(pt, rtp_cfg); + } + if (one_phase) { /* Connect flow to MGW using a CRCX that also contains an SDP * part that tells the MGW where we are listening for RTP streams @@ -299,6 +310,15 @@ /* rebind local RTP emulation socket to the new address */ f_rtpem_bind(pt, flow.em.hostname, flow.em.portnr); + /* reconfigure rtp-emulation */ + if (ispresent(flow.rtp_cfg)) { + f_rtpem_configure(pt, flow.rtp_cfg); + } else { + var RtpemConfig rtp_cfg := c_RtpemDefaultCfg; + rtp_cfg.tx_payload_type := flow.pt + f_rtpem_configure(pt, rtp_cfg); + } + /* connect MGW side RTP socket to the emulation-side RTP socket using SDP */ cmd := ts_MDCX(get_next_trans_id(), ep, mode, call_id, flow.mgcp_conn_id); cmd.sdp := ts_SDP(flow.em.hostname, flow.em.hostname, "23", "42", -- To view, visit https://gerrit.osmocom.org/10076 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ie888424ac3e0bf0d960b6f071855b6dd43935a0e Gerrit-Change-Number: 10076 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 15:26:15 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 20 Jul 2018 15:26:15 +0000 Subject: Change in libosmocore[master]: libosmocodec: FR err concealment: Fix too many silent frames generated In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/10073 ) Change subject: libosmocodec: FR err concealment: Fix too many silent frames generated ...................................................................... Patch Set 1: Code-Review+1 You have fixed this, but the test results didn't even change... Looks like this part of code is out of the unit test coverage. May we cover this part somehow? -- To view, visit https://gerrit.osmocom.org/10073 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1624b7c6574f53d0593a61645d4fdc5d56cabe96 Gerrit-Change-Number: 10073 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: dexter Gerrit-Comment-Date: Fri, 20 Jul 2018 15:26:15 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 17:18:53 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 20 Jul 2018 17:18:53 +0000 Subject: Change in osmocom-bb[master]: trx_toolkit/trx_sniff.py: fix memleak: don't store packets Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/10077 Change subject: trx_toolkit/trx_sniff.py: fix memleak: don't store packets ...................................................................... trx_toolkit/trx_sniff.py: fix memleak: don't store packets The Scapy itself was the actual cause of continuously growing memory consumption. It was configured to store the captured packets, what isn't required for this tool. Change-Id: I0c6d9b76398e148b7febd94aa37aa2fa22d19b3f --- M src/target/trx_toolkit/trx_sniff.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/77/10077/1 diff --git a/src/target/trx_toolkit/trx_sniff.py b/src/target/trx_toolkit/trx_sniff.py index 577e6f9..535bb3f 100755 --- a/src/target/trx_toolkit/trx_sniff.py +++ b/src/target/trx_toolkit/trx_sniff.py @@ -79,7 +79,7 @@ print("[i] Listening on interface '%s'..." % self.sniff_interface) # Start sniffing... - scapy.all.sniff(iface = self.sniff_interface, store = 1, + scapy.all.sniff(iface = self.sniff_interface, store = 0, filter = pkt_filter, prn = self.pkt_handler) # Scapy registers its own signal handler -- To view, visit https://gerrit.osmocom.org/10077 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I0c6d9b76398e148b7febd94aa37aa2fa22d19b3f Gerrit-Change-Number: 10077 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 17:18:53 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 20 Jul 2018 17:18:53 +0000 Subject: Change in libosmocore[master]: tests: codec: ecu_fr: Print XMAXC fields Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10078 Change subject: tests: codec: ecu_fr: Print XMAXC fields ...................................................................... tests: codec: ecu_fr: Print XMAXC fields This makes it easy to debug how XMAXC fields are decreased every iteration in osmo_ecu_fr_conceal(). Change-Id: I678d4be5e0b15b05873b0d3bf5ea5bbee7bef839 --- M tests/codec/codec_ecu_fr_test.c M tests/codec/codec_ecu_fr_test.ok 2 files changed, 54 insertions(+), 25 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/78/10078/1 diff --git a/tests/codec/codec_ecu_fr_test.c b/tests/codec/codec_ecu_fr_test.c index 0fdc489..3a99fc7 100644 --- a/tests/codec/codec_ecu_fr_test.c +++ b/tests/codec/codec_ecu_fr_test.c @@ -1,12 +1,14 @@ #include #include #include +#include #include #include #include #include +#include /* Set with sample full-rate voice frames and some intentional dropouts */ static const char *fr_frames_hex[] = { @@ -74,6 +76,28 @@ static const char *sample_frame_hex = \ "d9ec9be212901f802335598c501f805bad3d4ba01f809b69df5a501f809cd1b4da"; +#define GSM610_XMAXC_LEN 6 +static void parse_xmaxc_frame(uint8_t *frame, uint64_t xmaxc_res[4]) +{ + unsigned int field_index, len; + + struct bitvec *frame_bitvec = bitvec_alloc(GSM_FR_BYTES, NULL); + OSMO_ASSERT(frame_bitvec); + len = bitvec_unpack(frame_bitvec, frame); + OSMO_ASSERT(len == GSM_FR_BYTES); + + field_index = GSM610_RTP_XMAXC00; + xmaxc_res[0] = bitvec_read_field(frame_bitvec, &field_index, GSM610_XMAXC_LEN); + field_index = GSM610_RTP_XMAXC10; + xmaxc_res[1] = bitvec_read_field(frame_bitvec, &field_index, GSM610_XMAXC_LEN); + field_index = GSM610_RTP_XMAXC20; + xmaxc_res[2] = bitvec_read_field(frame_bitvec, &field_index, GSM610_XMAXC_LEN); + field_index = GSM610_RTP_XMAXC30; + xmaxc_res[3] = bitvec_read_field(frame_bitvec, &field_index, GSM610_XMAXC_LEN); + + bitvec_free(frame_bitvec); +} + /** * Start with a good voice frame and then simulate 20 consecutive bad frames, * watching how the error concealment decreases the XMAXC parameters. @@ -82,23 +106,28 @@ { struct osmo_ecu_fr_state state; uint8_t frame[GSM_FR_BYTES]; + uint64_t xmaxc[4]; int i, rc; /* Parse frame from string to hex */ osmo_hexparse(sample_frame_hex, frame, GSM_FR_BYTES); - - printf("Start with: %s\n", sample_frame_hex); + parse_xmaxc_frame(frame, xmaxc); + printf("Start with: %s, XMAXC: [%"PRIx64", %"PRIx64", %"PRIx64", %"PRIx64"]\n", + sample_frame_hex, xmaxc[0], xmaxc[1], xmaxc[2], xmaxc[3]); /* Reset the ECU with the proposed known good frame */ osmo_ecu_fr_reset(&state, frame); /* Now pretend that we do not receive any good frames anymore */ for (i = 0; i < 20; i++) { + rc = osmo_ecu_fr_conceal(&state, frame); OSMO_ASSERT(rc == 0); + parse_xmaxc_frame(frame, xmaxc); - printf("conceal: %02i, result: %s\n", - i, osmo_hexdump_nospc(frame, GSM_FR_BYTES)); + printf("conceal: %02i, result: %s XMAXC: [%"PRIx64", %"PRIx64", %"PRIx64", %"PRIx64"]\n", + i, osmo_hexdump_nospc(frame, GSM_FR_BYTES), + xmaxc[0], xmaxc[1], xmaxc[2], xmaxc[3]); } } diff --git a/tests/codec/codec_ecu_fr_test.ok b/tests/codec/codec_ecu_fr_test.ok index 6e20099..52d06a1 100644 --- a/tests/codec/codec_ecu_fr_test.ok +++ b/tests/codec/codec_ecu_fr_test.ok @@ -1,24 +1,24 @@ -Start with: d9ec9be212901f802335598c501f805bad3d4ba01f809b69df5a501f809cd1b4da -conceal: 00, result: d9ec9be212901f802335598c501f805bad3d4ba01f809b69df5a501f809cd1b4da -conceal: 01, result: d9ec9be212901d802335598c501d805bad3d4ba01d809b69df5a501d809cd1b4da -conceal: 02, result: d9ec9be212901b802335598c501b805bad3d4ba01b809b69df5a501b809cd1b4da -conceal: 03, result: d9ec9be2129019802335598c5019805bad3d4ba019809b69df5a5019809cd1b4da -conceal: 04, result: d9ec9be2129017802335598c5017805bad3d4ba017809b69df5a5017809cd1b4da -conceal: 05, result: d9ec9be2129015802335598c5015805bad3d4ba015809b69df5a5015809cd1b4da -conceal: 06, result: d9ec9be2129013802335598c5013805bad3d4ba013809b69df5a5013809cd1b4da -conceal: 07, result: d9ec9be2129011802335598c5011805bad3d4ba011809b69df5a5011809cd1b4da -conceal: 08, result: d9ec9be212900f802335598c500f805bad3d4ba00f809b69df5a500f809cd1b4da -conceal: 09, result: d9ec9be212900d802335598c500d805bad3d4ba00d809b69df5a500d809cd1b4da -conceal: 10, result: d9ec9be212900b802335598c500b805bad3d4ba00b809b69df5a500b809cd1b4da -conceal: 11, result: d9ec9be2129009802335598c5009805bad3d4ba009809b69df5a5009809cd1b4da -conceal: 12, result: d9ec9be2129007802335598c5007805bad3d4ba007809b69df5a5007809cd1b4da -conceal: 13, result: d9ec9be2129005802335598c5005805bad3d4ba005809b69df5a5005809cd1b4da -conceal: 14, result: d9ec9be2129003802335598c5003805bad3d4ba003809b69df5a5003809cd1b4da -conceal: 15, result: d9ec9be2129001802335598c5001805bad3d4ba001809b69df5a5001809cd1b4da -conceal: 16, result: d00000000000000000000000000000000000000000000000000000000000000000 -conceal: 17, result: d00000000000000000000000000000000000000000000000000000000000000000 -conceal: 18, result: d00000000000000000000000000000000000000000000000000000000000000000 -conceal: 19, result: d00000000000000000000000000000000000000000000000000000000000000000 +Start with: d9ec9be212901f802335598c501f805bad3d4ba01f809b69df5a501f809cd1b4da, XMAXC: [3f, 3f, 3f, 3f] +conceal: 00, result: d9ec9be212901f802335598c501f805bad3d4ba01f809b69df5a501f809cd1b4da XMAXC: [3f, 3f, 3f, 3f] +conceal: 01, result: d9ec9be212901d802335598c501d805bad3d4ba01d809b69df5a501d809cd1b4da XMAXC: [3b, 3b, 3b, 3b] +conceal: 02, result: d9ec9be212901b802335598c501b805bad3d4ba01b809b69df5a501b809cd1b4da XMAXC: [37, 37, 37, 37] +conceal: 03, result: d9ec9be2129019802335598c5019805bad3d4ba019809b69df5a5019809cd1b4da XMAXC: [33, 33, 33, 33] +conceal: 04, result: d9ec9be2129017802335598c5017805bad3d4ba017809b69df5a5017809cd1b4da XMAXC: [2f, 2f, 2f, 2f] +conceal: 05, result: d9ec9be2129015802335598c5015805bad3d4ba015809b69df5a5015809cd1b4da XMAXC: [2b, 2b, 2b, 2b] +conceal: 06, result: d9ec9be2129013802335598c5013805bad3d4ba013809b69df5a5013809cd1b4da XMAXC: [27, 27, 27, 27] +conceal: 07, result: d9ec9be2129011802335598c5011805bad3d4ba011809b69df5a5011809cd1b4da XMAXC: [23, 23, 23, 23] +conceal: 08, result: d9ec9be212900f802335598c500f805bad3d4ba00f809b69df5a500f809cd1b4da XMAXC: [1f, 1f, 1f, 1f] +conceal: 09, result: d9ec9be212900d802335598c500d805bad3d4ba00d809b69df5a500d809cd1b4da XMAXC: [1b, 1b, 1b, 1b] +conceal: 10, result: d9ec9be212900b802335598c500b805bad3d4ba00b809b69df5a500b809cd1b4da XMAXC: [17, 17, 17, 17] +conceal: 11, result: d9ec9be2129009802335598c5009805bad3d4ba009809b69df5a5009809cd1b4da XMAXC: [13, 13, 13, 13] +conceal: 12, result: d9ec9be2129007802335598c5007805bad3d4ba007809b69df5a5007809cd1b4da XMAXC: [f, f, f, f] +conceal: 13, result: d9ec9be2129005802335598c5005805bad3d4ba005809b69df5a5005809cd1b4da XMAXC: [b, b, b, b] +conceal: 14, result: d9ec9be2129003802335598c5003805bad3d4ba003809b69df5a5003809cd1b4da XMAXC: [7, 7, 7, 7] +conceal: 15, result: d9ec9be2129001802335598c5001805bad3d4ba001809b69df5a5001809cd1b4da XMAXC: [3, 3, 3, 3] +conceal: 16, result: d00000000000000000000000000000000000000000000000000000000000000000 XMAXC: [0, 0, 0, 0] +conceal: 17, result: d00000000000000000000000000000000000000000000000000000000000000000 XMAXC: [0, 0, 0, 0] +conceal: 18, result: d00000000000000000000000000000000000000000000000000000000000000000 XMAXC: [0, 0, 0, 0] +conceal: 19, result: d00000000000000000000000000000000000000000000000000000000000000000 XMAXC: [0, 0, 0, 0] Frame No. 000: * input: d9aa93ae63de00471a91b95b8660471392b4a2daa037628f391c624039258dc723 * output: d9aa93ae63de00471a91b95b8660471392b4a2daa037628f391c624039258dc723 -- To view, visit https://gerrit.osmocom.org/10078 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I678d4be5e0b15b05873b0d3bf5ea5bbee7bef839 Gerrit-Change-Number: 10078 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 17:18:54 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 20 Jul 2018 17:18:54 +0000 Subject: Change in libosmocore[master]: tests: codec: ecu_fr: Add buffer with unequal XMAXC values Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10079 Change subject: tests: codec: ecu_fr: Add buffer with unequal XMAXC values ...................................................................... tests: codec: ecu_fr: Add buffer with unequal XMAXC values This buffer verifies that all XMAXC fields must be zero before the entire buffer is considered as silent by osmo_ecu_fr_conceal(). Change-Id: I14a192d001b5e167437cedbe76a1a3dd84dde35c --- M tests/codec/codec_ecu_fr_test.c M tests/codec/codec_ecu_fr_test.ok 2 files changed, 49 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/79/10079/1 diff --git a/tests/codec/codec_ecu_fr_test.c b/tests/codec/codec_ecu_fr_test.c index 3a99fc7..3561c44 100644 --- a/tests/codec/codec_ecu_fr_test.c +++ b/tests/codec/codec_ecu_fr_test.c @@ -73,8 +73,11 @@ }; /* Example of a good frame */ -static const char *sample_frame_hex = \ - "d9ec9be212901f802335598c501f805bad3d4ba01f809b69df5a501f809cd1b4da"; +static const char *sample_frame_hex[] = { + "d9ec9be212901f802335598c501f805bad3d4ba01f809b69df5a501f809cd1b4da", + "d9ec9be212901d802335598c5013805bad3d4ba01f809b69df5a5019809cd1b4da", + NULL +}; #define GSM610_XMAXC_LEN 6 static void parse_xmaxc_frame(uint8_t *frame, uint64_t xmaxc_res[4]) @@ -108,26 +111,32 @@ uint8_t frame[GSM_FR_BYTES]; uint64_t xmaxc[4]; int i, rc; + int j = 0; - /* Parse frame from string to hex */ - osmo_hexparse(sample_frame_hex, frame, GSM_FR_BYTES); - parse_xmaxc_frame(frame, xmaxc); - printf("Start with: %s, XMAXC: [%"PRIx64", %"PRIx64", %"PRIx64", %"PRIx64"]\n", - sample_frame_hex, xmaxc[0], xmaxc[1], xmaxc[2], xmaxc[3]); - - /* Reset the ECU with the proposed known good frame */ - osmo_ecu_fr_reset(&state, frame); - - /* Now pretend that we do not receive any good frames anymore */ - for (i = 0; i < 20; i++) { - - rc = osmo_ecu_fr_conceal(&state, frame); - OSMO_ASSERT(rc == 0); + while (sample_frame_hex[j] != NULL) { + /* Parse frame from string to hex */ + osmo_hexparse(sample_frame_hex[j], frame, GSM_FR_BYTES); parse_xmaxc_frame(frame, xmaxc); + printf("Start with: %s, XMAXC: [%"PRIx64", %"PRIx64", %"PRIx64", %"PRIx64"]\n", + sample_frame_hex[j], xmaxc[0], xmaxc[1], xmaxc[2], xmaxc[3]); - printf("conceal: %02i, result: %s XMAXC: [%"PRIx64", %"PRIx64", %"PRIx64", %"PRIx64"]\n", - i, osmo_hexdump_nospc(frame, GSM_FR_BYTES), - xmaxc[0], xmaxc[1], xmaxc[2], xmaxc[3]); + /* Reset the ECU with the proposed known good frame */ + osmo_ecu_fr_reset(&state, frame); + + /* Now pretend that we do not receive any good frames anymore */ + for (i = 0; i < 20; i++) { + + rc = osmo_ecu_fr_conceal(&state, frame); + OSMO_ASSERT(rc == 0); + parse_xmaxc_frame(frame, xmaxc); + + printf("conceal: %02i, result: %s XMAXC: [%"PRIx64", %"PRIx64", %"PRIx64", %"PRIx64"]\n", + i, osmo_hexdump_nospc(frame, GSM_FR_BYTES), + xmaxc[0], xmaxc[1], xmaxc[2], xmaxc[3]); + } + + /* Go to the next frame */ + j++; } } diff --git a/tests/codec/codec_ecu_fr_test.ok b/tests/codec/codec_ecu_fr_test.ok index 52d06a1..3cc35af 100644 --- a/tests/codec/codec_ecu_fr_test.ok +++ b/tests/codec/codec_ecu_fr_test.ok @@ -19,6 +19,27 @@ conceal: 17, result: d00000000000000000000000000000000000000000000000000000000000000000 XMAXC: [0, 0, 0, 0] conceal: 18, result: d00000000000000000000000000000000000000000000000000000000000000000 XMAXC: [0, 0, 0, 0] conceal: 19, result: d00000000000000000000000000000000000000000000000000000000000000000 XMAXC: [0, 0, 0, 0] +Start with: d9ec9be212901d802335598c5013805bad3d4ba01f809b69df5a5019809cd1b4da, XMAXC: [3b, 27, 3f, 33] +conceal: 00, result: d9ec9be212901d802335598c5013805bad3d4ba01f809b69df5a5019809cd1b4da XMAXC: [3b, 27, 3f, 33] +conceal: 01, result: d9ec9be212901b802335598c5011805bad3d4ba01d809b69df5a5017809cd1b4da XMAXC: [37, 23, 3b, 2f] +conceal: 02, result: d9ec9be2129019802335598c500f805bad3d4ba01b809b69df5a5015809cd1b4da XMAXC: [33, 1f, 37, 2b] +conceal: 03, result: d9ec9be2129017802335598c500d805bad3d4ba019809b69df5a5013809cd1b4da XMAXC: [2f, 1b, 33, 27] +conceal: 04, result: d9ec9be2129015802335598c500b805bad3d4ba017809b69df5a5011809cd1b4da XMAXC: [2b, 17, 2f, 23] +conceal: 05, result: d9ec9be2129013802335598c5009805bad3d4ba015809b69df5a500f809cd1b4da XMAXC: [27, 13, 2b, 1f] +conceal: 06, result: d9ec9be2129011802335598c5007805bad3d4ba013809b69df5a500d809cd1b4da XMAXC: [23, f, 27, 1b] +conceal: 07, result: d9ec9be212900f802335598c5005805bad3d4ba011809b69df5a500b809cd1b4da XMAXC: [1f, b, 23, 17] +conceal: 08, result: d9ec9be212900d802335598c5003805bad3d4ba00f809b69df5a5009809cd1b4da XMAXC: [1b, 7, 1f, 13] +conceal: 09, result: d9ec9be212900b802335598c5001805bad3d4ba00d809b69df5a5007809cd1b4da XMAXC: [17, 3, 1b, f] +conceal: 10, result: d9ec9be2129009802335598c5000005bad3d4ba00b809b69df5a5005809cd1b4da XMAXC: [13, 0, 17, b] +conceal: 11, result: d9ec9be2129007802335598c5000005bad3d4ba009809b69df5a5003809cd1b4da XMAXC: [f, 0, 13, 7] +conceal: 12, result: d9ec9be2129005802335598c5000005bad3d4ba007809b69df5a5001809cd1b4da XMAXC: [b, 0, f, 3] +conceal: 13, result: d9ec9be2129003802335598c5000005bad3d4ba005809b69df5a5000009cd1b4da XMAXC: [7, 0, b, 0] +conceal: 14, result: d9ec9be2129001802335598c5000005bad3d4ba003809b69df5a5000009cd1b4da XMAXC: [3, 0, 7, 0] +conceal: 15, result: d9ec9be2129000002335598c5000005bad3d4ba001809b69df5a5000009cd1b4da XMAXC: [0, 0, 3, 0] +conceal: 16, result: d00000000000000000000000000000000000000000000000000000000000000000 XMAXC: [0, 0, 0, 0] +conceal: 17, result: d00000000000000000000000000000000000000000000000000000000000000000 XMAXC: [0, 0, 0, 0] +conceal: 18, result: d00000000000000000000000000000000000000000000000000000000000000000 XMAXC: [0, 0, 0, 0] +conceal: 19, result: d00000000000000000000000000000000000000000000000000000000000000000 XMAXC: [0, 0, 0, 0] Frame No. 000: * input: d9aa93ae63de00471a91b95b8660471392b4a2daa037628f391c624039258dc723 * output: d9aa93ae63de00471a91b95b8660471392b4a2daa037628f391c624039258dc723 -- To view, visit https://gerrit.osmocom.org/10079 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I14a192d001b5e167437cedbe76a1a3dd84dde35c Gerrit-Change-Number: 10079 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 19:07:28 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Fri, 20 Jul 2018 19:07:28 +0000 Subject: Change in pysim[master]: add .gitreview In-Reply-To: References: Message-ID: lynxis lazus has posted comments on this change. ( https://gerrit.osmocom.org/10070 ) Change subject: add .gitreview ...................................................................... Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/10070 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia35aeb33d43ace3c71689d5acbb8d1259ccb7b42 Gerrit-Change-Number: 10070 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Fri, 20 Jul 2018 19:07:28 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 19:07:50 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Fri, 20 Jul 2018 19:07:50 +0000 Subject: Change in pysim[master]: contrib: add jenkins.sh In-Reply-To: References: Message-ID: lynxis lazus has submitted this change and it was merged. ( https://gerrit.osmocom.org/10069 ) Change subject: contrib: add jenkins.sh ...................................................................... contrib: add jenkins.sh Run the tests. Change-Id: I9308f097bf77d82e5ef78d1be551baf127726f74 --- A contrib/jenkins.sh 1 file changed, 19 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved dexter: Looks good to me, but someone else must approve diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh new file mode 100755 index 0000000..94da198 --- /dev/null +++ b/contrib/jenkins.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +set -e + +if [ ! -d "$HOME/pysim-testdata/" ] ; then + echo "###############################################" + echo "Please create testdata in $HOME/pysim-testdata!" + echo "###############################################" + exit 1 +fi + +virtualenv -p python2 venv --system-site-packages +. venv/bin/activate +pip install pytlv + +cp -a "$HOME/pysim-testdata/" pysim-testdata/ +cd pysim-testdata +../tests/pysim-test.sh + -- To view, visit https://gerrit.osmocom.org/10069 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I9308f097bf77d82e5ef78d1be551baf127726f74 Gerrit-Change-Number: 10069 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-Reviewer: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 19:07:53 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Fri, 20 Jul 2018 19:07:53 +0000 Subject: Change in pysim[master]: add .gitreview In-Reply-To: References: Message-ID: lynxis lazus has submitted this change and it was merged. ( https://gerrit.osmocom.org/10070 ) Change subject: add .gitreview ...................................................................... add .gitreview git review uses this file to build the git url. Change-Id: Ia35aeb33d43ace3c71689d5acbb8d1259ccb7b42 --- A .gitreview 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved lynxis lazus: Verified diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..3637d15 --- /dev/null +++ b/.gitreview @@ -0,0 +1,3 @@ +[gerrit] +host=gerrit.osmocom.org +project=pysim -- To view, visit https://gerrit.osmocom.org/10070 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ia35aeb33d43ace3c71689d5acbb8d1259ccb7b42 Gerrit-Change-Number: 10070 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 20:30:31 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 20 Jul 2018 20:30:31 +0000 Subject: Change in libosmocore[master]: tests: codec: ecu_fr: Print XMAXC fields In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/10078 ) Change subject: tests: codec: ecu_fr: Print XMAXC fields ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/10078 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I678d4be5e0b15b05873b0d3bf5ea5bbee7bef839 Gerrit-Change-Number: 10078 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Fri, 20 Jul 2018 20:30:31 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 20:31:32 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 20 Jul 2018 20:31:32 +0000 Subject: Change in libosmocore[master]: tests: codec: ecu_fr: Add buffer with unequal XMAXC values In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/10079 ) Change subject: tests: codec: ecu_fr: Add buffer with unequal XMAXC values ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/10079 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I14a192d001b5e167437cedbe76a1a3dd84dde35c Gerrit-Change-Number: 10079 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Fri, 20 Jul 2018 20:31:32 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 20 20:40:50 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Fri, 20 Jul 2018 20:40:50 +0000 Subject: Change in libosmocore[master]: vty: initialize termios before using it In-Reply-To: References: Message-ID: lynxis lazus has submitted this change and it was merged. ( https://gerrit.osmocom.org/10032 ) Change subject: vty: initialize termios before using it ...................................................................... vty: initialize termios before using it valgrind complains about using unitialised bytes in syscalls. I could imagine this happens when tcgetattr fails to set termios. Change-Id: I9d165911fa3127afa8f836fa5c5c2e14a949474a --- M src/vty/vty.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/vty/vty.c b/src/vty/vty.c index 08258e7..6ca7a15 100644 --- a/src/vty/vty.c +++ b/src/vty/vty.c @@ -1506,7 +1506,7 @@ { struct vty *vty; - struct termios t; + struct termios t = {}; tcgetattr(vty_sock, &t); cfmakeraw(&t); -- To view, visit https://gerrit.osmocom.org/10032 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I9d165911fa3127afa8f836fa5c5c2e14a949474a Gerrit-Change-Number: 10032 Gerrit-PatchSet: 3 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From admin at opensuse.org Sat Jul 21 03:56:41 2018 From: admin at opensuse.org (OBS Notification) Date: Sat, 21 Jul 2018 03:56:41 +0000 Subject: Build failure of network:osmocom:nightly/libasn1c in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <5b52af089f51_2828fb26884596f1@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libasn1c/xUbuntu_16.04/i586 Package network:osmocom:nightly/libasn1c failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly libasn1c Last lines of build log: [ 26s] [108/190] installing libglib2.0-0-2.48.0-1ubuntu4 [ 26s] No schema files found: doing nothing. [ 26s] Processing triggers for libc-bin (2.23-0ubuntu3) ... [ 26s] [109/190] installing libgssapi-krb5-2-1.13.2+dfsg-5 [ 26s] Processing triggers for libc-bin (2.23-0ubuntu3) ... [ 26s] [110/190] installing libsystemd0-229-4ubuntu4 [ 26s] Processing triggers for libc-bin (2.23-0ubuntu3) ... [ 26s] [111/190] installing cpp-5-5.3.1-14ubuntu2 [ 27s] [112/190] installing libsemanage1-2.3-1build3 [ 27s] Processing triggers for libc-bin (2.23-0ubuntu3) ... [ 27s] [113/190] installing vim-2:7.4.1689-3ubuntu1 [ 27s] update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vim (vim) in auto mode [ 27s] update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vimdiff (vimdiff) in auto mode [ 27s] update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rvim (rvim) in auto mode [ 27s] update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rview (rview) in auto mode [ 27s] update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vi (vi) in auto mode [ 27s] update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/view (view) in auto mode [ 27s] update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/ex (ex) in auto mode [ 27s] update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/editor (editor) in auto mode [ 27s] [114/190] installing cpp-4:5.3.1-1ubuntu1 [ 27s] [115/190] installing bsdutils-1:2.27.1-6ubuntu3 [ 27s] [116/190] installing libdbus-1-3-1.10.6-1ubuntu3 [28831s] qemu-system-x86_64: terminating on signal 15 from pid 40323 () Job seems to be stuck here, killed. (after 28800 seconds of inactivity) [28831s] ### VM INTERACTION END ### [28831s] No buildstatus set, either the base system is broken (kernel/initrd/udev/glibc/bash/perl) [28831s] or the build host has a kernel or hardware problem... -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Sat Jul 21 06:32:40 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 06:32:40 +0000 Subject: Change in docker-playground[master]: git-deamon: Make sure to create the git-daemon user Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10096 Change subject: git-deamon: Make sure to create the git-daemon user ...................................................................... git-deamon: Make sure to create the git-daemon user Recent debian packages moved creation of the git-daemon user from the main "git" package into the "git-daemon-run" package. We want the user without the latter... Change-Id: I42f68ba31d32574a01d1372d8cc5239c420e816f --- M Makefile M git-daemon/Dockerfile M osmo-bsc-master/Dockerfile M osmo-bts-master/Dockerfile M osmo-bts-master/osmo-bts.cfg 5 files changed, 9 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/96/10096/1 diff --git a/Makefile b/Makefile index eca64be..27f5659 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,7 @@ +.PHONY: production +production: bind9 redmine cgit gerrit git-daemon gitolite patchwork redmine + + .PHONY: build build: debian-jessie-build osmo-ggsn-master osmo-stp-master sctp-test sigtran-tests m3ua-test sua-test debian-stretch-titan ttcn3-ggsn-test diff --git a/git-daemon/Dockerfile b/git-daemon/Dockerfile index 7dc7d39..9c4601b 100644 --- a/git-daemon/Dockerfile +++ b/git-daemon/Dockerfile @@ -8,6 +8,8 @@ RUN apt-get install -qqy git +RUN useradd -u 30001 -g ssh git-daemon + ADD git-daemon.sh /usr/bin/git-daemon.sh VOLUME /git diff --git a/osmo-bsc-master/Dockerfile b/osmo-bsc-master/Dockerfile index 5af6abf..c2ae6fb 100644 --- a/osmo-bsc-master/Dockerfile +++ b/osmo-bsc-master/Dockerfile @@ -26,7 +26,7 @@ WORKDIR /tmp -ARG OSMO_BSC_BRANCH="master" +ARG OSMO_BSC_BRANCH="neels/inter_bsc_ho" RUN git clone git://git.osmocom.org/osmo-bsc.git ADD http://git.osmocom.org/osmo-bsc/patch?h=$OSMO_BSC_BRANCH /tmp/commit-osmo-bsc diff --git a/osmo-bts-master/Dockerfile b/osmo-bts-master/Dockerfile index 3c2dbec..aa41cca 100644 --- a/osmo-bts-master/Dockerfile +++ b/osmo-bts-master/Dockerfile @@ -26,7 +26,7 @@ WORKDIR /tmp -ARG OSMO_BTS_BRANCH="master" +ARG OSMO_BTS_BRANCH="laforge/meas256" RUN git clone git://git.osmocom.org/osmo-bts.git ADD http://git.osmocom.org/osmo-bts/patch?h=$OSMO_BTS_BRANCH /tmp/commit-osmo-bts diff --git a/osmo-bts-master/osmo-bts.cfg b/osmo-bts-master/osmo-bts.cfg index e8feff5..bd37b48 100644 --- a/osmo-bts-master/osmo-bts.cfg +++ b/osmo-bts-master/osmo-bts.cfg @@ -67,6 +67,7 @@ gsmtap-sapi pch min-qual-rach 50 min-qual-norm -5 + supp-meas-info toa256 trx 0 power-ramp max-initial 23000 mdBm power-ramp step-size 2000 mdB -- To view, visit https://gerrit.osmocom.org/10096 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I42f68ba31d32574a01d1372d8cc5239c420e816f Gerrit-Change-Number: 10096 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 07:38:05 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 07:38:05 +0000 Subject: Change in docker-playground[master]: git-deamon: Make sure to create the git-daemon user In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10096 ) Change subject: git-deamon: Make sure to create the git-daemon user ...................................................................... Patch Set 1: Verified+1 Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10096 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I42f68ba31d32574a01d1372d8cc5239c420e816f Gerrit-Change-Number: 10096 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Sat, 21 Jul 2018 07:38:05 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 07:38:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 07:38:24 +0000 Subject: Change in docker-playground[master]: git-deamon: Make sure to create the git-daemon user In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10096 ) Change subject: git-deamon: Make sure to create the git-daemon user ...................................................................... Patch Set 1: Code-Review-1 -- To view, visit https://gerrit.osmocom.org/10096 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I42f68ba31d32574a01d1372d8cc5239c420e816f Gerrit-Change-Number: 10096 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Sat, 21 Jul 2018 07:38:24 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 07:39:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 07:39:14 +0000 Subject: Change in docker-playground[master]: git-deamon: Make sure to create the git-daemon user In-Reply-To: References: Message-ID: Harald Welte has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/10096 ) Change subject: git-deamon: Make sure to create the git-daemon user ...................................................................... git-deamon: Make sure to create the git-daemon user Recent debian packages moved creation of the git-daemon user from the main "git" package into the "git-daemon-run" package. We want the user without the latter... Change-Id: I42f68ba31d32574a01d1372d8cc5239c420e816f --- M git-daemon/Dockerfile 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/96/10096/2 -- To view, visit https://gerrit.osmocom.org/10096 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I42f68ba31d32574a01d1372d8cc5239c420e816f Gerrit-Change-Number: 10096 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 07:39:26 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 07:39:26 +0000 Subject: Change in docker-playground[master]: git-deamon: Make sure to create the git-daemon user In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10096 ) Change subject: git-deamon: Make sure to create the git-daemon user ...................................................................... Patch Set 2: Verified+1 Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10096 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I42f68ba31d32574a01d1372d8cc5239c420e816f Gerrit-Change-Number: 10096 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Sat, 21 Jul 2018 07:39:26 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 07:39:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 07:39:27 +0000 Subject: Change in docker-playground[master]: git-deamon: Make sure to create the git-daemon user In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10096 ) Change subject: git-deamon: Make sure to create the git-daemon user ...................................................................... git-deamon: Make sure to create the git-daemon user Recent debian packages moved creation of the git-daemon user from the main "git" package into the "git-daemon-run" package. We want the user without the latter... Change-Id: I42f68ba31d32574a01d1372d8cc5239c420e816f --- M git-daemon/Dockerfile 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/git-daemon/Dockerfile b/git-daemon/Dockerfile index 7dc7d39..9c4601b 100644 --- a/git-daemon/Dockerfile +++ b/git-daemon/Dockerfile @@ -8,6 +8,8 @@ RUN apt-get install -qqy git +RUN useradd -u 30001 -g ssh git-daemon + ADD git-daemon.sh /usr/bin/git-daemon.sh VOLUME /git -- To view, visit https://gerrit.osmocom.org/10096 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I42f68ba31d32574a01d1372d8cc5239c420e816f Gerrit-Change-Number: 10096 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 07:39:35 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 07:39:35 +0000 Subject: Change in libosmocore[master]: tests: codec: ecu_fr: Add buffer with unequal XMAXC values In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10079 ) Change subject: tests: codec: ecu_fr: Add buffer with unequal XMAXC values ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10079 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I14a192d001b5e167437cedbe76a1a3dd84dde35c Gerrit-Change-Number: 10079 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Sat, 21 Jul 2018 07:39:35 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 07:40:12 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 07:40:12 +0000 Subject: Change in libosmocore[master]: libosmocodec: FR err concealment: Fix too many silent frames generated In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10073 ) Change subject: libosmocodec: FR err concealment: Fix too many silent frames generated ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10073 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1624b7c6574f53d0593a61645d4fdc5d56cabe96 Gerrit-Change-Number: 10073 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: dexter Gerrit-Comment-Date: Sat, 21 Jul 2018 07:40:12 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 07:40:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 07:40:17 +0000 Subject: Change in libosmocore[master]: tests: codec: ecu_fr: Print XMAXC fields In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10078 ) Change subject: tests: codec: ecu_fr: Print XMAXC fields ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10078 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I678d4be5e0b15b05873b0d3bf5ea5bbee7bef839 Gerrit-Change-Number: 10078 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Sat, 21 Jul 2018 07:40:17 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 07:40:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 07:40:20 +0000 Subject: Change in libosmocore[master]: libosmocodec: FR err concealment: Fix too many silent frames generated In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10073 ) Change subject: libosmocodec: FR err concealment: Fix too many silent frames generated ...................................................................... libosmocodec: FR err concealment: Fix too many silent frames generated As stated in its own documentation, reduce_xmaxcr_all() should only return true when ALL XMAXC fields return true. However, previous implementation returned true when at least one of them returned true. As a result, if any of the sections is silent (for instance because one of the bursts was lost), the whole frame is silenced, returning a zeroed buffer. Related: OS#2700 Fixes: 40def49ac4b8babbd1b17c232137ce50a428706b ("libosmocodec: implement ECU (Error Concealment Unit) for FR") Change-Id: I1624b7c6574f53d0593a61645d4fdc5d56cabe96 --- M src/codec/ecu_fr.c 1 file changed, 5 insertions(+), 9 deletions(-) Approvals: Harald Welte: Looks good to me, approved Vadim Yanitskiy: Looks good to me, but someone else must approve dexter: Looks good to me, but someone else must approve Stefan Sperling: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/src/codec/ecu_fr.c b/src/codec/ecu_fr.c index d4ea741..784a5b8 100644 --- a/src/codec/ecu_fr.c +++ b/src/codec/ecu_fr.c @@ -64,16 +64,12 @@ */ static bool reduce_xmaxcr_all(struct bitvec *frame_bitvec) { - bool silent = false; + bool silent = true; - if (reduce_xmaxcr(frame_bitvec, GSM610_RTP_XMAXC00)) - silent = true; - if (reduce_xmaxcr(frame_bitvec, GSM610_RTP_XMAXC10)) - silent = true; - if (reduce_xmaxcr(frame_bitvec, GSM610_RTP_XMAXC20)) - silent = true; - if (reduce_xmaxcr(frame_bitvec, GSM610_RTP_XMAXC30)) - silent = true; + silent &= reduce_xmaxcr(frame_bitvec, GSM610_RTP_XMAXC00); + silent &= reduce_xmaxcr(frame_bitvec, GSM610_RTP_XMAXC10); + silent &= reduce_xmaxcr(frame_bitvec, GSM610_RTP_XMAXC20); + silent &= reduce_xmaxcr(frame_bitvec, GSM610_RTP_XMAXC30); return silent; } -- To view, visit https://gerrit.osmocom.org/10073 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I1624b7c6574f53d0593a61645d4fdc5d56cabe96 Gerrit-Change-Number: 10073 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 07:40:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 07:40:20 +0000 Subject: Change in libosmocore[master]: tests: codec: ecu_fr: Print XMAXC fields In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10078 ) Change subject: tests: codec: ecu_fr: Print XMAXC fields ...................................................................... tests: codec: ecu_fr: Print XMAXC fields This makes it easy to debug how XMAXC fields are decreased every iteration in osmo_ecu_fr_conceal(). Change-Id: I678d4be5e0b15b05873b0d3bf5ea5bbee7bef839 --- M tests/codec/codec_ecu_fr_test.c M tests/codec/codec_ecu_fr_test.ok 2 files changed, 54 insertions(+), 25 deletions(-) Approvals: Harald Welte: Looks good to me, approved Vadim Yanitskiy: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/tests/codec/codec_ecu_fr_test.c b/tests/codec/codec_ecu_fr_test.c index 0fdc489..3a99fc7 100644 --- a/tests/codec/codec_ecu_fr_test.c +++ b/tests/codec/codec_ecu_fr_test.c @@ -1,12 +1,14 @@ #include #include #include +#include #include #include #include #include +#include /* Set with sample full-rate voice frames and some intentional dropouts */ static const char *fr_frames_hex[] = { @@ -74,6 +76,28 @@ static const char *sample_frame_hex = \ "d9ec9be212901f802335598c501f805bad3d4ba01f809b69df5a501f809cd1b4da"; +#define GSM610_XMAXC_LEN 6 +static void parse_xmaxc_frame(uint8_t *frame, uint64_t xmaxc_res[4]) +{ + unsigned int field_index, len; + + struct bitvec *frame_bitvec = bitvec_alloc(GSM_FR_BYTES, NULL); + OSMO_ASSERT(frame_bitvec); + len = bitvec_unpack(frame_bitvec, frame); + OSMO_ASSERT(len == GSM_FR_BYTES); + + field_index = GSM610_RTP_XMAXC00; + xmaxc_res[0] = bitvec_read_field(frame_bitvec, &field_index, GSM610_XMAXC_LEN); + field_index = GSM610_RTP_XMAXC10; + xmaxc_res[1] = bitvec_read_field(frame_bitvec, &field_index, GSM610_XMAXC_LEN); + field_index = GSM610_RTP_XMAXC20; + xmaxc_res[2] = bitvec_read_field(frame_bitvec, &field_index, GSM610_XMAXC_LEN); + field_index = GSM610_RTP_XMAXC30; + xmaxc_res[3] = bitvec_read_field(frame_bitvec, &field_index, GSM610_XMAXC_LEN); + + bitvec_free(frame_bitvec); +} + /** * Start with a good voice frame and then simulate 20 consecutive bad frames, * watching how the error concealment decreases the XMAXC parameters. @@ -82,23 +106,28 @@ { struct osmo_ecu_fr_state state; uint8_t frame[GSM_FR_BYTES]; + uint64_t xmaxc[4]; int i, rc; /* Parse frame from string to hex */ osmo_hexparse(sample_frame_hex, frame, GSM_FR_BYTES); - - printf("Start with: %s\n", sample_frame_hex); + parse_xmaxc_frame(frame, xmaxc); + printf("Start with: %s, XMAXC: [%"PRIx64", %"PRIx64", %"PRIx64", %"PRIx64"]\n", + sample_frame_hex, xmaxc[0], xmaxc[1], xmaxc[2], xmaxc[3]); /* Reset the ECU with the proposed known good frame */ osmo_ecu_fr_reset(&state, frame); /* Now pretend that we do not receive any good frames anymore */ for (i = 0; i < 20; i++) { + rc = osmo_ecu_fr_conceal(&state, frame); OSMO_ASSERT(rc == 0); + parse_xmaxc_frame(frame, xmaxc); - printf("conceal: %02i, result: %s\n", - i, osmo_hexdump_nospc(frame, GSM_FR_BYTES)); + printf("conceal: %02i, result: %s XMAXC: [%"PRIx64", %"PRIx64", %"PRIx64", %"PRIx64"]\n", + i, osmo_hexdump_nospc(frame, GSM_FR_BYTES), + xmaxc[0], xmaxc[1], xmaxc[2], xmaxc[3]); } } diff --git a/tests/codec/codec_ecu_fr_test.ok b/tests/codec/codec_ecu_fr_test.ok index 6e20099..52d06a1 100644 --- a/tests/codec/codec_ecu_fr_test.ok +++ b/tests/codec/codec_ecu_fr_test.ok @@ -1,24 +1,24 @@ -Start with: d9ec9be212901f802335598c501f805bad3d4ba01f809b69df5a501f809cd1b4da -conceal: 00, result: d9ec9be212901f802335598c501f805bad3d4ba01f809b69df5a501f809cd1b4da -conceal: 01, result: d9ec9be212901d802335598c501d805bad3d4ba01d809b69df5a501d809cd1b4da -conceal: 02, result: d9ec9be212901b802335598c501b805bad3d4ba01b809b69df5a501b809cd1b4da -conceal: 03, result: d9ec9be2129019802335598c5019805bad3d4ba019809b69df5a5019809cd1b4da -conceal: 04, result: d9ec9be2129017802335598c5017805bad3d4ba017809b69df5a5017809cd1b4da -conceal: 05, result: d9ec9be2129015802335598c5015805bad3d4ba015809b69df5a5015809cd1b4da -conceal: 06, result: d9ec9be2129013802335598c5013805bad3d4ba013809b69df5a5013809cd1b4da -conceal: 07, result: d9ec9be2129011802335598c5011805bad3d4ba011809b69df5a5011809cd1b4da -conceal: 08, result: d9ec9be212900f802335598c500f805bad3d4ba00f809b69df5a500f809cd1b4da -conceal: 09, result: d9ec9be212900d802335598c500d805bad3d4ba00d809b69df5a500d809cd1b4da -conceal: 10, result: d9ec9be212900b802335598c500b805bad3d4ba00b809b69df5a500b809cd1b4da -conceal: 11, result: d9ec9be2129009802335598c5009805bad3d4ba009809b69df5a5009809cd1b4da -conceal: 12, result: d9ec9be2129007802335598c5007805bad3d4ba007809b69df5a5007809cd1b4da -conceal: 13, result: d9ec9be2129005802335598c5005805bad3d4ba005809b69df5a5005809cd1b4da -conceal: 14, result: d9ec9be2129003802335598c5003805bad3d4ba003809b69df5a5003809cd1b4da -conceal: 15, result: d9ec9be2129001802335598c5001805bad3d4ba001809b69df5a5001809cd1b4da -conceal: 16, result: d00000000000000000000000000000000000000000000000000000000000000000 -conceal: 17, result: d00000000000000000000000000000000000000000000000000000000000000000 -conceal: 18, result: d00000000000000000000000000000000000000000000000000000000000000000 -conceal: 19, result: d00000000000000000000000000000000000000000000000000000000000000000 +Start with: d9ec9be212901f802335598c501f805bad3d4ba01f809b69df5a501f809cd1b4da, XMAXC: [3f, 3f, 3f, 3f] +conceal: 00, result: d9ec9be212901f802335598c501f805bad3d4ba01f809b69df5a501f809cd1b4da XMAXC: [3f, 3f, 3f, 3f] +conceal: 01, result: d9ec9be212901d802335598c501d805bad3d4ba01d809b69df5a501d809cd1b4da XMAXC: [3b, 3b, 3b, 3b] +conceal: 02, result: d9ec9be212901b802335598c501b805bad3d4ba01b809b69df5a501b809cd1b4da XMAXC: [37, 37, 37, 37] +conceal: 03, result: d9ec9be2129019802335598c5019805bad3d4ba019809b69df5a5019809cd1b4da XMAXC: [33, 33, 33, 33] +conceal: 04, result: d9ec9be2129017802335598c5017805bad3d4ba017809b69df5a5017809cd1b4da XMAXC: [2f, 2f, 2f, 2f] +conceal: 05, result: d9ec9be2129015802335598c5015805bad3d4ba015809b69df5a5015809cd1b4da XMAXC: [2b, 2b, 2b, 2b] +conceal: 06, result: d9ec9be2129013802335598c5013805bad3d4ba013809b69df5a5013809cd1b4da XMAXC: [27, 27, 27, 27] +conceal: 07, result: d9ec9be2129011802335598c5011805bad3d4ba011809b69df5a5011809cd1b4da XMAXC: [23, 23, 23, 23] +conceal: 08, result: d9ec9be212900f802335598c500f805bad3d4ba00f809b69df5a500f809cd1b4da XMAXC: [1f, 1f, 1f, 1f] +conceal: 09, result: d9ec9be212900d802335598c500d805bad3d4ba00d809b69df5a500d809cd1b4da XMAXC: [1b, 1b, 1b, 1b] +conceal: 10, result: d9ec9be212900b802335598c500b805bad3d4ba00b809b69df5a500b809cd1b4da XMAXC: [17, 17, 17, 17] +conceal: 11, result: d9ec9be2129009802335598c5009805bad3d4ba009809b69df5a5009809cd1b4da XMAXC: [13, 13, 13, 13] +conceal: 12, result: d9ec9be2129007802335598c5007805bad3d4ba007809b69df5a5007809cd1b4da XMAXC: [f, f, f, f] +conceal: 13, result: d9ec9be2129005802335598c5005805bad3d4ba005809b69df5a5005809cd1b4da XMAXC: [b, b, b, b] +conceal: 14, result: d9ec9be2129003802335598c5003805bad3d4ba003809b69df5a5003809cd1b4da XMAXC: [7, 7, 7, 7] +conceal: 15, result: d9ec9be2129001802335598c5001805bad3d4ba001809b69df5a5001809cd1b4da XMAXC: [3, 3, 3, 3] +conceal: 16, result: d00000000000000000000000000000000000000000000000000000000000000000 XMAXC: [0, 0, 0, 0] +conceal: 17, result: d00000000000000000000000000000000000000000000000000000000000000000 XMAXC: [0, 0, 0, 0] +conceal: 18, result: d00000000000000000000000000000000000000000000000000000000000000000 XMAXC: [0, 0, 0, 0] +conceal: 19, result: d00000000000000000000000000000000000000000000000000000000000000000 XMAXC: [0, 0, 0, 0] Frame No. 000: * input: d9aa93ae63de00471a91b95b8660471392b4a2daa037628f391c624039258dc723 * output: d9aa93ae63de00471a91b95b8660471392b4a2daa037628f391c624039258dc723 -- To view, visit https://gerrit.osmocom.org/10078 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I678d4be5e0b15b05873b0d3bf5ea5bbee7bef839 Gerrit-Change-Number: 10078 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 07:40:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 07:40:21 +0000 Subject: Change in libosmocore[master]: tests: codec: ecu_fr: Add buffer with unequal XMAXC values In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10079 ) Change subject: tests: codec: ecu_fr: Add buffer with unequal XMAXC values ...................................................................... tests: codec: ecu_fr: Add buffer with unequal XMAXC values This buffer verifies that all XMAXC fields must be zero before the entire buffer is considered as silent by osmo_ecu_fr_conceal(). Change-Id: I14a192d001b5e167437cedbe76a1a3dd84dde35c --- M tests/codec/codec_ecu_fr_test.c M tests/codec/codec_ecu_fr_test.ok 2 files changed, 49 insertions(+), 19 deletions(-) Approvals: Harald Welte: Looks good to me, approved Vadim Yanitskiy: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/tests/codec/codec_ecu_fr_test.c b/tests/codec/codec_ecu_fr_test.c index 3a99fc7..3561c44 100644 --- a/tests/codec/codec_ecu_fr_test.c +++ b/tests/codec/codec_ecu_fr_test.c @@ -73,8 +73,11 @@ }; /* Example of a good frame */ -static const char *sample_frame_hex = \ - "d9ec9be212901f802335598c501f805bad3d4ba01f809b69df5a501f809cd1b4da"; +static const char *sample_frame_hex[] = { + "d9ec9be212901f802335598c501f805bad3d4ba01f809b69df5a501f809cd1b4da", + "d9ec9be212901d802335598c5013805bad3d4ba01f809b69df5a5019809cd1b4da", + NULL +}; #define GSM610_XMAXC_LEN 6 static void parse_xmaxc_frame(uint8_t *frame, uint64_t xmaxc_res[4]) @@ -108,26 +111,32 @@ uint8_t frame[GSM_FR_BYTES]; uint64_t xmaxc[4]; int i, rc; + int j = 0; - /* Parse frame from string to hex */ - osmo_hexparse(sample_frame_hex, frame, GSM_FR_BYTES); - parse_xmaxc_frame(frame, xmaxc); - printf("Start with: %s, XMAXC: [%"PRIx64", %"PRIx64", %"PRIx64", %"PRIx64"]\n", - sample_frame_hex, xmaxc[0], xmaxc[1], xmaxc[2], xmaxc[3]); - - /* Reset the ECU with the proposed known good frame */ - osmo_ecu_fr_reset(&state, frame); - - /* Now pretend that we do not receive any good frames anymore */ - for (i = 0; i < 20; i++) { - - rc = osmo_ecu_fr_conceal(&state, frame); - OSMO_ASSERT(rc == 0); + while (sample_frame_hex[j] != NULL) { + /* Parse frame from string to hex */ + osmo_hexparse(sample_frame_hex[j], frame, GSM_FR_BYTES); parse_xmaxc_frame(frame, xmaxc); + printf("Start with: %s, XMAXC: [%"PRIx64", %"PRIx64", %"PRIx64", %"PRIx64"]\n", + sample_frame_hex[j], xmaxc[0], xmaxc[1], xmaxc[2], xmaxc[3]); - printf("conceal: %02i, result: %s XMAXC: [%"PRIx64", %"PRIx64", %"PRIx64", %"PRIx64"]\n", - i, osmo_hexdump_nospc(frame, GSM_FR_BYTES), - xmaxc[0], xmaxc[1], xmaxc[2], xmaxc[3]); + /* Reset the ECU with the proposed known good frame */ + osmo_ecu_fr_reset(&state, frame); + + /* Now pretend that we do not receive any good frames anymore */ + for (i = 0; i < 20; i++) { + + rc = osmo_ecu_fr_conceal(&state, frame); + OSMO_ASSERT(rc == 0); + parse_xmaxc_frame(frame, xmaxc); + + printf("conceal: %02i, result: %s XMAXC: [%"PRIx64", %"PRIx64", %"PRIx64", %"PRIx64"]\n", + i, osmo_hexdump_nospc(frame, GSM_FR_BYTES), + xmaxc[0], xmaxc[1], xmaxc[2], xmaxc[3]); + } + + /* Go to the next frame */ + j++; } } diff --git a/tests/codec/codec_ecu_fr_test.ok b/tests/codec/codec_ecu_fr_test.ok index 52d06a1..3cc35af 100644 --- a/tests/codec/codec_ecu_fr_test.ok +++ b/tests/codec/codec_ecu_fr_test.ok @@ -19,6 +19,27 @@ conceal: 17, result: d00000000000000000000000000000000000000000000000000000000000000000 XMAXC: [0, 0, 0, 0] conceal: 18, result: d00000000000000000000000000000000000000000000000000000000000000000 XMAXC: [0, 0, 0, 0] conceal: 19, result: d00000000000000000000000000000000000000000000000000000000000000000 XMAXC: [0, 0, 0, 0] +Start with: d9ec9be212901d802335598c5013805bad3d4ba01f809b69df5a5019809cd1b4da, XMAXC: [3b, 27, 3f, 33] +conceal: 00, result: d9ec9be212901d802335598c5013805bad3d4ba01f809b69df5a5019809cd1b4da XMAXC: [3b, 27, 3f, 33] +conceal: 01, result: d9ec9be212901b802335598c5011805bad3d4ba01d809b69df5a5017809cd1b4da XMAXC: [37, 23, 3b, 2f] +conceal: 02, result: d9ec9be2129019802335598c500f805bad3d4ba01b809b69df5a5015809cd1b4da XMAXC: [33, 1f, 37, 2b] +conceal: 03, result: d9ec9be2129017802335598c500d805bad3d4ba019809b69df5a5013809cd1b4da XMAXC: [2f, 1b, 33, 27] +conceal: 04, result: d9ec9be2129015802335598c500b805bad3d4ba017809b69df5a5011809cd1b4da XMAXC: [2b, 17, 2f, 23] +conceal: 05, result: d9ec9be2129013802335598c5009805bad3d4ba015809b69df5a500f809cd1b4da XMAXC: [27, 13, 2b, 1f] +conceal: 06, result: d9ec9be2129011802335598c5007805bad3d4ba013809b69df5a500d809cd1b4da XMAXC: [23, f, 27, 1b] +conceal: 07, result: d9ec9be212900f802335598c5005805bad3d4ba011809b69df5a500b809cd1b4da XMAXC: [1f, b, 23, 17] +conceal: 08, result: d9ec9be212900d802335598c5003805bad3d4ba00f809b69df5a5009809cd1b4da XMAXC: [1b, 7, 1f, 13] +conceal: 09, result: d9ec9be212900b802335598c5001805bad3d4ba00d809b69df5a5007809cd1b4da XMAXC: [17, 3, 1b, f] +conceal: 10, result: d9ec9be2129009802335598c5000005bad3d4ba00b809b69df5a5005809cd1b4da XMAXC: [13, 0, 17, b] +conceal: 11, result: d9ec9be2129007802335598c5000005bad3d4ba009809b69df5a5003809cd1b4da XMAXC: [f, 0, 13, 7] +conceal: 12, result: d9ec9be2129005802335598c5000005bad3d4ba007809b69df5a5001809cd1b4da XMAXC: [b, 0, f, 3] +conceal: 13, result: d9ec9be2129003802335598c5000005bad3d4ba005809b69df5a5000009cd1b4da XMAXC: [7, 0, b, 0] +conceal: 14, result: d9ec9be2129001802335598c5000005bad3d4ba003809b69df5a5000009cd1b4da XMAXC: [3, 0, 7, 0] +conceal: 15, result: d9ec9be2129000002335598c5000005bad3d4ba001809b69df5a5000009cd1b4da XMAXC: [0, 0, 3, 0] +conceal: 16, result: d00000000000000000000000000000000000000000000000000000000000000000 XMAXC: [0, 0, 0, 0] +conceal: 17, result: d00000000000000000000000000000000000000000000000000000000000000000 XMAXC: [0, 0, 0, 0] +conceal: 18, result: d00000000000000000000000000000000000000000000000000000000000000000 XMAXC: [0, 0, 0, 0] +conceal: 19, result: d00000000000000000000000000000000000000000000000000000000000000000 XMAXC: [0, 0, 0, 0] Frame No. 000: * input: d9aa93ae63de00471a91b95b8660471392b4a2daa037628f391c624039258dc723 * output: d9aa93ae63de00471a91b95b8660471392b4a2daa037628f391c624039258dc723 -- To view, visit https://gerrit.osmocom.org/10079 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I14a192d001b5e167437cedbe76a1a3dd84dde35c Gerrit-Change-Number: 10079 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 07:40:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 07:40:41 +0000 Subject: Change in osmocom-bb[master]: trx_toolkit/trx_sniff.py: fix memleak: don't store packets In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10077 ) Change subject: trx_toolkit/trx_sniff.py: fix memleak: don't store packets ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10077 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0c6d9b76398e148b7febd94aa37aa2fa22d19b3f Gerrit-Change-Number: 10077 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Sat, 21 Jul 2018 07:40:41 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 07:40:59 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 07:40:59 +0000 Subject: Change in osmocom-bb[master]: mobile: use osmo_init_logging2 with proper talloc context In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10021 ) Change subject: mobile: use osmo_init_logging2 with proper talloc context ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10021 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I231ac9987ff3c13fafcd272b7d9aae3938ab5972 Gerrit-Change-Number: 10021 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Sat, 21 Jul 2018 07:40:59 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 07:41:05 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 07:41:05 +0000 Subject: Change in osmocom-bb[master]: mobile: use osmo_init_logging2 with proper talloc context In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10021 ) Change subject: mobile: use osmo_init_logging2 with proper talloc context ...................................................................... mobile: use osmo_init_logging2 with proper talloc context Change-Id: I231ac9987ff3c13fafcd272b7d9aae3938ab5972 --- M src/host/layer23/src/mobile/main.c 1 file changed, 5 insertions(+), 13 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/host/layer23/src/mobile/main.c b/src/host/layer23/src/mobile/main.c index 5a28be8..115ac41 100644 --- a/src/host/layer23/src/mobile/main.c +++ b/src/host/layer23/src/mobile/main.c @@ -46,8 +46,6 @@ #include #include -struct log_target *stderr_target; - void *l23_ctx = NULL; struct llist_head ms_list; static char *gsmtap_ip = 0; @@ -55,7 +53,6 @@ struct gsmtap_inst *gsmtap_inst = NULL; static char *vty_ip = "127.0.0.1"; unsigned short vty_port = 4247; -int debug_set = 0; char *config_dir = NULL; int use_mncc_sock = 0; int daemonize = 0; @@ -142,8 +139,7 @@ vty_port = atoi(optarg); break; case 'd': - log_parse_category_mask(stderr_target, optarg); - debug_set = 1; + log_parse_category_mask(osmo_stderr_target, optarg); break; case 'D': daemonize = 1; @@ -214,20 +210,15 @@ srand(time(NULL)); INIT_LLIST_HEAD(&ms_list); - log_init(&log_info, NULL); - stderr_target = log_target_create_stderr(); - log_add_target(stderr_target); - log_set_all_filter(stderr_target, 1); l23_ctx = talloc_named_const(NULL, 1, "layer2 context"); /* TODO: measure and choose a proper pool size */ msgb_talloc_ctx_init(l23_ctx, 0); - handle_options(argc, argv); + /* Init default stderr logging */ + osmo_init_logging2(l23_ctx, &log_info); - if (!debug_set) - log_parse_category_mask(stderr_target, debug_default); - log_set_log_level(stderr_target, LOGL_DEBUG); + handle_options(argc, argv); if (gsmtap_ip) { gsmtap_inst = gsmtap_source_init(gsmtap_ip, GSMTAP_UDP_PORT, 1); @@ -287,6 +278,7 @@ } l23_app_exit(); + log_fini(); talloc_free(config_file); talloc_free(config_dir); -- To view, visit https://gerrit.osmocom.org/10021 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I231ac9987ff3c13fafcd272b7d9aae3938ab5972 Gerrit-Change-Number: 10021 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 07:41:06 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 07:41:06 +0000 Subject: Change in osmocom-bb[master]: trx_toolkit/trx_sniff.py: fix memleak: don't store packets In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10077 ) Change subject: trx_toolkit/trx_sniff.py: fix memleak: don't store packets ...................................................................... trx_toolkit/trx_sniff.py: fix memleak: don't store packets The Scapy itself was the actual cause of continuously growing memory consumption. It was configured to store the captured packets, what isn't required for this tool. Change-Id: I0c6d9b76398e148b7febd94aa37aa2fa22d19b3f --- M src/target/trx_toolkit/trx_sniff.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/target/trx_toolkit/trx_sniff.py b/src/target/trx_toolkit/trx_sniff.py index 577e6f9..535bb3f 100755 --- a/src/target/trx_toolkit/trx_sniff.py +++ b/src/target/trx_toolkit/trx_sniff.py @@ -79,7 +79,7 @@ print("[i] Listening on interface '%s'..." % self.sniff_interface) # Start sniffing... - scapy.all.sniff(iface = self.sniff_interface, store = 1, + scapy.all.sniff(iface = self.sniff_interface, store = 0, filter = pkt_filter, prn = self.pkt_handler) # Scapy registers its own signal handler -- To view, visit https://gerrit.osmocom.org/10077 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I0c6d9b76398e148b7febd94aa37aa2fa22d19b3f Gerrit-Change-Number: 10077 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 07:41:35 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 07:41:35 +0000 Subject: Change in osmo-bts[master]: l1sap: add_l1sap_header: Compact msgb_push ret assignment In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10052 ) Change subject: l1sap: add_l1sap_header: Compact msgb_push ret assignment ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10052 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia427c216cd096d313b234ca244eb71837450e2a9 Gerrit-Change-Number: 10052 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Sat, 21 Jul 2018 07:41:35 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 07:42:07 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 07:42:07 +0000 Subject: Change in osmo-bts[master]: sched: Log RX->RTP packet like we do in add_l1sap_header In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10053 ) Change subject: sched: Log RX->RTP packet like we do in add_l1sap_header ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10053 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia90b051f308abcd8b88b84e861da593844b0d81a Gerrit-Change-Number: 10053 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Sat, 21 Jul 2018 07:42:07 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 07:42:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 07:42:22 +0000 Subject: Change in osmo-bts[master]: scheduler: Log error on fn jump In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10074 ) Change subject: scheduler: Log error on fn jump ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10074 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I28f01e3f7fff6f1fb52a3c593a837f4f924bb2d9 Gerrit-Change-Number: 10074 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Sat, 21 Jul 2018 07:42:22 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 07:42:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 07:42:52 +0000 Subject: Change in osmo-bts[master]: trx: scheduler: Keep RTP clock up to date while in DTXu pause In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10075 ) Change subject: trx: scheduler: Keep RTP clock up to date while in DTXu pause ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10075 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0bdfb529f35253ca7e531bb9984a3839c3bfe7e8 Gerrit-Change-Number: 10075 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Sat, 21 Jul 2018 07:42:52 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 07:42:59 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 07:42:59 +0000 Subject: Change in osmo-bts[master]: l1sap: add_l1sap_header: Compact msgb_push ret assignment In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10052 ) Change subject: l1sap: add_l1sap_header: Compact msgb_push ret assignment ...................................................................... l1sap: add_l1sap_header: Compact msgb_push ret assignment Change-Id: Ia427c216cd096d313b234ca244eb71837450e2a9 --- M src/common/l1sap.c 1 file changed, 1 insertion(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 3a40949..8936674 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -139,8 +139,7 @@ gsm_lchan_name(lchan), osmo_hexdump(rmsg->data, rmsg->len)); rmsg->l2h = rmsg->data; - msgb_push(rmsg, sizeof(*l1sap)); - rmsg->l1h = rmsg->data; + rmsg->l1h = msgb_push(rmsg, sizeof(*l1sap)); l1sap = msgb_l1sap_prim(rmsg); osmo_prim_init(&l1sap->oph, SAP_GSM_PH, PRIM_TCH, PRIM_OP_INDICATION, rmsg); -- To view, visit https://gerrit.osmocom.org/10052 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ia427c216cd096d313b234ca244eb71837450e2a9 Gerrit-Change-Number: 10052 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 07:42:59 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 07:42:59 +0000 Subject: Change in osmo-bts[master]: sched: Log RX->RTP packet like we do in add_l1sap_header In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10053 ) Change subject: sched: Log RX->RTP packet like we do in add_l1sap_header ...................................................................... sched: Log RX->RTP packet like we do in add_l1sap_header Other backends use already msgb in lower layers and eventually call add_l1sap_header to push TCH data up the stack. backends using common/scheduler.c (bts-trx, bts-virt) are the only ones not yet using msgb in lower layer but only creating the msgb immediatelly before sending it in _sched_compose_tch_ind. Let's add a log message there too to have similar output in all BTS backends. Change-Id: Ia90b051f308abcd8b88b84e861da593844b0d81a --- M src/common/scheduler.c 1 file changed, 7 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/common/scheduler.c b/src/common/scheduler.c index 8c9d30d..69186fe 100644 --- a/src/common/scheduler.c +++ b/src/common/scheduler.c @@ -380,14 +380,17 @@ { struct msgb *msg; struct osmo_phsap_prim *l1sap; + struct gsm_bts_trx *trx = l1t->trx; struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, tn); + uint8_t chan_nr = trx_chan_desc[chan].chan_nr | tn; + struct gsm_lchan *lchan = &trx->ts[L1SAP_CHAN2TS(chan_nr)].lchan[l1sap_chan2ss(chan_nr)]; /* compose primitive */ msg = l1sap_msgb_alloc(tch_len); l1sap = msgb_l1sap_prim(msg); osmo_prim_init(&l1sap->oph, SAP_GSM_PH, PRIM_TCH, PRIM_OP_INDICATION, msg); - l1sap->u.tch.chan_nr = trx_chan_desc[chan].chan_nr | tn; + l1sap->u.tch.chan_nr = chan_nr; l1sap->u.tch.fn = fn; msg->l2h = msgb_put(msg, tch_len); if (tch_len) @@ -396,6 +399,9 @@ if (l1ts->chan_state[chan].lost) l1ts->chan_state[chan].lost--; + LOGL1S(DL1P, LOGL_DEBUG, l1t, tn, -1, l1sap->u.data.fn, + "%s Rx -> RTP: %s\n", + gsm_lchan_name(lchan), osmo_hexdump(msgb_l2(msg), msgb_l2len(msg))); /* forward primitive */ l1sap_up(l1t->trx, l1sap); -- To view, visit https://gerrit.osmocom.org/10053 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ia90b051f308abcd8b88b84e861da593844b0d81a Gerrit-Change-Number: 10053 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 07:42:59 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 07:42:59 +0000 Subject: Change in osmo-bts[master]: scheduler: Log error on fn jump In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10074 ) Change subject: scheduler: Log error on fn jump ...................................................................... scheduler: Log error on fn jump Change-Id: I28f01e3f7fff6f1fb52a3c593a837f4f924bb2d9 --- M src/common/scheduler.c 1 file changed, 5 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/common/scheduler.c b/src/common/scheduler.c index 69186fe..3842810 100644 --- a/src/common/scheduler.c +++ b/src/common/scheduler.c @@ -870,10 +870,13 @@ /* start counting from last fn + 1, but only if not too many fn have * been elapsed */ - if (elapsed < 10) + if (elapsed < 10) { fn = (l1ts->mf_last_fn + 1) % GSM_HYPERFRAME; - else + } else { + LOGPFN(DL1P, LOGL_NOTICE, current_fn, + "Too many contiguous elapsed fn, dropping %u\n", elapsed); fn = current_fn; + } while (42) { /* get frame from multiframe */ -- To view, visit https://gerrit.osmocom.org/10074 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I28f01e3f7fff6f1fb52a3c593a837f4f924bb2d9 Gerrit-Change-Number: 10074 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 07:43:00 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 07:43:00 +0000 Subject: Change in osmo-bts[master]: trx: scheduler: Keep RTP clock up to date while in DTXu pause In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10075 ) Change subject: trx: scheduler: Keep RTP clock up to date while in DTXu pause ...................................................................... trx: scheduler: Keep RTP clock up to date while in DTXu pause Upper layer requires us to trigger all events coming from lower layers in order to keep the RTP clock in sync. In this case, this is done by sending an empty payload to indicate there's no data to send. Change-Id: I0bdfb529f35253ca7e531bb9984a3839c3bfe7e8 --- M src/osmo-bts-trx/scheduler_trx.c 1 file changed, 12 insertions(+), 4 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index 11c5c4e..a22b53f 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -1077,8 +1077,11 @@ /* indicate bad frame */ switch (tch_mode) { case GSM48_CMODE_SPEECH_V1: /* FR */ - if (lchan->tch.dtx.ul_sid) - return 0; /* DTXu: pause in progress */ + if (lchan->tch.dtx.ul_sid) { + /* DTXu: pause in progress. Push empty payload to upper layers */ + rc = 0; + goto compose_l1sap; + } /* Perform error concealment if possible */ rc = osmo_ecu_fr_conceal(&lchan->ecu_state.fr, tch_data); @@ -1119,6 +1122,7 @@ osmo_ecu_fr_reset(&lchan->ecu_state.fr, tch_data); /* TCH or BFI */ +compose_l1sap: return _sched_compose_tch_ind(l1t, tn, (fn + GSM_HYPERFRAME - 7) % GSM_HYPERFRAME, chan, tch_data, rc); } @@ -1265,8 +1269,11 @@ /* indicate bad frame */ switch (tch_mode) { case GSM48_CMODE_SPEECH_V1: /* HR */ - if (lchan->tch.dtx.ul_sid) - return 0; /* DTXu: pause in progress */ + if (lchan->tch.dtx.ul_sid) { + /* DTXu: pause in progress. Push empty payload to upper layers */ + rc = 0; + goto compose_l1sap; + } tch_data[0] = 0x70; /* F = 0, FT = 111 */ memset(tch_data + 1, 0, 14); rc = 15; @@ -1291,6 +1298,7 @@ if (rsl_cmode != RSL_CMOD_SPD_SPEECH) return 0; +compose_l1sap: /* TCH or BFI */ /* Note on FN 19 or 20: If we received the last burst of a frame, * it actually starts at FN 8 or 9. A burst starting there, overlaps -- To view, visit https://gerrit.osmocom.org/10075 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I0bdfb529f35253ca7e531bb9984a3839c3bfe7e8 Gerrit-Change-Number: 10075 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 07:43:39 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 07:43:39 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_ConnectionHandler: make as_handover more race robust In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10040 ) Change subject: MSC_ConnectionHandler: make as_handover more race robust ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10040 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I207e9ece48ec53f872f82d981435cee7c2d0b094 Gerrit-Change-Number: 10040 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Sat, 21 Jul 2018 07:43:39 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 08:20:49 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 08:20:49 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MGCP_Test: Make sure PT in RTP-Stream and MGCP match up In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10076 ) Change subject: MGCP_Test: Make sure PT in RTP-Stream and MGCP match up ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10076 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie888424ac3e0bf0d960b6f071855b6dd43935a0e Gerrit-Change-Number: 10076 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Sat, 21 Jul 2018 08:20:49 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 08:20:59 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 08:20:59 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MSC_ConnectionHandler: make as_handover more race robust In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10040 ) Change subject: MSC_ConnectionHandler: make as_handover more race robust ...................................................................... MSC_ConnectionHandler: make as_handover more race robust The IPACC and MDCX interaction happens nearly in parallel to the normal RSL connection that handles the handover, in particular the channel relase from the old BTS may arrive in between IPACC and MGCP operations. - When the channel release arrives, check if MGCP and IPACC operations are done (we have seen one MDCX on MGCP and an CRCX plus an MDCX on IPACC level) Change-Id: I207e9ece48ec53f872f82d981435cee7c2d0b094 Related: OS#3396 --- M bsc/MSC_ConnectionHandler.ttcn 1 file changed, 32 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index 589ccf1..a82728a 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -74,6 +74,7 @@ /* BTS media state */ type record BtsMediaState { boolean ipa_crcx_seen, + boolean ipa_mdcx_seen, uint16_t conn_id, uint7_t rtp_pt, HostPort bts, @@ -91,6 +92,7 @@ /* BTS Side */ g_media.bts := { ipa_crcx_seen := false, + ipa_mdcx_seen := false, conn_id := nr, rtp_pt := 0, bts := { @@ -102,6 +104,7 @@ g_media.bts1 := { ipa_crcx_seen := false, + ipa_mdcx_seen := false, conn_id := nr, rtp_pt := 0, bts := { @@ -204,7 +207,7 @@ oct2int(f_inet_addr(g_media.bts.peer.host)), g_media.bts.peer.port_nr, g_media.bts.rtp_pt)); - //g_media.bts.ipa_mdcx_seen := true; + g_media.bts.ipa_mdcx_seen := true; repeat; } @@ -248,7 +251,7 @@ oct2int(f_inet_addr(g_media.bts1.peer.host)), g_media.bts1.peer.port_nr, g_media.bts1.rtp_pt)); - //g_media.bts1.ipa_mdcx_seen := true; + g_media.bts1.ipa_mdcx_seen := true; repeat; } @@ -257,7 +260,7 @@ /* altstep for handling of MGCP media related commands. Activated by as_Media() to test * MGW level media handling */ -altstep as_Media_mgw() runs on MSC_ConnHdlr { +altstep as_Media_mgw(boolean norepeat := false) runs on MSC_ConnHdlr { var MgcpCommand mgcp_cmd; [] MGCP.receive(tr_CRCX) -> value mgcp_cmd { @@ -290,7 +293,9 @@ f_mgcp_par_append(mgcp_resp.params, ts_MgcpParSpecEP(g_media.mgcp_ep)); MGCP.send(mgcp_resp); g_media.mgcp_conn[cid].crcx_seen := g_media.mgcp_conn[cid].crcx_seen + 1; - repeat; + if(norepeat == false) { + repeat; + } } [] MGCP.receive(tr_MDCX) -> value mgcp_cmd { var SDP_Message sdp; @@ -311,7 +316,9 @@ valueof(ts_SDP_ptime(mgcp_conn.ptime)) } )); MGCP.send(ts_MDCX_ACK(mgcp_cmd.line.trans_id, mgcp_conn.conn_id, sdp)); g_media.mgcp_conn[cid].mdcx_seen := g_media.mgcp_conn[cid].mdcx_seen + 1; - repeat; + if(norepeat == false) { + repeat; + } } } @@ -969,6 +976,7 @@ type record HandoverState { /* Assignment related bits */ boolean rr_ho_cmpl_seen, + integer mdcx_seen_before_ho, boolean handover_done, RslChannelNr old_chan_nr }; @@ -1004,13 +1012,18 @@ st.old_chan_nr := g_chan_nr; g_chan_nr := new_chan_nr; st.rr_ho_cmpl_seen := true; + + /* Memorize how many MDCX we have seen before. We need this number to detect + * that we have received the handover related MDCX */ + st.mdcx_seen_before_ho := g_media.mgcp_conn[0].mdcx_seen; repeat; } else { setverdict(fail, "Unexpected L3 received", l3); self.stop; } } - [st.rr_ho_cmpl_seen] as_Media(); + [st.rr_ho_cmpl_seen] as_Media_ipacc(); + [st.rr_ho_cmpl_seen] as_Media_mgw(true); [st.rr_ho_cmpl_seen] RSL.receive(tr_RSL_REL_REQ(st.old_chan_nr, tr_RslLinkID_DCCH(0))) { RSL.send(ts_RSL_REL_CONF(st.old_chan_nr, valueof(ts_RslLinkID_DCCH(0)))); repeat; @@ -1020,7 +1033,19 @@ /* unregister for old channel number in RSL emulation */ /* FIXME: Determine TRX NR by ARFCN, instead of hard-coded TRX0! */ f_rslem_unregister(0, st.old_chan_nr); - st.handover_done := true; + + /* The channel release must not necessarly be synchronized to the RSL handover + * procedure since those events may happen independently nearly at the same + * time. When we receive the RSL_RF_CHAN_REL command the media negotiation on + * IPACC or MGCP level may be still in progress. In order to make sure that + * we do only stop when we have seen an MDCX on MGCP level and another a CRCX + * as well as an MDCX on IPACC level. */ + if (g_media.mgcp_conn[0].mdcx_seen <= st.mdcx_seen_before_ho or + g_media.bts1.ipa_mdcx_seen == false or g_media.bts1.ipa_crcx_seen == false) { + repeat; + } else { + st.handover_done := true; + } } } -- To view, visit https://gerrit.osmocom.org/10040 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I207e9ece48ec53f872f82d981435cee7c2d0b094 Gerrit-Change-Number: 10040 Gerrit-PatchSet: 3 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 08:21:00 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 08:21:00 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MGCP_Test: Make sure PT in RTP-Stream and MGCP match up In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10076 ) Change subject: MGCP_Test: Make sure PT in RTP-Stream and MGCP match up ...................................................................... MGCP_Test: Make sure PT in RTP-Stream and MGCP match up At the moment the RTP stream emulation is left in its default configuration, this means that the payload type that appears in the RTP stream is always 0. This may mismatch the payload type that is configured with MGCP. If nothing else is set, we should make sure that whan we create and modify flows, the RTP emulation is always reconfigured to use the payload-type that we set in the flow parameters. The other rtp-emulation parameters should be set to their defaults. - Make sure f_flow_modify and f_flow_create set the rtp flow parameters properly. Change-Id: Ie888424ac3e0bf0d960b6f071855b6dd43935a0e Related:OS#3384 --- M mgw/MGCP_Test.ttcn 1 file changed, 21 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn index d816a71..659d5f1 100644 --- a/mgw/MGCP_Test.ttcn +++ b/mgw/MGCP_Test.ttcn @@ -58,6 +58,7 @@ private function f_init(template MgcpEndpoint ep := omit) runs on dummy_CT { var Result res; var uint32_t ssrc; + if (initialized == false) { initialized := true; @@ -243,7 +244,8 @@ HostPort mgw, /* mgw side */ uint7_t pt, charstring codec, - MgcpConnectionId mgcp_conn_id optional + MgcpConnectionId mgcp_conn_id optional, + RtpemConfig rtp_cfg optional } /* Create an RTP flow (bidirectional, or receive-only) */ @@ -256,6 +258,15 @@ /* bind local RTP emulation socket */ f_rtpem_bind(pt, flow.em.hostname, flow.em.portnr); + /* configure rtp-emulation */ + if (ispresent(flow.rtp_cfg)) { + f_rtpem_configure(pt, flow.rtp_cfg); + } else { + var RtpemConfig rtp_cfg := c_RtpemDefaultCfg; + rtp_cfg.tx_payload_type := flow.pt + f_rtpem_configure(pt, rtp_cfg); + } + if (one_phase) { /* Connect flow to MGW using a CRCX that also contains an SDP * part that tells the MGW where we are listening for RTP streams @@ -299,6 +310,15 @@ /* rebind local RTP emulation socket to the new address */ f_rtpem_bind(pt, flow.em.hostname, flow.em.portnr); + /* reconfigure rtp-emulation */ + if (ispresent(flow.rtp_cfg)) { + f_rtpem_configure(pt, flow.rtp_cfg); + } else { + var RtpemConfig rtp_cfg := c_RtpemDefaultCfg; + rtp_cfg.tx_payload_type := flow.pt + f_rtpem_configure(pt, rtp_cfg); + } + /* connect MGW side RTP socket to the emulation-side RTP socket using SDP */ cmd := ts_MDCX(get_next_trans_id(), ep, mode, call_id, flow.mgcp_conn_id); cmd.sdp := ts_SDP(flow.em.hostname, flow.em.hostname, "23", "42", -- To view, visit https://gerrit.osmocom.org/10076 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ie888424ac3e0bf0d960b6f071855b6dd43935a0e Gerrit-Change-Number: 10076 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 08:21:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 08:21:15 +0000 Subject: Change in libosmo-sccp[master]: remove unused -p option from getopt() call in sccp_demo_user In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10072 ) Change subject: remove unused -p option from getopt() call in sccp_demo_user ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10072 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I31f30d8c855cb5faf3173987bfe5b36f5a585d02 Gerrit-Change-Number: 10072 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Sat, 21 Jul 2018 08:21:15 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 08:22:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 08:22:22 +0000 Subject: Change in osmo-bsc[master]: fix handling of invalid pchan names in vty In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10026 ) Change subject: fix handling of invalid pchan names in vty ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10026 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I97baa359464a0e94de2497bc9214b99ed2a24041 Gerrit-Change-Number: 10026 Gerrit-PatchSet: 2 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Sat, 21 Jul 2018 08:22:22 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 08:22:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 08:22:24 +0000 Subject: Change in osmo-bsc[master]: fix handling of invalid pchan names in vty In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10026 ) Change subject: fix handling of invalid pchan names in vty ...................................................................... fix handling of invalid pchan names in vty If an invalid phys_chan_config is specified in osmo-bsc.cfg, raise a parsing error at program startup. If an invalid phys_chan_config is specified in in the VTY while the program is running, show a warning to inform the user that the configuration change was not applied. Change-Id: I97baa359464a0e94de2497bc9214b99ed2a24041 Related: OS#1876 --- M src/osmo-bsc/bsc_vty.c 1 file changed, 4 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c index 57c5363..77a534d 100644 --- a/src/osmo-bsc/bsc_vty.c +++ b/src/osmo-bsc/bsc_vty.c @@ -4032,8 +4032,10 @@ int pchanc; pchanc = gsm_pchan_parse(argv[0]); - if (pchanc < 0) - return CMD_WARNING; + if (pchanc < 0) { + vty_out(vty, "Unknown physical channel name '%s'%s", argv[0], VTY_NEWLINE); + return CMD_ERR_NO_MATCH; + } ts->pchan = pchanc; -- To view, visit https://gerrit.osmocom.org/10026 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I97baa359464a0e94de2497bc9214b99ed2a24041 Gerrit-Change-Number: 10026 Gerrit-PatchSet: 2 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 08:22:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 08:22:55 +0000 Subject: Change in libosmocore[master]: rate_ctr: Improve logging In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9753 ) Change subject: rate_ctr: Improve logging ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9753 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I992d165cab5ee6ca9b5b7e4a2210a0951954bd34 Gerrit-Change-Number: 9753 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Sat, 21 Jul 2018 08:22:55 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 08:22:58 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 08:22:58 +0000 Subject: Change in libosmocore[master]: rate_ctr: Improve logging In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9753 ) Change subject: rate_ctr: Improve logging ...................................................................... rate_ctr: Improve logging Previous logic regarding logging of verification and mangling of rate_ctr groups made it difficult to debug when an issue occurrs. Change-Id: I992d165cab5ee6ca9b5b7e4a2210a0951954bd34 --- M src/rate_ctr.c 1 file changed, 20 insertions(+), 15 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/rate_ctr.c b/src/rate_ctr.c index 777a42a..75302da 100644 --- a/src/rate_ctr.c +++ b/src/rate_ctr.c @@ -73,7 +73,7 @@ static void *tall_rate_ctr_ctx; -static bool rate_ctrl_group_desc_validate(const struct rate_ctr_group_desc *desc, bool quiet) +static bool rate_ctrl_group_desc_validate(const struct rate_ctr_group_desc *desc) { unsigned int i; const struct rate_ctr_desc *ctr_desc; @@ -88,17 +88,15 @@ desc->group_name_prefix, desc->num_ctr); if (!osmo_identifier_valid(desc->group_name_prefix)) { - if (!quiet) - LOGP(DLGLOBAL, LOGL_ERROR, "'%s' is not a valid counter group identifier\n", - desc->group_name_prefix); + LOGP(DLGLOBAL, LOGL_ERROR, "'%s' is not a valid counter group identifier\n", + desc->group_name_prefix); return false; } for (i = 0; i < desc->num_ctr; i++) { if (!osmo_identifier_valid(ctr_desc[i].name)) { - if (!quiet) - LOGP(DLGLOBAL, LOGL_ERROR, "'%s' is not a valid counter identifier\n", - ctr_desc[i].name); + LOGP(DLGLOBAL, LOGL_ERROR, "'%s' is not a valid counter identifier\n", + ctr_desc[i].name); return false; } } @@ -106,12 +104,13 @@ return true; } -/* return 'in' if it doesn't contaon any '.'; otherwise allocate a copy and +/* return 'in' if it doesn't contain any '.'; otherwise allocate a copy and * replace all '.' with ':' */ static char *mangle_identifier_ifneeded(const void *ctx, const char *in) { char *out; unsigned int i; + bool modified = false; if (!in) return NULL; @@ -123,10 +122,16 @@ OSMO_ASSERT(out); for (i = 0; i < strlen(out); i++) { - if (out[i] == '.') + if (out[i] == '.') { out[i] = ':'; + modified = true; + } } + if (modified) + LOGP(DLGLOBAL, LOGL_NOTICE, "counter group name mangled: '%s' -> '%s'\n", + in, out); + return out; } @@ -139,6 +144,10 @@ OSMO_ASSERT(desc_new); + LOGP(DLGLOBAL, LOGL_INFO, "Needed to mangle counter group '%s' names: it is still using '.' as " + "separator, which is not allowed. please consider updating the application\n", + desc->group_name_prefix); + /* mangle the name_prefix but copy/keep the rest */ desc_new->group_name_prefix = mangle_identifier_ifneeded(desc_new, desc->group_name_prefix); desc_new->group_description = desc->group_description; @@ -161,7 +170,7 @@ ctrd_new[i].description = ctrd[i].description; } - if (!rate_ctrl_group_desc_validate(desc_new, false)) { + if (!rate_ctrl_group_desc_validate(desc_new)) { /* simple mangling of identifiers ('.' -> ':') was not sufficient to render a valid * descriptor, we have to bail out */ LOGP(DLGLOBAL, LOGL_ERROR, "counter group '%s' still invalid after mangling\n", @@ -169,10 +178,6 @@ goto err_free; } - LOGP(DLGLOBAL, LOGL_INFO, "Needed to mangle counter group '%s' names: it is still using '.' as " - "separator, which is not allowed. please consider updating the application\n", - desc->group_name_prefix); - return desc_new; err_free: talloc_free(desc_new); @@ -231,7 +236,7 @@ return NULL; /* attempt to mangle all '.' in identifiers to ':' for backwards compat */ - if (!rate_ctrl_group_desc_validate(desc, true)) { + if (!rate_ctrl_group_desc_validate(desc)) { desc = rate_ctr_group_desc_mangle(group, desc); if (!desc) { talloc_free(group); -- To view, visit https://gerrit.osmocom.org/9753 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I992d165cab5ee6ca9b5b7e4a2210a0951954bd34 Gerrit-Change-Number: 9753 Gerrit-PatchSet: 4 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 08:23:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 08:23:17 +0000 Subject: Change in osmo-mgw[master]: protocol: prevent unnecessary null pointer deref In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10055 ) Change subject: protocol: prevent unnecessary null pointer deref ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10055 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id46e9bfba88613387026639eb4957221cce6820a Gerrit-Change-Number: 10055 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Sat, 21 Jul 2018 08:23:17 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 08:23:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 08:23:55 +0000 Subject: Change in pysim[master]: readme: add 'serial' dep, cosmetically rearrange In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10051 ) Change subject: readme: add 'serial' dep, cosmetically rearrange ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10051 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I414b897ba4911b7428ddf807cb04a93700ee0193 Gerrit-Change-Number: 10051 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: dexter Gerrit-Comment-Date: Sat, 21 Jul 2018 08:23:55 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 08:29:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 08:29:29 +0000 Subject: Change in osmo-tetra[master]: Make viterbi decoder deterministic in case of bit errors / too few sy... Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10097 Change subject: Make viterbi decoder deterministic in case of bit errors / too few symbols ...................................................................... Make viterbi decoder deterministic in case of bit errors / too few symbols Running tetra-rx on a capture with lots of bit errors is not deterministic. Investigation with Valgrind shows various errors about uninitialised values in libosmocore's viterbi decoder. The cause appears to lie in @lower_mac/viterbi.c at . The only function there allocates space for 864 symbols and then fills it with the symbols received. However, sym_count is sometimes less than 864, leaving the rest of the array uninitialized. Initializing it with @int8_t vit_inp[864*4] = {0};@ fixes the problem. Change-Id: Ib745c387e21fb81afef69efcf7e46d5d49331c8f Fixes: OS#3410 --- M src/lower_mac/viterbi.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-tetra refs/changes/97/10097/1 diff --git a/src/lower_mac/viterbi.c b/src/lower_mac/viterbi.c index 86aff77..b6f12c1 100644 --- a/src/lower_mac/viterbi.c +++ b/src/lower_mac/viterbi.c @@ -5,7 +5,7 @@ void viterbi_dec_sb1_wrapper(const uint8_t *in, uint8_t *out, unsigned int sym_count) { - int8_t vit_inp[864*4]; + int8_t vit_inp[864*4] = {0}; int i; for (i = 0; i < sym_count*4; i++) { -- To view, visit https://gerrit.osmocom.org/10097 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-tetra Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ib745c387e21fb81afef69efcf7e46d5d49331c8f Gerrit-Change-Number: 10097 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 11:29:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 11:29:16 +0000 Subject: Change in osmo-bsc[master]: move RSL and RR related functions to abis_rsl.[hc] In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9669 ) Change subject: move RSL and RR related functions to abis_rsl.[hc] ...................................................................... Patch Set 11: I still stand by my comment against patch version 3: TS 04.08 RR and TS 08.58 RSL are two completely different protocol layers. I'm happy with moving things around, renaming them, ... but against merging the two. We never do this anywhere else, and I fail to see the logic/rationale. -- To view, visit https://gerrit.osmocom.org/9669 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie8ee334145bf7bc3a601d395ea7ab9b2009b61c7 Gerrit-Change-Number: 9669 Gerrit-PatchSet: 11 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Harald Welte Gerrit-Comment-Date: Sat, 21 Jul 2018 11:29:16 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Sat Jul 21 15:10:07 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Sat, 21 Jul 2018 15:10:07 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-asn1c_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#191?= Message-ID: <1595967447.6.1532185807539.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 3.74 KB...] checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for style of include used by make... GNU checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking how to run the C++ preprocessor... g++ -E checking for g77... no checking for f77... no checking for xlf... no checking for frt... no checking for pgf77... no checking for cf77... no checking for fort77... no checking for fl32... no checking for af77... no checking for f90... no checking for xlf90... no checking for pgf90... no checking for pghpf... no checking for epcf90... no checking for gfortran... no checking for g95... no checking for f95... no checking for fort... no checking for xlf95... no checking for ifort... no checking for ifc... no checking for efc... no checking for pgf95... no checking for lf95... no checking for ftn... no checking whether we are using the GNU Fortran 77 compiler... no checking whether accepts -g... no checking the maximum length of command line arguments... 32768 checking command to parse /usr/bin/nm -B output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes configure: creating libtool appending configuration tag "CXX" to libtool checking for ld used by g++... /usr/bin/ld -m elf_x86_64 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC checking if g++ PIC flag -fPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate appending configuration tag "F77" to libtool checking for autoconf... /usr/bin/autoconf checking for autoheader... /usr/bin/autoheader checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking dependency style of gcc... (cached) gcc3 checking how to run the C preprocessor... gcc -E checking for a BSD-compatible install... /usr/bin/install -c checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking for bison... bison -y checking for flex... flex checking for yywrap in -lfl... yes checking lex output file root... lex.yy checking whether yytext is a pointer... yes checking for ar... /usr/bin/ar checking for ANSI C header files... (cached) yes checking sys/param.h usability... yes checking sys/param.h presence... yes checking for sys/param.h... yes checking whether byte ordering is bigendian... no checking for off_t... yes checking for size_t... yes checking whether struct tm is in sys/time.h or time.h... time.h checking for intmax_t... yes checking for library containing getopt... none required checking for strtoimax... yes checking for strtoll... yes checking for mergesort... no checking for mkstemps... yes configure: creating ./config.status config.status: creating skeletons/standard-modules/Makefile config.status: creating skeletons/tests/Makefile config.status: creating libasn1compiler/Makefile config.status: creating libasn1parser/Makefile config.status: creating libasn1print/Makefile config.status: creating asn1c/webcgi/Makefile config.status: creating asn1c/tests/Makefile config.status: creating libasn1fix/Makefile config.status: creating skeletons/Makefile config.status: creating examples/Makefile config.status: creating tests/Makefile config.status: creating asn1c/Makefile config.status: creating doc/Makefile config.status: creating asn1c.spec config.status: creating Makefile config.status: creating config.h config.status: executing depfiles commands + make -j 8 make all-recursive make[1]: Entering directory ' Making all in libasn1parser make[2]: Entering directory ' if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF ".deps/asn1parser.Tpo" -c -o asn1parser.lo asn1parser.c; \ then mv -f ".deps/asn1parser.Tpo" ".deps/asn1parser.Plo"; else rm -f ".deps/asn1parser.Tpo"; exit 1; fi bison -y -p asn1p_ -d asn1p_y.y if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF ".deps/asn1p_l.Tpo" -c -o asn1p_l.lo asn1p_l.c; \ then mv -f ".deps/asn1p_l.Tpo" ".deps/asn1p_l.Plo"; else rm -f ".deps/asn1p_l.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF ".deps/asn1p_module.Tpo" -c -o asn1p_module.lo asn1p_module.c; \ then mv -f ".deps/asn1p_module.Tpo" ".deps/asn1p_module.Plo"; else rm -f ".deps/asn1p_module.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF ".deps/asn1p_oid.Tpo" -c -o asn1p_oid.lo asn1p_oid.c; \ then mv -f ".deps/asn1p_oid.Tpo" ".deps/asn1p_oid.Plo"; else rm -f ".deps/asn1p_oid.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF ".deps/asn1p_value.Tpo" -c -o asn1p_value.lo asn1p_value.c; \ then mv -f ".deps/asn1p_value.Tpo" ".deps/asn1p_value.Plo"; else rm -f ".deps/asn1p_value.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF ".deps/asn1p_expr.Tpo" -c -o asn1p_expr.lo asn1p_expr.c; \ then mv -f ".deps/asn1p_expr.Tpo" ".deps/asn1p_expr.Plo"; else rm -f ".deps/asn1p_expr.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF ".deps/asn1p_xports.Tpo" -c -o asn1p_xports.lo asn1p_xports.c; \ then mv -f ".deps/asn1p_xports.Tpo" ".deps/asn1p_xports.Plo"; else rm -f ".deps/asn1p_xports.Tpo"; exit 1; fi asn1p_y.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] mkdir .libs mkdir .libs mkdir: cannot create directory '.libs': File exists gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -fPIC -DPIC -o .libs/asn1p_l.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -fPIC -DPIC -o .libs/asn1p_xports.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -fPIC -DPIC -o .libs/asn1p_module.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -fPIC -DPIC -o .libs/asn1p_oid.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -fPIC -DPIC -o .libs/asn1parser.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -fPIC -DPIC -o .libs/asn1p_expr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -fPIC -DPIC -o .libs/asn1p_value.o asn1p_l.c:3521:12: warning: 'input' defined but not used [-Wunused-function] static int input() ^~~~~ gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -o asn1p_xports.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -o asn1p_module.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -o asn1parser.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -o asn1p_oid.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -o asn1p_value.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF ".deps/asn1p_constr.Tpo" -c -o asn1p_constr.lo asn1p_constr.c; \ then mv -f ".deps/asn1p_constr.Tpo" ".deps/asn1p_constr.Plo"; else rm -f ".deps/asn1p_constr.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF ".deps/asn1p_param.Tpo" -c -o asn1p_param.lo asn1p_param.c; \ then mv -f ".deps/asn1p_param.Tpo" ".deps/asn1p_param.Plo"; else rm -f ".deps/asn1p_param.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -o asn1p_expr.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF ".deps/asn1p_class.Tpo" -c -o asn1p_class.lo asn1p_class.c; \ then mv -f ".deps/asn1p_class.Tpo" ".deps/asn1p_class.Plo"; else rm -f ".deps/asn1p_class.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF ".deps/asn1p_ref.Tpo" -c -o asn1p_ref.lo asn1p_ref.c; \ then mv -f ".deps/asn1p_ref.Tpo" ".deps/asn1p_ref.Plo"; else rm -f ".deps/asn1p_ref.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -fPIC -DPIC -o .libs/asn1p_constr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -fPIC -DPIC -o .libs/asn1p_param.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -fPIC -DPIC -o .libs/asn1p_ref.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -fPIC -DPIC -o .libs/asn1p_class.o if test -f y.tab.h; then \ to=`echo "asn1p_y_H" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \ sed -e "/^#/!b" -e "s/Y_TAB_H/$to/g" -e "s|y\.tab\.h|asn1p_y.h|" \ y.tab.h >asn1p_y.ht; \ rm -f y.tab.h; \ if cmp -s asn1p_y.ht asn1p_y.h; then \ rm -f asn1p_y.ht ;\ else \ mv asn1p_y.ht asn1p_y.h; \ fi; \ fi if test -f y.output; then \ mv y.output asn1p_y.output; \ fi sed '/^#/ s|y\.tab\.c|asn1p_y.c|' y.tab.c >asn1p_y.ct && mv asn1p_y.ct asn1p_y.c rm -f y.tab.c if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF ".deps/asn1p_y.Tpo" -c -o asn1p_y.lo asn1p_y.c; \ then mv -f ".deps/asn1p_y.Tpo" ".deps/asn1p_y.Plo"; else rm -f ".deps/asn1p_y.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -o asn1p_param.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -o asn1p_constr.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -o asn1p_ref.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -o asn1p_class.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF .deps/asn1p_y.Tpo -c asn1p_y.c -fPIC -DPIC -o .libs/asn1p_y.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -o asn1p_l.o >/dev/null 2>&1 asn1p_y.y: In function 'asn1p_parse': asn1p_y.y:357:13: error: 'param' undeclared (first use in this function) *(void **)param = $1; ^~~~~ asn1p_y.y:357:13: note: each undeclared identifier is reported only once for each function it appears in Makefile:299: recipe for target 'asn1p_y.lo' failed make[2]: *** [asn1p_y.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory ' Makefile:302: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory ' Makefile:212: recipe for target 'all' failed make: *** [all] Error 2 Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Sat Jul 21 17:07:45 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 17:07:45 +0000 Subject: Change in osmo-bsc[master]: fix handover start: dealloc ho if event not permitted In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10056 ) Change subject: fix handover start: dealloc ho if event not permitted ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10056 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I839a05495ae93c5dbbd1616efa2469e5b1990a61 Gerrit-Change-Number: 10056 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Sat, 21 Jul 2018 17:07:45 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 17:07:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 17:07:46 +0000 Subject: Change in osmo-bsc[master]: fix handover start: dealloc ho if event not permitted In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10056 ) Change subject: fix handover start: dealloc ho if event not permitted ...................................................................... fix handover start: dealloc ho if event not permitted Before this, a handover request in a conn state that disallows it would leave a lingering handover state in the conn, also thwarting any future handover attempts. (It would be deallocated on conn teardown, so no memleak.) Change-Id: I839a05495ae93c5dbbd1616efa2469e5b1990a61 --- M src/osmo-bsc/handover_logic.c 1 file changed, 9 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bsc/handover_logic.c b/src/osmo-bsc/handover_logic.c index 960bf69..064615c 100644 --- a/src/osmo-bsc/handover_logic.c +++ b/src/osmo-bsc/handover_logic.c @@ -82,6 +82,7 @@ int bsc_handover_start(enum hodec_id from_hodec_id, struct gsm_lchan *old_lchan, struct gsm_bts *new_bts, enum gsm_chan_t new_lchan_type) { + int rc; struct gsm_subscriber_connection *conn; struct bsc_handover *ho; static uint8_t ho_ref = 0; @@ -132,7 +133,14 @@ gsm_lchant_name(new_lchan_type), do_assignment ? "Assignment" : "Handover"); - return osmo_fsm_inst_dispatch(conn->fi, GSCON_EV_HO_START, NULL); + rc = osmo_fsm_inst_dispatch(conn->fi, GSCON_EV_HO_START, NULL); + + if (rc < 0) { + LOGPHO(ho, LOGL_ERROR, "Failed to trigger handover, conn state does not allow it\n"); + conn->ho = NULL; + talloc_free(ho); + } + return rc; } /*! Start actual handover. Call bsc_handover_start() instead; The only legal caller is the GSCON FSM in -- To view, visit https://gerrit.osmocom.org/10056 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I839a05495ae93c5dbbd1616efa2469e5b1990a61 Gerrit-Change-Number: 10056 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 17:07:58 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 17:07:58 +0000 Subject: Change in osmo-bsc[master]: ho cfg: fix unit strings In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10057 ) Change subject: ho cfg: fix unit strings ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10057 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie98a68de207aea69befd24af3f302b6ef9e6f8e4 Gerrit-Change-Number: 10057 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Sat, 21 Jul 2018 17:07:58 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 17:08:01 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 17:08:01 +0000 Subject: Change in osmo-bsc[master]: ho cfg: fix unit strings In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10057 ) Change subject: ho cfg: fix unit strings ...................................................................... ho cfg: fix unit strings Change-Id: Ie98a68de207aea69befd24af3f302b6ef9e6f8e4 --- M include/osmocom/bsc/handover_cfg.h M tests/handover_cfg.vty 2 files changed, 21 insertions(+), 21 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/bsc/handover_cfg.h b/include/osmocom/bsc/handover_cfg.h index 2321fcf..865fab9 100644 --- a/include/osmocom/bsc/handover_cfg.h +++ b/include/osmocom/bsc/handover_cfg.h @@ -126,8 +126,8 @@ "handover1 ", "power budget hysteresis", "<0-999>", atoi, "%u", as_is, \ HO_CFG_STR_HANDOVER1 \ HO_CFG_STR_POWER_BUDGET \ - "How many dBm stronger must a neighbor be to become a HO candidate\n" \ - "Neighbor's strength difference in dBm\n") \ + "How many dB stronger must a neighbor be to become a HO candidate\n" \ + "Neighbor's strength difference in dB\n") \ \ HO_CFG_ONE_MEMBER(unsigned int, hodec1_max_distance, 9999, \ "handover1 ", "maximum distance" , "<0-9999>", atoi, "%u", as_is, \ @@ -172,8 +172,8 @@ "handover2 ", "power budget hysteresis", "<0-999>", atoi, "%u", as_is, \ HO_CFG_STR_HANDOVER2 \ HO_CFG_STR_POWER_BUDGET \ - "How many dBm stronger must a neighbor be to become a HO candidate\n" \ - "Neighbor's strength difference in dBm\n") \ + "How many dB stronger must a neighbor be to become a HO candidate\n" \ + "Neighbor's strength difference in dB\n") \ \ HO_CFG_ONE_MEMBER(unsigned int, hodec2_max_distance, 9999, \ "handover2 ", "maximum distance" , "<0-9999>", atoi, "%u", as_is, \ @@ -208,21 +208,21 @@ HO_CFG_STR_HANDOVER2 \ HO_CFG_STR_MIN \ "How bad may RxQual of an MS become before triggering HO\n" \ - "minimum RxQual (dBm)\n") \ + "minimum RxQual\n") \ \ HO_CFG_ONE_MEMBER(int, hodec2_afs_bias_rxlev, 0, \ "handover2 ", "afs-bias rxlev", "<0-20>", atoi, "%d", as_is, \ HO_CFG_STR_HANDOVER2 \ HO_CFG_STR_AFS_BIAS \ "RxLev improvement bias for AFS over other codecs\n" \ - "Virtual RxLev improvement (dBm)\n") \ + "Virtual RxLev improvement (dB)\n") \ \ HO_CFG_ONE_MEMBER(int, hodec2_afs_bias_rxqual, 0, \ "handover2 ", "afs-bias rxqual", "<0-7>", atoi, "%d", as_is, \ HO_CFG_STR_HANDOVER2 \ HO_CFG_STR_AFS_BIAS \ "RxQual improvement bias for AFS over other codecs\n" \ - "Virtual RxQual improvement (dBm)\n") \ + "Virtual RxQual improvement\n") \ \ HO_CFG_ONE_MEMBER(int, hodec2_tchf_min_slots, 0, \ "handover2 ", "min-free-slots tch/f", "<0-9999>", atoi, "%d", as_is, \ diff --git a/tests/handover_cfg.vty b/tests/handover_cfg.vty index 3ad44d8..119eaf5 100644 --- a/tests/handover_cfg.vty +++ b/tests/handover_cfg.vty @@ -264,14 +264,14 @@ OsmoBSC(config-net)# handover1 power budget ? interval How often to check for a better cell (SACCH frames) - hysteresis How many dBm stronger must a neighbor be to become a HO candidate + hysteresis How many dB stronger must a neighbor be to become a HO candidate OsmoBSC(config-net)# handover1 power budget interval ? <1-99> Check for stronger neighbor every N number of SACCH frames default Use default (6), remove explicit setting on this node OsmoBSC(config-net)# handover1 power budget hysteresis ? - <0-999> Neighbor's strength difference in dBm + <0-999> Neighbor's strength difference in dB default Use default (3), remove explicit setting on this node OsmoBSC(config-net)# handover1 maximum ? @@ -312,14 +312,14 @@ OsmoBSC(config-net)# handover2 power budget ? interval How often to check for a better cell (SACCH frames) - hysteresis How many dBm stronger must a neighbor be to become a HO candidate + hysteresis How many dB stronger must a neighbor be to become a HO candidate OsmoBSC(config-net)# handover2 power budget interval ? <1-99> Check for stronger neighbor every N number of SACCH frames default Use default (6), remove explicit setting on this node OsmoBSC(config-net)# handover2 power budget hysteresis ? - <0-999> Neighbor's strength difference in dBm + <0-999> Neighbor's strength difference in dB default Use default (3), remove explicit setting on this node OsmoBSC(config-net)# handover2 maximum ? @@ -348,7 +348,7 @@ default Use default (-100), remove explicit setting on this node OsmoBSC(config-net)# handover2 min rxqual ? - <0-7> minimum RxQual (dBm) + <0-7> minimum RxQual default Use default (5), remove explicit setting on this node OsmoBSC(config-net)# handover2 afs-bias ? @@ -356,11 +356,11 @@ rxqual RxQual improvement bias for AFS over other codecs OsmoBSC(config-net)# handover2 afs-bias rxlev ? - <0-20> Virtual RxLev improvement (dBm) + <0-20> Virtual RxLev improvement (dB) default Use default (0), remove explicit setting on this node OsmoBSC(config-net)# handover2 afs-bias rxqual ? - <0-7> Virtual RxQual improvement (dBm) + <0-7> Virtual RxQual improvement default Use default (0), remove explicit setting on this node OsmoBSC(config-net)# handover2 min-free-slots ? @@ -482,14 +482,14 @@ OsmoBSC(config-net-bts)# handover1 power budget ? interval How often to check for a better cell (SACCH frames) - hysteresis How many dBm stronger must a neighbor be to become a HO candidate + hysteresis How many dB stronger must a neighbor be to become a HO candidate OsmoBSC(config-net-bts)# handover1 power budget interval ? <1-99> Check for stronger neighbor every N number of SACCH frames default Use default (6), remove explicit setting on this node OsmoBSC(config-net-bts)# handover1 power budget hysteresis ? - <0-999> Neighbor's strength difference in dBm + <0-999> Neighbor's strength difference in dB default Use default (3), remove explicit setting on this node OsmoBSC(config-net-bts)# handover1 maximum ? @@ -530,14 +530,14 @@ OsmoBSC(config-net-bts)# handover2 power budget ? interval How often to check for a better cell (SACCH frames) - hysteresis How many dBm stronger must a neighbor be to become a HO candidate + hysteresis How many dB stronger must a neighbor be to become a HO candidate OsmoBSC(config-net-bts)# handover2 power budget interval ? <1-99> Check for stronger neighbor every N number of SACCH frames default Use default (6), remove explicit setting on this node OsmoBSC(config-net-bts)# handover2 power budget hysteresis ? - <0-999> Neighbor's strength difference in dBm + <0-999> Neighbor's strength difference in dB default Use default (3), remove explicit setting on this node OsmoBSC(config-net-bts)# handover2 maximum ? @@ -566,7 +566,7 @@ default Use default (-100), remove explicit setting on this node OsmoBSC(config-net-bts)# handover2 min rxqual ? - <0-7> minimum RxQual (dBm) + <0-7> minimum RxQual default Use default (5), remove explicit setting on this node OsmoBSC(config-net-bts)# handover2 afs-bias ? @@ -574,11 +574,11 @@ rxqual RxQual improvement bias for AFS over other codecs OsmoBSC(config-net-bts)# handover2 afs-bias rxlev ? - <0-20> Virtual RxLev improvement (dBm) + <0-20> Virtual RxLev improvement (dB) default Use default (0), remove explicit setting on this node OsmoBSC(config-net-bts)# handover2 afs-bias rxqual ? - <0-7> Virtual RxQual improvement (dBm) + <0-7> Virtual RxQual improvement default Use default (0), remove explicit setting on this node OsmoBSC(config-net-bts)# handover2 min-free-slots ? -- To view, visit https://gerrit.osmocom.org/10057 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ie98a68de207aea69befd24af3f302b6ef9e6f8e4 Gerrit-Change-Number: 10057 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 17:08:34 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 17:08:34 +0000 Subject: Change in osmo-bsc[master]: hodec2 log: less verbose, more concise logging In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10058 ) Change subject: hodec2 log: less verbose, more concise logging ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10058 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If1add9b57a051d32b67a4a08ab47a9655aa9dd17 Gerrit-Change-Number: 10058 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Sat, 21 Jul 2018 17:08:34 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 17:09:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 17:09:17 +0000 Subject: Change in osmo-bsc[master]: various logging: fix missing/extra newlines In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10059 ) Change subject: various logging: fix missing/extra newlines ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10059 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id2619d0d45eb2686246c03643b4a578392a54cfe Gerrit-Change-Number: 10059 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Sat, 21 Jul 2018 17:09:17 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 17:10:50 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 17:10:50 +0000 Subject: Change in osmo-tetra[master]: Make viterbi decoder deterministic in case of bit errors / too few sy... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10097 ) Change subject: Make viterbi decoder deterministic in case of bit errors / too few symbols ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10097 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-tetra Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib745c387e21fb81afef69efcf7e46d5d49331c8f Gerrit-Change-Number: 10097 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Sat, 21 Jul 2018 17:10:50 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 17:11:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 17:11:08 +0000 Subject: Change in osmo-tetra[master]: Make viterbi decoder deterministic in case of bit errors / too few sy... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10097 ) Change subject: Make viterbi decoder deterministic in case of bit errors / too few symbols ...................................................................... Make viterbi decoder deterministic in case of bit errors / too few symbols Running tetra-rx on a capture with lots of bit errors is not deterministic. Investigation with Valgrind shows various errors about uninitialised values in libosmocore's viterbi decoder. The cause appears to lie in @lower_mac/viterbi.c at . The only function there allocates space for 864 symbols and then fills it with the symbols received. However, sym_count is sometimes less than 864, leaving the rest of the array uninitialized. Initializing it with @int8_t vit_inp[864*4] = {0};@ fixes the problem. Change-Id: Ib745c387e21fb81afef69efcf7e46d5d49331c8f Fixes: OS#3410 --- M src/lower_mac/viterbi.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/lower_mac/viterbi.c b/src/lower_mac/viterbi.c index 86aff77..b6f12c1 100644 --- a/src/lower_mac/viterbi.c +++ b/src/lower_mac/viterbi.c @@ -5,7 +5,7 @@ void viterbi_dec_sb1_wrapper(const uint8_t *in, uint8_t *out, unsigned int sym_count) { - int8_t vit_inp[864*4]; + int8_t vit_inp[864*4] = {0}; int i; for (i = 0; i < sym_count*4; i++) { -- To view, visit https://gerrit.osmocom.org/10097 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-tetra Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ib745c387e21fb81afef69efcf7e46d5d49331c8f Gerrit-Change-Number: 10097 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 17:12:26 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 17:12:26 +0000 Subject: Change in libosmo-sccp[master]: sccp_demo_user: use point code 23 for server and 1 for client In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9652 ) Change subject: sccp_demo_user: use point code 23 for server and 1 for client ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9652 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7432e6fc2617e0fd77a098fcd7d14abc40db7229 Gerrit-Change-Number: 9652 Gerrit-PatchSet: 4 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Stefan Sperling Gerrit-Comment-Date: Sat, 21 Jul 2018 17:12:26 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 17:12:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 17:12:28 +0000 Subject: Change in libosmo-sccp[master]: sccp_demo_user: use point code 23 for server and 1 for client In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9652 ) Change subject: sccp_demo_user: use point code 23 for server and 1 for client ...................................................................... sccp_demo_user: use point code 23 for server and 1 for client Fix previous commit 4dc9088cabedc40cb9072814237ad5926b12bd35 which broke this by using -1 for local and 23 for remote PC, for both server and client. Change-Id: I7432e6fc2617e0fd77a098fcd7d14abc40db7229 Related: OS#2666 --- M examples/sccp_demo_user.c 1 file changed, 48 insertions(+), 19 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/examples/sccp_demo_user.c b/examples/sccp_demo_user.c index f0b1a3e..9a9d6eb 100644 --- a/examples/sccp_demo_user.c +++ b/examples/sccp_demo_user.c @@ -82,12 +82,17 @@ .version = 0, }; -#define DEFAULT_LOCAL_PC -1 -#define DEFAULT_LOCAL_ADDRESS "127.0.0.2" -#define DEFAULT_LOCAL_PORT M3UA_PORT -#define DEFAULT_REMOTE_PC 23 -#define DEFAULT_REMOTE_ADDRESS "127.0.0.1" -#define DEFAULT_REMOTE_PORT M3UA_PORT +#define DEFAULT_LOCAL_ADDRESS_SERVER "127.0.0.1" +#define DEFAULT_LOCAL_ADDRESS_CLIENT "127.0.0.2" +#define DEFAULT_REMOTE_ADDRESS_CLIENT DEFAULT_LOCAL_ADDRESS_SERVER +#define DEFAULT_REMOTE_ADDRESS_SERVER DEFAULT_LOCAL_ADDRESS_CLIENT +#define DEFAULT_LOCAL_PORT_SERVER M3UA_PORT +#define DEFAULT_LOCAL_PORT_CLIENT M3UA_PORT +#define DEFAULT_REMOTE_PORT_CLIENT DEFAULT_LOCAL_PORT_SERVER +#define DEFAULT_REMOTE_PORT_SERVER DEFAULT_LOCAL_PORT_CLIENT +#define DEFAULT_REMOTE_PORT_SERVER_STR DEFAULT_LOCAL_PORT_CLIENT_STR +#define DEFAULT_PC_SERVER 1 +#define DEFAULT_PC_CLIENT 23 static void usage(void) { fprintf(stderr, "sccp_demo_user [-c] [-l LOCAL_ADDRESS[:LOCAL_PORT]]\n" @@ -95,13 +100,18 @@ " [-L LOCAL_POINT_CODE] [-R REMOTE_POINT_CODE]\n" "Options:\n" " -c: Run in client mode (default is server mode)\n" - " -l: local IP address and SCTP port (default is %s:%d)\n" - " -r: remote IP address and SCTP port (default is %s:%d)\n" - " -L: local point code (default is %d)\n" - " -R: remote point code (default is %d)\n", - DEFAULT_LOCAL_ADDRESS, DEFAULT_LOCAL_PORT, - DEFAULT_REMOTE_ADDRESS, DEFAULT_REMOTE_PORT, - DEFAULT_LOCAL_PC, DEFAULT_REMOTE_PC); + " -l: local IP address and SCTP port (default is %s:%d in server mode,\n" + " %s:%d in client mode)\n" + " -r: remote IP address and SCTP port (default is %s:%d in server mode,\n" + " %s:%d in client mode)\n" + " -L: local point code (default is %d in server mode, %d in client mode)\n" + " -R: remote point code (default is %d in server mode, %d in client mode)\n", + DEFAULT_LOCAL_ADDRESS_SERVER, DEFAULT_LOCAL_PORT_SERVER, + DEFAULT_LOCAL_ADDRESS_CLIENT, DEFAULT_LOCAL_PORT_CLIENT, + DEFAULT_REMOTE_ADDRESS_SERVER, DEFAULT_REMOTE_PORT_SERVER, + DEFAULT_REMOTE_ADDRESS_CLIENT, DEFAULT_REMOTE_PORT_CLIENT, + DEFAULT_PC_SERVER, DEFAULT_PC_CLIENT, + DEFAULT_PC_CLIENT, DEFAULT_PC_SERVER); exit(1); } @@ -151,25 +161,42 @@ { bool client = false; int rc, ch; - char *local_address = DEFAULT_LOCAL_ADDRESS; - int local_port = DEFAULT_LOCAL_PORT; - int local_pc = DEFAULT_LOCAL_PC; - char *remote_address = DEFAULT_REMOTE_ADDRESS; - int remote_port = DEFAULT_LOCAL_PORT; - int remote_pc = DEFAULT_REMOTE_PC; + char *local_address = DEFAULT_LOCAL_ADDRESS_SERVER; + int local_port = DEFAULT_LOCAL_PORT_SERVER; + int local_pc = DEFAULT_PC_SERVER; + char *remote_address = DEFAULT_REMOTE_ADDRESS_SERVER; + int remote_port = DEFAULT_REMOTE_PORT_SERVER; + int remote_pc = DEFAULT_PC_CLIENT; + bool lflag = false, rflag = false, Lflag = false, Rflag = false; while ((ch = getopt(argc, argv, "cl:r:p:L:R:")) != -1) { switch (ch) { case 'c': client = true; + + /* Set client-mode defaults unless already overridden during option parsing. */ + if (!lflag) { + local_address = DEFAULT_LOCAL_ADDRESS_CLIENT; + local_port = DEFAULT_LOCAL_PORT_CLIENT; + } + if (!Lflag) + local_pc = DEFAULT_PC_CLIENT; + if (!rflag) { + remote_address = DEFAULT_REMOTE_ADDRESS_CLIENT; + remote_port = DEFAULT_REMOTE_PORT_CLIENT; + } + if (!Rflag) + remote_pc = DEFAULT_PC_SERVER; break; case 'l': if (parse_address_port(&local_address, &local_port, optarg)) exit(1); + lflag = true; break; case 'r': if (parse_address_port(&remote_address, &remote_port, optarg)) exit(1); + rflag = true; break; case 'L': if (!is_decimal_string(optarg)) { @@ -177,6 +204,7 @@ exit(1); } local_pc = atoi(optarg); + Lflag = true; break; case 'R': if (!is_decimal_string(optarg)) { @@ -184,6 +212,7 @@ exit(1); } remote_pc = atoi(optarg); + Rflag = true; break; default: usage(); -- To view, visit https://gerrit.osmocom.org/9652 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I7432e6fc2617e0fd77a098fcd7d14abc40db7229 Gerrit-Change-Number: 9652 Gerrit-PatchSet: 4 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Stefan Sperling -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 17:12:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 17:12:32 +0000 Subject: Change in libosmo-sccp[master]: remove unused -p option from getopt() call in sccp_demo_user In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10072 ) Change subject: remove unused -p option from getopt() call in sccp_demo_user ...................................................................... remove unused -p option from getopt() call in sccp_demo_user Change-Id: I31f30d8c855cb5faf3173987bfe5b36f5a585d02 Depends: I7432e6fc2617e0fd77a098fcd7d14abc40db7229 --- M examples/sccp_demo_user.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/examples/sccp_demo_user.c b/examples/sccp_demo_user.c index 9a9d6eb..28dd166 100644 --- a/examples/sccp_demo_user.c +++ b/examples/sccp_demo_user.c @@ -169,7 +169,7 @@ int remote_pc = DEFAULT_PC_CLIENT; bool lflag = false, rflag = false, Lflag = false, Rflag = false; - while ((ch = getopt(argc, argv, "cl:r:p:L:R:")) != -1) { + while ((ch = getopt(argc, argv, "cl:r:L:R:")) != -1) { switch (ch) { case 'c': client = true; -- To view, visit https://gerrit.osmocom.org/10072 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I31f30d8c855cb5faf3173987bfe5b36f5a585d02 Gerrit-Change-Number: 10072 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 17:18:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 17:18:08 +0000 Subject: Change in osmo-ggsn[master]: fix unaligned access in build_ipcp_pco() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10054 ) Change subject: fix unaligned access in build_ipcp_pco() ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10054 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia1410abb216831864042f95679330f4508e1af3d Gerrit-Change-Number: 10054 Gerrit-PatchSet: 4 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling Gerrit-Comment-Date: Sat, 21 Jul 2018 17:18:08 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 17:18:43 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 17:18:43 +0000 Subject: Change in osmo-ggsn[master]: fix support for multiple IPCP in PDP protocol configuration options In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10061 ) Change subject: fix support for multiple IPCP in PDP protocol configuration options ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10061 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I51ecab4e35f3ee638e68ca773b0da90cc0294ab0 Gerrit-Change-Number: 10061 Gerrit-PatchSet: 2 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: dexter Gerrit-Comment-Date: Sat, 21 Jul 2018 17:18:43 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 17:18:45 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 17:18:45 +0000 Subject: Change in osmo-ggsn[master]: fix unaligned access in build_ipcp_pco() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10054 ) Change subject: fix unaligned access in build_ipcp_pco() ...................................................................... fix unaligned access in build_ipcp_pco() IPCP data can begin at any byte location in the pco_req->v array. Casting to a 'struct ipcp_hdr' pointer could lead to unaligned access. Parse IPCP data with u_int8_t pointers instead to avoid this problem. Add some length checks while here. pco_contains_proto() and ipcp_contains_option() now receive the minimum size of the data the caller is looking for, and only return pointers to items of sufficient size. Also fix an inifinite loop in ipcp_contains_option() by refusing IPCP options with length small than 2. Previously, a zero length option would trigger an infinite loop in the parser. Change-Id: Ia1410abb216831864042f95679330f4508e1af3d Related: OS#3194 --- M ggsn/ggsn.c 1 file changed, 31 insertions(+), 20 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 6d879c0..30584ef 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -413,16 +413,19 @@ } __attribute__ ((packed)); /* determine if IPCP contains given option */ -static struct ipcp_option_hdr *ipcp_contains_option(struct ipcp_hdr *ipcp, enum ipcp_options opt) +static uint8_t *ipcp_contains_option(uint8_t *ipcp, size_t ipcp_len, enum ipcp_options opt, size_t opt_minlen) { - uint8_t *cur = ipcp->options; + uint8_t *cur_opt = ipcp + sizeof(struct ipcp_hdr); /* iterate over Options and check if protocol contained */ - while (cur + 2 <= ((uint8_t *)ipcp) + ntohs(ipcp->len)) { - struct ipcp_option_hdr *cur_opt = (struct ipcp_option_hdr *) cur; - if (cur_opt->type == opt) + while (cur_opt + 2 <= ipcp + ipcp_len) { + uint8_t type = cur_opt[0]; + uint8_t len = cur_opt[1]; /* length value includes 2 bytes type/length */ + if (len < 2) + return NULL; + if (type == opt && len >= 2 + opt_minlen) return cur_opt; - cur += cur_opt->len; + cur_opt += len; } return NULL; } @@ -460,7 +463,7 @@ }; /* determine if PCO contains given protocol */ -static uint8_t *pco_contains_proto(struct ul255_t *pco, uint16_t prot) +static uint8_t *pco_contains_proto(struct ul255_t *pco, uint16_t prot, size_t prot_minlen) { uint8_t *cur = pco->v + 1; @@ -468,7 +471,7 @@ while (cur + 3 <= pco->v + pco->l) { uint16_t cur_prot = osmo_load16be(cur); uint8_t cur_len = cur[2]; - if (cur_prot == prot) + if (cur_prot == prot && cur_len >= prot_minlen) return cur; cur += cur_len + 3; } @@ -500,35 +503,45 @@ } /* construct an IPCP PCO response from request*/ -static int build_ipcp_pco(struct apn_ctx *apn, struct pdp_t *pdp, struct msgb *msg) +static void build_ipcp_pco(struct apn_ctx *apn, struct pdp_t *pdp, struct msgb *msg) { const struct in46_addr *dns1 = &apn->v4.cfg.dns[0]; const struct in46_addr *dns2 = &apn->v4.cfg.dns[1]; - struct ipcp_hdr *ipcp; + uint8_t *ipcp; + uint16_t ipcp_len; uint8_t *len1, *len2, *pco_ipcp; uint8_t *start = msg->tail; unsigned int len_appended; + ptrdiff_t consumed; + size_t remain; - if (!(pco_ipcp = pco_contains_proto(&pdp->pco_req, PCO_P_IPCP))) - return 0; - ipcp = (struct ipcp_hdr*) (pco_ipcp + 3); /* 2=type + 1=len */ + /* pco_contains_proto() returns a potentially unaligned pointer into pco_req->v (see OS#3194) */ + if (!(pco_ipcp = pco_contains_proto(&pdp->pco_req, PCO_P_IPCP, sizeof(struct ipcp_hdr)))) + return; + + ipcp = (pco_ipcp + 3); /* 2=type + 1=len */ + consumed = (ipcp - &pdp->pco_req.v[0]); + remain = sizeof(pdp->pco_req.v) - consumed; + ipcp_len = osmo_load16be(ipcp + 2); /* 1=code + 1=id */ + if (remain < 0 || remain < ipcp_len) + return; /* Three byte T16L header */ msgb_put_u16(msg, 0x8021); /* IPCP */ len1 = msgb_put(msg, 1); /* Length of contents: delay */ msgb_put_u8(msg, 0x02); /* ACK */ - msgb_put_u8(msg, ipcp->id); /* ID: Needs to match request */ + msgb_put_u8(msg, ipcp[1]); /* ID: Needs to match request */ msgb_put_u8(msg, 0x00); /* Length MSB */ len2 = msgb_put(msg, 1); /* Length LSB: delay */ - if (dns1->len == 4 && ipcp_contains_option(ipcp, IPCP_OPT_PRIMARY_DNS)) { + if (dns1->len == 4 && ipcp_contains_option(ipcp, ipcp_len, IPCP_OPT_PRIMARY_DNS, 4)) { msgb_put_u8(msg, 0x81); /* DNS1 Tag */ msgb_put_u8(msg, 2 + dns1->len);/* DNS1 Length, incl. TL */ msgb_put_u32(msg, ntohl(dns1->v4.s_addr)); } - if (dns2->len == 4 && ipcp_contains_option(ipcp, IPCP_OPT_SECONDARY_DNS)) { + if (dns2->len == 4 && ipcp_contains_option(ipcp, ipcp_len, IPCP_OPT_SECONDARY_DNS, 4)) { msgb_put_u8(msg, 0x83); /* DNS2 Tag */ msgb_put_u8(msg, 2 + dns2->len);/* DNS2 Length, incl. TL */ msgb_put_u32(msg, ntohl(dns2->v4.s_addr)); @@ -538,8 +551,6 @@ len_appended = msg->tail - start; *len1 = len_appended - 3; *len2 = len_appended - 3; - - return 0; } /* process one PCO request from a MS/UE, putting together the proper responses */ @@ -555,7 +566,7 @@ if (peer_v4) build_ipcp_pco(apn, pdp, msg); - if (pco_contains_proto(&pdp->pco_req, PCO_P_DNS_IPv6_ADDR)) { + if (pco_contains_proto(&pdp->pco_req, PCO_P_DNS_IPv6_ADDR, 0)) { for (i = 0; i < ARRAY_SIZE(apn->v6.cfg.dns); i++) { struct in46_addr *i46a = &apn->v6.cfg.dns[i]; if (i46a->len != 16) @@ -564,7 +575,7 @@ } } - if (pco_contains_proto(&pdp->pco_req, PCO_P_DNS_IPv4_ADDR)) { + if (pco_contains_proto(&pdp->pco_req, PCO_P_DNS_IPv4_ADDR, 0)) { for (i = 0; i < ARRAY_SIZE(apn->v4.cfg.dns); i++) { struct in46_addr *i46a = &apn->v4.cfg.dns[i]; if (i46a->len != 4) -- To view, visit https://gerrit.osmocom.org/10054 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ia1410abb216831864042f95679330f4508e1af3d Gerrit-Change-Number: 10054 Gerrit-PatchSet: 4 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 17:18:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 17:18:46 +0000 Subject: Change in osmo-ggsn[master]: fix support for multiple IPCP in PDP protocol configuration options In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10061 ) Change subject: fix support for multiple IPCP in PDP protocol configuration options ...................................................................... fix support for multiple IPCP in PDP protocol configuration options Parse multiple IPCP IEs embedded in Protocol Configuration Options, and return IPCP responses for all of them. Makes the associated TTCN3 GGSN test pass. Depends: Ia1410abb216831864042f95679330f4508e1af3d Change-Id: I51ecab4e35f3ee638e68ca773b0da90cc0294ab0 Related: OS#3319 --- M ggsn/ggsn.c 1 file changed, 40 insertions(+), 35 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, but someone else must approve dexter: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 30584ef..39695b9 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -463,9 +463,9 @@ }; /* determine if PCO contains given protocol */ -static uint8_t *pco_contains_proto(struct ul255_t *pco, uint16_t prot, size_t prot_minlen) +static uint8_t *pco_contains_proto(struct ul255_t *pco, size_t offset, uint16_t prot, size_t prot_minlen) { - uint8_t *cur = pco->v + 1; + uint8_t *cur = pco->v + 1 + offset; /* iterate over PCO and check if protocol contained */ while (cur + 3 <= pco->v + pco->l) { @@ -510,47 +510,52 @@ uint8_t *ipcp; uint16_t ipcp_len; uint8_t *len1, *len2, *pco_ipcp; - uint8_t *start = msg->tail; unsigned int len_appended; ptrdiff_t consumed; - size_t remain; + size_t remain, offset = 0; /* pco_contains_proto() returns a potentially unaligned pointer into pco_req->v (see OS#3194) */ - if (!(pco_ipcp = pco_contains_proto(&pdp->pco_req, PCO_P_IPCP, sizeof(struct ipcp_hdr)))) - return; + pco_ipcp = pco_contains_proto(&pdp->pco_req, offset, PCO_P_IPCP, sizeof(struct ipcp_hdr)); + while (pco_ipcp) { + uint8_t *start = msg->tail; - ipcp = (pco_ipcp + 3); /* 2=type + 1=len */ - consumed = (ipcp - &pdp->pco_req.v[0]); - remain = sizeof(pdp->pco_req.v) - consumed; - ipcp_len = osmo_load16be(ipcp + 2); /* 1=code + 1=id */ - if (remain < 0 || remain < ipcp_len) - return; + ipcp = (pco_ipcp + 3); /* 2=type + 1=len */ + consumed = (ipcp - &pdp->pco_req.v[0]); + remain = sizeof(pdp->pco_req.v) - consumed; + ipcp_len = osmo_load16be(ipcp + 2); /* 1=code + 1=id */ + if (remain < 0 || remain < ipcp_len) + return; - /* Three byte T16L header */ - msgb_put_u16(msg, 0x8021); /* IPCP */ - len1 = msgb_put(msg, 1); /* Length of contents: delay */ + /* Three byte T16L header */ + msgb_put_u16(msg, 0x8021); /* IPCP */ + len1 = msgb_put(msg, 1); /* Length of contents: delay */ - msgb_put_u8(msg, 0x02); /* ACK */ - msgb_put_u8(msg, ipcp[1]); /* ID: Needs to match request */ - msgb_put_u8(msg, 0x00); /* Length MSB */ - len2 = msgb_put(msg, 1); /* Length LSB: delay */ + msgb_put_u8(msg, 0x02); /* ACK */ + msgb_put_u8(msg, ipcp[1]); /* ID: Needs to match request */ + msgb_put_u8(msg, 0x00); /* Length MSB */ + len2 = msgb_put(msg, 1); /* Length LSB: delay */ - if (dns1->len == 4 && ipcp_contains_option(ipcp, ipcp_len, IPCP_OPT_PRIMARY_DNS, 4)) { - msgb_put_u8(msg, 0x81); /* DNS1 Tag */ - msgb_put_u8(msg, 2 + dns1->len);/* DNS1 Length, incl. TL */ - msgb_put_u32(msg, ntohl(dns1->v4.s_addr)); + if (dns1->len == 4 && ipcp_contains_option(ipcp, ipcp_len, IPCP_OPT_PRIMARY_DNS, 4)) { + msgb_put_u8(msg, 0x81); /* DNS1 Tag */ + msgb_put_u8(msg, 2 + dns1->len);/* DNS1 Length, incl. TL */ + msgb_put_u32(msg, ntohl(dns1->v4.s_addr)); + } + + if (dns2->len == 4 && ipcp_contains_option(ipcp, ipcp_len, IPCP_OPT_SECONDARY_DNS, 4)) { + msgb_put_u8(msg, 0x83); /* DNS2 Tag */ + msgb_put_u8(msg, 2 + dns2->len);/* DNS2 Length, incl. TL */ + msgb_put_u32(msg, ntohl(dns2->v4.s_addr)); + } + + /* patch in length values */ + len_appended = msg->tail - start; + *len1 = len_appended - 3; + *len2 = len_appended - 3; + + offset += 3 + ipcp_len; + pco_ipcp = pco_contains_proto(&pdp->pco_req, offset, PCO_P_IPCP, sizeof(struct ipcp_hdr)); } - if (dns2->len == 4 && ipcp_contains_option(ipcp, ipcp_len, IPCP_OPT_SECONDARY_DNS, 4)) { - msgb_put_u8(msg, 0x83); /* DNS2 Tag */ - msgb_put_u8(msg, 2 + dns2->len);/* DNS2 Length, incl. TL */ - msgb_put_u32(msg, ntohl(dns2->v4.s_addr)); - } - - /* patch in length values */ - len_appended = msg->tail - start; - *len1 = len_appended - 3; - *len2 = len_appended - 3; } /* process one PCO request from a MS/UE, putting together the proper responses */ @@ -566,7 +571,7 @@ if (peer_v4) build_ipcp_pco(apn, pdp, msg); - if (pco_contains_proto(&pdp->pco_req, PCO_P_DNS_IPv6_ADDR, 0)) { + if (pco_contains_proto(&pdp->pco_req, 0, PCO_P_DNS_IPv6_ADDR, 0)) { for (i = 0; i < ARRAY_SIZE(apn->v6.cfg.dns); i++) { struct in46_addr *i46a = &apn->v6.cfg.dns[i]; if (i46a->len != 16) @@ -575,7 +580,7 @@ } } - if (pco_contains_proto(&pdp->pco_req, PCO_P_DNS_IPv4_ADDR, 0)) { + if (pco_contains_proto(&pdp->pco_req, 0, PCO_P_DNS_IPv4_ADDR, 0)) { for (i = 0; i < ARRAY_SIZE(apn->v4.cfg.dns); i++) { struct in46_addr *i46a = &apn->v4.cfg.dns[i]; if (i46a->len != 4) -- To view, visit https://gerrit.osmocom.org/10061 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I51ecab4e35f3ee638e68ca773b0da90cc0294ab0 Gerrit-Change-Number: 10061 Gerrit-PatchSet: 2 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 17:21:31 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 17:21:31 +0000 Subject: Change in osmo-ggsn[master]: gtp: Pass originating pdp ctx to recovery_cb In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10024 ) Change subject: gtp: Pass originating pdp ctx to recovery_cb ...................................................................... Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/10024/2//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/10024/2//COMMIT_MSG at 9 PS2, Line 9: This commit breaks API and old apps will fail to compile if using the : cb_recovery does this mean that any older version of osmo-{sgsn,ggsn,gtphub} will fail to compile against a new version of libgtp? If so, we have to find a different method, sorry. -- To view, visit https://gerrit.osmocom.org/10024 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I53e92298f2f6b84d662a3300d922e8c2ccb178bc Gerrit-Change-Number: 10024 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Sat, 21 Jul 2018 17:21:31 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 17:22:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 17:22:52 +0000 Subject: Change in osmo-ggsn[master]: gtp: Add new API to avoid freeing pdp contexts during DEL CTX REQ In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10006 ) Change subject: gtp: Add new API to avoid freeing pdp contexts during DEL CTX REQ ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10006 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I29d366253bb98dcba328c7ce8aa3e4daf8f75e6c Gerrit-Change-Number: 10006 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Sat, 21 Jul 2018 17:22:52 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 17:22:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 17:22:54 +0000 Subject: Change in osmo-ggsn[master]: gtp: Add new API to avoid freeing pdp contexts during DEL CTX REQ In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10006 ) Change subject: gtp: Add new API to avoid freeing pdp contexts during DEL CTX REQ ...................................................................... gtp: Add new API to avoid freeing pdp contexts during DEL CTX REQ With this API, user is expectd to free the PDP ctx when the confirmation for the release has been received (cb_conf time). This way user can maintain the pdp ctx alive during all this time. Extra code is added to gtp_delete_pdp_resp() since it's now possible to match it and push it up to the user cb_conf. This way, cb_conf() can be used for locally-initiated DEL CTX REQ, while delete_context() cb is left for remotely-initiated DEL CTX REQ. In this later case, when the DEL CTX RESP is sent the ctx is deleted and the delete_context() is called, where the user can do related actions or trigger consequence events (in the case of SGSN, it will drop all related GGSN bits for that PDP ctx and forward the DEACT PDP CTX to the MS). Change-Id: I29d366253bb98dcba328c7ce8aa3e4daf8f75e6c --- M gtp/gtp.c M gtp/gtp.h 2 files changed, 74 insertions(+), 38 deletions(-) Approvals: Harald Welte: Looks good to me, approved Neels Hofmeyr: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/gtp/gtp.c b/gtp/gtp.c index 1309cb5..95abbef 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -2337,16 +2337,66 @@ return EOF; } -/* API: Send Delete PDP Context Request */ +/* API: Deprecated. Send Delete PDP Context Request And free pdp ctx. */ int gtp_delete_context_req(struct gsn_t *gsn, struct pdp_t *pdp, void *cbp, int teardown) { + struct pdp_t *linked_pdp; + struct pdp_t *secondary_pdp; + int n; + + if (pdp_getgtp1(&linked_pdp, pdp->teic_own)) { + LOGP(DLGTP, LOGL_ERROR, + "Unknown linked PDP context: %u\n", pdp->teic_own); + return EOF; + } + + if (gtp_delete_context_req2(gsn, pdp, cbp, teardown) == EOF) + return EOF; + + if (teardown) { /* Remove all contexts */ + for (n = 0; n < PDP_MAXNSAPI; n++) { + if (linked_pdp->secondary_tei[n]) { + if (pdp_getgtp1 + (&secondary_pdp, + linked_pdp->secondary_tei[n])) { + LOGP(DLGTP, LOGL_ERROR, + "Unknown secondary PDP context\n"); + return EOF; + } + if (linked_pdp != secondary_pdp) { + if (gsn->cb_delete_context) + gsn->cb_delete_context + (secondary_pdp); + pdp_freepdp(secondary_pdp); + } + } + } + if (gsn->cb_delete_context) + gsn->cb_delete_context(linked_pdp); + pdp_freepdp(linked_pdp); + } else { + if (gsn->cb_delete_context) + gsn->cb_delete_context(pdp); + if (pdp == linked_pdp) { + linked_pdp->secondary_tei[pdp->nsapi & 0xf0] = 0; + linked_pdp->nodata = 1; + } else + pdp_freepdp(pdp); + } + + return 0; +} + +/* API: Send Delete PDP Context Request. PDP CTX shall be free'd by user at cb_conf(GTP_DELETE_PDP_RSP) */ +int gtp_delete_context_req2(struct gsn_t *gsn, struct pdp_t *pdp, void *cbp, + int teardown) +{ union gtp_packet packet; unsigned int length = get_default_gtp(pdp->version, GTP_DELETE_PDP_REQ, &packet); struct in_addr addr; struct pdp_t *linked_pdp; - struct pdp_t *secondary_pdp; int n; int count = 0; @@ -2383,37 +2433,6 @@ gtp_req(gsn, pdp->version, pdp, &packet, length, &addr, cbp); - if (teardown) { /* Remove all contexts */ - for (n = 0; n < PDP_MAXNSAPI; n++) { - if (linked_pdp->secondary_tei[n]) { - if (pdp_getgtp1 - (&secondary_pdp, - linked_pdp->secondary_tei[n])) { - LOGP(DLGTP, LOGL_ERROR, - "Unknown secondary PDP context\n"); - return EOF; - } - if (linked_pdp != secondary_pdp) { - if (gsn->cb_delete_context) - gsn->cb_delete_context - (secondary_pdp); - pdp_freepdp(secondary_pdp); - } - } - } - if (gsn->cb_delete_context) - gsn->cb_delete_context(linked_pdp); - pdp_freepdp(linked_pdp); - } else { - if (gsn->cb_delete_context) - gsn->cb_delete_context(pdp); - if (pdp == linked_pdp) { - linked_pdp->secondary_tei[pdp->nsapi & 0xf0] = 0; - linked_pdp->nodata = 1; - } else - pdp_freepdp(pdp); - } - return 0; } @@ -2573,19 +2592,32 @@ uint8_t cause; void *cbp = NULL; uint8_t type = 0; + struct pdp_t *pdp = NULL; int hlen = get_hlen(pack); /* Remove packet from queue */ if (gtp_conf(gsn, version, peer, pack, len, &type, &cbp)) return EOF; + /* Find the context in question. It may not be available if gtp_delete_context_req + * was used and as a result the PDP ctx was already freed */ + if (pdp_getgtp1(&pdp, get_tei(pack))) { + gsn->err_unknownpdp++; + GTP_LOGPKG(LOGL_NOTICE, peer, pack, len, + "Unknown PDP context: %u (expected if gtp_delete_context_req is used)\n", + get_tei(pack)); + if (gsn->cb_conf) + gsn->cb_conf(type, EOF, NULL, cbp); + return EOF; + } + /* Decode information elements */ if (gtpie_decaps(ie, version, pack + hlen, len - hlen)) { gsn->invalid++; GTP_LOGPKG(LOGL_ERROR, peer, pack, len, "Invalid message format\n"); if (gsn->cb_conf) - gsn->cb_conf(type, EOF, NULL, cbp); + gsn->cb_conf(type, EOF, pdp, cbp); return EOF; } @@ -2595,7 +2627,7 @@ GTP_LOGPKG(LOGL_ERROR, peer, pack, len, "Missing mandatory information field\n"); if (gsn->cb_conf) - gsn->cb_conf(type, EOF, NULL, cbp); + gsn->cb_conf(type, EOF, pdp, cbp); return EOF; } @@ -2605,13 +2637,13 @@ GTP_LOGPKG(LOGL_ERROR, peer, pack, len, "Unexpected cause value received: %d\n", cause); if (gsn->cb_conf) - gsn->cb_conf(type, cause, NULL, cbp); + gsn->cb_conf(type, cause, pdp, cbp); return EOF; } /* Callback function to notify application */ if (gsn->cb_conf) - gsn->cb_conf(type, cause, NULL, cbp); + gsn->cb_conf(type, cause, pdp, cbp); return 0; } diff --git a/gtp/gtp.h b/gtp/gtp.h index 8f8e293..f185424 100644 --- a/gtp/gtp.h +++ b/gtp/gtp.h @@ -13,6 +13,7 @@ #define _GTP_H #include +#include #define GTP_MODE_GGSN 1 #define GTP_MODE_SGSN 2 @@ -323,7 +324,10 @@ void *cbp, struct in_addr *inetaddr); extern int gtp_delete_context_req(struct gsn_t *gsn, struct pdp_t *pdp, - void *cbp, int teardown); + void *cbp, int teardown) + OSMO_DEPRECATED("Use gtp_delete_context_req2() instead, to avoid freeing pdp ctx before reply"); +extern int gtp_delete_context_req2(struct gsn_t *gsn, struct pdp_t *pdp, + void *cbp, int teardown); extern int gtp_data_req(struct gsn_t *gsn, struct pdp_t *pdp, void *pack, unsigned len); -- To view, visit https://gerrit.osmocom.org/10006 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I29d366253bb98dcba328c7ce8aa3e4daf8f75e6c Gerrit-Change-Number: 10006 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 17:25:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 17:25:22 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: Add Test to verify timer t3395 In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10009 ) Change subject: sgsn: Add Test to verify timer t3395 ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10009 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9ec0863603692045b0d8da376e65080150066173 Gerrit-Change-Number: 10009 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Sat, 21 Jul 2018 17:25:22 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 17:51:26 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 17:51:26 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: Add Test to verify Recovery procedure during CreatePdpResp In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10023 ) Change subject: sgsn: Add Test to verify Recovery procedure during CreatePdpResp ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10023 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic81b854967492194367b7ce8a667c29c777791bf Gerrit-Change-Number: 10023 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Sat, 21 Jul 2018 17:51:26 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 17:52:39 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 17:52:39 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: Remove uneeded f_gtpu_send in f_gtpu_xceive_mo In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10035 ) Change subject: sgsn: Remove uneeded f_gtpu_send in f_gtpu_xceive_mo ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10035 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ide226f8501c4598e2bfaa5f1ea62c3ff20807ce4 Gerrit-Change-Number: 10035 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Sat, 21 Jul 2018 17:52:39 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 17:52:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 17:52:55 +0000 Subject: Change in osmo-ttcn3-hacks[master]: lib: gtp: Add templates to send ErrorIndiciation In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10036 ) Change subject: lib: gtp: Add templates to send ErrorIndiciation ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10036 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7c20bc3b62a953efe57eb05a8ba89f9f0830a816 Gerrit-Change-Number: 10036 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Sat, 21 Jul 2018 17:52:55 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 17:54:33 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 17:54:33 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: Add test to verify GPRS ctx deact caused by GTP ErrorInd In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10037 ) Change subject: sgsn: Add test to verify GPRS ctx deact caused by GTP ErrorInd ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10037 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I40e877f4126e62a731b071ae1d6d855fed210433 Gerrit-Change-Number: 10037 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Sat, 21 Jul 2018 17:54:33 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 17:54:35 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 17:54:35 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: Add Test to verify timer t3395 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10009 ) Change subject: sgsn: Add Test to verify timer t3395 ...................................................................... sgsn: Add Test to verify timer t3395 Change-Id: I9ec0863603692045b0d8da376e65080150066173 --- M sgsn/SGSN_Tests.ttcn M sgsn/expected-results.xml 2 files changed, 39 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 214239e..782d89c 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -1303,6 +1303,42 @@ g_use_echo := false } +/* ATTACH + PDP CTX ACT + user plane traffic + PDP CTX DEACT in MT direction + trigger T3395 */ +private function f_TC_attach_pdp_act_deact_mt_t3395_expire(charstring id) runs on BSSGP_ConnHdlr { + var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip)); + var integer seq_nr := 23; + var GtpPeer peer; + var integer i; + + /* first perform regular attach */ + f_TC_attach(id); + /* then activate PDP context */ + f_pdp_ctx_act(apars); + + BSSGP.clear; + peer := valueof(ts_GtpPeerC(apars.sgsn_ip_c)); + GTP.send(ts_GTPC_DeletePDP(peer, seq_nr, apars.sgsn_tei_c, apars.nsapi, '1'B)); + + for (i := 0; i < 5; i := i+1) { + alt { + [] BSSGP.receive(tr_BD_L3_MT(tr_SM_DEACT_PDP_REQ_MT(apars.tid, ?, true))) {} + [] as_xid(apars); + } + } + + GTP.receive(tr_GTPC_MsgType(?, deletePDPContextResponse, apars.ggsn_tei_c)) {} + + BSSGP.send(ts_SM_DEACT_PDP_ACCEPT_MO(apars.tid)); + setverdict(pass); +} +testcase TC_attach_pdp_act_deact_mt_t3395_expire() runs on test_CT { + var BSSGP_ConnHdlr vc_conn; + f_init(); + f_sleep(1.0); + vc_conn := f_start_handler(refers(f_TC_attach_pdp_act_deact_mt_t3395_expire), testcasename(), g_gb[0], 25, 60.0); + vc_conn.done; +} + private function f_TC_hlr_location_cancel_request_update(charstring id) runs on BSSGP_ConnHdlr { /* MS: perform regular attach */ f_TC_attach(id); @@ -1678,6 +1714,7 @@ execute( TC_attach_pdp_act_user_deact_mt() ); execute( TC_attach_second_attempt() ); execute( TC_attach_restart_ctr_dettach() ); + execute( TC_attach_pdp_act_deact_mt_t3395_expire() ); } diff --git a/sgsn/expected-results.xml b/sgsn/expected-results.xml index 2d7063b..f2bf327 100644 --- a/sgsn/expected-results.xml +++ b/sgsn/expected-results.xml @@ -1,5 +1,5 @@ - + @@ -61,4 +61,5 @@ + -- To view, visit https://gerrit.osmocom.org/10009 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I9ec0863603692045b0d8da376e65080150066173 Gerrit-Change-Number: 10009 Gerrit-PatchSet: 4 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 17:54:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 17:54:36 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: Add Test to verify Recovery procedure during CreatePdpResp In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10023 ) Change subject: sgsn: Add Test to verify Recovery procedure during CreatePdpResp ...................................................................... sgsn: Add Test to verify Recovery procedure during CreatePdpResp Change-Id: Ic81b854967492194367b7ce8a667c29c777791bf --- M library/GTP_Templates.ttcn M sgsn/SGSN_Tests.ttcn M sgsn/expected-results.xml 3 files changed, 60 insertions(+), 10 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/GTP_Templates.ttcn b/library/GTP_Templates.ttcn index a222b2e..a9d2394 100644 --- a/library/GTP_Templates.ttcn +++ b/library/GTP_Templates.ttcn @@ -308,11 +308,12 @@ template GTPC_PDUs ts_CreatePdpRespPDU(OCT1 cause, OCT4 teid_data, OCT4 teid_ctrl, BIT4 nsapi, octetstring ggsn_ip_sign, octetstring ggsn_ip_data, OCT4 chg_id, template EndUserAddress eua := omit, + template Recovery_gtpc recovery := omit, template ProtConfigOptions pco := omit) := { createPDPContextResponse := { cause := { '00'O, cause }, reorderingRequired := ts_ReorderReq(false), - recovery := omit, + recovery := recovery, teidDataI := { type_gtpc := '00'O, teidDataI := teid_data @@ -352,12 +353,13 @@ BIT4 nsapi, octetstring ggsn_ip_sign, octetstring ggsn_ip_data, OCT4 chg_id, template EndUserAddress eua := omit, + template Recovery_gtpc recovery := omit, template ProtConfigOptions pco := omit) := { peer := peer, gtpc := ts_GTP1C_PDU(createPDPContextResponse, teid, valueof(ts_CreatePdpRespPDU(cause, teid_data, teid_ctrl, nsapi, ggsn_ip_sign, ggsn_ip_data, chg_id, - eua, pco)), seq) + eua, recovery, pco)), seq) } /* PCO send base template */ diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 782d89c..d7e956f 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -903,9 +903,14 @@ f_gtp_register_teid(apars.ggsn_tei_u); } -function f_pdp_ctx_act(inout PdpActPars apars) runs on BSSGP_ConnHdlr { +function f_pdp_ctx_act(inout PdpActPars apars, boolean send_recovery := false) runs on BSSGP_ConnHdlr { var boolean exp_rej := ispresent(apars.exp_rej_cause); var Gtp1cUnitdata g_ud; + var template Recovery_gtpc recovery := omit; + + if (send_recovery) { + recovery := ts_Recovery(apars.ggsn_restart_ctr); + } BSSGP.send(ts_SM_ACT_PDP_REQ(apars.tid, apars.nsapi, apars.sapi, apars.qos, apars.addr, apars.apn, apars.pco)); @@ -916,7 +921,8 @@ apars.sgsn_tei_c, apars.gtp_resp_cause, apars.ggsn_tei_c, apars.ggsn_tei_u, apars.nsapi, - apars.ggsn_ip_c, apars.ggsn_ip_u, apars.chg_id)); + apars.ggsn_ip_c, apars.ggsn_ip_u, apars.chg_id, + omit, recovery)); } alt { [exp_rej] BSSGP.receive(tr_BD_L3_MT(tr_SM_ACT_PDP_REJ(apars.tid, apars.exp_rej_cause))) { @@ -1263,7 +1269,7 @@ vc_conn.done; } -private function f_TC_attach_restart_ctr_dettach(charstring id) runs on BSSGP_ConnHdlr { +private function f_TC_attach_restart_ctr_echo(charstring id) runs on BSSGP_ConnHdlr { var Gtp1cUnitdata g_ud; var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip)); @@ -1294,15 +1300,55 @@ } setverdict(pass); } -testcase TC_attach_restart_ctr_dettach() runs on test_CT { +/* ATTACH + trigger Recovery procedure through EchoResp */ +testcase TC_attach_restart_ctr_echo() runs on test_CT { var BSSGP_ConnHdlr vc_conn; g_use_echo := true f_init(); - vc_conn := f_start_handler(refers(f_TC_attach_restart_ctr_dettach), testcasename(), g_gb[0], 23, 30.0); + vc_conn := f_start_handler(refers(f_TC_attach_restart_ctr_echo), testcasename(), g_gb[0], 23, 30.0); vc_conn.done; g_use_echo := false } +private function f_TC_attach_restart_ctr_create(charstring id) runs on BSSGP_ConnHdlr { + var Gtp1cUnitdata g_ud; + var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip)); + var integer seq_nr := 23; + var GtpPeer peer; + /* first perform regular attach */ + f_TC_attach(id); + + /* Use this CTX ACT to send initial Restart counter to SGSN. */ + apars.gtp_resp_cause := int2oct(199, 1); /* no resources available */ + apars.exp_rej_cause := '1a'O; /* insufficient resources */ + f_pdp_ctx_act(apars, true); + + /* Increment restart_ctr. This will fake a restarted GGSN when CreatePdpResp is +/* received. */ + apars.ggsn_restart_ctr := int2oct(oct2int(apars.ggsn_restart_ctr) + 1, 1); + + /* FIXME: Once we can easily handle different pdp ctx simultaneously, it + would be great to have an active pdp context here before triggering + Recovery, and making sure the the DEACT request is sent by the SGSN. + */ + + /* Activate a pdp context against the GGSN, send incremented Recovery + IE. This should trigger the recovery path, but still this specific + CTX activation should work. */ + apars.exp_rej_cause := omit; /* default value for tests */ + apars.gtp_resp_cause := int2oct(128, 1); /* default value for tests */ + f_pdp_ctx_act(apars, true); + + setverdict(pass); +} +/* ATTACH + trigger Recovery procedure through CreatePdpResp */ +testcase TC_attach_restart_ctr_create() runs on test_CT { + var BSSGP_ConnHdlr vc_conn; + f_init(); + vc_conn := f_start_handler(refers(f_TC_attach_restart_ctr_create), testcasename(), g_gb[0], 24, 30.0); + vc_conn.done; +} + /* ATTACH + PDP CTX ACT + user plane traffic + PDP CTX DEACT in MT direction + trigger T3395 */ private function f_TC_attach_pdp_act_deact_mt_t3395_expire(charstring id) runs on BSSGP_ConnHdlr { var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip)); @@ -1713,7 +1759,8 @@ execute( TC_attach_pdp_act_user_deact_mo() ); execute( TC_attach_pdp_act_user_deact_mt() ); execute( TC_attach_second_attempt() ); - execute( TC_attach_restart_ctr_dettach() ); + execute( TC_attach_restart_ctr_echo() ); + execute( TC_attach_restart_ctr_create() ); execute( TC_attach_pdp_act_deact_mt_t3395_expire() ); } diff --git a/sgsn/expected-results.xml b/sgsn/expected-results.xml index f2bf327..5b756cd 100644 --- a/sgsn/expected-results.xml +++ b/sgsn/expected-results.xml @@ -1,5 +1,5 @@ - + @@ -60,6 +60,7 @@ - + + -- To view, visit https://gerrit.osmocom.org/10023 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ic81b854967492194367b7ce8a667c29c777791bf Gerrit-Change-Number: 10023 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 17:54:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 17:54:36 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: Remove uneeded f_gtpu_send in f_gtpu_xceive_mo In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10035 ) Change subject: sgsn: Remove uneeded f_gtpu_send in f_gtpu_xceive_mo ...................................................................... sgsn: Remove uneeded f_gtpu_send in f_gtpu_xceive_mo It's not needed for the functionality/scenario of f_gtpu_xceive_mo. It probably was left in when creating it from f_gtpu_xceive_mo. Change-Id: Ide226f8501c4598e2bfaa5f1ea62c3ff20807ce4 --- M sgsn/SGSN_Tests.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index d7e956f..d76c182 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -1117,12 +1117,12 @@ } } +/* Transceive given 'payload' as MT message from Gb -> OsmoSGSN -> GTP */ private function f_gtpu_xceive_mo(inout PdpActPars apars, octetstring payload) runs on BSSGP_ConnHdlr { /* Send PDU via SNDCP/LLC/BSSGP/NS via simulated MS/PCU to the SGSN */ var GtpPeer peer := valueof(ts_GtpPeerU(apars.sgsn_ip_u)); var PDU_SN sndcp := valueof(ts_SN_UD(apars.nsapi, payload)); BSSGP.send(ts_LLC_UI(enc_PDU_SN(sndcp), apars.sapi, '0'B, 0)); - f_gtpu_send(apars, payload); /* Expect PDU via GTP from SGSN on simulated GGSN */ alt { [] GTP.receive(tr_GTPU_GPDU(peer, apars.ggsn_tei_u, payload)); -- To view, visit https://gerrit.osmocom.org/10035 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ide226f8501c4598e2bfaa5f1ea62c3ff20807ce4 Gerrit-Change-Number: 10035 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 17:54:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 17:54:36 +0000 Subject: Change in osmo-ttcn3-hacks[master]: lib: gtp: Add templates to send ErrorIndiciation In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10036 ) Change subject: lib: gtp: Add templates to send ErrorIndiciation ...................................................................... lib: gtp: Add templates to send ErrorIndiciation Change-Id: I7c20bc3b62a953efe57eb05a8ba89f9f0830a816 --- M library/GTP_Templates.ttcn 1 file changed, 25 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Neels Hofmeyr: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/library/GTP_Templates.ttcn b/library/GTP_Templates.ttcn index a9d2394..d0a87e3 100644 --- a/library/GTP_Templates.ttcn +++ b/library/GTP_Templates.ttcn @@ -667,6 +667,31 @@ gtpu := ts_GTP1U_PDU(echoResponse, seq, '00000000'O, valueof(ts_UEchoRespPDU(rest_ctr))) } + template GSNAddress_gtpu ts_UGsnAddr(octetstring ip_addr) := { + type_gtpu := '85'O, + lengthf := lengthof(ip_addr), + gSNAddressValue := ip_addr + } + + template TeidDataI_gtpu ts_UteidDataI(OCT4 teid) := { + type_gtpu := '10'O, + teidDataI := teid + } + + template GTPU_IEs ts_UErrorIndication(OCT4 teid, octetstring gsn_addr) := { + errorIndication_IEs := { + teidDataI_gtpu := ts_UteidDataI(teid), + gSNAddress_gtpu := ts_UGsnAddr(gsn_addr), + private_extension_gtpu := omit + } + } + + /* master template for sending a GTP-U Error indication */ + template Gtp1uUnitdata ts_GTPU_ErrorIndication(GtpPeer peer, uint16_t seq, OCT4 teid, octetstring gsn_addr) := { + peer := peer, + gtpu := ts_GTP1U_PDU('1A'O, seq, '00000000'O, valueof(ts_UErrorIndication(teid, gsn_addr))) + } + /* master template for sending a GTP-U user plane data */ template Gtp1uUnitdata ts_GTP1U_GPDU(GtpPeer peer, template (omit) uint16_t seq, OCT4 teid, octetstring data) := { peer := peer, -- To view, visit https://gerrit.osmocom.org/10036 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I7c20bc3b62a953efe57eb05a8ba89f9f0830a816 Gerrit-Change-Number: 10036 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 17:54:37 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 21 Jul 2018 17:54:37 +0000 Subject: Change in osmo-ttcn3-hacks[master]: sgsn: Add test to verify GPRS ctx deact caused by GTP ErrorInd In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10037 ) Change subject: sgsn: Add test to verify GPRS ctx deact caused by GTP ErrorInd ...................................................................... sgsn: Add test to verify GPRS ctx deact caused by GTP ErrorInd Change-Id: I40e877f4126e62a731b071ae1d6d855fed210433 --- M sgsn/SGSN_Tests.ttcn M sgsn/expected-results.xml 2 files changed, 33 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Neels Hofmeyr: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index d76c182..78086af 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -959,19 +959,22 @@ } } -function f_pdp_ctx_deact_mt(inout PdpActPars apars, OCT1 cause) runs on BSSGP_ConnHdlr { +function f_pdp_ctx_deact_mt(inout PdpActPars apars, boolean error_ind := false) runs on BSSGP_ConnHdlr { var Gtp1cUnitdata g_ud; var integer seq_nr := 23; var GtpPeer peer := valueof(ts_GtpPeerC(apars.sgsn_ip_c)); BSSGP.clear; - GTP.send(ts_GTPC_DeletePDP(peer, seq_nr, apars.sgsn_tei_c, apars.nsapi, '1'B)); - - interleave { + if (error_ind) { + GTP.send(ts_GTPU_ErrorIndication(peer, 0 /* seq */, apars.ggsn_tei_u, apars.ggsn_ip_u)); + } else { + GTP.send(ts_GTPC_DeletePDP(peer, seq_nr, apars.sgsn_tei_c, apars.nsapi, '1'B)); + } + alt { [] BSSGP.receive(tr_BD_L3_MT(tr_SM_DEACT_PDP_REQ_MT(apars.tid, ?, true))) { BSSGP.send(ts_SM_DEACT_PDP_ACCEPT_MO(apars.tid)); } - [] GTP.receive(tr_GTPC_MsgType(?, deletePDPContextResponse, apars.ggsn_tei_c)) { } + [not error_ind] GTP.receive(tr_GTPC_MsgType(?, deletePDPContextResponse, apars.ggsn_tei_c)) { } } } @@ -1241,7 +1244,7 @@ f_gtpu_xceive_mt(apars, f_rnd_octstring(100)); f_gtpu_xceive_mo(apars, f_rnd_octstring(200)); - f_pdp_ctx_deact_mt(apars, '00'O); + f_pdp_ctx_deact_mt(apars, false); } testcase TC_attach_pdp_act_user_deact_mt() runs on test_CT { var BSSGP_ConnHdlr vc_conn; @@ -1411,6 +1414,27 @@ } } +/* ATTACH + PDP CTX ACT + user plane traffic + ERROR IND in MT direction */ +private function f_TC_attach_pdp_act_user_error_ind_ggsn(charstring id) runs on BSSGP_ConnHdlr { + var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip)); + + /* first perform regular attach */ + f_TC_attach(id); + /* then activate PDP context */ + f_pdp_ctx_act(apars); + /* then transceive a downlink PDU */ + f_gtpu_xceive_mo(apars, f_rnd_octstring(200)); + + /* Send Error indication as response from upload PDU and expect deact towards MS */ + f_pdp_ctx_deact_mt(apars, true); +} +testcase TC_attach_pdp_act_user_error_ind_ggsn() runs on test_CT { + var BSSGP_ConnHdlr vc_conn; + f_init(); + vc_conn := f_start_handler(refers(f_TC_attach_pdp_act_user_error_ind_ggsn), testcasename(), g_gb[0], 26); + vc_conn.done; +} + testcase TC_hlr_location_cancel_request_update() runs on test_CT { /* MS <-> SGSN: GMM Attach * HLR -> SGSN: Cancel Location Request @@ -1762,6 +1786,7 @@ execute( TC_attach_restart_ctr_echo() ); execute( TC_attach_restart_ctr_create() ); execute( TC_attach_pdp_act_deact_mt_t3395_expire() ); + execute( TC_attach_pdp_act_user_error_ind_ggsn() ); } diff --git a/sgsn/expected-results.xml b/sgsn/expected-results.xml index 5b756cd..bb38a7c 100644 --- a/sgsn/expected-results.xml +++ b/sgsn/expected-results.xml @@ -1,5 +1,5 @@ - + @@ -63,4 +63,5 @@ + -- To view, visit https://gerrit.osmocom.org/10037 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I40e877f4126e62a731b071ae1d6d855fed210433 Gerrit-Change-Number: 10037 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 22:13:53 2018 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sat, 21 Jul 2018 22:13:53 +0000 Subject: Change in osmocom-bb[master]: Move from libc random() to osmo_get_rand_id (2nd attempt) Message-ID: Holger Freyther has uploaded this change for review. ( https://gerrit.osmocom.org/10098 Change subject: Move from libc random() to osmo_get_rand_id (2nd attempt) ...................................................................... Move from libc random() to osmo_get_rand_id (2nd attempt) When starting multiple mobile in the same second, the libc random number generator will be seeded to exactly the same value. The random bits inside the RACH request(s) will be exactly the same across multiple mobile and when the channel fails they all pick the same randomized back-off timing. Use stronger random numbers and replace all calls to random(2) with osmo_get_rand_id. Add a fallback to try random(). [v2: Add helper to make sure the result is int and between 0 and RAND_MAX] Change-Id: Icdd4be88c62bba1e9d954568e48f0c12a67ac182 --- M src/host/layer23/include/osmocom/bb/mobile/Makefile.am A src/host/layer23/include/osmocom/bb/mobile/utils.h M src/host/layer23/src/mobile/Makefile.am M src/host/layer23/src/mobile/gsm322.c M src/host/layer23/src/mobile/gsm48_mm.c M src/host/layer23/src/mobile/gsm48_rr.c M src/host/layer23/src/mobile/settings.c A src/host/layer23/src/mobile/utils.c 8 files changed, 64 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/98/10098/1 diff --git a/src/host/layer23/include/osmocom/bb/mobile/Makefile.am b/src/host/layer23/include/osmocom/bb/mobile/Makefile.am index 12cf24b..d2b4f2a 100644 --- a/src/host/layer23/include/osmocom/bb/mobile/Makefile.am +++ b/src/host/layer23/include/osmocom/bb/mobile/Makefile.am @@ -1,3 +1,3 @@ noinst_HEADERS = gsm322.h gsm480_ss.h gsm411_sms.h gsm48_cc.h gsm48_mm.h \ gsm48_rr.h mncc.h settings.h subscriber.h support.h \ - transaction.h vty.h mncc_sock.h primitives.h + transaction.h vty.h mncc_sock.h primitives.h utils.h diff --git a/src/host/layer23/include/osmocom/bb/mobile/utils.h b/src/host/layer23/include/osmocom/bb/mobile/utils.h new file mode 100644 index 0000000..30f09ff --- /dev/null +++ b/src/host/layer23/include/osmocom/bb/mobile/utils.h @@ -0,0 +1,3 @@ +#pragma once + +int mobile_random(void); diff --git a/src/host/layer23/src/mobile/Makefile.am b/src/host/layer23/src/mobile/Makefile.am index 4e80e4e..f541565 100644 --- a/src/host/layer23/src/mobile/Makefile.am +++ b/src/host/layer23/src/mobile/Makefile.am @@ -5,7 +5,7 @@ noinst_LIBRARIES = libmobile.a libmobile_a_SOURCES = gsm322.c gsm480_ss.c gsm411_sms.c gsm48_cc.c gsm48_mm.c \ gsm48_rr.c mnccms.c settings.c subscriber.c support.c \ - transaction.c vty_interface.c voice.c mncc_sock.c primitives.c + transaction.c vty_interface.c voice.c mncc_sock.c primitives.c utils.c bin_PROGRAMS = mobile diff --git a/src/host/layer23/src/mobile/gsm322.c b/src/host/layer23/src/mobile/gsm322.c index c3485b6..f49b97d 100644 --- a/src/host/layer23/src/mobile/gsm322.c +++ b/src/host/layer23/src/mobile/gsm322.c @@ -40,6 +40,7 @@ #include #include #include +#include #include @@ -959,7 +960,7 @@ entries++; } while(entries) { - move = random() % entries; + move = mobile_random() % entries; i = 0; llist_for_each_entry(temp, &temp_list, entry) { if (rxlev2dbm(temp->rxlev) > -85) { diff --git a/src/host/layer23/src/mobile/gsm48_mm.c b/src/host/layer23/src/mobile/gsm48_mm.c index a7af1f5..c7cea65 100644 --- a/src/host/layer23/src/mobile/gsm48_mm.c +++ b/src/host/layer23/src/mobile/gsm48_mm.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -41,6 +42,7 @@ #include #include #include +#include extern void *l23_ctx; @@ -2099,7 +2101,7 @@ mm->t3212.timeout.tv_sec = current_time.tv_sec + (t % s->t3212); } else { - uint32_t rand = random(); + uint32_t rand = mobile_random(); LOGP(DMM, LOGL_INFO, "New T3212 while timer is not " "running (value %d)\n", s->t3212); diff --git a/src/host/layer23/src/mobile/gsm48_rr.c b/src/host/layer23/src/mobile/gsm48_rr.c index dd3fe93..5921c76 100644 --- a/src/host/layer23/src/mobile/gsm48_rr.c +++ b/src/host/layer23/src/mobile/gsm48_rr.c @@ -71,6 +71,7 @@ #include #include #include +#include #include #include @@ -79,6 +80,7 @@ #include #include #include +#include #include @@ -1628,7 +1630,7 @@ } } - chan_req = random(); + chan_req = mobile_random(); chan_req &= rr->chan_req_mask; chan_req |= rr->chan_req_val; diff --git a/src/host/layer23/src/mobile/settings.c b/src/host/layer23/src/mobile/settings.c index 7370b0a..908b4b4 100644 --- a/src/host/layer23/src/mobile/settings.c +++ b/src/host/layer23/src/mobile/settings.c @@ -23,8 +23,10 @@ #include #include #include +#include #include +#include #include #include #include @@ -184,8 +186,8 @@ if (digits > 15) digits = 15; - sprintf(rand, "%08ld", random() % 100000000); - sprintf(rand + 8, "%07ld", random() % 10000000); + sprintf(rand, "%08d", mobile_random() % 100000000); + sprintf(rand + 8, "%07d", mobile_random() % 10000000); strcpy(set->imei + 15 - digits, rand + 15 - digits); strncpy(set->imeisv, set->imei, 15); diff --git a/src/host/layer23/src/mobile/utils.c b/src/host/layer23/src/mobile/utils.c new file mode 100644 index 0000000..50a7f54 --- /dev/null +++ b/src/host/layer23/src/mobile/utils.c @@ -0,0 +1,47 @@ +/* Utilities used by mobile */ + +/* (C) 2018 by Holger Hans Peter Freyther + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include + +#include + +#include +#include + + +/** + * A secure replacement for random(3). + * + * \return a secure random number using osmo_get_rand_id between + * 0 and RAND_MAX. + */ +int mobile_random(void) +{ + unsigned int r; + + if (osmo_get_rand_id((uint8_t *) &r, sizeof(r)) != 0) + return random(); + + r &= ~(1U << 31); + r %= RAND_MAX; + return (int) r; +} -- To view, visit https://gerrit.osmocom.org/10098 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Icdd4be88c62bba1e9d954568e48f0c12a67ac182 Gerrit-Change-Number: 10098 Gerrit-PatchSet: 1 Gerrit-Owner: Holger Freyther -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 22:22:15 2018 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sat, 21 Jul 2018 22:22:15 +0000 Subject: Change in osmo-gsm-tester[master]: ms: Quit early when all tests concluded.. In-Reply-To: References: Message-ID: Hello Pau Espin Pedrol, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9716 to look at the new patch set (#4). Change subject: ms: Quit early when all tests concluded.. ...................................................................... ms: Quit early when all tests concluded.. And fix the the detection if everything has completed. Change-Id: I3575ee7618c35e3b66d25fa31844d267489d9179 --- M src/osmo_ms_driver/location_update_test.py 1 file changed, 11 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/16/9716/4 -- To view, visit https://gerrit.osmocom.org/9716 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3575ee7618c35e3b66d25fa31844d267489d9179 Gerrit-Change-Number: 9716 Gerrit-PatchSet: 4 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 21 22:43:24 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sat, 21 Jul 2018 22:43:24 +0000 Subject: Change in osmo-gsm-tester[master]: ms: Quit early when all tests concluded.. In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9716 ) Change subject: ms: Quit early when all tests concluded.. ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9716 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3575ee7618c35e3b66d25fa31844d267489d9179 Gerrit-Change-Number: 9716 Gerrit-PatchSet: 4 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Sat, 21 Jul 2018 22:43:24 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 22 06:05:49 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 22 Jul 2018 06:05:49 +0000 Subject: Change in osmocom-bb[master]: Move from libc random() to osmo_get_rand_id (2nd attempt) In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10098 ) Change subject: Move from libc random() to osmo_get_rand_id (2nd attempt) ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10098 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Icdd4be88c62bba1e9d954568e48f0c12a67ac182 Gerrit-Change-Number: 10098 Gerrit-PatchSet: 1 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Sun, 22 Jul 2018 06:05:49 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 22 06:09:06 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 22 Jul 2018 06:09:06 +0000 Subject: Change in osmo-bsc[master]: codec_pref: check bts codec support In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10011 ) Change subject: codec_pref: check bts codec support ...................................................................... Patch Set 10: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10011 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I285234e9c81de74d9fb9907fca2c443b08537435 Gerrit-Change-Number: 10011 Gerrit-PatchSet: 10 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Sun, 22 Jul 2018 06:09:06 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 22 06:16:07 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 22 Jul 2018 06:16:07 +0000 Subject: Change in osmo-bsc[master]: codec_pref: move match_codec_pref() to separate c-file and add unit-test In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10010 ) Change subject: codec_pref: move match_codec_pref() to separate c-file and add unit-test ...................................................................... Patch Set 10: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/10010/10//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/10010/10//COMMIT_MSG at 10 PS10, Line 10: advertises : advertises cosmetic: repetition -- To view, visit https://gerrit.osmocom.org/10010 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iabedfdcec8b99a319f2d57cbea45c5e36c7b6e29 Gerrit-Change-Number: 10010 Gerrit-PatchSet: 10 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Sun, 22 Jul 2018 06:16:07 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 22 06:16:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 22 Jul 2018 06:16:11 +0000 Subject: Change in osmo-bsc[master]: codec_pref: move match_codec_pref() to separate c-file and add unit-test In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10010 ) Change subject: codec_pref: move match_codec_pref() to separate c-file and add unit-test ...................................................................... codec_pref: move match_codec_pref() to separate c-file and add unit-test At the moment there are three sources that may advertise a list of supported audio codec/rate settings. There is the MS that advertises advertises a speech codec list and the MSC that sends a channel type information element over A and there are also settings in the bsc configuration file that may restrict the codec/rate types that are allowed to use. The function match_codec_pref() looks at all of the three buckets and selects a codec that satisfies all three. This is already a somewhat complicated process, overit is very isolated, so lets give it its own c-file. Due to the lack of unit-tests it is very hard to make changes here so lets add also unit-test to make sure that regressions are catched early. - Put match_codec_pref() and all its helper functions into a separate c-file. - Add a unit test. Change-Id: Iabedfdcec8b99a319f2d57cbea45c5e36c7b6e29 Related: OS#3361 --- M configure.ac M include/osmocom/bsc/Makefile.am A include/osmocom/bsc/codec_pref.h M src/osmo-bsc/Makefile.am A src/osmo-bsc/codec_pref.c M src/osmo-bsc/osmo_bsc_bssap.c M tests/Makefile.am A tests/codec_pref/Makefile.am A tests/codec_pref/codec_pref_test.c A tests/codec_pref/codec_pref_test.ok M tests/testsuite.at 11 files changed, 1,431 insertions(+), 160 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 25bcad7..a99e143 100644 --- a/configure.ac +++ b/configure.ac @@ -176,6 +176,7 @@ tests/atlocal tests/gsm0408/Makefile tests/bsc/Makefile + tests/codec_pref/Makefile tests/abis/Makefile tests/subscr/Makefile tests/nanobts_omlattr/Makefile diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am index 5fa39eb..dfab592 100644 --- a/include/osmocom/bsc/Makefile.am +++ b/include/osmocom/bsc/Makefile.am @@ -12,6 +12,7 @@ bss.h \ bts_ipaccess_nanobts_omlattr.h \ chan_alloc.h \ + codec_pref.h \ ctrl.h \ debug.h \ e1_config.h \ diff --git a/include/osmocom/bsc/codec_pref.h b/include/osmocom/bsc/codec_pref.h new file mode 100644 index 0000000..6933cea --- /dev/null +++ b/include/osmocom/bsc/codec_pref.h @@ -0,0 +1,6 @@ +#pragma once + +int match_codec_pref(int *full_rate, enum gsm48_chan_mode *chan_mode, + const struct gsm0808_channel_type *ct, + const struct gsm0808_speech_codec_list *scl, + const struct bsc_msc_data *msc); diff --git a/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am index a459a92..db63a99 100644 --- a/src/osmo-bsc/Makefile.am +++ b/src/osmo-bsc/Makefile.am @@ -53,6 +53,7 @@ bts_sysmobts.c \ bts_unknown.c \ chan_alloc.c \ + codec_pref.c \ e1_config.c \ gsm_04_08_utils.c \ gsm_04_80_utils.c \ diff --git a/src/osmo-bsc/codec_pref.c b/src/osmo-bsc/codec_pref.c new file mode 100644 index 0000000..ee0760a --- /dev/null +++ b/src/osmo-bsc/codec_pref.c @@ -0,0 +1,175 @@ +/* + * (C) 2017-2018 by sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Philipp Maier + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include + +/* Helper function for match_codec_pref(), looks up a matching chan mode for + * a given permitted speech value */ +enum gsm48_chan_mode gsm88_to_chan_mode(enum gsm0808_permitted_speech speech) +{ + switch (speech) { + case GSM0808_PERM_HR1: + case GSM0808_PERM_FR1: + return GSM48_CMODE_SPEECH_V1; + break; + case GSM0808_PERM_HR2: + case GSM0808_PERM_FR2: + return GSM48_CMODE_SPEECH_EFR; + break; + case GSM0808_PERM_HR3: + case GSM0808_PERM_FR3: + return GSM48_CMODE_SPEECH_AMR; + break; + default: + LOGP(DMSC, LOGL_FATAL, "Unsupported permitted speech selected, assuming AMR as channel mode...\n"); + return GSM48_CMODE_SPEECH_AMR; + } +} + +/* Helper function for match_codec_pref(), looks up a matching permitted speech + * value for a given msc audio codec pref */ +enum gsm0808_permitted_speech audio_support_to_gsm88(struct gsm_audio_support *audio) +{ + if (audio->hr) { + switch (audio->ver) { + case 1: + return GSM0808_PERM_HR1; + break; + case 2: + return GSM0808_PERM_HR2; + break; + case 3: + return GSM0808_PERM_HR3; + break; + default: + LOGP(DMSC, LOGL_ERROR, "Wrong speech mode: hr%d, using hr1 instead\n", audio->ver); + return GSM0808_PERM_HR1; + } + } else { + switch (audio->ver) { + case 1: + return GSM0808_PERM_FR1; + break; + case 2: + return GSM0808_PERM_FR2; + break; + case 3: + return GSM0808_PERM_FR3; + break; + default: + LOGP(DMSC, LOGL_ERROR, "Wrong speech mode: fr%d, using fr1 instead\n", audio->ver); + return GSM0808_PERM_FR1; + } + } +} + +/* Helper function for match_codec_pref(), tests if a given audio support + * matches one of the permitted speech settings of the channel type element. + * The matched permitted speech value is then also compared against the + * speech codec list. (optional, only relevant for AoIP) */ +static bool test_codec_pref(const struct gsm0808_channel_type *ct, + const struct gsm0808_speech_codec_list *scl, uint8_t perm_spch) +{ + unsigned int i; + bool match = false; + struct gsm0808_speech_codec sc; + int rc; + + /* Try to find the given permitted speech value in the + * codec list of the channel type element */ + for (i = 0; i < ct->perm_spch_len; i++) { + if (ct->perm_spch[i] == perm_spch) { + match = true; + break; + } + } + + /* If we do not have a speech codec list to test against, + * we just exit early (will be always the case in non-AoIP networks) */ + if (!scl) + return match; + + /* If we failed to match until here, there is no + * point in testing further */ + if (match == false) + return false; + + /* Extrapolate speech codec data */ + rc = gsm0808_speech_codec_from_chan_type(&sc, perm_spch); + if (rc < 0) + return false; + + /* Try to find extrapolated speech codec data in + * the speech codec list */ + for (i = 0; i < scl->len; i++) { + if (sc.type == scl->codec[i].type) + return true; + } + + return false; +} + +/*! Helper function for bssmap_handle_assignm_req(), matches the codec + * preferences from the MSC with the codec preferences + * \param[out] full_rate '1' if full-rate, '0' if half-rate, '-1' if no match + * \param[out] chan_mode GSM 04.08 channel mode + * \param[in] ct GSM 08.08 channel type + * \param[in] scl GSM 08.08 speech codec list + * \param[in] msc MSC data [for configuration] + * \returns 0 on success, -1 in case no match was found */ +int match_codec_pref(int *full_rate, enum gsm48_chan_mode *chan_mode, + const struct gsm0808_channel_type *ct, + const struct gsm0808_speech_codec_list *scl, const struct bsc_msc_data *msc) +{ + unsigned int i; + uint8_t perm_spch; + bool match = false; + + for (i = 0; i < msc->audio_length; i++) { + perm_spch = audio_support_to_gsm88(msc->audio_support[i]); + if (test_codec_pref(ct, scl, perm_spch)) { + match = true; + break; + } + } + + /* Exit without result, in case no match can be deteched */ + if (!match) { + *full_rate = -1; + *chan_mode = GSM48_CMODE_SIGN; + return -1; + } + + /* Check if the result is a half or full rate codec */ + if (perm_spch == GSM0808_PERM_HR1 || perm_spch == GSM0808_PERM_HR2 || perm_spch == GSM0808_PERM_HR3 + || perm_spch == GSM0808_PERM_HR4 || perm_spch == GSM0808_PERM_HR6) + *full_rate = 0; + else + *full_rate = 1; + + /* Lookup a channel mode for the selected codec */ + *chan_mode = gsm88_to_chan_mode(perm_spch); + + return 0; +} diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index c2d51b5..96cc2c5 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -22,17 +22,13 @@ #include #include #include -#include #include #include #include #include #include - -#include +#include #include -#include -#include #include #include #include @@ -45,161 +41,6 @@ * helpers for the assignment command */ -/* Helper function for match_codec_pref(), looks up a matching permitted speech - * value for a given msc audio codec pref */ -enum gsm0808_permitted_speech audio_support_to_gsm88(struct gsm_audio_support *audio) -{ - if (audio->hr) { - switch (audio->ver) { - case 1: - return GSM0808_PERM_HR1; - break; - case 2: - return GSM0808_PERM_HR2; - break; - case 3: - return GSM0808_PERM_HR3; - break; - default: - LOGP(DMSC, LOGL_ERROR, "Wrong speech mode: hr%d, using hr1 instead\n", - audio->ver); - return GSM0808_PERM_HR1; - } - } else { - switch (audio->ver) { - case 1: - return GSM0808_PERM_FR1; - break; - case 2: - return GSM0808_PERM_FR2; - break; - case 3: - return GSM0808_PERM_FR3; - break; - default: - LOGP(DMSC, LOGL_ERROR, "Wrong speech mode: fr%d, using fr1 instead\n", - audio->ver); - return GSM0808_PERM_FR1; - } - } -} - -/* Helper function for match_codec_pref(), looks up a matching chan mode for - * a given permitted speech value */ -enum gsm48_chan_mode gsm88_to_chan_mode(enum gsm0808_permitted_speech speech) -{ - switch (speech) { - case GSM0808_PERM_HR1: - case GSM0808_PERM_FR1: - return GSM48_CMODE_SPEECH_V1; - break; - case GSM0808_PERM_HR2: - case GSM0808_PERM_FR2: - return GSM48_CMODE_SPEECH_EFR; - break; - case GSM0808_PERM_HR3: - case GSM0808_PERM_FR3: - return GSM48_CMODE_SPEECH_AMR; - break; - default: - LOGP(DMSC, LOGL_FATAL, - "Unsupported permitted speech selected, assuming AMR as channel mode...\n"); - return GSM48_CMODE_SPEECH_AMR; - } -} - -/* Helper function for match_codec_pref(), tests if a given audio support - * matches one of the permitted speech settings of the channel type element. - * The matched permitted speech value is then also compared against the - * speech codec list. (optional, only relevant for AoIP) */ -static bool test_codec_pref(const struct gsm0808_channel_type *ct, - const struct gsm0808_speech_codec_list *scl, - uint8_t perm_spch) -{ - unsigned int i; - bool match = false; - struct gsm0808_speech_codec sc; - int rc; - - /* Try to finde the given permitted speech value in the - * codec list of the channel type element */ - for (i = 0; i < ct->perm_spch_len; i++) { - if (ct->perm_spch[i] == perm_spch) { - match = true; - break; - } - } - - /* If we do not have a speech codec list to test against, - * we just exit early (will be always the case in non-AoIP networks) */ - if (!scl) - return match; - - /* If we failed to match until here, there is no - * point in testing further */ - if (match == false) - return false; - - /* Extrapolate speech codec data */ - rc = gsm0808_speech_codec_from_chan_type(&sc, perm_spch); - if (rc < 0) - return false; - - /* Try to find extrapolated speech codec data in - * the speech codec list */ - for (i = 0; i < scl->len; i++) { - if (sc.type == scl->codec[i].type) - return true; - } - - return false; -} - -/*! Helper function for bssmap_handle_assignm_req(), matches the codec - * preferences from the MSC with the codec preferences - * \param[out] full_rate '1' if full-rate, '0' if half-rate, '-1' if no match - * \param[out] chan_mode GSM 04.08 channel mode - * \param[in] ct GSM 08.08 channel type - * \param[in] scl GSM 08.08 speech codec list - * \param[in] msc MSC data [for configuration] - * \returns 0 on success, -1 in case no match was found */ -static int match_codec_pref(int *full_rate, enum gsm48_chan_mode *chan_mode, - const struct gsm0808_channel_type *ct, - const struct gsm0808_speech_codec_list *scl, - const struct bsc_msc_data *msc) -{ - unsigned int i; - uint8_t perm_spch; - bool match = false; - - for (i = 0; i < msc->audio_length; i++) { - perm_spch = audio_support_to_gsm88(msc->audio_support[i]); - if (test_codec_pref(ct, scl, perm_spch)) { - match = true; - break; - } - } - - /* Exit without result, in case no match can be deteched */ - if (!match) { - *full_rate = -1; - *chan_mode = GSM48_CMODE_SIGN; - return -1; - } - - /* Check if the result is a half or full rate codec */ - if (perm_spch == GSM0808_PERM_HR1 || perm_spch == GSM0808_PERM_HR2 - || perm_spch == GSM0808_PERM_HR3 || perm_spch == GSM0808_PERM_HR4 - || perm_spch == GSM0808_PERM_HR6) - *full_rate = 0; - else - *full_rate = 1; - - /* Lookup a channel mode for the selected codec */ - *chan_mode = gsm88_to_chan_mode(perm_spch); - - return 0; -} static int bssmap_handle_reset_ack(struct bsc_msc_data *msc, struct msgb *msg, unsigned int length) diff --git a/tests/Makefile.am b/tests/Makefile.am index 95d836b..9b4cfe4 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,5 +1,6 @@ SUBDIRS = \ bsc \ + codec_pref \ gsm0408 \ abis \ subscr \ diff --git a/tests/codec_pref/Makefile.am b/tests/codec_pref/Makefile.am new file mode 100644 index 0000000..e000252 --- /dev/null +++ b/tests/codec_pref/Makefile.am @@ -0,0 +1,34 @@ +AM_CPPFLAGS = \ + $(all_includes) \ + -I$(top_srcdir)/include \ + $(NULL) + +AM_CFLAGS = \ + -Wall \ + $(LIBOSMOCORE_CFLAGS) \ + $(LIBOSMOGSM_CFLAGS) \ + $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ + $(NULL) + +AM_LDFLAGS = \ + $(NULL) + +EXTRA_DIST = \ + codec_pref_test.ok \ + $(NULL) + +noinst_PROGRAMS = \ + codec_pref_test \ + $(NULL) + +codec_pref_test_SOURCES = \ + codec_pref_test.c \ + $(NULL) + +codec_pref_test_LDADD = \ + $(top_builddir)/src/osmo-bsc/codec_pref.o \ + $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOGSM_LIBS) \ + -lrt \ + $(NULL) diff --git a/tests/codec_pref/codec_pref_test.c b/tests/codec_pref/codec_pref_test.c new file mode 100644 index 0000000..73547ad --- /dev/null +++ b/tests/codec_pref/codec_pref_test.c @@ -0,0 +1,498 @@ +/* + * (C) 2018 by sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Philipp Maier + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include +#include + +#include + +void *ctx = NULL; + +#define MSC_AUDIO_SUPPORT_MAX 5 +#define N_CONFIG_VARIANTS 9 + +/* Make sure that there is some memory to put our test configuration. */ +static void init_msc_config(struct bsc_msc_data *msc) +{ + unsigned int i; + + msc->audio_support = talloc_zero_array(ctx, struct gsm_audio_support *, MSC_AUDIO_SUPPORT_MAX); + msc->audio_length = MSC_AUDIO_SUPPORT_MAX; + for (i = 0; i < MSC_AUDIO_SUPPORT_MAX; i++) { + msc->audio_support[i] = talloc_zero(msc->audio_support, struct gsm_audio_support); + } +} + +/* Free memory that we have used for the test configuration. */ +static void free_msc_config(struct bsc_msc_data *msc) +{ + talloc_free(msc->audio_support); +} + +/* The speech codec list is sent by the MS and lists the voice codec settings + * that the MS is able to support. The BSC must select one of this codecs + * depending on what the MSC is able to support. The following function + * generates some realistically made up speech codec lists. */ +static void make_scl_config(struct gsm0808_speech_codec_list *scl, uint8_t config_no) +{ + OSMO_ASSERT(config_no < N_CONFIG_VARIANTS); + + switch (config_no) { + case 0: + /* FR1 only */ + scl->codec[0].type = GSM0808_SCT_FR1; + scl->len = 1; + break; + case 1: + /* HR1 only */ + scl->codec[0].type = GSM0808_SCT_HR1; + scl->len = 1; + break; + case 2: + /* FR2 only */ + scl->codec[0].type = GSM0808_SCT_FR2; + scl->len = 1; + break; + case 3: + /* FR3 only */ + scl->codec[0].type = GSM0808_SCT_FR3; + scl->len = 1; + break; + case 4: + /* HR3 only */ + scl->codec[0].type = GSM0808_SCT_HR3; + scl->len = 1; + break; + case 5: + /* FR1 and HR1 */ + scl->codec[0].type = GSM0808_SCT_FR1; + scl->codec[1].type = GSM0808_SCT_HR1; + scl->len = 2; + break; + case 6: + /* FR1, FR2 and HR1 */ + scl->codec[0].type = GSM0808_SCT_FR1; + scl->codec[1].type = GSM0808_SCT_FR2; + scl->codec[2].type = GSM0808_SCT_HR1; + scl->len = 3; + break; + case 7: + /* FR1, FR3 and HR3 */ + scl->codec[0].type = GSM0808_SCT_FR1; + scl->codec[1].type = GSM0808_SCT_FR3; + scl->codec[2].type = GSM0808_SCT_HR3; + scl->len = 3; + break; + case 8: + /* FR1, FR2, FR3, HR1 and HR3 */ + scl->codec[0].type = GSM0808_SCT_FR1; + scl->codec[1].type = GSM0808_SCT_FR2; + scl->codec[2].type = GSM0808_SCT_FR3; + scl->codec[3].type = GSM0808_SCT_HR1; + scl->codec[4].type = GSM0808_SCT_HR3; + scl->len = 5; + break; + } +} + +/* The channel type element which is sent to the BSC by the MSC lists all the + * codecs that the MSC is able to support. The following function generates + * a realistic permitted speech settings */ +static void make_ct_config(struct gsm0808_channel_type *ct, uint8_t config_no) +{ + OSMO_ASSERT(config_no < N_CONFIG_VARIANTS); + + switch (config_no) { + case 0: + /* FR1 only */ + ct->perm_spch[0] = GSM0808_PERM_FR1; + ct->perm_spch_len = 1; + break; + case 1: + /* HR1 only */ + ct->perm_spch[0] = GSM0808_PERM_HR1; + ct->perm_spch_len = 1; + break; + case 2: + /* FR2 only */ + ct->perm_spch[0] = GSM0808_PERM_FR2; + ct->perm_spch_len = 1; + break; + case 3: + /* FR3 only */ + ct->perm_spch[0] = GSM0808_PERM_FR3; + ct->perm_spch_len = 1; + break; + case 4: + /* HR3 only */ + ct->perm_spch[0] = GSM0808_PERM_HR3; + ct->perm_spch_len = 1; + break; + case 5: + /* FR1 and HR1 */ + ct->perm_spch[0] = GSM0808_PERM_FR1; + ct->perm_spch[1] = GSM0808_PERM_HR1; + ct->perm_spch_len = 2; + break; + case 6: + /* FR1, FR2 and HR1 */ + ct->perm_spch[0] = GSM0808_PERM_FR1; + ct->perm_spch[1] = GSM0808_PERM_FR2; + ct->perm_spch[2] = GSM0808_PERM_HR1; + ct->perm_spch_len = 3; + break; + case 7: + /* FR1, FR3 and HR3 */ + ct->perm_spch[0] = GSM0808_PERM_FR1; + ct->perm_spch[1] = GSM0808_PERM_FR3; + ct->perm_spch[2] = GSM0808_PERM_HR3; + ct->perm_spch_len = 3; + break; + case 8: + /* FR1, FR2, FR3, HR1 and HR3 */ + ct->perm_spch[0] = GSM0808_PERM_FR1; + ct->perm_spch[1] = GSM0808_PERM_FR2; + ct->perm_spch[2] = GSM0808_PERM_FR3; + ct->perm_spch[3] = GSM0808_PERM_HR1; + ct->perm_spch[4] = GSM0808_PERM_HR3; + ct->perm_spch_len = 5; + break; + } +} + +/* Generate some realistic MSC configuration which one also could find in the + * real world. This configuration acts as a filter. While the MSC could in + * theory advertise codecs more codecs as we are able to support we have to + * make sure that only the codecs we have support for are considered. */ +static void make_msc_config(struct bsc_msc_data *msc, uint8_t config_no) +{ + /* 1 = FR1/HR1 + * 2 = FR2/HR2 + * 3 = FR2/HR3 + * Note: HR2 is deprecated */ + + OSMO_ASSERT(config_no < N_CONFIG_VARIANTS); + + switch (config_no) { + case 0: + /* FR1 only */ + msc->audio_support[0]->ver = 1; + msc->audio_support[0]->hr = 0; + msc->audio_length = 1; + break; + case 1: + /* HR1 only */ + msc->audio_support[0]->ver = 1; + msc->audio_support[0]->hr = 1; + msc->audio_length = 1; + break; + case 2: + /* FR2 only */ + msc->audio_support[0]->ver = 2; + msc->audio_support[0]->hr = 0; + msc->audio_length = 1; + break; + case 3: + /* FR3 only */ + msc->audio_support[0]->ver = 3; + msc->audio_support[0]->hr = 0; + msc->audio_length = 1; + break; + case 4: + /* HR3 only */ + msc->audio_support[0]->ver = 3; + msc->audio_support[0]->hr = 1; + msc->audio_length = 1; + break; + case 5: + /* FR1 and HR1 */ + msc->audio_support[0]->ver = 1; + msc->audio_support[0]->hr = 0; + msc->audio_support[1]->ver = 1; + msc->audio_support[1]->hr = 1; + msc->audio_length = 2; + break; + case 6: + /* FR1, FR2 and HR1 */ + msc->audio_support[0]->ver = 1; + msc->audio_support[0]->hr = 0; + msc->audio_support[1]->ver = 2; + msc->audio_support[1]->hr = 0; + msc->audio_support[2]->ver = 1; + msc->audio_support[2]->hr = 1; + msc->audio_length = 3; + break; + case 7: + /* FR1, FR3 and HR3 */ + msc->audio_support[0]->ver = 1; + msc->audio_support[0]->hr = 0; + msc->audio_support[1]->ver = 3; + msc->audio_support[1]->hr = 0; + msc->audio_support[2]->ver = 3; + msc->audio_support[2]->hr = 1; + msc->audio_length = 3; + break; + case 8: + /* FR1, FR2, FR3, HR1 and HR3 */ + msc->audio_support[0]->ver = 1; + msc->audio_support[0]->hr = 0; + msc->audio_support[1]->ver = 2; + msc->audio_support[1]->hr = 0; + msc->audio_support[2]->ver = 3; + msc->audio_support[2]->hr = 0; + msc->audio_support[3]->ver = 1; + msc->audio_support[3]->hr = 1; + msc->audio_support[4]->ver = 3; + msc->audio_support[4]->hr = 1; + msc->audio_length = 5; + break; + } +} + +/* Try execute match_codec_pref(), display input and output parameters */ +static int test_match_codec_pref(const struct gsm0808_channel_type *ct, + const struct gsm0808_speech_codec_list *scl, const struct bsc_msc_data *msc) +{ + int rc; + unsigned int i; + int full_rate; + enum gsm48_chan_mode chan_mode; + + printf("Determining channel mode and rate:\n"); + + printf(" * MS: speech codec list (%u items):\n", scl->len); + for (i = 0; i < scl->len; i++) + printf(" codec[%u]->type=%s\n", i, gsm0808_speech_codec_type_name(scl->codec[i].type)); + + printf(" * MSC: channel type permitted speech (%u items):\n", ct->perm_spch_len); + for (i = 0; i < ct->perm_spch_len; i++) + printf(" perm_spch[%u]=%s\n", i, gsm0808_permitted_speech_name(ct->perm_spch[i])); + + printf(" * BSS: audio support settings (%u items):\n", msc->audio_length); + for (i = 0; i < msc->audio_length; i++) + if (msc->audio_support[i]->hr) + printf(" audio_support[%u]=HR%u\n", i, msc->audio_support[i]->ver); + else + printf(" audio_support[%u]=FR%u\n", i, msc->audio_support[i]->ver); + + rc = match_codec_pref(&full_rate, &chan_mode, ct, scl, msc); + printf(" * result: rc=%i, full_rate=%i, chan_mode=%s\n", rc, full_rate, gsm48_chan_mode_name(chan_mode)); + + printf("\n"); + + return rc; +} + +/* MS, MSC and local MSC settings are the same */ +static void test_one_to_one(void) +{ + unsigned int i; + struct gsm0808_channel_type ct_msc; + struct gsm0808_speech_codec_list scl_ms; + struct bsc_msc_data msc_local; + int rc; + + printf("============== test_one_to_one ==============\n\n"); + + init_msc_config(&msc_local); + + for (i = 0; i < N_CONFIG_VARIANTS; i++) { + make_msc_config(&msc_local, i); + make_scl_config(&scl_ms, i); + make_ct_config(&ct_msc, i); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + OSMO_ASSERT(rc == 0); + } + + free_msc_config(&msc_local); +} + +/* Network supports all combinations, MS varies */ +static void test_ms(void) +{ + unsigned int i; + struct gsm0808_channel_type ct_msc; + struct gsm0808_speech_codec_list scl_ms; + struct bsc_msc_data msc_local; + int rc; + + printf("============== test_ms ==============\n\n"); + + init_msc_config(&msc_local); + + make_msc_config(&msc_local, 8); + make_ct_config(&ct_msc, 8); + for (i = 0; i < N_CONFIG_VARIANTS; i++) { + make_scl_config(&scl_ms, i); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + OSMO_ASSERT(rc == 0); + } + + free_msc_config(&msc_local); +} + +/* BSS and MS support all combinations, MSC varies */ +static void test_ct(void) +{ + unsigned int i; + struct gsm0808_channel_type ct_msc; + struct gsm0808_speech_codec_list scl_ms; + struct bsc_msc_data msc_local; + int rc; + + printf("============== test_ct ==============\n\n"); + + init_msc_config(&msc_local); + + make_msc_config(&msc_local, 8); + make_scl_config(&scl_ms, 8); + for (i = 0; i < N_CONFIG_VARIANTS; i++) { + make_ct_config(&ct_msc, i); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + OSMO_ASSERT(rc == 0); + } + + free_msc_config(&msc_local); +} + +/* MSC and MS support all combinations, BSS varies */ +static void test_msc(void) +{ + unsigned int i; + struct gsm0808_channel_type ct_msc; + struct gsm0808_speech_codec_list scl_ms; + struct bsc_msc_data msc_local; + int rc; + + printf("============== test_msc ==============\n\n"); + + init_msc_config(&msc_local); + + make_ct_config(&ct_msc, 8); + make_scl_config(&scl_ms, 8); + for (i = 0; i < N_CONFIG_VARIANTS; i++) { + make_msc_config(&msc_local, 8); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + OSMO_ASSERT(rc == 0); + } + + free_msc_config(&msc_local); +} + +/* Some mixed configurations that are supposed to work */ +static void test_selected_working(void) +{ + struct gsm0808_channel_type ct_msc; + struct gsm0808_speech_codec_list scl_ms; + struct bsc_msc_data msc_local; + int rc; + + printf("============== test_selected_working ==============\n\n"); + + init_msc_config(&msc_local); + + make_scl_config(&scl_ms, 6); + make_ct_config(&ct_msc, 5); + make_msc_config(&msc_local, 7); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + OSMO_ASSERT(rc == 0); + + make_scl_config(&scl_ms, 0); + make_ct_config(&ct_msc, 5); + make_msc_config(&msc_local, 7); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + OSMO_ASSERT(rc == 0); + + make_scl_config(&scl_ms, 1); + make_ct_config(&ct_msc, 5); + make_msc_config(&msc_local, 6); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + OSMO_ASSERT(rc == 0); + + free_msc_config(&msc_local); +} + +/* Some mixed configurations that can not work */ +static void test_selected_non_working(void) +{ + struct gsm0808_channel_type ct_msc; + struct gsm0808_speech_codec_list scl_ms; + struct bsc_msc_data msc_local; + int rc; + + printf("============== test_selected_non_working ==============\n\n"); + + init_msc_config(&msc_local); + + make_scl_config(&scl_ms, 1); + make_ct_config(&ct_msc, 5); + make_msc_config(&msc_local, 7); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + OSMO_ASSERT(rc == -1); + + make_scl_config(&scl_ms, 1); + make_ct_config(&ct_msc, 5); + make_msc_config(&msc_local, 7); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + OSMO_ASSERT(rc == -1); + + make_scl_config(&scl_ms, 1); + make_ct_config(&ct_msc, 4); + make_msc_config(&msc_local, 6); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + OSMO_ASSERT(rc == -1); + + free_msc_config(&msc_local); +} + +static const struct log_info_cat log_categories[] = { + [DMSC] = { + .name = "DMSC", + .description = "Mobile Switching Center", + .enabled = 1,.loglevel = LOGL_NOTICE, + }, +}; + +static const struct log_info log_info = { + .cat = log_categories, + .num_cat = ARRAY_SIZE(log_categories), +}; + +int main(int argc, char **argv) +{ + ctx = talloc_named_const(NULL, 0, "codec_pref_test"); + msgb_talloc_ctx_init(ctx, 0); + osmo_init_logging2(ctx, &log_info); + + test_one_to_one(); + test_ms(); + test_ct(); + test_msc(); + test_selected_working(); + test_selected_non_working(); + + printf("Testing execution completed.\n"); + talloc_free(ctx); + return 0; +} diff --git a/tests/codec_pref/codec_pref_test.ok b/tests/codec_pref/codec_pref_test.ok new file mode 100644 index 0000000..f97fbb1 --- /dev/null +++ b/tests/codec_pref/codec_pref_test.ok @@ -0,0 +1,707 @@ +============== test_one_to_one ============== + +Determining channel mode and rate: + * MS: speech codec list (1 items): + codec[0]->type=FR1 + * MSC: channel type permitted speech (1 items): + perm_spch[0]=FR1 + * BSS: audio support settings (1 items): + audio_support[0]=FR1 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (1 items): + codec[0]->type=HR1 + * MSC: channel type permitted speech (1 items): + perm_spch[0]=HR1 + * BSS: audio support settings (1 items): + audio_support[0]=HR1 + * result: rc=0, full_rate=0, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (1 items): + codec[0]->type=FR2 + * MSC: channel type permitted speech (1 items): + perm_spch[0]=FR2 + * BSS: audio support settings (1 items): + audio_support[0]=FR2 + * result: rc=0, full_rate=1, chan_mode=SPEECH_EFR + +Determining channel mode and rate: + * MS: speech codec list (1 items): + codec[0]->type=FR3 + * MSC: channel type permitted speech (1 items): + perm_spch[0]=FR3 + * BSS: audio support settings (1 items): + audio_support[0]=FR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_AMR + +Determining channel mode and rate: + * MS: speech codec list (1 items): + codec[0]->type=HR3 + * MSC: channel type permitted speech (1 items): + perm_spch[0]=HR3 + * BSS: audio support settings (1 items): + audio_support[0]=HR3 + * result: rc=0, full_rate=0, chan_mode=SPEECH_AMR + +Determining channel mode and rate: + * MS: speech codec list (2 items): + codec[0]->type=FR1 + codec[1]->type=HR1 + * MSC: channel type permitted speech (2 items): + perm_spch[0]=FR1 + perm_spch[1]=HR1 + * BSS: audio support settings (2 items): + audio_support[0]=FR1 + audio_support[1]=HR1 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (3 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=HR1 + * MSC: channel type permitted speech (3 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=HR1 + * BSS: audio support settings (3 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=HR1 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (3 items): + codec[0]->type=FR1 + codec[1]->type=FR3 + codec[2]->type=HR3 + * MSC: channel type permitted speech (3 items): + perm_spch[0]=FR1 + perm_spch[1]=FR3 + perm_spch[2]=HR3 + * BSS: audio support settings (3 items): + audio_support[0]=FR1 + audio_support[1]=FR3 + audio_support[2]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +============== test_ms ============== + +Determining channel mode and rate: + * MS: speech codec list (1 items): + codec[0]->type=FR1 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (1 items): + codec[0]->type=HR1 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=0, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (1 items): + codec[0]->type=FR2 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_EFR + +Determining channel mode and rate: + * MS: speech codec list (1 items): + codec[0]->type=FR3 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_AMR + +Determining channel mode and rate: + * MS: speech codec list (1 items): + codec[0]->type=HR3 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=0, chan_mode=SPEECH_AMR + +Determining channel mode and rate: + * MS: speech codec list (2 items): + codec[0]->type=FR1 + codec[1]->type=HR1 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (3 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=HR1 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (3 items): + codec[0]->type=FR1 + codec[1]->type=FR3 + codec[2]->type=HR3 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +============== test_ct ============== + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (1 items): + perm_spch[0]=FR1 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (1 items): + perm_spch[0]=HR1 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=0, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (1 items): + perm_spch[0]=FR2 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_EFR + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (1 items): + perm_spch[0]=FR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_AMR + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (1 items): + perm_spch[0]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=0, chan_mode=SPEECH_AMR + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (2 items): + perm_spch[0]=FR1 + perm_spch[1]=HR1 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (3 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=HR1 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (3 items): + perm_spch[0]=FR1 + perm_spch[1]=FR3 + perm_spch[2]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +============== test_msc ============== + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (5 items): + perm_spch[0]=FR1 + perm_spch[1]=FR2 + perm_spch[2]=FR3 + perm_spch[3]=HR1 + perm_spch[4]=HR3 + * BSS: audio support settings (5 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=FR3 + audio_support[3]=HR1 + audio_support[4]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +============== test_selected_working ============== + +Determining channel mode and rate: + * MS: speech codec list (3 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=HR1 + * MSC: channel type permitted speech (2 items): + perm_spch[0]=FR1 + perm_spch[1]=HR1 + * BSS: audio support settings (3 items): + audio_support[0]=FR1 + audio_support[1]=FR3 + audio_support[2]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (1 items): + codec[0]->type=FR1 + * MSC: channel type permitted speech (2 items): + perm_spch[0]=FR1 + perm_spch[1]=HR1 + * BSS: audio support settings (3 items): + audio_support[0]=FR1 + audio_support[1]=FR3 + audio_support[2]=HR3 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (1 items): + codec[0]->type=HR1 + * MSC: channel type permitted speech (2 items): + perm_spch[0]=FR1 + perm_spch[1]=HR1 + * BSS: audio support settings (3 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=HR1 + * result: rc=0, full_rate=0, chan_mode=SPEECH_V1 + +============== test_selected_non_working ============== + +Determining channel mode and rate: + * MS: speech codec list (1 items): + codec[0]->type=HR1 + * MSC: channel type permitted speech (2 items): + perm_spch[0]=FR1 + perm_spch[1]=HR1 + * BSS: audio support settings (3 items): + audio_support[0]=FR1 + audio_support[1]=FR3 + audio_support[2]=HR3 + * result: rc=-1, full_rate=-1, chan_mode=SIGNALLING + +Determining channel mode and rate: + * MS: speech codec list (1 items): + codec[0]->type=HR1 + * MSC: channel type permitted speech (2 items): + perm_spch[0]=FR1 + perm_spch[1]=HR1 + * BSS: audio support settings (3 items): + audio_support[0]=FR1 + audio_support[1]=FR3 + audio_support[2]=HR3 + * result: rc=-1, full_rate=-1, chan_mode=SIGNALLING + +Determining channel mode and rate: + * MS: speech codec list (1 items): + codec[0]->type=HR1 + * MSC: channel type permitted speech (1 items): + perm_spch[0]=HR3 + * BSS: audio support settings (3 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=HR1 + * result: rc=-1, full_rate=-1, chan_mode=SIGNALLING + +Testing execution completed. diff --git a/tests/testsuite.at b/tests/testsuite.at index 515ffa0..f384655 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -26,6 +26,12 @@ AT_CHECK([$abs_top_builddir/tests/bsc/bsc_test], [], [expout], [ignore]) AT_CLEANUP +AT_SETUP([codec_pref]) +AT_KEYWORDS([codec_pref]) +cat $abs_srcdir/codec_pref/codec_pref_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/codec_pref/codec_pref_test], [], [expout], [ignore]) +AT_CLEANUP + AT_SETUP([nanobts_omlattr]) AT_KEYWORDS([nanobts_omlattr]) cat $abs_srcdir/nanobts_omlattr/nanobts_omlattr_test.ok > expout -- To view, visit https://gerrit.osmocom.org/10010 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iabedfdcec8b99a319f2d57cbea45c5e36c7b6e29 Gerrit-Change-Number: 10010 Gerrit-PatchSet: 11 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 22 06:16:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 22 Jul 2018 06:16:11 +0000 Subject: Change in osmo-bsc[master]: codec_pref: check bts codec support In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10011 ) Change subject: codec_pref: check bts codec support ...................................................................... codec_pref: check bts codec support The vty option bts->codec-support allows the user to set the supported codecs per BTS level. However, those values are currently only used to make the handover decision but the logic that handles the BSSMAP ASSIGNMENT REQUEST does not check those flags. - Do not ignore bts->codec-support flags on BSSMAP ASSIGNMENT REQUEST Change-Id: I285234e9c81de74d9fb9907fca2c443b08537435 Closes: OS#3361 --- M include/osmocom/bsc/codec_pref.h M src/osmo-bsc/codec_pref.c M src/osmo-bsc/osmo_bsc_bssap.c M tests/codec_pref/codec_pref_test.c M tests/codec_pref/codec_pref_test.ok 5 files changed, 490 insertions(+), 21 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/bsc/codec_pref.h b/include/osmocom/bsc/codec_pref.h index 6933cea..bbda14e 100644 --- a/include/osmocom/bsc/codec_pref.h +++ b/include/osmocom/bsc/codec_pref.h @@ -1,6 +1,6 @@ #pragma once -int match_codec_pref(int *full_rate, enum gsm48_chan_mode *chan_mode, - const struct gsm0808_channel_type *ct, - const struct gsm0808_speech_codec_list *scl, - const struct bsc_msc_data *msc); +struct gsm_bts; + +int match_codec_pref(int *full_rate, enum gsm48_chan_mode *chan_mode, const struct gsm0808_channel_type *ct, + const struct gsm0808_speech_codec_list *scl, const struct bsc_msc_data *msc, struct gsm_bts *bts); diff --git a/src/osmo-bsc/codec_pref.c b/src/osmo-bsc/codec_pref.c index ee0760a..d2887ac 100644 --- a/src/osmo-bsc/codec_pref.c +++ b/src/osmo-bsc/codec_pref.c @@ -23,6 +23,7 @@ #include #include #include +#include /* Helper function for match_codec_pref(), looks up a matching chan mode for * a given permitted speech value */ @@ -130,6 +131,34 @@ return false; } +/* Helper function to check if the given permitted speech value is supported + * by the BTS. (vty option bts->codec-support). */ +static bool test_codec_support_bts(struct gsm_bts *bts, uint8_t perm_spch) +{ + switch (perm_spch) { + case GSM0808_PERM_FR1: + /* GSM-FR is always supported by all BTSs. There is also no way to + * selectively disable GSM-RF per BTS via VTY. */ + return true; + case GSM0808_PERM_FR2: + if (bts->codec.efr) + return true; + case GSM0808_PERM_FR3: + if (bts->codec.amr) + return true; + case GSM0808_PERM_HR1: + if (bts->codec.hr) + return true; + case GSM0808_PERM_HR3: + if (bts->codec.amr) + return true; + default: + return false; + } + + return false; +} + /*! Helper function for bssmap_handle_assignm_req(), matches the codec * preferences from the MSC with the codec preferences * \param[out] full_rate '1' if full-rate, '0' if half-rate, '-1' if no match @@ -137,17 +166,26 @@ * \param[in] ct GSM 08.08 channel type * \param[in] scl GSM 08.08 speech codec list * \param[in] msc MSC data [for configuration] + * \param[in] bts BTS data [for configuration] * \returns 0 on success, -1 in case no match was found */ -int match_codec_pref(int *full_rate, enum gsm48_chan_mode *chan_mode, - const struct gsm0808_channel_type *ct, - const struct gsm0808_speech_codec_list *scl, const struct bsc_msc_data *msc) +int match_codec_pref(int *full_rate, enum gsm48_chan_mode *chan_mode, const struct gsm0808_channel_type *ct, + const struct gsm0808_speech_codec_list *scl, const struct bsc_msc_data *msc, struct gsm_bts *bts) { unsigned int i; uint8_t perm_spch; bool match = false; for (i = 0; i < msc->audio_length; i++) { + /* Pick a permitted speech value from the global codec configuration list */ perm_spch = audio_support_to_gsm88(msc->audio_support[i]); + + /* Check this permitted speech value against the BTS specific parameters. + * if the BTS does not support the codec, try the next one */ + if (test_codec_support_bts(bts, perm_spch) == false) + continue; + + /* Match the permitted speech value against the codec lists that were + * advertised by the MS and the MSC */ if (test_codec_pref(ct, scl, perm_spch)) { match = true; break; diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 96cc2c5..887a866 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -680,7 +680,7 @@ /* Match codec information from the assignment command against the * local preferences of the BSC */ - rc = match_codec_pref(&full_rate, &chan_mode, &ct, scl_ptr, msc); + rc = match_codec_pref(&full_rate, &chan_mode, &ct, scl_ptr, msc, conn_get_bts(conn)); if (rc < 0) { LOGP(DMSC, LOGL_ERROR, "No supported audio type found for channel_type =" " { ch_indctr=0x%x, ch_rate_type=0x%x, perm_spch=[ %s] }\n", diff --git a/tests/codec_pref/codec_pref_test.c b/tests/codec_pref/codec_pref_test.c index 73547ad..385854f 100644 --- a/tests/codec_pref/codec_pref_test.c +++ b/tests/codec_pref/codec_pref_test.c @@ -270,9 +270,62 @@ } } +/* Generate a realitically looking bts codec configuration */ +static void make_bts_config(struct gsm_bts *bts, uint8_t config_no) +{ + /* Note: FR is supported by all BTSs, so there is no flag for it */ + + OSMO_ASSERT(config_no < N_CONFIG_VARIANTS); + + bts->codec.hr = 0; + bts->codec.efr = 0; + bts->codec.amr = 0; + + switch (config_no) { + case 0: + /* FR1 (implicit) only */ + break; + case 1: + /* HR1 only (+FR implicit) */ + bts->codec.hr = 1; + break; + case 2: + /* FR2 only (+FR implicit) */ + bts->codec.efr = 1; + break; + case 3: + /* FR3 only (+FR implicit) */ + bts->codec.amr = 1; + break; + case 4: + /* HR3 only (+FR implicit) */ + bts->codec.amr = 1; + break; + case 5: + /* FR1 (implicit) and HR1 */ + bts->codec.hr = 1; + break; + case 6: + /* FR1 (implicit), FR2 and HR1 */ + bts->codec.efr = 1; + bts->codec.hr = 1; + break; + case 7: + /* FR1 (implicit), FR3 and HR3 */ + bts->codec.amr = 1; + break; + case 8: + /* FR1 (implicit), FR2, FR3, HR1 and HR3 */ + bts->codec.hr = 1; + bts->codec.efr = 1; + bts->codec.amr = 1; + break; + } +} + /* Try execute match_codec_pref(), display input and output parameters */ -static int test_match_codec_pref(const struct gsm0808_channel_type *ct, - const struct gsm0808_speech_codec_list *scl, const struct bsc_msc_data *msc) +static int test_match_codec_pref(const struct gsm0808_channel_type *ct, const struct gsm0808_speech_codec_list *scl, + const struct bsc_msc_data *msc, struct gsm_bts *bts) { int rc; unsigned int i; @@ -296,7 +349,13 @@ else printf(" audio_support[%u]=FR%u\n", i, msc->audio_support[i]->ver); - rc = match_codec_pref(&full_rate, &chan_mode, ct, scl, msc); + printf(" * BTS: audio support settings:\n"); + printf(" (GSM-FR implicitly supported)\n"); + printf(" codec->hr=%u\n", bts->codec.hr); + printf(" codec->efr=%u\n", bts->codec.efr); + printf(" codec->amr=%u\n", bts->codec.amr); + + rc = match_codec_pref(&full_rate, &chan_mode, ct, scl, msc, bts); printf(" * result: rc=%i, full_rate=%i, chan_mode=%s\n", rc, full_rate, gsm48_chan_mode_name(chan_mode)); printf("\n"); @@ -311,6 +370,7 @@ struct gsm0808_channel_type ct_msc; struct gsm0808_speech_codec_list scl_ms; struct bsc_msc_data msc_local; + struct gsm_bts bts_local; int rc; printf("============== test_one_to_one ==============\n\n"); @@ -321,7 +381,8 @@ make_msc_config(&msc_local, i); make_scl_config(&scl_ms, i); make_ct_config(&ct_msc, i); - rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + make_bts_config(&bts_local, i); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local, &bts_local); OSMO_ASSERT(rc == 0); } @@ -335,6 +396,7 @@ struct gsm0808_channel_type ct_msc; struct gsm0808_speech_codec_list scl_ms; struct bsc_msc_data msc_local; + struct gsm_bts bts_local; int rc; printf("============== test_ms ==============\n\n"); @@ -343,9 +405,10 @@ make_msc_config(&msc_local, 8); make_ct_config(&ct_msc, 8); + make_bts_config(&bts_local, 8); for (i = 0; i < N_CONFIG_VARIANTS; i++) { make_scl_config(&scl_ms, i); - rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local, &bts_local); OSMO_ASSERT(rc == 0); } @@ -359,6 +422,7 @@ struct gsm0808_channel_type ct_msc; struct gsm0808_speech_codec_list scl_ms; struct bsc_msc_data msc_local; + struct gsm_bts bts_local; int rc; printf("============== test_ct ==============\n\n"); @@ -367,9 +431,10 @@ make_msc_config(&msc_local, 8); make_scl_config(&scl_ms, 8); + make_bts_config(&bts_local, 8); for (i = 0; i < N_CONFIG_VARIANTS; i++) { make_ct_config(&ct_msc, i); - rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local, &bts_local); OSMO_ASSERT(rc == 0); } @@ -383,6 +448,7 @@ struct gsm0808_channel_type ct_msc; struct gsm0808_speech_codec_list scl_ms; struct bsc_msc_data msc_local; + struct gsm_bts bts_local; int rc; printf("============== test_msc ==============\n\n"); @@ -391,9 +457,10 @@ make_ct_config(&ct_msc, 8); make_scl_config(&scl_ms, 8); + make_bts_config(&bts_local, 8); for (i = 0; i < N_CONFIG_VARIANTS; i++) { make_msc_config(&msc_local, 8); - rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local, &bts_local); OSMO_ASSERT(rc == 0); } @@ -406,6 +473,7 @@ struct gsm0808_channel_type ct_msc; struct gsm0808_speech_codec_list scl_ms; struct bsc_msc_data msc_local; + struct gsm_bts bts_local; int rc; printf("============== test_selected_working ==============\n\n"); @@ -415,19 +483,43 @@ make_scl_config(&scl_ms, 6); make_ct_config(&ct_msc, 5); make_msc_config(&msc_local, 7); - rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + make_bts_config(&bts_local, 8); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local, &bts_local); OSMO_ASSERT(rc == 0); make_scl_config(&scl_ms, 0); make_ct_config(&ct_msc, 5); make_msc_config(&msc_local, 7); - rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + make_bts_config(&bts_local, 8); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local, &bts_local); OSMO_ASSERT(rc == 0); make_scl_config(&scl_ms, 1); make_ct_config(&ct_msc, 5); make_msc_config(&msc_local, 6); - rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + make_bts_config(&bts_local, 8); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local, &bts_local); + OSMO_ASSERT(rc == 0); + + make_scl_config(&scl_ms, 6); + make_ct_config(&ct_msc, 5); + make_msc_config(&msc_local, 7); + make_bts_config(&bts_local, 4); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local, &bts_local); + OSMO_ASSERT(rc == 0); + + make_scl_config(&scl_ms, 0); + make_ct_config(&ct_msc, 5); + make_msc_config(&msc_local, 7); + make_bts_config(&bts_local, 2); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local, &bts_local); + OSMO_ASSERT(rc == 0); + + make_scl_config(&scl_ms, 1); + make_ct_config(&ct_msc, 5); + make_msc_config(&msc_local, 6); + make_bts_config(&bts_local, 1); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local, &bts_local); OSMO_ASSERT(rc == 0); free_msc_config(&msc_local); @@ -439,6 +531,7 @@ struct gsm0808_channel_type ct_msc; struct gsm0808_speech_codec_list scl_ms; struct bsc_msc_data msc_local; + struct gsm_bts bts_local; int rc; printf("============== test_selected_non_working ==============\n\n"); @@ -448,19 +541,43 @@ make_scl_config(&scl_ms, 1); make_ct_config(&ct_msc, 5); make_msc_config(&msc_local, 7); - rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + make_bts_config(&bts_local, 8); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local, &bts_local); OSMO_ASSERT(rc == -1); make_scl_config(&scl_ms, 1); make_ct_config(&ct_msc, 5); make_msc_config(&msc_local, 7); - rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + make_bts_config(&bts_local, 8); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local, &bts_local); OSMO_ASSERT(rc == -1); make_scl_config(&scl_ms, 1); make_ct_config(&ct_msc, 4); make_msc_config(&msc_local, 6); - rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local); + make_bts_config(&bts_local, 8); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local, &bts_local); + OSMO_ASSERT(rc == -1); + + make_scl_config(&scl_ms, 1); + make_ct_config(&ct_msc, 2); + make_msc_config(&msc_local, 7); + make_bts_config(&bts_local, 8); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local, &bts_local); + OSMO_ASSERT(rc == -1); + + make_scl_config(&scl_ms, 1); + make_ct_config(&ct_msc, 5); + make_msc_config(&msc_local, 4); + make_bts_config(&bts_local, 8); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local, &bts_local); + OSMO_ASSERT(rc == -1); + + make_scl_config(&scl_ms, 8); + make_ct_config(&ct_msc, 4); + make_msc_config(&msc_local, 6); + make_bts_config(&bts_local, 7); + rc = test_match_codec_pref(&ct_msc, &scl_ms, &msc_local, &bts_local); OSMO_ASSERT(rc == -1); free_msc_config(&msc_local); diff --git a/tests/codec_pref/codec_pref_test.ok b/tests/codec_pref/codec_pref_test.ok index f97fbb1..d3cd028 100644 --- a/tests/codec_pref/codec_pref_test.ok +++ b/tests/codec_pref/codec_pref_test.ok @@ -7,6 +7,11 @@ perm_spch[0]=FR1 * BSS: audio support settings (1 items): audio_support[0]=FR1 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=0 + codec->efr=0 + codec->amr=0 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -16,6 +21,11 @@ perm_spch[0]=HR1 * BSS: audio support settings (1 items): audio_support[0]=HR1 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=0 + codec->amr=0 * result: rc=0, full_rate=0, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -25,6 +35,11 @@ perm_spch[0]=FR2 * BSS: audio support settings (1 items): audio_support[0]=FR2 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=0 + codec->efr=1 + codec->amr=0 * result: rc=0, full_rate=1, chan_mode=SPEECH_EFR Determining channel mode and rate: @@ -34,6 +49,11 @@ perm_spch[0]=FR3 * BSS: audio support settings (1 items): audio_support[0]=FR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=0 + codec->efr=0 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_AMR Determining channel mode and rate: @@ -43,6 +63,11 @@ perm_spch[0]=HR3 * BSS: audio support settings (1 items): audio_support[0]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=0 + codec->efr=0 + codec->amr=1 * result: rc=0, full_rate=0, chan_mode=SPEECH_AMR Determining channel mode and rate: @@ -55,6 +80,11 @@ * BSS: audio support settings (2 items): audio_support[0]=FR1 audio_support[1]=HR1 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=0 + codec->amr=0 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -70,6 +100,11 @@ audio_support[0]=FR1 audio_support[1]=FR2 audio_support[2]=HR1 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=0 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -85,6 +120,11 @@ audio_support[0]=FR1 audio_support[1]=FR3 audio_support[2]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=0 + codec->efr=0 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -106,6 +146,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 ============== test_ms ============== @@ -125,6 +170,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -142,6 +192,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=0, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -159,6 +214,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_EFR Determining channel mode and rate: @@ -176,6 +236,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_AMR Determining channel mode and rate: @@ -193,6 +258,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=0, chan_mode=SPEECH_AMR Determining channel mode and rate: @@ -211,6 +281,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -230,6 +305,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -249,6 +329,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -270,6 +355,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 ============== test_ct ============== @@ -289,6 +379,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -306,6 +401,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=0, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -323,6 +423,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_EFR Determining channel mode and rate: @@ -340,6 +445,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_AMR Determining channel mode and rate: @@ -357,6 +467,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=0, chan_mode=SPEECH_AMR Determining channel mode and rate: @@ -375,6 +490,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -394,6 +514,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -413,6 +538,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -434,6 +564,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 ============== test_msc ============== @@ -457,6 +592,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -478,6 +618,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -499,6 +644,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -520,6 +670,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -541,6 +696,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -562,6 +722,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -583,6 +748,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -604,6 +774,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -625,6 +800,11 @@ audio_support[2]=FR3 audio_support[3]=HR1 audio_support[4]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 ============== test_selected_working ============== @@ -641,6 +821,11 @@ audio_support[0]=FR1 audio_support[1]=FR3 audio_support[2]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -653,6 +838,11 @@ audio_support[0]=FR1 audio_support[1]=FR3 audio_support[2]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 Determining channel mode and rate: @@ -665,6 +855,64 @@ audio_support[0]=FR1 audio_support[1]=FR2 audio_support[2]=HR1 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 + * result: rc=0, full_rate=0, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (3 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=HR1 + * MSC: channel type permitted speech (2 items): + perm_spch[0]=FR1 + perm_spch[1]=HR1 + * BSS: audio support settings (3 items): + audio_support[0]=FR1 + audio_support[1]=FR3 + audio_support[2]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=0 + codec->efr=0 + codec->amr=1 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (1 items): + codec[0]->type=FR1 + * MSC: channel type permitted speech (2 items): + perm_spch[0]=FR1 + perm_spch[1]=HR1 + * BSS: audio support settings (3 items): + audio_support[0]=FR1 + audio_support[1]=FR3 + audio_support[2]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=0 + codec->efr=1 + codec->amr=0 + * result: rc=0, full_rate=1, chan_mode=SPEECH_V1 + +Determining channel mode and rate: + * MS: speech codec list (1 items): + codec[0]->type=HR1 + * MSC: channel type permitted speech (2 items): + perm_spch[0]=FR1 + perm_spch[1]=HR1 + * BSS: audio support settings (3 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=HR1 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=0 + codec->amr=0 * result: rc=0, full_rate=0, chan_mode=SPEECH_V1 ============== test_selected_non_working ============== @@ -679,6 +927,11 @@ audio_support[0]=FR1 audio_support[1]=FR3 audio_support[2]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=-1, full_rate=-1, chan_mode=SIGNALLING Determining channel mode and rate: @@ -691,6 +944,11 @@ audio_support[0]=FR1 audio_support[1]=FR3 audio_support[2]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 * result: rc=-1, full_rate=-1, chan_mode=SIGNALLING Determining channel mode and rate: @@ -702,6 +960,62 @@ audio_support[0]=FR1 audio_support[1]=FR2 audio_support[2]=HR1 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 + * result: rc=-1, full_rate=-1, chan_mode=SIGNALLING + +Determining channel mode and rate: + * MS: speech codec list (1 items): + codec[0]->type=HR1 + * MSC: channel type permitted speech (1 items): + perm_spch[0]=FR2 + * BSS: audio support settings (3 items): + audio_support[0]=FR1 + audio_support[1]=FR3 + audio_support[2]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 + * result: rc=-1, full_rate=-1, chan_mode=SIGNALLING + +Determining channel mode and rate: + * MS: speech codec list (1 items): + codec[0]->type=HR1 + * MSC: channel type permitted speech (2 items): + perm_spch[0]=FR1 + perm_spch[1]=HR1 + * BSS: audio support settings (1 items): + audio_support[0]=HR3 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=1 + codec->efr=1 + codec->amr=1 + * result: rc=-1, full_rate=-1, chan_mode=SIGNALLING + +Determining channel mode and rate: + * MS: speech codec list (5 items): + codec[0]->type=FR1 + codec[1]->type=FR2 + codec[2]->type=FR3 + codec[3]->type=HR1 + codec[4]->type=HR3 + * MSC: channel type permitted speech (1 items): + perm_spch[0]=HR3 + * BSS: audio support settings (3 items): + audio_support[0]=FR1 + audio_support[1]=FR2 + audio_support[2]=HR1 + * BTS: audio support settings: + (GSM-FR implicitly supported) + codec->hr=0 + codec->efr=0 + codec->amr=1 * result: rc=-1, full_rate=-1, chan_mode=SIGNALLING Testing execution completed. -- To view, visit https://gerrit.osmocom.org/10011 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I285234e9c81de74d9fb9907fca2c443b08537435 Gerrit-Change-Number: 10011 Gerrit-PatchSet: 11 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 22 06:22:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 22 Jul 2018 06:22:16 +0000 Subject: Change in osmo-ttcn3-hacks[master]: introduce a TTCN3 test suite for SCCP In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9653 ) Change subject: introduce a TTCN3 test suite for SCCP ...................................................................... Patch Set 3: Code-Review+1 (1 comment) fine except for the license header. let's get this over with :) https://gerrit.osmocom.org/#/c/9653/3/library/SCCP_Templates.ttcn File library/SCCP_Templates.ttcn: https://gerrit.osmocom.org/#/c/9653/3/library/SCCP_Templates.ttcn at 6 PS3, Line 6: Affero General Public License as published by : * the Free Software Foundation; either version 3 It should be GPLv2-or-later in this repo, not AGPLv3-or-later. -- To view, visit https://gerrit.osmocom.org/9653 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I03f5e8b282a7396b45417495c88d8fb81b26cda8 Gerrit-Change-Number: 9653 Gerrit-PatchSet: 3 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-Comment-Date: Sun, 22 Jul 2018 06:22:16 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 22 06:23:00 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 22 Jul 2018 06:23:00 +0000 Subject: Change in osmo-bsc[master]: ctrl: Avoid sending back received ERROR msgs In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9982 ) Change subject: ctrl: Avoid sending back received ERROR msgs ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9982 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If0cd4d435acd13dd132248c521e6bb0182de0deb Gerrit-Change-Number: 9982 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Sun, 22 Jul 2018 06:23:00 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 22 06:23:02 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 22 Jul 2018 06:23:02 +0000 Subject: Change in osmo-bsc[master]: ctrl: Avoid sending back received ERROR msgs In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9982 ) Change subject: ctrl: Avoid sending back received ERROR msgs ...................................................................... ctrl: Avoid sending back received ERROR msgs Change-Id: If0cd4d435acd13dd132248c521e6bb0182de0deb --- M src/osmo-bsc/osmo_bsc_ctrl.c 1 file changed, 3 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Neels Hofmeyr: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/src/osmo-bsc/osmo_bsc_ctrl.c b/src/osmo-bsc/osmo_bsc_ctrl.c index 13cf98d..77087c5 100644 --- a/src/osmo-bsc/osmo_bsc_ctrl.c +++ b/src/osmo-bsc/osmo_bsc_ctrl.c @@ -110,16 +110,17 @@ int bsc_sccplite_rx_ctrl(struct osmo_ss7_asp *asp, struct msgb *msg) { struct ctrl_cmd *cmd; + bool parse_failed; int rc; /* caller has already ensured ipaccess_head + ipaccess_head_ext */ OSMO_ASSERT(msg->l2h); /* prase raw (ASCII) CTRL command into ctrl_cmd */ - cmd = ctrl_cmd_parse2(asp, msg); + cmd = ctrl_cmd_parse3(asp, msg, &parse_failed); OSMO_ASSERT(cmd); msgb_free(msg); - if (cmd->type == CTRL_TYPE_ERROR) + if (cmd->type == CTRL_TYPE_ERROR && parse_failed) goto send_reply; /* handle the CTRL command */ -- To view, visit https://gerrit.osmocom.org/9982 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: If0cd4d435acd13dd132248c521e6bb0182de0deb Gerrit-Change-Number: 9982 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 22 06:32:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 22 Jul 2018 06:32:47 +0000 Subject: Change in osmo-ttcn3-hacks[master]: log / comment tweaks In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9627 ) Change subject: log / comment tweaks ...................................................................... Patch Set 3: > ok, so the package summary shows > > "RSL ip.access CRCX ACK" > > but in the packet details I only see the bytes, no RTP port > information: Are you sure you are using the "Use nanoBTS definitions" config setting? The RSL dissector will be (largely) limited to 3GPP standard RSL unless that setting is enabled. It was written by me in ~2010 and added to mainline wireshark in 2012. -- To view, visit https://gerrit.osmocom.org/9627 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I93c2914e766e200d89308cc81dd803e939b9b28c Gerrit-Change-Number: 9627 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte Gerrit-Comment-Date: Sun, 22 Jul 2018 06:32:47 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 22 06:35:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 22 Jul 2018 06:35:32 +0000 Subject: Change in osmo-bsc[master]: chan_alloc: delete rtp voice related in lchan_free() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10038 ) Change subject: chan_alloc: delete rtp voice related in lchan_free() ...................................................................... Patch Set 1: (1 comment) I'll quickly edit it myself. https://gerrit.osmocom.org/#/c/10038/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/10038/1//COMMIT_MSG at 7 PS1, Line 7: delete I would prefer to call this "overwrite", "re-initialize", "reset" or the like. "delete" sounds like dynamic memory management and some memory is actually freed/deleted (which it isn't). -- To view, visit https://gerrit.osmocom.org/10038 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0c99494292cd1d058a19a21413d0ddb51471c6be Gerrit-Change-Number: 10038 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Harald Welte Gerrit-Comment-Date: Sun, 22 Jul 2018 06:35:32 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 22 06:36:33 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 22 Jul 2018 06:36:33 +0000 Subject: Change in osmo-bsc[master]: chan_alloc: reset rtp voice related bits in lchan_free() In-Reply-To: References: Message-ID: Harald Welte has uploaded a new patch set (#2) to the change originally created by dexter. ( https://gerrit.osmocom.org/10038 ) Change subject: chan_alloc: reset rtp voice related bits in lchan_free() ...................................................................... chan_alloc: reset rtp voice related bits in lchan_free() The function lchan_free() is supposed to reset the lchan so that it can be used by another connection. This function does not yet reset the struct memebers in lchan->abis_ip. This may lead to confusion if some other end re-uses that lchan and finds old RTP voice port/ip settings there. Those data must be reset to ensure it does accidently migrate into an unrelated conext. - do a memset to 0 on lchan->abis_ip in lchan_free() Change-Id: I0c99494292cd1d058a19a21413d0ddb51471c6be Related: OS#3396 --- M src/osmo-bsc/chan_alloc.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/38/10038/2 -- To view, visit https://gerrit.osmocom.org/10038 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0c99494292cd1d058a19a21413d0ddb51471c6be Gerrit-Change-Number: 10038 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 22 07:26:42 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 22 Jul 2018 07:26:42 +0000 Subject: Change in osmo-bsc[master]: chan_alloc: reset rtp voice related bits in lchan_free() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10038 ) Change subject: chan_alloc: reset rtp voice related bits in lchan_free() ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10038 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0c99494292cd1d058a19a21413d0ddb51471c6be Gerrit-Change-Number: 10038 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Sun, 22 Jul 2018 07:26:42 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 22 07:26:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 22 Jul 2018 07:26:52 +0000 Subject: Change in osmo-bsc[master]: chan_alloc: reset rtp voice related bits in lchan_free() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10038 ) Change subject: chan_alloc: reset rtp voice related bits in lchan_free() ...................................................................... chan_alloc: reset rtp voice related bits in lchan_free() The function lchan_free() is supposed to reset the lchan so that it can be used by another connection. This function does not yet reset the struct memebers in lchan->abis_ip. This may lead to confusion if some other end re-uses that lchan and finds old RTP voice port/ip settings there. Those data must be reset to ensure it does accidently migrate into an unrelated conext. - do a memset to 0 on lchan->abis_ip in lchan_free() Change-Id: I0c99494292cd1d058a19a21413d0ddb51471c6be Related: OS#3396 --- M src/osmo-bsc/chan_alloc.c 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bsc/chan_alloc.c b/src/osmo-bsc/chan_alloc.c index a24fbea..cec5846 100644 --- a/src/osmo-bsc/chan_alloc.c +++ b/src/osmo-bsc/chan_alloc.c @@ -539,6 +539,9 @@ /* FIXME: ts_free() the timeslot, if we're the last logical * channel using it */ + + /* reset RTP voice connection related data */ + memset(&lchan->abis_ip, 0, sizeof(lchan->abis_ip)); } /* -- To view, visit https://gerrit.osmocom.org/10038 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I0c99494292cd1d058a19a21413d0ddb51471c6be Gerrit-Change-Number: 10038 Gerrit-PatchSet: 3 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 22 07:27:56 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 22 Jul 2018 07:27:56 +0000 Subject: Change in osmo-bsc[master]: handover_logic: make sure IPACC is done before MGCP In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10039 ) Change subject: handover_logic: make sure IPACC is done before MGCP ...................................................................... Patch Set 2: i'll defer to neels for reviewing/approving this -- To view, visit https://gerrit.osmocom.org/10039 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I01f05f5d8abe07a0d063e84a1984ac5797afb4f7 Gerrit-Change-Number: 10039 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Assignee: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Harald Welte Gerrit-CC: Neels Hofmeyr Gerrit-Comment-Date: Sun, 22 Jul 2018 07:27:56 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 22 10:01:59 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 22 Jul 2018 10:01:59 +0000 Subject: Change in osmocom-bb[master]: Move from libc random() to osmo_get_rand_id (2nd attempt) In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/10098 ) Change subject: Move from libc random() to osmo_get_rand_id (2nd attempt) ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/10098/1/src/host/layer23/src/mobile/utils.c File src/host/layer23/src/mobile/utils.c: https://gerrit.osmocom.org/#/c/10098/1/src/host/layer23/src/mobile/utils.c at 37 PS1, Line 37: int mobile_random(void) Just a few questions: - Why do we need int, and not unsigned int? It's written in description that return value starts from 0... - Why not to share this wrapper in 'src/host/layer23/src/common/utils.c'? This way some other fragmented parts would be able to use it, e.g. misc utils... -- To view, visit https://gerrit.osmocom.org/10098 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Icdd4be88c62bba1e9d954568e48f0c12a67ac182 Gerrit-Change-Number: 10098 Gerrit-PatchSet: 1 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Sun, 22 Jul 2018 10:01:59 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 22 13:02:42 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 22 Jul 2018 13:02:42 +0000 Subject: Change in osmo-ttcn3-hacks[master]: bts: add missing BTS_Tests.cfg config file Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10099 Change subject: bts: add missing BTS_Tests.cfg config file ...................................................................... bts: add missing BTS_Tests.cfg config file Change-Id: I2b1f9b6f910dfdb828bbe95836a2b72ee35ef1d8 --- A bts/BTS_Tests.cfg 1 file changed, 31 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/99/10099/1 diff --git a/bts/BTS_Tests.cfg b/bts/BTS_Tests.cfg new file mode 100644 index 0000000..58eed2c --- /dev/null +++ b/bts/BTS_Tests.cfg @@ -0,0 +1,31 @@ +[ORDERED_INCLUDE] +# Common configuration, shared between test suites +"../Common.cfg" +# testsuite specific configuration, not expected to change +"./BTS_Tests.default" + +# Local configuration below + +[LOGGING] + +[TESTPORT_PARAMETERS] +#*.BTSVTY.CTRL_HOSTNAME := "10.9.1.191" # sysmoBTS Max +#*.BTSVTY.CTRL_HOSTNAME := "10.9.1.162" # sysmoBTS Pau +#*.BTSVTY.CTRL_HOSTNAME := "192.168.100.130" # sysmoBTS home +*.BTSVTY.CTRL_HOSTNAME := "127.0.0.1" # osmo-bts-trx + +[MODULE_PARAMETERS] +#BTS_Tests.mp_rsl_ip := "10.9.1.2" # office +BTS_Tests.mp_rsl_ip := "192.168.100.2" # home +#BTS_Tests.mp_pcu_socket := "" + +# real BTS / RF +#BTS_Tests.mp_bb_trxc_port := -1 +#BTS_Tests.mp_tolerance_rxlev := 10; +#BTS_Tests.mp_tolerance_rxqual := 1; + + +[MAIN_CONTROLLER] + +[EXECUTE] +BTS_Tests.control -- To view, visit https://gerrit.osmocom.org/10099 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I2b1f9b6f910dfdb828bbe95836a2b72ee35ef1d8 Gerrit-Change-Number: 10099 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 22 13:15:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 22 Jul 2018 13:15:24 +0000 Subject: Change in libosmocore[master]: gprs_ns.h: Declare gprs_ns_cause_str() which already existed in c file Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10100 Change subject: gprs_ns.h: Declare gprs_ns_cause_str() which already existed in c file ...................................................................... gprs_ns.h: Declare gprs_ns_cause_str() which already existed in c file Change-Id: Ia95f0cc8d110f95814173bb5a1c11bd85d8cd533 --- M include/osmocom/gprs/gprs_ns.h 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/00/10100/1 diff --git a/include/osmocom/gprs/gprs_ns.h b/include/osmocom/gprs/gprs_ns.h index 7b95099..c97b200 100644 --- a/include/osmocom/gprs/gprs_ns.h +++ b/include/osmocom/gprs/gprs_ns.h @@ -214,6 +214,7 @@ }; extern const struct value_string gprs_ns_signal_ns_names[]; +const char *gprs_ns_cause_str(enum ns_cause cause); struct ns_signal_data { struct gprs_nsvc *nsvc; -- To view, visit https://gerrit.osmocom.org/10100 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ia95f0cc8d110f95814173bb5a1c11bd85d8cd533 Gerrit-Change-Number: 10100 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Sun Jul 22 15:10:07 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Sun, 22 Jul 2018 15:10:07 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-asn1c_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#192?= In-Reply-To: <1595967447.6.1532185807539.JavaMail.jenkins@jenkins.osmocom.org> References: <1595967447.6.1532185807539.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <1185752000.36.1532272207201.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 3.67 KB...] + ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for style of include used by make... GNU checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking how to run the C++ preprocessor... g++ -E checking for g77... no checking for f77... no checking for xlf... no checking for frt... no checking for pgf77... no checking for cf77... no checking for fort77... no checking for fl32... no checking for af77... no checking for f90... no checking for xlf90... no checking for pgf90... no checking for pghpf... no checking for epcf90... no checking for gfortran... no checking for g95... no checking for f95... no checking for fort... no checking for xlf95... no checking for ifort... no checking for ifc... no checking for efc... no checking for pgf95... no checking for lf95... no checking for ftn... no checking whether we are using the GNU Fortran 77 compiler... no checking whether accepts -g... no checking the maximum length of command line arguments... 32768 checking command to parse /usr/bin/nm -B output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes configure: creating libtool appending configuration tag "CXX" to libtool checking for ld used by g++... /usr/bin/ld -m elf_x86_64 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC checking if g++ PIC flag -fPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate appending configuration tag "F77" to libtool checking for autoconf... /usr/bin/autoconf checking for autoheader... /usr/bin/autoheader checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking dependency style of gcc... (cached) gcc3 checking how to run the C preprocessor... gcc -E checking for a BSD-compatible install... /usr/bin/install -c checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking for bison... bison -y checking for flex... flex checking for yywrap in -lfl... yes checking lex output file root... lex.yy checking whether yytext is a pointer... yes checking for ar... /usr/bin/ar checking for ANSI C header files... (cached) yes checking sys/param.h usability... yes checking sys/param.h presence... yes checking for sys/param.h... yes checking whether byte ordering is bigendian... no checking for off_t... yes checking for size_t... yes checking whether struct tm is in sys/time.h or time.h... time.h checking for intmax_t... yes checking for library containing getopt... none required checking for strtoimax... yes checking for strtoll... yes checking for mergesort... no checking for mkstemps... yes configure: creating ./config.status config.status: creating skeletons/standard-modules/Makefile config.status: creating skeletons/tests/Makefile config.status: creating libasn1compiler/Makefile config.status: creating libasn1parser/Makefile config.status: creating libasn1print/Makefile config.status: creating asn1c/webcgi/Makefile config.status: creating asn1c/tests/Makefile config.status: creating libasn1fix/Makefile config.status: creating skeletons/Makefile config.status: creating examples/Makefile config.status: creating tests/Makefile config.status: creating asn1c/Makefile config.status: creating doc/Makefile config.status: creating asn1c.spec config.status: creating Makefile config.status: creating config.h config.status: executing depfiles commands + make -j 8 make all-recursive make[1]: Entering directory ' Making all in libasn1parser make[2]: Entering directory ' if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF ".deps/asn1parser.Tpo" -c -o asn1parser.lo asn1parser.c; \ then mv -f ".deps/asn1parser.Tpo" ".deps/asn1parser.Plo"; else rm -f ".deps/asn1parser.Tpo"; exit 1; fi bison -y -p asn1p_ -d asn1p_y.y if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF ".deps/asn1p_l.Tpo" -c -o asn1p_l.lo asn1p_l.c; \ then mv -f ".deps/asn1p_l.Tpo" ".deps/asn1p_l.Plo"; else rm -f ".deps/asn1p_l.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF ".deps/asn1p_module.Tpo" -c -o asn1p_module.lo asn1p_module.c; \ then mv -f ".deps/asn1p_module.Tpo" ".deps/asn1p_module.Plo"; else rm -f ".deps/asn1p_module.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF ".deps/asn1p_oid.Tpo" -c -o asn1p_oid.lo asn1p_oid.c; \ then mv -f ".deps/asn1p_oid.Tpo" ".deps/asn1p_oid.Plo"; else rm -f ".deps/asn1p_oid.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF ".deps/asn1p_value.Tpo" -c -o asn1p_value.lo asn1p_value.c; \ then mv -f ".deps/asn1p_value.Tpo" ".deps/asn1p_value.Plo"; else rm -f ".deps/asn1p_value.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF ".deps/asn1p_expr.Tpo" -c -o asn1p_expr.lo asn1p_expr.c; \ then mv -f ".deps/asn1p_expr.Tpo" ".deps/asn1p_expr.Plo"; else rm -f ".deps/asn1p_expr.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF ".deps/asn1p_xports.Tpo" -c -o asn1p_xports.lo asn1p_xports.c; \ then mv -f ".deps/asn1p_xports.Tpo" ".deps/asn1p_xports.Plo"; else rm -f ".deps/asn1p_xports.Tpo"; exit 1; fi asn1p_y.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] mkdir .libs gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -fPIC -DPIC -o .libs/asn1p_value.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -fPIC -DPIC -o .libs/asn1p_expr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -fPIC -DPIC -o .libs/asn1p_l.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -fPIC -DPIC -o .libs/asn1p_module.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -fPIC -DPIC -o .libs/asn1p_xports.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -fPIC -DPIC -o .libs/asn1p_oid.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -fPIC -DPIC -o .libs/asn1parser.o asn1p_l.c:3521:12: warning: 'input' defined but not used [-Wunused-function] static int input() ^~~~~ gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -o asn1p_xports.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -o asn1p_module.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -o asn1p_value.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -o asn1p_oid.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -o asn1parser.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF ".deps/asn1p_constr.Tpo" -c -o asn1p_constr.lo asn1p_constr.c; \ then mv -f ".deps/asn1p_constr.Tpo" ".deps/asn1p_constr.Plo"; else rm -f ".deps/asn1p_constr.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -o asn1p_expr.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF ".deps/asn1p_param.Tpo" -c -o asn1p_param.lo asn1p_param.c; \ then mv -f ".deps/asn1p_param.Tpo" ".deps/asn1p_param.Plo"; else rm -f ".deps/asn1p_param.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF ".deps/asn1p_class.Tpo" -c -o asn1p_class.lo asn1p_class.c; \ then mv -f ".deps/asn1p_class.Tpo" ".deps/asn1p_class.Plo"; else rm -f ".deps/asn1p_class.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF ".deps/asn1p_ref.Tpo" -c -o asn1p_ref.lo asn1p_ref.c; \ then mv -f ".deps/asn1p_ref.Tpo" ".deps/asn1p_ref.Plo"; else rm -f ".deps/asn1p_ref.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -fPIC -DPIC -o .libs/asn1p_constr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -fPIC -DPIC -o .libs/asn1p_param.o if test -f y.tab.h; then \ to=`echo "asn1p_y_H" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \ sed -e "/^#/!b" -e "s/Y_TAB_H/$to/g" -e "s|y\.tab\.h|asn1p_y.h|" \ y.tab.h >asn1p_y.ht; \ rm -f y.tab.h; \ if cmp -s asn1p_y.ht asn1p_y.h; then \ rm -f asn1p_y.ht ;\ else \ mv asn1p_y.ht asn1p_y.h; \ fi; \ fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -fPIC -DPIC -o .libs/asn1p_ref.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -fPIC -DPIC -o .libs/asn1p_class.o if test -f y.output; then \ mv y.output asn1p_y.output; \ fi sed '/^#/ s|y\.tab\.c|asn1p_y.c|' y.tab.c >asn1p_y.ct && mv asn1p_y.ct asn1p_y.c gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -o asn1p_param.o >/dev/null 2>&1 rm -f y.tab.c if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF ".deps/asn1p_y.Tpo" -c -o asn1p_y.lo asn1p_y.c; \ then mv -f ".deps/asn1p_y.Tpo" ".deps/asn1p_y.Plo"; else rm -f ".deps/asn1p_y.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -o asn1p_constr.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -o asn1p_ref.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -o asn1p_l.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -o asn1p_class.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF .deps/asn1p_y.Tpo -c asn1p_y.c -fPIC -DPIC -o .libs/asn1p_y.o asn1p_y.y: In function 'asn1p_parse': asn1p_y.y:357:13: error: 'param' undeclared (first use in this function) *(void **)param = $1; ^~~~~ asn1p_y.y:357:13: note: each undeclared identifier is reported only once for each function it appears in Makefile:299: recipe for target 'asn1p_y.lo' failed make[2]: *** [asn1p_y.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory ' Makefile:302: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory ' Makefile:212: recipe for target 'all' failed make: *** [all] Error 2 Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Sun Jul 22 21:10:35 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 22 Jul 2018 21:10:35 +0000 Subject: Change in libosmocore[master]: gprs_ns.h: Declare gprs_ns_cause_str() which already existed in c file In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10100 ) Change subject: gprs_ns.h: Declare gprs_ns_cause_str() which already existed in c file ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10100 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia95f0cc8d110f95814173bb5a1c11bd85d8cd533 Gerrit-Change-Number: 10100 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Sun, 22 Jul 2018 21:10:35 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 22 21:10:38 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 22 Jul 2018 21:10:38 +0000 Subject: Change in libosmocore[master]: gprs_ns.h: Declare gprs_ns_cause_str() which already existed in c file In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10100 ) Change subject: gprs_ns.h: Declare gprs_ns_cause_str() which already existed in c file ...................................................................... gprs_ns.h: Declare gprs_ns_cause_str() which already existed in c file Change-Id: Ia95f0cc8d110f95814173bb5a1c11bd85d8cd533 --- M include/osmocom/gprs/gprs_ns.h 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmocom/gprs/gprs_ns.h b/include/osmocom/gprs/gprs_ns.h index 7b95099..c97b200 100644 --- a/include/osmocom/gprs/gprs_ns.h +++ b/include/osmocom/gprs/gprs_ns.h @@ -214,6 +214,7 @@ }; extern const struct value_string gprs_ns_signal_ns_names[]; +const char *gprs_ns_cause_str(enum ns_cause cause); struct ns_signal_data { struct gprs_nsvc *nsvc; -- To view, visit https://gerrit.osmocom.org/10100 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ia95f0cc8d110f95814173bb5a1c11bd85d8cd533 Gerrit-Change-Number: 10100 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 22 21:10:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 22 Jul 2018 21:10:52 +0000 Subject: Change in osmo-ttcn3-hacks[master]: bts: add missing BTS_Tests.cfg config file In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10099 ) Change subject: bts: add missing BTS_Tests.cfg config file ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10099 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2b1f9b6f910dfdb828bbe95836a2b72ee35ef1d8 Gerrit-Change-Number: 10099 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Sun, 22 Jul 2018 21:10:52 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 22 21:10:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 22 Jul 2018 21:10:54 +0000 Subject: Change in osmo-ttcn3-hacks[master]: bts: add missing BTS_Tests.cfg config file In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10099 ) Change subject: bts: add missing BTS_Tests.cfg config file ...................................................................... bts: add missing BTS_Tests.cfg config file Change-Id: I2b1f9b6f910dfdb828bbe95836a2b72ee35ef1d8 --- A bts/BTS_Tests.cfg 1 file changed, 31 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/bts/BTS_Tests.cfg b/bts/BTS_Tests.cfg new file mode 100644 index 0000000..58eed2c --- /dev/null +++ b/bts/BTS_Tests.cfg @@ -0,0 +1,31 @@ +[ORDERED_INCLUDE] +# Common configuration, shared between test suites +"../Common.cfg" +# testsuite specific configuration, not expected to change +"./BTS_Tests.default" + +# Local configuration below + +[LOGGING] + +[TESTPORT_PARAMETERS] +#*.BTSVTY.CTRL_HOSTNAME := "10.9.1.191" # sysmoBTS Max +#*.BTSVTY.CTRL_HOSTNAME := "10.9.1.162" # sysmoBTS Pau +#*.BTSVTY.CTRL_HOSTNAME := "192.168.100.130" # sysmoBTS home +*.BTSVTY.CTRL_HOSTNAME := "127.0.0.1" # osmo-bts-trx + +[MODULE_PARAMETERS] +#BTS_Tests.mp_rsl_ip := "10.9.1.2" # office +BTS_Tests.mp_rsl_ip := "192.168.100.2" # home +#BTS_Tests.mp_pcu_socket := "" + +# real BTS / RF +#BTS_Tests.mp_bb_trxc_port := -1 +#BTS_Tests.mp_tolerance_rxlev := 10; +#BTS_Tests.mp_tolerance_rxqual := 1; + + +[MAIN_CONTROLLER] + +[EXECUTE] +BTS_Tests.control -- To view, visit https://gerrit.osmocom.org/10099 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I2b1f9b6f910dfdb828bbe95836a2b72ee35ef1d8 Gerrit-Change-Number: 10099 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 01:00:25 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Jul 2018 01:00:25 +0000 Subject: Change in osmo-bsc[master]: cosmetic: FSMs: allow ignorable events Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10101 Change subject: cosmetic: FSMs: allow ignorable events ...................................................................... cosmetic: FSMs: allow ignorable events In various FSMs, some events may appear later or earlier without need of action. Do not indicate these as 'ERROR' (event not permitted), but allow and ignore them. Debug-log about some of those. >From the old code, we've taken over the habit to change into WAIT_BEFORE_RF_RELEASE even before SAPI[0] is released. Hence we may still receive a SAPI[0] REL_IND in WAIT_BEFORE_RF_RELEASE. Don't show this as error message, just silently accept it. Change-Id: Ie320c7c6a1436184aaf2ec5a1843e04f4b3414ab --- M src/osmo-bsc/assignment_fsm.c M src/osmo-bsc/handover_fsm.c M src/osmo-bsc/lchan_fsm.c 3 files changed, 60 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/01/10101/1 diff --git a/src/osmo-bsc/assignment_fsm.c b/src/osmo-bsc/assignment_fsm.c index 61757ba..618a83d 100644 --- a/src/osmo-bsc/assignment_fsm.c +++ b/src/osmo-bsc/assignment_fsm.c @@ -433,8 +433,9 @@ return; case ASSIGNMENT_EV_LCHAN_ESTABLISHED: - /* The lchan is already done with all of its RTP setup. We will notice the lchan state to - * be established in assignment_fsm_wait_lchan_established_onenter(). */ + LOG_ASSIGNMENT(conn, LOGL_DEBUG, "lchan established, still waiting for RR Assignment Complete\n"); + /* The lchan is already done with all of its RTP setup. We will notice the lchan state + * being LCHAN_ST_ESTABLISHED in assignment_fsm_wait_lchan_established_onenter(). */ return; case ASSIGNMENT_EV_RR_ASSIGNMENT_FAIL: @@ -453,8 +454,10 @@ { struct gsm_subscriber_connection *conn = assignment_fi_conn(fi); /* Do we still need to wait for the RTP stream at all? */ - if (lchan_state_is(conn->assignment.new_lchan, LCHAN_ST_ESTABLISHED)) + if (lchan_state_is(conn->assignment.new_lchan, LCHAN_ST_ESTABLISHED)) { + LOG_ASSIGNMENT(conn, LOGL_DEBUG, "lchan fully established, no need to wait"); assignment_fsm_post_lchan_established(fi); + } } static void assignment_fsm_wait_lchan_established(struct osmo_fsm_inst *fi, uint32_t event, void *data) @@ -558,6 +561,7 @@ .in_event_mask = 0 | S(ASSIGNMENT_EV_RR_ASSIGNMENT_COMPLETE) | S(ASSIGNMENT_EV_RR_ASSIGNMENT_FAIL) + | S(ASSIGNMENT_EV_LCHAN_ESTABLISHED) , .out_state_mask = 0 | S(ASSIGNMENT_ST_WAIT_LCHAN_ESTABLISHED) diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c index 1be4214..e3f64cd 100644 --- a/src/osmo-bsc/handover_fsm.c +++ b/src/osmo-bsc/handover_fsm.c @@ -872,6 +872,16 @@ switch (event) { + case HO_EV_RR_HO_DETECT: + /* Numerous HO Detect RACH bursts may follow after the initial one, ignore. */ + return; + + case HO_EV_LCHAN_ESTABLISHED: + LOG_HO(conn, LOGL_DEBUG, "lchan established, still waiting for RR Handover Complete\n"); + /* The lchan is already done with all of its RTP setup. We will notice the lchan state + * being LCHAN_ST_ESTABLISHED in ho_fsm_wait_lchan_established_onenter(). */ + return; + case HO_EV_RR_HO_COMPLETE: ho_fsm_state_chg(HO_ST_WAIT_LCHAN_ESTABLISHED); return; @@ -891,8 +901,10 @@ { struct gsm_subscriber_connection *conn = ho_fi_conn(fi); - if (conn->ho.fi && lchan_state_is(conn->ho.new_lchan, LCHAN_ST_ESTABLISHED)) + if (conn->ho.fi && lchan_state_is(conn->ho.new_lchan, LCHAN_ST_ESTABLISHED)) { + LOG_HO(conn, LOGL_DEBUG, "lchan already established earlier\n"); ho_fsm_post_lchan_established(fi); + } } static void ho_fsm_wait_lchan_established(struct osmo_fsm_inst *fi, uint32_t event, void *data) @@ -1068,6 +1080,8 @@ .name = "WAIT_RR_HO_COMPLETE", .action = ho_fsm_wait_rr_ho_complete, .in_event_mask = 0 + | S(HO_EV_RR_HO_DETECT) /* ignore extra HO RACH */ + | S(HO_EV_LCHAN_ESTABLISHED) | S(HO_EV_RR_HO_COMPLETE) | S(HO_EV_RR_HO_FAIL) , diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c index 3c616dd..f25e7b9 100644 --- a/src/osmo-bsc/lchan_fsm.c +++ b/src/osmo-bsc/lchan_fsm.c @@ -755,7 +755,11 @@ case LCHAN_EV_MGW_ENDPOINT_AVAILABLE: lchan->activate.mgw_endpoint_available = true; lchan_fsm_tch_post_endpoint_available(fi); - break; + return; + + case LCHAN_EV_RLL_ESTABLISH_IND: + /* abis_rsl.c has noticed that a SAPI was established, no need to take action here. */ + return; default: OSMO_ASSERT(false); @@ -828,6 +832,10 @@ lchan_fail("Received NACK on IPACC CRCX"); return; + case LCHAN_EV_RLL_ESTABLISH_IND: + /* abis_rsl.c has noticed that a SAPI was established, no need to take action here. */ + return; + default: OSMO_ASSERT(false); } @@ -879,6 +887,10 @@ lchan_fail("Received NACK on IPACC MDCX"); return; + case LCHAN_EV_RLL_ESTABLISH_IND: + /* abis_rsl.c has noticed that a SAPI was established, no need to take action here. */ + return; + default: OSMO_ASSERT(false); } @@ -946,6 +958,10 @@ lchan_fail("Error while redirecting the MGW to the BTS' RTP port"); return; + case LCHAN_EV_RLL_ESTABLISH_IND: + /* abis_rsl.c has noticed that a SAPI was established, no need to take action here. */ + return; + default: OSMO_ASSERT(false); } @@ -1033,7 +1049,19 @@ static void lchan_fsm_established(struct osmo_fsm_inst *fi, uint32_t event, void *data) { - handle_rll_rel_ind_or_conf(fi, event, data, true); + switch (event) { + case LCHAN_EV_RLL_ESTABLISH_IND: + /* abis_rsl.c has noticed that a SAPI was established, no need to take action here. */ + return; + + case LCHAN_EV_RLL_REL_IND: + case LCHAN_EV_RLL_REL_CONF: + handle_rll_rel_ind_or_conf(fi, event, data, true); + return; + + default: + OSMO_ASSERT(false); + } } static bool should_sacch_deact(struct gsm_lchan *lchan) @@ -1236,6 +1264,7 @@ .action = lchan_fsm_wait_mgw_endpoint_available, .in_event_mask = 0 | S(LCHAN_EV_MGW_ENDPOINT_AVAILABLE) + | S(LCHAN_EV_RLL_ESTABLISH_IND) /* ignored */ , .out_state_mask = 0 | S(LCHAN_ST_UNUSED) @@ -1252,6 +1281,7 @@ .in_event_mask = 0 | S(LCHAN_EV_IPACC_CRCX_ACK) | S(LCHAN_EV_IPACC_CRCX_NACK) + | S(LCHAN_EV_RLL_ESTABLISH_IND) /* ignored */ , .out_state_mask = 0 | S(LCHAN_ST_UNUSED) @@ -1267,6 +1297,7 @@ .in_event_mask = 0 | S(LCHAN_EV_IPACC_MDCX_ACK) | S(LCHAN_EV_IPACC_MDCX_NACK) + | S(LCHAN_EV_RLL_ESTABLISH_IND) /* ignored */ , .out_state_mask = 0 | S(LCHAN_ST_UNUSED) @@ -1281,6 +1312,7 @@ .action = lchan_fsm_wait_mgw_endpoint_configured, .in_event_mask = 0 | S(LCHAN_EV_MGW_ENDPOINT_CONFIGURED) + | S(LCHAN_EV_RLL_ESTABLISH_IND) /* ignored */ , .out_state_mask = 0 | S(LCHAN_ST_UNUSED) @@ -1296,6 +1328,7 @@ .in_event_mask = 0 | S(LCHAN_EV_RLL_REL_IND) | S(LCHAN_EV_RLL_REL_CONF) + | S(LCHAN_EV_RLL_ESTABLISH_IND) /* ignored */ , .out_state_mask = 0 | S(LCHAN_ST_UNUSED) @@ -1320,6 +1353,9 @@ }, [LCHAN_ST_WAIT_BEFORE_RF_RELEASE] = { .name = "WAIT_BEFORE_RF_RELEASE", + .in_event_mask = 0 + | S(LCHAN_EV_RLL_REL_IND) /* allow late REL_IND of SAPI[0] */ + , .out_state_mask = 0 | S(LCHAN_ST_UNUSED) | S(LCHAN_ST_WAIT_RF_RELEASE_ACK) -- To view, visit https://gerrit.osmocom.org/10101 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ie320c7c6a1436184aaf2ec5a1843e04f4b3414ab Gerrit-Change-Number: 10101 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 01:00:26 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Jul 2018 01:00:26 +0000 Subject: Change in osmo-bsc[master]: fix BSC_CTR_ASSIGNMENT doc strings Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10102 Change subject: fix BSC_CTR_ASSIGNMENT doc strings ...................................................................... fix BSC_CTR_ASSIGNMENT doc strings Change-Id: I9de0c16a14edd8bf4f02b7781ccfd211e0a79463 --- M include/osmocom/bsc/gsm_data.h 1 file changed, 7 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/02/10102/1 diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index ce563ef..7d89371 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -1307,13 +1307,13 @@ }; static const struct rate_ctr_desc bsc_ctr_description[] = { - [BSC_CTR_ASSIGNMENT_ATTEMPTED] = {"assignment:attempted", "Intra-cell re-assignment attempts."}, - [BSC_CTR_ASSIGNMENT_COMPLETED] = {"assignment:completed", "Intra-cell re-assignment completed."}, - [BSC_CTR_ASSIGNMENT_STOPPED] = {"assignment:stopped", "Connection ended during re-assignment."}, - [BSC_CTR_ASSIGNMENT_NO_CHANNEL] = {"assignment:no_channel", "Failure to allocate lchan for re-assignment."}, - [BSC_CTR_ASSIGNMENT_TIMEOUT] = {"assignment:timeout", "Re-assignment timed out."}, - [BSC_CTR_ASSIGNMENT_FAILED] = {"assignment:failed", "Received FAIL message."}, - [BSC_CTR_ASSIGNMENT_ERROR] = {"assignment:error", "Re-assigment failed for other reason."}, + [BSC_CTR_ASSIGNMENT_ATTEMPTED] = {"assignment:attempted", "Assignment attempts."}, + [BSC_CTR_ASSIGNMENT_COMPLETED] = {"assignment:completed", "Assignment completed."}, + [BSC_CTR_ASSIGNMENT_STOPPED] = {"assignment:stopped", "Connection ended during Assignment."}, + [BSC_CTR_ASSIGNMENT_NO_CHANNEL] = {"assignment:no_channel", "Failure to allocate lchan for Assignment."}, + [BSC_CTR_ASSIGNMENT_TIMEOUT] = {"assignment:timeout", "Assignment timed out."}, + [BSC_CTR_ASSIGNMENT_FAILED] = {"assignment:failed", "Received Assignment Failure message."}, + [BSC_CTR_ASSIGNMENT_ERROR] = {"assignment:error", "Assigment failed for other reason."}, [BSC_CTR_HANDOVER_ATTEMPTED] = {"handover:attempted", "Intra-BSC handover attempts."}, [BSC_CTR_HANDOVER_COMPLETED] = {"handover:completed", "Intra-BSC handover completed."}, -- To view, visit https://gerrit.osmocom.org/10102 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I9de0c16a14edd8bf4f02b7781ccfd211e0a79463 Gerrit-Change-Number: 10102 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 01:00:26 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Jul 2018 01:00:26 +0000 Subject: Change in osmo-bsc[master]: lchan_fsm: split off lchan_rtp_fsm, establish RTP a bit earlier Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10103 Change subject: lchan_fsm: split off lchan_rtp_fsm, establish RTP a bit earlier ...................................................................... lchan_fsm: split off lchan_rtp_fsm, establish RTP a bit earlier Change-Id: Id7a4407d9b63be05ce63f5f2768b7d7e3d5c86fb --- M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/lchan_fsm.h A include/osmocom/bsc/lchan_rtp_fsm.h M src/osmo-bsc/Makefile.am M src/osmo-bsc/abis_rsl.c M src/osmo-bsc/bsc_subscr_conn_fsm.c M src/osmo-bsc/handover_fsm.c M src/osmo-bsc/lchan_fsm.c A src/osmo-bsc/lchan_rtp_fsm.c M tests/handover/Makefile.am M tests/handover/handover_test.c 12 files changed, 1,038 insertions(+), 481 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/03/10103/1 diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am index f1a9ce7..ac62d5e 100644 --- a/include/osmocom/bsc/Makefile.am +++ b/include/osmocom/bsc/Makefile.am @@ -29,6 +29,7 @@ handover_vty.h \ ipaccess.h \ lchan_fsm.h \ + lchan_rtp_fsm.h \ lchan_select.h \ meas_feed.h \ meas_rep.h \ diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 7d89371..7bd0943 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -499,13 +499,15 @@ char *name; struct osmo_fsm_inst *fi; + struct osmo_fsm_inst *fi_rtp; struct mgwep_ci *mgw_endpoint_ci_bts; struct { enum lchan_activate_mode activ_for; + bool activ_ack; /*< true as soon as RSL Chan Activ Ack is received */ bool concluded; /*< true as soon as LCHAN_ST_ESTABLISHED is reached */ bool requires_voice_stream; - bool mgw_endpoint_available; + bool wait_before_switching_rtp; /*< true = requires LCHAN_EV_READY_TO_SWITCH_RTP */ uint16_t msc_assigned_cic; enum gsm0808_cause gsm0808_error_cause; struct gsm_lchan *re_use_mgw_endpoint_from_lchan; diff --git a/include/osmocom/bsc/lchan_fsm.h b/include/osmocom/bsc/lchan_fsm.h index 49701c1..35b8847 100644 --- a/include/osmocom/bsc/lchan_fsm.h +++ b/include/osmocom/bsc/lchan_fsm.h @@ -16,13 +16,9 @@ LCHAN_ST_UNUSED, LCHAN_ST_WAIT_TS_READY, LCHAN_ST_WAIT_ACTIV_ACK, /*< After RSL Chan Act Ack, lchan is active but RTP not configured. */ - LCHAN_ST_WAIT_RLL_ESTABLISH, - LCHAN_ST_WAIT_MGW_ENDPOINT_AVAILABLE, - LCHAN_ST_WAIT_IPACC_CRCX_ACK, - LCHAN_ST_WAIT_IPACC_MDCX_ACK, - LCHAN_ST_WAIT_MGW_ENDPOINT_CONFIGURED, + LCHAN_ST_WAIT_RLL_RTP_ESTABLISH, LCHAN_ST_ESTABLISHED, /*< Active and RTP is fully configured. */ - LCHAN_ST_WAIT_SAPIS_RELEASED, + LCHAN_ST_WAIT_RLL_RTP_RELEASED, LCHAN_ST_WAIT_BEFORE_RF_RELEASE, LCHAN_ST_WAIT_RF_RELEASE_ACK, LCHAN_ST_WAIT_AFTER_ERROR, @@ -36,13 +32,9 @@ LCHAN_EV_RSL_CHAN_ACTIV_ACK, LCHAN_EV_RSL_CHAN_ACTIV_NACK, LCHAN_EV_RLL_ESTABLISH_IND, - LCHAN_EV_MGW_ENDPOINT_AVAILABLE, - LCHAN_EV_MGW_ENDPOINT_CONFIGURED, - LCHAN_EV_MGW_ENDPOINT_ERROR, - LCHAN_EV_IPACC_CRCX_ACK, - LCHAN_EV_IPACC_CRCX_NACK, - LCHAN_EV_IPACC_MDCX_ACK, - LCHAN_EV_IPACC_MDCX_NACK, + LCHAN_EV_RTP_READY, + LCHAN_EV_RTP_ERROR, + LCHAN_EV_RTP_RELEASED, LCHAN_EV_RLL_REL_IND, LCHAN_EV_RLL_REL_CONF, LCHAN_EV_RSL_RF_CHAN_REL_ACK, @@ -66,11 +58,13 @@ * When a dyn TS was selected, the lchan->type has been set to the desired rate. */ enum gsm48_chan_mode chan_mode; bool requires_voice_stream; + bool wait_before_switching_rtp; uint16_t msc_assigned_cic; struct gsm_lchan *old_lchan; }; void lchan_activate(struct gsm_lchan *lchan, struct lchan_activate_info *info); +void lchan_ready_to_switch_rtp(struct gsm_lchan *lchan); static inline const char *lchan_state_name(struct gsm_lchan *lchan) { @@ -86,4 +80,5 @@ bool lchan_may_receive_data(struct gsm_lchan *lchan); void lchan_forget_conn(struct gsm_lchan *lchan); -void lchan_forget_mgw_endpoint(struct gsm_lchan *lchan); + +void lchan_set_last_error(struct gsm_lchan *lchan, const char *fmt, ...); diff --git a/include/osmocom/bsc/lchan_rtp_fsm.h b/include/osmocom/bsc/lchan_rtp_fsm.h new file mode 100644 index 0000000..fa0e746 --- /dev/null +++ b/include/osmocom/bsc/lchan_rtp_fsm.h @@ -0,0 +1,45 @@ +/* osmo-bsc API to manage lchans, logical channels in GSM cells. */ +#pragma once + +#define LOG_LCHAN_RTP(lchan, level, fmt, args...) do { \ + if (lchan->fi_rtp) \ + LOGPFSML(lchan->fi_rtp, level, fmt, ## args); \ + else \ + LOGP(DLMGCP, level, "%s (not initialized) " fmt, gsm_lchan_name(lchan), \ + ## args); \ + } while(0) + +struct gsm_lchan; + +enum lchan_rtp_fsm_state { + LCHAN_RTP_ST_WAIT_MGW_ENDPOINT_AVAILABLE, + LCHAN_RTP_ST_WAIT_LCHAN_READY, + LCHAN_RTP_ST_WAIT_IPACC_CRCX_ACK, + LCHAN_RTP_ST_WAIT_IPACC_MDCX_ACK, + LCHAN_RTP_ST_WAIT_READY_TO_SWITCH_RTP, + LCHAN_RTP_ST_WAIT_MGW_ENDPOINT_CONFIGURED, + LCHAN_RTP_ST_READY, + LCHAN_RTP_ST_ROLLBACK, + LCHAN_RTP_ST_ESTABLISHED, +}; + +enum lchan_rtp_fsm_event { + LCHAN_RTP_EV_LCHAN_READY, + LCHAN_RTP_EV_READY_TO_SWITCH_RTP, + LCHAN_RTP_EV_MGW_ENDPOINT_AVAILABLE, + LCHAN_RTP_EV_MGW_ENDPOINT_ERROR, + LCHAN_RTP_EV_IPACC_CRCX_ACK, + LCHAN_RTP_EV_IPACC_CRCX_NACK, + LCHAN_RTP_EV_IPACC_MDCX_ACK, + LCHAN_RTP_EV_IPACC_MDCX_NACK, + LCHAN_RTP_EV_READY_TO_SWITCH, + LCHAN_RTP_EV_MGW_ENDPOINT_CONFIGURED, + LCHAN_RTP_EV_ROLLBACK, /*< Give the RTP back to the old lchan, if any */ + LCHAN_RTP_EV_ESTABLISHED, /*< All done, forget about the old lchan, if any */ + LCHAN_RTP_EV_RELEASE, +}; + +void lchan_rtp_fsm_start(struct gsm_lchan *lchan); +struct mgwep_ci *lchan_use_mgw_endpoint_ci_bts(struct gsm_lchan *lchan); +bool lchan_rtp_established(struct gsm_lchan *lchan); +void lchan_forget_mgw_endpoint(struct gsm_lchan *lchan); diff --git a/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am index 0c9d93c..5b717a1 100644 --- a/src/osmo-bsc/Makefile.am +++ b/src/osmo-bsc/Makefile.am @@ -67,6 +67,7 @@ handover_logic.c \ handover_vty.c \ lchan_fsm.c \ + lchan_rtp_fsm.c \ lchan_select.c \ meas_feed.c \ meas_rep.c \ diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c index 28002e4..7ab97a9 100644 --- a/src/osmo-bsc/abis_rsl.c +++ b/src/osmo-bsc/abis_rsl.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -1885,6 +1886,11 @@ struct tlv_parsed tv; struct gsm_lchan *lchan = msg->lchan; + if (!lchan->fi_rtp) { + LOG_LCHAN(msg->lchan, LOGL_ERROR, "Rx RSL IPACC: CRCX ACK message for unconfigured lchan"); + return -EINVAL; + } + /* the BTS has acknowledged a local bind, it now tells us the IP * address and port number to which it has bound the given logical * channel */ @@ -1899,17 +1905,37 @@ ipac_parse_rtp(lchan, &tv, "CRCX"); - osmo_fsm_inst_dispatch(lchan->fi, LCHAN_EV_IPACC_CRCX_ACK, 0); + osmo_fsm_inst_dispatch(lchan->fi_rtp, LCHAN_RTP_EV_IPACC_CRCX_ACK, 0); return 0; } +static int abis_rsl_rx_ipacc_crcx_nack(struct msgb *msg) +{ + struct e1inp_sign_link *sign_link = msg->dst; + struct gsm_lchan *lchan = msg->lchan; + + rate_ctr_inc(&sign_link->trx->bts->bts_ctrs->ctr[BTS_CTR_RSL_IPA_NACK]); + + if (!lchan->fi_rtp) { + LOG_LCHAN(msg->lchan, LOGL_ERROR, "Rx RSL IPACC: CRCX NACK message for unconfigured lchan"); + return -EINVAL; + } + osmo_fsm_inst_dispatch(msg->lchan->fi_rtp, LCHAN_RTP_EV_IPACC_CRCX_NACK, 0); + return 0; +} + static int abis_rsl_rx_ipacc_mdcx_ack(struct msgb *msg) { struct abis_rsl_dchan_hdr *dh = msgb_l2(msg); struct tlv_parsed tv; struct gsm_lchan *lchan = msg->lchan; + if (!lchan->fi_rtp) { + LOG_LCHAN(msg->lchan, LOGL_ERROR, "Rx RSL IPACC: MDCX ACK message for unconfigured lchan"); + return -EINVAL; + } + /* the BTS has acknowledged a remote connect request and * it now tells us the IP address and port number to which it has * connected the given logical channel */ @@ -1917,11 +1943,26 @@ rsl_tlv_parse(&tv, dh->data, msgb_l2len(msg)-sizeof(*dh)); ipac_parse_rtp(lchan, &tv, "MDCX"); - osmo_fsm_inst_dispatch(lchan->fi, LCHAN_EV_IPACC_MDCX_ACK, 0); + osmo_fsm_inst_dispatch(lchan->fi_rtp, LCHAN_RTP_EV_IPACC_MDCX_ACK, 0); return 0; } +static int abis_rsl_rx_ipacc_mdcx_nack(struct msgb *msg) +{ + struct e1inp_sign_link *sign_link = msg->dst; + struct gsm_lchan *lchan = msg->lchan; + + rate_ctr_inc(&sign_link->trx->bts->bts_ctrs->ctr[BTS_CTR_RSL_IPA_NACK]); + + if (!lchan->fi_rtp) { + LOG_LCHAN(msg->lchan, LOGL_ERROR, "Rx RSL IPACC: MDCX NACK message for unconfigured lchan"); + return -EINVAL; + } + osmo_fsm_inst_dispatch(msg->lchan->fi_rtp, LCHAN_RTP_EV_IPACC_MDCX_NACK, 0); + return 0; +} + static int abis_rsl_rx_ipacc_dlcx_ind(struct msgb *msg) { struct abis_rsl_dchan_hdr *dh = msgb_l2(msg); @@ -1964,8 +2005,7 @@ case RSL_MT_IPAC_CRCX_NACK: /* somehow the BTS was unable to bind the lchan to its local * port?!? */ - rate_ctr_inc(&sign_link->trx->bts->bts_ctrs->ctr[BTS_CTR_RSL_IPA_NACK]); - osmo_fsm_inst_dispatch(msg->lchan->fi, LCHAN_EV_IPACC_CRCX_NACK, 0); + rc = abis_rsl_rx_ipacc_crcx_nack(msg); break; case RSL_MT_IPAC_MDCX_ACK: /* the BTS tells us that a connect operation was successful */ @@ -1974,8 +2014,7 @@ case RSL_MT_IPAC_MDCX_NACK: /* somehow the BTS was unable to connect the lchan to a remote * port */ - rate_ctr_inc(&sign_link->trx->bts->bts_ctrs->ctr[BTS_CTR_RSL_IPA_NACK]); - osmo_fsm_inst_dispatch(msg->lchan->fi, LCHAN_EV_IPACC_MDCX_NACK, 0); + rc = abis_rsl_rx_ipacc_mdcx_nack(msg); break; case RSL_MT_IPAC_DLCX_IND: rc = abis_rsl_rx_ipacc_dlcx_ind(msg); diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c b/src/osmo-bsc/bsc_subscr_conn_fsm.c index f56b2af..c6c291a 100644 --- a/src/osmo-bsc/bsc_subscr_conn_fsm.c +++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -597,7 +598,10 @@ conn->lchan = new_lchan; conn->lchan->conn = conn; - if (old_lchan) { + if (conn->lchan->fi_rtp) + osmo_fsm_inst_dispatch(conn->lchan->fi_rtp, LCHAN_RTP_EV_ESTABLISHED, 0); + + if (old_lchan && (old_lchan != new_lchan)) { lchan_forget_conn(old_lchan); lchan_release(old_lchan, false, false, 0); } diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c index e3f64cd..d70d049 100644 --- a/src/osmo-bsc/handover_fsm.c +++ b/src/osmo-bsc/handover_fsm.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -359,6 +360,7 @@ .requires_voice_stream = conn->lchan->mgw_endpoint_ci_bts ? true : false, .msc_assigned_cic = conn->ho.inter_bsc_in.msc_assigned_cic, .old_lchan = conn->lchan, + .wait_before_switching_rtp = true, }; lchan_activate(ho->new_lchan, &info); @@ -845,6 +847,9 @@ } } + if (ho->new_lchan->fi_rtp) + osmo_fsm_inst_dispatch(ho->new_lchan->fi_rtp, + LCHAN_RTP_EV_READY_TO_SWITCH_RTP, 0); ho_fsm_state_chg(HO_ST_WAIT_RR_HO_COMPLETE); /* The lchan FSM will already start to redirect the RTP stream */ return; @@ -853,7 +858,9 @@ LOG_HO(conn, LOGL_ERROR, "Received RR Handover Complete, but haven't even seen a Handover Detect yet;" " Accepting handover anyway\n"); - + if (ho->new_lchan->fi_rtp) + osmo_fsm_inst_dispatch(ho->new_lchan->fi_rtp, + LCHAN_RTP_EV_READY_TO_SWITCH_RTP, 0); ho_fsm_state_chg(HO_ST_WAIT_LCHAN_ESTABLISHED); return; diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c index f25e7b9..58adb99 100644 --- a/src/osmo-bsc/lchan_fsm.c +++ b/src/osmo-bsc/lchan_fsm.c @@ -1,5 +1,4 @@ -/* osmo-bsc API to allocate an lchan, complete with dyn TS switchover and MGCP communication to allocate - * RTP endpoints. +/* osmo-bsc API to allocate an lchan, complete with dyn TS switchover. * * (C) 2018 by sysmocom - s.f.m.c. GmbH * All Rights Reserved @@ -26,6 +25,7 @@ #include #include +#include #include #include #include @@ -53,11 +53,7 @@ return false; switch (lchan->fi->state) { - case LCHAN_ST_WAIT_RLL_ESTABLISH: - case LCHAN_ST_WAIT_MGW_ENDPOINT_AVAILABLE: - case LCHAN_ST_WAIT_IPACC_CRCX_ACK: - case LCHAN_ST_WAIT_IPACC_MDCX_ACK: - case LCHAN_ST_WAIT_MGW_ENDPOINT_CONFIGURED: + case LCHAN_ST_WAIT_RLL_RTP_ESTABLISH: case LCHAN_ST_ESTABLISHED: return true; default: @@ -65,7 +61,7 @@ } } -static void lchan_set_last_error(struct gsm_lchan *lchan, const char *fmt, ...) +void lchan_set_last_error(struct gsm_lchan *lchan, const char *fmt, ...) { va_list ap; /* This dance allows using an existing error reason in above fmt */ @@ -137,11 +133,12 @@ } } -static void lchan_on_activation_success(struct gsm_lchan *lchan) +static void lchan_on_fully_established(struct gsm_lchan *lchan) { switch (lchan->activate.activ_for) { case FOR_MS_CHANNEL_REQUEST: - /* Nothing to do here, MS is free to use the channel. */ + /* No signalling to do here, MS is free to use the channel, and should go on to connect + * to the MSC and establish a subscriber connection. */ break; case FOR_ASSIGNMENT: @@ -161,6 +158,9 @@ } osmo_fsm_inst_dispatch(lchan->conn->assignment.fi, ASSIGNMENT_EV_LCHAN_ESTABLISHED, lchan); + /* The lchan->fi_rtp will be notified of LCHAN_RTP_EV_ESTABLISHED in + * gscon_change_primary_lchan() upon assignment_success(). On failure before then, we + * will try to roll back a modified RTP connection. */ break; case FOR_HANDOVER: @@ -178,6 +178,9 @@ break; } osmo_fsm_inst_dispatch(lchan->conn->ho.fi, HO_EV_LCHAN_ESTABLISHED, lchan); + /* The lchan->fi_rtp will be notified of LCHAN_RTP_EV_ESTABLISHED in + * gscon_change_primary_lchan() upon handover_end(HO_RESULT_OK). On failure before then, + * we will try to roll back a modified RTP connection. */ break; default: @@ -190,12 +193,8 @@ struct state_timeout lchan_fsm_timeouts[32] = { [LCHAN_ST_WAIT_TS_READY] = { .T=23001 }, [LCHAN_ST_WAIT_ACTIV_ACK] = { .T=23002 }, - [LCHAN_ST_WAIT_RLL_ESTABLISH] = { .T=3101 }, - [LCHAN_ST_WAIT_MGW_ENDPOINT_AVAILABLE] = { .T=23004 }, - [LCHAN_ST_WAIT_IPACC_CRCX_ACK] = { .T=23005 }, - [LCHAN_ST_WAIT_IPACC_MDCX_ACK] = { .T=23006 }, - [LCHAN_ST_WAIT_MGW_ENDPOINT_CONFIGURED] = { .T=23004 }, - [LCHAN_ST_WAIT_SAPIS_RELEASED] = { .T=3109 }, + [LCHAN_ST_WAIT_RLL_RTP_ESTABLISH] = { .T=3101 }, + [LCHAN_ST_WAIT_RLL_RTP_RELEASED] = { .T=3109 }, [LCHAN_ST_WAIT_BEFORE_RF_RELEASE] = { .T=3111 }, [LCHAN_ST_WAIT_RF_RELEASE_ACK] = { .T=3111 }, [LCHAN_ST_WAIT_AFTER_ERROR] = { .T=993111 }, @@ -215,7 +214,7 @@ #define lchan_fail_to(state_chg, fmt, args...) do { \ struct gsm_lchan *_lchan = fi->priv; \ uint32_t state_was = fi->state; \ - lchan_set_last_error(fi->priv, "lchan %s in state %s: " fmt, \ + lchan_set_last_error(_lchan, "lchan %s in state %s: " fmt, \ _lchan->activate.concluded ? "failure" : "allocation failed", \ osmo_fsm_state_name(fi->fsm, state_was), ## args); \ if (!_lchan->activate.concluded) \ @@ -229,13 +228,9 @@ [LCHAN_ST_UNUSED] = LCHAN_ST_UNUSED, [LCHAN_ST_WAIT_TS_READY] = LCHAN_ST_UNUSED, [LCHAN_ST_WAIT_ACTIV_ACK] = LCHAN_ST_BORKEN, - [LCHAN_ST_WAIT_RLL_ESTABLISH] = LCHAN_ST_WAIT_RF_RELEASE_ACK, - [LCHAN_ST_WAIT_MGW_ENDPOINT_AVAILABLE] = LCHAN_ST_WAIT_SAPIS_RELEASED, - [LCHAN_ST_WAIT_IPACC_CRCX_ACK] = LCHAN_ST_WAIT_SAPIS_RELEASED, - [LCHAN_ST_WAIT_IPACC_MDCX_ACK] = LCHAN_ST_WAIT_SAPIS_RELEASED, - [LCHAN_ST_WAIT_MGW_ENDPOINT_CONFIGURED] = LCHAN_ST_WAIT_SAPIS_RELEASED, - [LCHAN_ST_ESTABLISHED] = LCHAN_ST_WAIT_SAPIS_RELEASED, - [LCHAN_ST_WAIT_SAPIS_RELEASED] = LCHAN_ST_WAIT_RF_RELEASE_ACK, + [LCHAN_ST_WAIT_RLL_RTP_ESTABLISH] = LCHAN_ST_WAIT_RF_RELEASE_ACK, + [LCHAN_ST_ESTABLISHED] = LCHAN_ST_WAIT_RLL_RTP_RELEASED, + [LCHAN_ST_WAIT_RLL_RTP_RELEASED] = LCHAN_ST_WAIT_RF_RELEASE_ACK, [LCHAN_ST_WAIT_BEFORE_RF_RELEASE] = LCHAN_ST_WAIT_RF_RELEASE_ACK, [LCHAN_ST_WAIT_RF_RELEASE_ACK] = LCHAN_ST_BORKEN, [LCHAN_ST_WAIT_AFTER_ERROR] = LCHAN_ST_UNUSED, @@ -322,11 +317,16 @@ osmo_fsm_inst_update_id_f(lchan->fi, "%u-%u-%u-%s-%u", lchan->ts->trx->bts->nr, lchan->ts->trx->nr, lchan->ts->nr, gsm_pchan_id(lchan->ts->pchan_on_init), lchan->nr); + if (lchan->fi_rtp) + osmo_fsm_inst_update_id_f(lchan->fi_rtp, lchan->fi->id); } +extern void lchan_rtp_fsm_init(); + void lchan_fsm_init() { OSMO_ASSERT(osmo_fsm_register(&lchan_fsm) == 0); + lchan_rtp_fsm_init(); } void lchan_fsm_alloc(struct gsm_lchan *lchan) @@ -357,6 +357,8 @@ talloc_free(lchan->rqd_ref); lchan->rqd_ref = NULL; } + if (lchan->fi_rtp) + osmo_fsm_inst_term(lchan->fi_rtp, OSMO_FSM_TERM_REQUEST, 0); if (lchan->mgw_endpoint_ci_bts) { mgw_endpoint_ci_dlcx(lchan->mgw_endpoint_ci_bts); lchan->mgw_endpoint_ci_bts = NULL; @@ -424,6 +426,7 @@ lchan->conn = info->for_conn; lchan->activate.activ_for = info->activ_for; lchan->activate.requires_voice_stream = info->requires_voice_stream; + lchan->activate.wait_before_switching_rtp = info->wait_before_switching_rtp; lchan->activate.msc_assigned_cic = info->msc_assigned_cic; lchan->activate.concluded = false; lchan->activate.re_use_mgw_endpoint_from_lchan = info->old_lchan; @@ -477,24 +480,8 @@ } } -/* While activating an lchan, for example for Handover, we may want to re-use another lchan's MGW - * endpoint CI. If Handover fails half way, the old lchan must keep its MGW endpoint CI, and we must not - * clean it up. Hence keep another lchan's mgw_endpoint_ci_bts out of lchan until all is done. */ -static struct mgwep_ci *lchan_use_mgw_endpoint_ci_bts(struct gsm_lchan *lchan) -{ - if (lchan->mgw_endpoint_ci_bts) - return lchan->mgw_endpoint_ci_bts; - if (lchan_state_is(lchan, LCHAN_ST_ESTABLISHED)) - return NULL; - if (lchan->activate.re_use_mgw_endpoint_from_lchan) - return lchan->activate.re_use_mgw_endpoint_from_lchan->mgw_endpoint_ci_bts; - return NULL; -} - static void lchan_fsm_wait_ts_ready_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) { - struct mgw_endpoint *mgwep; - struct mgcp_conn_peer crcx_info = {}; struct gsm_lchan *lchan = lchan_fi_lchan(fi); struct mgwep_ci *use_mgwep_ci = lchan_use_mgw_endpoint_ci_bts(lchan); @@ -518,32 +505,8 @@ osmo_fsm_inst_dispatch(lchan->ts->fi, TS_EV_LCHAN_REQUESTED, lchan); /* Prepare an MGW endpoint CI if appropriate. */ - if (!lchan->activate.requires_voice_stream) - return; - - if (use_mgwep_ci) { - lchan->activate.mgw_endpoint_available = true; - return; - } - - mgwep = gscon_ensure_mgw_endpoint(lchan->conn, lchan->activate.msc_assigned_cic); - if (!mgwep) { - lchan_fail("Internal error: cannot obtain MGW endpoint handle for conn"); - return; - } - - lchan->mgw_endpoint_ci_bts = mgw_endpoint_ci_add(mgwep, "to-BTS"); - - if (lchan->conn) - crcx_info.call_id = lchan->conn->sccp.conn_id; - crcx_info.ptime = 20; - mgcp_pick_codec(&crcx_info, lchan); - - mgw_endpoint_ci_request(lchan->mgw_endpoint_ci_bts, - MGCP_VERB_CRCX, &crcx_info, - lchan->fi, - LCHAN_EV_MGW_ENDPOINT_AVAILABLE, - LCHAN_EV_MGW_ENDPOINT_ERROR, 0); + if (lchan->activate.requires_voice_stream) + lchan_rtp_fsm_start(lchan); } static void lchan_fsm_wait_ts_ready(struct osmo_fsm_inst *fi, uint32_t event, void *data) @@ -556,10 +519,18 @@ lchan_fsm_state_chg(LCHAN_ST_WAIT_ACTIV_ACK); break; - case LCHAN_EV_MGW_ENDPOINT_AVAILABLE: - /* conn FSM is already done preparing an MGW endpoint. Remember that. */ - lchan->activate.mgw_endpoint_available = true; - break; + case LCHAN_EV_RTP_RELEASED: + case LCHAN_EV_RTP_ERROR: + if (lchan->release_requested) { + /* Already in release, the RTP is not the initial cause of failure. + * Just ignore. */ + return; + } + + lchan_fail("Failed to setup RTP stream: %s in state %s\n", + osmo_fsm_event_name(fi->fsm, event), + osmo_fsm_inst_state_name(fi)); + return; default: OSMO_ASSERT(false); @@ -597,18 +568,16 @@ lchan_fail_to(LCHAN_ST_UNUSED, "Tx Chan Activ failed: %s (%d)", strerror(-rc), rc); } +static void lchan_fsm_post_activ_ack(struct osmo_fsm_inst *fi); + static void lchan_fsm_wait_activ_ack(struct osmo_fsm_inst *fi, uint32_t event, void *data) { struct gsm_lchan *lchan = lchan_fi_lchan(fi); switch (event) { - case LCHAN_EV_MGW_ENDPOINT_AVAILABLE: - lchan->activate.mgw_endpoint_available = true; - break; - case LCHAN_EV_RSL_CHAN_ACTIV_ACK: - /* Chan Activ was ack'd, but we need an RLL Establish to be sure it's working out. */ - lchan_fsm_state_chg(LCHAN_ST_WAIT_RLL_ESTABLISH); + lchan->activate.activ_ack = true; + lchan_fsm_post_activ_ack(fi); break; case LCHAN_EV_RSL_CHAN_ACTIV_NACK: @@ -632,12 +601,26 @@ } break; + case LCHAN_EV_RTP_RELEASED: + case LCHAN_EV_RTP_ERROR: + if (lchan->release_requested) { + /* Already in release, the RTP is not the initial cause of failure. + * Just ignore. */ + return; + } + + lchan_fail_to(LCHAN_ST_WAIT_RF_RELEASE_ACK, + "Failed to setup RTP stream: %s in state %s\n", + osmo_fsm_event_name(fi->fsm, event), + osmo_fsm_inst_state_name(fi)); + return; + default: OSMO_ASSERT(false); } } -static void lchan_fsm_wait_rll_establish_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +static void lchan_fsm_post_activ_ack(struct osmo_fsm_inst *fi) { int rc; struct gsm_lchan *lchan = lchan_fi_lchan(fi); @@ -703,62 +686,44 @@ lchan_activate_mode_name(lchan->activate.activ_for)); break; } + + lchan_fsm_state_chg(LCHAN_ST_WAIT_RLL_RTP_ESTABLISH); } -static void lchan_fsm_wait_rll_establish(struct osmo_fsm_inst *fi, uint32_t event, void *data) +static void lchan_fsm_wait_rll_rtp_establish_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + struct gsm_lchan *lchan = lchan_fi_lchan(fi); + if (lchan->fi_rtp) + osmo_fsm_inst_dispatch(lchan->fi_rtp, LCHAN_RTP_EV_LCHAN_READY, 0); +} + +static void lchan_fsm_wait_rll_rtp_establish(struct osmo_fsm_inst *fi, uint32_t event, void *data) { struct gsm_lchan *lchan = lchan_fi_lchan(fi); switch (event) { - case LCHAN_EV_MGW_ENDPOINT_AVAILABLE: - lchan->activate.mgw_endpoint_available = true; - break; - case LCHAN_EV_RLL_ESTABLISH_IND: - lchan->sapis[0] = LCHAN_SAPI_MS; - if (lchan->activate.requires_voice_stream) { - /* For Abis/IP, we would technically only need the MGW endpoint one step later, - * on IPACC MDCX. But usually the MGW endpoint is anyway done by now, so keep one - * common endpoint wait state for all BTS types. */ - lchan_fsm_state_chg(LCHAN_ST_WAIT_MGW_ENDPOINT_AVAILABLE); - } else + if (!lchan->activate.requires_voice_stream + || lchan_rtp_established(lchan)) lchan_fsm_state_chg(LCHAN_ST_ESTABLISHED); - break; - - default: - OSMO_ASSERT(false); - } -} - -static void lchan_fsm_tch_post_endpoint_available(struct osmo_fsm_inst *fi); - -static void lchan_fsm_wait_mgw_endpoint_available_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) -{ - struct gsm_lchan *lchan = lchan_fi_lchan(fi); - - if (lchan->release_requested) { - lchan_fail("Release requested while activating"); - return; - } - - if (lchan->activate.mgw_endpoint_available) { - LOG_LCHAN(lchan, LOGL_DEBUG, "MGW endpoint already available\n"); - lchan_fsm_tch_post_endpoint_available(fi); - } -} - -static void lchan_fsm_wait_mgw_endpoint_available(struct osmo_fsm_inst *fi, uint32_t event, void *data) -{ - struct gsm_lchan *lchan = lchan_fi_lchan(fi); - switch (event) { - - case LCHAN_EV_MGW_ENDPOINT_AVAILABLE: - lchan->activate.mgw_endpoint_available = true; - lchan_fsm_tch_post_endpoint_available(fi); return; - case LCHAN_EV_RLL_ESTABLISH_IND: - /* abis_rsl.c has noticed that a SAPI was established, no need to take action here. */ + case LCHAN_EV_RTP_READY: + if (lchan->sapis[0] != LCHAN_SAPI_UNUSED) + lchan_fsm_state_chg(LCHAN_ST_ESTABLISHED); + return; + + case LCHAN_EV_RTP_RELEASED: + case LCHAN_EV_RTP_ERROR: + if (lchan->release_requested) { + /* Already in release, the RTP is not the initial cause of failure. + * Just ignore. */ + return; + } + + lchan_fail("Failed to setup RTP stream: %s in state %s\n", + osmo_fsm_event_name(fi->fsm, event), + osmo_fsm_inst_state_name(fi)); return; default: @@ -766,208 +731,6 @@ } } -static void lchan_fsm_tch_post_endpoint_available(struct osmo_fsm_inst *fi) -{ - struct gsm_lchan *lchan = lchan_fi_lchan(fi); - - LOG_LCHAN(lchan, LOGL_DEBUG, "MGW endpoint: %s\n", - mgwep_ci_name(lchan_use_mgw_endpoint_ci_bts(lchan))); - - if (is_ipaccess_bts(lchan->ts->trx->bts)) - lchan_fsm_state_chg(LCHAN_ST_WAIT_IPACC_CRCX_ACK); - else - lchan_fsm_state_chg(LCHAN_ST_WAIT_MGW_ENDPOINT_CONFIGURED); -} - -static void lchan_fsm_wait_ipacc_crcx_ack_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) -{ - int rc; - int val; - struct gsm_lchan *lchan = lchan_fi_lchan(fi); - - if (lchan->release_requested) { - lchan_fail("Release requested while activating"); - return; - } - - val = ipacc_speech_mode(lchan->tch_mode, lchan->type); - if (val < 0) { - lchan_fail("Cannot determine Abis/IP speech mode for tch_mode=%s type=%s\n", - get_value_string(gsm48_chan_mode_names, lchan->tch_mode), - gsm_lchant_name(lchan->type)); - return; - } - lchan->abis_ip.speech_mode = val; - - val = ipacc_payload_type(lchan->tch_mode, lchan->type); - if (val < 0) { - lchan_fail("Cannot determine Abis/IP payload type for tch_mode=%s type=%s\n", - get_value_string(gsm48_chan_mode_names, lchan->tch_mode), - gsm_lchant_name(lchan->type)); - return; - } - lchan->abis_ip.rtp_payload = val; - - /* recv-only */ - ipacc_speech_mode_set_direction(&lchan->abis_ip.speech_mode, false); - - rc = rsl_tx_ipacc_crcx(lchan); - if (rc) - lchan_fail("Failure to transmit IPACC CRCX to BTS (rc=%d, %s)", - rc, strerror(-rc)); -} - -static void lchan_fsm_wait_ipacc_crcx_ack(struct osmo_fsm_inst *fi, uint32_t event, void *data) -{ - switch (event) { - - case LCHAN_EV_IPACC_CRCX_ACK: - /* the CRCX ACK parsing has already noted the RTP port information at - * lchan->abis_ip.bound_*, see ipac_parse_rtp(). We'll use that in - * lchan_fsm_wait_mgw_endpoint_configured_onenter(). */ - lchan_fsm_state_chg(LCHAN_ST_WAIT_IPACC_MDCX_ACK); - return; - - case LCHAN_EV_IPACC_CRCX_NACK: - lchan_fail("Received NACK on IPACC CRCX"); - return; - - case LCHAN_EV_RLL_ESTABLISH_IND: - /* abis_rsl.c has noticed that a SAPI was established, no need to take action here. */ - return; - - default: - OSMO_ASSERT(false); - } -} - -static void lchan_fsm_wait_ipacc_mdcx_ack_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) -{ - int rc; - struct gsm_lchan *lchan = lchan_fi_lchan(fi); - const struct mgcp_conn_peer *mgw_rtp; - - if (lchan->release_requested) { - lchan_fail("Release requested while activating"); - return; - } - - mgw_rtp = mgwep_ci_get_rtp_info(lchan_use_mgw_endpoint_ci_bts(lchan)); - - if (!mgw_rtp) { - lchan_fail("Cannot send IPACC MDCX to BTS:" - " there is no RTP IP+port set that the BTS should send RTP to."); - return; - } - - /* Other RTP settings were already setup in lchan_fsm_wait_ipacc_crcx_ack_onenter() */ - lchan->abis_ip.connect_ip = ntohl(inet_addr(mgw_rtp->addr)); - lchan->abis_ip.connect_port = mgw_rtp->port; - - /* send-recv */ - ipacc_speech_mode_set_direction(&lchan->abis_ip.speech_mode, true); - - rc = rsl_tx_ipacc_mdcx(lchan); - if (rc) - lchan_fail("Failure to transmit IPACC MDCX to BTS (rc=%d, %s)", - rc, strerror(-rc)); - -} - -static void lchan_fsm_wait_ipacc_mdcx_ack(struct osmo_fsm_inst *fi, uint32_t event, void *data) -{ - switch (event) { - - case LCHAN_EV_IPACC_MDCX_ACK: - /* Finally, the lchan and its RTP are established. */ - lchan_fsm_state_chg(LCHAN_ST_WAIT_MGW_ENDPOINT_CONFIGURED); - return; - - case LCHAN_EV_IPACC_MDCX_NACK: - lchan_fail("Received NACK on IPACC MDCX"); - return; - - case LCHAN_EV_RLL_ESTABLISH_IND: - /* abis_rsl.c has noticed that a SAPI was established, no need to take action here. */ - return; - - default: - OSMO_ASSERT(false); - } -} - -/* Tell the MGW endpoint about the RTP port allocated on BTS side. */ -static void lchan_fsm_wait_mgw_endpoint_configured_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) -{ - int rc; - struct mgcp_conn_peer mdcx_info; - struct in_addr addr; - const char *addr_str; - struct gsm_lchan *lchan = lchan_fi_lchan(fi); - - if (lchan->release_requested) { - lchan_fail("Release requested while activating"); - return; - } - - mdcx_info = (struct mgcp_conn_peer){ - .port = lchan->abis_ip.bound_port, - .ptime = 20, - }; - mgcp_pick_codec(&mdcx_info, lchan); - - addr.s_addr = osmo_ntohl(lchan->abis_ip.bound_ip); - addr_str = inet_ntoa(addr); - rc = osmo_strlcpy(mdcx_info.addr, addr_str, sizeof(mdcx_info.addr)); - if (rc <= 0 || rc >= sizeof(mdcx_info.addr)) { - lchan_fail("Cannot compose BTS side RTP IP address to send to MGW: '%s'", - addr_str); - return; - } - - /* At this point, we are taking over an old lchan's MGW endpoint (if any). */ - if (!lchan->mgw_endpoint_ci_bts - && lchan->activate.re_use_mgw_endpoint_from_lchan) { - lchan->mgw_endpoint_ci_bts = - lchan->activate.re_use_mgw_endpoint_from_lchan->mgw_endpoint_ci_bts; - /* The old lchan shall forget the enpoint now. */ - lchan->activate.re_use_mgw_endpoint_from_lchan->mgw_endpoint_ci_bts = NULL; - } - - if (!lchan->mgw_endpoint_ci_bts) { - lchan_fail("No MGW endpoint ci configured"); - return; - } - - LOG_LCHAN(lchan, LOGL_DEBUG, "Sending BTS side RTP port info %s:%u to MGW %s\n", - mdcx_info.addr, mdcx_info.port, mgwep_ci_name(lchan->mgw_endpoint_ci_bts)); - mgw_endpoint_ci_request(lchan->mgw_endpoint_ci_bts, MGCP_VERB_MDCX, - &mdcx_info, fi, LCHAN_EV_MGW_ENDPOINT_CONFIGURED, - LCHAN_EV_MGW_ENDPOINT_ERROR, 0); -} - -static void lchan_fsm_wait_mgw_endpoint_configured(struct osmo_fsm_inst *fi, uint32_t event, void *data) -{ - switch (event) { - - case LCHAN_EV_MGW_ENDPOINT_CONFIGURED: - lchan_fsm_state_chg(LCHAN_ST_ESTABLISHED); - return; - - case LCHAN_EV_MGW_ENDPOINT_ERROR: - lchan_fail("Error while redirecting the MGW to the BTS' RTP port"); - return; - - case LCHAN_EV_RLL_ESTABLISH_IND: - /* abis_rsl.c has noticed that a SAPI was established, no need to take action here. */ - return; - - default: - OSMO_ASSERT(false); - } -} - - static void lchan_fsm_established_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) { struct gsm_lchan *lchan = lchan_fi_lchan(fi); @@ -981,7 +744,7 @@ * like Immediate Assignment or BSSMAP Assignment Complete, and if then, way later, some other * error occurs, e.g. during release, that we don't send a NACK out of context. */ lchan->activate.concluded = true; - lchan_on_activation_success(lchan); + lchan_on_fully_established(lchan); } #define for_each_sapi(sapi, start, lchan) \ @@ -1015,8 +778,7 @@ return sapis; } -static void handle_rll_rel_ind_or_conf(struct osmo_fsm_inst *fi, uint32_t event, void *data, - bool wait_for_sapi0_rel) +static void handle_rll_rel_ind_or_conf(struct osmo_fsm_inst *fi, uint32_t event, void *data) { uint8_t link_id; uint8_t sapi; @@ -1043,12 +805,13 @@ gscon_lchan_releasing(lchan->conn, lchan); } - if (!lchan_active_sapis(lchan, wait_for_sapi0_rel? 0 : 1)) - lchan_fsm_state_chg(LCHAN_ST_WAIT_BEFORE_RF_RELEASE); + /* The caller shall check whether all SAPIs are released and cause a state chg */ } static void lchan_fsm_established(struct osmo_fsm_inst *fi, uint32_t event, void *data) { + struct gsm_lchan *lchan = lchan_fi_lchan(fi); + switch (event) { case LCHAN_EV_RLL_ESTABLISH_IND: /* abis_rsl.c has noticed that a SAPI was established, no need to take action here. */ @@ -1056,7 +819,22 @@ case LCHAN_EV_RLL_REL_IND: case LCHAN_EV_RLL_REL_CONF: - handle_rll_rel_ind_or_conf(fi, event, data, true); + handle_rll_rel_ind_or_conf(fi, event, data); + if (!lchan_active_sapis(lchan, 0)) + lchan_fsm_state_chg(LCHAN_ST_WAIT_RLL_RTP_RELEASED); + return; + + case LCHAN_EV_RTP_RELEASED: + case LCHAN_EV_RTP_ERROR: + if (lchan->release_requested) { + /* Already in release, the RTP is not the initial cause of failure. + * Just ignore. */ + return; + } + + lchan_fail("RTP stream closed unexpectedly: %s in state %s\n", + osmo_fsm_event_name(fi->fsm, event), + osmo_fsm_inst_state_name(fi)); return; default: @@ -1079,7 +857,7 @@ } } -static void lchan_fsm_wait_sapis_released_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +static void lchan_fsm_wait_rll_rtp_released_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) { int sapis; int sapi; @@ -1089,9 +867,12 @@ if (lchan->sapis[sapi]) LOG_LCHAN(lchan, LOGL_DEBUG, "SAPI[%d] = %d\n", sapi, lchan->sapis[sapi]); - if (lchan->conn) + if (lchan->conn && lchan->sapis[0] != LCHAN_SAPI_UNUSED) gsm48_send_rr_release(lchan); + if (lchan->fi_rtp) + osmo_fsm_inst_dispatch(lchan->fi_rtp, LCHAN_RTP_EV_RELEASE, 0); + if (lchan->deact_sacch && should_sacch_deact(lchan)) rsl_deact_sacch(lchan); @@ -1117,16 +898,33 @@ sapis = 0; } - if (!sapis) + if (!sapis && !lchan->fi_rtp) lchan_fsm_state_chg(LCHAN_ST_WAIT_BEFORE_RF_RELEASE); } -static void lchan_fsm_wait_sapis_released(struct osmo_fsm_inst *fi, uint32_t event, void *data) +static void lchan_fsm_wait_rll_rtp_released(struct osmo_fsm_inst *fi, uint32_t event, void *data) { - /* When we're telling the MS to release, we're fine to carry on with RF Channel Release when SAPI - * 0 release is not confirmed yet. - * TODO: that's how the code was before lchan FSM, is this correct/useful? */ - handle_rll_rel_ind_or_conf(fi, event, data, false); + struct gsm_lchan *lchan = lchan_fi_lchan(fi); + switch (event) { + + case LCHAN_EV_RLL_REL_IND: + case LCHAN_EV_RLL_REL_CONF: + /* When we're telling the MS to release, we're fine to carry on with RF Channel Release + * when SAPI 0 release is not confirmed yet. + * TODO: that's how the code was before lchan FSM, is this correct/useful? */ + handle_rll_rel_ind_or_conf(fi, event, data); + break; + + case LCHAN_EV_RTP_RELEASED: + case LCHAN_EV_RTP_ERROR: + break; + + default: + OSMO_ASSERT(false); + } + + if (!lchan_active_sapis(lchan, 1) && !lchan->fi_rtp) + lchan_fsm_state_chg(LCHAN_ST_WAIT_BEFORE_RF_RELEASE); } static void lchan_fsm_wait_rf_release_ack_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) @@ -1194,6 +992,10 @@ * independently from the BTS model, right?? */ return; + case LCHAN_EV_RTP_RELEASED: + case LCHAN_EV_RTP_ERROR: + return; + default: OSMO_ASSERT(false); } @@ -1219,7 +1021,8 @@ .action = lchan_fsm_wait_ts_ready, .in_event_mask = 0 | S(LCHAN_EV_TS_READY) - | S(LCHAN_EV_MGW_ENDPOINT_AVAILABLE) + | S(LCHAN_EV_RTP_ERROR) + | S(LCHAN_EV_RTP_RELEASED) , .out_state_mask = 0 | S(LCHAN_ST_UNUSED) @@ -1231,94 +1034,33 @@ .onenter = lchan_fsm_wait_activ_ack_onenter, .action = lchan_fsm_wait_activ_ack, .in_event_mask = 0 - | S(LCHAN_EV_MGW_ENDPOINT_AVAILABLE) | S(LCHAN_EV_RSL_CHAN_ACTIV_ACK) | S(LCHAN_EV_RSL_CHAN_ACTIV_NACK) + | S(LCHAN_EV_RTP_ERROR) + | S(LCHAN_EV_RTP_RELEASED) , .out_state_mask = 0 | S(LCHAN_ST_UNUSED) - | S(LCHAN_ST_WAIT_RLL_ESTABLISH) + | S(LCHAN_ST_WAIT_RLL_RTP_ESTABLISH) | S(LCHAN_ST_BORKEN) | S(LCHAN_ST_WAIT_RF_RELEASE_ACK) , }, - [LCHAN_ST_WAIT_RLL_ESTABLISH] = { - .name = "WAIT_RLL_ESTABLISH", - .onenter = lchan_fsm_wait_rll_establish_onenter, - .action = lchan_fsm_wait_rll_establish, + [LCHAN_ST_WAIT_RLL_RTP_ESTABLISH] = { + .name = "WAIT_RLL_RTP_ESTABLISH", + .onenter = lchan_fsm_wait_rll_rtp_establish_onenter, + .action = lchan_fsm_wait_rll_rtp_establish, .in_event_mask = 0 - | S(LCHAN_EV_MGW_ENDPOINT_AVAILABLE) | S(LCHAN_EV_RLL_ESTABLISH_IND) - , - .out_state_mask = 0 - | S(LCHAN_ST_UNUSED) - | S(LCHAN_ST_WAIT_MGW_ENDPOINT_AVAILABLE) - | S(LCHAN_ST_ESTABLISHED) - | S(LCHAN_ST_WAIT_RF_RELEASE_ACK) - | S(LCHAN_ST_WAIT_SAPIS_RELEASED) - , - }, - [LCHAN_ST_WAIT_MGW_ENDPOINT_AVAILABLE] = { - .name = "WAIT_MGW_ENDPOINT_AVAILABLE", - .onenter = lchan_fsm_wait_mgw_endpoint_available_onenter, - .action = lchan_fsm_wait_mgw_endpoint_available, - .in_event_mask = 0 - | S(LCHAN_EV_MGW_ENDPOINT_AVAILABLE) - | S(LCHAN_EV_RLL_ESTABLISH_IND) /* ignored */ - , - .out_state_mask = 0 - | S(LCHAN_ST_UNUSED) - | S(LCHAN_ST_WAIT_IPACC_CRCX_ACK) - | S(LCHAN_ST_WAIT_MGW_ENDPOINT_CONFIGURED) - | S(LCHAN_ST_WAIT_SAPIS_RELEASED) - | S(LCHAN_ST_WAIT_RF_RELEASE_ACK) - , - }, - [LCHAN_ST_WAIT_IPACC_CRCX_ACK] = { - .name = "WAIT_IPACC_CRCX_ACK", - .onenter = lchan_fsm_wait_ipacc_crcx_ack_onenter, - .action = lchan_fsm_wait_ipacc_crcx_ack, - .in_event_mask = 0 - | S(LCHAN_EV_IPACC_CRCX_ACK) - | S(LCHAN_EV_IPACC_CRCX_NACK) - | S(LCHAN_EV_RLL_ESTABLISH_IND) /* ignored */ - , - .out_state_mask = 0 - | S(LCHAN_ST_UNUSED) - | S(LCHAN_ST_WAIT_IPACC_MDCX_ACK) - | S(LCHAN_ST_WAIT_SAPIS_RELEASED) - | S(LCHAN_ST_WAIT_RF_RELEASE_ACK) - , - }, - [LCHAN_ST_WAIT_IPACC_MDCX_ACK] = { - .name = "WAIT_IPACC_MDCX_ACK", - .onenter = lchan_fsm_wait_ipacc_mdcx_ack_onenter, - .action = lchan_fsm_wait_ipacc_mdcx_ack, - .in_event_mask = 0 - | S(LCHAN_EV_IPACC_MDCX_ACK) - | S(LCHAN_EV_IPACC_MDCX_NACK) - | S(LCHAN_EV_RLL_ESTABLISH_IND) /* ignored */ - , - .out_state_mask = 0 - | S(LCHAN_ST_UNUSED) - | S(LCHAN_ST_WAIT_MGW_ENDPOINT_CONFIGURED) - | S(LCHAN_ST_WAIT_SAPIS_RELEASED) - | S(LCHAN_ST_WAIT_RF_RELEASE_ACK) - , - }, - [LCHAN_ST_WAIT_MGW_ENDPOINT_CONFIGURED] = { - .name = "WAIT_MGW_ENDPOINT_CONFIGURED", - .onenter = lchan_fsm_wait_mgw_endpoint_configured_onenter, - .action = lchan_fsm_wait_mgw_endpoint_configured, - .in_event_mask = 0 - | S(LCHAN_EV_MGW_ENDPOINT_CONFIGURED) - | S(LCHAN_EV_RLL_ESTABLISH_IND) /* ignored */ + | S(LCHAN_EV_RTP_READY) + | S(LCHAN_EV_RTP_ERROR) + | S(LCHAN_EV_RTP_RELEASED) , .out_state_mask = 0 | S(LCHAN_ST_UNUSED) | S(LCHAN_ST_ESTABLISHED) - | S(LCHAN_ST_WAIT_SAPIS_RELEASED) | S(LCHAN_ST_WAIT_RF_RELEASE_ACK) + | S(LCHAN_ST_WAIT_RLL_RTP_RELEASED) , }, [LCHAN_ST_ESTABLISHED] = { @@ -1329,21 +1071,25 @@ | S(LCHAN_EV_RLL_REL_IND) | S(LCHAN_EV_RLL_REL_CONF) | S(LCHAN_EV_RLL_ESTABLISH_IND) /* ignored */ + | S(LCHAN_EV_RTP_ERROR) + | S(LCHAN_EV_RTP_RELEASED) , .out_state_mask = 0 | S(LCHAN_ST_UNUSED) - | S(LCHAN_ST_WAIT_SAPIS_RELEASED) + | S(LCHAN_ST_WAIT_RLL_RTP_RELEASED) | S(LCHAN_ST_WAIT_BEFORE_RF_RELEASE) | S(LCHAN_ST_WAIT_RF_RELEASE_ACK) , }, - [LCHAN_ST_WAIT_SAPIS_RELEASED] = { - .name = "WAIT_SAPIS_RELEASED", - .onenter = lchan_fsm_wait_sapis_released_onenter, - .action = lchan_fsm_wait_sapis_released, + [LCHAN_ST_WAIT_RLL_RTP_RELEASED] = { + .name = "WAIT_RLL_RTP_RELEASED", + .onenter = lchan_fsm_wait_rll_rtp_released_onenter, + .action = lchan_fsm_wait_rll_rtp_released, .in_event_mask = 0 | S(LCHAN_EV_RLL_REL_IND) | S(LCHAN_EV_RLL_REL_CONF) + | S(LCHAN_EV_RTP_ERROR) + | S(LCHAN_EV_RTP_RELEASED) , .out_state_mask = 0 | S(LCHAN_ST_UNUSED) @@ -1388,6 +1134,8 @@ | S(LCHAN_EV_RSL_CHAN_ACTIV_ACK) | S(LCHAN_EV_RSL_CHAN_ACTIV_NACK) | S(LCHAN_EV_RSL_RF_CHAN_REL_ACK) + | S(LCHAN_EV_RTP_ERROR) + | S(LCHAN_EV_RTP_RELEASED) , .out_state_mask = 0 | S(LCHAN_ST_UNUSED) @@ -1403,13 +1151,9 @@ OSMO_VALUE_STRING(LCHAN_EV_RSL_CHAN_ACTIV_ACK), OSMO_VALUE_STRING(LCHAN_EV_RSL_CHAN_ACTIV_NACK), OSMO_VALUE_STRING(LCHAN_EV_RLL_ESTABLISH_IND), - OSMO_VALUE_STRING(LCHAN_EV_MGW_ENDPOINT_AVAILABLE), - OSMO_VALUE_STRING(LCHAN_EV_MGW_ENDPOINT_CONFIGURED), - OSMO_VALUE_STRING(LCHAN_EV_MGW_ENDPOINT_ERROR), - OSMO_VALUE_STRING(LCHAN_EV_IPACC_CRCX_ACK), - OSMO_VALUE_STRING(LCHAN_EV_IPACC_CRCX_NACK), - OSMO_VALUE_STRING(LCHAN_EV_IPACC_MDCX_ACK), - OSMO_VALUE_STRING(LCHAN_EV_IPACC_MDCX_NACK), + OSMO_VALUE_STRING(LCHAN_EV_RTP_READY), + OSMO_VALUE_STRING(LCHAN_EV_RTP_ERROR), + OSMO_VALUE_STRING(LCHAN_EV_RTP_RELEASED), OSMO_VALUE_STRING(LCHAN_EV_RLL_REL_IND), OSMO_VALUE_STRING(LCHAN_EV_RLL_REL_CONF), OSMO_VALUE_STRING(LCHAN_EV_RSL_RF_CHAN_REL_ACK), @@ -1421,27 +1165,12 @@ void lchan_fsm_allstate_action(struct osmo_fsm_inst *fi, uint32_t event, void *data) { - struct gsm_lchan *lchan = lchan_fi_lchan(fi); - switch (event) { case LCHAN_EV_TS_ERROR: lchan_fail_to(LCHAN_ST_UNUSED, "LCHAN_EV_TS_ERROR"); return; - case LCHAN_EV_MGW_ENDPOINT_ERROR: - /* This event during activation means that it was not possible to establish an endpoint. - * After activation was successful, it could also come in at any point to signal that the - * MGW side has become unavailable, which should lead to graceful release. */ - if (fi->state == LCHAN_ST_WAIT_MGW_ENDPOINT_AVAILABLE) { - /* This state is actually waiting for availability. Fail it immediately. */ - lchan_fail("LCHAN_EV_MGW_ENDPOINT_ERROR"); - return; - } - LOG_LCHAN(lchan, LOGL_ERROR, "Releasing due to MGW endpoint error\n"); - lchan_release(lchan, false, true, RSL_ERR_EQUIPMENT_FAIL); - return; - default: return; } @@ -1477,28 +1206,26 @@ lchan->rsl_error_cause = cause_rr; lchan->deact_sacch = sacch_deact; - /* This would also happen later, but better to do this a sooner. */ - if (lchan->mgw_endpoint_ci_bts) { - mgw_endpoint_ci_dlcx(lchan->mgw_endpoint_ci_bts); - lchan->mgw_endpoint_ci_bts = NULL; - } - /* States waiting for events will notice the desire to release when done waiting, so it is enough * to mark for release. */ lchan->release_requested = true; - /* But when in error, shortcut that. */ + /* If we took the RTP over from another lchan, put it back. */ + if (lchan->fi_rtp && lchan->release_in_error) + osmo_fsm_inst_dispatch(lchan->fi_rtp, LCHAN_RTP_EV_ROLLBACK, 0); + + /* But when in error, don't wait for the next state to pick up release_requested. */ if (lchan->release_in_error) { switch (lchan->fi->state) { default: - /* Normally we deact SACCH in lchan_fsm_wait_sapis_released_onenter(). When + /* Normally we deact SACCH in lchan_fsm_wait_rll_rtp_released_onenter(). When * skipping that, but asked to SACCH deact, do it now. */ if (lchan->deact_sacch) rsl_deact_sacch(lchan); lchan_fsm_state_chg(LCHAN_ST_WAIT_RF_RELEASE_ACK); return; case LCHAN_ST_WAIT_TS_READY: - lchan_fsm_state_chg(LCHAN_ST_UNUSED); + lchan_fsm_state_chg(LCHAN_ST_WAIT_RLL_RTP_RELEASED); return; case LCHAN_ST_WAIT_RF_RELEASE_ACK: case LCHAN_ST_BORKEN: @@ -1509,7 +1236,7 @@ /* The only non-broken state that would stay stuck without noticing the release_requested flag * is: */ if (fi->state == LCHAN_ST_ESTABLISHED) - lchan_fsm_state_chg(LCHAN_ST_WAIT_SAPIS_RELEASED); + lchan_fsm_state_chg(LCHAN_ST_WAIT_RLL_RTP_RELEASED); } void lchan_fsm_cleanup(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause) @@ -1525,14 +1252,6 @@ lchan->fi = NULL; } -/* The mgw_endpoint was invalidated, just and simply forget the pointer without cleanup. */ -void lchan_forget_mgw_endpoint(struct gsm_lchan *lchan) -{ - if (!lchan) - return; - lchan->mgw_endpoint_ci_bts = NULL; -} - /* The conn is deallocating, just forget all about it */ void lchan_forget_conn(struct gsm_lchan *lchan) { @@ -1551,7 +1270,6 @@ .allstate_action = lchan_fsm_allstate_action, .allstate_event_mask = 0 | S(LCHAN_EV_TS_ERROR) - | S(LCHAN_EV_MGW_ENDPOINT_ERROR) , .timer_cb = lchan_fsm_timer_cb, .cleanup = lchan_fsm_cleanup, diff --git a/src/osmo-bsc/lchan_rtp_fsm.c b/src/osmo-bsc/lchan_rtp_fsm.c new file mode 100644 index 0000000..3530b8a --- /dev/null +++ b/src/osmo-bsc/lchan_rtp_fsm.c @@ -0,0 +1,743 @@ +/* osmo-bsc API to switch the RTP stream for an lchan. + * + * (C) 2018 by sysmocom - s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include + +#include +#include +#include +#include +#include +#include +#include + +static struct osmo_fsm lchan_rtp_fsm; + +struct gsm_lchan *lchan_rtp_fi_lchan(struct osmo_fsm_inst *fi) +{ + OSMO_ASSERT(fi); + OSMO_ASSERT(fi->fsm == &lchan_rtp_fsm); + OSMO_ASSERT(fi->priv); + return fi->priv; +} + +struct state_timeout lchan_rtp_fsm_timeouts[32] = { + [LCHAN_RTP_ST_WAIT_MGW_ENDPOINT_AVAILABLE] = { .T=23004 }, + [LCHAN_RTP_ST_WAIT_IPACC_CRCX_ACK] = { .T=23005 }, + [LCHAN_RTP_ST_WAIT_IPACC_MDCX_ACK] = { .T=23006 }, + [LCHAN_RTP_ST_WAIT_MGW_ENDPOINT_CONFIGURED] = { .T=23004 }, +}; + +/* Transition to a state, using the T timer defined in lchan_rtp_fsm_timeouts. + * The actual timeout value is in turn obtained from network->T_defs. + * Assumes local variable fi exists. */ +#define lchan_rtp_fsm_state_chg(state) \ + fsm_inst_state_chg_T(fi, state, \ + lchan_rtp_fsm_timeouts, \ + ((struct gsm_lchan*)(fi->priv))->ts->trx->bts->network->T_defs, \ + 5) + +/* Set a failure message, trigger the common actions to take on failure, transition to a state to + * continue with (using state timeouts from lchan_rtp_fsm_timeouts[]). Assumes local variable fi exists. */ +#define lchan_rtp_fail(fmt, args...) do { \ + struct gsm_lchan *_lchan = fi->priv; \ + uint32_t state_was = fi->state; \ + lchan_set_last_error(_lchan, "lchan-rtp failure in state %s: " fmt, \ + osmo_fsm_state_name(fi->fsm, state_was), ## args); \ + osmo_fsm_inst_dispatch(_lchan->fi, LCHAN_EV_RTP_ERROR, 0); \ + } while(0) + +/* Called from lchan_fsm_init(), does not need to be visible in lchan_rtp_fsm.h */ +void lchan_rtp_fsm_init() +{ + OSMO_ASSERT(osmo_fsm_register(&lchan_rtp_fsm) == 0); +} + +static void lchan_rtp_fsm_update_id(struct gsm_lchan *lchan) +{ + OSMO_ASSERT(lchan->fi); + OSMO_ASSERT(lchan->fi_rtp); + osmo_fsm_inst_update_id_f(lchan->fi_rtp, lchan->fi->id); +} + +bool lchan_rtp_established(struct gsm_lchan *lchan) +{ + if (!lchan->fi_rtp) + return false; + switch (lchan->fi_rtp->state) { + case LCHAN_RTP_ST_READY: + case LCHAN_RTP_ST_ESTABLISHED: + case LCHAN_RTP_ST_ROLLBACK: + return true; + default: + return false; + } +} + +void lchan_rtp_fsm_start(struct gsm_lchan *lchan) +{ + struct osmo_fsm_inst *fi; + + OSMO_ASSERT(lchan->ts); + OSMO_ASSERT(lchan->ts->fi); + OSMO_ASSERT(lchan->fi); + OSMO_ASSERT(!lchan->fi_rtp); + + fi = osmo_fsm_inst_alloc_child(&lchan_rtp_fsm, lchan->fi, LCHAN_EV_RTP_RELEASED); + OSMO_ASSERT(fi); + fi->priv = lchan; + lchan->fi_rtp = fi; + lchan_rtp_fsm_update_id(lchan); + + /* Use old lchan only if there is an MGW endpoint present. Otherwise, on ROLLBACK, we might put + * an endpoint "back" to an lchan that never had one to begin with. */ + if (lchan->activate.re_use_mgw_endpoint_from_lchan + && !lchan->activate.re_use_mgw_endpoint_from_lchan->mgw_endpoint_ci_bts) + lchan->activate.re_use_mgw_endpoint_from_lchan = NULL; + + lchan_rtp_fsm_state_chg(LCHAN_RTP_ST_WAIT_MGW_ENDPOINT_AVAILABLE); +} + +/* While activating an lchan, for example for Handover, we may want to re-use another lchan's MGW + * endpoint CI. If Handover fails half way, the old lchan must keep its MGW endpoint CI, and we must not + * clean it up. Hence keep another lchan's mgw_endpoint_ci_bts out of lchan until all is done. */ +struct mgwep_ci *lchan_use_mgw_endpoint_ci_bts(struct gsm_lchan *lchan) +{ + if (lchan->mgw_endpoint_ci_bts) + return lchan->mgw_endpoint_ci_bts; + if (lchan_state_is(lchan, LCHAN_ST_ESTABLISHED)) + return NULL; + if (lchan->activate.re_use_mgw_endpoint_from_lchan) + return lchan->activate.re_use_mgw_endpoint_from_lchan->mgw_endpoint_ci_bts; + return NULL; +} + +static void lchan_rtp_fsm_wait_mgw_endpoint_available_onenter(struct osmo_fsm_inst *fi, + uint32_t prev_state) +{ + struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); + struct mgw_endpoint *mgwep; + struct mgwep_ci *use_mgwep_ci = lchan_use_mgw_endpoint_ci_bts(lchan); + struct mgcp_conn_peer crcx_info = {}; + + if (use_mgwep_ci) { + LOG_LCHAN_RTP(lchan, LOGL_DEBUG, "MGW endpoint already available: %s", + mgwep_ci_name(use_mgwep_ci)); + lchan_rtp_fsm_state_chg(LCHAN_RTP_ST_WAIT_LCHAN_READY); + return; + } + + mgwep = gscon_ensure_mgw_endpoint(lchan->conn, lchan->activate.msc_assigned_cic); + if (!mgwep) { + lchan_rtp_fail("Internal error: cannot obtain MGW endpoint handle for conn"); + return; + } + + lchan->mgw_endpoint_ci_bts = mgw_endpoint_ci_add(mgwep, "to-BTS"); + + if (lchan->conn) + crcx_info.call_id = lchan->conn->sccp.conn_id; + crcx_info.ptime = 20; + mgcp_pick_codec(&crcx_info, lchan); + + mgw_endpoint_ci_request(lchan->mgw_endpoint_ci_bts, MGCP_VERB_CRCX, &crcx_info, + fi, LCHAN_RTP_EV_MGW_ENDPOINT_AVAILABLE, LCHAN_RTP_EV_MGW_ENDPOINT_ERROR, + 0); +} + +static void lchan_rtp_fsm_wait_mgw_endpoint_available(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); + switch (event) { + + case LCHAN_RTP_EV_MGW_ENDPOINT_AVAILABLE: + LOG_LCHAN_RTP(lchan, LOGL_DEBUG, "MGW endpoint: %s", + mgwep_ci_name(lchan_use_mgw_endpoint_ci_bts(lchan))); + lchan_rtp_fsm_state_chg(LCHAN_RTP_ST_WAIT_LCHAN_READY); + return; + + case LCHAN_RTP_EV_LCHAN_READY: + /* will notice lchan->activate.activ_ack == true in + * lchan_rtp_fsm_wait_lchan_ready_onenter() */ + return; + + case LCHAN_RTP_EV_MGW_ENDPOINT_ERROR: + lchan_rtp_fail("Failure to create MGW endpoint"); + return; + + case LCHAN_RTP_EV_ROLLBACK: + case LCHAN_RTP_EV_RELEASE: + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REQUEST, 0); + return; + + default: + OSMO_ASSERT(false); + } +} + +static void lchan_rtp_fsm_post_lchan_ready(struct osmo_fsm_inst *fi); + +static void lchan_rtp_fsm_wait_lchan_ready_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); + + if (lchan->activate.activ_ack) { + LOG_LCHAN_RTP(lchan, LOGL_DEBUG, "Activ Ack received earlier, no need to wait"); + lchan_rtp_fsm_post_lchan_ready(fi); + } +} + +static void lchan_rtp_fsm_wait_lchan_ready(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + switch (event) { + + case LCHAN_RTP_EV_LCHAN_READY: + lchan_rtp_fsm_post_lchan_ready(fi); + return; + + case LCHAN_RTP_EV_ROLLBACK: + case LCHAN_RTP_EV_RELEASE: + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REQUEST, 0); + return; + + default: + OSMO_ASSERT(false); + } +} + +static void lchan_rtp_fsm_switch_rtp(struct osmo_fsm_inst *fi) +{ + struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); + + if (lchan->activate.wait_before_switching_rtp) { + LOG_LCHAN_RTP(lchan, LOGL_DEBUG, + "Waiting for an event by caller before switching RTP\n"); + lchan_rtp_fsm_state_chg(LCHAN_RTP_ST_WAIT_READY_TO_SWITCH_RTP); + } else + lchan_rtp_fsm_state_chg(LCHAN_RTP_ST_WAIT_MGW_ENDPOINT_CONFIGURED); +} + +static void lchan_rtp_fsm_post_lchan_ready(struct osmo_fsm_inst *fi) +{ + struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); + + if (is_ipaccess_bts(lchan->ts->trx->bts)) + lchan_rtp_fsm_state_chg(LCHAN_RTP_ST_WAIT_IPACC_CRCX_ACK); + else + lchan_rtp_fsm_switch_rtp(fi); +} + +static void lchan_rtp_fsm_wait_ipacc_crcx_ack_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + int rc; + int val; + struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); + + if (lchan->release_requested) { + lchan_rtp_fail("Release requested while activating"); + return; + } + + val = ipacc_speech_mode(lchan->tch_mode, lchan->type); + if (val < 0) { + lchan_rtp_fail("Cannot determine Abis/IP speech mode for tch_mode=%s type=%s\n", + get_value_string(gsm48_chan_mode_names, lchan->tch_mode), + gsm_lchant_name(lchan->type)); + return; + } + lchan->abis_ip.speech_mode = val; + + val = ipacc_payload_type(lchan->tch_mode, lchan->type); + if (val < 0) { + lchan_rtp_fail("Cannot determine Abis/IP payload type for tch_mode=%s type=%s\n", + get_value_string(gsm48_chan_mode_names, lchan->tch_mode), + gsm_lchant_name(lchan->type)); + return; + } + lchan->abis_ip.rtp_payload = val; + + /* recv-only */ + ipacc_speech_mode_set_direction(&lchan->abis_ip.speech_mode, false); + + rc = rsl_tx_ipacc_crcx(lchan); + if (rc) + lchan_rtp_fail("Failure to transmit IPACC CRCX to BTS (rc=%d, %s)", + rc, strerror(-rc)); +} + +static void lchan_rtp_fsm_wait_ipacc_crcx_ack(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); + switch (event) { + + case LCHAN_RTP_EV_IPACC_CRCX_ACK: + /* the CRCX ACK parsing has already noted the RTP port information at + * lchan->abis_ip.bound_*, see ipac_parse_rtp(). We'll use that in + * lchan_rtp_fsm_wait_mgw_endpoint_configured_onenter(). */ + lchan_rtp_fsm_state_chg(LCHAN_RTP_ST_WAIT_IPACC_MDCX_ACK); + return; + + case LCHAN_RTP_EV_IPACC_CRCX_NACK: + lchan_rtp_fail("Received NACK on IPACC CRCX"); + return; + + case LCHAN_RTP_EV_READY_TO_SWITCH_RTP: + lchan->activate.wait_before_switching_rtp = false; + return; + + case LCHAN_RTP_EV_RELEASE: + case LCHAN_RTP_EV_ROLLBACK: + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REQUEST, 0); + return; + + default: + OSMO_ASSERT(false); + } +} + +static void lchan_rtp_fsm_wait_ipacc_mdcx_ack_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + int rc; + struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); + const struct mgcp_conn_peer *mgw_rtp; + + if (lchan->release_requested) { + lchan_rtp_fail("Release requested while activating"); + return; + } + + mgw_rtp = mgwep_ci_get_rtp_info(lchan_use_mgw_endpoint_ci_bts(lchan)); + + if (!mgw_rtp) { + lchan_rtp_fail("Cannot send IPACC MDCX to BTS:" + " there is no RTP IP+port set that the BTS should send RTP to."); + return; + } + + /* Other RTP settings were already setup in lchan_rtp_fsm_wait_ipacc_crcx_ack_onenter() */ + lchan->abis_ip.connect_ip = ntohl(inet_addr(mgw_rtp->addr)); + lchan->abis_ip.connect_port = mgw_rtp->port; + + /* send-recv */ + ipacc_speech_mode_set_direction(&lchan->abis_ip.speech_mode, true); + + rc = rsl_tx_ipacc_mdcx(lchan); + if (rc) + lchan_rtp_fail("Failure to transmit IPACC MDCX to BTS (rc=%d, %s)", + rc, strerror(-rc)); + +} + +static void lchan_rtp_fsm_wait_ipacc_mdcx_ack(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); + switch (event) { + + case LCHAN_RTP_EV_IPACC_MDCX_ACK: + lchan_rtp_fsm_switch_rtp(fi); + return; + + case LCHAN_RTP_EV_IPACC_MDCX_NACK: + lchan_rtp_fail("Received NACK on IPACC MDCX"); + return; + + case LCHAN_RTP_EV_READY_TO_SWITCH_RTP: + lchan->activate.wait_before_switching_rtp = false; + return; + + case LCHAN_RTP_EV_RELEASE: + case LCHAN_RTP_EV_ROLLBACK: + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REQUEST, 0); + return; + + default: + OSMO_ASSERT(false); + } +} + +static void lchan_rtp_fsm_wait_ready_to_switch_rtp(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + switch (event) { + + case LCHAN_RTP_EV_READY_TO_SWITCH_RTP: + lchan_rtp_fsm_state_chg(LCHAN_RTP_ST_WAIT_MGW_ENDPOINT_CONFIGURED); + return; + + case LCHAN_RTP_EV_RELEASE: + case LCHAN_RTP_EV_ROLLBACK: + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REQUEST, 0); + return; + + default: + OSMO_ASSERT(false); + } +} + +static void connect_mgw_endpoint_to_lchan(struct osmo_fsm_inst *fi, + struct mgwep_ci *ci, + struct gsm_lchan *to_lchan) +{ + int rc; + struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); + struct mgcp_conn_peer mdcx_info; + struct in_addr addr; + const char *addr_str; + + mdcx_info = (struct mgcp_conn_peer){ + .port = to_lchan->abis_ip.bound_port, + .ptime = 20, + }; + mgcp_pick_codec(&mdcx_info, to_lchan); + + addr.s_addr = ntohl(to_lchan->abis_ip.bound_ip); + addr_str = inet_ntoa(addr); + rc = osmo_strlcpy(mdcx_info.addr, addr_str, sizeof(mdcx_info.addr)); + if (rc <= 0 || rc >= sizeof(mdcx_info.addr)) { + lchan_rtp_fail("Cannot compose BTS side RTP IP address to send to MGW: '%s'", + addr_str); + return; + } + + if (!ci) { + lchan_rtp_fail("No MGW endpoint ci configured"); + return; + } + + LOG_LCHAN_RTP(lchan, LOGL_DEBUG, "Sending BTS side RTP port info %s:%u to MGW %s", + mdcx_info.addr, mdcx_info.port, mgwep_ci_name(ci)); + mgw_endpoint_ci_request(ci, MGCP_VERB_MDCX, &mdcx_info, + fi, LCHAN_RTP_EV_MGW_ENDPOINT_CONFIGURED, + LCHAN_RTP_EV_MGW_ENDPOINT_ERROR, 0); +} + +static void lchan_rtp_fsm_wait_mgw_endpoint_configured_onenter(struct osmo_fsm_inst *fi, + uint32_t prev_state) +{ + struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); + struct gsm_lchan *old_lchan = lchan->activate.re_use_mgw_endpoint_from_lchan; + + if (lchan->release_requested) { + lchan_rtp_fail("Release requested while activating"); + return; + } + + /* At this point, we are taking over an old lchan's MGW endpoint (if any). */ + if (!lchan->mgw_endpoint_ci_bts && old_lchan) { + /* The old lchan shall forget the enpoint now. We might put it back upon ROLLBACK */ + lchan->mgw_endpoint_ci_bts = old_lchan->mgw_endpoint_ci_bts; + old_lchan->mgw_endpoint_ci_bts = NULL; + } + + if (!lchan->mgw_endpoint_ci_bts) { + lchan_rtp_fail("No MGW endpoint ci configured"); + return; + } + + connect_mgw_endpoint_to_lchan(fi, lchan->mgw_endpoint_ci_bts, lchan); +} + +static void lchan_rtp_fsm_wait_mgw_endpoint_configured(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + switch (event) { + + case LCHAN_RTP_EV_MGW_ENDPOINT_CONFIGURED: + lchan_rtp_fsm_state_chg(LCHAN_RTP_ST_READY); + return; + + case LCHAN_RTP_EV_MGW_ENDPOINT_ERROR: + lchan_rtp_fail("Error while redirecting the MGW to the lchan's RTP port"); + return; + + default: + OSMO_ASSERT(false); + } +} + +static void lchan_rtp_fsm_ready_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); + osmo_fsm_inst_dispatch(lchan->fi, LCHAN_EV_RTP_READY, 0); +} + +static void lchan_rtp_fsm_ready(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + switch (event) { + + case LCHAN_RTP_EV_ESTABLISHED: + lchan_rtp_fsm_state_chg(LCHAN_RTP_ST_ESTABLISHED); + return; + + case LCHAN_RTP_EV_RELEASE: + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REQUEST, 0); + return; + + case LCHAN_RTP_EV_ROLLBACK: + lchan_rtp_fsm_state_chg(LCHAN_RTP_ST_ROLLBACK); + return; + + default: + OSMO_ASSERT(false); + } +} + +static void lchan_rtp_fsm_rollback_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); + struct gsm_lchan *old_lchan = lchan->activate.re_use_mgw_endpoint_from_lchan; + + if (!lchan->mgw_endpoint_ci_bts || !old_lchan) { + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REQUEST, 0); + return; + } + connect_mgw_endpoint_to_lchan(fi, lchan->mgw_endpoint_ci_bts, old_lchan); +} + +static void lchan_rtp_fsm_rollback(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); + struct gsm_lchan *old_lchan = lchan->activate.re_use_mgw_endpoint_from_lchan; + + switch (event) { + + case LCHAN_RTP_EV_MGW_ENDPOINT_CONFIGURED: + old_lchan->mgw_endpoint_ci_bts = lchan->mgw_endpoint_ci_bts; + lchan->mgw_endpoint_ci_bts = NULL; + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, 0); + return; + + case LCHAN_RTP_EV_MGW_ENDPOINT_ERROR: + LOG_LCHAN_RTP(lchan, LOGL_ERROR, + "Error while connecting the MGW back to the old lchan's RTP port:" + " %s %s\n", + mgwep_ci_name(lchan->mgw_endpoint_ci_bts), + gsm_lchan_name(old_lchan)); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, 0); + return; + + default: + OSMO_ASSERT(false); + } +} + +static void lchan_rtp_fsm_established_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); + + /* Make sure that we will not hand back the MGW endpoint to any old lchan from here on. */ + lchan->activate.re_use_mgw_endpoint_from_lchan = NULL; +} + +static void lchan_rtp_fsm_established(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + switch (event) { + + case LCHAN_RTP_EV_RELEASE: + case LCHAN_RTP_EV_ROLLBACK: + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, 0); + return; + + default: + OSMO_ASSERT(false); + } +} + +#define S(x) (1 << (x)) + +static const struct osmo_fsm_state lchan_rtp_fsm_states[] = { + [LCHAN_RTP_ST_WAIT_MGW_ENDPOINT_AVAILABLE] = { + .name = "WAIT_MGW_ENDPOINT_AVAILABLE", + .onenter = lchan_rtp_fsm_wait_mgw_endpoint_available_onenter, + .action = lchan_rtp_fsm_wait_mgw_endpoint_available, + .in_event_mask = 0 + | S(LCHAN_RTP_EV_MGW_ENDPOINT_AVAILABLE) + | S(LCHAN_RTP_EV_MGW_ENDPOINT_ERROR) + | S(LCHAN_RTP_EV_LCHAN_READY) + | S(LCHAN_RTP_EV_RELEASE) + | S(LCHAN_RTP_EV_ROLLBACK) + , + .out_state_mask = 0 + | S(LCHAN_RTP_ST_WAIT_MGW_ENDPOINT_AVAILABLE) /* for init */ + | S(LCHAN_RTP_ST_WAIT_LCHAN_READY) + , + }, + [LCHAN_RTP_ST_WAIT_LCHAN_READY] = { + .name = "WAIT_LCHAN_READY", + .onenter = lchan_rtp_fsm_wait_lchan_ready_onenter, + .action = lchan_rtp_fsm_wait_lchan_ready, + .in_event_mask = 0 + | S(LCHAN_RTP_EV_LCHAN_READY) + | S(LCHAN_RTP_EV_RELEASE) + | S(LCHAN_RTP_EV_ROLLBACK) + , + .out_state_mask = 0 + | S(LCHAN_RTP_ST_WAIT_IPACC_CRCX_ACK) + | S(LCHAN_RTP_ST_WAIT_READY_TO_SWITCH_RTP) + | S(LCHAN_RTP_ST_WAIT_MGW_ENDPOINT_CONFIGURED) + , + }, + [LCHAN_RTP_ST_WAIT_IPACC_CRCX_ACK] = { + .name = "WAIT_IPACC_CRCX_ACK", + .onenter = lchan_rtp_fsm_wait_ipacc_crcx_ack_onenter, + .action = lchan_rtp_fsm_wait_ipacc_crcx_ack, + .in_event_mask = 0 + | S(LCHAN_RTP_EV_READY_TO_SWITCH_RTP) + | S(LCHAN_RTP_EV_IPACC_CRCX_ACK) + | S(LCHAN_RTP_EV_IPACC_CRCX_NACK) + | S(LCHAN_RTP_EV_RELEASE) + | S(LCHAN_RTP_EV_ROLLBACK) + , + .out_state_mask = 0 + | S(LCHAN_RTP_ST_WAIT_IPACC_MDCX_ACK) + , + }, + [LCHAN_RTP_ST_WAIT_IPACC_MDCX_ACK] = { + .name = "WAIT_IPACC_MDCX_ACK", + .onenter = lchan_rtp_fsm_wait_ipacc_mdcx_ack_onenter, + .action = lchan_rtp_fsm_wait_ipacc_mdcx_ack, + .in_event_mask = 0 + | S(LCHAN_RTP_EV_READY_TO_SWITCH_RTP) + | S(LCHAN_RTP_EV_IPACC_MDCX_ACK) + | S(LCHAN_RTP_EV_IPACC_MDCX_NACK) + | S(LCHAN_RTP_EV_RELEASE) + | S(LCHAN_RTP_EV_ROLLBACK) + , + .out_state_mask = 0 + | S(LCHAN_RTP_ST_WAIT_READY_TO_SWITCH_RTP) + | S(LCHAN_RTP_ST_WAIT_MGW_ENDPOINT_CONFIGURED) + , + }, + [LCHAN_RTP_ST_WAIT_READY_TO_SWITCH_RTP] = { + .name = "WAIT_READY_TO_SWITCH_RTP", + .action = lchan_rtp_fsm_wait_ready_to_switch_rtp, + .in_event_mask = 0 + | S(LCHAN_RTP_EV_READY_TO_SWITCH_RTP) + | S(LCHAN_RTP_EV_RELEASE) + | S(LCHAN_RTP_EV_ROLLBACK) + , + .out_state_mask = 0 + | S(LCHAN_RTP_ST_WAIT_MGW_ENDPOINT_CONFIGURED) + , + }, + [LCHAN_RTP_ST_WAIT_MGW_ENDPOINT_CONFIGURED] = { + .name = "WAIT_MGW_ENDPOINT_CONFIGURED", + .onenter = lchan_rtp_fsm_wait_mgw_endpoint_configured_onenter, + .action = lchan_rtp_fsm_wait_mgw_endpoint_configured, + .in_event_mask = 0 + | S(LCHAN_RTP_EV_MGW_ENDPOINT_CONFIGURED) + | S(LCHAN_RTP_EV_MGW_ENDPOINT_ERROR) + | S(LCHAN_RTP_EV_RELEASE) + | S(LCHAN_RTP_EV_ROLLBACK) + , + .out_state_mask = 0 + | S(LCHAN_RTP_ST_READY) + , + }, + [LCHAN_RTP_ST_READY] = { + .name = "READY", + .onenter = lchan_rtp_fsm_ready_onenter, + .action = lchan_rtp_fsm_ready, + .in_event_mask = 0 + | S(LCHAN_RTP_EV_ESTABLISHED) + | S(LCHAN_RTP_EV_RELEASE) + | S(LCHAN_RTP_EV_ROLLBACK) + , + .out_state_mask = 0 + | S(LCHAN_RTP_ST_ESTABLISHED) + | S(LCHAN_RTP_ST_ROLLBACK) + , + }, + [LCHAN_RTP_ST_ESTABLISHED] = { + .name = "ESTABLISHED", + .onenter = lchan_rtp_fsm_established_onenter, + .action = lchan_rtp_fsm_established, + .in_event_mask = 0 + | S(LCHAN_RTP_EV_RELEASE) + | S(LCHAN_RTP_EV_ROLLBACK) + , + }, + [LCHAN_RTP_ST_ROLLBACK] = { + .name = "ROLLBACK", + .onenter = lchan_rtp_fsm_rollback_onenter, + .action = lchan_rtp_fsm_rollback, + .in_event_mask = 0 + | S(LCHAN_RTP_EV_MGW_ENDPOINT_CONFIGURED) + | S(LCHAN_RTP_EV_MGW_ENDPOINT_ERROR) + | S(LCHAN_RTP_EV_RELEASE) + | S(LCHAN_RTP_EV_ROLLBACK) + , + }, +}; + +static const struct value_string lchan_rtp_fsm_event_names[] = { + OSMO_VALUE_STRING(LCHAN_RTP_EV_LCHAN_READY), + OSMO_VALUE_STRING(LCHAN_RTP_EV_READY_TO_SWITCH_RTP), + OSMO_VALUE_STRING(LCHAN_RTP_EV_MGW_ENDPOINT_AVAILABLE), + OSMO_VALUE_STRING(LCHAN_RTP_EV_MGW_ENDPOINT_ERROR), + OSMO_VALUE_STRING(LCHAN_RTP_EV_IPACC_CRCX_ACK), + OSMO_VALUE_STRING(LCHAN_RTP_EV_IPACC_CRCX_NACK), + OSMO_VALUE_STRING(LCHAN_RTP_EV_IPACC_MDCX_ACK), + OSMO_VALUE_STRING(LCHAN_RTP_EV_IPACC_MDCX_NACK), + OSMO_VALUE_STRING(LCHAN_RTP_EV_READY_TO_SWITCH), + OSMO_VALUE_STRING(LCHAN_RTP_EV_MGW_ENDPOINT_CONFIGURED), + OSMO_VALUE_STRING(LCHAN_RTP_EV_ROLLBACK), + OSMO_VALUE_STRING(LCHAN_RTP_EV_ESTABLISHED), + OSMO_VALUE_STRING(LCHAN_RTP_EV_RELEASE), + {} +}; + +int lchan_rtp_fsm_timer_cb(struct osmo_fsm_inst *fi) +{ + struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); + lchan->release_in_error = true; + lchan_rtp_fail("Timeout"); + return 0; +} + +void lchan_rtp_fsm_cleanup(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause) +{ + struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); + if (lchan->mgw_endpoint_ci_bts) { + mgw_endpoint_ci_dlcx(lchan->mgw_endpoint_ci_bts); + lchan->mgw_endpoint_ci_bts = NULL; + } + lchan->fi_rtp = NULL; + if (lchan->fi) + osmo_fsm_inst_dispatch(lchan->fi, LCHAN_EV_RTP_RELEASED, 0); +} + +/* The mgw_endpoint was invalidated, just and simply forget the pointer without cleanup. */ +void lchan_forget_mgw_endpoint(struct gsm_lchan *lchan) +{ + if (!lchan) + return; + lchan->mgw_endpoint_ci_bts = NULL; +} + +static struct osmo_fsm lchan_rtp_fsm = { + .name = "lchan_rtp", + .states = lchan_rtp_fsm_states, + .num_states = ARRAY_SIZE(lchan_rtp_fsm_states), + .log_subsys = DRSL, + .event_names = lchan_rtp_fsm_event_names, + .timer_cb = lchan_rtp_fsm_timer_cb, + .cleanup = lchan_rtp_fsm_cleanup, +}; diff --git a/tests/handover/Makefile.am b/tests/handover/Makefile.am index 709a87b..c28c417 100644 --- a/tests/handover/Makefile.am +++ b/tests/handover/Makefile.am @@ -63,6 +63,7 @@ $(top_builddir)/src/osmo-bsc/handover_fsm.o \ $(top_builddir)/src/osmo-bsc/handover_logic.o \ $(top_builddir)/src/osmo-bsc/lchan_fsm.o \ + $(top_builddir)/src/osmo-bsc/lchan_rtp_fsm.o \ $(top_builddir)/src/osmo-bsc/lchan_select.o \ $(top_builddir)/src/osmo-bsc/meas_rep.o \ $(top_builddir)/src/osmo-bsc/mgw_endpoint_fsm.o \ diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c index 3a5748e..e76cc85 100644 --- a/tests/handover/handover_test.c +++ b/tests/handover/handover_test.c @@ -393,6 +393,7 @@ struct gsm48_ho_cpl *hc; send_est_ind(lchan); + osmo_fsm_inst_dispatch(lchan->fi, LCHAN_EV_RTP_READY, 0); rh = (struct abis_rsl_rll_hdr *) msgb_put(msg, sizeof(*rh)); rh->c.msg_discr = ABIS_RSL_MDISC_RLL; -- To view, visit https://gerrit.osmocom.org/10103 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id7a4407d9b63be05ce63f5f2768b7d7e3d5c86fb Gerrit-Change-Number: 10103 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 01:00:26 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Jul 2018 01:00:26 +0000 Subject: Change in osmo-bsc[master]: lchan_fsm: add in_release_handler flag Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10104 Change subject: lchan_fsm: add in_release_handler flag ...................................................................... lchan_fsm: add in_release_handler flag Change-Id: Iec41e006b6ab9d0f618d36925341f9536353e5d8 --- M include/osmocom/bsc/gsm_data.h M src/osmo-bsc/lchan_fsm.c 2 files changed, 21 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/04/10104/1 diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 7bd0943..425de0b 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -525,6 +525,10 @@ /* RSL error code, RSL_ERR_* */ uint8_t rsl_error_cause; + /* If a release event is being handled, ignore other ricocheting release events until that + * release handling has concluded. */ + bool in_release_handler; + /* The logical channel type */ enum gsm_chan_t type; /* RSL channel mode */ diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c index 58adb99..6d090f6 100644 --- a/src/osmo-bsc/lchan_fsm.c +++ b/src/osmo-bsc/lchan_fsm.c @@ -521,7 +521,7 @@ case LCHAN_EV_RTP_RELEASED: case LCHAN_EV_RTP_ERROR: - if (lchan->release_requested) { + if (lchan->in_release_handler) { /* Already in release, the RTP is not the initial cause of failure. * Just ignore. */ return; @@ -581,6 +581,7 @@ break; case LCHAN_EV_RSL_CHAN_ACTIV_NACK: + lchan->in_release_handler = true; if (data) { uint32_t next_state; lchan->rsl_error_cause = *(uint8_t*)data; @@ -599,11 +600,12 @@ lchan->release_in_error = true; lchan_fail_to(LCHAN_ST_BORKEN, "Chan Activ NACK without cause IE"); } + lchan->in_release_handler = false; break; case LCHAN_EV_RTP_RELEASED: case LCHAN_EV_RTP_ERROR: - if (lchan->release_requested) { + if (lchan->in_release_handler) { /* Already in release, the RTP is not the initial cause of failure. * Just ignore. */ return; @@ -715,7 +717,7 @@ case LCHAN_EV_RTP_RELEASED: case LCHAN_EV_RTP_ERROR: - if (lchan->release_requested) { + if (lchan->in_release_handler) { /* Already in release, the RTP is not the initial cause of failure. * Just ignore. */ return; @@ -826,7 +828,7 @@ case LCHAN_EV_RTP_RELEASED: case LCHAN_EV_RTP_ERROR: - if (lchan->release_requested) { + if (lchan->in_release_handler) { /* Already in release, the RTP is not the initial cause of failure. * Just ignore. */ return; @@ -1201,6 +1203,11 @@ { if (!lchan || !lchan->fi) return; + + if (lchan->in_release_handler) + return; + lchan->in_release_handler = true; + struct osmo_fsm_inst *fi = lchan->fi; lchan->release_in_error = err; lchan->rsl_error_cause = cause_rr; @@ -1223,13 +1230,13 @@ if (lchan->deact_sacch) rsl_deact_sacch(lchan); lchan_fsm_state_chg(LCHAN_ST_WAIT_RF_RELEASE_ACK); - return; + goto exit_release_handler; case LCHAN_ST_WAIT_TS_READY: lchan_fsm_state_chg(LCHAN_ST_WAIT_RLL_RTP_RELEASED); - return; + goto exit_release_handler; case LCHAN_ST_WAIT_RF_RELEASE_ACK: case LCHAN_ST_BORKEN: - return; + goto exit_release_handler; } } @@ -1237,6 +1244,9 @@ * is: */ if (fi->state == LCHAN_ST_ESTABLISHED) lchan_fsm_state_chg(LCHAN_ST_WAIT_RLL_RTP_RELEASED); + +exit_release_handler: + lchan->in_release_handler = false; } void lchan_fsm_cleanup(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause) -- To view, visit https://gerrit.osmocom.org/10104 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iec41e006b6ab9d0f618d36925341f9536353e5d8 Gerrit-Change-Number: 10104 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 01:00:27 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Jul 2018 01:00:27 +0000 Subject: Change in osmo-bsc[master]: allocate larger lchans if no SDCCH are available Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10105 Change subject: allocate larger lchans if no SDCCH are available ...................................................................... allocate larger lchans if no SDCCH are available Related: OS#3332 Change-Id: I2fcf9e9baa7d03974a367763f3f52f59dfc2cc51 --- M src/osmo-bsc/abis_rsl.c 1 file changed, 16 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/05/10105/1 diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c index 7ab97a9..7ca6750 100644 --- a/src/osmo-bsc/abis_rsl.c +++ b/src/osmo-bsc/abis_rsl.c @@ -1394,6 +1394,22 @@ gsm_lchant_name(lctype)); lchan = lchan_select_by_type(bts, lctype); } + if (!lchan && lctype == GSM_LCHAN_SDCCH) { + LOGP(DRSL, LOGL_NOTICE, "(bts=%d) CHAN RQD: no resources for %s " + "0x%x, retrying with %s\n", + msg->lchan->ts->trx->bts->nr, + gsm_lchant_name(GSM_LCHAN_SDCCH), rqd_ref->ra, + gsm_lchant_name(GSM_LCHAN_TCH_H)); + lchan = lchan_select_by_type(bts, GSM_LCHAN_TCH_H); + } + if (!lchan && lctype == GSM_LCHAN_SDCCH) { + LOGP(DRSL, LOGL_NOTICE, "(bts=%d) CHAN RQD: no resources for %s " + "0x%x, retrying with %s\n", + msg->lchan->ts->trx->bts->nr, + gsm_lchant_name(GSM_LCHAN_SDCCH), rqd_ref->ra, + gsm_lchant_name(GSM_LCHAN_TCH_F)); + lchan = lchan_select_by_type(bts, GSM_LCHAN_TCH_F); + } if (!lchan) { LOGP(DRSL, LOGL_NOTICE, "(bts=%d) CHAN RQD: no resources for %s 0x%x\n", msg->lchan->ts->trx->bts->nr, gsm_lchant_name(lctype), rqd_ref->ra); -- To view, visit https://gerrit.osmocom.org/10105 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I2fcf9e9baa7d03974a367763f3f52f59dfc2cc51 Gerrit-Change-Number: 10105 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 01:00:28 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Jul 2018 01:00:28 +0000 Subject: Change in osmo-bsc[master]: create separate logging categories for lchan, ts, as FSMs Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10106 Change subject: create separate logging categories for lchan,ts,as FSMs ...................................................................... create separate logging categories for lchan,ts,as FSMs Change-Id: Ie889b8860a4a63c7c22ef65025f690d64cd7330c --- M include/osmocom/bsc/debug.h M src/osmo-bsc/assignment_fsm.c M src/osmo-bsc/lchan_fsm.c M src/osmo-bsc/lchan_rtp_fsm.c M src/osmo-bsc/osmo_bsc_main.c M src/osmo-bsc/timeslot_fsm.c M tests/handover/handover_test.c 7 files changed, 43 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/06/10106/1 diff --git a/include/osmocom/bsc/debug.h b/include/osmocom/bsc/debug.h index 1133bf6..e78ba59 100644 --- a/include/osmocom/bsc/debug.h +++ b/include/osmocom/bsc/debug.h @@ -24,5 +24,8 @@ DFILTER, DPCU, DLCLS, + DCHAN, + DTS, + DAS, Debug_LastEntry, }; diff --git a/src/osmo-bsc/assignment_fsm.c b/src/osmo-bsc/assignment_fsm.c index 618a83d..8379914 100644 --- a/src/osmo-bsc/assignment_fsm.c +++ b/src/osmo-bsc/assignment_fsm.c @@ -643,7 +643,7 @@ .name = "assignment", .states = assignment_fsm_states, .num_states = ARRAY_SIZE(assignment_fsm_states), - .log_subsys = DRSL, + .log_subsys = DAS, .event_names = assignment_fsm_event_names, .allstate_action = assignment_fsm_allstate_action, .allstate_event_mask = 0 diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c index 6d090f6..60dab3d 100644 --- a/src/osmo-bsc/lchan_fsm.c +++ b/src/osmo-bsc/lchan_fsm.c @@ -1275,7 +1275,7 @@ .name = "lchan", .states = lchan_fsm_states, .num_states = ARRAY_SIZE(lchan_fsm_states), - .log_subsys = DRSL, + .log_subsys = DCHAN, .event_names = lchan_fsm_event_names, .allstate_action = lchan_fsm_allstate_action, .allstate_event_mask = 0 diff --git a/src/osmo-bsc/lchan_rtp_fsm.c b/src/osmo-bsc/lchan_rtp_fsm.c index 3530b8a..f7efc1b 100644 --- a/src/osmo-bsc/lchan_rtp_fsm.c +++ b/src/osmo-bsc/lchan_rtp_fsm.c @@ -736,7 +736,7 @@ .name = "lchan_rtp", .states = lchan_rtp_fsm_states, .num_states = ARRAY_SIZE(lchan_rtp_fsm_states), - .log_subsys = DRSL, + .log_subsys = DCHAN, .event_names = lchan_rtp_fsm_event_names, .timer_cb = lchan_rtp_fsm_timer_cb, .cleanup = lchan_rtp_fsm_cleanup, diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index 218ea15..b6c37c9 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -679,6 +679,24 @@ .color = "\033[1;35m", .enabled = 1, .loglevel = LOGL_NOTICE, }, + [DCHAN] = { + .name = "DCHAN", + .description = "lchan FSM", + .color = "\033[1;32m", + .enabled = 1, .loglevel = LOGL_NOTICE, + }, + [DTS] = { + .name = "DTS", + .description = "timeslot FSM", + .color = "\033[1;31m", + .enabled = 1, .loglevel = LOGL_NOTICE, + }, + [DAS] = { + .name = "DAS", + .description = "assignment FSM", + .color = "\033[1;33m", + .enabled = 1, .loglevel = LOGL_NOTICE, + }, [DNM] = { .name = "DNM", .description = "A-bis Network Management / O&M (NM/OML)", diff --git a/src/osmo-bsc/timeslot_fsm.c b/src/osmo-bsc/timeslot_fsm.c index 13a8cf3..4ec46e3 100644 --- a/src/osmo-bsc/timeslot_fsm.c +++ b/src/osmo-bsc/timeslot_fsm.c @@ -825,7 +825,7 @@ .states = ts_fsm_states, .num_states = ARRAY_SIZE(ts_fsm_states), .timer_cb = ts_fsm_timer_cb, - .log_subsys = DRSL, + .log_subsys = DTS, .event_names = ts_fsm_event_names, .allstate_event_mask = 0 | S(TS_EV_OML_DOWN) diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c index e76cc85..8f2305a 100644 --- a/tests/handover/handover_test.c +++ b/tests/handover/handover_test.c @@ -1356,6 +1356,24 @@ .description = "Mobile Switching Center", .enabled = 1, .loglevel = LOGL_DEBUG, }, + [DCHAN] = { + .name = "DCHAN", + .description = "lchan FSM", + .color = "\033[1;32m", + .enabled = 1, .loglevel = LOGL_DEBUG, + }, + [DTS] = { + .name = "DTS", + .description = "timeslot FSM", + .color = "\033[1;31m", + .enabled = 1, .loglevel = LOGL_DEBUG, + }, + [DAS] = { + .name = "DAS", + .description = "assignment FSM", + .color = "\033[1;33m", + .enabled = 1, .loglevel = LOGL_DEBUG, + }, }; const struct log_info log_info = { -- To view, visit https://gerrit.osmocom.org/10106 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ie889b8860a4a63c7c22ef65025f690d64cd7330c Gerrit-Change-Number: 10106 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 01:00:28 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Jul 2018 01:00:28 +0000 Subject: Change in osmo-bsc[master]: cosmetic: constify gsm_bts_num() net arg Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10107 Change subject: cosmetic: constify gsm_bts_num() net arg ...................................................................... cosmetic: constify gsm_bts_num() net arg Change-Id: I9a078ffb781ee55c0ca114fa0d752c1b53067419 --- M include/osmocom/bsc/gsm_data.h M src/osmo-bsc/gsm_data.c 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/07/10107/1 diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 425de0b..24115b0 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -1130,7 +1130,7 @@ struct gsm_network *gsm_network_init(void *ctx); struct gsm_bts *gsm_bts_alloc(struct gsm_network *net, uint8_t bts_num); -struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num); +struct gsm_bts *gsm_bts_num(const struct gsm_network *net, int num); bool gsm_bts_matches_lai(const struct gsm_bts *bts, const struct osmo_location_area_id *lai); bool gsm_bts_matches_cell_id(const struct gsm_bts *bts, const struct gsm0808_cell_id *cell_id); struct gsm_bts *gsm_bts_by_cell_id(const struct gsm_network *net, diff --git a/src/osmo-bsc/gsm_data.c b/src/osmo-bsc/gsm_data.c index c3cc84d..a08dc15 100644 --- a/src/osmo-bsc/gsm_data.c +++ b/src/osmo-bsc/gsm_data.c @@ -554,7 +554,7 @@ return get_value_string(chreq_names, c); } -struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num) +struct gsm_bts *gsm_bts_num(const struct gsm_network *net, int num) { struct gsm_bts *bts; -- To view, visit https://gerrit.osmocom.org/10107 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I9a078ffb781ee55c0ca114fa0d752c1b53067419 Gerrit-Change-Number: 10107 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 01:00:28 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Jul 2018 01:00:28 +0000 Subject: Change in osmo-bsc[master]: vty: 'handover any': pick more random chans, use lchan_select_by_type() Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10108 Change subject: vty: 'handover any': pick more random chans, use lchan_select_by_type() ...................................................................... vty: 'handover any': pick more random chans, use lchan_select_by_type() The 'handover any' VTY command is only useful for testing. It is even more useful if it doesn't always pick the first used lchan but produces more random handovers. The algorithm takes a random number as input, iterates over used lchans once, and if the random number is larger, takes modulo of the nr of used lchans counted. A second iteration will then produce a match. Instead of figuring out the lchan type logic in bsc_vty.c, just use lchan_select_by_type(); Change-Id: I50b70e02d665b967e401db65581e110bc83101e7 --- M src/osmo-bsc/bsc_vty.c 1 file changed, 43 insertions(+), 47 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/08/10108/1 diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c index f5454ec..83ca2e5 100644 --- a/src/osmo-bsc/bsc_vty.c +++ b/src/osmo-bsc/bsc_vty.c @@ -68,6 +68,7 @@ #include #include #include +#include #include #include @@ -1605,36 +1606,48 @@ return ho_or_as(vty, argv, argc); } -static struct gsm_lchan *find_used_voice_lchan(struct vty *vty) +static struct gsm_lchan *find_used_voice_lchan(struct vty *vty, int random_idx) { struct gsm_bts *bts; struct gsm_network *network = gsmnet_from_vty(vty); - llist_for_each_entry(bts, &network->bts_list, list) { - struct gsm_bts_trx *trx; + while (1) { + int count = 0; + llist_for_each_entry(bts, &network->bts_list, list) { + struct gsm_bts_trx *trx; - llist_for_each_entry(trx, &bts->trx_list, list) { - int i; - for (i = 0; i < ARRAY_SIZE(trx->ts); i++) { - struct gsm_bts_trx_ts *ts = &trx->ts[i]; - struct gsm_lchan *lchan; + llist_for_each_entry(trx, &bts->trx_list, list) { + int i; + for (i = 0; i < ARRAY_SIZE(trx->ts); i++) { + struct gsm_bts_trx_ts *ts = &trx->ts[i]; + struct gsm_lchan *lchan; - if (ts->fi->state != TS_ST_IN_USE) - continue; + if (ts->fi->state != TS_ST_IN_USE) + continue; - ts_for_each_lchan(lchan, ts) { - if (lchan_state_is(lchan, LCHAN_ST_ESTABLISHED) - && (lchan->type == GSM_LCHAN_TCH_F - || lchan->type == GSM_LCHAN_TCH_H)) { + ts_for_each_lchan(lchan, ts) { + if (lchan_state_is(lchan, LCHAN_ST_ESTABLISHED) + && (lchan->type == GSM_LCHAN_TCH_F + || lchan->type == GSM_LCHAN_TCH_H)) { - vty_out(vty, "Found voice call: %s%s", - gsm_lchan_name(lchan), VTY_NEWLINE); - lchan_dump_full_vty(vty, lchan); - return lchan; + if (count == random_idx) { + vty_out(vty, "Found voice call: %s%s", + gsm_lchan_name(lchan), + VTY_NEWLINE); + lchan_dump_full_vty(vty, lchan); + return lchan; + } + count ++; + } } } } } + + if (!count) + break; + /* there are used lchans, but random_idx is > count. Iterate again. */ + random_idx %= count; } vty_out(vty, "Cannot find any ongoing voice calls%s", VTY_NEWLINE); @@ -1642,7 +1655,7 @@ } static struct gsm_bts *find_other_bts_with_free_slots(struct vty *vty, struct gsm_bts *not_this_bts, - enum gsm_phys_chan_config free_type) + enum gsm_chan_t free_type) { struct gsm_bts *bts; struct gsm_network *network = gsmnet_from_vty(vty); @@ -1654,30 +1667,14 @@ continue; llist_for_each_entry(trx, &bts->trx_list, list) { - int i; - /* FIXME: use lchan_select_by_type() instead */ - for (i = 0; i < ARRAY_SIZE(trx->ts); i++) { - struct gsm_bts_trx_ts *ts = &trx->ts[i]; - struct gsm_lchan *lchan; + struct gsm_lchan *lchan = lchan_select_by_type(bts, free_type); + if (!lchan) + continue; - /* skip administratively deactivated timeslots */ - if (!nm_is_running(&ts->mo.nm_state)) - continue; - - if (ts->pchan_is != free_type) - continue; - - ts_for_each_lchan(lchan, ts) { - if (lchan->fi->state != LCHAN_ST_UNUSED) - continue; - vty_out(vty, "Found unused %s slot: %s%s", - gsm_pchan_name(free_type), - gsm_lchan_name(lchan), - VTY_NEWLINE); - lchan_dump_full_vty(vty, lchan); - return bts; - } - } + vty_out(vty, "Found unused %s slot: %s%s", + gsm_lchant_name(free_type), gsm_lchan_name(lchan), VTY_NEWLINE); + lchan_dump_full_vty(vty, lchan); + return bts; } } vty_out(vty, "Cannot find any BTS (other than BTS %u) with free %s lchan%s", @@ -1694,12 +1691,11 @@ struct gsm_lchan *from_lchan; struct gsm_bts *to_bts; - from_lchan = find_used_voice_lchan(vty); + from_lchan = find_used_voice_lchan(vty, random()); if (!from_lchan) return CMD_WARNING; - to_bts = find_other_bts_with_free_slots(vty, from_lchan->ts->trx->bts, - from_lchan->ts->pchan_is); + to_bts = find_other_bts_with_free_slots(vty, from_lchan->ts->trx->bts, from_lchan->type); if (!to_bts) return CMD_WARNING; @@ -1714,7 +1710,7 @@ { struct gsm_lchan *from_lchan; - from_lchan = find_used_voice_lchan(vty); + from_lchan = find_used_voice_lchan(vty, random()); if (!from_lchan) return CMD_WARNING; @@ -1732,7 +1728,7 @@ { struct gsm_lchan *from_lchan; - from_lchan = find_used_voice_lchan(vty); + from_lchan = find_used_voice_lchan(vty, random()); if (!from_lchan) return CMD_WARNING; -- To view, visit https://gerrit.osmocom.org/10108 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I50b70e02d665b967e401db65581e110bc83101e7 Gerrit-Change-Number: 10108 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 01:04:00 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Jul 2018 01:04:00 +0000 Subject: Change in osmo-bsc[master]: doc: update/fix FSM charts In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9667 ) Change subject: doc: update/fix FSM charts ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/9667 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I29e31b753e23a4207662e0e385a337e7df836f45 Gerrit-Change-Number: 9667 Gerrit-PatchSet: 12 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Mon, 23 Jul 2018 01:04:00 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 01:08:43 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Jul 2018 01:08:43 +0000 Subject: Change in osmo-bsc[master]: large refactoring: use FSMs for lchans; add inter-BSC HO In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9671 ) Change subject: large refactoring: use FSMs for lchans; add inter-BSC HO ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/9671 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I82e3f918295daa83274a4cf803f046979f284366 Gerrit-Change-Number: 9671 Gerrit-PatchSet: 33 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Mon, 23 Jul 2018 01:08:43 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 01:10:26 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Jul 2018 01:10:26 +0000 Subject: Change in osmo-bsc[master]: hodec2 log: less verbose, more concise logging In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10058 ) Change subject: hodec2 log: less verbose, more concise logging ...................................................................... hodec2 log: less verbose, more concise logging Drop numerous log statements that merely bloat the ho decision log. Logging HO candidates: log more compact in a single line, do not use LOGPC and multiline output. The result is more useful information in a quarter of the log lines. LOGPHOLCHAN(), LOGPHOLCHANTOBTS(): - log lchan->type instead of lchan->ts->pchan - always log the speech mode ===== Before ===== DHODEC handover_decision_2.c:1131 (lchan 0.010 TCH/F) (subscr IMSI:000001) MEASUREMENT REPORT (1 neighbors) DHODEC handover_decision_2.c:1136 (lchan 0.010 TCH/F) (subscr IMSI:000001) 0: arfcn=871 bsic=63 neigh_idx=0 rxlev=30 flags=0 DHODEC handover_decision_2.c:261 (lchan 0.010 TCH/F) (subscr IMSI:000001) neigh 871 rxlev=30 last_seen_nr=3 DHODEC handover_decision_2.c:1158 (lchan 0.010 TCH/F) (subscr IMSI:000001) HODEC2: evaluating measurement report DHODEC handover_decision_2.c:1175 (lchan 0.010 TCH/F) (subscr IMSI:000001) Measurement report: average RX level = -110 DHODEC handover_decision_2.c:1190 (lchan 0.010 TCH/F) (subscr IMSI:000001) Virtually improving RX level from -110 to -105, due to AFS bias DHODEC handover_decision_2.c:1220 (lchan 0.010 TCH/F) (subscr IMSI:000001) Attempting handover/assignment due to low rxlev DHODEC handover_decision_2.c:899 (lchan 0.010 TCH/F) (subscr IMSI:000001) Collecting candidates for Assignment and Handover DHODEC handover_decision_2.c:407 (lchan 0.010 TCH/F)->(BTS 0) (subscr IMSI:000001) tch_mode='SPEECH_AMR' type='TCH_F' DHODEC handover_decision_2.c:313 (lchan 0.010 TCH/F) (subscr IMSI:000001) FR3 supported DHODEC handover_decision_2.c:313 (lchan 0.010 TCH/F) (subscr IMSI:000001) HR3 supported DHODEC handover_decision_2.c:489 (lchan 0.010 TCH/F)->(BTS 0) (subscr IMSI:000001) removing TCH/F, already on TCH/F in this cell DHODEC handover_decision_2.c:573 (lchan 0.010 TCH/F)->(BTS 0) (subscr IMSI:000001) TCH/H would not be congested after HO DHODEC handover_decision_2.c:605 (lchan 0.010 TCH/F)->(BTS 0) (subscr IMSI:000001) TCH/H would not be less congested in target than source cell after HO DHODEC handover_decision_2.c:609 (lchan 0.010 TCH/F)->(BTS 0) (subscr IMSI:000001) requirements=0x30 DHODEC handover_decision_2.c:704 - current BTS 0, RX level -110 DHODEC handover_decision_2.c:707 o free TCH/F slots 3, minimum required 0 DHODEC handover_decision_2.c:709 o free TCH/H slots 4, minimum required 0 DHODEC handover_decision_2.c:714 o no requirement fulfilled for TCHF (no assignment possible) DHODEC handover_decision_2.c:737 o requirement A B fulfilled for TCHH (not congested after assignment) DHODEC handover_decision_2.c:407 (lchan 0.010 TCH/F)->(BTS 1) (subscr IMSI:000001) tch_mode='SPEECH_AMR' type='TCH_F' DHODEC handover_decision_2.c:313 (lchan 0.010 TCH/F) (subscr IMSI:000001) FR3 supported DHODEC handover_decision_2.c:313 (lchan 0.010 TCH/F) (subscr IMSI:000001) HR3 supported DHODEC handover_decision_2.c:563 (lchan 0.010 TCH/F)->(BTS 1) (subscr IMSI:000001) TCH/F would not be congested after HO DHODEC handover_decision_2.c:573 (lchan 0.010 TCH/F)->(BTS 1) (subscr IMSI:000001) TCH/H would not be congested after HO DHODEC handover_decision_2.c:595 (lchan 0.010 TCH/F)->(BTS 1) (subscr IMSI:000001) TCH/F would not be less congested in target than source cell after HO DHODEC handover_decision_2.c:605 (lchan 0.010 TCH/F)->(BTS 1) (subscr IMSI:000001) TCH/H would not be less congested in target than source cell after HO DHODEC handover_decision_2.c:609 (lchan 0.010 TCH/F)->(BTS 1) (subscr IMSI:000001) requirements=0x33 DHODEC handover_decision_2.c:701 - neighbor BTS 1, RX level -110 -> -80 DHODEC handover_decision_2.c:707 o free TCH/F slots 4, minimum required 0 DHODEC handover_decision_2.c:709 o free TCH/H slots 4, minimum required 0 DHODEC handover_decision_2.c:712 o requirement A B fulfilled for TCHF (not congested after handover) DHODEC handover_decision_2.c:737 o requirement A B fulfilled for TCHH (not congested after handover) DHODEC handover_decision_2.c:914 (lchan 0.010 TCH/F) (subscr IMSI:000001) adding 2 candidates from 1 neighbors, total 2 DHODEC handover_decision_2.c:1020 (lchan 0.010 TCH/F)->(BTS 1) (subscr IMSI:000001) Best candidate, RX level -80 DHODEC handover_decision_2.c:625 (lchan 0.010 TCH/F)->(BTS 1) (subscr IMSI:000001) Triggering Handover DHODEC handover_decision_2.c:688 (lchan 0.010 TCH/F)->(BTS 1) (subscr IMSI:000001) Triggering handover to TCH/F, due to low rxlevel DHO handover_logic.c:133 (BTS 0 trx 0 ts 1 lchan 0 TCH/F)->(BTS 1 lchan TCH_F) Initiating Handover... DMSC handover_logic.c:135 SUBSCR_CONN[0x612000000520]{ACTIVE}: Received Event HO_START DHODEC handover_logic.c:172 (BTS 0 trx 0 arfcn 870 ts 1 lchan 0 TCH/F)->(BTS 1 trx 0 arfcn 871 ts 1 lchan 0 TCH/F) (subscr IMSI:000001) Triggering Handover ===== After ===== DHODEC handover_decision_2.c:1039 (lchan 0.010 TCH_F SPEECH_AMR) (subscr IMSI:000001) MEASUREMENT REPORT (1 neighbors) DHODEC handover_decision_2.c:1044 (lchan 0.010 TCH_F SPEECH_AMR) (subscr IMSI:000001) 0: arfcn=871 bsic=63 neigh_idx=0 rxlev=30 flags=0 DHODEC handover_decision_2.c:1097 (lchan 0.010 TCH_F SPEECH_AMR) (subscr IMSI:000001) Avg RX level = -110 dBm, +5 dBm AFS bias = -105 dBm; Avg RX quality = -1 (invalid), +0 AFS bias = -1 DHODEC handover_decision_2.c:1122 (lchan 0.010 TCH_F SPEECH_AMR) (subscr IMSI:000001) RX level is TOO LOW: -105 < -100 DHODEC handover_decision_2.c:677 (lchan 0.010 TCH_F SPEECH_AMR)->(BTS 0) (subscr IMSI:000001) RX level -110; TCH/F={free 3 (want 0), [-] not a candidate}; TCH/H={free 4 (want 0), [ABC] good} DHODEC handover_decision_2.c:671 (lchan 0.010 TCH_F SPEECH_AMR)->(BTS 1) (subscr IMSI:000001) RX level -110 -> -80; TCH/F={free 4 (want 0), [ABC] good}; TCH/H={free 4 (want 0), [ABC] good} DHODEC handover_decision_2.c:928 (lchan 0.010 TCH_F SPEECH_AMR)->(BTS 1) (subscr IMSI:000001) Best candidate, RX level -80 DHODEC handover_decision_2.c:641 (lchan 0.010 TCH_F SPEECH_AMR)->(BTS 1) (subscr IMSI:000001) Triggering handover to TCH/F, due to low rxlevel DMSC handover_logic.c:125 SUBSCR_CONN[0x612000000520]{ACTIVE}: Received Event HO_START DHODEC handover_logic.c:169 (BTS 0 trx 0 arfcn 870 ts 1 lchan 0 TCH_F SPEECH_AMR)->(BTS 1 trx 0 arfcn 871 ts 1 lchan 0 TCH/F) (subscr IMSI:000001) Triggering Handover Change-Id: If1add9b57a051d32b67a4a08ab47a9655aa9dd17 --- M include/osmocom/bsc/handover.h M src/osmo-bsc/handover_decision.c M src/osmo-bsc/handover_decision_2.c M src/osmo-bsc/handover_logic.c 4 files changed, 81 insertions(+), 222 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmocom/bsc/handover.h b/include/osmocom/bsc/handover.h index eb03f6a..772ab98 100644 --- a/include/osmocom/bsc/handover.h +++ b/include/osmocom/bsc/handover.h @@ -12,13 +12,14 @@ struct gsm_meas_rep mr; #define LOGPHOLCHANTOLCHAN(old_lchan, new_lchan, level, fmt, args...) \ - LOGP(DHODEC, level, "(BTS %u trx %u arfcn %u ts %u lchan %u %s)->(BTS %u trx %u arfcn %u ts %u lchan %u %s) (subscr %s) " fmt, \ + LOGP(DHODEC, level, "(BTS %u trx %u arfcn %u ts %u lchan %u %s %s)->(BTS %u trx %u arfcn %u ts %u lchan %u %s) (subscr %s) " fmt, \ old_lchan->ts->trx->bts->nr, \ old_lchan->ts->trx->nr, \ old_lchan->ts->trx->arfcn, \ old_lchan->ts->nr, \ old_lchan->nr, \ - gsm_pchan_name(old_lchan->ts->pchan), \ + gsm_lchant_name(old_lchan->type), \ + gsm48_chan_mode_name(old_lchan->tch_mode), \ new_lchan->ts->trx->bts->nr, \ new_lchan->ts->trx->nr, \ new_lchan->ts->trx->arfcn, \ diff --git a/src/osmo-bsc/handover_decision.c b/src/osmo-bsc/handover_decision.c index 887c299..0e79023 100644 --- a/src/osmo-bsc/handover_decision.c +++ b/src/osmo-bsc/handover_decision.c @@ -201,7 +201,10 @@ struct gsm_bts *bts = mr->lchan->ts->trx->bts; struct neigh_meas_proc *best_cell = NULL; unsigned int best_better_db = 0; - int i, rc; + int i; + + if (!ho_get_ho_active(bts->ho)) + return 0; /* find the best cell in this report that is at least RXLEV_HYST * better than the current serving cell */ @@ -231,28 +234,7 @@ if (!best_cell) return 0; - LOGP(DHODEC, LOGL_INFO, "%s: Cell on ARFCN %u is better: ", - gsm_ts_name(mr->lchan->ts), best_cell->arfcn); - if (!ho_get_ho_active(bts->ho)) { - LOGPC(DHODEC, LOGL_INFO, "Skipping, Handover disabled\n"); - return 0; - } - - rc = handover_to_arfcn_bsic(mr->lchan, best_cell->arfcn, best_cell->bsic); - switch (rc) { - case 0: - LOGPC(DHODEC, LOGL_INFO, "Starting handover: meas report number %d \n", mr->nr); - break; - case -ENOSPC: - LOGPC(DHODEC, LOGL_INFO, "No channel available\n"); - break; - case -EBUSY: - LOGPC(DHODEC, LOGL_INFO, "Handover already active\n"); - break; - default: - LOGPC(DHODEC, LOGL_ERROR, "Unknown error\n"); - } - return rc; + return handover_to_arfcn_bsic(mr->lchan, best_cell->arfcn, best_cell->bsic); } /* process an already parsed measurement report and decide if we want to diff --git a/src/osmo-bsc/handover_decision_2.c b/src/osmo-bsc/handover_decision_2.c index 7ac54df..e514b6c 100644 --- a/src/osmo-bsc/handover_decision_2.c +++ b/src/osmo-bsc/handover_decision_2.c @@ -40,22 +40,24 @@ LOGP(DHODEC, level, "(BTS %u) " fmt, bts->nr, ## args) #define LOGPHOLCHAN(lchan, level, fmt, args...) \ - LOGP(DHODEC, level, "(lchan %u.%u%u%u %s) (subscr %s) " fmt, \ + LOGP(DHODEC, level, "(lchan %u.%u%u%u %s %s) (subscr %s) " fmt, \ lchan->ts->trx->bts->nr, \ lchan->ts->trx->nr, \ lchan->ts->nr, \ lchan->nr, \ - gsm_pchan_name(lchan->ts->pchan), \ + gsm_lchant_name(lchan->type), \ + gsm48_chan_mode_name(lchan->tch_mode), \ bsc_subscr_name(lchan->conn? lchan->conn->bsub : NULL), \ ## args) #define LOGPHOLCHANTOBTS(lchan, new_bts, level, fmt, args...) \ - LOGP(DHODEC, level, "(lchan %u.%u%u%u %s)->(BTS %u) (subscr %s) " fmt, \ + LOGP(DHODEC, level, "(lchan %u.%u%u%u %s %s)->(BTS %u) (subscr %s) " fmt, \ lchan->ts->trx->bts->nr, \ lchan->ts->trx->nr, \ lchan->ts->nr, \ lchan->nr, \ - gsm_pchan_name(lchan->ts->pchan), \ + gsm_lchant_name(lchan->type), \ + gsm48_chan_mode_name(lchan->tch_mode), \ new_bts->nr, \ bsc_subscr_name(lchan->conn? lchan->conn->bsub : NULL), \ ## args) @@ -257,13 +259,9 @@ if (mrc) { nmp->rxlev[idx] = mrc->rxlev; nmp->last_seen_nr = mr->nr; - LOGPHOLCHAN(mr->lchan, LOGL_DEBUG, "neigh %u rxlev=%d last_seen_nr=%u\n", - nmp->arfcn, mrc->rxlev, nmp->last_seen_nr); mrc->flags |= MRC_F_PROCESSED; } else { nmp->rxlev[idx] = 0; - LOGPHOLCHAN(mr->lchan, LOGL_DEBUG, "neigh %u not in report (last_seen_nr=%u)\n", - nmp->arfcn, nmp->last_seen_nr); } nmp->rxlev_cnt++; } @@ -308,11 +306,8 @@ } for (i = 0; i < clist->len; i++) { - if (clist->codec[i].type == type) { - LOGPHOLCHAN(conn->lchan, LOGL_DEBUG, "%s supported\n", - gsm0808_speech_codec_type_name(type)); + if (clist->codec[i].type == type) return true; - } } LOGPHOLCHAN(conn->lchan, LOGL_DEBUG, "Codec not supported by MS or not allowed by MSC: %s\n", gsm0808_speech_codec_type_name(type)); @@ -402,10 +397,6 @@ return 0; } - LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "tch_mode='%s' type='%s'\n", - get_value_string(gsm48_chan_mode_names, lchan->tch_mode), - gsm_lchant_name(lchan->type)); - /* compatibility check for codecs. * if so, the candidates for full rate and half rate are selected */ switch (lchan->tch_mode) { @@ -413,9 +404,6 @@ switch (lchan->type) { case GSM_LCHAN_TCH_F: /* mandatory */ requirement |= REQUIREMENT_A_TCHF; - LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "tch_mode='%s' type='%s' supported\n", - get_value_string(gsm48_chan_mode_names, lchan->tch_mode), - gsm_lchant_name(lchan->type)); break; case GSM_LCHAN_TCH_H: if (!bts->codec.hr) { @@ -485,13 +473,9 @@ if (bts == current_bts) { switch (lchan->type) { case GSM_LCHAN_TCH_F: - LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, - "removing TCH/F, already on TCH/F in this cell\n"); requirement &= ~(REQUIREMENT_A_TCHF); break; case GSM_LCHAN_TCH_H: - LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, - "removing TCH/H, already on TCH/H in this cell\n"); requirement &= ~(REQUIREMENT_A_TCHH); break; default: @@ -558,24 +542,12 @@ /* the minimum free timeslots that are defined for this cell must * be maintained _after_ handover/assignment */ if (requirement & REQUIREMENT_A_TCHF) { - if (tchf_count - 1 >= ho_get_hodec2_tchf_min_slots(bts->ho)) { - LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, - "TCH/F would not be congested after HO\n"); + if (tchf_count - 1 >= ho_get_hodec2_tchf_min_slots(bts->ho)) requirement |= REQUIREMENT_B_TCHF; - } else { - LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, - "TCH/F would be congested after HO\n"); - } } if (requirement & REQUIREMENT_A_TCHH) { - if (tchh_count - 1 >= ho_get_hodec2_tchh_min_slots(bts->ho)) { - LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, - "TCH/H would not be congested after HO\n"); + if (tchh_count - 1 >= ho_get_hodec2_tchh_min_slots(bts->ho)) requirement |= REQUIREMENT_B_TCHH; - } else { - LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, - "TCH/H would be congested after HO\n"); - } } /* Requirement C */ @@ -584,30 +556,16 @@ * free slots of the current cell _after_ handover/assignment */ count = bts_count_free_ts(current_bts, (lchan->type == GSM_LCHAN_TCH_H) ? - GSM_PCHAN_TCH_H : GSM_PCHAN_TCH_F); + GSM_PCHAN_TCH_H : GSM_PCHAN_TCH_F); if (requirement & REQUIREMENT_A_TCHF) { - if (tchf_count - 1 >= count + 1) { - LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, - "TCH/F would be less congested in target than source cell after HO\n"); + if (tchf_count - 1 >= count + 1) requirement |= REQUIREMENT_C_TCHF; - } else { - LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, - "TCH/F would not be less congested in target than source cell after HO\n"); - } } if (requirement & REQUIREMENT_A_TCHH) { - if (tchh_count - 1 >= count + 1) { - LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, - "TCH/H would be less congested in target than source cell after HO\n"); + if (tchh_count - 1 >= count + 1) requirement |= REQUIREMENT_C_TCHH; - } else { - LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, - "TCH/H would not be less congested in target than source cell after HO\n"); - } } - LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "requirements=0x%x\n", requirement); - /* return mask of fulfilled requirements */ return requirement; } @@ -619,11 +577,6 @@ int afs_bias = 0; bool full_rate = false; - if (current_bts == new_bts) - LOGPHOLCHAN(lchan, LOGL_NOTICE, "Triggering Assignment\n"); - else - LOGPHOLCHANTOBTS(lchan, new_bts, LOGL_NOTICE, "Triggering Handover\n"); - /* afs_bias becomes > 0, if AFS is used and is improved */ if (lchan->tch_mode == GSM48_CMODE_SPEECH_AMR) afs_bias = ho_get_hodec2_afs_bias_rxlev(new_bts->ho); @@ -682,7 +635,7 @@ full_rate ? "TCH/F" : "TCH/H", ho_reason_name(global_ho_reason)); else - LOGPHOLCHANTOBTS(lchan, new_bts, LOGL_NOTICE, + LOGPHOLCHANTOBTS(lchan, new_bts, LOGL_INFO, "Triggering handover to %s, due to %s\n", full_rate ? "TCH/F" : "TCH/H", ho_reason_name(global_ho_reason)); @@ -692,71 +645,36 @@ } /* debug collected candidates */ -static inline void debug_candidate(struct ho_candidate *candidate, - int neighbor, int8_t rxlev, int tchf_count, int tchh_count) +static inline void debug_candidate(struct gsm_lchan *lchan, struct ho_candidate *candidate, + struct gsm_bts *neighbor, int8_t rxlev, int tchf_count, int tchh_count) { +#define HO_CANDIDATE_FMT(tchx, TCHX) "TCH/" #TCHX "={free %d (want %d), [%s%s%s]%s}" +#define HO_CANDIDATE_ARGS(tchx, TCHX) \ + tch##tchx##_count, ho_get_hodec2_tch##tchx##_min_slots(candidate->bts->ho), \ + candidate->requirements & REQUIREMENT_A_TCH##TCHX ? "A" : \ + (candidate->requirements & REQUIREMENT_TCH##TCHX##_MASK) == 0? "-" : "", \ + candidate->requirements & REQUIREMENT_B_TCH##TCHX ? "B" : "", \ + candidate->requirements & REQUIREMENT_B_TCH##TCHX ? "C" : "", \ + (candidate->requirements & REQUIREMENT_TCH##TCHX##_MASK) == 0 ? " not a candidate" : \ + ((candidate->requirements & REQUIREMENT_TCH##TCHX##_MASK) == REQUIREMENT_A_TCH##TCHX ? \ + " more congestion" : \ + (candidate->requirements & REQUIREMENT_B_TCH##TCHX ? \ + " good" : \ + /* now has to be candidate->requirements & REQUIREMENT_C_TCHX != 0: */ \ + " less-or-equal congestion")) + if (neighbor) - LOGP(DHODEC, LOGL_DEBUG, " - neighbor BTS %d, RX level " - "%d -> %d\n", candidate->bts->nr, rxlev2dbm(rxlev), - rxlev2dbm(candidate->avg)); + LOGPHOLCHANTOBTS(lchan, neighbor, LOGL_DEBUG, + "RX level %d -> %d; " + HO_CANDIDATE_FMT(f, F) "; " HO_CANDIDATE_FMT(h, H) "\n", + rxlev2dbm(rxlev), rxlev2dbm(candidate->avg), + HO_CANDIDATE_ARGS(f, F), HO_CANDIDATE_ARGS(h, H)); else - LOGP(DHODEC, LOGL_DEBUG, " - current BTS %d, RX level %d\n", - candidate->bts->nr, rxlev2dbm(candidate->avg)); - - LOGP(DHODEC, LOGL_DEBUG, " o free TCH/F slots %d, minimum required " - "%d\n", tchf_count, ho_get_hodec2_tchf_min_slots(candidate->bts->ho)); - LOGP(DHODEC, LOGL_DEBUG, " o free TCH/H slots %d, minimum required " - "%d\n", tchh_count, ho_get_hodec2_tchh_min_slots(candidate->bts->ho)); - - if ((candidate->requirements & REQUIREMENT_TCHF_MASK)) - LOGP(DHODEC, LOGL_DEBUG, " o requirement "); - else - LOGP(DHODEC, LOGL_DEBUG, " o no requirement "); - if ((candidate->requirements & REQUIREMENT_A_TCHF)) - LOGPC(DHODEC, LOGL_DEBUG, "A "); - if ((candidate->requirements & REQUIREMENT_B_TCHF)) - LOGPC(DHODEC, LOGL_DEBUG, "B "); - if ((candidate->requirements & REQUIREMENT_C_TCHF)) - LOGPC(DHODEC, LOGL_DEBUG, "C "); - LOGPC(DHODEC, LOGL_DEBUG, "fulfilled for TCHF"); - if (!(candidate->requirements & REQUIREMENT_TCHF_MASK)) /* nothing */ - LOGPC(DHODEC, LOGL_DEBUG, " (no %s possible)\n", - (neighbor) ? "handover" : "assignment"); - else if ((candidate->requirements & REQUIREMENT_TCHF_MASK) - == REQUIREMENT_A_TCHF) /* only A */ - LOGPC(DHODEC, LOGL_DEBUG, " (more congestion after %s)\n", - (neighbor) ? "handover" : "assignment"); - else if ((candidate->requirements & REQUIREMENT_B_TCHF)) /* B incl. */ - LOGPC(DHODEC, LOGL_DEBUG, " (not congested after %s)\n", - (neighbor) ? "handover" : "assignment"); - else /* so it must include C */ - LOGPC(DHODEC, LOGL_DEBUG, " (less or equally congested after " - "%s)\n", (neighbor) ? "handover" : "assignment"); - - if ((candidate->requirements & REQUIREMENT_TCHH_MASK)) - LOGP(DHODEC, LOGL_DEBUG, " o requirement "); - else - LOGP(DHODEC, LOGL_DEBUG, " o no requirement "); - if ((candidate->requirements & REQUIREMENT_A_TCHH)) - LOGPC(DHODEC, LOGL_DEBUG, "A "); - if ((candidate->requirements & REQUIREMENT_B_TCHH)) - LOGPC(DHODEC, LOGL_DEBUG, "B "); - if ((candidate->requirements & REQUIREMENT_C_TCHH)) - LOGPC(DHODEC, LOGL_DEBUG, "C "); - LOGPC(DHODEC, LOGL_DEBUG, "fulfilled for TCHH"); - if (!(candidate->requirements & REQUIREMENT_TCHH_MASK)) /* nothing */ - LOGPC(DHODEC, LOGL_DEBUG, " (no %s possible)\n", - (neighbor) ? "handover" : "assignment"); - else if ((candidate->requirements & REQUIREMENT_TCHH_MASK) - == REQUIREMENT_A_TCHH) /* only A */ - LOGPC(DHODEC, LOGL_DEBUG, " (more congestion after %s)\n", - (neighbor) ? "handover" : "assignment"); - else if ((candidate->requirements & REQUIREMENT_B_TCHH)) /* B incl. */ - LOGPC(DHODEC, LOGL_DEBUG, " (not congested after %s)\n", - (neighbor) ? "handover" : "assignment"); - else /* so it must include C */ - LOGPC(DHODEC, LOGL_DEBUG, " (less or equally congested after " - "%s)\n", (neighbor) ? "handover" : "assignment"); + LOGPHOLCHANTOBTS(lchan, lchan->ts->trx->bts, LOGL_DEBUG, + "RX level %d; " + HO_CANDIDATE_FMT(f, F) "; " HO_CANDIDATE_FMT(h, H) "\n", + rxlev2dbm(candidate->avg), + HO_CANDIDATE_ARGS(f, F), HO_CANDIDATE_ARGS(h, H)); } /* add candidate for re-assignment within the current cell */ @@ -775,7 +693,7 @@ c->bts = bts; c->requirements = check_requirements(lchan, bts, tchf_count, tchh_count); c->avg = av_rxlev; - debug_candidate(c, 0, 0, tchf_count, tchh_count); + debug_candidate(lchan, c, NULL, 0, tchf_count, tchh_count); (*candidates)++; } @@ -855,7 +773,7 @@ c->requirements = check_requirements(lchan, neighbor_bts, tchf_count, tchh_count); c->avg = avg; - debug_candidate(c, 1, av_rxlev, tchf_count, tchh_count); + debug_candidate(lchan, c, neighbor_bts, av_rxlev, tchf_count, tchh_count); (*candidates)++; } @@ -865,14 +783,12 @@ { struct gsm_bts *bts = lchan->ts->trx->bts; int av_rxlev; - unsigned int candidates_was; bool assignment; bool handover; int neighbors_count = 0; unsigned int rxlev_avg_win = ho_get_hodec2_rxlev_avg_win(bts->ho); OSMO_ASSERT(candidates); - candidates_was = *candidates; /* caculate average rxlev for this cell over the window */ av_rxlev = get_meas_rep_avg(lchan, @@ -893,11 +809,6 @@ assignment = ho_get_hodec2_as_active(bts->ho); handover = ho_get_ho_active(bts->ho); - LOGPHOLCHAN(lchan, LOGL_DEBUG, "Collecting candidates for%s%s%s\n", - assignment ? " Assignment" : "", - assignment && handover ? " and" : "", - handover ? " Handover" : ""); - if (assignment) collect_assignment_candidate(lchan, clist, candidates, av_rxlev); @@ -909,9 +820,6 @@ include_weaker_rxlev, av_rxlev, &neighbors_count); } } - - LOGPHOLCHAN(lchan, LOGL_DEBUG, "adding %u candidates from %u neighbors, total %u\n", - *candidates - candidates_was, neighbors_count, *candidates); } /* @@ -1155,8 +1063,6 @@ return; } - LOGPHOLCHAN(lchan, LOGL_DEBUG, "HODEC2: evaluating measurement report\n"); - /* get average levels. if not enought measurements yet, value is < 0 */ av_rxlev = get_meas_rep_avg(lchan, ho_get_hodec2_full_tdma(bts->ho) ? @@ -1170,34 +1076,29 @@ LOGPHOLCHAN(lchan, LOGL_INFO, "Skipping, Not enough recent measurements\n"); return; } - if (av_rxlev >= 0) { - LOGPHOLCHAN(lchan, LOGL_DEBUG, "Measurement report: average RX level = %d\n", - rxlev2dbm(av_rxlev)); - } - if (av_rxqual >= 0) { - LOGPHOLCHAN(lchan, LOGL_DEBUG, "Measurement report: average RX quality = %d\n", - av_rxqual); - } /* improve levels in case of AFS, if defined */ if (lchan->type == GSM_LCHAN_TCH_F && lchan->tch_mode == GSM48_CMODE_SPEECH_AMR) { + int av_rxlev_was = av_rxlev; + int av_rxqual_was = av_rxqual; int rxlev_bias = ho_get_hodec2_afs_bias_rxlev(bts->ho); int rxqual_bias = ho_get_hodec2_afs_bias_rxqual(bts->ho); - if (av_rxlev >= 0 && rxlev_bias) { - int imp = av_rxlev + rxlev_bias; - LOGPHOLCHAN(lchan, LOGL_INFO, "Virtually improving RX level from %d to %d," - " due to AFS bias\n", rxlev2dbm(av_rxlev), rxlev2dbm(imp)); - av_rxlev = imp; - } - if (av_rxqual >= 0 && rxqual_bias) { - int imp = av_rxqual - rxqual_bias; - if (imp < 0) - imp = 0; - LOGPHOLCHAN(lchan, LOGL_INFO, "Virtually improving RX quality from %d to %d," - " due to AFS bias\n", rxlev2dbm(av_rxqual), rxlev2dbm(imp)); - av_rxqual = imp; - } + if (av_rxlev >= 0) + av_rxlev = av_rxlev + rxlev_bias; + if (av_rxqual >= 0) + av_rxqual = OSMO_MAX(0, av_rxqual - rxqual_bias); + + LOGPHOLCHAN(lchan, LOGL_DEBUG, + "Avg RX level = %d dBm, %+d dBm AFS bias = %d dBm;" + " Avg RX quality = %d%s, %+d AFS bias = %d\n", + rxlev2dbm(av_rxlev_was), rxlev_bias, rxlev2dbm(av_rxlev), + OSMO_MAX(-1, av_rxqual_was), av_rxqual_was < 0 ? " (invalid)" : "", + -rxqual_bias, OSMO_MAX(-1, av_rxqual)); + } else { + LOGPHOLCHAN(lchan, LOGL_DEBUG, "Avg RX level = %d dBm; Avg RX quality = %d%s\n", + rxlev2dbm(av_rxlev), + OSMO_MAX(-1, av_rxqual), av_rxqual < 0 ? " (invalid)" : ""); } /* Bad Quality */ @@ -1217,7 +1118,8 @@ /* Low Level */ if (av_rxlev >= 0 && rxlev2dbm(av_rxlev) < ho_get_hodec2_min_rxlev(bts->ho)) { global_ho_reason = HO_REASON_LOW_RXLEVEL; - LOGPHOLCHAN(lchan, LOGL_INFO, "Attempting handover/assignment due to low rxlev\n"); + LOGPHOLCHAN(lchan, LOGL_NOTICE, "RX level is TOO LOW: %d < %d\n", + rxlev2dbm(av_rxlev), ho_get_hodec2_min_rxlev(bts->ho)); find_alternative_lchan(lchan, true); return; } @@ -1226,7 +1128,8 @@ if (lchan->meas_rep_count > 0 && lchan->rqd_ta > ho_get_hodec2_max_distance(bts->ho)) { global_ho_reason = HO_REASON_MAX_DISTANCE; - LOGPHOLCHAN(lchan, LOGL_INFO, "Attempting handover due to high TA\n"); + LOGPHOLCHAN(lchan, LOGL_NOTICE, "TA is TOO HIGH: %u > %d\n", + lchan->rqd_ta, ho_get_hodec2_max_distance(bts->ho)); /* start penalty timer to prevent comming back too * early. it must be started before selecting a better cell, * so there is no assignment selected, due to running @@ -1242,7 +1145,6 @@ /* try handover to a better cell */ if (av_rxlev >= 0 && (mr->nr % pwr_interval) == 0) { - LOGPHOLCHAN(lchan, LOGL_INFO, "Looking whether a cell has better RXLEV\n"); global_ho_reason = HO_REASON_BETTER_CELL; find_alternative_lchan(lchan, false); } @@ -1439,12 +1341,10 @@ /* perform handover, if there is a candidate */ if (best_cand) { any_ho = 1; - LOGPHOLCHAN(best_cand->lchan, LOGL_INFO, - "Best candidate BTS %u (RX level %d) without congestion found\n", - best_cand->bts->nr, rxlev2dbm(best_cand->avg)); - if (is_improved) - LOGP(DHODEC, LOGL_INFO, "(is improved due to " - "AHS -> AFS)\n"); + LOGPHOLCHAN(best_cand->lchan, LOGL_DEBUG, + "Best candidate BTS %u (RX level %d%s) without congestion found\n", + best_cand->bts->nr, rxlev2dbm(best_cand->avg), + is_improved ? ", RX quality improved by AHS->AFS" : ""); trigger_handover_or_assignment(best_cand->lchan, best_cand->bts, best_cand->requirements & REQUIREMENT_B_MASK); #if 0 @@ -1468,9 +1368,6 @@ goto exit; } - LOGPHOBTS(bts, LOGL_DEBUG, "Did not find a best candidate that fulfills requirement B" - " (omitting change from AHS to AFS)\n"); - #if 0 next_b2: #endif @@ -1504,8 +1401,6 @@ is_improved = 1; } else is_improved = 0; - LOGP(DHODEC, LOGL_DEBUG, "candidate %d: avg=%d worst_avg_db=%d\n", i, avg, - worst_avg_db); if (avg < worst_avg_db) { worst_cand = &clist[i]; worst_avg_db = avg; @@ -1517,11 +1412,9 @@ if (worst_cand) { any_ho = 1; LOGP(DHODEC, LOGL_INFO, "Worst candidate for assignment " - "(RX level %d) from TCH/H -> TCH/F without congestion " - "found\n", rxlev2dbm(worst_cand->avg)); - if (is_improved) - LOGP(DHODEC, LOGL_INFO, "(is improved due to " - "AHS -> AFS)\n"); + "(RX level %d%s) from TCH/H -> TCH/F without congestion " + "found\n", rxlev2dbm(worst_cand->avg), + is_improved ? ", RX quality improved by AHS->AFS" : ""); trigger_handover_or_assignment(worst_cand->lchan, worst_cand->bts, worst_cand->requirements & REQUIREMENT_B_MASK); @@ -1543,9 +1436,6 @@ goto exit; } - LOGPHOBTS(bts, LOGL_DEBUG, "Did not find a worst candidate that fulfills requirement B," - " selecting candidates that change from AHS to AFS only\n"); - #if 0 next_c1: #endif @@ -1584,7 +1474,6 @@ is_improved = 1; } else is_improved = 0; - LOGP(DHODEC, LOGL_DEBUG, "candidate %d: avg=%d best_avg_db=%d\n", i, avg, best_avg_db); if (avg > best_avg_db) { best_cand = &clist[i]; best_avg_db = avg; @@ -1672,11 +1561,9 @@ if (worst_cand) { any_ho = 1; LOGP(DHODEC, LOGL_INFO, "Worst candidate for assignment " - "(RX level %d) from TCH/H -> TCH/F with less or equal " - "congestion found\n", rxlev2dbm(worst_cand->avg)); - if (is_improved) - LOGP(DHODEC, LOGL_INFO, "(is improved due to " - "AHS -> AFS)\n"); + "(RX level %d%s) from TCH/H -> TCH/F with less or equal " + "congestion found\n", rxlev2dbm(worst_cand->avg), + is_improved ? ", RX quality improved by AHS->AFS" : ""); trigger_handover_or_assignment(worst_cand->lchan, worst_cand->bts, worst_cand->requirements & REQUIREMENT_C_MASK); diff --git a/src/osmo-bsc/handover_logic.c b/src/osmo-bsc/handover_logic.c index 064615c..509de53 100644 --- a/src/osmo-bsc/handover_logic.c +++ b/src/osmo-bsc/handover_logic.c @@ -122,17 +122,6 @@ llist_add(&ho->list, &bsc_handovers); conn->ho = ho; - - DEBUGP(DHO, "(BTS %u trx %u ts %u lchan %u %s)->(BTS %u lchan %s) Initiating %s...\n", - old_lchan->ts->trx->bts->nr, - old_lchan->ts->trx->nr, - old_lchan->ts->nr, - old_lchan->nr, - gsm_pchan_name(old_lchan->ts->pchan), - new_bts->nr, - gsm_lchant_name(new_lchan_type), - do_assignment ? "Assignment" : "Handover"); - rc = osmo_fsm_inst_dispatch(conn->fi, GSCON_EV_HO_START, NULL); if (rc < 0) { -- To view, visit https://gerrit.osmocom.org/10058 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: If1add9b57a051d32b67a4a08ab47a9655aa9dd17 Gerrit-Change-Number: 10058 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 01:12:20 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Jul 2018 01:12:20 +0000 Subject: Change in osmo-bsc[master]: inter-BSC HO: add neighbor_ident API to manage neighbor-BSS-cells In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9666 ) Change subject: inter-BSC HO: add neighbor_ident API to manage neighbor-BSS-cells ...................................................................... Patch Set 12: (1 comment) still need to resolve the 0x8000 ARFCN bit question... https://gerrit.osmocom.org/#/c/9666/3/tests/handover/neighbor_ident_test.c File tests/handover/neighbor_ident_test.c: https://gerrit.osmocom.org/#/c/9666/3/tests/handover/neighbor_ident_test.c at 33 PS3, Line 33: arfcn > In turn I'm not fully understanding yet where the pitfall lies in that. [?] In the C API to neighbor_ident, the high bit should be handled transparently. But I notice that in the VTY we are limiting ARFCN args to <0-1023>. Should we set 0x8000 depending on the band the BTS operates on, and if yes, also in the user visible interface, or is it possible to derive it interally? -- To view, visit https://gerrit.osmocom.org/9666 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0153d7069817fba9146ddc11214de2757d7d37bf Gerrit-Change-Number: 9666 Gerrit-PatchSet: 12 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Mon, 23 Jul 2018 01:12:20 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 01:12:57 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Jul 2018 01:12:57 +0000 Subject: Change in osmo-bsc[master]: doc: update/fix FSM charts In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9667 ) Change subject: doc: update/fix FSM charts ...................................................................... Patch Set 12: all .dot and .msc charts now accurately reflect the branch tip of neels/inter_bsc_ho -- To view, visit https://gerrit.osmocom.org/9667 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I29e31b753e23a4207662e0e385a337e7df836f45 Gerrit-Change-Number: 9667 Gerrit-PatchSet: 12 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Mon, 23 Jul 2018 01:12:57 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 01:14:54 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Jul 2018 01:14:54 +0000 Subject: Change in osmo-bsc[master]: move RSL and RR related functions to abis_rsl.[hc] In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9669 ) Change subject: move RSL and RR related functions to abis_rsl.[hc] ...................................................................... Patch Set 12: missed this one -- To view, visit https://gerrit.osmocom.org/9669 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie8ee334145bf7bc3a601d395ea7ab9b2009b61c7 Gerrit-Change-Number: 9669 Gerrit-PatchSet: 12 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte Gerrit-Comment-Date: Mon, 23 Jul 2018 01:14:54 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 01:40:25 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Jul 2018 01:40:25 +0000 Subject: Change in osmo-bsc[master]: move RSL and RR related functions to abis_rsl.[hc] In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9669 ) Change subject: move RSL and RR related functions to abis_rsl.[hc] ...................................................................... Patch Set 12: Rationale: gsm_04_08_utils.c and bsc_api.c contain functions that rx/tx messages over Abis RSL. Some small programs/tests that pull in gsm_04_08_utils.c then pull in the entire Abis dependencies. Looking at it again, the functions of 04_08_utils.c used elsewhere than abis_rsl.c are: gsm_net_update_ctype() in bsc_vty.c, bsc_init.c gsm48_create_loc_upd_rej() in osmo_bsc_api.c gsm48_multirate_config() in osmo_bsc_api.c gsm48_extract_mi() in bsc_msg_filter.c gsm48_paging_extract_mi() in osmo_bsc_api.c and bsc_msg_filter.c str_to_imsi() in pcu_sock.c, paging.c, bsc_vty.c (weird dependency example: msg_filter test needing Abis RSL, ...) Maybe it makes more sense to move some of those out. I think "_utils" still is a misnomer for the central Abis RR implementation, could become abis_rr.c, but we don't really need to rename the file. Then there is bsc_api.c, that appears to have been a kitchen sink for everything and anything. We removed struct bsc_api already. Do we agree on moving bsc_api.c's RR functions? If gsm_04_08_utils.c is the main "RR" file, then maybe handle_rr_ho_*() and gsm_04_08_rcvmsg should move from bsc_api.c to gsm_04_08_utils.c instead of abis_rsl.c? (The only functions left in bsc_api.c are gsm0808_page() and gsm0808_cipher_mode(), maybe they can move to the callers, paging.c and osmo_bsc_bssap.c, to completely drop bsc_api.c) -- To view, visit https://gerrit.osmocom.org/9669 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie8ee334145bf7bc3a601d395ea7ab9b2009b61c7 Gerrit-Change-Number: 9669 Gerrit-PatchSet: 12 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte Gerrit-Comment-Date: Mon, 23 Jul 2018 01:40:25 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 01:42:02 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Jul 2018 01:42:02 +0000 Subject: Change in osmo-bsc[master]: add gsm_timers, for Tnnn definitions usable by FSMs In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9670 ) Change subject: add gsm_timers, for Tnnn definitions usable by FSMs ...................................................................... Patch Set 12: Code-Review+2 (+2 twice already, save others the review time by re-adding.) -- To view, visit https://gerrit.osmocom.org/9670 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If212fcd042051b6fa53484254223614c5b93a9c6 Gerrit-Change-Number: 9670 Gerrit-PatchSet: 12 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Mon, 23 Jul 2018 01:42:02 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 01:43:19 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Jul 2018 01:43:19 +0000 Subject: Change in pysim[master]: readme: add 'serial' dep, cosmetically rearrange In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10051 ) Change subject: readme: add 'serial' dep, cosmetically rearrange ...................................................................... Patch Set 2: Verified+1 "I verified the README" :P -- To view, visit https://gerrit.osmocom.org/10051 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I414b897ba4911b7428ddf807cb04a93700ee0193 Gerrit-Change-Number: 10051 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-Comment-Date: Mon, 23 Jul 2018 01:43:19 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 01:44:32 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Jul 2018 01:44:32 +0000 Subject: Change in pysim[master]: cards: Add support for Wavemobile SIM In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10047 ) Change subject: cards: Add support for Wavemobile SIM ...................................................................... Patch Set 2: @dexter, apparently no-one is going to verify it, maybe give it your own V+1? -- To view, visit https://gerrit.osmocom.org/10047 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ida3f37bd6e3ac995812aeddc9770f1ccd54ecf3f Gerrit-Change-Number: 10047 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-CC: Neels Hofmeyr Gerrit-Comment-Date: Mon, 23 Jul 2018 01:44:32 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 01:45:16 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Jul 2018 01:45:16 +0000 Subject: Change in osmo-ttcn3-hacks[master]: bsc: fix f_gen_ass_req(): populate codec list In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. ( https://gerrit.osmocom.org/9998 ) Change subject: bsc: fix f_gen_ass_req(): populate codec list ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/9998 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: Ia18e44e93b0328ad26d741a3317753118fc57f9f Gerrit-Change-Number: 9998 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 01:45:57 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Jul 2018 01:45:57 +0000 Subject: Change in osmo-bsc[master]: various logging: fix missing/extra newlines In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10059 ) Change subject: various logging: fix missing/extra newlines ...................................................................... various logging: fix missing/extra newlines Change-Id: Id2619d0d45eb2686246c03643b4a578392a54cfe --- M src/libfilter/bsc_msg_acc.c M src/osmo-bsc/abis_nm.c M src/osmo-bsc/abis_rsl.c M src/osmo-bsc/handover_decision_2.c M src/osmo-bsc/system_information.c 5 files changed, 9 insertions(+), 9 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/libfilter/bsc_msg_acc.c b/src/libfilter/bsc_msg_acc.c index 46077b3..de6c4d9 100644 --- a/src/libfilter/bsc_msg_acc.c +++ b/src/libfilter/bsc_msg_acc.c @@ -96,7 +96,7 @@ lst = talloc_zero(ctx, struct bsc_msg_acc_lst); if (!lst) { - LOGP(DNAT, LOGL_ERROR, "Failed to allocate access list"); + LOGP(DNAT, LOGL_ERROR, "Failed to allocate access list\n"); return NULL; } diff --git a/src/osmo-bsc/abis_nm.c b/src/osmo-bsc/abis_nm.c index cb1cc56..d056bc4 100644 --- a/src/osmo-bsc/abis_nm.c +++ b/src/osmo-bsc/abis_nm.c @@ -1214,11 +1214,11 @@ /* go back to the start as we checked the whole filesize.. */ lseek(sw->fd, 0l, SEEK_SET); - LOGP(DNM, LOGL_NOTICE, "The ipaccess SDP header is not fully understood.\n" - "There might be checksums in the file that are not\n" - "verified and incomplete firmware might be flashed.\n" - "There is absolutely no WARRANTY that flashing will\n" - "work.\n"); + LOGP(DNM, LOGL_NOTICE, "The ipaccess SDP header is not fully understood." + " There might be checksums in the file that are not" + " verified and incomplete firmware might be flashed." + " There is absolutely no WARRANTY that flashing will" + " work.\n"); return 0; } diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c index ab3658d..bcc56bc 100644 --- a/src/osmo-bsc/abis_rsl.c +++ b/src/osmo-bsc/abis_rsl.c @@ -2351,7 +2351,7 @@ break; } LOGP(DRSL, LOGL_ERROR, "Cannot determine ip.access rtp payload type for " - "tch_mode == 0x%02x\n & lchan_type == %d", + "tch_mode == 0x%02x & lchan_type == %d\n", lchan->tch_mode, lchan->type); return 0; } diff --git a/src/osmo-bsc/handover_decision_2.c b/src/osmo-bsc/handover_decision_2.c index e514b6c..826dcaa 100644 --- a/src/osmo-bsc/handover_decision_2.c +++ b/src/osmo-bsc/handover_decision_2.c @@ -1680,7 +1680,7 @@ struct gsm_subscriber_connection *conn = ho->old_lchan->conn; if (!conn) { - LOGPHO(ho, LOGL_ERROR, "HO failure, but no conn"); + LOGPHO(ho, LOGL_ERROR, "HO failure, but no conn\n"); return; } diff --git a/src/osmo-bsc/system_information.c b/src/osmo-bsc/system_information.c index d99153f..f810f52 100644 --- a/src/osmo-bsc/system_information.c +++ b/src/osmo-bsc/system_information.c @@ -556,7 +556,7 @@ return 0; LOGP(DRR, LOGL_ERROR, "min_arfcn=%u, max_arfcn=%u, arfcns=%d " - "can not generate ARFCN list", min, max, arfcns); + "can not generate ARFCN list\n", min, max, arfcns); return -EINVAL; } -- To view, visit https://gerrit.osmocom.org/10059 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Id2619d0d45eb2686246c03643b4a578392a54cfe Gerrit-Change-Number: 10059 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 07:29:28 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 23 Jul 2018 07:29:28 +0000 Subject: Change in pysim[master]: cards: Add support for Wavemobile SIM In-Reply-To: References: Message-ID: dexter has posted comments on this change. ( https://gerrit.osmocom.org/10047 ) Change subject: cards: Add support for Wavemobile SIM ...................................................................... Patch Set 2: > @dexter, apparently no-one is going to verify it, maybe give it > your own V+1? I can do this, but lets wait until I get feedback from wavemobile. They are currently trying it. -- To view, visit https://gerrit.osmocom.org/10047 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ida3f37bd6e3ac995812aeddc9770f1ccd54ecf3f Gerrit-Change-Number: 10047 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: dexter Gerrit-CC: Neels Hofmeyr Gerrit-Comment-Date: Mon, 23 Jul 2018 07:29:28 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 07:31:33 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 23 Jul 2018 07:31:33 +0000 Subject: Change in osmo-mgw[master]: protocol: prevent unnecessary null pointer deref In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. ( https://gerrit.osmocom.org/10055 ) Change subject: protocol: prevent unnecessary null pointer deref ...................................................................... protocol: prevent unnecessary null pointer deref The function setup_rtp_processing() in mgcp_protocol.c executes a function pointer setup_rtp_processing_cb(). The function pointer gets two struct mgcp_rtp_end pointers as parameter. To get those parameters it has to dereference them from struct mgcp_conn_rtp pointers. The variable conn_src is such a struct pointer and there are conditions where this pointer may be NULL. The function at the function pointer should get the conn pointers directly instead of the dereferenced end (rtp) pointers. This also gives additional flexibility to the implementation behind the function pointer, which is not yet defined (the function pointer points always to a stub function since we donot support transcoding yet. - give conn pointers directly to setup_rtp_processing_cb() insed of dereferencing conn_src->end Change-Id: Id46e9bfba88613387026639eb4957221cce6820a Closes OS#3406 --- M include/osmocom/mgcp/mgcp.h M include/osmocom/mgcp/mgcp_internal.h M src/libosmo-mgcp/mgcp_network.c M src/libosmo-mgcp/mgcp_protocol.c 4 files changed, 12 insertions(+), 11 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h index bdc8f87..bdc86fc 100644 --- a/include/osmocom/mgcp/mgcp.h +++ b/include/osmocom/mgcp/mgcp.h @@ -74,11 +74,13 @@ typedef int (*mgcp_processing)(struct mgcp_endpoint *endp, struct mgcp_rtp_end *dst_end, char *data, int *len, int buf_size); -typedef int (*mgcp_processing_setup)(struct mgcp_endpoint *endp, - struct mgcp_rtp_end *dst_end, - struct mgcp_rtp_end *src_end); struct mgcp_conn_rtp; + +typedef int (*mgcp_processing_setup)(struct mgcp_endpoint *endp, + struct mgcp_conn_rtp *conn_dst, + struct mgcp_conn_rtp *conn_src); + typedef void (*mgcp_get_format)(struct mgcp_endpoint *endp, int *payload_type, const char**subtype_name, diff --git a/include/osmocom/mgcp/mgcp_internal.h b/include/osmocom/mgcp/mgcp_internal.h index 38b687c..06883dd 100644 --- a/include/osmocom/mgcp/mgcp_internal.h +++ b/include/osmocom/mgcp/mgcp_internal.h @@ -290,8 +290,8 @@ char *data, int *len, int buf_size); int mgcp_setup_rtp_processing_default(struct mgcp_endpoint *endp, - struct mgcp_rtp_end *dst_end, - struct mgcp_rtp_end *src_end); + struct mgcp_conn_rtp *conn_dst, + struct mgcp_conn_rtp *conn_src); void mgcp_get_net_downlink_format_default(struct mgcp_endpoint *endp, int *payload_type, diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c index 494156d..870a4de 100644 --- a/src/libosmo-mgcp/mgcp_network.c +++ b/src/libosmo-mgcp/mgcp_network.c @@ -399,12 +399,12 @@ /*! dummy callback to disable transcoding (see also cfg->setup_rtp_processing_cb). * \param[in] associated endpoint - * \param[in] destination RTP end - * \param[in] source RTP end + * \param[in] destination RTP connnection + * \param[in] source RTP connection * \returns ignores input parameters, return always 0 */ int mgcp_setup_rtp_processing_default(struct mgcp_endpoint *endp, - struct mgcp_rtp_end *dst_end, - struct mgcp_rtp_end *src_end) + struct mgcp_conn_rtp *conn_dst, + struct mgcp_conn_rtp *conn_src) { LOGP(DRTP, LOGL_DEBUG, "endpoint:0x%x transcoding disabled\n", ENDPOINT_NUMBER(endp)); diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index eea67a6..ea80907 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -89,8 +89,7 @@ } } - return cfg->setup_rtp_processing_cb(endp, &conn_dst->end, - &conn_src->end); + return cfg->setup_rtp_processing_cb(endp, conn_dst, conn_src); } /* array of function pointers for handling various -- To view, visit https://gerrit.osmocom.org/10055 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Id46e9bfba88613387026639eb4957221cce6820a Gerrit-Change-Number: 10055 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 07:51:40 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 23 Jul 2018 07:51:40 +0000 Subject: Change in osmo-bsc[master]: lcls: do not LCLS call legs with different codecs In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9940 to look at the new patch set (#3). Change subject: lcls: do not LCLS call legs with different codecs ...................................................................... lcls: do not LCLS call legs with different codecs It is theoretically possible to LCLS two legs that use different codecs. However, this requires transcoding capabilities on the local MGW. If the local MGW lacks transcoding features such a local circuit should be avoided. Enabeling LCLS under such coditions should be optional (VTY) - Add check to avoid LCLS on different codec/rate - Add VTY-Option to optionally override the check (MGW is able to transcode) Change-Id: I157549129a40c64364dc126f67195759e5f1d60f Related: OS#1602 --- M include/osmocom/bsc/bsc_msc_data.h M src/osmo-bsc/osmo_bsc_lcls.c M src/osmo-bsc/osmo_bsc_vty.c 3 files changed, 36 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/40/9940/3 -- To view, visit https://gerrit.osmocom.org/9940 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I157549129a40c64364dc126f67195759e5f1d60f Gerrit-Change-Number: 9940 Gerrit-PatchSet: 3 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 08:19:05 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 23 Jul 2018 08:19:05 +0000 Subject: Change in osmo-ggsn[master]: gtp: Pass originating pdp ctx to recovery_cb In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10024 ) Change subject: gtp: Pass originating pdp ctx to recovery_cb ...................................................................... Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/10024/2//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/10024/2//COMMIT_MSG at 9 PS2, Line 9: This commit breaks API and old apps will fail to compile if using the : cb_recovery > does this mean that any older version of osmo-{sgsn,ggsn,gtphub} will fail to compile against a new [?] Only user of this API I can find is osmo-sgsn, which requires this change to have PdpCtx* with Recovery Counter increased to work fine. I'll then create a v2 callback which provides this information then. -- To view, visit https://gerrit.osmocom.org/10024 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I53e92298f2f6b84d662a3300d922e8c2ccb178bc Gerrit-Change-Number: 10024 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Mon, 23 Jul 2018 08:19:05 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 09:26:33 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 23 Jul 2018 09:26:33 +0000 Subject: Change in osmo-ggsn[master]: gtp: Add new replacement cb_recovery2 for cb_recovery In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10024 to look at the new patch set (#3). Change subject: gtp: Add new replacement cb_recovery2 for cb_recovery ...................................................................... gtp: Add new replacement cb_recovery2 for cb_recovery Sometimes the originating pdp ctx causing the Recovery Procedure is required, in order to drop all pdp ctx but this one, which specs specify should be handled as valid: """ The SGSN receiving the Recovery information element shall handle it as when an Echo Response message is received but shall consider the PDP context being created as active if the response indicates successful context activation at the GGSN. """ Change-Id: I53e92298f2f6b84d662a3300d922e8c2ccb178bc --- M gtp/gtp.c M gtp/gtp.h 2 files changed, 45 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/24/10024/3 -- To view, visit https://gerrit.osmocom.org/10024 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I53e92298f2f6b84d662a3300d922e8c2ccb178bc Gerrit-Change-Number: 10024 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 09:29:21 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 23 Jul 2018 09:29:21 +0000 Subject: Change in osmo-sgsn[master]: gtp: Fix crash using new libgtp cb_recovery API In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10025 to look at the new patch set (#4). Change subject: gtp: Fix crash using new libgtp cb_recovery API ...................................................................... gtp: Fix crash using new libgtp cb_recovery API When PDP CTX CREATE ACK is received with an increased RestartCtr, cb_recovery is called first, which will dettach ggsn from al pdp ctx (free the pdp_t). But when giving control back from the ctrl, libgtp still uses that freed ctx and sends it back to osmo-sgsn through cb_conf(). As specs state in any case that we need to handle the message containing the increased RestartCtr as valid, we then need to avoid freeing the pdp ctx and leave handling for later in cb_conf. Depends: osmo-ggsn (libgtp) Change-Id I53e92298f2f6b84d662a3300d922e8c2ccb178bc. Change-Id: I0989c00e18ca95a099e1a312940eaac71957b444 --- M include/osmocom/sgsn/gprs_sgsn.h M src/gprs/gprs_sgsn.c M src/gprs/sgsn_libgtp.c 3 files changed, 16 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/25/10025/4 -- To view, visit https://gerrit.osmocom.org/10025 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0989c00e18ca95a099e1a312940eaac71957b444 Gerrit-Change-Number: 10025 Gerrit-PatchSet: 4 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 09:31:59 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 23 Jul 2018 09:31:59 +0000 Subject: Change in osmo-sgsn[master]: gtp: Fix crash using new libgtp cb_recovery2 API In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10025 to look at the new patch set (#5). Change subject: gtp: Fix crash using new libgtp cb_recovery2 API ...................................................................... gtp: Fix crash using new libgtp cb_recovery2 API When PDP CTX CREATE ACK is received with an increased RestartCtr, cb_recovery2 is called first, which will dettach ggsn from al pdp ctx (free the pdp_t). But when giving control back from the ctrl, libgtp still uses that freed ctx and sends it back to osmo-sgsn through cb_conf(). As specs state in any case that we need to handle the message containing the increased RestartCtr as valid, we then need to avoid freeing the pdp ctx and leave handling for later in cb_conf. Depends: osmo-ggsn (libgtp) Change-Id I53e92298f2f6b84d662a3300d922e8c2ccb178bc. Change-Id: I0989c00e18ca95a099e1a312940eaac71957b444 --- M include/osmocom/sgsn/gprs_sgsn.h M src/gprs/gprs_sgsn.c M src/gprs/sgsn_libgtp.c 3 files changed, 16 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/25/10025/5 -- To view, visit https://gerrit.osmocom.org/10025 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0989c00e18ca95a099e1a312940eaac71957b444 Gerrit-Change-Number: 10025 Gerrit-PatchSet: 5 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 11:45:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Jul 2018 11:45:15 +0000 Subject: Change in libosmocore[master]: import gsup_client + oap_client as new libosmo-gsup-client Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10109 Change subject: import gsup_client + oap_client as new libosmo-gsup-client ...................................................................... import gsup_client + oap_client as new libosmo-gsup-client This imports the code from osmo-msc 6afef893e17bce67e4d4119acd34d480ed03ba77 with minimal changes to make it compile. Symbol renaming ot osmo_ prefix is done separately in a follow-up patch to have a as-clean-as-possible import first. Change-Id: Ief50054ad135551625b684ed8a0486f7af0b2940 --- M Makefile.am M configure.ac M include/Makefile.am A include/osmocom/gsupclient/gsup_client.h A include/osmocom/gsupclient/oap_client.h A src/gsupclient/Makefile.am A src/gsupclient/gsup_client.c A src/gsupclient/gsup_test_client.c A src/gsupclient/oap_client.c 9 files changed, 1,123 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/09/10109/1 diff --git a/Makefile.am b/Makefile.am index de5eb35..3fe61b2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,7 @@ ACLOCAL_AMFLAGS = -I m4 AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -SUBDIRS = include src src/vty src/codec src/gsm src/coding src/gb src/ctrl src/sim src/pseudotalloc utils tests +SUBDIRS = include src src/vty src/codec src/gsm src/coding src/gb src/ctrl src/sim src/pseudotalloc src/gsupclient utils tests pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libosmocore.pc libosmocodec.pc libosmovty.pc libosmogsm.pc \ diff --git a/configure.ac b/configure.ac index dd5f15b..c2b12ea 100644 --- a/configure.ac +++ b/configure.ac @@ -228,6 +228,14 @@ [enable_ctrl=$enableval], [enable_ctrl="yes"]) AM_CONDITIONAL(ENABLE_CTRL, test x"$enable_ctrl" = x"yes") +AC_ARG_ENABLE(gsup-client, + [AS_HELP_STRING( + [--disable-gsup-client], + [Disable building GSUP client library], + )], + [enable_gsupclient=$enableval], [enable_gsupclient="yes"]) +AM_CONDITIONAL(ENABLE_GSUP_CLIENT, test x"$enable_gsupclient" = x"yes") + AC_ARG_ENABLE(pseudotalloc, [AS_HELP_STRING( [--enable-pseudotalloc], @@ -364,6 +372,7 @@ src/gb/Makefile src/ctrl/Makefile src/pseudotalloc/Makefile + src/gsupclient/Makefile tests/Makefile tests/atlocal utils/Makefile diff --git a/include/Makefile.am b/include/Makefile.am index 38ba14c..a65f8a5 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -135,6 +135,10 @@ nobase_include_HEADERS += osmocom/core/serial.h endif +if ENABLE_GSUP_CLIENT +nobase_include_HEADERS += osmocom/gsupclient/oap_client.h \ + osmocom/gsupclient/gsup_client.h +endif if ENABLE_VTY nobase_include_HEADERS += \ diff --git a/include/osmocom/gsupclient/gsup_client.h b/include/osmocom/gsupclient/gsup_client.h new file mode 100644 index 0000000..bc0f35a --- /dev/null +++ b/include/osmocom/gsupclient/gsup_client.h @@ -0,0 +1,66 @@ +/* GPRS Subscriber Update Protocol client */ + +/* (C) 2014 by Sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Jacob Erlbeck + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#include +#include + +/* a loss of GSUP between MSC and HLR is considered quite serious, let's try to recover as quickly as + * possible. Even one new connection attempt per second should be quite acceptable until the link is + * re-established */ +#define GSUP_CLIENT_RECONNECT_INTERVAL 1 +#define GSUP_CLIENT_PING_INTERVAL 20 + +struct msgb; +struct ipa_client_conn; +struct gsup_client; + +/* Expects message in msg->l2h */ +typedef int (*gsup_client_read_cb_t)(struct gsup_client *gsupc, + struct msgb *msg); + +struct gsup_client { + const char *unit_name; + + struct ipa_client_conn *link; + gsup_client_read_cb_t read_cb; + void *data; + + struct oap_client_state oap_state; + + struct osmo_timer_list ping_timer; + struct osmo_timer_list connect_timer; + int is_connected; + int got_ipa_pong; +}; + +struct gsup_client *gsup_client_create(void *talloc_ctx, + const char *unit_name, + const char *ip_addr, + unsigned int tcp_port, + gsup_client_read_cb_t read_cb, + struct oap_client_config *oapc_config); + +void gsup_client_destroy(struct gsup_client *gsupc); +int gsup_client_send(struct gsup_client *gsupc, struct msgb *msg); +struct msgb *gsup_client_msgb_alloc(void); + diff --git a/include/osmocom/gsupclient/oap_client.h b/include/osmocom/gsupclient/oap_client.h new file mode 100644 index 0000000..80c86d5 --- /dev/null +++ b/include/osmocom/gsupclient/oap_client.h @@ -0,0 +1,82 @@ +/* Osmocom Authentication Protocol API */ + +/* (C) 2015 by Sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#pragma once + +#include + +struct msgb; +struct osmo_oap_message; + +/* This is the config part for vty. It is essentially copied in + * oap_client_state, where values are copied over once the config is + * considered valid. */ +struct oap_client_config { + uint16_t client_id; + int secret_k_present; + uint8_t secret_k[16]; + int secret_opc_present; + uint8_t secret_opc[16]; +}; + +/* The runtime state of the OAP client. client_id and the secrets are in fact + * duplicated from oap_client_config, so that a separate validation of the + * config data is possible, and so that only a struct oap_client_state* is + * passed around. */ +struct oap_client_state { + enum { + OAP_UNINITIALIZED = 0, /* just allocated. */ + OAP_DISABLED, /* disabled by config. */ + OAP_INITIALIZED, /* enabled, config is valid. */ + OAP_REQUESTED_CHALLENGE, + OAP_SENT_CHALLENGE_RESULT, + OAP_REGISTERED + } state; + uint16_t client_id; + uint8_t secret_k[16]; + uint8_t secret_opc[16]; + int registration_failures; +}; + +/* From config, initialize state. Return 0 on success. */ +int oap_client_init(struct oap_client_config *config, + struct oap_client_state *state); + +/* Construct an OAP registration message and return in *msg_tx. Use + * state->client_id and update state->state. + * Return 0 on success, or a negative value on error. + * If an error is returned, *msg_tx is guaranteed to be NULL. */ +int oap_client_register(struct oap_client_state *state, struct msgb **msg_tx); + +/* Decode and act on a received OAP message msg_rx. Update state->state. If a + * non-NULL pointer is returned in *msg_tx, that msgb should be sent to the OAP + * server (and freed) by the caller. The received msg_rx is not freed. + * Return 0 on success, or a negative value on error. + * If an error is returned, *msg_tx is guaranteed to be NULL. */ +int oap_client_handle(struct oap_client_state *state, + const struct msgb *msg_rx, struct msgb **msg_tx); + +/* Allocate a msgb and in it, return the encoded oap_client_msg. Return + * NULL on error. (Like oap_client_encode(), but also allocates a msgb.) + * About the name: the idea is do_something(oap_client_encoded(my_struct)) + */ +struct msgb *oap_client_encoded(const struct osmo_oap_message *oap_client_msg); diff --git a/src/gsupclient/Makefile.am b/src/gsupclient/Makefile.am new file mode 100644 index 0000000..a2a3cde --- /dev/null +++ b/src/gsupclient/Makefile.am @@ -0,0 +1,16 @@ +# This is _NOT_ the library release version, it's an API version. +# Please read chapter "Library interface versions" of the libtool documentation +# before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html +LIBVERSION=0:0:0 + +AM_CFLAGS = -Wall $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)/include $(TALLOC_CFLAGS) + +if ENABLE_GSUP_CLIENT +lib_LTLIBRARIES = libosmo-gsup-client.la + +libosmo_gsup_client_la_SOURCES = gsup_client.c oap_client.c + +libosmo_gsup_client_la_LDFLAGS = -version-info $(LIBVERSION) -no-undefined +libosmo_gsup_client_la_LIBADD = $(TALLOC_LIBS) \ + $(top_builddir)/src/libosmocore.la +endif diff --git a/src/gsupclient/gsup_client.c b/src/gsupclient/gsup_client.c new file mode 100644 index 0000000..7c2bb49 --- /dev/null +++ b/src/gsupclient/gsup_client.c @@ -0,0 +1,344 @@ +/* Generic Subscriber Update Protocol client */ + +/* (C) 2014-2016 by Sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Jacob Erlbeck + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include + +#include +#include +#include +#include + +#include +#include + +static void start_test_procedure(struct gsup_client *gsupc); + +static void gsup_client_send_ping(struct gsup_client *gsupc) +{ + struct msgb *msg = gsup_client_msgb_alloc(); + + msg->l2h = msgb_put(msg, 1); + msg->l2h[0] = IPAC_MSGT_PING; + ipa_msg_push_header(msg, IPAC_PROTO_IPACCESS); + ipa_client_conn_send(gsupc->link, msg); +} + +static int gsup_client_connect(struct gsup_client *gsupc) +{ + int rc; + + if (gsupc->is_connected) + return 0; + + if (osmo_timer_pending(&gsupc->connect_timer)) { + LOGP(DLGSUP, LOGL_DEBUG, + "GSUP connect: connect timer already running\n"); + osmo_timer_del(&gsupc->connect_timer); + } + + if (osmo_timer_pending(&gsupc->ping_timer)) { + LOGP(DLGSUP, LOGL_DEBUG, + "GSUP connect: ping timer already running\n"); + osmo_timer_del(&gsupc->ping_timer); + } + + if (ipa_client_conn_clear_queue(gsupc->link) > 0) + LOGP(DLGSUP, LOGL_DEBUG, "GSUP connect: discarded stored messages\n"); + + rc = ipa_client_conn_open(gsupc->link); + + if (rc >= 0) { + LOGP(DLGSUP, LOGL_NOTICE, "GSUP connecting to %s:%d\n", + gsupc->link->addr, gsupc->link->port); + return 0; + } + + LOGP(DLGSUP, LOGL_ERROR, "GSUP failed to connect to %s:%d: %s\n", + gsupc->link->addr, gsupc->link->port, strerror(-rc)); + + if (rc == -EBADF || rc == -ENOTSOCK || rc == -EAFNOSUPPORT || + rc == -EINVAL) + return rc; + + osmo_timer_schedule(&gsupc->connect_timer, + GSUP_CLIENT_RECONNECT_INTERVAL, 0); + + LOGP(DLGSUP, LOGL_INFO, "Scheduled timer to retry GSUP connect to %s:%d\n", + gsupc->link->addr, gsupc->link->port); + + return 0; +} + +static void connect_timer_cb(void *gsupc_) +{ + struct gsup_client *gsupc = gsupc_; + + if (gsupc->is_connected) + return; + + gsup_client_connect(gsupc); +} + +static void client_send(struct gsup_client *gsupc, int proto_ext, + struct msgb *msg_tx) +{ + ipa_prepend_header_ext(msg_tx, proto_ext); + ipa_msg_push_header(msg_tx, IPAC_PROTO_OSMO); + ipa_client_conn_send(gsupc->link, msg_tx); + /* msg_tx is now queued and will be freed. */ +} + +static void gsup_client_oap_register(struct gsup_client *gsupc) +{ + struct msgb *msg_tx; + int rc; + rc = oap_client_register(&gsupc->oap_state, &msg_tx); + + if ((rc < 0) || (!msg_tx)) { + LOGP(DLGSUP, LOGL_ERROR, "GSUP OAP set up, but cannot register.\n"); + return; + } + + client_send(gsupc, IPAC_PROTO_EXT_OAP, msg_tx); +} + +static void gsup_client_updown_cb(struct ipa_client_conn *link, int up) +{ + struct gsup_client *gsupc = link->data; + + LOGP(DLGSUP, LOGL_INFO, "GSUP link to %s:%d %s\n", + link->addr, link->port, up ? "UP" : "DOWN"); + + gsupc->is_connected = up; + + if (up) { + start_test_procedure(gsupc); + + if (gsupc->oap_state.state == OAP_INITIALIZED) + gsup_client_oap_register(gsupc); + + osmo_timer_del(&gsupc->connect_timer); + } else { + osmo_timer_del(&gsupc->ping_timer); + + osmo_timer_schedule(&gsupc->connect_timer, + GSUP_CLIENT_RECONNECT_INTERVAL, 0); + } +} + +static int gsup_client_oap_handle(struct gsup_client *gsupc, struct msgb *msg_rx) +{ + int rc; + struct msgb *msg_tx; + + /* If the oap_state is disabled, this will reject the messages. */ + rc = oap_client_handle(&gsupc->oap_state, msg_rx, &msg_tx); + msgb_free(msg_rx); + if (rc < 0) + return rc; + + if (msg_tx) + client_send(gsupc, IPAC_PROTO_EXT_OAP, msg_tx); + + return 0; +} + +static int gsup_client_read_cb(struct ipa_client_conn *link, struct msgb *msg) +{ + struct ipaccess_head *hh = (struct ipaccess_head *) msg->data; + struct ipaccess_head_ext *he = (struct ipaccess_head_ext *) msgb_l2(msg); + struct gsup_client *gsupc = (struct gsup_client *)link->data; + int rc; + struct ipaccess_unit ipa_dev = { + /* see gsup_client_create() on const vs non-const */ + .unit_name = (char*)gsupc->unit_name, + }; + + OSMO_ASSERT(ipa_dev.unit_name); + + msg->l2h = &hh->data[0]; + + rc = ipaccess_bts_handle_ccm(link, &ipa_dev, msg); + + if (rc < 0) { + LOGP(DLGSUP, LOGL_NOTICE, + "GSUP received an invalid IPA/CCM message from %s:%d\n", + link->addr, link->port); + /* Link has been closed */ + gsupc->is_connected = 0; + msgb_free(msg); + return -1; + } + + if (rc == 1) { + uint8_t msg_type = *(msg->l2h); + /* CCM message */ + if (msg_type == IPAC_MSGT_PONG) { + LOGP(DLGSUP, LOGL_DEBUG, "GSUP receiving PONG\n"); + gsupc->got_ipa_pong = 1; + } + + msgb_free(msg); + return 0; + } + + if (hh->proto != IPAC_PROTO_OSMO) + goto invalid; + + if (!he || msgb_l2len(msg) < sizeof(*he)) + goto invalid; + + msg->l2h = &he->data[0]; + + if (he->proto == IPAC_PROTO_EXT_GSUP) { + OSMO_ASSERT(gsupc->read_cb != NULL); + gsupc->read_cb(gsupc, msg); + /* expecting read_cb() to free msg */ + } else if (he->proto == IPAC_PROTO_EXT_OAP) { + return gsup_client_oap_handle(gsupc, msg); + /* gsup_client_oap_handle frees msg */ + } else + goto invalid; + + return 0; + +invalid: + LOGP(DLGSUP, LOGL_NOTICE, + "GSUP received an invalid IPA message from %s:%d, size = %d\n", + link->addr, link->port, msgb_length(msg)); + + msgb_free(msg); + return -1; +} + +static void ping_timer_cb(void *gsupc_) +{ + struct gsup_client *gsupc = gsupc_; + + LOGP(DLGSUP, LOGL_INFO, "GSUP ping callback (%s, %s PONG)\n", + gsupc->is_connected ? "connected" : "not connected", + gsupc->got_ipa_pong ? "got" : "didn't get"); + + if (gsupc->got_ipa_pong) { + start_test_procedure(gsupc); + return; + } + + LOGP(DLGSUP, LOGL_NOTICE, "GSUP ping timed out, reconnecting\n"); + ipa_client_conn_close(gsupc->link); + gsupc->is_connected = 0; + + gsup_client_connect(gsupc); +} + +static void start_test_procedure(struct gsup_client *gsupc) +{ + osmo_timer_setup(&gsupc->ping_timer, ping_timer_cb, gsupc); + + gsupc->got_ipa_pong = 0; + osmo_timer_schedule(&gsupc->ping_timer, GSUP_CLIENT_PING_INTERVAL, 0); + LOGP(DLGSUP, LOGL_DEBUG, "GSUP sending PING\n"); + gsup_client_send_ping(gsupc); +} + +struct gsup_client *gsup_client_create(void *talloc_ctx, + const char *unit_name, + const char *ip_addr, + unsigned int tcp_port, + gsup_client_read_cb_t read_cb, + struct oap_client_config *oapc_config) +{ + struct gsup_client *gsupc; + int rc; + + gsupc = talloc_zero(talloc_ctx, struct gsup_client); + OSMO_ASSERT(gsupc); + + /* struct ipaccess_unit has a non-const unit_name, so let's copy to be + * able to have a non-const unit_name here as well. To not taint the + * public gsup_client API, let's store it in a const char* anyway. */ + gsupc->unit_name = talloc_strdup(gsupc, unit_name); + OSMO_ASSERT(gsupc->unit_name); + + /* a NULL oapc_config will mark oap_state disabled. */ + rc = oap_client_init(oapc_config, &gsupc->oap_state); + if (rc != 0) + goto failed; + + gsupc->link = ipa_client_conn_create(gsupc, + /* no e1inp */ NULL, + 0, + ip_addr, tcp_port, + gsup_client_updown_cb, + gsup_client_read_cb, + /* default write_cb */ NULL, + gsupc); + if (!gsupc->link) + goto failed; + + osmo_timer_setup(&gsupc->connect_timer, connect_timer_cb, gsupc); + + rc = gsup_client_connect(gsupc); + + if (rc < 0) + goto failed; + + gsupc->read_cb = read_cb; + + return gsupc; + +failed: + gsup_client_destroy(gsupc); + return NULL; +} + +void gsup_client_destroy(struct gsup_client *gsupc) +{ + osmo_timer_del(&gsupc->connect_timer); + osmo_timer_del(&gsupc->ping_timer); + + if (gsupc->link) { + ipa_client_conn_close(gsupc->link); + ipa_client_conn_destroy(gsupc->link); + gsupc->link = NULL; + } + talloc_free(gsupc); +} + +int gsup_client_send(struct gsup_client *gsupc, struct msgb *msg) +{ + if (!gsupc || !gsupc->is_connected) { + LOGP(DLGSUP, LOGL_ERROR, "GSUP not connected, unable to send %s\n", msgb_hexdump(msg)); + msgb_free(msg); + return -ENOTCONN; + } + + client_send(gsupc, IPAC_PROTO_EXT_GSUP, msg); + + return 0; +} + +struct msgb *gsup_client_msgb_alloc(void) +{ + return msgb_alloc_headroom(4000, 64, __func__); +} diff --git a/src/gsupclient/gsup_test_client.c b/src/gsupclient/gsup_test_client.c new file mode 100644 index 0000000..0ebcd4a --- /dev/null +++ b/src/gsupclient/gsup_test_client.c @@ -0,0 +1,321 @@ +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +static struct gsup_client *g_gc; + + +/*********************************************************************** + * IMSI Operation + ***********************************************************************/ +static LLIST_HEAD(g_imsi_ops); + +struct imsi_op_stats { + uint32_t num_alloc; + uint32_t num_released; + uint32_t num_rx_success; + uint32_t num_rx_error; + uint32_t num_timeout; +}; + +enum imsi_op_type { + IMSI_OP_SAI, + IMSI_OP_LU, + IMSI_OP_ISD, + _NUM_IMSI_OP +}; + +static const struct value_string imsi_op_names[] = { + { IMSI_OP_SAI, "SAI" }, + { IMSI_OP_LU, "LU" }, + { IMSI_OP_ISD, "ISD" }, + { 0, NULL } +}; + +static struct imsi_op_stats imsi_op_stats[_NUM_IMSI_OP]; + +struct imsi_op { + struct llist_head list; + char imsi[17]; + enum imsi_op_type type; + struct osmo_timer_list timer; +}; + +static struct imsi_op *imsi_op_find(const char *imsi, + enum imsi_op_type type) +{ + struct imsi_op *io; + + llist_for_each_entry(io, &g_imsi_ops, list) { + if (!strcmp(io->imsi, imsi) && io->type == type) + return io; + } + return NULL; +} + +static void imsi_op_timer_cb(void *data); + +static struct imsi_op *imsi_op_alloc(void *ctx, const char *imsi, + enum imsi_op_type type) +{ + struct imsi_op *io; + + if (imsi_op_find(imsi, type)) + return NULL; + + io = talloc_zero(ctx, struct imsi_op); + OSMO_STRLCPY_ARRAY(io->imsi, imsi); + io->type = type; + osmo_timer_setup(&io->timer, imsi_op_timer_cb, io); + llist_add(&io->list, &g_imsi_ops); + imsi_op_stats[type].num_alloc++; + + return io; +} + +static void imsi_op_release(struct imsi_op *io) +{ + osmo_timer_del(&io->timer); + llist_del(&io->list); + imsi_op_stats[io->type].num_released++; + talloc_free(io); +} + +static void imsi_op_timer_cb(void *data) +{ + struct imsi_op *io = data; + printf("%s: Timer expiration\n", io->imsi); + imsi_op_stats[io->type].num_timeout++; + imsi_op_release(io); +} + +/* allocate + generate + send Send-Auth-Info */ +static int req_auth_info(const char *imsi) +{ + struct imsi_op *io = imsi_op_alloc(g_gc, imsi, IMSI_OP_SAI); + struct osmo_gsup_message gsup = {0}; + struct msgb *msg = msgb_alloc_headroom(1200, 200, __func__); + int rc; + + OSMO_STRLCPY_ARRAY(gsup.imsi, io->imsi); + gsup.message_type = OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST; + + rc = osmo_gsup_encode(msg, &gsup); + if (rc < 0) { + printf("%s: encoding failure (%s)\n", imsi, strerror(-rc)); + return rc; + } + + return gsup_client_send(g_gc, msg); +} + +/* allocate + generate + send Send-Auth-Info */ +static int req_loc_upd(const char *imsi) +{ + struct imsi_op *io = imsi_op_alloc(g_gc, imsi, IMSI_OP_LU); + struct osmo_gsup_message gsup = {0}; + struct msgb *msg = msgb_alloc_headroom(1200, 200, __func__); + int rc; + + OSMO_STRLCPY_ARRAY(gsup.imsi, io->imsi); + gsup.message_type = OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST; + + rc = osmo_gsup_encode(msg, &gsup); + if (rc < 0) { + printf("%s: encoding failure (%s)\n", imsi, strerror(-rc)); + return rc; + } + + return gsup_client_send(g_gc, msg); +} + +static int resp_isd(struct imsi_op *io) +{ + struct osmo_gsup_message gsup = {0}; + struct msgb *msg = msgb_alloc_headroom(1200, 200, __func__); + int rc; + + OSMO_STRLCPY_ARRAY(gsup.imsi, io->imsi); + gsup.message_type = OSMO_GSUP_MSGT_INSERT_DATA_RESULT; + + rc = osmo_gsup_encode(msg, &gsup); + if (rc < 0) { + printf("%s: encoding failure (%s)\n", io->imsi, strerror(-rc)); + return rc; + } + + imsi_op_release(io); + + return gsup_client_send(g_gc, msg); +} + +/* receive an incoming GSUP message */ +static void imsi_op_rx_gsup(struct imsi_op *io, const struct osmo_gsup_message *gsup) +{ + int is_error = 0, rc; + + if (OSMO_GSUP_IS_MSGT_ERROR(gsup->message_type)) { + imsi_op_stats[io->type].num_rx_error++; + is_error = 1; + } else + imsi_op_stats[io->type].num_rx_success++; + + switch (io->type) { + case IMSI_OP_SAI: + printf("%s; SAI Response%s\n", io->imsi, is_error ? ": ERROR" : ""); + /* now that we have auth tuples, request LU */ + rc = req_loc_upd(io->imsi); + if (rc < 0) + printf("Failed to request Location Update for %s\n", io->imsi); + imsi_op_release(io); + break; + case IMSI_OP_LU: + printf("%s; LU Response%s\n", io->imsi, is_error ? ": ERROR" : ""); + imsi_op_release(io); + break; + case IMSI_OP_ISD: + printf("%s; ISD Request%s\n", io->imsi, is_error ? ": ERROR" : ""); + rc = resp_isd(io); + if (rc < 0) + printf("Failed to insert subscriber data for %s\n", io->imsi); + break; + default: + printf("%s: Unknown\n", io->imsi); + imsi_op_release(io); + break; + } +} + +static int op_type_by_gsup_msgt(enum osmo_gsup_message_type msg_type) +{ + switch (msg_type) { + case OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: + case OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR: + return IMSI_OP_SAI; + case OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: + case OSMO_GSUP_MSGT_UPDATE_LOCATION_ERROR: + return IMSI_OP_LU; + case OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: + return IMSI_OP_ISD; + default: + printf("Unknown GSUP msg_type %u\n", msg_type); + return -1; + } +} + +static int gsupc_read_cb(struct gsup_client *gsupc, struct msgb *msg) +{ + struct osmo_gsup_message gsup_msg = {0}; + struct imsi_op *io = NULL; + int rc; + + DEBUGP(DLGSUP, "Rx GSUP %s\n", msgb_hexdump(msg)); + + rc = osmo_gsup_decode(msgb_l2(msg), msgb_l2len(msg), &gsup_msg); + if (rc < 0) + return rc; + + if (!gsup_msg.imsi[0]) + return -1; + + rc = op_type_by_gsup_msgt(gsup_msg.message_type); + if (rc < 0) + return rc; + + switch (rc) { + case IMSI_OP_SAI: + case IMSI_OP_LU: + io = imsi_op_find(gsup_msg.imsi, rc); + break; + case IMSI_OP_ISD: + /* ISD is an inbound transaction */ + io = imsi_op_alloc(g_gc, gsup_msg.imsi, IMSI_OP_ISD); + break; + } + if (!io) + return -1; + + imsi_op_rx_gsup(io, &gsup_msg); + msgb_free(msg); + + return 0; +} + +static void print_report(void) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(imsi_op_stats); i++) { + struct imsi_op_stats *st = &imsi_op_stats[i]; + const char *name = get_value_string(imsi_op_names, i); + printf("%s: %u alloc, %u released, %u success, %u error , %u tout\n", + name, st->num_alloc, st->num_released, st->num_rx_success, + st->num_rx_error, st->num_timeout); + } +} + +static void sig_cb(int sig) +{ + switch (sig) { + case SIGINT: + print_report(); + exit(0); + break; + } +} + +/* default categories */ +static struct log_info_cat default_categories[] = { +}; + +static const struct log_info gsup_test_client_log_info = { + .cat = default_categories, + .num_cat = ARRAY_SIZE(default_categories), +}; + +int main(int argc, char **argv) +{ + unsigned long long i; + char *server_host = "127.0.0.1"; + uint16_t server_port = OSMO_GSUP_PORT; + void *ctx = talloc_named_const(NULL, 0, "gsup_test_client"); + + osmo_init_logging2(ctx, &gsup_test_client_log_info); + + g_gc = gsup_client_create(ctx, "GSUPTEST", server_host, server_port, + gsupc_read_cb, NULL); + + + signal(SIGINT, sig_cb); + + for (i = 0; i < 10000; i++) { + unsigned long long imsi = 901790000000000 + i; + char imsi_buf[17] = { 0 }; + int rc; + + snprintf(imsi_buf, sizeof(imsi_buf), "%015llu", imsi); + rc = req_auth_info(imsi_buf); + if (rc < 0) + printf("Failed to request Auth Info for %s\n", imsi_buf); + + osmo_select_main(0); + } + + while (1) { + osmo_select_main(0); + } + + print_report(); + exit(0); +} diff --git a/src/gsupclient/oap_client.c b/src/gsupclient/oap_client.c new file mode 100644 index 0000000..9a0b60f --- /dev/null +++ b/src/gsupclient/oap_client.c @@ -0,0 +1,280 @@ +/* Osmocom Authentication Protocol API */ + +/* (C) 2015 by Sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include + +#include +#include +#include +#include + +#include + +int oap_client_init(struct oap_client_config *config, + struct oap_client_state *state) +{ + OSMO_ASSERT(state->state == OAP_UNINITIALIZED); + + if (!config) + goto disable; + + if (config->client_id == 0) + goto disable; + + if (config->secret_k_present == 0) { + LOGP(DLOAP, LOGL_NOTICE, "OAP: client ID set, but secret K missing.\n"); + goto disable; + } + + if (config->secret_opc_present == 0) { + LOGP(DLOAP, LOGL_NOTICE, "OAP: client ID set, but secret OPC missing.\n"); + goto disable; + } + + state->client_id = config->client_id; + memcpy(state->secret_k, config->secret_k, sizeof(state->secret_k)); + memcpy(state->secret_opc, config->secret_opc, sizeof(state->secret_opc)); + state->state = OAP_INITIALIZED; + return 0; + +disable: + state->state = OAP_DISABLED; + return 0; +} + +/* From the given state and received RAND and AUTN octets, validate the + * server's authenticity and formulate the matching milenage reply octets in + * *tx_xres. The state is not modified. + * On success, and if tx_res is not NULL, exactly 8 octets will be written to + * *tx_res. If not NULL, tx_res must point at allocated memory of at least 8 + * octets. The caller will want to send XRES back to the server in a challenge + * response message and update the state. + * Return 0 on success; -1 if OAP is disabled; -2 if rx_random and rx_autn fail + * the authentication check; -3 for any other errors. */ +static int oap_evaluate_challenge(const struct oap_client_state *state, + const uint8_t *rx_random, + const uint8_t *rx_autn, + uint8_t *tx_xres) +{ + struct osmo_auth_vector vec; + + struct osmo_sub_auth_data auth = { + .type = OSMO_AUTH_TYPE_UMTS, + .algo = OSMO_AUTH_ALG_MILENAGE, + }; + + osmo_static_assert(sizeof(((struct osmo_sub_auth_data*)0)->u.umts.k) + == sizeof(state->secret_k), _secret_k_size_match); + osmo_static_assert(sizeof(((struct osmo_sub_auth_data*)0)->u.umts.opc) + == sizeof(state->secret_opc), _secret_opc_size_match); + + switch (state->state) { + case OAP_UNINITIALIZED: + case OAP_DISABLED: + return -1; + default: + break; + } + + memcpy(auth.u.umts.k, state->secret_k, sizeof(auth.u.umts.k)); + memcpy(auth.u.umts.opc, state->secret_opc, sizeof(auth.u.umts.opc)); + memset(auth.u.umts.amf, '\0', sizeof(auth.u.umts.amf)); + auth.u.umts.sqn = 41; /* TODO use incrementing sequence nr */ + + memset(&vec, 0, sizeof(vec)); + osmo_auth_gen_vec(&vec, &auth, rx_random); + + if (vec.res_len != 8) { + LOGP(DLOAP, LOGL_ERROR, "OAP: Expected XRES to be 8 octets, got %d\n", + vec.res_len); + return -3; + } + + if (osmo_constant_time_cmp(vec.autn, rx_autn, sizeof(vec.autn)) != 0) { + LOGP(DLOAP, LOGL_ERROR, "OAP: AUTN mismatch!\n"); + LOGP(DLOAP, LOGL_INFO, "OAP: AUTN from server: %s\n", + osmo_hexdump_nospc(rx_autn, sizeof(vec.autn))); + LOGP(DLOAP, LOGL_INFO, "OAP: AUTN expected: %s\n", + osmo_hexdump_nospc(vec.autn, sizeof(vec.autn))); + return -2; + } + + if (tx_xres != NULL) + memcpy(tx_xres, vec.res, 8); + return 0; +} + +struct msgb *oap_client_encoded(const struct osmo_oap_message *oap_msg) +{ + struct msgb *msg = msgb_alloc_headroom(1000, 64, __func__); + OSMO_ASSERT(msg); + osmo_oap_encode(msg, oap_msg); + return msg; +} + +/* Create a new msgb containing an OAP registration message. + * On error, return NULL. */ +static struct msgb* oap_msg_register(uint16_t client_id) +{ + struct osmo_oap_message oap_msg = {0}; + + if (client_id < 1) { + LOGP(DLOAP, LOGL_ERROR, "OAP: Invalid client ID: %d\n", client_id); + return NULL; + } + + oap_msg.message_type = OAP_MSGT_REGISTER_REQUEST; + oap_msg.client_id = client_id; + return oap_client_encoded(&oap_msg); +} + +int oap_client_register(struct oap_client_state *state, struct msgb **msg_tx) +{ + *msg_tx = oap_msg_register(state->client_id); + if (!(*msg_tx)) + return -1; + + state->state = OAP_REQUESTED_CHALLENGE; + return 0; +} + +/* Create a new msgb containing an OAP challenge response message. + * xres must point at 8 octets to return as challenge response. + * On error, return NULL. */ +static struct msgb* oap_msg_challenge_response(uint8_t *xres) +{ + struct osmo_oap_message oap_reply = {0}; + + oap_reply.message_type = OAP_MSGT_CHALLENGE_RESULT; + memcpy(oap_reply.xres, xres, sizeof(oap_reply.xres)); + oap_reply.xres_present = 1; + return oap_client_encoded(&oap_reply); +} + +static int handle_challenge(struct oap_client_state *state, + struct osmo_oap_message *oap_rx, + struct msgb **msg_tx) +{ + int rc; + uint8_t xres[8]; + + if (!(oap_rx->rand_present && oap_rx->autn_present)) { + LOGP(DLOAP, LOGL_ERROR, + "OAP challenge incomplete (rand_present: %d, autn_present: %d)\n", + oap_rx->rand_present, oap_rx->autn_present); + rc = -2; + goto failure; + } + + rc = oap_evaluate_challenge(state, + oap_rx->rand, + oap_rx->autn, + xres); + if (rc < 0) + goto failure; + + *msg_tx = oap_msg_challenge_response(xres); + if ((*msg_tx) == NULL) { + rc = -1; + goto failure; + } + + state->state = OAP_SENT_CHALLENGE_RESULT; + return 0; + +failure: + OSMO_ASSERT(rc < 0); + state->state = OAP_INITIALIZED; + return rc; +} + +int oap_client_handle(struct oap_client_state *state, + const struct msgb *msg_rx, struct msgb **msg_tx) +{ + uint8_t *data = msgb_l2(msg_rx); + size_t data_len = msgb_l2len(msg_rx); + struct osmo_oap_message oap_msg = {0}; + int rc = 0; + + *msg_tx = NULL; + + OSMO_ASSERT(data); + + rc = osmo_oap_decode(&oap_msg, data, data_len); + if (rc < 0) { + LOGP(DLOAP, LOGL_ERROR, + "Decoding OAP message failed with error '%s' (%d)\n", + get_value_string(gsm48_gmm_cause_names, -rc), -rc); + return -10; + } + + switch (state->state) { + case OAP_UNINITIALIZED: + LOGP(DLOAP, LOGL_ERROR, + "Received OAP message %d, but the OAP client is" + " not initialized\n", oap_msg.message_type); + return -ENOTCONN; + case OAP_DISABLED: + LOGP(DLOAP, LOGL_ERROR, + "Received OAP message %d, but the OAP client is" + " disabled\n", oap_msg.message_type); + return -ENOTCONN; + default: + break; + } + + switch (oap_msg.message_type) { + case OAP_MSGT_CHALLENGE_REQUEST: + return handle_challenge(state, &oap_msg, msg_tx); + + case OAP_MSGT_REGISTER_RESULT: + /* successfully registered */ + state->state = OAP_REGISTERED; + break; + + case OAP_MSGT_REGISTER_ERROR: + LOGP(DLOAP, LOGL_ERROR, + "OAP registration failed\n"); + state->state = OAP_INITIALIZED; + if (state->registration_failures < 3) { + state->registration_failures++; + return oap_client_register(state, msg_tx); + } + return -11; + + case OAP_MSGT_REGISTER_REQUEST: + case OAP_MSGT_CHALLENGE_RESULT: + LOGP(DLOAP, LOGL_ERROR, + "Received invalid OAP message type for OAP client side: %d\n", + (int)oap_msg.message_type); + return -12; + + default: + LOGP(DLOAP, LOGL_ERROR, + "Unknown OAP message type: %d\n", + (int)oap_msg.message_type); + return -13; + } + + return 0; +} -- To view, visit https://gerrit.osmocom.org/10109 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ief50054ad135551625b684ed8a0486f7af0b2940 Gerrit-Change-Number: 10109 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 11:45:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Jul 2018 11:45:15 +0000 Subject: Change in libosmocore[master]: gsup_client: rename gsup_client_* to osmo_gsup_client_* Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10110 Change subject: gsup_client: rename gsup_client_* to osmo_gsup_client_* ...................................................................... gsup_client: rename gsup_client_* to osmo_gsup_client_* As we're moving this to a common/shared library now, we need to use the osmo_ namespace prefix for symbol names, struct/type names and constants. Change-Id: I294f8f96af4c5daa2b128962534426e04909290e --- M include/osmocom/gsupclient/gsup_client.h M src/gsupclient/gsup_client.c 2 files changed, 42 insertions(+), 43 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/10/10110/1 diff --git a/include/osmocom/gsupclient/gsup_client.h b/include/osmocom/gsupclient/gsup_client.h index bc0f35a..e8be11f 100644 --- a/include/osmocom/gsupclient/gsup_client.h +++ b/include/osmocom/gsupclient/gsup_client.h @@ -27,22 +27,21 @@ /* a loss of GSUP between MSC and HLR is considered quite serious, let's try to recover as quickly as * possible. Even one new connection attempt per second should be quite acceptable until the link is * re-established */ -#define GSUP_CLIENT_RECONNECT_INTERVAL 1 -#define GSUP_CLIENT_PING_INTERVAL 20 +#define OSMO_GSUP_CLIENT_RECONNECT_INTERVAL 1 +#define OSMO_GSUP_CLIENT_PING_INTERVAL 20 struct msgb; struct ipa_client_conn; -struct gsup_client; +struct osmo_gsup_client; /* Expects message in msg->l2h */ -typedef int (*gsup_client_read_cb_t)(struct gsup_client *gsupc, - struct msgb *msg); +typedef int (*osmo_gsup_client_read_cb_t)(struct osmo_gsup_client *gsupc, struct msgb *msg); -struct gsup_client { +struct osmo_gsup_client { const char *unit_name; struct ipa_client_conn *link; - gsup_client_read_cb_t read_cb; + osmo_gsup_client_read_cb_t read_cb; void *data; struct oap_client_state oap_state; @@ -53,14 +52,14 @@ int got_ipa_pong; }; -struct gsup_client *gsup_client_create(void *talloc_ctx, - const char *unit_name, - const char *ip_addr, - unsigned int tcp_port, - gsup_client_read_cb_t read_cb, - struct oap_client_config *oapc_config); +struct osmo_gsup_client *osmo_gsup_client_create(void *talloc_ctx, + const char *unit_name, + const char *ip_addr, + unsigned int tcp_port, + osmo_gsup_client_read_cb_t read_cb, + struct oap_client_config *oapc_config); -void gsup_client_destroy(struct gsup_client *gsupc); -int gsup_client_send(struct gsup_client *gsupc, struct msgb *msg); -struct msgb *gsup_client_msgb_alloc(void); +void osmo_gsup_client_destroy(struct osmo_gsup_client *gsupc); +int osmo_gsup_client_send(struct osmo_gsup_client *gsupc, struct msgb *msg); +struct msgb *osmo_gsup_client_msgb_alloc(void); diff --git a/src/gsupclient/gsup_client.c b/src/gsupclient/gsup_client.c index 7c2bb49..b4b138b 100644 --- a/src/gsupclient/gsup_client.c +++ b/src/gsupclient/gsup_client.c @@ -31,11 +31,11 @@ #include #include -static void start_test_procedure(struct gsup_client *gsupc); +static void start_test_procedure(struct osmo_gsup_client *gsupc); -static void gsup_client_send_ping(struct gsup_client *gsupc) +static void gsup_client_send_ping(struct osmo_gsup_client *gsupc) { - struct msgb *msg = gsup_client_msgb_alloc(); + struct msgb *msg = osmo_gsup_client_msgb_alloc(); msg->l2h = msgb_put(msg, 1); msg->l2h[0] = IPAC_MSGT_PING; @@ -43,7 +43,7 @@ ipa_client_conn_send(gsupc->link, msg); } -static int gsup_client_connect(struct gsup_client *gsupc) +static int gsup_client_connect(struct osmo_gsup_client *gsupc) { int rc; @@ -81,7 +81,7 @@ return rc; osmo_timer_schedule(&gsupc->connect_timer, - GSUP_CLIENT_RECONNECT_INTERVAL, 0); + OSMO_GSUP_CLIENT_RECONNECT_INTERVAL, 0); LOGP(DLGSUP, LOGL_INFO, "Scheduled timer to retry GSUP connect to %s:%d\n", gsupc->link->addr, gsupc->link->port); @@ -91,7 +91,7 @@ static void connect_timer_cb(void *gsupc_) { - struct gsup_client *gsupc = gsupc_; + struct osmo_gsup_client *gsupc = gsupc_; if (gsupc->is_connected) return; @@ -99,7 +99,7 @@ gsup_client_connect(gsupc); } -static void client_send(struct gsup_client *gsupc, int proto_ext, +static void client_send(struct osmo_gsup_client *gsupc, int proto_ext, struct msgb *msg_tx) { ipa_prepend_header_ext(msg_tx, proto_ext); @@ -108,7 +108,7 @@ /* msg_tx is now queued and will be freed. */ } -static void gsup_client_oap_register(struct gsup_client *gsupc) +static void gsup_client_oap_register(struct osmo_gsup_client *gsupc) { struct msgb *msg_tx; int rc; @@ -124,7 +124,7 @@ static void gsup_client_updown_cb(struct ipa_client_conn *link, int up) { - struct gsup_client *gsupc = link->data; + struct osmo_gsup_client *gsupc = link->data; LOGP(DLGSUP, LOGL_INFO, "GSUP link to %s:%d %s\n", link->addr, link->port, up ? "UP" : "DOWN"); @@ -142,11 +142,11 @@ osmo_timer_del(&gsupc->ping_timer); osmo_timer_schedule(&gsupc->connect_timer, - GSUP_CLIENT_RECONNECT_INTERVAL, 0); + OSMO_GSUP_CLIENT_RECONNECT_INTERVAL, 0); } } -static int gsup_client_oap_handle(struct gsup_client *gsupc, struct msgb *msg_rx) +static int gsup_client_oap_handle(struct osmo_gsup_client *gsupc, struct msgb *msg_rx) { int rc; struct msgb *msg_tx; @@ -167,7 +167,7 @@ { struct ipaccess_head *hh = (struct ipaccess_head *) msg->data; struct ipaccess_head_ext *he = (struct ipaccess_head_ext *) msgb_l2(msg); - struct gsup_client *gsupc = (struct gsup_client *)link->data; + struct osmo_gsup_client *gsupc = (struct osmo_gsup_client *)link->data; int rc; struct ipaccess_unit ipa_dev = { /* see gsup_client_create() on const vs non-const */ @@ -233,7 +233,7 @@ static void ping_timer_cb(void *gsupc_) { - struct gsup_client *gsupc = gsupc_; + struct osmo_gsup_client *gsupc = gsupc_; LOGP(DLGSUP, LOGL_INFO, "GSUP ping callback (%s, %s PONG)\n", gsupc->is_connected ? "connected" : "not connected", @@ -251,27 +251,27 @@ gsup_client_connect(gsupc); } -static void start_test_procedure(struct gsup_client *gsupc) +static void start_test_procedure(struct osmo_gsup_client *gsupc) { osmo_timer_setup(&gsupc->ping_timer, ping_timer_cb, gsupc); gsupc->got_ipa_pong = 0; - osmo_timer_schedule(&gsupc->ping_timer, GSUP_CLIENT_PING_INTERVAL, 0); + osmo_timer_schedule(&gsupc->ping_timer, OSMO_GSUP_CLIENT_PING_INTERVAL, 0); LOGP(DLGSUP, LOGL_DEBUG, "GSUP sending PING\n"); gsup_client_send_ping(gsupc); } -struct gsup_client *gsup_client_create(void *talloc_ctx, - const char *unit_name, - const char *ip_addr, - unsigned int tcp_port, - gsup_client_read_cb_t read_cb, - struct oap_client_config *oapc_config) +struct osmo_gsup_client *osmo_gsup_client_create(void *talloc_ctx, + const char *unit_name, + const char *ip_addr, + unsigned int tcp_port, + osmo_gsup_client_read_cb_t read_cb, + struct oap_client_config *oapc_config) { - struct gsup_client *gsupc; + struct osmo_gsup_client *gsupc; int rc; - gsupc = talloc_zero(talloc_ctx, struct gsup_client); + gsupc = talloc_zero(talloc_ctx, struct osmo_gsup_client); OSMO_ASSERT(gsupc); /* struct ipaccess_unit has a non-const unit_name, so let's copy to be @@ -308,11 +308,11 @@ return gsupc; failed: - gsup_client_destroy(gsupc); + osmo_gsup_client_destroy(gsupc); return NULL; } -void gsup_client_destroy(struct gsup_client *gsupc) +void osmo_gsup_client_destroy(struct osmo_gsup_client *gsupc) { osmo_timer_del(&gsupc->connect_timer); osmo_timer_del(&gsupc->ping_timer); @@ -325,7 +325,7 @@ talloc_free(gsupc); } -int gsup_client_send(struct gsup_client *gsupc, struct msgb *msg) +int osmo_gsup_client_send(struct osmo_gsup_client *gsupc, struct msgb *msg) { if (!gsupc || !gsupc->is_connected) { LOGP(DLGSUP, LOGL_ERROR, "GSUP not connected, unable to send %s\n", msgb_hexdump(msg)); @@ -338,7 +338,7 @@ return 0; } -struct msgb *gsup_client_msgb_alloc(void) +struct msgb *osmo_gsup_client_msgb_alloc(void) { return msgb_alloc_headroom(4000, 64, __func__); } -- To view, visit https://gerrit.osmocom.org/10110 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I294f8f96af4c5daa2b128962534426e04909290e Gerrit-Change-Number: 10110 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 11:45:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Jul 2018 11:45:15 +0000 Subject: Change in libosmocore[master]: oap_client: rename oa_* to osmo_oap_* Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10111 Change subject: oap_client: rename oa_* to osmo_oap_* ...................................................................... oap_client: rename oa_* to osmo_oap_* As we're moving this to a common/shared library now, we need to use the osmo_ namespace prefix for symbol names, struct/type names and constants. Change-Id: Ifa777de6293bac5d4817c11dc2420fa6631c8b41 --- M include/osmocom/gsupclient/gsup_client.h M include/osmocom/gsupclient/oap_client.h M src/gsupclient/gsup_client.c M src/gsupclient/oap_client.c 4 files changed, 44 insertions(+), 44 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/11/10111/1 diff --git a/include/osmocom/gsupclient/gsup_client.h b/include/osmocom/gsupclient/gsup_client.h index e8be11f..6af50dc 100644 --- a/include/osmocom/gsupclient/gsup_client.h +++ b/include/osmocom/gsupclient/gsup_client.h @@ -44,7 +44,7 @@ osmo_gsup_client_read_cb_t read_cb; void *data; - struct oap_client_state oap_state; + struct osmo_oap_client_state oap_state; struct osmo_timer_list ping_timer; struct osmo_timer_list connect_timer; @@ -57,7 +57,7 @@ const char *ip_addr, unsigned int tcp_port, osmo_gsup_client_read_cb_t read_cb, - struct oap_client_config *oapc_config); + struct osmo_oap_client_config *oapc_config); void osmo_gsup_client_destroy(struct osmo_gsup_client *gsupc); int osmo_gsup_client_send(struct osmo_gsup_client *gsupc, struct msgb *msg); diff --git a/include/osmocom/gsupclient/oap_client.h b/include/osmocom/gsupclient/oap_client.h index 80c86d5..763f982 100644 --- a/include/osmocom/gsupclient/oap_client.h +++ b/include/osmocom/gsupclient/oap_client.h @@ -30,7 +30,7 @@ /* This is the config part for vty. It is essentially copied in * oap_client_state, where values are copied over once the config is * considered valid. */ -struct oap_client_config { +struct osmo_oap_client_config { uint16_t client_id; int secret_k_present; uint8_t secret_k[16]; @@ -42,14 +42,14 @@ * duplicated from oap_client_config, so that a separate validation of the * config data is possible, and so that only a struct oap_client_state* is * passed around. */ -struct oap_client_state { +struct osmo_oap_client_state { enum { - OAP_UNINITIALIZED = 0, /* just allocated. */ - OAP_DISABLED, /* disabled by config. */ - OAP_INITIALIZED, /* enabled, config is valid. */ - OAP_REQUESTED_CHALLENGE, - OAP_SENT_CHALLENGE_RESULT, - OAP_REGISTERED + OSMO_OAP_UNINITIALIZED = 0, /* just allocated. */ + OSMO_OAP_DISABLED, /* disabled by config. */ + OSMO_OAP_INITIALIZED, /* enabled, config is valid. */ + OSMO_OAP_REQUESTED_CHALLENGE, + OSMO_OAP_SENT_CHALLENGE_RESULT, + OSMO_OAP_REGISTERED } state; uint16_t client_id; uint8_t secret_k[16]; @@ -58,25 +58,25 @@ }; /* From config, initialize state. Return 0 on success. */ -int oap_client_init(struct oap_client_config *config, - struct oap_client_state *state); +int osmo_oap_client_init(struct osmo_oap_client_config *config, + struct osmo_oap_client_state *state); /* Construct an OAP registration message and return in *msg_tx. Use * state->client_id and update state->state. * Return 0 on success, or a negative value on error. * If an error is returned, *msg_tx is guaranteed to be NULL. */ -int oap_client_register(struct oap_client_state *state, struct msgb **msg_tx); +int osmo_oap_client_register(struct osmo_oap_client_state *state, struct msgb **msg_tx); /* Decode and act on a received OAP message msg_rx. Update state->state. If a * non-NULL pointer is returned in *msg_tx, that msgb should be sent to the OAP * server (and freed) by the caller. The received msg_rx is not freed. * Return 0 on success, or a negative value on error. * If an error is returned, *msg_tx is guaranteed to be NULL. */ -int oap_client_handle(struct oap_client_state *state, - const struct msgb *msg_rx, struct msgb **msg_tx); +int osmo_oap_client_handle(struct osmo_oap_client_state *state, + const struct msgb *msg_rx, struct msgb **msg_tx); /* Allocate a msgb and in it, return the encoded oap_client_msg. Return * NULL on error. (Like oap_client_encode(), but also allocates a msgb.) * About the name: the idea is do_something(oap_client_encoded(my_struct)) */ -struct msgb *oap_client_encoded(const struct osmo_oap_message *oap_client_msg); +struct msgb *osmo_oap_client_encoded(const struct osmo_oap_message *oap_client_msg); diff --git a/src/gsupclient/gsup_client.c b/src/gsupclient/gsup_client.c index b4b138b..7cf58ea 100644 --- a/src/gsupclient/gsup_client.c +++ b/src/gsupclient/gsup_client.c @@ -112,7 +112,7 @@ { struct msgb *msg_tx; int rc; - rc = oap_client_register(&gsupc->oap_state, &msg_tx); + rc = osmo_oap_client_register(&gsupc->oap_state, &msg_tx); if ((rc < 0) || (!msg_tx)) { LOGP(DLGSUP, LOGL_ERROR, "GSUP OAP set up, but cannot register.\n"); @@ -134,7 +134,7 @@ if (up) { start_test_procedure(gsupc); - if (gsupc->oap_state.state == OAP_INITIALIZED) + if (gsupc->oap_state.state == OSMO_OAP_INITIALIZED) gsup_client_oap_register(gsupc); osmo_timer_del(&gsupc->connect_timer); @@ -152,7 +152,7 @@ struct msgb *msg_tx; /* If the oap_state is disabled, this will reject the messages. */ - rc = oap_client_handle(&gsupc->oap_state, msg_rx, &msg_tx); + rc = osmo_oap_client_handle(&gsupc->oap_state, msg_rx, &msg_tx); msgb_free(msg_rx); if (rc < 0) return rc; @@ -266,7 +266,7 @@ const char *ip_addr, unsigned int tcp_port, osmo_gsup_client_read_cb_t read_cb, - struct oap_client_config *oapc_config) + struct osmo_oap_client_config *oapc_config) { struct osmo_gsup_client *gsupc; int rc; @@ -281,7 +281,7 @@ OSMO_ASSERT(gsupc->unit_name); /* a NULL oapc_config will mark oap_state disabled. */ - rc = oap_client_init(oapc_config, &gsupc->oap_state); + rc = osmo_oap_client_init(oapc_config, &gsupc->oap_state); if (rc != 0) goto failed; diff --git a/src/gsupclient/oap_client.c b/src/gsupclient/oap_client.c index 9a0b60f..26b0fe0 100644 --- a/src/gsupclient/oap_client.c +++ b/src/gsupclient/oap_client.c @@ -30,10 +30,10 @@ #include -int oap_client_init(struct oap_client_config *config, - struct oap_client_state *state) +int osmo_oap_client_init(struct osmo_oap_client_config *config, + struct osmo_oap_client_state *state) { - OSMO_ASSERT(state->state == OAP_UNINITIALIZED); + OSMO_ASSERT(state->state == OSMO_OAP_UNINITIALIZED); if (!config) goto disable; @@ -54,11 +54,11 @@ state->client_id = config->client_id; memcpy(state->secret_k, config->secret_k, sizeof(state->secret_k)); memcpy(state->secret_opc, config->secret_opc, sizeof(state->secret_opc)); - state->state = OAP_INITIALIZED; + state->state = OSMO_OAP_INITIALIZED; return 0; disable: - state->state = OAP_DISABLED; + state->state = OSMO_OAP_DISABLED; return 0; } @@ -71,7 +71,7 @@ * response message and update the state. * Return 0 on success; -1 if OAP is disabled; -2 if rx_random and rx_autn fail * the authentication check; -3 for any other errors. */ -static int oap_evaluate_challenge(const struct oap_client_state *state, +static int oap_evaluate_challenge(const struct osmo_oap_client_state *state, const uint8_t *rx_random, const uint8_t *rx_autn, uint8_t *tx_xres) @@ -89,8 +89,8 @@ == sizeof(state->secret_opc), _secret_opc_size_match); switch (state->state) { - case OAP_UNINITIALIZED: - case OAP_DISABLED: + case OSMO_OAP_UNINITIALIZED: + case OSMO_OAP_DISABLED: return -1; default: break; @@ -124,7 +124,7 @@ return 0; } -struct msgb *oap_client_encoded(const struct osmo_oap_message *oap_msg) +struct msgb *osmo_oap_client_encoded(const struct osmo_oap_message *oap_msg) { struct msgb *msg = msgb_alloc_headroom(1000, 64, __func__); OSMO_ASSERT(msg); @@ -145,16 +145,16 @@ oap_msg.message_type = OAP_MSGT_REGISTER_REQUEST; oap_msg.client_id = client_id; - return oap_client_encoded(&oap_msg); + return osmo_oap_client_encoded(&oap_msg); } -int oap_client_register(struct oap_client_state *state, struct msgb **msg_tx) +int osmo_oap_client_register(struct osmo_oap_client_state *state, struct msgb **msg_tx) { *msg_tx = oap_msg_register(state->client_id); if (!(*msg_tx)) return -1; - state->state = OAP_REQUESTED_CHALLENGE; + state->state = OSMO_OAP_REQUESTED_CHALLENGE; return 0; } @@ -168,10 +168,10 @@ oap_reply.message_type = OAP_MSGT_CHALLENGE_RESULT; memcpy(oap_reply.xres, xres, sizeof(oap_reply.xres)); oap_reply.xres_present = 1; - return oap_client_encoded(&oap_reply); + return osmo_oap_client_encoded(&oap_reply); } -static int handle_challenge(struct oap_client_state *state, +static int handle_challenge(struct osmo_oap_client_state *state, struct osmo_oap_message *oap_rx, struct msgb **msg_tx) { @@ -199,17 +199,17 @@ goto failure; } - state->state = OAP_SENT_CHALLENGE_RESULT; + state->state = OSMO_OAP_SENT_CHALLENGE_RESULT; return 0; failure: OSMO_ASSERT(rc < 0); - state->state = OAP_INITIALIZED; + state->state = OSMO_OAP_INITIALIZED; return rc; } -int oap_client_handle(struct oap_client_state *state, - const struct msgb *msg_rx, struct msgb **msg_tx) +int osmo_oap_client_handle(struct osmo_oap_client_state *state, + const struct msgb *msg_rx, struct msgb **msg_tx) { uint8_t *data = msgb_l2(msg_rx); size_t data_len = msgb_l2len(msg_rx); @@ -229,12 +229,12 @@ } switch (state->state) { - case OAP_UNINITIALIZED: + case OSMO_OAP_UNINITIALIZED: LOGP(DLOAP, LOGL_ERROR, "Received OAP message %d, but the OAP client is" " not initialized\n", oap_msg.message_type); return -ENOTCONN; - case OAP_DISABLED: + case OSMO_OAP_DISABLED: LOGP(DLOAP, LOGL_ERROR, "Received OAP message %d, but the OAP client is" " disabled\n", oap_msg.message_type); @@ -249,16 +249,16 @@ case OAP_MSGT_REGISTER_RESULT: /* successfully registered */ - state->state = OAP_REGISTERED; + state->state = OSMO_OAP_REGISTERED; break; case OAP_MSGT_REGISTER_ERROR: LOGP(DLOAP, LOGL_ERROR, "OAP registration failed\n"); - state->state = OAP_INITIALIZED; + state->state = OSMO_OAP_INITIALIZED; if (state->registration_failures < 3) { state->registration_failures++; - return oap_client_register(state, msg_tx); + return osmo_oap_client_register(state, msg_tx); } return -11; -- To view, visit https://gerrit.osmocom.org/10111 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ifa777de6293bac5d4817c11dc2420fa6631c8b41 Gerrit-Change-Number: 10111 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 11:45:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Jul 2018 11:45:16 +0000 Subject: Change in libosmocore[master]: fixup libosmo-gsup-client pkg-config Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10112 Change subject: fixup libosmo-gsup-client pkg-config ...................................................................... fixup libosmo-gsup-client pkg-config Change-Id: I6a27ec64c4e5f76abac6093d6b32179657915afe --- M Makefile.am M configure.ac A libosmo-gsup-client.pc.in 3 files changed, 14 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/12/10112/1 diff --git a/Makefile.am b/Makefile.am index 3fe61b2..5c9b1b1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,7 +5,8 @@ pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libosmocore.pc libosmocodec.pc libosmovty.pc libosmogsm.pc \ - libosmogb.pc libosmoctrl.pc libosmocoding.pc libosmosim.pc + libosmogb.pc libosmoctrl.pc libosmocoding.pc libosmosim.pc \ + libosmo-gsup-client.pc @RELMAKE@ diff --git a/configure.ac b/configure.ac index c2b12ea..902190d 100644 --- a/configure.ac +++ b/configure.ac @@ -362,6 +362,7 @@ libosmogb.pc libosmoctrl.pc libosmosim.pc + libosmo-gsup-client.pc include/Makefile src/Makefile src/vty/Makefile diff --git a/libosmo-gsup-client.pc.in b/libosmo-gsup-client.pc.in new file mode 100644 index 0000000..4210a4a --- /dev/null +++ b/libosmo-gsup-client.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: Osmocom GSUP and OAP Client Library +Description: C Utility Library +Version: @VERSION@ +Libs: -L${libdir} @TALLOC_LIBS@ -losmogsm -losmocore +Cflags: -I${includedir}/ + -- To view, visit https://gerrit.osmocom.org/10112 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I6a27ec64c4e5f76abac6093d6b32179657915afe Gerrit-Change-Number: 10112 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 12:31:02 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Jul 2018 12:31:02 +0000 Subject: Change in libosmocore[master]: fixup libosmo-gsup-client pkg-config In-Reply-To: References: Message-ID: Harald Welte has abandoned this change. ( https://gerrit.osmocom.org/10112 ) Change subject: fixup libosmo-gsup-client pkg-config ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/10112 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: I6a27ec64c4e5f76abac6093d6b32179657915afe Gerrit-Change-Number: 10112 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 12:37:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Jul 2018 12:37:48 +0000 Subject: Change in osmo-hlr[master]: import gsup_client + oap_client as new libosmo-gsup-client Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10113 Change subject: import gsup_client + oap_client as new libosmo-gsup-client ...................................................................... import gsup_client + oap_client as new libosmo-gsup-client This imports the code from osmo-msc 6afef893e17bce67e4d4119acd34d480ed03ba77 with minimal changes to make it compile. Symbol renaming ot osmo_ prefix is done separately in a follow-up patch to have a as-clean-as-possible import first. Change-Id: Ief50054ad135551625b684ed8a0486f7af0b2940 --- M .gitignore M Makefile.am M configure.ac A include/Makefile.am A include/osmocom/gsupclient/gsup_client.h A include/osmocom/gsupclient/oap_client.h A libosmo-gsup-client.pc.in M src/Makefile.am A src/gsupclient/Makefile.am A src/gsupclient/gsup_client.c A src/gsupclient/gsup_test_client.c A src/gsupclient/oap_client.c 12 files changed, 1,132 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/13/10113/1 diff --git a/.gitignore b/.gitignore index d65cb68..571f5b1 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,8 @@ missing .deps +*.pc + src/db_test src/db_bootstrap.h src/osmo-hlr diff --git a/Makefile.am b/Makefile.am index f5062a2..8e18167 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,6 +3,7 @@ SUBDIRS = \ doc \ src \ + include \ sql \ tests \ $(NULL) @@ -11,6 +12,9 @@ .version \ $(NULL) +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libosmo-gsup-client.pc + @RELMAKE@ BUILT_SOURCES = $(top_srcdir)/.version diff --git a/configure.ac b/configure.ac index cedba45..16c8b51 100644 --- a/configure.ac +++ b/configure.ac @@ -99,6 +99,9 @@ Makefile doc/Makefile src/Makefile + src/gsupclient/Makefile + include/Makefile + libosmo-gsup-client.pc sql/Makefile tests/Makefile tests/auc/Makefile diff --git a/include/Makefile.am b/include/Makefile.am new file mode 100644 index 0000000..5c3ae02 --- /dev/null +++ b/include/Makefile.am @@ -0,0 +1,3 @@ +nobase_include_HEADERS = osmocom/gsupclient/oap_client.h \ + osmocom/gsupclient/gsup_client.h + diff --git a/include/osmocom/gsupclient/gsup_client.h b/include/osmocom/gsupclient/gsup_client.h new file mode 100644 index 0000000..bc0f35a --- /dev/null +++ b/include/osmocom/gsupclient/gsup_client.h @@ -0,0 +1,66 @@ +/* GPRS Subscriber Update Protocol client */ + +/* (C) 2014 by Sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Jacob Erlbeck + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#include +#include + +/* a loss of GSUP between MSC and HLR is considered quite serious, let's try to recover as quickly as + * possible. Even one new connection attempt per second should be quite acceptable until the link is + * re-established */ +#define GSUP_CLIENT_RECONNECT_INTERVAL 1 +#define GSUP_CLIENT_PING_INTERVAL 20 + +struct msgb; +struct ipa_client_conn; +struct gsup_client; + +/* Expects message in msg->l2h */ +typedef int (*gsup_client_read_cb_t)(struct gsup_client *gsupc, + struct msgb *msg); + +struct gsup_client { + const char *unit_name; + + struct ipa_client_conn *link; + gsup_client_read_cb_t read_cb; + void *data; + + struct oap_client_state oap_state; + + struct osmo_timer_list ping_timer; + struct osmo_timer_list connect_timer; + int is_connected; + int got_ipa_pong; +}; + +struct gsup_client *gsup_client_create(void *talloc_ctx, + const char *unit_name, + const char *ip_addr, + unsigned int tcp_port, + gsup_client_read_cb_t read_cb, + struct oap_client_config *oapc_config); + +void gsup_client_destroy(struct gsup_client *gsupc); +int gsup_client_send(struct gsup_client *gsupc, struct msgb *msg); +struct msgb *gsup_client_msgb_alloc(void); + diff --git a/include/osmocom/gsupclient/oap_client.h b/include/osmocom/gsupclient/oap_client.h new file mode 100644 index 0000000..80c86d5 --- /dev/null +++ b/include/osmocom/gsupclient/oap_client.h @@ -0,0 +1,82 @@ +/* Osmocom Authentication Protocol API */ + +/* (C) 2015 by Sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#pragma once + +#include + +struct msgb; +struct osmo_oap_message; + +/* This is the config part for vty. It is essentially copied in + * oap_client_state, where values are copied over once the config is + * considered valid. */ +struct oap_client_config { + uint16_t client_id; + int secret_k_present; + uint8_t secret_k[16]; + int secret_opc_present; + uint8_t secret_opc[16]; +}; + +/* The runtime state of the OAP client. client_id and the secrets are in fact + * duplicated from oap_client_config, so that a separate validation of the + * config data is possible, and so that only a struct oap_client_state* is + * passed around. */ +struct oap_client_state { + enum { + OAP_UNINITIALIZED = 0, /* just allocated. */ + OAP_DISABLED, /* disabled by config. */ + OAP_INITIALIZED, /* enabled, config is valid. */ + OAP_REQUESTED_CHALLENGE, + OAP_SENT_CHALLENGE_RESULT, + OAP_REGISTERED + } state; + uint16_t client_id; + uint8_t secret_k[16]; + uint8_t secret_opc[16]; + int registration_failures; +}; + +/* From config, initialize state. Return 0 on success. */ +int oap_client_init(struct oap_client_config *config, + struct oap_client_state *state); + +/* Construct an OAP registration message and return in *msg_tx. Use + * state->client_id and update state->state. + * Return 0 on success, or a negative value on error. + * If an error is returned, *msg_tx is guaranteed to be NULL. */ +int oap_client_register(struct oap_client_state *state, struct msgb **msg_tx); + +/* Decode and act on a received OAP message msg_rx. Update state->state. If a + * non-NULL pointer is returned in *msg_tx, that msgb should be sent to the OAP + * server (and freed) by the caller. The received msg_rx is not freed. + * Return 0 on success, or a negative value on error. + * If an error is returned, *msg_tx is guaranteed to be NULL. */ +int oap_client_handle(struct oap_client_state *state, + const struct msgb *msg_rx, struct msgb **msg_tx); + +/* Allocate a msgb and in it, return the encoded oap_client_msg. Return + * NULL on error. (Like oap_client_encode(), but also allocates a msgb.) + * About the name: the idea is do_something(oap_client_encoded(my_struct)) + */ +struct msgb *oap_client_encoded(const struct osmo_oap_message *oap_client_msg); diff --git a/libosmo-gsup-client.pc.in b/libosmo-gsup-client.pc.in new file mode 100644 index 0000000..4210a4a --- /dev/null +++ b/libosmo-gsup-client.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: Osmocom GSUP and OAP Client Library +Description: C Utility Library +Version: @VERSION@ +Libs: -L${libdir} @TALLOC_LIBS@ -losmogsm -losmocore +Cflags: -I${includedir}/ + diff --git a/src/Makefile.am b/src/Makefile.am index ea5023d..e4506bb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,3 +1,5 @@ +SUBDIRS = gsupclient + AM_CFLAGS = \ -Wall \ $(LIBOSMOCORE_CFLAGS) \ diff --git a/src/gsupclient/Makefile.am b/src/gsupclient/Makefile.am new file mode 100644 index 0000000..4e3a93b --- /dev/null +++ b/src/gsupclient/Makefile.am @@ -0,0 +1,14 @@ +# This is _NOT_ the library release version, it's an API version. +# Please read chapter "Library interface versions" of the libtool documentation +# before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html +LIBVERSION=0:0:0 + +AM_CFLAGS = -Wall $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)/include \ + $(TALLOC_CFLAGS) $(LIBOSMOCORE_CFLAGS) + +lib_LTLIBRARIES = libosmo-gsup-client.la + +libosmo_gsup_client_la_SOURCES = gsup_client.c oap_client.c + +libosmo_gsup_client_la_LDFLAGS = -version-info $(LIBVERSION) -no-undefined +libosmo_gsup_client_la_LIBADD = $(TALLOC_LIBS) $(LIBOSMOCORE_LIBS) diff --git a/src/gsupclient/gsup_client.c b/src/gsupclient/gsup_client.c new file mode 100644 index 0000000..7c2bb49 --- /dev/null +++ b/src/gsupclient/gsup_client.c @@ -0,0 +1,344 @@ +/* Generic Subscriber Update Protocol client */ + +/* (C) 2014-2016 by Sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Jacob Erlbeck + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include + +#include +#include +#include +#include + +#include +#include + +static void start_test_procedure(struct gsup_client *gsupc); + +static void gsup_client_send_ping(struct gsup_client *gsupc) +{ + struct msgb *msg = gsup_client_msgb_alloc(); + + msg->l2h = msgb_put(msg, 1); + msg->l2h[0] = IPAC_MSGT_PING; + ipa_msg_push_header(msg, IPAC_PROTO_IPACCESS); + ipa_client_conn_send(gsupc->link, msg); +} + +static int gsup_client_connect(struct gsup_client *gsupc) +{ + int rc; + + if (gsupc->is_connected) + return 0; + + if (osmo_timer_pending(&gsupc->connect_timer)) { + LOGP(DLGSUP, LOGL_DEBUG, + "GSUP connect: connect timer already running\n"); + osmo_timer_del(&gsupc->connect_timer); + } + + if (osmo_timer_pending(&gsupc->ping_timer)) { + LOGP(DLGSUP, LOGL_DEBUG, + "GSUP connect: ping timer already running\n"); + osmo_timer_del(&gsupc->ping_timer); + } + + if (ipa_client_conn_clear_queue(gsupc->link) > 0) + LOGP(DLGSUP, LOGL_DEBUG, "GSUP connect: discarded stored messages\n"); + + rc = ipa_client_conn_open(gsupc->link); + + if (rc >= 0) { + LOGP(DLGSUP, LOGL_NOTICE, "GSUP connecting to %s:%d\n", + gsupc->link->addr, gsupc->link->port); + return 0; + } + + LOGP(DLGSUP, LOGL_ERROR, "GSUP failed to connect to %s:%d: %s\n", + gsupc->link->addr, gsupc->link->port, strerror(-rc)); + + if (rc == -EBADF || rc == -ENOTSOCK || rc == -EAFNOSUPPORT || + rc == -EINVAL) + return rc; + + osmo_timer_schedule(&gsupc->connect_timer, + GSUP_CLIENT_RECONNECT_INTERVAL, 0); + + LOGP(DLGSUP, LOGL_INFO, "Scheduled timer to retry GSUP connect to %s:%d\n", + gsupc->link->addr, gsupc->link->port); + + return 0; +} + +static void connect_timer_cb(void *gsupc_) +{ + struct gsup_client *gsupc = gsupc_; + + if (gsupc->is_connected) + return; + + gsup_client_connect(gsupc); +} + +static void client_send(struct gsup_client *gsupc, int proto_ext, + struct msgb *msg_tx) +{ + ipa_prepend_header_ext(msg_tx, proto_ext); + ipa_msg_push_header(msg_tx, IPAC_PROTO_OSMO); + ipa_client_conn_send(gsupc->link, msg_tx); + /* msg_tx is now queued and will be freed. */ +} + +static void gsup_client_oap_register(struct gsup_client *gsupc) +{ + struct msgb *msg_tx; + int rc; + rc = oap_client_register(&gsupc->oap_state, &msg_tx); + + if ((rc < 0) || (!msg_tx)) { + LOGP(DLGSUP, LOGL_ERROR, "GSUP OAP set up, but cannot register.\n"); + return; + } + + client_send(gsupc, IPAC_PROTO_EXT_OAP, msg_tx); +} + +static void gsup_client_updown_cb(struct ipa_client_conn *link, int up) +{ + struct gsup_client *gsupc = link->data; + + LOGP(DLGSUP, LOGL_INFO, "GSUP link to %s:%d %s\n", + link->addr, link->port, up ? "UP" : "DOWN"); + + gsupc->is_connected = up; + + if (up) { + start_test_procedure(gsupc); + + if (gsupc->oap_state.state == OAP_INITIALIZED) + gsup_client_oap_register(gsupc); + + osmo_timer_del(&gsupc->connect_timer); + } else { + osmo_timer_del(&gsupc->ping_timer); + + osmo_timer_schedule(&gsupc->connect_timer, + GSUP_CLIENT_RECONNECT_INTERVAL, 0); + } +} + +static int gsup_client_oap_handle(struct gsup_client *gsupc, struct msgb *msg_rx) +{ + int rc; + struct msgb *msg_tx; + + /* If the oap_state is disabled, this will reject the messages. */ + rc = oap_client_handle(&gsupc->oap_state, msg_rx, &msg_tx); + msgb_free(msg_rx); + if (rc < 0) + return rc; + + if (msg_tx) + client_send(gsupc, IPAC_PROTO_EXT_OAP, msg_tx); + + return 0; +} + +static int gsup_client_read_cb(struct ipa_client_conn *link, struct msgb *msg) +{ + struct ipaccess_head *hh = (struct ipaccess_head *) msg->data; + struct ipaccess_head_ext *he = (struct ipaccess_head_ext *) msgb_l2(msg); + struct gsup_client *gsupc = (struct gsup_client *)link->data; + int rc; + struct ipaccess_unit ipa_dev = { + /* see gsup_client_create() on const vs non-const */ + .unit_name = (char*)gsupc->unit_name, + }; + + OSMO_ASSERT(ipa_dev.unit_name); + + msg->l2h = &hh->data[0]; + + rc = ipaccess_bts_handle_ccm(link, &ipa_dev, msg); + + if (rc < 0) { + LOGP(DLGSUP, LOGL_NOTICE, + "GSUP received an invalid IPA/CCM message from %s:%d\n", + link->addr, link->port); + /* Link has been closed */ + gsupc->is_connected = 0; + msgb_free(msg); + return -1; + } + + if (rc == 1) { + uint8_t msg_type = *(msg->l2h); + /* CCM message */ + if (msg_type == IPAC_MSGT_PONG) { + LOGP(DLGSUP, LOGL_DEBUG, "GSUP receiving PONG\n"); + gsupc->got_ipa_pong = 1; + } + + msgb_free(msg); + return 0; + } + + if (hh->proto != IPAC_PROTO_OSMO) + goto invalid; + + if (!he || msgb_l2len(msg) < sizeof(*he)) + goto invalid; + + msg->l2h = &he->data[0]; + + if (he->proto == IPAC_PROTO_EXT_GSUP) { + OSMO_ASSERT(gsupc->read_cb != NULL); + gsupc->read_cb(gsupc, msg); + /* expecting read_cb() to free msg */ + } else if (he->proto == IPAC_PROTO_EXT_OAP) { + return gsup_client_oap_handle(gsupc, msg); + /* gsup_client_oap_handle frees msg */ + } else + goto invalid; + + return 0; + +invalid: + LOGP(DLGSUP, LOGL_NOTICE, + "GSUP received an invalid IPA message from %s:%d, size = %d\n", + link->addr, link->port, msgb_length(msg)); + + msgb_free(msg); + return -1; +} + +static void ping_timer_cb(void *gsupc_) +{ + struct gsup_client *gsupc = gsupc_; + + LOGP(DLGSUP, LOGL_INFO, "GSUP ping callback (%s, %s PONG)\n", + gsupc->is_connected ? "connected" : "not connected", + gsupc->got_ipa_pong ? "got" : "didn't get"); + + if (gsupc->got_ipa_pong) { + start_test_procedure(gsupc); + return; + } + + LOGP(DLGSUP, LOGL_NOTICE, "GSUP ping timed out, reconnecting\n"); + ipa_client_conn_close(gsupc->link); + gsupc->is_connected = 0; + + gsup_client_connect(gsupc); +} + +static void start_test_procedure(struct gsup_client *gsupc) +{ + osmo_timer_setup(&gsupc->ping_timer, ping_timer_cb, gsupc); + + gsupc->got_ipa_pong = 0; + osmo_timer_schedule(&gsupc->ping_timer, GSUP_CLIENT_PING_INTERVAL, 0); + LOGP(DLGSUP, LOGL_DEBUG, "GSUP sending PING\n"); + gsup_client_send_ping(gsupc); +} + +struct gsup_client *gsup_client_create(void *talloc_ctx, + const char *unit_name, + const char *ip_addr, + unsigned int tcp_port, + gsup_client_read_cb_t read_cb, + struct oap_client_config *oapc_config) +{ + struct gsup_client *gsupc; + int rc; + + gsupc = talloc_zero(talloc_ctx, struct gsup_client); + OSMO_ASSERT(gsupc); + + /* struct ipaccess_unit has a non-const unit_name, so let's copy to be + * able to have a non-const unit_name here as well. To not taint the + * public gsup_client API, let's store it in a const char* anyway. */ + gsupc->unit_name = talloc_strdup(gsupc, unit_name); + OSMO_ASSERT(gsupc->unit_name); + + /* a NULL oapc_config will mark oap_state disabled. */ + rc = oap_client_init(oapc_config, &gsupc->oap_state); + if (rc != 0) + goto failed; + + gsupc->link = ipa_client_conn_create(gsupc, + /* no e1inp */ NULL, + 0, + ip_addr, tcp_port, + gsup_client_updown_cb, + gsup_client_read_cb, + /* default write_cb */ NULL, + gsupc); + if (!gsupc->link) + goto failed; + + osmo_timer_setup(&gsupc->connect_timer, connect_timer_cb, gsupc); + + rc = gsup_client_connect(gsupc); + + if (rc < 0) + goto failed; + + gsupc->read_cb = read_cb; + + return gsupc; + +failed: + gsup_client_destroy(gsupc); + return NULL; +} + +void gsup_client_destroy(struct gsup_client *gsupc) +{ + osmo_timer_del(&gsupc->connect_timer); + osmo_timer_del(&gsupc->ping_timer); + + if (gsupc->link) { + ipa_client_conn_close(gsupc->link); + ipa_client_conn_destroy(gsupc->link); + gsupc->link = NULL; + } + talloc_free(gsupc); +} + +int gsup_client_send(struct gsup_client *gsupc, struct msgb *msg) +{ + if (!gsupc || !gsupc->is_connected) { + LOGP(DLGSUP, LOGL_ERROR, "GSUP not connected, unable to send %s\n", msgb_hexdump(msg)); + msgb_free(msg); + return -ENOTCONN; + } + + client_send(gsupc, IPAC_PROTO_EXT_GSUP, msg); + + return 0; +} + +struct msgb *gsup_client_msgb_alloc(void) +{ + return msgb_alloc_headroom(4000, 64, __func__); +} diff --git a/src/gsupclient/gsup_test_client.c b/src/gsupclient/gsup_test_client.c new file mode 100644 index 0000000..0ebcd4a --- /dev/null +++ b/src/gsupclient/gsup_test_client.c @@ -0,0 +1,321 @@ +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +static struct gsup_client *g_gc; + + +/*********************************************************************** + * IMSI Operation + ***********************************************************************/ +static LLIST_HEAD(g_imsi_ops); + +struct imsi_op_stats { + uint32_t num_alloc; + uint32_t num_released; + uint32_t num_rx_success; + uint32_t num_rx_error; + uint32_t num_timeout; +}; + +enum imsi_op_type { + IMSI_OP_SAI, + IMSI_OP_LU, + IMSI_OP_ISD, + _NUM_IMSI_OP +}; + +static const struct value_string imsi_op_names[] = { + { IMSI_OP_SAI, "SAI" }, + { IMSI_OP_LU, "LU" }, + { IMSI_OP_ISD, "ISD" }, + { 0, NULL } +}; + +static struct imsi_op_stats imsi_op_stats[_NUM_IMSI_OP]; + +struct imsi_op { + struct llist_head list; + char imsi[17]; + enum imsi_op_type type; + struct osmo_timer_list timer; +}; + +static struct imsi_op *imsi_op_find(const char *imsi, + enum imsi_op_type type) +{ + struct imsi_op *io; + + llist_for_each_entry(io, &g_imsi_ops, list) { + if (!strcmp(io->imsi, imsi) && io->type == type) + return io; + } + return NULL; +} + +static void imsi_op_timer_cb(void *data); + +static struct imsi_op *imsi_op_alloc(void *ctx, const char *imsi, + enum imsi_op_type type) +{ + struct imsi_op *io; + + if (imsi_op_find(imsi, type)) + return NULL; + + io = talloc_zero(ctx, struct imsi_op); + OSMO_STRLCPY_ARRAY(io->imsi, imsi); + io->type = type; + osmo_timer_setup(&io->timer, imsi_op_timer_cb, io); + llist_add(&io->list, &g_imsi_ops); + imsi_op_stats[type].num_alloc++; + + return io; +} + +static void imsi_op_release(struct imsi_op *io) +{ + osmo_timer_del(&io->timer); + llist_del(&io->list); + imsi_op_stats[io->type].num_released++; + talloc_free(io); +} + +static void imsi_op_timer_cb(void *data) +{ + struct imsi_op *io = data; + printf("%s: Timer expiration\n", io->imsi); + imsi_op_stats[io->type].num_timeout++; + imsi_op_release(io); +} + +/* allocate + generate + send Send-Auth-Info */ +static int req_auth_info(const char *imsi) +{ + struct imsi_op *io = imsi_op_alloc(g_gc, imsi, IMSI_OP_SAI); + struct osmo_gsup_message gsup = {0}; + struct msgb *msg = msgb_alloc_headroom(1200, 200, __func__); + int rc; + + OSMO_STRLCPY_ARRAY(gsup.imsi, io->imsi); + gsup.message_type = OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST; + + rc = osmo_gsup_encode(msg, &gsup); + if (rc < 0) { + printf("%s: encoding failure (%s)\n", imsi, strerror(-rc)); + return rc; + } + + return gsup_client_send(g_gc, msg); +} + +/* allocate + generate + send Send-Auth-Info */ +static int req_loc_upd(const char *imsi) +{ + struct imsi_op *io = imsi_op_alloc(g_gc, imsi, IMSI_OP_LU); + struct osmo_gsup_message gsup = {0}; + struct msgb *msg = msgb_alloc_headroom(1200, 200, __func__); + int rc; + + OSMO_STRLCPY_ARRAY(gsup.imsi, io->imsi); + gsup.message_type = OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST; + + rc = osmo_gsup_encode(msg, &gsup); + if (rc < 0) { + printf("%s: encoding failure (%s)\n", imsi, strerror(-rc)); + return rc; + } + + return gsup_client_send(g_gc, msg); +} + +static int resp_isd(struct imsi_op *io) +{ + struct osmo_gsup_message gsup = {0}; + struct msgb *msg = msgb_alloc_headroom(1200, 200, __func__); + int rc; + + OSMO_STRLCPY_ARRAY(gsup.imsi, io->imsi); + gsup.message_type = OSMO_GSUP_MSGT_INSERT_DATA_RESULT; + + rc = osmo_gsup_encode(msg, &gsup); + if (rc < 0) { + printf("%s: encoding failure (%s)\n", io->imsi, strerror(-rc)); + return rc; + } + + imsi_op_release(io); + + return gsup_client_send(g_gc, msg); +} + +/* receive an incoming GSUP message */ +static void imsi_op_rx_gsup(struct imsi_op *io, const struct osmo_gsup_message *gsup) +{ + int is_error = 0, rc; + + if (OSMO_GSUP_IS_MSGT_ERROR(gsup->message_type)) { + imsi_op_stats[io->type].num_rx_error++; + is_error = 1; + } else + imsi_op_stats[io->type].num_rx_success++; + + switch (io->type) { + case IMSI_OP_SAI: + printf("%s; SAI Response%s\n", io->imsi, is_error ? ": ERROR" : ""); + /* now that we have auth tuples, request LU */ + rc = req_loc_upd(io->imsi); + if (rc < 0) + printf("Failed to request Location Update for %s\n", io->imsi); + imsi_op_release(io); + break; + case IMSI_OP_LU: + printf("%s; LU Response%s\n", io->imsi, is_error ? ": ERROR" : ""); + imsi_op_release(io); + break; + case IMSI_OP_ISD: + printf("%s; ISD Request%s\n", io->imsi, is_error ? ": ERROR" : ""); + rc = resp_isd(io); + if (rc < 0) + printf("Failed to insert subscriber data for %s\n", io->imsi); + break; + default: + printf("%s: Unknown\n", io->imsi); + imsi_op_release(io); + break; + } +} + +static int op_type_by_gsup_msgt(enum osmo_gsup_message_type msg_type) +{ + switch (msg_type) { + case OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: + case OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR: + return IMSI_OP_SAI; + case OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: + case OSMO_GSUP_MSGT_UPDATE_LOCATION_ERROR: + return IMSI_OP_LU; + case OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: + return IMSI_OP_ISD; + default: + printf("Unknown GSUP msg_type %u\n", msg_type); + return -1; + } +} + +static int gsupc_read_cb(struct gsup_client *gsupc, struct msgb *msg) +{ + struct osmo_gsup_message gsup_msg = {0}; + struct imsi_op *io = NULL; + int rc; + + DEBUGP(DLGSUP, "Rx GSUP %s\n", msgb_hexdump(msg)); + + rc = osmo_gsup_decode(msgb_l2(msg), msgb_l2len(msg), &gsup_msg); + if (rc < 0) + return rc; + + if (!gsup_msg.imsi[0]) + return -1; + + rc = op_type_by_gsup_msgt(gsup_msg.message_type); + if (rc < 0) + return rc; + + switch (rc) { + case IMSI_OP_SAI: + case IMSI_OP_LU: + io = imsi_op_find(gsup_msg.imsi, rc); + break; + case IMSI_OP_ISD: + /* ISD is an inbound transaction */ + io = imsi_op_alloc(g_gc, gsup_msg.imsi, IMSI_OP_ISD); + break; + } + if (!io) + return -1; + + imsi_op_rx_gsup(io, &gsup_msg); + msgb_free(msg); + + return 0; +} + +static void print_report(void) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(imsi_op_stats); i++) { + struct imsi_op_stats *st = &imsi_op_stats[i]; + const char *name = get_value_string(imsi_op_names, i); + printf("%s: %u alloc, %u released, %u success, %u error , %u tout\n", + name, st->num_alloc, st->num_released, st->num_rx_success, + st->num_rx_error, st->num_timeout); + } +} + +static void sig_cb(int sig) +{ + switch (sig) { + case SIGINT: + print_report(); + exit(0); + break; + } +} + +/* default categories */ +static struct log_info_cat default_categories[] = { +}; + +static const struct log_info gsup_test_client_log_info = { + .cat = default_categories, + .num_cat = ARRAY_SIZE(default_categories), +}; + +int main(int argc, char **argv) +{ + unsigned long long i; + char *server_host = "127.0.0.1"; + uint16_t server_port = OSMO_GSUP_PORT; + void *ctx = talloc_named_const(NULL, 0, "gsup_test_client"); + + osmo_init_logging2(ctx, &gsup_test_client_log_info); + + g_gc = gsup_client_create(ctx, "GSUPTEST", server_host, server_port, + gsupc_read_cb, NULL); + + + signal(SIGINT, sig_cb); + + for (i = 0; i < 10000; i++) { + unsigned long long imsi = 901790000000000 + i; + char imsi_buf[17] = { 0 }; + int rc; + + snprintf(imsi_buf, sizeof(imsi_buf), "%015llu", imsi); + rc = req_auth_info(imsi_buf); + if (rc < 0) + printf("Failed to request Auth Info for %s\n", imsi_buf); + + osmo_select_main(0); + } + + while (1) { + osmo_select_main(0); + } + + print_report(); + exit(0); +} diff --git a/src/gsupclient/oap_client.c b/src/gsupclient/oap_client.c new file mode 100644 index 0000000..9a0b60f --- /dev/null +++ b/src/gsupclient/oap_client.c @@ -0,0 +1,280 @@ +/* Osmocom Authentication Protocol API */ + +/* (C) 2015 by Sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include + +#include +#include +#include +#include + +#include + +int oap_client_init(struct oap_client_config *config, + struct oap_client_state *state) +{ + OSMO_ASSERT(state->state == OAP_UNINITIALIZED); + + if (!config) + goto disable; + + if (config->client_id == 0) + goto disable; + + if (config->secret_k_present == 0) { + LOGP(DLOAP, LOGL_NOTICE, "OAP: client ID set, but secret K missing.\n"); + goto disable; + } + + if (config->secret_opc_present == 0) { + LOGP(DLOAP, LOGL_NOTICE, "OAP: client ID set, but secret OPC missing.\n"); + goto disable; + } + + state->client_id = config->client_id; + memcpy(state->secret_k, config->secret_k, sizeof(state->secret_k)); + memcpy(state->secret_opc, config->secret_opc, sizeof(state->secret_opc)); + state->state = OAP_INITIALIZED; + return 0; + +disable: + state->state = OAP_DISABLED; + return 0; +} + +/* From the given state and received RAND and AUTN octets, validate the + * server's authenticity and formulate the matching milenage reply octets in + * *tx_xres. The state is not modified. + * On success, and if tx_res is not NULL, exactly 8 octets will be written to + * *tx_res. If not NULL, tx_res must point at allocated memory of at least 8 + * octets. The caller will want to send XRES back to the server in a challenge + * response message and update the state. + * Return 0 on success; -1 if OAP is disabled; -2 if rx_random and rx_autn fail + * the authentication check; -3 for any other errors. */ +static int oap_evaluate_challenge(const struct oap_client_state *state, + const uint8_t *rx_random, + const uint8_t *rx_autn, + uint8_t *tx_xres) +{ + struct osmo_auth_vector vec; + + struct osmo_sub_auth_data auth = { + .type = OSMO_AUTH_TYPE_UMTS, + .algo = OSMO_AUTH_ALG_MILENAGE, + }; + + osmo_static_assert(sizeof(((struct osmo_sub_auth_data*)0)->u.umts.k) + == sizeof(state->secret_k), _secret_k_size_match); + osmo_static_assert(sizeof(((struct osmo_sub_auth_data*)0)->u.umts.opc) + == sizeof(state->secret_opc), _secret_opc_size_match); + + switch (state->state) { + case OAP_UNINITIALIZED: + case OAP_DISABLED: + return -1; + default: + break; + } + + memcpy(auth.u.umts.k, state->secret_k, sizeof(auth.u.umts.k)); + memcpy(auth.u.umts.opc, state->secret_opc, sizeof(auth.u.umts.opc)); + memset(auth.u.umts.amf, '\0', sizeof(auth.u.umts.amf)); + auth.u.umts.sqn = 41; /* TODO use incrementing sequence nr */ + + memset(&vec, 0, sizeof(vec)); + osmo_auth_gen_vec(&vec, &auth, rx_random); + + if (vec.res_len != 8) { + LOGP(DLOAP, LOGL_ERROR, "OAP: Expected XRES to be 8 octets, got %d\n", + vec.res_len); + return -3; + } + + if (osmo_constant_time_cmp(vec.autn, rx_autn, sizeof(vec.autn)) != 0) { + LOGP(DLOAP, LOGL_ERROR, "OAP: AUTN mismatch!\n"); + LOGP(DLOAP, LOGL_INFO, "OAP: AUTN from server: %s\n", + osmo_hexdump_nospc(rx_autn, sizeof(vec.autn))); + LOGP(DLOAP, LOGL_INFO, "OAP: AUTN expected: %s\n", + osmo_hexdump_nospc(vec.autn, sizeof(vec.autn))); + return -2; + } + + if (tx_xres != NULL) + memcpy(tx_xres, vec.res, 8); + return 0; +} + +struct msgb *oap_client_encoded(const struct osmo_oap_message *oap_msg) +{ + struct msgb *msg = msgb_alloc_headroom(1000, 64, __func__); + OSMO_ASSERT(msg); + osmo_oap_encode(msg, oap_msg); + return msg; +} + +/* Create a new msgb containing an OAP registration message. + * On error, return NULL. */ +static struct msgb* oap_msg_register(uint16_t client_id) +{ + struct osmo_oap_message oap_msg = {0}; + + if (client_id < 1) { + LOGP(DLOAP, LOGL_ERROR, "OAP: Invalid client ID: %d\n", client_id); + return NULL; + } + + oap_msg.message_type = OAP_MSGT_REGISTER_REQUEST; + oap_msg.client_id = client_id; + return oap_client_encoded(&oap_msg); +} + +int oap_client_register(struct oap_client_state *state, struct msgb **msg_tx) +{ + *msg_tx = oap_msg_register(state->client_id); + if (!(*msg_tx)) + return -1; + + state->state = OAP_REQUESTED_CHALLENGE; + return 0; +} + +/* Create a new msgb containing an OAP challenge response message. + * xres must point at 8 octets to return as challenge response. + * On error, return NULL. */ +static struct msgb* oap_msg_challenge_response(uint8_t *xres) +{ + struct osmo_oap_message oap_reply = {0}; + + oap_reply.message_type = OAP_MSGT_CHALLENGE_RESULT; + memcpy(oap_reply.xres, xres, sizeof(oap_reply.xres)); + oap_reply.xres_present = 1; + return oap_client_encoded(&oap_reply); +} + +static int handle_challenge(struct oap_client_state *state, + struct osmo_oap_message *oap_rx, + struct msgb **msg_tx) +{ + int rc; + uint8_t xres[8]; + + if (!(oap_rx->rand_present && oap_rx->autn_present)) { + LOGP(DLOAP, LOGL_ERROR, + "OAP challenge incomplete (rand_present: %d, autn_present: %d)\n", + oap_rx->rand_present, oap_rx->autn_present); + rc = -2; + goto failure; + } + + rc = oap_evaluate_challenge(state, + oap_rx->rand, + oap_rx->autn, + xres); + if (rc < 0) + goto failure; + + *msg_tx = oap_msg_challenge_response(xres); + if ((*msg_tx) == NULL) { + rc = -1; + goto failure; + } + + state->state = OAP_SENT_CHALLENGE_RESULT; + return 0; + +failure: + OSMO_ASSERT(rc < 0); + state->state = OAP_INITIALIZED; + return rc; +} + +int oap_client_handle(struct oap_client_state *state, + const struct msgb *msg_rx, struct msgb **msg_tx) +{ + uint8_t *data = msgb_l2(msg_rx); + size_t data_len = msgb_l2len(msg_rx); + struct osmo_oap_message oap_msg = {0}; + int rc = 0; + + *msg_tx = NULL; + + OSMO_ASSERT(data); + + rc = osmo_oap_decode(&oap_msg, data, data_len); + if (rc < 0) { + LOGP(DLOAP, LOGL_ERROR, + "Decoding OAP message failed with error '%s' (%d)\n", + get_value_string(gsm48_gmm_cause_names, -rc), -rc); + return -10; + } + + switch (state->state) { + case OAP_UNINITIALIZED: + LOGP(DLOAP, LOGL_ERROR, + "Received OAP message %d, but the OAP client is" + " not initialized\n", oap_msg.message_type); + return -ENOTCONN; + case OAP_DISABLED: + LOGP(DLOAP, LOGL_ERROR, + "Received OAP message %d, but the OAP client is" + " disabled\n", oap_msg.message_type); + return -ENOTCONN; + default: + break; + } + + switch (oap_msg.message_type) { + case OAP_MSGT_CHALLENGE_REQUEST: + return handle_challenge(state, &oap_msg, msg_tx); + + case OAP_MSGT_REGISTER_RESULT: + /* successfully registered */ + state->state = OAP_REGISTERED; + break; + + case OAP_MSGT_REGISTER_ERROR: + LOGP(DLOAP, LOGL_ERROR, + "OAP registration failed\n"); + state->state = OAP_INITIALIZED; + if (state->registration_failures < 3) { + state->registration_failures++; + return oap_client_register(state, msg_tx); + } + return -11; + + case OAP_MSGT_REGISTER_REQUEST: + case OAP_MSGT_CHALLENGE_RESULT: + LOGP(DLOAP, LOGL_ERROR, + "Received invalid OAP message type for OAP client side: %d\n", + (int)oap_msg.message_type); + return -12; + + default: + LOGP(DLOAP, LOGL_ERROR, + "Unknown OAP message type: %d\n", + (int)oap_msg.message_type); + return -13; + } + + return 0; +} -- To view, visit https://gerrit.osmocom.org/10113 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ief50054ad135551625b684ed8a0486f7af0b2940 Gerrit-Change-Number: 10113 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 12:37:49 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Jul 2018 12:37:49 +0000 Subject: Change in osmo-hlr[master]: gsup_client: rename gsup_client_* to osmo_gsup_client_* Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10114 Change subject: gsup_client: rename gsup_client_* to osmo_gsup_client_* ...................................................................... gsup_client: rename gsup_client_* to osmo_gsup_client_* As we're moving this to a common/shared library now, we need to use the osmo_ namespace prefix for symbol names, struct/type names and constants. Change-Id: I294f8f96af4c5daa2b128962534426e04909290e --- M include/osmocom/gsupclient/gsup_client.h M src/gsupclient/gsup_client.c 2 files changed, 42 insertions(+), 43 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/14/10114/1 diff --git a/include/osmocom/gsupclient/gsup_client.h b/include/osmocom/gsupclient/gsup_client.h index bc0f35a..e8be11f 100644 --- a/include/osmocom/gsupclient/gsup_client.h +++ b/include/osmocom/gsupclient/gsup_client.h @@ -27,22 +27,21 @@ /* a loss of GSUP between MSC and HLR is considered quite serious, let's try to recover as quickly as * possible. Even one new connection attempt per second should be quite acceptable until the link is * re-established */ -#define GSUP_CLIENT_RECONNECT_INTERVAL 1 -#define GSUP_CLIENT_PING_INTERVAL 20 +#define OSMO_GSUP_CLIENT_RECONNECT_INTERVAL 1 +#define OSMO_GSUP_CLIENT_PING_INTERVAL 20 struct msgb; struct ipa_client_conn; -struct gsup_client; +struct osmo_gsup_client; /* Expects message in msg->l2h */ -typedef int (*gsup_client_read_cb_t)(struct gsup_client *gsupc, - struct msgb *msg); +typedef int (*osmo_gsup_client_read_cb_t)(struct osmo_gsup_client *gsupc, struct msgb *msg); -struct gsup_client { +struct osmo_gsup_client { const char *unit_name; struct ipa_client_conn *link; - gsup_client_read_cb_t read_cb; + osmo_gsup_client_read_cb_t read_cb; void *data; struct oap_client_state oap_state; @@ -53,14 +52,14 @@ int got_ipa_pong; }; -struct gsup_client *gsup_client_create(void *talloc_ctx, - const char *unit_name, - const char *ip_addr, - unsigned int tcp_port, - gsup_client_read_cb_t read_cb, - struct oap_client_config *oapc_config); +struct osmo_gsup_client *osmo_gsup_client_create(void *talloc_ctx, + const char *unit_name, + const char *ip_addr, + unsigned int tcp_port, + osmo_gsup_client_read_cb_t read_cb, + struct oap_client_config *oapc_config); -void gsup_client_destroy(struct gsup_client *gsupc); -int gsup_client_send(struct gsup_client *gsupc, struct msgb *msg); -struct msgb *gsup_client_msgb_alloc(void); +void osmo_gsup_client_destroy(struct osmo_gsup_client *gsupc); +int osmo_gsup_client_send(struct osmo_gsup_client *gsupc, struct msgb *msg); +struct msgb *osmo_gsup_client_msgb_alloc(void); diff --git a/src/gsupclient/gsup_client.c b/src/gsupclient/gsup_client.c index 7c2bb49..b4b138b 100644 --- a/src/gsupclient/gsup_client.c +++ b/src/gsupclient/gsup_client.c @@ -31,11 +31,11 @@ #include #include -static void start_test_procedure(struct gsup_client *gsupc); +static void start_test_procedure(struct osmo_gsup_client *gsupc); -static void gsup_client_send_ping(struct gsup_client *gsupc) +static void gsup_client_send_ping(struct osmo_gsup_client *gsupc) { - struct msgb *msg = gsup_client_msgb_alloc(); + struct msgb *msg = osmo_gsup_client_msgb_alloc(); msg->l2h = msgb_put(msg, 1); msg->l2h[0] = IPAC_MSGT_PING; @@ -43,7 +43,7 @@ ipa_client_conn_send(gsupc->link, msg); } -static int gsup_client_connect(struct gsup_client *gsupc) +static int gsup_client_connect(struct osmo_gsup_client *gsupc) { int rc; @@ -81,7 +81,7 @@ return rc; osmo_timer_schedule(&gsupc->connect_timer, - GSUP_CLIENT_RECONNECT_INTERVAL, 0); + OSMO_GSUP_CLIENT_RECONNECT_INTERVAL, 0); LOGP(DLGSUP, LOGL_INFO, "Scheduled timer to retry GSUP connect to %s:%d\n", gsupc->link->addr, gsupc->link->port); @@ -91,7 +91,7 @@ static void connect_timer_cb(void *gsupc_) { - struct gsup_client *gsupc = gsupc_; + struct osmo_gsup_client *gsupc = gsupc_; if (gsupc->is_connected) return; @@ -99,7 +99,7 @@ gsup_client_connect(gsupc); } -static void client_send(struct gsup_client *gsupc, int proto_ext, +static void client_send(struct osmo_gsup_client *gsupc, int proto_ext, struct msgb *msg_tx) { ipa_prepend_header_ext(msg_tx, proto_ext); @@ -108,7 +108,7 @@ /* msg_tx is now queued and will be freed. */ } -static void gsup_client_oap_register(struct gsup_client *gsupc) +static void gsup_client_oap_register(struct osmo_gsup_client *gsupc) { struct msgb *msg_tx; int rc; @@ -124,7 +124,7 @@ static void gsup_client_updown_cb(struct ipa_client_conn *link, int up) { - struct gsup_client *gsupc = link->data; + struct osmo_gsup_client *gsupc = link->data; LOGP(DLGSUP, LOGL_INFO, "GSUP link to %s:%d %s\n", link->addr, link->port, up ? "UP" : "DOWN"); @@ -142,11 +142,11 @@ osmo_timer_del(&gsupc->ping_timer); osmo_timer_schedule(&gsupc->connect_timer, - GSUP_CLIENT_RECONNECT_INTERVAL, 0); + OSMO_GSUP_CLIENT_RECONNECT_INTERVAL, 0); } } -static int gsup_client_oap_handle(struct gsup_client *gsupc, struct msgb *msg_rx) +static int gsup_client_oap_handle(struct osmo_gsup_client *gsupc, struct msgb *msg_rx) { int rc; struct msgb *msg_tx; @@ -167,7 +167,7 @@ { struct ipaccess_head *hh = (struct ipaccess_head *) msg->data; struct ipaccess_head_ext *he = (struct ipaccess_head_ext *) msgb_l2(msg); - struct gsup_client *gsupc = (struct gsup_client *)link->data; + struct osmo_gsup_client *gsupc = (struct osmo_gsup_client *)link->data; int rc; struct ipaccess_unit ipa_dev = { /* see gsup_client_create() on const vs non-const */ @@ -233,7 +233,7 @@ static void ping_timer_cb(void *gsupc_) { - struct gsup_client *gsupc = gsupc_; + struct osmo_gsup_client *gsupc = gsupc_; LOGP(DLGSUP, LOGL_INFO, "GSUP ping callback (%s, %s PONG)\n", gsupc->is_connected ? "connected" : "not connected", @@ -251,27 +251,27 @@ gsup_client_connect(gsupc); } -static void start_test_procedure(struct gsup_client *gsupc) +static void start_test_procedure(struct osmo_gsup_client *gsupc) { osmo_timer_setup(&gsupc->ping_timer, ping_timer_cb, gsupc); gsupc->got_ipa_pong = 0; - osmo_timer_schedule(&gsupc->ping_timer, GSUP_CLIENT_PING_INTERVAL, 0); + osmo_timer_schedule(&gsupc->ping_timer, OSMO_GSUP_CLIENT_PING_INTERVAL, 0); LOGP(DLGSUP, LOGL_DEBUG, "GSUP sending PING\n"); gsup_client_send_ping(gsupc); } -struct gsup_client *gsup_client_create(void *talloc_ctx, - const char *unit_name, - const char *ip_addr, - unsigned int tcp_port, - gsup_client_read_cb_t read_cb, - struct oap_client_config *oapc_config) +struct osmo_gsup_client *osmo_gsup_client_create(void *talloc_ctx, + const char *unit_name, + const char *ip_addr, + unsigned int tcp_port, + osmo_gsup_client_read_cb_t read_cb, + struct oap_client_config *oapc_config) { - struct gsup_client *gsupc; + struct osmo_gsup_client *gsupc; int rc; - gsupc = talloc_zero(talloc_ctx, struct gsup_client); + gsupc = talloc_zero(talloc_ctx, struct osmo_gsup_client); OSMO_ASSERT(gsupc); /* struct ipaccess_unit has a non-const unit_name, so let's copy to be @@ -308,11 +308,11 @@ return gsupc; failed: - gsup_client_destroy(gsupc); + osmo_gsup_client_destroy(gsupc); return NULL; } -void gsup_client_destroy(struct gsup_client *gsupc) +void osmo_gsup_client_destroy(struct osmo_gsup_client *gsupc) { osmo_timer_del(&gsupc->connect_timer); osmo_timer_del(&gsupc->ping_timer); @@ -325,7 +325,7 @@ talloc_free(gsupc); } -int gsup_client_send(struct gsup_client *gsupc, struct msgb *msg) +int osmo_gsup_client_send(struct osmo_gsup_client *gsupc, struct msgb *msg) { if (!gsupc || !gsupc->is_connected) { LOGP(DLGSUP, LOGL_ERROR, "GSUP not connected, unable to send %s\n", msgb_hexdump(msg)); @@ -338,7 +338,7 @@ return 0; } -struct msgb *gsup_client_msgb_alloc(void) +struct msgb *osmo_gsup_client_msgb_alloc(void) { return msgb_alloc_headroom(4000, 64, __func__); } -- To view, visit https://gerrit.osmocom.org/10114 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I294f8f96af4c5daa2b128962534426e04909290e Gerrit-Change-Number: 10114 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 12:37:50 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Jul 2018 12:37:50 +0000 Subject: Change in osmo-hlr[master]: oap_client: rename oa_* to osmo_oap_* Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10115 Change subject: oap_client: rename oa_* to osmo_oap_* ...................................................................... oap_client: rename oa_* to osmo_oap_* As we're moving this to a common/shared library now, we need to use the osmo_ namespace prefix for symbol names, struct/type names and constants. Change-Id: Ifa777de6293bac5d4817c11dc2420fa6631c8b41 --- M include/osmocom/gsupclient/gsup_client.h M include/osmocom/gsupclient/oap_client.h M src/gsupclient/gsup_client.c M src/gsupclient/oap_client.c 4 files changed, 44 insertions(+), 44 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/15/10115/1 diff --git a/include/osmocom/gsupclient/gsup_client.h b/include/osmocom/gsupclient/gsup_client.h index e8be11f..6af50dc 100644 --- a/include/osmocom/gsupclient/gsup_client.h +++ b/include/osmocom/gsupclient/gsup_client.h @@ -44,7 +44,7 @@ osmo_gsup_client_read_cb_t read_cb; void *data; - struct oap_client_state oap_state; + struct osmo_oap_client_state oap_state; struct osmo_timer_list ping_timer; struct osmo_timer_list connect_timer; @@ -57,7 +57,7 @@ const char *ip_addr, unsigned int tcp_port, osmo_gsup_client_read_cb_t read_cb, - struct oap_client_config *oapc_config); + struct osmo_oap_client_config *oapc_config); void osmo_gsup_client_destroy(struct osmo_gsup_client *gsupc); int osmo_gsup_client_send(struct osmo_gsup_client *gsupc, struct msgb *msg); diff --git a/include/osmocom/gsupclient/oap_client.h b/include/osmocom/gsupclient/oap_client.h index 80c86d5..763f982 100644 --- a/include/osmocom/gsupclient/oap_client.h +++ b/include/osmocom/gsupclient/oap_client.h @@ -30,7 +30,7 @@ /* This is the config part for vty. It is essentially copied in * oap_client_state, where values are copied over once the config is * considered valid. */ -struct oap_client_config { +struct osmo_oap_client_config { uint16_t client_id; int secret_k_present; uint8_t secret_k[16]; @@ -42,14 +42,14 @@ * duplicated from oap_client_config, so that a separate validation of the * config data is possible, and so that only a struct oap_client_state* is * passed around. */ -struct oap_client_state { +struct osmo_oap_client_state { enum { - OAP_UNINITIALIZED = 0, /* just allocated. */ - OAP_DISABLED, /* disabled by config. */ - OAP_INITIALIZED, /* enabled, config is valid. */ - OAP_REQUESTED_CHALLENGE, - OAP_SENT_CHALLENGE_RESULT, - OAP_REGISTERED + OSMO_OAP_UNINITIALIZED = 0, /* just allocated. */ + OSMO_OAP_DISABLED, /* disabled by config. */ + OSMO_OAP_INITIALIZED, /* enabled, config is valid. */ + OSMO_OAP_REQUESTED_CHALLENGE, + OSMO_OAP_SENT_CHALLENGE_RESULT, + OSMO_OAP_REGISTERED } state; uint16_t client_id; uint8_t secret_k[16]; @@ -58,25 +58,25 @@ }; /* From config, initialize state. Return 0 on success. */ -int oap_client_init(struct oap_client_config *config, - struct oap_client_state *state); +int osmo_oap_client_init(struct osmo_oap_client_config *config, + struct osmo_oap_client_state *state); /* Construct an OAP registration message and return in *msg_tx. Use * state->client_id and update state->state. * Return 0 on success, or a negative value on error. * If an error is returned, *msg_tx is guaranteed to be NULL. */ -int oap_client_register(struct oap_client_state *state, struct msgb **msg_tx); +int osmo_oap_client_register(struct osmo_oap_client_state *state, struct msgb **msg_tx); /* Decode and act on a received OAP message msg_rx. Update state->state. If a * non-NULL pointer is returned in *msg_tx, that msgb should be sent to the OAP * server (and freed) by the caller. The received msg_rx is not freed. * Return 0 on success, or a negative value on error. * If an error is returned, *msg_tx is guaranteed to be NULL. */ -int oap_client_handle(struct oap_client_state *state, - const struct msgb *msg_rx, struct msgb **msg_tx); +int osmo_oap_client_handle(struct osmo_oap_client_state *state, + const struct msgb *msg_rx, struct msgb **msg_tx); /* Allocate a msgb and in it, return the encoded oap_client_msg. Return * NULL on error. (Like oap_client_encode(), but also allocates a msgb.) * About the name: the idea is do_something(oap_client_encoded(my_struct)) */ -struct msgb *oap_client_encoded(const struct osmo_oap_message *oap_client_msg); +struct msgb *osmo_oap_client_encoded(const struct osmo_oap_message *oap_client_msg); diff --git a/src/gsupclient/gsup_client.c b/src/gsupclient/gsup_client.c index b4b138b..7cf58ea 100644 --- a/src/gsupclient/gsup_client.c +++ b/src/gsupclient/gsup_client.c @@ -112,7 +112,7 @@ { struct msgb *msg_tx; int rc; - rc = oap_client_register(&gsupc->oap_state, &msg_tx); + rc = osmo_oap_client_register(&gsupc->oap_state, &msg_tx); if ((rc < 0) || (!msg_tx)) { LOGP(DLGSUP, LOGL_ERROR, "GSUP OAP set up, but cannot register.\n"); @@ -134,7 +134,7 @@ if (up) { start_test_procedure(gsupc); - if (gsupc->oap_state.state == OAP_INITIALIZED) + if (gsupc->oap_state.state == OSMO_OAP_INITIALIZED) gsup_client_oap_register(gsupc); osmo_timer_del(&gsupc->connect_timer); @@ -152,7 +152,7 @@ struct msgb *msg_tx; /* If the oap_state is disabled, this will reject the messages. */ - rc = oap_client_handle(&gsupc->oap_state, msg_rx, &msg_tx); + rc = osmo_oap_client_handle(&gsupc->oap_state, msg_rx, &msg_tx); msgb_free(msg_rx); if (rc < 0) return rc; @@ -266,7 +266,7 @@ const char *ip_addr, unsigned int tcp_port, osmo_gsup_client_read_cb_t read_cb, - struct oap_client_config *oapc_config) + struct osmo_oap_client_config *oapc_config) { struct osmo_gsup_client *gsupc; int rc; @@ -281,7 +281,7 @@ OSMO_ASSERT(gsupc->unit_name); /* a NULL oapc_config will mark oap_state disabled. */ - rc = oap_client_init(oapc_config, &gsupc->oap_state); + rc = osmo_oap_client_init(oapc_config, &gsupc->oap_state); if (rc != 0) goto failed; diff --git a/src/gsupclient/oap_client.c b/src/gsupclient/oap_client.c index 9a0b60f..26b0fe0 100644 --- a/src/gsupclient/oap_client.c +++ b/src/gsupclient/oap_client.c @@ -30,10 +30,10 @@ #include -int oap_client_init(struct oap_client_config *config, - struct oap_client_state *state) +int osmo_oap_client_init(struct osmo_oap_client_config *config, + struct osmo_oap_client_state *state) { - OSMO_ASSERT(state->state == OAP_UNINITIALIZED); + OSMO_ASSERT(state->state == OSMO_OAP_UNINITIALIZED); if (!config) goto disable; @@ -54,11 +54,11 @@ state->client_id = config->client_id; memcpy(state->secret_k, config->secret_k, sizeof(state->secret_k)); memcpy(state->secret_opc, config->secret_opc, sizeof(state->secret_opc)); - state->state = OAP_INITIALIZED; + state->state = OSMO_OAP_INITIALIZED; return 0; disable: - state->state = OAP_DISABLED; + state->state = OSMO_OAP_DISABLED; return 0; } @@ -71,7 +71,7 @@ * response message and update the state. * Return 0 on success; -1 if OAP is disabled; -2 if rx_random and rx_autn fail * the authentication check; -3 for any other errors. */ -static int oap_evaluate_challenge(const struct oap_client_state *state, +static int oap_evaluate_challenge(const struct osmo_oap_client_state *state, const uint8_t *rx_random, const uint8_t *rx_autn, uint8_t *tx_xres) @@ -89,8 +89,8 @@ == sizeof(state->secret_opc), _secret_opc_size_match); switch (state->state) { - case OAP_UNINITIALIZED: - case OAP_DISABLED: + case OSMO_OAP_UNINITIALIZED: + case OSMO_OAP_DISABLED: return -1; default: break; @@ -124,7 +124,7 @@ return 0; } -struct msgb *oap_client_encoded(const struct osmo_oap_message *oap_msg) +struct msgb *osmo_oap_client_encoded(const struct osmo_oap_message *oap_msg) { struct msgb *msg = msgb_alloc_headroom(1000, 64, __func__); OSMO_ASSERT(msg); @@ -145,16 +145,16 @@ oap_msg.message_type = OAP_MSGT_REGISTER_REQUEST; oap_msg.client_id = client_id; - return oap_client_encoded(&oap_msg); + return osmo_oap_client_encoded(&oap_msg); } -int oap_client_register(struct oap_client_state *state, struct msgb **msg_tx) +int osmo_oap_client_register(struct osmo_oap_client_state *state, struct msgb **msg_tx) { *msg_tx = oap_msg_register(state->client_id); if (!(*msg_tx)) return -1; - state->state = OAP_REQUESTED_CHALLENGE; + state->state = OSMO_OAP_REQUESTED_CHALLENGE; return 0; } @@ -168,10 +168,10 @@ oap_reply.message_type = OAP_MSGT_CHALLENGE_RESULT; memcpy(oap_reply.xres, xres, sizeof(oap_reply.xres)); oap_reply.xres_present = 1; - return oap_client_encoded(&oap_reply); + return osmo_oap_client_encoded(&oap_reply); } -static int handle_challenge(struct oap_client_state *state, +static int handle_challenge(struct osmo_oap_client_state *state, struct osmo_oap_message *oap_rx, struct msgb **msg_tx) { @@ -199,17 +199,17 @@ goto failure; } - state->state = OAP_SENT_CHALLENGE_RESULT; + state->state = OSMO_OAP_SENT_CHALLENGE_RESULT; return 0; failure: OSMO_ASSERT(rc < 0); - state->state = OAP_INITIALIZED; + state->state = OSMO_OAP_INITIALIZED; return rc; } -int oap_client_handle(struct oap_client_state *state, - const struct msgb *msg_rx, struct msgb **msg_tx) +int osmo_oap_client_handle(struct osmo_oap_client_state *state, + const struct msgb *msg_rx, struct msgb **msg_tx) { uint8_t *data = msgb_l2(msg_rx); size_t data_len = msgb_l2len(msg_rx); @@ -229,12 +229,12 @@ } switch (state->state) { - case OAP_UNINITIALIZED: + case OSMO_OAP_UNINITIALIZED: LOGP(DLOAP, LOGL_ERROR, "Received OAP message %d, but the OAP client is" " not initialized\n", oap_msg.message_type); return -ENOTCONN; - case OAP_DISABLED: + case OSMO_OAP_DISABLED: LOGP(DLOAP, LOGL_ERROR, "Received OAP message %d, but the OAP client is" " disabled\n", oap_msg.message_type); @@ -249,16 +249,16 @@ case OAP_MSGT_REGISTER_RESULT: /* successfully registered */ - state->state = OAP_REGISTERED; + state->state = OSMO_OAP_REGISTERED; break; case OAP_MSGT_REGISTER_ERROR: LOGP(DLOAP, LOGL_ERROR, "OAP registration failed\n"); - state->state = OAP_INITIALIZED; + state->state = OSMO_OAP_INITIALIZED; if (state->registration_failures < 3) { state->registration_failures++; - return oap_client_register(state, msg_tx); + return osmo_oap_client_register(state, msg_tx); } return -11; -- To view, visit https://gerrit.osmocom.org/10115 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ifa777de6293bac5d4817c11dc2420fa6631c8b41 Gerrit-Change-Number: 10115 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 12:41:23 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 23 Jul 2018 12:41:23 +0000 Subject: Change in libosmocore[master]: logging: Fix logging level all Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10116 Change subject: logging: Fix logging level all ...................................................................... logging: Fix logging level all This commit fixes "logging level all " to have a behavior which makes sense. First, old "everything" deprecated loglevel is dropped and re-used as "unset", which can be used to set loglevel for a given category to whatever the logtarget defaults to. When using "logging level all", VTY sets default log level to and resets all log categories to UNSET. Then user can specify specific log levels for specific categories using "logging level ". For instance: log stderr logging level all error logging level l1p notice Will print ERROR messages for all categories and NOTICE+ERROR messages for L1P category. Another example: In the VTY, while debugging: * logging level all error -> Only all ERRORs are printed * logging level l1p debug -> all INFO+NOTICE+ERROR for L1P, and all ERROR are printed. Now, user is interested to debug some other category, eg. TRX: * logging level l1p unset -> L1P goes back to target default (ERROR) * logging level trx debug -> we get all TRX logs. Fixes: OS#3409 Change-Id: I0f50ad8d6fd038398f7d751287417505c8dcdeff --- M include/osmocom/core/logging.h M src/logging.c M src/vty/logging_vty.c 3 files changed, 27 insertions(+), 21 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/16/10116/1 diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h index e68f618..5d4fd36 100644 --- a/include/osmocom/core/logging.h +++ b/include/osmocom/core/logging.h @@ -97,6 +97,7 @@ } while(0) /*! different log levels */ +#define LOGL_UNSET 0 /*!< Log level unset. Internal, don't use. */ #define LOGL_DEBUG 1 /*!< debugging information */ #define LOGL_INFO 3 /*!< general information */ #define LOGL_NOTICE 5 /*!< abnormal/unexpected condition */ diff --git a/src/logging.c b/src/logging.c index 1dfd484..7631ad1 100644 --- a/src/logging.c +++ b/src/logging.c @@ -67,7 +67,7 @@ #define LOGLEVEL_DEFS 6 /* Number of loglevels.*/ static const struct value_string loglevel_strs[LOGLEVEL_DEFS+1] = { - { 0, "EVERYTHING" }, + { 0, "UNSET" }, { LOGL_DEBUG, "DEBUG" }, { LOGL_INFO, "INFO" }, { LOGL_NOTICE, "NOTICE" }, @@ -178,7 +178,7 @@ /*! descriptive string for each log level */ /* You have to keep this in sync with the structure loglevel_strs. */ static const char *loglevel_descriptions[LOGLEVEL_DEFS+1] = { - "Don't use. It doesn't log anything", + "Unsets previous logging level for that category", "Log debug messages and higher levels", "Log informational messages and higher levels", "Log noticeable messages and higher levels", @@ -474,13 +474,13 @@ if (!category->enabled) return false; - /* Check the global log level */ - if (tar->loglevel != 0 && level < tar->loglevel) + /* Check the category log level */ + if (category->loglevel != LOGL_UNSET && level < category->loglevel) return false; - /* Check the category log level */ - if (tar->loglevel == 0 && category->loglevel != 0 && - level < category->loglevel) + /* Check the global log level */ + if (category->loglevel == LOGL_UNSET && tar->loglevel != LOGL_UNSET && + level < tar->loglevel) return false; /* Apply filters here... if that becomes messy we will @@ -714,7 +714,19 @@ */ void log_set_log_level(struct log_target *target, int log_level) { + int i; + target->loglevel = log_level; + + for (i = 0; i < osmo_log_info->num_cat; i++) { + struct log_category *cat = &target->categories[i]; + + /* skip empty entries in the array */ + if (!osmo_log_info->cat[i].name) + continue; + + cat->loglevel = LOGL_UNSET; + } } /*! Set a category filter on a given log target @@ -783,7 +795,7 @@ target->print_category_hex = true; /* global log level */ - target->loglevel = 0; + target->loglevel = LOGL_UNSET; return target; } diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index 8151fda..80df73a 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -279,11 +279,6 @@ return CMD_WARNING; } - if (strcmp(argv[1], "everything") == 0) { /* FIXME: remove this check once 'everything' is phased out */ - vty_out(vty, "%% Ignoring deprecated logging level %s%s", argv[1], VTY_NEWLINE); - return CMD_SUCCESS; - } - /* Check for special case where we want to set global log level */ if (!strcmp(argv[0], "all")) { log_set_log_level(tgt, level); @@ -811,18 +806,16 @@ if (!osmo_log_info->cat[i].name) continue; + /* skip unset categories */ + if (cat->loglevel == LOGL_UNSET) + continue; + /* stupid old osmo logging API uses uppercase strings... */ osmo_str2lower(cat_lower, osmo_log_info->cat[i].name+1); osmo_str2lower(level_lower, log_level_str(cat->loglevel)); - - if (strcmp(level_lower, "everything") != 0) /* FIXME: remove this check once 'everything' is phased out */ - vty_out(vty, " logging level %s %s%s", cat_lower, level_lower, VTY_NEWLINE); - else - LOGP(DLSTATS, LOGL_ERROR, "logging level everything is deprecated and should not be used\n"); + vty_out(vty, " logging level %s %s%s", cat_lower, level_lower, VTY_NEWLINE); } - /* FIXME: levels */ - return 1; } @@ -846,7 +839,7 @@ { struct cmd_element *cmd = talloc_zero(ctx, struct cmd_element); OSMO_ASSERT(cmd); - cmd->string = talloc_asprintf(cmd, "logging level %s (everything|debug|info|notice|error|fatal)", + cmd->string = talloc_asprintf(cmd, "logging level %s (unset|debug|info|notice|error|fatal)", name); printf("%s\n", cmd->string); cmd->func = log_deprecated_func; -- To view, visit https://gerrit.osmocom.org/10116 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I0f50ad8d6fd038398f7d751287417505c8dcdeff Gerrit-Change-Number: 10116 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 12:41:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Jul 2018 12:41:27 +0000 Subject: Change in osmo-hlr[master]: import gsup_client + oap_client as new libosmo-gsup-client In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10113 to look at the new patch set (#2). Change subject: import gsup_client + oap_client as new libosmo-gsup-client ...................................................................... import gsup_client + oap_client as new libosmo-gsup-client This imports the code from osmo-msc 6afef893e17bce67e4d4119acd34d480ed03ba77 with minimal changes to make it compile. Symbol renaming ot osmo_ prefix is done separately in a follow-up patch to have a as-clean-as-possible import first. Change-Id: Ief50054ad135551625b684ed8a0486f7af0b2940 --- M .gitignore M Makefile.am M configure.ac A include/Makefile.am A include/osmocom/gsupclient/gsup_client.h A include/osmocom/gsupclient/oap_client.h A libosmo-gsup-client.pc.in M src/Makefile.am A src/gsupclient/Makefile.am A src/gsupclient/gsup_client.c A src/gsupclient/gsup_test_client.c A src/gsupclient/oap_client.c 12 files changed, 1,132 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/13/10113/2 -- To view, visit https://gerrit.osmocom.org/10113 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ief50054ad135551625b684ed8a0486f7af0b2940 Gerrit-Change-Number: 10113 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 12:42:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Jul 2018 12:42:46 +0000 Subject: Change in osmo-hlr[master]: import gsup_client + oap_client as new libosmo-gsup-client In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10113 ) Change subject: import gsup_client + oap_client as new libosmo-gsup-client ...................................................................... Patch Set 2: Code-Review-1 in general, it makes sense to move oap_client to libosmocore or libosmo-netif, as it is used in non-GSUP-contexts like by osmo-bsc_nat. -- To view, visit https://gerrit.osmocom.org/10113 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ief50054ad135551625b684ed8a0486f7af0b2940 Gerrit-Change-Number: 10113 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 23 Jul 2018 12:42:46 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 13:42:21 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 23 Jul 2018 13:42:21 +0000 Subject: Change in libosmocore[master]: logging: Fix logging level all In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/10116 ) Change subject: logging: Fix logging level all ...................................................................... Patch Set 1: (3 comments) https://gerrit.osmocom.org/#/c/10116/1/src/logging.c File src/logging.c: https://gerrit.osmocom.org/#/c/10116/1/src/logging.c at 70 PS1, Line 70: 0 Feel free to use 'LOGL_UNSET' here ;) https://gerrit.osmocom.org/#/c/10116/1/src/logging.c at 721 PS1, Line 721: for (i = 0; i < osmo_log_info->num_cat; i++) { Would be great to have a comment here, what this loop is actually doing? Resetting all categories to 'unset'? As I understand, setting: logging level all error logging level l1p notice logging level l1c error and then: logging level all notice would reset log_levels for both 'l1p' and 'l1c' to 'unset'? What if I need to change to global logging level without resetting the existing categories? I think we can introduce something like this: logging level all notice [reset] or like this: logging level global notice // Only changes the global logging level all notice // Resets all categories to 'notice' What do you think? https://gerrit.osmocom.org/#/c/10116/1/src/vty/logging_vty.c File src/vty/logging_vty.c: https://gerrit.osmocom.org/#/c/10116/1/src/vty/logging_vty.c at a283 PS1, Line 283: Probably, it makes sense to keep informing user that 'everything' is deprecated, but now is reused as 'unset'... -- To view, visit https://gerrit.osmocom.org/10116 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0f50ad8d6fd038398f7d751287417505c8dcdeff Gerrit-Change-Number: 10116 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 23 Jul 2018 13:42:21 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 13:53:15 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 23 Jul 2018 13:53:15 +0000 Subject: Change in libosmocore[master]: logging: Fix logging level all In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10116 ) Change subject: logging: Fix logging level all ...................................................................... Patch Set 1: (3 comments) https://gerrit.osmocom.org/#/c/10116/1/src/logging.c File src/logging.c: https://gerrit.osmocom.org/#/c/10116/1/src/logging.c at 70 PS1, Line 70: 0 > Feel free to use 'LOGL_UNSET' here ;) Good catch, thanks. https://gerrit.osmocom.org/#/c/10116/1/src/logging.c at 721 PS1, Line 721: for (i = 0; i < osmo_log_info->num_cat; i++) { > Would be great to have a comment here, what this loop [?] About what the loop does: yes, it resets all categories to unset. Regarding your example: yes, it works like that. I also thought about what you mentioned. I actually thought about calling it "logging level unset ", which would basically apply to all unset categories. It would be the same as "all", but without forcing reset of the categories. I even though about changing log_set_log_level() to contain a "bool reset" param, but since it's actually a public API we cannot do that. Looking at current users of log_set_log_level() through all osmocom projects, I think in general the desired behaviour is to reset the categories. I would then have another function to log_set_log_level2(struct log_target *target, int log_level, bool reset), and use the reset=false only in the case of "logging level unset " in VTY. Agree? https://gerrit.osmocom.org/#/c/10116/1/src/vty/logging_vty.c File src/vty/logging_vty.c: https://gerrit.osmocom.org/#/c/10116/1/src/vty/logging_vty.c at a283 PS1, Line 283: > Probably, it makes sense to keep informing user that 'everything' is deprecated, but now is reused a [?] I would expect "everything" to not be available anymore after this patch, so parsing should fail before this point. -- To view, visit https://gerrit.osmocom.org/10116 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0f50ad8d6fd038398f7d751287417505c8dcdeff Gerrit-Change-Number: 10116 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 23 Jul 2018 13:53:15 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Mon Jul 23 15:10:07 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Mon, 23 Jul 2018 15:10:07 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-asn1c_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#193?= In-Reply-To: <1185752000.36.1532272207201.JavaMail.jenkins@jenkins.osmocom.org> References: <1185752000.36.1532272207201.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <829703170.49.1532358607168.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 3.67 KB...] + ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for style of include used by make... GNU checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking how to run the C++ preprocessor... g++ -E checking for g77... no checking for f77... no checking for xlf... no checking for frt... no checking for pgf77... no checking for cf77... no checking for fort77... no checking for fl32... no checking for af77... no checking for f90... no checking for xlf90... no checking for pgf90... no checking for pghpf... no checking for epcf90... no checking for gfortran... no checking for g95... no checking for f95... no checking for fort... no checking for xlf95... no checking for ifort... no checking for ifc... no checking for efc... no checking for pgf95... no checking for lf95... no checking for ftn... no checking whether we are using the GNU Fortran 77 compiler... no checking whether accepts -g... no checking the maximum length of command line arguments... 32768 checking command to parse /usr/bin/nm -B output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes configure: creating libtool appending configuration tag "CXX" to libtool checking for ld used by g++... /usr/bin/ld -m elf_x86_64 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC checking if g++ PIC flag -fPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate appending configuration tag "F77" to libtool checking for autoconf... /usr/bin/autoconf checking for autoheader... /usr/bin/autoheader checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking dependency style of gcc... (cached) gcc3 checking how to run the C preprocessor... gcc -E checking for a BSD-compatible install... /usr/bin/install -c checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking for bison... bison -y checking for flex... flex checking for yywrap in -lfl... yes checking lex output file root... lex.yy checking whether yytext is a pointer... yes checking for ar... /usr/bin/ar checking for ANSI C header files... (cached) yes checking sys/param.h usability... yes checking sys/param.h presence... yes checking for sys/param.h... yes checking whether byte ordering is bigendian... no checking for off_t... yes checking for size_t... yes checking whether struct tm is in sys/time.h or time.h... time.h checking for intmax_t... yes checking for library containing getopt... none required checking for strtoimax... yes checking for strtoll... yes checking for mergesort... no checking for mkstemps... yes configure: creating ./config.status config.status: creating skeletons/standard-modules/Makefile config.status: creating skeletons/tests/Makefile config.status: creating libasn1compiler/Makefile config.status: creating libasn1parser/Makefile config.status: creating libasn1print/Makefile config.status: creating asn1c/webcgi/Makefile config.status: creating asn1c/tests/Makefile config.status: creating libasn1fix/Makefile config.status: creating skeletons/Makefile config.status: creating examples/Makefile config.status: creating tests/Makefile config.status: creating asn1c/Makefile config.status: creating doc/Makefile config.status: creating asn1c.spec config.status: creating Makefile config.status: creating config.h config.status: executing depfiles commands + make -j 8 make all-recursive make[1]: Entering directory ' Making all in libasn1parser make[2]: Entering directory ' if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF ".deps/asn1parser.Tpo" -c -o asn1parser.lo asn1parser.c; \ then mv -f ".deps/asn1parser.Tpo" ".deps/asn1parser.Plo"; else rm -f ".deps/asn1parser.Tpo"; exit 1; fi bison -y -p asn1p_ -d asn1p_y.y if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF ".deps/asn1p_l.Tpo" -c -o asn1p_l.lo asn1p_l.c; \ then mv -f ".deps/asn1p_l.Tpo" ".deps/asn1p_l.Plo"; else rm -f ".deps/asn1p_l.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF ".deps/asn1p_module.Tpo" -c -o asn1p_module.lo asn1p_module.c; \ then mv -f ".deps/asn1p_module.Tpo" ".deps/asn1p_module.Plo"; else rm -f ".deps/asn1p_module.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF ".deps/asn1p_oid.Tpo" -c -o asn1p_oid.lo asn1p_oid.c; \ then mv -f ".deps/asn1p_oid.Tpo" ".deps/asn1p_oid.Plo"; else rm -f ".deps/asn1p_oid.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF ".deps/asn1p_value.Tpo" -c -o asn1p_value.lo asn1p_value.c; \ then mv -f ".deps/asn1p_value.Tpo" ".deps/asn1p_value.Plo"; else rm -f ".deps/asn1p_value.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF ".deps/asn1p_expr.Tpo" -c -o asn1p_expr.lo asn1p_expr.c; \ then mv -f ".deps/asn1p_expr.Tpo" ".deps/asn1p_expr.Plo"; else rm -f ".deps/asn1p_expr.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF ".deps/asn1p_xports.Tpo" -c -o asn1p_xports.lo asn1p_xports.c; \ then mv -f ".deps/asn1p_xports.Tpo" ".deps/asn1p_xports.Plo"; else rm -f ".deps/asn1p_xports.Tpo"; exit 1; fi asn1p_y.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] mkdir .libs gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -fPIC -DPIC -o .libs/asn1p_xports.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -fPIC -DPIC -o .libs/asn1p_value.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -fPIC -DPIC -o .libs/asn1p_l.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -fPIC -DPIC -o .libs/asn1p_expr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -fPIC -DPIC -o .libs/asn1p_module.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -fPIC -DPIC -o .libs/asn1parser.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -fPIC -DPIC -o .libs/asn1p_oid.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -o asn1p_xports.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -o asn1p_module.o >/dev/null 2>&1 asn1p_l.c:3521:12: warning: 'input' defined but not used [-Wunused-function] static int input() ^~~~~ gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -o asn1p_oid.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -o asn1parser.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF ".deps/asn1p_constr.Tpo" -c -o asn1p_constr.lo asn1p_constr.c; \ then mv -f ".deps/asn1p_constr.Tpo" ".deps/asn1p_constr.Plo"; else rm -f ".deps/asn1p_constr.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -o asn1p_value.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF ".deps/asn1p_param.Tpo" -c -o asn1p_param.lo asn1p_param.c; \ then mv -f ".deps/asn1p_param.Tpo" ".deps/asn1p_param.Plo"; else rm -f ".deps/asn1p_param.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -o asn1p_expr.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF ".deps/asn1p_class.Tpo" -c -o asn1p_class.lo asn1p_class.c; \ then mv -f ".deps/asn1p_class.Tpo" ".deps/asn1p_class.Plo"; else rm -f ".deps/asn1p_class.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF ".deps/asn1p_ref.Tpo" -c -o asn1p_ref.lo asn1p_ref.c; \ then mv -f ".deps/asn1p_ref.Tpo" ".deps/asn1p_ref.Plo"; else rm -f ".deps/asn1p_ref.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -fPIC -DPIC -o .libs/asn1p_param.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -fPIC -DPIC -o .libs/asn1p_constr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -fPIC -DPIC -o .libs/asn1p_class.o if test -f y.tab.h; then \ to=`echo "asn1p_y_H" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \ sed -e "/^#/!b" -e "s/Y_TAB_H/$to/g" -e "s|y\.tab\.h|asn1p_y.h|" \ y.tab.h >asn1p_y.ht; \ rm -f y.tab.h; \ if cmp -s asn1p_y.ht asn1p_y.h; then \ rm -f asn1p_y.ht ;\ else \ mv asn1p_y.ht asn1p_y.h; \ fi; \ fi if test -f y.output; then \ mv y.output asn1p_y.output; \ fi sed '/^#/ s|y\.tab\.c|asn1p_y.c|' y.tab.c >asn1p_y.ct && mv asn1p_y.ct asn1p_y.c gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -fPIC -DPIC -o .libs/asn1p_ref.o rm -f y.tab.c if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF ".deps/asn1p_y.Tpo" -c -o asn1p_y.lo asn1p_y.c; \ then mv -f ".deps/asn1p_y.Tpo" ".deps/asn1p_y.Plo"; else rm -f ".deps/asn1p_y.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -o asn1p_param.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -o asn1p_constr.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -o asn1p_ref.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -o asn1p_class.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF .deps/asn1p_y.Tpo -c asn1p_y.c -fPIC -DPIC -o .libs/asn1p_y.o asn1p_y.y: In function 'asn1p_parse': asn1p_y.y:357:13: error: 'param' undeclared (first use in this function) *(void **)param = $1; ^~~~~ asn1p_y.y:357:13: note: each undeclared identifier is reported only once for each function it appears in Makefile:299: recipe for target 'asn1p_y.lo' failed make[2]: *** [asn1p_y.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -o asn1p_l.o >/dev/null 2>&1 make[2]: Leaving directory ' Makefile:302: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory ' Makefile:212: recipe for target 'all' failed make: *** [all] Error 2 Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Mon Jul 23 16:40:05 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Jul 2018 16:40:05 +0000 Subject: Change in osmo-mgw[master]: cosmetic: mgcp_network.c: merge one LOGPC to its preceding LOGP Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10117 Change subject: cosmetic: mgcp_network.c: merge one LOGPC to its preceding LOGP ...................................................................... cosmetic: mgcp_network.c: merge one LOGPC to its preceding LOGP Change-Id: I4dde8a060ec77e1234a373d7501c7082ae4c5028 --- M src/libosmo-mgcp/mgcp_network.c 1 file changed, 3 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/17/10117/1 diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c index 870a4de..7d98d07 100644 --- a/src/libosmo-mgcp/mgcp_network.c +++ b/src/libosmo-mgcp/mgcp_network.c @@ -680,12 +680,9 @@ } LOGP(DRTP, LOGL_DEBUG, - "endpoint:0x%x loop:%d, mode:%d ", - ENDPOINT_NUMBER(endp), tcfg->audio_loop, conn_src->conn->mode); - if (conn_src->conn->mode == MGCP_CONN_LOOPBACK) - LOGPC(DRTP, LOGL_DEBUG, "(loopback)\n"); - else - LOGPC(DRTP, LOGL_DEBUG, "\n"); + "endpoint:0x%x loop:%d, mode:%d%s\n", + ENDPOINT_NUMBER(endp), tcfg->audio_loop, conn_src->conn->mode, + conn_src->conn->mode == MGCP_CONN_LOOPBACK ? " (loopback)" : ""); /* Note: In case of loopback configuration, both, the source and the * destination will point to the same connection. */ -- To view, visit https://gerrit.osmocom.org/10117 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I4dde8a060ec77e1234a373d7501c7082ae4c5028 Gerrit-Change-Number: 10117 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 16:40:06 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Jul 2018 16:40:06 +0000 Subject: Change in osmo-mgw[master]: IuUP hack: make RTP patching less general Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10118 Change subject: IuUP hack: make RTP patching less general ...................................................................... IuUP hack: make RTP patching less general We currently still patch over an RTP message to make it look like an IuUP Initialization Ack specifically for the ip.access nano3G femto cell. Be more specific about it: - only patch over RTP in 'loopback' mode. osmo-msc specifically leaves the endpoint in loopback mode for this hack, so if we're not in 'loopback', then this hack is out of place. - only patch over RTP if the header indicates an IuUP Initialization (check for 0xe4 byte). Change-Id: Ia9ec4debc138b34f6ca6a871a8778eafa6c0ba21 --- M src/libosmo-mgcp/mgcp_network.c 1 file changed, 11 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/18/10118/1 diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c index 7d98d07..3ac93be 100644 --- a/src/libosmo-mgcp/mgcp_network.c +++ b/src/libosmo-mgcp/mgcp_network.c @@ -732,11 +732,18 @@ * 'e400', or it will reject the RAB assignment. It seems to not harm other femto * cells (as long as we patch only the first RTP payload in each stream). */ - if (!rtp_state->patched_first_rtp_payload) { + if (!rtp_state->patched_first_rtp_payload + && conn_src->conn->mode == MGCP_CONN_LOOPBACK) { uint8_t *data = (uint8_t *) & buf[12]; - data[0] = 0xe4; - data[1] = 0x00; - rtp_state->patched_first_rtp_payload = true; + if (data[0] == 0xe0) { + data[0] = 0xe4; + data[1] = 0x00; + rtp_state->patched_first_rtp_payload = true; + LOGP(DRTP, LOGL_DEBUG, + "endpoint:0x%x Patching over first two bytes" + " to fake an IuUP Initialization Ack\n", + ENDPOINT_NUMBER(endp)); + } } len = mgcp_udp_send(rtp_end->rtp.fd, -- To view, visit https://gerrit.osmocom.org/10118 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ia9ec4debc138b34f6ca6a871a8778eafa6c0ba21 Gerrit-Change-Number: 10118 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 16:40:06 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 23 Jul 2018 16:40:06 +0000 Subject: Change in osmo-mgw[master]: fix 3G hack: allow any IP for loopback and 0.0.0.0 Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10119 Change subject: fix 3G hack: allow any IP for loopback and 0.0.0.0 ...................................................................... fix 3G hack: allow any IP for loopback and 0.0.0.0 HACK: for IuUP, we want to reply with an IuUP Initialization ACK upon the first RTP message received. We currently hackishly accomplish that by putting the endpoint in loopback mode and patching over the looped back RTP message to make it look like an ack. We don't know the femto cell's IP address and port until the RAB Assignment Response is received, but the nano3G expects an IuUP Initialization Ack before it even sends the RAB Assignment Response. Hence, if the remote address is 0.0.0.0 and the MGCP port is in loopback mode, allow looping back the packet to any source. None of these are anything near nice, during call setup using a 3G femto cell, we still lack a proper IuUP handling. See OS#2459, OS#1937. This is merely a temporary hack to maintain 3G voice usability in a quick and dirty way. Related: OS#3411 Change-Id: Ib25e6261855eae8ddb8d1c0b8838cc3e30332cf1 --- M src/libosmo-mgcp/mgcp_network.c 1 file changed, 16 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/19/10119/1 diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c index 3ac93be..6884db9 100644 --- a/src/libosmo-mgcp/mgcp_network.c +++ b/src/libosmo-mgcp/mgcp_network.c @@ -829,6 +829,22 @@ { struct mgcp_endpoint *endp; endp = conn->conn->endp; + struct sockaddr_in zero_addr = {}; + + if (memcmp(&zero_addr, &conn->end.addr, sizeof(zero_addr)) == 0 + && conn->conn->mode == MGCP_CONN_LOOPBACK) { + /* HACK: for IuUP, we want to reply with an IuUP Initialization ACK upon the first RTP + * message received. We currently hackishly accomplish that by putting the endpoint in + * loopback mode and patching over the looped back RTP message to make it look like an + * ack. We don't know the femto cell's IP address and port until the RAB Assignment + * Response is received, but the nano3G expects an IuUP Initialization Ack before it even + * sends the RAB Assignment Response. Hence, if the remote address is 0.0.0.0 and the + * MGCP port is in loopback mode, allow looping back the packet to any source. */ + LOGP(DRTP, LOGL_ERROR, + "endpoint:0x%x In loopback mode and remote address not set: allowing data from address: %s\n", + ENDPOINT_NUMBER(endp), inet_ntoa(addr->sin_addr)); + return 0; + } /* Note: Check if the inbound RTP data comes from the same host to * which we send our outgoing RTP traffic. */ -- To view, visit https://gerrit.osmocom.org/10119 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ib25e6261855eae8ddb8d1c0b8838cc3e30332cf1 Gerrit-Change-Number: 10119 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 17:24:08 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 23 Jul 2018 17:24:08 +0000 Subject: Change in libosmocore[master]: logging: Fix logging level all In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/10116 ) Change subject: logging: Fix logging level all ...................................................................... Patch Set 1: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/10116/1/src/logging.c File src/logging.c: https://gerrit.osmocom.org/#/c/10116/1/src/logging.c at 721 PS1, Line 721: for (i = 0; i < osmo_log_info->num_cat; i++) { > I also thought about what you mentioned. I actually thought about > calling it "logging level unset ", which would basically > apply to all unset categories. It would be the same as "all", but > without forcing reset of the categories. I think it would be even more flexible to have a separate command: logging level unset-all which would do the only thing - resetting all categories, and nothing else. > I even though about changing log_set_log_level() to contain a "bool reset" > param, but since it's actually a public API we cannot do that. In any case, it's strange that so simple one-line function, that only changes the publicly available member of a logging target, is a part of the public API... > Looking at current users of log_set_log_level() through all osmocom projects, > I think in general the desired behaviour is to reset the categories. > I would then have another function: > log_set_log_level2(struct log_target *target, int log_level, bool reset), > and use the reset=false only in the case of: > "logging level unset " > in VTY. Oh, let's please avoid introducing foo2, bar3, etc., especially in the cases when it isn't that important and not that hard to give a better name... Instead, let's have a separate function (UNIX way) just to reset the logging categories to 'unset'? It could be done in a separate change I think. We should also ask both Neels and Harald, as Neels has been working some VTY changes, and Harald has lots of experience in general... https://gerrit.osmocom.org/#/c/10116/1/src/vty/logging_vty.c File src/vty/logging_vty.c: https://gerrit.osmocom.org/#/c/10116/1/src/vty/logging_vty.c at a283 PS1, Line 283: > I would expect "everything" to not be available anymore after this patch, so parsing should fail bef [?] Still not sure about this, sorry. We are going to drop some deprecated functionality in core by hiding this as a part of flabbily related change... That can be also done and discussed in a separate change. -- To view, visit https://gerrit.osmocom.org/10116 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0f50ad8d6fd038398f7d751287417505c8dcdeff Gerrit-Change-Number: 10116 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 23 Jul 2018 17:24:08 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 19:31:55 2018 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 23 Jul 2018 19:31:55 +0000 Subject: Change in osmocom-bb[master]: Move from libc random() to osmo_get_rand_id (2nd attempt) In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10098 to look at the new patch set (#2). Change subject: Move from libc random() to osmo_get_rand_id (2nd attempt) ...................................................................... Move from libc random() to osmo_get_rand_id (2nd attempt) When starting multiple mobile in the same second, the libc random number generator will be seeded to exactly the same value. The random bits inside the RACH request(s) will be exactly the same across multiple mobile and when the channel fails they all pick the same randomized back-off timing. Use stronger random numbers and replace all calls to random(2) with osmo_get_rand_id. Add a fallback to try random(). [v2: Add helper to make sure the result is int and between 0 and RAND_MAX] Change-Id: Icdd4be88c62bba1e9d954568e48f0c12a67ac182 --- M src/host/layer23/include/osmocom/bb/common/Makefile.am A src/host/layer23/include/osmocom/bb/common/utils.h M src/host/layer23/src/common/Makefile.am A src/host/layer23/src/common/utils.c M src/host/layer23/src/mobile/gsm322.c M src/host/layer23/src/mobile/gsm48_mm.c M src/host/layer23/src/mobile/gsm48_rr.c M src/host/layer23/src/mobile/settings.c 8 files changed, 64 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/98/10098/2 -- To view, visit https://gerrit.osmocom.org/10098 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icdd4be88c62bba1e9d954568e48f0c12a67ac182 Gerrit-Change-Number: 10098 Gerrit-PatchSet: 2 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 19:33:16 2018 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 23 Jul 2018 19:33:16 +0000 Subject: Change in osmocom-bb[master]: Move from libc random() to osmo_get_rand_id (2nd attempt) In-Reply-To: References: Message-ID: Holger Freyther has posted comments on this change. ( https://gerrit.osmocom.org/10098 ) Change subject: Move from libc random() to osmo_get_rand_id (2nd attempt) ...................................................................... Patch Set 2: * Moved the function (and need to rename...) * int because random(3) is long int... and I wanted maximum compat after the failure you ran into. -- To view, visit https://gerrit.osmocom.org/10098 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Icdd4be88c62bba1e9d954568e48f0c12a67ac182 Gerrit-Change-Number: 10098 Gerrit-PatchSet: 2 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 23 Jul 2018 19:33:16 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 19:39:34 2018 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 23 Jul 2018 19:39:34 +0000 Subject: Change in osmocom-bb[master]: Move from libc random() to osmo_get_rand_id (2nd attempt) In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10098 to look at the new patch set (#3). Change subject: Move from libc random() to osmo_get_rand_id (2nd attempt) ...................................................................... Move from libc random() to osmo_get_rand_id (2nd attempt) When starting multiple mobile in the same second, the libc random number generator will be seeded to exactly the same value. The random bits inside the RACH request(s) will be exactly the same across multiple mobile and when the channel fails they all pick the same randomized back-off timing. Use stronger random numbers and replace all calls to random(2) with osmo_get_rand_id. Add a fallback to try random(). [v2: Add helper to make sure the result is int and between 0 and RAND_MAX] Change-Id: Icdd4be88c62bba1e9d954568e48f0c12a67ac182 --- M src/host/layer23/include/osmocom/bb/common/Makefile.am A src/host/layer23/include/osmocom/bb/common/utils.h M src/host/layer23/src/common/Makefile.am A src/host/layer23/src/common/utils.c M src/host/layer23/src/mobile/gsm322.c M src/host/layer23/src/mobile/gsm48_mm.c M src/host/layer23/src/mobile/gsm48_rr.c M src/host/layer23/src/mobile/settings.c 8 files changed, 64 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/98/10098/3 -- To view, visit https://gerrit.osmocom.org/10098 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icdd4be88c62bba1e9d954568e48f0c12a67ac182 Gerrit-Change-Number: 10098 Gerrit-PatchSet: 3 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 19:46:33 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 23 Jul 2018 19:46:33 +0000 Subject: Change in osmocom-bb[master]: Move from libc random() to osmo_get_rand_id (2nd attempt) In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/10098 ) Change subject: Move from libc random() to osmo_get_rand_id (2nd attempt) ...................................................................... Patch Set 3: (3 comments) https://gerrit.osmocom.org/#/c/10098/3/src/host/layer23/src/mobile/gsm48_mm.c File src/host/layer23/src/mobile/gsm48_mm.c: https://gerrit.osmocom.org/#/c/10098/3/src/host/layer23/src/mobile/gsm48_mm.c at 33 PS3, Line 33: #include This include is not required. https://gerrit.osmocom.org/#/c/10098/3/src/host/layer23/src/mobile/gsm48_rr.c File src/host/layer23/src/mobile/gsm48_rr.c: https://gerrit.osmocom.org/#/c/10098/3/src/host/layer23/src/mobile/gsm48_rr.c at 74 PS3, Line 74: #include This include is not required. https://gerrit.osmocom.org/#/c/10098/3/src/host/layer23/src/mobile/settings.c File src/host/layer23/src/mobile/settings.c: https://gerrit.osmocom.org/#/c/10098/3/src/host/layer23/src/mobile/settings.c at 26 PS3, Line 26: #include This include is not required. -- To view, visit https://gerrit.osmocom.org/10098 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Icdd4be88c62bba1e9d954568e48f0c12a67ac182 Gerrit-Change-Number: 10098 Gerrit-PatchSet: 3 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 23 Jul 2018 19:46:33 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 19:56:04 2018 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 23 Jul 2018 19:56:04 +0000 Subject: Change in osmocom-bb[master]: Move from libc random() to osmo_get_rand_id (2nd attempt) In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10098 to look at the new patch set (#4). Change subject: Move from libc random() to osmo_get_rand_id (2nd attempt) ...................................................................... Move from libc random() to osmo_get_rand_id (2nd attempt) When starting multiple mobile in the same second, the libc random number generator will be seeded to exactly the same value. The random bits inside the RACH request(s) will be exactly the same across multiple mobile and when the channel fails they all pick the same randomized back-off timing. Use stronger random numbers and replace all calls to random(2) with osmo_get_rand_id. Add a fallback to try random(). [v2: Add helper to make sure the result is int and between 0 and RAND_MAX] Change-Id: Icdd4be88c62bba1e9d954568e48f0c12a67ac182 --- M src/host/layer23/include/osmocom/bb/common/Makefile.am A src/host/layer23/include/osmocom/bb/common/utils.h M src/host/layer23/src/common/Makefile.am A src/host/layer23/src/common/utils.c M src/host/layer23/src/mobile/gsm322.c M src/host/layer23/src/mobile/gsm48_mm.c M src/host/layer23/src/mobile/gsm48_rr.c M src/host/layer23/src/mobile/settings.c 8 files changed, 61 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/98/10098/4 -- To view, visit https://gerrit.osmocom.org/10098 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icdd4be88c62bba1e9d954568e48f0c12a67ac182 Gerrit-Change-Number: 10098 Gerrit-PatchSet: 4 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 19:56:29 2018 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 23 Jul 2018 19:56:29 +0000 Subject: Change in osmocom-bb[master]: Move from libc random() to osmo_get_rand_id (2nd attempt) In-Reply-To: References: Message-ID: Holger Freyther has posted comments on this change. ( https://gerrit.osmocom.org/10098 ) Change subject: Move from libc random() to osmo_get_rand_id (2nd attempt) ...................................................................... Patch Set 3: Sorry about that. Fixed the extra includes and actually looked at the patch. -- To view, visit https://gerrit.osmocom.org/10098 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Icdd4be88c62bba1e9d954568e48f0c12a67ac182 Gerrit-Change-Number: 10098 Gerrit-PatchSet: 3 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 23 Jul 2018 19:56:29 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 22:15:45 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Jul 2018 22:15:45 +0000 Subject: Change in osmocom-bb[master]: Move from libc random() to osmo_get_rand_id (2nd attempt) In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10098 ) Change subject: Move from libc random() to osmo_get_rand_id (2nd attempt) ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10098 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Icdd4be88c62bba1e9d954568e48f0c12a67ac182 Gerrit-Change-Number: 10098 Gerrit-PatchSet: 4 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 23 Jul 2018 22:15:45 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 22:16:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Jul 2018 22:16:15 +0000 Subject: Change in osmo-mgw[master]: cosmetic: mgcp_network.c: merge one LOGPC to its preceding LOGP In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10117 ) Change subject: cosmetic: mgcp_network.c: merge one LOGPC to its preceding LOGP ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10117 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4dde8a060ec77e1234a373d7501c7082ae4c5028 Gerrit-Change-Number: 10117 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 23 Jul 2018 22:16:15 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 22:16:40 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Jul 2018 22:16:40 +0000 Subject: Change in osmo-mgw[master]: IuUP hack: make RTP patching less general In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10118 ) Change subject: IuUP hack: make RTP patching less general ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10118 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia9ec4debc138b34f6ca6a871a8778eafa6c0ba21 Gerrit-Change-Number: 10118 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 23 Jul 2018 22:16:40 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 23 22:18:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 23 Jul 2018 22:18:32 +0000 Subject: Change in osmo-bsc[master]: lcls: do not LCLS call legs with different codecs In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9940 ) Change subject: lcls: do not LCLS call legs with different codecs ...................................................................... Patch Set 3: assigning to neels to avoid further merge conflicts -- To view, visit https://gerrit.osmocom.org/9940 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I157549129a40c64364dc126f67195759e5f1d60f Gerrit-Change-Number: 9940 Gerrit-PatchSet: 3 Gerrit-Owner: dexter Gerrit-Assignee: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Mon, 23 Jul 2018 22:18:32 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 04:53:12 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 04:53:12 +0000 Subject: Change in osmo-bsc[master]: lcls: do not LCLS call legs with different codecs In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9940 ) Change subject: lcls: do not LCLS call legs with different codecs ...................................................................... Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/9940 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I157549129a40c64364dc126f67195759e5f1d60f Gerrit-Change-Number: 9940 Gerrit-PatchSet: 3 Gerrit-Owner: dexter Gerrit-Assignee: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Tue, 24 Jul 2018 04:53:12 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 04:54:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 04:54:15 +0000 Subject: Change in libosmocore[master]: oap_client: rename oa_* to osmo_oap_* In-Reply-To: References: Message-ID: Harald Welte has abandoned this change. ( https://gerrit.osmocom.org/10111 ) Change subject: oap_client: rename oa_* to osmo_oap_* ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/10111 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: Ifa777de6293bac5d4817c11dc2420fa6631c8b41 Gerrit-Change-Number: 10111 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 04:54:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 04:54:22 +0000 Subject: Change in libosmocore[master]: gsup_client: rename gsup_client_* to osmo_gsup_client_* In-Reply-To: References: Message-ID: Harald Welte has abandoned this change. ( https://gerrit.osmocom.org/10110 ) Change subject: gsup_client: rename gsup_client_* to osmo_gsup_client_* ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/10110 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: I294f8f96af4c5daa2b128962534426e04909290e Gerrit-Change-Number: 10110 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 04:54:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 04:54:27 +0000 Subject: Change in libosmocore[master]: import gsup_client + oap_client as new libosmo-gsup-client In-Reply-To: References: Message-ID: Harald Welte has abandoned this change. ( https://gerrit.osmocom.org/10109 ) Change subject: import gsup_client + oap_client as new libosmo-gsup-client ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/10109 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: Ief50054ad135551625b684ed8a0486f7af0b2940 Gerrit-Change-Number: 10109 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 04:56:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 04:56:36 +0000 Subject: Change in osmo-ggsn[master]: gtp: Add new replacement cb_recovery2 for cb_recovery In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10024 ) Change subject: gtp: Add new replacement cb_recovery2 for cb_recovery ...................................................................... Patch Set 3: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/10024/3/gtp/gtp.h File gtp/gtp.h: https://gerrit.osmocom.org/#/c/10024/3/gtp/gtp.h at 274 PS3, Line 274: int (*cb_recovery2) (struct sockaddr_in * peer, struct pdp_t * pdp, uint8_t recovery); ok, so we break ABI but we don't break API compatibility - that's not great but acceptable (and I see little other chances. We could have a union of cb_recovery + cb_recovery2, but then where would we stuff the bit to differentiate which of the two to use? -- To view, visit https://gerrit.osmocom.org/10024 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I53e92298f2f6b84d662a3300d922e8c2ccb178bc Gerrit-Change-Number: 10024 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 24 Jul 2018 04:56:36 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 05:06:35 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 05:06:35 +0000 Subject: Change in osmo-bsc[master]: inter-BSC HO: add neighbor_ident API to manage neighbor-BSS-cells In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9666 ) Change subject: inter-BSC HO: add neighbor_ident API to manage neighbor-BSS-cells ...................................................................... Patch Set 3: (4 comments) https://gerrit.osmocom.org/#/c/9666/3/include/osmocom/bsc/gsm_data.h File include/osmocom/bsc/gsm_data.h: https://gerrit.osmocom.org/#/c/9666/3/include/osmocom/bsc/gsm_data.h at 755 PS3, Line 755: struct gsm_bts_ref { > ah. [?] not a request, just a reminder for future cases. https://gerrit.osmocom.org/#/c/9666/3/include/osmocom/bsc/neighbor_ident.h File include/osmocom/bsc/neighbor_ident.h: https://gerrit.osmocom.org/#/c/9666/3/include/osmocom/bsc/neighbor_ident.h at 18 PS3, Line 18: BSIC_9BIT, > 23.003 "4.3.2 Base Station Identify Code (BSIC)" [?] Ah, I didn't follow EC-GSM-IoT yet in that level of detail. We don't support it (and it seems like it's becoming one of the "born dead" inventions of the GSM/3GPP specs). We don't deal with a 9bit BSIC in any other part of the code in BTS or BSC, so it might be offering options/choices to people that are more confusing than helping. Your call. Either keep it in, or #ifdef it out? https://gerrit.osmocom.org/#/c/9666/3/src/osmo-bsc/neighbor_ident_vty.c File src/osmo-bsc/neighbor_ident_vty.c: https://gerrit.osmocom.org/#/c/9666/3/src/osmo-bsc/neighbor_ident_vty.c at 560 PS3, Line 560: install_element(BTS_NODE, &cfg_neighbor_resolve_cmd); > hm, so when I'm in the bts node and entered some neighbor entries, I can't just query on the same le [?] yes, this separation about VIEW/ENABLE and CONFIG node exists. prefixing it with "show" is of course always an option, as long as it's in the VIEW/ENABLE node. https://gerrit.osmocom.org/#/c/9666/3/tests/handover/neighbor_ident_test.c File tests/handover/neighbor_ident_test.c: https://gerrit.osmocom.org/#/c/9666/3/tests/handover/neighbor_ident_test.c at 33 PS3, Line 33: arfcn > In the C API to neighbor_ident, the high bit should be handled transparently. [?] The User Interface and VTY is 0-1023. There are no higher ARFCN number. But the semantics of [some of that] number space differs whether the neighbor is in DCS or in PCS bands. I don't know the specs well enough to understand how they differentiate neighbors between those two bands. However, there are (supported) setups of our customers that either use 900+1800 (more standard) or (AFAIK) 900+1900 (!) MHz bands. Maybe this can be re-visited as a separate follow-up ticket, unrelated to the specific test case: Ensure that our neighbor-handling works correctly with neighbors in either DCS or PCS bands. -- To view, visit https://gerrit.osmocom.org/9666 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0153d7069817fba9146ddc11214de2757d7d37bf Gerrit-Change-Number: 9666 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 24 Jul 2018 05:06:35 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 05:08:05 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 05:08:05 +0000 Subject: Change in osmo-bsc[master]: doc: update/fix FSM charts In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9667 ) Change subject: doc: update/fix FSM charts ...................................................................... Patch Set 12: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9667 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I29e31b753e23a4207662e0e385a337e7df836f45 Gerrit-Change-Number: 9667 Gerrit-PatchSet: 12 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Tue, 24 Jul 2018 05:08:05 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 05:09:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 05:09:20 +0000 Subject: Change in osmo-bsc[master]: fix / clarify rsl dtap cache In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9668 ) Change subject: fix / clarify rsl dtap cache ...................................................................... Patch Set 12: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9668 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6ffd7aa641c8905292c769400048c96aa0949585 Gerrit-Change-Number: 9668 Gerrit-PatchSet: 12 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Tue, 24 Jul 2018 05:09:20 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 05:13:03 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 05:13:03 +0000 Subject: Change in osmo-bsc[master]: move RSL and RR related functions to abis_rsl.[hc] In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9669 ) Change subject: move RSL and RR related functions to abis_rsl.[hc] ...................................................................... Patch Set 12: > Maybe it makes more sense to move some of those out. I think > "_utils" still is a misnomer for the central Abis RR > implementation, could become abis_rr.c, but we don't really need to > rename the file. I agree, and I wouldn't mind the rename either. However, it's not "Abis RR", but "gsm0408_rr". Afte rall, RR is a Layer3 sub-layer spoken over Abis and Um. See also my recently-proposed patch to move the CC related 04.08 messages to a separate file in osmo-msc. > Then there is bsc_api.c, that appears to have been a kitchen sink > for everything and anything. We removed struct bsc_api already. Do > we agree on moving bsc_api.c's RR functions? yes, I would be more than happy with that. > If gsm_04_08_utils.c > is the main "RR" file, then maybe handle_rr_ho_*() and > gsm_04_08_rcvmsg should move from bsc_api.c to gsm_04_08_utils.c > instead of abis_rsl.c? ACK > (The only functions left in bsc_api.c are gsm0808_page() and > gsm0808_cipher_mode(), maybe they can move to the callers, paging.c > and osmo_bsc_bssap.c, to completely drop bsc_api.c) great! -- To view, visit https://gerrit.osmocom.org/9669 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie8ee334145bf7bc3a601d395ea7ab9b2009b61c7 Gerrit-Change-Number: 9669 Gerrit-PatchSet: 12 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte Gerrit-Comment-Date: Tue, 24 Jul 2018 05:13:03 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 05:24:58 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 05:24:58 +0000 Subject: Change in osmo-bsc[master]: cosmetic: FSMs: allow ignorable events In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10101 ) Change subject: cosmetic: FSMs: allow ignorable events ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10101 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie320c7c6a1436184aaf2ec5a1843e04f4b3414ab Gerrit-Change-Number: 10101 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 24 Jul 2018 05:24:58 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 05:25:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 05:25:14 +0000 Subject: Change in osmo-bsc[master]: fix BSC_CTR_ASSIGNMENT doc strings In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10102 ) Change subject: fix BSC_CTR_ASSIGNMENT doc strings ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10102 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9de0c16a14edd8bf4f02b7781ccfd211e0a79463 Gerrit-Change-Number: 10102 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 24 Jul 2018 05:25:14 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 05:26:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 05:26:53 +0000 Subject: Change in osmo-bsc[master]: lchan_fsm: split off lchan_rtp_fsm, establish RTP a bit earlier In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10103 ) Change subject: lchan_fsm: split off lchan_rtp_fsm, establish RTP a bit earlier ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10103 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id7a4407d9b63be05ce63f5f2768b7d7e3d5c86fb Gerrit-Change-Number: 10103 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 24 Jul 2018 05:26:53 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 05:27:42 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 05:27:42 +0000 Subject: Change in osmo-bsc[master]: lchan_fsm: add in_release_handler flag In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10104 ) Change subject: lchan_fsm: add in_release_handler flag ...................................................................... Patch Set 1: Code-Review+1 commit log could be more verbose, i.e. copy the comment string from gsm_data.h, otherwise +2 -- To view, visit https://gerrit.osmocom.org/10104 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iec41e006b6ab9d0f618d36925341f9536353e5d8 Gerrit-Change-Number: 10104 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 24 Jul 2018 05:27:42 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 05:27:56 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 05:27:56 +0000 Subject: Change in osmo-bsc[master]: allocate larger lchans if no SDCCH are available In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10105 ) Change subject: allocate larger lchans if no SDCCH are available ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10105 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2fcf9e9baa7d03974a367763f3f52f59dfc2cc51 Gerrit-Change-Number: 10105 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 24 Jul 2018 05:27:56 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 05:29:00 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 05:29:00 +0000 Subject: Change in osmo-bsc[master]: create separate logging categories for lchan, ts, as FSMs In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10106 ) Change subject: create separate logging categories for lchan,ts,as FSMs ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10106 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie889b8860a4a63c7c22ef65025f690d64cd7330c Gerrit-Change-Number: 10106 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 24 Jul 2018 05:29:00 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 05:29:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 05:29:11 +0000 Subject: Change in osmo-bsc[master]: cosmetic: constify gsm_bts_num() net arg In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10107 ) Change subject: cosmetic: constify gsm_bts_num() net arg ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10107 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9a078ffb781ee55c0ca114fa0d752c1b53067419 Gerrit-Change-Number: 10107 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 24 Jul 2018 05:29:11 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 05:29:38 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 05:29:38 +0000 Subject: Change in osmo-bsc[master]: vty: 'handover any': pick more random chans, use lchan_select_by_type() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10108 ) Change subject: vty: 'handover any': pick more random chans, use lchan_select_by_type() ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10108 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I50b70e02d665b967e401db65581e110bc83101e7 Gerrit-Change-Number: 10108 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 24 Jul 2018 05:29:38 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 05:34:30 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 05:34:30 +0000 Subject: Change in osmo-bsc[master]: large refactoring: use FSMs for lchans; add inter-BSC HO In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9671 ) Change subject: large refactoring: use FSMs for lchans; add inter-BSC HO ...................................................................... Patch Set 28: (1 comment) https://gerrit.osmocom.org/#/c/9671/28/src/osmo-bsc/handover_fsm.c File src/osmo-bsc/handover_fsm.c: https://gerrit.osmocom.org/#/c/9671/28/src/osmo-bsc/handover_fsm.c at 352 PS28, Line 352: { > @laforge, your opinion is against these inner scopes, but I don't really see a need to remove them. [?] it's just something I've never seen in the kernel, and we use kernel coding style in Osmocom. So my argument is "consistency with existing code base and documented coding style". Yes, "if" there was an if, I wouldn't flag it. we also add another indent level without any need for it, reducing the usable part of the line. A quick look at the function without reading it from top to bottom makes me think this is some kind of condition/branch/loop due to that extra indent, only to then discover no, this is normal, un-conditional "main body" of the function. -- To view, visit https://gerrit.osmocom.org/9671 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I82e3f918295daa83274a4cf803f046979f284366 Gerrit-Change-Number: 9671 Gerrit-PatchSet: 28 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Tue, 24 Jul 2018 05:34:30 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 06:52:45 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Tue, 24 Jul 2018 06:52:45 +0000 Subject: Change in osmo-ttcn3-hacks[master]: library: Ensure setverdict(fail is followed by mtc.stop In-Reply-To: References: Message-ID: daniel has posted comments on this change. ( https://gerrit.osmocom.org/9905 ) Change subject: library: Ensure setverdict(fail is followed by mtc.stop ...................................................................... Patch Set 1: testcase.stop will mark the testcase with an error verdict instead of failed. I tried to use it for all the times where our test infrastructure fails and not the test itself (so if a table for something we're tracking fills up). -- To view, visit https://gerrit.osmocom.org/9905 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Idc6819aaf0b01e70c38fad828dd44dcec6bdd778 Gerrit-Change-Number: 9905 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel Gerrit-Comment-Date: Tue, 24 Jul 2018 06:52:45 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 07:58:46 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Tue, 24 Jul 2018 07:58:46 +0000 Subject: Change in osmo-ttcn3-hacks[master]: library: Ensure setverdict(fail is followed by mtc.stop In-Reply-To: References: Message-ID: Hello Pau Espin Pedrol, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9905 to look at the new patch set (#2). Change subject: library: Ensure setverdict(fail is followed by mtc.stop ...................................................................... library: Ensure setverdict(fail is followed by mtc.stop This will prevent subsequent failures from overwriting the verdict so we can easily see the root cause of the test failure. Using testcase.stop instead for errors internal to our test infrastructure to mark them as test errors instead of failed. Change-Id: Idc6819aaf0b01e70c38fad828dd44dcec6bdd778 --- M library/BSSAP_Adapter.ttcn M library/BSSGP_Emulation.ttcn M library/BSSMAP_Emulation.ttcn M library/GSM_Types.ttcn M library/GSUP_Emulation.ttcn M library/GTP_Emulation.ttcn M library/GTP_Templates.ttcn M library/IPA_Emulation.ttcnpp M library/IuUP_Emulation.ttcn M library/L1CTL_PortType.ttcn M library/L3_Common.ttcn M library/LAPDm_RAW_PT.ttcn M library/MGCP_Emulation.ttcn M library/MGCP_Templates.ttcn M library/MNCC_Emulation.ttcn M library/MNCC_Types.ttcn M library/NS_Emulation.ttcn M library/Osmocom_CTRL_Adapter.ttcn M library/Osmocom_CTRL_Functions.ttcn M library/Osmocom_Types.ttcn M library/Osmocom_VTY_Functions.ttcn M library/PCUIF_CodecPort.ttcn M library/RSL_Emulation.ttcn M library/RTP_Emulation.ttcn M library/SIP_Emulation.ttcn M library/SMPP_Emulation.ttcn M library/TRXC_CodecPort.ttcn 27 files changed, 148 insertions(+), 148 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/05/9905/2 -- To view, visit https://gerrit.osmocom.org/9905 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Idc6819aaf0b01e70c38fad828dd44dcec6bdd778 Gerrit-Change-Number: 9905 Gerrit-PatchSet: 2 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 07:58:46 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Tue, 24 Jul 2018 07:58:46 +0000 Subject: Change in osmo-ttcn3-hacks[master]: Stop tests after failures In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9907 to look at the new patch set (#2). Change subject: Stop tests after failures ...................................................................... Stop tests after failures Call mtc.stop after setverdict(fail), add reasons to most failures and fail with verdict error for internal errors. Change-Id: I9b618235939fa41160b9be6677b121963d3ec857 --- M bsc/BSC_Tests.ttcn M bsc/MSC_ConnectionHandler.ttcn M hlr/HLR_Tests.ttcn M mgw/MGCP_Test.ttcn M mgw/RTP_Endpoint.ttcn M msc/BSC_ConnectionHandler.ttcn M msc/MSC_Tests.ttcn M pcu/GPRS_TBF.ttcn M pcu/PCU_Tests.ttcn M selftest/Selftest.ttcn M sgsn/SGSN_Tests.ttcn M sip/SIP_Tests.ttcn M sysinfo/Test.ttcn 13 files changed, 189 insertions(+), 112 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/07/9907/2 -- To view, visit https://gerrit.osmocom.org/9907 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9b618235939fa41160b9be6677b121963d3ec857 Gerrit-Change-Number: 9907 Gerrit-PatchSet: 2 Gerrit-Owner: daniel Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 07:58:48 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Tue, 24 Jul 2018 07:58:48 +0000 Subject: Change in osmo-ttcn3-hacks[master]: Fail if f_streamId_by_trx() can't find a stream id Message-ID: daniel has uploaded this change for review. ( https://gerrit.osmocom.org/10120 Change subject: Fail if f_streamId_by_trx() can't find a stream id ...................................................................... Fail if f_streamId_by_trx() can't find a stream id Change-Id: Ie58278edf7050254d7cdced48b4b7870e0e8d577 --- M library/RSL_Emulation.ttcn 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/20/10120/1 diff --git a/library/RSL_Emulation.ttcn b/library/RSL_Emulation.ttcn index 3c035e9..c56c278 100644 --- a/library/RSL_Emulation.ttcn +++ b/library/RSL_Emulation.ttcn @@ -318,7 +318,8 @@ case (2) { return IPAC_PROTO_RSL_TRX2; } case (3) { return IPAC_PROTO_RSL_TRX3; } } - self.stop; + setverdict(fail, "Unknown stream ID ", trx_nr); + mtc.stop; } -- To view, visit https://gerrit.osmocom.org/10120 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ie58278edf7050254d7cdced48b4b7870e0e8d577 Gerrit-Change-Number: 10120 Gerrit-PatchSet: 1 Gerrit-Owner: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 07:59:04 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Tue, 24 Jul 2018 07:59:04 +0000 Subject: Change in osmo-ttcn3-hacks[master]: library: Ensure setverdict(fail is followed by mtc.stop In-Reply-To: References: Message-ID: daniel has posted comments on this change. ( https://gerrit.osmocom.org/9905 ) Change subject: library: Ensure setverdict(fail is followed by mtc.stop ...................................................................... Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/9905/1/library/BSSGP_Emulation.ttcn File library/BSSGP_Emulation.ttcn: https://gerrit.osmocom.org/#/c/9905/1/library/BSSGP_Emulation.ttcn at 291 PS1, Line 291: testcase.stop("Client Table full"); > Why do you use testcase.stop instead of setverdict(fail) + mtc. [?] testcase.stop will mark the testcase as error so I tried using that for internal errors of our test infrastructure. I updated the commit message to clarify. https://gerrit.osmocom.org/#/c/9905/1/library/Osmocom_Types.ttcn File library/Osmocom_Types.ttcn: https://gerrit.osmocom.org/#/c/9905/1/library/Osmocom_Types.ttcn at 98 PS1, Line 98: setverdict(fail, "Unsupported template", inp); > I'd say this one cannot be reached, so we can drop it. Done -- To view, visit https://gerrit.osmocom.org/9905 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Idc6819aaf0b01e70c38fad828dd44dcec6bdd778 Gerrit-Change-Number: 9905 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel Gerrit-Comment-Date: Tue, 24 Jul 2018 07:59:04 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 08:00:00 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 24 Jul 2018 08:00:00 +0000 Subject: Change in simtrace2[master]: cardem: fix typo Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/10121 Change subject: cardem: fix typo ...................................................................... cardem: fix typo Change-Id: Ibeeb01b21a3ccfa74642f13694a20054e920837e --- M firmware/libcommon/source/card_emu.c M firmware/libcommon/source/mode_cardemu.c 2 files changed, 8 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/21/10121/1 diff --git a/firmware/libcommon/source/card_emu.c b/firmware/libcommon/source/card_emu.c index 94a601a..25ec36a 100644 --- a/firmware/libcommon/source/card_emu.c +++ b/firmware/libcommon/source/card_emu.c @@ -189,7 +189,7 @@ return msg; } -/* Update cardemu_usb_msg_rx_data length + submit bufffer */ +/* Update cardemu_usb_msg_rx_data length + submit buffer */ static void flush_rx_buffer(struct card_handle *ch) { struct msgb *msg; @@ -202,14 +202,14 @@ ch->uart_rx_msg = NULL; - /* store length of data payload fild in header */ + /* store length of data payload field in header */ rd = (struct cardemu_usb_msg_rx_data *) msg->l2h; rd->data_len = msgb_l2len(msg) - sizeof(*rd); usb_buf_upd_len_and_submit(msg); } -/* convert a non-contiguous PTS request/responsei into a contiguous +/* convert a non-contiguous PTS request/response into a contiguous * buffer, returning the number of bytes used in the buffer */ static int serialize_pts(uint8_t *out, const uint8_t *in) { @@ -301,7 +301,7 @@ ch->fi = 1; ch->di = 1; emu_update_fidi(ch); - /* initialize todefault WI, this will be overwritten if we + /* initialize to default WI, this will be overwritten if we * receive TC2, and it will be programmed into hardware after * ATR is finished */ ch->wi = ISO7816_3_DEFAULT_WI; @@ -334,7 +334,7 @@ * PTS / PPS handling **********************************************************************/ -/* Update the ATR sub-state */ +/* Update the PTS sub-state */ static void set_pts_state(struct card_handle *ch, enum pts_state new_ptss) { TRACE_DEBUG("%u: 7816 PTS state %u -> %u\r\n", @@ -974,7 +974,7 @@ INIT_LLIST_HEAD(&ch->uart_tx_queue); - /* initialize the card_handle with reasonabe defaults */ + /* initialize the card_handle with reasonable defaults */ ch->num = slot_num; ch->irq_ep = irq_ep; ch->in_ep = in_ep; diff --git a/firmware/libcommon/source/mode_cardemu.c b/firmware/libcommon/source/mode_cardemu.c index b1d9c7a..7bb06f9 100644 --- a/firmware/libcommon/source/mode_cardemu.c +++ b/firmware/libcommon/source/mode_cardemu.c @@ -203,7 +203,7 @@ csr = usart->US_CSR & usart->US_IMR; if (csr & US_CSR_RXRDY) { - byte = (usart->US_RHR) & 0xFF; + byte = (usart->US_RHR) & 0xFF; if (rbuf_write(&ci->rb, byte) < 0) TRACE_ERROR("rbuf overrun\r\n"); } @@ -341,7 +341,7 @@ #endif /* DETECT_VCC_BY_ADC */ /*********************************************************************** - * Core USB / mainloop integration + * Core USB / main loop integration ***********************************************************************/ static void usim1_rst_irqhandler(const Pin *pPin) -- To view, visit https://gerrit.osmocom.org/10121 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ibeeb01b21a3ccfa74642f13694a20054e920837e Gerrit-Change-Number: 10121 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 08:00:00 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 24 Jul 2018 08:00:00 +0000 Subject: Change in simtrace2[master]: cardem: fix USB message parsing Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/10122 Change subject: cardem: fix USB message parsing ...................................................................... cardem: fix USB message parsing the msg->l2h pointer was not set but used later on, e.g. in dispatch_usb_command_cardem, case SIMTRACE_MSGT_DT_CEMU_SET_ATR): > case SIMTRACE_MSGT_DT_CEMU_SET_ATR: > > atr = (struct cardemu_usb_msg_set_atr *) msg->l2h; > > card_emu_set_atr(ci->ch, atr->atr, atr->atr_len); l2h is by default 0, thus not pointing to the actual message l2h. I wonder how cardem worked worked before with this issue though. Change-Id: Ifbb53dbf478d8dade82251f769e78e1306e77434 --- M firmware/libcommon/source/mode_cardemu.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/22/10122/1 diff --git a/firmware/libcommon/source/mode_cardemu.c b/firmware/libcommon/source/mode_cardemu.c index 7bb06f9..57d541b 100644 --- a/firmware/libcommon/source/mode_cardemu.c +++ b/firmware/libcommon/source/mode_cardemu.c @@ -593,6 +593,7 @@ usb_buf_free(msg); return; } + msg->l2h = msg->l1h + sizeof(*sh); switch (sh->msg_class) { case SIMTRACE_MSGC_GENERIC: @@ -604,7 +605,6 @@ case SIMTRACE_MSGC_MODEM: /* FIXME: Find out why this fails if used for != * MSGC_MODEM ?!? */ - msg->l2h = msg->l1h + sizeof(*sh); dispatch_usb_command_modem(msg, ci); break; default: -- To view, visit https://gerrit.osmocom.org/10122 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ifbb53dbf478d8dade82251f769e78e1306e77434 Gerrit-Change-Number: 10122 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 08:00:00 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 24 Jul 2018 08:00:00 +0000 Subject: Change in simtrace2[master]: I2C: add wait time after write to let EEPROM write Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/10123 Change subject: I2C: add wait time after write to let EEPROM write ...................................................................... I2C: add wait time after write to let EEPROM write The Atmel AT24C02 defines a maximum tWR waiting time after a byte write of 5 ms before a next write. Enforcing this wait time also fixed the failed verification in qmod, where it was reading 0xffff instead of the written value. Change-Id: I42c90b8d0329e425f275067e87d584212a43a90b --- M firmware/libboard/qmod/source/i2c.c 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/23/10123/1 diff --git a/firmware/libboard/qmod/source/i2c.c b/firmware/libboard/qmod/source/i2c.c index 06c7565..a708704 100644 --- a/firmware/libboard/qmod/source/i2c.c +++ b/firmware/libboard/qmod/source/i2c.c @@ -185,6 +185,8 @@ nack = i2c_write_byte(false, true, byte); if (nack) goto out_stop; + /* Wait tWR time to ensure EEPROM is writing correctly (tWR = 5 ms for AT24C02) */ + mdelay(5); out_stop: i2c_stop_cond(); -- To view, visit https://gerrit.osmocom.org/10123 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I42c90b8d0329e425f275067e87d584212a43a90b Gerrit-Change-Number: 10123 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 08:00:01 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 24 Jul 2018 08:00:01 +0000 Subject: Change in simtrace2[master]: I2C: return error after failed write Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/10124 Change subject: I2C: return error after failed write ...................................................................... I2C: return error after failed write The previous mechanism of retrying a failed write could become a infinite blocking loop (until watchdog tiemout). Also the array size is used to know how much data to write and verify instead of a constant. Change-Id: I8d2d090c5f4d1195f4c7eb29b3958a7bb05f56ec --- M firmware/libboard/qmod/source/board_qmod.c 1 file changed, 7 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/24/10124/1 diff --git a/firmware/libboard/qmod/source/board_qmod.c b/firmware/libboard/qmod/source/board_qmod.c index 7ae1978..47a4cb6 100644 --- a/firmware/libboard/qmod/source/board_qmod.c +++ b/firmware/libboard/qmod/source/board_qmod.c @@ -70,8 +70,6 @@ #include "i2c.h" static int write_hub_eeprom(void) { - const unsigned int __eeprom_bin_len = 256; - int i; /* wait */ @@ -79,16 +77,18 @@ TRACE_INFO("Writing EEPROM...\n\r"); /* write the EEPROM once */ - for (i = 0; i < 256; i++) { + for (i = 0; i < ARRAY_SIZE(__eeprom_bin); i++) { int rc = eeprom_write_byte(0x50, i, __eeprom_bin[i]); - /* if the result was negative, repeat that write */ - if (rc < 0) - i--; + if (rc < 0) { + TRACE_ERROR("Writing EEPROM failed at byte %u: 0x%02x\n\r", + i, __eeprom_bin[i]); + return 1; + } } /* then pursue re-reading it again and again */ TRACE_INFO("Verifying EEPROM...\n\r"); - for (i = 0; i < 256; i++) { + for (i = 0; i < ARRAY_SIZE(__eeprom_bin); i++) { int byte = eeprom_read_byte(0x50, i); TRACE_INFO("0x%02x: %02x\n\r", i, byte); if (byte != __eeprom_bin[i]) -- To view, visit https://gerrit.osmocom.org/10124 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I8d2d090c5f4d1195f4c7eb29b3958a7bb05f56ec Gerrit-Change-Number: 10124 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 08:00:01 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Tue, 24 Jul 2018 08:00:01 +0000 Subject: Change in simtrace2[master]: USB: print decoded USB error Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/10125 Change subject: USB: print decoded USB error ...................................................................... USB: print decoded USB error In case of error it also ensures the returned value is NULL. Else a segfault would occur because the caller (e.g. remsim) continued on with a free handler. Change-Id: Ie7f20e3eff03acf77eb08283747ca8e032b9b4c8 --- M host/libusb_util.c 1 file changed, 10 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/25/10125/1 diff --git a/host/libusb_util.c b/host/libusb_util.c index 8565372..cb435e2 100644 --- a/host/libusb_util.c +++ b/host/libusb_util.c @@ -250,34 +250,39 @@ (strlen(ifm->path) && !strcmp(path, ifm->path))) { rc = libusb_open(*dev, &usb_devh); if (rc < 0) { - perror("Cannot open device"); + fprintf(stderr, "Cannot open device: %s\n", libusb_error_name(rc)); + usb_devh = NULL; break; } rc = libusb_get_configuration(usb_devh, &config); if (rc < 0) { - perror("Cannot get current configuration"); + fprintf(stderr, "Cannot get current configuration: %s\n", libusb_error_name(rc)); libusb_close(usb_devh); + usb_devh = NULL; break; } if (config != ifm->configuration) { rc = libusb_set_configuration(usb_devh, ifm->configuration); if (rc < 0) { - perror("Cannot set configuration"); + fprintf(stderr, "Cannot set configuration: %s\n", libusb_error_name(rc)); libusb_close(usb_devh); + usb_devh = NULL; break; } } rc = libusb_claim_interface(usb_devh, ifm->interface); if (rc < 0) { - perror("Cannot claim interface"); + fprintf(stderr, "Cannot claim interface: %s\n", libusb_error_name(rc)); libusb_close(usb_devh); + usb_devh = NULL; break; } rc = libusb_set_interface_alt_setting(usb_devh, ifm->interface, ifm->altsetting); if (rc < 0) { - perror("Cannot set interface altsetting"); + fprintf(stderr, "Cannot set interface altsetting: %s\n", libusb_error_name(rc)); libusb_release_interface(usb_devh, ifm->interface); libusb_close(usb_devh); + usb_devh = NULL; break; } } -- To view, visit https://gerrit.osmocom.org/10125 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ie7f20e3eff03acf77eb08283747ca8e032b9b4c8 Gerrit-Change-Number: 10125 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 08:01:59 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Tue, 24 Jul 2018 08:01:59 +0000 Subject: Change in osmo-ttcn3-hacks[master]: Stop tests after failures In-Reply-To: References: Message-ID: daniel has posted comments on this change. ( https://gerrit.osmocom.org/9907 ) Change subject: Stop tests after failures ...................................................................... Patch Set 1: No, that works. The problem was setverdict(fail), "foo", foo, "bar"); instead of setverdict(fail, "foo", foo, "bar"); I built most of the other tests/ran them through docker, but I forgot sysinfo... -- To view, visit https://gerrit.osmocom.org/9907 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9b618235939fa41160b9be6677b121963d3ec857 Gerrit-Change-Number: 9907 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-CC: Pau Espin Pedrol Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 24 Jul 2018 08:01:59 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 09:15:11 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 24 Jul 2018 09:15:11 +0000 Subject: Change in osmo-ttcn3-hacks[master]: Stop tests after failures In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9907 ) Change subject: Stop tests after failures ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/9907 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9b618235939fa41160b9be6677b121963d3ec857 Gerrit-Change-Number: 9907 Gerrit-PatchSet: 2 Gerrit-Owner: daniel Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 24 Jul 2018 09:15:11 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 09:18:04 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 24 Jul 2018 09:18:04 +0000 Subject: Change in osmo-ttcn3-hacks[master]: library: Ensure setverdict(fail is followed by mtc.stop In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9905 ) Change subject: library: Ensure setverdict(fail is followed by mtc.stop ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/9905 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Idc6819aaf0b01e70c38fad828dd44dcec6bdd778 Gerrit-Change-Number: 9905 Gerrit-PatchSet: 2 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel Gerrit-Comment-Date: Tue, 24 Jul 2018 09:18:04 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 09:24:15 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 24 Jul 2018 09:24:15 +0000 Subject: Change in osmo-ttcn3-hacks[master]: Fail if f_streamId_by_trx() can't find a stream id In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10120 ) Change subject: Fail if f_streamId_by_trx() can't find a stream id ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/10120 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie58278edf7050254d7cdced48b4b7870e0e8d577 Gerrit-Change-Number: 10120 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 24 Jul 2018 09:24:15 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 09:33:11 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 24 Jul 2018 09:33:11 +0000 Subject: Change in osmo-ggsn[master]: gtp: Add new replacement cb_recovery2 for cb_recovery In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10024 ) Change subject: gtp: Add new replacement cb_recovery2 for cb_recovery ...................................................................... Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/10024/3/gtp/gtp.h File gtp/gtp.h: https://gerrit.osmocom.org/#/c/10024/3/gtp/gtp.h at 274 PS3, Line 274: int (*cb_recovery2) (struct sockaddr_in * peer, struct pdp_t * pdp, uint8_t recovery); > ok, so we break ABI but we don't break API compatibility - that's not great but acceptable (and I se [?] We could move cb_recovery2 to the end of the struct since it is always accessed through pointers, so at least field access wouldn't change, but we'd still break the ABI. -- To view, visit https://gerrit.osmocom.org/10024 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I53e92298f2f6b84d662a3300d922e8c2ccb178bc Gerrit-Change-Number: 10024 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 24 Jul 2018 09:33:11 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 09:34:23 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 24 Jul 2018 09:34:23 +0000 Subject: Change in osmo-ggsn[master]: gtp: Add new replacement cb_recovery2 for cb_recovery In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/10024 ) Change subject: gtp: Add new replacement cb_recovery2 for cb_recovery ...................................................................... gtp: Add new replacement cb_recovery2 for cb_recovery Sometimes the originating pdp ctx causing the Recovery Procedure is required, in order to drop all pdp ctx but this one, which specs specify should be handled as valid: """ The SGSN receiving the Recovery information element shall handle it as when an Echo Response message is received but shall consider the PDP context being created as active if the response indicates successful context activation at the GGSN. """ Change-Id: I53e92298f2f6b84d662a3300d922e8c2ccb178bc --- M gtp/gtp.c M gtp/gtp.h 2 files changed, 45 insertions(+), 12 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/gtp/gtp.c b/gtp/gtp.c index 95abbef..1d58088 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -190,6 +190,15 @@ return 0; } +static void emit_cb_recovery(struct gsn_t *gsn, struct sockaddr_in * peer, + struct pdp_t * pdp, uint8_t recovery) +{ + if (gsn->cb_recovery) + gsn->cb_recovery(peer, recovery); + if (gsn->cb_recovery2) + gsn->cb_recovery2(peer, pdp, recovery); +} + int gtp_set_cb_recovery(struct gsn_t *gsn, int (*cb) (struct sockaddr_in * peer, uint8_t recovery)) { @@ -197,6 +206,20 @@ return 0; } +/* cb_recovery() + * pdp may be NULL if Recovery IE was received from a message independent + * of any PDP ctx (such as Echo Response), or because pdp ctx is unknown to the + * local setup. In case pdp is known, caller may want to keep that pdp alive to + * handle subsequent msg cb as this specific pdp ctx is still valid according to + * specs. + */ +int gtp_set_cb_recovery2(struct gsn_t *gsn, + int (*cb_recovery2) (struct sockaddr_in * peer, struct pdp_t * pdp, uint8_t recovery)) +{ + gsn->cb_recovery2 = cb_recovery2; + return 0; +} + int gtp_set_cb_data_ind(struct gsn_t *gsn, int (*cb_data_ind) (struct pdp_t * pdp, void *pack, unsigned len)) @@ -977,8 +1000,7 @@ if (gsn->cb_conf) gsn->cb_conf(type, recovery, NULL, cbp); - if (gsn->cb_recovery) - gsn->cb_recovery(peer, recovery); + emit_cb_recovery(gsn, peer, NULL, recovery); return 0; } @@ -1310,6 +1332,8 @@ struct pdp_t pdp_buf; union gtpie_member *ie[GTPIE_SIZE]; uint8_t recovery; + bool recovery_recvd = false; + int rc; uint16_t seq = get_seq(pack); int hlen = get_hlen(pack); @@ -1410,8 +1434,8 @@ /* Recovery (optional) */ if (!gtpie_gettv1(ie, GTPIE_RECOVERY, 0, &recovery)) { - if (gsn->cb_recovery) - gsn->cb_recovery(peer, recovery); + /* we use recovery futher down after announcing new pdp ctx to user */ + recovery_recvd = true; } /* Selection mode (conditional) */ @@ -1612,6 +1636,9 @@ /* Switch to using the old pdp context */ pdp = pdp_old; + if (recovery_recvd) + emit_cb_recovery(gsn, peer, pdp, recovery); + /* Confirm to peer that things were "successful" */ return gtp_create_pdp_resp(gsn, version, pdp, GTPCAUSE_ACC_REQ); @@ -1633,13 +1660,16 @@ /* Callback function to validata login */ if (gsn->cb_create_context_ind != 0) - return gsn->cb_create_context_ind(pdp); + rc = gsn->cb_create_context_ind(pdp); else { GTP_LOGPKG(LOGL_ERROR, peer, pack, len, "No create_context_ind callback defined\n"); - return gtp_create_pdp_resp(gsn, version, pdp, + rc = gtp_create_pdp_resp(gsn, version, pdp, GTPCAUSE_NOT_SUPPORTED); } + if (recovery_recvd) + emit_cb_recovery(gsn, peer, pdp, recovery); + return rc; } /* Handle Create PDP Context Response */ @@ -1696,8 +1726,7 @@ /* Extract recovery (optional) */ if (!gtpie_gettv1(ie, GTPIE_RECOVERY, 0, &recovery)) { - if (gsn->cb_recovery) - gsn->cb_recovery(peer, recovery); + emit_cb_recovery(gsn, peer, pdp, recovery); } /* Extract protocol configuration options (optional) */ @@ -2106,8 +2135,7 @@ /* Recovery (optional) */ if (!gtpie_gettv1(ie, GTPIE_RECOVERY, 0, &recovery)) { - if (gsn->cb_recovery) - gsn->cb_recovery(peer, recovery); + emit_cb_recovery(gsn, peer, pdp, recovery); } if (version == 0) { @@ -2267,8 +2295,7 @@ /* Extract recovery (optional) */ if (!gtpie_gettv1(ie, GTPIE_RECOVERY, 0, &recovery)) { - if (gsn->cb_recovery) - gsn->cb_recovery(peer, recovery); + emit_cb_recovery(gsn, peer, pdp, recovery); } /* Check all conditional information elements */ diff --git a/gtp/gtp.h b/gtp/gtp.h index f185424..ed594f1 100644 --- a/gtp/gtp.h +++ b/gtp/gtp.h @@ -271,6 +271,7 @@ int (*cb_conf) (int type, int cause, struct pdp_t * pdp, void *cbp); int (*cb_data_ind) (struct pdp_t * pdp, void *pack, unsigned len); int (*cb_recovery) (struct sockaddr_in * peer, uint8_t recovery); + int (*cb_recovery2) (struct sockaddr_in * peer, struct pdp_t * pdp, uint8_t recovery); /* Counters */ @@ -361,6 +362,11 @@ int gtp_set_cb_recovery(struct gsn_t *gsn, int (*cb) (struct sockaddr_in * peer, + uint8_t recovery)) + OSMO_DEPRECATED("Use gtp_set_cb_recovery2() instead, to obtain pdp ctx originating the recovery"); +int gtp_set_cb_recovery2(struct gsn_t *gsn, + int (*cb) (struct sockaddr_in * peer, + struct pdp_t * pdp, uint8_t recovery)); /* Internal functions (not part of the API */ -- To view, visit https://gerrit.osmocom.org/10024 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I53e92298f2f6b84d662a3300d922e8c2ccb178bc Gerrit-Change-Number: 10024 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 09:39:33 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 24 Jul 2018 09:39:33 +0000 Subject: Change in osmo-sgsn[master]: sgsn: Fix crash using new libgtp cb_recovery2 API In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10025 to look at the new patch set (#6). Change subject: sgsn: Fix crash using new libgtp cb_recovery2 API ...................................................................... sgsn: Fix crash using new libgtp cb_recovery2 API When PDP CTX CREATE ACK is received with an increased RestartCtr, cb_recovery2 is called first, which will dettach ggsn from al pdp ctx (free the pdp_t). But when giving control back from the ctrl, libgtp still uses that freed ctx and sends it back to osmo-sgsn through cb_conf(). As specs state in any case that we need to handle the message containing the increased RestartCtr as valid, we then need to avoid freeing the pdp ctx and leave handling for later in cb_conf. Depends: osmo-ggsn (libgtp) Change-Id I53e92298f2f6b84d662a3300d922e8c2ccb178bc. Change-Id: I0989c00e18ca95a099e1a312940eaac71957b444 --- M include/osmocom/sgsn/gprs_sgsn.h M src/gprs/gprs_sgsn.c M src/gprs/sgsn_libgtp.c 3 files changed, 16 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/25/10025/6 -- To view, visit https://gerrit.osmocom.org/10025 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0989c00e18ca95a099e1a312940eaac71957b444 Gerrit-Change-Number: 10025 Gerrit-PatchSet: 6 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 09:55:02 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 09:55:02 +0000 Subject: Change in osmo-ttcn3-hacks[master]: library: Ensure setverdict(fail) is followed by mtc.stop In-Reply-To: References: Message-ID: Neels Hofmeyr has uploaded a new patch set (#3) to the change originally created by daniel. ( https://gerrit.osmocom.org/9905 ) Change subject: library: Ensure setverdict(fail) is followed by mtc.stop ...................................................................... library: Ensure setverdict(fail) is followed by mtc.stop This will prevent subsequent failures from overwriting the verdict so we can easily see the root cause of the test failure. Using testcase.stop instead for errors internal to our test infrastructure to mark them as test errors instead of failed. Change-Id: Idc6819aaf0b01e70c38fad828dd44dcec6bdd778 --- M library/BSSAP_Adapter.ttcn M library/BSSGP_Emulation.ttcn M library/BSSMAP_Emulation.ttcn M library/GSM_Types.ttcn M library/GSUP_Emulation.ttcn M library/GTP_Emulation.ttcn M library/GTP_Templates.ttcn M library/IPA_Emulation.ttcnpp M library/IuUP_Emulation.ttcn M library/L1CTL_PortType.ttcn M library/L3_Common.ttcn M library/LAPDm_RAW_PT.ttcn M library/MGCP_Emulation.ttcn M library/MGCP_Templates.ttcn M library/MNCC_Emulation.ttcn M library/MNCC_Types.ttcn M library/NS_Emulation.ttcn M library/Osmocom_CTRL_Adapter.ttcn M library/Osmocom_CTRL_Functions.ttcn M library/Osmocom_Types.ttcn M library/Osmocom_VTY_Functions.ttcn M library/PCUIF_CodecPort.ttcn M library/RSL_Emulation.ttcn M library/RTP_Emulation.ttcn M library/SIP_Emulation.ttcn M library/SMPP_Emulation.ttcn M library/TRXC_CodecPort.ttcn 27 files changed, 148 insertions(+), 148 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/05/9905/3 -- To view, visit https://gerrit.osmocom.org/9905 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Idc6819aaf0b01e70c38fad828dd44dcec6bdd778 Gerrit-Change-Number: 9905 Gerrit-PatchSet: 3 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 09:55:07 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 09:55:07 +0000 Subject: Change in osmo-ttcn3-hacks[master]: library: Ensure setverdict(fail) is followed by mtc.stop In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9905 ) Change subject: library: Ensure setverdict(fail) is followed by mtc.stop ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9905 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Idc6819aaf0b01e70c38fad828dd44dcec6bdd778 Gerrit-Change-Number: 9905 Gerrit-PatchSet: 3 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel Gerrit-Comment-Date: Tue, 24 Jul 2018 09:55:07 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 10:03:11 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 24 Jul 2018 10:03:11 +0000 Subject: Change in osmo-ci[master]: jobs: osmo-gsm-tester-builder: Fix typo in job parameter name Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10126 Change subject: jobs: osmo-gsm-tester-builder: Fix typo in job parameter name ...................................................................... jobs: osmo-gsm-tester-builder: Fix typo in job parameter name osmo-mgw is duplicated and osmo-bsc is not there. Change-Id: Ib0ab7f8796b8b78d5f21b7a4f541fd3ddffc95a4 --- M jobs/osmo-gsm-tester-builder.yml 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/26/10126/1 diff --git a/jobs/osmo-gsm-tester-builder.yml b/jobs/osmo-gsm-tester-builder.yml index 48150c7..471d66a 100644 --- a/jobs/osmo-gsm-tester-builder.yml +++ b/jobs/osmo-gsm-tester-builder.yml @@ -77,7 +77,7 @@ - add_param_build_branch: name: OSMO_GSM_TESTER_BUILD_osmo_bts - add_param_build_branch: - name: OSMO_GSM_TESTER_BUILD_osmo_mgw + name: OSMO_GSM_TESTER_BUILD_osmo_bsc - add_param_build_branch: name: OSMO_GSM_TESTER_BUILD_osmo-mgw - add_param_build_branch: -- To view, visit https://gerrit.osmocom.org/10126 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ib0ab7f8796b8b78d5f21b7a4f541fd3ddffc95a4 Gerrit-Change-Number: 10126 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 10:05:35 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Tue, 24 Jul 2018 10:05:35 +0000 Subject: Change in osmo-ttcn3-hacks[master]: library: Ensure setverdict(fail) is followed by mtc.stop In-Reply-To: References: Message-ID: daniel has submitted this change and it was merged. ( https://gerrit.osmocom.org/9905 ) Change subject: library: Ensure setverdict(fail) is followed by mtc.stop ...................................................................... library: Ensure setverdict(fail) is followed by mtc.stop This will prevent subsequent failures from overwriting the verdict so we can easily see the root cause of the test failure. Using testcase.stop instead for errors internal to our test infrastructure to mark them as test errors instead of failed. Change-Id: Idc6819aaf0b01e70c38fad828dd44dcec6bdd778 --- M library/BSSAP_Adapter.ttcn M library/BSSGP_Emulation.ttcn M library/BSSMAP_Emulation.ttcn M library/GSM_Types.ttcn M library/GSUP_Emulation.ttcn M library/GTP_Emulation.ttcn M library/GTP_Templates.ttcn M library/IPA_Emulation.ttcnpp M library/IuUP_Emulation.ttcn M library/L1CTL_PortType.ttcn M library/L3_Common.ttcn M library/LAPDm_RAW_PT.ttcn M library/MGCP_Emulation.ttcn M library/MGCP_Templates.ttcn M library/MNCC_Emulation.ttcn M library/MNCC_Types.ttcn M library/NS_Emulation.ttcn M library/Osmocom_CTRL_Adapter.ttcn M library/Osmocom_CTRL_Functions.ttcn M library/Osmocom_Types.ttcn M library/Osmocom_VTY_Functions.ttcn M library/PCUIF_CodecPort.ttcn M library/RSL_Emulation.ttcn M library/RTP_Emulation.ttcn M library/SIP_Emulation.ttcn M library/SMPP_Emulation.ttcn M library/TRXC_CodecPort.ttcn 27 files changed, 148 insertions(+), 148 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/BSSAP_Adapter.ttcn b/library/BSSAP_Adapter.ttcn index e50487d..b29d03f 100644 --- a/library/BSSAP_Adapter.ttcn +++ b/library/BSSAP_Adapter.ttcn @@ -144,7 +144,7 @@ } case else { setverdict(fail, "Unsuppored BSSAP_Transport"); - self.stop; + mtc.stop; } } diff --git a/library/BSSGP_Emulation.ttcn b/library/BSSGP_Emulation.ttcn index f51d539..8b3b9eb 100644 --- a/library/BSSGP_Emulation.ttcn +++ b/library/BSSGP_Emulation.ttcn @@ -288,8 +288,7 @@ return; } } - setverdict(fail, "Client Table full"); - self.stop; + testcase.stop("Client Table full"); } private function f_tbl_client_del(hexstring imsi, BSSGP_Client_CT vc_conn) runs on BSSGP_CT { @@ -299,7 +298,7 @@ if (ClientTable[i].comp_ref != vc_conn) { setverdict(fail, "Cannot unregister index=", i, " IMSI ", imsi, " registred to ", ClientTable[i].comp_ref, " from ", vc_conn); - self.stop; + mtc.stop; } log("Removing Client IMSI=", imsi, ", index=", i); ClientTable[i] := { @@ -313,7 +312,7 @@ } } setverdict(fail, "Could not find client for IMSI ", imsi); - self.stop; + mtc.stop; } /* TS 44.064 7.2.1.1 LLGMM-ASSIGN */ @@ -344,7 +343,7 @@ } } setverdict(fail, "Couldn't find Component for IMSI ", imsi); - self.stop; + mtc.stop; } private function f_tbl_comp_by_tlli(OCT4 tlli) runs on BSSGP_CT return BSSGP_Client_CT { @@ -357,7 +356,7 @@ } } setverdict(fail, "Couldn't find Component for TLLI ", tlli); - self.stop; + mtc.stop; } private function f_tbl_idx_by_comp(BSSGP_Client_CT comp_ref) runs on BSSGP_CT return integer { @@ -368,7 +367,7 @@ } } setverdict(fail, "Couldn't find Client for Component ", comp_ref); - self.stop; + mtc.stop; } private function f_tbl_tlli_by_comp(BSSGP_Client_CT comp_ref) runs on BSSGP_CT return OCT4 { @@ -380,7 +379,7 @@ } } setverdict(fail, "Couldn't find TLLI for Component ", comp_ref); - self.stop; + mtc.stop; } altstep as_allstate() runs on BSSGP_CT { @@ -590,7 +589,7 @@ return c_LLC_SAPI_LLSMS; } setverdict(fail, "No LLC SAPI for ", l3_mo); - self.stop; + mtc.stop; } private function f_llc_sapi_by_l3_mt(PDU_L3_SGSN_MS l3_mt) return BIT4 { @@ -602,7 +601,7 @@ return c_LLC_SAPI_LLSMS; } setverdict(fail, "No LLC SAPI for ", l3_mt); - self.stop; + mtc.stop; } diff --git a/library/BSSMAP_Emulation.ttcn b/library/BSSMAP_Emulation.ttcn index e65c550..921ac59 100644 --- a/library/BSSMAP_Emulation.ttcn +++ b/library/BSSMAP_Emulation.ttcn @@ -202,9 +202,8 @@ return ConnectionTable[i].comp_ref; } } - log("BSSMAP Connection table not found by SCCP Connection ID ", sccp_conn_id); - setverdict(fail); - self.stop; + setverdict(fail, "BSSMAP Connection table not found by SCCP Connection ID ", sccp_conn_id); + mtc.stop; } /* resolve component reference by CIC */ @@ -216,9 +215,8 @@ return ConnectionTable[i].comp_ref; } } - log("BSSMAP Connection table not found by MGCP Transaction ID ", tid); - setverdict(fail); - self.stop; + setverdict(fail, "BSSMAP Connection table not found by MGCP Transaction ID ", tid); + mtc.stop; } private function f_comp_store_mgcp_tid(BSSAP_ConnHdlr client, MgcpTransId tid) @@ -230,9 +228,8 @@ return; } } - log("BSSMAP Connection table not found by component ", client); - setverdict(fail); - self.stop; + setverdict(fail, "BSSMAP Connection table not found by component ", client); + mtc.stop; } private function f_comp_by_cic(integer cic) @@ -243,9 +240,8 @@ return ConnectionTable[i].comp_ref; } } - log("BSSMAP Connection table not found by CIC ", cic); - setverdict(fail); - self.stop; + setverdict(fail, "BSSMAP Connection table not found by CIC ", cic); + mtc.stop; } private function f_comp_store_cic(BSSAP_ConnHdlr client, integer cic) @@ -257,8 +253,8 @@ return; } } - log("BSSMAP Connection table not found by component ", client); - setverdict(fail); + setverdict(fail, "BSSMAP Connection table not found by component ", client); + mtc.stop; } /* resolve connection ID by component reference */ @@ -269,9 +265,8 @@ return ConnectionTable[i].sccp_conn_id; } } - log("BSSMAP Connection table not found by component ", client); - setverdict(fail); - self.stop; + setverdict(fail, "BSSMAP Connection table not found by component ", client); + mtc.stop; } /* resolve ConnectionTable index component reference */ @@ -282,9 +277,8 @@ return i; } } - log("BSSMAP Connection table not found by component ", client); - setverdict(fail); - self.stop; + setverdict(fail, "BSSMAP Connection table not found by component ", client); + mtc.stop; } private function f_gen_conn_id() @@ -325,9 +319,7 @@ return; } } - log("BSSMAP Connection table full!"); - setverdict(fail); - self.stop; + testcase.stop("BSSMAP Connection table full!"); } private function f_conn_table_del(integer sccp_conn_id) @@ -341,9 +333,8 @@ return } } - log("BSSMAP Connection table attempt to delete non-existant ", sccp_conn_id); - setverdict(fail); - self.stop; + setverdict(fail, "BSSMAP Connection table attempt to delete non-existant ", sccp_conn_id); + mtc.stop; } private function f_imsi_table_find(hexstring imsi, template OCT4 tmsi) @@ -501,7 +492,8 @@ repeat; } [] T.timeout { - setverdict(fail); + setverdict(fail, "Timeout waiting for BSSAP RESET"); + mtc.stop; } } } @@ -517,7 +509,10 @@ } [] as_reset_ack(); [] BSSAP.receive { repeat }; - [] T.timeout { setverdict(fail, "Waiting for RESET-ACK after sending RESET"); } + [] T.timeout { + setverdict(fail, "Timeout waiting for RESET-ACK after sending RESET"); + mtc.stop; + } } } @@ -763,6 +758,7 @@ if (not ischosen(conn_ind.userData.pdu.bssmap.completeLayer3Information)) { setverdict(fail, "N-CONNECT.ind with L3 != COMPLETE L3"); + mtc.stop; return ret; } l3_info := conn_ind.userData.pdu.bssmap.completeLayer3Information.layer3Information.layer3info; @@ -782,6 +778,7 @@ } } setverdict(fail, "Couldn't find Expect for incoming connection ", conn_ind); + mtc.stop; return ret; } @@ -796,7 +793,7 @@ return; } } - setverdict(fail, "No space left in ExpectTable"); + testcase.stop("No space left in ExpectTable"); } private function f_create_imsi(hexstring imsi, OCT4 tmsi, BSSAP_ConnHdlr hdlr) @@ -810,8 +807,7 @@ return; } } - setverdict(fail, "No space left in ImsiTable"); - self.stop; + testcase.stop("No space left in ImsiTable"); } diff --git a/library/GSM_Types.ttcn b/library/GSM_Types.ttcn index 2000b4a..59ccb76 100644 --- a/library/GSM_Types.ttcn +++ b/library/GSM_Types.ttcn @@ -34,6 +34,7 @@ case (CS3) { return 52 } case else { setverdict(fail, "Invalid GPRS CS ", cs); + mtc.stop; return -1; } } diff --git a/library/GSUP_Emulation.ttcn b/library/GSUP_Emulation.ttcn index 7cf1656..86859ba 100644 --- a/library/GSUP_Emulation.ttcn +++ b/library/GSUP_Emulation.ttcn @@ -98,9 +98,8 @@ return GsupImsiTable[i].comp_ref; } } - log("GSUP IMSI table not found by IMSI ", imsi); - setverdict(fail); - self.stop; + setverdict(fail, "GSUP IMSI table not found by IMSI ", imsi); + mtc.stop; } /* resolve connection ID by component reference */ @@ -111,9 +110,8 @@ return GsupImsiTable[i].imsi; } } - log("GSUP IMSI table not found by component ", client); - setverdict(fail); - self.stop; + setverdict(fail, "GSUP IMSI table not found by component ", client); + mtc.stop; } private function f_imsi_table_init() @@ -142,9 +140,7 @@ return; } } - log("GSUP IMSI table full!"); - setverdict(fail); - self.stop; + testcase.stop("GSUP IMSI table full!"); } private function f_imsi_table_del(charstring imsi) @@ -158,9 +154,8 @@ return } } - log("GSUP IMSI table attempt to delete non-existant ", imsi); - setverdict(fail); - self.stop; + setverdict(fail, "GSUP IMSI table attempt to delete non-existant ", imsi); + mtc.stop; } @@ -190,7 +185,7 @@ [] GSUP.receive(ASP_IPA_Event:{up_down:=ASP_IPA_EVENT_UP}) { repeat; } [] GSUP.receive(ASP_IPA_Event:{up_down:=ASP_IPA_EVENT_DOWN}) { setverdict(fail, "GSUP Connection Lost"); - self.stop; + mtc.stop; } /* GSUP -> Client: call related messages */ @@ -272,6 +267,7 @@ } } setverdict(fail, "Couldn't find GsupExpect for incoming imsi ", imsi); + mtc.stop; return ret; } @@ -287,7 +283,7 @@ return; } } - setverdict(fail, "No space left in GsupExpectTable"); + testcase.stop("No space left in GsupExpectTable"); } /* client/conn_hdlr side function to use procedure port to create expect in emulation */ diff --git a/library/GTP_Emulation.ttcn b/library/GTP_Emulation.ttcn index 615309a..4368a8a 100644 --- a/library/GTP_Emulation.ttcn +++ b/library/GTP_Emulation.ttcn @@ -62,7 +62,7 @@ } } setverdict(fail, "No Component for TEID ", teid); - self.stop; + mtc.stop; } private function f_comp_by_imsi(hexstring imsi) runs on GTP_Emulation_CT return GTP_ConnHdlr { @@ -73,7 +73,7 @@ } } setverdict(fail, "No Component for IMSI ", imsi); - self.stop; + mtc.stop; } private function f_tid_tbl_add(OCT4 teid, GTP_ConnHdlr vc_conn) runs on GTP_Emulation_CT { @@ -85,8 +85,7 @@ return; } } - setverdict(fail, "No Space in TidTable for ", teid); - self.stop; + testcase.stop("No Space in TidTable for ", teid); } private function f_imsi_tbl_add(hexstring imsi, GTP_ConnHdlr vc_conn) runs on GTP_Emulation_CT { @@ -98,8 +97,7 @@ return; } } - setverdict(fail, "No Space in IMSI Table for ", imsi); - self.stop; + testcase.stop("No Space in IMSI Table for ", imsi); } function f_gtpc_extract_imsi(PDU_GTPC gtp) return template (omit) hexstring { diff --git a/library/GTP_Templates.ttcn b/library/GTP_Templates.ttcn index d0a87e3..018f6da 100644 --- a/library/GTP_Templates.ttcn +++ b/library/GTP_Templates.ttcn @@ -464,7 +464,8 @@ } } } - setverdict(fail); + setverdict(fail, "Could not extract protocol payload from protocol ", protocol); + mtc.stop; return ''O; } diff --git a/library/IPA_Emulation.ttcnpp b/library/IPA_Emulation.ttcnpp index df2b15e..a271f2d 100644 --- a/library/IPA_Emulation.ttcnpp +++ b/library/IPA_Emulation.ttcnpp @@ -203,7 +203,7 @@ local_host, local_port, 0, { tcp:={} }); if (not ispresent(res.connId)) { setverdict(fail, "Could not connect IPA socket, check your configuration"); - self.stop; + mtc.stop; } g_ipa_conn_id := res.connId; g_ccm_pars := ccm_pars; @@ -218,7 +218,7 @@ local_host, local_port, { tcp:={} }); if (not ispresent(res.connId)) { setverdict(fail, "Could not listen IPA socket, check your configuration"); - self.stop; + mtc.stop; } g_ipa_conn_id := res.connId; g_ccm_pars := ccm_pars; @@ -507,7 +507,7 @@ } case else { setverdict(fail, "Unknown mode"); - self.stop; + mtc.stop; } } } diff --git a/library/IuUP_Emulation.ttcn b/library/IuUP_Emulation.ttcn index 77cd739..752b897 100644 --- a/library/IuUP_Emulation.ttcn +++ b/library/IuUP_Emulation.ttcn @@ -80,6 +80,7 @@ return pdu.type_0.payload; } else { setverdict(fail, "PDU Type 0 received but 1 configured"); + mtc.stop; } } else if (ischosen(pdu.type_1)) { if (st.cfg.data_pdu_type_0 == false) { @@ -88,11 +89,13 @@ return pdu.type_1.payload; } else { setverdict(fail, "PDU Type 1 received but 0 configured"); + mtc.stop; } } else if (ischosen(pdu.type_14)) { if (match(pdu, tr_IuUP_INIT)) { if (st.cfg.active_init == true) { setverdict(fail, "INIT received in ACTIVE role"); + mtc.stop; } else { /* store an INIT_ACK to be transmitted later */ st.pending_tx_pdu := valueof(ts_IuUP_INIT_ACK(pdu.type_14.frame_nr, @@ -104,11 +107,13 @@ st.state := ST_DATA_TRANSFER_READY; } else { setverdict(fail, "INIT_ACK received in PASSIVE role"); + mtc.stop; } } return ''O; } else { setverdict(fail, "Impossible IuUP PDU decoded from ", inp); + mtc.stop; } self.stop; } diff --git a/library/L1CTL_PortType.ttcn b/library/L1CTL_PortType.ttcn index ba9c2b5..14a059c 100644 --- a/library/L1CTL_PortType.ttcn +++ b/library/L1CTL_PortType.ttcn @@ -41,7 +41,7 @@ [] pt.receive(tr_L1CTL_FBSB_CONF(0)) { return; }; [i >= 9] pt.receive(tr_L1CTL_FBSB_CONF(?)) { setverdict(fail, "FBSB Failed with non-zero return code"); - self.stop; + mtc.stop; }; [] pt.receive(tr_L1CTL_FBSB_CONF(?)) { f_sleep(1.0); @@ -49,7 +49,7 @@ [] pt.receive { repeat; }; [] T.timeout { setverdict(fail, "Timeout in FBSB") - self.stop; + mtc.stop; }; } } @@ -64,7 +64,7 @@ [] pt.receive { repeat; } [] T.timeout { setverdict(fail, "Timeout in CCH_MODE"); - self.stop; + mtc.stop; } } } @@ -80,7 +80,7 @@ [] pt.receive { repeat; }; [] T.timeout { setverdict(fail, "Timeout in RACH"); - self.stop; + mtc.stop; } } return fn; @@ -108,7 +108,7 @@ [] pt.receive { repeat }; [] T.timeout { setverdict(fail, "Timeout waiting for IMM ASS"); - self.stop; + mtc.stop; } } T.stop; @@ -133,7 +133,7 @@ [] pt.receive { repeat }; [] T.timeout { setverdict(fail, "Timeout waiting for IMM ASS"); - self.stop; + mtc.stop; } } T.stop; @@ -149,7 +149,7 @@ [] pt.receive { repeat }; [] T.timeout { setverdict(fail, "Timeout waiting for TBF-CFG.conf"); - self.stop; + mtc.stop; }; } T.stop; @@ -174,7 +174,7 @@ [] pt.receive { repeat; } [] T.timeout { setverdict(fail, "Timeout waiting for RESET.conf"); - self.stop; + mtc.stop; } } } diff --git a/library/L3_Common.ttcn b/library/L3_Common.ttcn index 2b39621..bf7818a 100644 --- a/library/L3_Common.ttcn +++ b/library/L3_Common.ttcn @@ -70,7 +70,7 @@ return TLLI_RAND_G_RNTI; } else { setverdict(fail, "Unknonw TLLI Type ", tllib); - self.stop; + mtc.stop; } } diff --git a/library/LAPDm_RAW_PT.ttcn b/library/LAPDm_RAW_PT.ttcn index bdfc50b..6b8f9fb 100644 --- a/library/LAPDm_RAW_PT.ttcn +++ b/library/LAPDm_RAW_PT.ttcn @@ -320,7 +320,7 @@ var TBF_UL_establish_res res; if (isvalue(g_tbf_ul[tbf_nr].arfcn)) { setverdict(fail, "Cannot establish UL TBF ID ", tbf_nr, ": BUSY"); - self.stop; + mtc.stop; } f_establish_tbf(tbf_ul_req.ra); if (ph_state == PH_STATE_TBF) { @@ -340,7 +340,7 @@ var TbfNr tbf_nr := tbf_dl_req.tbf_nr; if (isvalue(g_tbf_dl[tbf_nr].arfcn)) { setverdict(fail, "Cannot establish DL TBF ID ", tbf_nr, ": BUSY"); - self.stop; + mtc.stop; } g_tbf_dl[tbf_nr] := tbf_dl_req.pars; f_L1CTL_TBF_CFG(L1CTL, false, tbf_dl_req.pars.tfi); diff --git a/library/MGCP_Emulation.ttcn b/library/MGCP_Emulation.ttcn index 0863511..c3d09b9 100644 --- a/library/MGCP_Emulation.ttcn +++ b/library/MGCP_Emulation.ttcn @@ -134,9 +134,8 @@ return MgcpEndpointTable[i].comp_ref; } } - log("MGCP Endpoint Table not found by Endpoint", ep); - setverdict(fail); - self.stop; + setverdict(fail, "MGCP Endpoint Table not found by Endpoint", ep); + mtc.stop; } private function f_ep_by_comp(MGCP_ConnHdlr client) @@ -147,9 +146,8 @@ return MgcpEndpointTable[i].endpoint; } } - log("MGCP Endpoint Table not found by component ", client); - setverdict(fail); - self.stop; + setverdict(fail, "MGCP Endpoint Table not found by component ", client); + mtc.stop; } private function f_ep_table_add(MGCP_ConnHdlr comp_ref, MgcpEndpoint ep) @@ -162,8 +160,7 @@ return; } } - setverdict(fail, "MGCP Endpoint Table full!"); - self.stop; + testcase.stop("MGCP Endpoint Table full!"); } private function f_ep_table_del(MGCP_ConnHdlr comp_ref, MgcpEndpoint ep) @@ -178,7 +175,7 @@ } } setverdict(fail, "MGCP Endpoint Table: Couldn't find to-be-deleted entry!"); - self.stop; + mtc.stop; } @@ -211,7 +208,7 @@ var MgcpEndpoint ep; if (f_mgcp_find_param(msg, "Z", ep) == false) { setverdict(fail, "No SpecificEndpointName in MGCP response", msg); - self.stop; + mtc.stop; } return ep; } @@ -239,7 +236,7 @@ } if (not ispresent(res.connId)) { setverdict(fail, "Could not connect MGCP socket, check your configuration"); - self.stop; + mtc.stop; } g_mgcp_conn_id := res.connId; @@ -273,7 +270,7 @@ res := MGCP_CodecPort_CtrlFunct.f_IPL4_connect(MGCP, p.callagent_ip, p.callagent_udp_port, p.mgw_ip, p.mgw_udp_port, g_mgcp_conn_id, { udp:={} }); if (not ispresent(res.connId)) { setverdict(fail, "Could not connect MGCP socket, check your configuration"); - self.stop; + mtc.stop; } } if (ischosen(mrf.msg.command)) { @@ -302,7 +299,7 @@ } } else { setverdict(fail, "Received unexpected MGCP response: ", mrf.msg.response); - self.stop; + mtc.stop; } } [] MGCP_PROC.getcall(MGCPEM_register:{?,?}) -> param(crit, vc_conn) { @@ -387,6 +384,7 @@ } } setverdict(fail, "Couldn't find Expect for CRCX", cmd); + mtc.stop; return ret; } @@ -398,7 +396,7 @@ for (i := 0; i < sizeof(MgcpExpectTable); i := i+1) { if (crit == MgcpExpectTable[i].crit) { setverdict(fail, "Crit already present", crit); - self.stop; + mtc.stop; } } for (i := 0; i < sizeof(MgcpExpectTable); i := i+1) { @@ -409,7 +407,7 @@ return; } } - setverdict(fail, "No space left in MgcpExpectTable") + testcase.stop("No space left in MgcpExpectTable") } /* client/conn_hdlr side function to use procedure port to create expect in emulation */ @@ -459,7 +457,8 @@ return "AMR-WB"; } - setverdict(fail); + setverdict(fail, "Unknown payload type ", pt); + mtc.stop; return ""; } diff --git a/library/MGCP_Templates.ttcn b/library/MGCP_Templates.ttcn index 9d6dea6..afdc33d 100644 --- a/library/MGCP_Templates.ttcn +++ b/library/MGCP_Templates.ttcn @@ -294,7 +294,7 @@ return par.val; } } - setverdict(fail); + setverdict(fail, "Could not extract parameters for code ", code); return ""; } diff --git a/library/MNCC_Emulation.ttcn b/library/MNCC_Emulation.ttcn index d9b7c79..94ed1c4 100644 --- a/library/MNCC_Emulation.ttcn +++ b/library/MNCC_Emulation.ttcn @@ -116,9 +116,8 @@ return MnccCallTable[i].comp_ref; } } - log("MNCC Call table not found by MNCC Call ID ", mncc_call_id); - setverdict(fail); - self.stop; + setverdict(fail, "MNCC Call table not found by MNCC Call ID ", mncc_call_id); + mtc.stop; } /* resolve connection ID by component reference */ @@ -129,9 +128,8 @@ return MnccCallTable[i].mncc_call_id; } } - log("MNCC Call table not found by component ", client); - setverdict(fail); - self.stop; + setverdict(fail, "MNCC Call table not found by component ", client); + mtc.stop; } private function f_gen_call_id() @@ -171,9 +169,7 @@ return; } } - log("MNCC Call table full!"); - setverdict(fail); - self.stop; + testcase.stop("MNCC Call table full!"); } private function f_call_table_del(uint32_t mncc_call_id) @@ -187,9 +183,8 @@ return } } - log("MNCC Call table attempt to delete non-existant ", mncc_call_id); - setverdict(fail); - self.stop; + setverdict(fail, "MNCC Call table attempt to delete non-existant ", mncc_call_id); + mtc.stop; } @@ -203,14 +198,14 @@ [] MNCC.receive(UD_connect_result:?) -> value res { if (ispresent(res.result) and ispresent(res.result.result_code) and res.result.result_code == ERROR) { setverdict(fail, "Error connecting to MNCC socket", res); - self.stop; + mtc.stop; } else { g_mncc_ud_id := res.id; } } [] T.timeout { setverdict(fail, "Timeout connecting to MNCC socket"); - self.stop; + mtc.stop; } } } @@ -226,14 +221,14 @@ [] MNCC.receive(UD_listen_result:?) -> value res { if (ispresent(res.result) and ispresent(res.result.result_code) and res.result.result_code == ERROR) { setverdict(fail, "Error listening to MNCC socket", res); - self.stop; + mtc.stop; } else { g_mncc_ud_id := res.id; } } [] T.timeout { setverdict(fail, "Timeout listening to MNCC socket"); - self.stop; + mtc.stop; } } @@ -244,7 +239,7 @@ } [] T.timeout { setverdict(fail, "Timeout waiting for MNCC connection"); - self.stop; + mtc.stop; } } } @@ -393,6 +388,7 @@ if (not ischosen(conn_ind.u.signal) or (conn_ind.msg_type != MNCC_SETUP_IND and conn_ind.msg_type != MNCC_SETUP_REQ)) { setverdict(fail, "MNCC ExpectedCreateCallback needs MNCC_SETUP_{IND,REQ}"); + mtc.stop; return ret; } dest_number := conn_ind.u.signal.called.number; @@ -412,6 +408,7 @@ } } setverdict(fail, "Couldn't find MnccExpect for incoming call ", dest_number); + mtc.stop; return ret; } @@ -427,7 +424,7 @@ return; } } - setverdict(fail, "No space left in MnccMnccExpectTable"); + testcase.stop("No space left in MnccMnccExpectTable"); } /* client/conn_hdlr side function to use procedure port to create expect in emulation */ diff --git a/library/MNCC_Types.ttcn b/library/MNCC_Types.ttcn index 19af236..157457a 100644 --- a/library/MNCC_Types.ttcn +++ b/library/MNCC_Types.ttcn @@ -1922,7 +1922,7 @@ return pdu.u.signal.callref; } else { setverdict(fail, "Unable to determine Callref for MNCC", pdu); - self.stop + mtc.stop } } diff --git a/library/NS_Emulation.ttcn b/library/NS_Emulation.ttcn index d43d15c..01d45b4 100644 --- a/library/NS_Emulation.ttcn +++ b/library/NS_Emulation.ttcn @@ -83,7 +83,7 @@ res := f_IPL4_connect(NSCP, mp_remote_ip, mp_remote_udp_port, mp_local_ip, mp_local_udp_port, 0, { udp := {}}); if (not ispresent(res.connId)) { setverdict(fail, "Could not connect NS UDP socket, check your configuration"); - self.stop; + mtc.stop; } g_conn_id := res.connId; f_change_state(NSE_S_DEAD_BLOCKED); diff --git a/library/Osmocom_CTRL_Adapter.ttcn b/library/Osmocom_CTRL_Adapter.ttcn index 22195c8..a98ac29 100644 --- a/library/Osmocom_CTRL_Adapter.ttcn +++ b/library/Osmocom_CTRL_Adapter.ttcn @@ -38,7 +38,7 @@ [] IPA_CTRL.receive(ASP_IPA_Event:{up_down := ASP_IPA_EVENT_UP}) { } [] T.timeout { setverdict(fail, "Timeout CTRL waiting for ASP_IPA_EVENT_UP"); - self.stop; + mtc.stop; } } } diff --git a/library/Osmocom_CTRL_Functions.ttcn b/library/Osmocom_CTRL_Functions.ttcn index 70885c9..da3b80d 100644 --- a/library/Osmocom_CTRL_Functions.ttcn +++ b/library/Osmocom_CTRL_Functions.ttcn @@ -40,10 +40,12 @@ [] pt.receive(tr_CtrlMsgTrap) { repeat; } [] pt.receive(tr_CtrlMsgError) -> value rx { setverdict(fail, "Error in CTRL GET ", variable, ": ", rx.err.reason); + mtc.stop; return "FAIL"; } [] T.timeout { setverdict(fail, "Timeout waiting for CTRL GET REPLY ", variable); + mtc.stop; return "TIMEOUT"; } } @@ -62,9 +64,11 @@ [] pt.receive(tr_CtrlMsgTrap) { repeat; } [] pt.receive(tr_CtrlMsgError) -> value rx { setverdict(fail, "Error in CTRL GET ", variable, ": ", rx.err.reason); + mtc.stop; } [] T.timeout { setverdict(fail, "Timeout waiting for CTRL SET REPLY ", variable); + mtc.stop; } } } @@ -80,6 +84,7 @@ } [] T.timeout { setverdict(fail, "Timeout waiting for TRAP ", variable); + mtc.stop; return "TIMEOUT"; } } @@ -92,6 +97,7 @@ ctrl_resp := f_ctrl_get(pt, variable); if (not match(ctrl_resp, exp)) { setverdict(fail, "Unexpected " & variable & ":" & ctrl_resp); + mtc.stop; } } @@ -111,6 +117,7 @@ ctrl_resp := f_ctrl_get(pt, variable); if (not match(str2int(ctrl_resp), exp)) { setverdict(fail, variable & " value " & ctrl_resp & " didn't match ", exp); + mtc.stop; } } diff --git a/library/Osmocom_Types.ttcn b/library/Osmocom_Types.ttcn index d01fe37..90b2758 100644 --- a/library/Osmocom_Types.ttcn +++ b/library/Osmocom_Types.ttcn @@ -95,8 +95,6 @@ return '0'B; } } - setverdict(fail, "Unsupported template", inp); - self.stop; } type record of integer IntegerRecord; diff --git a/library/Osmocom_VTY_Functions.ttcn b/library/Osmocom_VTY_Functions.ttcn index c7f4441..6e4eb74 100644 --- a/library/Osmocom_VTY_Functions.ttcn +++ b/library/Osmocom_VTY_Functions.ttcn @@ -59,7 +59,7 @@ [] pt.receive(charstring:?) -> value rx { buf := buf & rx; repeat }; [] T.timeout { setverdict(fail, "VTY Timeout for prompt"); - self.stop; + mtc.stop; }; } T.stop; @@ -132,7 +132,7 @@ var charstring ret := f_vty_transceive_ret(pt, cmd); if (not match(ret, exp_ret)) { setverdict(fail, "Non-matching VTY response: ", ret); - self.stop; + mtc.stop; } } @@ -140,7 +140,7 @@ var charstring ret := f_vty_transceive_ret(pt, cmd); if (match(ret, exp_ret)) { setverdict(fail, "Unexpected matching VTY response: ", ret); - self.stop; + mtc.stop; } } diff --git a/library/PCUIF_CodecPort.ttcn b/library/PCUIF_CodecPort.ttcn index c642202..389c5ca 100644 --- a/library/PCUIF_CodecPort.ttcn +++ b/library/PCUIF_CodecPort.ttcn @@ -70,14 +70,14 @@ } else { setverdict(fail, "Error connecting to PCU socket"); } - self.stop; + mtc.stop; } else { return res.id; } } [] T.timeout { setverdict(fail, "Timeout connecting to PCU socket"); - self.stop; + mtc.stop; } } return -23; @@ -106,7 +106,7 @@ [] pt.receive { repeat; } [] T.timeout { setverdict(fail, "Timeout waiting for PCU DATA.cnf"); - self.stop; + mtc.stop; } } return 0; diff --git a/library/RSL_Emulation.ttcn b/library/RSL_Emulation.ttcn index 325f22e..3c035e9 100644 --- a/library/RSL_Emulation.ttcn +++ b/library/RSL_Emulation.ttcn @@ -90,11 +90,11 @@ } [] RSL.receive { setverdict(fail, "Unexpected RSL message on DCHAN"); - self.stop; + mtc.stop; } [] T.timeout { setverdict(fail, "Timeout waiting for RSL on DCHAN"); - self.stop; + mtc.stop; } } /* never reached */ @@ -361,7 +361,7 @@ cid := f_cid_by_ra_fn(ra, fn); if (cid == -1) { setverdict(fail, "IMM ASS for unknown DChan"); - self.stop; + mtc.stop; } /* update client with trx_nr */ ConnectionTable[cid].trx_nr := f_trx_by_streamId(rx_rsl.streamId); @@ -421,12 +421,13 @@ CLIENT_PT.send(rx_rsl.rsl) to ConnectionTable[cid].comp_ref; } else { setverdict(fail, "RSL for unknown Dchan"); + mtc.stop; } } [not dchan_suspended] IPA_PT.receive { setverdict(fail, "Received unknown primitive from IPA"); - self.stop; + mtc.stop; } [bts_role] CLIENT_PT.receive(RSLDC_ChanRqd:?) -> value chan_rqd sender vc_conn { diff --git a/library/RTP_Emulation.ttcn b/library/RTP_Emulation.ttcn index 475b478..71cd8db 100644 --- a/library/RTP_Emulation.ttcn +++ b/library/RTP_Emulation.ttcn @@ -303,7 +303,7 @@ g_local_port, {udp:={}}); if (not ispresent(res.connId)) { setverdict(fail, "Could not listen on RTP socket, check your configuration"); - self.stop; + mtc.stop; } g_rtp_conn_id := res.connId; tr_rtp.connId := g_rtp_conn_id; @@ -311,7 +311,7 @@ g_local_port+1, {udp:={}}); if (not ispresent(res.connId)) { setverdict(fail, "Could not listen on RTCP socket, check your configuration"); - self.stop; + mtc.stop; } g_rtcp_conn_id := res.connId; tr_rtcp.connId := g_rtcp_conn_id; @@ -329,7 +329,7 @@ g_rtp_conn_id, {udp:={}}); if (not ispresent(res.connId)) { setverdict(fail, "Could not connect to RTP socket, check your configuration"); - self.stop; + mtc.stop; } res := RTP_CodecPort_CtrlFunct.f_IPL4_connect(RTCP, g_remote_host, g_remote_port+1, @@ -337,7 +337,7 @@ g_rtcp_conn_id, {udp:={}}); if (not ispresent(res.connId)) { setverdict(fail, "Could not connect to RTCP socket, check your configuration"); - self.stop; + mtc.stop; } CTRL.reply(RTPEM_connect:{g_remote_host, g_remote_port}); } @@ -426,9 +426,11 @@ /* fail on any unexpected messages */ [] RTP.receive { setverdict(fail, "Received unexpected type from RTP"); + mtc.stop; } [] RTCP.receive { setverdict(fail, "Received unexpected type from RTCP"); + mtc.stop; } } } diff --git a/library/SIP_Emulation.ttcn b/library/SIP_Emulation.ttcn index 3957b8f..98f7371 100644 --- a/library/SIP_Emulation.ttcn +++ b/library/SIP_Emulation.ttcn @@ -155,7 +155,7 @@ } } setverdict(fail, "SIP Call table not found by SIP Call ID ", call_id); - self.stop; + mtc.stop; } /* resolve connection ID by component reference */ @@ -167,7 +167,7 @@ } } setverdict(fail, "SIP Call table not found by component ", client); - self.stop; + mtc.stop; } private function f_expect_table_init() @@ -196,8 +196,7 @@ return; } } - setverdict(fail, "SIP Call table full"); - self.stop; + testcase.stop("SIP Call table full"); } private function f_call_table_del(CallidString call_id) @@ -211,7 +210,7 @@ } } setverdict(fail, "SIP Call table attempt to delete non-existant ", call_id); - self.stop; + mtc.stop; } /* call-back type, to be provided by specific implementation; called when new call connection @@ -270,7 +269,7 @@ CLIENT.send(sip_req) to vc_conn; } else { setverdict(fail, "SIP Request for unknown call ", call_id); - self.stop; + mtc.stop; } } /* SIP response was received on SIP socket/port */ @@ -281,7 +280,7 @@ CLIENT.send(sip_resp) to vc_conn; } else { setverdict(fail, "SIP Response for unknown call ", call_id); - self.stop; + mtc.stop; } } @@ -344,6 +343,7 @@ if (sip_req.requestLine.method != INVITE_E) { setverdict(fail, "SIP ExpectedCreateCallback needs INVITE"); + mtc.stop return ret; } sip_to := sip_req.msgHeader.toField.addressField.nameAddr.addrSpec; @@ -378,6 +378,7 @@ } setverdict(fail, "Couldn't find SipExpect for incoming call ", sip_to); + mtc.stop return ret; } @@ -393,7 +394,7 @@ return; } } - setverdict(fail, "No space left in SipExpectTable"); + testcase.stop("No space left in SipExpectTable"); } /* client/conn_hdlr side function to use procedure port to create expect in emulation */ diff --git a/library/SMPP_Emulation.ttcn b/library/SMPP_Emulation.ttcn index 27876dc..6dc78e9 100644 --- a/library/SMPP_Emulation.ttcn +++ b/library/SMPP_Emulation.ttcn @@ -88,7 +88,7 @@ } } setverdict(fail, "No componten for SMPP TID ", tid); - self.stop; + mtc.stop; } @@ -109,8 +109,7 @@ return; } } - setverdict(fail, "SMPP Trans table full!"); - self.stop; + testcase.stop("SMPP Trans table full!"); } private function f_trans_table_del(uint32_t trans_id) @@ -123,7 +122,7 @@ } } setverdict(fail, "SMPP Trans table attempt to delete non-existant ", trans_id); - self.stop; + mtc.stop; } @@ -136,7 +135,7 @@ local_host, local_port, 0, { tcp :={} }); if (not ispresent(res.connId)) { setverdict(fail, "Could not connect to SMPP port, check your configuration"); - self.stop; + mtc.stop; } g_smpp_conn_id := res.connId; } @@ -187,7 +186,7 @@ [] SMPP_PORT.receive(tr_SMPP_Recv(g_smpp_conn_id, pdu)) { } [] T_wait.timeout { setverdict(fail, "Timeout waiting for ", pdu); - self.stop; + mtc.stop; } } } @@ -211,7 +210,7 @@ } [] SMPP_PORT.receive { setverdict(fail, "Unexpected SMPP from peer"); - self.stop; + mtc.stop; } } @@ -371,8 +370,7 @@ return; } } - setverdict(fail, "No space left in SmppExpectTable"); - self.stop; + testcase.stop("No space left in SmppExpectTable"); } private function f_exp_lookup(SMPP_TON ton, SMPP_NPI npi, charstring dst) diff --git a/library/TRXC_CodecPort.ttcn b/library/TRXC_CodecPort.ttcn index 774b674..09b2977 100644 --- a/library/TRXC_CodecPort.ttcn +++ b/library/TRXC_CodecPort.ttcn @@ -81,6 +81,7 @@ } [] T.timeout { setverdict(fail, "Timeout waiting for ", tr, " on ", pt); + mtc.stop; } } return rf.msg; -- To view, visit https://gerrit.osmocom.org/9905 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Idc6819aaf0b01e70c38fad828dd44dcec6bdd778 Gerrit-Change-Number: 9905 Gerrit-PatchSet: 3 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 10:09:02 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 24 Jul 2018 10:09:02 +0000 Subject: Change in osmocom-bb[master]: Move from libc random() to osmo_get_rand_id (2nd attempt) In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/10098 ) Change subject: Move from libc random() to osmo_get_rand_id (2nd attempt) ...................................................................... Patch Set 4: Code-Review+1 Ok, let's finally merge this. Tested, and looks good. -- To view, visit https://gerrit.osmocom.org/10098 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Icdd4be88c62bba1e9d954568e48f0c12a67ac182 Gerrit-Change-Number: 10098 Gerrit-PatchSet: 4 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 24 Jul 2018 10:09:02 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 10:09:08 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 24 Jul 2018 10:09:08 +0000 Subject: Change in osmocom-bb[master]: Move from libc random() to osmo_get_rand_id (2nd attempt) In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. ( https://gerrit.osmocom.org/10098 ) Change subject: Move from libc random() to osmo_get_rand_id (2nd attempt) ...................................................................... Move from libc random() to osmo_get_rand_id (2nd attempt) When starting multiple mobile in the same second, the libc random number generator will be seeded to exactly the same value. The random bits inside the RACH request(s) will be exactly the same across multiple mobile and when the channel fails they all pick the same randomized back-off timing. Use stronger random numbers and replace all calls to random(2) with osmo_get_rand_id. Add a fallback to try random(). [v2: Add helper to make sure the result is int and between 0 and RAND_MAX] Change-Id: Icdd4be88c62bba1e9d954568e48f0c12a67ac182 --- M src/host/layer23/include/osmocom/bb/common/Makefile.am A src/host/layer23/include/osmocom/bb/common/utils.h M src/host/layer23/src/common/Makefile.am A src/host/layer23/src/common/utils.c M src/host/layer23/src/mobile/gsm322.c M src/host/layer23/src/mobile/gsm48_mm.c M src/host/layer23/src/mobile/gsm48_rr.c M src/host/layer23/src/mobile/settings.c 8 files changed, 61 insertions(+), 8 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved Vadim Yanitskiy: Looks good to me, but someone else must approve diff --git a/src/host/layer23/include/osmocom/bb/common/Makefile.am b/src/host/layer23/include/osmocom/bb/common/Makefile.am index 945c73d..cd3437e 100644 --- a/src/host/layer23/include/osmocom/bb/common/Makefile.am +++ b/src/host/layer23/include/osmocom/bb/common/Makefile.am @@ -1,2 +1,2 @@ noinst_HEADERS = l1ctl.h l1l2_interface.h l23_app.h logging.h \ - networks.h gps.h sysinfo.h osmocom_data.h + networks.h gps.h sysinfo.h osmocom_data.h utils.h diff --git a/src/host/layer23/include/osmocom/bb/common/utils.h b/src/host/layer23/include/osmocom/bb/common/utils.h new file mode 100644 index 0000000..8ca61f8 --- /dev/null +++ b/src/host/layer23/include/osmocom/bb/common/utils.h @@ -0,0 +1,3 @@ +#pragma once + +int layer23_random(void); diff --git a/src/host/layer23/src/common/Makefile.am b/src/host/layer23/src/common/Makefile.am index 71081c0..b76094c 100644 --- a/src/host/layer23/src/common/Makefile.am +++ b/src/host/layer23/src/common/Makefile.am @@ -3,4 +3,4 @@ noinst_LIBRARIES = liblayer23.a liblayer23_a_SOURCES = l1ctl.c l1l2_interface.c sap_interface.c \ - logging.c networks.c sim.c sysinfo.c gps.c l1ctl_lapdm_glue.c + logging.c networks.c sim.c sysinfo.c gps.c l1ctl_lapdm_glue.c utils.c diff --git a/src/host/layer23/src/common/utils.c b/src/host/layer23/src/common/utils.c new file mode 100644 index 0000000..4ecb134 --- /dev/null +++ b/src/host/layer23/src/common/utils.c @@ -0,0 +1,47 @@ +/* Utilities used by mobile */ + +/* (C) 2018 by Holger Hans Peter Freyther + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include + +#include + +#include +#include + + +/** + * A secure replacement for random(3). + * + * \return a secure random number using osmo_get_rand_id between + * 0 and RAND_MAX. + */ +int layer23_random(void) +{ + unsigned int r; + + if (osmo_get_rand_id((uint8_t *) &r, sizeof(r)) != 0) + return random(); + + r &= ~(1U << 31); + r %= RAND_MAX; + return (int) r; +} diff --git a/src/host/layer23/src/mobile/gsm322.c b/src/host/layer23/src/mobile/gsm322.c index c3485b6..3bc8b5c 100644 --- a/src/host/layer23/src/mobile/gsm322.c +++ b/src/host/layer23/src/mobile/gsm322.c @@ -31,7 +31,6 @@ #include #include #include -#include #include #include @@ -40,6 +39,7 @@ #include #include #include +#include #include @@ -959,7 +959,7 @@ entries++; } while(entries) { - move = random() % entries; + move = layer23_random() % entries; i = 0; llist_for_each_entry(temp, &temp_list, entry) { if (rxlev2dbm(temp->rxlev) > -85) { diff --git a/src/host/layer23/src/mobile/gsm48_mm.c b/src/host/layer23/src/mobile/gsm48_mm.c index a7af1f5..02d861e 100644 --- a/src/host/layer23/src/mobile/gsm48_mm.c +++ b/src/host/layer23/src/mobile/gsm48_mm.c @@ -41,6 +41,7 @@ #include #include #include +#include extern void *l23_ctx; @@ -2099,7 +2100,7 @@ mm->t3212.timeout.tv_sec = current_time.tv_sec + (t % s->t3212); } else { - uint32_t rand = random(); + uint32_t rand = layer23_random(); LOGP(DMM, LOGL_INFO, "New T3212 while timer is not " "running (value %d)\n", s->t3212); diff --git a/src/host/layer23/src/mobile/gsm48_rr.c b/src/host/layer23/src/mobile/gsm48_rr.c index dd3fe93..c074323 100644 --- a/src/host/layer23/src/mobile/gsm48_rr.c +++ b/src/host/layer23/src/mobile/gsm48_rr.c @@ -79,6 +79,7 @@ #include #include #include +#include #include @@ -1628,7 +1629,7 @@ } } - chan_req = random(); + chan_req = layer23_random(); chan_req &= rr->chan_req_mask; chan_req |= rr->chan_req_val; diff --git a/src/host/layer23/src/mobile/settings.c b/src/host/layer23/src/mobile/settings.c index 7370b0a..6a7cd81 100644 --- a/src/host/layer23/src/mobile/settings.c +++ b/src/host/layer23/src/mobile/settings.c @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -184,8 +185,8 @@ if (digits > 15) digits = 15; - sprintf(rand, "%08ld", random() % 100000000); - sprintf(rand + 8, "%07ld", random() % 10000000); + sprintf(rand, "%08d", layer23_random() % 100000000); + sprintf(rand + 8, "%07d", layer23_random() % 10000000); strcpy(set->imei + 15 - digits, rand + 15 - digits); strncpy(set->imeisv, set->imei, 15); -- To view, visit https://gerrit.osmocom.org/10098 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Icdd4be88c62bba1e9d954568e48f0c12a67ac182 Gerrit-Change-Number: 10098 Gerrit-PatchSet: 4 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 10:13:57 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Tue, 24 Jul 2018 10:13:57 +0000 Subject: Change in osmo-ttcn3-hacks[master]: introduce a TTCN3 test suite for SCCP In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9653 to look at the new patch set (#4). Change subject: introduce a TTCN3 test suite for SCCP ...................................................................... introduce a TTCN3 test suite for SCCP This test suite acts as an SCCP server on top of M3UA. SCCP tests are run against the sccp_demo_user program which can be found in libosmo-sccp/examples. This program must be started in client mode: sccp_demo_user -c The SCCP test suite should then work out of the box with the provided SCCP_Tests.cfg file and this additional change to sccp_demo_user default point codes: https://gerrit.osmocom.org/#/c/libosmo-sccp/+/9652/ There is currently only one test, for the libosmo-sccp crash reported as issue OS#2666. The implementation of this test is currently using an ugly workaround due to shortcomings of the M3UA Emulation layer (see source code comments). Whether a better solution is feasible is still to be determined. The test requires a patch to the SCCP Protocol Emulation which has been submitted upstream: https://git.eclipse.org/r/#/c/124552/ Change-Id: I03f5e8b282a7396b45417495c88d8fb81b26cda8 Related: OS#2666 --- M Makefile M bsc/BSC_Tests.ttcn M bsc/gen_links.sh M library/BSSAP_Adapter.ttcn A library/SCCP_Templates.ttcn M msc/MSC_Tests.ttcn M msc/gen_links.sh A sccp/SCCP_Tests.cfg A sccp/SCCP_Tests.default A sccp/SCCP_Tests.ttcn A sccp/gen_links.sh A sccp/regen_makefile.sh 12 files changed, 336 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/53/9653/4 -- To view, visit https://gerrit.osmocom.org/9653 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I03f5e8b282a7396b45417495c88d8fb81b26cda8 Gerrit-Change-Number: 9653 Gerrit-PatchSet: 4 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 10:15:25 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 24 Jul 2018 10:15:25 +0000 Subject: Change in osmo-ci[master]: jobs: osmo-gsm-tester-builder: Fix typo in job parameter name In-Reply-To: References: Message-ID: lynxis lazus has posted comments on this change. ( https://gerrit.osmocom.org/10126 ) Change subject: jobs: osmo-gsm-tester-builder: Fix typo in job parameter name ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10126 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib0ab7f8796b8b78d5f21b7a4f541fd3ddffc95a4 Gerrit-Change-Number: 10126 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Tue, 24 Jul 2018 10:15:25 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 10:20:07 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 10:20:07 +0000 Subject: Change in osmo-ci[master]: jobs: osmo-gsm-tester-builder: Fix typo in job parameter name In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10126 ) Change subject: jobs: osmo-gsm-tester-builder: Fix typo in job parameter name ...................................................................... Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/10126/1/jobs/osmo-gsm-tester-builder.yml File jobs/osmo-gsm-tester-builder.yml: https://gerrit.osmocom.org/#/c/10126/1/jobs/osmo-gsm-tester-builder.yml at 82 PS1, Line 82: name: OSMO_GSM_TESTER_BUILD_osmo-mgw but shouldn't this say "osmo_mgw" because dashes are not allowed in env var names? i.e. you replaced the wrong osmo_mgw? -- To view, visit https://gerrit.osmocom.org/10126 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib0ab7f8796b8b78d5f21b7a4f541fd3ddffc95a4 Gerrit-Change-Number: 10126 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Tue, 24 Jul 2018 10:20:07 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 10:21:31 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 24 Jul 2018 10:21:31 +0000 Subject: Change in osmo-ci[master]: ansible: osmocom-jenkins-slave: debian.yml: don't install recommends In-Reply-To: References: Message-ID: lynxis lazus has posted comments on this change. ( https://gerrit.osmocom.org/10015 ) Change subject: ansible: osmocom-jenkins-slave: debian.yml: don't install recommends ...................................................................... Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/10015 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I894455ea779ece84c403f768a1260a1cf2528389 Gerrit-Change-Number: 10015 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Tue, 24 Jul 2018 10:21:31 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 10:21:33 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 24 Jul 2018 10:21:33 +0000 Subject: Change in osmo-ci[master]: jobs: osmo-gsm-tester-builder: Fix typo in job parameter name In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10126 ) Change subject: jobs: osmo-gsm-tester-builder: Fix typo in job parameter name ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/10126/1/jobs/osmo-gsm-tester-builder.yml File jobs/osmo-gsm-tester-builder.yml: https://gerrit.osmocom.org/#/c/10126/1/jobs/osmo-gsm-tester-builder.yml at 82 PS1, Line 82: name: OSMO_GSM_TESTER_BUILD_osmo-mgw > but shouldn't this say "osmo_mgw" because dashes are not allowed in env var names? i.e. [?] So true my lord. -- To view, visit https://gerrit.osmocom.org/10126 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib0ab7f8796b8b78d5f21b7a4f541fd3ddffc95a4 Gerrit-Change-Number: 10126 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Tue, 24 Jul 2018 10:21:33 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 10:21:38 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 24 Jul 2018 10:21:38 +0000 Subject: Change in osmo-ci[master]: ansible: osmocom-jenkins-slave: move installing build + runtime deps ... In-Reply-To: References: Message-ID: lynxis lazus has posted comments on this change. ( https://gerrit.osmocom.org/10014 ) Change subject: ansible: osmocom-jenkins-slave: move installing build + runtime deps into own file ...................................................................... Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/10014 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I469a8012b124516bfd9c4d4dd3a3fe0e1ff80bb6 Gerrit-Change-Number: 10014 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Tue, 24 Jul 2018 10:21:38 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 10:21:50 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 24 Jul 2018 10:21:50 +0000 Subject: Change in osmo-ci[master]: ansible: osmocom-jenkins-slave: add var install_jenkins_utilities In-Reply-To: References: Message-ID: lynxis lazus has posted comments on this change. ( https://gerrit.osmocom.org/10016 ) Change subject: ansible: osmocom-jenkins-slave: add var install_jenkins_utilities ...................................................................... Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/10016 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I72f4460b8550da191e74a44be0ee3eeb3b2d7769 Gerrit-Change-Number: 10016 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: lynxis lazus Gerrit-CC: Neels Hofmeyr Gerrit-Comment-Date: Tue, 24 Jul 2018 10:21:50 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 10:22:00 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 24 Jul 2018 10:22:00 +0000 Subject: Change in osmo-ci[master]: ansible: add playbook setup-simtest In-Reply-To: References: Message-ID: lynxis lazus has posted comments on this change. ( https://gerrit.osmocom.org/10017 ) Change subject: ansible: add playbook setup-simtest ...................................................................... Patch Set 3: Verified+1 -- To view, visit https://gerrit.osmocom.org/10017 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iab74a2b3fc3148bce815b2dadd1fd683c4b64c44 Gerrit-Change-Number: 10017 Gerrit-PatchSet: 3 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Tue, 24 Jul 2018 10:22:00 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 10:22:16 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 24 Jul 2018 10:22:16 +0000 Subject: Change in osmo-ci[master]: ansible: osmocom-jenkins-slave: move installing build + runtime deps ... In-Reply-To: References: Message-ID: lynxis lazus has submitted this change and it was merged. ( https://gerrit.osmocom.org/10014 ) Change subject: ansible: osmocom-jenkins-slave: move installing build + runtime deps into own file ...................................................................... ansible: osmocom-jenkins-slave: move installing build + runtime deps into own file For small nodes (e.g. simtester) the full blown packages are not required nor supported. In this case only the jenkins user and the ssh keys will be setted up. Change-Id: I469a8012b124516bfd9c4d4dd3a3fe0e1ff80bb6 --- M ansible/roles/osmocom-jenkins-slave/README.md M ansible/roles/osmocom-jenkins-slave/defaults/main.yml M ansible/roles/osmocom-jenkins-slave/tasks/main.yml A ansible/roles/osmocom-jenkins-slave/tasks/osmocom_build_deps.yml 4 files changed, 93 insertions(+), 85 deletions(-) Approvals: Harald Welte: Looks good to me, approved lynxis lazus: Verified diff --git a/ansible/roles/osmocom-jenkins-slave/README.md b/ansible/roles/osmocom-jenkins-slave/README.md index 51bf6a1..de02b43 100644 --- a/ansible/roles/osmocom-jenkins-slave/README.md +++ b/ansible/roles/osmocom-jenkins-slave/README.md @@ -2,6 +2,7 @@ Support the following variables: +* `install_osmocom_build_deps`: (true) install all osmocom runtime and build time dependencies * `generic_slave`: (true) contains tasks used by the most osmocom jenkins slaves * `osmocom_jenkins_slave_fstrim`: (false) calls fstrim periodical * `ttcn3_slave`: (true) install titan ttcn3 compiler and prepares the docker-playground diff --git a/ansible/roles/osmocom-jenkins-slave/defaults/main.yml b/ansible/roles/osmocom-jenkins-slave/defaults/main.yml index e32b5a0..bdc13b4 100644 --- a/ansible/roles/osmocom-jenkins-slave/defaults/main.yml +++ b/ansible/roles/osmocom-jenkins-slave/defaults/main.yml @@ -3,6 +3,9 @@ # OS user jenkins_user: jenkins +# install all osmocom runtime and build time dependencies +install_osmocom_build_deps: true + # E.g. a generic_slave requires different tasks as a # special slave including the gsm-tester generic_slave: true diff --git a/ansible/roles/osmocom-jenkins-slave/tasks/main.yml b/ansible/roles/osmocom-jenkins-slave/tasks/main.yml index cca3704..072792d 100644 --- a/ansible/roles/osmocom-jenkins-slave/tasks/main.yml +++ b/ansible/roles/osmocom-jenkins-slave/tasks/main.yml @@ -4,91 +4,6 @@ include_tasks: debian.yml when: ansible_distribution == 'Debian' -- name: install build utilities - apt: - name: "{{ item }}" - cache_valid_time: 3600 - update_cache: yes - with_items: - - asciidoc - - autoconf - - autoconf-archive - - automake - - bc - - bison - - coccinelle - - cppcheck - - debhelper - - devscripts - - dh-autoreconf - - dh-systemd - - doxygen - - flex - - g++ - - gawk - - gcc - - gcc-arm-none-eabi - - git - - git-buildpackage - - graphviz - - libtool - - libboost-all-dev - - make - - mscgen - - osc - - pkgconf - - python-minimal - - python-setuptools - - python3 - - python3-setuptools - - stow - - texinfo - # by gsm-manuals - - python-nwdiag - - python-pychart - # by gapk - - libasound-dev - - libopencore-amrnb-dev - -- name: install build dependencies and libraries - apt: - name: "{{ item }}" - cache_valid_time: 3600 - update_cache: yes - install_recommends: no - with_items: - - docbook5-xml - - libboost-dev - - libc-ares-dev - - libdbd-sqlite3 - - libdbi-dev - - libffi-dev - - libffi-dev - - libfftw3-dev - - libgmp-dev - - libgnutls28-dev - - libgps-dev - - libgsm1-dev - - libmnl-dev - - libncurses5-dev - - libortp-dev - - libpcap-dev - - libpcsclite-dev - - libreadline-dev - - libsctp-dev - - libsigsegv-dev - - libsnmp-dev - - libsofia-sip-ua-glib-dev - - libsqlite3-dev - - libssl-dev - - libsystemd-dev - - libtalloc-dev - - libuhd-dev - - libusb-1.0-0-dev - - libusb-dev - - libzmq3-dev - - sqlite3 - - name: add user jenkins user: name: "{{ jenkins_user }}" @@ -102,6 +17,10 @@ user: "{{ jenkins_user }}" key: "{{ lookup('file', 'jenkins.osmocom.org.pub') }}" +- name: include osmocom_build_deps.yml + include_tasks: osmocom_build_deps.yml + when: install_osmocom_build_deps + - name: include generic slave include_tasks: generic-slave.yml when: generic_slave diff --git a/ansible/roles/osmocom-jenkins-slave/tasks/osmocom_build_deps.yml b/ansible/roles/osmocom-jenkins-slave/tasks/osmocom_build_deps.yml new file mode 100644 index 0000000..733866c --- /dev/null +++ b/ansible/roles/osmocom-jenkins-slave/tasks/osmocom_build_deps.yml @@ -0,0 +1,85 @@ +--- +- name: install build utilities + apt: + name: "{{ item }}" + cache_valid_time: 3600 + update_cache: yes + with_items: + - asciidoc + - autoconf + - autoconf-archive + - automake + - bc + - bison + - coccinelle + - cppcheck + - debhelper + - devscripts + - dh-autoreconf + - dh-systemd + - doxygen + - flex + - g++ + - gawk + - gcc + - gcc-arm-none-eabi + - git + - git-buildpackage + - graphviz + - libtool + - libboost-all-dev + - make + - mscgen + - osc + - pkgconf + - python-minimal + - python-setuptools + - python3 + - python3-setuptools + - stow + - texinfo + # by gsm-manuals + - python-nwdiag + - python-pychart + # by gapk + - libasound-dev + - libopencore-amrnb-dev + +- name: install build dependencies and libraries + apt: + name: "{{ item }}" + cache_valid_time: 3600 + update_cache: yes + install_recommends: no + with_items: + - docbook5-xml + - libboost-dev + - libc-ares-dev + - libdbd-sqlite3 + - libdbi-dev + - libffi-dev + - libffi-dev + - libfftw3-dev + - libgmp-dev + - libgnutls28-dev + - libgps-dev + - libgsm1-dev + - libmnl-dev + - libncurses5-dev + - libortp-dev + - libpcap-dev + - libpcsclite-dev + - libreadline-dev + - libsctp-dev + - libsigsegv-dev + - libsnmp-dev + - libsofia-sip-ua-glib-dev + - libsqlite3-dev + - libssl-dev + - libsystemd-dev + - libtalloc-dev + - libuhd-dev + - libusb-1.0-0-dev + - libusb-dev + - libzmq3-dev + - sqlite3 -- To view, visit https://gerrit.osmocom.org/10014 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I469a8012b124516bfd9c4d4dd3a3fe0e1ff80bb6 Gerrit-Change-Number: 10014 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 10:22:18 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 24 Jul 2018 10:22:18 +0000 Subject: Change in osmo-ci[master]: ansible: osmocom-jenkins-slave: debian.yml: don't install recommends In-Reply-To: References: Message-ID: lynxis lazus has submitted this change and it was merged. ( https://gerrit.osmocom.org/10015 ) Change subject: ansible: osmocom-jenkins-slave: debian.yml: don't install recommends ...................................................................... ansible: osmocom-jenkins-slave: debian.yml: don't install recommends Pulls a lot of packages Change-Id: I894455ea779ece84c403f768a1260a1cf2528389 --- M ansible/roles/osmocom-jenkins-slave/tasks/debian.yml 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: lynxis lazus: Verified Harald Welte: Looks good to me, approved diff --git a/ansible/roles/osmocom-jenkins-slave/tasks/debian.yml b/ansible/roles/osmocom-jenkins-slave/tasks/debian.yml index a1f8574..43b1263 100644 --- a/ansible/roles/osmocom-jenkins-slave/tasks/debian.yml +++ b/ansible/roles/osmocom-jenkins-slave/tasks/debian.yml @@ -5,6 +5,7 @@ name: "{{ item }}" cache_valid_time: 3600 update_cache: yes + install_recommends: no with_items: - htop - virt-manager @@ -26,6 +27,7 @@ name: openjdk-8-jre-headless cache_valid_time: 3600 update_cache: yes + install_recommends: no default_release: jessie-backports when: ansible_distribution == 'Debian' and ansible_distribution_release == 'jessie' @@ -34,6 +36,7 @@ name: "{{ item }}" cache_valid_time: 3600 update_cache: yes + install_recommends: no with_items: - openjdk-8-jre-headless when: ansible_distribution == 'Debian' and ansible_distribution_release == 'stretch' -- To view, visit https://gerrit.osmocom.org/10015 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I894455ea779ece84c403f768a1260a1cf2528389 Gerrit-Change-Number: 10015 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 10:22:20 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 24 Jul 2018 10:22:20 +0000 Subject: Change in osmo-ci[master]: ansible: osmocom-jenkins-slave: add var install_jenkins_utilities In-Reply-To: References: Message-ID: lynxis lazus has submitted this change and it was merged. ( https://gerrit.osmocom.org/10016 ) Change subject: ansible: osmocom-jenkins-slave: add var install_jenkins_utilities ...................................................................... ansible: osmocom-jenkins-slave: add var install_jenkins_utilities To select if some utilities including qemu/debootstrap/fakeroot will be installed. Usefull for small setups e.g. simtester Change-Id: I72f4460b8550da191e74a44be0ee3eeb3b2d7769 --- M ansible/roles/osmocom-jenkins-slave/README.md M ansible/roles/osmocom-jenkins-slave/defaults/main.yml M ansible/roles/osmocom-jenkins-slave/tasks/debian.yml 3 files changed, 5 insertions(+), 0 deletions(-) Approvals: lynxis lazus: Verified Harald Welte: Looks good to me, approved diff --git a/ansible/roles/osmocom-jenkins-slave/README.md b/ansible/roles/osmocom-jenkins-slave/README.md index de02b43..50aed16 100644 --- a/ansible/roles/osmocom-jenkins-slave/README.md +++ b/ansible/roles/osmocom-jenkins-slave/README.md @@ -2,6 +2,7 @@ Support the following variables: +* `install_jenkins_utilities`: (true) install usefull utilities including qemu/debootstrap/fakeroot * `install_osmocom_build_deps`: (true) install all osmocom runtime and build time dependencies * `generic_slave`: (true) contains tasks used by the most osmocom jenkins slaves * `osmocom_jenkins_slave_fstrim`: (false) calls fstrim periodical diff --git a/ansible/roles/osmocom-jenkins-slave/defaults/main.yml b/ansible/roles/osmocom-jenkins-slave/defaults/main.yml index bdc13b4..4e1f179 100644 --- a/ansible/roles/osmocom-jenkins-slave/defaults/main.yml +++ b/ansible/roles/osmocom-jenkins-slave/defaults/main.yml @@ -3,6 +3,9 @@ # OS user jenkins_user: jenkins +# install usefull utilities including qemu/debootstrap/fakeroot +install_jenkins_utilities: true + # install all osmocom runtime and build time dependencies install_osmocom_build_deps: true diff --git a/ansible/roles/osmocom-jenkins-slave/tasks/debian.yml b/ansible/roles/osmocom-jenkins-slave/tasks/debian.yml index 43b1263..ad9f5c2 100644 --- a/ansible/roles/osmocom-jenkins-slave/tasks/debian.yml +++ b/ansible/roles/osmocom-jenkins-slave/tasks/debian.yml @@ -15,6 +15,7 @@ - proot - debootstrap - fakeroot + when: install_jenkins_utilities - name: enable backports for jessie apt_repository: -- To view, visit https://gerrit.osmocom.org/10016 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I72f4460b8550da191e74a44be0ee3eeb3b2d7769 Gerrit-Change-Number: 10016 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: lynxis lazus Gerrit-CC: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 10:22:23 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 24 Jul 2018 10:22:23 +0000 Subject: Change in osmo-ci[master]: ansible: add playbook setup-simtest In-Reply-To: References: Message-ID: lynxis lazus has submitted this change and it was merged. ( https://gerrit.osmocom.org/10017 ) Change subject: ansible: add playbook setup-simtest ...................................................................... ansible: add playbook setup-simtest Change-Id: Iab74a2b3fc3148bce815b2dadd1fd683c4b64c44 --- M ansible/hosts A ansible/setup-simtest.yml 2 files changed, 35 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved lynxis lazus: Verified diff --git a/ansible/hosts b/ansible/hosts index 4767b0c..85b25d6 100644 --- a/ansible/hosts +++ b/ansible/hosts @@ -14,3 +14,6 @@ build2-deb9build-ansible ansible_host=2a01:4f8:10b:2ad9::1:6 osmocom_jenkins_slave_fstrim=True host2-deb8build-ansible ansible_host=2a01:4f8:120:8470::1:2 host2-deb9build-ansible ansible_host=2a01:4f8:120:8470::1:3 osmocom_jenkins_slave_fstrim=True + +[simtester] +simtest ansible_host=10.9.25.80 diff --git a/ansible/setup-simtest.yml b/ansible/setup-simtest.yml new file mode 100644 index 0000000..2cbd45b --- /dev/null +++ b/ansible/setup-simtest.yml @@ -0,0 +1,32 @@ +--- +- name: setup jenkins slaves + hosts: simtester + user: root + tasks: + - name: apt-get update + apt: + cache_valid_time: 3600 + update_cache: yes + + - name: install common utilities + apt: + name: "{{ item }}" + install_recommends: no + with_items: + - vim + - ca-certificates + - python-minimal + - python-setuptools + - python-pip + - python-serial + - python-pyscard + - virtualenv + + roles: + - name: osmocom-jenkins-slave + generic_slave: false + install_jenkins_utilities: false + install_osmocom_build_deps: false + ttcn3_slave: false + tags: + - jenkins-slave -- To view, visit https://gerrit.osmocom.org/10017 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iab74a2b3fc3148bce815b2dadd1fd683c4b64c44 Gerrit-Change-Number: 10017 Gerrit-PatchSet: 3 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 10:23:22 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 24 Jul 2018 10:23:22 +0000 Subject: Change in osmo-ci[master]: jobs: osmo-gsm-tester-builder: Fix typo in job parameter name In-Reply-To: References: Message-ID: Hello lynxis lazus, Neels Hofmeyr, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10126 to look at the new patch set (#2). Change subject: jobs: osmo-gsm-tester-builder: Fix typo in job parameter name ...................................................................... jobs: osmo-gsm-tester-builder: Fix typo in job parameter name osmo-mgw is duplicated and osmo-bsc is not there. Change-Id: Ib0ab7f8796b8b78d5f21b7a4f541fd3ddffc95a4 --- M jobs/osmo-gsm-tester-builder.yml 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/26/10126/2 -- To view, visit https://gerrit.osmocom.org/10126 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib0ab7f8796b8b78d5f21b7a4f541fd3ddffc95a4 Gerrit-Change-Number: 10126 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 10:25:04 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 10:25:04 +0000 Subject: Change in osmo-mgw[master]: cosmetic: mgcp_network.c: merge one LOGPC to its preceding LOGP In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10117 ) Change subject: cosmetic: mgcp_network.c: merge one LOGPC to its preceding LOGP ...................................................................... cosmetic: mgcp_network.c: merge one LOGPC to its preceding LOGP Change-Id: I4dde8a060ec77e1234a373d7501c7082ae4c5028 --- M src/libosmo-mgcp/mgcp_network.c 1 file changed, 3 insertions(+), 6 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c index 870a4de..7d98d07 100644 --- a/src/libosmo-mgcp/mgcp_network.c +++ b/src/libosmo-mgcp/mgcp_network.c @@ -680,12 +680,9 @@ } LOGP(DRTP, LOGL_DEBUG, - "endpoint:0x%x loop:%d, mode:%d ", - ENDPOINT_NUMBER(endp), tcfg->audio_loop, conn_src->conn->mode); - if (conn_src->conn->mode == MGCP_CONN_LOOPBACK) - LOGPC(DRTP, LOGL_DEBUG, "(loopback)\n"); - else - LOGPC(DRTP, LOGL_DEBUG, "\n"); + "endpoint:0x%x loop:%d, mode:%d%s\n", + ENDPOINT_NUMBER(endp), tcfg->audio_loop, conn_src->conn->mode, + conn_src->conn->mode == MGCP_CONN_LOOPBACK ? " (loopback)" : ""); /* Note: In case of loopback configuration, both, the source and the * destination will point to the same connection. */ -- To view, visit https://gerrit.osmocom.org/10117 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I4dde8a060ec77e1234a373d7501c7082ae4c5028 Gerrit-Change-Number: 10117 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 10:25:05 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 10:25:05 +0000 Subject: Change in osmo-mgw[master]: IuUP hack: make RTP patching less general In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10118 ) Change subject: IuUP hack: make RTP patching less general ...................................................................... IuUP hack: make RTP patching less general We currently still patch over an RTP message to make it look like an IuUP Initialization Ack specifically for the ip.access nano3G femto cell. Be more specific about it: - only patch over RTP in 'loopback' mode. osmo-msc specifically leaves the endpoint in loopback mode for this hack, so if we're not in 'loopback', then this hack is out of place. - only patch over RTP if the header indicates an IuUP Initialization (check for 0xe4 byte). Change-Id: Ia9ec4debc138b34f6ca6a871a8778eafa6c0ba21 --- M src/libosmo-mgcp/mgcp_network.c 1 file changed, 11 insertions(+), 4 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c index 7d98d07..3ac93be 100644 --- a/src/libosmo-mgcp/mgcp_network.c +++ b/src/libosmo-mgcp/mgcp_network.c @@ -732,11 +732,18 @@ * 'e400', or it will reject the RAB assignment. It seems to not harm other femto * cells (as long as we patch only the first RTP payload in each stream). */ - if (!rtp_state->patched_first_rtp_payload) { + if (!rtp_state->patched_first_rtp_payload + && conn_src->conn->mode == MGCP_CONN_LOOPBACK) { uint8_t *data = (uint8_t *) & buf[12]; - data[0] = 0xe4; - data[1] = 0x00; - rtp_state->patched_first_rtp_payload = true; + if (data[0] == 0xe0) { + data[0] = 0xe4; + data[1] = 0x00; + rtp_state->patched_first_rtp_payload = true; + LOGP(DRTP, LOGL_DEBUG, + "endpoint:0x%x Patching over first two bytes" + " to fake an IuUP Initialization Ack\n", + ENDPOINT_NUMBER(endp)); + } } len = mgcp_udp_send(rtp_end->rtp.fd, -- To view, visit https://gerrit.osmocom.org/10118 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ia9ec4debc138b34f6ca6a871a8778eafa6c0ba21 Gerrit-Change-Number: 10118 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 10:26:46 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 10:26:46 +0000 Subject: Change in osmo-bsc[master]: large refactoring: use FSMs for lchans; add inter-BSC HO In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9671 ) Change subject: large refactoring: use FSMs for lchans; add inter-BSC HO ...................................................................... Patch Set 33: ok, let me add an "if (1)" then ;) -- To view, visit https://gerrit.osmocom.org/9671 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I82e3f918295daa83274a4cf803f046979f284366 Gerrit-Change-Number: 9671 Gerrit-PatchSet: 33 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Tue, 24 Jul 2018 10:26:46 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 10:41:53 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 24 Jul 2018 10:41:53 +0000 Subject: Change in osmo-sgsn[master]: gbproxy: Replace '.' in counter names with ':' Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10127 Change subject: gbproxy: Replace '.' in counter names with ':' ...................................................................... gbproxy: Replace '.' in counter names with ':' The '.' is illegal character in counter names, as they are exported via CTRL interface, where '.' has a special meaning that cannot be used by strings comprising the variable name. Change-Id: I93a2e5b6ec66c9edb6e93d95032e788f552af44b --- M src/gprs/gb_proxy.c 1 file changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/27/10127/1 diff --git a/src/gprs/gb_proxy.c b/src/gprs/gb_proxy.c index 7d21518..447772f 100644 --- a/src/gprs/gb_proxy.c +++ b/src/gprs/gb_proxy.c @@ -57,12 +57,12 @@ { "inv-lai", "Invalid Location Area Identifier" }, { "inv-rai", "Invalid Routing Area Identifier " }, { "inv-nsei", "No BVC established for NSEI " }, - { "proto-err.bss", "BSSGP protocol error (BSS )" }, - { "proto-err.sgsn", "BSSGP protocol error (SGSN)" }, - { "not-supp.bss", "Feature not supported (BSS )" }, - { "not-supp.sgsn", "Feature not supported (SGSN)" }, - { "restart.sgsn", "Restarted RESET procedure (SGSN)" }, - { "tx-err.sgsn", "NS Transmission error (SGSN)" }, + { "proto-err:bss", "BSSGP protocol error (BSS )" }, + { "proto-err:sgsn", "BSSGP protocol error (SGSN)" }, + { "not-supp:bss", "Feature not supported (BSS )" }, + { "not-supp:sgsn", "Feature not supported (SGSN)" }, + { "restart:sgsn", "Restarted RESET procedure (SGSN)" }, + { "tx-err:sgsn", "NS Transmission error (SGSN)" }, { "error", "Other error " }, { "mod-peer-err", "Patch error: no peer " }, }; -- To view, visit https://gerrit.osmocom.org/10127 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I93a2e5b6ec66c9edb6e93d95032e788f552af44b Gerrit-Change-Number: 10127 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 12:29:01 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Tue, 24 Jul 2018 12:29:01 +0000 Subject: Change in osmo-ttcn3-hacks[master]: Stop tests after failures In-Reply-To: References: Message-ID: Hello Pau Espin Pedrol, Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9907 to look at the new patch set (#3). Change subject: Stop tests after failures ...................................................................... Stop tests after failures Call mtc.stop after setverdict(fail), add reasons to most failures and fail with verdict error for internal errors. Change-Id: I9b618235939fa41160b9be6677b121963d3ec857 --- M bsc/BSC_Tests.ttcn M bsc/MSC_ConnectionHandler.ttcn M hlr/HLR_Tests.ttcn M mgw/MGCP_Test.ttcn M mgw/RTP_Endpoint.ttcn M msc/BSC_ConnectionHandler.ttcn M msc/MSC_Tests.ttcn M pcu/GPRS_TBF.ttcn M pcu/PCU_Tests.ttcn M selftest/Selftest.ttcn M sgsn/SGSN_Tests.ttcn M sip/SIP_Tests.ttcn M sysinfo/Test.ttcn 13 files changed, 189 insertions(+), 112 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/07/9907/3 -- To view, visit https://gerrit.osmocom.org/9907 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9b618235939fa41160b9be6677b121963d3ec857 Gerrit-Change-Number: 9907 Gerrit-PatchSet: 3 Gerrit-Owner: daniel Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel Gerrit-CC: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 12:29:01 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Tue, 24 Jul 2018 12:29:01 +0000 Subject: Change in osmo-ttcn3-hacks[master]: Fail if f_streamId_by_trx() can't find a stream id In-Reply-To: References: Message-ID: Hello Pau Espin Pedrol, Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10120 to look at the new patch set (#2). Change subject: Fail if f_streamId_by_trx() can't find a stream id ...................................................................... Fail if f_streamId_by_trx() can't find a stream id Change-Id: Ie58278edf7050254d7cdced48b4b7870e0e8d577 --- M library/RSL_Emulation.ttcn 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/20/10120/2 -- To view, visit https://gerrit.osmocom.org/10120 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie58278edf7050254d7cdced48b4b7870e0e8d577 Gerrit-Change-Number: 10120 Gerrit-PatchSet: 2 Gerrit-Owner: daniel Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 12:29:02 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Tue, 24 Jul 2018 12:29:02 +0000 Subject: Change in osmo-ttcn3-hacks[master]: Reply to wildcard ep in CRCX with a concrete endpoint Message-ID: daniel has uploaded this change for review. ( https://gerrit.osmocom.org/10128 Change subject: Reply to wildcard ep in CRCX with a concrete endpoint ...................................................................... Reply to wildcard ep in CRCX with a concrete endpoint BSC_ConnectionHandler.ttcn:563 This helps TC_gsup_cancel which previously encountered a Dynamic test case error: Using the value of an optional field containing omit. The test still fails, but this time because it "Received unexpected BSSAP instead of CM SERV REJ". Change-Id: I9fedf2573487066b951804a328ba428d2189c4a4 --- M msc/MSC_Tests.ttcn 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/28/10128/1 diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index 161744c..63cab84 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -1504,6 +1504,7 @@ cpars.bss_rtp_port := 1110; cpars.mgcp_connection_id_bss := '22222'H; cpars.mgcp_connection_id_mss := '33333'H; + cpars.mgcp_ep := "rtpbridge/1 at mgw"; /* Location Update to make subscriber known */ f_perform_lu(); -- To view, visit https://gerrit.osmocom.org/10128 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I9fedf2573487066b951804a328ba428d2189c4a4 Gerrit-Change-Number: 10128 Gerrit-PatchSet: 1 Gerrit-Owner: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 12:53:43 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 24 Jul 2018 12:53:43 +0000 Subject: Change in osmo-ttcn3-hacks[master]: Stop tests after failures In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9907 ) Change subject: Stop tests after failures ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9907 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9b618235939fa41160b9be6677b121963d3ec857 Gerrit-Change-Number: 9907 Gerrit-PatchSet: 3 Gerrit-Owner: daniel Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 24 Jul 2018 12:53:43 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 12:53:50 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 24 Jul 2018 12:53:50 +0000 Subject: Change in osmo-ttcn3-hacks[master]: Fail if f_streamId_by_trx() can't find a stream id In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10120 ) Change subject: Fail if f_streamId_by_trx() can't find a stream id ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10120 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie58278edf7050254d7cdced48b4b7870e0e8d577 Gerrit-Change-Number: 10120 Gerrit-PatchSet: 2 Gerrit-Owner: daniel Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 24 Jul 2018 12:53:50 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 12:55:30 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 24 Jul 2018 12:55:30 +0000 Subject: Change in osmo-ttcn3-hacks[master]: Reply to wildcard ep in CRCX with a concrete endpoint In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10128 ) Change subject: Reply to wildcard ep in CRCX with a concrete endpoint ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10128 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9fedf2573487066b951804a328ba428d2189c4a4 Gerrit-Change-Number: 10128 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 24 Jul 2018 12:55:30 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 12:56:27 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Tue, 24 Jul 2018 12:56:27 +0000 Subject: Change in osmo-ttcn3-hacks[master]: Stop tests after failures In-Reply-To: References: Message-ID: daniel has submitted this change and it was merged. ( https://gerrit.osmocom.org/9907 ) Change subject: Stop tests after failures ...................................................................... Stop tests after failures Call mtc.stop after setverdict(fail), add reasons to most failures and fail with verdict error for internal errors. Change-Id: I9b618235939fa41160b9be6677b121963d3ec857 --- M bsc/BSC_Tests.ttcn M bsc/MSC_ConnectionHandler.ttcn M hlr/HLR_Tests.ttcn M mgw/MGCP_Test.ttcn M mgw/RTP_Endpoint.ttcn M msc/BSC_ConnectionHandler.ttcn M msc/MSC_Tests.ttcn M pcu/GPRS_TBF.ttcn M pcu/PCU_Tests.ttcn M selftest/Selftest.ttcn M sgsn/SGSN_Tests.ttcn M sip/SIP_Tests.ttcn M sysinfo/Test.ttcn 13 files changed, 189 insertions(+), 112 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 2897a0b..d71d3dc 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -113,14 +113,8 @@ } private function f_shutdown_helper() runs on test_CT { - for (var integer i := 0; i < NUM_BTS; i := i+1) { - if (isbound(bts[i]) and isbound(bts[i].rsl)) { - f_ipa_rsl_stop(bts[i].rsl); - } - } - f_ipa_ctrl_stop(); - all port.stop; setverdict(pass); + mtc.stop; } private function f_legacy_bssap_reset() runs on test_CT { @@ -199,7 +193,7 @@ [] IPA_RSL[i].receive { repeat } [] T.timeout { setverdict(fail, "Timeout RSL waiting for ASP_IPA_EVENT_ID_ACK"); - self.stop; + mtc.stop; } } } @@ -230,7 +224,7 @@ f_sleep(0.1); if (not T.running) { setverdict(fail, "Timeout waiting for oml-connection-state ", status); - self.stop; + mtc.stop; } } } @@ -240,7 +234,7 @@ var BSSAP_N_UNITDATA_ind ud_ind; [] T_guard.timeout { setverdict(fail, "Timeout of T_guard"); - self.stop; + mtc.stop; } /* always respond with RESET ACK to RESET */ [] BSSAP.receive(tr_BSSAP_UNITDATA_ind(?, ?, tr_BSSMAP_Reset)) -> value ud_ind { @@ -253,7 +247,7 @@ altstep no_bssmap_reset() runs on test_CT { [] BSSAP.receive(tr_BSSAP_UNITDATA_ind(?, ?, tr_BSSMAP_Reset)) { setverdict(fail, "unexpected BSSMAP Reset"); - self.stop; + mtc.stop; } } @@ -340,7 +334,7 @@ [] IPA_RSL[bts_nr].receive { repeat; } [] T.timeout { setverdict(fail, "Timeout expecting ", t_rx); - self.stop; + mtc.stop; } } return rx_rsl_ud.rsl; @@ -1325,7 +1319,7 @@ alt { [] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_PAGING_CMD(?))) { setverdict(fail, "Received PAGING after LOAD_IND(0)"); - self.stop; + mtc.stop; } [] T_retrans.timeout { /* re-trnsmit the zero-space LOAD IND to avoid BSC 'auto credit' */ @@ -1404,15 +1398,15 @@ alt { [] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_PAGING_CMD(?))) { setverdict(fail, "Received PAGING after A-RESET"); - self.stop; + mtc.stop; } [] IPA_RSL[1].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_PAGING_CMD(?))) { setverdict(fail, "Received PAGING after A-RESET"); - self.stop; + mtc.stop; } [] IPA_RSL[2].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_PAGING_CMD(?))) { setverdict(fail, "Received PAGING after A-RESET"); - self.stop; + mtc.stop; } [] T.timeout { setverdict(pass); @@ -1467,10 +1461,9 @@ } [] IPA_RSL[0].receive { repeat } [] T.timeout { - self.stop; + return false; } } - return false; } @@ -1762,7 +1755,7 @@ } case else { setverdict(fail, "Unsupported codec ", a_elem); - self.stop; + mtc.stop; } } return ret; @@ -1835,7 +1828,7 @@ var RSL_IE_Body mode_ie; if (f_rsl_find_ie(rsl, RSL_IE_CHAN_MODE, mode_ie) == false) { setverdict(fail, "Couldn't find CHAN_MODE IE"); - self.stop; + mtc.stop; } var template RSL_IE_Body t_mode_ie := f_rsl_chmod_tmpl_from_codec(g_pars.ass_codec_list.codecElements[0]); if (not match(mode_ie, t_mode_ie)) { @@ -1846,7 +1839,7 @@ if (g_pars.expect_mr_conf_ie != omit) { if (f_rsl_find_ie(rsl, RSL_IE_MR_CONFIG, mr_conf) == false) { setverdict(fail, "Missing MR CONFIG IE in RSL Chan Activ"); - self.stop; + mtc.stop; } log("found RSL MR CONFIG IE: ", mr_conf); @@ -1858,7 +1851,7 @@ if (f_rsl_find_ie(rsl, RSL_IE_MR_CONFIG, mr_conf) == true) { log("found RSL MR CONFIG IE: ", mr_conf); setverdict(fail, "Found MR CONFIG IE in RSL Chan Activ, expecting omit"); - self.stop; + mtc.stop; } } } @@ -1973,7 +1966,7 @@ alt { [] BSSAP.receive(PDU_BSSAP:?) -> value bssap { setverdict(fail, "Unexpected BSSMAP ", bssap); - self.stop; + mtc.stop; } [] T.timeout { setverdict(pass); @@ -2087,7 +2080,7 @@ ss_nr := chan_nr.u.sdcch8.sub_chan; } else { setverdict(fail, "Invalid ChanNr ", chan_nr); - self.stop; + mtc.stop; } var charstring cmd := "bts "&int2str(bts_nr)&" trx "&int2str(trx_nr)& @@ -2337,7 +2330,7 @@ var charstring mode := f_ts_dyn_mode_get(bts_nr, trx_nr, ts_nr); if (not match(mode, exp)) { setverdict(fail, "Unexpected TS Mode: ", mode); - self.stop; + mtc.stop; } } diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index a82728a..102c30e 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -147,7 +147,7 @@ } } setverdict(fail, "Only 2 Connections per EP!"); - self.stop; + mtc.stop; } /* Helper function to pick a specific connection by its cid. Since we reach out @@ -160,7 +160,7 @@ } } setverdict(fail, "No Connection for ID ", cid); - self.stop; + mtc.stop; } /* altstep for handling of IPACC media related commands. Activated by as_Media() to test @@ -189,7 +189,7 @@ b_unused := f_rsl_find_ie(rsl, RSL_IE_IPAC_CONN_ID, ie); if (g_media.bts.conn_id != ie.ipa_conn_id) { setverdict(fail, "IPA MDCX for unknown ConnId", rsl); - self.stop; + mtc.stop; } /* mandatory */ b_unused := f_rsl_find_ie(rsl, RSL_IE_IPAC_REMOTE_IP, ie); @@ -233,7 +233,7 @@ b_unused := f_rsl_find_ie(rsl, RSL_IE_IPAC_CONN_ID, ie); if (g_media.bts1.conn_id != ie.ipa_conn_id) { setverdict(fail, "IPA MDCX for unknown ConnId", rsl); - self.stop; + mtc.stop; } /* mandatory */ b_unused := f_rsl_find_ie(rsl, RSL_IE_IPAC_REMOTE_IP, ie); @@ -269,7 +269,7 @@ if (match(mgcp_cmd.line.ep, t_MGCP_EP_wildcard)) { if (cid != 0) { setverdict(fail, "MGCP wildcard EP only works in first CRCX"); - self.stop; + mtc.stop; } /* we keep the endpoint name allocated during MediaState_init */ } else { @@ -575,12 +575,12 @@ } else { setverdict(fail, "Unknown ChDesc!"); - self.stop; + mtc.stop; } if (ch_desc.octet3 and4b '10'O == '10'O) { setverdict(fail, "No support for Hopping"); - self.stop; + mtc.stop; } else { var OCT2 concat := ch_desc.octet3 & ch_desc.octet4; arfcn := oct2int(concat); @@ -670,7 +670,7 @@ repeat; } else { setverdict(fail, "Unexpected L3 received", l3); - self.stop; + mtc.stop; } } [st.rr_ass_cmpl_seen] RSL.receive(tr_RSL_REL_REQ(st.old_chan_nr, tr_RslLinkID_DCCH(0))) { @@ -955,7 +955,7 @@ } log("g_media ", g_media); if (not isbound(bssap)) { - self.stop; + mtc.stop; } /* When the BSC detects that LCLS is possible it will cross the @@ -1019,7 +1019,7 @@ repeat; } else { setverdict(fail, "Unexpected L3 received", l3); - self.stop; + mtc.stop; } } [st.rr_ho_cmpl_seen] as_Media_ipacc(); diff --git a/hlr/HLR_Tests.ttcn b/hlr/HLR_Tests.ttcn index 51d45ba..753f92e 100644 --- a/hlr/HLR_Tests.ttcn +++ b/hlr/HLR_Tests.ttcn @@ -91,7 +91,7 @@ private altstep as_Tguard() runs on test_CT { [] g_Tguard.timeout { setverdict(fail, "g_Tguard timeout"); - self.stop; + mtc.stop; } } @@ -131,7 +131,7 @@ [legacy] GSUP.receive(ASP_IPA_Event:{up_down := ASP_IPA_EVENT_UP}) { } [] T.timeout { setverdict(fail, "No connection to GSUP Port"); - self.stop; + mtc.stop; } } } @@ -270,7 +270,7 @@ var charstring ret := f_vty_transceive_ret(pt, cmd); if (not match(ret, exp_ret)) { setverdict(fail, "Non-matching VTY response: ", ret); - self.stop; + mtc.stop; } } @@ -359,7 +359,7 @@ [] GSUP.receive { repeat; } [] T.timeout { setverdict(fail, "Timeout waiting for SAI response"); - self.stop; + mtc.stop; } } return ret; @@ -405,7 +405,7 @@ [] GSUP.receive { repeat; } [] T.timeout { setverdict(fail, "Timeout waiting for UL response"); - self.stop; + mtc.stop; } } return ret; @@ -443,7 +443,7 @@ [] GSUP.receive { repeat; } [] T.timeout { setverdict(fail, "Timeout waiting for PURGE response"); - self.stop; + mtc.stop; } } return ret; diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn index 659d5f1..82ed608 100644 --- a/mgw/MGCP_Test.ttcn +++ b/mgw/MGCP_Test.ttcn @@ -71,7 +71,7 @@ res := MGCP_CodecPort_CtrlFunct.f_IPL4_connect(MGCP, mp_remote_ip, mp_remote_udp_port, mp_local_ip, mp_local_udp_port, 0, { udp := {} }); if (not ispresent(res.connId)) { setverdict(fail, "Could not connect MGCP, check your configuration"); - self.stop; + mtc.stop; } g_mgcp_conn_id := res.connId; @@ -180,9 +180,15 @@ T.start; alt { [] MGCP.receive(mrt) -> value mrf { } - [] MGCP.receive(tr_MGCP_RecvFrom_R(?)) { setverdict(fail); } + [] MGCP.receive(tr_MGCP_RecvFrom_R(?)) { + setverdict(fail, "Response didn't match template"); + mtc.stop; + } [] MGCP.receive { repeat; } - [] T.timeout { setverdict(fail); } + [] T.timeout { + setverdict(fail, "Timeout waiting for response to ", cmd); + mtc.stop; + } } T.stop; @@ -202,7 +208,8 @@ return str2hex(par.val); } } - setverdict(fail); + setverdict(fail, "Could not find conn id for MgcpReponse"); + mtc.stop; return '00000000'H; } @@ -390,12 +397,14 @@ payload type should be visible in the SDP of the response. */ if (resp.sdp.media_list[0].media_field.fmts[0] != "0") { setverdict(fail, "SDP contains unexpected codec"); + mtc.stop; } /* See also OS#2658: We also expect the MGW to assign a port number to us. */ if (isbound(resp.sdp.media_list[0].media_field.ports.port_number) == false) { setverdict(fail, "SDP does not contain a port number"); + mtc.stop; } } @@ -579,6 +588,7 @@ } if (f_mgcp_find_param(resp_msg, "Z", ep_assigned) == false) { setverdict(fail, "No SpecificEndpointName in MGCP response", resp); + mtc.stop; } /* clean-up */ @@ -611,6 +621,7 @@ } if (f_mgcp_find_param(resp_msg, "Z", ep_assigned[i]) == false) { setverdict(fail, "No SpecificEndpointName in MGCP response", resp); + mtc.stop; } } @@ -920,6 +931,7 @@ stats[1] := f_rtpem_stats_get(RTPEM[1]); if (not f_rtpem_stats_compare(stats[0], stats[1])) { setverdict(fail, "RTP endpoint statistics don't match"); + mtc.stop; } setverdict(pass); } @@ -1047,6 +1059,7 @@ stats[1] := f_rtpem_stats_get(RTPEM[1]); if (not f_rtpem_stats_compare(stats[0], stats[1], tolerance)) { setverdict(fail, "RTP endpoint statistics don't match"); + mtc.stop; } setverdict(pass); @@ -1092,10 +1105,12 @@ stats[0] := f_rtpem_stats_get(RTPEM[0]); if (stats[0].num_pkts_rx_err_disabled != 0) { setverdict(fail, "received packets from MGW on recvonly connection"); + mtc.stop; } stats[1] := f_rtpem_stats_get(RTPEM[1]); if (stats[1].num_pkts_rx_err_disabled != 0) { setverdict(fail, "received packets from MGW on recvonly connection"); + mtc.stop; } /* The second leg starts transmitting a little later */ @@ -1104,10 +1119,12 @@ stats[0] := f_rtpem_stats_get(RTPEM[0]); if (stats[0].num_pkts_rx_err_disabled != 0) { setverdict(fail, "received packets from MGW on recvonly connection"); + mtc.stop; } stats[1] := f_rtpem_stats_get(RTPEM[1]); if (stats[1].num_pkts_rx_err_disabled != 0) { setverdict(fail, "received packets from MGW on recvonly connection"); + mtc.stop; } /* The first leg will now be switched into bidirectional @@ -1117,10 +1134,12 @@ stats[0] := f_rtpem_stats_get(RTPEM[0]); if (stats[1].num_pkts_rx_err_disabled != 0) { setverdict(fail, "received packets from MGW on recvonly connection"); + mtc.stop; } stats[1] := f_rtpem_stats_get(RTPEM[1]); if (stats[1].num_pkts_rx_err_disabled != 0) { setverdict(fail, "received packets from MGW on recvonly connection"); + mtc.stop; } /* When the second leg is switched into bidirectional mode @@ -1142,11 +1161,13 @@ temp := stats[0].num_pkts_tx - num_pkts_tx[0] - stats[1].num_pkts_rx; if (temp > 3 or temp < -3) { setverdict(fail, "number of packets not within normal parameters"); + mtc.stop; } temp := stats[1].num_pkts_tx - num_pkts_tx[1] - stats[0].num_pkts_rx; if (temp > 3 or temp < -3) { setverdict(fail, "number of packets not within normal parameters"); + mtc.stop; } /* Tear down */ @@ -1197,6 +1218,7 @@ stats[1] := f_rtpem_stats_get(RTPEM[1]); if (not f_rtpem_stats_compare(stats[0], stats[1])) { setverdict(fail, "RTP endpoint statistics don't match"); + mtc.stop; } setverdict(pass); @@ -1254,10 +1276,12 @@ stats[1] := f_rtpem_stats_get(RTPEM[1]); if (not f_rtpem_stats_compare(stats[0], stats[1], 5)) { setverdict(fail, "RTP endpoint statistics don't match"); + mtc.stop; } stats[2] := f_rtpem_stats_get(RTPEM[2]); if (stats[2].num_pkts_rx_err_disabled != 0) { setverdict(fail, "received packets on old leg after handover"); + mtc.stop; } setverdict(pass); diff --git a/mgw/RTP_Endpoint.ttcn b/mgw/RTP_Endpoint.ttcn index 3c939a2..c73aa58 100644 --- a/mgw/RTP_Endpoint.ttcn +++ b/mgw/RTP_Endpoint.ttcn @@ -111,7 +111,7 @@ sub.local_name, sub.local_port, sub.connection_id, { udp := {} }); if (not ispresent(res.connId)) { setverdict(fail, "Could not connect RTP, check your configuration"); - self.stop; + mtc.stop; } /* connect without previous bind: save conenction id allocated by IPL4asp */ if (sub.connection_id == -1) { @@ -136,7 +136,7 @@ res := f_IPL4_listen(RTP, sub.local_name, sub.local_port, { udp := {} }); if (not ispresent(res.connId)) { setverdict(fail, "Could not listen to RTP, check your configuration"); - self.stop; + mtc.stop; } sub.connection_id := res.connId; } diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn index 803cb4d..4e02d6c 100644 --- a/msc/BSC_ConnectionHandler.ttcn +++ b/msc/BSC_ConnectionHandler.ttcn @@ -109,7 +109,7 @@ private altstep as_Tguard() runs on BSC_ConnHdlr { [] g_Tguard.timeout { setverdict(fail, "Tguard timeout"); - self.stop; + mtc.stop; } } @@ -183,7 +183,7 @@ [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_CONF_IND) {} [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) { setverdict(fail, "DISC.ind from SCCP"); - self.stop; + mtc.stop; } } } @@ -294,7 +294,7 @@ } [] BSSAP.receive(tr_BSSMAP_CipherModeCmd(?, g_pars.vec.kc)) { setverdict(fail, "Wrong ciphering algorithm mask in CiphModCmd"); - self.stop; + mtc.stop; } } /* FIXME: Send the best available algorithm */ @@ -331,7 +331,7 @@ if (not ispresent(lu_acc.mobileIdentityTLV) or not ischosen(lu_acc.mobileIdentityTLV.mobileIdentityLV.mobileIdentityV.oddEvenInd_identity.tmsi_ptmsi)) { setverdict(fail, "Expected TMSI but no TMSI was allocated"); - self.stop; + mtc.stop; } else { g_pars.tmsi := lu_acc.mobileIdentityTLV.mobileIdentityLV.mobileIdentityV.oddEvenInd_identity.tmsi_ptmsi.octets; BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_TmsiRealloc_Cmpl)); @@ -340,13 +340,13 @@ if (ispresent(lu_acc.mobileIdentityTLV) and ischosen(lu_acc.mobileIdentityTLV.mobileIdentityLV.mobileIdentityV.oddEvenInd_identity.tmsi_ptmsi)) { setverdict(fail, "Expected no TMSI but TMSI was allocated"); - self.stop; + mtc.stop; } } } [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) { setverdict(fail, "Expected LU ACK, but received LU REJ"); - self.stop; + mtc.stop; } } /* FIXME: there could be pending SMS or other common procedures by the MSC, let's ignore them */ @@ -695,7 +695,7 @@ [] MNCC.receive(tr_MNCC_START_DTMF_ind(cpars.mncc_callref, "2")) {} [] T.timeout { setverdict(fail, "Timeout waiting for START_DTMF_ind"); - self.stop; + mtc.stop; } } @@ -704,7 +704,7 @@ alt { [] MNCC.receive(tr_MNCC_START_DTMF_ind(cpars.mncc_callref, "2")) { setverdict(fail, "Received duplicate START_DTMF_ind"); - self.stop; + mtc.stop; } [] T.timeout { } } @@ -716,7 +716,7 @@ [] MNCC.receive(tr_MNCC_START_DTMF_ind(cpars.mncc_callref, "3")) { } [] T.timeout { setverdict(fail, "Received duplicate START_DTMF_ind"); - self.stop; + mtc.stop; } } @@ -732,13 +732,13 @@ } [] BSSAP.receive { setverdict(fail, "Unexpected BSSMAP while waiting for SCCP Release"); - self.stop; + mtc.stop; } } } [] BSSAP.receive { setverdict(fail, "Unexpected BSSMAP while waiting for ClearCommand"); - self.stop; + mtc.stop; } } @@ -750,7 +750,7 @@ [] as_clear_cmd_compl_disc(t) { } [] T.timeout { setverdict(fail, "Timeout waiting for ClearCommand/Release"); - self.stop; + mtc.stop; } } } @@ -808,7 +808,7 @@ private altstep as_other_sms() runs on BSC_ConnHdlr { [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_SMS(?, ?, ?), ?)) { setverdict(fail, "Unexpected SMS related PDU from MSC"); - self.stop; + mtc.stop; } } diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index a18b9b0..161744c 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -133,7 +133,7 @@ private altstep as_Tguard_direct() runs on MTC_CT { [] Tguard_direct.timeout { setverdict(fail, "Tguard timeout"); - self.stop; + mtc.stop; } } @@ -213,7 +213,7 @@ [] GSUP_IPA_EVENT.receive(t_ASP_IPA_EVT_UD(ASP_IPA_EVENT_UP)) { } [] T.timeout { setverdict(fail, "No connection to GSUP Port"); - self.stop + mtc.stop } } } @@ -226,7 +226,7 @@ g_initialized := true; if (num_bsc > NUM_BSC) { - setverdict(fail, "excess number of BSC instances requested"); + testcase.stop("excess number of BSC instances requested"); } for (var integer i := 0; i < num_bsc; i := i + 1) { @@ -234,7 +234,7 @@ f_bssap_init(g_bssap[i], mp_bssap_cfg[i], "MSC_Test_" & int2str(i), BSC_BssmapOps); f_bssap_start(g_bssap[i]); } else { - setverdict(fail, "missing BSSAP configuration"); + testcase.stop("missing BSSAP configuration"); } } @@ -529,7 +529,7 @@ } [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Acc)) { setverdict(fail, "Expecting LU REJ, but got ACCEPT"); - self.stop; + mtc.stop; } } f_expect_clear(); @@ -558,7 +558,7 @@ } [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Acc)) { setverdict(fail, "Expecting LU REJ, but got ACCEPT"); - self.stop; + mtc.stop; } } f_expect_clear(); @@ -605,11 +605,18 @@ alt { [] BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ)) { } //[] BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_ACC)) { } - [] BSSAP.receive { setverdict(fail, "Received unexpected BSSAP"); } + [] BSSAP.receive { + setverdict(fail, "Received unexpected BSSAP"); + mtc.stop; + } [] GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)) { setverdict(fail, "Unexpected GSUP UL REQ"); + mtc.stop; } - [] T.timeout { setverdict(fail, "Timeout waiting for CM SERV REQ"); } + [] T.timeout { + setverdict(fail, "Timeout waiting for CM SERV REQ"); + mtc.stop; + } } f_expect_clear(); @@ -730,6 +737,7 @@ /* See https://osmocom.org/issues/2862 */ [] BSSAP.receive(tr_BSSMAP_ClearCommand) { setverdict(fail, "Got a second Clear Command, only one expected"); + mtc.stop; repeat; } [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {} @@ -840,6 +848,7 @@ } [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) { setverdict(fail, "Expected LU ACK, but received REJ"); + mtc.stop; } } @@ -1127,7 +1136,7 @@ [] as_clear_cmd_compl_disc(); [] T.timeout { setverdict(fail, "Timeout waiting for ClearCommand or SCCP Release"); - self.stop; + mtc.stop; } } setverdict(pass); @@ -1161,7 +1170,7 @@ [] as_clear_cmd_compl_disc(); [] T.timeout { setverdict(fail, "Timeout waiting for ClearCommand or SCCP Release"); - self.stop; + mtc.stop; } } setverdict(pass); @@ -1305,7 +1314,10 @@ timer T := 30.0; T.start; alt { - [] T.timeout { setverdict(fail, "Timeout waiting for channel release"); self.stop; } + [] T.timeout { + setverdict(fail, "Timeout waiting for channel release"); + mtc.stop; + } [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_RELEASE(cpars.transaction_id))) { BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_REL_COMPL(cpars.transaction_id))); repeat; @@ -1317,7 +1329,10 @@ * the current implementation, there is no recovery mechanism implemented * and a DLCX can not be performed as the MSC does not know a specific * endpoint yet. */ - [] MGCP.receive { setverdict(fail, "Unexpected MGCP message"); self.stop; } + [] MGCP.receive { + setverdict(fail, "Unexpected MGCP message"); + mtc.stop; + } [] as_clear_cmd_compl_disc(); } } @@ -1405,7 +1420,10 @@ timer T := 30.0; T.start; alt { - [] T.timeout { setverdict(fail, "Timeout waiting for channel release"); self.stop; } + [] T.timeout { + setverdict(fail, "Timeout waiting for channel release"); + mtc.stop; + } [] BSSAP.receive { repeat; } [] MNCC.receive { repeat; } [] GSUP.receive { repeat; } @@ -1449,7 +1467,10 @@ timer T := 190.0; T.start; alt { - [] T.timeout { setverdict(fail, "Timeout waiting for T310"); self.stop; } + [] T.timeout { + setverdict(fail, "Timeout waiting for T310"); + mtc.stop; + } [] MNCC.receive(tr_MNCC_DISC_ind(cpars.mncc_callref)) { MNCC.send(ts_MNCC_REL_req(cpars.mncc_callref, valueof(ts_MNCC_cause(23)))); } @@ -1496,7 +1517,7 @@ [] GSUP.receive(tr_GSUP_CL_RES(g_pars.imsi)) { } [] GSUP.receive(tr_GSUP_CL_ERR(g_pars.imsi)) { setverdict(fail, "Received GSUP Location Cancel Error"); - self.stop; + mtc.stop; } } @@ -1508,7 +1529,7 @@ [] BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ)) { } [] BSSAP.receive { setverdict(fail, "Received unexpected BSSAP instead of CM SERV REJ"); - self.stop; + mtc.stop; } } setverdict(pass); @@ -1581,11 +1602,11 @@ } [] BSSAP.receive(tr_BSSMAP_CipherModeCmd(?,?)) { setverdict(fail, "CipherModeCommand despite no A5 intersection"); - self.stop; + mtc.stop; } [] BSSAP.receive { setverdict(fail, "Unknown/unexpected BSSAP received"); - self.stop; + mtc.stop; } } setverdict(pass); @@ -1648,11 +1669,11 @@ } [] BSSAP.receive(tr_BSSMAP_CipherModeCmd(?,?)) { setverdict(fail, "CipherModeCommand despite no A5 intersection"); - self.stop; + mtc.stop; } [] BSSAP.receive { setverdict(fail, "Unknown/unexpected BSSAP received"); - self.stop; + mtc.stop; } } setverdict(pass); @@ -1764,6 +1785,7 @@ [reset_ack_seen == true] T.timeout { setverdict(pass) } [reset_ack_seen == false] T.timeout { setverdict(fail, "no BSSMAP RESET ACK seen!"); + mtc.stop; } } } @@ -1999,7 +2021,7 @@ case ('110'B) { return abbreviated; } } setverdict(fail, "Unknown TON ", ton); - self.stop; + mtc.stop; } /* convert GSM L3 NPI to SMPP_NPI enum */ function f_sm_npi_from_gsm(BIT4 npi) return SMPP_NPI { @@ -2014,7 +2036,7 @@ case ('1010'B) { return ermes; } } setverdict(fail, "Unknown NPI ", npi); - self.stop; + mtc.stop; } /* build a SMPP_SM from SmsParameters */ @@ -2154,7 +2176,7 @@ } [] BSSAP.receive { setverdict(fail, "Unknown/unexpected BSSAP received"); - self.stop; + mtc.stop; } } @@ -2217,7 +2239,7 @@ } [] BSSAP.receive { setverdict(fail, "Unknown/unexpected BSSAP received"); - self.stop; + mtc.stop; } } diff --git a/pcu/GPRS_TBF.ttcn b/pcu/GPRS_TBF.ttcn index 3e8658e..951cf4a 100644 --- a/pcu/GPRS_TBF.ttcn +++ b/pcu/GPRS_TBF.ttcn @@ -121,7 +121,7 @@ var integer idx := n - us.et.v_a; if (idx < 0 or idx > lengthof(us.et.v_b)) { setverdict(fail, "UlTbf: Cannot ACK ", n, " while V(A) is ", us.et.v_a); - self.stop; + mtc.stop; } /* set the bit in the acknowledge state array */ us.et.v_b[idx] := '1'B; @@ -411,7 +411,7 @@ function f_dl_tbf_is_in_window(integer bsn) return boolean { setverdict(fail, "pleaes implement me"); - self.stop; + mtc.stop; } function f_dl_tbf_is_received(inout DlTbfState ds, integer bsn) return boolean { @@ -471,7 +471,7 @@ var integer bsn := db.mac_hdr.hdr_ext.bsn; if (db.mac_hdr.hdr_ext.tfi != ds.tfi) { setverdict(fail, "Unexpected TFI of DL Data Block ", db); - self.stop; + mtc.stop; } f_dl_tbf_mark_received(ds, bsn); if (ds.tbf.ack_mode) { @@ -480,7 +480,7 @@ * SNS */ if (bsn < ds.er.v_q or bsn > ds.er.v_q + ds.tbf.ws) { setverdict(fail, "Unexpected BSN outside of window ", bsn); - self.stop; + mtc.stop; } /* In RLC acknowledged mode, the value of V(Q) shall be updated when the RLC diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn index 6e36f68..dfd380d 100644 --- a/pcu/PCU_Tests.ttcn +++ b/pcu/PCU_Tests.ttcn @@ -131,7 +131,8 @@ log("NS Expected: ", b); if (a != b) { - setverdict(fail); + setverdict(fail, "Values mismatch", a, b); + mtc.stop; } else { setverdict(pass); } @@ -188,7 +189,10 @@ alt { [] BSSGP.receive(t_BssgpStsInd(?, ?, BVC_S_UNBLOCKED)) { } [] BSSGP.receive { repeat; } - [] T.timeout { setverdict(fail); } + [] T.timeout { + setverdict(fail, "Timeout establishing BSSGP connection"); + mtc.stop; + } } T.stop log("BSSGP successfully initialized"); @@ -233,7 +237,7 @@ [] L1.receive { repeat; } [] T.timeout { setverdict(fail, "Timeout establishing UL TBF"); - self.stop; + mtc.stop; } } T.stop; @@ -275,6 +279,7 @@ } [] T.timeout { setverdict(fail, "Timeout waiting for ", bd_exp); + mtc.stop; } } } @@ -365,7 +370,8 @@ log("LLC Expected: ", b); if (a != b) { - setverdict(fail); + setverdict(fail, "LLC input ", b, " != expected ", a); + mtc.stop; } else { setverdict(pass); } @@ -437,7 +443,10 @@ log("Dec: ", udb); var octetstring enc := enc_RlcmacUlBlock(udb); log("Enc: ", enc); - if (enc != buf) { setverdict(fail, "Re-encoded data doesn't equal input data"); } + if (enc != buf) { + setverdict(fail, "Re-encoded data doesn't equal input data"); + mtc.stop; + } } function f_rlcmac_uld_decenc(in octetstring buf) { @@ -447,7 +456,10 @@ log("Dec: ", udb); var octetstring enc := enc_RlcmacUlDataBlock(udb); log("Enc: ", enc); - if (enc != buf) { setverdict(fail, "Re-encoded data doesn't equal input data"); } + if (enc != buf) { + setverdict(fail, "Re-encoded data doesn't equal input data"); + mtc.stop; + } } function f_rlcmac_dld_decenc(in octetstring buf) { @@ -457,7 +469,10 @@ log("Dec: ", udb); var octetstring enc := enc_RlcmacDlDataBlock(udb); log("Enc: ", enc); - if (enc != buf) { setverdict(fail, "Re-encoded data doesn't equal input data"); } + if (enc != buf) { + setverdict(fail, "Re-encoded data doesn't equal input data"); + mtc.stop; + } } @@ -561,7 +576,7 @@ [] L1.receive { repeat }; [] T.timeout { setverdict(fail, "Timeout waiting for IMM ASS") - self.stop; + mtc.stop; } } T.stop; diff --git a/selftest/Selftest.ttcn b/selftest/Selftest.ttcn index 826d244..8411b3d 100644 --- a/selftest/Selftest.ttcn +++ b/selftest/Selftest.ttcn @@ -57,7 +57,7 @@ res := IPL4asp_PortType.f_IPL4_connect(IP, "127.0.0.1", 55555, "", -1,-1, {tcp:={}}); if (not ispresent(res.connId)) { setverdict(fail, "Could not connect to TCP port, check your configuration"); - self.stop; + mtc.stop; } g_ip_conn_id := res.connId; } diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 78086af..0a20dd6 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -134,7 +134,7 @@ [] GSUP_IPA_EVENT.receive(t_ASP_IPA_EVT_UD(ASP_IPA_EVENT_UP)) { } [] T.timeout { setverdict(fail, "No connection to GSUP Port"); - self.stop; + mtc.stop; } } } @@ -240,7 +240,7 @@ private altstep as_Tguard() runs on BSSGP_ConnHdlr { [] g_Tguard.timeout { setverdict(fail, "Tguard timeout"); - self.stop; + mtc.stop; } } @@ -385,19 +385,19 @@ if (not (g_pars.bssgp_cell_id.ra_id.lai.mcc_mnc == aa_plmn)) { setverdict(fail, "mismatching PLMN in Attach Accept: " & hex2str(aa_plmn) & "; expected " & hex2str(g_pars.bssgp_cell_id.ra_id.lai.mcc_mnc)); - self.stop; + mtc.stop; } g_pars.ra := aa.routingAreaIdentification; if (ispresent(aa.allocatedPTMSI)) { if (not g_pars.net.expect_ptmsi) { setverdict(fail, "unexpected P-TMSI allocation"); - self.stop; + mtc.stop; } f_upd_ptmsi_and_tlli(aa.allocatedPTMSI.mobileIdentityLV.mobileIdentityV.oddEvenInd_identity.tmsi_ptmsi.octets); } if (ispresent(aa.msIdentity)) { setverdict(fail, "unexpected TMSI allocation in non-combined attach"); - self.stop; + mtc.stop; } /* P-TMSI.sig */ if (ispresent(aa.ptmsiSignature)) { @@ -414,13 +414,13 @@ if (ispresent(ra.allocatedPTMSI)) { if (not g_pars.net.expect_ptmsi) { setverdict(fail, "unexpected P-TMSI allocation"); - self.stop; + mtc.stop; } f_upd_ptmsi_and_tlli(ra.allocatedPTMSI.mobileIdentityLV.mobileIdentityV.oddEvenInd_identity.tmsi_ptmsi.octets); } if (ispresent(ra.msIdentity)) { setverdict(fail, "unexpected TMSI allocation in non-combined attach"); - self.stop; + mtc.stop; } /* P-TMSI.sig */ if (ispresent(ra.ptmsiSignature)) { @@ -540,6 +540,7 @@ } [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT(?))) { setverdict(fail, "Wrong Attach Reject Cause"); + mtc.stop; } } } @@ -608,6 +609,7 @@ [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?))) -> value bd { f_process_attach_accept(bd.l3_mt.msgs.gprs_mm.attachAccept); setverdict(fail); + mtc.stop; } } } @@ -637,6 +639,7 @@ [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT('001'B, ?, ?))) -> value bd { f_process_attach_accept(bd.l3_mt.msgs.gprs_mm.attachAccept); setverdict(fail); + mtc.stop; } } } @@ -718,6 +721,7 @@ } [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT(*, *, *))) { setverdict(fail); + mtc.stop; } } } @@ -771,6 +775,7 @@ } [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_RAU_REJECT)) { setverdict(fail, "Unexpected RAU Reject"); + mtc.stop; } [] BSSGP.receive { repeat; } } @@ -796,10 +801,12 @@ alt { [not expect_purge] GSUP.receive(tr_GSUP_PURGE_MS_REQ(?)) { setverdict(fail, "Unexpected GSUP PURGE MS for unregistered TLLI"); + mtc.stop; } [power_off] BSSGP.receive(tr_BD_L3_MT(tr_GMM_DET_ACCEPT_MT)) -> value bd { g_pars.ra := omit; setverdict(fail, "Unexpected ATTACH ACCEPT in no-power-off DETACH"); + mtc.stop; /* TODO: check if any PDP contexts are deactivated on network side? */ } [power_off] T.timeout { @@ -930,9 +937,11 @@ } [exp_rej] BSSGP.receive(tr_BD_L3_MT(tr_SM_ACT_PDP_ACCEPT)) { setverdict(fail, "Unexpected PDP CTX ACT ACC"); + mtc.stop; } [not exp_rej] BSSGP.receive(tr_BD_L3_MT(tr_SM_ACT_PDP_REJ(apars.tid, ?))) { setverdict(fail, "Unexpected PDP CTX ACT FAIL"); + mtc.stop; } [not exp_rej] BSSGP.receive(tr_BD_L3_MT(tr_SM_ACT_PDP_ACCEPT(apars.tid, apars.sapi))) { setverdict(pass); @@ -1159,9 +1168,11 @@ } [] GTP.receive(tr_GTPC_MsgType(?, createPDPContextRequest, ?)) { setverdict(fail, "Unexpected GTP PDP CTX ACT"); + mtc.stop; } [] BSSGP.receive(tr_BD_L3_MT(tr_SM_ACT_PDP_ACCEPT(?, ?))) { setverdict(fail, "Unexpected SM PDP CTX ACT ACK"); + mtc.stop; } [] BSSGP.receive { repeat; } } @@ -1403,10 +1414,11 @@ [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_DET_REQ_MT(*, *, *))) { T.stop; setverdict(fail, "Unexpected GMM Detach Request"); + mtc.stop; } [] T.timeout { setverdict(pass); - self.stop; + mtc.stop; } [] BSSGP.receive { repeat; @@ -1569,6 +1581,7 @@ } if (count_req != 5) { setverdict(fail, "Did not received GMM ID Request Type IMEI 5 times!"); + mtc.stop; } setverdict(pass); } @@ -1616,6 +1629,7 @@ } if (count_req != 5) { setverdict(fail, "Did not received GMM ID Request Type IMSI 5 times!"); + mtc.stop; } setverdict(pass); } @@ -1675,6 +1689,7 @@ alt { [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_REJECT(?))) { setverdict(fail, "Received unexpected GMM Attach REJECT"); + mtc.stop; } [] BSSGP.receive(tr_BD_L3_MT(tr_GMM_ATTACH_ACCEPT(*, *, *))) -> value bd { f_process_attach_accept(bd.l3_mt.msgs.gprs_mm.attachAccept); @@ -1730,6 +1745,7 @@ } if (count_req != 5) { setverdict(fail, "Did not received GMM Attach Complete."); + mtc.stop; } setverdict(pass); } diff --git a/sip/SIP_Tests.ttcn b/sip/SIP_Tests.ttcn index f690dc7..24b3622 100644 --- a/sip/SIP_Tests.ttcn +++ b/sip/SIP_Tests.ttcn @@ -131,7 +131,7 @@ private altstep as_Tguard() runs on ConnHdlr { [] g_Tguard.timeout { setverdict(fail, "Tguard timeout"); - self.stop; + mtc.stop; } } diff --git a/sysinfo/Test.ttcn b/sysinfo/Test.ttcn index 02a2279..c35da91 100644 --- a/sysinfo/Test.ttcn +++ b/sysinfo/Test.ttcn @@ -139,8 +139,8 @@ /* ensure a given TC slot of the SI vector contains given SI type at least once at TC */ function f_ensure_si_vec_contains(SystemInformationVectorPerTc arr, integer tc, RrMessageType key, boolean ext_bcch := false) { if (not f_si_vecslot_contains(arr[tc], key, ext_bcch)) { - log("Fail: No ", key, " in TC=", tc, "!"); - setverdict(fail); + setverdict(fail, "Fail: No ", key, " in TC=", tc, "!"); + mtc.stop; } } @@ -180,8 +180,8 @@ /* ensure a given TC slot of the SI vector contains given SI type at least N out of M times at TC */ function f_ensure_si_vec_contains_n_of_m(SystemInformationVectorPerTc arr, integer tc, RrMessageType key, boolean ext_bcch := false, integer n, integer m) { if (not f_si_vecslot_contains_n_of_m(arr[tc], key, ext_bcch, n, m)) { - log("Fail: Not ", n, "/", m, " of ", key, " in TC=", tc, "!"); - setverdict(fail); + setverdict(fail, "Fail: Not ", n, "/", m, " of ", key, " in TC=", tc, "!"); + mtc.stop; } } @@ -202,8 +202,8 @@ /* ensure a given TC slot of the SI vector contains only given SI type */ function f_ensure_si_vec_contains_only(SystemInformationVectorPerTc arr, integer tc, RrMessageType key, boolean ext_bcch := false) { if (not f_si_vecslot_contains_only(arr[tc], key, ext_bcch)) { - log("Fail: Not all ", key, " in TC=", tc, "!"); - setverdict(fail); + setverdict(fail, "Fail: Not all ", key, " in TC=", tc, "!"); + mtc.stop; } } @@ -233,6 +233,7 @@ for (i := 0; i < sizeof(si_per_tc); i := i + 1) { if (sizeof(si_per_tc[i]) == 0) { setverdict(fail, "No SI messages for TC=0!"); + mtc.stop; } } if (cfg.si1_present) { @@ -313,6 +314,7 @@ } if (f_si_vec_contains(si_per_tc, SYSTEM_INFORMATION_TYPE_13alt)) { setverdict(fail, "Cannot have SI13alt and SI13"); + mtc.stop; } } if (cfg.si16_present or cfg.si17_present) { @@ -323,6 +325,7 @@ } if (f_si_vec_contains(si_per_tc, SYSTEM_INFORMATION_TYPE_22)) { setverdict(fail, "Cannot have SI16/SI17 and SI22!"); + mtc.stop; } if (not cfg.bcch_extended) { testcase.stop("Error: SI16/SI17 requires BCCH Extd!"); @@ -368,6 +371,7 @@ } if (f_si_vec_contains(si_per_tc, SYSTEM_INFORMATION_TYPE_13)) { setverdict(fail, "Cannot have SI13alt and SI13"); + mtc.stop; } if (not cfg.bcch_extended) { f_ensure_si_vec_contains_n_of_m(si_per_tc, 4, SYSTEM_INFORMATION_TYPE_13alt, false, 1, 4); @@ -399,6 +403,7 @@ f_ensure_si_vec_contains_n_of_m(si_per_tc, 4, SYSTEM_INFORMATION_TYPE_21, true, 1, 4); if (f_si_vecslot_contains(si_per_tc[4], SYSTEM_INFORMATION_TYPE_21)) { setverdict(fail, "Cannot have SI21 on BCCH Norm if BCCH Extd enabled!"); + mtc.stop; } } } @@ -413,6 +418,7 @@ if (f_si_vec_contains(si_per_tc, SYSTEM_INFORMATION_TYPE_16) or f_si_vec_contains(si_per_tc, SYSTEM_INFORMATION_TYPE_17)) { setverdict(fail, "Cannot have SI16/SI17 and SI22!"); + mtc.stop; } if (not cfg.bcch_extended) { testcase.stop("Error: SI22 requires BCCH Extd!"); @@ -484,6 +490,7 @@ var SystemInformation si := f_gsmtap_get_si(pt, msg_type); if (not match(si, t)) { setverdict(fail, "SI ", si, " doesn't match ", t); + mtc.stop; } else { setverdict(pass); } -- To view, visit https://gerrit.osmocom.org/9907 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I9b618235939fa41160b9be6677b121963d3ec857 Gerrit-Change-Number: 9907 Gerrit-PatchSet: 3 Gerrit-Owner: daniel Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel Gerrit-CC: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 12:56:32 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Tue, 24 Jul 2018 12:56:32 +0000 Subject: Change in osmo-ttcn3-hacks[master]: Fail if f_streamId_by_trx() can't find a stream id In-Reply-To: References: Message-ID: daniel has submitted this change and it was merged. ( https://gerrit.osmocom.org/10120 ) Change subject: Fail if f_streamId_by_trx() can't find a stream id ...................................................................... Fail if f_streamId_by_trx() can't find a stream id Change-Id: Ie58278edf7050254d7cdced48b4b7870e0e8d577 --- M library/RSL_Emulation.ttcn 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/RSL_Emulation.ttcn b/library/RSL_Emulation.ttcn index 3c035e9..c56c278 100644 --- a/library/RSL_Emulation.ttcn +++ b/library/RSL_Emulation.ttcn @@ -318,7 +318,8 @@ case (2) { return IPAC_PROTO_RSL_TRX2; } case (3) { return IPAC_PROTO_RSL_TRX3; } } - self.stop; + setverdict(fail, "Unknown stream ID ", trx_nr); + mtc.stop; } -- To view, visit https://gerrit.osmocom.org/10120 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ie58278edf7050254d7cdced48b4b7870e0e8d577 Gerrit-Change-Number: 10120 Gerrit-PatchSet: 2 Gerrit-Owner: daniel Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 12:56:42 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Tue, 24 Jul 2018 12:56:42 +0000 Subject: Change in osmo-ttcn3-hacks[master]: Reply to wildcard ep in CRCX with a concrete endpoint In-Reply-To: References: Message-ID: daniel has submitted this change and it was merged. ( https://gerrit.osmocom.org/10128 ) Change subject: Reply to wildcard ep in CRCX with a concrete endpoint ...................................................................... Reply to wildcard ep in CRCX with a concrete endpoint BSC_ConnectionHandler.ttcn:563 This helps TC_gsup_cancel which previously encountered a Dynamic test case error: Using the value of an optional field containing omit. The test still fails, but this time because it "Received unexpected BSSAP instead of CM SERV REJ". Change-Id: I9fedf2573487066b951804a328ba428d2189c4a4 --- M msc/MSC_Tests.ttcn 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index 161744c..63cab84 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -1504,6 +1504,7 @@ cpars.bss_rtp_port := 1110; cpars.mgcp_connection_id_bss := '22222'H; cpars.mgcp_connection_id_mss := '33333'H; + cpars.mgcp_ep := "rtpbridge/1 at mgw"; /* Location Update to make subscriber known */ f_perform_lu(); -- To view, visit https://gerrit.osmocom.org/10128 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I9fedf2573487066b951804a328ba428d2189c4a4 Gerrit-Change-Number: 10128 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 12:59:36 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 12:59:36 +0000 Subject: Change in osmo-bsc[master]: BTS codec pref legacy compat: allow all codecs per default Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10129 Change subject: BTS codec pref legacy compat: allow all codecs per default ...................................................................... BTS codec pref legacy compat: allow all codecs per default Legacy compat: we used to not check the BTS codec-pref settings upon assignment until we added checks for the BTS codec-pref in osmo-bsc 5bc43cd107597b78f701f77c7fd4cce8f923dce5, change-id I285234e9c81de74d9fb9907fca2c443b08537435, "codec_pref: check bts codec support". From that commit onwards, config setups without a 'codec-pref' potentially stop working (like all osmo-gsm-tester runs just did), because with no codec-pref settings, now only FR is permitted, while before the patch, we would allow any codecs as long as MSC and the overall BSC config agree on them. So, upon BTS initialization, enable all codecs. These get reset to a more fine grained selection IF a 'codec-pref' appears in the config file (see bsc_vty.c). Change-Id: I4650a1f8e350c6f74f48391f43ddfe771be01e1b --- M src/osmo-bsc/gsm_data.c 1 file changed, 14 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/29/10129/1 diff --git a/src/osmo-bsc/gsm_data.c b/src/osmo-bsc/gsm_data.c index 0f062d2..6c8bdf3 100644 --- a/src/osmo-bsc/gsm_data.c +++ b/src/osmo-bsc/gsm_data.c @@ -757,6 +757,20 @@ INIT_LLIST_HEAD(&bts->abis_queue); INIT_LLIST_HEAD(&bts->loc_list); + /* Legacy compat: we used to not check the BTS codec-pref settings upon assignment until we added + * checks for the BTS codec-pref in osmo-bsc 5bc43cd107597b78f701f77c7fd4cce8f923dce5, change-id + * I285234e9c81de74d9fb9907fca2c443b08537435, "codec_pref: check bts codec support". From that + * commit onwards, config setups without a 'codec-pref' potentially stop working, because with no + * codec-pref settings, now only FR is permitted, while before the patch, we would allow any + * codecs as long as MSC and the overall BSC config agree on them. So, upon BTS initialization, + * enable all codecs. These get reset to a more fine grained selection IF a 'codec-pref' appears + * in the config file (see bsc_vty.c). */ + bts->codec = (struct bts_codec_conf){ + hr = 1, + efr = 1, + amr = 1, + }; + return bts; } -- To view, visit https://gerrit.osmocom.org/10129 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I4650a1f8e350c6f74f48391f43ddfe771be01e1b Gerrit-Change-Number: 10129 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 13:00:54 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 24 Jul 2018 13:00:54 +0000 Subject: Change in libosmo-abis[master]: e1_input.c: Replace '.' in counter names with ':' Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10130 Change subject: e1_input.c: Replace '.' in counter names with ':' ...................................................................... e1_input.c: Replace '.' in counter names with ':' The '.' is illegal character in counter names, as they are exported via CTRL interface, where '.' has a special meaning that cannot be used by strings comprising the variable name. Change-Id: I730d1acdd5562cd2c1758ceee31193010b14337d --- M src/e1_input.c 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/30/10130/1 diff --git a/src/e1_input.c b/src/e1_input.c index 11949a1..4717830 100644 --- a/src/e1_input.c +++ b/src/e1_input.c @@ -58,13 +58,13 @@ static const struct rate_ctr_desc e1inp_ctr_d[] = { [E1I_CTR_HDLC_ABORT] = { - "hdlc.abort", "HDLC abort" + "hdlc:abort", "HDLC abort" }, [E1I_CTR_HDLC_BADFCS] = { - "hdlc.bad_fcs", "HLDC Bad FCS" + "hdlc:bad_fcs", "HLDC Bad FCS" }, [E1I_CTR_HDLC_OVERR] = { - "hdlc.overrun", "HDLC Overrun" + "hdlc:overrun", "HDLC Overrun" }, [E1I_CTR_ALARM] = { "alarm", "Alarm" -- To view, visit https://gerrit.osmocom.org/10130 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I730d1acdd5562cd2c1758ceee31193010b14337d Gerrit-Change-Number: 10130 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 13:05:31 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 24 Jul 2018 13:05:31 +0000 Subject: Change in osmo-bsc[master]: BTS codec pref legacy compat: allow all codecs per default In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10129 ) Change subject: BTS codec pref legacy compat: allow all codecs per default ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/10129/1/src/osmo-bsc/gsm_data.c File src/osmo-bsc/gsm_data.c: https://gerrit.osmocom.org/#/c/10129/1/src/osmo-bsc/gsm_data.c at 767 PS1, Line 767: * in the config file (see bsc_vty.c). */ I think we don't need this huge comment here. Let's only keep the following: /* enable all codecs. These get reset to a more fine grained selection IF a 'codec-support' appears in the config file (see bsc_vty.c). */ Note also I changed codec-pref by codec-support :) -- To view, visit https://gerrit.osmocom.org/10129 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4650a1f8e350c6f74f48391f43ddfe771be01e1b Gerrit-Change-Number: 10129 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 24 Jul 2018 13:05:31 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 13:17:42 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 13:17:42 +0000 Subject: Change in osmo-bsc[master]: BTS codec pref legacy compat: allow all codecs per default In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10129 to look at the new patch set (#2). Change subject: BTS codec pref legacy compat: allow all codecs per default ...................................................................... BTS codec pref legacy compat: allow all codecs per default Legacy compat: we used to not check the BTS codec-pref settings upon assignment until we added checks for the BTS codec-pref in osmo-bsc 5bc43cd107597b78f701f77c7fd4cce8f923dce5, change-id I285234e9c81de74d9fb9907fca2c443b08537435, "codec_pref: check bts codec support". From that commit onwards, config setups without a 'codec-pref' potentially stop working (like all osmo-gsm-tester runs just did), because with no codec-pref settings, now only FR is permitted, while before the patch, we would allow any codecs as long as MSC and the overall BSC config agree on them. So, upon BTS initialization, enable all codecs. These get reset to a more fine grained selection IF a 'codec-pref' appears in the config file (see bsc_vty.c). Change-Id: I4650a1f8e350c6f74f48391f43ddfe771be01e1b --- M src/osmo-bsc/gsm_data.c 1 file changed, 14 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/29/10129/2 -- To view, visit https://gerrit.osmocom.org/10129 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4650a1f8e350c6f74f48391f43ddfe771be01e1b Gerrit-Change-Number: 10129 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 13:28:08 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 13:28:08 +0000 Subject: Change in osmo-bsc[master]: BTS codec pref legacy compat: allow all codecs per default In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10129 to look at the new patch set (#3). Change subject: BTS codec pref legacy compat: allow all codecs per default ...................................................................... BTS codec pref legacy compat: allow all codecs per default Legacy compat: we used to not check the BTS codec-pref settings upon assignment until we added checks for the BTS codec-pref in osmo-bsc 5bc43cd107597b78f701f77c7fd4cce8f923dce5, change-id I285234e9c81de74d9fb9907fca2c443b08537435, "codec_pref: check bts codec support". From that commit onwards, config setups without a 'codec-pref' potentially stop working (like all osmo-gsm-tester runs just did), because with no codec-pref settings, now only FR is permitted, while before the patch, we would allow any codecs as long as MSC and the overall BSC config agree on them. So, upon BTS initialization, enable all codecs. These get reset to a more fine grained selection IF a 'codec-support' config appears in the config file (see bsc_vty.c). Change-Id: I4650a1f8e350c6f74f48391f43ddfe771be01e1b --- M src/osmo-bsc/gsm_data.c 1 file changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/29/10129/3 -- To view, visit https://gerrit.osmocom.org/10129 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4650a1f8e350c6f74f48391f43ddfe771be01e1b Gerrit-Change-Number: 10129 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 13:31:08 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 13:31:08 +0000 Subject: Change in osmo-bsc[master]: large refactoring: use FSMs for lchans; add inter-BSC HO In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9671 to look at the new patch set (#34). Change subject: large refactoring: use FSMs for lchans; add inter-BSC HO ...................................................................... large refactoring: use FSMs for lchans; add inter-BSC HO Add FSMs: - timeslot_fsm: handle dynamic timeslots and OML+RSL availability. - lchan_fsm: handle an individual lchan activation, RTP stream and release, signal the appropriate calling FSMs on success, failure, release. - mgw_endpoint_fsm: handle one entire endpoint with several CI. - assignment_fsm: BSSMAP Assignment Request. - handover_fsm: all of intra, inter-MO and inter-MT handover. Above FSMs absorb large parts of the gscon FSM. The gscon FSM was surpassing the maximum amount events (32), and it is more logical to treat assignment, handover and MGW procedures in separate FSMs. - Add logging macros for each FSM type: - LOG_TS() - LOG_LCHAN() - LOG_MGWEP(), LOG_CI() - LOG_ASSIGNMENT() - LOG_HO() These log with the osmo_fsm_inst where present. New style decision: logging without a final newline char is awkward, especially for gsmtap logging and when other logs interleave LOGPC() calls; we have various cases where the final \n goes missing, and also this invokes the log category checking N times instead of once. So I decided to make these macros *always* append a newline, but only if there is no final newline yet. I hope that the compiler optimizes the strlen() of the constant format strings away. Thus I can log with or without typing "\n" and always get an \n termination anyway. General: - replace osmo_timers, state enums and program-wide osmo_signal_dispatch() with dedicated FSM timeouts, states and events. - introduce a common way to handle Tnnn timers: gsm_timers.h/.c: struct T_def. These can be used (with some macro magic) to define a state's timeout once, and not make mistakes for each osmo_fsm_inst_state_chg(). Details: bsc_subscr_conn_fsm.c: - move most states of this FSM to lchan_fsm, assignment_fsm, handover_fsm and mgw_endpoint_fsm. - There is exactly one state for an ongoing Assignment, with all details handled in conn->assignment.fi. The state relies on the assignment_fsm's timeout. - There is one state for an ongoing Handover; except for an incoming Handover from a remote BSS, the gscon remains in ST_INIT until the new lchan and conn are both established. - move bssmap_add_lcls_status() to osmo_bsc_lcls.c abis_rsl.c: - move all dynamic timeslot logic away into timeslot_fsm. Only keep plain send/receive functions in abis_rsl.c - reduce some rsl functions to merely send a message, rename to "_tx_". - rsl_ipacc_mdcx(): add '_tx_' in the name; move parts that change the lchan state out into the lchan_fsm, the lchan->abis_ip.* are now set there prior to invoking this function. - move all timers and error/release handling away into various FSMs. - tweak ipa_smod_s_for_lchan() and ipa_rtp_pt_for_lchan() to not require an lchan passed, but just mode,type that they require. Rename to ipacc_speech_mode*() and ipacc_payload_type(). - add rsl_forward_layer3_info, used for inter-BSC HO MO, to just send the RR message received during BSSMAP Handover Command. - move various logging to LOG_LCHAN() in order to log with the lchan FSM instance. One drawback is that the lchan FSM is limited to one logging category, i.e. this moves some logging from DRR to DRSL. It might actually make sense to combine those categories. - lose LOGP...LOGPC logging cascades: they are bad for gsmtap logging and for performance. - handle_classmark_chg(): change logging, move cm2 len check out of the cm3 condition (I hope that's correct). - gsm48_send_ho_cmd(): split off gsm48_make_ho_cmd() which doesn't send right away, so that during inter-bsc HO we can make an RR Handover Command to send via the MSC to the remote BSS. assignment_fsm.c: - the Chan Mode Modify in case of re-using the same lchan is not implemented yet, because this was also missing in the previous implementation (OS#3357). osmo_bsc_api.c: - simplify bsc_mr_config() and move to lchan_fsm.c, the only caller; rename to lchan_mr_config(). (bsc_mr_config() used to copy the values to mr_bts_lv twice, once by member assignment and then again with a memcpy.) - During handover, we used to copy the MR config from the old lchan. Since we may handover between FR and HR, rather set the MR Config anew every time, so that FR rates are always available on FR lchans, and never on HR lchans. Depends: I03ee7ce840ecfa0b6a33358e7385528aabd4873f (libosmocore), I1f2918418c38918c5ac70acaa51a47adfca12b5e (libosmocore) Change-Id: I82e3f918295daa83274a4cf803f046979f284366 --- M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/abis_rsl.h A include/osmocom/bsc/assignment_fsm.h M include/osmocom/bsc/bsc_api.h M include/osmocom/bsc/bsc_msc_data.h M include/osmocom/bsc/bsc_subscr_conn_fsm.h M include/osmocom/bsc/bsc_subscriber.h M include/osmocom/bsc/chan_alloc.h M include/osmocom/bsc/codec_pref.h M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/gsm_timers.h M include/osmocom/bsc/handover.h A include/osmocom/bsc/handover_fsm.h A include/osmocom/bsc/lchan_fsm.h A include/osmocom/bsc/lchan_select.h A include/osmocom/bsc/mgw_endpoint_fsm.h M include/osmocom/bsc/osmo_bsc.h M include/osmocom/bsc/osmo_bsc_lcls.h A include/osmocom/bsc/timeslot_fsm.h M src/ipaccess/Makefile.am M src/ipaccess/stubs.c M src/osmo-bsc/Makefile.am M src/osmo-bsc/abis_om2000.c M src/osmo-bsc/abis_rsl.c A src/osmo-bsc/assignment_fsm.c M src/osmo-bsc/bsc_api.c D src/osmo-bsc/bsc_dyn_ts.c M src/osmo-bsc/bsc_subscr_conn_fsm.c M src/osmo-bsc/bsc_subscriber.c M src/osmo-bsc/bsc_vty.c M src/osmo-bsc/bts_ericsson_rbs2000.c M src/osmo-bsc/bts_ipaccess_nanobts.c M src/osmo-bsc/bts_nokia_site.c M src/osmo-bsc/bts_siemens_bs11.c M src/osmo-bsc/chan_alloc.c M src/osmo-bsc/codec_pref.c M src/osmo-bsc/gsm_04_08_utils.c M src/osmo-bsc/gsm_data.c M src/osmo-bsc/gsm_timers.c M src/osmo-bsc/handover_decision.c M src/osmo-bsc/handover_decision_2.c A src/osmo-bsc/handover_fsm.c M src/osmo-bsc/handover_logic.c A src/osmo-bsc/lchan_fsm.c A src/osmo-bsc/lchan_select.c M src/osmo-bsc/meas_feed.c A src/osmo-bsc/mgw_endpoint_fsm.c M src/osmo-bsc/osmo_bsc_api.c D src/osmo-bsc/osmo_bsc_audio.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_ctrl.c M src/osmo-bsc/osmo_bsc_filter.c M src/osmo-bsc/osmo_bsc_grace.c M src/osmo-bsc/osmo_bsc_lcls.c M src/osmo-bsc/osmo_bsc_main.c M src/osmo-bsc/osmo_bsc_sigtran.c M src/osmo-bsc/paging.c M src/osmo-bsc/pcu_sock.c M src/osmo-bsc/system_information.c A src/osmo-bsc/timeslot_fsm.c M src/utils/Makefile.am M src/utils/bs11_config.c M src/utils/meas_json.c D src/utils/stubs.c M tests/abis/abis_test.c M tests/bsc/Makefile.am M tests/bsc/bsc_test.c M tests/codec_pref/codec_pref_test.c M tests/codec_pref/codec_pref_test.ok M tests/gsm0408/gsm0408_test.c M tests/handover/Makefile.am M tests/handover/handover_test.c M tests/handover/neighbor_ident_test.c M tests/nanobts_omlattr/nanobts_omlattr_test.c 74 files changed, 8,462 insertions(+), 4,781 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/71/9671/34 -- To view, visit https://gerrit.osmocom.org/9671 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I82e3f918295daa83274a4cf803f046979f284366 Gerrit-Change-Number: 9671 Gerrit-PatchSet: 34 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 13:31:08 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 13:31:08 +0000 Subject: Change in osmo-bsc[master]: lchan_fsm: split off lchan_rtp_fsm, establish RTP a bit earlier In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10103 to look at the new patch set (#2). Change subject: lchan_fsm: split off lchan_rtp_fsm, establish RTP a bit earlier ...................................................................... lchan_fsm: split off lchan_rtp_fsm, establish RTP a bit earlier Change-Id: Id7a4407d9b63be05ce63f5f2768b7d7e3d5c86fb --- M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/lchan_fsm.h A include/osmocom/bsc/lchan_rtp_fsm.h M src/osmo-bsc/Makefile.am M src/osmo-bsc/abis_rsl.c M src/osmo-bsc/bsc_subscr_conn_fsm.c M src/osmo-bsc/handover_fsm.c M src/osmo-bsc/lchan_fsm.c A src/osmo-bsc/lchan_rtp_fsm.c M tests/handover/Makefile.am M tests/handover/handover_test.c 12 files changed, 1,038 insertions(+), 481 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/03/10103/2 -- To view, visit https://gerrit.osmocom.org/10103 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id7a4407d9b63be05ce63f5f2768b7d7e3d5c86fb Gerrit-Change-Number: 10103 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 13:31:08 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 13:31:08 +0000 Subject: Change in osmo-bsc[master]: lchan_fsm: add in_release_handler flag In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10104 to look at the new patch set (#2). Change subject: lchan_fsm: add in_release_handler flag ...................................................................... lchan_fsm: add in_release_handler flag If a release event is being handled, ignore other ricocheting release events until that release handling has concluded. For example, if an lchan is regularly released, it signals the lchan RTP FSM to release, which then calls back to say "RTP is released" on termination -- this should not trigger other state changes than the initial release intends. Change-Id: Iec41e006b6ab9d0f618d36925341f9536353e5d8 --- M include/osmocom/bsc/gsm_data.h M src/osmo-bsc/lchan_fsm.c 2 files changed, 21 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/04/10104/2 -- To view, visit https://gerrit.osmocom.org/10104 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iec41e006b6ab9d0f618d36925341f9536353e5d8 Gerrit-Change-Number: 10104 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 13:33:39 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 13:33:39 +0000 Subject: Change in osmo-bsc[master]: large refactoring: use FSMs for lchans; add inter-BSC HO In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9671 ) Change subject: large refactoring: use FSMs for lchans; add inter-BSC HO ...................................................................... Patch Set 34: patch set 34: remove sub-scopes for various FSM kick-offs and place local vars in function scope's top instead, as requested. I accept the "consistency" argument, but let me say again that semantically I still don't agree that this should be desirable. But here we are. -- To view, visit https://gerrit.osmocom.org/9671 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I82e3f918295daa83274a4cf803f046979f284366 Gerrit-Change-Number: 9671 Gerrit-PatchSet: 34 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Tue, 24 Jul 2018 13:33:39 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 13:37:23 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 24 Jul 2018 13:37:23 +0000 Subject: Change in osmo-bsc[master]: BTS codec pref legacy compat: allow all codecs per default In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10129 ) Change subject: BTS codec pref legacy compat: allow all codecs per default ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10129 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4650a1f8e350c6f74f48391f43ddfe771be01e1b Gerrit-Change-Number: 10129 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 24 Jul 2018 13:37:23 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 13:37:26 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 24 Jul 2018 13:37:26 +0000 Subject: Change in osmo-bsc[master]: BTS codec pref legacy compat: allow all codecs per default In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/10129 ) Change subject: BTS codec pref legacy compat: allow all codecs per default ...................................................................... BTS codec pref legacy compat: allow all codecs per default Legacy compat: we used to not check the BTS codec-pref settings upon assignment until we added checks for the BTS codec-pref in osmo-bsc 5bc43cd107597b78f701f77c7fd4cce8f923dce5, change-id I285234e9c81de74d9fb9907fca2c443b08537435, "codec_pref: check bts codec support". From that commit onwards, config setups without a 'codec-pref' potentially stop working (like all osmo-gsm-tester runs just did), because with no codec-pref settings, now only FR is permitted, while before the patch, we would allow any codecs as long as MSC and the overall BSC config agree on them. So, upon BTS initialization, enable all codecs. These get reset to a more fine grained selection IF a 'codec-support' config appears in the config file (see bsc_vty.c). Change-Id: I4650a1f8e350c6f74f48391f43ddfe771be01e1b --- M src/osmo-bsc/gsm_data.c 1 file changed, 8 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/src/osmo-bsc/gsm_data.c b/src/osmo-bsc/gsm_data.c index 0f062d2..7885dad 100644 --- a/src/osmo-bsc/gsm_data.c +++ b/src/osmo-bsc/gsm_data.c @@ -757,6 +757,14 @@ INIT_LLIST_HEAD(&bts->abis_queue); INIT_LLIST_HEAD(&bts->loc_list); + /* Enable all codecs by default. These get reset to a more fine grained selection IF a + * 'codec-support' config appears in the config file (see bsc_vty.c). */ + bts->codec = (struct bts_codec_conf){ + .hr = 1, + .efr = 1, + .amr = 1, + }; + return bts; } -- To view, visit https://gerrit.osmocom.org/10129 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I4650a1f8e350c6f74f48391f43ddfe771be01e1b Gerrit-Change-Number: 10129 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 13:38:18 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 13:38:18 +0000 Subject: Change in osmo-bsc[master]: large refactoring: use FSMs for lchans; add inter-BSC HO In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9671 to look at the new patch set (#35). Change subject: large refactoring: use FSMs for lchans; add inter-BSC HO ...................................................................... large refactoring: use FSMs for lchans; add inter-BSC HO Add FSMs: - timeslot_fsm: handle dynamic timeslots and OML+RSL availability. - lchan_fsm: handle an individual lchan activation, RTP stream and release, signal the appropriate calling FSMs on success, failure, release. - mgw_endpoint_fsm: handle one entire endpoint with several CI. - assignment_fsm: BSSMAP Assignment Request. - handover_fsm: all of intra, inter-MO and inter-MT handover. Above FSMs absorb large parts of the gscon FSM. The gscon FSM was surpassing the maximum amount events (32), and it is more logical to treat assignment, handover and MGW procedures in separate FSMs. - Add logging macros for each FSM type: - LOG_TS() - LOG_LCHAN() - LOG_MGWEP(), LOG_CI() - LOG_ASSIGNMENT() - LOG_HO() These log with the osmo_fsm_inst where present. New style decision: logging without a final newline char is awkward, especially for gsmtap logging and when other logs interleave LOGPC() calls; we have various cases where the final \n goes missing, and also this invokes the log category checking N times instead of once. So I decided to make these macros *always* append a newline, but only if there is no final newline yet. I hope that the compiler optimizes the strlen() of the constant format strings away. Thus I can log with or without typing "\n" and always get an \n termination anyway. General: - replace osmo_timers, state enums and program-wide osmo_signal_dispatch() with dedicated FSM timeouts, states and events. - introduce a common way to handle Tnnn timers: gsm_timers.h/.c: struct T_def. These can be used (with some macro magic) to define a state's timeout once, and not make mistakes for each osmo_fsm_inst_state_chg(). Details: bsc_subscr_conn_fsm.c: - move most states of this FSM to lchan_fsm, assignment_fsm, handover_fsm and mgw_endpoint_fsm. - There is exactly one state for an ongoing Assignment, with all details handled in conn->assignment.fi. The state relies on the assignment_fsm's timeout. - There is one state for an ongoing Handover; except for an incoming Handover from a remote BSS, the gscon remains in ST_INIT until the new lchan and conn are both established. - move bssmap_add_lcls_status() to osmo_bsc_lcls.c abis_rsl.c: - move all dynamic timeslot logic away into timeslot_fsm. Only keep plain send/receive functions in abis_rsl.c - reduce some rsl functions to merely send a message, rename to "_tx_". - rsl_ipacc_mdcx(): add '_tx_' in the name; move parts that change the lchan state out into the lchan_fsm, the lchan->abis_ip.* are now set there prior to invoking this function. - move all timers and error/release handling away into various FSMs. - tweak ipa_smod_s_for_lchan() and ipa_rtp_pt_for_lchan() to not require an lchan passed, but just mode,type that they require. Rename to ipacc_speech_mode*() and ipacc_payload_type(). - add rsl_forward_layer3_info, used for inter-BSC HO MO, to just send the RR message received during BSSMAP Handover Command. - move various logging to LOG_LCHAN() in order to log with the lchan FSM instance. One drawback is that the lchan FSM is limited to one logging category, i.e. this moves some logging from DRR to DRSL. It might actually make sense to combine those categories. - lose LOGP...LOGPC logging cascades: they are bad for gsmtap logging and for performance. - handle_classmark_chg(): change logging, move cm2 len check out of the cm3 condition (I hope that's correct). - gsm48_send_ho_cmd(): split off gsm48_make_ho_cmd() which doesn't send right away, so that during inter-bsc HO we can make an RR Handover Command to send via the MSC to the remote BSS. assignment_fsm.c: - the Chan Mode Modify in case of re-using the same lchan is not implemented yet, because this was also missing in the previous implementation (OS#3357). osmo_bsc_api.c: - simplify bsc_mr_config() and move to lchan_fsm.c, the only caller; rename to lchan_mr_config(). (bsc_mr_config() used to copy the values to mr_bts_lv twice, once by member assignment and then again with a memcpy.) - During handover, we used to copy the MR config from the old lchan. Since we may handover between FR and HR, rather set the MR Config anew every time, so that FR rates are always available on FR lchans, and never on HR lchans. Depends: I03ee7ce840ecfa0b6a33358e7385528aabd4873f (libosmocore), I1f2918418c38918c5ac70acaa51a47adfca12b5e (libosmocore) Change-Id: I82e3f918295daa83274a4cf803f046979f284366 --- M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/abis_rsl.h A include/osmocom/bsc/assignment_fsm.h M include/osmocom/bsc/bsc_api.h M include/osmocom/bsc/bsc_msc_data.h M include/osmocom/bsc/bsc_subscr_conn_fsm.h M include/osmocom/bsc/bsc_subscriber.h M include/osmocom/bsc/chan_alloc.h M include/osmocom/bsc/codec_pref.h M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/gsm_timers.h M include/osmocom/bsc/handover.h A include/osmocom/bsc/handover_fsm.h A include/osmocom/bsc/lchan_fsm.h A include/osmocom/bsc/lchan_select.h A include/osmocom/bsc/mgw_endpoint_fsm.h M include/osmocom/bsc/osmo_bsc.h M include/osmocom/bsc/osmo_bsc_lcls.h A include/osmocom/bsc/timeslot_fsm.h M src/ipaccess/Makefile.am M src/ipaccess/stubs.c M src/osmo-bsc/Makefile.am M src/osmo-bsc/abis_om2000.c M src/osmo-bsc/abis_rsl.c A src/osmo-bsc/assignment_fsm.c M src/osmo-bsc/bsc_api.c D src/osmo-bsc/bsc_dyn_ts.c M src/osmo-bsc/bsc_subscr_conn_fsm.c M src/osmo-bsc/bsc_subscriber.c M src/osmo-bsc/bsc_vty.c M src/osmo-bsc/bts_ericsson_rbs2000.c M src/osmo-bsc/bts_ipaccess_nanobts.c M src/osmo-bsc/bts_nokia_site.c M src/osmo-bsc/bts_siemens_bs11.c M src/osmo-bsc/chan_alloc.c M src/osmo-bsc/codec_pref.c M src/osmo-bsc/gsm_04_08_utils.c M src/osmo-bsc/gsm_data.c M src/osmo-bsc/gsm_timers.c M src/osmo-bsc/handover_decision.c M src/osmo-bsc/handover_decision_2.c A src/osmo-bsc/handover_fsm.c M src/osmo-bsc/handover_logic.c A src/osmo-bsc/lchan_fsm.c A src/osmo-bsc/lchan_select.c M src/osmo-bsc/meas_feed.c A src/osmo-bsc/mgw_endpoint_fsm.c M src/osmo-bsc/osmo_bsc_api.c D src/osmo-bsc/osmo_bsc_audio.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_ctrl.c M src/osmo-bsc/osmo_bsc_filter.c M src/osmo-bsc/osmo_bsc_grace.c M src/osmo-bsc/osmo_bsc_lcls.c M src/osmo-bsc/osmo_bsc_main.c M src/osmo-bsc/osmo_bsc_sigtran.c M src/osmo-bsc/paging.c M src/osmo-bsc/pcu_sock.c M src/osmo-bsc/system_information.c A src/osmo-bsc/timeslot_fsm.c M src/utils/Makefile.am M src/utils/bs11_config.c M src/utils/meas_json.c D src/utils/stubs.c M tests/abis/abis_test.c M tests/bsc/Makefile.am M tests/bsc/bsc_test.c M tests/codec_pref/codec_pref_test.c M tests/codec_pref/codec_pref_test.ok M tests/gsm0408/gsm0408_test.c M tests/handover/Makefile.am M tests/handover/handover_test.c M tests/handover/neighbor_ident_test.c M tests/nanobts_omlattr/nanobts_omlattr_test.c 74 files changed, 8,462 insertions(+), 4,781 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/71/9671/35 -- To view, visit https://gerrit.osmocom.org/9671 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I82e3f918295daa83274a4cf803f046979f284366 Gerrit-Change-Number: 9671 Gerrit-PatchSet: 35 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 13:41:35 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 13:41:35 +0000 Subject: Change in osmo-bsc[master]: large refactoring: use FSMs for lchans; add inter-BSC HO In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9671 ) Change subject: large refactoring: use FSMs for lchans; add inter-BSC HO ...................................................................... Patch Set 35: patch set 35: fix assignment to const members of struct ho_out_rx_bssmap_ho_command: only allowed during declaration, hence having a var declaration that's not at the top of the function (but don't add a sub-scope). -- To view, visit https://gerrit.osmocom.org/9671 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I82e3f918295daa83274a4cf803f046979f284366 Gerrit-Change-Number: 9671 Gerrit-PatchSet: 35 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Tue, 24 Jul 2018 13:41:35 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 13:50:06 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Tue, 24 Jul 2018 13:50:06 +0000 Subject: Change in osmocom-bb[master]: prevent heap overflow in tch_fr_disassemble() Message-ID: Stefan Sperling has uploaded this change for review. ( https://gerrit.osmocom.org/10131 Change subject: prevent heap overflow in tch_fr_disassemble() ...................................................................... prevent heap overflow in tch_fr_disassemble() Ensure that sched_prim_init() allocates at least GSM_BURST_PL_LEN bytes of payload buffer. An incomplete packet received could lead to short buffer allocation and cause a crash in libosmocore. Change-Id: I3ae3a1a14d131de256b48d645130df737e9b5f26 Related: OS#3415 --- M src/host/trxcon/sched_prim.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/31/10131/1 diff --git a/src/host/trxcon/sched_prim.c b/src/host/trxcon/sched_prim.c index 2ee06d7..169a906 100644 --- a/src/host/trxcon/sched_prim.c +++ b/src/host/trxcon/sched_prim.c @@ -68,7 +68,7 @@ /* How much memory do we need? */ len = sizeof(struct trx_ts_prim); /* Primitive header */ - len += pl_len; /* Requested payload size */ + len += pl_len < GSM_BURST_PL_LEN ? GSM_BURST_PL_LEN : pl_len; /* Requested payload size */ /* Allocate a new primitive */ new_prim = talloc_zero_size(trx, len); -- To view, visit https://gerrit.osmocom.org/10131 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I3ae3a1a14d131de256b48d645130df737e9b5f26 Gerrit-Change-Number: 10131 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 14:02:35 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 14:02:35 +0000 Subject: Change in osmo-bsc[master]: lchan_fsm: add in_release_handler flag In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10104 ) Change subject: lchan_fsm: add in_release_handler flag ...................................................................... Patch Set 3: Code-Review+2 commit log adjusted, marking +2 -- To view, visit https://gerrit.osmocom.org/10104 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iec41e006b6ab9d0f618d36925341f9536353e5d8 Gerrit-Change-Number: 10104 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Tue, 24 Jul 2018 14:02:35 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 14:04:26 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 14:04:26 +0000 Subject: Change in osmo-bsc[master]: lchan_fsm: split off lchan_rtp_fsm, establish RTP a bit earlier In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10103 ) Change subject: lchan_fsm: split off lchan_rtp_fsm, establish RTP a bit earlier ...................................................................... Patch Set 3: Code-Review+2 only cosmetic changes due to modification of previous patch, re-adding +2 -- To view, visit https://gerrit.osmocom.org/10103 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id7a4407d9b63be05ce63f5f2768b7d7e3d5c86fb Gerrit-Change-Number: 10103 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Tue, 24 Jul 2018 14:04:26 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 14:19:38 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 24 Jul 2018 14:19:38 +0000 Subject: Change in osmocom-bb[master]: prevent heap overflow in tch_fr_disassemble() In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/10131 ) Change subject: prevent heap overflow in tch_fr_disassemble() ...................................................................... Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/10131/1/src/host/trxcon/sched_prim.c File src/host/trxcon/sched_prim.c: https://gerrit.osmocom.org/#/c/10131/1/src/host/trxcon/sched_prim.c at 71 PS1, Line 71: len += pl_len < GSM_BURST_PL_LEN ? GSM_BURST_PL_LEN : pl_len; /* Requested payload size */ Oh, no. This is definitely wrong, sorry... GSM_BURST_PL_LEN defines the *length of a normal burst's payload* in bits (Layer 1, coding), while here we allocate the memory for a L2 frame... -- To view, visit https://gerrit.osmocom.org/10131 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3ae3a1a14d131de256b48d645130df737e9b5f26 Gerrit-Change-Number: 10131 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 24 Jul 2018 14:19:38 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 14:44:48 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 14:44:48 +0000 Subject: Change in osmo-gsm-tester[master]: resources.conf.prod: add calypso SIM data (commented) Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10132 Change subject: resources.conf.prod: add calypso SIM data (commented) ...................................................................... resources.conf.prod: add calypso SIM data (commented) We've installed two SIM cards in the osmo-gsm-tester prod setup. I don't know the USB device(s) they enumerate at, just noting down the card data for now, commented out for later enabling. Change-Id: Iafe42f743a2a09a81d421764aae578e4a280eae0 --- M example/resources.conf.prod 1 file changed, 14 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/32/10132/1 diff --git a/example/resources.conf.prod b/example/resources.conf.prod index 8a9a534..ef1fafa 100644 --- a/example/resources.conf.prod +++ b/example/resources.conf.prod @@ -114,3 +114,17 @@ auth_algo: 'comp128v1' ciphers: [a5_0, a5_1] features: ['gprs', 'sim'] + +#- label: c123 +# path: ? +# ki: '485D98E1BE34B3BEFD7E9FCACFF8EC49' # IMSI = 901700000023844 +# auth_algo: 'comp128v1' +# ciphers: [a5_0, a5_1] +# features: ['gprs', 'sim'] + +#- label: freecalypso +# path: ? +# ki: '8CCBE85A62C6DC7AC2A9886F4BBC3146' # IMSI = 901700000023843 +# auth_algo: 'comp128v1' +# ciphers: [a5_0, a5_1] +# features: ['gprs', 'sim'] -- To view, visit https://gerrit.osmocom.org/10132 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iafe42f743a2a09a81d421764aae578e4a280eae0 Gerrit-Change-Number: 10132 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 14:49:13 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 24 Jul 2018 14:49:13 +0000 Subject: Change in libosmocore[master]: stats_statsd: sanitize statsd name Message-ID: lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/10133 Change subject: stats_statsd: sanitize statsd name ...................................................................... stats_statsd: sanitize statsd name The statsd protocol use ':' as seperator between name and value. It's not allowed to use the seperator in a name. Replace ':' with '.' before sending the packet to the statsd server. Change-Id: Ib46d08481e8ca04afd97cb9ae241e4e39c91ad66 --- M src/stats_statsd.c 1 file changed, 22 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/33/10133/1 diff --git a/src/stats_statsd.c b/src/stats_statsd.c index c11c013..a99aea8 100644 --- a/src/stats_statsd.c +++ b/src/stats_statsd.c @@ -68,6 +68,25 @@ return srep; } +/*! Replace all illegal ':' in the stats name, but not when used as value seperator. + * ':' is used as seperator between the name and the value in the statsd protocol. + * \param[in] buf is a null terminated string containing name, value, unit. */ +static void osmo_stats_reporter_sanitize_name(char *buf) +{ + /* e.g. msc.loc_update_type:normal:1|c -> msc.loc_update_type.normal:1|c + * last is the seperator between name and value */ + char *last = strrchr(buf, ':'); + char *tmp = strchr(buf, ':'); + + if (!last) + return; + + while (tmp < last) { + *tmp = '.'; + tmp = strchr(buf, ':'); + } +} + static int osmo_stats_reporter_statsd_send(struct osmo_stats_reporter *srep, const char *name1, unsigned int index1, const char *name2, int64_t value, const char *unit) @@ -134,8 +153,10 @@ return -EMSGSIZE; } - if (nchars > 0) + if (nchars > 0) { + osmo_stats_reporter_sanitize_name(buf); msgb_trim(srep->buffer, msgb_length(srep->buffer) + nchars); + } if (!srep->agg_enabled) rc = osmo_stats_reporter_send_buffer(srep); -- To view, visit https://gerrit.osmocom.org/10133 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ib46d08481e8ca04afd97cb9ae241e4e39c91ad66 Gerrit-Change-Number: 10133 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Tue Jul 24 15:10:06 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Tue, 24 Jul 2018 15:10:06 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-asn1c_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#194?= In-Reply-To: <829703170.49.1532358607168.JavaMail.jenkins@jenkins.osmocom.org> References: <829703170.49.1532358607168.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <31047094.66.1532445006814.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 3.74 KB...] checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for style of include used by make... GNU checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking how to run the C++ preprocessor... g++ -E checking for g77... no checking for f77... no checking for xlf... no checking for frt... no checking for pgf77... no checking for cf77... no checking for fort77... no checking for fl32... no checking for af77... no checking for f90... no checking for xlf90... no checking for pgf90... no checking for pghpf... no checking for epcf90... no checking for gfortran... no checking for g95... no checking for f95... no checking for fort... no checking for xlf95... no checking for ifort... no checking for ifc... no checking for efc... no checking for pgf95... no checking for lf95... no checking for ftn... no checking whether we are using the GNU Fortran 77 compiler... no checking whether accepts -g... no checking the maximum length of command line arguments... 32768 checking command to parse /usr/bin/nm -B output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes configure: creating libtool appending configuration tag "CXX" to libtool checking for ld used by g++... /usr/bin/ld -m elf_x86_64 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC checking if g++ PIC flag -fPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate appending configuration tag "F77" to libtool checking for autoconf... /usr/bin/autoconf checking for autoheader... /usr/bin/autoheader checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking dependency style of gcc... (cached) gcc3 checking how to run the C preprocessor... gcc -E checking for a BSD-compatible install... /usr/bin/install -c checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking for bison... bison -y checking for flex... flex checking for yywrap in -lfl... yes checking lex output file root... lex.yy checking whether yytext is a pointer... yes checking for ar... /usr/bin/ar checking for ANSI C header files... (cached) yes checking sys/param.h usability... yes checking sys/param.h presence... yes checking for sys/param.h... yes checking whether byte ordering is bigendian... no checking for off_t... yes checking for size_t... yes checking whether struct tm is in sys/time.h or time.h... time.h checking for intmax_t... yes checking for library containing getopt... none required checking for strtoimax... yes checking for strtoll... yes checking for mergesort... no checking for mkstemps... yes configure: creating ./config.status config.status: creating skeletons/standard-modules/Makefile config.status: creating skeletons/tests/Makefile config.status: creating libasn1compiler/Makefile config.status: creating libasn1parser/Makefile config.status: creating libasn1print/Makefile config.status: creating asn1c/webcgi/Makefile config.status: creating asn1c/tests/Makefile config.status: creating libasn1fix/Makefile config.status: creating skeletons/Makefile config.status: creating examples/Makefile config.status: creating tests/Makefile config.status: creating asn1c/Makefile config.status: creating doc/Makefile config.status: creating asn1c.spec config.status: creating Makefile config.status: creating config.h config.status: executing depfiles commands + make -j 8 make all-recursive make[1]: Entering directory ' Making all in libasn1parser make[2]: Entering directory ' if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF ".deps/asn1parser.Tpo" -c -o asn1parser.lo asn1parser.c; \ then mv -f ".deps/asn1parser.Tpo" ".deps/asn1parser.Plo"; else rm -f ".deps/asn1parser.Tpo"; exit 1; fi bison -y -p asn1p_ -d asn1p_y.y if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF ".deps/asn1p_l.Tpo" -c -o asn1p_l.lo asn1p_l.c; \ then mv -f ".deps/asn1p_l.Tpo" ".deps/asn1p_l.Plo"; else rm -f ".deps/asn1p_l.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF ".deps/asn1p_module.Tpo" -c -o asn1p_module.lo asn1p_module.c; \ then mv -f ".deps/asn1p_module.Tpo" ".deps/asn1p_module.Plo"; else rm -f ".deps/asn1p_module.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF ".deps/asn1p_oid.Tpo" -c -o asn1p_oid.lo asn1p_oid.c; \ then mv -f ".deps/asn1p_oid.Tpo" ".deps/asn1p_oid.Plo"; else rm -f ".deps/asn1p_oid.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF ".deps/asn1p_value.Tpo" -c -o asn1p_value.lo asn1p_value.c; \ then mv -f ".deps/asn1p_value.Tpo" ".deps/asn1p_value.Plo"; else rm -f ".deps/asn1p_value.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF ".deps/asn1p_expr.Tpo" -c -o asn1p_expr.lo asn1p_expr.c; \ then mv -f ".deps/asn1p_expr.Tpo" ".deps/asn1p_expr.Plo"; else rm -f ".deps/asn1p_expr.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF ".deps/asn1p_xports.Tpo" -c -o asn1p_xports.lo asn1p_xports.c; \ then mv -f ".deps/asn1p_xports.Tpo" ".deps/asn1p_xports.Plo"; else rm -f ".deps/asn1p_xports.Tpo"; exit 1; fi asn1p_y.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] mkdir .libs mkdir .libs mkdir: cannot create directory '.libs': File exists gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -fPIC -DPIC -o .libs/asn1p_l.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -fPIC -DPIC -o .libs/asn1p_xports.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -fPIC -DPIC -o .libs/asn1p_expr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -fPIC -DPIC -o .libs/asn1p_oid.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -fPIC -DPIC -o .libs/asn1parser.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -fPIC -DPIC -o .libs/asn1p_module.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -fPIC -DPIC -o .libs/asn1p_value.o asn1p_l.c:3521:12: warning: 'input' defined but not used [-Wunused-function] static int input() ^~~~~ gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -o asn1p_xports.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -o asn1p_module.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -o asn1p_oid.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -o asn1p_expr.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -o asn1parser.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF ".deps/asn1p_constr.Tpo" -c -o asn1p_constr.lo asn1p_constr.c; \ then mv -f ".deps/asn1p_constr.Tpo" ".deps/asn1p_constr.Plo"; else rm -f ".deps/asn1p_constr.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF ".deps/asn1p_param.Tpo" -c -o asn1p_param.lo asn1p_param.c; \ then mv -f ".deps/asn1p_param.Tpo" ".deps/asn1p_param.Plo"; else rm -f ".deps/asn1p_param.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -o asn1p_value.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF ".deps/asn1p_class.Tpo" -c -o asn1p_class.lo asn1p_class.c; \ then mv -f ".deps/asn1p_class.Tpo" ".deps/asn1p_class.Plo"; else rm -f ".deps/asn1p_class.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF ".deps/asn1p_ref.Tpo" -c -o asn1p_ref.lo asn1p_ref.c; \ then mv -f ".deps/asn1p_ref.Tpo" ".deps/asn1p_ref.Plo"; else rm -f ".deps/asn1p_ref.Tpo"; exit 1; fi if test -f y.tab.h; then \ to=`echo "asn1p_y_H" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \ sed -e "/^#/!b" -e "s/Y_TAB_H/$to/g" -e "s|y\.tab\.h|asn1p_y.h|" \ y.tab.h >asn1p_y.ht; \ rm -f y.tab.h; \ if cmp -s asn1p_y.ht asn1p_y.h; then \ rm -f asn1p_y.ht ;\ else \ mv asn1p_y.ht asn1p_y.h; \ fi; \ fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -fPIC -DPIC -o .libs/asn1p_class.o if test -f y.output; then \ mv y.output asn1p_y.output; \ fi sed '/^#/ s|y\.tab\.c|asn1p_y.c|' y.tab.c >asn1p_y.ct && mv asn1p_y.ct asn1p_y.c gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -fPIC -DPIC -o .libs/asn1p_param.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -fPIC -DPIC -o .libs/asn1p_constr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -fPIC -DPIC -o .libs/asn1p_ref.o rm -f y.tab.c if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF ".deps/asn1p_y.Tpo" -c -o asn1p_y.lo asn1p_y.c; \ then mv -f ".deps/asn1p_y.Tpo" ".deps/asn1p_y.Plo"; else rm -f ".deps/asn1p_y.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -o asn1p_l.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -o asn1p_class.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -o asn1p_param.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -o asn1p_constr.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -o asn1p_ref.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF .deps/asn1p_y.Tpo -c asn1p_y.c -fPIC -DPIC -o .libs/asn1p_y.o asn1p_y.y: In function 'asn1p_parse': asn1p_y.y:357:13: error: 'param' undeclared (first use in this function) *(void **)param = $1; ^~~~~ asn1p_y.y:357:13: note: each undeclared identifier is reported only once for each function it appears in Makefile:299: recipe for target 'asn1p_y.lo' failed make[2]: *** [asn1p_y.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory ' Makefile:302: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory ' Makefile:212: recipe for target 'all' failed make: *** [all] Error 2 Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Tue Jul 24 15:19:26 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 24 Jul 2018 15:19:26 +0000 Subject: Change in libosmocore[master]: logging: Fix logging level all In-Reply-To: References: Message-ID: Hello Vadim Yanitskiy, Neels Hofmeyr, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10116 to look at the new patch set (#2). Change subject: logging: Fix logging level all ...................................................................... logging: Fix logging level all This commit fixes "logging level all " to have a behavior which makes sense. First, old "everything" loglevel is moved and re-used as "unset", which can be used to set loglevel for a given category to whatever the logtarget defaults to. This is done because it's handy to have "unset" in pos 0 since it's the default level for all categories until they are explicitly set. Furthermore, we don't care about position/number of "everything" level because nowadays it's deprecated and never assigned anymore (and it never had a public define value), and string only kept for VTY compatibility until it is totally removed in the future. When using "logging level all", VTY sets default log level to and resets all log categories to UNSET. Then user can specify specific log levels for specific categories using "logging level ". For instance: log stderr logging level all error logging level l1p notice Will print ERROR messages for all categories and NOTICE+ERROR messages for L1P category. Another example: In the VTY, while debugging: * logging level all error -> Only all ERRORs are printed * logging level l1p debug -> all INFO+NOTICE+ERROR for L1P, and all ERROR are printed. Now, user is interested to debug some other category, eg. TRX: * logging level l1p unset -> L1P goes back to target default (ERROR) * logging level trx debug -> we get all TRX logs. Fixes: OS#3409 Change-Id: I0f50ad8d6fd038398f7d751287417505c8dcdeff --- M include/osmocom/core/logging.h M src/logging.c M src/vty/logging_vty.c 3 files changed, 32 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/16/10116/2 -- To view, visit https://gerrit.osmocom.org/10116 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0f50ad8d6fd038398f7d751287417505c8dcdeff Gerrit-Change-Number: 10116 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 15:19:27 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 24 Jul 2018 15:19:27 +0000 Subject: Change in libosmocore[master]: logging: log_vty_command_string: Fix undercount of buf alloc size Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10134 Change subject: logging: log_vty_command_string: Fix undercount of buf alloc size ...................................................................... logging: log_vty_command_string: Fix undercount of buf alloc size Change-Id: I7aca0ce3d2981001e8081f7cee0dea3e2aaf8f7c --- M src/logging.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/34/10134/1 diff --git a/src/logging.c b/src/logging.c index 1dfd484..381d303 100644 --- a/src/logging.c +++ b/src/logging.c @@ -932,7 +932,7 @@ { struct log_info *info = osmo_log_info; int len = 0, offset = 0, ret, i, rem; - int size = strlen("logging level () ()") + 1; + int size = strlen("logging level (all|) ()") + 1; char *str; assert_loginfo(__func__); -- To view, visit https://gerrit.osmocom.org/10134 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I7aca0ce3d2981001e8081f7cee0dea3e2aaf8f7c Gerrit-Change-Number: 10134 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 15:19:27 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 24 Jul 2018 15:19:27 +0000 Subject: Change in libosmocore[master]: logging_vty: Simplify code in config_write_log_single Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10135 Change subject: logging_vty: Simplify code in config_write_log_single ...................................................................... logging_vty: Simplify code in config_write_log_single Since we ignore "logging level CAT everything" in logging_level_cmd, we can never run into the case in which we have loglevel==EVERYTHING, so we can simplify this code and make it esier for later removal of everything keyword. Change-Id: I4e76c65a11cc22616c6dfc632435617ebb861c03 --- M src/vty/logging_vty.c 1 file changed, 1 insertion(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/35/10135/1 diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index 8151fda..1194914 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -814,15 +814,9 @@ /* stupid old osmo logging API uses uppercase strings... */ osmo_str2lower(cat_lower, osmo_log_info->cat[i].name+1); osmo_str2lower(level_lower, log_level_str(cat->loglevel)); - - if (strcmp(level_lower, "everything") != 0) /* FIXME: remove this check once 'everything' is phased out */ - vty_out(vty, " logging level %s %s%s", cat_lower, level_lower, VTY_NEWLINE); - else - LOGP(DLSTATS, LOGL_ERROR, "logging level everything is deprecated and should not be used\n"); + vty_out(vty, " logging level %s %s%s", cat_lower, level_lower, VTY_NEWLINE); } - /* FIXME: levels */ - return 1; } -- To view, visit https://gerrit.osmocom.org/10135 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I4e76c65a11cc22616c6dfc632435617ebb861c03 Gerrit-Change-Number: 10135 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 15:19:28 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 24 Jul 2018 15:19:28 +0000 Subject: Change in libosmocore[master]: logging: Add VTY cmd: logging level unset Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10136 Change subject: logging: Add VTY cmd: logging level unset ...................................................................... logging: Add VTY cmd: logging level unset This command is useful while debugging an osmocom application in the VTY. It allows a user to keep per-category set loglevels while changing the default log level. For instance, scenario: 1- Set everything to error to get as low output as possible (but keep seeing errors): logging level all error 2- Set severla categories to debug: logging level trx debug logging level l1c info logging level l1p info 3- Decide more output is required while keeping setup for previously set categories: logging level unset notice As a result, we have trx=debug, l1c=info, l1p=info and all the other categories are handled as loglvel notice. Change-Id: Iee0d4da16b075e798f85c3f6adeb513057fd5402 --- M include/osmocom/core/logging.h M src/logging.c M src/vty/logging_vty.c 3 files changed, 33 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/36/10136/1 diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h index 5d4fd36..bc6174d 100644 --- a/include/osmocom/core/logging.h +++ b/include/osmocom/core/logging.h @@ -340,6 +340,7 @@ void log_set_print_category_hex(struct log_target *target, int); void log_set_print_level(struct log_target *target, int); void log_set_log_level(struct log_target *target, int log_level); +void log_set_log_level_unset(struct log_target *target, int log_level); void log_parse_category_mask(struct log_target *target, const char* mask); const char* log_category_name(int subsys); int log_parse_level(const char *lvl) OSMO_DEPRECATED_OUTSIDE_LIBOSMOCORE; diff --git a/src/logging.c b/src/logging.c index b0ac0b5..ebd6838 100644 --- a/src/logging.c +++ b/src/logging.c @@ -710,6 +710,16 @@ target->print_level = (bool)print_level; } +/*! Set the global log level for a given log target. This log level will be used + * as a default for all log categories with an unset level. + * \param[in] target Log target to be affected + * \param[in] log_level New global log level + */ +void log_set_log_level_unset(struct log_target *target, int log_level) +{ + target->loglevel = log_level; +} + /*! Set the global log level for a given log target. Unsets previously set * category specific log levels. * \param[in] target Log target to be affected @@ -948,7 +958,7 @@ { struct log_info *info = osmo_log_info; int len = 0, offset = 0, ret, i, rem; - int size = strlen("logging level (all|) ()") + 1; + int size = strlen("logging level (all|unset|) ()") + 1; char *str; assert_loginfo(__func__); @@ -967,7 +977,7 @@ if (!str) return NULL; - ret = snprintf(str + offset, rem, "logging level (all|"); + ret = snprintf(str + offset, rem, "logging level (all|unset|"); if (ret < 0) goto err; OSMO_SNPRINTF_RET(ret, rem, offset, len); @@ -1029,6 +1039,11 @@ struct log_info *info = osmo_log_info; char *str; int i, ret, len = 0, offset = 0, rem; + const char *static_categories[] = { + "Global setting for all subsystems (unsets previosuly set subsystems)\n", + "Global setting for all subsystems with unset log level\n", + NULL + }; unsigned int size = strlen(LOGGING_STR "Set the log level for a specified category\n") + 1; @@ -1044,7 +1059,8 @@ for (i = 0; i < LOGLEVEL_DEFS; i++) size += strlen(loglevel_descriptions[i]) + 1; - size += strlen("Global setting for all subsystems") + 1; + for (i = 0; static_categories[i] != NULL; i++) + size += strlen(static_categories[i]) + 1; rem = size; str = talloc_zero_size(tall_log_ctx, size); if (!str) @@ -1056,11 +1072,12 @@ goto err; OSMO_SNPRINTF_RET(ret, rem, offset, len); - ret = snprintf(str + offset, rem, - "Global setting for all subsystems\n"); - if (ret < 0) - goto err; - OSMO_SNPRINTF_RET(ret, rem, offset, len); + for (i = 0; static_categories[i] != NULL; i++) { + ret = snprintf(str + offset, rem, static_categories[i]); + if (ret < 0) + goto err; + OSMO_SNPRINTF_RET(ret, rem, offset, len); + } for (i = 0; i < info->num_cat; i++) { if (info->cat[i].name == NULL) diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index 735d348..2373a6b 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -284,12 +284,18 @@ return CMD_SUCCESS; } - /* Check for special case where we want to set global log level */ + /* Check for special case where we want to set global log level and unset all categories */ if (!strcmp(argv[0], "all")) { log_set_log_level(tgt, level); return CMD_SUCCESS; } + /* Check for special case where we want to set global log level without unsetting categories */ + if (!strcmp(argv[0], "unset")) { + log_set_log_level_unset(tgt, level); + return CMD_SUCCESS; + } + if (category < 0) { vty_out(vty, "Invalid category `%s'%s", argv[0], VTY_NEWLINE); return CMD_WARNING; -- To view, visit https://gerrit.osmocom.org/10136 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iee0d4da16b075e798f85c3f6adeb513057fd5402 Gerrit-Change-Number: 10136 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 15:37:10 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 24 Jul 2018 15:37:10 +0000 Subject: Change in osmocom-bb[master]: trxcon/scheduler: fix: check primitive len before encoding Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/10137 Change subject: trxcon/scheduler: fix: check primitive len before encoding ...................................................................... trxcon/scheduler: fix: check primitive len before encoding We used to trust (and still doing this) the messages coming from L1CTL interface too much, and not to check the primitive length before passing the payload to the libosmocoding API. As was discovered and described in OS#3415, sending a L1CTL message (either DATA_REQ, or TRAFFIC_REQ) with an incorrect length (lower than expected) may cause heap overflow. Let's explicitly check a primitive before encoding, and drop it if its length doesn't match the expected value(s). Change-Id: I258ee9f6d0124b183b1db23a73f1e523fcea89a8 Fixes: OS#3415 --- M src/host/trxcon/sched_lchan_rach.c M src/host/trxcon/sched_lchan_tchf.c M src/host/trxcon/sched_lchan_xcch.c 3 files changed, 29 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/37/10137/1 diff --git a/src/host/trxcon/sched_lchan_rach.c b/src/host/trxcon/sched_lchan_rach.c index 3f6e2e1..a255efb 100644 --- a/src/host/trxcon/sched_lchan_rach.c +++ b/src/host/trxcon/sched_lchan_rach.c @@ -69,6 +69,15 @@ uint8_t payload[36]; int rc; + /* Check the prim payload length */ + if (lchan->prim->payload_len != sizeof(*req)) { + LOGP(DSCHD, LOGL_ERROR, "Primitive has odd length %zu (expected %zu), " + "so dropping...\n", lchan->prim->payload_len, sizeof(*req)); + + sched_prim_drop(lchan); + return -EINVAL; + } + /* Get the payload from a current primitive */ req = (struct l1ctl_rach_req *) lchan->prim->payload; diff --git a/src/host/trxcon/sched_lchan_tchf.c b/src/host/trxcon/sched_lchan_tchf.c index 80e4d52..e20b461 100644 --- a/src/host/trxcon/sched_lchan_tchf.c +++ b/src/host/trxcon/sched_lchan_tchf.c @@ -232,9 +232,17 @@ return -EINVAL; } - /* Determine payload length */ - if (lchan->prim->payload_len == GSM_MACBLOCK_LEN) - l2_len = GSM_MACBLOCK_LEN; + /* Determine and check the payload length */ + if (lchan->prim->payload_len == GSM_MACBLOCK_LEN) { + l2_len = GSM_MACBLOCK_LEN; /* FACCH */ + } else if (lchan->prim->payload_len != l2_len) { + LOGP(DSCHD, LOGL_ERROR, "Primitive has odd length %zu " + "(expected %zu for TCH or %u for FACCH), so dropping...\n", + lchan->prim->payload_len, l2_len, GSM_MACBLOCK_LEN); + + sched_prim_drop(lchan); + return -EINVAL; + } /* Shift buffer by 4 bursts back for interleaving */ memcpy(buffer, buffer + 464, 464); diff --git a/src/host/trxcon/sched_lchan_xcch.c b/src/host/trxcon/sched_lchan_xcch.c index 04c9f4e..b31f727 100644 --- a/src/host/trxcon/sched_lchan_xcch.c +++ b/src/host/trxcon/sched_lchan_xcch.c @@ -141,6 +141,15 @@ return 0; } + /* Check the prim payload length */ + if (lchan->prim->payload_len != GSM_MACBLOCK_LEN) { + LOGP(DSCHD, LOGL_ERROR, "Primitive has odd length %zu (expected %u), " + "so dropping...\n", lchan->prim->payload_len, GSM_MACBLOCK_LEN); + + sched_prim_drop(lchan); + return -EINVAL; + } + /* Encode payload */ rc = gsm0503_xcch_encode(buffer, lchan->prim->payload); if (rc) { -- To view, visit https://gerrit.osmocom.org/10137 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I258ee9f6d0124b183b1db23a73f1e523fcea89a8 Gerrit-Change-Number: 10137 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 15:42:34 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 24 Jul 2018 15:42:34 +0000 Subject: Change in osmocom-bb[master]: trxcon/scheduler: fix: check primitive len before encoding In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10137 ) Change subject: trxcon/scheduler: fix: check primitive len before encoding ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/10137 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I258ee9f6d0124b183b1db23a73f1e523fcea89a8 Gerrit-Change-Number: 10137 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 24 Jul 2018 15:42:34 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 15:45:57 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Tue, 24 Jul 2018 15:45:57 +0000 Subject: Change in osmocom-bb[master]: prevent heap overflow in tch_fr_disassemble() In-Reply-To: References: Message-ID: Stefan Sperling has abandoned this change. ( https://gerrit.osmocom.org/10131 ) Change subject: prevent heap overflow in tch_fr_disassemble() ...................................................................... Abandoned see https://gerrit.osmocom.org/c/osmocom-bb/+/10137/ -- To view, visit https://gerrit.osmocom.org/10131 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: I3ae3a1a14d131de256b48d645130df737e9b5f26 Gerrit-Change-Number: 10131 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 15:48:22 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Tue, 24 Jul 2018 15:48:22 +0000 Subject: Change in osmocom-bb[master]: trxcon/scheduler: fix: check primitive len before encoding In-Reply-To: References: Message-ID: Stefan Sperling has posted comments on this change. ( https://gerrit.osmocom.org/10137 ) Change subject: trxcon/scheduler: fix: check primitive len before encoding ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/10137 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I258ee9f6d0124b183b1db23a73f1e523fcea89a8 Gerrit-Change-Number: 10137 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling Gerrit-Comment-Date: Tue, 24 Jul 2018 15:48:22 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 15:58:34 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Tue, 24 Jul 2018 15:58:34 +0000 Subject: Change in osmo-sysmon[master]: git-version-gen: Don't check for .git directory Message-ID: daniel has uploaded this change for review. ( https://gerrit.osmocom.org/10138 Change subject: git-version-gen: Don't check for .git directory ...................................................................... git-version-gen: Don't check for .git directory This check is not in all our repos that use git-version-gen. Indeed it seems to be a leftover of openbsc where I think it wanted to ensure being called in the openbsc subfolder or something? libosmocore e.g. doesn't have it. In any case .git being a directory is not always true (if using git worktree) so remove this check. Change-Id: I414111b27db9951314e6bc7eff8bc1f10775b3ff --- M git-version-gen 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sysmon refs/changes/38/10138/1 diff --git a/git-version-gen b/git-version-gen index 8e59c5a..42cf3d2 100755 --- a/git-version-gen +++ b/git-version-gen @@ -92,8 +92,8 @@ if test -n "$v" then : # use $v -elif test -d ./.git \ - && v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ +elif + v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ || git describe --abbrev=4 HEAD 2>/dev/null` \ && case $v in [0-9]*) ;; -- To view, visit https://gerrit.osmocom.org/10138 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sysmon Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I414111b27db9951314e6bc7eff8bc1f10775b3ff Gerrit-Change-Number: 10138 Gerrit-PatchSet: 1 Gerrit-Owner: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 16:04:13 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Tue, 24 Jul 2018 16:04:13 +0000 Subject: Change in libosmo-sccp[master]: git-version-gen: Don't check for .git directory Message-ID: daniel has uploaded this change for review. ( https://gerrit.osmocom.org/10139 Change subject: git-version-gen: Don't check for .git directory ...................................................................... git-version-gen: Don't check for .git directory This check is not in all our repos that use git-version-gen. Indeed it seems to be a leftover of openbsc where I think it wanted to ensure being called in the openbsc subfolder or something? libosmocore e.g. doesn't have it. In any case .git being a directory is not always true (if using git worktree) so remove this check. Change-Id: Ic14561f3b041bb94d1b60e477b18e37077ce4c32 --- M git-version-gen 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/39/10139/1 diff --git a/git-version-gen b/git-version-gen index 8e59c5a..42cf3d2 100755 --- a/git-version-gen +++ b/git-version-gen @@ -92,8 +92,8 @@ if test -n "$v" then : # use $v -elif test -d ./.git \ - && v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ +elif + v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ || git describe --abbrev=4 HEAD 2>/dev/null` \ && case $v in [0-9]*) ;; -- To view, visit https://gerrit.osmocom.org/10139 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ic14561f3b041bb94d1b60e477b18e37077ce4c32 Gerrit-Change-Number: 10139 Gerrit-PatchSet: 1 Gerrit-Owner: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 16:05:37 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Tue, 24 Jul 2018 16:05:37 +0000 Subject: Change in osmo-bsc[master]: git-version-gen: Don't check for .git directory Message-ID: daniel has uploaded this change for review. ( https://gerrit.osmocom.org/10140 Change subject: git-version-gen: Don't check for .git directory ...................................................................... git-version-gen: Don't check for .git directory This check is not in all our repos that use git-version-gen. Indeed it seems to be a leftover of openbsc where I think it wanted to ensure being called in the openbsc subfolder or something? libosmocore e.g. doesn't have it. In any case .git being a directory is not always true (if using git worktree) so remove this check. Change-Id: I976dd4ff20cc5b220b244b1fb6192c0528c32638 --- M git-version-gen 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/40/10140/1 diff --git a/git-version-gen b/git-version-gen index 8e59c5a..42cf3d2 100755 --- a/git-version-gen +++ b/git-version-gen @@ -92,8 +92,8 @@ if test -n "$v" then : # use $v -elif test -d ./.git \ - && v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ +elif + v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ || git describe --abbrev=4 HEAD 2>/dev/null` \ && case $v in [0-9]*) ;; -- To view, visit https://gerrit.osmocom.org/10140 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I976dd4ff20cc5b220b244b1fb6192c0528c32638 Gerrit-Change-Number: 10140 Gerrit-PatchSet: 1 Gerrit-Owner: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 16:05:54 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Tue, 24 Jul 2018 16:05:54 +0000 Subject: Change in osmo-msc[master]: git-version-gen: Don't check for .git directory Message-ID: daniel has uploaded this change for review. ( https://gerrit.osmocom.org/10141 Change subject: git-version-gen: Don't check for .git directory ...................................................................... git-version-gen: Don't check for .git directory This check is not in all our repos that use git-version-gen. Indeed it seems to be a leftover of openbsc where I think it wanted to ensure being called in the openbsc subfolder or something? libosmocore e.g. doesn't have it. In any case .git being a directory is not always true (if using git worktree) so remove this check. Change-Id: I9d895fa90991d47e9626a8e7fa701540b658194c --- M git-version-gen 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/41/10141/1 diff --git a/git-version-gen b/git-version-gen index 8e59c5a..42cf3d2 100755 --- a/git-version-gen +++ b/git-version-gen @@ -92,8 +92,8 @@ if test -n "$v" then : # use $v -elif test -d ./.git \ - && v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ +elif + v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ || git describe --abbrev=4 HEAD 2>/dev/null` \ && case $v in [0-9]*) ;; -- To view, visit https://gerrit.osmocom.org/10141 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I9d895fa90991d47e9626a8e7fa701540b658194c Gerrit-Change-Number: 10141 Gerrit-PatchSet: 1 Gerrit-Owner: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 16:06:17 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Tue, 24 Jul 2018 16:06:17 +0000 Subject: Change in osmo-sgsn[master]: git-version-gen: Don't check for .git directory Message-ID: daniel has uploaded this change for review. ( https://gerrit.osmocom.org/10142 Change subject: git-version-gen: Don't check for .git directory ...................................................................... git-version-gen: Don't check for .git directory This check is not in all our repos that use git-version-gen. Indeed it seems to be a leftover of openbsc where I think it wanted to ensure being called in the openbsc subfolder or something? libosmocore e.g. doesn't have it. In any case .git being a directory is not always true (if using git worktree) so remove this check. Change-Id: I4385cc4fb87ca4354a3c608a18aa3d2eb03a744f --- M git-version-gen 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/42/10142/1 diff --git a/git-version-gen b/git-version-gen index 8e59c5a..42cf3d2 100755 --- a/git-version-gen +++ b/git-version-gen @@ -92,8 +92,8 @@ if test -n "$v" then : # use $v -elif test -d ./.git \ - && v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ +elif + v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ || git describe --abbrev=4 HEAD 2>/dev/null` \ && case $v in [0-9]*) ;; -- To view, visit https://gerrit.osmocom.org/10142 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I4385cc4fb87ca4354a3c608a18aa3d2eb03a744f Gerrit-Change-Number: 10142 Gerrit-PatchSet: 1 Gerrit-Owner: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 16:07:01 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Tue, 24 Jul 2018 16:07:01 +0000 Subject: Change in osmo-mgw[master]: git-version-gen: Don't check for .git directory Message-ID: daniel has uploaded this change for review. ( https://gerrit.osmocom.org/10143 Change subject: git-version-gen: Don't check for .git directory ...................................................................... git-version-gen: Don't check for .git directory This check is not in all our repos that use git-version-gen. Indeed it seems to be a leftover of openbsc where I think it wanted to ensure being called in the openbsc subfolder or something? libosmocore e.g. doesn't have it. In any case .git being a directory is not always true (if using git worktree) so remove this check. Change-Id: I83b84099c34d593a8a384f001a8131c2a8085606 --- M git-version-gen 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/43/10143/1 diff --git a/git-version-gen b/git-version-gen index 8e59c5a..42cf3d2 100755 --- a/git-version-gen +++ b/git-version-gen @@ -92,8 +92,8 @@ if test -n "$v" then : # use $v -elif test -d ./.git \ - && v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ +elif + v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ || git describe --abbrev=4 HEAD 2>/dev/null` \ && case $v in [0-9]*) ;; -- To view, visit https://gerrit.osmocom.org/10143 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I83b84099c34d593a8a384f001a8131c2a8085606 Gerrit-Change-Number: 10143 Gerrit-PatchSet: 1 Gerrit-Owner: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 16:11:55 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Tue, 24 Jul 2018 16:11:55 +0000 Subject: Change in openbsc[master]: git-version-gen: Don't check for .git directory Message-ID: daniel has uploaded this change for review. ( https://gerrit.osmocom.org/10144 Change subject: git-version-gen: Don't check for .git directory ...................................................................... git-version-gen: Don't check for .git directory This check is not in all our repos that use git-version-gen. Indeed it seems to be a leftover of openbsc where I think it wanted to ensure being called in the openbsc subfolder or something? libosmocore e.g. doesn't have it. In any case .git being a directory is not always true (if using git worktree) so remove this check. Change-Id: Ibc8c0d8e74bb03bfe87d6f8b9ef6e74c0c889d0f --- M openbsc/git-version-gen 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/44/10144/1 diff --git a/openbsc/git-version-gen b/openbsc/git-version-gen index f2ad4a7..42cf3d2 100755 --- a/openbsc/git-version-gen +++ b/openbsc/git-version-gen @@ -92,8 +92,8 @@ if test -n "$v" then : # use $v -elif test -d ./../.git \ - && v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ +elif + v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ || git describe --abbrev=4 HEAD 2>/dev/null` \ && case $v in [0-9]*) ;; -- To view, visit https://gerrit.osmocom.org/10144 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ibc8c0d8e74bb03bfe87d6f8b9ef6e74c0c889d0f Gerrit-Change-Number: 10144 Gerrit-PatchSet: 1 Gerrit-Owner: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 16:13:29 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 16:13:29 +0000 Subject: Change in osmo-bsc[master]: add gsm_timers, for Tnnn definitions usable by FSMs In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9670 to look at the new patch set (#13). Change subject: add gsm_timers, for Tnnn definitions usable by FSMs ...................................................................... add gsm_timers, for Tnnn definitions usable by FSMs Change-Id: If212fcd042051b6fa53484254223614c5b93a9c6 --- M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/gsm_data.h A include/osmocom/bsc/gsm_timers.h M src/ipaccess/Makefile.am M src/osmo-bsc/Makefile.am M src/osmo-bsc/abis_om2000.c M src/osmo-bsc/abis_rsl.c M src/osmo-bsc/bsc_subscr_conn_fsm.c M src/osmo-bsc/bsc_vty.c M src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c M src/osmo-bsc/bts_siemens_bs11.c M src/osmo-bsc/gsm_data.c A src/osmo-bsc/gsm_timers.c A src/osmo-bsc/gsm_timers_vty.c M src/osmo-bsc/net_init.c M src/osmo-bsc/paging.c M src/utils/Makefile.am M tests/abis/Makefile.am M tests/bsc/Makefile.am M tests/gsm0408/Makefile.am M tests/handover/Makefile.am M tests/nanobts_omlattr/Makefile.am M tests/nanobts_omlattr/nanobts_omlattr_test.c 23 files changed, 513 insertions(+), 180 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/70/9670/13 -- To view, visit https://gerrit.osmocom.org/9670 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If212fcd042051b6fa53484254223614c5b93a9c6 Gerrit-Change-Number: 9670 Gerrit-PatchSet: 13 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 16:13:29 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 16:13:29 +0000 Subject: Change in osmo-bsc[master]: large refactoring: use FSMs for lchans; add inter-BSC HO In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9671 to look at the new patch set (#36). Change subject: large refactoring: use FSMs for lchans; add inter-BSC HO ...................................................................... large refactoring: use FSMs for lchans; add inter-BSC HO Add FSMs: - timeslot_fsm: handle dynamic timeslots and OML+RSL availability. - lchan_fsm: handle an individual lchan activation, RTP stream and release, signal the appropriate calling FSMs on success, failure, release. - mgw_endpoint_fsm: handle one entire endpoint with several CI. - assignment_fsm: BSSMAP Assignment Request. - handover_fsm: all of intra, inter-MO and inter-MT handover. Above FSMs absorb large parts of the gscon FSM. The gscon FSM was surpassing the maximum amount events (32), and it is more logical to treat assignment, handover and MGW procedures in separate FSMs. - Add logging macros for each FSM type: - LOG_TS() - LOG_LCHAN() - LOG_MGWEP(), LOG_CI() - LOG_ASSIGNMENT() - LOG_HO() These log with the osmo_fsm_inst where present. New style decision: logging without a final newline char is awkward, especially for gsmtap logging and when other logs interleave LOGPC() calls; we have various cases where the final \n goes missing, and also this invokes the log category checking N times instead of once. So I decided to make these macros *always* append a newline, but only if there is no final newline yet. I hope that the compiler optimizes the strlen() of the constant format strings away. Thus I can log with or without typing "\n" and always get an \n termination anyway. General: - replace osmo_timers, state enums and program-wide osmo_signal_dispatch() with dedicated FSM timeouts, states and events. - introduce a common way to handle Tnnn timers: gsm_timers.h/.c: struct T_def. These can be used (with some macro magic) to define a state's timeout once, and not make mistakes for each osmo_fsm_inst_state_chg(). Details: bsc_subscr_conn_fsm.c: - move most states of this FSM to lchan_fsm, assignment_fsm, handover_fsm and mgw_endpoint_fsm. - There is exactly one state for an ongoing Assignment, with all details handled in conn->assignment.fi. The state relies on the assignment_fsm's timeout. - There is one state for an ongoing Handover; except for an incoming Handover from a remote BSS, the gscon remains in ST_INIT until the new lchan and conn are both established. - move bssmap_add_lcls_status() to osmo_bsc_lcls.c abis_rsl.c: - move all dynamic timeslot logic away into timeslot_fsm. Only keep plain send/receive functions in abis_rsl.c - reduce some rsl functions to merely send a message, rename to "_tx_". - rsl_ipacc_mdcx(): add '_tx_' in the name; move parts that change the lchan state out into the lchan_fsm, the lchan->abis_ip.* are now set there prior to invoking this function. - move all timers and error/release handling away into various FSMs. - tweak ipa_smod_s_for_lchan() and ipa_rtp_pt_for_lchan() to not require an lchan passed, but just mode,type that they require. Rename to ipacc_speech_mode*() and ipacc_payload_type(). - add rsl_forward_layer3_info, used for inter-BSC HO MO, to just send the RR message received during BSSMAP Handover Command. - move various logging to LOG_LCHAN() in order to log with the lchan FSM instance. One drawback is that the lchan FSM is limited to one logging category, i.e. this moves some logging from DRR to DRSL. It might actually make sense to combine those categories. - lose LOGP...LOGPC logging cascades: they are bad for gsmtap logging and for performance. - handle_classmark_chg(): change logging, move cm2 len check out of the cm3 condition (I hope that's correct). - gsm48_send_ho_cmd(): split off gsm48_make_ho_cmd() which doesn't send right away, so that during inter-bsc HO we can make an RR Handover Command to send via the MSC to the remote BSS. assignment_fsm.c: - the Chan Mode Modify in case of re-using the same lchan is not implemented yet, because this was also missing in the previous implementation (OS#3357). osmo_bsc_api.c: - simplify bsc_mr_config() and move to lchan_fsm.c, the only caller; rename to lchan_mr_config(). (bsc_mr_config() used to copy the values to mr_bts_lv twice, once by member assignment and then again with a memcpy.) - During handover, we used to copy the MR config from the old lchan. Since we may handover between FR and HR, rather set the MR Config anew every time, so that FR rates are always available on FR lchans, and never on HR lchans. Depends: I03ee7ce840ecfa0b6a33358e7385528aabd4873f (libosmocore), I1f2918418c38918c5ac70acaa51a47adfca12b5e (libosmocore) Change-Id: I82e3f918295daa83274a4cf803f046979f284366 --- M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/abis_rsl.h A include/osmocom/bsc/assignment_fsm.h M include/osmocom/bsc/bsc_api.h M include/osmocom/bsc/bsc_msc_data.h M include/osmocom/bsc/bsc_subscr_conn_fsm.h M include/osmocom/bsc/bsc_subscriber.h M include/osmocom/bsc/chan_alloc.h M include/osmocom/bsc/codec_pref.h M include/osmocom/bsc/gsm_04_08_rr.h M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/gsm_timers.h M include/osmocom/bsc/handover.h A include/osmocom/bsc/handover_fsm.h A include/osmocom/bsc/lchan_fsm.h A include/osmocom/bsc/lchan_select.h A include/osmocom/bsc/mgw_endpoint_fsm.h M include/osmocom/bsc/osmo_bsc.h M include/osmocom/bsc/osmo_bsc_lcls.h A include/osmocom/bsc/timeslot_fsm.h M src/ipaccess/Makefile.am M src/ipaccess/stubs.c M src/osmo-bsc/Makefile.am M src/osmo-bsc/abis_om2000.c M src/osmo-bsc/abis_rsl.c A src/osmo-bsc/assignment_fsm.c M src/osmo-bsc/bsc_api.c D src/osmo-bsc/bsc_dyn_ts.c M src/osmo-bsc/bsc_subscr_conn_fsm.c M src/osmo-bsc/bsc_subscriber.c M src/osmo-bsc/bsc_vty.c M src/osmo-bsc/bts_ericsson_rbs2000.c M src/osmo-bsc/bts_ipaccess_nanobts.c M src/osmo-bsc/bts_nokia_site.c M src/osmo-bsc/bts_siemens_bs11.c M src/osmo-bsc/chan_alloc.c M src/osmo-bsc/codec_pref.c M src/osmo-bsc/gsm_04_08_rr.c M src/osmo-bsc/gsm_data.c M src/osmo-bsc/gsm_timers.c M src/osmo-bsc/handover_decision.c M src/osmo-bsc/handover_decision_2.c A src/osmo-bsc/handover_fsm.c M src/osmo-bsc/handover_logic.c A src/osmo-bsc/lchan_fsm.c A src/osmo-bsc/lchan_select.c M src/osmo-bsc/meas_feed.c A src/osmo-bsc/mgw_endpoint_fsm.c M src/osmo-bsc/osmo_bsc_api.c D src/osmo-bsc/osmo_bsc_audio.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_ctrl.c M src/osmo-bsc/osmo_bsc_filter.c M src/osmo-bsc/osmo_bsc_grace.c M src/osmo-bsc/osmo_bsc_lcls.c M src/osmo-bsc/osmo_bsc_main.c M src/osmo-bsc/osmo_bsc_sigtran.c M src/osmo-bsc/paging.c M src/osmo-bsc/pcu_sock.c M src/osmo-bsc/system_information.c A src/osmo-bsc/timeslot_fsm.c M src/utils/Makefile.am M src/utils/bs11_config.c M src/utils/meas_json.c D src/utils/stubs.c M tests/abis/abis_test.c M tests/bsc/Makefile.am M tests/bsc/bsc_test.c M tests/codec_pref/codec_pref_test.c M tests/codec_pref/codec_pref_test.ok M tests/gsm0408/gsm0408_test.c M tests/handover/Makefile.am M tests/handover/handover_test.c M tests/handover/neighbor_ident_test.c M tests/nanobts_omlattr/nanobts_omlattr_test.c 75 files changed, 8,463 insertions(+), 4,783 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/71/9671/36 -- To view, visit https://gerrit.osmocom.org/9671 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I82e3f918295daa83274a4cf803f046979f284366 Gerrit-Change-Number: 9671 Gerrit-PatchSet: 36 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 16:13:29 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 16:13:29 +0000 Subject: Change in osmo-bsc[master]: lchan_fsm: split off lchan_rtp_fsm, establish RTP a bit earlier In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10103 to look at the new patch set (#4). Change subject: lchan_fsm: split off lchan_rtp_fsm, establish RTP a bit earlier ...................................................................... lchan_fsm: split off lchan_rtp_fsm, establish RTP a bit earlier Change-Id: Id7a4407d9b63be05ce63f5f2768b7d7e3d5c86fb --- M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/lchan_fsm.h A include/osmocom/bsc/lchan_rtp_fsm.h M src/osmo-bsc/Makefile.am M src/osmo-bsc/abis_rsl.c M src/osmo-bsc/bsc_subscr_conn_fsm.c M src/osmo-bsc/handover_fsm.c M src/osmo-bsc/lchan_fsm.c A src/osmo-bsc/lchan_rtp_fsm.c M tests/handover/Makefile.am M tests/handover/handover_test.c 12 files changed, 1,038 insertions(+), 481 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/03/10103/4 -- To view, visit https://gerrit.osmocom.org/10103 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id7a4407d9b63be05ce63f5f2768b7d7e3d5c86fb Gerrit-Change-Number: 10103 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 16:13:32 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 16:13:32 +0000 Subject: Change in osmo-bsc[master]: rename gsm_04_08_utils.[hc] to gsm_04_08_rr Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10145 Change subject: rename gsm_04_08_utils.[hc] to gsm_04_08_rr ...................................................................... rename gsm_04_08_utils.[hc] to gsm_04_08_rr "utils" suggests thin helpers to aid using a proper API, while this .c file actually *is* the proper RR API. Rename from "utils" to "rr". Change-Id: I0ffff63d57f03cb324df8e40e41caea5b55a2c85 --- M include/osmocom/bsc/Makefile.am R include/osmocom/bsc/gsm_04_08_rr.h M src/libfilter/bsc_msg_filter.c M src/osmo-bsc/Makefile.am M src/osmo-bsc/abis_rsl.c M src/osmo-bsc/bsc_api.c M src/osmo-bsc/bsc_init.c M src/osmo-bsc/bsc_vty.c M src/osmo-bsc/chan_alloc.c R src/osmo-bsc/gsm_04_08_rr.c M src/osmo-bsc/handover_logic.c M src/osmo-bsc/net_init.c M src/osmo-bsc/osmo_bsc_api.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_filter.c M src/osmo-bsc/paging.c M src/osmo-bsc/pcu_sock.c M src/osmo-bsc/system_information.c M tests/bsc/Makefile.am M tests/handover/Makefile.am 20 files changed, 20 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/45/10145/1 diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am index 0b576cd..1e26c34 100644 --- a/include/osmocom/bsc/Makefile.am +++ b/include/osmocom/bsc/Makefile.am @@ -16,7 +16,7 @@ ctrl.h \ debug.h \ e1_config.h \ - gsm_04_08_utils.h \ + gsm_04_08_rr.h \ gsm_04_80.h \ gsm_data.h \ handover.h \ diff --git a/include/osmocom/bsc/gsm_04_08_utils.h b/include/osmocom/bsc/gsm_04_08_rr.h similarity index 100% rename from include/osmocom/bsc/gsm_04_08_utils.h rename to include/osmocom/bsc/gsm_04_08_rr.h diff --git a/src/libfilter/bsc_msg_filter.c b/src/libfilter/bsc_msg_filter.c index bcabc24..1318689 100644 --- a/src/libfilter/bsc_msg_filter.c +++ b/src/libfilter/bsc_msg_filter.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am index bf7ef11..0bc78d5 100644 --- a/src/osmo-bsc/Makefile.am +++ b/src/osmo-bsc/Makefile.am @@ -55,7 +55,7 @@ chan_alloc.c \ codec_pref.c \ e1_config.c \ - gsm_04_08_utils.c \ + gsm_04_08_rr.c \ gsm_04_80_utils.c \ gsm_data.c \ handover_cfg.c \ diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c index bcc56bc..c4e5292 100644 --- a/src/osmo-bsc/abis_rsl.c +++ b/src/osmo-bsc/abis_rsl.c @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/osmo-bsc/bsc_api.c b/src/osmo-bsc/bsc_api.c index 35e6977..2ce8d3b 100644 --- a/src/osmo-bsc/bsc_api.c +++ b/src/osmo-bsc/bsc_api.c @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/osmo-bsc/bsc_init.c b/src/osmo-bsc/bsc_init.c index 641b6db..b1388b8 100644 --- a/src/osmo-bsc/bsc_init.c +++ b/src/osmo-bsc/bsc_init.c @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c index b1e6d78..b187704 100644 --- a/src/osmo-bsc/bsc_vty.c +++ b/src/osmo-bsc/bsc_vty.c @@ -59,7 +59,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/osmo-bsc/chan_alloc.c b/src/osmo-bsc/chan_alloc.c index cec5846..c73ecb7 100644 --- a/src/osmo-bsc/chan_alloc.c +++ b/src/osmo-bsc/chan_alloc.c @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include diff --git a/src/osmo-bsc/gsm_04_08_utils.c b/src/osmo-bsc/gsm_04_08_rr.c similarity index 99% rename from src/osmo-bsc/gsm_04_08_utils.c rename to src/osmo-bsc/gsm_04_08_rr.c index c548500..64eace7 100644 --- a/src/osmo-bsc/gsm_04_08_utils.c +++ b/src/osmo-bsc/gsm_04_08_rr.c @@ -35,7 +35,7 @@ #include #include #include -#include +#include /* should ip.access BTS use direct RTP streams between each other (1), * or should OpenBSC always act as RTP relay/proxy in between (0) ? */ diff --git a/src/osmo-bsc/handover_logic.c b/src/osmo-bsc/handover_logic.c index 0f664c6..9622066 100644 --- a/src/osmo-bsc/handover_logic.c +++ b/src/osmo-bsc/handover_logic.c @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/osmo-bsc/net_init.c b/src/osmo-bsc/net_init.c index db3d01c..208b4ef 100644 --- a/src/osmo-bsc/net_init.c +++ b/src/osmo-bsc/net_init.c @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/osmo-bsc/osmo_bsc_api.c b/src/osmo-bsc/osmo_bsc_api.c index d409c93..1ce9194 100644 --- a/src/osmo-bsc/osmo_bsc_api.c +++ b/src/osmo-bsc/osmo_bsc_api.c @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 887a866..60c858f 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/osmo-bsc/osmo_bsc_filter.c b/src/osmo-bsc/osmo_bsc_filter.c index 0d0fc29..773a146 100644 --- a/src/osmo-bsc/osmo_bsc_filter.c +++ b/src/osmo-bsc/osmo_bsc_filter.c @@ -22,11 +22,11 @@ #include #include #include -#include +#include #include #include #include -#include +#include #include diff --git a/src/osmo-bsc/paging.c b/src/osmo-bsc/paging.c index feb9fea..7e833d3 100644 --- a/src/osmo-bsc/paging.c +++ b/src/osmo-bsc/paging.c @@ -50,7 +50,7 @@ #include #include #include -#include +#include void *tall_paging_ctx = NULL; diff --git a/src/osmo-bsc/pcu_sock.c b/src/osmo-bsc/pcu_sock.c index 8a3c331..82d01e1 100644 --- a/src/osmo-bsc/pcu_sock.c +++ b/src/osmo-bsc/pcu_sock.c @@ -43,7 +43,7 @@ #include #include #include -#include +#include static int pcu_sock_send(struct gsm_bts *bts, struct msgb *msg); uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx); diff --git a/src/osmo-bsc/system_information.c b/src/osmo-bsc/system_information.c index 3c0c76c..caf29ec 100644 --- a/src/osmo-bsc/system_information.c +++ b/src/osmo-bsc/system_information.c @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include diff --git a/tests/bsc/Makefile.am b/tests/bsc/Makefile.am index 2e34d79..6ffeed2 100644 --- a/tests/bsc/Makefile.am +++ b/tests/bsc/Makefile.am @@ -40,7 +40,7 @@ $(top_builddir)/src/osmo-bsc/bsc_rll.o \ $(top_builddir)/src/osmo-bsc/bsc_subscriber.o \ $(top_builddir)/src/osmo-bsc/chan_alloc.o \ - $(top_builddir)/src/osmo-bsc/gsm_04_08_utils.o \ + $(top_builddir)/src/osmo-bsc/gsm_04_08_rr.o \ $(top_builddir)/src/osmo-bsc/gsm_04_80_utils.o \ $(top_builddir)/src/osmo-bsc/gsm_data.o \ $(top_builddir)/src/osmo-bsc/handover_cfg.o \ diff --git a/tests/handover/Makefile.am b/tests/handover/Makefile.am index 140d8ff..f8c2664 100644 --- a/tests/handover/Makefile.am +++ b/tests/handover/Makefile.am @@ -51,7 +51,7 @@ $(top_builddir)/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.o \ $(top_builddir)/src/osmo-bsc/bts_sysmobts.o \ $(top_builddir)/src/osmo-bsc/chan_alloc.o \ - $(top_builddir)/src/osmo-bsc/gsm_04_08_utils.o \ + $(top_builddir)/src/osmo-bsc/gsm_04_08_rr.o \ $(top_builddir)/src/osmo-bsc/gsm_04_80_utils.o \ $(top_builddir)/src/osmo-bsc/gsm_data.o \ $(top_builddir)/src/osmo-bsc/handover_cfg.o \ -- To view, visit https://gerrit.osmocom.org/10145 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I0ffff63d57f03cb324df8e40e41caea5b55a2c85 Gerrit-Change-Number: 10145 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 16:13:32 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 16:13:32 +0000 Subject: Change in osmo-bsc[master]: cosmetic: dissolve bsc_api.c Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10146 Change subject: cosmetic: dissolve bsc_api.c ...................................................................... cosmetic: dissolve bsc_api.c gsm0808_page() is just a thin wrapper for rsl_paging_cmd(), the only caller is page_ms() from paging.c. Directly call rsl_paging_cmd() instead. Move gsm0808_cipher_mode() to the only caller in osmo_bsc_bssap.c, make static. Change-Id: Ib7ce026b52d4ba3e53a8b2824e74ea92432c48c5 --- M include/osmocom/bsc/bsc_api.h M src/osmo-bsc/Makefile.am D src/osmo-bsc/bsc_api.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/paging.c M tests/handover/Makefile.am 6 files changed, 29 insertions(+), 82 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/46/10146/1 diff --git a/include/osmocom/bsc/bsc_api.h b/include/osmocom/bsc/bsc_api.h index bc6c676..dcfcc45 100644 --- a/include/osmocom/bsc/bsc_api.h +++ b/include/osmocom/bsc/bsc_api.h @@ -20,10 +20,6 @@ int gsm0808_submit_dtap(struct gsm_subscriber_connection *conn, struct msgb *msg, uint8_t link_id, bool allow_sacch); int gsm0808_assign_req(struct gsm_subscriber_connection *conn, int chan_mode, int full_rate); -int gsm0808_cipher_mode(struct gsm_subscriber_connection *conn, int cipher, - const uint8_t *key, int len, int include_imeisv); -int gsm0808_page(struct gsm_bts *bts, unsigned int page_group, - unsigned int mi_len, uint8_t *mi, int chan_type); int gsm0808_clear(struct gsm_subscriber_connection *conn); bool msc_connected(struct gsm_subscriber_connection *conn); diff --git a/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am index e9add36..2d479c1 100644 --- a/src/osmo-bsc/Makefile.am +++ b/src/osmo-bsc/Makefile.am @@ -35,7 +35,6 @@ acc_ramp.c \ arfcn_range_encode.c \ assignment_fsm.c \ - bsc_api.c \ bsc_ctrl_commands.c \ bsc_ctrl_lookup.c \ bsc_init.c \ diff --git a/src/osmo-bsc/bsc_api.c b/src/osmo-bsc/bsc_api.c deleted file mode 100644 index e5424c4..0000000 --- a/src/osmo-bsc/bsc_api.c +++ /dev/null @@ -1,75 +0,0 @@ -/* GSM 08.08 like API for OpenBSC. The bridge from MSC to BSC */ - -/* (C) 2010-2011 by Holger Hans Peter Freyther - * (C) 2010-2011 by On-Waves - * (C) 2009,2017 by Harald Welte - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include - -int gsm0808_page(struct gsm_bts *bts, unsigned int page_group, unsigned int mi_len, - uint8_t *mi, int chan_type) -{ - return rsl_paging_cmd(bts, page_group, mi_len, mi, chan_type, false); -} - -/*! \brief We received a GSM 08.08 CIPHER MODE from the MSC */ -int gsm0808_cipher_mode(struct gsm_subscriber_connection *conn, int cipher, - const uint8_t *key, int len, int include_imeisv) -{ - if (cipher > 0 && key == NULL) { - LOGP(DRSL, LOGL_ERROR, "%s: Need to have an encryption key.\n", - bsc_subscr_name(conn->bsub)); - return -1; - } - - if (len > MAX_A5_KEY_LEN) { - LOGP(DRSL, LOGL_ERROR, "%s: The key is too long: %d\n", - bsc_subscr_name(conn->bsub), len); - return -1; - } - - LOGP(DRSL, LOGL_DEBUG, "(subscr %s) Cipher Mode: cipher=%d key=%s include_imeisv=%d\n", - bsc_subscr_name(conn->bsub), cipher, osmo_hexdump_nospc(key, len), include_imeisv); - - conn->lchan->encr.alg_id = RSL_ENC_ALG_A5(cipher); - if (key) { - conn->lchan->encr.key_len = len; - memcpy(conn->lchan->encr.key, key, len); - } - - return gsm48_send_rr_ciph_mode(conn->lchan, include_imeisv); -} diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index c6fbe23..95bad7b 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -386,6 +386,34 @@ return -1; } +/*! We received a GSM 08.08 CIPHER MODE from the MSC */ +static int gsm0808_cipher_mode(struct gsm_subscriber_connection *conn, int cipher, + const uint8_t *key, int len, int include_imeisv) +{ + if (cipher > 0 && key == NULL) { + LOGP(DRSL, LOGL_ERROR, "%s: Need to have an encryption key.\n", + bsc_subscr_name(conn->bsub)); + return -1; + } + + if (len > MAX_A5_KEY_LEN) { + LOGP(DRSL, LOGL_ERROR, "%s: The key is too long: %d\n", + bsc_subscr_name(conn->bsub), len); + return -1; + } + + LOGP(DRSL, LOGL_DEBUG, "(subscr %s) Cipher Mode: cipher=%d key=%s include_imeisv=%d\n", + bsc_subscr_name(conn->bsub), cipher, osmo_hexdump_nospc(key, len), include_imeisv); + + conn->lchan->encr.alg_id = RSL_ENC_ALG_A5(cipher); + if (key) { + conn->lchan->encr.key_len = len; + memcpy(conn->lchan->encr.key, key, len); + } + + return gsm48_send_rr_ciph_mode(conn->lchan, include_imeisv); +} + /* * GSM 08.08 ? 3.4.7 cipher mode handling. We will have to pick * the cipher to be used for this. In case we are already using diff --git a/src/osmo-bsc/paging.c b/src/osmo-bsc/paging.c index bc1927e..0ef89c1 100644 --- a/src/osmo-bsc/paging.c +++ b/src/osmo-bsc/paging.c @@ -96,7 +96,7 @@ page_group = gsm0502_calc_paging_group(&bts->si_common.chan_desc, str_to_imsi(request->bsub->imsi)); - gsm0808_page(bts, page_group, mi_len, mi, request->chan_type); + rsl_paging_cmd(bts, page_group, mi_len, mi, request->chan_type, false); log_set_context(LOG_CTX_BSC_SUBSCR, NULL); } diff --git a/tests/handover/Makefile.am b/tests/handover/Makefile.am index 3ce870b..5e9af04 100644 --- a/tests/handover/Makefile.am +++ b/tests/handover/Makefile.am @@ -43,7 +43,6 @@ $(top_builddir)/src/osmo-bsc/abis_rsl.o \ $(top_builddir)/src/osmo-bsc/arfcn_range_encode.o \ $(top_builddir)/src/osmo-bsc/assignment_fsm.o \ - $(top_builddir)/src/osmo-bsc/bsc_api.o \ $(top_builddir)/src/osmo-bsc/bsc_init.o \ $(top_builddir)/src/osmo-bsc/bsc_rll.o \ $(top_builddir)/src/osmo-bsc/bsc_subscr_conn_fsm.o \ -- To view, visit https://gerrit.osmocom.org/10146 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ib7ce026b52d4ba3e53a8b2824e74ea92432c48c5 Gerrit-Change-Number: 10146 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 16:13:32 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 16:13:32 +0000 Subject: Change in osmo-bsc[master]: cosmetic: reduce bsc_api.h Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10147 Change subject: cosmetic: reduce bsc_api.h ...................................................................... cosmetic: reduce bsc_api.h Remove as much as possible from bsc_api.h. Use '#pragma once'. Tweak head comment. BSC_API_CONN_POL_{ACCEPT,REJECT}: only user is static complete_layer3(), just use a bool return value instead. msc_connected(): only used in osmo_bsc_api.c, make static there. Instead of including gsm_data.h, declare structs opaquely, include stdint.h. codec_pref_test.c used this as indirect gsm_data.h include via osmo_bsc.h, include gsm_data.h there directly. osmo_bsc.h: instead of including bsc_api.h, declare opaque structs. gsm_04_08_rr.h: declare opaque structs to replace indirect include of gsm_data.h. Change-Id: Ia9c0f9828317236048e40ec9ecf9990592e2190a --- M include/osmocom/bsc/bsc_api.h M include/osmocom/bsc/gsm_04_08_rr.h M include/osmocom/bsc/osmo_bsc.h M src/osmo-bsc/osmo_bsc_api.c 4 files changed, 30 insertions(+), 25 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/47/10147/1 diff --git a/include/osmocom/bsc/bsc_api.h b/include/osmocom/bsc/bsc_api.h index dcfcc45..5241295 100644 --- a/include/osmocom/bsc/bsc_api.h +++ b/include/osmocom/bsc/bsc_api.h @@ -1,12 +1,10 @@ -/* GSM 08.08 like API for OpenBSC */ +/* GSM 08.08 function declarations for osmo-bsc */ -#ifndef OPENBSC_BSC_API_H -#define OPENBSC_BSC_API_H +#pragma once -#include "gsm_data.h" +#include -#define BSC_API_CONN_POL_ACCEPT 0 -#define BSC_API_CONN_POL_REJECT 1 +struct gsm_subscriber_connection; void bsc_sapi_n_reject(struct gsm_subscriber_connection *conn, int dlci); void bsc_cipher_mode_compl(struct gsm_subscriber_connection *conn, struct msgb *msg, uint8_t chosen_encr); @@ -16,11 +14,3 @@ void bsc_cm_update(struct gsm_subscriber_connection *conn, const uint8_t *cm2, uint8_t cm2_len, const uint8_t *cm3, uint8_t cm3_len); - -int gsm0808_submit_dtap(struct gsm_subscriber_connection *conn, struct msgb *msg, uint8_t link_id, - bool allow_sacch); -int gsm0808_assign_req(struct gsm_subscriber_connection *conn, int chan_mode, int full_rate); -int gsm0808_clear(struct gsm_subscriber_connection *conn); - -bool msc_connected(struct gsm_subscriber_connection *conn); -#endif diff --git a/include/osmocom/bsc/gsm_04_08_rr.h b/include/osmocom/bsc/gsm_04_08_rr.h index 63bec7a..8f46922 100644 --- a/include/osmocom/bsc/gsm_04_08_rr.h +++ b/include/osmocom/bsc/gsm_04_08_rr.h @@ -1,5 +1,18 @@ #pragma once +#include + +struct amr_mode; +struct amr_multirate_conf; +struct bsc_subscr; +struct gsm48_chan_desc; +struct gsm48_pag_resp; +struct gsm_lchan; +struct gsm_meas_rep; +struct gsm_network; +struct gsm_subscriber_connection; +struct msgb; + void gsm_net_update_ctype(struct gsm_network *network); enum gsm_chan_t get_ctype_by_chreq(struct gsm_network *network, uint8_t ra); int get_reason_by_chreq(uint8_t ra, int neci); diff --git a/include/osmocom/bsc/osmo_bsc.h b/include/osmocom/bsc/osmo_bsc.h index 0e19b0b..bebfb2f 100644 --- a/include/osmocom/bsc/osmo_bsc.h +++ b/include/osmocom/bsc/osmo_bsc.h @@ -2,7 +2,6 @@ #include -#include #include #define BSS_SEND_USSD 1 @@ -18,6 +17,8 @@ struct gsm0808_channel_type; struct gsm0808_speech_codec_list; struct gsm_audio_support; +struct gsm_subscriber_connection; +struct gsm_bts; struct bsc_api *osmo_bsc_api(); diff --git a/src/osmo-bsc/osmo_bsc_api.c b/src/osmo-bsc/osmo_bsc_api.c index b4d080d..dfec19a 100644 --- a/src/osmo-bsc/osmo_bsc_api.c +++ b/src/osmo-bsc/osmo_bsc_api.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -36,7 +37,7 @@ #include /* Check if we have a proper connection to the MSC */ -bool msc_connected(struct gsm_subscriber_connection *conn) +static bool msc_connected(struct gsm_subscriber_connection *conn) { /* No subscriber conn at all */ if (!conn) @@ -53,8 +54,8 @@ return true; } -static int complete_layer3(struct gsm_subscriber_connection *conn, - struct msgb *msg, struct bsc_msc_data *msc); +static bool complete_layer3(struct gsm_subscriber_connection *conn, + struct msgb *msg, struct bsc_msc_data *msc); static struct osmo_cell_global_id *cgi_for_msc(struct bsc_msc_data *msc, struct gsm_bts *bts) { @@ -438,8 +439,8 @@ return 0; } -static int complete_layer3(struct gsm_subscriber_connection *conn, - struct msgb *msg, struct bsc_msc_data *msc) +static bool complete_layer3(struct gsm_subscriber_connection *conn, + struct msgb *msg, struct bsc_msc_data *msc) { int con_type, rc, lu_cause; char *imsi = NULL; @@ -451,7 +452,7 @@ &imsi, &con_type, &lu_cause); if (rc < 0) { bsc_maybe_lu_reject(conn, con_type, lu_cause); - return BSC_API_CONN_POL_REJECT; + return false; } /* allocate resource for a new connection */ @@ -464,7 +465,7 @@ else if (ret == BSC_CON_REJECT_RF_GRACE) bsc_send_ussd_no_srv(conn, msg, msc->ussd_grace_txt); - return BSC_API_CONN_POL_REJECT; + return false; } /* TODO: also extract TMSI. We get an IMSI only when an initial L3 Complete comes in that @@ -493,12 +494,12 @@ resp = gsm0808_create_layer3_2(msg, cgi_for_msc(conn->sccp.msc, conn_get_bts(conn)), NULL); if (!resp) { LOGP(DMSC, LOGL_DEBUG, "Failed to create layer3 message.\n"); - return BSC_API_CONN_POL_REJECT; + return false; } osmo_fsm_inst_dispatch(conn->fi, GSCON_EV_A_CONN_REQ, resp); - return BSC_API_CONN_POL_ACCEPT; + return true; } /* @@ -519,7 +520,7 @@ * MSC. If it fails the caller will need to handle this * properly. */ - if (complete_layer3(_conn, msg, msc) != BSC_API_CONN_POL_ACCEPT) { + if (!complete_layer3(_conn, msg, msc)) { /* FIXME: I have not the slightest idea what move_to_msc() intends to do; during lchan * FSM introduction, I changed this and hope it is the appropriate action. I actually * assume this is unused legacy code for osmo-bsc_nat?? */ -- To view, visit https://gerrit.osmocom.org/10147 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ia9c0f9828317236048e40ec9ecf9990592e2190a Gerrit-Change-Number: 10147 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 16:13:33 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 16:13:33 +0000 Subject: Change in osmo-bsc[master]: cosmetic: rename bsc_api.h to gsm_08_08.h Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10148 Change subject: cosmetic: rename bsc_api.h to gsm_08_08.h ...................................................................... cosmetic: rename bsc_api.h to gsm_08_08.h See also I91922f557072d0fb8cfe213a8a7b50f3bb23dea0, which renames osmo_bsc_api.c to gsm_08_08.c. Change-Id: I7179eb27183ee213f8fc8d548895b67aa43dc6a2 --- M include/osmocom/bsc/Makefile.am R include/osmocom/bsc/gsm_08_08.h M src/osmo-bsc/abis_rsl.c M src/osmo-bsc/assignment_fsm.c M src/osmo-bsc/bsc_subscr_conn_fsm.c M src/osmo-bsc/gsm_04_08_rr.c M src/osmo-bsc/osmo_bsc_api.c M src/osmo-bsc/paging.c M tests/codec_pref/codec_pref_test.c M tests/handover/handover_test.c 10 files changed, 9 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/48/10148/1 diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am index 57837ec..02a4ad8 100644 --- a/include/osmocom/bsc/Makefile.am +++ b/include/osmocom/bsc/Makefile.am @@ -54,7 +54,7 @@ timeslot_fsm.h \ ussd.h \ vty.h \ - bsc_api.h \ + gsm_08_08.h \ penalty_timers.h \ osmo_bsc_lcls.h \ $(NULL) diff --git a/include/osmocom/bsc/bsc_api.h b/include/osmocom/bsc/gsm_08_08.h similarity index 100% rename from include/osmocom/bsc/bsc_api.h rename to include/osmocom/bsc/gsm_08_08.h diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c index 3e9634e..767f8cb 100644 --- a/src/osmo-bsc/abis_rsl.c +++ b/src/osmo-bsc/abis_rsl.c @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/osmo-bsc/assignment_fsm.c b/src/osmo-bsc/assignment_fsm.c index e37ec9c..41615ac 100644 --- a/src/osmo-bsc/assignment_fsm.c +++ b/src/osmo-bsc/assignment_fsm.c @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c b/src/osmo-bsc/bsc_subscr_conn_fsm.c index bd41761..60a9a75 100644 --- a/src/osmo-bsc/bsc_subscr_conn_fsm.c +++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/osmo-bsc/gsm_04_08_rr.c b/src/osmo-bsc/gsm_04_08_rr.c index 8950d93..2b4a1ba 100644 --- a/src/osmo-bsc/gsm_04_08_rr.c +++ b/src/osmo-bsc/gsm_04_08_rr.c @@ -39,7 +39,7 @@ #include #include #include -#include +#include /* should ip.access BTS use direct RTP streams between each other (1), * or should OpenBSC always act as RTP relay/proxy in between (0) ? */ diff --git a/src/osmo-bsc/osmo_bsc_api.c b/src/osmo-bsc/osmo_bsc_api.c index dfec19a..d1a6a96 100644 --- a/src/osmo-bsc/osmo_bsc_api.c +++ b/src/osmo-bsc/osmo_bsc_api.c @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/osmo-bsc/paging.c b/src/osmo-bsc/paging.c index 0ef89c1..afe3245 100644 --- a/src/osmo-bsc/paging.c +++ b/src/osmo-bsc/paging.c @@ -49,7 +49,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tests/codec_pref/codec_pref_test.c b/tests/codec_pref/codec_pref_test.c index 0f908e5..b0b9f5e 100644 --- a/tests/codec_pref/codec_pref_test.c +++ b/tests/codec_pref/codec_pref_test.c @@ -19,6 +19,7 @@ * */ +#include #include #include #include diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c index 8f2305a..73d0b5b 100644 --- a/tests/handover/handover_test.c +++ b/tests/handover/handover_test.c @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include #include -- To view, visit https://gerrit.osmocom.org/10148 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I7179eb27183ee213f8fc8d548895b67aa43dc6a2 Gerrit-Change-Number: 10148 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 16:13:33 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 16:13:33 +0000 Subject: Change in osmo-bsc[master]: cosmetic: rename osmo_bsc_api.c to gsm_08_08.c Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10149 Change subject: cosmetic: rename osmo_bsc_api.c to gsm_08_08.c ...................................................................... cosmetic: rename osmo_bsc_api.c to gsm_08_08.c Change-Id: I91922f557072d0fb8cfe213a8a7b50f3bb23dea0 --- M src/osmo-bsc/Makefile.am R src/osmo-bsc/gsm_08_08.c 2 files changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/49/10149/1 diff --git a/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am index 2d479c1..364228d 100644 --- a/src/osmo-bsc/Makefile.am +++ b/src/osmo-bsc/Makefile.am @@ -74,7 +74,7 @@ neighbor_ident.c \ neighbor_ident_vty.c \ net_init.c \ - osmo_bsc_api.c \ + gsm_08_08.c \ osmo_bsc_bssap.c \ osmo_bsc_ctrl.c \ osmo_bsc_filter.c \ diff --git a/src/osmo-bsc/osmo_bsc_api.c b/src/osmo-bsc/gsm_08_08.c similarity index 100% rename from src/osmo-bsc/osmo_bsc_api.c rename to src/osmo-bsc/gsm_08_08.c -- To view, visit https://gerrit.osmocom.org/10149 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I91922f557072d0fb8cfe213a8a7b50f3bb23dea0 Gerrit-Change-Number: 10149 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 16:18:14 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 16:18:14 +0000 Subject: Change in osmo-bsc[master]: cosmetic: move RR functions from bsc_api.c to gsm_04_08_rr.c In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9669 ) Change subject: cosmetic: move RR functions from bsc_api.c to gsm_04_08_rr.c ...................................................................... Patch Set 13: this patch is now only removing the rr functions from bsc_api.c, see commit log -- To view, visit https://gerrit.osmocom.org/9669 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie8ee334145bf7bc3a601d395ea7ab9b2009b61c7 Gerrit-Change-Number: 9669 Gerrit-PatchSet: 13 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte Gerrit-Comment-Date: Tue, 24 Jul 2018 16:18:14 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 16:22:12 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 24 Jul 2018 16:22:12 +0000 Subject: Change in osmo-sysmon[master]: git-version-gen: Don't check for .git directory In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10138 ) Change subject: git-version-gen: Don't check for .git directory ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/10138/1/git-version-gen File git-version-gen: https://gerrit.osmocom.org/#/c/10138/1/git-version-gen at a95 PS1, Line 95: Is .git a symlink in your case? It probably makes sense to still check for existence of .git. -- To view, visit https://gerrit.osmocom.org/10138 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sysmon Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I414111b27db9951314e6bc7eff8bc1f10775b3ff Gerrit-Change-Number: 10138 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 24 Jul 2018 16:22:12 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 16:22:33 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 24 Jul 2018 16:22:33 +0000 Subject: Change in libosmo-sccp[master]: git-version-gen: Don't check for .git directory In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10139 ) Change subject: git-version-gen: Don't check for .git directory ...................................................................... Patch Set 1: Is .git a symlink in your case? It probably makes sense to still check for existence of .git. -- To view, visit https://gerrit.osmocom.org/10139 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic14561f3b041bb94d1b60e477b18e37077ce4c32 Gerrit-Change-Number: 10139 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 24 Jul 2018 16:22:33 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 16:31:26 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 24 Jul 2018 16:31:26 +0000 Subject: Change in osmo-gsm-tester[master]: ms: Quit early when all tests concluded.. In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/9716 ) Change subject: ms: Quit early when all tests concluded.. ...................................................................... Patch Set 4: Jenkins builds are failing because osmo-sgsn triggers ASAN triggers or crashes. It should be fixed once https://gerrit.osmocom.org/#/c/osmo-sgsn/+/10025/ is merged and built. We can then re-trigger these jobs and merge them. Sorry for the inconvenience, I didn't notice the -1 till today. -- To view, visit https://gerrit.osmocom.org/9716 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3575ee7618c35e3b66d25fa31844d267489d9179 Gerrit-Change-Number: 9716 Gerrit-PatchSet: 4 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 24 Jul 2018 16:31:26 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 16:36:51 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Tue, 24 Jul 2018 16:36:51 +0000 Subject: Change in osmo-sysmon[master]: git-version-gen: Don't check for .git directory In-Reply-To: References: Message-ID: daniel has posted comments on this change. ( https://gerrit.osmocom.org/10138 ) Change subject: git-version-gen: Don't check for .git directory ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/10138/1/git-version-gen File git-version-gen: https://gerrit.osmocom.org/#/c/10138/1/git-version-gen at a95 PS1, Line 95: > Is .git a symlink in your case? It probably makes sense to still check for existence of .git. Not in the filesystem sense, it is a regular file: daniel at adrastea:~/scm/osmo/onwaves/osmo-sgsn(daniel/onwaves) ? cat .git gitdir: /home/daniel/scm/osmo/master/osmo-sgsn/.git/worktrees/osmo-sgsn As I said libosmocore, libosmo-netif, libosmo-abis, osmo-bts, osmo-hlr, .... all don't have this check for .git. We should either add a check everywhere or remove it completely. We could just use a newer git-version-gen like the one from https://github.com/agordon/autotools-scripts/blob/master/config/git-version-gen which uses test "`git log -1 --pretty=format:x . 2>&1`" = x to verify that there is a git repo with a commit. But even without that check git-version-gen reports UNKNOWN if run from a non-git-repo. -- To view, visit https://gerrit.osmocom.org/10138 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sysmon Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I414111b27db9951314e6bc7eff8bc1f10775b3ff Gerrit-Change-Number: 10138 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 24 Jul 2018 16:36:51 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 16:36:55 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 24 Jul 2018 16:36:55 +0000 Subject: Change in osmo-gsm-tester[master]: resources.conf.prod: add calypso SIM data (commented) In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10132 ) Change subject: resources.conf.prod: add calypso SIM data (commented) ...................................................................... Patch Set 1: Code-Review-1 As I said in iRC, I don't really understand what these sim cards are to be used for, since the motorola c123 doesn't use the HW simcard. The IMSi and alike are provided by TTCN3 code through osmocon. -- To view, visit https://gerrit.osmocom.org/10132 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iafe42f743a2a09a81d421764aae578e4a280eae0 Gerrit-Change-Number: 10132 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 24 Jul 2018 16:36:55 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 16:38:02 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 24 Jul 2018 16:38:02 +0000 Subject: Change in osmo-sysmon[master]: git-version-gen: Don't check for .git directory In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10138 ) Change subject: git-version-gen: Don't check for .git directory ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10138 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sysmon Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I414111b27db9951314e6bc7eff8bc1f10775b3ff Gerrit-Change-Number: 10138 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel Gerrit-Comment-Date: Tue, 24 Jul 2018 16:38:02 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 16:41:35 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 16:41:35 +0000 Subject: Change in osmo-bsc[master]: cosmetic: move RR functions from bsc_api.c to gsm_04_08_rr.c In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9669 to look at the new patch set (#14). Change subject: cosmetic: move RR functions from bsc_api.c to gsm_04_08_rr.c ...................................................................... cosmetic: move RR functions from bsc_api.c to gsm_04_08_rr.c Rationale: bsc_api.c used to be a kind of kitchen sink for various implementations, we want to dissolve it. Also, combining 0808 and 0408 in the same c file causes "weird" linking dependencies for utility and test programs. bsc_api.c will be completely dissolved in upcoming Ib7ce026b52d4ba3e53a8b2824e74ea92432c48c5. Change-Id: Ie8ee334145bf7bc3a601d395ea7ab9b2009b61c7 --- M include/osmocom/bsc/bsc_api.h M include/osmocom/bsc/gsm_04_08_rr.h M src/osmo-bsc/bsc_api.c M src/osmo-bsc/gsm_04_08_rr.c 4 files changed, 309 insertions(+), 307 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/69/9669/14 -- To view, visit https://gerrit.osmocom.org/9669 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie8ee334145bf7bc3a601d395ea7ab9b2009b61c7 Gerrit-Change-Number: 9669 Gerrit-PatchSet: 14 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 16:41:35 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 16:41:35 +0000 Subject: Change in osmo-bsc[master]: large refactoring: use FSMs for lchans; add inter-BSC HO In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9671 to look at the new patch set (#37). Change subject: large refactoring: use FSMs for lchans; add inter-BSC HO ...................................................................... large refactoring: use FSMs for lchans; add inter-BSC HO Add FSMs: - timeslot_fsm: handle dynamic timeslots and OML+RSL availability. - lchan_fsm: handle an individual lchan activation, RTP stream and release, signal the appropriate calling FSMs on success, failure, release. - mgw_endpoint_fsm: handle one entire endpoint with several CI. - assignment_fsm: BSSMAP Assignment Request. - handover_fsm: all of intra, inter-MO and inter-MT handover. Above FSMs absorb large parts of the gscon FSM. The gscon FSM was surpassing the maximum amount events (32), and it is more logical to treat assignment, handover and MGW procedures in separate FSMs. - Add logging macros for each FSM type: - LOG_TS() - LOG_LCHAN() - LOG_MGWEP(), LOG_CI() - LOG_ASSIGNMENT() - LOG_HO() These log with the osmo_fsm_inst where present. New style decision: logging without a final newline char is awkward, especially for gsmtap logging and when other logs interleave LOGPC() calls; we have various cases where the final \n goes missing, and also this invokes the log category checking N times instead of once. So I decided to make these macros *always* append a newline, but only if there is no final newline yet. I hope that the compiler optimizes the strlen() of the constant format strings away. Thus I can log with or without typing "\n" and always get an \n termination anyway. General: - replace osmo_timers, state enums and program-wide osmo_signal_dispatch() with dedicated FSM timeouts, states and events. - introduce a common way to handle Tnnn timers: gsm_timers.h/.c: struct T_def. These can be used (with some macro magic) to define a state's timeout once, and not make mistakes for each osmo_fsm_inst_state_chg(). Details: bsc_subscr_conn_fsm.c: - move most states of this FSM to lchan_fsm, assignment_fsm, handover_fsm and mgw_endpoint_fsm. - There is exactly one state for an ongoing Assignment, with all details handled in conn->assignment.fi. The state relies on the assignment_fsm's timeout. - There is one state for an ongoing Handover; except for an incoming Handover from a remote BSS, the gscon remains in ST_INIT until the new lchan and conn are both established. - move bssmap_add_lcls_status() to osmo_bsc_lcls.c abis_rsl.c: - move all dynamic timeslot logic away into timeslot_fsm. Only keep plain send/receive functions in abis_rsl.c - reduce some rsl functions to merely send a message, rename to "_tx_". - rsl_ipacc_mdcx(): add '_tx_' in the name; move parts that change the lchan state out into the lchan_fsm, the lchan->abis_ip.* are now set there prior to invoking this function. - move all timers and error/release handling away into various FSMs. - tweak ipa_smod_s_for_lchan() and ipa_rtp_pt_for_lchan() to not require an lchan passed, but just mode,type that they require. Rename to ipacc_speech_mode*() and ipacc_payload_type(). - add rsl_forward_layer3_info, used for inter-BSC HO MO, to just send the RR message received during BSSMAP Handover Command. - move various logging to LOG_LCHAN() in order to log with the lchan FSM instance. One drawback is that the lchan FSM is limited to one logging category, i.e. this moves some logging from DRR to DRSL. It might actually make sense to combine those categories. - lose LOGP...LOGPC logging cascades: they are bad for gsmtap logging and for performance. - handle_classmark_chg(): change logging, move cm2 len check out of the cm3 condition (I hope that's correct). - gsm48_send_ho_cmd(): split off gsm48_make_ho_cmd() which doesn't send right away, so that during inter-bsc HO we can make an RR Handover Command to send via the MSC to the remote BSS. assignment_fsm.c: - the Chan Mode Modify in case of re-using the same lchan is not implemented yet, because this was also missing in the previous implementation (OS#3357). osmo_bsc_api.c: - simplify bsc_mr_config() and move to lchan_fsm.c, the only caller; rename to lchan_mr_config(). (bsc_mr_config() used to copy the values to mr_bts_lv twice, once by member assignment and then again with a memcpy.) - During handover, we used to copy the MR config from the old lchan. Since we may handover between FR and HR, rather set the MR Config anew every time, so that FR rates are always available on FR lchans, and never on HR lchans. Depends: I03ee7ce840ecfa0b6a33358e7385528aabd4873f (libosmocore), I1f2918418c38918c5ac70acaa51a47adfca12b5e (libosmocore) Change-Id: I82e3f918295daa83274a4cf803f046979f284366 --- M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/abis_rsl.h A include/osmocom/bsc/assignment_fsm.h M include/osmocom/bsc/bsc_api.h M include/osmocom/bsc/bsc_msc_data.h M include/osmocom/bsc/bsc_subscr_conn_fsm.h M include/osmocom/bsc/bsc_subscriber.h M include/osmocom/bsc/chan_alloc.h M include/osmocom/bsc/codec_pref.h M include/osmocom/bsc/gsm_04_08_rr.h M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/gsm_timers.h M include/osmocom/bsc/handover.h A include/osmocom/bsc/handover_fsm.h A include/osmocom/bsc/lchan_fsm.h A include/osmocom/bsc/lchan_select.h A include/osmocom/bsc/mgw_endpoint_fsm.h M include/osmocom/bsc/osmo_bsc.h M include/osmocom/bsc/osmo_bsc_lcls.h A include/osmocom/bsc/timeslot_fsm.h M src/ipaccess/Makefile.am M src/ipaccess/stubs.c M src/osmo-bsc/Makefile.am M src/osmo-bsc/abis_om2000.c M src/osmo-bsc/abis_rsl.c A src/osmo-bsc/assignment_fsm.c M src/osmo-bsc/bsc_api.c D src/osmo-bsc/bsc_dyn_ts.c M src/osmo-bsc/bsc_subscr_conn_fsm.c M src/osmo-bsc/bsc_subscriber.c M src/osmo-bsc/bsc_vty.c M src/osmo-bsc/bts_ericsson_rbs2000.c M src/osmo-bsc/bts_ipaccess_nanobts.c M src/osmo-bsc/bts_nokia_site.c M src/osmo-bsc/bts_siemens_bs11.c M src/osmo-bsc/chan_alloc.c M src/osmo-bsc/codec_pref.c M src/osmo-bsc/gsm_04_08_rr.c M src/osmo-bsc/gsm_data.c M src/osmo-bsc/gsm_timers.c M src/osmo-bsc/handover_decision.c M src/osmo-bsc/handover_decision_2.c A src/osmo-bsc/handover_fsm.c M src/osmo-bsc/handover_logic.c A src/osmo-bsc/lchan_fsm.c A src/osmo-bsc/lchan_select.c M src/osmo-bsc/meas_feed.c A src/osmo-bsc/mgw_endpoint_fsm.c M src/osmo-bsc/osmo_bsc_api.c D src/osmo-bsc/osmo_bsc_audio.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_ctrl.c M src/osmo-bsc/osmo_bsc_filter.c M src/osmo-bsc/osmo_bsc_grace.c M src/osmo-bsc/osmo_bsc_lcls.c M src/osmo-bsc/osmo_bsc_main.c M src/osmo-bsc/osmo_bsc_sigtran.c M src/osmo-bsc/paging.c M src/osmo-bsc/pcu_sock.c M src/osmo-bsc/system_information.c A src/osmo-bsc/timeslot_fsm.c M src/utils/Makefile.am M src/utils/bs11_config.c M src/utils/meas_json.c D src/utils/stubs.c M tests/abis/abis_test.c M tests/bsc/Makefile.am M tests/bsc/bsc_test.c M tests/codec_pref/codec_pref_test.c M tests/codec_pref/codec_pref_test.ok M tests/gsm0408/gsm0408_test.c M tests/handover/Makefile.am M tests/handover/handover_test.c M tests/handover/neighbor_ident_test.c M tests/nanobts_omlattr/nanobts_omlattr_test.c 75 files changed, 8,462 insertions(+), 4,784 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/71/9671/37 -- To view, visit https://gerrit.osmocom.org/9671 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I82e3f918295daa83274a4cf803f046979f284366 Gerrit-Change-Number: 9671 Gerrit-PatchSet: 37 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 16:41:35 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 16:41:35 +0000 Subject: Change in osmo-bsc[master]: cosmetic: FSMs: allow ignorable events In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10101 to look at the new patch set (#5). Change subject: cosmetic: FSMs: allow ignorable events ...................................................................... cosmetic: FSMs: allow ignorable events In various FSMs, some events may appear later or earlier without need of action. Do not indicate these as 'ERROR' (event not permitted), but allow and ignore them. Debug-log about some of those. >From the old code, we've taken over the habit to change into WAIT_BEFORE_RF_RELEASE even before SAPI[0] is released. Hence we may still receive a SAPI[0] REL_IND in WAIT_BEFORE_RF_RELEASE. Don't show this as error message, just silently accept it. Change-Id: Ie320c7c6a1436184aaf2ec5a1843e04f4b3414ab --- M src/osmo-bsc/assignment_fsm.c M src/osmo-bsc/handover_fsm.c M src/osmo-bsc/lchan_fsm.c 3 files changed, 60 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/01/10101/5 -- To view, visit https://gerrit.osmocom.org/10101 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie320c7c6a1436184aaf2ec5a1843e04f4b3414ab Gerrit-Change-Number: 10101 Gerrit-PatchSet: 5 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 16:41:35 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 16:41:35 +0000 Subject: Change in osmo-bsc[master]: fix BSC_CTR_ASSIGNMENT doc strings In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10102 to look at the new patch set (#5). Change subject: fix BSC_CTR_ASSIGNMENT doc strings ...................................................................... fix BSC_CTR_ASSIGNMENT doc strings Change-Id: I9de0c16a14edd8bf4f02b7781ccfd211e0a79463 --- M include/osmocom/bsc/gsm_data.h 1 file changed, 7 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/02/10102/5 -- To view, visit https://gerrit.osmocom.org/10102 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9de0c16a14edd8bf4f02b7781ccfd211e0a79463 Gerrit-Change-Number: 10102 Gerrit-PatchSet: 5 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 16:41:35 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 16:41:35 +0000 Subject: Change in osmo-bsc[master]: lchan_fsm: split off lchan_rtp_fsm, establish RTP a bit earlier In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10103 to look at the new patch set (#5). Change subject: lchan_fsm: split off lchan_rtp_fsm, establish RTP a bit earlier ...................................................................... lchan_fsm: split off lchan_rtp_fsm, establish RTP a bit earlier Change-Id: Id7a4407d9b63be05ce63f5f2768b7d7e3d5c86fb --- M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/lchan_fsm.h A include/osmocom/bsc/lchan_rtp_fsm.h M src/osmo-bsc/Makefile.am M src/osmo-bsc/abis_rsl.c M src/osmo-bsc/bsc_subscr_conn_fsm.c M src/osmo-bsc/handover_fsm.c M src/osmo-bsc/lchan_fsm.c A src/osmo-bsc/lchan_rtp_fsm.c M tests/handover/Makefile.am M tests/handover/handover_test.c 12 files changed, 1,038 insertions(+), 481 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/03/10103/5 -- To view, visit https://gerrit.osmocom.org/10103 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id7a4407d9b63be05ce63f5f2768b7d7e3d5c86fb Gerrit-Change-Number: 10103 Gerrit-PatchSet: 5 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 16:41:35 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 16:41:35 +0000 Subject: Change in osmo-bsc[master]: lchan_fsm: add in_release_handler flag In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10104 to look at the new patch set (#5). Change subject: lchan_fsm: add in_release_handler flag ...................................................................... lchan_fsm: add in_release_handler flag If a release event is being handled, ignore other ricocheting release events until that release handling has concluded. For example, if an lchan is regularly released, it signals the lchan RTP FSM to release, which then calls back to say "RTP is released" on termination -- this should not trigger other state changes than the initial release intends. Change-Id: Iec41e006b6ab9d0f618d36925341f9536353e5d8 --- M include/osmocom/bsc/gsm_data.h M src/osmo-bsc/lchan_fsm.c 2 files changed, 21 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/04/10104/5 -- To view, visit https://gerrit.osmocom.org/10104 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iec41e006b6ab9d0f618d36925341f9536353e5d8 Gerrit-Change-Number: 10104 Gerrit-PatchSet: 5 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 16:41:35 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 16:41:35 +0000 Subject: Change in osmo-bsc[master]: allocate larger lchans if no SDCCH are available In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10105 to look at the new patch set (#5). Change subject: allocate larger lchans if no SDCCH are available ...................................................................... allocate larger lchans if no SDCCH are available Related: OS#3332 Change-Id: I2fcf9e9baa7d03974a367763f3f52f59dfc2cc51 --- M src/osmo-bsc/abis_rsl.c 1 file changed, 16 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/05/10105/5 -- To view, visit https://gerrit.osmocom.org/10105 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2fcf9e9baa7d03974a367763f3f52f59dfc2cc51 Gerrit-Change-Number: 10105 Gerrit-PatchSet: 5 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 16:41:35 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 16:41:35 +0000 Subject: Change in osmo-bsc[master]: create separate logging categories for lchan, ts, as FSMs In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10106 to look at the new patch set (#5). Change subject: create separate logging categories for lchan,ts,as FSMs ...................................................................... create separate logging categories for lchan,ts,as FSMs Change-Id: Ie889b8860a4a63c7c22ef65025f690d64cd7330c --- M include/osmocom/bsc/debug.h M src/osmo-bsc/assignment_fsm.c M src/osmo-bsc/lchan_fsm.c M src/osmo-bsc/lchan_rtp_fsm.c M src/osmo-bsc/osmo_bsc_main.c M src/osmo-bsc/timeslot_fsm.c M tests/handover/handover_test.c 7 files changed, 43 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/06/10106/5 -- To view, visit https://gerrit.osmocom.org/10106 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie889b8860a4a63c7c22ef65025f690d64cd7330c Gerrit-Change-Number: 10106 Gerrit-PatchSet: 5 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 16:41:35 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 16:41:35 +0000 Subject: Change in osmo-bsc[master]: cosmetic: constify gsm_bts_num() net arg In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10107 to look at the new patch set (#5). Change subject: cosmetic: constify gsm_bts_num() net arg ...................................................................... cosmetic: constify gsm_bts_num() net arg Change-Id: I9a078ffb781ee55c0ca114fa0d752c1b53067419 --- M include/osmocom/bsc/gsm_data.h M src/osmo-bsc/gsm_data.c 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/07/10107/5 -- To view, visit https://gerrit.osmocom.org/10107 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9a078ffb781ee55c0ca114fa0d752c1b53067419 Gerrit-Change-Number: 10107 Gerrit-PatchSet: 5 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 16:41:35 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 16:41:35 +0000 Subject: Change in osmo-bsc[master]: vty: 'handover any': pick more random chans, use lchan_select_by_type() In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10108 to look at the new patch set (#5). Change subject: vty: 'handover any': pick more random chans, use lchan_select_by_type() ...................................................................... vty: 'handover any': pick more random chans, use lchan_select_by_type() The 'handover any' VTY command is only useful for testing. It is even more useful if it doesn't always pick the first used lchan but produces more random handovers. The algorithm takes a random number as input, iterates over used lchans once, and if the random number is larger, takes modulo of the nr of used lchans counted. A second iteration will then produce a match. Instead of figuring out the lchan type logic in bsc_vty.c, just use lchan_select_by_type(); Change-Id: I50b70e02d665b967e401db65581e110bc83101e7 --- M src/osmo-bsc/bsc_vty.c 1 file changed, 43 insertions(+), 47 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/08/10108/5 -- To view, visit https://gerrit.osmocom.org/10108 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I50b70e02d665b967e401db65581e110bc83101e7 Gerrit-Change-Number: 10108 Gerrit-PatchSet: 5 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 16:41:35 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 16:41:35 +0000 Subject: Change in osmo-bsc[master]: cosmetic: dissolve bsc_api.c In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10146 to look at the new patch set (#2). Change subject: cosmetic: dissolve bsc_api.c ...................................................................... cosmetic: dissolve bsc_api.c gsm0808_page() is just a thin wrapper for rsl_paging_cmd(), the only caller is page_ms() from paging.c. Directly call rsl_paging_cmd() instead. Move gsm0808_cipher_mode() to the only caller in osmo_bsc_bssap.c, make static. Change-Id: Ib7ce026b52d4ba3e53a8b2824e74ea92432c48c5 --- M include/osmocom/bsc/bsc_api.h M src/osmo-bsc/Makefile.am D src/osmo-bsc/bsc_api.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/paging.c M tests/handover/Makefile.am 6 files changed, 29 insertions(+), 82 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/46/10146/2 -- To view, visit https://gerrit.osmocom.org/10146 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib7ce026b52d4ba3e53a8b2824e74ea92432c48c5 Gerrit-Change-Number: 10146 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 16:41:35 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 16:41:35 +0000 Subject: Change in osmo-bsc[master]: cosmetic: reduce bsc_api.h In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10147 to look at the new patch set (#2). Change subject: cosmetic: reduce bsc_api.h ...................................................................... cosmetic: reduce bsc_api.h Remove as much as possible from bsc_api.h. Use '#pragma once'. Tweak head comment. BSC_API_CONN_POL_{ACCEPT,REJECT}: only user is static complete_layer3(), just use a bool return value instead. msc_connected(): only used in osmo_bsc_api.c, make static there. Instead of including gsm_data.h, declare structs opaquely, include stdint.h. codec_pref_test.c used this as indirect gsm_data.h include via osmo_bsc.h, include gsm_data.h there directly. osmo_bsc.h: instead of including bsc_api.h, declare opaque structs. gsm_04_08_rr.h: declare opaque structs to replace indirect include of gsm_data.h. Change-Id: Ia9c0f9828317236048e40ec9ecf9990592e2190a --- M include/osmocom/bsc/bsc_api.h M include/osmocom/bsc/gsm_04_08_rr.h M include/osmocom/bsc/osmo_bsc.h M src/osmo-bsc/osmo_bsc_api.c M tests/codec_pref/codec_pref_test.c 5 files changed, 31 insertions(+), 25 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/47/10147/2 -- To view, visit https://gerrit.osmocom.org/10147 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia9c0f9828317236048e40ec9ecf9990592e2190a Gerrit-Change-Number: 10147 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 16:41:35 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 16:41:35 +0000 Subject: Change in osmo-bsc[master]: cosmetic: rename osmo_bsc_api.c to gsm_08_08.c In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10149 to look at the new patch set (#2). Change subject: cosmetic: rename osmo_bsc_api.c to gsm_08_08.c ...................................................................... cosmetic: rename osmo_bsc_api.c to gsm_08_08.c Change-Id: I91922f557072d0fb8cfe213a8a7b50f3bb23dea0 --- M src/osmo-bsc/Makefile.am R src/osmo-bsc/gsm_08_08.c 2 files changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/49/10149/2 -- To view, visit https://gerrit.osmocom.org/10149 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I91922f557072d0fb8cfe213a8a7b50f3bb23dea0 Gerrit-Change-Number: 10149 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 17:01:32 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 24 Jul 2018 17:01:32 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MGCP_Test: check payload type of received RTP packets Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/10150 Change subject: MGCP_Test: check payload type of received RTP packets ...................................................................... MGCP_Test: check payload type of received RTP packets When an RTP packet is received, the payload type is not checked, so we will not detect if the MGW emits packets with a wrong payload type for some reason. - Introduce a statistics counter that counts packets with wrong PT - Update testcases so that they check for the statistics for wrong PT count. Change-Id: I83d4b04656a16ced624024245a2fcb7a0ad48a8a Related: OS#3384 --- M library/RTP_Emulation.ttcn M mgw/MGCP_Test.ttcn 2 files changed, 36 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/50/10150/1 diff --git a/library/RTP_Emulation.ttcn b/library/RTP_Emulation.ttcn index 71cd8db..2a358a9 100644 --- a/library/RTP_Emulation.ttcn +++ b/library/RTP_Emulation.ttcn @@ -116,6 +116,8 @@ integer num_pkts_rx_err_seq, /* number of packets received wrong timestamp */ integer num_pkts_rx_err_ts, + /* number of packets received wrong payload type */ + integer num_pkts_rx_err_pt, /* number of packets received during Rx disable */ integer num_pkts_rx_err_disabled } @@ -127,6 +129,7 @@ bytes_payload_rx := 0, num_pkts_rx_err_seq := 0, num_pkts_rx_err_ts := 0, + num_pkts_rx_err_pt := 0, num_pkts_rx_err_disabled := 0 } @@ -399,7 +402,11 @@ /* process received RTCP/RTP if receiver enabled */ [g_rx_enabled] RTP.receive(tr_rtp) -> value rx_rtp { //log("RX RTP: ", rx_rtp); + /* increment counters */ + if (rx_rtp.msg.rtp.payload_type != g_cfg.tx_payload_type) { + g_stats_rtp.num_pkts_rx_err_pt := g_stats_rtp.num_pkts_rx_err_pt+1; + } g_stats_rtp.num_pkts_rx := g_stats_rtp.num_pkts_rx+1; g_stats_rtp.bytes_payload_rx := g_stats_rtp.bytes_payload_rx + lengthof(rx_rtp.msg.rtp.data); diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn index 82ed608..264ac28 100644 --- a/mgw/MGCP_Test.ttcn +++ b/mgw/MGCP_Test.ttcn @@ -970,6 +970,9 @@ if (stats.num_pkts_rx_err_ts != 0) { setverdict(fail); } + if (stats.num_pkts_rx_err_pt != 0) { + setverdict(fail); + } if (stats.num_pkts_rx_err_disabled != 0) { setverdict(fail); } @@ -1008,6 +1011,9 @@ if (stats.num_pkts_rx_err_ts != 0) { setverdict(fail); } + if (stats.num_pkts_rx_err_pt != 0) { + setverdict(fail); + } if (stats.num_pkts_rx_err_disabled != 0) { setverdict(fail); } @@ -1062,6 +1068,11 @@ mtc.stop; } + if (stats[0].num_pkts_rx_err_pt > 0 or stats[1].num_pkts_rx_err_pt > 0) { + setverdict(fail, "RTP packets with wrong payload type received"); + mtc.stop; + } + setverdict(pass); } @@ -1163,12 +1174,20 @@ setverdict(fail, "number of packets not within normal parameters"); mtc.stop; } + if (stats[0].num_pkts_rx_err_pt > 0) { + setverdict(fail, "RTP packets with wrong payload type received"); + mtc.stop; + } temp := stats[1].num_pkts_tx - num_pkts_tx[1] - stats[0].num_pkts_rx; if (temp > 3 or temp < -3) { setverdict(fail, "number of packets not within normal parameters"); mtc.stop; } + if (stats[0].num_pkts_rx_err_pt > 0) { + setverdict(fail, "RTP packets with wrong payload type received"); + mtc.stop; + } /* Tear down */ f_flow_delete(RTPEM[0]); @@ -1221,6 +1240,11 @@ mtc.stop; } + if (stats[0].num_pkts_rx_err_pt > 0 or stats[1].num_pkts_rx_err_pt > 0) { + setverdict(fail, "RTP packets with wrong payload type received"); + mtc.stop; + } + setverdict(pass); } @@ -1284,6 +1308,11 @@ mtc.stop; } + if (stats[0].num_pkts_rx_err_pt > 0 or stats[1].num_pkts_rx_err_pt > 0) { + setverdict(fail, "RTP packets with wrong payload type received"); + mtc.stop; + } + setverdict(pass); } -- To view, visit https://gerrit.osmocom.org/10150 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I83d4b04656a16ced624024245a2fcb7a0ad48a8a Gerrit-Change-Number: 10150 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 17:08:48 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 24 Jul 2018 17:08:48 +0000 Subject: Change in osmo-iuh[master]: hnbgw: remove close_cb() to fix a crash when releasing a hnbgw Message-ID: lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/10151 Change subject: hnbgw: remove close_cb() to fix a crash when releasing a hnbgw ...................................................................... hnbgw: remove close_cb() to fix a crash when releasing a hnbgw The read callback should catch all errors already. Previous when a read fails it: * hnb_context_release() -> osmo_stream_srv_destroy() -> hnb_context_release() On the second hnb_context_release() the hnbgw will crash because calling llist_del() twice on the same object. Fixes: OS#3416 Change-Id: Ic84b2184b7fc850c0de2acacf179e86771e17510 --- M include/osmocom/iuh/hnbgw.h M src/hnbgw.c M src/hnbgw_hnbap.c 3 files changed, 8 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/51/10151/1 diff --git a/include/osmocom/iuh/hnbgw.h b/include/osmocom/iuh/hnbgw.h index b79bcc1..db49dc1 100644 --- a/include/osmocom/iuh/hnbgw.h +++ b/include/osmocom/iuh/hnbgw.h @@ -161,7 +161,7 @@ void ue_context_free(struct ue_context *ue); struct hnb_context *hnb_context_alloc(struct hnb_gw *gw, struct osmo_stream_srv_link *link, int new_fd); -void hnb_context_release(struct hnb_context *ctx, bool destroy_conn); +void hnb_context_release(struct hnb_context *ctx); void hnbgw_vty_init(struct hnb_gw *gw, void *tall_ctx); int hnbgw_vty_go_parent(struct vty *vty); diff --git a/src/hnbgw.c b/src/hnbgw.c index 94d8fb9..91e551b 100644 --- a/src/hnbgw.c +++ b/src/hnbgw.c @@ -202,16 +202,6 @@ llist_del(&ue->list); talloc_free(ue); } -static int hnb_close_cb(struct osmo_stream_srv *conn) -{ - struct hnb_context *hnb = osmo_stream_srv_get_data(conn); - - /* This connection is about to be closed. Destroy the HNB context now. */ - if (hnb) - hnb_context_release(hnb, false); - - return 0; -} static int hnb_read_cb(struct osmo_stream_srv *conn) { @@ -234,10 +224,10 @@ } else if (rc < 0) { LOGP(DMAIN, LOGL_ERROR, "Error during sctp_recvmsg()\n"); /* FIXME: clean up after disappeared HNB */ - hnb_context_release(hnb, true); + hnb_context_release(hnb); goto out; } else if (rc == 0) { - hnb_context_release(hnb, true); + hnb_context_release(hnb); rc = -1; goto out; @@ -283,7 +273,7 @@ INIT_LLIST_HEAD(&ctx->map_list); ctx->gw = gw; - ctx->conn = osmo_stream_srv_create(tall_hnb_ctx, link, new_fd, hnb_read_cb, hnb_close_cb, ctx); + ctx->conn = osmo_stream_srv_create(tall_hnb_ctx, link, new_fd, hnb_read_cb, NULL, ctx); if (!ctx->conn) { LOGP(DMAIN, LOGL_INFO, "error while creating connection\n"); talloc_free(ctx); @@ -294,7 +284,7 @@ return ctx; } -void hnb_context_release(struct hnb_context *ctx, bool destroy_conn) +void hnb_context_release(struct hnb_context *ctx) { struct hnbgw_context_map *map, *map2; @@ -312,8 +302,7 @@ } ue_context_free_by_hnb(ctx->gw, ctx); - if (destroy_conn) - osmo_stream_srv_destroy(ctx->conn); + osmo_stream_srv_destroy(ctx->conn); talloc_free(ctx); } diff --git a/src/hnbgw_hnbap.c b/src/hnbgw_hnbap.c index acc5aff..2a19dda 100644 --- a/src/hnbgw_hnbap.c +++ b/src/hnbgw_hnbap.c @@ -84,7 +84,7 @@ osmo_stream_srv_set_flush_and_destroy(ctx->conn); } else { /* The message was not queued. Destroy the connection right away. */ - hnb_context_release(ctx, true); + hnb_context_release(ctx); } } @@ -401,7 +401,7 @@ hnbap_cause_str(&ies.cause)); hnbap_free_hnbde_registeries(&ies); - hnb_context_release(ctx, true); + hnb_context_release(ctx); return 0; } -- To view, visit https://gerrit.osmocom.org/10151 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ic84b2184b7fc850c0de2acacf179e86771e17510 Gerrit-Change-Number: 10151 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 17:19:31 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Tue, 24 Jul 2018 17:19:31 +0000 Subject: Change in osmo-sysmon[master]: git-version-gen: Don't check for .git directory In-Reply-To: References: Message-ID: daniel has submitted this change and it was merged. ( https://gerrit.osmocom.org/10138 ) Change subject: git-version-gen: Don't check for .git directory ...................................................................... git-version-gen: Don't check for .git directory This check is not in all our repos that use git-version-gen. Indeed it seems to be a leftover of openbsc where I think it wanted to ensure being called in the openbsc subfolder or something? libosmocore e.g. doesn't have it. In any case .git being a directory is not always true (if using git worktree) so remove this check. Change-Id: I414111b27db9951314e6bc7eff8bc1f10775b3ff --- M git-version-gen 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/git-version-gen b/git-version-gen index 8e59c5a..42cf3d2 100755 --- a/git-version-gen +++ b/git-version-gen @@ -92,8 +92,8 @@ if test -n "$v" then : # use $v -elif test -d ./.git \ - && v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ +elif + v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ || git describe --abbrev=4 HEAD 2>/dev/null` \ && case $v in [0-9]*) ;; -- To view, visit https://gerrit.osmocom.org/10138 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sysmon Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I414111b27db9951314e6bc7eff8bc1f10775b3ff Gerrit-Change-Number: 10138 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 17:20:51 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 24 Jul 2018 17:20:51 +0000 Subject: Change in libosmocore[master]: logging_vty: Simplify code in config_write_log_single In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/10135 ) Change subject: logging_vty: Simplify code in config_write_log_single ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/10135 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4e76c65a11cc22616c6dfc632435617ebb861c03 Gerrit-Change-Number: 10135 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 24 Jul 2018 17:20:51 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 17:48:21 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 24 Jul 2018 17:48:21 +0000 Subject: Change in libosmocore[master]: logging: log_vty_command_string: Fix undercount of buf alloc size In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/10134 ) Change subject: logging: log_vty_command_string: Fix undercount of buf alloc size ...................................................................... Patch Set 1: Code-Review+1 (5 comments) Looks fine for me. I have posted some comments for further improvements of this function. Not necessary in the current change, I just couldn't resist :) https://gerrit.osmocom.org/#/c/10134/1/src/logging.c File src/logging.c: https://gerrit.osmocom.org/#/c/10134/1/src/logging.c at 943 PS1, Line 943: size += strlen(info->cat[i].name) + 1; AFAIU, it also accounts '|' after each category name. Even for the last one, where we don't have '|', i.e. "logging level (all|rll|cc|...|ljibuf)" https://gerrit.osmocom.org/#/c/10134/1/src/logging.c at 947 PS1, Line 947: size += strlen(loglevel_strs[i].str) + 1; Same here: "(everything|debug|...|fatal)" https://gerrit.osmocom.org/#/c/10134/1/src/logging.c at 950 PS1, Line 950: str = talloc_zero_size(tall_log_ctx, size); Then here we should have 2 useless bytes. https://gerrit.osmocom.org/#/c/10134/1/src/logging.c at 965 PS1, Line 965: name[j] = tolower((unsigned char)info->cat[i].name[j]); We can simplify this by using pointer arithmetics and osmo_str2lower(). https://gerrit.osmocom.org/#/c/10134/1/src/logging.c at 986 PS1, Line 986: for (j = 0; j < loglevel_str_len; j++) This part also can be simplified... -- To view, visit https://gerrit.osmocom.org/10134 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7aca0ce3d2981001e8081f7cee0dea3e2aaf8f7c Gerrit-Change-Number: 10134 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 24 Jul 2018 17:48:21 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 17:57:10 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 24 Jul 2018 17:57:10 +0000 Subject: Change in libosmocore[master]: logging: Fix logging level all In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/10116 ) Change subject: logging: Fix logging level all ...................................................................... Patch Set 2: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/10116/2/src/logging.c File src/logging.c: https://gerrit.osmocom.org/#/c/10116/2/src/logging.c at 724 PS2, Line 724: /* Reset all categories to UNSET */ Let's implements this in a separate change, and focus on fixing the issue this commit is intended to fix... Please see: https://lists.osmocom.org/pipermail/openbsc/2018-July/012053.html Sorry, but I still think that this part implements an additional feature bu changing the default behaviour of 'logging level all LEVEL'... -- To view, visit https://gerrit.osmocom.org/10116 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0f50ad8d6fd038398f7d751287417505c8dcdeff Gerrit-Change-Number: 10116 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 24 Jul 2018 17:57:10 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 18:02:35 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 24 Jul 2018 18:02:35 +0000 Subject: Change in libosmocore[master]: logging: Add VTY cmd: logging level unset In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/10136 ) Change subject: logging: Add VTY cmd: logging level unset ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/10136/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/10136/1//COMMIT_MSG at 17 PS1, Line 17: 2- Set severla categories to debug: s/severla/several ;) -- To view, visit https://gerrit.osmocom.org/10136 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iee0d4da16b075e798f85c3f6adeb513057fd5402 Gerrit-Change-Number: 10136 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 24 Jul 2018 18:02:35 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 18:03:07 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Tue, 24 Jul 2018 18:03:07 +0000 Subject: Change in libosmocore[master]: stats_vty: Add asciidoc sections between the different counters Message-ID: daniel has uploaded this change for review. ( https://gerrit.osmocom.org/10152 Change subject: stats_vty: Add asciidoc sections between the different counters ...................................................................... stats_vty: Add asciidoc sections between the different counters Change-Id: Ie37be744abd8c47211d64877bcd17f94465bd423 --- M src/vty/stats_vty.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/52/10152/1 diff --git a/src/vty/stats_vty.c b/src/vty/stats_vty.c index 8d90945..5ded7a4 100644 --- a/src/vty/stats_vty.c +++ b/src/vty/stats_vty.c @@ -516,12 +516,15 @@ host.app_info->name ? host.app_info->name : "", VTY_NEWLINE, VTY_NEWLINE); /* 2x VTY_NEWLINE are intentional otherwise it would interpret the first table header * as usual text*/ + vty_out(vty, "=== Rate Counters%s%s", VTY_NEWLINE, VTY_NEWLINE); vty_out(vty, "// generating tables for rate_ctr_group%s", VTY_NEWLINE); rate_ctr_for_each_group(asciidoc_rate_ctr_group_handler, vty); + vty_out(vty, "== Osmo Stat Items%s%s", VTY_NEWLINE, VTY_NEWLINE); vty_out(vty, "// generating tables for osmo_stat_items%s", VTY_NEWLINE); osmo_stat_item_for_each_group(asciidoc_osmo_stat_item_group_handler, vty); + vty_out(vty, "== Osmo Counters%s%s", VTY_NEWLINE, VTY_NEWLINE); vty_out(vty, "// generating tables for osmo_counters%s", VTY_NEWLINE); asciidoc_counter_generate(vty); return CMD_SUCCESS; -- To view, visit https://gerrit.osmocom.org/10152 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ie37be744abd8c47211d64877bcd17f94465bd423 Gerrit-Change-Number: 10152 Gerrit-PatchSet: 1 Gerrit-Owner: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 18:03:30 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Tue, 24 Jul 2018 18:03:30 +0000 Subject: Change in osmo-bts[master]: update sysinfo copies in all lchans upon SACCH FILL Message-ID: Stefan Sperling has uploaded this change for review. ( https://gerrit.osmocom.org/10153 Change subject: update sysinfo copies in all lchans upon SACCH FILL ...................................................................... update sysinfo copies in all lchans upon SACCH FILL When a SACCH FILL is received, loop over all lchans and update their copies of system information data. This change makes BTS_Tests.TC_sacch_multi_chg pass. Change-Id: I3e63eeb5fcf320fb029de16e4d327e153cc34567 Related: OS#3173 --- M src/common/rsl.c 1 file changed, 32 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/53/10153/1 diff --git a/src/common/rsl.c b/src/common/rsl.c index 9295240..e28f313 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -563,12 +563,44 @@ } if (TLVP_PRESENT(&tp, RSL_IE_L3_INFO)) { uint16_t len = TLVP_LEN(&tp, RSL_IE_L3_INFO); + struct gsm_bts_trx *t; + lapdm_ui_prefix_bts(bts, TLVP_VAL(&tp, RSL_IE_L3_INFO), osmo_si, len); + /* Propagate SI change to all lchans. */ + llist_for_each_entry(t, &bts->trx_list, list) { + int i, j; + for (i = 0; i < ARRAY_SIZE(t->ts); i++) { + struct gsm_bts_trx_ts *ts = &t->ts[i]; + for (j = 0; j < ARRAY_SIZE(ts->lchan); j++) { + struct gsm_lchan *lchan = &ts->lchan[j]; + if (lchan->state == LCHAN_S_NONE) + continue; + lapdm_ui_prefix_lchan(lchan, TLVP_VAL(&tp, RSL_IE_L3_INFO), osmo_si, len); + } + } + } + LOGP(DRSL, LOGL_INFO, " Rx RSL SACCH FILLING (SI%s, %u bytes)\n", get_value_string(osmo_sitype_strs, osmo_si), len); } else { + struct gsm_bts_trx *t; + bts->si_valid &= ~(1 << osmo_si); + + /* Propagate SI change to all lchans. */ + llist_for_each_entry(t, &bts->trx_list, list) { + int i, j; + for (i = 0; i < ARRAY_SIZE(t->ts); i++) { + struct gsm_bts_trx_ts *ts = &t->ts[i]; + for (j = 0; j < ARRAY_SIZE(ts->lchan); j++) { + struct gsm_lchan *lchan = &ts->lchan[j]; + if (lchan->state == LCHAN_S_NONE) + continue; + lchan->si.valid &= ~(1 << osmo_si); + } + } + } LOGP(DRSL, LOGL_INFO, " Rx RSL Disabling SACCH FILLING (SI%s)\n", get_value_string(osmo_sitype_strs, osmo_si)); } -- To view, visit https://gerrit.osmocom.org/10153 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I3e63eeb5fcf320fb029de16e4d327e153cc34567 Gerrit-Change-Number: 10153 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 18:17:15 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 24 Jul 2018 18:17:15 +0000 Subject: Change in libosmocore[master]: logging: Fix logging level all In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10116 ) Change subject: logging: Fix logging level all ...................................................................... Patch Set 2: What I would like to have, for a long time already, is a small program that tests all desired features and shows how to make them work. a) define all use cases, b) make sure we support them, c) ensure with such test; I've been meaning to implement such for a long time after being so confused about logging, and also after Keith reported that his use case of 'logging level all everything' or what it was is broken... but never having time for it and still always annoyed of logging weirdness. -- To view, visit https://gerrit.osmocom.org/10116 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0f50ad8d6fd038398f7d751287417505c8dcdeff Gerrit-Change-Number: 10116 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 24 Jul 2018 18:17:15 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 18:52:40 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 18:52:40 +0000 Subject: Change in osmo-bts[master]: update sysinfo copies in all lchans upon SACCH FILL In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10153 ) Change subject: update sysinfo copies in all lchans upon SACCH FILL ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10153 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3e63eeb5fcf320fb029de16e4d327e153cc34567 Gerrit-Change-Number: 10153 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 24 Jul 2018 18:52:40 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 18:52:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 18:52:44 +0000 Subject: Change in osmo-bts[master]: update sysinfo copies in all lchans upon SACCH FILL In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10153 ) Change subject: update sysinfo copies in all lchans upon SACCH FILL ...................................................................... update sysinfo copies in all lchans upon SACCH FILL When a SACCH FILL is received, loop over all lchans and update their copies of system information data. This change makes BTS_Tests.TC_sacch_multi_chg pass. Change-Id: I3e63eeb5fcf320fb029de16e4d327e153cc34567 Related: OS#3173 --- M src/common/rsl.c 1 file changed, 32 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/common/rsl.c b/src/common/rsl.c index 9295240..e28f313 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -563,12 +563,44 @@ } if (TLVP_PRESENT(&tp, RSL_IE_L3_INFO)) { uint16_t len = TLVP_LEN(&tp, RSL_IE_L3_INFO); + struct gsm_bts_trx *t; + lapdm_ui_prefix_bts(bts, TLVP_VAL(&tp, RSL_IE_L3_INFO), osmo_si, len); + /* Propagate SI change to all lchans. */ + llist_for_each_entry(t, &bts->trx_list, list) { + int i, j; + for (i = 0; i < ARRAY_SIZE(t->ts); i++) { + struct gsm_bts_trx_ts *ts = &t->ts[i]; + for (j = 0; j < ARRAY_SIZE(ts->lchan); j++) { + struct gsm_lchan *lchan = &ts->lchan[j]; + if (lchan->state == LCHAN_S_NONE) + continue; + lapdm_ui_prefix_lchan(lchan, TLVP_VAL(&tp, RSL_IE_L3_INFO), osmo_si, len); + } + } + } + LOGP(DRSL, LOGL_INFO, " Rx RSL SACCH FILLING (SI%s, %u bytes)\n", get_value_string(osmo_sitype_strs, osmo_si), len); } else { + struct gsm_bts_trx *t; + bts->si_valid &= ~(1 << osmo_si); + + /* Propagate SI change to all lchans. */ + llist_for_each_entry(t, &bts->trx_list, list) { + int i, j; + for (i = 0; i < ARRAY_SIZE(t->ts); i++) { + struct gsm_bts_trx_ts *ts = &t->ts[i]; + for (j = 0; j < ARRAY_SIZE(ts->lchan); j++) { + struct gsm_lchan *lchan = &ts->lchan[j]; + if (lchan->state == LCHAN_S_NONE) + continue; + lchan->si.valid &= ~(1 << osmo_si); + } + } + } LOGP(DRSL, LOGL_INFO, " Rx RSL Disabling SACCH FILLING (SI%s)\n", get_value_string(osmo_sitype_strs, osmo_si)); } -- To view, visit https://gerrit.osmocom.org/10153 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I3e63eeb5fcf320fb029de16e4d327e153cc34567 Gerrit-Change-Number: 10153 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 18:53:03 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 18:53:03 +0000 Subject: Change in libosmocore[master]: stats_vty: Add asciidoc sections between the different counters In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10152 ) Change subject: stats_vty: Add asciidoc sections between the different counters ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10152 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie37be744abd8c47211d64877bcd17f94465bd423 Gerrit-Change-Number: 10152 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 24 Jul 2018 18:53:03 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 18:53:05 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 18:53:05 +0000 Subject: Change in libosmocore[master]: stats_vty: Add asciidoc sections between the different counters In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10152 ) Change subject: stats_vty: Add asciidoc sections between the different counters ...................................................................... stats_vty: Add asciidoc sections between the different counters Change-Id: Ie37be744abd8c47211d64877bcd17f94465bd423 --- M src/vty/stats_vty.c 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/vty/stats_vty.c b/src/vty/stats_vty.c index 8d90945..5ded7a4 100644 --- a/src/vty/stats_vty.c +++ b/src/vty/stats_vty.c @@ -516,12 +516,15 @@ host.app_info->name ? host.app_info->name : "", VTY_NEWLINE, VTY_NEWLINE); /* 2x VTY_NEWLINE are intentional otherwise it would interpret the first table header * as usual text*/ + vty_out(vty, "=== Rate Counters%s%s", VTY_NEWLINE, VTY_NEWLINE); vty_out(vty, "// generating tables for rate_ctr_group%s", VTY_NEWLINE); rate_ctr_for_each_group(asciidoc_rate_ctr_group_handler, vty); + vty_out(vty, "== Osmo Stat Items%s%s", VTY_NEWLINE, VTY_NEWLINE); vty_out(vty, "// generating tables for osmo_stat_items%s", VTY_NEWLINE); osmo_stat_item_for_each_group(asciidoc_osmo_stat_item_group_handler, vty); + vty_out(vty, "== Osmo Counters%s%s", VTY_NEWLINE, VTY_NEWLINE); vty_out(vty, "// generating tables for osmo_counters%s", VTY_NEWLINE); asciidoc_counter_generate(vty); return CMD_SUCCESS; -- To view, visit https://gerrit.osmocom.org/10152 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ie37be744abd8c47211d64877bcd17f94465bd423 Gerrit-Change-Number: 10152 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 18:54:04 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 18:54:04 +0000 Subject: Change in libosmocore[master]: logging: log_vty_command_string: Fix undercount of buf alloc size In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10134 ) Change subject: logging: log_vty_command_string: Fix undercount of buf alloc size ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10134 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7aca0ce3d2981001e8081f7cee0dea3e2aaf8f7c Gerrit-Change-Number: 10134 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 24 Jul 2018 18:54:04 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 18:54:38 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 18:54:38 +0000 Subject: Change in libosmocore[master]: logging_vty: Simplify code in config_write_log_single In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10135 ) Change subject: logging_vty: Simplify code in config_write_log_single ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10135 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4e76c65a11cc22616c6dfc632435617ebb861c03 Gerrit-Change-Number: 10135 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 24 Jul 2018 18:54:38 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 18:57:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 18:57:11 +0000 Subject: Change in osmo-iuh[master]: hnbgw: remove close_cb() to fix a crash when releasing a hnbgw In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10151 ) Change subject: hnbgw: remove close_cb() to fix a crash when releasing a hnbgw ...................................................................... Patch Set 1: Code-Review+1 it somehow feels odd that we have a close_cb function but we populate it with NULL. Are we sure there are no other cases (other than from the read path) where the connection can be closed and cloes_cb is invoked somehow? -- To view, visit https://gerrit.osmocom.org/10151 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic84b2184b7fc850c0de2acacf179e86771e17510 Gerrit-Change-Number: 10151 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 24 Jul 2018 18:57:11 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 18:57:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 18:57:57 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MGCP_Test: check payload type of received RTP packets In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10150 ) Change subject: MGCP_Test: check payload type of received RTP packets ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10150 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I83d4b04656a16ced624024245a2fcb7a0ad48a8a Gerrit-Change-Number: 10150 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 24 Jul 2018 18:57:57 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 18:57:59 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 18:57:59 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MGCP_Test: check payload type of received RTP packets In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10150 ) Change subject: MGCP_Test: check payload type of received RTP packets ...................................................................... MGCP_Test: check payload type of received RTP packets When an RTP packet is received, the payload type is not checked, so we will not detect if the MGW emits packets with a wrong payload type for some reason. - Introduce a statistics counter that counts packets with wrong PT - Update testcases so that they check for the statistics for wrong PT count. Change-Id: I83d4b04656a16ced624024245a2fcb7a0ad48a8a Related: OS#3384 --- M library/RTP_Emulation.ttcn M mgw/MGCP_Test.ttcn 2 files changed, 36 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/library/RTP_Emulation.ttcn b/library/RTP_Emulation.ttcn index 71cd8db..2a358a9 100644 --- a/library/RTP_Emulation.ttcn +++ b/library/RTP_Emulation.ttcn @@ -116,6 +116,8 @@ integer num_pkts_rx_err_seq, /* number of packets received wrong timestamp */ integer num_pkts_rx_err_ts, + /* number of packets received wrong payload type */ + integer num_pkts_rx_err_pt, /* number of packets received during Rx disable */ integer num_pkts_rx_err_disabled } @@ -127,6 +129,7 @@ bytes_payload_rx := 0, num_pkts_rx_err_seq := 0, num_pkts_rx_err_ts := 0, + num_pkts_rx_err_pt := 0, num_pkts_rx_err_disabled := 0 } @@ -399,7 +402,11 @@ /* process received RTCP/RTP if receiver enabled */ [g_rx_enabled] RTP.receive(tr_rtp) -> value rx_rtp { //log("RX RTP: ", rx_rtp); + /* increment counters */ + if (rx_rtp.msg.rtp.payload_type != g_cfg.tx_payload_type) { + g_stats_rtp.num_pkts_rx_err_pt := g_stats_rtp.num_pkts_rx_err_pt+1; + } g_stats_rtp.num_pkts_rx := g_stats_rtp.num_pkts_rx+1; g_stats_rtp.bytes_payload_rx := g_stats_rtp.bytes_payload_rx + lengthof(rx_rtp.msg.rtp.data); diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn index 82ed608..264ac28 100644 --- a/mgw/MGCP_Test.ttcn +++ b/mgw/MGCP_Test.ttcn @@ -970,6 +970,9 @@ if (stats.num_pkts_rx_err_ts != 0) { setverdict(fail); } + if (stats.num_pkts_rx_err_pt != 0) { + setverdict(fail); + } if (stats.num_pkts_rx_err_disabled != 0) { setverdict(fail); } @@ -1008,6 +1011,9 @@ if (stats.num_pkts_rx_err_ts != 0) { setverdict(fail); } + if (stats.num_pkts_rx_err_pt != 0) { + setverdict(fail); + } if (stats.num_pkts_rx_err_disabled != 0) { setverdict(fail); } @@ -1062,6 +1068,11 @@ mtc.stop; } + if (stats[0].num_pkts_rx_err_pt > 0 or stats[1].num_pkts_rx_err_pt > 0) { + setverdict(fail, "RTP packets with wrong payload type received"); + mtc.stop; + } + setverdict(pass); } @@ -1163,12 +1174,20 @@ setverdict(fail, "number of packets not within normal parameters"); mtc.stop; } + if (stats[0].num_pkts_rx_err_pt > 0) { + setverdict(fail, "RTP packets with wrong payload type received"); + mtc.stop; + } temp := stats[1].num_pkts_tx - num_pkts_tx[1] - stats[0].num_pkts_rx; if (temp > 3 or temp < -3) { setverdict(fail, "number of packets not within normal parameters"); mtc.stop; } + if (stats[0].num_pkts_rx_err_pt > 0) { + setverdict(fail, "RTP packets with wrong payload type received"); + mtc.stop; + } /* Tear down */ f_flow_delete(RTPEM[0]); @@ -1221,6 +1240,11 @@ mtc.stop; } + if (stats[0].num_pkts_rx_err_pt > 0 or stats[1].num_pkts_rx_err_pt > 0) { + setverdict(fail, "RTP packets with wrong payload type received"); + mtc.stop; + } + setverdict(pass); } @@ -1284,6 +1308,11 @@ mtc.stop; } + if (stats[0].num_pkts_rx_err_pt > 0 or stats[1].num_pkts_rx_err_pt > 0) { + setverdict(fail, "RTP packets with wrong payload type received"); + mtc.stop; + } + setverdict(pass); } -- To view, visit https://gerrit.osmocom.org/10150 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I83d4b04656a16ced624024245a2fcb7a0ad48a8a Gerrit-Change-Number: 10150 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 18:59:02 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 18:59:02 +0000 Subject: Change in osmo-mgw[master]: git-version-gen: Don't check for .git directory In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10143 ) Change subject: git-version-gen: Don't check for .git directory ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10143 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I83b84099c34d593a8a384f001a8131c2a8085606 Gerrit-Change-Number: 10143 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 24 Jul 2018 18:59:02 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 18:59:05 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 18:59:05 +0000 Subject: Change in osmo-mgw[master]: git-version-gen: Don't check for .git directory In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10143 ) Change subject: git-version-gen: Don't check for .git directory ...................................................................... git-version-gen: Don't check for .git directory This check is not in all our repos that use git-version-gen. Indeed it seems to be a leftover of openbsc where I think it wanted to ensure being called in the openbsc subfolder or something? libosmocore e.g. doesn't have it. In any case .git being a directory is not always true (if using git worktree) so remove this check. Change-Id: I83b84099c34d593a8a384f001a8131c2a8085606 --- M git-version-gen 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/git-version-gen b/git-version-gen index 8e59c5a..42cf3d2 100755 --- a/git-version-gen +++ b/git-version-gen @@ -92,8 +92,8 @@ if test -n "$v" then : # use $v -elif test -d ./.git \ - && v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ +elif + v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ || git describe --abbrev=4 HEAD 2>/dev/null` \ && case $v in [0-9]*) ;; -- To view, visit https://gerrit.osmocom.org/10143 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I83b84099c34d593a8a384f001a8131c2a8085606 Gerrit-Change-Number: 10143 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 18:59:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 18:59:14 +0000 Subject: Change in libosmo-sccp[master]: git-version-gen: Don't check for .git directory In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10139 ) Change subject: git-version-gen: Don't check for .git directory ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10139 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic14561f3b041bb94d1b60e477b18e37077ce4c32 Gerrit-Change-Number: 10139 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Tue, 24 Jul 2018 18:59:14 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 18:59:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 18:59:23 +0000 Subject: Change in osmo-msc[master]: git-version-gen: Don't check for .git directory In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10141 ) Change subject: git-version-gen: Don't check for .git directory ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10141 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9d895fa90991d47e9626a8e7fa701540b658194c Gerrit-Change-Number: 10141 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 24 Jul 2018 18:59:23 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 18:59:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 18:59:27 +0000 Subject: Change in osmo-bsc[master]: git-version-gen: Don't check for .git directory In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10140 ) Change subject: git-version-gen: Don't check for .git directory ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10140 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I976dd4ff20cc5b220b244b1fb6192c0528c32638 Gerrit-Change-Number: 10140 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 24 Jul 2018 18:59:27 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 18:59:30 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 18:59:30 +0000 Subject: Change in osmo-sgsn[master]: git-version-gen: Don't check for .git directory In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10142 ) Change subject: git-version-gen: Don't check for .git directory ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10142 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4385cc4fb87ca4354a3c608a18aa3d2eb03a744f Gerrit-Change-Number: 10142 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 24 Jul 2018 18:59:30 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 19:00:12 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 19:00:12 +0000 Subject: Change in osmocom-bb[master]: trxcon/scheduler: fix: check primitive len before encoding In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10137 ) Change subject: trxcon/scheduler: fix: check primitive len before encoding ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10137 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I258ee9f6d0124b183b1db23a73f1e523fcea89a8 Gerrit-Change-Number: 10137 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling Gerrit-Comment-Date: Tue, 24 Jul 2018 19:00:12 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 19:00:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 19:00:14 +0000 Subject: Change in osmocom-bb[master]: trxcon/scheduler: fix: check primitive len before encoding In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10137 ) Change subject: trxcon/scheduler: fix: check primitive len before encoding ...................................................................... trxcon/scheduler: fix: check primitive len before encoding We used to trust (and still doing this) the messages coming from L1CTL interface too much, and not to check the primitive length before passing the payload to the libosmocoding API. As was discovered and described in OS#3415, sending a L1CTL message (either DATA_REQ, or TRAFFIC_REQ) with an incorrect length (lower than expected) may cause heap overflow. Let's explicitly check a primitive before encoding, and drop it if its length doesn't match the expected value(s). Change-Id: I258ee9f6d0124b183b1db23a73f1e523fcea89a8 Fixes: OS#3415 --- M src/host/trxcon/sched_lchan_rach.c M src/host/trxcon/sched_lchan_tchf.c M src/host/trxcon/sched_lchan_xcch.c 3 files changed, 29 insertions(+), 3 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, but someone else must approve Stefan Sperling: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/src/host/trxcon/sched_lchan_rach.c b/src/host/trxcon/sched_lchan_rach.c index 3f6e2e1..a255efb 100644 --- a/src/host/trxcon/sched_lchan_rach.c +++ b/src/host/trxcon/sched_lchan_rach.c @@ -69,6 +69,15 @@ uint8_t payload[36]; int rc; + /* Check the prim payload length */ + if (lchan->prim->payload_len != sizeof(*req)) { + LOGP(DSCHD, LOGL_ERROR, "Primitive has odd length %zu (expected %zu), " + "so dropping...\n", lchan->prim->payload_len, sizeof(*req)); + + sched_prim_drop(lchan); + return -EINVAL; + } + /* Get the payload from a current primitive */ req = (struct l1ctl_rach_req *) lchan->prim->payload; diff --git a/src/host/trxcon/sched_lchan_tchf.c b/src/host/trxcon/sched_lchan_tchf.c index 80e4d52..e20b461 100644 --- a/src/host/trxcon/sched_lchan_tchf.c +++ b/src/host/trxcon/sched_lchan_tchf.c @@ -232,9 +232,17 @@ return -EINVAL; } - /* Determine payload length */ - if (lchan->prim->payload_len == GSM_MACBLOCK_LEN) - l2_len = GSM_MACBLOCK_LEN; + /* Determine and check the payload length */ + if (lchan->prim->payload_len == GSM_MACBLOCK_LEN) { + l2_len = GSM_MACBLOCK_LEN; /* FACCH */ + } else if (lchan->prim->payload_len != l2_len) { + LOGP(DSCHD, LOGL_ERROR, "Primitive has odd length %zu " + "(expected %zu for TCH or %u for FACCH), so dropping...\n", + lchan->prim->payload_len, l2_len, GSM_MACBLOCK_LEN); + + sched_prim_drop(lchan); + return -EINVAL; + } /* Shift buffer by 4 bursts back for interleaving */ memcpy(buffer, buffer + 464, 464); diff --git a/src/host/trxcon/sched_lchan_xcch.c b/src/host/trxcon/sched_lchan_xcch.c index 04c9f4e..b31f727 100644 --- a/src/host/trxcon/sched_lchan_xcch.c +++ b/src/host/trxcon/sched_lchan_xcch.c @@ -141,6 +141,15 @@ return 0; } + /* Check the prim payload length */ + if (lchan->prim->payload_len != GSM_MACBLOCK_LEN) { + LOGP(DSCHD, LOGL_ERROR, "Primitive has odd length %zu (expected %u), " + "so dropping...\n", lchan->prim->payload_len, GSM_MACBLOCK_LEN); + + sched_prim_drop(lchan); + return -EINVAL; + } + /* Encode payload */ rc = gsm0503_xcch_encode(buffer, lchan->prim->payload); if (rc) { -- To view, visit https://gerrit.osmocom.org/10137 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I258ee9f6d0124b183b1db23a73f1e523fcea89a8 Gerrit-Change-Number: 10137 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 19:01:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 19:01:27 +0000 Subject: Change in osmo-bsc[master]: rename gsm_04_08_utils.[hc] to gsm_04_08_rr In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10145 ) Change subject: rename gsm_04_08_utils.[hc] to gsm_04_08_rr ...................................................................... Patch Set 1: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/10145/1/src/osmo-bsc/osmo_bsc_filter.c File src/osmo-bsc/osmo_bsc_filter.c: https://gerrit.osmocom.org/#/c/10145/1/src/osmo-bsc/osmo_bsc_filter.c at 29 PS1, Line 29: #include why do we #include it twice? -- To view, visit https://gerrit.osmocom.org/10145 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0ffff63d57f03cb324df8e40e41caea5b55a2c85 Gerrit-Change-Number: 10145 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 24 Jul 2018 19:01:27 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 19:02:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 19:02:32 +0000 Subject: Change in libosmocore[master]: stats_statsd: sanitize statsd name In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10133 ) Change subject: stats_statsd: sanitize statsd name ...................................................................... Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/10133/1/src/stats_statsd.c File src/stats_statsd.c: https://gerrit.osmocom.org/#/c/10133/1/src/stats_statsd.c at 73 PS1, Line 73: in it's actually inout, as the bufer is modified. -- To view, visit https://gerrit.osmocom.org/10133 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib46d08481e8ca04afd97cb9ae241e4e39c91ad66 Gerrit-Change-Number: 10133 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 24 Jul 2018 19:02:32 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 19:02:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 19:02:54 +0000 Subject: Change in libosmo-abis[master]: e1_input.c: Replace '.' in counter names with ':' In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10130 ) Change subject: e1_input.c: Replace '.' in counter names with ':' ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10130 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I730d1acdd5562cd2c1758ceee31193010b14337d Gerrit-Change-Number: 10130 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 24 Jul 2018 19:02:54 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 19:02:56 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 19:02:56 +0000 Subject: Change in libosmo-abis[master]: e1_input.c: Replace '.' in counter names with ':' In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10130 ) Change subject: e1_input.c: Replace '.' in counter names with ':' ...................................................................... e1_input.c: Replace '.' in counter names with ':' The '.' is illegal character in counter names, as they are exported via CTRL interface, where '.' has a special meaning that cannot be used by strings comprising the variable name. Change-Id: I730d1acdd5562cd2c1758ceee31193010b14337d --- M src/e1_input.c 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/e1_input.c b/src/e1_input.c index 11949a1..4717830 100644 --- a/src/e1_input.c +++ b/src/e1_input.c @@ -58,13 +58,13 @@ static const struct rate_ctr_desc e1inp_ctr_d[] = { [E1I_CTR_HDLC_ABORT] = { - "hdlc.abort", "HDLC abort" + "hdlc:abort", "HDLC abort" }, [E1I_CTR_HDLC_BADFCS] = { - "hdlc.bad_fcs", "HLDC Bad FCS" + "hdlc:bad_fcs", "HLDC Bad FCS" }, [E1I_CTR_HDLC_OVERR] = { - "hdlc.overrun", "HDLC Overrun" + "hdlc:overrun", "HDLC Overrun" }, [E1I_CTR_ALARM] = { "alarm", "Alarm" -- To view, visit https://gerrit.osmocom.org/10130 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I730d1acdd5562cd2c1758ceee31193010b14337d Gerrit-Change-Number: 10130 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 19:03:03 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 19:03:03 +0000 Subject: Change in osmo-sgsn[master]: gbproxy: Replace '.' in counter names with ':' In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10127 ) Change subject: gbproxy: Replace '.' in counter names with ':' ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10127 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I93a2e5b6ec66c9edb6e93d95032e788f552af44b Gerrit-Change-Number: 10127 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 24 Jul 2018 19:03:03 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 19:03:13 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 19:03:13 +0000 Subject: Change in osmo-sgsn[master]: sgsn: gtp: Use new API to send PDP DEL CTX REQ without freeing ctx lo... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10019 ) Change subject: sgsn: gtp: Use new API to send PDP DEL CTX REQ without freeing ctx locally ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10019 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I304c59de5d137b81de3c6df0fdbe911ae3dbd1f3 Gerrit-Change-Number: 10019 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Neels Hofmeyr Gerrit-Comment-Date: Tue, 24 Jul 2018 19:03:13 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 19:03:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 19:03:23 +0000 Subject: Change in osmo-sgsn[master]: sgsn: gtp: Use new API to send PDP DEL CTX REQ without freeing ctx lo... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10019 ) Change subject: sgsn: gtp: Use new API to send PDP DEL CTX REQ without freeing ctx locally ...................................................................... sgsn: gtp: Use new API to send PDP DEL CTX REQ without freeing ctx locally Previous API freed the ctx immediatelly after sending the packet, which triggered a call to cb_delete_context() and dropped the entire sgsn_pdp_ctx before the PDP DEL CTX ACCEPT was received. This new API won't free the pdp ctx and we can tear down everything once we receive the ACCEPT in cb_conf. cb_conf is not automatically freed at cb_conf, user needs to free it, so we need to remove setting pctx->lib to NULL in cb_conf to avoid leaking the pdp ctx, as it needs to be freed inside sgsn_pdp_ctx_free(). Depends: osmo-ggsn (libgtp) Change-Id I29d366253bb98dcba328c7ce8aa3e4daf8f75e6c. Change-Id: I304c59de5d137b81de3c6df0fdbe911ae3dbd1f3 --- M src/gprs/sgsn_libgtp.c 1 file changed, 2 insertions(+), 6 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 23b8811..3813397 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -314,10 +314,10 @@ /* SGSN wants to delete a PDP context */ int sgsn_delete_pdp_ctx(struct sgsn_pdp_ctx *pctx) { - LOGPDPCTXP(LOGL_ERROR, pctx, "Delete PDP Context\n"); + LOGPDPCTXP(LOGL_INFO, pctx, "Delete PDP Context\n"); /* FIXME: decide if we need teardown or not ! */ - return gtp_delete_context_req(pctx->ggsn->gsn, pctx->lib, pctx, 1); + return gtp_delete_context_req2(pctx->ggsn->gsn, pctx->lib, pctx, 1); } struct cause_map { @@ -573,10 +573,6 @@ "is not available\n"); } - /* unlink the now non-existing library handle from the pdp - * context */ - pctx->lib = NULL; - sgsn_pdp_ctx_free(pctx); return rc; -- To view, visit https://gerrit.osmocom.org/10019 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I304c59de5d137b81de3c6df0fdbe911ae3dbd1f3 Gerrit-Change-Number: 10019 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 19:03:37 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 19:03:37 +0000 Subject: Change in osmo-sgsn[master]: sgsn: Fix crash using new libgtp cb_recovery2 API In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10025 ) Change subject: sgsn: Fix crash using new libgtp cb_recovery2 API ...................................................................... Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10025 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0989c00e18ca95a099e1a312940eaac71957b444 Gerrit-Change-Number: 10025 Gerrit-PatchSet: 6 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Neels Hofmeyr Gerrit-Comment-Date: Tue, 24 Jul 2018 19:03:37 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 19:03:40 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 19:03:40 +0000 Subject: Change in osmo-sgsn[master]: sgsn: Fix crash using new libgtp cb_recovery2 API In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10025 ) Change subject: sgsn: Fix crash using new libgtp cb_recovery2 API ...................................................................... sgsn: Fix crash using new libgtp cb_recovery2 API When PDP CTX CREATE ACK is received with an increased RestartCtr, cb_recovery2 is called first, which will dettach ggsn from al pdp ctx (free the pdp_t). But when giving control back from the ctrl, libgtp still uses that freed ctx and sends it back to osmo-sgsn through cb_conf(). As specs state in any case that we need to handle the message containing the increased RestartCtr as valid, we then need to avoid freeing the pdp ctx and leave handling for later in cb_conf. Depends: osmo-ggsn (libgtp) Change-Id I53e92298f2f6b84d662a3300d922e8c2ccb178bc. Change-Id: I0989c00e18ca95a099e1a312940eaac71957b444 --- M include/osmocom/sgsn/gprs_sgsn.h M src/gprs/gprs_sgsn.c M src/gprs/sgsn_libgtp.c 3 files changed, 16 insertions(+), 9 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/sgsn/gprs_sgsn.h b/include/osmocom/sgsn/gprs_sgsn.h index 8eba2d4..6f16dc7 100644 --- a/include/osmocom/sgsn/gprs_sgsn.h +++ b/include/osmocom/sgsn/gprs_sgsn.h @@ -362,7 +362,7 @@ struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_addr(struct in_addr *addr); struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_find_alloc(uint32_t id); void sgsn_ggsn_ctx_drop_pdp(struct sgsn_pdp_ctx *pctx); -int sgsn_ggsn_ctx_drop_all_pdp(struct sgsn_ggsn_ctx *ggsn); +int sgsn_ggsn_ctx_drop_all_pdp_except(struct sgsn_ggsn_ctx *ggsn, struct sgsn_pdp_ctx *except); void sgsn_ggsn_ctx_add_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx *pdp); void sgsn_ggsn_ctx_remove_pdp(struct sgsn_ggsn_ctx *ggc, struct sgsn_pdp_ctx *pdp); diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c index e6d88e3..9046157 100644 --- a/src/gprs/gprs_sgsn.c +++ b/src/gprs/gprs_sgsn.c @@ -714,13 +714,17 @@ } /* High-level function to be called in case a GGSN has disappeared or - * otherwise lost state (recovery procedure) */ -int sgsn_ggsn_ctx_drop_all_pdp(struct sgsn_ggsn_ctx *ggsn) + * otherwise lost state (recovery procedure). It will detach all related pdp ctx + * from a ggsn and communicate deact to MS. Optionally (!NULL), one pdp ctx can + * be kept alive to allow handling later message which contained the Recovery IE. */ +int sgsn_ggsn_ctx_drop_all_pdp_except(struct sgsn_ggsn_ctx *ggsn, struct sgsn_pdp_ctx *except) { int num = 0; struct sgsn_pdp_ctx *pdp, *pdp2; llist_for_each_entry_safe(pdp, pdp2, &ggsn->pdp_list, ggsn_list) { + if (pdp == except) + continue; sgsn_ggsn_ctx_drop_pdp(pdp); num++; } diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 3813397..7829796 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -591,9 +591,10 @@ } /* Any message received by GGSN contains a recovery IE */ -static int cb_recovery(struct sockaddr_in *peer, uint8_t recovery) +static int cb_recovery2(struct sockaddr_in *peer, struct pdp_t *pdp, uint8_t recovery) { struct sgsn_ggsn_ctx *ggsn; + struct sgsn_pdp_ctx *pctx = NULL; ggsn = sgsn_ggsn_ctx_by_addr(&peer->sin_addr); if (!ggsn) { @@ -606,11 +607,13 @@ ggsn->remote_restart_ctr = recovery; } else if (ggsn->remote_restart_ctr != recovery) { /* counter has changed (GGSN restart): release all PDP */ - LOGP(DGPRS, LOGL_NOTICE, "GGSN recovery (%u->%u), " - "releasing all PDP contexts\n", - ggsn->remote_restart_ctr, recovery); + LOGP(DGPRS, LOGL_NOTICE, "GGSN recovery (%u->%u) pdp=%p, " + "releasing all%s PDP contexts\n", + ggsn->remote_restart_ctr, recovery, pdp, pdp ? " other" : ""); ggsn->remote_restart_ctr = recovery; - sgsn_ggsn_ctx_drop_all_pdp(ggsn); + if (pdp) + pctx = pdp->priv; + sgsn_ggsn_ctx_drop_all_pdp_except(ggsn, pctx); } return 0; } @@ -896,7 +899,7 @@ /* Register callbackcs with libgtp */ gtp_set_cb_delete_context(gsn, cb_delete_context); gtp_set_cb_conf(gsn, cb_conf); - gtp_set_cb_recovery(gsn, cb_recovery); + gtp_set_cb_recovery2(gsn, cb_recovery2); gtp_set_cb_data_ind(gsn, cb_data_ind); gtp_set_cb_unsup_ind(gsn, cb_unsup_ind); gtp_set_cb_extheader_ind(gsn, cb_extheader_ind); -- To view, visit https://gerrit.osmocom.org/10025 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I0989c00e18ca95a099e1a312940eaac71957b444 Gerrit-Change-Number: 10025 Gerrit-PatchSet: 6 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-CC: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 19:03:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 19:03:48 +0000 Subject: Change in osmo-sgsn[master]: gbproxy: Replace '.' in counter names with ':' In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10127 ) Change subject: gbproxy: Replace '.' in counter names with ':' ...................................................................... gbproxy: Replace '.' in counter names with ':' The '.' is illegal character in counter names, as they are exported via CTRL interface, where '.' has a special meaning that cannot be used by strings comprising the variable name. Change-Id: I93a2e5b6ec66c9edb6e93d95032e788f552af44b --- M src/gprs/gb_proxy.c 1 file changed, 6 insertions(+), 6 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/gprs/gb_proxy.c b/src/gprs/gb_proxy.c index 7d21518..447772f 100644 --- a/src/gprs/gb_proxy.c +++ b/src/gprs/gb_proxy.c @@ -57,12 +57,12 @@ { "inv-lai", "Invalid Location Area Identifier" }, { "inv-rai", "Invalid Routing Area Identifier " }, { "inv-nsei", "No BVC established for NSEI " }, - { "proto-err.bss", "BSSGP protocol error (BSS )" }, - { "proto-err.sgsn", "BSSGP protocol error (SGSN)" }, - { "not-supp.bss", "Feature not supported (BSS )" }, - { "not-supp.sgsn", "Feature not supported (SGSN)" }, - { "restart.sgsn", "Restarted RESET procedure (SGSN)" }, - { "tx-err.sgsn", "NS Transmission error (SGSN)" }, + { "proto-err:bss", "BSSGP protocol error (BSS )" }, + { "proto-err:sgsn", "BSSGP protocol error (SGSN)" }, + { "not-supp:bss", "Feature not supported (BSS )" }, + { "not-supp:sgsn", "Feature not supported (SGSN)" }, + { "restart:sgsn", "Restarted RESET procedure (SGSN)" }, + { "tx-err:sgsn", "NS Transmission error (SGSN)" }, { "error", "Other error " }, { "mod-peer-err", "Patch error: no peer " }, }; -- To view, visit https://gerrit.osmocom.org/10127 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I93a2e5b6ec66c9edb6e93d95032e788f552af44b Gerrit-Change-Number: 10127 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 19:04:38 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 19:04:38 +0000 Subject: Change in osmo-ci[master]: jobs: osmo-gsm-tester-builder: Fix typo in job parameter name In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10126 ) Change subject: jobs: osmo-gsm-tester-builder: Fix typo in job parameter name ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10126 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib0ab7f8796b8b78d5f21b7a4f541fd3ddffc95a4 Gerrit-Change-Number: 10126 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Tue, 24 Jul 2018 19:04:38 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 19:05:09 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 19:05:09 +0000 Subject: Change in osmo-ttcn3-hacks[master]: introduce a TTCN3 test suite for SCCP In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9653 ) Change subject: introduce a TTCN3 test suite for SCCP ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9653 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I03f5e8b282a7396b45417495c88d8fb81b26cda8 Gerrit-Change-Number: 9653 Gerrit-PatchSet: 4 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-Comment-Date: Tue, 24 Jul 2018 19:05:09 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 19:05:10 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 19:05:10 +0000 Subject: Change in osmo-ttcn3-hacks[master]: introduce a TTCN3 test suite for SCCP In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9653 ) Change subject: introduce a TTCN3 test suite for SCCP ...................................................................... introduce a TTCN3 test suite for SCCP This test suite acts as an SCCP server on top of M3UA. SCCP tests are run against the sccp_demo_user program which can be found in libosmo-sccp/examples. This program must be started in client mode: sccp_demo_user -c The SCCP test suite should then work out of the box with the provided SCCP_Tests.cfg file and this additional change to sccp_demo_user default point codes: https://gerrit.osmocom.org/#/c/libosmo-sccp/+/9652/ There is currently only one test, for the libosmo-sccp crash reported as issue OS#2666. The implementation of this test is currently using an ugly workaround due to shortcomings of the M3UA Emulation layer (see source code comments). Whether a better solution is feasible is still to be determined. The test requires a patch to the SCCP Protocol Emulation which has been submitted upstream: https://git.eclipse.org/r/#/c/124552/ Change-Id: I03f5e8b282a7396b45417495c88d8fb81b26cda8 Related: OS#2666 --- M Makefile M bsc/BSC_Tests.ttcn M bsc/gen_links.sh M library/BSSAP_Adapter.ttcn A library/SCCP_Templates.ttcn M msc/MSC_Tests.ttcn M msc/gen_links.sh A sccp/SCCP_Tests.cfg A sccp/SCCP_Tests.default A sccp/SCCP_Tests.ttcn A sccp/gen_links.sh A sccp/regen_makefile.sh 12 files changed, 336 insertions(+), 17 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Makefile b/Makefile index a12a504..074e151 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -SUBDIRS=bsc bsc-nat bts ggsn_tests hlr lapdm mgw msc pcu selftest sgsn sip sysinfo +SUBDIRS=bsc bsc-nat bts ggsn_tests hlr lapdm mgw msc pcu sccp selftest sgsn sip sysinfo NPROC=$(shell nproc 2>/dev/null) ifeq ($(NPROC),) diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index d71d3dc..9412251 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -46,6 +46,7 @@ import from L3_Templates all; import from GSM_RR_Types all; +import from SCCP_Templates all; import from BSSMAP_Templates all; const integer NUM_BTS := 3; diff --git a/bsc/gen_links.sh b/bsc/gen_links.sh index a6a1b0a..3e27cb1 100755 --- a/bsc/gen_links.sh +++ b/bsc/gen_links.sh @@ -67,7 +67,7 @@ gen_links $DIR $FILES DIR=../library -FILES="General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn Osmocom_VTY_Functions.ttcn Native_Functions.ttcn Native_FunctionDefs.cc IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp L3_Templates.ttcn BSSMAP_Templates.ttcn BSSMAP_Emulation.ttcn RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn RSL_Emulation.ttcn MGCP_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc BSSAP_CodecPort.ttcn BSSAP_Adapter.ttcn Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunct.ttcn RTP_CodecPort_CtrlFunctDef.cc RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_EncDec.cc IuUP_Emulation.ttcn " +FILES="General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn Osmocom_VTY_Functions.ttcn Native_Functions.ttcn Native_FunctionDefs.cc IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp L3_Templates.ttcn BSSMAP_Templates.ttcn BSSMAP_Emulation.ttcn RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn RSL_Emulation.ttcn MGCP_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc BSSAP_CodecPort.ttcn BSSAP_Adapter.ttcn Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunct.ttcn RTP_CodecPort_CtrlFunctDef.cc RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_EncDec.cc IuUP_Emulation.ttcn SCCP_Templates.ttcn" gen_links $DIR $FILES ignore_pp_results diff --git a/library/BSSAP_Adapter.ttcn b/library/BSSAP_Adapter.ttcn index b29d03f..ada66d2 100644 --- a/library/BSSAP_Adapter.ttcn +++ b/library/BSSAP_Adapter.ttcn @@ -18,6 +18,7 @@ import from SCCP_Types all; import from SCCPasp_Types all; import from SCCP_Emulation all; +import from SCCP_Templates all; import from SCTPasp_Types all; import from SCTPasp_PortType all; @@ -59,20 +60,6 @@ integer rctx }; -/* construct a SCCP_PAR_Address with just PC + SSN and no GT */ -template (value) SCCP_PAR_Address ts_SccpAddr_PC_SSN(integer pc, integer ssn, octetstring sio, - charstring sccp_srv_type) := { - addressIndicator := { - pointCodeIndic := '1'B, - ssnIndicator := '1'B, - globalTitleIndic := '0000'B, - routingIndicator := '1'B - }, - signPointCode := SCCP_SPC_int2bit(pc, sccp_srv_type, sio), - subsystemNumber := ssn, - globalTitle := omit -} - private function init_pars(inout BSSAP_Adapter ba, in BSSAP_Configuration cfg) { ba.sccp_pars := { sio := { diff --git a/library/SCCP_Templates.ttcn b/library/SCCP_Templates.ttcn new file mode 100644 index 0000000..f4019b8 --- /dev/null +++ b/library/SCCP_Templates.ttcn @@ -0,0 +1,47 @@ +/* (C) 2018 by sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + +module SCCP_Templates { + +import from SCCP_Types all; +import from SCCPasp_Types all; +import from SCCP_Emulation all; + +/* construct a SCCP_PAR_Address with just PC + SSN and no GT */ +template (value) SCCP_PAR_Address ts_SccpAddr_PC_SSN(integer pc, integer ssn, octetstring sio, + charstring sccp_srv_type) := { + addressIndicator := { + pointCodeIndic := '1'B, + ssnIndicator := '1'B, + globalTitleIndic := '0000'B, + routingIndicator := '1'B + }, + signPointCode := SCCP_SPC_int2bit(pc, sccp_srv_type, sio), + subsystemNumber := ssn, + globalTitle := omit +} + +/* construct a SCCP_PAR_Address with only GT */ +template (value) SCCP_PAR_Address ts_SccpAddr_GT(hexstring global_address) := { + addressIndicator := { + pointCodeIndic := '0'B, + ssnIndicator := '0'B, + globalTitleIndic := '0001'B, // NAI only + routingIndicator := cg_route_on_GT // route on GT + }, + signPointCode := omit, + subsystemNumber := omit, + globalTitle := { + gti0001 := { + natureOfAddress := '0000011'B, + oddeven := '0'B, + globalTitleAddress := global_address + } + } +} + +} diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index 63cab84..1427fd0 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -51,6 +51,8 @@ import from SMPP_Templates all; import from SMPP_Emulation all; +import from SCCP_Templates all; + import from SS_Types all; import from SS_Templates all; import from USSD_Helpers all; diff --git a/msc/gen_links.sh b/msc/gen_links.sh index 8b40268..d8a7d22 100755 --- a/msc/gen_links.sh +++ b/msc/gen_links.sh @@ -90,7 +90,7 @@ FILES+="RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunctDef.cc " FILES+="MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunctDef.cc " FILES+="SMPP_CodecPort.ttcn SMPP_CodecPort_CtrlFunct.ttcn SMPP_CodecPort_CtrlFunctDef.cc SMPP_Emulation.ttcn SMPP_Templates.ttcn " -FILES+="SS_Templates.ttcn " +FILES+="SS_Templates.ttcn SCCP_Templates.ttcn" gen_links $DIR $FILES ignore_pp_results diff --git a/sccp/SCCP_Tests.cfg b/sccp/SCCP_Tests.cfg new file mode 100644 index 0000000..4b7e742 --- /dev/null +++ b/sccp/SCCP_Tests.cfg @@ -0,0 +1,19 @@ +[ORDERED_INCLUDE] +# Common configuration, shared between test suites +"../Common.cfg" +# testsuite specific configuration, not expected to change +"./SCCP_Tests.default" + +# Local configuration below + +[LOGGING] + +[TESTPORT_PARAMETERS] + +[MODULE_PARAMETERS] + +[MAIN_CONTROLLER] + +[EXECUTE] +SCCP_Tests.control +#SCCP_Tests.TC_routing_global_title_crash diff --git a/sccp/SCCP_Tests.default b/sccp/SCCP_Tests.default new file mode 100644 index 0000000..7d16e5b --- /dev/null +++ b/sccp/SCCP_Tests.default @@ -0,0 +1,41 @@ +[LOGGING] +FileMask := LOG_ALL | TTCN_MATCHING | DEBUG_ENCDEC; + +BSSAP.FileMask := LOG_NOTHING; +"SCCP_Test_M3UA".FileMask := ERROR | WARNING; +"SCCP_Test_SCCP".FileMask := ERROR | WARNING; +"IPA-CTRL-IPA".FileMask := ERROR | WARNING; +mtc.FileMask := ERROR | WARNING; + +[TESTPORT_PARAMETERS] +*.SCCP_DEMO_USER_VTY.CTRL_MODE := "client" +*.SCCP_DEMO_USER_VTY.CTRL_HOSTNAME := "127.0.0.1" +*.SCCP_DEMO_USER_VTY.CTRL_PORTNUM := "2325" +*.SCCP_DEMO_USER_VTY.CTRL_LOGIN_SKIPPED := "yes" +*.SCCP_DEMO_USER_VTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" +*.SCCP_DEMO_USER_VTY.CTRL_READMODE := "buffered" +*.SCCP_DEMO_USER_VTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" +*.SCCP_DEMO_USER_VTY.PROMPT1 := "sccp-demo-user> " + +[MODULE_PARAMETERS] +M3UA_Emulation.tsp_logVerbose := true; +M3UA_Emulation.tsp_SCTP_Server_Mode := true; +M3UA_Emulation.tsp_M3UA_Server_Mode := true; +SCCP_Tests.sccp_cfg := { + { + sccp_service_type := "mtp3_itu", + sctp_addr := { 2905, "127.0.0.1", 2905, "127.0.0.2" }, + own_pc := 185, + own_ssn := 254, + peer_pc := 23, + peer_ssn := 254, + sio := '83'O, + rctx := 0 + } +}; + +Osmocom_VTY_Functions.mp_prompt_prefix := "sccp-demo-user"; + +[MAIN_CONTROLLER] + +[EXECUTE] diff --git a/sccp/SCCP_Tests.ttcn b/sccp/SCCP_Tests.ttcn new file mode 100644 index 0000000..ea2522a --- /dev/null +++ b/sccp/SCCP_Tests.ttcn @@ -0,0 +1,153 @@ +/* (C) 2018 by sysmocom s.f.m.c. GmbH + * Author: Stefan Sperling + * All Rights Reserved + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + +module SCCP_Tests { + +import from M3UA_Emulation all; + +import from SCCPasp_Types all; +import from SCCP_Types all; +import from SCCP_Emulation all; +import from SCCP_Templates all; + +import from SCTPasp_PortType all; + +import from Osmocom_CTRL_Adapter all; + +import from TELNETasp_PortType all; +import from Osmocom_VTY_Functions all; + +type component system_CT { + port SCTPasp_PT sctp; +}; + +type component MTC_CT extends CTRL_Adapter_CT { + /* VTY to sccp_demo_user (not used yet) */ + port TELNETasp_PT SCCP_DEMO_USER_VTY; + + /* SCCP protocol runs on top of M3UA Emulation. + * "System Under Test" is libosmo-sccp's sccp_demo_user example program. */ + var SCCP_CT vc_SCCP_A; + var M3UA_CT vc_M3UA; + port SCCPasp_PT A_PORT; +} + +type record SCCP_Configuration { + charstring sccp_service_type, + SCTP_Association_Address sctp_addr, + integer own_pc, + integer own_ssn, + integer peer_pc, + integer peer_ssn, + octetstring sio, + integer rctx +}; + +type record of SCCP_Configuration SCCP_Configurations; +modulepar { + SCCP_Configurations sccp_cfg; +} + +function f_init(SCCP_Configuration cfg) runs on MTC_CT { + var MSC_SCCP_MTP3_parameters v_param := { + sio := { + ni := substr(oct2bit(cfg.sio),0,2), + prio := substr(oct2bit(cfg.sio),2,2), + si := substr(oct2bit(cfg.sio),4,4) + }, + opc := cfg.own_pc, + dpc := cfg.peer_pc, + sls := 0, + sccp_serviceType := cfg.sccp_service_type, + ssn := cfg.own_ssn + }; + + map(self:SCCP_DEMO_USER_VTY, system:SCCP_DEMO_USER_VTY); + f_vty_set_prompts(SCCP_DEMO_USER_VTY); + f_vty_transceive(SCCP_DEMO_USER_VTY, "enable"); + + /* Create and connect test components for an SCCP connection with M3UA beneath. */ + vc_SCCP_A := SCCP_CT.create; + vc_M3UA := M3UA_CT.create; + connect(self:A_PORT, vc_SCCP_A:SCCP_SP_PORT); + connect(vc_M3UA:MTP3_SP_PORT, vc_SCCP_A:MTP3_SCCP_PORT); + map(vc_M3UA:SCTP_PORT, system:sctp); + + vc_M3UA.start(f_M3UA_Emulation(cfg.sctp_addr)); + vc_SCCP_A.start(SCCPStart(v_param)); +} + +function f_cleanup() runs on MTC_CT { + all component.stop; + unmap(vc_M3UA:SCTP_PORT, system:sctp); + disconnect(vc_M3UA:MTP3_SP_PORT, vc_SCCP_A:MTP3_SCCP_PORT); + disconnect(self:A_PORT, vc_SCCP_A:SCCP_SP_PORT); + self.stop +} + +/* + * libosmo-sccp does not support Global Title address as a routing indicator. + * But sccp_demo_user should not crash if such a message is received (see OS#2666). + */ +testcase TC_routing_global_title_crash() runs on MTC_CT system system_CT { + timer TL_timer:= 10.0; /* twice the sccp_demo_user connection attempt interval */ + var SCCP_PAR_Address v_CallingAddress; + var SCCP_PAR_Address v_CalledAddress; + var octetstring vl_userdata :='12345678901234567890'O; + var ASP_SCCP_N_UNITDATA_ind vl_N_UNITDATA_ind; + + f_init(sccp_cfg[0]); + + /* Called address with routing indicator set to Global Title Address. This used to trigger the crash. */ + v_CalledAddress := valueof(ts_SccpAddr_GT('012345'H)); + + v_CallingAddress := valueof(ts_SccpAddr_PC_SSN(sccp_cfg[0].own_pc, sccp_cfg[0].own_ssn, + sccp_cfg[0].sio, sccp_cfg[0].sccp_service_type)); + A_PORT.send(t_ASP_N_UNITDATA_req(v_CalledAddress, v_CallingAddress, '00000001'B /* sequence control */, + '00000001'B /* return option */, vl_userdata, omit)); + + /* + * Start a timeout within which our DATA packet will be sent out. + * The M3UA Emulation layer has buffered the packet and is going + * to send it when the sccp_demo_user SCCP client connects. + * + * libosmo-sccp will echo the packet back at us in an SCCP UDTS packet. + * However, the current M3UA Emulation implementation will discard this + * response because it arrives on a separate SCTP association and the + * emulation only supports one association at a time. + * + * As a workaround, we wait for a fixed amount of time and then issue + * another command to the VTY of sccp_demo_user. If sccp_demo_user + * has crashed, this will result in a test failure. + */ + TL_timer.start; + alt { + [] A_PORT.receive(tr_ASP_N_UNITDATA_ind) -> value vl_N_UNITDATA_ind { + log("Received data from SCCP client."); + repeat; + } + + [] TL_timer.timeout { + log("Timeout...."); + } + } + TL_timer.stop; + + /* Check that the VTY is still active (implying that the process hasn't crashed). */ + f_vty_transceive_ret(SCCP_DEMO_USER_VTY, "?"); + setverdict(pass); + + f_cleanup(); +} + +control { + execute( TC_routing_global_title_crash() ); +} + + +} diff --git a/sccp/gen_links.sh b/sccp/gen_links.sh new file mode 100755 index 0000000..faf347c --- /dev/null +++ b/sccp/gen_links.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +BASEDIR=../deps + +. ../gen_links.sh.inc + +DIR=$BASEDIR/titan.TestPorts.UNIX_DOMAIN_SOCKETasp/src +FILES="UD_PT.cc UD_PT.hh UD_PortType.ttcn UD_Types.ttcn" +gen_links $DIR $FILES + +DIR=$BASEDIR/titan.Libraries.TCCUsefulFunctions/src +FILES="TCCInterface_Functions.ttcn TCCConversion_Functions.ttcn TCCConversion.cc TCCInterface.cc TCCInterface_ip.h" +FILES+=" TCCEncoding_Functions.ttcn TCCEncoding.cc " # GSM 7-bit coding +gen_links $DIR $FILES + +DIR=$BASEDIR/titan.TestPorts.Common_Components.Socket-API/src +FILES="Socket_API_Definitions.ttcn" +gen_links $DIR $FILES + +# Required by MGCP and IPA +DIR=$BASEDIR/titan.TestPorts.IPL4asp/src +FILES="IPL4asp_Functions.ttcn IPL4asp_PT.cc IPL4asp_PT.hh IPL4asp_PortType.ttcn IPL4asp_Types.ttcn IPL4asp_discovery.cc IPL4asp_protocol_L234.hh" +gen_links $DIR $FILES + +# required by M3UA_Emulation +DIR=$BASEDIR/titan.ProtocolModules.M3UA/src +FILES="M3UA_Types.ttcn" +gen_links $DIR $FILES + +# required by M3UA_Emulation +DIR=$BASEDIR/titan.TestPorts.SCTPasp/src +FILES="SCTPasp_PT.cc SCTPasp_PT.hh SCTPasp_PortType.ttcn SCTPasp_Types.ttcn" +gen_links $DIR $FILES + +# required by M3UA Emulation +DIR=$BASEDIR/titan.TestPorts.MTP3asp/src +FILES="MTP3asp_PortType.ttcn MTP3asp_Types.ttcn" +gen_links $DIR $FILES + +# required by SCCP Emulation +DIR=$BASEDIR/titan.ProtocolEmulations.M3UA/src +FILES="M3UA_Emulation.ttcn" +gen_links $DIR $FILES + +DIR=$BASEDIR/titan.ProtocolEmulations.SCCP/src +FILES="SCCP_Emulation.ttcn SCCP_EncDec.cc SCCP_Mapping.ttcnpp SCCP_Types.ttcn SCCPasp_Types.ttcn" +gen_links $DIR $FILES + +DIR=$BASEDIR/titan.TestPorts.TELNETasp/src +FILES="TELNETasp_PT.cc TELNETasp_PT.hh TELNETasp_PortType.ttcn" +gen_links $DIR $FILES + + +DIR=../library +FILES="General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn " +FILES+="Osmocom_VTY_Functions.ttcn Native_Functions.ttcn Native_FunctionDefs.cc " +FILES+="IPA_Types.ttcn IPA_Emulation.ttcnpp IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc " +FILES+="Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn " +FILES+="SCCP_Templates.ttcn " +gen_links $DIR $FILES + +ignore_pp_results diff --git a/sccp/regen_makefile.sh b/sccp/regen_makefile.sh new file mode 100755 index 0000000..fc9e6d2 --- /dev/null +++ b/sccp/regen_makefile.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +FILES="*.ttcn *.ttcnpp SCCP_EncDec.cc SCTPasp_PT.cc TCCConversion.cc TCCInterface.cc UD_PT.cc IPL4asp_PT.cc IPL4asp_discovery.cc IPA_CodecPort_CtrlFunctDef.cc TELNETasp_PT.cc Native_FunctionDefs.cc TCCEncoding.cc " + +export CPPFLAGS_TTCN3="-DIPA_EMULATION_SCCP -DUSE_MTP3_DISTRIBUTOR" + +../regen-makefile.sh SCCP_Tests.ttcn $FILES -- To view, visit https://gerrit.osmocom.org/9653 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I03f5e8b282a7396b45417495c88d8fb81b26cda8 Gerrit-Change-Number: 9653 Gerrit-PatchSet: 5 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 19:05:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 19:05:41 +0000 Subject: Change in simtrace2[master]: cardem: fix typo In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10121 ) Change subject: cardem: fix typo ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10121 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ibeeb01b21a3ccfa74642f13694a20054e920837e Gerrit-Change-Number: 10121 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 24 Jul 2018 19:05:41 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 19:06:01 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 19:06:01 +0000 Subject: Change in simtrace2[master]: cardem: fix USB message parsing In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10122 ) Change subject: cardem: fix USB message parsing ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10122 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ifbb53dbf478d8dade82251f769e78e1306e77434 Gerrit-Change-Number: 10122 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 24 Jul 2018 19:06:01 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 19:06:19 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 19:06:19 +0000 Subject: Change in simtrace2[master]: I2C: add wait time after write to let EEPROM write In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10123 ) Change subject: I2C: add wait time after write to let EEPROM write ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10123 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I42c90b8d0329e425f275067e87d584212a43a90b Gerrit-Change-Number: 10123 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 24 Jul 2018 19:06:19 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 19:06:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 19:06:53 +0000 Subject: Change in simtrace2[master]: I2C: return error after failed write In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10124 ) Change subject: I2C: return error after failed write ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10124 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8d2d090c5f4d1195f4c7eb29b3958a7bb05f56ec Gerrit-Change-Number: 10124 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 24 Jul 2018 19:06:53 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 19:07:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 19:07:18 +0000 Subject: Change in simtrace2[master]: USB: print decoded USB error In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10125 ) Change subject: USB: print decoded USB error ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10125 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie7f20e3eff03acf77eb08283747ca8e032b9b4c8 Gerrit-Change-Number: 10125 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 24 Jul 2018 19:07:18 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 19:07:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 19:07:20 +0000 Subject: Change in simtrace2[master]: cardem: fix typo In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10121 ) Change subject: cardem: fix typo ...................................................................... cardem: fix typo Change-Id: Ibeeb01b21a3ccfa74642f13694a20054e920837e --- M firmware/libcommon/source/card_emu.c M firmware/libcommon/source/mode_cardemu.c 2 files changed, 8 insertions(+), 8 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libcommon/source/card_emu.c b/firmware/libcommon/source/card_emu.c index 94a601a..25ec36a 100644 --- a/firmware/libcommon/source/card_emu.c +++ b/firmware/libcommon/source/card_emu.c @@ -189,7 +189,7 @@ return msg; } -/* Update cardemu_usb_msg_rx_data length + submit bufffer */ +/* Update cardemu_usb_msg_rx_data length + submit buffer */ static void flush_rx_buffer(struct card_handle *ch) { struct msgb *msg; @@ -202,14 +202,14 @@ ch->uart_rx_msg = NULL; - /* store length of data payload fild in header */ + /* store length of data payload field in header */ rd = (struct cardemu_usb_msg_rx_data *) msg->l2h; rd->data_len = msgb_l2len(msg) - sizeof(*rd); usb_buf_upd_len_and_submit(msg); } -/* convert a non-contiguous PTS request/responsei into a contiguous +/* convert a non-contiguous PTS request/response into a contiguous * buffer, returning the number of bytes used in the buffer */ static int serialize_pts(uint8_t *out, const uint8_t *in) { @@ -301,7 +301,7 @@ ch->fi = 1; ch->di = 1; emu_update_fidi(ch); - /* initialize todefault WI, this will be overwritten if we + /* initialize to default WI, this will be overwritten if we * receive TC2, and it will be programmed into hardware after * ATR is finished */ ch->wi = ISO7816_3_DEFAULT_WI; @@ -334,7 +334,7 @@ * PTS / PPS handling **********************************************************************/ -/* Update the ATR sub-state */ +/* Update the PTS sub-state */ static void set_pts_state(struct card_handle *ch, enum pts_state new_ptss) { TRACE_DEBUG("%u: 7816 PTS state %u -> %u\r\n", @@ -974,7 +974,7 @@ INIT_LLIST_HEAD(&ch->uart_tx_queue); - /* initialize the card_handle with reasonabe defaults */ + /* initialize the card_handle with reasonable defaults */ ch->num = slot_num; ch->irq_ep = irq_ep; ch->in_ep = in_ep; diff --git a/firmware/libcommon/source/mode_cardemu.c b/firmware/libcommon/source/mode_cardemu.c index b1d9c7a..7bb06f9 100644 --- a/firmware/libcommon/source/mode_cardemu.c +++ b/firmware/libcommon/source/mode_cardemu.c @@ -203,7 +203,7 @@ csr = usart->US_CSR & usart->US_IMR; if (csr & US_CSR_RXRDY) { - byte = (usart->US_RHR) & 0xFF; + byte = (usart->US_RHR) & 0xFF; if (rbuf_write(&ci->rb, byte) < 0) TRACE_ERROR("rbuf overrun\r\n"); } @@ -341,7 +341,7 @@ #endif /* DETECT_VCC_BY_ADC */ /*********************************************************************** - * Core USB / mainloop integration + * Core USB / main loop integration ***********************************************************************/ static void usim1_rst_irqhandler(const Pin *pPin) -- To view, visit https://gerrit.osmocom.org/10121 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ibeeb01b21a3ccfa74642f13694a20054e920837e Gerrit-Change-Number: 10121 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 19:07:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 19:07:21 +0000 Subject: Change in simtrace2[master]: cardem: fix USB message parsing In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10122 ) Change subject: cardem: fix USB message parsing ...................................................................... cardem: fix USB message parsing the msg->l2h pointer was not set but used later on, e.g. in dispatch_usb_command_cardem, case SIMTRACE_MSGT_DT_CEMU_SET_ATR): > case SIMTRACE_MSGT_DT_CEMU_SET_ATR: > > atr = (struct cardemu_usb_msg_set_atr *) msg->l2h; > > card_emu_set_atr(ci->ch, atr->atr, atr->atr_len); l2h is by default 0, thus not pointing to the actual message l2h. I wonder how cardem worked worked before with this issue though. Change-Id: Ifbb53dbf478d8dade82251f769e78e1306e77434 --- M firmware/libcommon/source/mode_cardemu.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libcommon/source/mode_cardemu.c b/firmware/libcommon/source/mode_cardemu.c index 7bb06f9..57d541b 100644 --- a/firmware/libcommon/source/mode_cardemu.c +++ b/firmware/libcommon/source/mode_cardemu.c @@ -593,6 +593,7 @@ usb_buf_free(msg); return; } + msg->l2h = msg->l1h + sizeof(*sh); switch (sh->msg_class) { case SIMTRACE_MSGC_GENERIC: @@ -604,7 +605,6 @@ case SIMTRACE_MSGC_MODEM: /* FIXME: Find out why this fails if used for != * MSGC_MODEM ?!? */ - msg->l2h = msg->l1h + sizeof(*sh); dispatch_usb_command_modem(msg, ci); break; default: -- To view, visit https://gerrit.osmocom.org/10122 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ifbb53dbf478d8dade82251f769e78e1306e77434 Gerrit-Change-Number: 10122 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 19:07:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 19:07:22 +0000 Subject: Change in simtrace2[master]: I2C: add wait time after write to let EEPROM write In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10123 ) Change subject: I2C: add wait time after write to let EEPROM write ...................................................................... I2C: add wait time after write to let EEPROM write The Atmel AT24C02 defines a maximum tWR waiting time after a byte write of 5 ms before a next write. Enforcing this wait time also fixed the failed verification in qmod, where it was reading 0xffff instead of the written value. Change-Id: I42c90b8d0329e425f275067e87d584212a43a90b --- M firmware/libboard/qmod/source/i2c.c 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libboard/qmod/source/i2c.c b/firmware/libboard/qmod/source/i2c.c index 06c7565..a708704 100644 --- a/firmware/libboard/qmod/source/i2c.c +++ b/firmware/libboard/qmod/source/i2c.c @@ -185,6 +185,8 @@ nack = i2c_write_byte(false, true, byte); if (nack) goto out_stop; + /* Wait tWR time to ensure EEPROM is writing correctly (tWR = 5 ms for AT24C02) */ + mdelay(5); out_stop: i2c_stop_cond(); -- To view, visit https://gerrit.osmocom.org/10123 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I42c90b8d0329e425f275067e87d584212a43a90b Gerrit-Change-Number: 10123 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 19:07:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 19:07:23 +0000 Subject: Change in simtrace2[master]: I2C: return error after failed write In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10124 ) Change subject: I2C: return error after failed write ...................................................................... I2C: return error after failed write The previous mechanism of retrying a failed write could become a infinite blocking loop (until watchdog tiemout). Also the array size is used to know how much data to write and verify instead of a constant. Change-Id: I8d2d090c5f4d1195f4c7eb29b3958a7bb05f56ec --- M firmware/libboard/qmod/source/board_qmod.c 1 file changed, 7 insertions(+), 7 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libboard/qmod/source/board_qmod.c b/firmware/libboard/qmod/source/board_qmod.c index 7ae1978..47a4cb6 100644 --- a/firmware/libboard/qmod/source/board_qmod.c +++ b/firmware/libboard/qmod/source/board_qmod.c @@ -70,8 +70,6 @@ #include "i2c.h" static int write_hub_eeprom(void) { - const unsigned int __eeprom_bin_len = 256; - int i; /* wait */ @@ -79,16 +77,18 @@ TRACE_INFO("Writing EEPROM...\n\r"); /* write the EEPROM once */ - for (i = 0; i < 256; i++) { + for (i = 0; i < ARRAY_SIZE(__eeprom_bin); i++) { int rc = eeprom_write_byte(0x50, i, __eeprom_bin[i]); - /* if the result was negative, repeat that write */ - if (rc < 0) - i--; + if (rc < 0) { + TRACE_ERROR("Writing EEPROM failed at byte %u: 0x%02x\n\r", + i, __eeprom_bin[i]); + return 1; + } } /* then pursue re-reading it again and again */ TRACE_INFO("Verifying EEPROM...\n\r"); - for (i = 0; i < 256; i++) { + for (i = 0; i < ARRAY_SIZE(__eeprom_bin); i++) { int byte = eeprom_read_byte(0x50, i); TRACE_INFO("0x%02x: %02x\n\r", i, byte); if (byte != __eeprom_bin[i]) -- To view, visit https://gerrit.osmocom.org/10124 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I8d2d090c5f4d1195f4c7eb29b3958a7bb05f56ec Gerrit-Change-Number: 10124 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 19:07:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 24 Jul 2018 19:07:23 +0000 Subject: Change in simtrace2[master]: USB: print decoded USB error In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10125 ) Change subject: USB: print decoded USB error ...................................................................... USB: print decoded USB error In case of error it also ensures the returned value is NULL. Else a segfault would occur because the caller (e.g. remsim) continued on with a free handler. Change-Id: Ie7f20e3eff03acf77eb08283747ca8e032b9b4c8 --- M host/libusb_util.c 1 file changed, 10 insertions(+), 5 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/host/libusb_util.c b/host/libusb_util.c index 8565372..cb435e2 100644 --- a/host/libusb_util.c +++ b/host/libusb_util.c @@ -250,34 +250,39 @@ (strlen(ifm->path) && !strcmp(path, ifm->path))) { rc = libusb_open(*dev, &usb_devh); if (rc < 0) { - perror("Cannot open device"); + fprintf(stderr, "Cannot open device: %s\n", libusb_error_name(rc)); + usb_devh = NULL; break; } rc = libusb_get_configuration(usb_devh, &config); if (rc < 0) { - perror("Cannot get current configuration"); + fprintf(stderr, "Cannot get current configuration: %s\n", libusb_error_name(rc)); libusb_close(usb_devh); + usb_devh = NULL; break; } if (config != ifm->configuration) { rc = libusb_set_configuration(usb_devh, ifm->configuration); if (rc < 0) { - perror("Cannot set configuration"); + fprintf(stderr, "Cannot set configuration: %s\n", libusb_error_name(rc)); libusb_close(usb_devh); + usb_devh = NULL; break; } } rc = libusb_claim_interface(usb_devh, ifm->interface); if (rc < 0) { - perror("Cannot claim interface"); + fprintf(stderr, "Cannot claim interface: %s\n", libusb_error_name(rc)); libusb_close(usb_devh); + usb_devh = NULL; break; } rc = libusb_set_interface_alt_setting(usb_devh, ifm->interface, ifm->altsetting); if (rc < 0) { - perror("Cannot set interface altsetting"); + fprintf(stderr, "Cannot set interface altsetting: %s\n", libusb_error_name(rc)); libusb_release_interface(usb_devh, ifm->interface); libusb_close(usb_devh); + usb_devh = NULL; break; } } -- To view, visit https://gerrit.osmocom.org/10125 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ie7f20e3eff03acf77eb08283747ca8e032b9b4c8 Gerrit-Change-Number: 10125 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 21:58:54 2018 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 24 Jul 2018 21:58:54 +0000 Subject: Change in osmo-gsm-tester[master]: ms: Quit early when all tests concluded.. In-Reply-To: References: Message-ID: Holger Freyther has submitted this change and it was merged. ( https://gerrit.osmocom.org/9716 ) Change subject: ms: Quit early when all tests concluded.. ...................................................................... ms: Quit early when all tests concluded.. And fix the the detection if everything has completed. Change-Id: I3575ee7618c35e3b66d25fa31844d267489d9179 --- M src/osmo_ms_driver/location_update_test.py 1 file changed, 11 insertions(+), 3 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo_ms_driver/location_update_test.py b/src/osmo_ms_driver/location_update_test.py index 2a3c246..4b1c499 100644 --- a/src/osmo_ms_driver/location_update_test.py +++ b/src/osmo_ms_driver/location_update_test.py @@ -35,6 +35,9 @@ assert self._time_of_lu is None self._time_of_lu = time + def has_lu_time(self): + return self._time_of_lu is not None + def lu_time(self): return self._time_of_lu or 0 @@ -64,6 +67,7 @@ self._results = {} imsi_gen = imsi_ki_gen() + self._outstanding = number_of_ms for i in range(0, number_of_ms): ms_name = "%.5d" % i @@ -155,6 +159,8 @@ elif data['type'] == 'event': if data['data']['lu_done'] == 1: ms = self._results[data['ms']] + if not ms.has_lu_time(): + self._outstanding = self._outstanding - 1 ms.set_lu_time(time) self.log("MS performed LU ", ms=ms, at=time, lu_delay=ms.lu_delay()) else: @@ -165,7 +171,7 @@ def wait_for_result(self, loop): to_complete_time = self._start_time + self.TEST_TIME.total_seconds() - while True: + while not self.all_completed(): now_time = time.clock_gettime(time.CLOCK_MONOTONIC) sleep_time = to_complete_time - now_time if sleep_time < 0: @@ -173,9 +179,11 @@ loop.schedule_timeout(sleep_time) loop.select() + def all_completed(self): + return self._outstanding == 0 + def print_stats(self): - from functools import reduce - all_completed = reduce(lambda b, ms: b and ms.lu_time() is not None, self._results.values(), True) + all_completed = self.all_completed() min_value = min(self._results.values(), key=lambda x: x.lu_delay()) max_value = max(self._results.values(), key=lambda x: x.lu_delay()) -- To view, visit https://gerrit.osmocom.org/9716 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I3575ee7618c35e3b66d25fa31844d267489d9179 Gerrit-Change-Number: 9716 Gerrit-PatchSet: 4 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 22:00:46 2018 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 24 Jul 2018 22:00:46 +0000 Subject: Change in osmo-gsm-tester[master]: ms: Simplify starting of the test and combine loop and wait In-Reply-To: References: Message-ID: Holger Freyther has submitted this change and it was merged. ( https://gerrit.osmocom.org/9717 ) Change subject: ms: Simplify starting of the test and combine loop and wait ...................................................................... ms: Simplify starting of the test and combine loop and wait This will make it easier to strt different kind of tests. The cost of calling step_once is hopefully neglectable as it simplifies the test. Change-Id: I3708ac382c0a34e17cf147d18f03603946437a53 --- M src/osmo_ms_driver/__main__.py M src/osmo_ms_driver/location_update_test.py 2 files changed, 45 insertions(+), 42 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, but someone else must approve Pau Espin Pedrol: Looks good to me, approved diff --git a/src/osmo_ms_driver/__main__.py b/src/osmo_ms_driver/__main__.py index abc5e54..ef06393 100644 --- a/src/osmo_ms_driver/__main__.py +++ b/src/osmo_ms_driver/__main__.py @@ -82,10 +82,7 @@ atexit.register(test.stop_all) # Run until everything has been launched - test.launch(loop) - - # Wait for it to complete - test.wait_for_result(loop) + test.run_test(loop) # Print stats test.print_stats() diff --git a/src/osmo_ms_driver/location_update_test.py b/src/osmo_ms_driver/location_update_test.py index 4b1c499..48c57eb 100644 --- a/src/osmo_ms_driver/location_update_test.py +++ b/src/osmo_ms_driver/location_update_test.py @@ -98,7 +98,7 @@ for phy in self._phys: phy.verify_ready() - def launch(self, loop): + def prepare(self, loop): self.log("Starting testcase") self.pre_launch(loop) @@ -108,40 +108,57 @@ self._cdf.duration().total_seconds() + \ timedelta(seconds=120).total_seconds() - current_time = self._start_time - step_size = self._cdf.step_size().total_seconds() self._started = [] - too_slow = 0 + self._too_slow = 0 + + def step_once(self, loop, current_time): + if len(self._unstarted) <= 0: + return current_time, None + + step_size = self._cdf.step_size().total_seconds() # Start self._cdf.step_once() - while len(self._unstarted) > 0: - # Check for timeout - # start pending MS - while len(self._started) < self._cdf.current_scaled_value() and len(self._unstarted) > 0: - ms = self._unstarted.pop(0) - ms.start(loop) - launch_time = time.clock_gettime(time.CLOCK_MONOTONIC) - self._results[ms.name_number()].set_launch_time(launch_time) - self._started.append(ms) + # Check for timeout + # start pending MS + while len(self._started) < self._cdf.current_scaled_value() and len(self._unstarted) > 0: + ms = self._unstarted.pop(0) + ms.start(loop) + launch_time = time.clock_gettime(time.CLOCK_MONOTONIC) + self._results[ms.name_number()].set_launch_time(launch_time) + self._started.append(ms) - # Progress and sleep - self._cdf.step_once() + now_time = time.clock_gettime(time.CLOCK_MONOTONIC) + sleep_time = (current_time + step_size) - now_time + if sleep_time <= 0: + self.log("Starting too slowly. Moving on", + target=(current_time + step_size), now=now_time, sleep=sleep_time) + self._too_slow += 1 + sleep_time = 0 + if len(self._unstarted) == 0: + end_time = time.clock_gettime(time.CLOCK_MONOTONIC) + self.log("All started...", too_slow=self._too_slow, duration=end_time - self._start_time) + return current_time, None + + return current_time + step_size, sleep_time + + def run_test(self, loop): + self.prepare(loop) + + to_complete_time = self._start_time + self.TEST_TIME.total_seconds() + tick_time = self._start_time + + while not self.all_completed(): + tick_time, sleep_time = self.step_once(loop, tick_time) now_time = time.clock_gettime(time.CLOCK_MONOTONIC) - sleep_time = (current_time + step_size) - now_time - if sleep_time <= 0: - self.log("Starting too slowly. Moving on", - target=(current_time + step_size), now=now_time, sleep=sleep_time) - too_slow += 1 - else: - loop.schedule_timeout(sleep_time) - loop.select() - current_time += step_size - - end_time = time.clock_gettime(time.CLOCK_MONOTONIC) - self.log("All started...", too_slow=too_slow, duration=end_time - self._start_time) + if sleep_time is None: + sleep_time = to_complete_time - now_time + if sleep_time < 0: + break + loop.schedule_timeout(sleep_time) + loop.select() def stop_all(self): for launcher in self._started: @@ -168,17 +185,6 @@ raise Exception("Unknown event type..:" + _data.decode()) - def wait_for_result(self, loop): - to_complete_time = self._start_time + self.TEST_TIME.total_seconds() - - while not self.all_completed(): - now_time = time.clock_gettime(time.CLOCK_MONOTONIC) - sleep_time = to_complete_time - now_time - if sleep_time < 0: - break - loop.schedule_timeout(sleep_time) - loop.select() - def all_completed(self): return self._outstanding == 0 -- To view, visit https://gerrit.osmocom.org/9717 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I3708ac382c0a34e17cf147d18f03603946437a53 Gerrit-Change-Number: 9717 Gerrit-PatchSet: 3 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 22:00:47 2018 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 24 Jul 2018 22:00:47 +0000 Subject: Change in osmo-gsm-tester[master]: ms: Only use completed tests for min/max handling In-Reply-To: References: Message-ID: Holger Freyther has submitted this change and it was merged. ( https://gerrit.osmocom.org/9718 ) Change subject: ms: Only use completed tests for min/max handling ...................................................................... ms: Only use completed tests for min/max handling Remove non completed results before calculating the min/max. We will need to check success/failure based on completion ratio. Change-Id: Icaf9e90dd729b2339e409b3ec1593f456969fd19 --- M src/osmo_ms_driver/location_update_test.py 1 file changed, 11 insertions(+), 3 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/src/osmo_ms_driver/location_update_test.py b/src/osmo_ms_driver/location_update_test.py index 48c57eb..848d8da 100644 --- a/src/osmo_ms_driver/location_update_test.py +++ b/src/osmo_ms_driver/location_update_test.py @@ -188,10 +188,18 @@ def all_completed(self): return self._outstanding == 0 + def results_min_max(self, results): + min_value = max_value = None + for result in results: + if min_value is None or result.lu_delay() < min_value: + min_value = result.lu_delay() + if max_value is None or result.lu_delay() > max_value: + max_value = result.lu_delay() + return min_value, max_value + def print_stats(self): all_completed = self.all_completed() - min_value = min(self._results.values(), key=lambda x: x.lu_delay()) - max_value = max(self._results.values(), key=lambda x: x.lu_delay()) + min_value, max_value = self.results_min_max(filter(lambda x: x.has_lu_time(), self._results.values())) self.log("Tests done", all_completed=all_completed, - min=min_value.lu_delay(), max=max_value.lu_delay()) + min=min_value, max=max_value) -- To view, visit https://gerrit.osmocom.org/9718 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Icaf9e90dd729b2339e409b3ec1593f456969fd19 Gerrit-Change-Number: 9718 Gerrit-PatchSet: 3 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 22:01:23 2018 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 24 Jul 2018 22:01:23 +0000 Subject: Change in osmo-gsm-tester[master]: ms: Remove unused imports In-Reply-To: References: Message-ID: Holger Freyther has submitted this change and it was merged. ( https://gerrit.osmocom.org/9719 ) Change subject: ms: Remove unused imports ...................................................................... ms: Remove unused imports Change-Id: Idd428d1bbd937a26a320eb69b1031856e49d3e4b --- M src/osmo_ms_driver/__main__.py M src/osmo_ms_driver/event_server.py M src/osmo_ms_driver/simple_loop.py 3 files changed, 1 insertion(+), 4 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/src/osmo_ms_driver/__main__.py b/src/osmo_ms_driver/__main__.py index ef06393..5314d71 100644 --- a/src/osmo_ms_driver/__main__.py +++ b/src/osmo_ms_driver/__main__.py @@ -19,14 +19,13 @@ from .event_server import EventServer from .simple_loop import SimpleLoop from .location_update_test import MassUpdateLocationTest -from .cdf import ease_in_out_duration, linear_with_duration, cdfs +from .cdf import cdfs from osmo_gsm_tester import log # System modules import argparse import atexit import datetime -import subprocess import signal import tempfile import os.path diff --git a/src/osmo_ms_driver/event_server.py b/src/osmo_ms_driver/event_server.py index b0f699d..ce9d5c1 100644 --- a/src/osmo_ms_driver/event_server.py +++ b/src/osmo_ms_driver/event_server.py @@ -1,6 +1,5 @@ from osmo_gsm_tester import log -from functools import partial import time diff --git a/src/osmo_ms_driver/simple_loop.py b/src/osmo_ms_driver/simple_loop.py index f4b3e05..29a4b5b 100644 --- a/src/osmo_ms_driver/simple_loop.py +++ b/src/osmo_ms_driver/simple_loop.py @@ -16,7 +16,6 @@ # along with this program. If not, see . from osmo_gsm_tester import log -from functools import partial import os import selectors -- To view, visit https://gerrit.osmocom.org/9719 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Idd428d1bbd937a26a320eb69b1031856e49d3e4b Gerrit-Change-Number: 9719 Gerrit-PatchSet: 3 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 24 22:01:24 2018 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 24 Jul 2018 22:01:24 +0000 Subject: Change in osmo-gsm-tester[master]: ms: Make the total test duration configurable In-Reply-To: References: Message-ID: Holger Freyther has submitted this change and it was merged. ( https://gerrit.osmocom.org/9720 ) Change subject: ms: Make the total test duration configurable ...................................................................... ms: Make the total test duration configurable Change-Id: I5598d5dfd51e224e13835307ad20d108a5aa3935 --- M src/osmo_ms_driver/__main__.py M src/osmo_ms_driver/location_update_test.py 2 files changed, 8 insertions(+), 4 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/src/osmo_ms_driver/__main__.py b/src/osmo_ms_driver/__main__.py index 5314d71..1573084 100644 --- a/src/osmo_ms_driver/__main__.py +++ b/src/osmo_ms_driver/__main__.py @@ -23,6 +23,8 @@ from osmo_gsm_tester import log # System modules +from datetime import timedelta + import argparse import atexit import datetime @@ -39,6 +41,9 @@ parser.add_argument('-i', '--launch-interval', dest='launch_interval', default=100, type=int, help="Time between launching in milliseconds") + parser.add_argument('-t', '--test-duration', dest="test_duration", + default=120, type=int, + help="Time of the test duration in seconds") parser.add_argument('-d', '--distribution', dest="cdf_name", choices=cdfs.keys(), default="ease_in_out", help="Curve to use for starting within launch duration") @@ -81,7 +86,7 @@ atexit.register(test.stop_all) # Run until everything has been launched - test.run_test(loop) + test.run_test(loop, timedelta(seconds=args.test_duration)) # Print stats test.print_stats() diff --git a/src/osmo_ms_driver/location_update_test.py b/src/osmo_ms_driver/location_update_test.py index 848d8da..2c59d97 100644 --- a/src/osmo_ms_driver/location_update_test.py +++ b/src/osmo_ms_driver/location_update_test.py @@ -55,7 +55,6 @@ TEMPLATE_LUA = "osmo-mobile-lu.lua" TEMPLATE_CFG = "osmo-mobile.cfg" - TEST_TIME = timedelta(seconds=120) def __init__(self, name, number_of_ms, cdf_function, event_server, tmp_dir): super().__init__(log.C_RUN, name) @@ -144,10 +143,10 @@ return current_time + step_size, sleep_time - def run_test(self, loop): + def run_test(self, loop, test_duration): self.prepare(loop) - to_complete_time = self._start_time + self.TEST_TIME.total_seconds() + to_complete_time = self._start_time + test_duration.total_seconds() tick_time = self._start_time while not self.all_completed(): -- To view, visit https://gerrit.osmocom.org/9720 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I5598d5dfd51e224e13835307ad20d108a5aa3935 Gerrit-Change-Number: 9720 Gerrit-PatchSet: 3 Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 01:53:42 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Wed, 25 Jul 2018 01:53:42 +0000 Subject: Change in osmo-iuh[master]: hnbgw: remove close_cb() to fix a crash when releasing a hnbgw In-Reply-To: References: Message-ID: lynxis lazus has posted comments on this change. ( https://gerrit.osmocom.org/10151 ) Change subject: hnbgw: remove close_cb() to fix a crash when releasing a hnbgw ...................................................................... Patch Set 1: The close_cb is only called within osmo_stream_srv_destroy(). osmo_stream_srv_* code itself does not call osmo_stream_srv_destroy() at least not our case. Leaving the osmo_stream_srv_destroy() within hnb_release() as the only function calling it. -- To view, visit https://gerrit.osmocom.org/10151 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic84b2184b7fc850c0de2acacf179e86771e17510 Gerrit-Change-Number: 10151 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Wed, 25 Jul 2018 01:53:42 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 01:54:57 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Wed, 25 Jul 2018 01:54:57 +0000 Subject: Change in libosmocore[master]: stats_statsd: sanitize statsd name In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10133 to look at the new patch set (#2). Change subject: stats_statsd: sanitize statsd name ...................................................................... stats_statsd: sanitize statsd name The statsd protocol use ':' as seperator between name and value. It's not allowed to use the seperator in a name. Replace ':' with '.' before sending the packet to the statsd server. Change-Id: Ib46d08481e8ca04afd97cb9ae241e4e39c91ad66 --- M src/stats_statsd.c 1 file changed, 22 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/33/10133/2 -- To view, visit https://gerrit.osmocom.org/10133 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib46d08481e8ca04afd97cb9ae241e4e39c91ad66 Gerrit-Change-Number: 10133 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 07:03:09 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Wed, 25 Jul 2018 07:03:09 +0000 Subject: Change in libosmo-sccp[master]: git-version-gen: Don't check for .git directory In-Reply-To: References: Message-ID: daniel has submitted this change and it was merged. ( https://gerrit.osmocom.org/10139 ) Change subject: git-version-gen: Don't check for .git directory ...................................................................... git-version-gen: Don't check for .git directory This check is not in all our repos that use git-version-gen. Indeed it seems to be a leftover of openbsc where I think it wanted to ensure being called in the openbsc subfolder or something? libosmocore e.g. doesn't have it. In any case .git being a directory is not always true (if using git worktree) so remove this check. Change-Id: Ic14561f3b041bb94d1b60e477b18e37077ce4c32 --- M git-version-gen 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/git-version-gen b/git-version-gen index 8e59c5a..42cf3d2 100755 --- a/git-version-gen +++ b/git-version-gen @@ -92,8 +92,8 @@ if test -n "$v" then : # use $v -elif test -d ./.git \ - && v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ +elif + v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ || git describe --abbrev=4 HEAD 2>/dev/null` \ && case $v in [0-9]*) ;; -- To view, visit https://gerrit.osmocom.org/10139 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ic14561f3b041bb94d1b60e477b18e37077ce4c32 Gerrit-Change-Number: 10139 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-CC: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 07:03:12 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Wed, 25 Jul 2018 07:03:12 +0000 Subject: Change in osmo-bsc[master]: git-version-gen: Don't check for .git directory In-Reply-To: References: Message-ID: daniel has submitted this change and it was merged. ( https://gerrit.osmocom.org/10140 ) Change subject: git-version-gen: Don't check for .git directory ...................................................................... git-version-gen: Don't check for .git directory This check is not in all our repos that use git-version-gen. Indeed it seems to be a leftover of openbsc where I think it wanted to ensure being called in the openbsc subfolder or something? libosmocore e.g. doesn't have it. In any case .git being a directory is not always true (if using git worktree) so remove this check. Change-Id: I976dd4ff20cc5b220b244b1fb6192c0528c32638 --- M git-version-gen 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/git-version-gen b/git-version-gen index 8e59c5a..42cf3d2 100755 --- a/git-version-gen +++ b/git-version-gen @@ -92,8 +92,8 @@ if test -n "$v" then : # use $v -elif test -d ./.git \ - && v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ +elif + v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ || git describe --abbrev=4 HEAD 2>/dev/null` \ && case $v in [0-9]*) ;; -- To view, visit https://gerrit.osmocom.org/10140 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I976dd4ff20cc5b220b244b1fb6192c0528c32638 Gerrit-Change-Number: 10140 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 07:03:13 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Wed, 25 Jul 2018 07:03:13 +0000 Subject: Change in osmo-msc[master]: git-version-gen: Don't check for .git directory In-Reply-To: References: Message-ID: daniel has submitted this change and it was merged. ( https://gerrit.osmocom.org/10141 ) Change subject: git-version-gen: Don't check for .git directory ...................................................................... git-version-gen: Don't check for .git directory This check is not in all our repos that use git-version-gen. Indeed it seems to be a leftover of openbsc where I think it wanted to ensure being called in the openbsc subfolder or something? libosmocore e.g. doesn't have it. In any case .git being a directory is not always true (if using git worktree) so remove this check. Change-Id: I9d895fa90991d47e9626a8e7fa701540b658194c --- M git-version-gen 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/git-version-gen b/git-version-gen index 8e59c5a..42cf3d2 100755 --- a/git-version-gen +++ b/git-version-gen @@ -92,8 +92,8 @@ if test -n "$v" then : # use $v -elif test -d ./.git \ - && v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ +elif + v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ || git describe --abbrev=4 HEAD 2>/dev/null` \ && case $v in [0-9]*) ;; -- To view, visit https://gerrit.osmocom.org/10141 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I9d895fa90991d47e9626a8e7fa701540b658194c Gerrit-Change-Number: 10141 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 07:03:14 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Wed, 25 Jul 2018 07:03:14 +0000 Subject: Change in osmo-sgsn[master]: git-version-gen: Don't check for .git directory In-Reply-To: References: Message-ID: daniel has submitted this change and it was merged. ( https://gerrit.osmocom.org/10142 ) Change subject: git-version-gen: Don't check for .git directory ...................................................................... git-version-gen: Don't check for .git directory This check is not in all our repos that use git-version-gen. Indeed it seems to be a leftover of openbsc where I think it wanted to ensure being called in the openbsc subfolder or something? libosmocore e.g. doesn't have it. In any case .git being a directory is not always true (if using git worktree) so remove this check. Change-Id: I4385cc4fb87ca4354a3c608a18aa3d2eb03a744f --- M git-version-gen 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/git-version-gen b/git-version-gen index 8e59c5a..42cf3d2 100755 --- a/git-version-gen +++ b/git-version-gen @@ -92,8 +92,8 @@ if test -n "$v" then : # use $v -elif test -d ./.git \ - && v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ +elif + v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ || git describe --abbrev=4 HEAD 2>/dev/null` \ && case $v in [0-9]*) ;; -- To view, visit https://gerrit.osmocom.org/10142 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I4385cc4fb87ca4354a3c608a18aa3d2eb03a744f Gerrit-Change-Number: 10142 Gerrit-PatchSet: 2 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 07:44:58 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 25 Jul 2018 07:44:58 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MGCP_Test: add function to check for RTP err counters Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/10154 Change subject: MGCP_Test: add function to check for RTP err counters ...................................................................... MGCP_Test: add function to check for RTP err counters At the moment we check the error counters of the RTP statistics in the testcases. However, in most situations we will do the check to make sure that no errors occurred (all counters == 0). Rather than having a long tail of if statements in the testcases we should have a function for this. This also makes it much easier in case we add more error countes lateron. - add and use function f_rtpem_stats_err_check() Change-Id: I69e5f80b0765284ec99056ce62c315461967d2a1 Related: OS#3384 --- M library/RTP_Emulation.ttcn M mgw/MGCP_Test.ttcn 2 files changed, 44 insertions(+), 47 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/54/10154/1 diff --git a/library/RTP_Emulation.ttcn b/library/RTP_Emulation.ttcn index 2a358a9..c752c22 100644 --- a/library/RTP_Emulation.ttcn +++ b/library/RTP_Emulation.ttcn @@ -242,6 +242,36 @@ return true; } +/* Check the statistics for general signs of errors. This is a basic general + * check that will fit most situations and is intended to be executed by + * the testcases as as needed. */ +function f_rtpem_stats_err_check(RtpemStats s) { + log("stats: ", s); + + /* Check if there was some activity at either on the RX or on the + * TX side, but complete silence would indicate some problem */ + if (s.num_pkts_tx < 1 and s.num_pkts_rx < 1) { + setverdict(fail, "no RTP packet activity detected (packets)"); + } + if (s.bytes_payload_tx < 1 and s.bytes_payload_rx < 1) { + setverdict(fail, "no RTP packet activity detected (bytes)"); + } + + /* Check error counters */ + if (s.num_pkts_rx_err_seq != 0) { + setverdict(fail, "RTP packet sequence number errors occurred"); + } + if (s.num_pkts_rx_err_ts != 0) { + setverdict(fail, "RTP packet timestamp errors occurred"); + } + if (s.num_pkts_rx_err_pt != 0) { + setverdict(fail, "RTP packet payload type errors occurred"); + } + if (s.num_pkts_rx_err_disabled != 0) { + setverdict(fail, "RTP packets received while RX was disabled"); + } +} + template PDU_RTP ts_RTP(BIT32_BO_LAST ssrc, INT7b pt, LIN2_BO_LAST seq, uint32_t ts, octetstring payload, BIT1 marker := '0'B) := { version := 2, diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn index 264ac28..a6d3460 100644 --- a/mgw/MGCP_Test.ttcn +++ b/mgw/MGCP_Test.ttcn @@ -961,21 +961,8 @@ if (stats.bytes_payload_tx < 190) { setverdict(fail); } - if (stats.num_pkts_rx != 0) { - setverdict(fail); - } - if (stats.num_pkts_rx_err_seq != 0) { - setverdict(fail); - } - if (stats.num_pkts_rx_err_ts != 0) { - setverdict(fail); - } - if (stats.num_pkts_rx_err_pt != 0) { - setverdict(fail); - } - if (stats.num_pkts_rx_err_disabled != 0) { - setverdict(fail); - } + + f_rtpem_stats_err_check(stats); setverdict(pass); } @@ -1005,18 +992,8 @@ if (stats.bytes_payload_tx != stats.bytes_payload_rx) { setverdict(fail); } - if (stats.num_pkts_rx_err_seq != 0) { - setverdict(fail); - } - if (stats.num_pkts_rx_err_ts != 0) { - setverdict(fail); - } - if (stats.num_pkts_rx_err_pt != 0) { - setverdict(fail); - } - if (stats.num_pkts_rx_err_disabled != 0) { - setverdict(fail); - } + + f_rtpem_stats_err_check(stats); setverdict(pass); } @@ -1068,10 +1045,8 @@ mtc.stop; } - if (stats[0].num_pkts_rx_err_pt > 0 or stats[1].num_pkts_rx_err_pt > 0) { - setverdict(fail, "RTP packets with wrong payload type received"); - mtc.stop; - } + f_rtpem_stats_err_check(stats[0]); + f_rtpem_stats_err_check(stats[1]); setverdict(pass); } @@ -1174,20 +1149,15 @@ setverdict(fail, "number of packets not within normal parameters"); mtc.stop; } - if (stats[0].num_pkts_rx_err_pt > 0) { - setverdict(fail, "RTP packets with wrong payload type received"); - mtc.stop; - } temp := stats[1].num_pkts_tx - num_pkts_tx[1] - stats[0].num_pkts_rx; if (temp > 3 or temp < -3) { setverdict(fail, "number of packets not within normal parameters"); mtc.stop; } - if (stats[0].num_pkts_rx_err_pt > 0) { - setverdict(fail, "RTP packets with wrong payload type received"); - mtc.stop; - } + + f_rtpem_stats_err_check(stats[0]); + f_rtpem_stats_err_check(stats[1]); /* Tear down */ f_flow_delete(RTPEM[0]); @@ -1240,10 +1210,8 @@ mtc.stop; } - if (stats[0].num_pkts_rx_err_pt > 0 or stats[1].num_pkts_rx_err_pt > 0) { - setverdict(fail, "RTP packets with wrong payload type received"); - mtc.stop; - } + f_rtpem_stats_err_check(stats[0]); + f_rtpem_stats_err_check(stats[0]); setverdict(pass); } @@ -1308,10 +1276,9 @@ mtc.stop; } - if (stats[0].num_pkts_rx_err_pt > 0 or stats[1].num_pkts_rx_err_pt > 0) { - setverdict(fail, "RTP packets with wrong payload type received"); - mtc.stop; - } + f_rtpem_stats_err_check(stats[0]); + f_rtpem_stats_err_check(stats[1]); + f_rtpem_stats_err_check(stats[2]); setverdict(pass); } -- To view, visit https://gerrit.osmocom.org/10154 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I69e5f80b0765284ec99056ce62c315461967d2a1 Gerrit-Change-Number: 10154 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 08:34:39 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 25 Jul 2018 08:34:39 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MGCP_Test: add function to check for RTP err counters In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10154 to look at the new patch set (#2). Change subject: MGCP_Test: add function to check for RTP err counters ...................................................................... MGCP_Test: add function to check for RTP err counters At the moment we check the error counters of the RTP statistics in the testcases. However, in most situations we will do the check to make sure that no errors occurred (all counters == 0). Rather than having a long tail of if statements in the testcases we should have a function for this. This also makes it much easier in case we add more error countes lateron. - add and use function f_rtpem_stats_err_check() Change-Id: I69e5f80b0765284ec99056ce62c315461967d2a1 Related: OS#3384 --- M library/RTP_Emulation.ttcn M mgw/MGCP_Test.ttcn 2 files changed, 50 insertions(+), 47 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/54/10154/2 -- To view, visit https://gerrit.osmocom.org/10154 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I69e5f80b0765284ec99056ce62c315461967d2a1 Gerrit-Change-Number: 10154 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 08:34:40 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 25 Jul 2018 08:34:40 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MGCP_Test: Test what happens when two ends use different PT Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/10155 Change subject: MGCP_Test: Test what happens when two ends use different PT ...................................................................... MGCP_Test: Test what happens when two ends use different PT It is legal that two connections use the same codec but negotiate different dynamic payload types for both connections. Then the MGW is expected to receive packets with one PT and send them with the other PT. This is currently not done in osmo-mgw so the two tests that this commit adds are expected to fail for now. - add testcase TC_two_crcx_diff_pt_and_rtp - add testcase TC_two_crcx_diff_pt_and_rtp_bidir Change-Id: Ib4606dfc08764410ee9e450949361544adb07cd3 Related: OS#3384 --- M mgw/MGCP_Test.ttcn M mgw/expected-results.xml 2 files changed, 24 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/55/10155/1 diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn index a6d3460..494e8bb 100644 --- a/mgw/MGCP_Test.ttcn +++ b/mgw/MGCP_Test.ttcn @@ -998,7 +998,8 @@ setverdict(pass); } - function f_TC_two_crcx_and_rtp(boolean bidir) runs on dummy_CT { + function f_TC_two_crcx_and_rtp(boolean bidir, charstring codec_name_a, integer pt_a, + charstring codec_name_b, integer pt_b) runs on dummy_CT { var RtpFlowData flow[2]; var RtpemStats stats[2]; var MgcpResponse resp; @@ -1009,13 +1010,13 @@ f_init(ep); /* from us to MGW */ - flow[0] := valueof(t_RtpFlow(mp_local_ip, mp_remote_ip, 98, "AMR/8000")); + flow[0] := valueof(t_RtpFlow(mp_local_ip, mp_remote_ip, pt_a, codec_name_a)); /* bind local RTP emulation sockets */ flow[0].em.portnr := 10000; f_flow_create(RTPEM[0], ep, call_id, "sendrecv", flow[0]); /* from MGW back to us */ - flow[1] := valueof(t_RtpFlow(mp_local_ip, mp_remote_ip, 98, "AMR/8000")); + flow[1] := valueof(t_RtpFlow(mp_local_ip, mp_remote_ip, pt_b, codec_name_b)); flow[1].em.portnr := 20000; f_flow_create(RTPEM[1], ep, call_id, "sendrecv", flow[1]); @@ -1053,13 +1054,23 @@ /* create two local RTP emulations; create two connections on MGW EP, exchange some data */ testcase TC_two_crcx_and_rtp() runs on dummy_CT { - f_TC_two_crcx_and_rtp(false); + f_TC_two_crcx_and_rtp(false, "AMR/8000", 98, "AMR/8000", 98); } /* create two local RTP emulations; create two connections on MGW EP, * exchange some data in both directions */ testcase TC_two_crcx_and_rtp_bidir() runs on dummy_CT { - f_TC_two_crcx_and_rtp(true); + f_TC_two_crcx_and_rtp(true, "AMR/8000", 98, "AMR/8000", 98); + } + + /* same as TC_two_crcx_and_rtp, but with different PT number on both ends */ + testcase TC_two_crcx_diff_pt_and_rtp() runs on dummy_CT { + f_TC_two_crcx_and_rtp(false, "AMR/8000", 98, "AMR/8000", 112); + } + + /* same as TC_two_crcx_and_rtp, but with different PT number on both ends */ + testcase TC_two_crcx_diff_pt_and_rtp_bidir() runs on dummy_CT { + f_TC_two_crcx_and_rtp(true, "AMR/8000", 98, "AMR/8000", 112); } /* create two local RTP emulations and pass data in both directions */ @@ -1328,6 +1339,8 @@ execute(TC_one_crcx_loopback_rtp()); execute(TC_two_crcx_and_rtp()); execute(TC_two_crcx_and_rtp_bidir()); + execute(TC_two_crcx_diff_pt_and_rtp()); + execute(TC_two_crcx_diff_pt_and_rtp_bidir()); execute(TC_two_crcx_mdcx_and_rtp()); execute(TC_two_crcx_and_unsolicited_rtp()); execute(TC_two_crcx_and_one_mdcx_rtp_ho()); diff --git a/mgw/expected-results.xml b/mgw/expected-results.xml index f201099..92b9351 100644 --- a/mgw/expected-results.xml +++ b/mgw/expected-results.xml @@ -34,6 +34,12 @@ + + RTP packet payload type errors occurred + + + RTP packet payload type errors occurred + -- To view, visit https://gerrit.osmocom.org/10155 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ib4606dfc08764410ee9e450949361544adb07cd3 Gerrit-Change-Number: 10155 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 08:51:57 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 25 Jul 2018 08:51:57 +0000 Subject: Change in osmo-ci[master]: jobs: osmo-gsm-tester-builder: Fix typo in job parameter name In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10126 ) Change subject: jobs: osmo-gsm-tester-builder: Fix typo in job parameter name ...................................................................... Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/10126 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib0ab7f8796b8b78d5f21b7a4f541fd3ddffc95a4 Gerrit-Change-Number: 10126 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Wed, 25 Jul 2018 08:51:57 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 08:52:01 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 25 Jul 2018 08:52:01 +0000 Subject: Change in osmo-ci[master]: jobs: osmo-gsm-tester-builder: Fix typo in job parameter name In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/10126 ) Change subject: jobs: osmo-gsm-tester-builder: Fix typo in job parameter name ...................................................................... jobs: osmo-gsm-tester-builder: Fix typo in job parameter name osmo-mgw is duplicated and osmo-bsc is not there. Change-Id: Ib0ab7f8796b8b78d5f21b7a4f541fd3ddffc95a4 --- M jobs/osmo-gsm-tester-builder.yml 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Pau Espin Pedrol: Verified diff --git a/jobs/osmo-gsm-tester-builder.yml b/jobs/osmo-gsm-tester-builder.yml index 48150c7..ac1e868 100644 --- a/jobs/osmo-gsm-tester-builder.yml +++ b/jobs/osmo-gsm-tester-builder.yml @@ -79,7 +79,7 @@ - add_param_build_branch: name: OSMO_GSM_TESTER_BUILD_osmo_mgw - add_param_build_branch: - name: OSMO_GSM_TESTER_BUILD_osmo-mgw + name: OSMO_GSM_TESTER_BUILD_osmo_bsc - add_param_build_branch: name: OSMO_GSM_TESTER_BUILD_osmo_msc - add_param_build_branch: -- To view, visit https://gerrit.osmocom.org/10126 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ib0ab7f8796b8b78d5f21b7a4f541fd3ddffc95a4 Gerrit-Change-Number: 10126 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 08:57:42 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 25 Jul 2018 08:57:42 +0000 Subject: Change in libosmocore[master]: logging: log_vty_command_string: Fix undercount of buf alloc size In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10134 ) Change subject: logging: log_vty_command_string: Fix undercount of buf alloc size ...................................................................... Patch Set 1: Hi Vadim, indeed this function can be longer improved, since it's clear from this fix that extra bytes are being allocated somewhere else (otherwise it would have failed until now). I wanted to avoid doing more changes which could lead to an error (like decrementing number of allocated bytes) to not mix new bugs with the feature. We can fix your comments in an extra commit later. Thanks for taking the time to investigate. -- To view, visit https://gerrit.osmocom.org/10134 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7aca0ce3d2981001e8081f7cee0dea3e2aaf8f7c Gerrit-Change-Number: 10134 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 25 Jul 2018 08:57:42 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 09:00:22 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 25 Jul 2018 09:00:22 +0000 Subject: Change in libosmocore[master]: logging: Fix logging level all In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10116 ) Change subject: logging: Fix logging level all ...................................................................... Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/10116/2/src/logging.c File src/logging.c: https://gerrit.osmocom.org/#/c/10116/2/src/logging.c at 724 PS2, Line 724: /* Reset all categories to UNSET */ > Let's implements this in a separate change, and focus [?] If you mean changing from a broken or nonsense behavior to a working behavior I agree, it changes behavior :-P. I can move this to another commit if required, let's discuss in the ML. -- To view, visit https://gerrit.osmocom.org/10116 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0f50ad8d6fd038398f7d751287417505c8dcdeff Gerrit-Change-Number: 10116 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 25 Jul 2018 09:00:22 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 09:46:18 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Wed, 25 Jul 2018 09:46:18 +0000 Subject: Change in osmo-bts[master]: preserve lchan-specific SI overrides on SACCH FILL Message-ID: Stefan Sperling has uploaded this change for review. ( https://gerrit.osmocom.org/10156 Change subject: preserve lchan-specific SI overrides on SACCH FILL ...................................................................... preserve lchan-specific SI overrides on SACCH FILL During SACCH FILL processing, update lchan SI values only for lchans which follow BTS-global default values, keeping lchan-specific overrides in place. Change-Id: I515bbd9983fa894507386b241863a9aa4d279497 Fixes: eee7247ebe0d0a54a54b53b739bdd434dfceb511 Related: OS#3173 --- M src/common/rsl.c 1 file changed, 10 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/56/10156/1 diff --git a/src/common/rsl.c b/src/common/rsl.c index e28f313..bcf36d7 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -564,10 +564,12 @@ if (TLVP_PRESENT(&tp, RSL_IE_L3_INFO)) { uint16_t len = TLVP_LEN(&tp, RSL_IE_L3_INFO); struct gsm_bts_trx *t; + sysinfo_buf_t old_bts_global_si; + memcpy(&old_bts_global_si, GSM_BTS_SI(bts, osmo_si), sizeof(old_bts_global_si)); lapdm_ui_prefix_bts(bts, TLVP_VAL(&tp, RSL_IE_L3_INFO), osmo_si, len); - /* Propagate SI change to all lchans. */ + /* Propagate SI change to all lchans which adhere to BTS-global default. */ llist_for_each_entry(t, &bts->trx_list, list) { int i, j; for (i = 0; i < ARRAY_SIZE(t->ts); i++) { @@ -576,6 +578,9 @@ struct gsm_lchan *lchan = &ts->lchan[j]; if (lchan->state == LCHAN_S_NONE) continue; + if (memcmp(&old_bts_global_si, GSM_LCHAN_SI(lchan, osmo_si), + sizeof(old_bts_global_si)) != 0) + continue; lapdm_ui_prefix_lchan(lchan, TLVP_VAL(&tp, RSL_IE_L3_INFO), osmo_si, len); } } @@ -588,7 +593,7 @@ bts->si_valid &= ~(1 << osmo_si); - /* Propagate SI change to all lchans. */ + /* Propagate SI change to all lchans which adhere to BTS-global default. */ llist_for_each_entry(t, &bts->trx_list, list) { int i, j; for (i = 0; i < ARRAY_SIZE(t->ts); i++) { @@ -597,6 +602,9 @@ struct gsm_lchan *lchan = &ts->lchan[j]; if (lchan->state == LCHAN_S_NONE) continue; + if (memcmp(GSM_BTS_SI(bts, osmo_si), GSM_LCHAN_SI(lchan, osmo_si), + sizeof(sysinfo_buf_t)) != 0) + continue; lchan->si.valid &= ~(1 << osmo_si); } } -- To view, visit https://gerrit.osmocom.org/10156 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I515bbd9983fa894507386b241863a9aa4d279497 Gerrit-Change-Number: 10156 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 09:51:33 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Wed, 25 Jul 2018 09:51:33 +0000 Subject: Change in osmo-ttcn3-hacks[master]: update expected test result for TC_sacch_multi_chg Message-ID: Stefan Sperling has uploaded this change for review. ( https://gerrit.osmocom.org/10157 Change subject: update expected test result for TC_sacch_multi_chg ...................................................................... update expected test result for TC_sacch_multi_chg This test is now passing, so expect it to pass instead of fail. Change-Id: I576f881fcb40c4fcbe6b6f767220111a0e9ffd3c Related: OS#3137 --- M bts/expected-results.xml 1 file changed, 1 insertion(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/57/10157/1 diff --git a/bts/expected-results.xml b/bts/expected-results.xml index 6cebb46..d1a65a3 100644 --- a/bts/expected-results.xml +++ b/bts/expected-results.xml @@ -8,9 +8,7 @@ - - Dynamic test case error: Error message was received from MC: The connect operation refers to test component with component reference 116, which has already terminated. - + -- To view, visit https://gerrit.osmocom.org/10157 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I576f881fcb40c4fcbe6b6f767220111a0e9ffd3c Gerrit-Change-Number: 10157 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 10:59:58 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Wed, 25 Jul 2018 10:59:58 +0000 Subject: Change in osmo-bts[master]: preserve lchan-specific SI overrides on SACCH FILL In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10156 to look at the new patch set (#2). Change subject: preserve lchan-specific SI overrides on SACCH FILL ...................................................................... preserve lchan-specific SI overrides on SACCH FILL During SACCH FILL processing, update lchan SI values only for lchans which follow BTS-global default values, keeping lchan-specific overrides in place. Change-Id: I515bbd9983fa894507386b241863a9aa4d279497 Fixes: eee7247ebe0d0a54a54b53b739bdd434dfceb511 Related: OS#3173 --- M include/osmo-bts/gsm_data_shared.h M src/common/rsl.c 2 files changed, 12 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/56/10156/2 -- To view, visit https://gerrit.osmocom.org/10156 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I515bbd9983fa894507386b241863a9aa4d279497 Gerrit-Change-Number: 10156 Gerrit-PatchSet: 2 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 13:44:13 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Wed, 25 Jul 2018 13:44:13 +0000 Subject: Change in osmo-ttcn3-hacks[master]: update expected test result for TC_sacch_multi_chg In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10157 to look at the new patch set (#2). Change subject: update expected test result for TC_sacch_multi_chg ...................................................................... update expected test result for TC_sacch_multi_chg This test is now passing, so expect it to pass instead of fail. Change-Id: I576f881fcb40c4fcbe6b6f767220111a0e9ffd3c Related: OS#3173 --- M bts/expected-results.xml 1 file changed, 1 insertion(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/57/10157/2 -- To view, visit https://gerrit.osmocom.org/10157 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I576f881fcb40c4fcbe6b6f767220111a0e9ffd3c Gerrit-Change-Number: 10157 Gerrit-PatchSet: 2 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 14:41:11 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 25 Jul 2018 14:41:11 +0000 Subject: Change in osmo-gsm-tester[master]: Add ttcn3-bts-test env Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10158 Change subject: Add ttcn3-bts-test env ...................................................................... Add ttcn3-bts-test env Change-Id: I3251a49503dc823f0ef1fe8ef5d68236a584dad4 --- M .gitignore M example/resources.conf.prod M example/resources.conf.rnd A src/osmo_gsm_tester/osmocon.py M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/suite.py A ttcn3/README.txt A ttcn3/default-suites.conf A ttcn3/defaults.conf A ttcn3/jenkins-run.sh A ttcn3/paths.conf A ttcn3/resources.conf.prod A ttcn3/resources.conf.rnd A ttcn3/scenarios/trx.conf A ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl A ttcn3/suites/ttcn3_bts_tests/scripts/run_ttcn3_docker.sh A ttcn3/suites/ttcn3_bts_tests/suite.conf A ttcn3/suites/ttcn3_bts_tests/ttcn3_bts_tests.py 18 files changed, 395 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/58/10158/1 diff --git a/.gitignore b/.gitignore index 8d3479b..a85b41a 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ *.pyc selftest/trial_test/ example/resources.conf +ttcn3/resources.conf diff --git a/example/resources.conf.prod b/example/resources.conf.prod index 8a9a534..6481254 100644 --- a/example/resources.conf.prod +++ b/example/resources.conf.prod @@ -114,3 +114,6 @@ auth_algo: 'comp128v1' ciphers: [a5_0, a5_1] features: ['gprs', 'sim'] + +osmocon_phone: + - serial_device: '/dev/serial/by-id/usb-Silicon_Labs_CP2104_USB_to_UART_Bridge_Controller_00897B41-if00-port0' diff --git a/example/resources.conf.rnd b/example/resources.conf.rnd index 7483260..05fce87 100644 --- a/example/resources.conf.rnd +++ b/example/resources.conf.rnd @@ -87,3 +87,6 @@ auth_algo: 'comp128v1' ciphers: [a5_0, a5_1] features: ['gprs', 'sim'] + +osmocon_phone: +- serial_device: '/dev/serial/by-id/usb-Silicon_Labs_CP2104_USB_to_UART_Bridge_Controller_0089279D-if00-port0' diff --git a/src/osmo_gsm_tester/osmocon.py b/src/osmo_gsm_tester/osmocon.py new file mode 100644 index 0000000..5b1e145 --- /dev/null +++ b/src/osmo_gsm_tester/osmocon.py @@ -0,0 +1,103 @@ +# osmo_gsm_tester: specifics for running an osmocon +# +# Copyright (C) 2018 by sysmocom - s.f.m.c. GmbH +# +# Author: Pau Espin Pedrol +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +import os +import tempfile + +from . import log, util, process +from .event_loop import MainLoop + +class Osmocon(log.Origin): + suite_run = None + run_dir = None + process = None + sk_tmp_dir = None + + FIRMWARE_FILE="opt/osmocom-bb/target/firmware/board/compal_e88/layer1.compalram.bin" + + def __init__(self, suite_run, conf): + serial_device = conf.get('serial_device') + if serial_device is None: + raise log.Error('osmocon_phone contains no attr "serial_device"') + self.serial_device = os.path.realpath(serial_device) + super().__init__(log.C_RUN, 'osmocon_%s' % os.path.basename(self.serial_device)) + self.suite_run = suite_run + self.conf = conf + self.sk_tmp_dir = tempfile.mkdtemp('', 'ogtosmoconsk') + if len(self.l2_socket_path().encode()) > 107: + raise log.Error('Path for l2 socket is longer than max allowed len for unix socket path (107):', self.l2_socket_path()) + if len(self.loader_socket_path().encode()) > 107: + raise log.Error('Path for loader socket is longer than max allowed len for unix socket path (107):', self.loader_socket_path()) + + def l2_socket_path(self): + return os.path.join(self.sk_tmp_dir, 'osmocom_l2') + + def loader_socket_path(self): + return os.path.join(self.sk_tmp_dir, 'osmocom_loader') + + def start(self): + self.log('Resetting the phone') + # TODO: make sure the pone is powered off before starting osmocon + + self.log('Starting osmocon') + self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name())) + + inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmocom-bb'))) + + binary = inst.child('sbin', 'osmocon') + if not os.path.isfile(binary): + raise RuntimeError('Binary missing: %r' % binary) + lib = inst.child('lib') + if not os.path.isdir(lib): + raise RuntimeError('No lib/ in %r' % inst) + + env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) } + + firmware_path = os.path.join(str(inst), Osmocon.FIRMWARE_FILE) + if not os.path.isfile(firmware_path): + raise RuntimeError('Binary missing: %r' % firmware_path) + self.dbg(run_dir=self.run_dir, binary=binary, env=env) + self.process = process.Process(self.name(), self.run_dir, + (binary, '-p', self.serial_device, + '-m', 'c123xor', + '-s', self.l2_socket_path(), + '-l', self.loader_socket_path(), + firmware_path), + env=env) + self.suite_run.remember_to_stop(self.process) + self.process.launch() + self.log('Waiting for osmocon to be up and running') + MainLoop.wait(self, os.path.exists, self.l2_socket_path()) + + def running(self): + return not self.process.terminated() + + def cleanup(self): + if self.sk_tmp_dir: + try: + os.remove(self.l2_socket_path()) + except OSError: + pass + try: + os.remove(self.loader_socket_path()) + except OSError: + pass + os.rmdir(self.sk_tmp_dir) + +# vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index 70d6e8a..28c4117 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -44,7 +44,8 @@ R_BTS = 'bts' R_ARFCN = 'arfcn' R_MODEM = 'modem' -R_ALL = (R_IP_ADDRESS, R_BTS, R_ARFCN, R_MODEM) +R_OSMOCON = 'osmocon_phone' +R_ALL = (R_IP_ADDRESS, R_BTS, R_ARFCN, R_MODEM, R_OSMOCON) RESOURCES_SCHEMA = { 'ip_address[].addr': schema.IPV4, @@ -76,6 +77,7 @@ 'modem[].auth_algo': schema.AUTH_ALGO, 'modem[].ciphers[]': schema.CIPHER, 'modem[].features[]': schema.MODEM_FEATURE, + 'osmocon_phone[].serial_device': schema.STR, } WANT_SCHEMA = util.dict_add( diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 618a39b..db4a8dc 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -23,7 +23,7 @@ import pprint from . import config, log, template, util, resource, schema, test from .event_loop import MainLoop -from . import osmo_nitb, osmo_hlr, osmo_mgcpgw, osmo_mgw, osmo_msc, osmo_bsc, osmo_stp, osmo_ggsn, osmo_sgsn, modem, esme +from . import osmo_nitb, osmo_hlr, osmo_mgcpgw, osmo_mgw, osmo_msc, osmo_bsc, osmo_stp, osmo_ggsn, osmo_sgsn, modem, esme, osmocon class Timeout(Exception): pass @@ -332,6 +332,12 @@ self.register_for_cleanup(esme_obj) return esme_obj + def osmocon(self, specifics=None): + conf = self.reserved_resources.get(resource.R_OSMOCON, specifics=specifics) + osmocon_obj = osmocon.Osmocon(self, conf=conf) + self.register_for_cleanup(osmocon_obj) + return osmocon_obj + def msisdn(self): msisdn = self.resources_pool.next_msisdn(self) self.log('using MSISDN', msisdn) diff --git a/ttcn3/README.txt b/ttcn3/README.txt new file mode 100644 index 0000000..3886c80 --- /dev/null +++ b/ttcn3/README.txt @@ -0,0 +1,20 @@ +This directory contains a set of scripts and osmo-gsm-tester testsuites to run +osmo-ttcn3-hacks.git BTS_tests.ttcn (https://git.osmocom.org/osmo-ttcn3-hacks/tree/bts). + +The idea is to set up automatically the following components: +TTCN3 <-> osmocon (osmocom-bb) <-> motorola C123 <-> RF network <-> BTS_TO_TEST <-> TTCN3 + osmo-bsc + +* A jenkins job builds a docker image containing a built BTS_tests TTCN testsuite. +* Another jenkins job retrieves the artifacts from osmo-gsm-tester-build jobs + plus one for required osmocon binary. This job then calls osmo-gsm-tester/ttcn3/jenkins-run.sh, which will: +** Pull the above mentioned docker image containing BTS_Tests. +** Start osmo-gsm-tester with OSMO_GSM_TESTER_OPTS=osmo-gsm-tester/ttcn3/paths.conf, + that contains mostly same stuff as regular osmo-gsm-tester jobs, but with a + different testsuite containing 1 test "ttcn3_bts_tests.py". +** The test "ttcn3_bts_tests.py" does the following: +*** Start and manage all osmocom required components to run BTS_Tests: osmo-bts, osmo-bsc, osmocon, etc. +*** Generate the BTS_Tests.cfg required by BTS_Tests from a template to adapt to dynamic bits set by osmo-gsm-tester. +*** Launch script osmo-gsm-tester/ttcn3/suites/ttcn3_bts_tests/scripts/run_ttcn3_docker.sh with parameters and wait for it to finish. + This script will start and manage the lifecycle of the docker container running BTS_Tests + +See OS#3155 for more information regarding this topic. diff --git a/ttcn3/default-suites.conf b/ttcn3/default-suites.conf new file mode 100644 index 0000000..80f14e6 --- /dev/null +++ b/ttcn3/default-suites.conf @@ -0,0 +1 @@ +- ttcn3_bts_tests:trx diff --git a/ttcn3/defaults.conf b/ttcn3/defaults.conf new file mode 120000 index 0000000..e47699d --- /dev/null +++ b/ttcn3/defaults.conf @@ -0,0 +1 @@ +../example/defaults.conf \ No newline at end of file diff --git a/ttcn3/jenkins-run.sh b/ttcn3/jenkins-run.sh new file mode 100755 index 0000000..c744606 --- /dev/null +++ b/ttcn3/jenkins-run.sh @@ -0,0 +1,58 @@ +#!/bin/sh +set -e -x +base="$PWD" + +time_start="$(date '+%F %T')" + +prepare_docker() { + OLDPWD=$PWD + + # update docker-playground and update the BSC and bsc-test containers (if needed) + DIR=~/jenkins/docker-playground + if [ ! -d "$DIR" ]; then + mkdir -p ~/jenkins/ && cd ~/jenkins + git clone git://git.osmocom.org/docker-playground + fi + cd $DIR + git remote prune origin; git fetch; git checkout -f -B master origin/master + cd $DIR/debian-stretch-titan && make + docker pull laforge/debian-stretch-titan:latest # HACK + cd $DIR/ttcn3-bts-test && make + # execute the script to start containers, read results, ... + #cd $DIR/ttcn3-bts-test && sh -x ./jenkins.sh + PWD=$OLDPWD +} + +docker pull registry.sysmocom.de/ttcn3-bts-test + +# remove older trial dirs and *-run.tgz, if any +trial_dir_prefix="trial-" +rm -rf "$trial_dir_prefix"* || true + +# Expecting *.tgz artifacts to be copied to this workspace from the various +# jenkins-*.sh runs, via jenkins job configuration. Compose a trial dir: +trial_dir="${trial_dir_prefix}$BUILD_NUMBER" +mkdir -p "$trial_dir" + +mv *.tgz "$trial_dir" +cat *.md5 >> "$trial_dir/checksums.md5" +rm *.md5 + +# OSMO_GSM_TESTER_OPTS is a way to pass in e.g. logging preferences from the +# jenkins build job. +# On failure, first clean up below and then return the exit code. +exit_code="1" +if python3 -u "$(which osmo-gsm-tester.py)" "$trial_dir" $OSMO_GSM_TESTER_OPTS ; then + exit_code="0" +fi + +# no need to keep extracted binaries +rm -rf "$trial_dir/inst" || true + +# tar up all results for archiving (optional) +cd "$trial_dir" +journalctl -u ofono -o short-precise --since "${time_start}" > "$(readlink last_run)/ofono.log" +tar czf "$base/${trial_dir}-run.tgz" "$(readlink last_run)" +tar czf "$base/${trial_dir}-bin.tgz" *.md5 *.tgz + +exit $exit_code diff --git a/ttcn3/paths.conf b/ttcn3/paths.conf new file mode 100644 index 0000000..27c5818 --- /dev/null +++ b/ttcn3/paths.conf @@ -0,0 +1,3 @@ +state_dir: '/var/tmp/osmo-gsm-tester/state' +suites_dir: './suites' +scenarios_dir: './scenarios' diff --git a/ttcn3/resources.conf.prod b/ttcn3/resources.conf.prod new file mode 120000 index 0000000..3e40e89 --- /dev/null +++ b/ttcn3/resources.conf.prod @@ -0,0 +1 @@ +../example/resources.conf.prod \ No newline at end of file diff --git a/ttcn3/resources.conf.rnd b/ttcn3/resources.conf.rnd new file mode 120000 index 0000000..6f98474 --- /dev/null +++ b/ttcn3/resources.conf.rnd @@ -0,0 +1 @@ +../example/resources.conf.rnd \ No newline at end of file diff --git a/ttcn3/scenarios/trx.conf b/ttcn3/scenarios/trx.conf new file mode 120000 index 0000000..d72ddb2 --- /dev/null +++ b/ttcn3/scenarios/trx.conf @@ -0,0 +1 @@ +../../example/scenarios/trx.conf \ No newline at end of file diff --git a/ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl b/ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl new file mode 100644 index 0000000..7379528 --- /dev/null +++ b/ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl @@ -0,0 +1,25 @@ +[ORDERED_INCLUDE] +"/osmo-ttcn3-hacks/Common.cfg" +"/osmo-ttcn3-hacks/bts/BTS_Tests.default" + +[LOGGING] + +[TESTPORT_PARAMETERS] +*.BTSVTY.CTRL_HOSTNAME := "${btsvty_ctrl_hostname}" + +[MODULE_PARAMETERS] +BTS_Tests.mp_rsl_ip := "172.18.9.10" +BTS_Tests.mp_bb_trxc_ip := "127.0.0.1" +BTS_Tests.mp_pcu_socket := "/data/unix_pcu/pcu_bts" +BTS_Tests.mp_bb_trxc_port := -1 +L1CTL_PortType.m_l1ctl_sock_path := "/data/unix_l2/osmocom_l2" +BTS_Tests.mp_ctrl_ip := "${btsvty_ctrl_hostname}" +BTS_Tests.mp_rxlev_exp := 1 +BTS_Tests.mp_tolerance_rxlev := 10; +BTS_Tests.mp_tolerance_rxqual := 1; +BTS_Tests.mp_trx0_arfcn := 868 + +[MAIN_CONTROLLER] + +[EXECUTE] +BTS_Tests.control diff --git a/ttcn3/suites/ttcn3_bts_tests/scripts/run_ttcn3_docker.sh b/ttcn3/suites/ttcn3_bts_tests/scripts/run_ttcn3_docker.sh new file mode 100755 index 0000000..64987b3 --- /dev/null +++ b/ttcn3/suites/ttcn3_bts_tests/scripts/run_ttcn3_docker.sh @@ -0,0 +1,86 @@ +#!/bin/sh +set -x + +RUNDIR="$1" +JUNIT_TTCN3_DST_FILE="$2" +L2_SOCKET_PATH="$3" +PCU_SOCKET_PATH="$4" + +# Absolute path to this script +SCRIPT=$(readlink -f "$0") +# Absolute path this script is in +SCRIPTPATH=$(dirname "$SCRIPT") + +VOL_BASE_DIR="$RUNDIR/logs" +rm -rf "$VOL_BASE_DIR" +mkdir -p "$VOL_BASE_DIR" + +if [ "x$BUILD_TAG" = "x" ]; then + BUILD_TAG=nonjenkins +fi + +REPO_USER="registry.sysmocom.de" +SUITE_NAME="ttcn3-bts-test" +NET_NAME=$SUITE_NAME +DOCKER_NAME="$BUILD_TAG-$SUITE_NAME" + +network_create() { + NET=$1 + echo Creating network $NET_NAME + docker network create --internal --subnet $NET $NET_NAME +} + +network_remove() { + echo Removing network $NET_NAME + docker network remove $NET_NAME +} + +child_ps=0 +forward_kill() { + sig="$1" + echo "Caught signal SIG$sig!" + if [ "$child_ps" != "0" ]; then + echo "Killing $child_ps with SIG$sig!" + docker kill ${DOCKER_NAME} + fi + exit 130 +} +forward_kill_int() { + forward_kill "INT" +} +forward_kill_term() { + forward_kill "TERM" +} +# Don't use 'set -e', otherwise traps are not triggered! +trap forward_kill_int INT +trap forward_kill_term TERM + +network_create 172.18.9.0/24 + +mkdir $VOL_BASE_DIR/bts-tester +echo "SCRIPTPATH=$SCRIPTPATH PWD=$PWD" +cp $RUNDIR/BTS_Tests.cfg $VOL_BASE_DIR/bts-tester/ + +echo Starting container with BTS testsuite +docker kill ${DOCKER_NAME} +docker run --rm \ + --network $NET_NAME --ip 172.18.9.10 \ + -e "TTCN3_PCAP_PATH=/data" \ + --mount type=bind,source=$VOL_BASE_DIR/bts-tester,destination=/data \ + --mount type=bind,source="$(dirname "$L2_SOCKET_PATH")",destination=/data/unix_l2 \ + --mount type=bind,source="$(dirname "$PCU_SOCKET_PATH")",destination=/data/unix_pcu \ + --name ${DOCKER_NAME} \ + $REPO_USER/${SUITE_NAME} & +child_ps=$! +echo "$$: waiting for $child_ps" +wait "$child_ps" +child_exit_code="$?" +echo "ttcn3 docker exited with code $child_exit_code" + +network_remove + +echo "Copying TTCN3 junit file to $JUNIT_TTCN3_DST_FILE" +cp $VOL_BASE_DIR/bts-tester/junit-xml-*.log $JUNIT_TTCN3_DST_FILE +sed -i "s#classname='BTS_Tests'#classname='$(basename $JUNIT_TTCN3_DST_FILE)'#g" $JUNIT_TTCN3_DST_FILE + +exit $child_exit_code diff --git a/ttcn3/suites/ttcn3_bts_tests/suite.conf b/ttcn3/suites/ttcn3_bts_tests/suite.conf new file mode 100644 index 0000000..1eb0a02 --- /dev/null +++ b/ttcn3/suites/ttcn3_bts_tests/suite.conf @@ -0,0 +1,7 @@ +resources: + ip_address: + - times: 7 # msc, bsc, hlr, stp, mgw, sgsn, ggsn + bts: + - times: 1 + osmocon_phone: + - times: 1 diff --git a/ttcn3/suites/ttcn3_bts_tests/ttcn3_bts_tests.py b/ttcn3/suites/ttcn3_bts_tests/ttcn3_bts_tests.py new file mode 100755 index 0000000..b3ca946 --- /dev/null +++ b/ttcn3/suites/ttcn3_bts_tests/ttcn3_bts_tests.py @@ -0,0 +1,71 @@ +#!/usr/bin/env python3 +import os +from mako.template import Template + +from osmo_gsm_tester.testenv import * + +hlr_dummy = suite.hlr() +mgw_dummy = suite.mgw() +stp_dummy = suite.stp() +msc_dummy = suite.msc(hlr_dummy, mgw_dummy, stp_dummy) +ggsn_dummy = suite.ggsn() +sgsn_dummy = suite.sgsn(hlr_dummy, ggsn_dummy) +bsc = suite.bsc(msc_dummy, mgw_dummy, stp_dummy) +bts = suite.bts() +osmocon = suite.osmocon() + +bts.set_num_trx(1) +bts.set_trx_phy_channel(0, 0, 'CCCH+SDCCH4') +bts.set_trx_phy_channel(0, 1, 'TCH/F') +bts.set_trx_phy_channel(0, 2, 'TCH/F') +bts.set_trx_phy_channel(0, 3, 'TCH/F_PDCH') +bts.set_trx_phy_channel(0, 4, 'TCH/F_TCH/H_PDCH') +bts.set_trx_phy_channel(0, 5, 'TCH/H') +bts.set_trx_phy_channel(0, 6, 'SDCCH8') +bts.set_trx_phy_channel(0, 7, 'PDCH') + +print('Starting CNI') +hlr_dummy.start() +stp_dummy.start() +msc_dummy.start() +mgw_dummy.start() + +bsc.set_rsl_ip('172.18.9.10') +bsc.bts_add(bts) +sgsn_dummy.bts_add(bts) + +bsc.start() +bts.start(keepalive=True) + +print('Starting osmocon') +osmocon.start() + +own_dir = os.path.dirname(os.path.realpath(__file__)) +script_file = os.path.join(own_dir, 'scripts', 'run_ttcn3_docker.sh') +bts_tmpl_file = os.path.join(own_dir, 'scripts', 'BTS_Tests.cfg.tmpl') +script_run_dir = test.get_run_dir().new_dir('ttcn3') +bts_cfg_file = os.path.join(str(script_run_dir), 'BTS_Tests.cfg') +junit_ttcn3_dst_file = os.path.join(str(suite.trial.get_run_dir()), 'trial-') + suite.name() + '.xml' +docker_cmd = (script_file, str(script_run_dir), junit_ttcn3_dst_file, osmocon.l2_socket_path(), bts.pcu_socket_path()) + +print('Creating template') +mytemplate = Template(filename=bts_tmpl_file) +r = mytemplate.render(btsvty_ctrl_hostname=bts.remote_addr()) +with open(bts_cfg_file, 'w') as f: + f.write(r) + + +print('Starting TTCN3 tests') +proc = process.Process('ttcn3', script_run_dir, docker_cmd) +try: + proc.launch() + print('Starting TTCN3 launched, waiting until it finishes') + proc.wait(timeout=3600) +except Exception as e: + proc.terminate() + raise e + +if proc.result != 0: + raise RuntimeError("run_ttcn3_docker.sh exited with error code %d" % proc.result) + +print('Done') -- To view, visit https://gerrit.osmocom.org/10158 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I3251a49503dc823f0ef1fe8ef5d68236a584dad4 Gerrit-Change-Number: 10158 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 14:52:45 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Wed, 25 Jul 2018 14:52:45 +0000 Subject: Change in osmo-ttcn3-hacks[master]: fix length of frame generated by f_TC_chan_act_encr Message-ID: Stefan Sperling has uploaded this change for review. ( https://gerrit.osmocom.org/10159 Change subject: fix length of frame generated by f_TC_chan_act_encr ...................................................................... fix length of frame generated by f_TC_chan_act_encr Because trxconn now requires frames of a minimum size some BTS tests which send unpadded frames with a short payload have started to fail. Extend the payload size generated by f_TC_chan_act_encr() to make these tests pass again: TC_chan_act_a51 TC_chan_act_a52 TC_chan_act_a53 Found by: Vadim Yanitskiy Related: OS#3415 Change-Id: I0f9a40503a4ed4fce10d9655f845ac49d33f4041 --- M bts/BTS_Tests.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/59/10159/1 diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index 4f0f0ef..941be28 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -3658,7 +3658,7 @@ /* now we actually need to transmit some data both ways to check if the encryption works */ var L1ctlDlMessage dl; - var octetstring l3 := f_rnd_octstring(16); + var octetstring l3 := f_rnd_octstring(20); var RslLinkId link_id := valueof(ts_RslLinkID_DCCH(0)); /* send UNITDATA_REQ from BTS to MS and expect it to arrive */ -- To view, visit https://gerrit.osmocom.org/10159 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I0f9a40503a4ed4fce10d9655f845ac49d33f4041 Gerrit-Change-Number: 10159 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 14:58:44 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 25 Jul 2018 14:58:44 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS: fix length of frames generated by f_TC_chan_act_encr In-Reply-To: References: Message-ID: Vadim Yanitskiy has uploaded a new patch set (#2) to the change originally created by Stefan Sperling. ( https://gerrit.osmocom.org/10159 ) Change subject: BTS: fix length of frames generated by f_TC_chan_act_encr ...................................................................... BTS: fix length of frames generated by f_TC_chan_act_encr Since trxcon now drops L2 frames of an incorrect length, some BTS tests which send unpadded frames with a short payload have started to fail. Extend the payload size generated by f_TC_chan_act_encr() to make these tests pass again: TC_chan_act_a51 TC_chan_act_a52 TC_chan_act_a53 Found by: Vadim Yanitskiy Related: OS#3415 Change-Id: I0f9a40503a4ed4fce10d9655f845ac49d33f4041 --- M bts/BTS_Tests.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/59/10159/2 -- To view, visit https://gerrit.osmocom.org/10159 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0f9a40503a4ed4fce10d9655f845ac49d33f4041 Gerrit-Change-Number: 10159 Gerrit-PatchSet: 2 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 14:58:54 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 25 Jul 2018 14:58:54 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS: fix length of frames generated by f_TC_chan_act_encr In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/10159 ) Change subject: BTS: fix length of frames generated by f_TC_chan_act_encr ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/10159 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0f9a40503a4ed4fce10d9655f845ac49d33f4041 Gerrit-Change-Number: 10159 Gerrit-PatchSet: 2 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 25 Jul 2018 14:58:54 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 15:03:57 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Wed, 25 Jul 2018 15:03:57 +0000 Subject: Change in osmo-ttcn3-hacks[master]: fix length of frame generated by f_TC_rll_ud_ind Message-ID: Stefan Sperling has uploaded this change for review. ( https://gerrit.osmocom.org/10160 Change subject: fix length of frame generated by f_TC_rll_ud_ind ...................................................................... fix length of frame generated by f_TC_rll_ud_ind Because trxcon now requires frames of a minimum size some BTS tests which send unpadded frames with a short payload have started to fail. Extend the payload size generated by f_TC_rll_ud_ind() to make TC_rll_unit_data_ind_DCCH pass again. Change-Id: Ibaa4124ebdec96623f48c38fac702e9bbd843869 Related: OS#3415 --- M bts/BTS_Tests.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/60/10160/1 diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index 4f0f0ef..d398c7a 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -3602,7 +3602,7 @@ f_rslem_unregister(0, g_chan_nr); } testcase TC_rll_unit_data_ind_DCCH() runs on test_CT { - var octetstring l3 := f_rnd_octstring(15); + var octetstring l3 := f_rnd_octstring(20); var RllTestCases tcs := { valueof(t_EITC(0, valueof(ts_RslLinkID_DCCH(0)), l3, true)), valueof(t_EITC(3, valueof(ts_RslLinkID_DCCH(3)), l3, true)) -- To view, visit https://gerrit.osmocom.org/10160 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ibaa4124ebdec96623f48c38fac702e9bbd843869 Gerrit-Change-Number: 10160 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Wed Jul 25 15:10:06 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Wed, 25 Jul 2018 15:10:06 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-asn1c_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#195?= In-Reply-To: <31047094.66.1532445006814.JavaMail.jenkins@jenkins.osmocom.org> References: <31047094.66.1532445006814.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <916368251.74.1532531407000.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 3.67 KB...] + ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for style of include used by make... GNU checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking how to run the C++ preprocessor... g++ -E checking for g77... no checking for f77... no checking for xlf... no checking for frt... no checking for pgf77... no checking for cf77... no checking for fort77... no checking for fl32... no checking for af77... no checking for f90... no checking for xlf90... no checking for pgf90... no checking for pghpf... no checking for epcf90... no checking for gfortran... no checking for g95... no checking for f95... no checking for fort... no checking for xlf95... no checking for ifort... no checking for ifc... no checking for efc... no checking for pgf95... no checking for lf95... no checking for ftn... no checking whether we are using the GNU Fortran 77 compiler... no checking whether accepts -g... no checking the maximum length of command line arguments... 32768 checking command to parse /usr/bin/nm -B output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes configure: creating libtool appending configuration tag "CXX" to libtool checking for ld used by g++... /usr/bin/ld -m elf_x86_64 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC checking if g++ PIC flag -fPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate appending configuration tag "F77" to libtool checking for autoconf... /usr/bin/autoconf checking for autoheader... /usr/bin/autoheader checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking dependency style of gcc... (cached) gcc3 checking how to run the C preprocessor... gcc -E checking for a BSD-compatible install... /usr/bin/install -c checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking for bison... bison -y checking for flex... flex checking for yywrap in -lfl... yes checking lex output file root... lex.yy checking whether yytext is a pointer... yes checking for ar... /usr/bin/ar checking for ANSI C header files... (cached) yes checking sys/param.h usability... yes checking sys/param.h presence... yes checking for sys/param.h... yes checking whether byte ordering is bigendian... no checking for off_t... yes checking for size_t... yes checking whether struct tm is in sys/time.h or time.h... time.h checking for intmax_t... yes checking for library containing getopt... none required checking for strtoimax... yes checking for strtoll... yes checking for mergesort... no checking for mkstemps... yes configure: creating ./config.status config.status: creating skeletons/standard-modules/Makefile config.status: creating skeletons/tests/Makefile config.status: creating libasn1compiler/Makefile config.status: creating libasn1parser/Makefile config.status: creating libasn1print/Makefile config.status: creating asn1c/webcgi/Makefile config.status: creating asn1c/tests/Makefile config.status: creating libasn1fix/Makefile config.status: creating skeletons/Makefile config.status: creating examples/Makefile config.status: creating tests/Makefile config.status: creating asn1c/Makefile config.status: creating doc/Makefile config.status: creating asn1c.spec config.status: creating Makefile config.status: creating config.h config.status: executing depfiles commands + make -j 8 make all-recursive make[1]: Entering directory ' Making all in libasn1parser make[2]: Entering directory ' if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF ".deps/asn1parser.Tpo" -c -o asn1parser.lo asn1parser.c; \ then mv -f ".deps/asn1parser.Tpo" ".deps/asn1parser.Plo"; else rm -f ".deps/asn1parser.Tpo"; exit 1; fi bison -y -p asn1p_ -d asn1p_y.y if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF ".deps/asn1p_l.Tpo" -c -o asn1p_l.lo asn1p_l.c; \ then mv -f ".deps/asn1p_l.Tpo" ".deps/asn1p_l.Plo"; else rm -f ".deps/asn1p_l.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF ".deps/asn1p_module.Tpo" -c -o asn1p_module.lo asn1p_module.c; \ then mv -f ".deps/asn1p_module.Tpo" ".deps/asn1p_module.Plo"; else rm -f ".deps/asn1p_module.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF ".deps/asn1p_oid.Tpo" -c -o asn1p_oid.lo asn1p_oid.c; \ then mv -f ".deps/asn1p_oid.Tpo" ".deps/asn1p_oid.Plo"; else rm -f ".deps/asn1p_oid.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF ".deps/asn1p_value.Tpo" -c -o asn1p_value.lo asn1p_value.c; \ then mv -f ".deps/asn1p_value.Tpo" ".deps/asn1p_value.Plo"; else rm -f ".deps/asn1p_value.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF ".deps/asn1p_expr.Tpo" -c -o asn1p_expr.lo asn1p_expr.c; \ then mv -f ".deps/asn1p_expr.Tpo" ".deps/asn1p_expr.Plo"; else rm -f ".deps/asn1p_expr.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF ".deps/asn1p_xports.Tpo" -c -o asn1p_xports.lo asn1p_xports.c; \ then mv -f ".deps/asn1p_xports.Tpo" ".deps/asn1p_xports.Plo"; else rm -f ".deps/asn1p_xports.Tpo"; exit 1; fi asn1p_y.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] mkdir .libs gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -fPIC -DPIC -o .libs/asn1p_module.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -fPIC -DPIC -o .libs/asn1p_oid.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -fPIC -DPIC -o .libs/asn1p_value.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -fPIC -DPIC -o .libs/asn1p_xports.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -fPIC -DPIC -o .libs/asn1p_expr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -fPIC -DPIC -o .libs/asn1parser.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -fPIC -DPIC -o .libs/asn1p_l.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -o asn1p_module.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -o asn1p_oid.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -o asn1parser.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -o asn1p_xports.o >/dev/null 2>&1 asn1p_l.c:3521:12: warning: 'input' defined but not used [-Wunused-function] static int input() ^~~~~ gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -o asn1p_value.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF ".deps/asn1p_constr.Tpo" -c -o asn1p_constr.lo asn1p_constr.c; \ then mv -f ".deps/asn1p_constr.Tpo" ".deps/asn1p_constr.Plo"; else rm -f ".deps/asn1p_constr.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -o asn1p_expr.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF ".deps/asn1p_param.Tpo" -c -o asn1p_param.lo asn1p_param.c; \ then mv -f ".deps/asn1p_param.Tpo" ".deps/asn1p_param.Plo"; else rm -f ".deps/asn1p_param.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF ".deps/asn1p_class.Tpo" -c -o asn1p_class.lo asn1p_class.c; \ then mv -f ".deps/asn1p_class.Tpo" ".deps/asn1p_class.Plo"; else rm -f ".deps/asn1p_class.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF ".deps/asn1p_ref.Tpo" -c -o asn1p_ref.lo asn1p_ref.c; \ then mv -f ".deps/asn1p_ref.Tpo" ".deps/asn1p_ref.Plo"; else rm -f ".deps/asn1p_ref.Tpo"; exit 1; fi if test -f y.tab.h; then \ to=`echo "asn1p_y_H" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \ sed -e "/^#/!b" -e "s/Y_TAB_H/$to/g" -e "s|y\.tab\.h|asn1p_y.h|" \ y.tab.h >asn1p_y.ht; \ rm -f y.tab.h; \ if cmp -s asn1p_y.ht asn1p_y.h; then \ rm -f asn1p_y.ht ;\ else \ mv asn1p_y.ht asn1p_y.h; \ fi; \ fi if test -f y.output; then \ mv y.output asn1p_y.output; \ fi sed '/^#/ s|y\.tab\.c|asn1p_y.c|' y.tab.c >asn1p_y.ct && mv asn1p_y.ct asn1p_y.c rm -f y.tab.c if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF ".deps/asn1p_y.Tpo" -c -o asn1p_y.lo asn1p_y.c; \ then mv -f ".deps/asn1p_y.Tpo" ".deps/asn1p_y.Plo"; else rm -f ".deps/asn1p_y.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -fPIC -DPIC -o .libs/asn1p_constr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -fPIC -DPIC -o .libs/asn1p_class.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -fPIC -DPIC -o .libs/asn1p_param.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -fPIC -DPIC -o .libs/asn1p_ref.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -o asn1p_constr.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -o asn1p_param.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -o asn1p_class.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -o asn1p_ref.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -o asn1p_l.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF .deps/asn1p_y.Tpo -c asn1p_y.c -fPIC -DPIC -o .libs/asn1p_y.o asn1p_y.y: In function 'asn1p_parse': asn1p_y.y:357:13: error: 'param' undeclared (first use in this function) *(void **)param = $1; ^~~~~ asn1p_y.y:357:13: note: each undeclared identifier is reported only once for each function it appears in Makefile:299: recipe for target 'asn1p_y.lo' failed make[2]: *** [asn1p_y.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory ' Makefile:302: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory ' Makefile:212: recipe for target 'all' failed make: *** [all] Error 2 Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Wed Jul 25 15:47:09 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 25 Jul 2018 15:47:09 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS: fix length of frames generated by f_TC_chan_act_encr In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10159 ) Change subject: BTS: fix length of frames generated by f_TC_chan_act_encr ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10159 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0f9a40503a4ed4fce10d9655f845ac49d33f4041 Gerrit-Change-Number: 10159 Gerrit-PatchSet: 2 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 25 Jul 2018 15:47:09 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 16:42:06 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Wed, 25 Jul 2018 16:42:06 +0000 Subject: Change in osmo-ttcn3-hacks[master]: bsc: stop all components before terminating testcase Message-ID: daniel has uploaded this change for review. ( https://gerrit.osmocom.org/10161 Change subject: bsc: stop all components before terminating testcase ...................................................................... bsc: stop all components before terminating testcase It seems mtc.stop() alone does not really solve the race conditions when shutting down components. The error happens when messages are sent on ports which are no longer connected since the receiving component has terminated. Some web search http://www.ttcn-3.org/TTCN3UCAsia2007/Presentations/TTCN3%20UC%202007%20Concurrent%20TTCN.pdf suggested that one should stop all components before calling mtc.stop (slide 38). Slide 33 also mentions the difference between .stop and .kill. Kill removes the port connections while stop does not. And I think looking at the logs when the testcase teminates (through mtc.stop or otherwise) it is internally calling kill on all the components. So hopefully stopping all components and then stopping the mtc will fix this nasty issue. I verified locally that the situation improves between commits now when running BSC_Tests.TC_paging_imsi_nochan_all 20 times in a loop and otherwise generating load on the system. It reliably failed before this patch and I wasn't able to get it to fail with it. Change-Id: I398883492919ceabcf94b5cc2361c63ec772d9d5 --- M bsc/BSC_Tests.ttcn 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/61/10161/1 diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 9412251..c802a6b 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -114,6 +114,7 @@ } private function f_shutdown_helper() runs on test_CT { + all component.stop; setverdict(pass); mtc.stop; } -- To view, visit https://gerrit.osmocom.org/10161 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I398883492919ceabcf94b5cc2361c63ec772d9d5 Gerrit-Change-Number: 10161 Gerrit-PatchSet: 1 Gerrit-Owner: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 17:00:29 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Wed, 25 Jul 2018 17:00:29 +0000 Subject: Change in osmo-ttcn3-hacks[master]: bsc: stop all components before terminating testcase In-Reply-To: References: Message-ID: daniel has posted comments on this change. ( https://gerrit.osmocom.org/10161 ) Change subject: bsc: stop all components before terminating testcase ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/10161 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I398883492919ceabcf94b5cc2361c63ec772d9d5 Gerrit-Change-Number: 10161 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 25 Jul 2018 17:00:29 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 17:14:00 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Wed, 25 Jul 2018 17:14:00 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS: fix length of frames generated by f_TC_chan_act_encr In-Reply-To: References: Message-ID: Stefan Sperling has submitted this change and it was merged. ( https://gerrit.osmocom.org/10159 ) Change subject: BTS: fix length of frames generated by f_TC_chan_act_encr ...................................................................... BTS: fix length of frames generated by f_TC_chan_act_encr Since trxcon now drops L2 frames of an incorrect length, some BTS tests which send unpadded frames with a short payload have started to fail. Extend the payload size generated by f_TC_chan_act_encr() to make these tests pass again: TC_chan_act_a51 TC_chan_act_a52 TC_chan_act_a53 Found by: Vadim Yanitskiy Related: OS#3415 Change-Id: I0f9a40503a4ed4fce10d9655f845ac49d33f4041 --- M bts/BTS_Tests.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Vadim Yanitskiy: Looks good to me, but someone else must approve Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index 4f0f0ef..941be28 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -3658,7 +3658,7 @@ /* now we actually need to transmit some data both ways to check if the encryption works */ var L1ctlDlMessage dl; - var octetstring l3 := f_rnd_octstring(16); + var octetstring l3 := f_rnd_octstring(20); var RslLinkId link_id := valueof(ts_RslLinkID_DCCH(0)); /* send UNITDATA_REQ from BTS to MS and expect it to arrive */ -- To view, visit https://gerrit.osmocom.org/10159 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I0f9a40503a4ed4fce10d9655f845ac49d33f4041 Gerrit-Change-Number: 10159 Gerrit-PatchSet: 2 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 18:41:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Jul 2018 18:41:14 +0000 Subject: Change in osmo-gsm-tester[master]: Add ttcn3-bts-test env In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10158 ) Change subject: Add ttcn3-bts-test env ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/10158 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3251a49503dc823f0ef1fe8ef5d68236a584dad4 Gerrit-Change-Number: 10158 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-CC: Jenkins Builder Gerrit-Comment-Date: Wed, 25 Jul 2018 18:41:14 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 18:41:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Jul 2018 18:41:32 +0000 Subject: Change in osmo-ttcn3-hacks[master]: bsc: stop all components before terminating testcase In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10161 ) Change subject: bsc: stop all components before terminating testcase ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10161 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I398883492919ceabcf94b5cc2361c63ec772d9d5 Gerrit-Change-Number: 10161 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 25 Jul 2018 18:41:32 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 18:41:35 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Jul 2018 18:41:35 +0000 Subject: Change in osmo-ttcn3-hacks[master]: bsc: stop all components before terminating testcase In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10161 ) Change subject: bsc: stop all components before terminating testcase ...................................................................... bsc: stop all components before terminating testcase It seems mtc.stop() alone does not really solve the race conditions when shutting down components. The error happens when messages are sent on ports which are no longer connected since the receiving component has terminated. Some web search http://www.ttcn-3.org/TTCN3UCAsia2007/Presentations/TTCN3%20UC%202007%20Concurrent%20TTCN.pdf suggested that one should stop all components before calling mtc.stop (slide 38). Slide 33 also mentions the difference between .stop and .kill. Kill removes the port connections while stop does not. And I think looking at the logs when the testcase teminates (through mtc.stop or otherwise) it is internally calling kill on all the components. So hopefully stopping all components and then stopping the mtc will fix this nasty issue. I verified locally that the situation improves between commits now when running BSC_Tests.TC_paging_imsi_nochan_all 20 times in a loop and otherwise generating load on the system. It reliably failed before this patch and I wasn't able to get it to fail with it. Change-Id: I398883492919ceabcf94b5cc2361c63ec772d9d5 --- M bsc/BSC_Tests.ttcn 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 9412251..c802a6b 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -114,6 +114,7 @@ } private function f_shutdown_helper() runs on test_CT { + all component.stop; setverdict(pass); mtc.stop; } -- To view, visit https://gerrit.osmocom.org/10161 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I398883492919ceabcf94b5cc2361c63ec772d9d5 Gerrit-Change-Number: 10161 Gerrit-PatchSet: 2 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 18:42:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Jul 2018 18:42:08 +0000 Subject: Change in osmo-ttcn3-hacks[master]: fix length of frame generated by f_TC_rll_ud_ind In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10160 ) Change subject: fix length of frame generated by f_TC_rll_ud_ind ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10160 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ibaa4124ebdec96623f48c38fac702e9bbd843869 Gerrit-Change-Number: 10160 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 25 Jul 2018 18:42:08 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 18:42:09 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Jul 2018 18:42:09 +0000 Subject: Change in osmo-ttcn3-hacks[master]: fix length of frame generated by f_TC_rll_ud_ind In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10160 ) Change subject: fix length of frame generated by f_TC_rll_ud_ind ...................................................................... fix length of frame generated by f_TC_rll_ud_ind Because trxcon now requires frames of a minimum size some BTS tests which send unpadded frames with a short payload have started to fail. Extend the payload size generated by f_TC_rll_ud_ind() to make TC_rll_unit_data_ind_DCCH pass again. Change-Id: Ibaa4124ebdec96623f48c38fac702e9bbd843869 Related: OS#3415 --- M bts/BTS_Tests.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index 941be28..04c4043 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -3602,7 +3602,7 @@ f_rslem_unregister(0, g_chan_nr); } testcase TC_rll_unit_data_ind_DCCH() runs on test_CT { - var octetstring l3 := f_rnd_octstring(15); + var octetstring l3 := f_rnd_octstring(20); var RllTestCases tcs := { valueof(t_EITC(0, valueof(ts_RslLinkID_DCCH(0)), l3, true)), valueof(t_EITC(3, valueof(ts_RslLinkID_DCCH(3)), l3, true)) -- To view, visit https://gerrit.osmocom.org/10160 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ibaa4124ebdec96623f48c38fac702e9bbd843869 Gerrit-Change-Number: 10160 Gerrit-PatchSet: 2 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 18:43:03 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Jul 2018 18:43:03 +0000 Subject: Change in osmo-bts[master]: preserve lchan-specific SI overrides on SACCH FILL In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10156 ) Change subject: preserve lchan-specific SI overrides on SACCH FILL ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10156 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I515bbd9983fa894507386b241863a9aa4d279497 Gerrit-Change-Number: 10156 Gerrit-PatchSet: 2 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 25 Jul 2018 18:43:03 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 18:43:05 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Jul 2018 18:43:05 +0000 Subject: Change in osmo-bts[master]: preserve lchan-specific SI overrides on SACCH FILL In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10156 ) Change subject: preserve lchan-specific SI overrides on SACCH FILL ...................................................................... preserve lchan-specific SI overrides on SACCH FILL During SACCH FILL processing, update lchan SI values only for lchans which follow BTS-global default values, keeping lchan-specific overrides in place. Change-Id: I515bbd9983fa894507386b241863a9aa4d279497 Fixes: eee7247ebe0d0a54a54b53b739bdd434dfceb511 Related: OS#3173 --- M include/osmo-bts/gsm_data_shared.h M src/common/rsl.c 2 files changed, 12 insertions(+), 4 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmo-bts/gsm_data_shared.h b/include/osmo-bts/gsm_data_shared.h index e15abfe..baa0145 100644 --- a/include/osmo-bts/gsm_data_shared.h +++ b/include/osmo-bts/gsm_data_shared.h @@ -240,6 +240,8 @@ struct { /* bitmask of all SI that are present/valid in si_buf */ uint32_t valid; + /* bitmask of all SI that do not mirror the BTS-global SI values */ + uint32_t overridden; uint32_t last; /* buffers where we put the pre-computed SI: SI2Q_MAX_NUM is the max number of SI2quater messages (see 3GPP TS 44.018) */ diff --git a/src/common/rsl.c b/src/common/rsl.c index e28f313..a24c444 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -567,14 +567,14 @@ lapdm_ui_prefix_bts(bts, TLVP_VAL(&tp, RSL_IE_L3_INFO), osmo_si, len); - /* Propagate SI change to all lchans. */ + /* Propagate SI change to all lchans which adhere to BTS-global default. */ llist_for_each_entry(t, &bts->trx_list, list) { int i, j; for (i = 0; i < ARRAY_SIZE(t->ts); i++) { struct gsm_bts_trx_ts *ts = &t->ts[i]; for (j = 0; j < ARRAY_SIZE(ts->lchan); j++) { struct gsm_lchan *lchan = &ts->lchan[j]; - if (lchan->state == LCHAN_S_NONE) + if (lchan->state == LCHAN_S_NONE || (lchan->si.overridden & (1 << osmo_si))) continue; lapdm_ui_prefix_lchan(lchan, TLVP_VAL(&tp, RSL_IE_L3_INFO), osmo_si, len); } @@ -588,14 +588,14 @@ bts->si_valid &= ~(1 << osmo_si); - /* Propagate SI change to all lchans. */ + /* Propagate SI change to all lchans which adhere to BTS-global default. */ llist_for_each_entry(t, &bts->trx_list, list) { int i, j; for (i = 0; i < ARRAY_SIZE(t->ts); i++) { struct gsm_bts_trx_ts *ts = &t->ts[i]; for (j = 0; j < ARRAY_SIZE(ts->lchan); j++) { struct gsm_lchan *lchan = &ts->lchan[j]; - if (lchan->state == LCHAN_S_NONE) + if (lchan->state == LCHAN_S_NONE || (lchan->si.overridden & (1 << osmo_si))) continue; lchan->si.valid &= ~(1 << osmo_si); } @@ -1567,6 +1567,7 @@ { struct abis_rsl_dchan_hdr *dch = msgb_l2(msg); struct gsm_lchan *lchan = msg->lchan; + struct gsm_bts *bts = lchan->ts->trx->bts; struct tlv_parsed tp; uint8_t rsl_si, osmo_si; @@ -1593,7 +1594,12 @@ } if (TLVP_PRESENT(&tp, RSL_IE_L3_INFO)) { uint16_t len = TLVP_LEN(&tp, RSL_IE_L3_INFO); + lapdm_ui_prefix_lchan(lchan, TLVP_VAL(&tp, RSL_IE_L3_INFO), osmo_si, len); + if (memcmp(GSM_BTS_SI(bts, osmo_si), TLVP_VAL(&tp, RSL_IE_L3_INFO), sizeof(sysinfo_buf_t) != 0)) + lchan->si.overridden |= (1 << osmo_si); + else + lchan->si.overridden &= ~(1 << osmo_si); LOGP(DRSL, LOGL_INFO, "%s Rx RSL SACCH FILLING (SI%s)\n", gsm_lchan_name(lchan), -- To view, visit https://gerrit.osmocom.org/10156 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I515bbd9983fa894507386b241863a9aa4d279497 Gerrit-Change-Number: 10156 Gerrit-PatchSet: 2 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 18:43:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Jul 2018 18:43:41 +0000 Subject: Change in osmo-ttcn3-hacks[master]: update expected test result for TC_sacch_multi_chg In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10157 ) Change subject: update expected test result for TC_sacch_multi_chg ...................................................................... Patch Set 2: Code-Review+1 it is good practise to refer not to "is now passing" but to specifically refer to the repository+change-id of the patch whcich changes the expectation. -- To view, visit https://gerrit.osmocom.org/10157 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I576f881fcb40c4fcbe6b6f767220111a0e9ffd3c Gerrit-Change-Number: 10157 Gerrit-PatchSet: 2 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 25 Jul 2018 18:43:41 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 18:44:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Jul 2018 18:44:46 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MGCP_Test: add function to check for RTP err counters In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10154 ) Change subject: MGCP_Test: add function to check for RTP err counters ...................................................................... Patch Set 2: Code-Review+2 I was about to comment on this in your recent related changes, but didn't for some reason. It's good to see you caught the same :) -- To view, visit https://gerrit.osmocom.org/10154 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I69e5f80b0765284ec99056ce62c315461967d2a1 Gerrit-Change-Number: 10154 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 25 Jul 2018 18:44:46 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 18:44:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Jul 2018 18:44:54 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MGCP_Test: add function to check for RTP err counters In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10154 ) Change subject: MGCP_Test: add function to check for RTP err counters ...................................................................... MGCP_Test: add function to check for RTP err counters At the moment we check the error counters of the RTP statistics in the testcases. However, in most situations we will do the check to make sure that no errors occurred (all counters == 0). Rather than having a long tail of if statements in the testcases we should have a function for this. This also makes it much easier in case we add more error countes lateron. - add and use function f_rtpem_stats_err_check() Change-Id: I69e5f80b0765284ec99056ce62c315461967d2a1 Related: OS#3384 --- M library/RTP_Emulation.ttcn M mgw/MGCP_Test.ttcn 2 files changed, 50 insertions(+), 47 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/RTP_Emulation.ttcn b/library/RTP_Emulation.ttcn index 2a358a9..fcb158b 100644 --- a/library/RTP_Emulation.ttcn +++ b/library/RTP_Emulation.ttcn @@ -242,6 +242,42 @@ return true; } +/* Check the statistics for general signs of errors. This is a basic general + * check that will fit most situations and is intended to be executed by + * the testcases as as needed. */ +function f_rtpem_stats_err_check(RtpemStats s) { + log("stats: ", s); + + /* Check if there was some activity at either on the RX or on the + * TX side, but complete silence would indicate some problem */ + if (s.num_pkts_tx < 1 and s.num_pkts_rx < 1) { + setverdict(fail, "no RTP packet activity detected (packets)"); + mtc.stop; + } + if (s.bytes_payload_tx < 1 and s.bytes_payload_rx < 1) { + setverdict(fail, "no RTP packet activity detected (bytes)"); + mtc.stop; + } + + /* Check error counters */ + if (s.num_pkts_rx_err_seq != 0) { + setverdict(fail, "RTP packet sequence number errors occurred"); + mtc.stop; + } + if (s.num_pkts_rx_err_ts != 0) { + setverdict(fail, "RTP packet timestamp errors occurred"); + mtc.stop; + } + if (s.num_pkts_rx_err_pt != 0) { + setverdict(fail, "RTP packet payload type errors occurred"); + mtc.stop; + } + if (s.num_pkts_rx_err_disabled != 0) { + setverdict(fail, "RTP packets received while RX was disabled"); + mtc.stop; + } +} + template PDU_RTP ts_RTP(BIT32_BO_LAST ssrc, INT7b pt, LIN2_BO_LAST seq, uint32_t ts, octetstring payload, BIT1 marker := '0'B) := { version := 2, diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn index 264ac28..a6d3460 100644 --- a/mgw/MGCP_Test.ttcn +++ b/mgw/MGCP_Test.ttcn @@ -961,21 +961,8 @@ if (stats.bytes_payload_tx < 190) { setverdict(fail); } - if (stats.num_pkts_rx != 0) { - setverdict(fail); - } - if (stats.num_pkts_rx_err_seq != 0) { - setverdict(fail); - } - if (stats.num_pkts_rx_err_ts != 0) { - setverdict(fail); - } - if (stats.num_pkts_rx_err_pt != 0) { - setverdict(fail); - } - if (stats.num_pkts_rx_err_disabled != 0) { - setverdict(fail); - } + + f_rtpem_stats_err_check(stats); setverdict(pass); } @@ -1005,18 +992,8 @@ if (stats.bytes_payload_tx != stats.bytes_payload_rx) { setverdict(fail); } - if (stats.num_pkts_rx_err_seq != 0) { - setverdict(fail); - } - if (stats.num_pkts_rx_err_ts != 0) { - setverdict(fail); - } - if (stats.num_pkts_rx_err_pt != 0) { - setverdict(fail); - } - if (stats.num_pkts_rx_err_disabled != 0) { - setverdict(fail); - } + + f_rtpem_stats_err_check(stats); setverdict(pass); } @@ -1068,10 +1045,8 @@ mtc.stop; } - if (stats[0].num_pkts_rx_err_pt > 0 or stats[1].num_pkts_rx_err_pt > 0) { - setverdict(fail, "RTP packets with wrong payload type received"); - mtc.stop; - } + f_rtpem_stats_err_check(stats[0]); + f_rtpem_stats_err_check(stats[1]); setverdict(pass); } @@ -1174,20 +1149,15 @@ setverdict(fail, "number of packets not within normal parameters"); mtc.stop; } - if (stats[0].num_pkts_rx_err_pt > 0) { - setverdict(fail, "RTP packets with wrong payload type received"); - mtc.stop; - } temp := stats[1].num_pkts_tx - num_pkts_tx[1] - stats[0].num_pkts_rx; if (temp > 3 or temp < -3) { setverdict(fail, "number of packets not within normal parameters"); mtc.stop; } - if (stats[0].num_pkts_rx_err_pt > 0) { - setverdict(fail, "RTP packets with wrong payload type received"); - mtc.stop; - } + + f_rtpem_stats_err_check(stats[0]); + f_rtpem_stats_err_check(stats[1]); /* Tear down */ f_flow_delete(RTPEM[0]); @@ -1240,10 +1210,8 @@ mtc.stop; } - if (stats[0].num_pkts_rx_err_pt > 0 or stats[1].num_pkts_rx_err_pt > 0) { - setverdict(fail, "RTP packets with wrong payload type received"); - mtc.stop; - } + f_rtpem_stats_err_check(stats[0]); + f_rtpem_stats_err_check(stats[0]); setverdict(pass); } @@ -1308,10 +1276,9 @@ mtc.stop; } - if (stats[0].num_pkts_rx_err_pt > 0 or stats[1].num_pkts_rx_err_pt > 0) { - setverdict(fail, "RTP packets with wrong payload type received"); - mtc.stop; - } + f_rtpem_stats_err_check(stats[0]); + f_rtpem_stats_err_check(stats[1]); + f_rtpem_stats_err_check(stats[2]); setverdict(pass); } -- To view, visit https://gerrit.osmocom.org/10154 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I69e5f80b0765284ec99056ce62c315461967d2a1 Gerrit-Change-Number: 10154 Gerrit-PatchSet: 3 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 18:45:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Jul 2018 18:45:22 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MGCP_Test: Test what happens when two ends use different PT In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10155 ) Change subject: MGCP_Test: Test what happens when two ends use different PT ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10155 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib4606dfc08764410ee9e450949361544adb07cd3 Gerrit-Change-Number: 10155 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 25 Jul 2018 18:45:22 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 18:45:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Jul 2018 18:45:46 +0000 Subject: Change in libosmocore[master]: stats_statsd: sanitize statsd name In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10133 ) Change subject: stats_statsd: sanitize statsd name ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10133 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib46d08481e8ca04afd97cb9ae241e4e39c91ad66 Gerrit-Change-Number: 10133 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 25 Jul 2018 18:45:46 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 18:45:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Jul 2018 18:45:48 +0000 Subject: Change in libosmocore[master]: stats_statsd: sanitize statsd name In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10133 ) Change subject: stats_statsd: sanitize statsd name ...................................................................... stats_statsd: sanitize statsd name The statsd protocol use ':' as seperator between name and value. It's not allowed to use the seperator in a name. Replace ':' with '.' before sending the packet to the statsd server. Change-Id: Ib46d08481e8ca04afd97cb9ae241e4e39c91ad66 --- M src/stats_statsd.c 1 file changed, 22 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/stats_statsd.c b/src/stats_statsd.c index c11c013..5ae2570 100644 --- a/src/stats_statsd.c +++ b/src/stats_statsd.c @@ -68,6 +68,25 @@ return srep; } +/*! Replace all illegal ':' in the stats name, but not when used as value seperator. + * ':' is used as seperator between the name and the value in the statsd protocol. + * \param[inout] buf is a null terminated string containing name, value, unit. */ +static void osmo_stats_reporter_sanitize_name(char *buf) +{ + /* e.g. msc.loc_update_type:normal:1|c -> msc.loc_update_type.normal:1|c + * last is the seperator between name and value */ + char *last = strrchr(buf, ':'); + char *tmp = strchr(buf, ':'); + + if (!last) + return; + + while (tmp < last) { + *tmp = '.'; + tmp = strchr(buf, ':'); + } +} + static int osmo_stats_reporter_statsd_send(struct osmo_stats_reporter *srep, const char *name1, unsigned int index1, const char *name2, int64_t value, const char *unit) @@ -134,8 +153,10 @@ return -EMSGSIZE; } - if (nchars > 0) + if (nchars > 0) { + osmo_stats_reporter_sanitize_name(buf); msgb_trim(srep->buffer, msgb_length(srep->buffer) + nchars); + } if (!srep->agg_enabled) rc = osmo_stats_reporter_send_buffer(srep); -- To view, visit https://gerrit.osmocom.org/10133 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ib46d08481e8ca04afd97cb9ae241e4e39c91ad66 Gerrit-Change-Number: 10133 Gerrit-PatchSet: 3 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 18:46:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Jul 2018 18:46:27 +0000 Subject: Change in osmo-iuh[master]: hnbgw: remove close_cb() to fix a crash when releasing a hnbgw In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10151 ) Change subject: hnbgw: remove close_cb() to fix a crash when releasing a hnbgw ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10151 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic84b2184b7fc850c0de2acacf179e86771e17510 Gerrit-Change-Number: 10151 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Wed, 25 Jul 2018 18:46:27 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 18:48:01 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Jul 2018 18:48:01 +0000 Subject: Change in osmo-bsc[master]: add gsm_timers, for Tnnn definitions usable by FSMs In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9670 ) Change subject: add gsm_timers, for Tnnn definitions usable by FSMs ...................................................................... Patch Set 14: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9670 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If212fcd042051b6fa53484254223614c5b93a9c6 Gerrit-Change-Number: 9670 Gerrit-PatchSet: 14 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Wed, 25 Jul 2018 18:48:01 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 18:48:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Jul 2018 18:48:41 +0000 Subject: Change in osmo-bsc[master]: cosmetic: move RR functions from bsc_api.c to gsm_04_08_rr.c In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9669 ) Change subject: cosmetic: move RR functions from bsc_api.c to gsm_04_08_rr.c ...................................................................... Patch Set 14: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9669 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie8ee334145bf7bc3a601d395ea7ab9b2009b61c7 Gerrit-Change-Number: 9669 Gerrit-PatchSet: 14 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Wed, 25 Jul 2018 18:48:41 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 18:49:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Jul 2018 18:49:18 +0000 Subject: Change in osmo-bsc[master]: cosmetic: dissolve bsc_api.c In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10146 ) Change subject: cosmetic: dissolve bsc_api.c ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10146 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib7ce026b52d4ba3e53a8b2824e74ea92432c48c5 Gerrit-Change-Number: 10146 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 25 Jul 2018 18:49:18 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 18:49:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Jul 2018 18:49:57 +0000 Subject: Change in osmo-bsc[master]: cosmetic: reduce bsc_api.h In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10147 ) Change subject: cosmetic: reduce bsc_api.h ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10147 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia9c0f9828317236048e40ec9ecf9990592e2190a Gerrit-Change-Number: 10147 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 25 Jul 2018 18:49:57 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 18:50:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Jul 2018 18:50:22 +0000 Subject: Change in osmo-bsc[master]: cosmetic: rename bsc_api.h to gsm_08_08.h In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10148 ) Change subject: cosmetic: rename bsc_api.h to gsm_08_08.h ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10148 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7179eb27183ee213f8fc8d548895b67aa43dc6a2 Gerrit-Change-Number: 10148 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 25 Jul 2018 18:50:22 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 18:50:42 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Jul 2018 18:50:42 +0000 Subject: Change in osmo-bsc[master]: cosmetic: rename osmo_bsc_api.c to gsm_08_08.c In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10149 ) Change subject: cosmetic: rename osmo_bsc_api.c to gsm_08_08.c ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10149 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I91922f557072d0fb8cfe213a8a7b50f3bb23dea0 Gerrit-Change-Number: 10149 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Wed, 25 Jul 2018 18:50:42 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 18:50:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Jul 2018 18:50:54 +0000 Subject: Change in osmo-iuh[master]: hnbgw: remove close_cb() to fix a crash when releasing a hnbgw In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10151 ) Change subject: hnbgw: remove close_cb() to fix a crash when releasing a hnbgw ...................................................................... hnbgw: remove close_cb() to fix a crash when releasing a hnbgw The read callback should catch all errors already. Previous when a read fails it: * hnb_context_release() -> osmo_stream_srv_destroy() -> hnb_context_release() On the second hnb_context_release() the hnbgw will crash because calling llist_del() twice on the same object. Fixes: OS#3416 Change-Id: Ic84b2184b7fc850c0de2acacf179e86771e17510 --- M include/osmocom/iuh/hnbgw.h M src/hnbgw.c M src/hnbgw_hnbap.c 3 files changed, 8 insertions(+), 19 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmocom/iuh/hnbgw.h b/include/osmocom/iuh/hnbgw.h index b79bcc1..db49dc1 100644 --- a/include/osmocom/iuh/hnbgw.h +++ b/include/osmocom/iuh/hnbgw.h @@ -161,7 +161,7 @@ void ue_context_free(struct ue_context *ue); struct hnb_context *hnb_context_alloc(struct hnb_gw *gw, struct osmo_stream_srv_link *link, int new_fd); -void hnb_context_release(struct hnb_context *ctx, bool destroy_conn); +void hnb_context_release(struct hnb_context *ctx); void hnbgw_vty_init(struct hnb_gw *gw, void *tall_ctx); int hnbgw_vty_go_parent(struct vty *vty); diff --git a/src/hnbgw.c b/src/hnbgw.c index 94d8fb9..91e551b 100644 --- a/src/hnbgw.c +++ b/src/hnbgw.c @@ -202,16 +202,6 @@ llist_del(&ue->list); talloc_free(ue); } -static int hnb_close_cb(struct osmo_stream_srv *conn) -{ - struct hnb_context *hnb = osmo_stream_srv_get_data(conn); - - /* This connection is about to be closed. Destroy the HNB context now. */ - if (hnb) - hnb_context_release(hnb, false); - - return 0; -} static int hnb_read_cb(struct osmo_stream_srv *conn) { @@ -234,10 +224,10 @@ } else if (rc < 0) { LOGP(DMAIN, LOGL_ERROR, "Error during sctp_recvmsg()\n"); /* FIXME: clean up after disappeared HNB */ - hnb_context_release(hnb, true); + hnb_context_release(hnb); goto out; } else if (rc == 0) { - hnb_context_release(hnb, true); + hnb_context_release(hnb); rc = -1; goto out; @@ -283,7 +273,7 @@ INIT_LLIST_HEAD(&ctx->map_list); ctx->gw = gw; - ctx->conn = osmo_stream_srv_create(tall_hnb_ctx, link, new_fd, hnb_read_cb, hnb_close_cb, ctx); + ctx->conn = osmo_stream_srv_create(tall_hnb_ctx, link, new_fd, hnb_read_cb, NULL, ctx); if (!ctx->conn) { LOGP(DMAIN, LOGL_INFO, "error while creating connection\n"); talloc_free(ctx); @@ -294,7 +284,7 @@ return ctx; } -void hnb_context_release(struct hnb_context *ctx, bool destroy_conn) +void hnb_context_release(struct hnb_context *ctx) { struct hnbgw_context_map *map, *map2; @@ -312,8 +302,7 @@ } ue_context_free_by_hnb(ctx->gw, ctx); - if (destroy_conn) - osmo_stream_srv_destroy(ctx->conn); + osmo_stream_srv_destroy(ctx->conn); talloc_free(ctx); } diff --git a/src/hnbgw_hnbap.c b/src/hnbgw_hnbap.c index acc5aff..2a19dda 100644 --- a/src/hnbgw_hnbap.c +++ b/src/hnbgw_hnbap.c @@ -84,7 +84,7 @@ osmo_stream_srv_set_flush_and_destroy(ctx->conn); } else { /* The message was not queued. Destroy the connection right away. */ - hnb_context_release(ctx, true); + hnb_context_release(ctx); } } @@ -401,7 +401,7 @@ hnbap_cause_str(&ies.cause)); hnbap_free_hnbde_registeries(&ies); - hnb_context_release(ctx, true); + hnb_context_release(ctx); return 0; } -- To view, visit https://gerrit.osmocom.org/10151 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ic84b2184b7fc850c0de2acacf179e86771e17510 Gerrit-Change-Number: 10151 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 18:51:06 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Jul 2018 18:51:06 +0000 Subject: Change in osmo-ttcn3-hacks[master]: MGCP_Test: Test what happens when two ends use different PT In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10155 ) Change subject: MGCP_Test: Test what happens when two ends use different PT ...................................................................... MGCP_Test: Test what happens when two ends use different PT It is legal that two connections use the same codec but negotiate different dynamic payload types for both connections. Then the MGW is expected to receive packets with one PT and send them with the other PT. This is currently not done in osmo-mgw so the two tests that this commit adds are expected to fail for now. - add testcase TC_two_crcx_diff_pt_and_rtp - add testcase TC_two_crcx_diff_pt_and_rtp_bidir Change-Id: Ib4606dfc08764410ee9e450949361544adb07cd3 Related: OS#3384 --- M mgw/MGCP_Test.ttcn M mgw/expected-results.xml 2 files changed, 24 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn index a6d3460..494e8bb 100644 --- a/mgw/MGCP_Test.ttcn +++ b/mgw/MGCP_Test.ttcn @@ -998,7 +998,8 @@ setverdict(pass); } - function f_TC_two_crcx_and_rtp(boolean bidir) runs on dummy_CT { + function f_TC_two_crcx_and_rtp(boolean bidir, charstring codec_name_a, integer pt_a, + charstring codec_name_b, integer pt_b) runs on dummy_CT { var RtpFlowData flow[2]; var RtpemStats stats[2]; var MgcpResponse resp; @@ -1009,13 +1010,13 @@ f_init(ep); /* from us to MGW */ - flow[0] := valueof(t_RtpFlow(mp_local_ip, mp_remote_ip, 98, "AMR/8000")); + flow[0] := valueof(t_RtpFlow(mp_local_ip, mp_remote_ip, pt_a, codec_name_a)); /* bind local RTP emulation sockets */ flow[0].em.portnr := 10000; f_flow_create(RTPEM[0], ep, call_id, "sendrecv", flow[0]); /* from MGW back to us */ - flow[1] := valueof(t_RtpFlow(mp_local_ip, mp_remote_ip, 98, "AMR/8000")); + flow[1] := valueof(t_RtpFlow(mp_local_ip, mp_remote_ip, pt_b, codec_name_b)); flow[1].em.portnr := 20000; f_flow_create(RTPEM[1], ep, call_id, "sendrecv", flow[1]); @@ -1053,13 +1054,23 @@ /* create two local RTP emulations; create two connections on MGW EP, exchange some data */ testcase TC_two_crcx_and_rtp() runs on dummy_CT { - f_TC_two_crcx_and_rtp(false); + f_TC_two_crcx_and_rtp(false, "AMR/8000", 98, "AMR/8000", 98); } /* create two local RTP emulations; create two connections on MGW EP, * exchange some data in both directions */ testcase TC_two_crcx_and_rtp_bidir() runs on dummy_CT { - f_TC_two_crcx_and_rtp(true); + f_TC_two_crcx_and_rtp(true, "AMR/8000", 98, "AMR/8000", 98); + } + + /* same as TC_two_crcx_and_rtp, but with different PT number on both ends */ + testcase TC_two_crcx_diff_pt_and_rtp() runs on dummy_CT { + f_TC_two_crcx_and_rtp(false, "AMR/8000", 98, "AMR/8000", 112); + } + + /* same as TC_two_crcx_and_rtp, but with different PT number on both ends */ + testcase TC_two_crcx_diff_pt_and_rtp_bidir() runs on dummy_CT { + f_TC_two_crcx_and_rtp(true, "AMR/8000", 98, "AMR/8000", 112); } /* create two local RTP emulations and pass data in both directions */ @@ -1328,6 +1339,8 @@ execute(TC_one_crcx_loopback_rtp()); execute(TC_two_crcx_and_rtp()); execute(TC_two_crcx_and_rtp_bidir()); + execute(TC_two_crcx_diff_pt_and_rtp()); + execute(TC_two_crcx_diff_pt_and_rtp_bidir()); execute(TC_two_crcx_mdcx_and_rtp()); execute(TC_two_crcx_and_unsolicited_rtp()); execute(TC_two_crcx_and_one_mdcx_rtp_ho()); diff --git a/mgw/expected-results.xml b/mgw/expected-results.xml index f201099..92b9351 100644 --- a/mgw/expected-results.xml +++ b/mgw/expected-results.xml @@ -34,6 +34,12 @@ + + RTP packet payload type errors occurred + + + RTP packet payload type errors occurred + -- To view, visit https://gerrit.osmocom.org/10155 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ib4606dfc08764410ee9e450949361544adb07cd3 Gerrit-Change-Number: 10155 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 18:51:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Jul 2018 18:51:21 +0000 Subject: Change in libosmocore[master]: logging: log_vty_command_string: Fix undercount of buf alloc size In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10134 ) Change subject: logging: log_vty_command_string: Fix undercount of buf alloc size ...................................................................... logging: log_vty_command_string: Fix undercount of buf alloc size Change-Id: I7aca0ce3d2981001e8081f7cee0dea3e2aaf8f7c --- M src/logging.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Vadim Yanitskiy: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/src/logging.c b/src/logging.c index 1dfd484..381d303 100644 --- a/src/logging.c +++ b/src/logging.c @@ -932,7 +932,7 @@ { struct log_info *info = osmo_log_info; int len = 0, offset = 0, ret, i, rem; - int size = strlen("logging level () ()") + 1; + int size = strlen("logging level (all|) ()") + 1; char *str; assert_loginfo(__func__); -- To view, visit https://gerrit.osmocom.org/10134 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I7aca0ce3d2981001e8081f7cee0dea3e2aaf8f7c Gerrit-Change-Number: 10134 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 18:51:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Jul 2018 18:51:32 +0000 Subject: Change in libosmocore[master]: logging_vty: Simplify code in config_write_log_single In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10135 ) Change subject: logging_vty: Simplify code in config_write_log_single ...................................................................... logging_vty: Simplify code in config_write_log_single Since we ignore "logging level CAT everything" in logging_level_cmd, we can never run into the case in which we have loglevel==EVERYTHING, so we can simplify this code and make it esier for later removal of everything keyword. Change-Id: I4e76c65a11cc22616c6dfc632435617ebb861c03 --- M src/vty/logging_vty.c 1 file changed, 1 insertion(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Vadim Yanitskiy: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index 8151fda..1194914 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -814,15 +814,9 @@ /* stupid old osmo logging API uses uppercase strings... */ osmo_str2lower(cat_lower, osmo_log_info->cat[i].name+1); osmo_str2lower(level_lower, log_level_str(cat->loglevel)); - - if (strcmp(level_lower, "everything") != 0) /* FIXME: remove this check once 'everything' is phased out */ - vty_out(vty, " logging level %s %s%s", cat_lower, level_lower, VTY_NEWLINE); - else - LOGP(DLSTATS, LOGL_ERROR, "logging level everything is deprecated and should not be used\n"); + vty_out(vty, " logging level %s %s%s", cat_lower, level_lower, VTY_NEWLINE); } - /* FIXME: levels */ - return 1; } -- To view, visit https://gerrit.osmocom.org/10135 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I4e76c65a11cc22616c6dfc632435617ebb861c03 Gerrit-Change-Number: 10135 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 18:52:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Jul 2018 18:52:24 +0000 Subject: Change in osmo-ci[master]: jobs: add gerrit verification for pysim In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10018 ) Change subject: jobs: add gerrit verification for pysim ...................................................................... Patch Set 3: Verified+1 Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10018 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I180cc4a83a41f3ef2e4b1e316ea0371cc83be654 Gerrit-Change-Number: 10018 Gerrit-PatchSet: 3 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Comment-Date: Wed, 25 Jul 2018 18:52:24 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 18:52:26 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Jul 2018 18:52:26 +0000 Subject: Change in osmo-ci[master]: jobs: add gerrit verification for pysim In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10018 ) Change subject: jobs: add gerrit verification for pysim ...................................................................... jobs: add gerrit verification for pysim pysim will be tested on the simtester which has real hardware. Change-Id: I180cc4a83a41f3ef2e4b1e316ea0371cc83be654 --- M jobs/gerrit-verifications.yml 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index 6ccccbc..52a5d1d 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -185,6 +185,9 @@ - simtrace2 - gapk + - pysim: + slave_axis: !!python/tuple [simtester] + - osmo-ttcn3-hacks: repos_url: 'https://gerrit.osmocom.org/{repos}' slave_axis: !!python/tuple [ttcn3] -- To view, visit https://gerrit.osmocom.org/10018 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I180cc4a83a41f3ef2e4b1e316ea0371cc83be654 Gerrit-Change-Number: 10018 Gerrit-PatchSet: 4 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 18:52:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Jul 2018 18:52:48 +0000 Subject: Change in pysim[master]: readme: add info about dependencies In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10046 ) Change subject: readme: add info about dependencies ...................................................................... Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/10046 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I912bbf787e1408100183cade2113bf7617b86ffa Gerrit-Change-Number: 10046 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Wed, 25 Jul 2018 18:52:48 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 18:52:58 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Jul 2018 18:52:58 +0000 Subject: Change in pysim[master]: readme: add info about dependencies In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10046 ) Change subject: readme: add info about dependencies ...................................................................... readme: add info about dependencies So far, the README.md file does not mention much about the dependencies. This commt adds at lest the most important ones Change-Id: I912bbf787e1408100183cade2113bf7617b86ffa --- M README.md 1 file changed, 9 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Harald Welte: Verified diff --git a/README.md b/README.md index 10ec568..e098700 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,15 @@ There is a cgit interface at + +Dependencies +------------ +pysim requires pyscard and pytlv. Both can be installed using python-pip: + +pip install pytlv +pip install pyscard + + Mailing List ------------ -- To view, visit https://gerrit.osmocom.org/10046 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I912bbf787e1408100183cade2113bf7617b86ffa Gerrit-Change-Number: 10046 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 18:52:59 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Jul 2018 18:52:59 +0000 Subject: Change in pysim[master]: commands: depend on pytlv only when it is actually needed In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10048 ) Change subject: commands: depend on pytlv only when it is actually needed ...................................................................... commands: depend on pytlv only when it is actually needed Some of the USIM-Card programming implementations do not need to look at card responses, which means they also do not have to parse TLV data. Lets depend on pytlv only in cases where TLV data has to be parsed so that useser of cards that do not need at can go without installing pytlv. Change-Id: Ida841d74d9581e7f395751b0f74556a06a038de6 --- M pySim/commands.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/pySim/commands.py b/pySim/commands.py index 9e16b0e..73c2247 100644 --- a/pySim/commands.py +++ b/pySim/commands.py @@ -23,7 +23,6 @@ # from pySim.utils import rpad, b2h -from pytlv.TLV import * class SimCardCommands(object): def __init__(self, transport): @@ -35,6 +34,7 @@ def __get_len_from_tlv(self, fcp): # see also: ETSI TS 102 221, chapter 11.1.1.3.1 Response for MF, # DF or ADF + from pytlv.TLV import TLV tlvparser = TLV(['82', '83', '84', 'A5', '8a', '8b', '8c', '80', 'ab', 'c6', '81', '88']) # pytlv is case sensitive! -- To view, visit https://gerrit.osmocom.org/10048 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ida841d74d9581e7f395751b0f74556a06a038de6 Gerrit-Change-Number: 10048 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 18:53:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Jul 2018 18:53:47 +0000 Subject: Change in osmo-msc[master]: libmsc: move L3 call-control to separate C file (gsm_04_08_cc.c) In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9705 ) Change subject: libmsc: move L3 call-control to separate C file (gsm_04_08_cc.c) ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9705 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Idb8dd7a8d9d8b4a28c492f12da3cc3305b695cca Gerrit-Change-Number: 9705 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Wed, 25 Jul 2018 18:53:47 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Wed Jul 25 18:54:10 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Wed, 25 Jul 2018 18:54:10 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-osmo-sip-connector_=C2=BB_a1=3D?= =?UTF-8?Q?default,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#550?= Message-ID: <1971999481.75.1532544850281.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 24.85 KB...] make[2]: Entering directory ' GEN crc8gen.c GEN crc16gen.c GEN crc32gen.c GEN crc64gen.c make install-am make[3]: Entering directory ' CC timer.lo CC timer_gettimeofday.lo CC timer_clockgettime.lo CC signal.lo CC select.lo CC msgb.lo CC bitvec.lo CC bits.lo CC bitcomp.lo CC counter.lo CC fsm.lo CC write_queue.lo CC utils.lo CC socket.lo CC logging.lo CC logging_syslog.lo CC rate_ctr.lo CC logging_gsmtap.lo CC gsmtap_util.lo CC panic.lo CC crc16.lo CC backtrace.lo CC conv.lo CC application.lo CC rbtree.lo CC strrb.lo CC loggingrb.lo CC crc8gen.lo CC crc16gen.lo CC crc32gen.lo CC crc64gen.lo CC stat_item.lo CC macaddr.lo CC stats.lo CC stats_statsd.lo CC prim.lo CC conv_acc.lo CC conv_acc_generic.lo CC sercomm.lo CC prbs.lo CC isdnhdlc.lo CC conv_acc_sse.lo CC conv_acc_sse_avx.lo CC plugin.lo CC msgfile.lo CC serial.lo CCLD libosmocore.la make[4]: Entering directory ' make[4]: Nothing to be done for 'install-data-am'. /bin/mkdir -p ' /bin/bash ../libtool --mode=install /usr/bin/install -c libosmocore.la ' libtool: install: /usr/bin/install -c .libs/libosmocore.so.10.0.0 libtool: install: (cd && { ln -s -f libosmocore.so.10.0.0 libosmocore.so.10 || { rm -f libosmocore.so.10 && ln -s libosmocore.so.10.0.0 libosmocore.so.10; }; }) libtool: install: (cd && { ln -s -f libosmocore.so.10.0.0 libosmocore.so || { rm -f libosmocore.so && ln -s libosmocore.so.10.0.0 libosmocore.so; }; }) libtool: install: /usr/bin/install -c .libs/libosmocore.lai libtool: finish: PATH="/usr/local/bin:/usr/bin:/bin:/usr/games:/home/osmocom-build/bin:/sbin" ldconfig -n ---------------------------------------------------------------------- Libraries have been installed in: If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the '-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the 'LD_RUN_PATH' environment variable during linking - use the '-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to '/etc/ld.so.conf' See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- make[4]: Leaving directory ' make[3]: Leaving directory ' make[2]: Leaving directory ' Making install in src/vty make[2]: Entering directory ' CC telnet_interface.lo CC utils.lo CC vty.lo CC buffer.lo CC command.lo CC vector.lo CC logging_vty.lo CC stats_vty.lo CC fsm_vty.lo CC talloc_ctx_vty.lo CCLD libosmovty.la make[3]: Entering directory ' make[3]: Nothing to be done for 'install-data-am'. /bin/mkdir -p ' /bin/bash ../../libtool --mode=install /usr/bin/install -c libosmovty.la ' libtool: warning: relinking 'libosmovty.la' libtool: install: (cd /bin/bash " --silent --tag CC --mode=relink gcc -Wall -g -O2 -DBUILDING_LIBOSMOCORE -Wall -version-info 4:1:0 -no-undefined -o libosmovty.la -rpath buffer.lo command.lo vty.lo vector.lo utils.lo telnet_interface.lo logging_vty.lo stats_vty.lo fsm_vty.lo talloc_ctx_vty.lo ../../src/libosmocore.la -ltalloc ) libtool: install: /usr/bin/install -c .libs/libosmovty.so.4.0.1T libtool: install: (cd && { ln -s -f libosmovty.so.4.0.1 libosmovty.so.4 || { rm -f libosmovty.so.4 && ln -s libosmovty.so.4.0.1 libosmovty.so.4; }; }) libtool: install: (cd && { ln -s -f libosmovty.so.4.0.1 libosmovty.so || { rm -f libosmovty.so && ln -s libosmovty.so.4.0.1 libosmovty.so; }; }) libtool: install: /usr/bin/install -c .libs/libosmovty.lai libtool: finish: PATH="/usr/local/bin:/usr/bin:/bin:/usr/games:/home/osmocom-build/bin:/sbin" ldconfig -n ---------------------------------------------------------------------- Libraries have been installed in: If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the '-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the 'LD_RUN_PATH' environment variable during linking - use the '-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to '/etc/ld.so.conf' See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- make[3]: Leaving directory ' make[2]: Leaving directory ' Making install in src/codec make[2]: Entering directory ' CC ecu_fr.lo CC gsm690.lo CC gsm660.lo CC gsm620.lo CC gsm610.lo CCLD libosmocodec.la make[3]: Entering directory ' make[3]: Nothing to be done for 'install-data-am'. /bin/mkdir -p ' /bin/bash ../../libtool --mode=install /usr/bin/install -c libosmocodec.la ' libtool: warning: relinking 'libosmocodec.la' libtool: install: (cd /bin/bash " --silent --tag CC --mode=relink gcc -Wall -g -O2 -DBUILDING_LIBOSMOCORE -Wall -version-info 1:0:1 -no-undefined -o libosmocodec.la -rpath gsm610.lo gsm620.lo gsm660.lo gsm690.lo ecu_fr.lo ../../src/libosmocore.la ) libtool: install: /usr/bin/install -c .libs/libosmocodec.so.0.1.0T libtool: install: (cd && { ln -s -f libosmocodec.so.0.1.0 libosmocodec.so.0 || { rm -f libosmocodec.so.0 && ln -s libosmocodec.so.0.1.0 libosmocodec.so.0; }; }) libtool: install: (cd && { ln -s -f libosmocodec.so.0.1.0 libosmocodec.so || { rm -f libosmocodec.so && ln -s libosmocodec.so.0.1.0 libosmocodec.so; }; }) libtool: install: /usr/bin/install -c .libs/libosmocodec.lai libtool: finish: PATH="/usr/local/bin:/usr/bin:/bin:/usr/games:/home/osmocom-build/bin:/sbin" ldconfig -n ---------------------------------------------------------------------- Libraries have been installed in: If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the '-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the 'LD_RUN_PATH' environment variable during linking - use the '-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to '/etc/ld.so.conf' See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- make[3]: Leaving directory ' make[2]: Leaving directory ' Making install in src/gsm make[2]: Entering directory ' GEN gsm0503_conv.c Generating convolutional codes... Generate 'xcch' definition Generate 'rach' definition Generate 'rach_ext' definition Generate 'sch' definition Generate 'cs2' definition Generate 'cs3' definition Generate 'cs2_np' definition Generate 'cs3_np' definition Generate 'tch_afs_12_2' definition Generate 'tch_afs_10_2' definition Generate 'tch_afs_7_95' definition Generate 'tch_afs_7_4' definition Generate 'tch_afs_6_7' definition Generate 'tch_afs_5_9' definition Generate 'tch_afs_5_15' definition Generate 'tch_afs_4_75' definition Generate 'tch_fr' definition Generate 'tch_hr' definition Generate 'tch_ahs_7_95' definition Generate 'tch_ahs_7_4' definition Generate 'tch_ahs_6_7' definition Generate 'tch_ahs_5_9' definition Generate 'tch_ahs_5_15' definition Generate 'tch_ahs_4_75' definition Generate 'mcs1_dl_hdr' definition Generate 'mcs1_ul_hdr' definition Generate 'mcs1' definition Generate 'mcs2' definition Generate 'mcs3' definition Generate 'mcs4' definition Generate 'mcs5_dl_hdr' definition Generate 'mcs5_ul_hdr' definition Generate 'mcs5' definition Generate 'mcs6' definition Generate 'mcs7_dl_hdr' definition Generate 'mcs7_ul_hdr' definition Generate 'mcs7' definition Generate 'mcs8' definition Generate 'mcs9' definition Generation complete. make install-am make[3]: Entering directory ' CC a5.lo CC comp128v23.lo CC rxlev_stat.lo CC tlv_parser.lo CC comp128.lo CC gsm_utils.lo CC rsl.lo CC gsm48.lo /bin/bash: line 2: 32085 Illegal instruction /bin/bash ../../libtool --silent --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../include -I/usr/include/p11-kit-1 -DBUILDING_LIBOSMOCORE -Wall -Wall -g -O2 -DBUILDING_LIBOSMOCORE -Wall -MT a5.lo -MD -MP -MF $depbase.Tpo -c -o a5.lo a5.c /bin/bash: line 2: 32086 Illegal instruction /bin/bash ../../libtool --silent --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../include -I/usr/include/p11-kit-1 -DBUILDING_LIBOSMOCORE -Wall -Wall -g -O2 -DBUILDING_LIBOSMOCORE -Wall -MT tlv_parser.lo -MD -MP -MF $depbase.Tpo -c -o tlv_parser.lo tlv_parser.c Makefile:580: recipe for target 'a5.lo' failed make[3]: *** [a5.lo] Error 132 make[3]: *** Waiting for unfinished jobs.... Makefile:580: recipe for target 'tlv_parser.lo' failed make[3]: *** [tlv_parser.lo] Error 132 gsm_utils.c:112:9: note: #pragma message: including GnuTLS for getrandom fallback. #pragma message ("including GnuTLS for getrandom fallback.") ^~~~~~~ gsm_utils.c: In function ?osmo_get_rand_id?: gsm_utils.c:448:9: note: #pragma message: Using direct syscall access for getrandom(): consider upgrading to glibc >= 2.25 #pragma message ("Using direct syscall access for getrandom(): consider upgrading to glibc >= 2.25") ^~~~~~~ gsm_utils.c:456:9: note: #pragma message: Secure random failed: using GnuTLS fallback. #pragma message ("Secure random failed: using GnuTLS fallback.") ^~~~~~~ make[3]: Leaving directory ' Makefile:685: recipe for target 'install' failed make[2]: *** [install] Error 2 make[2]: Leaving directory ' Makefile:604: recipe for target 'install-recursive' failed make[1]: *** [install-recursive] Error 1 make[1]: Leaving directory ' Makefile:903: recipe for target 'install' failed make: *** [install] Error 2 Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From jenkins at lists.osmocom.org Wed Jul 25 19:05:37 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Wed, 25 Jul 2018 19:05:37 +0000 (UTC) Subject: =?UTF-8?Q?Jenkins_build_is_back_to_norma?= =?UTF-8?Q?l_:_master-osmo-sip-connector_=C2=BB?= =?UTF-8?Q?_a1=3Ddefault,a2=3Ddefault,a3=3Ddefa?= =?UTF-8?Q?ult,osmocom-master-debian9_#551?= In-Reply-To: <1971999481.75.1532544850281.JavaMail.jenkins@jenkins.osmocom.org> References: <1971999481.75.1532544850281.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <1456269976.76.1532545537354.JavaMail.jenkins@jenkins.osmocom.org> See From gerrit-no-reply at lists.osmocom.org Thu Jul 26 00:32:44 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 26 Jul 2018 00:32:44 +0000 Subject: Change in libosmo-sccp[master]: ipa_asp_fsm: init: expect IPA ID ACK, not GET Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10162 Change subject: ipa_asp_fsm: init: expect IPA ID ACK, not GET ...................................................................... ipa_asp_fsm: init: expect IPA ID ACK, not GET Testing with an actual SCCPlite MSC, I see the IPA connection starting out by the MSC sending an IPA ID ACK. Make the ipa_asp_fsm match that. Change-Id: Icffda98579e676ab6ca63c9c22cf5d151c4fe95f --- M src/xua_asp_fsm.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/62/10162/1 diff --git a/src/xua_asp_fsm.c b/src/xua_asp_fsm.c index 93c76cb..8429da3 100644 --- a/src/xua_asp_fsm.c +++ b/src/xua_asp_fsm.c @@ -785,7 +785,7 @@ } } else { /* Client: We simply wait for an ID GET */ - osmo_fsm_inst_state_chg(fi, IPA_ASP_S_WAIT_ID_GET, 10, T_WAIT_ID_GET); + osmo_fsm_inst_state_chg(fi, IPA_ASP_S_WAIT_ID_ACK, 10, T_WAIT_ID_ACK); } break; } @@ -985,7 +985,7 @@ [IPA_ASP_S_DOWN] = { .in_event_mask = S(XUA_ASP_E_M_ASP_UP_REQ) | S(XUA_ASP_E_SCTP_EST_IND), - .out_state_mask = S(IPA_ASP_S_WAIT_ID_GET) | + .out_state_mask = S(IPA_ASP_S_WAIT_ID_ACK) | S(IPA_ASP_S_WAIT_ID_RESP), .name = "ASP_DOWN", .action = ipa_asp_fsm_down, -- To view, visit https://gerrit.osmocom.org/10162 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Icffda98579e676ab6ca63c9c22cf5d151c4fe95f Gerrit-Change-Number: 10162 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 00:32:45 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 26 Jul 2018 00:32:45 +0000 Subject: Change in libosmo-sccp[master]: ipa: if there are PCs in the msg, use them for routing Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10163 Change subject: ipa: if there are PCs in the msg, use them for routing ...................................................................... ipa: if there are PCs in the msg, use them for routing patch_sccp_with_pc() overwrites the SCCP addresses' point-codes only if there are none yet in the message. ipa_rx_msg_sccp() feeds opc and dpc to patch into the message, and so far uses these opc and dpc in the xua_msg_hdr even if there are different PCs in the SCCP message already, and these opc and dpc were never patched into the msg. Change the opc and dpc args of patch_sccp_with_pc() as in+out params, and if not patched into the message, return the opc and dpc actually found in the message. Hence in ipa_rx_msg_sccp() compose the m3ua_data_hdr with the point-codes found in the message, instead of those that would have been but were not actually patched into the message and potentially mismatch it. Testing with an SCCPlite MSC actually gives me complete SCCP addresses with point-codes, so it is not set in stone to receive no point-codes over IPA. If the cs7 vty config matches the point-codes received, there is no problem, but I faced a weird situation when the config is wrong: osmo-bsc logs the PCs received in the message while it confusingly uses the config ones for routing. Change-Id: I157c43a5dc12f6e24828efef1dceac246497e313 --- M src/ipa.c 1 file changed, 17 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/63/10163/1 diff --git a/src/ipa.c b/src/ipa.c index f3a7a52..dc0c603 100644 --- a/src/ipa.c +++ b/src/ipa.c @@ -138,9 +138,10 @@ return NULL; } -/* Patch a SCCP message and add point codes to Called/Calling Party (if missing) */ +/* Patch a SCCP message and add point codes to Called/Calling Party (if missing). + * If not missing, report back the actually present opc and dpc. */ static struct msgb *patch_sccp_with_pc(struct osmo_ss7_asp *asp, struct msgb *sccp_msg_in, - uint32_t opc, uint32_t dpc) + uint32_t *opc, uint32_t *dpc) { struct osmo_sccp_addr addr; struct msgb *sccp_msg_out; @@ -161,11 +162,13 @@ rc = sua_addr_parse(&addr, sua, SUA_IEI_DEST_ADDR); switch (rc) { case 0: - if (addr.presence & OSMO_SCCP_ADDR_T_PC) + if (addr.presence & OSMO_SCCP_ADDR_T_PC) { + *dpc = addr.pc; break; + } /* if there's no point code in dest_addr, add one */ addr.presence |= OSMO_SCCP_ADDR_T_PC; - addr.pc = dpc; + addr.pc = *dpc; xua_msg_free_tag(sua, SUA_IEI_DEST_ADDR); xua_msg_add_sccp_addr(sua, SUA_IEI_DEST_ADDR, &addr); break; @@ -179,11 +182,13 @@ rc = sua_addr_parse(&addr, sua, SUA_IEI_SRC_ADDR); switch (rc) { case 0: - if (addr.presence & OSMO_SCCP_ADDR_T_PC) + if (addr.presence & OSMO_SCCP_ADDR_T_PC) { + *opc = addr.pc; break; + } /* if there's no point code in src_addr, add one */ addr.presence |= OSMO_SCCP_ADDR_T_PC; - addr.pc = opc; + addr.pc = *opc; xua_msg_free_tag(sua, SUA_IEI_SRC_ADDR); xua_msg_add_sccp_addr(sua, SUA_IEI_SRC_ADDR, &addr); break; @@ -219,7 +224,7 @@ /* We have received an IPA-encapsulated SCCP message, without * any MTP routing label. Furthermore, the SCCP Called/Calling - * Party are SSN-only, with no GT or PC. This means we have no + * Party possibly are SSN-only, with no GT or PC. This means we have no * real idea where it came from, nor where it goes to. We could * simply treat it as being for the local point code, but then * this means that we would have to implement SCCP connection @@ -247,10 +252,13 @@ opc = as->cfg.pc_override.dpc; /* Destination: PC of the routing key */ dpc = as->cfg.routing_key.pc; + + LOGPASP(asp, DLSS7, LOGL_INFO, "Rx message: setting opc=%u dpc=%u\n", + opc, dpc); } - /* Second, patch this into the SCCP message */ - msg = patch_sccp_with_pc(asp, msg, opc, dpc); + /* Second, patch this into the SCCP message, if they lack PCs */ + msg = patch_sccp_with_pc(asp, msg, &opc, &dpc); /* Third, create a MTP3/M3UA label with those point codes */ memset(&data_hdr, 0, sizeof(data_hdr)); -- To view, visit https://gerrit.osmocom.org/10163 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I157c43a5dc12f6e24828efef1dceac246497e313 Gerrit-Change-Number: 10163 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 00:36:19 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 26 Jul 2018 00:36:19 +0000 Subject: Change in libosmo-sccp[master]: ipa: if there are PCs in the msg, use them for routing In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10163 ) Change subject: ipa: if there are PCs in the msg, use them for routing ...................................................................... Patch Set 1: not yet verified against ttcn3-bsc-test sccplite -- To view, visit https://gerrit.osmocom.org/10163 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I157c43a5dc12f6e24828efef1dceac246497e313 Gerrit-Change-Number: 10163 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Thu, 26 Jul 2018 00:36:19 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 00:51:14 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 26 Jul 2018 00:51:14 +0000 Subject: Change in osmo-bsc[master]: lchan_fsm: split off lchan_rtp_fsm, establish RTP a bit earlier In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10103 ) Change subject: lchan_fsm: split off lchan_rtp_fsm, establish RTP a bit earlier ...................................................................... Patch Set 5: Code-Review+2 again only rebase changes, re-adding earlier +2 -- To view, visit https://gerrit.osmocom.org/10103 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id7a4407d9b63be05ce63f5f2768b7d7e3d5c86fb Gerrit-Change-Number: 10103 Gerrit-PatchSet: 5 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Thu, 26 Jul 2018 00:51:14 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 00:59:56 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 26 Jul 2018 00:59:56 +0000 Subject: Change in osmo-bsc[master]: inter-BSC HO: add neighbor_ident API to manage neighbor-BSS-cells In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9666 ) Change subject: inter-BSC HO: add neighbor_ident API to manage neighbor-BSS-cells ...................................................................... Patch Set 12: (2 comments) https://gerrit.osmocom.org/#/c/9666/3/include/osmocom/bsc/neighbor_ident.h File include/osmocom/bsc/neighbor_ident.h: https://gerrit.osmocom.org/#/c/9666/3/include/osmocom/bsc/neighbor_ident.h at 18 PS3, Line 18: BSIC_9BIT, > Ah, I didn't follow EC-GSM-IoT yet in that level of detail. [?] yeah, I think I'll just drop the 9-bit stuff then, in a way that doesn't prevent us from re-adding it later, in the unlikely event. https://gerrit.osmocom.org/#/c/9666/3/tests/handover/neighbor_ident_test.c File tests/handover/neighbor_ident_test.c: https://gerrit.osmocom.org/#/c/9666/3/tests/handover/neighbor_ident_test.c at 33 PS3, Line 33: arfcn > The User Interface and VTY is 0-1023. There are no higher ARFCN number. [?] Leaving for the future then, but I still haven't grokked where the 0x8000 is coming from. Is it osmocom code using this bit or 3GPP protocol we are receiving? -- To view, visit https://gerrit.osmocom.org/9666 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0153d7069817fba9146ddc11214de2757d7d37bf Gerrit-Change-Number: 9666 Gerrit-PatchSet: 12 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 26 Jul 2018 00:59:56 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 01:52:15 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 26 Jul 2018 01:52:15 +0000 Subject: Change in osmo-bsc[master]: large refactoring: use FSMs for lchans; add inter-BSC HO In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9671 to look at the new patch set (#38). Change subject: large refactoring: use FSMs for lchans; add inter-BSC HO ...................................................................... large refactoring: use FSMs for lchans; add inter-BSC HO Add FSMs: - timeslot_fsm: handle dynamic timeslots and OML+RSL availability. - lchan_fsm: handle an individual lchan activation, RTP stream and release, signal the appropriate calling FSMs on success, failure, release. - mgw_endpoint_fsm: handle one entire endpoint with several CI. - assignment_fsm: BSSMAP Assignment Request. - handover_fsm: all of intra, inter-MO and inter-MT handover. Above FSMs absorb large parts of the gscon FSM. The gscon FSM was surpassing the maximum amount events (32), and it is more logical to treat assignment, handover and MGW procedures in separate FSMs. - Add logging macros for each FSM type: - LOG_TS() - LOG_LCHAN() - LOG_MGWEP(), LOG_CI() - LOG_ASSIGNMENT() - LOG_HO() These log with the osmo_fsm_inst where present. New style decision: logging without a final newline char is awkward, especially for gsmtap logging and when other logs interleave LOGPC() calls; we have various cases where the final \n goes missing, and also this invokes the log category checking N times instead of once. So I decided to make these macros *always* append a newline, but only if there is no final newline yet. I hope that the compiler optimizes the strlen() of the constant format strings away. Thus I can log with or without typing "\n" and always get an \n termination anyway. General: - replace osmo_timers, state enums and program-wide osmo_signal_dispatch() with dedicated FSM timeouts, states and events. - introduce a common way to handle Tnnn timers: gsm_timers.h/.c: struct T_def. These can be used (with some macro magic) to define a state's timeout once, and not make mistakes for each osmo_fsm_inst_state_chg(). Details: bsc_subscr_conn_fsm.c: - move most states of this FSM to lchan_fsm, assignment_fsm, handover_fsm and mgw_endpoint_fsm. - There is exactly one state for an ongoing Assignment, with all details handled in conn->assignment.fi. The state relies on the assignment_fsm's timeout. - There is one state for an ongoing Handover; except for an incoming Handover from a remote BSS, the gscon remains in ST_INIT until the new lchan and conn are both established. - move bssmap_add_lcls_status() to osmo_bsc_lcls.c abis_rsl.c: - move all dynamic timeslot logic away into timeslot_fsm. Only keep plain send/receive functions in abis_rsl.c - reduce some rsl functions to merely send a message, rename to "_tx_". - rsl_ipacc_mdcx(): add '_tx_' in the name; move parts that change the lchan state out into the lchan_fsm, the lchan->abis_ip.* are now set there prior to invoking this function. - move all timers and error/release handling away into various FSMs. - tweak ipa_smod_s_for_lchan() and ipa_rtp_pt_for_lchan() to not require an lchan passed, but just mode,type that they require. Rename to ipacc_speech_mode*() and ipacc_payload_type(). - add rsl_forward_layer3_info, used for inter-BSC HO MO, to just send the RR message received during BSSMAP Handover Command. - move various logging to LOG_LCHAN() in order to log with the lchan FSM instance. One drawback is that the lchan FSM is limited to one logging category, i.e. this moves some logging from DRR to DRSL. It might actually make sense to combine those categories. - lose LOGP...LOGPC logging cascades: they are bad for gsmtap logging and for performance. - handle_classmark_chg(): change logging, move cm2 len check out of the cm3 condition (I hope that's correct). - gsm48_send_ho_cmd(): split off gsm48_make_ho_cmd() which doesn't send right away, so that during inter-bsc HO we can make an RR Handover Command to send via the MSC to the remote BSS. assignment_fsm.c: - the Chan Mode Modify in case of re-using the same lchan is not implemented yet, because this was also missing in the previous implementation (OS#3357). osmo_bsc_api.c: - simplify bsc_mr_config() and move to lchan_fsm.c, the only caller; rename to lchan_mr_config(). (bsc_mr_config() used to copy the values to mr_bts_lv twice, once by member assignment and then again with a memcpy.) - During handover, we used to copy the MR config from the old lchan. Since we may handover between FR and HR, rather set the MR Config anew every time, so that FR rates are always available on FR lchans, and never on HR lchans. Depends: I03ee7ce840ecfa0b6a33358e7385528aabd4873f (libosmocore), I1f2918418c38918c5ac70acaa51a47adfca12b5e (libosmocore) Change-Id: I82e3f918295daa83274a4cf803f046979f284366 --- M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/abis_rsl.h A include/osmocom/bsc/assignment_fsm.h M include/osmocom/bsc/bsc_api.h M include/osmocom/bsc/bsc_msc_data.h M include/osmocom/bsc/bsc_subscr_conn_fsm.h M include/osmocom/bsc/bsc_subscriber.h M include/osmocom/bsc/chan_alloc.h M include/osmocom/bsc/codec_pref.h M include/osmocom/bsc/gsm_04_08_rr.h M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/gsm_timers.h M include/osmocom/bsc/handover.h A include/osmocom/bsc/handover_fsm.h A include/osmocom/bsc/lchan_fsm.h A include/osmocom/bsc/lchan_select.h A include/osmocom/bsc/mgw_endpoint_fsm.h M include/osmocom/bsc/osmo_bsc.h M include/osmocom/bsc/osmo_bsc_lcls.h A include/osmocom/bsc/timeslot_fsm.h M src/ipaccess/Makefile.am M src/ipaccess/stubs.c M src/osmo-bsc/Makefile.am M src/osmo-bsc/abis_om2000.c M src/osmo-bsc/abis_rsl.c A src/osmo-bsc/assignment_fsm.c M src/osmo-bsc/bsc_api.c D src/osmo-bsc/bsc_dyn_ts.c M src/osmo-bsc/bsc_subscr_conn_fsm.c M src/osmo-bsc/bsc_subscriber.c M src/osmo-bsc/bsc_vty.c M src/osmo-bsc/bts_ericsson_rbs2000.c M src/osmo-bsc/bts_ipaccess_nanobts.c M src/osmo-bsc/bts_nokia_site.c M src/osmo-bsc/bts_siemens_bs11.c M src/osmo-bsc/chan_alloc.c M src/osmo-bsc/codec_pref.c M src/osmo-bsc/gsm_04_08_rr.c M src/osmo-bsc/gsm_data.c M src/osmo-bsc/gsm_timers.c M src/osmo-bsc/handover_decision.c M src/osmo-bsc/handover_decision_2.c A src/osmo-bsc/handover_fsm.c M src/osmo-bsc/handover_logic.c A src/osmo-bsc/lchan_fsm.c A src/osmo-bsc/lchan_select.c M src/osmo-bsc/meas_feed.c A src/osmo-bsc/mgw_endpoint_fsm.c M src/osmo-bsc/osmo_bsc_api.c D src/osmo-bsc/osmo_bsc_audio.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_ctrl.c M src/osmo-bsc/osmo_bsc_filter.c M src/osmo-bsc/osmo_bsc_grace.c M src/osmo-bsc/osmo_bsc_lcls.c M src/osmo-bsc/osmo_bsc_main.c M src/osmo-bsc/osmo_bsc_sigtran.c M src/osmo-bsc/paging.c M src/osmo-bsc/pcu_sock.c M src/osmo-bsc/system_information.c A src/osmo-bsc/timeslot_fsm.c M src/utils/Makefile.am M src/utils/bs11_config.c M src/utils/meas_json.c D src/utils/stubs.c M tests/abis/abis_test.c M tests/bsc/Makefile.am M tests/bsc/bsc_test.c M tests/codec_pref/codec_pref_test.c M tests/codec_pref/codec_pref_test.ok M tests/gsm0408/gsm0408_test.c M tests/handover/Makefile.am M tests/handover/handover_test.c M tests/handover/neighbor_ident_test.c M tests/nanobts_omlattr/nanobts_omlattr_test.c 75 files changed, 8,460 insertions(+), 4,784 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/71/9671/38 -- To view, visit https://gerrit.osmocom.org/9671 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I82e3f918295daa83274a4cf803f046979f284366 Gerrit-Change-Number: 9671 Gerrit-PatchSet: 38 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 01:52:18 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 26 Jul 2018 01:52:18 +0000 Subject: Change in osmo-bsc[master]: inter-BSC HO: neighbor_ident API: drop 9bit BSIC Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10164 Change subject: inter-BSC HO: neighbor_ident API: drop 9bit BSIC ...................................................................... inter-BSC HO: neighbor_ident API: drop 9bit BSIC 9-bit BSIC exist in the 3GPP specs, but we don't use them anywhere. Rather remove that choice from the API and UI. Change-Id: I29b92f47da2636d3a19f073755f9382fa98f9010 --- M include/osmocom/bsc/neighbor_ident.h M src/osmo-bsc/handover_logic.c M src/osmo-bsc/neighbor_ident.c M src/osmo-bsc/neighbor_ident_vty.c M tests/handover/neighbor_ident_test.c M tests/handover/neighbor_ident_test.ok M tests/neighbor_ident.vty 7 files changed, 113 insertions(+), 257 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/64/10164/1 diff --git a/include/osmocom/bsc/neighbor_ident.h b/include/osmocom/bsc/neighbor_ident.h index bba18c3..17bffbc 100644 --- a/include/osmocom/bsc/neighbor_ident.h +++ b/include/osmocom/bsc/neighbor_ident.h @@ -12,19 +12,14 @@ struct neighbor_ident_list; struct gsm0808_cell_id_list2; -enum bsic_kind { - BSIC_NONE, - BSIC_6BIT, - BSIC_9BIT, -}; - #define NEIGHBOR_IDENT_KEY_ANY_BTS -1 +#define BSIC_ANY 0xff + struct neighbor_ident_key { int from_bts; /*< BTS nr 0..255 or NEIGHBOR_IDENT_KEY_ANY_BTS */ uint16_t arfcn; - enum bsic_kind bsic_kind; - uint16_t bsic; + uint8_t bsic; }; const char *neighbor_ident_key_name(const struct neighbor_ident_key *ni_key); @@ -52,10 +47,10 @@ void neighbor_ident_vty_init(struct gsm_network *net, struct neighbor_ident_list *nil); void neighbor_ident_vty_write(struct vty *vty, const char *indent, struct gsm_bts *bts); -#define NEIGHBOR_IDENT_VTY_KEY_PARAMS "arfcn <0-1023> (bsic|bsic9) (<0-511>|any)" +#define NEIGHBOR_IDENT_VTY_KEY_PARAMS "arfcn <0-1023> bsic (<0-63>|any)" #define NEIGHBOR_IDENT_VTY_KEY_DOC \ "ARFCN of neighbor cell\n" "ARFCN value\n" \ - "BSIC of neighbor cell\n" "9-bit BSIC of neighbor cell\n" "BSIC value\n" \ + "BSIC of neighbor cell\n" "BSIC value\n" \ "for all BSICs / use any BSIC in this ARFCN\n" bool neighbor_ident_vty_parse_key_params(struct vty *vty, const char **argv, struct neighbor_ident_key *key); diff --git a/src/osmo-bsc/handover_logic.c b/src/osmo-bsc/handover_logic.c index 0f664c6..028b2d4 100644 --- a/src/osmo-bsc/handover_logic.c +++ b/src/osmo-bsc/handover_logic.c @@ -400,7 +400,6 @@ struct neighbor_ident_key entry = { .from_bts = NEIGHBOR_IDENT_KEY_ANY_BTS, .arfcn = bts->c0->arfcn, - .bsic_kind = BSIC_6BIT, .bsic = bts->bsic, }; if (neighbor_ident_key_match(&entry, search_for, true)) { @@ -427,7 +426,6 @@ static struct neighbor_ident_key key; key = (struct neighbor_ident_key){ .arfcn = bts->c0->arfcn, - .bsic_kind = BSIC_6BIT, .bsic = bts->bsic, }; return &key; diff --git a/src/osmo-bsc/neighbor_ident.c b/src/osmo-bsc/neighbor_ident.c index 8a7c580..4a0cd47 100644 --- a/src/osmo-bsc/neighbor_ident.c +++ b/src/osmo-bsc/neighbor_ident.c @@ -67,18 +67,10 @@ APPEND_STR("invalid(%d)", ni_key->from_bts); APPEND_STR(" to "); - switch (ni_key->bsic_kind) { - default: - case BSIC_NONE: + if (ni_key->bsic == BSIC_ANY) APPEND_STR("ARFCN %u (any BSIC)", ni_key->arfcn); - break; - case BSIC_6BIT: + else APPEND_STR("ARFCN %u BSIC %u", ni_key->arfcn, ni_key->bsic & 0x3f); - break; - case BSIC_9BIT: - APPEND_STR("ARFCN %u BSIC %u(9bit)", ni_key->arfcn, ni_key->bsic & 0x1ff); - break; - } return buf; } @@ -104,18 +96,16 @@ } /* Return true when the entry matches the search_for requirements. - * If exact_match is false, a BSIC_NONE entry acts as wildcard to match any search_for on that ARFCN, - * and a BSIC_NONE in search_for likewise returns any one entry that matches the ARFCN; + * If exact_match is false, a BSIC_ANY entry acts as wildcard to match any search_for on that ARFCN, + * and a BSIC_ANY in search_for likewise returns any one entry that matches the ARFCN; * also a from_bts == NEIGHBOR_IDENT_KEY_ANY_BTS in either entry or search_for will match. - * If exact_match is true, only identical bsic_kind values and identical from_bts values return a match. + * If exact_match is true, only identical bsic values and identical from_bts values return a match. * Note, typically wildcard BSICs are only in entry, e.g. the user configured list, and search_for * contains a specific BSIC, e.g. as received from a Measurement Report. */ bool neighbor_ident_key_match(const struct neighbor_ident_key *entry, const struct neighbor_ident_key *search_for, bool exact_match) { - uint16_t bsic_mask; - if (exact_match && entry->from_bts != search_for->from_bts) return false; @@ -128,32 +118,13 @@ if (entry->arfcn != search_for->arfcn) return false; - switch (entry->bsic_kind) { - default: + if (exact_match && entry->bsic != search_for->bsic) return false; - case BSIC_NONE: - if (!exact_match) { - /* The neighbor identifier list entry matches any BSIC for this ARFCN. */ - return true; - } - /* Match exact entry */ - bsic_mask = 0; - break; - case BSIC_6BIT: - bsic_mask = 0x3f; - break; - case BSIC_9BIT: - bsic_mask = 0x1ff; - break; - } - if (!exact_match && search_for->bsic_kind == BSIC_NONE) { - /* The search is looking only for an ARFCN with any BSIC */ + + if (entry->bsic == BSIC_ANY || search_for->bsic == BSIC_ANY) return true; - } - if (search_for->bsic_kind == entry->bsic_kind - && (search_for->bsic & bsic_mask) == (entry->bsic & bsic_mask)) - return true; - return false; + + return entry->bsic == search_for->bsic; } static struct neighbor_ident *_neighbor_ident_get(const struct neighbor_ident_list *nil, @@ -189,20 +160,8 @@ && (key->from_bts < 0 || key->from_bts > 255)) return false; - switch (key->bsic_kind) { - case BSIC_6BIT: - if (key->bsic > 0x3f) - return false; - break; - case BSIC_9BIT: - if (key->bsic > 0x1ff) - return false; - break; - case BSIC_NONE: - break; - default: + if (key->bsic != BSIC_ANY && key->bsic > 0x3f) return false; - } return true; } diff --git a/src/osmo-bsc/neighbor_ident_vty.c b/src/osmo-bsc/neighbor_ident_vty.c index 44830ab..a38d123 100644 --- a/src/osmo-bsc/neighbor_ident_vty.c +++ b/src/osmo-bsc/neighbor_ident_vty.c @@ -52,8 +52,7 @@ struct neighbor_ident_key *key) { const char *arfcn_str = argv[0]; - const char *bsic_kind = argv[1]; - const char *bsic_str = argv[2]; + const char *bsic_str = argv[1]; OSMO_ASSERT(bts); @@ -63,16 +62,9 @@ }; if (!strcmp(bsic_str, "any")) - key->bsic_kind = BSIC_NONE; - else { - key->bsic_kind = (!strcmp(bsic_kind, "bsic9")) ? BSIC_9BIT : BSIC_6BIT; + key->bsic = BSIC_ANY; + else key->bsic = atoi(bsic_str); - if (key->bsic_kind == BSIC_6BIT && key->bsic > 0x3f) { - vty_out(vty, "%% Error: BSIC value surpasses 6-bit range: %u, use 'bsic9' instead%s", - key->bsic, VTY_NEWLINE); - return false; - } - } return true; } @@ -239,7 +231,7 @@ if (!bts || !key) return false; return key->arfcn == bts->c0->arfcn - && (key->bsic_kind == BSIC_NONE || key->bsic == bts->bsic); + && (key->bsic == BSIC_ANY || key->bsic == bts->bsic); } static int add_remote_or_local_bts(struct vty *vty, const struct gsm0808_cell_id *cell_id, @@ -431,18 +423,10 @@ #define NEIGH_BSS_WRITE(fmt, args...) do { \ vty_out(vty, "%sneighbor add " fmt " arfcn %u ", d->indent, ## args, key->arfcn); \ - switch (key->bsic_kind) { \ - default: \ - case BSIC_NONE: \ + if (key->bsic == BSIC_ANY) \ vty_out(vty, "bsic any"); \ - break; \ - case BSIC_6BIT: \ + else \ vty_out(vty, "bsic %u", key->bsic & 0x3f); \ - break; \ - case BSIC_9BIT: \ - vty_out(vty, "bsic9 %u", key->bsic & 0x1ff); \ - break; \ - } \ vty_out(vty, "%s", VTY_NEWLINE); \ } while(0) diff --git a/tests/handover/neighbor_ident_test.c b/tests/handover/neighbor_ident_test.c index b67219c..4eddd4a 100644 --- a/tests/handover/neighbor_ident_test.c +++ b/tests/handover/neighbor_ident_test.c @@ -30,13 +30,12 @@ struct neighbor_ident_list *nil; -static const struct neighbor_ident_key *k(int from_bts, uint16_t arfcn, enum bsic_kind kind, uint16_t bsic) +static const struct neighbor_ident_key *k(int from_bts, uint16_t arfcn, uint8_t bsic) { static struct neighbor_ident_key key; key = (struct neighbor_ident_key){ .from_bts = from_bts, .arfcn = arfcn, - .bsic_kind = kind, .bsic = bsic, }; return &key; @@ -187,61 +186,54 @@ printf("\n--- testing NULL neighbor_ident_list\n"); nil = NULL; - check_add(k(0, 1, BSIC_6BIT, 2), &cgi1, -ENOMEM); - check_get(k(0, 1, BSIC_6BIT, 2), false); - check_del(k(0, 1, BSIC_6BIT, 2), false); + check_add(k(0, 1, 2), &cgi1, -ENOMEM); + check_get(k(0, 1, 2), false); + check_del(k(0, 1, 2), false); printf("\n--- adding entries, test that no two identical entries are added\n"); nil = neighbor_ident_init(ctx); - check_add(k(0, 1, BSIC_6BIT, 2), &cgi1, 1); - check_get(k(0, 1, BSIC_6BIT, 2), true); - check_add(k(0, 1, BSIC_6BIT, 2), &cgi1, 1); - check_add(k(0, 1, BSIC_6BIT, 2), &cgi2, 2); - check_add(k(0, 1, BSIC_6BIT, 2), &cgi2, 2); - check_del(k(0, 1, BSIC_6BIT, 2), true); + check_add(k(0, 1, 2), &cgi1, 1); + check_get(k(0, 1, 2), true); + check_add(k(0, 1, 2), &cgi1, 1); + check_add(k(0, 1, 2), &cgi2, 2); + check_add(k(0, 1, 2), &cgi2, 2); + check_del(k(0, 1, 2), true); printf("\n--- Cannot mix cell identifier types for one entry\n"); - check_add(k(0, 1, BSIC_6BIT, 2), &cgi1, 1); - check_add(k(0, 1, BSIC_6BIT, 2), &lac1, -EINVAL); - check_del(k(0, 1, BSIC_6BIT, 2), true); + check_add(k(0, 1, 2), &cgi1, 1); + check_add(k(0, 1, 2), &lac1, -EINVAL); + check_del(k(0, 1, 2), true); neighbor_ident_free(nil); printf("\n--- BTS matching: specific BTS is stronger\n"); nil = neighbor_ident_init(ctx); - check_add(k(NEIGHBOR_IDENT_KEY_ANY_BTS, 1, BSIC_6BIT, 2), &lac1, 1); - check_add(k(3, 1, BSIC_6BIT, 2), &lac2, 2); - check_get(k(2, 1, BSIC_6BIT, 2), true); - check_get(k(3, 1, BSIC_6BIT, 2), true); - check_get(k(4, 1, BSIC_6BIT, 2), true); - check_get(k(NEIGHBOR_IDENT_KEY_ANY_BTS, 1, BSIC_6BIT, 2), true); + check_add(k(NEIGHBOR_IDENT_KEY_ANY_BTS, 1, 2), &lac1, 1); + check_add(k(3, 1, 2), &lac2, 2); + check_get(k(2, 1, 2), true); + check_get(k(3, 1, 2), true); + check_get(k(4, 1, 2), true); + check_get(k(NEIGHBOR_IDENT_KEY_ANY_BTS, 1, 2), true); neighbor_ident_free(nil); printf("\n--- BSIC matching: 6bit and 9bit are different realms, and wildcard match is weaker\n"); nil = neighbor_ident_init(ctx); - check_add(k(0, 1, BSIC_NONE, 0), &cgi1, 1); - check_add(k(0, 1, BSIC_6BIT, 2), &lac1, 1); - check_add(k(0, 1, BSIC_9BIT, 2), &lac2, 2); - check_get(k(0, 1, BSIC_6BIT, 2), true); - check_get(k(0, 1, BSIC_9BIT, 2), true); - printf("--- wildcard matches both 6bit and 9bit BSIC regardless:\n"); - check_get(k(0, 1, BSIC_6BIT, 23), true); - check_get(k(0, 1, BSIC_9BIT, 23), true); + check_add(k(0, 1, BSIC_ANY), &cgi1, 1); + check_add(k(0, 1, 2), &lac1, 1); + check_add(k(0, 1, 2), &lac2, 2); + check_get(k(0, 1, 2), true); + check_get(k(0, 1, 2), true); neighbor_ident_free(nil); printf("\n--- Value ranges\n"); nil = neighbor_ident_init(ctx); - check_add(k(0, 6, BSIC_6BIT, 1 << 6), &lac1, -ERANGE); - check_add(k(0, 9, BSIC_9BIT, 1 << 9), &lac1, -ERANGE); - check_add(k(0, 6, BSIC_6BIT, -1), &lac1, -ERANGE); - check_add(k(0, 9, BSIC_9BIT, -1), &lac1, -ERANGE); - check_add(k(NEIGHBOR_IDENT_KEY_ANY_BTS - 1, 1, BSIC_NONE, 1), &cgi2, -ERANGE); - check_add(k(256, 1, BSIC_NONE, 1), &cgi2, -ERANGE); - check_add(k(0, 0, BSIC_NONE, 0), &cgi1, 1); - check_add(k(255, 65535, BSIC_NONE, 65535), &lac1, 1); - check_add(k(0, 0, BSIC_6BIT, 0), &cgi2, 2); - check_add(k(255, 65535, BSIC_6BIT, 0x3f), &lac2, 2); - check_add(k(0, 0, BSIC_9BIT, 0), &cgi1, 1); - check_add(k(255, 65535, BSIC_9BIT, 0x1ff), &cgi2, 2); + check_add(k(0, 6, 1 << 6), &lac1, -ERANGE); + check_add(k(0, 6, BSIC_ANY - 1), &lac1, -ERANGE); + check_add(k(NEIGHBOR_IDENT_KEY_ANY_BTS - 1, 1, BSIC_ANY), &cgi2, -ERANGE); + check_add(k(256, 1, BSIC_ANY), &cgi2, -ERANGE); + check_add(k(0, 0, BSIC_ANY), &cgi1, 1); + check_add(k(255, 65535, BSIC_ANY), &lac1, 1); + check_add(k(0, 0, 0), &cgi2, 2); + check_add(k(255, 65535, 0x3f), &lac2, 2); neighbor_ident_free(nil); @@ -262,9 +254,9 @@ nil = neighbor_ident_init(ctx); - i = neighbor_ident_add(nil, k(0, 1, BSIC_6BIT, 2), &a); + i = neighbor_ident_add(nil, k(0, 1, 2), &a); printf("Added first cell identifier list (added %u) --> rc = %d\n", a.id_list_len, i); - i = neighbor_ident_add(nil, k(0, 1, BSIC_6BIT, 2), &b); + i = neighbor_ident_add(nil, k(0, 1, 2), &b); printf("Added second cell identifier list (tried to add %u) --> rc = %d\n", b.id_list_len, i); if (i != -ENOSPC) printf("ERROR: expected rc=%d\n", -ENOSPC); diff --git a/tests/handover/neighbor_ident_test.ok b/tests/handover/neighbor_ident_test.ok index 280b6f2..961a33c 100644 --- a/tests/handover/neighbor_ident_test.ok +++ b/tests/handover/neighbor_ident_test.ok @@ -1,62 +1,62 @@ --- testing NULL neighbor_ident_list -neighbor_ident_add(k(0, 1, BSIC_6BIT, 2), &cgi1) --> expect rc=-ENOMEM, got -12 +neighbor_ident_add(k(0, 1, 2), &cgi1) --> expect rc=-ENOMEM, got -12 (empty) -neighbor_ident_get(k(0, 1, BSIC_6BIT, 2)) --> NULL -neighbor_ident_del(k(0, 1, BSIC_6BIT, 2)) --> nothing deleted +neighbor_ident_get(k(0, 1, 2)) --> NULL +neighbor_ident_del(k(0, 1, 2)) --> nothing deleted (empty) --- adding entries, test that no two identical entries are added -neighbor_ident_add(k(0, 1, BSIC_6BIT, 2), &cgi1) --> expect rc=1, got 1 +neighbor_ident_add(k(0, 1, 2), &cgi1) --> expect rc=1, got 1 0: BTS 0 to ARFCN 1 BSIC 2 cell_id_list cgi[1] = { 0: 001-02-3-4 } -neighbor_ident_get(k(0, 1, BSIC_6BIT, 2)) --> entry returned +neighbor_ident_get(k(0, 1, 2)) --> entry returned cell_id_list cgi[1] = { 0: 001-02-3-4 } -neighbor_ident_add(k(0, 1, BSIC_6BIT, 2), &cgi1) --> expect rc=1, got 1 +neighbor_ident_add(k(0, 1, 2), &cgi1) --> expect rc=1, got 1 0: BTS 0 to ARFCN 1 BSIC 2 cell_id_list cgi[1] = { 0: 001-02-3-4 } -neighbor_ident_add(k(0, 1, BSIC_6BIT, 2), &cgi2) --> expect rc=2, got 2 +neighbor_ident_add(k(0, 1, 2), &cgi2) --> expect rc=2, got 2 0: BTS 0 to ARFCN 1 BSIC 2 cell_id_list cgi[2] = { 0: 001-02-3-4 1: 005-006-7-8 } -neighbor_ident_add(k(0, 1, BSIC_6BIT, 2), &cgi2) --> expect rc=2, got 2 +neighbor_ident_add(k(0, 1, 2), &cgi2) --> expect rc=2, got 2 0: BTS 0 to ARFCN 1 BSIC 2 cell_id_list cgi[2] = { 0: 001-02-3-4 1: 005-006-7-8 } -neighbor_ident_del(k(0, 1, BSIC_6BIT, 2)) --> entry deleted +neighbor_ident_del(k(0, 1, 2)) --> entry deleted (empty) --- Cannot mix cell identifier types for one entry -neighbor_ident_add(k(0, 1, BSIC_6BIT, 2), &cgi1) --> expect rc=1, got 1 +neighbor_ident_add(k(0, 1, 2), &cgi1) --> expect rc=1, got 1 0: BTS 0 to ARFCN 1 BSIC 2 cell_id_list cgi[1] = { 0: 001-02-3-4 } -neighbor_ident_add(k(0, 1, BSIC_6BIT, 2), &lac1) --> expect rc=-EINVAL, got -22 +neighbor_ident_add(k(0, 1, 2), &lac1) --> expect rc=-EINVAL, got -22 0: BTS 0 to ARFCN 1 BSIC 2 cell_id_list cgi[1] = { 0: 001-02-3-4 } -neighbor_ident_del(k(0, 1, BSIC_6BIT, 2)) --> entry deleted +neighbor_ident_del(k(0, 1, 2)) --> entry deleted (empty) --- BTS matching: specific BTS is stronger -neighbor_ident_add(k(NEIGHBOR_IDENT_KEY_ANY_BTS, 1, BSIC_6BIT, 2), &lac1) --> expect rc=1, got 1 +neighbor_ident_add(k(NEIGHBOR_IDENT_KEY_ANY_BTS, 1, 2), &lac1) --> expect rc=1, got 1 0: BTS * to ARFCN 1 BSIC 2 cell_id_list lac[1] = { 0: 123 } -neighbor_ident_add(k(3, 1, BSIC_6BIT, 2), &lac2) --> expect rc=2, got 2 +neighbor_ident_add(k(3, 1, 2), &lac2) --> expect rc=2, got 2 0: BTS * to ARFCN 1 BSIC 2 cell_id_list lac[1] = { 0: 123 @@ -66,31 +66,31 @@ 0: 456 1: 789 } -neighbor_ident_get(k(2, 1, BSIC_6BIT, 2)) --> entry returned +neighbor_ident_get(k(2, 1, 2)) --> entry returned cell_id_list lac[1] = { 0: 123 } -neighbor_ident_get(k(3, 1, BSIC_6BIT, 2)) --> entry returned +neighbor_ident_get(k(3, 1, 2)) --> entry returned cell_id_list lac[2] = { 0: 456 1: 789 } -neighbor_ident_get(k(4, 1, BSIC_6BIT, 2)) --> entry returned +neighbor_ident_get(k(4, 1, 2)) --> entry returned cell_id_list lac[1] = { 0: 123 } -neighbor_ident_get(k(NEIGHBOR_IDENT_KEY_ANY_BTS, 1, BSIC_6BIT, 2)) --> entry returned +neighbor_ident_get(k(NEIGHBOR_IDENT_KEY_ANY_BTS, 1, 2)) --> entry returned cell_id_list lac[1] = { 0: 123 } --- BSIC matching: 6bit and 9bit are different realms, and wildcard match is weaker -neighbor_ident_add(k(0, 1, BSIC_NONE, 0), &cgi1) --> expect rc=1, got 1 +neighbor_ident_add(k(0, 1, BSIC_ANY), &cgi1) --> expect rc=1, got 1 0: BTS 0 to ARFCN 1 (any BSIC) cell_id_list cgi[1] = { 0: 001-02-3-4 } -neighbor_ident_add(k(0, 1, BSIC_6BIT, 2), &lac1) --> expect rc=1, got 1 +neighbor_ident_add(k(0, 1, 2), &lac1) --> expect rc=1, got 1 0: BTS 0 to ARFCN 1 (any BSIC) cell_id_list cgi[1] = { 0: 001-02-3-4 @@ -99,58 +99,46 @@ cell_id_list lac[1] = { 0: 123 } -neighbor_ident_add(k(0, 1, BSIC_9BIT, 2), &lac2) --> expect rc=2, got 2 +neighbor_ident_add(k(0, 1, 2), &lac2) --> expect rc=2, got 3 +ERROR 0: BTS 0 to ARFCN 1 (any BSIC) cell_id_list cgi[1] = { 0: 001-02-3-4 } 1: BTS 0 to ARFCN 1 BSIC 2 - cell_id_list lac[1] = { + cell_id_list lac[3] = { 0: 123 + 1: 456 + 2: 789 } - 2: BTS 0 to ARFCN 1 BSIC 2(9bit) - cell_id_list lac[2] = { - 0: 456 - 1: 789 - } -neighbor_ident_get(k(0, 1, BSIC_6BIT, 2)) --> entry returned - cell_id_list lac[1] = { +neighbor_ident_get(k(0, 1, 2)) --> entry returned + cell_id_list lac[3] = { 0: 123 + 1: 456 + 2: 789 } -neighbor_ident_get(k(0, 1, BSIC_9BIT, 2)) --> entry returned - cell_id_list lac[2] = { - 0: 456 - 1: 789 - } ---- wildcard matches both 6bit and 9bit BSIC regardless: -neighbor_ident_get(k(0, 1, BSIC_6BIT, 23)) --> entry returned - cell_id_list cgi[1] = { - 0: 001-02-3-4 - } -neighbor_ident_get(k(0, 1, BSIC_9BIT, 23)) --> entry returned - cell_id_list cgi[1] = { - 0: 001-02-3-4 +neighbor_ident_get(k(0, 1, 2)) --> entry returned + cell_id_list lac[3] = { + 0: 123 + 1: 456 + 2: 789 } --- Value ranges -neighbor_ident_add(k(0, 6, BSIC_6BIT, 1 << 6), &lac1) --> expect rc=-ERANGE, got -34 +neighbor_ident_add(k(0, 6, 1 << 6), &lac1) --> expect rc=-ERANGE, got -34 (empty) -neighbor_ident_add(k(0, 9, BSIC_9BIT, 1 << 9), &lac1) --> expect rc=-ERANGE, got -34 +neighbor_ident_add(k(0, 6, BSIC_ANY - 1), &lac1) --> expect rc=-ERANGE, got -34 (empty) -neighbor_ident_add(k(0, 6, BSIC_6BIT, -1), &lac1) --> expect rc=-ERANGE, got -34 +neighbor_ident_add(k(NEIGHBOR_IDENT_KEY_ANY_BTS - 1, 1, BSIC_ANY), &cgi2) --> expect rc=-ERANGE, got -34 (empty) -neighbor_ident_add(k(0, 9, BSIC_9BIT, -1), &lac1) --> expect rc=-ERANGE, got -34 +neighbor_ident_add(k(256, 1, BSIC_ANY), &cgi2) --> expect rc=-ERANGE, got -34 (empty) -neighbor_ident_add(k(NEIGHBOR_IDENT_KEY_ANY_BTS - 1, 1, BSIC_NONE, 1), &cgi2) --> expect rc=-ERANGE, got -34 - (empty) -neighbor_ident_add(k(256, 1, BSIC_NONE, 1), &cgi2) --> expect rc=-ERANGE, got -34 - (empty) -neighbor_ident_add(k(0, 0, BSIC_NONE, 0), &cgi1) --> expect rc=1, got 1 +neighbor_ident_add(k(0, 0, BSIC_ANY), &cgi1) --> expect rc=1, got 1 0: BTS 0 to ARFCN 0 (any BSIC) cell_id_list cgi[1] = { 0: 001-02-3-4 } -neighbor_ident_add(k(255, 65535, BSIC_NONE, 65535), &lac1) --> expect rc=1, got 1 +neighbor_ident_add(k(255, 65535, BSIC_ANY), &lac1) --> expect rc=1, got 1 0: BTS 0 to ARFCN 0 (any BSIC) cell_id_list cgi[1] = { 0: 001-02-3-4 @@ -159,7 +147,7 @@ cell_id_list lac[1] = { 0: 123 } -neighbor_ident_add(k(0, 0, BSIC_6BIT, 0), &cgi2) --> expect rc=2, got 2 +neighbor_ident_add(k(0, 0, 0), &cgi2) --> expect rc=2, got 2 0: BTS 0 to ARFCN 0 (any BSIC) cell_id_list cgi[1] = { 0: 001-02-3-4 @@ -173,7 +161,7 @@ 0: 001-02-3-4 1: 005-006-7-8 } -neighbor_ident_add(k(255, 65535, BSIC_6BIT, 0x3f), &lac2) --> expect rc=2, got 2 +neighbor_ident_add(k(255, 65535, 0x3f), &lac2) --> expect rc=2, got 2 0: BTS 0 to ARFCN 0 (any BSIC) cell_id_list cgi[1] = { 0: 001-02-3-4 @@ -192,57 +180,6 @@ 0: 456 1: 789 } -neighbor_ident_add(k(0, 0, BSIC_9BIT, 0), &cgi1) --> expect rc=1, got 1 - 0: BTS 0 to ARFCN 0 (any BSIC) - cell_id_list cgi[1] = { - 0: 001-02-3-4 - } - 1: BTS 255 to ARFCN 65535 (any BSIC) - cell_id_list lac[1] = { - 0: 123 - } - 2: BTS 0 to ARFCN 0 BSIC 0 - cell_id_list cgi[2] = { - 0: 001-02-3-4 - 1: 005-006-7-8 - } - 3: BTS 255 to ARFCN 65535 BSIC 63 - cell_id_list lac[2] = { - 0: 456 - 1: 789 - } - 4: BTS 0 to ARFCN 0 BSIC 0(9bit) - cell_id_list cgi[1] = { - 0: 001-02-3-4 - } -neighbor_ident_add(k(255, 65535, BSIC_9BIT, 0x1ff), &cgi2) --> expect rc=2, got 2 - 0: BTS 0 to ARFCN 0 (any BSIC) - cell_id_list cgi[1] = { - 0: 001-02-3-4 - } - 1: BTS 255 to ARFCN 65535 (any BSIC) - cell_id_list lac[1] = { - 0: 123 - } - 2: BTS 0 to ARFCN 0 BSIC 0 - cell_id_list cgi[2] = { - 0: 001-02-3-4 - 1: 005-006-7-8 - } - 3: BTS 255 to ARFCN 65535 BSIC 63 - cell_id_list lac[2] = { - 0: 456 - 1: 789 - } - 4: BTS 0 to ARFCN 0 BSIC 0(9bit) - cell_id_list cgi[1] = { - 0: 001-02-3-4 - } - 5: BTS 255 to ARFCN 65535 BSIC 511(9bit) - cell_id_list cgi[2] = { - 0: 001-02-3-4 - 1: 005-006-7-8 - } --- size limits Added first cell identifier list (added 127) --> rc = 127 diff --git a/tests/neighbor_ident.vty b/tests/neighbor_ident.vty index 11227ed..692d894 100644 --- a/tests/neighbor_ident.vty +++ b/tests/neighbor_ident.vty @@ -2,13 +2,13 @@ OsmoBSC> list ... - show bts <0-255> neighbor arfcn <0-1023> (bsic|bsic9) (<0-511>|any) + show bts <0-255> neighbor arfcn <0-1023> bsic (<0-63>|any) ... OsmoBSC> enable OsmoBSC# list ... - show bts <0-255> neighbor arfcn <0-1023> (bsic|bsic9) (<0-511>|any) + show bts <0-255> neighbor arfcn <0-1023> bsic (<0-63>|any) ... OsmoBSC# configure terminal @@ -83,18 +83,18 @@ neighbor add bts <0-255> neighbor add lac <0-65535> neighbor add lac-ci <0-65535> <0-255> - neighbor add lac <0-65535> arfcn <0-1023> (bsic|bsic9) (<0-511>|any) - neighbor add lac-ci <0-65535> <0-255> arfcn <0-1023> (bsic|bsic9) (<0-511>|any) - neighbor add cgi <0-999> <0-999> <0-65535> <0-255> arfcn <0-1023> (bsic|bsic9) (<0-511>|any) + neighbor add lac <0-65535> arfcn <0-1023> bsic (<0-63>|any) + neighbor add lac-ci <0-65535> <0-255> arfcn <0-1023> bsic (<0-63>|any) + neighbor add cgi <0-999> <0-999> <0-65535> <0-255> arfcn <0-1023> bsic (<0-63>|any) neighbor del bts <0-255> - neighbor del arfcn <0-1023> (bsic|bsic9) (<0-511>|any) + neighbor del arfcn <0-1023> bsic (<0-63>|any) ... OsmoBSC(config-net-bts)# show running-config ... !neighbor add OsmoBSC(config-net-bts)# neighbor add cgi 23 42 423 5 arfcn 23 bsic 64 -% Error: BSIC value surpasses 6-bit range: 64, use 'bsic9' instead +% Unknown command. OsmoBSC(config-net-bts)# neighbor add bts 0 % Error: cannot add local BTS 0 as neighbor to BTS 0: Invalid argument @@ -135,11 +135,8 @@ OsmoBSC(config-net-bts)# neighbor add lac-ci 789 10 arfcn 423 bsic any % BTS 0 to ARFCN 423 (any BSIC) now has 1 remote BSS Cell Identifier List entry -OsmoBSC(config-net-bts)# neighbor add lac-ci 789 10 arfcn 423 bsic9 511 -% BTS 0 to ARFCN 423 BSIC 511(9bit) now has 1 remote BSS Cell Identifier List entry - -OsmoBSC(config-net-bts)# neighbor add lac-ci 789 10 arfcn 423 bsic9 1 -% BTS 0 to ARFCN 423 BSIC 1(9bit) now has 1 remote BSS Cell Identifier List entry +OsmoBSC(config-net-bts)# neighbor add lac-ci 789 10 arfcn 423 bsic 63 +% BTS 0 to ARFCN 423 BSIC 63 now has 1 remote BSS Cell Identifier List entry OsmoBSC(config-net-bts)# neighbor add lac-ci 789 10 arfcn 423 bsic 1 % BTS 0 to ARFCN 423 BSIC 1 now has 1 remote BSS Cell Identifier List entry @@ -157,8 +154,7 @@ neighbor add cgi 023 042 234 56 arfcn 23 bsic 42 neighbor add lac 456 arfcn 123 bsic 45 neighbor add lac-ci 789 10 arfcn 423 bsic any - neighbor add lac-ci 789 10 arfcn 423 bsic9 511 - neighbor add lac-ci 789 10 arfcn 423 bsic9 1 + neighbor add lac-ci 789 10 arfcn 423 bsic 63 neighbor add lac-ci 789 10 arfcn 423 bsic 1 ... !neighbor add @@ -186,8 +182,7 @@ neighbor add lac-ci 22 32 neighbor add lac 456 arfcn 123 bsic 45 neighbor add lac-ci 789 10 arfcn 423 bsic any - neighbor add lac-ci 789 10 arfcn 423 bsic9 511 - neighbor add lac-ci 789 10 arfcn 423 bsic9 1 + neighbor add lac-ci 789 10 arfcn 423 bsic 63 neighbor add lac-ci 789 10 arfcn 423 bsic 1 ... !neighbor add @@ -199,8 +194,7 @@ neighbor add lac-ci 21 31 neighbor add lac-ci 22 32 neighbor add lac-ci 789 10 arfcn 423 bsic any - neighbor add lac-ci 789 10 arfcn 423 bsic9 511 - neighbor add lac-ci 789 10 arfcn 423 bsic9 1 + neighbor add lac-ci 789 10 arfcn 423 bsic 63 neighbor add lac-ci 789 10 arfcn 423 bsic 1 ... !neighbor add @@ -211,15 +205,12 @@ ... !neighbor add neighbor add lac-ci 21 31 neighbor add lac-ci 22 32 - neighbor add lac-ci 789 10 arfcn 423 bsic9 511 - neighbor add lac-ci 789 10 arfcn 423 bsic9 1 + neighbor add lac-ci 789 10 arfcn 423 bsic 63 neighbor add lac-ci 789 10 arfcn 423 bsic 1 ... !neighbor add -OsmoBSC(config-net-bts)# neighbor del arfcn 423 bsic9 511 -% Removed remote BSS neighbor BTS 0 to ARFCN 423 BSIC 511(9bit) -OsmoBSC(config-net-bts)# neighbor del arfcn 423 bsic9 1 -% Removed remote BSS neighbor BTS 0 to ARFCN 423 BSIC 1(9bit) +OsmoBSC(config-net-bts)# neighbor del arfcn 423 bsic 63 +% Removed remote BSS neighbor BTS 0 to ARFCN 423 BSIC 63 OsmoBSC(config-net-bts)# show running-config ... !neighbor add -- To view, visit https://gerrit.osmocom.org/10164 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I29b92f47da2636d3a19f073755f9382fa98f9010 Gerrit-Change-Number: 10164 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 01:54:03 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 26 Jul 2018 01:54:03 +0000 Subject: Change in osmo-bsc[master]: inter-BSC HO: add neighbor_ident API to manage neighbor-BSS-cells In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9666 ) Change subject: inter-BSC HO: add neighbor_ident API to manage neighbor-BSS-cells ...................................................................... Patch Set 13: I have removed the 9bit BSIC in the next commit after this one. That way if it would ever come up, we could re-apply the changes to add 9bit bsic by reverting the removal commit from git history. -- To view, visit https://gerrit.osmocom.org/9666 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0153d7069817fba9146ddc11214de2757d7d37bf Gerrit-Change-Number: 9666 Gerrit-PatchSet: 13 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 26 Jul 2018 01:54:03 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 06:43:04 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Thu, 26 Jul 2018 06:43:04 +0000 Subject: Change in osmo-ttcn3-hacks[master]: bts: Stop all components before mtc.stop in f_shutdown Message-ID: daniel has uploaded this change for review. ( https://gerrit.osmocom.org/10165 Change subject: bts: Stop all components before mtc.stop in f_shutdown ...................................................................... bts: Stop all components before mtc.stop in f_shutdown This is the bts version of patch 637ef6c8 Again I picked a test that sometimes failed - BTS_Tests.TC_sacch_info_mod - and ran it 20 times before and after this commit. Before it failed roughly half the time with a DTE and after I was not able to make it fail. Change-Id: I96f02037283b79a93ef4d659b00a90ac519c0a75 --- M bts/BTS_Tests.ttcn 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/65/10165/1 diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index 04c4043..40bfd24 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -342,6 +342,7 @@ function f_shutdown() runs on test_CT { /* mtc.stop cleanly stops testcase execution to avoid unclean shutdown */ + all component.stop; mtc.stop; } -- To view, visit https://gerrit.osmocom.org/10165 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I96f02037283b79a93ef4d659b00a90ac519c0a75 Gerrit-Change-Number: 10165 Gerrit-PatchSet: 1 Gerrit-Owner: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 06:54:58 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Thu, 26 Jul 2018 06:54:58 +0000 Subject: Change in osmo-ttcn3-hacks[master]: bts: Stop all components before mtc.stop in f_shutdown In-Reply-To: References: Message-ID: daniel has posted comments on this change. ( https://gerrit.osmocom.org/10165 ) Change subject: bts: Stop all components before mtc.stop in f_shutdown ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/10165 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I96f02037283b79a93ef4d659b00a90ac519c0a75 Gerrit-Change-Number: 10165 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Thu, 26 Jul 2018 06:54:58 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 07:49:10 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Thu, 26 Jul 2018 07:49:10 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: Fix random error of TC_cl3_rnd_payload Message-ID: daniel has uploaded this change for review. ( https://gerrit.osmocom.org/10166 Change subject: msc: Fix random error of TC_cl3_rnd_payload ...................................................................... msc: Fix random error of TC_cl3_rnd_payload The random length for that test could to out of bounds leading to a Dynamic test case error. The limiting field here is the lengthIndicator of PDU_BSSAP which includes the length of the PDU_BSSMAP mesageType, cellId as well as the layer3 info IE and lenght indicator additionally to the l3info payload. So maximum length for the payload can only be 240 bytes (if the cell ID is encoded in the longest possible way as BSSMAP_FIELD_LAC_RNC_CI). Change-Id: I7be33e261a11f03a80a6b770b6acf0a4be49b85b --- M msc/MSC_Tests.ttcn 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/66/10166/1 diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index 1427fd0..5078292 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -1155,8 +1155,11 @@ private function f_tc_cl3_rnd_payload(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); - var integer len := float2int(rnd() * 256.0); + // length is limited by PDU_BSSAP length field which includes some + // other fields beside l3info payload. So payl can only be 240 bytes + var integer len := float2int(rnd() * 241.0); var octetstring payl := f_rnd_octstring(len); + log("Length:", len); /* Send Complete L3 Info with empty L3 frame */ BSSAP.send(ts_BSSAP_Conn_Req(g_pars.sccp_addr_peer, g_pars.sccp_addr_own, -- To view, visit https://gerrit.osmocom.org/10166 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I7be33e261a11f03a80a6b770b6acf0a4be49b85b Gerrit-Change-Number: 10166 Gerrit-PatchSet: 1 Gerrit-Owner: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 08:39:17 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 26 Jul 2018 08:39:17 +0000 Subject: Change in osmo-ttcn3-hacks[master]: update expected test result for TC_sacch_multi_chg In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10157 to look at the new patch set (#3). Change subject: update expected test result for TC_sacch_multi_chg ...................................................................... update expected test result for TC_sacch_multi_chg This test is has been passing since osmo-bts commit eee7247ebe0d0a54a54b53b739bdd434dfceb511, so expect it to pass instead of fail. Change-Id: I576f881fcb40c4fcbe6b6f767220111a0e9ffd3c Related: OS#3173 --- M bts/expected-results.xml 1 file changed, 1 insertion(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/57/10157/3 -- To view, visit https://gerrit.osmocom.org/10157 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I576f881fcb40c4fcbe6b6f767220111a0e9ffd3c Gerrit-Change-Number: 10157 Gerrit-PatchSet: 3 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 08:39:32 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 26 Jul 2018 08:39:32 +0000 Subject: Change in osmo-ttcn3-hacks[master]: update expected test result for TC_sacch_multi_chg In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10157 to look at the new patch set (#4). Change subject: update expected test result for TC_sacch_multi_chg ...................................................................... update expected test result for TC_sacch_multi_chg This test has been passing since osmo-bts commit eee7247ebe0d0a54a54b53b739bdd434dfceb511, so expect it to pass instead of fail. Change-Id: I576f881fcb40c4fcbe6b6f767220111a0e9ffd3c Related: OS#3173 --- M bts/expected-results.xml 1 file changed, 1 insertion(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/57/10157/4 -- To view, visit https://gerrit.osmocom.org/10157 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I576f881fcb40c4fcbe6b6f767220111a0e9ffd3c Gerrit-Change-Number: 10157 Gerrit-PatchSet: 4 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 08:40:31 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 26 Jul 2018 08:40:31 +0000 Subject: Change in osmo-ttcn3-hacks[master]: bts: Stop all components before mtc.stop in f_shutdown In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10165 ) Change subject: bts: Stop all components before mtc.stop in f_shutdown ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10165 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I96f02037283b79a93ef4d659b00a90ac519c0a75 Gerrit-Change-Number: 10165 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 26 Jul 2018 08:40:31 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 08:45:27 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 26 Jul 2018 08:45:27 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: Fix random error of TC_cl3_rnd_payload In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10166 ) Change subject: msc: Fix random error of TC_cl3_rnd_payload ...................................................................... Patch Set 1: Code-Review+1 (4 comments) https://gerrit.osmocom.org/#/c/10166/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/10166/1//COMMIT_MSG at 9 PS1, Line 9: The random length for that test could to out of bounds leading to a This sentence looks strange to me. Missing word "trigger" or similar after "could"? https://gerrit.osmocom.org/#/c/10166/1/msc/MSC_Tests.ttcn File msc/MSC_Tests.ttcn: https://gerrit.osmocom.org/#/c/10166/1/msc/MSC_Tests.ttcn at 1158 PS1, Line 1158: // length is limited by PDU_BSSAP length field which includes some Better use /* */ for comments. https://gerrit.osmocom.org/#/c/10166/1/msc/MSC_Tests.ttcn at 1159 PS1, Line 1159: // other fields beside l3info payload. So payl can only be 240 bytes be "max" 240 bytes? Why do you use value 241 then? due to accounting the length field too? Would be good to write it down too. https://gerrit.osmocom.org/#/c/10166/1/msc/MSC_Tests.ttcn at 1162 PS1, Line 1162: log("Length:", len); We can drop this line. -- To view, visit https://gerrit.osmocom.org/10166 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7be33e261a11f03a80a6b770b6acf0a4be49b85b Gerrit-Change-Number: 10166 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 26 Jul 2018 08:45:27 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 09:14:32 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Thu, 26 Jul 2018 09:14:32 +0000 Subject: Change in osmo-ttcn3-hacks[master]: bts: Stop all components before mtc.stop in f_shutdown In-Reply-To: References: Message-ID: daniel has submitted this change and it was merged. ( https://gerrit.osmocom.org/10165 ) Change subject: bts: Stop all components before mtc.stop in f_shutdown ...................................................................... bts: Stop all components before mtc.stop in f_shutdown This is the bts version of patch 637ef6c8 Again I picked a test that sometimes failed - BTS_Tests.TC_sacch_info_mod - and ran it 20 times before and after this commit. Before it failed roughly half the time with a DTE and after I was not able to make it fail. Change-Id: I96f02037283b79a93ef4d659b00a90ac519c0a75 --- M bts/BTS_Tests.ttcn 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index 04c4043..40bfd24 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -342,6 +342,7 @@ function f_shutdown() runs on test_CT { /* mtc.stop cleanly stops testcase execution to avoid unclean shutdown */ + all component.stop; mtc.stop; } -- To view, visit https://gerrit.osmocom.org/10165 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I96f02037283b79a93ef4d659b00a90ac519c0a75 Gerrit-Change-Number: 10165 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 09:29:13 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Thu, 26 Jul 2018 09:29:13 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: Fix random error of TC_cl3_rnd_payload In-Reply-To: References: Message-ID: Hello Pau Espin Pedrol, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10166 to look at the new patch set (#2). Change subject: msc: Fix random error of TC_cl3_rnd_payload ...................................................................... msc: Fix random error of TC_cl3_rnd_payload The random length for that test could to out of bounds leading to a Dynamic test case error. The limiting field here is the lengthIndicator of PDU_BSSAP which includes the length of the PDU_BSSMAP mesageType, cellId as well as the layer3 info IE and lenght indicator additionally to the l3info payload. So maximum length for the payload can only be 240 bytes (if the cell ID is encoded in the longest possible way as BSSMAP_FIELD_LAC_RNC_CI). Change-Id: I7be33e261a11f03a80a6b770b6acf0a4be49b85b --- M msc/MSC_Tests.ttcn 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/66/10166/2 -- To view, visit https://gerrit.osmocom.org/10166 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7be33e261a11f03a80a6b770b6acf0a4be49b85b Gerrit-Change-Number: 10166 Gerrit-PatchSet: 2 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 09:29:20 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Thu, 26 Jul 2018 09:29:20 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: Fix random error of TC_cl3_rnd_payload In-Reply-To: References: Message-ID: daniel has posted comments on this change. ( https://gerrit.osmocom.org/10166 ) Change subject: msc: Fix random error of TC_cl3_rnd_payload ...................................................................... Patch Set 1: (3 comments) https://gerrit.osmocom.org/#/c/10166/1/msc/MSC_Tests.ttcn File msc/MSC_Tests.ttcn: https://gerrit.osmocom.org/#/c/10166/1/msc/MSC_Tests.ttcn at 1158 PS1, Line 1158: // length is limited by PDU_BSSAP length field which includes some > Better use /* */ for comments. Done https://gerrit.osmocom.org/#/c/10166/1/msc/MSC_Tests.ttcn at 1159 PS1, Line 1159: // other fields beside l3info payload. So payl can only be 240 bytes > be "max" 240 bytes? [?] The short answer was that before it was 256 for a max length of 255. The long answer is that rnd() always returns a value < 1 and float2int does not round. In https://www.etsi.org/deliver/etsi_es/201800_201899/20187301/04.10.01_60/es_20187301v041001p.pdf#page=343 the formula for generating values in a given range is: float2int(int2float(upperbound - lowerbound +1)*rnd()) + lowerbound // with lowerbound 0, upperbound 240 https://gerrit.osmocom.org/#/c/10166/1/msc/MSC_Tests.ttcn at 1162 PS1, Line 1162: log("Length:", len); > We can drop this line. Thanks, forgot this one -- To view, visit https://gerrit.osmocom.org/10166 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7be33e261a11f03a80a6b770b6acf0a4be49b85b Gerrit-Change-Number: 10166 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel Gerrit-Comment-Date: Thu, 26 Jul 2018 09:29:20 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 09:32:02 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Thu, 26 Jul 2018 09:32:02 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: Fix random error of TC_cl3_rnd_payload In-Reply-To: References: Message-ID: daniel has posted comments on this change. ( https://gerrit.osmocom.org/10166 ) Change subject: msc: Fix random error of TC_cl3_rnd_payload ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/10166 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7be33e261a11f03a80a6b770b6acf0a4be49b85b Gerrit-Change-Number: 10166 Gerrit-PatchSet: 3 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel Gerrit-Comment-Date: Thu, 26 Jul 2018 09:32:02 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 09:35:27 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Thu, 26 Jul 2018 09:35:27 +0000 Subject: Change in libosmocore[master]: GSMTAP: add SIM sub_types Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/10167 Change subject: GSMTAP: add SIM sub_types ...................................................................... GSMTAP: add SIM sub_types In SIMtrace 1 the ATR was sent the same way as an APDU. The ATR is not an APDU, and could be mis-interpreted as valid APDU. This change allows to make the difference between actual APDU and the ATR, but also adds sub_types for future SIMtrace 2 use cases. Change-Id: I5bd0dff5a4a90cfe96d9c4f3dec6657e1d85bf7a --- M include/osmocom/core/gsmtap.h 1 file changed, 13 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/67/10167/1 diff --git a/include/osmocom/core/gsmtap.h b/include/osmocom/core/gsmtap.h index b4239f8..9f5049f 100644 --- a/include/osmocom/core/gsmtap.h +++ b/include/osmocom/core/gsmtap.h @@ -33,7 +33,7 @@ #define GSMTAP_TYPE_UM 0x01 #define GSMTAP_TYPE_ABIS 0x02 #define GSMTAP_TYPE_UM_BURST 0x03 /* raw burst bits */ -#define GSMTAP_TYPE_SIM 0x04 +#define GSMTAP_TYPE_SIM 0x04 /* ISO 7816 smart card interface */ #define GSMTAP_TYPE_TETRA_I1 0x05 /* tetra air interface */ #define GSMTAP_TYPE_TETRA_I1_BURST 0x06 /* tetra air interface */ #define GSMTAP_TYPE_WMX_BURST 0x07 /* WiMAX burst */ @@ -103,6 +103,18 @@ /* ====== DO NOT MAKE UNAPPROVED MODIFICATIONS HERE ===== */ +/* sub-types for GSMTAP_TYPE_SIM */ +#define GSMTAP_SIM_APDU 0x00 /* APDU data (complete APDU) */ +#define GSMTAP_SIM_ATR 0x01 /* card ATR data */ +#define GSMTAP_SIM_PPS_REQ 0x02 /* PPS request data */ +#define GSMTAP_SIM_PPS_RSP 0x03 /* PPS response data */ +#define GSMTAP_SIM_TPDU_HDR 0x04 /* TPDU command header */ +#define GSMTAP_SIM_TPDU_CMD 0x05 /* TPDU command body */ +#define GSMTAP_SIM_TPDU_RSP 0x06 /* TPDU response body */ +#define GSMTAP_SIM_TPDU_SW 0x07 /* TPDU response trailer */ + +/* ====== DO NOT MAKE UNAPPROVED MODIFICATIONS HERE ===== */ + /* sub-types for TYPE_TETRA_AIR */ #define GSMTAP_TETRA_BSCH 0x01 #define GSMTAP_TETRA_AACH 0x02 -- To view, visit https://gerrit.osmocom.org/10167 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I5bd0dff5a4a90cfe96d9c4f3dec6657e1d85bf7a Gerrit-Change-Number: 10167 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 10:03:50 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 26 Jul 2018 10:03:50 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: Fix random error of TC_cl3_rnd_payload In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10166 ) Change subject: msc: Fix random error of TC_cl3_rnd_payload ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/10166/1/msc/MSC_Tests.ttcn File msc/MSC_Tests.ttcn: https://gerrit.osmocom.org/#/c/10166/1/msc/MSC_Tests.ttcn at 1159 PS1, Line 1159: // other fields beside l3info payload. So payl can only be 240 bytes > The short answer was that before it was 256 for a max length of 255. [?] Oh returning <1 is not nice indeed. I think this situation (specially since you document 240 and then use 241) is worth a comment. I'm pretty sure if I see this in the future it will raise a concern that the code is wrong. Maybe it'd be a good idea to have a function doing that in the library to avoid this kind of complexities, feel free do do it here, or in another commit now or in the future. -- To view, visit https://gerrit.osmocom.org/10166 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7be33e261a11f03a80a6b770b6acf0a4be49b85b Gerrit-Change-Number: 10166 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel Gerrit-Comment-Date: Thu, 26 Jul 2018 10:03:50 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 10:04:03 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 26 Jul 2018 10:04:03 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: Fix random error of TC_cl3_rnd_payload In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10166 ) Change subject: msc: Fix random error of TC_cl3_rnd_payload ...................................................................... Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/10166 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7be33e261a11f03a80a6b770b6acf0a4be49b85b Gerrit-Change-Number: 10166 Gerrit-PatchSet: 3 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel Gerrit-Comment-Date: Thu, 26 Jul 2018 10:04:03 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 10:17:37 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 26 Jul 2018 10:17:37 +0000 Subject: Change in libosmocore[master]: logging: Fix logging level all In-Reply-To: References: Message-ID: Hello Vadim Yanitskiy, Neels Hofmeyr, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10116 to look at the new patch set (#3). Change subject: logging: Fix logging level all ...................................................................... logging: Fix logging level all This commit fixes "logging level all " to have a behavior which makes sense. First, old "everything" loglevel is moved and re-used as "unset", which can be used to set loglevel for a given category to whatever the logtarget defaults to. This is done because it's handy to have "unset" in pos 0 since it's the default level for all categories until they are explicitly set. Furthermore, we don't care about position/number of "everything" level because nowadays it's deprecated and never assigned anymore (and it never had a public define value), and string only kept for VTY compatibility until it is totally removed in the future. When using "logging level all", VTY now sets the log level to for each category available in that logtarget, instead of setting the global default one. A new API log_set_log_level_all() is added to libosmocore for that. Old API log_set_log_level() is kept as is as it is still used by osmocom applications which set global loglevel through "-e" cmd line parameter. This old API will also be used in next commit to implement a new VTY command to set the global default level in the same way. For instance: log stderr logging level all error logging level l1p notice Will print ERROR messages for all categories and NOTICE+ERROR messages for L1P category. Another example: In the VTY, while debugging: * logging level all error -> Only all ERRORs are printed * logging level l1p debug -> all DBG+INFO+NOTICE+ERROR for L1P, and all ERROR are printed. Now, user is interested to debug some other category, eg. TRX: * logging level l1p unset -> L1P goes back to target default (ERROR) * logging level trx debug -> we get all TRX logs. Fixes: OS#3409 Change-Id: I0f50ad8d6fd038398f7d751287417505c8dcdeff --- M include/osmocom/core/logging.h M src/logging.c M src/vty/logging_vty.c 3 files changed, 40 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/16/10116/3 -- To view, visit https://gerrit.osmocom.org/10116 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0f50ad8d6fd038398f7d751287417505c8dcdeff Gerrit-Change-Number: 10116 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 10:17:37 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 26 Jul 2018 10:17:37 +0000 Subject: Change in libosmocore[master]: logging: Add VTY cmd: logging level default In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10136 to look at the new patch set (#2). Change subject: logging: Add VTY cmd: logging level default ...................................................................... logging: Add VTY cmd: logging level default This command is useful while debugging an osmocom application in the VTY. It allows a user to keep per-category set loglevels while changing the default log level. For instance, scenario: 1- Set everything to error to get as low output as possible (but keep seeing errors): logging level all error 2- Set several categories to debug: logging level trx debug logging level l1c info logging level l1p info 3- Decide more output is required while keeping setup for previously set categories: logging level default notice As a result, we have trx=debug, l1c=info, l1p=info and all the other categories are handled as loglvel notice. Change-Id: Iee0d4da16b075e798f85c3f6adeb513057fd5402 --- M src/logging.c M src/vty/logging_vty.c 2 files changed, 21 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/36/10136/2 -- To view, visit https://gerrit.osmocom.org/10136 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iee0d4da16b075e798f85c3f6adeb513057fd5402 Gerrit-Change-Number: 10136 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 10:17:38 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 26 Jul 2018 10:17:38 +0000 Subject: Change in libosmocore[master]: logging.c: Fix whitespace typo Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10168 Change subject: logging.c: Fix whitespace typo ...................................................................... logging.c: Fix whitespace typo Change-Id: I943763e175dca6f3078923a494b052319b78574d --- M src/logging.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/68/10168/1 diff --git a/src/logging.c b/src/logging.c index 381d303..edb2b56 100644 --- a/src/logging.c +++ b/src/logging.c @@ -759,7 +759,7 @@ if (!target) return NULL; - target->categories = talloc_zero_array(target, + target->categories = talloc_zero_array(target, struct log_category, osmo_log_info->num_cat); if (!target->categories) { -- To view, visit https://gerrit.osmocom.org/10168 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I943763e175dca6f3078923a494b052319b78574d Gerrit-Change-Number: 10168 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 10:30:43 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 26 Jul 2018 10:30:43 +0000 Subject: Change in osmo-gsm-tester[master]: Add ttcn3-bts-test env In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10158 ) Change subject: Add ttcn3-bts-test env ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10158 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3251a49503dc823f0ef1fe8ef5d68236a584dad4 Gerrit-Change-Number: 10158 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 26 Jul 2018 10:30:43 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 10:30:45 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 26 Jul 2018 10:30:45 +0000 Subject: Change in osmo-gsm-tester[master]: Add ttcn3-bts-test env In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/10158 ) Change subject: Add ttcn3-bts-test env ...................................................................... Add ttcn3-bts-test env Change-Id: I3251a49503dc823f0ef1fe8ef5d68236a584dad4 --- M .gitignore M example/resources.conf.prod M example/resources.conf.rnd A src/osmo_gsm_tester/osmocon.py M src/osmo_gsm_tester/resource.py M src/osmo_gsm_tester/suite.py A ttcn3/README.txt A ttcn3/default-suites.conf A ttcn3/defaults.conf A ttcn3/jenkins-run.sh A ttcn3/paths.conf A ttcn3/resources.conf.prod A ttcn3/resources.conf.rnd A ttcn3/scenarios/trx.conf A ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl A ttcn3/suites/ttcn3_bts_tests/scripts/run_ttcn3_docker.sh A ttcn3/suites/ttcn3_bts_tests/suite.conf A ttcn3/suites/ttcn3_bts_tests/ttcn3_bts_tests.py 18 files changed, 395 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, but someone else must approve Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitignore b/.gitignore index 8d3479b..a85b41a 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ *.pyc selftest/trial_test/ example/resources.conf +ttcn3/resources.conf diff --git a/example/resources.conf.prod b/example/resources.conf.prod index 8a9a534..6481254 100644 --- a/example/resources.conf.prod +++ b/example/resources.conf.prod @@ -114,3 +114,6 @@ auth_algo: 'comp128v1' ciphers: [a5_0, a5_1] features: ['gprs', 'sim'] + +osmocon_phone: + - serial_device: '/dev/serial/by-id/usb-Silicon_Labs_CP2104_USB_to_UART_Bridge_Controller_00897B41-if00-port0' diff --git a/example/resources.conf.rnd b/example/resources.conf.rnd index 7483260..05fce87 100644 --- a/example/resources.conf.rnd +++ b/example/resources.conf.rnd @@ -87,3 +87,6 @@ auth_algo: 'comp128v1' ciphers: [a5_0, a5_1] features: ['gprs', 'sim'] + +osmocon_phone: +- serial_device: '/dev/serial/by-id/usb-Silicon_Labs_CP2104_USB_to_UART_Bridge_Controller_0089279D-if00-port0' diff --git a/src/osmo_gsm_tester/osmocon.py b/src/osmo_gsm_tester/osmocon.py new file mode 100644 index 0000000..5b1e145 --- /dev/null +++ b/src/osmo_gsm_tester/osmocon.py @@ -0,0 +1,103 @@ +# osmo_gsm_tester: specifics for running an osmocon +# +# Copyright (C) 2018 by sysmocom - s.f.m.c. GmbH +# +# Author: Pau Espin Pedrol +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +import os +import tempfile + +from . import log, util, process +from .event_loop import MainLoop + +class Osmocon(log.Origin): + suite_run = None + run_dir = None + process = None + sk_tmp_dir = None + + FIRMWARE_FILE="opt/osmocom-bb/target/firmware/board/compal_e88/layer1.compalram.bin" + + def __init__(self, suite_run, conf): + serial_device = conf.get('serial_device') + if serial_device is None: + raise log.Error('osmocon_phone contains no attr "serial_device"') + self.serial_device = os.path.realpath(serial_device) + super().__init__(log.C_RUN, 'osmocon_%s' % os.path.basename(self.serial_device)) + self.suite_run = suite_run + self.conf = conf + self.sk_tmp_dir = tempfile.mkdtemp('', 'ogtosmoconsk') + if len(self.l2_socket_path().encode()) > 107: + raise log.Error('Path for l2 socket is longer than max allowed len for unix socket path (107):', self.l2_socket_path()) + if len(self.loader_socket_path().encode()) > 107: + raise log.Error('Path for loader socket is longer than max allowed len for unix socket path (107):', self.loader_socket_path()) + + def l2_socket_path(self): + return os.path.join(self.sk_tmp_dir, 'osmocom_l2') + + def loader_socket_path(self): + return os.path.join(self.sk_tmp_dir, 'osmocom_loader') + + def start(self): + self.log('Resetting the phone') + # TODO: make sure the pone is powered off before starting osmocon + + self.log('Starting osmocon') + self.run_dir = util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name())) + + inst = util.Dir(os.path.abspath(self.suite_run.trial.get_inst('osmocom-bb'))) + + binary = inst.child('sbin', 'osmocon') + if not os.path.isfile(binary): + raise RuntimeError('Binary missing: %r' % binary) + lib = inst.child('lib') + if not os.path.isdir(lib): + raise RuntimeError('No lib/ in %r' % inst) + + env = { 'LD_LIBRARY_PATH': util.prepend_library_path(lib) } + + firmware_path = os.path.join(str(inst), Osmocon.FIRMWARE_FILE) + if not os.path.isfile(firmware_path): + raise RuntimeError('Binary missing: %r' % firmware_path) + self.dbg(run_dir=self.run_dir, binary=binary, env=env) + self.process = process.Process(self.name(), self.run_dir, + (binary, '-p', self.serial_device, + '-m', 'c123xor', + '-s', self.l2_socket_path(), + '-l', self.loader_socket_path(), + firmware_path), + env=env) + self.suite_run.remember_to_stop(self.process) + self.process.launch() + self.log('Waiting for osmocon to be up and running') + MainLoop.wait(self, os.path.exists, self.l2_socket_path()) + + def running(self): + return not self.process.terminated() + + def cleanup(self): + if self.sk_tmp_dir: + try: + os.remove(self.l2_socket_path()) + except OSError: + pass + try: + os.remove(self.loader_socket_path()) + except OSError: + pass + os.rmdir(self.sk_tmp_dir) + +# vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index 70d6e8a..28c4117 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -44,7 +44,8 @@ R_BTS = 'bts' R_ARFCN = 'arfcn' R_MODEM = 'modem' -R_ALL = (R_IP_ADDRESS, R_BTS, R_ARFCN, R_MODEM) +R_OSMOCON = 'osmocon_phone' +R_ALL = (R_IP_ADDRESS, R_BTS, R_ARFCN, R_MODEM, R_OSMOCON) RESOURCES_SCHEMA = { 'ip_address[].addr': schema.IPV4, @@ -76,6 +77,7 @@ 'modem[].auth_algo': schema.AUTH_ALGO, 'modem[].ciphers[]': schema.CIPHER, 'modem[].features[]': schema.MODEM_FEATURE, + 'osmocon_phone[].serial_device': schema.STR, } WANT_SCHEMA = util.dict_add( diff --git a/src/osmo_gsm_tester/suite.py b/src/osmo_gsm_tester/suite.py index 618a39b..db4a8dc 100644 --- a/src/osmo_gsm_tester/suite.py +++ b/src/osmo_gsm_tester/suite.py @@ -23,7 +23,7 @@ import pprint from . import config, log, template, util, resource, schema, test from .event_loop import MainLoop -from . import osmo_nitb, osmo_hlr, osmo_mgcpgw, osmo_mgw, osmo_msc, osmo_bsc, osmo_stp, osmo_ggsn, osmo_sgsn, modem, esme +from . import osmo_nitb, osmo_hlr, osmo_mgcpgw, osmo_mgw, osmo_msc, osmo_bsc, osmo_stp, osmo_ggsn, osmo_sgsn, modem, esme, osmocon class Timeout(Exception): pass @@ -332,6 +332,12 @@ self.register_for_cleanup(esme_obj) return esme_obj + def osmocon(self, specifics=None): + conf = self.reserved_resources.get(resource.R_OSMOCON, specifics=specifics) + osmocon_obj = osmocon.Osmocon(self, conf=conf) + self.register_for_cleanup(osmocon_obj) + return osmocon_obj + def msisdn(self): msisdn = self.resources_pool.next_msisdn(self) self.log('using MSISDN', msisdn) diff --git a/ttcn3/README.txt b/ttcn3/README.txt new file mode 100644 index 0000000..3886c80 --- /dev/null +++ b/ttcn3/README.txt @@ -0,0 +1,20 @@ +This directory contains a set of scripts and osmo-gsm-tester testsuites to run +osmo-ttcn3-hacks.git BTS_tests.ttcn (https://git.osmocom.org/osmo-ttcn3-hacks/tree/bts). + +The idea is to set up automatically the following components: +TTCN3 <-> osmocon (osmocom-bb) <-> motorola C123 <-> RF network <-> BTS_TO_TEST <-> TTCN3 + osmo-bsc + +* A jenkins job builds a docker image containing a built BTS_tests TTCN testsuite. +* Another jenkins job retrieves the artifacts from osmo-gsm-tester-build jobs + plus one for required osmocon binary. This job then calls osmo-gsm-tester/ttcn3/jenkins-run.sh, which will: +** Pull the above mentioned docker image containing BTS_Tests. +** Start osmo-gsm-tester with OSMO_GSM_TESTER_OPTS=osmo-gsm-tester/ttcn3/paths.conf, + that contains mostly same stuff as regular osmo-gsm-tester jobs, but with a + different testsuite containing 1 test "ttcn3_bts_tests.py". +** The test "ttcn3_bts_tests.py" does the following: +*** Start and manage all osmocom required components to run BTS_Tests: osmo-bts, osmo-bsc, osmocon, etc. +*** Generate the BTS_Tests.cfg required by BTS_Tests from a template to adapt to dynamic bits set by osmo-gsm-tester. +*** Launch script osmo-gsm-tester/ttcn3/suites/ttcn3_bts_tests/scripts/run_ttcn3_docker.sh with parameters and wait for it to finish. + This script will start and manage the lifecycle of the docker container running BTS_Tests + +See OS#3155 for more information regarding this topic. diff --git a/ttcn3/default-suites.conf b/ttcn3/default-suites.conf new file mode 100644 index 0000000..80f14e6 --- /dev/null +++ b/ttcn3/default-suites.conf @@ -0,0 +1 @@ +- ttcn3_bts_tests:trx diff --git a/ttcn3/defaults.conf b/ttcn3/defaults.conf new file mode 120000 index 0000000..e47699d --- /dev/null +++ b/ttcn3/defaults.conf @@ -0,0 +1 @@ +../example/defaults.conf \ No newline at end of file diff --git a/ttcn3/jenkins-run.sh b/ttcn3/jenkins-run.sh new file mode 100755 index 0000000..c744606 --- /dev/null +++ b/ttcn3/jenkins-run.sh @@ -0,0 +1,58 @@ +#!/bin/sh +set -e -x +base="$PWD" + +time_start="$(date '+%F %T')" + +prepare_docker() { + OLDPWD=$PWD + + # update docker-playground and update the BSC and bsc-test containers (if needed) + DIR=~/jenkins/docker-playground + if [ ! -d "$DIR" ]; then + mkdir -p ~/jenkins/ && cd ~/jenkins + git clone git://git.osmocom.org/docker-playground + fi + cd $DIR + git remote prune origin; git fetch; git checkout -f -B master origin/master + cd $DIR/debian-stretch-titan && make + docker pull laforge/debian-stretch-titan:latest # HACK + cd $DIR/ttcn3-bts-test && make + # execute the script to start containers, read results, ... + #cd $DIR/ttcn3-bts-test && sh -x ./jenkins.sh + PWD=$OLDPWD +} + +docker pull registry.sysmocom.de/ttcn3-bts-test + +# remove older trial dirs and *-run.tgz, if any +trial_dir_prefix="trial-" +rm -rf "$trial_dir_prefix"* || true + +# Expecting *.tgz artifacts to be copied to this workspace from the various +# jenkins-*.sh runs, via jenkins job configuration. Compose a trial dir: +trial_dir="${trial_dir_prefix}$BUILD_NUMBER" +mkdir -p "$trial_dir" + +mv *.tgz "$trial_dir" +cat *.md5 >> "$trial_dir/checksums.md5" +rm *.md5 + +# OSMO_GSM_TESTER_OPTS is a way to pass in e.g. logging preferences from the +# jenkins build job. +# On failure, first clean up below and then return the exit code. +exit_code="1" +if python3 -u "$(which osmo-gsm-tester.py)" "$trial_dir" $OSMO_GSM_TESTER_OPTS ; then + exit_code="0" +fi + +# no need to keep extracted binaries +rm -rf "$trial_dir/inst" || true + +# tar up all results for archiving (optional) +cd "$trial_dir" +journalctl -u ofono -o short-precise --since "${time_start}" > "$(readlink last_run)/ofono.log" +tar czf "$base/${trial_dir}-run.tgz" "$(readlink last_run)" +tar czf "$base/${trial_dir}-bin.tgz" *.md5 *.tgz + +exit $exit_code diff --git a/ttcn3/paths.conf b/ttcn3/paths.conf new file mode 100644 index 0000000..27c5818 --- /dev/null +++ b/ttcn3/paths.conf @@ -0,0 +1,3 @@ +state_dir: '/var/tmp/osmo-gsm-tester/state' +suites_dir: './suites' +scenarios_dir: './scenarios' diff --git a/ttcn3/resources.conf.prod b/ttcn3/resources.conf.prod new file mode 120000 index 0000000..3e40e89 --- /dev/null +++ b/ttcn3/resources.conf.prod @@ -0,0 +1 @@ +../example/resources.conf.prod \ No newline at end of file diff --git a/ttcn3/resources.conf.rnd b/ttcn3/resources.conf.rnd new file mode 120000 index 0000000..6f98474 --- /dev/null +++ b/ttcn3/resources.conf.rnd @@ -0,0 +1 @@ +../example/resources.conf.rnd \ No newline at end of file diff --git a/ttcn3/scenarios/trx.conf b/ttcn3/scenarios/trx.conf new file mode 120000 index 0000000..d72ddb2 --- /dev/null +++ b/ttcn3/scenarios/trx.conf @@ -0,0 +1 @@ +../../example/scenarios/trx.conf \ No newline at end of file diff --git a/ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl b/ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl new file mode 100644 index 0000000..7379528 --- /dev/null +++ b/ttcn3/suites/ttcn3_bts_tests/scripts/BTS_Tests.cfg.tmpl @@ -0,0 +1,25 @@ +[ORDERED_INCLUDE] +"/osmo-ttcn3-hacks/Common.cfg" +"/osmo-ttcn3-hacks/bts/BTS_Tests.default" + +[LOGGING] + +[TESTPORT_PARAMETERS] +*.BTSVTY.CTRL_HOSTNAME := "${btsvty_ctrl_hostname}" + +[MODULE_PARAMETERS] +BTS_Tests.mp_rsl_ip := "172.18.9.10" +BTS_Tests.mp_bb_trxc_ip := "127.0.0.1" +BTS_Tests.mp_pcu_socket := "/data/unix_pcu/pcu_bts" +BTS_Tests.mp_bb_trxc_port := -1 +L1CTL_PortType.m_l1ctl_sock_path := "/data/unix_l2/osmocom_l2" +BTS_Tests.mp_ctrl_ip := "${btsvty_ctrl_hostname}" +BTS_Tests.mp_rxlev_exp := 1 +BTS_Tests.mp_tolerance_rxlev := 10; +BTS_Tests.mp_tolerance_rxqual := 1; +BTS_Tests.mp_trx0_arfcn := 868 + +[MAIN_CONTROLLER] + +[EXECUTE] +BTS_Tests.control diff --git a/ttcn3/suites/ttcn3_bts_tests/scripts/run_ttcn3_docker.sh b/ttcn3/suites/ttcn3_bts_tests/scripts/run_ttcn3_docker.sh new file mode 100755 index 0000000..64987b3 --- /dev/null +++ b/ttcn3/suites/ttcn3_bts_tests/scripts/run_ttcn3_docker.sh @@ -0,0 +1,86 @@ +#!/bin/sh +set -x + +RUNDIR="$1" +JUNIT_TTCN3_DST_FILE="$2" +L2_SOCKET_PATH="$3" +PCU_SOCKET_PATH="$4" + +# Absolute path to this script +SCRIPT=$(readlink -f "$0") +# Absolute path this script is in +SCRIPTPATH=$(dirname "$SCRIPT") + +VOL_BASE_DIR="$RUNDIR/logs" +rm -rf "$VOL_BASE_DIR" +mkdir -p "$VOL_BASE_DIR" + +if [ "x$BUILD_TAG" = "x" ]; then + BUILD_TAG=nonjenkins +fi + +REPO_USER="registry.sysmocom.de" +SUITE_NAME="ttcn3-bts-test" +NET_NAME=$SUITE_NAME +DOCKER_NAME="$BUILD_TAG-$SUITE_NAME" + +network_create() { + NET=$1 + echo Creating network $NET_NAME + docker network create --internal --subnet $NET $NET_NAME +} + +network_remove() { + echo Removing network $NET_NAME + docker network remove $NET_NAME +} + +child_ps=0 +forward_kill() { + sig="$1" + echo "Caught signal SIG$sig!" + if [ "$child_ps" != "0" ]; then + echo "Killing $child_ps with SIG$sig!" + docker kill ${DOCKER_NAME} + fi + exit 130 +} +forward_kill_int() { + forward_kill "INT" +} +forward_kill_term() { + forward_kill "TERM" +} +# Don't use 'set -e', otherwise traps are not triggered! +trap forward_kill_int INT +trap forward_kill_term TERM + +network_create 172.18.9.0/24 + +mkdir $VOL_BASE_DIR/bts-tester +echo "SCRIPTPATH=$SCRIPTPATH PWD=$PWD" +cp $RUNDIR/BTS_Tests.cfg $VOL_BASE_DIR/bts-tester/ + +echo Starting container with BTS testsuite +docker kill ${DOCKER_NAME} +docker run --rm \ + --network $NET_NAME --ip 172.18.9.10 \ + -e "TTCN3_PCAP_PATH=/data" \ + --mount type=bind,source=$VOL_BASE_DIR/bts-tester,destination=/data \ + --mount type=bind,source="$(dirname "$L2_SOCKET_PATH")",destination=/data/unix_l2 \ + --mount type=bind,source="$(dirname "$PCU_SOCKET_PATH")",destination=/data/unix_pcu \ + --name ${DOCKER_NAME} \ + $REPO_USER/${SUITE_NAME} & +child_ps=$! +echo "$$: waiting for $child_ps" +wait "$child_ps" +child_exit_code="$?" +echo "ttcn3 docker exited with code $child_exit_code" + +network_remove + +echo "Copying TTCN3 junit file to $JUNIT_TTCN3_DST_FILE" +cp $VOL_BASE_DIR/bts-tester/junit-xml-*.log $JUNIT_TTCN3_DST_FILE +sed -i "s#classname='BTS_Tests'#classname='$(basename $JUNIT_TTCN3_DST_FILE)'#g" $JUNIT_TTCN3_DST_FILE + +exit $child_exit_code diff --git a/ttcn3/suites/ttcn3_bts_tests/suite.conf b/ttcn3/suites/ttcn3_bts_tests/suite.conf new file mode 100644 index 0000000..1eb0a02 --- /dev/null +++ b/ttcn3/suites/ttcn3_bts_tests/suite.conf @@ -0,0 +1,7 @@ +resources: + ip_address: + - times: 7 # msc, bsc, hlr, stp, mgw, sgsn, ggsn + bts: + - times: 1 + osmocon_phone: + - times: 1 diff --git a/ttcn3/suites/ttcn3_bts_tests/ttcn3_bts_tests.py b/ttcn3/suites/ttcn3_bts_tests/ttcn3_bts_tests.py new file mode 100755 index 0000000..b3ca946 --- /dev/null +++ b/ttcn3/suites/ttcn3_bts_tests/ttcn3_bts_tests.py @@ -0,0 +1,71 @@ +#!/usr/bin/env python3 +import os +from mako.template import Template + +from osmo_gsm_tester.testenv import * + +hlr_dummy = suite.hlr() +mgw_dummy = suite.mgw() +stp_dummy = suite.stp() +msc_dummy = suite.msc(hlr_dummy, mgw_dummy, stp_dummy) +ggsn_dummy = suite.ggsn() +sgsn_dummy = suite.sgsn(hlr_dummy, ggsn_dummy) +bsc = suite.bsc(msc_dummy, mgw_dummy, stp_dummy) +bts = suite.bts() +osmocon = suite.osmocon() + +bts.set_num_trx(1) +bts.set_trx_phy_channel(0, 0, 'CCCH+SDCCH4') +bts.set_trx_phy_channel(0, 1, 'TCH/F') +bts.set_trx_phy_channel(0, 2, 'TCH/F') +bts.set_trx_phy_channel(0, 3, 'TCH/F_PDCH') +bts.set_trx_phy_channel(0, 4, 'TCH/F_TCH/H_PDCH') +bts.set_trx_phy_channel(0, 5, 'TCH/H') +bts.set_trx_phy_channel(0, 6, 'SDCCH8') +bts.set_trx_phy_channel(0, 7, 'PDCH') + +print('Starting CNI') +hlr_dummy.start() +stp_dummy.start() +msc_dummy.start() +mgw_dummy.start() + +bsc.set_rsl_ip('172.18.9.10') +bsc.bts_add(bts) +sgsn_dummy.bts_add(bts) + +bsc.start() +bts.start(keepalive=True) + +print('Starting osmocon') +osmocon.start() + +own_dir = os.path.dirname(os.path.realpath(__file__)) +script_file = os.path.join(own_dir, 'scripts', 'run_ttcn3_docker.sh') +bts_tmpl_file = os.path.join(own_dir, 'scripts', 'BTS_Tests.cfg.tmpl') +script_run_dir = test.get_run_dir().new_dir('ttcn3') +bts_cfg_file = os.path.join(str(script_run_dir), 'BTS_Tests.cfg') +junit_ttcn3_dst_file = os.path.join(str(suite.trial.get_run_dir()), 'trial-') + suite.name() + '.xml' +docker_cmd = (script_file, str(script_run_dir), junit_ttcn3_dst_file, osmocon.l2_socket_path(), bts.pcu_socket_path()) + +print('Creating template') +mytemplate = Template(filename=bts_tmpl_file) +r = mytemplate.render(btsvty_ctrl_hostname=bts.remote_addr()) +with open(bts_cfg_file, 'w') as f: + f.write(r) + + +print('Starting TTCN3 tests') +proc = process.Process('ttcn3', script_run_dir, docker_cmd) +try: + proc.launch() + print('Starting TTCN3 launched, waiting until it finishes') + proc.wait(timeout=3600) +except Exception as e: + proc.terminate() + raise e + +if proc.result != 0: + raise RuntimeError("run_ttcn3_docker.sh exited with error code %d" % proc.result) + +print('Done') -- To view, visit https://gerrit.osmocom.org/10158 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I3251a49503dc823f0ef1fe8ef5d68236a584dad4 Gerrit-Change-Number: 10158 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 10:43:02 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Thu, 26 Jul 2018 10:43:02 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: Fix random error of TC_cl3_rnd_payload In-Reply-To: References: Message-ID: daniel has posted comments on this change. ( https://gerrit.osmocom.org/10166 ) Change subject: msc: Fix random error of TC_cl3_rnd_payload ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/10166/1/msc/MSC_Tests.ttcn File msc/MSC_Tests.ttcn: https://gerrit.osmocom.org/#/c/10166/1/msc/MSC_Tests.ttcn at 1159 PS1, Line 1159: // other fields beside l3info payload. So payl can only be 240 bytes > Oh returning <1 is not nice indeed. [?] I think this is standard as far as random behaviour is concerned. Python random.random() also ranges from 0.0 to <1.0 and rand() in c would typically be used as rand() % n+1 to give a range from 0 to n. Nevertheless I added a short comment explaining the off-by-1. -- To view, visit https://gerrit.osmocom.org/10166 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7be33e261a11f03a80a6b770b6acf0a4be49b85b Gerrit-Change-Number: 10166 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel Gerrit-Comment-Date: Thu, 26 Jul 2018 10:43:02 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 10:43:15 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Thu, 26 Jul 2018 10:43:15 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: Fix random error of TC_cl3_rnd_payload In-Reply-To: References: Message-ID: Hello Pau Espin Pedrol, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10166 to look at the new patch set (#4). Change subject: msc: Fix random error of TC_cl3_rnd_payload ...................................................................... msc: Fix random error of TC_cl3_rnd_payload The random length for that test could go out of bounds leading to a Dynamic test case error when sending the message. The limiting field here is the lengthIndicator of PDU_BSSAP which includes the length of the PDU_BSSMAP mesageType, cellId as well as the layer3 info IE and lenght indicator additionally to the l3info payload. So maximum length for the payload can only be 240 bytes (if the cell ID is encoded in the longest possible way as BSSMAP_FIELD_LAC_RNC_CI). Change-Id: I7be33e261a11f03a80a6b770b6acf0a4be49b85b --- M msc/MSC_Tests.ttcn 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/66/10166/4 -- To view, visit https://gerrit.osmocom.org/10166 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7be33e261a11f03a80a6b770b6acf0a4be49b85b Gerrit-Change-Number: 10166 Gerrit-PatchSet: 4 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 10:47:21 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 26 Jul 2018 10:47:21 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: Fix random error of TC_cl3_rnd_payload In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10166 ) Change subject: msc: Fix random error of TC_cl3_rnd_payload ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10166 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7be33e261a11f03a80a6b770b6acf0a4be49b85b Gerrit-Change-Number: 10166 Gerrit-PatchSet: 4 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel Gerrit-Comment-Date: Thu, 26 Jul 2018 10:47:21 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 10:47:54 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Thu, 26 Jul 2018 10:47:54 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc: Fix random error of TC_cl3_rnd_payload In-Reply-To: References: Message-ID: daniel has submitted this change and it was merged. ( https://gerrit.osmocom.org/10166 ) Change subject: msc: Fix random error of TC_cl3_rnd_payload ...................................................................... msc: Fix random error of TC_cl3_rnd_payload The random length for that test could go out of bounds leading to a Dynamic test case error when sending the message. The limiting field here is the lengthIndicator of PDU_BSSAP which includes the length of the PDU_BSSMAP mesageType, cellId as well as the layer3 info IE and lenght indicator additionally to the l3info payload. So maximum length for the payload can only be 240 bytes (if the cell ID is encoded in the longest possible way as BSSMAP_FIELD_LAC_RNC_CI). Change-Id: I7be33e261a11f03a80a6b770b6acf0a4be49b85b --- M msc/MSC_Tests.ttcn 1 file changed, 5 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index 1427fd0..4a6b822 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -1155,7 +1155,11 @@ private function f_tc_cl3_rnd_payload(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); - var integer len := float2int(rnd() * 256.0); + /* length is limited by PDU_BSSAP length field which includes some + * other fields beside l3info payload. So payl can only be 240 bytes + * Since rnd() returns values < 1 multiply with 241 + */ + var integer len := float2int(rnd() * 241.0); var octetstring payl := f_rnd_octstring(len); /* Send Complete L3 Info with empty L3 frame */ -- To view, visit https://gerrit.osmocom.org/10166 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I7be33e261a11f03a80a6b770b6acf0a4be49b85b Gerrit-Change-Number: 10166 Gerrit-PatchSet: 4 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 11:02:27 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 26 Jul 2018 11:02:27 +0000 Subject: Change in osmo-ci[master]: ansible: osmo-gsm-tester-prod: Add DHCP lease for secondary muliTRX n... Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10169 Change subject: ansible: osmo-gsm-tester-prod: Add DHCP lease for secondary muliTRX nanobts ...................................................................... ansible: osmo-gsm-tester-prod: Add DHCP lease for secondary muliTRX nanobts Change-Id: I3967d7b4203f5361dc03074dcd82c870d60c8aac --- M ansible/host_vars/osmo-gsm-tester-prod.yml 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/69/10169/1 diff --git a/ansible/host_vars/osmo-gsm-tester-prod.yml b/ansible/host_vars/osmo-gsm-tester-prod.yml index ee9edea..8268080 100644 --- a/ansible/host_vars/osmo-gsm-tester-prod.yml +++ b/ansible/host_vars/osmo-gsm-tester-prod.yml @@ -4,6 +4,8 @@ ip: 10.42.42.120 - mac: 00:02:95:00:5a:a4 ip: 10.42.42.121 + - mac: 00:02:95:22:22:22 + ip: 10.42.42.122 # how many modems are connected via a quadmodem? gsm_modems: 3 -- To view, visit https://gerrit.osmocom.org/10169 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I3967d7b4203f5361dc03074dcd82c870d60c8aac Gerrit-Change-Number: 10169 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 11:48:23 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 26 Jul 2018 11:48:23 +0000 Subject: Change in osmo-bsc[master]: rsl: use 3GPP assigned payload type constants from libosmo-abis In-Reply-To: References: Message-ID: dexter has posted comments on this change. ( https://gerrit.osmocom.org/9781 ) Change subject: rsl: use 3GPP assigned payload type constants from libosmo-abis ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/9781 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib6a866b29d863d6875c67748dbe6b6468941ab29 Gerrit-Change-Number: 9781 Gerrit-PatchSet: 4 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-CC: Harald Welte Gerrit-Comment-Date: Thu, 26 Jul 2018 11:48:23 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 11:50:26 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 26 Jul 2018 11:50:26 +0000 Subject: Change in osmo-bsc[master]: rsl: use 3GPP assigned payload type constants from libosmo-abis In-Reply-To: References: Message-ID: dexter has posted comments on this change. ( https://gerrit.osmocom.org/9781 ) Change subject: rsl: use 3GPP assigned payload type constants from libosmo-abis ...................................................................... Patch Set 4: > Set Ready For Review I now got back to this. Since this patch technically only removes a code duplication I also changed the commit message. There should also be no changes on the binary level or in the behavior. -- To view, visit https://gerrit.osmocom.org/9781 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib6a866b29d863d6875c67748dbe6b6468941ab29 Gerrit-Change-Number: 9781 Gerrit-PatchSet: 4 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-CC: Harald Welte Gerrit-Comment-Date: Thu, 26 Jul 2018 11:50:26 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 12:10:18 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 26 Jul 2018 12:10:18 +0000 Subject: Change in osmo-bsc[master]: rsl: use 3GPP assigned payload type constants from libosmo-netif In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9781 to look at the new patch set (#5). Change subject: rsl: use 3GPP assigned payload type constants from libosmo-netif ...................................................................... rsl: use 3GPP assigned payload type constants from libosmo-netif The payload constants for AMR, EFR, GSM-FR, and GSM-HR are already defined in libosmo-netif, there is no need to re-define them locally. - include rtp.h from libosmo-netif in abis_rsl.c - remove duplicate payload type constants Change-Id: Ib6a866b29d863d6875c67748dbe6b6468941ab29 Related: OS#2728 --- M src/osmo-bsc/abis_rsl.c 1 file changed, 2 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/81/9781/5 -- To view, visit https://gerrit.osmocom.org/9781 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib6a866b29d863d6875c67748dbe6b6468941ab29 Gerrit-Change-Number: 9781 Gerrit-PatchSet: 5 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-CC: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 12:13:17 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 26 Jul 2018 12:13:17 +0000 Subject: Change in osmo-bsc[master]: rsl: use 3GPP assigned payload type constants from libosmo-netif In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9781 to look at the new patch set (#6). Change subject: rsl: use 3GPP assigned payload type constants from libosmo-netif ...................................................................... rsl: use 3GPP assigned payload type constants from libosmo-netif The payload constants for AMR, EFR, GSM-FR, and GSM-HR are already defined in libosmo-netif, there is no need to re-define them locally. - include rtp.h from libosmo-netif in abis_rsl.c - remove duplicate payload type constants Change-Id: Ib6a866b29d863d6875c67748dbe6b6468941ab29 Related: OS#2728 --- M src/osmo-bsc/abis_rsl.c 1 file changed, 1 insertion(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/81/9781/6 -- To view, visit https://gerrit.osmocom.org/9781 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib6a866b29d863d6875c67748dbe6b6468941ab29 Gerrit-Change-Number: 9781 Gerrit-PatchSet: 6 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-CC: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 15:03:40 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 26 Jul 2018 15:03:40 +0000 Subject: Change in osmo-bts[master]: clear GPRS indicator in SI3 while PCU is disconnected Message-ID: Stefan Sperling has uploaded this change for review. ( https://gerrit.osmocom.org/10170 Change subject: clear GPRS indicator in SI3 while PCU is disconnected ...................................................................... clear GPRS indicator in SI3 while PCU is disconnected osmo-bts cannot provide GPRS service while osmo-pcu is not connected. The BSC has no knowledge of the PCU connection state. Prevent MMs from trying to register for GPRS while the PCU is disconnected by erasing the GPRS Indicator in SI3. Change-Id: I1a6f5c636c0fe098ee31c280d4572a3f8122b44b Related: OS#3075 --- M src/common/rsl.c 1 file changed, 171 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/70/10170/1 diff --git a/src/common/rsl.c b/src/common/rsl.c index a24c444..556ecb0 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -285,6 +285,151 @@ * common channel releated messages */ +/* Parsed representation of si3 rest octets. */ +struct gsm48_si3_rest { + uint8_t sp; + uint8_t sp_cbq; + uint8_t sp_cro; + uint8_t sp_to; + uint8_t sp_pt; + uint8_t po; + uint8_t po_value; + uint8_t si2ter_ind; + uint8_t ecsm; + uint8_t sched; + uint8_t sched_where; + uint8_t gprs; + uint8_t gprs_ra_colour; + uint8_t gprs_si13_pos; + uint8_t ecmr_3g; + uint8_t si2qter_ind; +}; + +/* decode "SI 3 Rest Octets" (10.5.2.34); XXX move to libosmocore? */ +static void gsm48_decode_si3_rest(struct gsm48_si3_rest *s, uint8_t *si, + uint8_t len) +{ + struct bitvec bv; + + memset(&bv, 0, sizeof(bv)); + bv.data_len = len; + bv.data = si; + + /* Optional Selection Parameters */ + if (bitvec_get_bit_high(&bv) == H) { + s->sp = 1; + s->sp_cbq = bitvec_get_uint(&bv, 1); + s->sp_cro = bitvec_get_uint(&bv, 6); + s->sp_to = bitvec_get_uint(&bv, 3); + s->sp_pt = bitvec_get_uint(&bv, 5); + } else + s->sp = 0; + /* Optional Power Offset */ + if (bitvec_get_bit_high(&bv) == H) { + s->po = 1; + s->po_value = bitvec_get_uint(&bv, 2); + } else + s->po = 0; + /* System Information 2ter Indicator */ + if (bitvec_get_bit_high(&bv) == H) + s->si2ter_ind = 1; + else + s->si2ter_ind = 0; + /* Early Classmark Sending Control */ + if (bitvec_get_bit_high(&bv) == H) + s->ecsm = 1; + else + s->ecsm = 0; + /* Scheduling if and where */ + if (bitvec_get_bit_high(&bv) == H) { + s->sched = 1; + s->sched_where = bitvec_get_uint(&bv, 3); + } else + s->sched = 0; + /* GPRS Indicator */ + if (bitvec_get_bit_high(&bv) == H) { + s->gprs = 1; + s->gprs_ra_colour = bitvec_get_uint(&bv, 3); + s->gprs_si13_pos = bitvec_get_uint(&bv, 1); + } else + s->gprs = 0; + /* 3G Early Classmark Sending Restriction. If H, then controlled by + * early_cm_ctrl above */ + if (bitvec_get_bit_high(&bv) == H) + s->ecmr_3g = 1; + else + s->ecmr_3g = 0; + + if (bitvec_get_bit_high(&bv) == H) + s->si2qter_ind = 1; + else + s->si2qter_ind = 0; +} + +/* encode "SI 3 Rest Octets" (10.5.2.34); XXX move to libosmocore? */ +static void gsm48_encode_si3_rest(struct gsm48_si3_rest *s, uint8_t *si, + uint8_t len) +{ + struct bitvec bv; + + memset(&bv, 0, sizeof(bv)); + bv.data = si; + bv.data_len = len; + + /* Optional Selection Parameters */ + if (s->sp) { + bitvec_set_bit(&bv, H); + bitvec_set_bit(&bv, s->sp_cbq); + bitvec_set_uint(&bv, s->sp_cro, 6); + bitvec_set_uint(&bv, s->sp_to, 3); + bitvec_set_uint(&bv, s->sp_pt, 5); + } else + bitvec_set_bit(&bv, L); + /* Optional Power Offset */ + if (s->po) { + bitvec_set_bit(&bv, H); + bitvec_set_uint(&bv, s->po_value, 2); + } else + bitvec_set_bit(&bv, L); + /* System Information 2ter Indicator */ + if (s->si2ter_ind) + bitvec_set_bit(&bv, H); + else + bitvec_set_bit(&bv, L); + /* Early Classmark Sending Control */ + if (s->ecsm) + bitvec_set_bit(&bv, H); + else + bitvec_set_bit(&bv, L); + /* Scheduling if and where */ + if (s->sched) { + bitvec_set_bit(&bv, H); + bitvec_set_uint(&bv, s->sched_where, 3); + } else + bitvec_set_bit(&bv, L); + /* GPRS Indicator */ + if (s->gprs) { + bitvec_set_bit(&bv, H); + bitvec_set_uint(&bv, s->gprs_ra_colour, 3); + /* 0 == SI13 in BCCH Norm, 1 == SI13 sent on BCCH Ext */ + bitvec_set_bit(&bv, s->gprs_si13_pos); + } else + bitvec_set_bit(&bv, L); + /* 3G Early Classmark Sending Restriction. If H, then controlled by + * early_cm_ctrl above */ + if (s->ecmr_3g) + bitvec_set_bit(&bv, L); + else + bitvec_set_bit(&bv, H); + + if (s->si2qter_ind) { + bitvec_set_bit(&bv, H); /* indicator struct present */ + bitvec_set_uint(&bv, 0, 1); /* message is sent on BCCH Norm */ + } + + bitvec_spare_padding(&bv, (bv.data_len*8)-1); +} + /* 8.5.1 BCCH INFOrmation is received */ static int rsl_rx_bcch_info(struct gsm_bts_trx *trx, struct msgb *msg) { @@ -356,12 +501,32 @@ bts->si_valid |= (1 << osmo_si); - if (SYSINFO_TYPE_3 == osmo_si && trx->nr == 0 && - num_agch(trx, "RSL") != 1) { - lchan_deactivate(&trx->bts->c0->ts[0].lchan[CCCH_LCHAN]); - /* will be reactivated by sapi_deactivate_cb() */ - trx->bts->c0->ts[0].lchan[CCCH_LCHAN].rel_act_kind = - LCHAN_REL_ACT_REACT; + if (SYSINFO_TYPE_3 == osmo_si) { + if (trx->nr == 0 && num_agch(trx, "RSL") != 1) { + lchan_deactivate(&trx->bts->c0->ts[0].lchan[CCCH_LCHAN]); + /* will be reactivated by sapi_deactivate_cb() */ + trx->bts->c0->ts[0].lchan[CCCH_LCHAN].rel_act_kind = + LCHAN_REL_ACT_REACT; + } + + /* While osmo-pcu is not connected this BTS cannot provide GPRS service. + * The BSC has no knowledge of our PCU connection state, but we want + * to prevent MMs from trying to register for GPRS through this BTS. + * Thus, we erase the GPRS Indicator in SI3 ourselves. See OS#3075. */ + if (!pcu_connected()) { + struct gsm48_system_information_type_3 *si3; + size_t rest_octet_len; + si3 = (struct gsm48_system_information_type_3 *)GSM_BTS_SI(bts, osmo_si); + rest_octet_len = len - offsetof(struct gsm48_system_information_type_3, rest_octets); + if (rest_octet_len > 0) { + struct gsm48_si3_rest s; + gsm48_decode_si3_rest(&s, si3->rest_octets, rest_octet_len); + if (s.gprs) { + s.gprs = 0; + gsm48_encode_si3_rest(&s, si3->rest_octets, rest_octet_len); + } + } + } } if (SYSINFO_TYPE_13 == osmo_si) -- To view, visit https://gerrit.osmocom.org/10170 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I1a6f5c636c0fe098ee31c280d4572a3f8122b44b Gerrit-Change-Number: 10170 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 15:08:17 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 26 Jul 2018 15:08:17 +0000 Subject: Change in osmo-mgw[master]: mgcp_client_fsm: allow ptmap in mgcp_client_fsm as well Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/10171 Change subject: mgcp_client_fsm: allow ptmap in mgcp_client_fsm as well ...................................................................... mgcp_client_fsm: allow ptmap in mgcp_client_fsm as well The regular version of the mgcp_client supports the configuration of of custom payload types. In case some corner cases require a specific dynamic paylod type number that is not according to 3GPP standards has to be used the user can override the standard settings. However the fsm based variant of the mgcp_client does not have that feature but it should have it as well. - add struct members for ptmap config. - pass configuration values down to the underlying magcp client. Change-Id: If176a3719dd9e888da16196d5fc0bdb53cc2a5f2 Related: OS#2728 Related: OS#3384 --- M include/osmocom/mgcp_client/mgcp_client_fsm.h M src/libosmo-mgcp-client/mgcp_client_fsm.c 2 files changed, 17 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/71/10171/1 diff --git a/include/osmocom/mgcp_client/mgcp_client_fsm.h b/include/osmocom/mgcp_client/mgcp_client_fsm.h index 353baff..81d3dea 100644 --- a/include/osmocom/mgcp_client/mgcp_client_fsm.h +++ b/include/osmocom/mgcp_client/mgcp_client_fsm.h @@ -34,6 +34,14 @@ /*! Number of codecs in RTP codec list (optional) */ unsigned int codecs_len; + + /*! RTP payload type map (optional, only needed when payload types are + * used that differ from what IANA/3GPP defines) */ + struct ptmap ptmap[MGCP_MAX_CODECS]; + + /*! RTP payload type map length (optional, only needed when payload + * types are used that differ from what IANA/3GPP defines) */ + unsigned int ptmap_len; }; struct osmo_fsm_inst *mgcp_conn_create(struct mgcp_client *mgcp, struct osmo_fsm_inst *parent_fi, uint32_t parent_term_evt, diff --git a/src/libosmo-mgcp-client/mgcp_client_fsm.c b/src/libosmo-mgcp-client/mgcp_client_fsm.c index fe1590f..a0dc0fb 100644 --- a/src/libosmo-mgcp-client/mgcp_client_fsm.c +++ b/src/libosmo-mgcp-client/mgcp_client_fsm.c @@ -114,10 +114,12 @@ .call_id = mgcp_ctx->conn_peer_local.call_id, .conn_mode = MGCP_CONN_RECV_ONLY, .ptime = mgcp_ctx->conn_peer_local.ptime, - .codecs_len = mgcp_ctx->conn_peer_local.codecs_len + .codecs_len = mgcp_ctx->conn_peer_local.codecs_len, + .ptmap_len = mgcp_ctx->conn_peer_local.ptmap_len }; osmo_strlcpy(mgcp_msg.endpoint, mgcp_ctx->conn_peer_local.endpoint, MGCP_ENDPOINT_MAXLEN); memcpy(mgcp_msg.codecs, mgcp_ctx->conn_peer_local.codecs, sizeof(mgcp_msg.codecs)); + memcpy(mgcp_msg.ptmap, mgcp_ctx->conn_peer_local.ptmap, sizeof(mgcp_msg.ptmap)); return mgcp_msg_gen(mgcp_ctx->mgcp, &mgcp_msg); } @@ -136,10 +138,12 @@ .audio_ip = mgcp_ctx->conn_peer_local.addr, .audio_port = mgcp_ctx->conn_peer_local.port, .ptime = mgcp_ctx->conn_peer_local.ptime, - .codecs_len = mgcp_ctx->conn_peer_local.codecs_len + .codecs_len = mgcp_ctx->conn_peer_local.codecs_len, + .ptmap_len = mgcp_ctx->conn_peer_local.ptmap_len }; osmo_strlcpy(mgcp_msg.endpoint, mgcp_ctx->conn_peer_local.endpoint, MGCP_ENDPOINT_MAXLEN); memcpy(mgcp_msg.codecs, mgcp_ctx->conn_peer_local.codecs, sizeof(mgcp_msg.codecs)); + memcpy(mgcp_msg.ptmap, mgcp_ctx->conn_peer_local.ptmap, sizeof(mgcp_msg.ptmap)); return mgcp_msg_gen(mgcp_ctx->mgcp, &mgcp_msg); } @@ -158,10 +162,12 @@ .audio_ip = mgcp_ctx->conn_peer_local.addr, .audio_port = mgcp_ctx->conn_peer_local.port, .ptime = mgcp_ctx->conn_peer_local.ptime, - .codecs_len = mgcp_ctx->conn_peer_local.codecs_len + .codecs_len = mgcp_ctx->conn_peer_local.codecs_len, + .ptmap_len = mgcp_ctx->conn_peer_local.ptmap_len }; osmo_strlcpy(mgcp_msg.endpoint, mgcp_ctx->conn_peer_remote.endpoint, MGCP_ENDPOINT_MAXLEN); memcpy(mgcp_msg.codecs, mgcp_ctx->conn_peer_local.codecs, sizeof(mgcp_msg.codecs)); + memcpy(mgcp_msg.ptmap, mgcp_ctx->conn_peer_local.ptmap, sizeof(mgcp_msg.ptmap)); /* Note: We take the endpoint and the call_id from the remote * connection info, because we can be confident that the -- To view, visit https://gerrit.osmocom.org/10171 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: If176a3719dd9e888da16196d5fc0bdb53cc2a5f2 Gerrit-Change-Number: 10171 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 15:08:17 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 26 Jul 2018 15:08:17 +0000 Subject: Change in osmo-mgw[master]: mgcp_network: translate payload type numbers in RTP packets Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/10172 Change subject: mgcp_network: translate payload type numbers in RTP packets ...................................................................... mgcp_network: translate payload type numbers in RTP packets Since no transcoding is in place osmo-mgw forwards the incoming rtp packets as they are (there may be minor modifications of the header) from an ingress connection to an egress connection. This works without problems as long as both connections use the same payload type. For IANA defined fixed payload type numbers this is usually the case, but for dynemic payload type numbers both ends may set up the same codecs but with different payload type numbers. When different payload type numbers are set up, and the packet is passed through without modification, it will have the wrong payload type when it is sent. The receiving end may then toss the packet since it expects packets with the payload type it has configured. The machanism, which is introduced with this patch looks up actual codec inside the struct data of the ingress connection and then looks for the matching codec in the struct data of the egress connection. When it finds the codec there it looks up the payload type of this codec. The header of the RTP packet is then patched with the correct payoad type. - Add function mgcp_codec_pt_translate() to look up the payload type - Add unit-test for function mgcp_codec_pt_translate() - Add payload type translation to mgcp_network.c Change-Id: I3a874e59fa07bcc2a67c376cafa197360036f539 Related: OS#2728 Related: OS#3384 --- M include/osmocom/mgcp/mgcp_codec.h M src/libosmo-mgcp/mgcp_codec.c M src/libosmo-mgcp/mgcp_network.c M tests/mgcp/mgcp_test.c 4 files changed, 206 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/72/10172/1 diff --git a/include/osmocom/mgcp/mgcp_codec.h b/include/osmocom/mgcp/mgcp_codec.h index f8d5e70..334913b 100644 --- a/include/osmocom/mgcp/mgcp_codec.h +++ b/include/osmocom/mgcp/mgcp_codec.h @@ -4,3 +4,4 @@ void mgcp_codec_reset_all(struct mgcp_conn_rtp *conn); int mgcp_codec_add(struct mgcp_conn_rtp *conn, int payload_type, const char *audio_name); int mgcp_codec_decide(struct mgcp_conn_rtp *conn); +int mgcp_codec_pt_translate(struct mgcp_conn_rtp *conn_src, struct mgcp_conn_rtp *conn_dst, int payload_type); diff --git a/src/libosmo-mgcp/mgcp_codec.c b/src/libosmo-mgcp/mgcp_codec.c index 2ce90dd..15ab568 100644 --- a/src/libosmo-mgcp/mgcp_codec.c +++ b/src/libosmo-mgcp/mgcp_codec.c @@ -341,3 +341,72 @@ return -EINVAL; } + +/* Helper function to compare two codecs, all parameters must match up, except + * for the payload type number. */ +static bool codecs_cmp(struct mgcp_rtp_codec *codec_a, + struct mgcp_rtp_codec *codec_b) +{ + if (codec_a->rate != codec_b->rate) + return false; + if (codec_a->channels != codec_b->channels) + return false; + if (codec_a->frame_duration_num != codec_b->frame_duration_num) + return false; + if (codec_a->frame_duration_den != codec_b->frame_duration_den) + return false; + if (strcmp(codec_a->audio_name, codec_b->audio_name)) + return false; + if (strcmp(codec_a->subtype_name, codec_b->subtype_name)) + return false; + + return true; +} + +/*! Translate a given payload type number that belongs to the packet of a + * source connection to the equivalent payload type number that matches the + * configuration of a destination connection. + * \param[in] conn_src related source rtp-connection. + * \param[in] conn_src related destination rtp-connection. + * \param[in] payload_type number from the source packet or source connection. + * \returns translated payload type number on success, -EINVAL on failure. */ +int mgcp_codec_pt_translate(struct mgcp_conn_rtp *conn_src, + struct mgcp_conn_rtp *conn_dst, int payload_type) +{ + struct mgcp_rtp_end *rtp_src; + struct mgcp_rtp_end *rtp_dst; + struct mgcp_rtp_codec *codec_src = NULL; + struct mgcp_rtp_codec *codec_dst = NULL; + unsigned int i; + unsigned int codecs_assigned; + + rtp_src = &conn_src->end; + rtp_dst = &conn_dst->end; + + /* Find the codec information that is used on the source side */ + codecs_assigned = rtp_src->codecs_assigned; + OSMO_ASSERT(codecs_assigned < MGCP_MAX_CODECS) + for (i = 0; i < codecs_assigned; i++) { + if (payload_type == rtp_src->codecs[i].payload_type) { + codec_src = &rtp_src->codecs[i]; + break; + } + } + if (!codec_src) + return -EINVAL; + + /* Use the codec infrmation from the source and try to find the + * equivalent of it on the destination side */ + codecs_assigned = rtp_dst->codecs_assigned; + OSMO_ASSERT(codecs_assigned < MGCP_MAX_CODECS) + for (i = 0; i < codecs_assigned; i++) { + if (codecs_cmp(codec_src, &rtp_dst->codecs[i])) { + codec_dst = &rtp_dst->codecs[i]; + break; + } + } + if (!codec_dst) + return -EINVAL; + + return codec_dst->payload_type; +} diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c index 3ac93be..5b043e1 100644 --- a/src/libosmo-mgcp/mgcp_network.c +++ b/src/libosmo-mgcp/mgcp_network.c @@ -40,8 +40,10 @@ #include #include #include +#include #include + #define RTP_SEQ_MOD (1 << 16) #define RTP_MAX_DROPOUT 3000 #define RTP_MAX_MISORDER 100 @@ -474,6 +476,28 @@ state->stats.max_seq = seq; } +/* There may be different payload type numbers negotiated for two connections. + * Patch the payload type of an RTP packet so that it uses the payload type + * that is valid for the destination connection (conn_dst) */ +static int mgcp_patch_pt(struct mgcp_conn_rtp *conn_src, + struct mgcp_conn_rtp *conn_dst, char *data, int len) +{ + struct rtp_hdr *rtp_hdr; + uint8_t pt_in; + int pt_out; + + OSMO_ASSERT(len >= sizeof(struct rtp_hdr)); + rtp_hdr = (struct rtp_hdr *)data; + + pt_in = rtp_hdr->payload_type; + pt_out = mgcp_codec_pt_translate(conn_src, conn_dst, pt_in); + if (pt_out < 0) + return -EINVAL; + + rtp_hdr->payload_type = (uint8_t) (pt_out & 0xFF); + return 0; +} + /* The RFC 3550 Appendix A assumes there are multiple sources but * some of the supported endpoints (e.g. the nanoBTS) can only handle * one source and this code will patch RTP header to appear as if there @@ -665,6 +689,7 @@ struct mgcp_rtp_end *rtp_end; struct mgcp_rtp_state *rtp_state; char *dest_name; + int rc; OSMO_ASSERT(conn_src); OSMO_ASSERT(conn_dst); @@ -684,6 +709,22 @@ ENDPOINT_NUMBER(endp), tcfg->audio_loop, conn_src->conn->mode, conn_src->conn->mode == MGCP_CONN_LOOPBACK ? " (loopback)" : ""); + /* FIXME: It is legal that the payload type on the egress connection is + * different from the payload type that has been negotiated on the + * ingress connection. Essentially the codecs are the same so we can + * match them and patch the payload type. However, if we can not find + * the codec pendant (everything ist equal except the PT), we are of + * course unable to patch the payload type. A situation like this + * should not occurr if transcoding is consequently avoided. Until + * we do not have transcoding support in osmo-mgw we can not resolve + * this. */ + rc = mgcp_patch_pt(conn_src, conn_dst, buf, len); + if (rc < 0) { + LOGP(DRTP, LOGL_ERROR, + "endpoint:0x%x can not patch PT because no suitable egress codec was found.\n", + ENDPOINT_NUMBER(endp)); + } + /* Note: In case of loopback configuration, both, the source and the * destination will point to the same connection. */ rtp_end = &conn_dst->end; diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c index 56d0cee..c14922c 100644 --- a/tests/mgcp/mgcp_test.c +++ b/tests/mgcp/mgcp_test.c @@ -1616,6 +1616,100 @@ OSMO_ASSERT(check_local_cx_options(ctx, ",,,") == -1); } +static void test_mgcp_codec_pt_translate_pars(struct mgcp_rtp_codec *c) +{ + c->rate = 8000; + c->channels = 1; + c->frame_duration_num = 23; + c->frame_duration_den = 42; +} + +static void test_mgcp_codec_pt_translate(void) +{ + struct mgcp_conn_rtp conn_src; + struct mgcp_conn_rtp conn_dst; + int pt_dst; + + /* Setup a realistic set of codec configurations on both + * ends. AMR and HR will use different payload types. PCMU + * must use 0 on both ends since this is not a dynamic payload + * type */ + test_mgcp_codec_pt_translate_pars(&conn_src.end.codecs[0]); + test_mgcp_codec_pt_translate_pars(&conn_dst.end.codecs[0]); + test_mgcp_codec_pt_translate_pars(&conn_src.end.codecs[1]); + test_mgcp_codec_pt_translate_pars(&conn_dst.end.codecs[1]); + test_mgcp_codec_pt_translate_pars(&conn_src.end.codecs[2]); + test_mgcp_codec_pt_translate_pars(&conn_dst.end.codecs[2]); + conn_src.end.codecs[0].payload_type = 112; + conn_dst.end.codecs[0].payload_type = 96; + conn_src.end.codecs[1].payload_type = 0; + conn_dst.end.codecs[1].payload_type = 0; + conn_src.end.codecs[2].payload_type = 111; + conn_dst.end.codecs[2].payload_type = 97; + conn_src.end.codecs[0].audio_name = "AMR/8000/1"; + conn_dst.end.codecs[0].audio_name = "AMR/8000/1"; + conn_src.end.codecs[1].audio_name = "PCMU/8000/1"; + conn_dst.end.codecs[1].audio_name = "PCMU/8000/1"; + conn_src.end.codecs[2].audio_name = "GSM-HR-08/8000/1"; + conn_dst.end.codecs[2].audio_name = "GSM-HR-08/8000/1"; + conn_src.end.codecs[0].subtype_name = "AMR"; + conn_dst.end.codecs[0].subtype_name = "AMR"; + conn_src.end.codecs[1].subtype_name = "PCMU"; + conn_dst.end.codecs[1].subtype_name = "PCMU"; + conn_src.end.codecs[2].subtype_name = "GSM-HR-08"; + conn_dst.end.codecs[2].subtype_name = "GSM-HR-08"; + conn_src.end.codecs_assigned = 3; + conn_dst.end.codecs_assigned = 3; + + /* We expect the function to find the PT we must use when we send the + * packet out to the destination. All we know the context for both + * connections and the payload type from the source packet */ + pt_dst = + mgcp_codec_pt_translate(&conn_src, &conn_dst, + conn_src.end.codecs[0].payload_type); + OSMO_ASSERT(pt_dst == conn_dst.end.codecs[0].payload_type); + pt_dst = + mgcp_codec_pt_translate(&conn_src, &conn_dst, + conn_src.end.codecs[1].payload_type); + OSMO_ASSERT(pt_dst == conn_dst.end.codecs[1].payload_type); + pt_dst = + mgcp_codec_pt_translate(&conn_src, &conn_dst, + conn_src.end.codecs[2].payload_type); + OSMO_ASSERT(pt_dst == conn_dst.end.codecs[2].payload_type); + + /* Try some constellations that must fail */ + pt_dst = mgcp_codec_pt_translate(&conn_src, &conn_dst, 123); + OSMO_ASSERT(pt_dst == -EINVAL); + conn_src.end.codecs_assigned = 0; + conn_dst.end.codecs_assigned = 3; + pt_dst = + mgcp_codec_pt_translate(&conn_src, &conn_dst, + conn_src.end.codecs[0].payload_type); + OSMO_ASSERT(pt_dst == -EINVAL); + pt_dst = + mgcp_codec_pt_translate(&conn_src, &conn_dst, + conn_src.end.codecs[1].payload_type); + OSMO_ASSERT(pt_dst == -EINVAL); + pt_dst = + mgcp_codec_pt_translate(&conn_src, &conn_dst, + conn_src.end.codecs[2].payload_type); + OSMO_ASSERT(pt_dst == -EINVAL); + conn_src.end.codecs_assigned = 3; + conn_dst.end.codecs_assigned = 0; + pt_dst = + mgcp_codec_pt_translate(&conn_src, &conn_dst, + conn_src.end.codecs[0].payload_type); + OSMO_ASSERT(pt_dst == -EINVAL); + pt_dst = + mgcp_codec_pt_translate(&conn_src, &conn_dst, + conn_src.end.codecs[1].payload_type); + OSMO_ASSERT(pt_dst == -EINVAL); + pt_dst = + mgcp_codec_pt_translate(&conn_src, &conn_dst, + conn_src.end.codecs[2].payload_type); + OSMO_ASSERT(pt_dst == -EINVAL); +} + int main(int argc, char **argv) { void *ctx = talloc_named_const(NULL, 0, "mgcp_test"); @@ -1639,6 +1733,7 @@ test_osmux_cid(); test_get_lco_identifier(); test_check_local_cx_options(ctx); + test_mgcp_codec_pt_translate(); OSMO_ASSERT(talloc_total_size(msgb_ctx) == 0); OSMO_ASSERT(talloc_total_blocks(msgb_ctx) == 1); -- To view, visit https://gerrit.osmocom.org/10172 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I3a874e59fa07bcc2a67c376cafa197360036f539 Gerrit-Change-Number: 10172 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Thu Jul 26 15:10:07 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Thu, 26 Jul 2018 15:10:07 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-asn1c_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#196?= In-Reply-To: <916368251.74.1532531407000.JavaMail.jenkins@jenkins.osmocom.org> References: <916368251.74.1532531407000.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <386191770.86.1532617807115.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 3.67 KB...] + ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for style of include used by make... GNU checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking how to run the C++ preprocessor... g++ -E checking for g77... no checking for f77... no checking for xlf... no checking for frt... no checking for pgf77... no checking for cf77... no checking for fort77... no checking for fl32... no checking for af77... no checking for f90... no checking for xlf90... no checking for pgf90... no checking for pghpf... no checking for epcf90... no checking for gfortran... no checking for g95... no checking for f95... no checking for fort... no checking for xlf95... no checking for ifort... no checking for ifc... no checking for efc... no checking for pgf95... no checking for lf95... no checking for ftn... no checking whether we are using the GNU Fortran 77 compiler... no checking whether accepts -g... no checking the maximum length of command line arguments... 32768 checking command to parse /usr/bin/nm -B output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes configure: creating libtool appending configuration tag "CXX" to libtool checking for ld used by g++... /usr/bin/ld -m elf_x86_64 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC checking if g++ PIC flag -fPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate appending configuration tag "F77" to libtool checking for autoconf... /usr/bin/autoconf checking for autoheader... /usr/bin/autoheader checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking dependency style of gcc... (cached) gcc3 checking how to run the C preprocessor... gcc -E checking for a BSD-compatible install... /usr/bin/install -c checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking for bison... bison -y checking for flex... flex checking for yywrap in -lfl... yes checking lex output file root... lex.yy checking whether yytext is a pointer... yes checking for ar... /usr/bin/ar checking for ANSI C header files... (cached) yes checking sys/param.h usability... yes checking sys/param.h presence... yes checking for sys/param.h... yes checking whether byte ordering is bigendian... no checking for off_t... yes checking for size_t... yes checking whether struct tm is in sys/time.h or time.h... time.h checking for intmax_t... yes checking for library containing getopt... none required checking for strtoimax... yes checking for strtoll... yes checking for mergesort... no checking for mkstemps... yes configure: creating ./config.status config.status: creating skeletons/standard-modules/Makefile config.status: creating skeletons/tests/Makefile config.status: creating libasn1compiler/Makefile config.status: creating libasn1parser/Makefile config.status: creating libasn1print/Makefile config.status: creating asn1c/webcgi/Makefile config.status: creating asn1c/tests/Makefile config.status: creating libasn1fix/Makefile config.status: creating skeletons/Makefile config.status: creating examples/Makefile config.status: creating tests/Makefile config.status: creating asn1c/Makefile config.status: creating doc/Makefile config.status: creating asn1c.spec config.status: creating Makefile config.status: creating config.h config.status: executing depfiles commands + make -j 8 make all-recursive make[1]: Entering directory ' Making all in libasn1parser make[2]: Entering directory ' if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF ".deps/asn1parser.Tpo" -c -o asn1parser.lo asn1parser.c; \ then mv -f ".deps/asn1parser.Tpo" ".deps/asn1parser.Plo"; else rm -f ".deps/asn1parser.Tpo"; exit 1; fi bison -y -p asn1p_ -d asn1p_y.y if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF ".deps/asn1p_l.Tpo" -c -o asn1p_l.lo asn1p_l.c; \ then mv -f ".deps/asn1p_l.Tpo" ".deps/asn1p_l.Plo"; else rm -f ".deps/asn1p_l.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF ".deps/asn1p_module.Tpo" -c -o asn1p_module.lo asn1p_module.c; \ then mv -f ".deps/asn1p_module.Tpo" ".deps/asn1p_module.Plo"; else rm -f ".deps/asn1p_module.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF ".deps/asn1p_oid.Tpo" -c -o asn1p_oid.lo asn1p_oid.c; \ then mv -f ".deps/asn1p_oid.Tpo" ".deps/asn1p_oid.Plo"; else rm -f ".deps/asn1p_oid.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF ".deps/asn1p_value.Tpo" -c -o asn1p_value.lo asn1p_value.c; \ then mv -f ".deps/asn1p_value.Tpo" ".deps/asn1p_value.Plo"; else rm -f ".deps/asn1p_value.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF ".deps/asn1p_expr.Tpo" -c -o asn1p_expr.lo asn1p_expr.c; \ then mv -f ".deps/asn1p_expr.Tpo" ".deps/asn1p_expr.Plo"; else rm -f ".deps/asn1p_expr.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF ".deps/asn1p_xports.Tpo" -c -o asn1p_xports.lo asn1p_xports.c; \ then mv -f ".deps/asn1p_xports.Tpo" ".deps/asn1p_xports.Plo"; else rm -f ".deps/asn1p_xports.Tpo"; exit 1; fi asn1p_y.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] mkdir .libs gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -fPIC -DPIC -o .libs/asn1p_expr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -fPIC -DPIC -o .libs/asn1p_module.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -fPIC -DPIC -o .libs/asn1p_l.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -fPIC -DPIC -o .libs/asn1p_oid.o asn1p_l.c:3521:12: warning: 'input' defined but not used [-Wunused-function] static int input() ^~~~~ gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -fPIC -DPIC -o .libs/asn1p_xports.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -fPIC -DPIC -o .libs/asn1p_value.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -o asn1p_module.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -fPIC -DPIC -o .libs/asn1parser.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -o asn1p_oid.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -o asn1p_xports.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -o asn1p_expr.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF ".deps/asn1p_constr.Tpo" -c -o asn1p_constr.lo asn1p_constr.c; \ then mv -f ".deps/asn1p_constr.Tpo" ".deps/asn1p_constr.Plo"; else rm -f ".deps/asn1p_constr.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF ".deps/asn1p_param.Tpo" -c -o asn1p_param.lo asn1p_param.c; \ then mv -f ".deps/asn1p_param.Tpo" ".deps/asn1p_param.Plo"; else rm -f ".deps/asn1p_param.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF ".deps/asn1p_class.Tpo" -c -o asn1p_class.lo asn1p_class.c; \ then mv -f ".deps/asn1p_class.Tpo" ".deps/asn1p_class.Plo"; else rm -f ".deps/asn1p_class.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -o asn1parser.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -o asn1p_value.o >/dev/null 2>&1 if test -f y.tab.h; then \ to=`echo "asn1p_y_H" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \ sed -e "/^#/!b" -e "s/Y_TAB_H/$to/g" -e "s|y\.tab\.h|asn1p_y.h|" \ y.tab.h >asn1p_y.ht; \ rm -f y.tab.h; \ if cmp -s asn1p_y.ht asn1p_y.h; then \ rm -f asn1p_y.ht ;\ else \ mv asn1p_y.ht asn1p_y.h; \ fi; \ fi if test -f y.output; then \ mv y.output asn1p_y.output; \ fi sed '/^#/ s|y\.tab\.c|asn1p_y.c|' y.tab.c >asn1p_y.ct && mv asn1p_y.ct asn1p_y.c rm -f y.tab.c if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF ".deps/asn1p_ref.Tpo" -c -o asn1p_ref.lo asn1p_ref.c; \ then mv -f ".deps/asn1p_ref.Tpo" ".deps/asn1p_ref.Plo"; else rm -f ".deps/asn1p_ref.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF ".deps/asn1p_y.Tpo" -c -o asn1p_y.lo asn1p_y.c; \ then mv -f ".deps/asn1p_y.Tpo" ".deps/asn1p_y.Plo"; else rm -f ".deps/asn1p_y.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -fPIC -DPIC -o .libs/asn1p_param.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -fPIC -DPIC -o .libs/asn1p_constr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF .deps/asn1p_y.Tpo -c asn1p_y.c -fPIC -DPIC -o .libs/asn1p_y.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -fPIC -DPIC -o .libs/asn1p_class.o asn1p_y.y: In function 'asn1p_parse': asn1p_y.y:357:13: error: 'param' undeclared (first use in this function) *(void **)param = $1; ^~~~~ asn1p_y.y:357:13: note: each undeclared identifier is reported only once for each function it appears in gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -o asn1p_param.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -o asn1p_constr.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -o asn1p_l.o >/dev/null 2>&1 Makefile:299: recipe for target 'asn1p_y.lo' failed make[2]: *** [asn1p_y.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -o asn1p_class.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -fPIC -DPIC -o .libs/asn1p_ref.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -o asn1p_ref.o >/dev/null 2>&1 make[2]: Leaving directory ' Makefile:302: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory ' Makefile:212: recipe for target 'all' failed make: *** [all] Error 2 Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Thu Jul 26 15:11:35 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 26 Jul 2018 15:11:35 +0000 Subject: Change in osmo-bsc[master]: gscon: use BSS-common payload types on BSS side Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/10173 Change subject: gscon: use BSS-common payload types on BSS side ...................................................................... gscon: use BSS-common payload types on BSS side In cases where a codec has no fixed (IANA) payload type number, a dynamically coosen payload type number is used. For the route between BSC and MSC IANA as designated certain payload type numbers. However, beond those payload type numbers may not necessarly apply. The RTP communication between BTS and BSC still might run on a completely different payload type number. libosmo-netif contains a header file which payload type numbers shall be used. Lets use those in order to signal the same payload type numbers as we actually use in the RTP packets to the MGW. Change-Id: I3373876bf5430130c6509be08b5f08e724c57c7a Depends: osmo-mgw If176a3719dd9e888da16196d5fc0bdb53cc2a5f2 Related: OS#2728 Related: OS#3384 --- M include/osmocom/bsc/bsc_subscr_conn_fsm.h M src/osmo-bsc/bsc_subscr_conn_fsm.c M src/osmo-bsc/osmo_bsc_lcls.c 3 files changed, 37 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/73/10173/1 diff --git a/include/osmocom/bsc/bsc_subscr_conn_fsm.h b/include/osmocom/bsc/bsc_subscr_conn_fsm.h index 9e56f6b..e458d7a 100644 --- a/include/osmocom/bsc/bsc_subscr_conn_fsm.h +++ b/include/osmocom/bsc/bsc_subscr_conn_fsm.h @@ -71,4 +71,4 @@ /* Allocate a subscriber connection and its associated FSM */ struct gsm_subscriber_connection *bsc_subscr_con_allocate(struct gsm_network *net); -void bsc_subscr_pick_codec(struct mgcp_conn_peer *conn_peer, struct gsm_subscriber_connection *conn); +void bsc_subscr_pick_codec(struct mgcp_conn_peer *conn_peer, struct gsm_subscriber_connection *conn, bool bss_side); diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c b/src/osmo-bsc/bsc_subscr_conn_fsm.c index 66cdbba..b239fd0 100644 --- a/src/osmo-bsc/bsc_subscr_conn_fsm.c +++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c @@ -36,6 +36,7 @@ #include #include #include +#include #define S(x) (1 << (x)) @@ -122,8 +123,10 @@ /* Depending on the channel mode and rate, set the codec type that is signalled * towards the MGW. */ -void bsc_subscr_pick_codec(struct mgcp_conn_peer *conn_peer, struct gsm_subscriber_connection *conn) +void bsc_subscr_pick_codec(struct mgcp_conn_peer *conn_peer, struct gsm_subscriber_connection *conn, bool bss_side) { + /* Set up codec configuration */ + conn_peer->codecs_len = 0; switch (conn->user_plane.chan_mode) { case GSM48_CMODE_SPEECH_V1: if (conn->user_plane.full_rate) @@ -143,6 +146,32 @@ default: conn_peer->codecs_len = 0; } + + /* Setup custom payload types (only for BSS side) */ + conn_peer->ptmap_len = 0; + if (bss_side) { + switch (conn->user_plane.chan_mode) { + case GSM48_CMODE_SPEECH_V1: + if (!conn->user_plane.full_rate) { + conn_peer->ptmap[0].codec = CODEC_GSMHR_8000_1; + conn_peer->ptmap[0].pt = RTP_PT_GSM_HALF; + } + conn_peer->ptmap_len = 1; + break; + case GSM48_CMODE_SPEECH_EFR: + conn_peer->ptmap[0].codec = CODEC_GSMEFR_8000_1; + conn_peer->ptmap[0].pt = RTP_PT_GSM_EFR; + conn_peer->ptmap_len = 1; + break; + case GSM48_CMODE_SPEECH_AMR: + conn_peer->ptmap[0].codec = CODEC_AMR_8000_1; + conn_peer->ptmap[0].pt = RTP_PT_AMR; + conn_peer->ptmap_len = 1; + break; + default: + conn_peer->ptmap_len = 0; + } + } } /* Send data SCCP message through SCCP connection. All sigtran messages @@ -439,7 +468,7 @@ /* A voice channel is requested, so we run down the * mgcp-ass-mgcp state-chain (see FIXME above) */ memset(&conn_peer, 0, sizeof(conn_peer)); - bsc_subscr_pick_codec(&conn_peer, conn); + bsc_subscr_pick_codec(&conn_peer, conn, true); conn_peer.call_id = conn->sccp.conn_id; conn_peer.ptime = 20; osmo_strlcpy(conn_peer.endpoint, get_mgw_ep_name(conn), sizeof(conn_peer.endpoint)); @@ -599,7 +628,7 @@ /* Prepare parameters with the information we got during the assignment */ memset(&conn_peer, 0, sizeof(conn_peer)); - bsc_subscr_pick_codec(&conn_peer, conn); + bsc_subscr_pick_codec(&conn_peer, conn, true); addr.s_addr = osmo_ntohl(lchan->abis_ip.bound_ip); osmo_strlcpy(conn_peer.addr, inet_ntoa(addr), sizeof(conn_peer.addr)); conn_peer.port = lchan->abis_ip.bound_port; @@ -666,7 +695,7 @@ /* Prepare parameters with the connection information we got * with the assignment command */ memset(&conn_peer, 0, sizeof(conn_peer)); - bsc_subscr_pick_codec(&conn_peer, conn); + bsc_subscr_pick_codec(&conn_peer, conn, false); conn_peer.call_id = conn->sccp.conn_id; sin = (struct sockaddr_in *)&conn->user_plane.aoip_rtp_addr_remote; conn_peer.port = osmo_ntohs(sin->sin_port); @@ -791,7 +820,7 @@ /* Prepare parameters with the information we got during the * handover procedure (via IPACC) */ memset(&conn_peer, 0, sizeof(conn_peer)); - bsc_subscr_pick_codec(&conn_peer, conn); + bsc_subscr_pick_codec(&conn_peer, conn, true); addr.s_addr = osmo_ntohl(lchan->abis_ip.bound_ip); osmo_strlcpy(conn_peer.addr, inet_ntoa(addr), sizeof(conn_peer.addr)); conn_peer.port = lchan->abis_ip.bound_port; diff --git a/src/osmo-bsc/osmo_bsc_lcls.c b/src/osmo-bsc/osmo_bsc_lcls.c index b197e66..8d990a9 100644 --- a/src/osmo-bsc/osmo_bsc_lcls.c +++ b/src/osmo-bsc/osmo_bsc_lcls.c @@ -244,7 +244,7 @@ memset(&peer, 0, sizeof(peer)); peer.port = htons(sin->sin_port); osmo_strlcpy(peer.addr, inet_ntoa(sin->sin_addr), sizeof(peer.addr)); - bsc_subscr_pick_codec(&peer, conn); + bsc_subscr_pick_codec(&peer, conn, false); mgcp_conn_modify(conn->user_plane.fi_msc, 0, &peer); } @@ -564,7 +564,7 @@ memset(&peer, 0, sizeof(peer)); peer.port = htons(sin->sin_port); osmo_strlcpy(peer.addr, inet_ntoa(sin->sin_addr), sizeof(peer.addr)); - bsc_subscr_pick_codec(&peer, conn); + bsc_subscr_pick_codec(&peer, conn, false); mgcp_conn_modify(conn->user_plane.fi_msc, 0, &peer); } -- To view, visit https://gerrit.osmocom.org/10173 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I3373876bf5430130c6509be08b5f08e724c57c7a Gerrit-Change-Number: 10173 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 15:15:11 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 26 Jul 2018 15:15:11 +0000 Subject: Change in libosmo-netif[master]: rtp: use 3GPP assigned payload type numbers In-Reply-To: References: Message-ID: dexter has abandoned this change. ( https://gerrit.osmocom.org/9780 ) Change subject: rtp: use 3GPP assigned payload type numbers ...................................................................... Abandoned Since we osmo-mgw now can translate payload types, modifying this constants is no longer necessary to get 3GPP compliant payload type numbers on the route between MSC and BSC -- To view, visit https://gerrit.osmocom.org/9780 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: Ife9ea525a615685c4b2369e491db46452b63c6cb Gerrit-Change-Number: 9780 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 15:15:25 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 26 Jul 2018 15:15:25 +0000 Subject: Change in libosmo-abis[master]: ortp: use 3GPP assigned payload type numbers In-Reply-To: References: Message-ID: dexter has abandoned this change. ( https://gerrit.osmocom.org/9779 ) Change subject: ortp: use 3GPP assigned payload type numbers ...................................................................... Abandoned Since we osmo-mgw now can translate payload types, modifying this constants is no longer necessary to get 3GPP compliant payload type numbers on the route between MSC and BSC -- To view, visit https://gerrit.osmocom.org/9779 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: If5bfa4aac37ce95741322f6a7481cf612425d77b Gerrit-Change-Number: 9779 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 15:23:59 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 26 Jul 2018 15:23:59 +0000 Subject: Change in libosmocore[master]: fix strncpy bugs in gsm/ipa.c Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10174 Change subject: fix strncpy bugs in gsm/ipa.c ...................................................................... fix strncpy bugs in gsm/ipa.c Change-Id: I423a24c55c9b9aa6fc8f501df94fe54c71ee2b2b --- M src/gsm/ipa.c 1 file changed, 6 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/74/10174/1 diff --git a/src/gsm/ipa.c b/src/gsm/ipa.c index 0c7aaad..aecde83 100644 --- a/src/gsm/ipa.c +++ b/src/gsm/ipa.c @@ -251,23 +251,23 @@ break; case IPAC_IDTAG_LOCATION1: if (dev->location1) - strncpy(str, dev->location1, IPA_STRING_MAX); + osmo_strlcpy(str, dev->location1, sizeof(str)); break; case IPAC_IDTAG_LOCATION2: if (dev->location2) - strncpy(str, dev->location2, IPA_STRING_MAX); + osmo_strlcpy(str, dev->location2, sizeof(str)); break; case IPAC_IDTAG_EQUIPVERS: if (dev->equipvers) - strncpy(str, dev->equipvers, IPA_STRING_MAX); + osmo_strlcpy(str, dev->equipvers, sizeof(str)); break; case IPAC_IDTAG_SWVERSION: if (dev->swversion) - strncpy(str, dev->swversion, IPA_STRING_MAX); + osmo_strlcpy(str, dev->swversion, sizeof(str)); break; case IPAC_IDTAG_UNITNAME: if (dev->unit_name) { - snprintf(str, sizeof(str), dev->unit_name, IPA_STRING_MAX); + snprintf(str, sizeof(str), "%s", dev->unit_name); } else { snprintf(str, sizeof(str), "%02x-%02x-%02x-%02x-%02x-%02x", @@ -278,7 +278,7 @@ break; case IPAC_IDTAG_SERNR: if (dev->serno) - strncpy(str, dev->serno, IPA_STRING_MAX); + osmo_strlcpy(str, dev->serno, sizeof(str)); break; default: LOGP(DLINP, LOGL_NOTICE, @@ -286,7 +286,6 @@ msgb_free(msg); return NULL; } - str[IPA_STRING_MAX-1] = '\0'; LOGP(DLINP, LOGL_INFO, " tag %d: %s\n", ies_req[i], str); tag = msgb_put(msg, 3 + strlen(str) + 1); -- To view, visit https://gerrit.osmocom.org/10174 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I423a24c55c9b9aa6fc8f501df94fe54c71ee2b2b Gerrit-Change-Number: 10174 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 15:24:00 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 26 Jul 2018 15:24:00 +0000 Subject: Change in libosmocore[master]: fix strncpy bugs in socket.c Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10175 Change subject: fix strncpy bugs in socket.c ...................................................................... fix strncpy bugs in socket.c Change-Id: Iddf36d26b23dcef4f9b291fd7ead1907e38c3486 --- M src/socket.c 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/75/10175/1 diff --git a/src/socket.c b/src/socket.c index 0405847..dc5590c 100644 --- a/src/socket.c +++ b/src/socket.c @@ -596,8 +596,7 @@ return -EINVAL; local.sun_family = AF_UNIX; - strncpy(local.sun_path, socket_path, sizeof(local.sun_path)); - local.sun_path[sizeof(local.sun_path) - 1] = '\0'; + osmo_strlcpy(local.sun_path, socket_path, sizeof(local.sun_path)); #if defined(BSD44SOCKETS) || defined(__UNIXWARE__) local.sun_len = strlen(local.sun_path); -- To view, visit https://gerrit.osmocom.org/10175 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iddf36d26b23dcef4f9b291fd7ead1907e38c3486 Gerrit-Change-Number: 10175 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 15:24:00 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 26 Jul 2018 15:24:00 +0000 Subject: Change in libosmocore[master]: cosmetic: osmo-sim-test.c: use memcpy instead of strncpy Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10176 Change subject: cosmetic: osmo-sim-test.c: use memcpy instead of strncpy ...................................................................... cosmetic: osmo-sim-test.c: use memcpy instead of strncpy gcc 8.1.0 complains that the terminating \0 is not copied by strncpy, while this code intends to do exactly that. Use memcpy instead. Change-Id: I8d66fa22502c04d11ae153b9856d7e54f3492dd6 --- M utils/osmo-sim-test.c 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/76/10176/1 diff --git a/utils/osmo-sim-test.c b/utils/osmo-sim-test.c index ea24120..5588294 100644 --- a/utils/osmo-sim-test.c +++ b/utils/osmo-sim-test.c @@ -74,7 +74,8 @@ msg = osim_new_apdumsg(0x00, 0x20, 0x00, pin_nr, 8, 0); pindst = (char *) msgb_put(msg, 8); memset(pindst, 0xFF, 8); - strncpy(pindst, pin, strlen(pin)); + /* Do not copy the terminating \0 */ + memcpy(pindst, pin, strlen(pin)); return osim_transceive_apdu(st, msg); } -- To view, visit https://gerrit.osmocom.org/10176 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I8d66fa22502c04d11ae153b9856d7e54f3492dd6 Gerrit-Change-Number: 10176 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 15:28:51 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 26 Jul 2018 15:28:51 +0000 Subject: Change in libosmo-abis[master]: fix strncpy bugs in ipaccess.c, ipa_proxy.c Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10177 Change subject: fix strncpy bugs in ipaccess.c, ipa_proxy.c ...................................................................... fix strncpy bugs in ipaccess.c, ipa_proxy.c Change-Id: Iad53b603521c0a8f4857bd87dca777ba8e875cde --- M src/input/ipaccess.c M src/ipa_proxy.c 2 files changed, 6 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/77/10177/1 diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c index 23eeda6..7d3845e 100644 --- a/src/input/ipaccess.c +++ b/src/input/ipaccess.c @@ -602,19 +602,19 @@ break; case IPAC_IDTAG_LOCATION1: if (dev->location1) - strncpy(str, dev->location1, IPA_STRING_MAX); + osmo_strlcpy(str, dev->swversion, sizeof(str)); break; case IPAC_IDTAG_LOCATION2: if (dev->location2) - strncpy(str, dev->location2, IPA_STRING_MAX); + osmo_strlcpy(str, dev->swversion, sizeof(str)); break; case IPAC_IDTAG_EQUIPVERS: if (dev->equipvers) - strncpy(str, dev->equipvers, IPA_STRING_MAX); + osmo_strlcpy(str, dev->swversion, sizeof(str)); break; case IPAC_IDTAG_SWVERSION: if (dev->swversion) - strncpy(str, dev->swversion, IPA_STRING_MAX); + osmo_strlcpy(str, dev->swversion, sizeof(str)); break; case IPAC_IDTAG_UNITNAME: snprintf(str, sizeof(str), @@ -626,7 +626,7 @@ break; case IPAC_IDTAG_SERNR: if (dev->serno) - strncpy(str, dev->serno, IPA_STRING_MAX); + osmo_strlcpy(str, dev->swversion, sizeof(str)); break; default: LOGP(DLINP, LOGL_NOTICE, @@ -634,7 +634,6 @@ msgb_free(nmsg); return NULL; } - str[IPA_STRING_MAX-1] = '\0'; LOGP(DLINP, LOGL_INFO, " tag %d: %s\n", data[1], str); tag = msgb_put(nmsg, 3 + strlen(str) + 1); diff --git a/src/ipa_proxy.c b/src/ipa_proxy.c index 94f48dc..44f5baf 100644 --- a/src/ipa_proxy.c +++ b/src/ipa_proxy.c @@ -245,8 +245,7 @@ VTY_NEWLINE); return CMD_WARNING; } - strncpy(ipi->name, argv[0], IPA_INSTANCE_NAME); - ipi->name[IPA_INSTANCE_NAME - 1] = '\0'; + osmo_strlcpy(ipi->name, argv[0], sizeof(ipi->name)); ipi->net.type = type; ipi->net.addr = talloc_strdup(tall_ipa_proxy_ctx, argv[2]); ipi->net.port = port; -- To view, visit https://gerrit.osmocom.org/10177 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iad53b603521c0a8f4857bd87dca777ba8e875cde Gerrit-Change-Number: 10177 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 15:29:50 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 26 Jul 2018 15:29:50 +0000 Subject: Change in libosmo-netif[master]: fix strncpy bug in rs232.c Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10178 Change subject: fix strncpy bug in rs232.c ...................................................................... fix strncpy bug in rs232.c Change-Id: I2f3b7888acb4f25da22ffef4391e1d0831485483 --- M src/rs232.c 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/78/10178/1 diff --git a/src/rs232.c b/src/rs232.c index da5b56b..28f1ba0 100644 --- a/src/rs232.c +++ b/src/rs232.c @@ -141,8 +141,7 @@ void osmo_rs232_set_serial_port(struct osmo_rs232 *r, char *serial_port) { - strncpy(r->cfg.serial_port, serial_port, PATH_MAX); - r->cfg.serial_port[PATH_MAX-1] = '\0'; + osmo_strlcpy(r->cfg.serial_port, serial_port, PATH_MAX); } void osmo_rs232_set_baudrate(struct osmo_rs232 *r, int baudrate) -- To view, visit https://gerrit.osmocom.org/10178 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I2f3b7888acb4f25da22ffef4391e1d0831485483 Gerrit-Change-Number: 10178 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 15:36:07 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 26 Jul 2018 15:36:07 +0000 Subject: Change in osmo-bsc[master]: large refactoring: use FSMs for lchans; add inter-BSC HO In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9671 ) Change subject: large refactoring: use FSMs for lchans; add inter-BSC HO ...................................................................... Patch Set 38: https://jenkins.osmocom.org/jenkins/view/osmo-gsm-tester/job/osmo-gsm-tester_manual-run/111/console suggests that I completely broke ip.access nanobts. Need to investigate. -- To view, visit https://gerrit.osmocom.org/9671 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I82e3f918295daa83274a4cf803f046979f284366 Gerrit-Change-Number: 9671 Gerrit-PatchSet: 38 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Thu, 26 Jul 2018 15:36:07 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 15:39:49 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 26 Jul 2018 15:39:49 +0000 Subject: Change in libosmocore[master]: fix strncpy bugs in gsm/ipa.c In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10174 ) Change subject: fix strncpy bugs in gsm/ipa.c ...................................................................... Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/10174/1/src/gsm/ipa.c File src/gsm/ipa.c: https://gerrit.osmocom.org/#/c/10174/1/src/gsm/ipa.c at 270 PS1, Line 270: snprintf(str, sizeof(str), "%s", dev->unit_name); Why not passing dev->unit_name directly instead? Looks like this line previous commit was wrong hree passing IPA_STRING_MAX right? -- To view, visit https://gerrit.osmocom.org/10174 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I423a24c55c9b9aa6fc8f501df94fe54c71ee2b2b Gerrit-Change-Number: 10174 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 26 Jul 2018 15:39:49 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 15:42:01 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 26 Jul 2018 15:42:01 +0000 Subject: Change in libosmocore[master]: fix strncpy bugs in socket.c In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10175 ) Change subject: fix strncpy bugs in socket.c ...................................................................... Patch Set 2: Next time please add the compilation error in the commit description for better understanding of the issue -- To view, visit https://gerrit.osmocom.org/10175 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iddf36d26b23dcef4f9b291fd7ead1907e38c3486 Gerrit-Change-Number: 10175 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 26 Jul 2018 15:42:01 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 15:42:09 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 26 Jul 2018 15:42:09 +0000 Subject: Change in libosmocore[master]: fix strncpy bugs in socket.c In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10175 ) Change subject: fix strncpy bugs in socket.c ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10175 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iddf36d26b23dcef4f9b291fd7ead1907e38c3486 Gerrit-Change-Number: 10175 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Thu, 26 Jul 2018 15:42:09 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 15:45:15 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 26 Jul 2018 15:45:15 +0000 Subject: Change in osmo-msc[master]: Iu MGCP: no need to loopback on the cn side Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10179 Change subject: Iu MGCP: no need to loopback on the cn side ...................................................................... Iu MGCP: no need to loopback on the cn side Change-Id: I501a7846c76dd703beb3991362b1ccbd62dfd155 --- M src/libmsc/msc_mgcp.c 1 file changed, 0 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/79/10179/1 diff --git a/src/libmsc/msc_mgcp.c b/src/libmsc/msc_mgcp.c index c77e389..e261e7a 100644 --- a/src/libmsc/msc_mgcp.c +++ b/src/libmsc/msc_mgcp.c @@ -437,14 +437,6 @@ return; } - /* HACK: We put the connection in loopback mode at the beginnig to - * trick the NodeB into doing the IuUP negotiation with itsself. - * this is a hack we need because osmo-mgw does not support IuUP yet */ -#ifdef BUILD_IU - if (conn->via_ran == RAN_UTRAN_IU) - mgcp_msg.conn_mode = MGCP_CONN_LOOPBACK; -#endif - msg = mgcp_msg_gen(mgcp, &mgcp_msg); OSMO_ASSERT(msg); -- To view, visit https://gerrit.osmocom.org/10179 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I501a7846c76dd703beb3991362b1ccbd62dfd155 Gerrit-Change-Number: 10179 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 15:45:15 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 26 Jul 2018 15:45:15 +0000 Subject: Change in osmo-msc[master]: cosmetic: typos in log and comment Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10180 Change subject: cosmetic: typos in log and comment ...................................................................... cosmetic: typos in log and comment Change-Id: I2416d9a45e88f4317aa8e6644f5581a6f4f119c8 --- M src/libmsc/msc_mgcp.c 1 file changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/80/10180/1 diff --git a/src/libmsc/msc_mgcp.c b/src/libmsc/msc_mgcp.c index e261e7a..f5bdeb7 100644 --- a/src/libmsc/msc_mgcp.c +++ b/src/libmsc/msc_mgcp.c @@ -315,8 +315,8 @@ } /* HACK: We put the connection in loopback mode at the beginnig to - * trick the NodeB into doing the IuUP negotiation with itsself. - * this is a hack we need because osmo-mgw does not support IuUP yet */ + * trick the hNodeB into doing the IuUP negotiation with itself. + * This is a hack we need because osmo-mgw does not support IuUP yet, see OS#2459. */ #ifdef BUILD_IU if (conn->via_ran == RAN_UTRAN_IU) mgcp_msg.conn_mode = MGCP_CONN_LOOPBACK; @@ -1044,19 +1044,19 @@ OSMO_ASSERT(conn); if (port == 0) { - LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid remote call leg port, assignmnet completion failed\n", + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid remote call leg port, assignment completion failed\n", vlr_subscr_name(conn->vsub)); return -EINVAL; } if (!addr || strlen(addr) <= 0) { - LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) missing remote call leg address, assignmnet completion failed\n", + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) missing remote call leg address, assignment completion failed\n", vlr_subscr_name(conn->vsub)); return -EINVAL; } mgcp_ctx = conn->rtp.mgcp_ctx; if (!mgcp_ctx) { - LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid mgcp context, assignmnet completion failed.\n", + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid mgcp context, assignment completion failed.\n", vlr_subscr_name(conn->vsub)); return -EINVAL; } @@ -1066,7 +1066,7 @@ conn->rtp.remote_port_ran = port; osmo_strlcpy(conn->rtp.remote_addr_ran, addr, sizeof(conn->rtp.remote_addr_ran)); - LOGP(DMGCP, LOGL_DEBUG, "(subscriber:%s) assignmnet completed, rtp %s:%d.\n", + LOGP(DMGCP, LOGL_DEBUG, "(subscriber:%s) assignment completed, rtp %s:%d.\n", vlr_subscr_name(conn->vsub), conn->rtp.remote_addr_ran, port); /* Note: We only dispatch the event if we are really waiting for the -- To view, visit https://gerrit.osmocom.org/10180 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I2416d9a45e88f4317aa8e6644f5581a6f4f119c8 Gerrit-Change-Number: 10180 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 16:03:19 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 26 Jul 2018 16:03:19 +0000 Subject: Change in osmo-ttcn3-hacks[master]: detect VTY TELNET port connection failures in TTCN3 tests Message-ID: Stefan Sperling has uploaded this change for review. ( https://gerrit.osmocom.org/10181 Change subject: detect VTY TELNET port connection failures in TTCN3 tests ...................................................................... detect VTY TELNET port connection failures in TTCN3 tests Pass the CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT parameter to the TELNET port by default. This allows tests to make progress into an error handling path if they are started while the osmo-* program they want to connect on VTY is not running. Observed with osmo-ggsn tests, where if the one test runs into a VTY connection failure the subsequent test would get stuck forever in a map() call on the VTY TELNET port. Change-Id: I9acf7793d5d68aec6d087cff254a10d8b673dab1 Related: OS#3149 --- M bsc/BSC_Tests.default M bts/BTS_Tests.default M ggsn_tests/GGSN_Tests.default M hlr/HLR_Tests.default M msc/MSC_Tests.default M sccp/SCCP_Tests.default M sgsn/SGSN_Tests.default M sip/SIP_Tests.default 8 files changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/81/10181/1 diff --git a/bsc/BSC_Tests.default b/bsc/BSC_Tests.default index c13f7b0..8818359 100644 --- a/bsc/BSC_Tests.default +++ b/bsc/BSC_Tests.default @@ -15,6 +15,7 @@ *.BSCVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.BSCVTY.CTRL_READMODE := "buffered" *.BSCVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" +*.BSCVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.BSCVTY.PROMPT1 := "OsmoBSC> " [MODULE_PARAMETERS] diff --git a/bts/BTS_Tests.default b/bts/BTS_Tests.default index 502c17f..f254993 100644 --- a/bts/BTS_Tests.default +++ b/bts/BTS_Tests.default @@ -12,6 +12,7 @@ *.BTSVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.BTSVTY.CTRL_READMODE := "buffered" *.BTSVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" +*.BTSVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.BTSVTY.PROMPT1 := "OsmoBTS> " *.PCU.socket_type := "SEQPACKET" diff --git a/ggsn_tests/GGSN_Tests.default b/ggsn_tests/GGSN_Tests.default index ff0cd97..4d52e24 100644 --- a/ggsn_tests/GGSN_Tests.default +++ b/ggsn_tests/GGSN_Tests.default @@ -8,6 +8,7 @@ *.GGSNVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.GGSNVTY.CTRL_READMODE := "buffered" *.GGSNVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" +*.GGSNVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.GGSNVTY.PROMPT1 := "OsmoGGSN> " [MODULE_PARAMETERS] diff --git a/hlr/HLR_Tests.default b/hlr/HLR_Tests.default index f458479..84d4ff3 100644 --- a/hlr/HLR_Tests.default +++ b/hlr/HLR_Tests.default @@ -9,6 +9,7 @@ *.VTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.VTY.CTRL_READMODE := "buffered" *.VTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" +*.VTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.VTY.PROMPT1 := "OsmoHLR> " [MODULE_PARAMETERS] diff --git a/msc/MSC_Tests.default b/msc/MSC_Tests.default index bcaae06..a24fa38 100644 --- a/msc/MSC_Tests.default +++ b/msc/MSC_Tests.default @@ -20,6 +20,7 @@ *.MSCVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.MSCVTY.CTRL_READMODE := "buffered" *.MSCVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" +*.MSCVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.MSCVTY.PROMPT1 := "OsmoMSC> " diff --git a/sccp/SCCP_Tests.default b/sccp/SCCP_Tests.default index 7d16e5b..95e0d2f 100644 --- a/sccp/SCCP_Tests.default +++ b/sccp/SCCP_Tests.default @@ -15,6 +15,7 @@ *.SCCP_DEMO_USER_VTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.SCCP_DEMO_USER_VTY.CTRL_READMODE := "buffered" *.SCCP_DEMO_USER_VTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" +*.SCCP_DEMO_USER_VTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.SCCP_DEMO_USER_VTY.PROMPT1 := "sccp-demo-user> " [MODULE_PARAMETERS] diff --git a/sgsn/SGSN_Tests.default b/sgsn/SGSN_Tests.default index bac5fdd..3957e82 100644 --- a/sgsn/SGSN_Tests.default +++ b/sgsn/SGSN_Tests.default @@ -15,6 +15,7 @@ *.SGSNVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.SGSNVTY.CTRL_READMODE := "buffered" *.SGSNVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" +*.SGSNVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.SGSNVTY.PROMPT1 := "OsmoSGSN> " diff --git a/sip/SIP_Tests.default b/sip/SIP_Tests.default index 2576b33..4434a1a 100644 --- a/sip/SIP_Tests.default +++ b/sip/SIP_Tests.default @@ -13,6 +13,7 @@ *.SIPVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.SIPVTY.CTRL_READMODE := "buffered" *.SIPVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" +*.SIPVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.SIPVTY.PROMPT1 := "OsmoSIPcon> " *.SIP.local_sip_port := "5060" -- To view, visit https://gerrit.osmocom.org/10181 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I9acf7793d5d68aec6d087cff254a10d8b673dab1 Gerrit-Change-Number: 10181 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 16:15:33 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 26 Jul 2018 16:15:33 +0000 Subject: Change in osmo-ci[master]: ansible: osmo-gsm-tester-prod: Add DHCP lease for secondary muliTRX n... In-Reply-To: References: Message-ID: Pau Espin Pedrol has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/10169 ) Change subject: ansible: osmo-gsm-tester-prod: Add DHCP lease for secondary muliTRX nanobts ...................................................................... ansible: osmo-gsm-tester-prod: Add DHCP lease for secondary muliTRX nanobts Change-Id: I3967d7b4203f5361dc03074dcd82c870d60c8aac --- M ansible/host_vars/osmo-gsm-tester-prod.yml 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/69/10169/2 -- To view, visit https://gerrit.osmocom.org/10169 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3967d7b4203f5361dc03074dcd82c870d60c8aac Gerrit-Change-Number: 10169 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 16:24:51 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 26 Jul 2018 16:24:51 +0000 Subject: Change in libosmocore[master]: logging.c: Fix whitespace typo In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/10168 ) Change subject: logging.c: Fix whitespace typo ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/10168 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I943763e175dca6f3078923a494b052319b78574d Gerrit-Change-Number: 10168 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 26 Jul 2018 16:24:51 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 17:22:05 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 26 Jul 2018 17:22:05 +0000 Subject: Change in libosmocore[master]: logging: Fix logging level all In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10116 ) Change subject: logging: Fix logging level all ...................................................................... Patch Set 3: Code-Review-2 I want to block this until I've had a chance to prove my points, or to see that my arguments weren't justified in the first place. Please give me some time on it. thx! -- To view, visit https://gerrit.osmocom.org/10116 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0f50ad8d6fd038398f7d751287417505c8dcdeff Gerrit-Change-Number: 10116 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 26 Jul 2018 17:22:05 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 18:32:03 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 26 Jul 2018 18:32:03 +0000 Subject: Change in osmo-msc[master]: vlr_access_req_fsm.c: use osmo_strlcpy and avoid compiler error Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10182 Change subject: vlr_access_req_fsm.c: use osmo_strlcpy and avoid compiler error ...................................................................... vlr_access_req_fsm.c: use osmo_strlcpy and avoid compiler error gcc 8.1.0: ../../../../src/osmo-msc/src/libvlr/vlr_access_req_fsm.c:679:3: error: ?strncpy? output may be truncated copying 15 bytes from a string of length 31 [-Werror=stringop-truncation] strncpy(par->imsi, mi_string, sizeof(par->imsi)-1); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The Mobile Identity is a union of various kinds, but the IMSI is at most 15 digits, so truncation is "intended". I hope other layers validate the correct length of an IMSI MI. Change-Id: I0a17a188fc91e42e252ae4bf1d6cd0bf0e5eb077 --- M src/libvlr/vlr_access_req_fsm.c 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/82/10182/1 diff --git a/src/libvlr/vlr_access_req_fsm.c b/src/libvlr/vlr_access_req_fsm.c index 79eb75f..3a0760d 100644 --- a/src/libvlr/vlr_access_req_fsm.c +++ b/src/libvlr/vlr_access_req_fsm.c @@ -676,8 +676,7 @@ mi_type = mi_lv[1] & GSM_MI_TYPE_MASK; switch (mi_type) { case GSM_MI_TYPE_IMSI: - strncpy(par->imsi, mi_string, sizeof(par->imsi)-1); - par->imsi[sizeof(par->imsi)-1] = '\0'; + osmo_strlcpy(par->imsi, mi_string, sizeof(par->imsi)); par->by_tmsi = false; break; case GSM_MI_TYPE_TMSI: -- To view, visit https://gerrit.osmocom.org/10182 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I0a17a188fc91e42e252ae4bf1d6cd0bf0e5eb077 Gerrit-Change-Number: 10182 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 19:03:03 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 26 Jul 2018 19:03:03 +0000 Subject: Change in osmo-ttcn3-hacks[master]: update expected test result for TC_sacch_multi_chg In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/10157 ) Change subject: update expected test result for TC_sacch_multi_chg ...................................................................... Patch Set 4: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/10157 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I576f881fcb40c4fcbe6b6f767220111a0e9ffd3c Gerrit-Change-Number: 10157 Gerrit-PatchSet: 4 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 26 Jul 2018 19:03:03 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 19:47:30 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 26 Jul 2018 19:47:30 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS: fix: pad LAPDm frames before sending via L1CTL Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/10183 Change subject: BTS: fix: pad LAPDm frames before sending via L1CTL ...................................................................... BTS: fix: pad LAPDm frames before sending via L1CTL Thanks to Stefan Sperling, a critical bug was discovered in trxcon. The problem was that length of LAPDm frames was not checked before passing them to the libosmocoding API. So, if a received LAPDm frame is shorter than expected (i.e. 23 bytes), then: - in case of xCCH, there was a heap overflow (detected by ASAN), so a short frame has been encoded together with some garbage outside the primitive buffer... - in case of FACCH, as the length != 23, a frame was recognised as a speech frame, and also encoded together with some garbage. Since the bug is fixed (OS#3415), some TTCN-3 BTS tests started to fail, because most likely it was assumed that trxcon would pad the frames automatically, but it doesn't and shouldn't. Let's automatically pad LAPDm frames with 0x2b before sending. Change-Id: I16cba4e4179456bebabf0638760af011a27fd333 Related: OS#3418 --- M bts/BTS_Tests.ttcn M start-testsuite.sh 2 files changed, 9 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/83/10183/1 diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index 40bfd24..2e27c10 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -3222,6 +3222,14 @@ /* prepend dummy L1 header */ l2 := '0000'O & l2; } + + /* If required, pad L2 frame with constant 0x02 filling */ + var integer l2_len := lengthof(l2); + while (l2_len < 23) { + l2_len := l2_len + 1; + l2 := l2 & '2B'O; + } + log("encoding ", l, " to ", l2); L1CTL.send(ts_L1CTL_DATA_REQ(g_chan_nr, link_id, l2)); } diff --git a/start-testsuite.sh b/start-testsuite.sh index e2da8f0..e8d7fcc 100755 --- a/start-testsuite.sh +++ b/start-testsuite.sh @@ -21,7 +21,7 @@ TEST=$3 fi -LD_LIBRARY_PATH="$SUITE_DIR:/usr/lib/titan:/usr/ttcn3/lib" ttcn3_start $SUITE $CFG $TEST +LD_LIBRARY_PATH="$SUITE_DIR:/home/wmn/osmocom/titan.core/install/lib" ttcn3_start $SUITE $CFG $TEST expected="$SUITE_DIR/expected-results.xml" if [ ! -f "$expected" ]; then -- To view, visit https://gerrit.osmocom.org/10183 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I16cba4e4179456bebabf0638760af011a27fd333 Gerrit-Change-Number: 10183 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 19:47:30 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 26 Jul 2018 19:47:30 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS: enable encryption + RLL tests for Bm (TCH/F) channels Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/10184 Change subject: BTS: enable encryption + RLL tests for Bm (TCH/F) channels ...................................................................... BTS: enable encryption + RLL tests for Bm (TCH/F) channels Due to OS#3418, both encryption and RLL tests have been failing. It's time to enable Bm (TCH/F FACCH) channel related tests now! Please note that Lm (TCH/H) remains disabled because of OS#3419. Change-Id: I7c0f9f9f695e089e4a30f63ec362d1e6c18abff0 Related: OS#3256 --- M bts/BTS_Tests.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/84/10184/1 diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index 2e27c10..023d8e7 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -301,7 +301,7 @@ }; g_AllChanTypes := { /* TS 1..4: TCH/F */ - //valueof(ts_RslChanNr_Bm(1)), + valueof(ts_RslChanNr_Bm(1)), /* TS 5: TCH/H */ //valueof(ts_RslChanNr_Lm(5,1)), /* TS 0: SDCCH/4 */ -- To view, visit https://gerrit.osmocom.org/10184 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I7c0f9f9f695e089e4a30f63ec362d1e6c18abff0 Gerrit-Change-Number: 10184 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 20:26:48 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 26 Jul 2018 20:26:48 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS: fix: pad LAPDm frames before sending via L1CTL In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/10183 ) Change subject: BTS: fix: pad LAPDm frames before sending via L1CTL ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/10183 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I16cba4e4179456bebabf0638760af011a27fd333 Gerrit-Change-Number: 10183 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-Comment-Date: Thu, 26 Jul 2018 20:26:48 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 20:36:01 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 26 Jul 2018 20:36:01 +0000 Subject: Change in libosmocore[master]: logging.c: Fix whitespace typo In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10168 ) Change subject: logging.c: Fix whitespace typo ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10168 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I943763e175dca6f3078923a494b052319b78574d Gerrit-Change-Number: 10168 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 26 Jul 2018 20:36:01 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 20:36:03 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 26 Jul 2018 20:36:03 +0000 Subject: Change in libosmocore[master]: logging.c: Fix whitespace typo In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10168 ) Change subject: logging.c: Fix whitespace typo ...................................................................... logging.c: Fix whitespace typo Change-Id: I943763e175dca6f3078923a494b052319b78574d --- M src/logging.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Vadim Yanitskiy: Looks good to me, but someone else must approve Neels Hofmeyr: Looks good to me, approved diff --git a/src/logging.c b/src/logging.c index 381d303..edb2b56 100644 --- a/src/logging.c +++ b/src/logging.c @@ -759,7 +759,7 @@ if (!target) return NULL; - target->categories = talloc_zero_array(target, + target->categories = talloc_zero_array(target, struct log_category, osmo_log_info->num_cat); if (!target->categories) { -- To view, visit https://gerrit.osmocom.org/10168 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I943763e175dca6f3078923a494b052319b78574d Gerrit-Change-Number: 10168 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 20:36:52 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 26 Jul 2018 20:36:52 +0000 Subject: Change in osmo-ttcn3-hacks[master]: update expected test result for TC_sacch_multi_chg In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10157 ) Change subject: update expected test result for TC_sacch_multi_chg ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10157 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I576f881fcb40c4fcbe6b6f767220111a0e9ffd3c Gerrit-Change-Number: 10157 Gerrit-PatchSet: 4 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Thu, 26 Jul 2018 20:36:52 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 20:36:56 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 26 Jul 2018 20:36:56 +0000 Subject: Change in osmo-ttcn3-hacks[master]: update expected test result for TC_sacch_multi_chg In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10157 ) Change subject: update expected test result for TC_sacch_multi_chg ...................................................................... update expected test result for TC_sacch_multi_chg This test has been passing since osmo-bts commit eee7247ebe0d0a54a54b53b739bdd434dfceb511, so expect it to pass instead of fail. Change-Id: I576f881fcb40c4fcbe6b6f767220111a0e9ffd3c Related: OS#3173 --- M bts/expected-results.xml 1 file changed, 1 insertion(+), 3 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Vadim Yanitskiy: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/bts/expected-results.xml b/bts/expected-results.xml index 6cebb46..d1a65a3 100644 --- a/bts/expected-results.xml +++ b/bts/expected-results.xml @@ -8,9 +8,7 @@ - - Dynamic test case error: Error message was received from MC: The connect operation refers to test component with component reference 116, which has already terminated. - + -- To view, visit https://gerrit.osmocom.org/10157 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I576f881fcb40c4fcbe6b6f767220111a0e9ffd3c Gerrit-Change-Number: 10157 Gerrit-PatchSet: 5 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 20:38:09 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 26 Jul 2018 20:38:09 +0000 Subject: Change in openbsc[master]: git-version-gen: Don't check for .git directory In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10144 ) Change subject: git-version-gen: Don't check for .git directory ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10144 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ibc8c0d8e74bb03bfe87d6f8b9ef6e74c0c889d0f Gerrit-Change-Number: 10144 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Thu, 26 Jul 2018 20:38:09 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 20:41:24 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 26 Jul 2018 20:41:24 +0000 Subject: Change in osmo-bsc[master]: rsl: use 3GPP assigned payload type constants from libosmo-netif In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9781 ) Change subject: rsl: use 3GPP assigned payload type constants from libosmo-netif ...................................................................... Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9781 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib6a866b29d863d6875c67748dbe6b6468941ab29 Gerrit-Change-Number: 9781 Gerrit-PatchSet: 6 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-CC: Harald Welte Gerrit-Comment-Date: Thu, 26 Jul 2018 20:41:24 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 20:46:43 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 26 Jul 2018 20:46:43 +0000 Subject: Change in osmo-bts[master]: clear GPRS indicator in SI3 while PCU is disconnected In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10170 ) Change subject: clear GPRS indicator in SI3 while PCU is disconnected ...................................................................... Patch Set 1: Code-Review+1 (4 comments) Can we share code with osmo-bsc rest_octets.[ch]? (by moving to libosmocore) If not, the si3 decoding and encoding should probably have a C test. https://gerrit.osmocom.org/#/c/10170/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/10170/1//COMMIT_MSG at 10 PS1, Line 10: The BSC has no knowledge of the PCU connection state. Prevent MMs MSs? https://gerrit.osmocom.org/#/c/10170/1/src/common/rsl.c File src/common/rsl.c: https://gerrit.osmocom.org/#/c/10170/1/src/common/rsl.c at 289 PS1, Line 289: struct gsm48_si3_rest { would it make sense to move gsm48_si_ro_info from osmo-bsc to libosmocore? https://gerrit.osmocom.org/#/c/10170/1/src/common/rsl.c at 290 PS1, Line 290: uint8_t sp; why tabs? https://gerrit.osmocom.org/#/c/10170/1/src/common/rsl.c at 516 PS1, Line 516: if (!pcu_connected()) { (the levels of nesting suggest a separate function) -- To view, visit https://gerrit.osmocom.org/10170 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1a6f5c636c0fe098ee31c280d4572a3f8122b44b Gerrit-Change-Number: 10170 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Thu, 26 Jul 2018 20:46:43 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Thu Jul 26 21:16:42 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 26 Jul 2018 21:16:42 +0000 Subject: Change in osmo-mgw[master]: mgcp_network: translate payload type numbers in RTP packets In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10172 ) Change subject: mgcp_network: translate payload type numbers in RTP packets ...................................................................... Patch Set 1: Code-Review-1 (12 comments) mainly good, let's resolve the few details https://gerrit.osmocom.org/#/c/10172/1/src/libosmo-mgcp/mgcp_codec.c File src/libosmo-mgcp/mgcp_codec.c: https://gerrit.osmocom.org/#/c/10172/1/src/libosmo-mgcp/mgcp_codec.c at 345 PS1, Line 345: /* Helper function to compare two codecs, all parameters must match up, except (I also used to call everything a "helper function" until I realized *everything* except main() is a helper function, and the only meaningful part of the comment is a description of the actual API) https://gerrit.osmocom.org/#/c/10172/1/src/libosmo-mgcp/mgcp_codec.c at 370 PS1, Line 370: * \param[in] conn_src related destination rtp-connection. "conn_dst" I mean, we don't have doxygen here anyway, but if you're writing doxygen then it should be correct :) https://gerrit.osmocom.org/#/c/10172/1/src/libosmo-mgcp/mgcp_codec.c at 373 PS1, Line 373: int mgcp_codec_pt_translate(struct mgcp_conn_rtp *conn_src, the caller passes in a uint8_t payload_type and masks the returned value with 0xff into a uint8_t. Is there a good reason for this being an int param and return val? https://gerrit.osmocom.org/#/c/10172/1/src/libosmo-mgcp/mgcp_codec.c at 388 PS1, Line 388: OSMO_ASSERT(codecs_assigned < MGCP_MAX_CODECS) fix ';' and indenting of 'for' below. Shouldn't it be "<=" the max? https://gerrit.osmocom.org/#/c/10172/1/src/libosmo-mgcp/mgcp_codec.c at 401 PS1, Line 401: OSMO_ASSERT(codecs_assigned < MGCP_MAX_CODECS) same '<=' (?) and ';' and indent https://gerrit.osmocom.org/#/c/10172/1/src/libosmo-mgcp/mgcp_network.c File src/libosmo-mgcp/mgcp_network.c: https://gerrit.osmocom.org/#/c/10172/1/src/libosmo-mgcp/mgcp_network.c at 489 PS1, Line 489: OSMO_ASSERT(len >= sizeof(struct rtp_hdr)); where does the len come from? If it's a len influenced by the size of an incoming packet, we must not assert = must not kill the program if it's too small. https://gerrit.osmocom.org/#/c/10172/1/src/libosmo-mgcp/mgcp_network.c at 497 PS1, Line 497: rtp_hdr->payload_type = (uint8_t) (pt_out & 0xFF); (when casting to uint8_t, the & 0xff is implicit and your & 0xFF has no effect) https://gerrit.osmocom.org/#/c/10172/1/src/libosmo-mgcp/mgcp_network.c at 718 PS1, Line 718: * should not occurr if transcoding is consequently avoided. Until "occur" https://gerrit.osmocom.org/#/c/10172/1/src/libosmo-mgcp/mgcp_network.c at 719 PS1, Line 719: * we do not have transcoding support in osmo-mgw we can not resolve "Until we have" https://gerrit.osmocom.org/#/c/10172/1/tests/mgcp/mgcp_test.c File tests/mgcp/mgcp_test.c: https://gerrit.osmocom.org/#/c/10172/1/tests/mgcp/mgcp_test.c at 1619 PS1, Line 1619: static void test_mgcp_codec_pt_translate_pars(struct mgcp_rtp_codec *c) (looks like a static const struct implemented as a function?) https://gerrit.osmocom.org/#/c/10172/1/tests/mgcp/mgcp_test.c at 1662 PS1, Line 1662: conn_dst.end.codecs_assigned = 3; (IMHO a bit weird way of initializing three structs, but ok) https://gerrit.osmocom.org/#/c/10172/1/tests/mgcp/mgcp_test.c at 1665 PS1, Line 1665: * packet out to the destination. All we know the context for both "is"? -- To view, visit https://gerrit.osmocom.org/10172 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3a874e59fa07bcc2a67c376cafa197360036f539 Gerrit-Change-Number: 10172 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Thu, 26 Jul 2018 21:16:42 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From admin at opensuse.org Thu Jul 26 03:51:34 2018 From: admin at opensuse.org (OBS Notification) Date: Thu, 26 Jul 2018 03:51:34 +0000 Subject: Build failure of network:osmocom:nightly/libgtpnl in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <5b5aaf6d37ea7_38e581068c36875@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libgtpnl/Debian_9.0/x86_64 Package network:osmocom:nightly/libgtpnl failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly libgtpnl Last lines of build log: [ 81s] dpkg-genchanges >../libgtpnl_1.2.0_amd64.changes [ 81s] dpkg-genchanges: info: including full source code in upload [ 81s] dpkg-source --after-build BUILD [ 81s] dpkg-buildpackage: info: full upload; Debian-native package (full source is included) [ 81s] Warning: mkbaselibs missing in build root, skipping baselibs [ 81s] ... saving statistics [ 81s] ... saving built packages [ 81s] DEBS/libgtpnl_1.2.0.dsc [ 81s] DEBS/libgtpnl-dev_1.2.0_amd64.deb [ 81s] DEBS/libgtpnl1_1.2.0_amd64.deb [ 81s] DEBS/libgtpnl_1.2.0_amd64.changes [ 81s] DEBS/libgtpnl-dbg_1.2.0_amd64.deb [ 81s] DEBS/libgtpnl_1.2.0.tar.gz [ 81s] OTHER/_statistics [ 81s] [ 81s] lamb53 finished "build libgtpnl_1.2.0.dsc" at Thu Jul 26 19:52:12 UTC 2018. [ 81s] [ 81s] ### VM INTERACTION START ### [ 84s] [ 72.543717] sysrq: SysRq : Power Off [ 84s] [ 72.550820] reboot: Power down [ 84s] ### VM INTERACTION END ### [ 84s] build: extracting built packages... [ 84s] DEBS/libgtpnl_1.2.0.dsc [ 84s] DEBS/libgtpnl-dev_1.2.0_amd64.deb [ 84s] DEBS/libgtpnl1_1.2.0_amd64.deb [ 84s] DEBS/libgtpnl_1.2.0_amd64.changes [ 84s] DEBS/libgtpnl-dbg_1.2.0_amd64.deb [ 84s] DEBS/libgtpnl_1.2.0.tar.gz [ 84s] OTHER/_statistics -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Fri Jul 27 07:30:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 07:30:36 +0000 Subject: Change in osmo-bts[master]: clear GPRS indicator in SI3 while PCU is disconnected In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10170 ) Change subject: clear GPRS indicator in SI3 while PCU is disconnected ...................................................................... Patch Set 1: I'm also in favor to move encoding to libosmocore so we can share it from osmo-bts and osmo-bsc -- To view, visit https://gerrit.osmocom.org/10170 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1a6f5c636c0fe098ee31c280d4572a3f8122b44b Gerrit-Change-Number: 10170 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-CC: Harald Welte Gerrit-Comment-Date: Fri, 27 Jul 2018 07:30:36 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 07:32:40 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 07:32:40 +0000 Subject: Change in osmo-mgw[master]: mgcp_client_fsm: allow ptmap in mgcp_client_fsm as well In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10171 ) Change subject: mgcp_client_fsm: allow ptmap in mgcp_client_fsm as well ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10171 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If176a3719dd9e888da16196d5fc0bdb53cc2a5f2 Gerrit-Change-Number: 10171 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Fri, 27 Jul 2018 07:32:40 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 07:34:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 07:34:11 +0000 Subject: Change in osmo-bsc[master]: rsl: use 3GPP assigned payload type constants from libosmo-netif In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9781 ) Change subject: rsl: use 3GPP assigned payload type constants from libosmo-netif ...................................................................... rsl: use 3GPP assigned payload type constants from libosmo-netif The payload constants for AMR, EFR, GSM-FR, and GSM-HR are already defined in libosmo-netif, there is no need to re-define them locally. - include rtp.h from libosmo-netif in abis_rsl.c - remove duplicate payload type constants Change-Id: Ib6a866b29d863d6875c67748dbe6b6468941ab29 Related: OS#2728 --- M src/osmo-bsc/abis_rsl.c 1 file changed, 1 insertion(+), 5 deletions(-) Approvals: Jenkins Builder: Verified Neels Hofmeyr: Looks good to me, approved diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c index bcc56bc..d5e69ac 100644 --- a/src/osmo-bsc/abis_rsl.c +++ b/src/osmo-bsc/abis_rsl.c @@ -46,15 +46,11 @@ #include #include #include +#include #define RSL_ALLOC_SIZE 1024 #define RSL_ALLOC_HEADROOM 128 -#define RTP_PT_GSM_FULL 3 -#define RTP_PT_GSM_HALF 96 -#define RTP_PT_GSM_EFR 97 -#define RTP_PT_AMR 98 - enum sacch_deact { SACCH_NONE, SACCH_DEACTIVATE, -- To view, visit https://gerrit.osmocom.org/9781 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ib6a866b29d863d6875c67748dbe6b6468941ab29 Gerrit-Change-Number: 9781 Gerrit-PatchSet: 6 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 07:35:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 07:35:16 +0000 Subject: Change in osmo-bsc[master]: gscon: use BSS-common payload types on BSS side In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10173 ) Change subject: gscon: use BSS-common payload types on BSS side ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/10173/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/10173/1//COMMIT_MSG at 11 PS1, Line 11: IANA are you sure IANA has designated anything for the A interface? I guess you meant 3GPP? -- To view, visit https://gerrit.osmocom.org/10173 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3373876bf5430130c6509be08b5f08e724c57c7a Gerrit-Change-Number: 10173 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Harald Welte Gerrit-Comment-Date: Fri, 27 Jul 2018 07:35:16 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 07:36:38 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 07:36:38 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS: fix: pad LAPDm frames before sending via L1CTL In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10183 ) Change subject: BTS: fix: pad LAPDm frames before sending via L1CTL ...................................................................... Patch Set 2: (2 comments) https://gerrit.osmocom.org/#/c/10183/2//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/10183/2//COMMIT_MSG at 23 PS2, Line 23: pad the frames automatically, but it doesn't and shouldn't. I think OsmocomBB is padding the frames if they are too short, doesn't it? I think that may be where that assumption came from https://gerrit.osmocom.org/#/c/10183/2/bts/BTS_Tests.ttcn File bts/BTS_Tests.ttcn: https://gerrit.osmocom.org/#/c/10183/2/bts/BTS_Tests.ttcn at 3226 PS2, Line 3226: 02 0x2B -- To view, visit https://gerrit.osmocom.org/10183 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I16cba4e4179456bebabf0638760af011a27fd333 Gerrit-Change-Number: 10183 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-Comment-Date: Fri, 27 Jul 2018 07:36:38 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 07:37:00 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 07:37:00 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS: enable encryption + RLL tests for Bm (TCH/F) channels In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10184 ) Change subject: BTS: enable encryption + RLL tests for Bm (TCH/F) channels ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10184 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7c0f9f9f695e089e4a30f63ec362d1e6c18abff0 Gerrit-Change-Number: 10184 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Fri, 27 Jul 2018 07:37:00 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 07:37:34 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 07:37:34 +0000 Subject: Change in openbsc[master]: git-version-gen: Don't check for .git directory In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10144 ) Change subject: git-version-gen: Don't check for .git directory ...................................................................... git-version-gen: Don't check for .git directory This check is not in all our repos that use git-version-gen. Indeed it seems to be a leftover of openbsc where I think it wanted to ensure being called in the openbsc subfolder or something? libosmocore e.g. doesn't have it. In any case .git being a directory is not always true (if using git worktree) so remove this check. Change-Id: Ibc8c0d8e74bb03bfe87d6f8b9ef6e74c0c889d0f --- M openbsc/git-version-gen 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Neels Hofmeyr: Looks good to me, approved diff --git a/openbsc/git-version-gen b/openbsc/git-version-gen index f2ad4a7..42cf3d2 100755 --- a/openbsc/git-version-gen +++ b/openbsc/git-version-gen @@ -92,8 +92,8 @@ if test -n "$v" then : # use $v -elif test -d ./../.git \ - && v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ +elif + v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \ || git describe --abbrev=4 HEAD 2>/dev/null` \ && case $v in [0-9]*) ;; -- To view, visit https://gerrit.osmocom.org/10144 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ibc8c0d8e74bb03bfe87d6f8b9ef6e74c0c889d0f Gerrit-Change-Number: 10144 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 07:38:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 07:38:18 +0000 Subject: Change in osmo-msc[master]: vlr_access_req_fsm.c: use osmo_strlcpy and avoid compiler error In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10182 ) Change subject: vlr_access_req_fsm.c: use osmo_strlcpy and avoid compiler error ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10182 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0a17a188fc91e42e252ae4bf1d6cd0bf0e5eb077 Gerrit-Change-Number: 10182 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Fri, 27 Jul 2018 07:38:18 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 07:38:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 07:38:22 +0000 Subject: Change in osmo-msc[master]: vlr_access_req_fsm.c: use osmo_strlcpy and avoid compiler error In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10182 ) Change subject: vlr_access_req_fsm.c: use osmo_strlcpy and avoid compiler error ...................................................................... vlr_access_req_fsm.c: use osmo_strlcpy and avoid compiler error gcc 8.1.0: ../../../../src/osmo-msc/src/libvlr/vlr_access_req_fsm.c:679:3: error: ?strncpy? output may be truncated copying 15 bytes from a string of length 31 [-Werror=stringop-truncation] strncpy(par->imsi, mi_string, sizeof(par->imsi)-1); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The Mobile Identity is a union of various kinds, but the IMSI is at most 15 digits, so truncation is "intended". I hope other layers validate the correct length of an IMSI MI. Change-Id: I0a17a188fc91e42e252ae4bf1d6cd0bf0e5eb077 --- M src/libvlr/vlr_access_req_fsm.c 1 file changed, 1 insertion(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/libvlr/vlr_access_req_fsm.c b/src/libvlr/vlr_access_req_fsm.c index 79eb75f..3a0760d 100644 --- a/src/libvlr/vlr_access_req_fsm.c +++ b/src/libvlr/vlr_access_req_fsm.c @@ -676,8 +676,7 @@ mi_type = mi_lv[1] & GSM_MI_TYPE_MASK; switch (mi_type) { case GSM_MI_TYPE_IMSI: - strncpy(par->imsi, mi_string, sizeof(par->imsi)-1); - par->imsi[sizeof(par->imsi)-1] = '\0'; + osmo_strlcpy(par->imsi, mi_string, sizeof(par->imsi)); par->by_tmsi = false; break; case GSM_MI_TYPE_TMSI: -- To view, visit https://gerrit.osmocom.org/10182 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I0a17a188fc91e42e252ae4bf1d6cd0bf0e5eb077 Gerrit-Change-Number: 10182 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 07:38:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 07:38:52 +0000 Subject: Change in osmo-msc[master]: Iu MGCP: no need to loopback on the cn side In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10179 ) Change subject: Iu MGCP: no need to loopback on the cn side ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10179 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I501a7846c76dd703beb3991362b1ccbd62dfd155 Gerrit-Change-Number: 10179 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Fri, 27 Jul 2018 07:38:52 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 07:38:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 07:38:54 +0000 Subject: Change in osmo-msc[master]: Iu MGCP: no need to loopback on the cn side In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10179 ) Change subject: Iu MGCP: no need to loopback on the cn side ...................................................................... Iu MGCP: no need to loopback on the cn side Change-Id: I501a7846c76dd703beb3991362b1ccbd62dfd155 --- M src/libmsc/msc_mgcp.c 1 file changed, 0 insertions(+), 8 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/libmsc/msc_mgcp.c b/src/libmsc/msc_mgcp.c index c77e389..e261e7a 100644 --- a/src/libmsc/msc_mgcp.c +++ b/src/libmsc/msc_mgcp.c @@ -437,14 +437,6 @@ return; } - /* HACK: We put the connection in loopback mode at the beginnig to - * trick the NodeB into doing the IuUP negotiation with itsself. - * this is a hack we need because osmo-mgw does not support IuUP yet */ -#ifdef BUILD_IU - if (conn->via_ran == RAN_UTRAN_IU) - mgcp_msg.conn_mode = MGCP_CONN_LOOPBACK; -#endif - msg = mgcp_msg_gen(mgcp, &mgcp_msg); OSMO_ASSERT(msg); -- To view, visit https://gerrit.osmocom.org/10179 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I501a7846c76dd703beb3991362b1ccbd62dfd155 Gerrit-Change-Number: 10179 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 07:39:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 07:39:16 +0000 Subject: Change in osmo-msc[master]: cosmetic: typos in log and comment In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10180 ) Change subject: cosmetic: typos in log and comment ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10180 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2416d9a45e88f4317aa8e6644f5581a6f4f119c8 Gerrit-Change-Number: 10180 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Fri, 27 Jul 2018 07:39:16 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 07:39:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 07:39:17 +0000 Subject: Change in osmo-msc[master]: cosmetic: typos in log and comment In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10180 ) Change subject: cosmetic: typos in log and comment ...................................................................... cosmetic: typos in log and comment Change-Id: I2416d9a45e88f4317aa8e6644f5581a6f4f119c8 --- M src/libmsc/msc_mgcp.c 1 file changed, 6 insertions(+), 6 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/libmsc/msc_mgcp.c b/src/libmsc/msc_mgcp.c index e261e7a..f5bdeb7 100644 --- a/src/libmsc/msc_mgcp.c +++ b/src/libmsc/msc_mgcp.c @@ -315,8 +315,8 @@ } /* HACK: We put the connection in loopback mode at the beginnig to - * trick the NodeB into doing the IuUP negotiation with itsself. - * this is a hack we need because osmo-mgw does not support IuUP yet */ + * trick the hNodeB into doing the IuUP negotiation with itself. + * This is a hack we need because osmo-mgw does not support IuUP yet, see OS#2459. */ #ifdef BUILD_IU if (conn->via_ran == RAN_UTRAN_IU) mgcp_msg.conn_mode = MGCP_CONN_LOOPBACK; @@ -1044,19 +1044,19 @@ OSMO_ASSERT(conn); if (port == 0) { - LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid remote call leg port, assignmnet completion failed\n", + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid remote call leg port, assignment completion failed\n", vlr_subscr_name(conn->vsub)); return -EINVAL; } if (!addr || strlen(addr) <= 0) { - LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) missing remote call leg address, assignmnet completion failed\n", + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) missing remote call leg address, assignment completion failed\n", vlr_subscr_name(conn->vsub)); return -EINVAL; } mgcp_ctx = conn->rtp.mgcp_ctx; if (!mgcp_ctx) { - LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid mgcp context, assignmnet completion failed.\n", + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid mgcp context, assignment completion failed.\n", vlr_subscr_name(conn->vsub)); return -EINVAL; } @@ -1066,7 +1066,7 @@ conn->rtp.remote_port_ran = port; osmo_strlcpy(conn->rtp.remote_addr_ran, addr, sizeof(conn->rtp.remote_addr_ran)); - LOGP(DMGCP, LOGL_DEBUG, "(subscriber:%s) assignmnet completed, rtp %s:%d.\n", + LOGP(DMGCP, LOGL_DEBUG, "(subscriber:%s) assignment completed, rtp %s:%d.\n", vlr_subscr_name(conn->vsub), conn->rtp.remote_addr_ran, port); /* Note: We only dispatch the event if we are really waiting for the -- To view, visit https://gerrit.osmocom.org/10180 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I2416d9a45e88f4317aa8e6644f5581a6f4f119c8 Gerrit-Change-Number: 10180 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 07:39:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 07:39:32 +0000 Subject: Change in osmo-ci[master]: ansible: osmo-gsm-tester-prod: Add DHCP lease for secondary muliTRX n... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10169 ) Change subject: ansible: osmo-gsm-tester-prod: Add DHCP lease for secondary muliTRX nanobts ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10169 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3967d7b4203f5361dc03074dcd82c870d60c8aac Gerrit-Change-Number: 10169 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Fri, 27 Jul 2018 07:39:32 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 07:40:09 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 07:40:09 +0000 Subject: Change in osmo-ttcn3-hacks[master]: detect VTY TELNET port connection failures in TTCN3 tests In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10181 ) Change subject: detect VTY TELNET port connection failures in TTCN3 tests ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10181 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9acf7793d5d68aec6d087cff254a10d8b673dab1 Gerrit-Change-Number: 10181 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Fri, 27 Jul 2018 07:40:09 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 07:40:10 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 07:40:10 +0000 Subject: Change in osmo-ttcn3-hacks[master]: detect VTY TELNET port connection failures in TTCN3 tests In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10181 ) Change subject: detect VTY TELNET port connection failures in TTCN3 tests ...................................................................... detect VTY TELNET port connection failures in TTCN3 tests Pass the CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT parameter to the TELNET port by default. This allows tests to make progress into an error handling path if they are started while the osmo-* program they want to connect on VTY is not running. Observed with osmo-ggsn tests, where if the one test runs into a VTY connection failure the subsequent test would get stuck forever in a map() call on the VTY TELNET port. Change-Id: I9acf7793d5d68aec6d087cff254a10d8b673dab1 Related: OS#3149 --- M bsc/BSC_Tests.default M bts/BTS_Tests.default M ggsn_tests/GGSN_Tests.default M hlr/HLR_Tests.default M msc/MSC_Tests.default M sccp/SCCP_Tests.default M sgsn/SGSN_Tests.default M sip/SIP_Tests.default 8 files changed, 8 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc/BSC_Tests.default b/bsc/BSC_Tests.default index c13f7b0..8818359 100644 --- a/bsc/BSC_Tests.default +++ b/bsc/BSC_Tests.default @@ -15,6 +15,7 @@ *.BSCVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.BSCVTY.CTRL_READMODE := "buffered" *.BSCVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" +*.BSCVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.BSCVTY.PROMPT1 := "OsmoBSC> " [MODULE_PARAMETERS] diff --git a/bts/BTS_Tests.default b/bts/BTS_Tests.default index 502c17f..f254993 100644 --- a/bts/BTS_Tests.default +++ b/bts/BTS_Tests.default @@ -12,6 +12,7 @@ *.BTSVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.BTSVTY.CTRL_READMODE := "buffered" *.BTSVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" +*.BTSVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.BTSVTY.PROMPT1 := "OsmoBTS> " *.PCU.socket_type := "SEQPACKET" diff --git a/ggsn_tests/GGSN_Tests.default b/ggsn_tests/GGSN_Tests.default index ff0cd97..4d52e24 100644 --- a/ggsn_tests/GGSN_Tests.default +++ b/ggsn_tests/GGSN_Tests.default @@ -8,6 +8,7 @@ *.GGSNVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.GGSNVTY.CTRL_READMODE := "buffered" *.GGSNVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" +*.GGSNVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.GGSNVTY.PROMPT1 := "OsmoGGSN> " [MODULE_PARAMETERS] diff --git a/hlr/HLR_Tests.default b/hlr/HLR_Tests.default index f458479..84d4ff3 100644 --- a/hlr/HLR_Tests.default +++ b/hlr/HLR_Tests.default @@ -9,6 +9,7 @@ *.VTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.VTY.CTRL_READMODE := "buffered" *.VTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" +*.VTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.VTY.PROMPT1 := "OsmoHLR> " [MODULE_PARAMETERS] diff --git a/msc/MSC_Tests.default b/msc/MSC_Tests.default index bcaae06..a24fa38 100644 --- a/msc/MSC_Tests.default +++ b/msc/MSC_Tests.default @@ -20,6 +20,7 @@ *.MSCVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.MSCVTY.CTRL_READMODE := "buffered" *.MSCVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" +*.MSCVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.MSCVTY.PROMPT1 := "OsmoMSC> " diff --git a/sccp/SCCP_Tests.default b/sccp/SCCP_Tests.default index 7d16e5b..95e0d2f 100644 --- a/sccp/SCCP_Tests.default +++ b/sccp/SCCP_Tests.default @@ -15,6 +15,7 @@ *.SCCP_DEMO_USER_VTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.SCCP_DEMO_USER_VTY.CTRL_READMODE := "buffered" *.SCCP_DEMO_USER_VTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" +*.SCCP_DEMO_USER_VTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.SCCP_DEMO_USER_VTY.PROMPT1 := "sccp-demo-user> " [MODULE_PARAMETERS] diff --git a/sgsn/SGSN_Tests.default b/sgsn/SGSN_Tests.default index bac5fdd..3957e82 100644 --- a/sgsn/SGSN_Tests.default +++ b/sgsn/SGSN_Tests.default @@ -15,6 +15,7 @@ *.SGSNVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.SGSNVTY.CTRL_READMODE := "buffered" *.SGSNVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" +*.SGSNVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.SGSNVTY.PROMPT1 := "OsmoSGSN> " diff --git a/sip/SIP_Tests.default b/sip/SIP_Tests.default index 2576b33..4434a1a 100644 --- a/sip/SIP_Tests.default +++ b/sip/SIP_Tests.default @@ -13,6 +13,7 @@ *.SIPVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.SIPVTY.CTRL_READMODE := "buffered" *.SIPVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" +*.SIPVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.SIPVTY.PROMPT1 := "OsmoSIPcon> " *.SIP.local_sip_port := "5060" -- To view, visit https://gerrit.osmocom.org/10181 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I9acf7793d5d68aec6d087cff254a10d8b673dab1 Gerrit-Change-Number: 10181 Gerrit-PatchSet: 2 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 07:40:42 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 07:40:42 +0000 Subject: Change in libosmocore[master]: fix strncpy bugs in gsm/ipa.c In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10174 ) Change subject: fix strncpy bugs in gsm/ipa.c ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10174 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I423a24c55c9b9aa6fc8f501df94fe54c71ee2b2b Gerrit-Change-Number: 10174 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 27 Jul 2018 07:40:42 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 07:41:01 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 07:41:01 +0000 Subject: Change in libosmocore[master]: fix strncpy bugs in socket.c In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10175 ) Change subject: fix strncpy bugs in socket.c ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10175 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iddf36d26b23dcef4f9b291fd7ead1907e38c3486 Gerrit-Change-Number: 10175 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 27 Jul 2018 07:41:01 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 07:41:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 07:41:32 +0000 Subject: Change in libosmocore[master]: cosmetic: osmo-sim-test.c: use memcpy instead of strncpy In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10176 ) Change subject: cosmetic: osmo-sim-test.c: use memcpy instead of strncpy ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10176 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I8d66fa22502c04d11ae153b9856d7e54f3492dd6 Gerrit-Change-Number: 10176 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Fri, 27 Jul 2018 07:41:32 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 08:10:38 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 27 Jul 2018 08:10:38 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS: fix: pad LAPDm frames before sending via L1CTL In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/10183 ) Change subject: BTS: fix: pad LAPDm frames before sending via L1CTL ...................................................................... Patch Set 2: (2 comments) https://gerrit.osmocom.org/#/c/10183/2//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/10183/2//COMMIT_MSG at 23 PS2, Line 23: pad the frames automatically, but it doesn't and shouldn't. > I think OsmocomBB is padding the frames if they are too short, doesn't it? I think that may be where [?] It actually does, but on the higher layers. So, on L1CTL we should have already padded frames. I also just checked Calypso firmware, and there are also no checks of the length, nor padding, so the firmware can also run into the heap overflow... https://gerrit.osmocom.org/#/c/10183/2/bts/BTS_Tests.ttcn File bts/BTS_Tests.ttcn: https://gerrit.osmocom.org/#/c/10183/2/bts/BTS_Tests.ttcn at 3226 PS2, Line 3226: 02 > 0x2B Thanks! I just discovered that there is a function for doing that. I was looking for it in 'library/', but it's private and defined here... -- To view, visit https://gerrit.osmocom.org/10183 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I16cba4e4179456bebabf0638760af011a27fd333 Gerrit-Change-Number: 10183 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Fri, 27 Jul 2018 08:10:38 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 08:11:31 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 27 Jul 2018 08:11:31 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS: fix: pad LAPDm frames before sending via L1CTL In-Reply-To: References: Message-ID: Hello Stefan Sperling, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10183 to look at the new patch set (#3). Change subject: BTS: fix: pad LAPDm frames before sending via L1CTL ...................................................................... BTS: fix: pad LAPDm frames before sending via L1CTL Thanks to Stefan Sperling, a critical bug was discovered in trxcon. The problem was that length of LAPDm frames was not checked before passing them to the libosmocoding API. So, if a received LAPDm frame is shorter than expected (i.e. 23 bytes), then: - in case of xCCH, there was a heap overflow (detected by ASAN), so a short frame has been encoded together with some garbage outside the primitive buffer... - in case of FACCH, as the length != 23, a frame was recognised as a speech frame, and also encoded together with some garbage. Since the bug is fixed (OS#3415), some TTCN-3 BTS tests started to fail, because most likely it was assumed that trxcon would pad the frames automatically, but it doesn't and shouldn't. Let's automatically pad LAPDm frames with 0x2b before sending. Change-Id: I16cba4e4179456bebabf0638760af011a27fd333 Related: OS#3418 --- M bts/BTS_Tests.ttcn 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/83/10183/3 -- To view, visit https://gerrit.osmocom.org/10183 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I16cba4e4179456bebabf0638760af011a27fd333 Gerrit-Change-Number: 10183 Gerrit-PatchSet: 3 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 10:45:59 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Fri, 27 Jul 2018 10:45:59 +0000 Subject: Change in libosmocore[master]: port arfcn range encode support from osmo-bsc Message-ID: Stefan Sperling has uploaded this change for review. ( https://gerrit.osmocom.org/10185 Change subject: port arfcn range encode support from osmo-bsc ...................................................................... port arfcn range encode support from osmo-bsc As part of fixing issue OS#3075, we want to migrate support for encoding system information from osmo-bsc to libosmocore. This change ports one of the prerequisites for doing so: osmo-bsc code for range-encoding ARFCNs, including tests. A gsm48_ prefix has been prepended to public symbols in order to avoid clashes with existing symbols in osmo-bsc code. Change-Id: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c Related: OS#3075 --- A include/osmocom/gsm/gsm48_arfcn_range_encode.h M src/gsm/Makefile.am A src/gsm/gsm48_arfcn_range_encode.c M src/gsm/libosmogsm.map M tests/gsm0408/gsm0408_test.c A tests/gsm0408/gsm0408_test.err M tests/gsm0408/gsm0408_test.ok 7 files changed, 798 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/85/10185/1 diff --git a/include/osmocom/gsm/gsm48_arfcn_range_encode.h b/include/osmocom/gsm/gsm48_arfcn_range_encode.h new file mode 100644 index 0000000..d015db1 --- /dev/null +++ b/include/osmocom/gsm/gsm48_arfcn_range_encode.h @@ -0,0 +1,25 @@ +/*! \file gsm48_arfcn_range_encode.h */ + +#pragma once + +#include + +enum gsm48_range { + GSM48_ARFCN_RANGE_INVALID = -1, + GSM48_ARFCN_RANGE_128 = 127, + GSM48_ARFCN_RANGE_256 = 255, + GSM48_ARFCN_RANGE_512 = 511, + GSM48_ARFCN_RANGE_1024 = 1023, +}; + +#define GSM48_RANGE_ENC_MAX_ARFCNS 29 + +int gsm48_range_enc_determine_range(const int *arfcns, int size, int *f0_out); +int gsm48_range_enc_arfcns(enum gsm48_range rng, const int *arfcns, int sze, int *out, int idx); +int gsm48_range_enc_find_index(enum gsm48_range rng, const int *arfcns, int size); +int gsm48_range_enc_filter_arfcns(int *arfcns, const int sze, const int f0, int *f0_included); + +int gsm48_range_enc_range128(uint8_t *chan_list, int f0, int *w); +int gsm48_range_enc_range256(uint8_t *chan_list, int f0, int *w); +int gsm48_range_enc_range512(uint8_t *chan_list, int f0, int *w); +int gsm48_range_enc_range1024(uint8_t *chan_list, int f0, int f0_incl, int *w); diff --git a/src/gsm/Makefile.am b/src/gsm/Makefile.am index 5387e3a..2f06749 100644 --- a/src/gsm/Makefile.am +++ b/src/gsm/Makefile.am @@ -21,9 +21,9 @@ BUILT_SOURCES = gsm0503_conv.c libgsmint_la_SOURCES = a5.c rxlev_stat.c tlv_parser.c comp128.c comp128v23.c \ - gsm_utils.c rsl.c gsm48.c gsm48_ie.c gsm0808.c sysinfo.c \ - gprs_cipher_core.c gprs_rlc.c gsm0480.c abis_nm.c gsm0502.c \ - gsm0411_utils.c gsm0411_smc.c gsm0411_smr.c gsm0414.c \ + gsm_utils.c rsl.c gsm48.c gsm48_ie.c gsm48_arfcn_range_encode.c \ + gsm0808.c sysinfo.c gprs_cipher_core.c gprs_rlc.c gsm0480.c abis_nm.c \ + gsm0502.c gsm0411_utils.c gsm0411_smc.c gsm0411_smr.c gsm0414.c \ lapd_core.c lapdm.c kasumi.c gsm_04_08_gprs.c \ auth_core.c auth_comp128v1.c auth_comp128v23.c \ auth_milenage.c milenage/aes-encblock.c gea.c \ diff --git a/src/gsm/gsm48_arfcn_range_encode.c b/src/gsm/gsm48_arfcn_range_encode.c new file mode 100644 index 0000000..17fcbd3 --- /dev/null +++ b/src/gsm/gsm48_arfcn_range_encode.c @@ -0,0 +1,334 @@ +/* gsm 04.08 system information (si) encoding and decoding + * 3gpp ts 04.08 version 7.21.0 release 1998 / etsi ts 100 940 v7.21.0 */ + +/* + * (C) 2012 Holger Hans Peter Freyther + * (C) 2012 by On-Waves + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#include +#include + +#include +#include + +#include + +static inline int greatest_power_of_2_lesser_or_equal_to(int index) +{ + int power_of_2 = 1; + + do { + power_of_2 *= 2; + } while (power_of_2 <= index); + + /* now go back one step */ + return power_of_2 / 2; +} + +static inline int mod(int data, int range) +{ + int res = data % range; + while (res < 0) + res += range; + return res; +} + +/** + * Determine at which index to split the ARFCNs to create an + * equally size partition for the given range. Return -1 if + * no such partition exists. + */ +int gsm48_range_enc_find_index(enum gsm48_range range, const int *freqs, const int size) +{ + int i, j, n; + + const int RANGE_DELTA = (range - 1) / 2; + + for (i = 0; i < size; ++i) { + n = 0; + for (j = 0; j < size; ++j) { + if (mod(freqs[j] - freqs[i], range) <= RANGE_DELTA) + n += 1; + } + + if (n - 1 == (size - 1) / 2) + return i; + } + + return -1; +} + +/* Worker for range_enc_arfcns(), do not call directly. */ +static int _range_enc_arfcns(enum gsm48_range range, + const int *arfcns, int size, int *out, + const int index) +{ + int split_at; + int i; + + /* + * The below is a GNU extension and we can remove it when + * we move to a quicksort like in-situ swap with the pivot. + */ + int arfcns_left[size / 2]; + int arfcns_right[size / 2]; + int l_size; + int r_size; + int l_origin; + int r_origin; + + /* Now do the processing */ + split_at = gsm48_range_enc_find_index(range, arfcns, size); + if (split_at < 0) + return -EINVAL; + + /* we now know where to split */ + out[index] = 1 + arfcns[split_at]; + + /* calculate the work that needs to be done for the leafs */ + l_origin = mod(arfcns[split_at] + ((range - 1) / 2) + 1, range); + r_origin = mod(arfcns[split_at] + 1, range); + for (i = 0, l_size = 0, r_size = 0; i < size; ++i) { + if (mod(arfcns[i] - l_origin, range) < range / 2) + arfcns_left[l_size++] = mod(arfcns[i] - l_origin, range); + if (mod(arfcns[i] - r_origin, range) < range / 2) + arfcns_right[r_size++] = mod(arfcns[i] - r_origin, range); + } + + /* + * Now recurse and we need to make this iterative... but as the + * tree is balanced the stack will not be too deep. + */ + if (l_size) + gsm48_range_enc_arfcns(range / 2, arfcns_left, l_size, + out, index + greatest_power_of_2_lesser_or_equal_to(index + 1)); + if (r_size) + gsm48_range_enc_arfcns((range - 1) / 2, arfcns_right, r_size, + out, index + (2 * greatest_power_of_2_lesser_or_equal_to(index + 1))); + return 0; +} + +/** + * Range encode the ARFCN list. + * \param range The range to use. + * \param arfcns The list of ARFCNs + * \param size The size of the list of ARFCNs + * \param out Place to store the W(i) output. + */ +int gsm48_range_enc_arfcns(enum gsm48_range range, + const int *arfcns, int size, int *out, + const int index) +{ + if (size <= 0) + return 0; + + if (size == 1) { + out[index] = 1 + arfcns[0]; + return 0; + } + + return _range_enc_arfcns(range, arfcns, size, out, index); +} + +/* + * The easiest is to use f0 == arfcns[0]. This means that under certain + * circumstances we can encode less ARFCNs than possible with an optimal f0. + * + * TODO: Solve the optimisation problem and pick f0 so that the max distance + * is the smallest. Taking into account the modulo operation. I think picking + * size/2 will be the optimal arfcn. + */ +/** + * This implements the range determination as described in GSM 04.08 J4. The + * result will be a base frequency f0 and the range to use. Note that for range + * 1024 encoding f0 always refers to ARFCN 0 even if it is not an element of + * the arfcns list. + * + * \param[in] arfcns The input frequencies, they must be sorted, lowest number first + * \param[in] size The length of the array + * \param[out] f0 The selected F0 base frequency. It might not be inside the list + */ +int gsm48_range_enc_determine_range(const int *arfcns, const int size, int *f0) +{ + int max = 0; + + /* + * Go for the easiest. And pick arfcns[0] == f0. + */ + max = arfcns[size - 1] - arfcns[0]; + *f0 = arfcns[0]; + + if (max < 128 && size <= 29) + return GSM48_ARFCN_RANGE_128; + if (max < 256 && size <= 22) + return GSM48_ARFCN_RANGE_256; + if (max < 512 && size <= 18) + return GSM48_ARFCN_RANGE_512; + if (max < 1024 && size <= 17) { + *f0 = 0; + return GSM48_ARFCN_RANGE_1024; + } + + return GSM48_ARFCN_RANGE_INVALID; +} + +static void write_orig_arfcn(uint8_t *chan_list, int f0) +{ + chan_list[0] |= (f0 >> 9) & 1; + chan_list[1] = (f0 >> 1); + chan_list[2] = (f0 & 1) << 7; +} + +static void write_all_wn(uint8_t *chan_list, int bit_offs, + int *w, int w_size, int w1_len) +{ + int octet_offs = 0; /* offset into chan_list */ + int wk_len = w1_len; /* encoding size in bits of w[k] */ + int k; /* 1 based */ + int level = 0; /* tree level, top level = 0 */ + int lvl_left = 1; /* nodes per tree level */ + + /* W(2^i) to W(2^(i+1)-1) are on w1_len-i bits when present */ + + for (k = 1; k <= w_size; k++) { + int wk_left = wk_len; + DEBUGP(DLGLOBAL, + "k=%d, wk_len=%d, offs=%d:%d, level=%d, " + "lvl_left=%d\n", + k, wk_len, octet_offs, bit_offs, level, lvl_left); + + while (wk_left > 0) { + int cur_bits = 8 - bit_offs; + int cur_mask; + int wk_slice; + + if (cur_bits > wk_left) + cur_bits = wk_left; + + cur_mask = ((1 << cur_bits) - 1); + + DEBUGP(DLGLOBAL, + " wk_left=%d, cur_bits=%d, offs=%d:%d\n", + wk_left, cur_bits, octet_offs, bit_offs); + + /* advance */ + wk_left -= cur_bits; + bit_offs += cur_bits; + + /* right aligned wk data for current out octet */ + wk_slice = (w[k-1] >> wk_left) & cur_mask; + + /* cur_bits now contains the number of bits + * that are to be copied from wk to the chan_list. + * wk_left is set to the number of bits that must + * not yet be copied. + * bit_offs points after the bit area that is going to + * be overwritten: + * + * wk_left + * | + * v + * wk: WWWWWWWWWWW + * |||||<-- wk_slice, cur_bits=5 + * --WWWWW- + * ^ + * | + * bit_offs + */ + + DEBUGP(DLGLOBAL, + " wk=%02x, slice=%02x/%02x, cl=%02x\n", + w[k-1], wk_slice, cur_mask, wk_slice << (8 - bit_offs)); + + chan_list[octet_offs] &= ~(cur_mask << (8 - bit_offs)); + chan_list[octet_offs] |= wk_slice << (8 - bit_offs); + + /* adjust output */ + if (bit_offs == 8) { + bit_offs = 0; + octet_offs += 1; + } + } + + /* adjust bit sizes */ + lvl_left -= 1; + if (!lvl_left) { + /* completed tree level, advance to next */ + level += 1; + lvl_left = 1 << level; + wk_len -= 1; + } + } +} + +int gsm48_range_enc_range128(uint8_t *chan_list, int f0, int *w) +{ + chan_list[0] = 0x8C; + write_orig_arfcn(chan_list, f0); + + write_all_wn(&chan_list[2], 1, w, 28, 7); + return 0; +} + +int gsm48_range_enc_range256(uint8_t *chan_list, int f0, int *w) +{ + chan_list[0] = 0x8A; + write_orig_arfcn(chan_list, f0); + + write_all_wn(&chan_list[2], 1, w, 21, 8); + return 0; +} + +int gsm48_range_enc_range512(uint8_t *chan_list, int f0, int *w) +{ + chan_list[0] = 0x88; + write_orig_arfcn(chan_list, f0); + + write_all_wn(&chan_list[2], 1, w, 17, 9); + return 0; +} + +int gsm48_range_enc_range1024(uint8_t *chan_list, int f0, int f0_included, int *w) +{ + chan_list[0] = 0x80 | (f0_included << 2); + + write_all_wn(&chan_list[0], 6, w, 16, 10); + return 0; +} + +int gsm48_range_enc_filter_arfcns(int *arfcns, const int size, const int f0, int *f0_included) +{ + int i, j = 0; + *f0_included = 0; + + for (i = 0; i < size; ++i) { + /* + * Appendix J.4 says the following: + * All frequencies except F(0), minus F(0) + 1. + * I assume we need to exclude it here. + */ + if (arfcns[i] == f0) { + *f0_included = 1; + continue; + } + + arfcns[j++] = mod(arfcns[i] - (f0 + 1), 1024); + } + + return j; +} diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 3b403c2..9e9cd43 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -287,6 +287,14 @@ gsm48_mm_att_tlvdef; gsm48_number_of_paging_subchannels; gsm48_parse_ra; +gsm48_range_enc_determine_range; +gsm48_range_enc_arfcns; +gsm48_range_enc_find_index; +gsm48_range_enc_filter_arfcns; +gsm48_range_enc_range128; +gsm48_range_enc_range256; +gsm48_range_enc_range512; +gsm48_range_enc_range1024; gsm48_rr_att_tlvdef; gsm48_set_dtx; gsm48_dtx_mode; diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c index 2a0e661..2c00f87 100644 --- a/tests/gsm0408/gsm0408_test.c +++ b/tests/gsm0408/gsm0408_test.c @@ -25,10 +25,12 @@ #include #include #include +#include #include #include #include #include +#include static const uint8_t csd_9600_v110_lv[] = { 0x07, 0xa1, 0xb8, 0x89, 0x21, 0x15, 0x63, 0x80 }; @@ -352,13 +354,375 @@ printf("passed: [%u] %s\n", len, osmo_hexdump(buf, len)); } +struct { + int range; + int arfcns_num; + int arfcns[GSM48_RANGE_ENC_MAX_ARFCNS]; +} arfcn_test_ranges[] = { + {GSM48_ARFCN_RANGE_512, 12, + { 1, 12, 31, 51, 57, 91, 97, 98, 113, 117, 120, 125 }}, + {GSM48_ARFCN_RANGE_512, 17, + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 }}, + {GSM48_ARFCN_RANGE_512, 18, + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 }}, + {GSM48_ARFCN_RANGE_512, 18, + { 1, 17, 31, 45, 58, 79, 81, 97, + 113, 127, 213, 277, 287, 311, 331, 391, + 417, 511 }}, + {GSM48_ARFCN_RANGE_512, 6, + { 1, 17, 31, 45, 58, 79 }}, + {GSM48_ARFCN_RANGE_512, 6, + { 10, 17, 31, 45, 58, 79 }}, + {GSM48_ARFCN_RANGE_1024, 17, + { 0, 17, 31, 45, 58, 79, 81, 97, + 113, 127, 213, 277, 287, 311, 331, 391, + 1023 }}, + {GSM48_ARFCN_RANGE_1024, 16, + { 17, 31, 45, 58, 79, 81, 97, 113, + 127, 213, 277, 287, 311, 331, 391, 1023 }}, + {-1} +}; + +static int test_single_range_encoding(int range, const int *orig_arfcns, + int arfcns_num, int silent) +{ + int arfcns[GSM48_RANGE_ENC_MAX_ARFCNS]; + int w[GSM48_RANGE_ENC_MAX_ARFCNS]; + int f0_included = 0; + int rc, f0; + uint8_t chan_list[16] = {0}; + struct gsm_sysinfo_freq dec_freq[1024] = {{0}}; + int dec_arfcns[GSM48_RANGE_ENC_MAX_ARFCNS] = {0}; + int dec_arfcns_count = 0; + int arfcns_used = 0; + int i; + + arfcns_used = arfcns_num; + memmove(arfcns, orig_arfcns, sizeof(arfcns)); + + f0 = range == GSM48_ARFCN_RANGE_1024 ? 0 : arfcns[0]; + /* + * Manipulate the ARFCN list according to the rules in J4 depending + * on the selected range. + */ + arfcns_used = gsm48_range_enc_filter_arfcns(arfcns, arfcns_used, + f0, &f0_included); + + memset(w, 0, sizeof(w)); + gsm48_range_enc_arfcns(range, arfcns, arfcns_used, w, 0); + + if (!silent) + fprintf(stderr, "range=%d, arfcns_used=%d, f0=%d, f0_included=%d\n", + range, arfcns_used, f0, f0_included); + + /* Select the range and the amount of bits needed */ + switch (range) { + case GSM48_ARFCN_RANGE_128: + gsm48_range_enc_range128(chan_list, f0, w); + break; + case GSM48_ARFCN_RANGE_256: + gsm48_range_enc_range256(chan_list, f0, w); + break; + case GSM48_ARFCN_RANGE_512: + gsm48_range_enc_range512(chan_list, f0, w); + break; + case GSM48_ARFCN_RANGE_1024: + gsm48_range_enc_range1024(chan_list, f0, f0_included, w); + break; + default: + return 1; + }; + + if (!silent) + printf("chan_list = %s\n", + osmo_hexdump(chan_list, sizeof(chan_list))); + + rc = gsm48_decode_freq_list(dec_freq, chan_list, sizeof(chan_list), + 0xfe, 1); + if (rc != 0) { + printf("Cannot decode freq list, rc = %d\n", rc); + return 1; + } + + for (i = 0; i < ARRAY_SIZE(dec_freq); i++) { + if (dec_freq[i].mask && + dec_arfcns_count < ARRAY_SIZE(dec_arfcns)) + dec_arfcns[dec_arfcns_count++] = i; + } + + if (!silent) { + printf("Decoded freqs %d (expected %d)\n", + dec_arfcns_count, arfcns_num); + printf("Decoded: "); + for (i = 0; i < dec_arfcns_count; i++) { + printf("%d ", dec_arfcns[i]); + if (dec_arfcns[i] != orig_arfcns[i]) + printf("(!= %d) ", orig_arfcns[i]); + } + printf("\n"); + } + + if (dec_arfcns_count != arfcns_num) { + printf("Wrong number of arfcns\n"); + return 1; + } + + if (memcmp(dec_arfcns, orig_arfcns, sizeof(dec_arfcns)) != 0) { + printf("Decoding error, got wrong freqs\n"); + fprintf(stderr, " w = "); + for (i = 0; i < ARRAY_SIZE(w); i++) + fprintf(stderr, "%d ", w[i]); + fprintf(stderr, "\n"); + return 1; + } + + return 0; +} + +static void test_random_range_encoding(int range, int max_arfcn_num) +{ + int arfcns_num = 0; + int test_idx; + int rc, max_count; + int num_tests = 1024; + + printf("Random range test: range %d, max num ARFCNs %d\n", + range, max_arfcn_num); + + srandom(1); + + for (max_count = 1; max_count < max_arfcn_num; max_count++) { + for (test_idx = 0; test_idx < num_tests; test_idx++) { + int count; + int i; + int min_freq = 0; + + int rnd_arfcns[GSM48_RANGE_ENC_MAX_ARFCNS] = {0}; + char rnd_arfcns_set[1024] = {0}; + + if (range < GSM48_ARFCN_RANGE_1024) + min_freq = random() % (1023 - range); + + for (count = max_count; count; ) { + int arfcn = min_freq + random() % (range + 1); + OSMO_ASSERT(arfcn < ARRAY_SIZE(rnd_arfcns_set)); + + if (!rnd_arfcns_set[arfcn]) { + rnd_arfcns_set[arfcn] = 1; + count -= 1; + } + } + + arfcns_num = 0; + for (i = 0; i < ARRAY_SIZE(rnd_arfcns_set); i++) + if (rnd_arfcns_set[i]) + rnd_arfcns[arfcns_num++] = i; + + rc = test_single_range_encoding(range, rnd_arfcns, + arfcns_num, 1); + if (rc != 0) { + printf("Failed on test %d, range %d, num ARFCNs %d\n", + test_idx, range, max_count); + test_single_range_encoding(range, rnd_arfcns, + arfcns_num, 0); + return; + } + } + } +} + +static void test_range_encoding() +{ + int *arfcns; + int arfcns_num = 0; + int test_idx; + int range; + + for (test_idx = 0; arfcn_test_ranges[test_idx].arfcns_num > 0; test_idx++) + { + arfcns_num = arfcn_test_ranges[test_idx].arfcns_num; + arfcns = &arfcn_test_ranges[test_idx].arfcns[0]; + range = arfcn_test_ranges[test_idx].range; + + printf("Range test %d: range %d, num ARFCNs %d\n", + test_idx, range, arfcns_num); + + test_single_range_encoding(range, arfcns, arfcns_num, 0); + } + + test_random_range_encoding(GSM48_ARFCN_RANGE_128, 29); + test_random_range_encoding(GSM48_ARFCN_RANGE_256, 22); + test_random_range_encoding(GSM48_ARFCN_RANGE_512, 18); + test_random_range_encoding(GSM48_ARFCN_RANGE_1024, 16); +} + +static int freqs1[] = { + 12, 70, 121, 190, 250, 320, 401, 475, 520, 574, 634, 700, 764, 830, 905, 980 +}; + +static int freqs2[] = { + 402, 460, 1, 67, 131, 197, 272, 347, +}; + +static int freqs3[] = { + 68, 128, 198, 279, 353, 398, 452, + +}; + +static int w_out[] = { + 122, 2, 69, 204, 75, 66, 60, 70, 83, 3, 24, 67, 54, 64, 70, 9, +}; + +static int range128[] = { + 1, 1 + 127, +}; + +static int range256[] = { + 1, 1 + 128, +}; + +static int range512[] = { + 1, 1+ 511, +}; + + +#define VERIFY(res, cmp, wanted) \ + if (!(res cmp wanted)) { \ + printf("ASSERT failed: %s:%d Wanted: %d %s %d\n", \ + __FILE__, __LINE__, (int) res, # cmp, (int) wanted); \ + } + +static void test_arfcn_filter() +{ + int arfcns[50], i, res, f0_included; + for (i = 0; i < ARRAY_SIZE(arfcns); ++i) + arfcns[i] = (i + 1) * 2; + + /* check that the arfcn is taken out. f0_included is only set for Range1024 */ + f0_included = 24; + res = gsm48_range_enc_filter_arfcns(arfcns, ARRAY_SIZE(arfcns), + arfcns[0], &f0_included); + VERIFY(res, ==, ARRAY_SIZE(arfcns) - 1); + VERIFY(f0_included, ==, 1); + for (i = 0; i < res; ++i) + VERIFY(arfcns[i], ==, ((i+2) * 2) - (2+1)); + + /* check with range1024, ARFCN 0 is included */ + for (i = 0; i < ARRAY_SIZE(arfcns); ++i) + arfcns[i] = i * 2; + res = gsm48_range_enc_filter_arfcns(arfcns, ARRAY_SIZE(arfcns), + 0, &f0_included); + VERIFY(res, ==, ARRAY_SIZE(arfcns) - 1); + VERIFY(f0_included, ==, 1); + for (i = 0; i < res; ++i) + VERIFY(arfcns[i], ==, (i + 1) * 2 - 1); + + /* check with range1024, ARFCN 0 not included */ + for (i = 0; i < ARRAY_SIZE(arfcns); ++i) + arfcns[i] = (i + 1) * 2; + res = gsm48_range_enc_filter_arfcns(arfcns, ARRAY_SIZE(arfcns), + 0, &f0_included); + VERIFY(res, ==, ARRAY_SIZE(arfcns)); + VERIFY(f0_included, ==, 0); + for (i = 0; i < res; ++i) + VERIFY(arfcns[i], ==, ((i + 1) * 2) - 1); +} + +static void test_print_encoding() +{ + int rc; + int w[17]; + uint8_t chan_list[16]; + memset(chan_list, 0x23, sizeof(chan_list)); + + for (rc = 0; rc < ARRAY_SIZE(w); ++rc) + switch (rc % 3) { + case 0: + w[rc] = 0xAAAA; + break; + case 1: + w[rc] = 0x5555; + break; + case 2: + w[rc] = 0x9696; + break; + } + + gsm48_range_enc_range512(chan_list, (1 << 9) | 0x96, w); + + printf("Range512: %s\n", osmo_hexdump(chan_list, ARRAY_SIZE(chan_list))); +} + +static void test_si_range_helpers() +{ + int ws[(sizeof(freqs1)/sizeof(freqs1[0]))]; + int i, f0 = 0xFFFFFF; + + memset(&ws[0], 0x23, sizeof(ws)); + + i = gsm48_range_enc_find_index(1023, freqs1, ARRAY_SIZE(freqs1)); + printf("Element is: %d => freqs[i] = %d\n", i, i >= 0 ? freqs1[i] : -1); + VERIFY(i, ==, 2); + + i = gsm48_range_enc_find_index(511, freqs2, ARRAY_SIZE(freqs2)); + printf("Element is: %d => freqs[i] = %d\n", i, i >= 0 ? freqs2[i] : -1); + VERIFY(i, ==, 2); + + i = gsm48_range_enc_find_index(511, freqs3, ARRAY_SIZE(freqs3)); + printf("Element is: %d => freqs[i] = %d\n", i, i >= 0 ? freqs3[i] : -1); + VERIFY(i, ==, 0); + + gsm48_range_enc_arfcns(1023, freqs1, ARRAY_SIZE(freqs1), ws, 0); + + for (i = 0; i < sizeof(freqs1)/sizeof(freqs1[0]); ++i) { + printf("w[%d]=%d\n", i, ws[i]); + VERIFY(ws[i], ==, w_out[i]); + } + + i = gsm48_range_enc_determine_range(range128, ARRAY_SIZE(range128), &f0); + VERIFY(i, ==, GSM48_ARFCN_RANGE_128); + VERIFY(f0, ==, 1); + + i = gsm48_range_enc_determine_range(range256, ARRAY_SIZE(range256), &f0); + VERIFY(i, ==, GSM48_ARFCN_RANGE_256); + VERIFY(f0, ==, 1); + + i = gsm48_range_enc_determine_range(range512, ARRAY_SIZE(range512), &f0); + VERIFY(i, ==, GSM48_ARFCN_RANGE_512); + VERIFY(f0, ==, 1); +} + +enum { + DMAIN, +}; + +static const struct log_info_cat default_categories[] = { + [DMAIN] = { + .name = "DMAIN", + .description = "Main", + .enabled = 1, .loglevel = LOGL_DEBUG, + }, +}; + +static const struct log_info log_info = { + .cat = default_categories, + .num_cat = ARRAY_SIZE(default_categories), +}; + int main(int argc, char **argv) { + log_init(&log_info, NULL); + test_bearer_cap(); test_mid_from_tmsi(); test_mid_from_imsi(); test_ra_cap(); test_lai_encode_decode(); + test_si_range_helpers(); + test_arfcn_filter(); + test_print_encoding(); + test_range_encoding(); + return EXIT_SUCCESS; } diff --git a/tests/gsm0408/gsm0408_test.err b/tests/gsm0408/gsm0408_test.err new file mode 100644 index 0000000..06c8edb --- /dev/null +++ b/tests/gsm0408/gsm0408_test.err @@ -0,0 +1,8 @@ +range=511, arfcns_used=11, f0=1, f0_included=1 +range=511, arfcns_used=16, f0=1, f0_included=1 +range=511, arfcns_used=17, f0=1, f0_included=1 +range=511, arfcns_used=17, f0=1, f0_included=1 +range=511, arfcns_used=5, f0=1, f0_included=1 +range=511, arfcns_used=5, f0=10, f0_included=1 +range=1023, arfcns_used=16, f0=0, f0_included=1 +range=1023, arfcns_used=16, f0=0, f0_included=0 diff --git a/tests/gsm0408/gsm0408_test.ok b/tests/gsm0408/gsm0408_test.ok index c1d6a70..c482844 100644 --- a/tests/gsm0408/gsm0408_test.ok +++ b/tests/gsm0408/gsm0408_test.ok @@ -145,3 +145,59 @@ Encoded 21 63 54 00 17 gsm48_decode_lai2() gives 123-456-23 (3-digit MNC) passed +Element is: 2 => freqs[i] = 121 +Element is: 2 => freqs[i] = 1 +Element is: 0 => freqs[i] = 68 +w[0]=122 +w[1]=2 +w[2]=69 +w[3]=204 +w[4]=75 +w[5]=66 +w[6]=60 +w[7]=70 +w[8]=83 +w[9]=3 +w[10]=24 +w[11]=67 +w[12]=54 +w[13]=64 +w[14]=70 +w[15]=9 +Range512: 89 4b 2a 95 65 95 55 2c a9 55 aa 55 6a 95 59 55 +Range test 0: range 511, num ARFCNs 12 +chan_list = 88 00 98 34 85 36 7c 50 22 dc 5e ec 00 00 00 00 +Decoded freqs 12 (expected 12) +Decoded: 1 12 31 51 57 91 97 98 113 117 120 125 +Range test 1: range 511, num ARFCNs 17 +chan_list = 88 00 82 7f 01 3f 7e 04 0b ff ff fc 10 41 07 e0 +Decoded freqs 17 (expected 17) +Decoded: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 +Range test 2: range 511, num ARFCNs 18 +chan_list = 88 00 82 7f 01 7f 7e 04 0b ff ff fc 10 41 07 ff +Decoded freqs 18 (expected 18) +Decoded: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 +Range test 3: range 511, num ARFCNs 18 +chan_list = 88 00 94 3a 44 32 d7 2a 43 2a 13 94 e5 38 39 f6 +Decoded freqs 18 (expected 18) +Decoded: 1 17 31 45 58 79 81 97 113 127 213 277 287 311 331 391 417 511 +Range test 4: range 511, num ARFCNs 6 +chan_list = 88 00 8b 3c 88 b9 6b 00 00 00 00 00 00 00 00 00 +Decoded freqs 6 (expected 6) +Decoded: 1 17 31 45 58 79 +Range test 5: range 511, num ARFCNs 6 +chan_list = 88 05 08 fc 88 b9 6b 00 00 00 00 00 00 00 00 00 +Decoded freqs 6 (expected 6) +Decoded: 10 17 31 45 58 79 +Range test 6: range 1023, num ARFCNs 17 +chan_list = 84 71 e4 ab b9 58 05 cb 39 17 fd b0 75 62 0f 2f +Decoded freqs 17 (expected 17) +Decoded: 0 17 31 45 58 79 81 97 113 127 213 277 287 311 331 391 1023 +Range test 7: range 1023, num ARFCNs 16 +chan_list = 80 71 e4 ab b9 58 05 cb 39 17 fd b0 75 62 0f 2f +Decoded freqs 16 (expected 16) +Decoded: 17 31 45 58 79 81 97 113 127 213 277 287 311 331 391 1023 +Random range test: range 127, max num ARFCNs 29 +Random range test: range 255, max num ARFCNs 22 +Random range test: range 511, max num ARFCNs 18 +Random range test: range 1023, max num ARFCNs 16 -- To view, visit https://gerrit.osmocom.org/10185 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c Gerrit-Change-Number: 10185 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 10:47:10 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Fri, 27 Jul 2018 10:47:10 +0000 Subject: Change in osmo-bts[master]: clear GPRS indicator in SI3 while PCU is disconnected In-Reply-To: References: Message-ID: Stefan Sperling has posted comments on this change. ( https://gerrit.osmocom.org/10170 ) Change subject: clear GPRS indicator in SI3 while PCU is disconnected ...................................................................... Patch Set 1: > Patch Set 1: > > I'm also in favor to move encoding to libosmocore so we can share it from osmo-bts and osmo-bsc OK, I'll port the code from osmo-bsc to libosmocore. This will take several steps. Here is step one: https://gerrit.osmocom.org/c/libosmocore/+/10185 -- To view, visit https://gerrit.osmocom.org/10170 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1a6f5c636c0fe098ee31c280d4572a3f8122b44b Gerrit-Change-Number: 10170 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Stefan Sperling Gerrit-CC: Harald Welte Gerrit-Comment-Date: Fri, 27 Jul 2018 10:47:10 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 10:51:33 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Fri, 27 Jul 2018 10:51:33 +0000 Subject: Change in libosmocore[master]: port arfcn range encode support from osmo-bsc In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10185 to look at the new patch set (#2). Change subject: port arfcn range encode support from osmo-bsc ...................................................................... port arfcn range encode support from osmo-bsc As part of fixing issue OS#3075, we want to migrate support for encoding system information from osmo-bsc to libosmocore. This change ports one of the prerequisites for doing so: osmo-bsc code for range-encoding ARFCNs, including tests. A gsm48_ prefix has been prepended to public symbols in order to avoid clashes with existing symbols in osmo-bsc code. Change-Id: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c Related: OS#3075 --- M include/Makefile.am A include/osmocom/gsm/gsm48_arfcn_range_encode.h M src/gsm/Makefile.am A src/gsm/gsm48_arfcn_range_encode.c M src/gsm/libosmogsm.map M tests/gsm0408/gsm0408_test.c A tests/gsm0408/gsm0408_test.err M tests/gsm0408/gsm0408_test.ok 8 files changed, 799 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/85/10185/2 -- To view, visit https://gerrit.osmocom.org/10185 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c Gerrit-Change-Number: 10185 Gerrit-PatchSet: 2 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 10:59:17 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 27 Jul 2018 10:59:17 +0000 Subject: Change in osmo-bsc[master]: gscon: use BSS-common payload types on BSS side In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10173 to look at the new patch set (#2). Change subject: gscon: use BSS-common payload types on BSS side ...................................................................... gscon: use BSS-common payload types on BSS side In cases where a codec has no fixed (IANA) payload type number, a dynamically coosen payload type number is used. For the route between BSC and MSC 3GPP as designated certain payload type numbers. However, beond that, those payload type numbers may not necessarly apply. The RTP communication between BTS and BSC still might run on a completely different payload type number. libosmo-netif contains a header file which payload type numbers shall be used. Lets use those in order to signal the same payload type numbers as we actually use in the RTP packets to the MGW. Change-Id: I3373876bf5430130c6509be08b5f08e724c57c7a Depends: osmo-mgw If176a3719dd9e888da16196d5fc0bdb53cc2a5f2 Related: OS#2728 Related: OS#3384 --- M include/osmocom/bsc/bsc_subscr_conn_fsm.h M src/osmo-bsc/bsc_subscr_conn_fsm.c M src/osmo-bsc/osmo_bsc_lcls.c 3 files changed, 37 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/73/10173/2 -- To view, visit https://gerrit.osmocom.org/10173 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3373876bf5430130c6509be08b5f08e724c57c7a Gerrit-Change-Number: 10173 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 11:01:27 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 27 Jul 2018 11:01:27 +0000 Subject: Change in osmo-bsc[master]: gscon: use BSS-common payload types on BSS side In-Reply-To: References: Message-ID: dexter has posted comments on this change. ( https://gerrit.osmocom.org/10173 ) Change subject: gscon: use BSS-common payload types on BSS side ...................................................................... Patch Set 2: > (1 comment) Thanks for catching that. I meant 3GPP. -- To view, visit https://gerrit.osmocom.org/10173 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3373876bf5430130c6509be08b5f08e724c57c7a Gerrit-Change-Number: 10173 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-CC: Harald Welte Gerrit-Comment-Date: Fri, 27 Jul 2018 11:01:27 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 11:37:21 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 27 Jul 2018 11:37:21 +0000 Subject: Change in osmo-mgw[master]: mgcp_network: translate payload type numbers in RTP packets In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10172 to look at the new patch set (#2). Change subject: mgcp_network: translate payload type numbers in RTP packets ...................................................................... mgcp_network: translate payload type numbers in RTP packets Since no transcoding is in place osmo-mgw forwards the incoming rtp packets as they are (there may be minor modifications of the header) from an ingress connection to an egress connection. This works without problems as long as both connections use the same payload type. For IANA defined fixed payload type numbers this is usually the case, but for dynemic payload type numbers both ends may set up the same codecs but with different payload type numbers. When different payload type numbers are set up, and the packet is passed through without modification, it will have the wrong payload type when it is sent. The receiving end may then toss the packet since it expects packets with the payload type it has configured. The machanism, which is introduced with this patch looks up actual codec inside the struct data of the ingress connection and then looks for the matching codec in the struct data of the egress connection. When it finds the codec there it looks up the payload type of this codec. The header of the RTP packet is then patched with the correct payoad type. - Add function mgcp_codec_pt_translate() to look up the payload type - Add unit-test for function mgcp_codec_pt_translate() - Add payload type translation to mgcp_network.c Change-Id: I3a874e59fa07bcc2a67c376cafa197360036f539 Related: OS#2728 Related: OS#3384 --- M include/osmocom/mgcp/mgcp_codec.h M src/libosmo-mgcp/mgcp_codec.c M src/libosmo-mgcp/mgcp_network.c M tests/mgcp/mgcp_test.c 4 files changed, 204 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/72/10172/2 -- To view, visit https://gerrit.osmocom.org/10172 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3a874e59fa07bcc2a67c376cafa197360036f539 Gerrit-Change-Number: 10172 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 11:48:40 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 27 Jul 2018 11:48:40 +0000 Subject: Change in osmo-mgw[master]: mgcp_network: translate payload type numbers in RTP packets In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10172 to look at the new patch set (#3). Change subject: mgcp_network: translate payload type numbers in RTP packets ...................................................................... mgcp_network: translate payload type numbers in RTP packets Since no transcoding is in place osmo-mgw forwards the incoming rtp packets as they are (there may be minor modifications of the header) from an ingress connection to an egress connection. This works without problems as long as both connections use the same payload type. For IANA defined fixed payload type numbers this is usually the case, but for dynemic payload type numbers both ends may set up the same codecs but with different payload type numbers. When different payload type numbers are set up, and the packet is passed through without modification, it will have the wrong payload type when it is sent. The receiving end may then toss the packet since it expects packets with the payload type it has configured. The machanism, which is introduced with this patch looks up actual codec inside the struct data of the ingress connection and then looks for the matching codec in the struct data of the egress connection. When it finds the codec there it looks up the payload type of this codec. The header of the RTP packet is then patched with the correct payoad type. - Add function mgcp_codec_pt_translate() to look up the payload type - Add unit-test for function mgcp_codec_pt_translate() - Add payload type translation to mgcp_network.c Change-Id: I3a874e59fa07bcc2a67c376cafa197360036f539 Related: OS#2728 Related: OS#3384 --- M include/osmocom/mgcp/mgcp_codec.h M src/libosmo-mgcp/mgcp_codec.c M src/libosmo-mgcp/mgcp_network.c M tests/mgcp/mgcp_test.c 4 files changed, 203 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/72/10172/3 -- To view, visit https://gerrit.osmocom.org/10172 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3a874e59fa07bcc2a67c376cafa197360036f539 Gerrit-Change-Number: 10172 Gerrit-PatchSet: 3 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 12:11:09 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Jul 2018 12:11:09 +0000 Subject: Change in osmo-bsc[master]: add gsm_timers, for Tnnn definitions usable by FSMs In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9670 to look at the new patch set (#16). Change subject: add gsm_timers, for Tnnn definitions usable by FSMs ...................................................................... add gsm_timers, for Tnnn definitions usable by FSMs Change-Id: If212fcd042051b6fa53484254223614c5b93a9c6 --- M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/gsm_data.h A include/osmocom/bsc/gsm_timers.h M src/ipaccess/Makefile.am M src/osmo-bsc/Makefile.am M src/osmo-bsc/abis_om2000.c M src/osmo-bsc/abis_rsl.c M src/osmo-bsc/bsc_subscr_conn_fsm.c M src/osmo-bsc/bsc_vty.c M src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c M src/osmo-bsc/bts_siemens_bs11.c M src/osmo-bsc/gsm_data.c A src/osmo-bsc/gsm_timers.c A src/osmo-bsc/gsm_timers_vty.c M src/osmo-bsc/net_init.c M src/osmo-bsc/paging.c M src/utils/Makefile.am M tests/abis/Makefile.am M tests/bsc/Makefile.am M tests/gsm0408/Makefile.am M tests/handover/Makefile.am M tests/nanobts_omlattr/Makefile.am M tests/nanobts_omlattr/nanobts_omlattr_test.c 23 files changed, 513 insertions(+), 180 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/70/9670/16 -- To view, visit https://gerrit.osmocom.org/9670 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If212fcd042051b6fa53484254223614c5b93a9c6 Gerrit-Change-Number: 9670 Gerrit-PatchSet: 16 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 12:11:09 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Jul 2018 12:11:09 +0000 Subject: Change in osmo-bsc[master]: cosmetic: rename bsc_api.h to gsm_08_08.h In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10148 to look at the new patch set (#4). Change subject: cosmetic: rename bsc_api.h to gsm_08_08.h ...................................................................... cosmetic: rename bsc_api.h to gsm_08_08.h See also I91922f557072d0fb8cfe213a8a7b50f3bb23dea0, which renames osmo_bsc_api.c to gsm_08_08.c. Change-Id: I7179eb27183ee213f8fc8d548895b67aa43dc6a2 --- M include/osmocom/bsc/Makefile.am R include/osmocom/bsc/gsm_08_08.h M src/osmo-bsc/abis_rsl.c M src/osmo-bsc/assignment_fsm.c M src/osmo-bsc/bsc_subscr_conn_fsm.c M src/osmo-bsc/gsm_04_08_rr.c M src/osmo-bsc/osmo_bsc_api.c M src/osmo-bsc/paging.c M tests/handover/handover_test.c 9 files changed, 8 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/48/10148/4 -- To view, visit https://gerrit.osmocom.org/10148 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7179eb27183ee213f8fc8d548895b67aa43dc6a2 Gerrit-Change-Number: 10148 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 12:11:17 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Jul 2018 12:11:17 +0000 Subject: Change in osmo-bsc[master]: fix nanobts: timeslot FSM: use flags to remember OML, RSL status Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10186 Change subject: fix nanobts: timeslot FSM: use flags to remember OML,RSL status ...................................................................... fix nanobts: timeslot FSM: use flags to remember OML,RSL status Before this patch, the timeslot FSM receives OML and RSL ready events. Afterwards, it relies on examining the RSL and OML status to match the received events. This doesn't work for the ip.access nanobts, which fails to change the CHANNEL OM's operational status even though it has sent an Opstart ACK. We receive OML CHANNEL Opstart ACK, but the mo's state left at OP_STATE=Disabled. We apparently cannot rely on the gsm_abis_mo state as assumed before this patch, since changing the state depends on each BTS vendor's OML implementation. Also, implementation wise, it is better to not include assumptions on RSL and OML implementations in the timeslot FSM. Simply receive the OML and RSL ready events and remember that they arrived in dedicated flags. Remove the no longer needed oml_is_ts_ready() callback from struct gsm_bts_model added in: commit 91aa68f762218906e45be4817c6ea54b480da5e1 "dyn TS: init only when both RSL and the Channel OM are established" I99f29d2ba079f6f4b77f0af12d9784588d2f56b3 This keeps osmo-bts operational while fixing ip.access nanobts, where the CHANNEL OM's state prevented the timeslot FSM from entering operation. Change-Id: I4843d03b3237cdcca0ad2041ef6895ff253d8419 --- M include/osmocom/bsc/gsm_data.h M src/osmo-bsc/bts_ericsson_rbs2000.c M src/osmo-bsc/bts_ipaccess_nanobts.c M src/osmo-bsc/timeslot_fsm.c M tests/handover/handover_test.c 5 files changed, 12 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/86/10186/1 diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index ce563ef..750c027 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -605,6 +605,11 @@ * enters IN_USE state, i.e. after each TCH use we try to PDCH ACT once again. */ bool pdch_act_allowed; + /* Whether TS_EV_OML_READY was received */ + bool is_oml_ready; + /* Whether TS_EV_RSL_READY was received */ + bool is_rsl_ready; + struct gsm_abis_mo mo; struct tlv_parsed nm_attr; uint8_t nm_chan_comb; @@ -739,7 +744,6 @@ int (*start)(struct gsm_network *net); int (*oml_rcvmsg)(struct msgb *msg); char * (*oml_status)(const struct gsm_bts *bts); - bool (*oml_is_ts_ready)(const struct gsm_bts_trx_ts *ts); void (*e1line_bind_ops)(struct e1inp_line *line); diff --git a/src/osmo-bsc/bts_ericsson_rbs2000.c b/src/osmo-bsc/bts_ericsson_rbs2000.c index c2975f4..ed3db93 100644 --- a/src/osmo-bsc/bts_ericsson_rbs2000.c +++ b/src/osmo-bsc/bts_ericsson_rbs2000.c @@ -175,17 +175,11 @@ e1inp_line_bind_ops(line, &bts_isdn_e1inp_line_ops); } -static bool bts_model_rbs2k_is_ts_ready(const struct gsm_bts_trx_ts *ts) -{ - return ts && ts->mo.nm_state.operational == NM_OPSTATE_ENABLED; -} - static struct gsm_bts_model model_rbs2k = { .type = GSM_BTS_TYPE_RBS2000, .name = "rbs2000", .start = bts_model_rbs2k_start, .oml_rcvmsg = &abis_om2k_rcvmsg, - .oml_is_ts_ready = bts_model_rbs2k_is_ts_ready, .config_write_bts = &config_write_bts, .e1line_bind_ops = &bts_model_rbs2k_e1line_bind_ops, }; diff --git a/src/osmo-bsc/bts_ipaccess_nanobts.c b/src/osmo-bsc/bts_ipaccess_nanobts.c index 6b6e265..80f7c9c 100644 --- a/src/osmo-bsc/bts_ipaccess_nanobts.c +++ b/src/osmo-bsc/bts_ipaccess_nanobts.c @@ -55,18 +55,12 @@ return "disconnected"; } -static bool oml_is_ts_ready(const struct gsm_bts_trx_ts *ts) -{ - return ts && ts->mo.nm_state.operational == NM_OPSTATE_ENABLED; -} - struct gsm_bts_model bts_model_nanobts = { .type = GSM_BTS_TYPE_NANOBTS, .name = "nanobts", .start = bts_model_nanobts_start, .oml_rcvmsg = &abis_nm_rcvmsg, .oml_status = &get_oml_status, - .oml_is_ts_ready = oml_is_ts_ready, .e1line_bind_ops = bts_model_nanobts_e1line_bind_ops, .nm_att_tlvdef = { .def = { diff --git a/src/osmo-bsc/timeslot_fsm.c b/src/osmo-bsc/timeslot_fsm.c index 7638f1f..09811d1 100644 --- a/src/osmo-bsc/timeslot_fsm.c +++ b/src/osmo-bsc/timeslot_fsm.c @@ -220,13 +220,13 @@ static void ts_fsm_not_initialized(struct osmo_fsm_inst *fi, uint32_t event, void *data) { struct gsm_bts_trx_ts *ts = ts_fi_ts(fi); - struct gsm_bts *bts = ts->trx->bts; switch (event) { case TS_EV_OML_READY: ts->pdch_act_allowed = true; + ts->is_oml_ready = true; ts_setup_lchans(ts); - if (!ts->trx->rsl_link) { + if (!ts->is_rsl_ready) { LOG_TS(ts, LOGL_DEBUG, "No RSL link yet\n"); return; } @@ -235,8 +235,8 @@ case TS_EV_RSL_READY: ts->pdch_act_allowed = true; - if (bts->model->oml_is_ts_ready - && !bts->model->oml_is_ts_ready(ts)) { + ts->is_rsl_ready = true; + if (!ts->is_oml_ready) { LOG_TS(ts, LOGL_DEBUG, "OML not ready yet\n"); return; } @@ -680,6 +680,7 @@ struct gsm_bts_trx_ts *ts = ts_fi_ts(fi); switch (event) { case TS_EV_OML_DOWN: + ts->is_oml_ready = false; if (fi->state != TS_ST_NOT_INITIALIZED) osmo_fsm_inst_state_chg(fi, TS_ST_NOT_INITIALIZED, 0, 0); OSMO_ASSERT(fi->state == TS_ST_NOT_INITIALIZED); @@ -689,6 +690,7 @@ break; case TS_EV_RSL_DOWN: + ts->is_rsl_ready = false; if (fi->state != TS_ST_NOT_INITIALIZED) osmo_fsm_inst_state_chg(fi, TS_ST_NOT_INITIALIZED, 0, 0); OSMO_ASSERT(fi->state == TS_ST_NOT_INITIALIZED); diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c index 3a5748e..172e620 100644 --- a/tests/handover/handover_test.c +++ b/tests/handover/handover_test.c @@ -210,6 +210,7 @@ for (i = 0; i < ARRAY_SIZE(bts->c0->ts); i++) { /* make sure ts->lchans[] get initialized */ + osmo_fsm_inst_dispatch(bts->c0->ts[i].fi, TS_EV_RSL_READY, 0); osmo_fsm_inst_dispatch(bts->c0->ts[i].fi, TS_EV_OML_READY, 0); } return bts; -- To view, visit https://gerrit.osmocom.org/10186 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I4843d03b3237cdcca0ad2041ef6895ff253d8419 Gerrit-Change-Number: 10186 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 12:36:21 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 27 Jul 2018 12:36:21 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS: fix: pad LAPDm frames before sending via L1CTL In-Reply-To: References: Message-ID: Hello Stefan Sperling, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10183 to look at the new patch set (#4). Change subject: BTS: fix: pad LAPDm frames before sending via L1CTL ...................................................................... BTS: fix: pad LAPDm frames before sending via L1CTL Thanks to Stefan Sperling, a critical bug was discovered in trxcon. The problem was that length of LAPDm frames was not checked before passing them to the libosmocoding API. So, if a received LAPDm frame is shorter than expected (i.e. 23 bytes), then: - in case of xCCH, there was a heap overflow (detected by ASAN), so a short frame has been encoded together with some garbage outside the primitive buffer... - in case of FACCH, as the length != 23, a frame was recognised as a speech frame, and also encoded together with some garbage. Since the bug is fixed (OS#3415), some TTCN-3 BTS tests started to fail, because most likely it was assumed that trxcon would pad the frames automatically, but it doesn't and shouldn't. Let's automatically pad LAPDm frames with 0x2b before sending. Change-Id: I16cba4e4179456bebabf0638760af011a27fd333 Related: OS#3418 --- M bts/BTS_Tests.ttcn 1 file changed, 8 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/83/10183/4 -- To view, visit https://gerrit.osmocom.org/10183 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I16cba4e4179456bebabf0638760af011a27fd333 Gerrit-Change-Number: 10183 Gerrit-PatchSet: 4 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 13:01:26 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Jul 2018 13:01:26 +0000 Subject: Change in osmo-ttcn3-hacks[master]: Revert "detect VTY TELNET port connection failures in TTCN3 tests" Message-ID: Hello Stefan Sperling, Harald Welte, Jenkins Builder, I'd like you to do a code review. Please visit https://gerrit.osmocom.org/10187 to review the following change. Change subject: Revert "detect VTY TELNET port connection failures in TTCN3 tests" ...................................................................... Revert "detect VTY TELNET port connection failures in TTCN3 tests" With this patch, I see all ttcn3-bsc-tests failing with "Verdict: fail reason: VTY Timeout for prompt" This reverts commit cb111b21aba1d5881da1a1d3f19754cbd15b3779. Change-Id: I215d7ab5eee75cf6d3afaac760af64356c943140 --- M bsc/BSC_Tests.default M bts/BTS_Tests.default M ggsn_tests/GGSN_Tests.default M hlr/HLR_Tests.default M msc/MSC_Tests.default M sccp/SCCP_Tests.default M sgsn/SGSN_Tests.default M sip/SIP_Tests.default 8 files changed, 0 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/87/10187/1 diff --git a/bsc/BSC_Tests.default b/bsc/BSC_Tests.default index 8818359..c13f7b0 100644 --- a/bsc/BSC_Tests.default +++ b/bsc/BSC_Tests.default @@ -15,7 +15,6 @@ *.BSCVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.BSCVTY.CTRL_READMODE := "buffered" *.BSCVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" -*.BSCVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.BSCVTY.PROMPT1 := "OsmoBSC> " [MODULE_PARAMETERS] diff --git a/bts/BTS_Tests.default b/bts/BTS_Tests.default index f254993..502c17f 100644 --- a/bts/BTS_Tests.default +++ b/bts/BTS_Tests.default @@ -12,7 +12,6 @@ *.BTSVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.BTSVTY.CTRL_READMODE := "buffered" *.BTSVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" -*.BTSVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.BTSVTY.PROMPT1 := "OsmoBTS> " *.PCU.socket_type := "SEQPACKET" diff --git a/ggsn_tests/GGSN_Tests.default b/ggsn_tests/GGSN_Tests.default index 4d52e24..ff0cd97 100644 --- a/ggsn_tests/GGSN_Tests.default +++ b/ggsn_tests/GGSN_Tests.default @@ -8,7 +8,6 @@ *.GGSNVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.GGSNVTY.CTRL_READMODE := "buffered" *.GGSNVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" -*.GGSNVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.GGSNVTY.PROMPT1 := "OsmoGGSN> " [MODULE_PARAMETERS] diff --git a/hlr/HLR_Tests.default b/hlr/HLR_Tests.default index 84d4ff3..f458479 100644 --- a/hlr/HLR_Tests.default +++ b/hlr/HLR_Tests.default @@ -9,7 +9,6 @@ *.VTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.VTY.CTRL_READMODE := "buffered" *.VTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" -*.VTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.VTY.PROMPT1 := "OsmoHLR> " [MODULE_PARAMETERS] diff --git a/msc/MSC_Tests.default b/msc/MSC_Tests.default index a24fa38..bcaae06 100644 --- a/msc/MSC_Tests.default +++ b/msc/MSC_Tests.default @@ -20,7 +20,6 @@ *.MSCVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.MSCVTY.CTRL_READMODE := "buffered" *.MSCVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" -*.MSCVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.MSCVTY.PROMPT1 := "OsmoMSC> " diff --git a/sccp/SCCP_Tests.default b/sccp/SCCP_Tests.default index 95e0d2f..7d16e5b 100644 --- a/sccp/SCCP_Tests.default +++ b/sccp/SCCP_Tests.default @@ -15,7 +15,6 @@ *.SCCP_DEMO_USER_VTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.SCCP_DEMO_USER_VTY.CTRL_READMODE := "buffered" *.SCCP_DEMO_USER_VTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" -*.SCCP_DEMO_USER_VTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.SCCP_DEMO_USER_VTY.PROMPT1 := "sccp-demo-user> " [MODULE_PARAMETERS] diff --git a/sgsn/SGSN_Tests.default b/sgsn/SGSN_Tests.default index 3957e82..bac5fdd 100644 --- a/sgsn/SGSN_Tests.default +++ b/sgsn/SGSN_Tests.default @@ -15,7 +15,6 @@ *.SGSNVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.SGSNVTY.CTRL_READMODE := "buffered" *.SGSNVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" -*.SGSNVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.SGSNVTY.PROMPT1 := "OsmoSGSN> " diff --git a/sip/SIP_Tests.default b/sip/SIP_Tests.default index 4434a1a..2576b33 100644 --- a/sip/SIP_Tests.default +++ b/sip/SIP_Tests.default @@ -13,7 +13,6 @@ *.SIPVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.SIPVTY.CTRL_READMODE := "buffered" *.SIPVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" -*.SIPVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.SIPVTY.PROMPT1 := "OsmoSIPcon> " *.SIP.local_sip_port := "5060" -- To view, visit https://gerrit.osmocom.org/10187 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I215d7ab5eee75cf6d3afaac760af64356c943140 Gerrit-Change-Number: 10187 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 13:01:29 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Jul 2018 13:01:29 +0000 Subject: Change in osmo-ttcn3-hacks[master]: detect VTY TELNET port connection failures in TTCN3 tests In-Reply-To: References: Message-ID: Neels Hofmeyr has reverted this change. ( https://gerrit.osmocom.org/10181 ) Change subject: detect VTY TELNET port connection failures in TTCN3 tests ...................................................................... -- To view, visit https://gerrit.osmocom.org/10181 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: revert Gerrit-Change-Id: I9acf7793d5d68aec6d087cff254a10d8b673dab1 Gerrit-Change-Number: 10181 Gerrit-PatchSet: 2 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 13:01:55 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Jul 2018 13:01:55 +0000 Subject: Change in osmo-ttcn3-hacks[master]: Revert "detect VTY TELNET port connection failures in TTCN3 tests" In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10187 ) Change subject: Revert "detect VTY TELNET port connection failures in TTCN3 tests" ...................................................................... Patch Set 1: but if it's just a config file update that's needed, we might as well merge that instead of this revert -- To view, visit https://gerrit.osmocom.org/10187 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I215d7ab5eee75cf6d3afaac760af64356c943140 Gerrit-Change-Number: 10187 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Stefan Sperling Gerrit-Comment-Date: Fri, 27 Jul 2018 13:01:55 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 13:03:01 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 13:03:01 +0000 Subject: Change in osmo-ttcn3-hacks[master]: Revert "detect VTY TELNET port connection failures in TTCN3 tests" In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10187 ) Change subject: Revert "detect VTY TELNET port connection failures in TTCN3 tests" ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10187 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I215d7ab5eee75cf6d3afaac760af64356c943140 Gerrit-Change-Number: 10187 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Stefan Sperling Gerrit-Comment-Date: Fri, 27 Jul 2018 13:03:01 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 13:04:12 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Jul 2018 13:04:12 +0000 Subject: Change in osmo-ttcn3-hacks[master]: Revert "detect VTY TELNET port connection failures in TTCN3 tests" In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10187 ) Change subject: Revert "detect VTY TELNET port connection failures in TTCN3 tests" ...................................................................... Revert "detect VTY TELNET port connection failures in TTCN3 tests" With this patch, I see all ttcn3-bsc-tests failing with "Verdict: fail reason: VTY Timeout for prompt" This reverts commit cb111b21aba1d5881da1a1d3f19754cbd15b3779. Change-Id: I215d7ab5eee75cf6d3afaac760af64356c943140 --- M bsc/BSC_Tests.default M bts/BTS_Tests.default M ggsn_tests/GGSN_Tests.default M hlr/HLR_Tests.default M msc/MSC_Tests.default M sccp/SCCP_Tests.default M sgsn/SGSN_Tests.default M sip/SIP_Tests.default 8 files changed, 0 insertions(+), 8 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/bsc/BSC_Tests.default b/bsc/BSC_Tests.default index 8818359..c13f7b0 100644 --- a/bsc/BSC_Tests.default +++ b/bsc/BSC_Tests.default @@ -15,7 +15,6 @@ *.BSCVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.BSCVTY.CTRL_READMODE := "buffered" *.BSCVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" -*.BSCVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.BSCVTY.PROMPT1 := "OsmoBSC> " [MODULE_PARAMETERS] diff --git a/bts/BTS_Tests.default b/bts/BTS_Tests.default index f254993..502c17f 100644 --- a/bts/BTS_Tests.default +++ b/bts/BTS_Tests.default @@ -12,7 +12,6 @@ *.BTSVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.BTSVTY.CTRL_READMODE := "buffered" *.BTSVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" -*.BTSVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.BTSVTY.PROMPT1 := "OsmoBTS> " *.PCU.socket_type := "SEQPACKET" diff --git a/ggsn_tests/GGSN_Tests.default b/ggsn_tests/GGSN_Tests.default index 4d52e24..ff0cd97 100644 --- a/ggsn_tests/GGSN_Tests.default +++ b/ggsn_tests/GGSN_Tests.default @@ -8,7 +8,6 @@ *.GGSNVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.GGSNVTY.CTRL_READMODE := "buffered" *.GGSNVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" -*.GGSNVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.GGSNVTY.PROMPT1 := "OsmoGGSN> " [MODULE_PARAMETERS] diff --git a/hlr/HLR_Tests.default b/hlr/HLR_Tests.default index 84d4ff3..f458479 100644 --- a/hlr/HLR_Tests.default +++ b/hlr/HLR_Tests.default @@ -9,7 +9,6 @@ *.VTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.VTY.CTRL_READMODE := "buffered" *.VTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" -*.VTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.VTY.PROMPT1 := "OsmoHLR> " [MODULE_PARAMETERS] diff --git a/msc/MSC_Tests.default b/msc/MSC_Tests.default index a24fa38..bcaae06 100644 --- a/msc/MSC_Tests.default +++ b/msc/MSC_Tests.default @@ -20,7 +20,6 @@ *.MSCVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.MSCVTY.CTRL_READMODE := "buffered" *.MSCVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" -*.MSCVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.MSCVTY.PROMPT1 := "OsmoMSC> " diff --git a/sccp/SCCP_Tests.default b/sccp/SCCP_Tests.default index 95e0d2f..7d16e5b 100644 --- a/sccp/SCCP_Tests.default +++ b/sccp/SCCP_Tests.default @@ -15,7 +15,6 @@ *.SCCP_DEMO_USER_VTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.SCCP_DEMO_USER_VTY.CTRL_READMODE := "buffered" *.SCCP_DEMO_USER_VTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" -*.SCCP_DEMO_USER_VTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.SCCP_DEMO_USER_VTY.PROMPT1 := "sccp-demo-user> " [MODULE_PARAMETERS] diff --git a/sgsn/SGSN_Tests.default b/sgsn/SGSN_Tests.default index 3957e82..bac5fdd 100644 --- a/sgsn/SGSN_Tests.default +++ b/sgsn/SGSN_Tests.default @@ -15,7 +15,6 @@ *.SGSNVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.SGSNVTY.CTRL_READMODE := "buffered" *.SGSNVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" -*.SGSNVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.SGSNVTY.PROMPT1 := "OsmoSGSN> " diff --git a/sip/SIP_Tests.default b/sip/SIP_Tests.default index 4434a1a..2576b33 100644 --- a/sip/SIP_Tests.default +++ b/sip/SIP_Tests.default @@ -13,7 +13,6 @@ *.SIPVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.SIPVTY.CTRL_READMODE := "buffered" *.SIPVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" -*.SIPVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.SIPVTY.PROMPT1 := "OsmoSIPcon> " *.SIP.local_sip_port := "5060" -- To view, visit https://gerrit.osmocom.org/10187 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I215d7ab5eee75cf6d3afaac760af64356c943140 Gerrit-Change-Number: 10187 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Stefan Sperling -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 13:05:50 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 13:05:50 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS: fix: pad LAPDm frames before sending via L1CTL In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10183 ) Change subject: BTS: fix: pad LAPDm frames before sending via L1CTL ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10183 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I16cba4e4179456bebabf0638760af011a27fd333 Gerrit-Change-Number: 10183 Gerrit-PatchSet: 4 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Fri, 27 Jul 2018 13:05:50 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 13:05:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 13:05:53 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS: fix: pad LAPDm frames before sending via L1CTL In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10183 ) Change subject: BTS: fix: pad LAPDm frames before sending via L1CTL ...................................................................... BTS: fix: pad LAPDm frames before sending via L1CTL Thanks to Stefan Sperling, a critical bug was discovered in trxcon. The problem was that length of LAPDm frames was not checked before passing them to the libosmocoding API. So, if a received LAPDm frame is shorter than expected (i.e. 23 bytes), then: - in case of xCCH, there was a heap overflow (detected by ASAN), so a short frame has been encoded together with some garbage outside the primitive buffer... - in case of FACCH, as the length != 23, a frame was recognised as a speech frame, and also encoded together with some garbage. Since the bug is fixed (OS#3415), some TTCN-3 BTS tests started to fail, because most likely it was assumed that trxcon would pad the frames automatically, but it doesn't and shouldn't. Let's automatically pad LAPDm frames with 0x2b before sending. Change-Id: I16cba4e4179456bebabf0638760af011a27fd333 Related: OS#3418 --- M bts/BTS_Tests.ttcn 1 file changed, 8 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index 40bfd24..77bffd6 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -1153,7 +1153,8 @@ var LapdmFrameAB lb := valueof(ts_LAPDm_AB(0, false, false, enc_GsmRrL3Message(meas_rep))); log("LAPDm: ", lb); var octetstring pl := '0000'O & enc_LapdmFrameAB(lb); - L1CTL.send(ts_L1CTL_DATA_REQ(g_chan_nr, ts_RslLinkID_SACCH(0), pl)); + L1CTL.send(ts_L1CTL_DATA_REQ(g_chan_nr, ts_RslLinkID_SACCH(0), + f_pad_oct(pl, 23, '2B'O))); repeat; } } @@ -1163,7 +1164,8 @@ [] L1CTL.receive(tr_L1CTL_DATA_IND(g_chan_nr, tr_RslLinkID_DCCH(?))) -> value l1_dl { log("DCCH received: ", l1_dl.payload.data_ind.payload); var octetstring pl := '010301'O; - L1CTL.send(ts_L1CTL_DATA_REQ(g_chan_nr, ts_RslLinkID_DCCH(0), pl)); + L1CTL.send(ts_L1CTL_DATA_REQ(g_chan_nr, ts_RslLinkID_DCCH(0), + f_pad_oct(pl, 23, '2B'O))); repeat; } } @@ -3222,6 +3224,10 @@ /* prepend dummy L1 header */ l2 := '0000'O & l2; } + + /* If required, pad L2 frame with constant 0x2b filling */ + l2 := f_pad_oct(l2, 23, '2B'O); + log("encoding ", l, " to ", l2); L1CTL.send(ts_L1CTL_DATA_REQ(g_chan_nr, link_id, l2)); } -- To view, visit https://gerrit.osmocom.org/10183 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I16cba4e4179456bebabf0638760af011a27fd333 Gerrit-Change-Number: 10183 Gerrit-PatchSet: 5 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 13:05:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 13:05:54 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BTS: enable encryption + RLL tests for Bm (TCH/F) channels In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10184 ) Change subject: BTS: enable encryption + RLL tests for Bm (TCH/F) channels ...................................................................... BTS: enable encryption + RLL tests for Bm (TCH/F) channels Due to OS#3418, both encryption and RLL tests have been failing. It's time to enable Bm (TCH/F FACCH) channel related tests now! Please note that Lm (TCH/H) remains disabled because of OS#3419. Change-Id: I7c0f9f9f695e089e4a30f63ec362d1e6c18abff0 Related: OS#3256 --- M bts/BTS_Tests.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index 77bffd6..fb6137c 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -301,7 +301,7 @@ }; g_AllChanTypes := { /* TS 1..4: TCH/F */ - //valueof(ts_RslChanNr_Bm(1)), + valueof(ts_RslChanNr_Bm(1)), /* TS 5: TCH/H */ //valueof(ts_RslChanNr_Lm(5,1)), /* TS 0: SDCCH/4 */ -- To view, visit https://gerrit.osmocom.org/10184 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I7c0f9f9f695e089e4a30f63ec362d1e6c18abff0 Gerrit-Change-Number: 10184 Gerrit-PatchSet: 5 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 13:08:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 13:08:44 +0000 Subject: Change in libosmocore[master]: port arfcn range encode support from osmo-bsc In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10185 ) Change subject: port arfcn range encode support from osmo-bsc ...................................................................... Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/10185/2/include/osmocom/gsm/gsm48_arfcn_range_encode.h File include/osmocom/gsm/gsm48_arfcn_range_encode.h: https://gerrit.osmocom.org/#/c/10185/2/include/osmocom/gsm/gsm48_arfcn_range_encode.h at 17 PS2, Line 17: int gsm48_range_enc_determine_range(const int *arfcns, int size, int *f0_out); for newly-introduced symbols we typically use an "osmo_" prefix. non "osmo_" prefixed symbols are all legacy. Yes, the symbol names get a bit long with all those prefixes, but the general rule is that applications must not define symbols with osmo_ prefix, while the libraries provide symbols with osmo_ prefix. -- To view, visit https://gerrit.osmocom.org/10185 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c Gerrit-Change-Number: 10185 Gerrit-PatchSet: 2 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Harald Welte Gerrit-Comment-Date: Fri, 27 Jul 2018 13:08:44 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 13:44:43 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 27 Jul 2018 13:44:43 +0000 Subject: Change in osmo-ci[master]: ansible: osmo-gsm-tester-prod: Add DHCP lease for secondary muliTRX n... In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10169 ) Change subject: ansible: osmo-gsm-tester-prod: Add DHCP lease for secondary muliTRX nanobts ...................................................................... Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/10169 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3967d7b4203f5361dc03074dcd82c870d60c8aac Gerrit-Change-Number: 10169 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 27 Jul 2018 13:44:43 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 13:44:45 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 27 Jul 2018 13:44:45 +0000 Subject: Change in osmo-ci[master]: ansible: osmo-gsm-tester-prod: Add DHCP lease for secondary muliTRX n... In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/10169 ) Change subject: ansible: osmo-gsm-tester-prod: Add DHCP lease for secondary muliTRX nanobts ...................................................................... ansible: osmo-gsm-tester-prod: Add DHCP lease for secondary muliTRX nanobts Change-Id: I3967d7b4203f5361dc03074dcd82c870d60c8aac --- M ansible/host_vars/osmo-gsm-tester-prod.yml 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Pau Espin Pedrol: Verified diff --git a/ansible/host_vars/osmo-gsm-tester-prod.yml b/ansible/host_vars/osmo-gsm-tester-prod.yml index ee9edea..9d195de 100644 --- a/ansible/host_vars/osmo-gsm-tester-prod.yml +++ b/ansible/host_vars/osmo-gsm-tester-prod.yml @@ -4,6 +4,8 @@ ip: 10.42.42.120 - mac: 00:02:95:00:5a:a4 ip: 10.42.42.121 + - mac: 00:02:95:00:7c:07 + ip: 10.42.42.122 # how many modems are connected via a quadmodem? gsm_modems: 3 -- To view, visit https://gerrit.osmocom.org/10169 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I3967d7b4203f5361dc03074dcd82c870d60c8aac Gerrit-Change-Number: 10169 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 14:00:22 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Fri, 27 Jul 2018 14:00:22 +0000 Subject: Change in libosmocore[master]: port arfcn range encode support from osmo-bsc In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10185 to look at the new patch set (#3). Change subject: port arfcn range encode support from osmo-bsc ...................................................................... port arfcn range encode support from osmo-bsc As part of fixing issue OS#3075, we want to migrate support for encoding system information from osmo-bsc to libosmocore. This change ports one of the prerequisites for doing so: osmo-bsc code for range-encoding ARFCNs, including tests. An osmo_gsm48_ prefix has been prepended to public symbols in order to avoid clashes with existing symbols in osmo-bsc code. Change-Id: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c Related: OS#3075 --- M include/Makefile.am A include/osmocom/gsm/gsm48_arfcn_range_encode.h M src/gsm/Makefile.am A src/gsm/gsm48_arfcn_range_encode.c M src/gsm/libosmogsm.map M tests/gsm0408/gsm0408_test.c A tests/gsm0408/gsm0408_test.err M tests/gsm0408/gsm0408_test.ok 8 files changed, 796 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/85/10185/3 -- To view, visit https://gerrit.osmocom.org/10185 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c Gerrit-Change-Number: 10185 Gerrit-PatchSet: 3 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 14:09:29 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Fri, 27 Jul 2018 14:09:29 +0000 Subject: Change in libosmocore[master]: port arfcn range encode support from osmo-bsc In-Reply-To: References: Message-ID: Stefan Sperling has posted comments on this change. ( https://gerrit.osmocom.org/10185 ) Change subject: port arfcn range encode support from osmo-bsc ...................................................................... Patch Set 3: > Patch Set 2: > > (1 comment) Fixed in next patchset. New symbols now use an osmo_gsm48_ prefix. -- To view, visit https://gerrit.osmocom.org/10185 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c Gerrit-Change-Number: 10185 Gerrit-PatchSet: 3 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-CC: Harald Welte Gerrit-Comment-Date: Fri, 27 Jul 2018 14:09:29 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 14:09:57 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 27 Jul 2018 14:09:57 +0000 Subject: Change in osmo-mgw[master]: mgcp_client: use IETF source port as for MGCP Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/10188 Change subject: mgcp_client: use IETF source port as for MGCP ...................................................................... mgcp_client: use IETF source port as for MGCP At the moment the mgcp client uses an arbitrary port as sourceport to exchange MGCP messages with the MGW. However, IETF has designated a specific port as sourceport for MGCP clients (Call agents), which is 2727. See also RFC3435, capter 3.5 Transmission over UDP. - Change MGCP_CLIENT_LOCAL_PORT_DEFAULT from 0 to 2727 Change-Id: I96de84df3a3bf623d98b057ec3f3f621a3330a8a Closes: OS#2874 --- M include/osmocom/mgcp_client/mgcp_client.h 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/88/10188/1 diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h index 19c684d..ed2dfb0 100644 --- a/include/osmocom/mgcp_client/mgcp_client.h +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -5,8 +5,9 @@ #include +/* See also: RFC 3435, chapter 3.5 Transmission over UDP */ #define MGCP_CLIENT_LOCAL_ADDR_DEFAULT "0.0.0.0" -#define MGCP_CLIENT_LOCAL_PORT_DEFAULT 0 +#define MGCP_CLIENT_LOCAL_PORT_DEFAULT 2727 #define MGCP_CLIENT_REMOTE_ADDR_DEFAULT "127.0.0.1" #define MGCP_CLIENT_REMOTE_PORT_DEFAULT 2427 -- To view, visit https://gerrit.osmocom.org/10188 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I96de84df3a3bf623d98b057ec3f3f621a3330a8a Gerrit-Change-Number: 10188 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 14:24:03 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Fri, 27 Jul 2018 14:24:03 +0000 Subject: Change in libosmocore[master]: port rest octets encoding code from osmo-bsc Message-ID: Stefan Sperling has uploaded this change for review. ( https://gerrit.osmocom.org/10189 Change subject: port rest octets encoding code from osmo-bsc ...................................................................... port rest octets encoding code from osmo-bsc As part of fixing issue OS#3075, we want to migrate support for encoding system information from osmo-bsc to libosmocore. This change ports osmo-bsc code for encoding SI rest octets. The conversion was a bit tricky in some places because some functions receive a 'struct gsm_bts' parameter in osmo-bsc. In this libosmocore version, such functions expect parameters which correspond to the individual fields of 'struct gsm_bts' which are used by these functions. Several structs from osmo-bsc's system_information.h are now also declared in libosmocore headers, with an added osmo_ prefix to avoid collisions with existing definitions in osmo-bsc. Some helpers were ported from osmo-bsc's system_information.c to libosmocore's gsm48_rest_octets.c. Contrary to osmo-bsc's implementation they are now only visible within this file. Unfortunately, this code ported from osmo-bsc lacks unit tests. Change-Id: I47888965ab11bba1186c21987f1365c9270abeab Related: OS#3075 --- M include/Makefile.am M include/osmocom/gprs/protocol/gsm_04_60.h A include/osmocom/gsm/gsm48_rest_octets.h M src/gsm/Makefile.am A src/gsm/gsm48_rest_octets.c M src/gsm/libosmogsm.map 6 files changed, 1,087 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/89/10189/1 diff --git a/include/Makefile.am b/include/Makefile.am index e7a30b1..2e27a5b 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -91,6 +91,7 @@ osmocom/gsm/gsm48.h \ osmocom/gsm/gsm48_arfcn_range_encode.h \ osmocom/gsm/gsm48_ie.h \ + osmocom/gsm/gsm48_rest_octets.h \ osmocom/gsm/gsm_utils.h \ osmocom/gsm/gsup.h \ osmocom/gsm/ipa.h \ diff --git a/include/osmocom/gprs/protocol/gsm_04_60.h b/include/osmocom/gprs/protocol/gsm_04_60.h index 96e9ab7..c0c9b29 100644 --- a/include/osmocom/gprs/protocol/gsm_04_60.h +++ b/include/osmocom/gprs/protocol/gsm_04_60.h @@ -207,3 +207,42 @@ bsn1_lo:1; } __attribute__ ((packed)); #endif + +/* TS 03.60 Chapter 6.3.3.1: Network Mode of Operation */ +enum osmo_gprs_nmo { + GPRS_NMO_I = 0, /* CS pagin on GPRS paging or traffic channel */ + GPRS_NMO_II = 1, /* all paging on CCCH */ + GPRS_NMO_III = 2, /* no paging coordination */ +}; + +/* TS 04.60 12.24 */ +struct osmo_gprs_cell_options { + enum osmo_gprs_nmo nmo; + /* T3168: wait for packet uplink assignment message */ + uint32_t t3168; /* in milliseconds */ + /* T3192: wait for release of the TBF after reception of the final block */ + uint32_t t3192; /* in milliseconds */ + uint32_t drx_timer_max;/* in seconds */ + uint32_t bs_cv_max; + uint8_t supports_egprs_11bit_rach; + bool ctrl_ack_type_use_block; /* use PACKET CONTROL ACKNOWLEDGMENT */ + + uint8_t ext_info_present; + struct { + uint8_t egprs_supported; + uint8_t use_egprs_p_ch_req; + uint8_t bep_period; + uint8_t pfc_supported; + uint8_t dtm_supported; + uint8_t bss_paging_coordination; + } ext_info; +}; + +/* TS 04.60 Table 12.9.2 */ +struct osmo_gprs_power_ctrl_pars { + uint8_t alpha; + uint8_t t_avg_w; + uint8_t t_avg_t; + uint8_t pc_meas_chan; + uint8_t n_avg_i; +}; diff --git a/include/osmocom/gsm/gsm48_rest_octets.h b/include/osmocom/gsm/gsm48_rest_octets.h new file mode 100644 index 0000000..74c4367 --- /dev/null +++ b/include/osmocom/gsm/gsm48_rest_octets.h @@ -0,0 +1,80 @@ +#pragma once + +#include +#include +#include + +/* generate SI1 rest octets */ +int osmo_gsm48_rest_octets_si1(uint8_t *data, uint8_t *nch_pos, int is1800_net); +int osmo_gsm48_rest_octets_si2quater(uint8_t *data, uint8_t si2q_index, uint8_t si2q_count, const uint16_t *uarfcn_list, + size_t *u_offset, size_t uarfcn_length, uint16_t *scramble_list, + struct osmo_earfcn_si2q *si2quater_neigh_list, size_t *e_offset); +int osmo_gsm48_rest_octets_si2ter(uint8_t *data); +int osmo_gsm48_rest_octets_si2bis(uint8_t *data); +int osmo_gsm48_rest_octets_si6(uint8_t *data, bool is1800_net); + +struct osmo_gsm48_si_selection_params { + uint16_t penalty_time:5, + temp_offs:3, + cell_resel_off:6, + cbq:1, + present:1; +}; + +struct osmo_gsm48_si_power_offset { + uint8_t power_offset:2, + present:1; +}; + +struct osmo_gsm48_si3_gprs_ind { + uint8_t si13_position:1, + ra_colour:3, + present:1; +}; + +struct osmo_gsm48_lsa_params { + uint32_t prio_thr:3, + lsa_offset:3, + mcc:12, + mnc:12; + unsigned int present; +}; + +struct osmo_gsm48_si_ro_info { + struct osmo_gsm48_si_selection_params selection_params; + struct osmo_gsm48_si_power_offset power_offset; + bool si2ter_indicator; + bool early_cm_ctrl; + struct { + uint8_t where:3, + present:1; + } scheduling; + struct osmo_gsm48_si3_gprs_ind gprs_ind; + /* SI 3 specific */ + bool early_cm_restrict_3g; + bool si2quater_indicator; + /* SI 4 specific */ + struct osmo_gsm48_lsa_params lsa_params; + uint16_t cell_id; + uint8_t break_ind; /* do we have SI7 + SI8 ? */ +}; + +/* Generate SI3 Rest Octests (Chapter 10.5.2.34 / Table 10.4.72) */ +int osmo_gsm48_rest_octets_si3(uint8_t *data, const struct osmo_gsm48_si_ro_info *si3); + +/* Generate SI4 Rest Octets (Chapter 10.5.2.35) */ +int osmo_gsm48_rest_octets_si4(uint8_t *data, const struct osmo_gsm48_si_ro_info *si4, int len); + +struct osmo_gsm48_si13_info { + struct osmo_gprs_cell_options cell_opts; + struct osmo_gprs_power_ctrl_pars pwr_ctrl_pars; + uint8_t bcch_change_mark; + uint8_t si_change_field; + uint8_t rac; + uint8_t spgc_ccch_sup; + uint8_t net_ctrl_ord; + uint8_t prio_acc_thr; +}; + +/* Generate SI13 Rest Octests (Chapter 10.5.2.37b) */ +int osmo_gsm48_rest_octets_si13(uint8_t *data, const struct osmo_gsm48_si13_info *si13); diff --git a/src/gsm/Makefile.am b/src/gsm/Makefile.am index 2f06749..2993776 100644 --- a/src/gsm/Makefile.am +++ b/src/gsm/Makefile.am @@ -22,9 +22,9 @@ libgsmint_la_SOURCES = a5.c rxlev_stat.c tlv_parser.c comp128.c comp128v23.c \ gsm_utils.c rsl.c gsm48.c gsm48_ie.c gsm48_arfcn_range_encode.c \ - gsm0808.c sysinfo.c gprs_cipher_core.c gprs_rlc.c gsm0480.c abis_nm.c \ - gsm0502.c gsm0411_utils.c gsm0411_smc.c gsm0411_smr.c gsm0414.c \ - lapd_core.c lapdm.c kasumi.c gsm_04_08_gprs.c \ + gsm48_rest_octets.c gsm0808.c sysinfo.c gprs_cipher_core.c gprs_rlc.c \ + gsm0480.c abis_nm.c gsm0502.c gsm0411_utils.c gsm0411_smc.c \ + gsm0411_smr.c gsm0414.c lapd_core.c lapdm.c kasumi.c gsm_04_08_gprs.c \ auth_core.c auth_comp128v1.c auth_comp128v23.c \ auth_milenage.c milenage/aes-encblock.c gea.c \ milenage/aes-internal.c milenage/aes-internal-enc.c \ diff --git a/src/gsm/gsm48_rest_octets.c b/src/gsm/gsm48_rest_octets.c new file mode 100644 index 0000000..e62bdb3 --- /dev/null +++ b/src/gsm/gsm48_rest_octets.c @@ -0,0 +1,956 @@ +/* GSM Mobile Radio Interface Layer 3 messages on the A-bis interface, + * rest octet handling according to + * 3GPP TS 04.08 version 7.21.0 Release 1998 / ETSI TS 100 940 V7.21.0 */ + +/* (C) 2009 by Harald Welte + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +/* generate SI1 rest octets */ +int osmo_gsm48_rest_octets_si1(uint8_t *data, uint8_t *nch_pos, int is1800_net) +{ + struct bitvec bv; + + memset(&bv, 0, sizeof(bv)); + bv.data = data; + bv.data_len = 1; + + if (nch_pos) { + bitvec_set_bit(&bv, H); + bitvec_set_uint(&bv, *nch_pos, 5); + } else + bitvec_set_bit(&bv, L); + + if (is1800_net) + bitvec_set_bit(&bv, L); + else + bitvec_set_bit(&bv, H); + + bitvec_spare_padding(&bv, 6); + return bv.data_len; +} + +/* 16 is the max. number of SI2quater messages according to 3GPP TS 44.018 Table 10.5.2.33b.1: + 4-bit index is used (2#1111 = 10#15) */ +#define SI2Q_MAX_NUM 16 +/* length in bits (for single SI2quater message) */ +#define SI2Q_MAX_LEN 160 +#define SI2Q_MIN_LEN 18 + +/* Append Repeated E-UTRAN Neighbour Cell to bitvec: see 3GPP TS 44.018 Table 10.5.2.33b.1 */ +static inline bool append_eutran_neib_cell(struct bitvec *bv, const struct osmo_earfcn_si2q *e, size_t *e_offset, + uint8_t budget) +{ + unsigned i, skip = 0; + int16_t rem = budget - 6; /* account for mandatory stop bit and THRESH_E-UTRAN_high */ + uint8_t earfcn_budget; + + if (budget <= 6) + return false; + + OSMO_ASSERT(budget <= SI2Q_MAX_LEN); + + /* first we have to properly adjust budget requirements */ + if (e->prio_valid) /* E-UTRAN_PRIORITY: 3GPP TS 45.008*/ + rem -= 4; + else + rem--; + + if (e->thresh_lo_valid) /* THRESH_E-UTRAN_low: */ + rem -= 6; + else + rem--; + + if (e->qrxlm_valid) /* E-UTRAN_QRXLEVMIN: */ + rem -= 6; + else + rem--; + + if (rem < 0) + return false; + + /* now we can proceed with actually adding EARFCNs within adjusted budget limit */ + for (i = 0; i < e->length; i++) { + if (e->arfcn[i] != OSMO_EARFCN_INVALID) { + if (skip < *e_offset) { + skip++; /* ignore EARFCNs added on previous calls */ + } else { + earfcn_budget = 17; /* compute budget per-EARFCN */ + if (OSMO_EARFCN_MEAS_INVALID == e->meas_bw[i]) + earfcn_budget++; + else + earfcn_budget += 4; + + if (rem - earfcn_budget < 0) + break; + else { + (*e_offset)++; + rem -= earfcn_budget; + + if (rem < 0) + return false; + + bitvec_set_bit(bv, 1); /* EARFCN: */ + bitvec_set_uint(bv, e->arfcn[i], 16); + + if (OSMO_EARFCN_MEAS_INVALID == e->meas_bw[i]) + bitvec_set_bit(bv, 0); + else { /* Measurement Bandwidth: 9.1.54 */ + bitvec_set_bit(bv, 1); + bitvec_set_uint(bv, e->meas_bw[i], 3); + } + } + } + } + } + + /* stop bit - end of EARFCN + Measurement Bandwidth sequence */ + bitvec_set_bit(bv, 0); + + /* Note: we don't support different EARFCN arrays each with different priority, threshold etc. */ + + if (e->prio_valid) { + /* E-UTRAN_PRIORITY: 3GPP TS 45.008*/ + bitvec_set_bit(bv, 1); + bitvec_set_uint(bv, e->prio, 3); + } else + bitvec_set_bit(bv, 0); + + /* THRESH_E-UTRAN_high */ + bitvec_set_uint(bv, e->thresh_hi, 5); + + if (e->thresh_lo_valid) { + /* THRESH_E-UTRAN_low: */ + bitvec_set_bit(bv, 1); + bitvec_set_uint(bv, e->thresh_lo, 5); + } else + bitvec_set_bit(bv, 0); + + if (e->qrxlm_valid) { + /* E-UTRAN_QRXLEVMIN: */ + bitvec_set_bit(bv, 1); + bitvec_set_uint(bv, e->qrxlm, 5); + } else + bitvec_set_bit(bv, 0); + + return true; +} + +static inline void append_earfcn(struct bitvec *bv, const struct osmo_earfcn_si2q *e, size_t *e_offset, uint8_t budget) +{ + bool appended; + unsigned int old = bv->cur_bit; /* save current position to make rollback possible */ + int rem = budget - 25; + if (rem <= 0) + return; + + OSMO_ASSERT(budget <= SI2Q_MAX_LEN); + + /* Additions in Rel-5: */ + bitvec_set_bit(bv, H); + /* No 3G Additional Measurement Param. Descr. */ + bitvec_set_bit(bv, 0); + /* No 3G ADDITIONAL MEASUREMENT Param. Descr. 2 */ + bitvec_set_bit(bv, 0); + /* Additions in Rel-6: */ + bitvec_set_bit(bv, H); + /* 3G_CCN_ACTIVE */ + bitvec_set_bit(bv, 0); + /* Additions in Rel-7: */ + bitvec_set_bit(bv, H); + /* No 700_REPORTING_OFFSET */ + bitvec_set_bit(bv, 0); + /* No 810_REPORTING_OFFSET */ + bitvec_set_bit(bv, 0); + /* Additions in Rel-8: */ + bitvec_set_bit(bv, H); + + /* Priority and E-UTRAN Parameters Description */ + bitvec_set_bit(bv, 1); + + /* No Serving Cell Priority Parameters Descr. */ + bitvec_set_bit(bv, 0); + /* No 3G Priority Parameters Description */ + bitvec_set_bit(bv, 0); + /* E-UTRAN Parameters Description */ + bitvec_set_bit(bv, 1); + + /* E-UTRAN_CCN_ACTIVE */ + bitvec_set_bit(bv, 0); + /* E-UTRAN_Start: 9.1.54 */ + bitvec_set_bit(bv, 1); + /* E-UTRAN_Stop: 9.1.54 */ + bitvec_set_bit(bv, 1); + + /* No E-UTRAN Measurement Parameters Descr. */ + bitvec_set_bit(bv, 0); + /* No GPRS E-UTRAN Measurement Param. Descr. */ + bitvec_set_bit(bv, 0); + + /* Note: each of next 3 "repeated" structures might be repeated any + (0, 1, 2...) times - we only support 1 and 0 */ + + /* Repeated E-UTRAN Neighbour Cells */ + bitvec_set_bit(bv, 1); + + appended = append_eutran_neib_cell(bv, e, e_offset, rem); + if (!appended) { /* appending is impossible within current budget: rollback */ + bv->cur_bit = old; + return; + } + + /* stop bit - end of Repeated E-UTRAN Neighbour Cells sequence: */ + bitvec_set_bit(bv, 0); + + /* Note: following 2 repeated structs are not supported ATM */ + /* stop bit - end of Repeated E-UTRAN Not Allowed Cells sequence: */ + bitvec_set_bit(bv, 0); + /* stop bit - end of Repeated E-UTRAN PCID to TA mapping sequence: */ + bitvec_set_bit(bv, 0); + + /* Priority and E-UTRAN Parameters Description ends here */ + /* No 3G CSG Description */ + bitvec_set_bit(bv, 0); + /* No E-UTRAN CSG Description */ + bitvec_set_bit(bv, 0); + /* No Additions in Rel-9: */ + bitvec_set_bit(bv, L); +} + +static int range_encode(enum osmo_gsm48_range r, int *arfcns, int arfcns_used, int *w, + int f0, uint8_t *chan_list) +{ + /* + * Manipulate the ARFCN list according to the rules in J4 depending + * on the selected range. + */ + int rc, f0_included; + + osmo_gsm48_range_enc_filter_arfcns(arfcns, arfcns_used, f0, &f0_included); + + rc = osmo_gsm48_range_enc_arfcns(r, arfcns, arfcns_used, w, 0); + if (rc < 0) + return rc; + + /* Select the range and the amount of bits needed */ + switch (r) { + case OSMO_GSM48_ARFCN_RANGE_128: + return osmo_gsm48_range_enc_range128(chan_list, f0, w); + case OSMO_GSM48_ARFCN_RANGE_256: + return osmo_gsm48_range_enc_range256(chan_list, f0, w); + case OSMO_GSM48_ARFCN_RANGE_512: + return osmo_gsm48_range_enc_range512(chan_list, f0, w); + case OSMO_GSM48_ARFCN_RANGE_1024: + return osmo_gsm48_range_enc_range1024(chan_list, f0, f0_included, w); + default: + return -ERANGE; + }; + + return f0_included; +} + +static inline int f0_helper(int *sc, size_t length, uint8_t *chan_list) +{ + int w[OSMO_GSM48_RANGE_ENC_MAX_ARFCNS] = { 0 }; + + return range_encode(OSMO_GSM48_ARFCN_RANGE_1024, sc, length, w, 0, chan_list); +} + +/* Return p(n) for given NR_OF_TDD_CELLS - see Table 9.1.54.1a, 3GPP TS 44.018 */ +static unsigned range1024_p(unsigned n) +{ + switch (n) { + case 0: return 0; + case 1: return 10; + case 2: return 19; + case 3: return 28; + case 4: return 36; + case 5: return 44; + case 6: return 52; + case 7: return 60; + case 8: return 67; + case 9: return 74; + case 10: return 81; + case 11: return 88; + case 12: return 95; + case 13: return 102; + case 14: return 109; + case 15: return 116; + case 16: return 122; + default: return 0; + } +} + +/* Estimate how many bits it'll take to append single FDD UARFCN */ +static inline int append_utran_fdd_length(uint16_t u, const int *sc, size_t sc_len, size_t length) +{ + uint8_t chan_list[16] = { 0 }; + int tmp[sc_len], f0; + + memcpy(tmp, sc, sizeof(tmp)); + + f0 = f0_helper(tmp, length, chan_list); + if (f0 < 0) + return f0; + + return 21 + range1024_p(length); +} + +/* Append single FDD UARFCN */ +static inline int append_utran_fdd(struct bitvec *bv, uint16_t u, int *sc, size_t length) +{ + uint8_t chan_list[16] = { 0 }; + int f0 = f0_helper(sc, length, chan_list); + + if (f0 < 0) + return f0; + + /* Repeated UTRAN FDD Neighbour Cells */ + bitvec_set_bit(bv, 1); + + /* FDD-ARFCN */ + bitvec_set_bit(bv, 0); + bitvec_set_uint(bv, u, 14); + + /* FDD_Indic0: parameter value '0000000000' is a member of the set? */ + bitvec_set_bit(bv, f0); + /* NR_OF_FDD_CELLS */ + bitvec_set_uint(bv, length, 5); + + f0 = bv->cur_bit; + bitvec_add_range1024(bv, (struct gsm48_range_1024 *)chan_list); + bv->cur_bit = f0 + range1024_p(length); + + return 21 + range1024_p(length); +} + +static inline int try_adding_uarfcn(struct bitvec *bv, uint16_t *scramble_list, + size_t uarfcn_length, size_t *u_offset, + uint16_t uarfcn, uint8_t num_sc, uint8_t start_pos, uint8_t budget) +{ + int i, k, rc, a[uarfcn_length]; + + if (budget < 23) + return -ENOMEM; + + /* copy corresponding Scrambling Codes: range encoder make in-place modifications */ + for (i = start_pos, k = 0; i < num_sc; a[k++] = scramble_list[i++]); + + /* estimate bit length requirements */ + rc = append_utran_fdd_length(uarfcn, a, uarfcn_length, k); + if (rc < 0) + return rc; /* range encoder failure */ + + if (budget - rc <= 0) + return -ENOMEM; /* we have ran out of budget in current SI2q */ + + /* compute next offset */ + *u_offset += k; + + return budget - append_utran_fdd(bv, uarfcn, a, k); +} + +/* Append multiple FDD UARFCNs */ +static inline void append_uarfcns(struct bitvec *bv, const uint16_t *uarfcn_list, size_t *u_offset, + size_t uarfcn_length, uint16_t *scramble_list, uint8_t budget) +{ + int i, rem = budget - 7, st = *u_offset; /* account for constant bits right away */ + uint16_t cu = uarfcn_list[*u_offset]; /* caller ensures that length is positive */ + + OSMO_ASSERT(budget <= SI2Q_MAX_LEN); + + if (budget <= 7) + return; + + /* 3G Neighbour Cell Description */ + bitvec_set_bit(bv, 1); + /* No Index_Start_3G */ + bitvec_set_bit(bv, 0); + /* No Absolute_Index_Start_EMR */ + bitvec_set_bit(bv, 0); + + /* UTRAN FDD Description */ + bitvec_set_bit(bv, 1); + /* No Bandwidth_FDD */ + bitvec_set_bit(bv, 0); + + for (i = *u_offset; i <= uarfcn_length; i++) + if (uarfcn_list[i] != cu) { /* we've reached new UARFCN */ + rem = try_adding_uarfcn(bv, scramble_list, uarfcn_length, u_offset, cu, i, st, rem); + if (rem < 0) + break; + + if (i < uarfcn_length) { + cu = uarfcn_list[i]; + st = i; + } else + break; + } + + /* stop bit - end of Repeated UTRAN FDD Neighbour Cells */ + bitvec_set_bit(bv, 0); + + /* UTRAN TDD Description */ + bitvec_set_bit(bv, 0); +} + +static size_t si2q_earfcn_count(const struct osmo_earfcn_si2q *e) +{ + unsigned i, ret = 0; + + if (!e) + return 0; + + for (i = 0; i < e->length; i++) + if (e->arfcn[i] != OSMO_EARFCN_INVALID) + ret++; + + return ret; +} + +/* generate SI2quater rest octets: 3GPP TS 44.018 ? 10.5.2.33b */ +int osmo_gsm48_rest_octets_si2quater(uint8_t *data, uint8_t si2q_index, uint8_t si2q_count, const uint16_t *uarfcn_list, + size_t *u_offset, size_t uarfcn_length, uint16_t *scramble_list, + struct osmo_earfcn_si2q *si2quater_neigh_list, size_t *e_offset) +{ + int rc; + struct bitvec bv; + + if (si2q_count < si2q_index) + return -EINVAL; + + bv.data = data; + bv.data_len = 20; + bitvec_zero(&bv); + + /* BA_IND: Set to '0' as that's what we use for SI2xxx type, + * whereas '1' is used for SI5xxx type messages. The point here + * is to be able to correlate whether a given MS measurement + * report was using the neighbor cells advertised in SI2 or in + * SI5, as those two could very well be different */ + bitvec_set_bit(&bv, 0); + /* 3G_BA_IND */ + bitvec_set_bit(&bv, 1); + /* MP_CHANGE_MARK */ + bitvec_set_bit(&bv, 0); + + /* SI2quater_INDEX */ + bitvec_set_uint(&bv, si2q_index, 4); + /* SI2quater_COUNT */ + bitvec_set_uint(&bv, si2q_count, 4); + + /* No Measurement_Parameters Description */ + bitvec_set_bit(&bv, 0); + /* No GPRS_Real Time Difference Description */ + bitvec_set_bit(&bv, 0); + /* No GPRS_BSIC Description */ + bitvec_set_bit(&bv, 0); + /* No GPRS_REPORT PRIORITY Description */ + bitvec_set_bit(&bv, 0); + /* No GPRS_MEASUREMENT_Parameters Description */ + bitvec_set_bit(&bv, 0); + /* No NC Measurement Parameters */ + bitvec_set_bit(&bv, 0); + /* No extension (length) */ + bitvec_set_bit(&bv, 0); + + rc = SI2Q_MAX_LEN - (bv.cur_bit + 3); + if (rc > 0 && uarfcn_length - *u_offset > 0) + append_uarfcns(&bv, uarfcn_list, u_offset, uarfcn_length, scramble_list, rc); + else /* No 3G Neighbour Cell Description */ + bitvec_set_bit(&bv, 0); + + /* No 3G Measurement Parameters Description */ + bitvec_set_bit(&bv, 0); + /* No GPRS_3G_MEASUREMENT Parameters Descr. */ + bitvec_set_bit(&bv, 0); + + rc = SI2Q_MAX_LEN - bv.cur_bit; + if (rc > 0 && si2q_earfcn_count(si2quater_neigh_list) - *e_offset > 0) + append_earfcn(&bv, si2quater_neigh_list, e_offset, rc); + else /* No Additions in Rel-5: */ + bitvec_set_bit(&bv, L); + + bitvec_spare_padding(&bv, (bv.data_len * 8) - 1); + return bv.data_len; +} + +/* Append selection parameters to bitvec */ +static void append_selection_params(struct bitvec *bv, + const struct osmo_gsm48_si_selection_params *sp) +{ + if (sp->present) { + bitvec_set_bit(bv, H); + bitvec_set_bit(bv, sp->cbq); + bitvec_set_uint(bv, sp->cell_resel_off, 6); + bitvec_set_uint(bv, sp->temp_offs, 3); + bitvec_set_uint(bv, sp->penalty_time, 5); + } else + bitvec_set_bit(bv, L); +} + +/* Append power offset to bitvec */ +static void append_power_offset(struct bitvec *bv, + const struct osmo_gsm48_si_power_offset *po) +{ + if (po->present) { + bitvec_set_bit(bv, H); + bitvec_set_uint(bv, po->power_offset, 2); + } else + bitvec_set_bit(bv, L); +} + +/* Append GPRS indicator to bitvec */ +static void append_gprs_ind(struct bitvec *bv, + const struct osmo_gsm48_si3_gprs_ind *gi) +{ + if (gi->present) { + bitvec_set_bit(bv, H); + bitvec_set_uint(bv, gi->ra_colour, 3); + /* 0 == SI13 in BCCH Norm, 1 == SI13 sent on BCCH Ext */ + bitvec_set_bit(bv, gi->si13_position); + } else + bitvec_set_bit(bv, L); +} + +/* Generate SI2ter Rest Octests 3GPP TS 44.018 Table 10.5.2.33a.1 */ +int osmo_gsm48_rest_octets_si2ter(uint8_t *data) +{ + struct bitvec bv; + + memset(&bv, 0, sizeof(bv)); + bv.data = data; + bv.data_len = 4; + + /* No SI2ter_MP_CHANGE_MARK */ + bitvec_set_bit(&bv, L); + + bitvec_spare_padding(&bv, (bv.data_len * 8) - 1); + + return bv.data_len; +} + +/* Generate SI2bis Rest Octests 3GPP TS 44.018 Table 10.5.2.33.1 */ +int osmo_gsm48_rest_octets_si2bis(uint8_t *data) +{ + struct bitvec bv; + + memset(&bv, 0, sizeof(bv)); + bv.data = data; + bv.data_len = 1; + + bitvec_spare_padding(&bv, (bv.data_len * 8) - 1); + + return bv.data_len; +} + +/* Generate SI3 Rest Octests (Chapter 10.5.2.34 / Table 10.4.72) */ +int osmo_gsm48_rest_octets_si3(uint8_t *data, const struct osmo_gsm48_si_ro_info *si3) +{ + struct bitvec bv; + + memset(&bv, 0, sizeof(bv)); + bv.data = data; + bv.data_len = 4; + + /* Optional Selection Parameters */ + append_selection_params(&bv, &si3->selection_params); + + /* Optional Power Offset */ + append_power_offset(&bv, &si3->power_offset); + + /* Do we have a SI2ter on the BCCH? */ + if (si3->si2ter_indicator) + bitvec_set_bit(&bv, H); + else + bitvec_set_bit(&bv, L); + + /* Early Classmark Sending Control */ + if (si3->early_cm_ctrl) + bitvec_set_bit(&bv, H); + else + bitvec_set_bit(&bv, L); + + /* Do we have a SI Type 9 on the BCCH? */ + if (si3->scheduling.present) { + bitvec_set_bit(&bv, H); + bitvec_set_uint(&bv, si3->scheduling.where, 3); + } else + bitvec_set_bit(&bv, L); + + /* GPRS Indicator */ + append_gprs_ind(&bv, &si3->gprs_ind); + + /* 3G Early Classmark Sending Restriction. If H, then controlled by + * early_cm_ctrl above */ + if (si3->early_cm_restrict_3g) + bitvec_set_bit(&bv, L); + else + bitvec_set_bit(&bv, H); + + if (si3->si2quater_indicator) { + bitvec_set_bit(&bv, H); /* indicator struct present */ + bitvec_set_uint(&bv, 0, 1); /* message is sent on BCCH Norm */ + } + + bitvec_spare_padding(&bv, (bv.data_len*8)-1); + return bv.data_len; +} + +static int append_lsa_params(struct bitvec *bv, + const struct osmo_gsm48_lsa_params *lsa_params) +{ + /* FIXME */ + return -1; +} + +/* Generate SI4 Rest Octets (Chapter 10.5.2.35) */ +int osmo_gsm48_rest_octets_si4(uint8_t *data, const struct osmo_gsm48_si_ro_info *si4, int len) +{ + struct bitvec bv; + + memset(&bv, 0, sizeof(bv)); + bv.data = data; + bv.data_len = len; + + /* SI4 Rest Octets O */ + append_selection_params(&bv, &si4->selection_params); + append_power_offset(&bv, &si4->power_offset); + append_gprs_ind(&bv, &si4->gprs_ind); + + if (0 /* FIXME */) { + /* H and SI4 Rest Octets S */ + bitvec_set_bit(&bv, H); + + /* LSA Parameters */ + if (si4->lsa_params.present) { + bitvec_set_bit(&bv, H); + append_lsa_params(&bv, &si4->lsa_params); + } else + bitvec_set_bit(&bv, L); + + /* Cell Identity */ + if (1) { + bitvec_set_bit(&bv, H); + bitvec_set_uint(&bv, si4->cell_id, 16); + } else + bitvec_set_bit(&bv, L); + + /* LSA ID Information */ + if (0) { + bitvec_set_bit(&bv, H); + /* FIXME */ + } else + bitvec_set_bit(&bv, L); + } else { + /* L and break indicator */ + bitvec_set_bit(&bv, L); + bitvec_set_bit(&bv, si4->break_ind ? H : L); + } + + return bv.data_len; +} + + +/* GSM 04.18 ETSI TS 101 503 V8.27.0 (2006-05) + + ::= +{L | H } +{L | H } +{ < DTM_support : bit == L > I < DTM_support : bit == H > +< RAC : bit (8) > +< MAX_LAPDm : bit (3) > } +< Band indicator > +{ L | H < GPRS_MS_TXPWR_MAX_CCH : bit (5) > } +; +*/ +int osmo_gsm48_rest_octets_si6(uint8_t *data, bool is1800_net) +{ + struct bitvec bv; + + memset(&bv, 0, sizeof(bv)); + bv.data = data; + bv.data_len = 1; + + /* no PCH/NCH info */ + bitvec_set_bit(&bv, L); + /* no VBS/VGCS options */ + bitvec_set_bit(&bv, L); + /* no DTM_support */ + bitvec_set_bit(&bv, L); + /* band indicator */ + if (is1800_net) + bitvec_set_bit(&bv, L); + else + bitvec_set_bit(&bv, H); + /* no GPRS_MS_TXPWR_MAX_CCH */ + bitvec_set_bit(&bv, L); + + bitvec_spare_padding(&bv, (bv.data_len * 8) - 1); + return bv.data_len; +} + +/* GPRS Mobile Allocation as per TS 04.60 Chapter 12.10a: + < GPRS Mobile Allocation IE > ::= + < HSN : bit (6) > + { 0 | 1 < RFL number list : < RFL number list struct > > } + { 0 < MA_LENGTH : bit (6) > + < MA_BITMAP: bit (val(MA_LENGTH) + 1) > + | 1 { 0 | 1 > } } ; + + < RFL number list struct > :: = + < RFL_NUMBER : bit (4) > + { 0 | 1 < RFL number list struct > } ; + < ARFCN index list struct > ::= + < ARFCN_INDEX : bit(6) > + { 0 | 1 < ARFCN index list struct > } ; + */ +static int append_gprs_mobile_alloc(struct bitvec *bv) +{ + /* Hopping Sequence Number */ + bitvec_set_uint(bv, 0, 6); + + if (0) { + /* We want to use a RFL number list */ + bitvec_set_bit(bv, 1); + /* FIXME: RFL number list */ + } else + bitvec_set_bit(bv, 0); + + if (0) { + /* We want to use a MA_BITMAP */ + bitvec_set_bit(bv, 0); + /* FIXME: MA_LENGTH, MA_BITMAP, ... */ + } else { + bitvec_set_bit(bv, 1); + if (0) { + /* We want to provide an ARFCN index list */ + bitvec_set_bit(bv, 1); + /* FIXME */ + } else + bitvec_set_bit(bv, 0); + } + return 0; +} + +static int encode_t3192(unsigned int t3192) +{ + /* See also 3GPP TS 44.060 + Table 12.24.2: GPRS Cell Options information element details */ + if (t3192 == 0) + return 3; + else if (t3192 <= 80) + return 4; + else if (t3192 <= 120) + return 5; + else if (t3192 <= 160) + return 6; + else if (t3192 <= 200) + return 7; + else if (t3192 <= 500) + return 0; + else if (t3192 <= 1000) + return 1; + else if (t3192 <= 1500) + return 2; + else + return -EINVAL; +} + +static int encode_drx_timer(unsigned int drx) +{ + if (drx == 0) + return 0; + else if (drx == 1) + return 1; + else if (drx == 2) + return 2; + else if (drx <= 4) + return 3; + else if (drx <= 8) + return 4; + else if (drx <= 16) + return 5; + else if (drx <= 32) + return 6; + else if (drx <= 64) + return 7; + else + return -EINVAL; +} + +/* GPRS Cell Options as per TS 04.60 Chapter 12.24 + < GPRS Cell Options IE > ::= + < NMO : bit(2) > + < T3168 : bit(3) > + < T3192 : bit(3) > + < DRX_TIMER_MAX: bit(3) > + < ACCESS_BURST_TYPE: bit > + < CONTROL_ACK_TYPE : bit > + < BS_CV_MAX: bit(4) > + { 0 | 1 < PAN_DEC : bit(3) > + < PAN_INC : bit(3) > + < PAN_MAX : bit(3) > + { 0 | 1 < Extension Length : bit(6) > + < bit (val(Extension Length) + 1 + & { < Extension Information > ! { bit ** = } } ; + < Extension Information > ::= + { 0 | 1 < EGPRS_PACKET_CHANNEL_REQUEST : bit > + < BEP_PERIOD : bit(4) > } + < PFC_FEATURE_MODE : bit > + < DTM_SUPPORT : bit > + + ** ; + */ +static int append_gprs_cell_opt(struct bitvec *bv, + const struct osmo_gprs_cell_options *gco) +{ + int t3192, drx_timer_max; + + t3192 = encode_t3192(gco->t3192); + if (t3192 < 0) + return t3192; + + drx_timer_max = encode_drx_timer(gco->drx_timer_max); + if (drx_timer_max < 0) + return drx_timer_max; + + bitvec_set_uint(bv, gco->nmo, 2); + + /* See also 3GPP TS 44.060 + Table 12.24.2: GPRS Cell Options information element details */ + bitvec_set_uint(bv, gco->t3168 / 500 - 1, 3); + + bitvec_set_uint(bv, t3192, 3); + bitvec_set_uint(bv, drx_timer_max, 3); + /* ACCESS_BURST_TYPE: Hard-code 8bit */ + bitvec_set_bit(bv, 0); + /* CONTROL_ACK_TYPE: */ + bitvec_set_bit(bv, gco->ctrl_ack_type_use_block); + bitvec_set_uint(bv, gco->bs_cv_max, 4); + + if (0) { + /* hard-code no PAN_{DEC,INC,MAX} */ + bitvec_set_bit(bv, 0); + } else { + /* copied from ip.access BSC protocol trace */ + bitvec_set_bit(bv, 1); + bitvec_set_uint(bv, 1, 3); /* DEC */ + bitvec_set_uint(bv, 1, 3); /* INC */ + bitvec_set_uint(bv, 15, 3); /* MAX */ + } + + if (!gco->ext_info_present) { + /* no extension information */ + bitvec_set_bit(bv, 0); + } else { + /* extension information */ + bitvec_set_bit(bv, 1); + if (!gco->ext_info.egprs_supported) { + /* 6bit length of extension */ + bitvec_set_uint(bv, (1 + 3)-1, 6); + /* EGPRS supported in the cell */ + bitvec_set_bit(bv, 0); + } else { + /* 6bit length of extension */ + bitvec_set_uint(bv, (1 + 5 + 3)-1, 6); + /* EGPRS supported in the cell */ + bitvec_set_bit(bv, 1); + + /* 1bit EGPRS PACKET CHANNEL REQUEST */ + if (gco->supports_egprs_11bit_rach == 0) { + bitvec_set_bit(bv, + gco->ext_info.use_egprs_p_ch_req); + } else { + bitvec_set_bit(bv, 0); + } + + /* 4bit BEP PERIOD */ + bitvec_set_uint(bv, gco->ext_info.bep_period, 4); + } + bitvec_set_bit(bv, gco->ext_info.pfc_supported); + bitvec_set_bit(bv, gco->ext_info.dtm_supported); + bitvec_set_bit(bv, gco->ext_info.bss_paging_coordination); + } + + return 0; +} + +static void append_gprs_pwr_ctrl_pars(struct bitvec *bv, + const struct osmo_gprs_power_ctrl_pars *pcp) +{ + bitvec_set_uint(bv, pcp->alpha, 4); + bitvec_set_uint(bv, pcp->t_avg_w, 5); + bitvec_set_uint(bv, pcp->t_avg_t, 5); + bitvec_set_uint(bv, pcp->pc_meas_chan, 1); + bitvec_set_uint(bv, pcp->n_avg_i, 4); +} + +/* Generate SI13 Rest Octests (04.08 Chapter 10.5.2.37b) */ +int osmo_gsm48_rest_octets_si13(uint8_t *data, const struct osmo_gsm48_si13_info *si13) +{ + struct bitvec bv; + + memset(&bv, 0, sizeof(bv)); + bv.data = data; + bv.data_len = 20; + + if (0) { + /* No rest octets */ + bitvec_set_bit(&bv, L); + } else { + bitvec_set_bit(&bv, H); + bitvec_set_uint(&bv, si13->bcch_change_mark, 3); + bitvec_set_uint(&bv, si13->si_change_field, 4); + if (1) { + bitvec_set_bit(&bv, 0); + } else { + bitvec_set_bit(&bv, 1); + bitvec_set_uint(&bv, si13->bcch_change_mark, 2); + append_gprs_mobile_alloc(&bv); + } + /* PBCCH not present in cell: + it shall never be indicated according to 3GPP TS 44.018 Table 10.5.2.37b.1 */ + bitvec_set_bit(&bv, 0); + bitvec_set_uint(&bv, si13->rac, 8); + bitvec_set_bit(&bv, si13->spgc_ccch_sup); + bitvec_set_uint(&bv, si13->prio_acc_thr, 3); + bitvec_set_uint(&bv, si13->net_ctrl_ord, 2); + append_gprs_cell_opt(&bv, &si13->cell_opts); + append_gprs_pwr_ctrl_pars(&bv, &si13->pwr_ctrl_pars); + + /* 3GPP TS 44.018 Release 6 / 10.5.2.37b */ + bitvec_set_bit(&bv, H); /* added Release 99 */ + /* claim our SGSN is compatible with Release 99, as EDGE and EGPRS + * was only added in this Release */ + bitvec_set_bit(&bv, 1); + } + bitvec_spare_padding(&bv, (bv.data_len*8)-1); + return bv.data_len; +} diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index bd286d4..bce2df0 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -239,6 +239,14 @@ gsm48_att_tlvdef; gsm48_cc_msg_name; +gsm48_rest_octets_si1; +gsm48_rest_octets_si2quater; +gsm48_rest_octets_si2ter; +gsm48_rest_octets_si2bis; +gsm48_rest_octets_si6; +gsm48_rest_octets_si3; +gsm48_rest_octets_si4; +gsm48_rest_octets_si13; gsm48_rr_msg_name; gsm48_cc_state_name; gsm48_construct_ra; -- To view, visit https://gerrit.osmocom.org/10189 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I47888965ab11bba1186c21987f1365c9270abeab Gerrit-Change-Number: 10189 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 14:27:29 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Jul 2018 14:27:29 +0000 Subject: Change in osmo-bsc[master]: fix: dispatch TS_EV_RSL_DOWN when losing RSL Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10190 Change subject: fix: dispatch TS_EV_RSL_DOWN when losing RSL ...................................................................... fix: dispatch TS_EV_RSL_DOWN when losing RSL Noticed by ttcn3-bsc-test: after TC_ms_rel_ind_does_not_cause_bssmap_reset the test TC_dyn_pdch_ipa_act_deact would fail because RSL was still indicated as available, and only OML was properly signalled as down. Before recent commit I4843d03b3237cdcca0ad2041ef6895ff253d8419 to fix nanobts and use only flags for RSL and OML presence, the timeslot FSM actually checked RSL link presence and the lacking RSL DOWN event was not noticed. Change-Id: I66c7fc5fcc676f4960f3d089b8c2ae5bce37ed99 --- M src/osmo-bsc/osmo_bsc_main.c 1 file changed, 14 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/90/10190/1 diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index 218ea15..8dc9098 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -309,13 +309,22 @@ } } +static void all_ts_dispatch_event(struct gsm_bts_trx *trx, uint32_t event) +{ + int ts_i; + for (ts_i = 0; ts_i < ARRAY_SIZE(trx->ts); ts_i++) { + struct gsm_bts_trx_ts *ts = &trx->ts[ts_i]; + if (ts->fi) + osmo_fsm_inst_dispatch(ts->fi, event, 0); + } +} + /* Callback function to be called every time we receive a signal from INPUT */ static int inp_sig_cb(unsigned int subsys, unsigned int signal, void *handler_data, void *signal_data) { struct input_signal_data *isd = signal_data; struct gsm_bts_trx *trx = isd->trx; - int ts_no; /* N. B: we rely on attribute order when parsing response in abis_nm_rx_get_attr_resp() */ const uint8_t bts_attr[] = { NM_ATT_MANUF_ID, NM_ATT_SW_CONFIG, }; const uint8_t trx_attr[] = { NM_ATT_MANUF_STATE, NM_ATT_SW_CONFIG, }; @@ -360,22 +369,13 @@ case S_L_INP_TEI_DN: LOGP(DLMI, LOGL_ERROR, "Lost some E1 TEI link: %d %p\n", isd->link_type, trx); - if (isd->link_type == E1INP_SIGN_OML) + if (isd->link_type == E1INP_SIGN_OML) { rate_ctr_inc(&trx->bts->bts_ctrs->ctr[BTS_CTR_BTS_OML_FAIL]); - else if (isd->link_type == E1INP_SIGN_RSL) { + all_ts_dispatch_event(trx, TS_EV_OML_DOWN); + } else if (isd->link_type == E1INP_SIGN_RSL) { rate_ctr_inc(&trx->bts->bts_ctrs->ctr[BTS_CTR_BTS_RSL_FAIL]); acc_ramp_abort(&trx->bts->acc_ramp); - } - - /* - * free all allocated channels. change the nm_state so the - * trx and trx_ts becomes unusable and chan_alloc.c can not - * allocate from it. - */ - for (ts_no = 0; ts_no < ARRAY_SIZE(trx->ts); ++ts_no) { - struct gsm_bts_trx_ts *ts = &trx->ts[ts_no]; - if (ts->fi) - osmo_fsm_inst_dispatch(ts->fi, TS_EV_OML_DOWN, 0); + all_ts_dispatch_event(trx, TS_EV_RSL_DOWN); } gsm_bts_mo_reset(trx->bts); -- To view, visit https://gerrit.osmocom.org/10190 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I66c7fc5fcc676f4960f3d089b8c2ae5bce37ed99 Gerrit-Change-Number: 10190 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 14:27:31 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Jul 2018 14:27:31 +0000 Subject: Change in osmo-bsc[master]: timeslot FSM: fix infinite recursion on failure to send PDCH ACT Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10191 Change subject: timeslot FSM: fix infinite recursion on failure to send PDCH ACT ...................................................................... timeslot FSM: fix infinite recursion on failure to send PDCH ACT If PDCH ACT sending fails and we go back to UNUSED, the UNUSED onenter goes right back to PDCH ACT and we loop. Avoid by going straight to broken state. Actually, if we can't send messages, the timeslot is obviously broken, so also enter the broken state if PDCH deactivation fails to be sent out. Change-Id: Iebaffd0547a9651c5ba435b54dedab99c2cfdd31 --- M src/osmo-bsc/timeslot_fsm.c 1 file changed, 7 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/91/10191/1 diff --git a/src/osmo-bsc/timeslot_fsm.c b/src/osmo-bsc/timeslot_fsm.c index 245ce76..4514f34 100644 --- a/src/osmo-bsc/timeslot_fsm.c +++ b/src/osmo-bsc/timeslot_fsm.c @@ -345,9 +345,11 @@ rc = rsl_tx_dyn_ts_pdch_act_deact(ts, true); - /* On error, we couldn't send the activation message and remain unused. */ + /* On error, we couldn't send the activation message. If we can't send messages, we're broken. + * (Also avoiding a recursion loop: enter UNUSED, try to PDCH act, fail, enter UNUSED, try to + * PDCH act,...). */ if (rc) - ts_fsm_error(fi, TS_ST_UNUSED, "Unable to send PDCH activation"); + ts_fsm_error(fi, TS_ST_BORKEN, "Unable to send PDCH activation"); } static void ts_fsm_wait_pdch_act(struct osmo_fsm_inst *fi, uint32_t event, void *data) @@ -464,9 +466,10 @@ rc = rsl_tx_dyn_ts_pdch_act_deact(ts, false); - /* On error, we couldn't send the deactivation message and remain in PDCH. */ + /* On error, we couldn't send the deactivation message. If we can't send messages, we're broken. + */ if (rc) - ts_fsm_error(fi, TS_ST_PDCH, "Unable to send PDCH deactivation"); + ts_fsm_error(fi, TS_ST_BORKEN, "Unable to send PDCH deactivation"); } static void ts_fsm_wait_pdch_deact(struct osmo_fsm_inst *fi, uint32_t event, void *data) -- To view, visit https://gerrit.osmocom.org/10191 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iebaffd0547a9651c5ba435b54dedab99c2cfdd31 Gerrit-Change-Number: 10191 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 14:27:31 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Jul 2018 14:27:31 +0000 Subject: Change in osmo-bsc[master]: timeslot FSM: permit entering broken state from anywhere Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10192 Change subject: timeslot FSM: permit entering broken state from anywhere ...................................................................... timeslot FSM: permit entering broken state from anywhere Change-Id: I59abcef2ee1d9e307f8eacf1d5ea663e19099a6a --- M src/osmo-bsc/timeslot_fsm.c 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/92/10192/1 diff --git a/src/osmo-bsc/timeslot_fsm.c b/src/osmo-bsc/timeslot_fsm.c index 4514f34..21de2fa 100644 --- a/src/osmo-bsc/timeslot_fsm.c +++ b/src/osmo-bsc/timeslot_fsm.c @@ -720,6 +720,7 @@ , .out_state_mask = 0 | S(TS_ST_UNUSED) + | S(TS_ST_BORKEN) , }, [TS_ST_UNUSED] = { @@ -734,6 +735,7 @@ | S(TS_ST_WAIT_PDCH_ACT) | S(TS_ST_IN_USE) | S(TS_ST_NOT_INITIALIZED) + | S(TS_ST_BORKEN) , }, [TS_ST_WAIT_PDCH_ACT] = { @@ -764,6 +766,7 @@ .out_state_mask = 0 | S(TS_ST_WAIT_PDCH_DEACT) | S(TS_ST_NOT_INITIALIZED) + | S(TS_ST_BORKEN) , }, [TS_ST_WAIT_PDCH_DEACT] = { @@ -781,6 +784,7 @@ | S(TS_ST_UNUSED) | S(TS_ST_BORKEN) | S(TS_ST_NOT_INITIALIZED) + | S(TS_ST_BORKEN) , }, [TS_ST_IN_USE] = { @@ -794,6 +798,7 @@ .out_state_mask = 0 | S(TS_ST_UNUSED) | S(TS_ST_NOT_INITIALIZED) + | S(TS_ST_BORKEN) , }, [TS_ST_BORKEN] = { -- To view, visit https://gerrit.osmocom.org/10192 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I59abcef2ee1d9e307f8eacf1d5ea663e19099a6a Gerrit-Change-Number: 10192 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 14:27:31 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Jul 2018 14:27:31 +0000 Subject: Change in osmo-bsc[master]: cosmetic: gscon: don't re-enter ST_CLEARING Message-ID: Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/10193 Change subject: cosmetic: gscon: don't re-enter ST_CLEARING ...................................................................... cosmetic: gscon: don't re-enter ST_CLEARING I often see "ERROR [ST_CLEARING] Entering ST_CLEARING not permitted!", avoid the bogus error messages by checking entering ST_CLEARING only if not in it yet. Still don't allow re-entering, to not restart the timeout. Change-Id: Ia1f171c08dcbc529f907a20eed43bf5ee3a452b3 --- M src/osmo-bsc/bsc_subscr_conn_fsm.c 1 file changed, 6 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/93/10193/1 diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c b/src/osmo-bsc/bsc_subscr_conn_fsm.c index 60a9a75..fd3c293 100644 --- a/src/osmo-bsc/bsc_subscr_conn_fsm.c +++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c @@ -290,7 +290,8 @@ osmo_fsm_inst_state_name(conn->fi)); } gscon_bssmap_clear(conn, GSM0808_CAUSE_EQUIPMENT_FAILURE); - osmo_fsm_inst_state_chg(fi, ST_CLEARING, 60, 999); + if (conn->fi->state != ST_CLEARING) + osmo_fsm_inst_state_chg(fi, ST_CLEARING, 60, 999); return; default: OSMO_ASSERT(false); @@ -626,7 +627,8 @@ conn->lchan = NULL; } if (!conn->lchan) { - osmo_fsm_inst_state_chg(conn->fi, ST_CLEARING, 60, 999); + if (conn->fi->state != ST_CLEARING) + osmo_fsm_inst_state_chg(conn->fi, ST_CLEARING, 60, 999); gscon_bssmap_clear(conn, GSM0808_CAUSE_EQUIPMENT_FAILURE); } } @@ -670,7 +672,8 @@ switch (event) { case GSCON_EV_A_CLEAR_CMD: /* MSC tells us to cleanly shut down */ - osmo_fsm_inst_state_chg(fi, ST_CLEARING, 60, 999); + if (conn->fi->state != ST_CLEARING) + osmo_fsm_inst_state_chg(fi, ST_CLEARING, 60, 999); LOGPFSML(fi, LOGL_DEBUG, "Releasing all lchans (if any) after BSSMAP Clear Command\n"); gscon_release_lchans(conn, true); /* FIXME: Release all terestrial resources in ST_CLEARING */ -- To view, visit https://gerrit.osmocom.org/10193 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ia1f171c08dcbc529f907a20eed43bf5ee3a452b3 Gerrit-Change-Number: 10193 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 14:33:38 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 27 Jul 2018 14:33:38 +0000 Subject: Change in osmo-gsm-tester[master]: bts: Recreate resources.conf trx_list with len based on num_trx Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10194 Change subject: bts: Recreate resources.conf trx_list with len based on num_trx ...................................................................... bts: Recreate resources.conf trx_list with len based on num_trx We are already doing this for defaults.cfg, but not for resources.conf. As a result, if we have a trx_list with 2 trx but we have set num_trx=1 (default), parsing will fail later in bsc.cfg.tmpl because conf_for_bsc_prepare() will pass a trx_list with 2 trx. Change-Id: I28ed34abeedaa0ee2e7862ced45a46042192d831 --- M src/osmo_gsm_tester/bts.py 1 file changed, 7 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/94/10194/1 diff --git a/src/osmo_gsm_tester/bts.py b/src/osmo_gsm_tester/bts.py index ca33eb4..0f3ef1c 100644 --- a/src/osmo_gsm_tester/bts.py +++ b/src/osmo_gsm_tester/bts.py @@ -20,6 +20,7 @@ import os import pprint import tempfile +import copy from abc import ABCMeta, abstractmethod from . import log, config, util, template, process, schema, pcu_osmo @@ -112,7 +113,12 @@ config.overlay(values, { 'cell_identity': self.cellid }) if self.bvci is not None: config.overlay(values, { 'bvci': self.bvci }) - config.overlay(values, self.conf) + + conf = copy.deepcopy(self.conf) + trx_list = conf.get('trx_list') + if trx_list and len(trx_list) != self.num_trx(): + conf['trx_list'] = Bts._trx_list_recreate(trx_list, self.num_trx()) + config.overlay(values, conf) sgsn_conf = {} if self.sgsn is None else self.sgsn.conf_for_client() config.overlay(values, sgsn_conf) -- To view, visit https://gerrit.osmocom.org/10194 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I28ed34abeedaa0ee2e7862ced45a46042192d831 Gerrit-Change-Number: 10194 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 14:33:38 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 27 Jul 2018 14:33:38 +0000 Subject: Change in osmo-gsm-tester[master]: nanobts: Support multiTRX Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10195 Change subject: nanobts: Support multiTRX ...................................................................... nanobts: Support multiTRX num_trx is left for now by default to 1, but it has been tested to work properly (current tests pass and both trx are configured) with num_trx=2. Change-Id: Ib3962f824a804e2aa582601475a8514c6cb0d8e7 --- M example/defaults.conf M example/resources.conf.prod M example/resources.conf.rnd M src/osmo_gsm_tester/bts_nanobts.py M src/osmo_gsm_tester/resource.py 5 files changed, 104 insertions(+), 71 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/95/10195/1 diff --git a/example/defaults.conf b/example/defaults.conf index 1e84200..f7bd1b1 100644 --- a/example/defaults.conf +++ b/example/defaults.conf @@ -58,3 +58,6 @@ osmo_bts_octphy: max_trx: 2 + +nanobts: + max_trx: 2 diff --git a/example/resources.conf.prod b/example/resources.conf.prod index 6481254..6023fc4 100644 --- a/example/resources.conf.prod +++ b/example/resources.conf.prod @@ -47,22 +47,30 @@ - label: NanoBTS-ONW-1900 type: nanobts ipa_unit_id: 9 - addr: 10.42.42.120 band: GSM-1900 - power_supply: - type: 'sispm' - device: '01:01:4d:98:24' - port: '1' + trx_list: + - addr: 10.42.42.120 + power_supply: + type: 'sispm' + device: '01:01:4d:98:24' + port: '1' - label: NanoBTS-ONW-900 type: nanobts ipa_unit_id: 10 - addr: 10.42.42.121 band: GSM-900 - power_supply: - type: 'sispm' - device: '01:01:4d:98:24' - port: '2' + num_trx: 1 + trx_list: + - addr: 10.42.42.121 + power_supply: + type: 'sispm' + device: '01:01:4d:98:24' + port: '2' + - addr: 10.42.42.122 + power_supply: + type: 'sispm' + device: '01:01:4d:98:24' + port: '3' arfcn: - arfcn: 512 diff --git a/example/resources.conf.rnd b/example/resources.conf.rnd index 05fce87..4e5c173 100644 --- a/example/resources.conf.rnd +++ b/example/resources.conf.rnd @@ -30,12 +30,13 @@ - label: NanoBTS-ONW-1900 type: nanobts ipa_unit_id: 9 - addr: 10.42.42.120 band: GSM-1900 - power_supply: - type: 'sispm' - device: '01:01:55:2e:b6' - port: '1' + trx_list: + - addr: 10.42.42.120 + power_supply: + type: 'sispm' + device: '01:01:55:2e:b6' + port: '1' arfcn: - arfcn: 512 diff --git a/src/osmo_gsm_tester/bts_nanobts.py b/src/osmo_gsm_tester/bts_nanobts.py index 29a8ac5..7f0151f 100644 --- a/src/osmo_gsm_tester/bts_nanobts.py +++ b/src/osmo_gsm_tester/bts_nanobts.py @@ -28,28 +28,37 @@ class NanoBts(bts.Bts): - pwsup = None + pwsup_list = [] _pcu = None ############## # PROTECTED ############## def __init__(self, suite_run, conf): - if conf.get('addr') is None: - raise log.Error('No attribute addr provided in conf!') - super().__init__(suite_run, conf, 'nanobts_%s' % conf.get('addr'), 'nanobts') + super().__init__(suite_run, conf, 'nanobts_%s' % conf.get('label', 'nolabel'), 'nanobts') def _configure(self): if self.bsc is None: raise log.Error('BTS needs to be added to a BSC or NITB before it can be configured') - pwsup_opt = self.conf.get('power_supply', {}) - if not pwsup_opt: - raise log.Error('No power_supply attribute provided in conf!') - pwsup_type = pwsup_opt.get('type') - if not pwsup_type: - raise log.Error('No type attribute provided in power_supply conf!') + for trx_i in range(self.num_trx()): + pwsup_opt = self.conf.get('trx_list')[trx_i].get('power_supply', {}) + if not pwsup_opt: + raise log.Error('No power_supply attribute provided in conf for TRX %d!' % trx_i) + pwsup_type = pwsup_opt.get('type') + if not pwsup_type: + raise log.Error('No type attribute provided in power_supply conf for TRX %d!' % trx_i) + self.pwsup_list.append(powersupply.get_instance_by_type(pwsup_type, pwsup_opt)) - self.pwsup = powersupply.get_instance_by_type(pwsup_type, pwsup_opt) + + def get_pcap_filter_all_trx_ip(self): + ret = "(" + for trx_i in range(self.num_trx()): + if trx_i != 0: + ret = ret + " or " + bts_trx_ip = self.conf.get('trx_list')[trx_i].get('addr') + ret = ret + "host " + bts_trx_ip + ret = ret + ")" + return ret ######################## # PUBLIC - INTERNAL API @@ -61,9 +70,11 @@ band = values.get('band') trx_list = values.get('trx_list') if band == 'GSM-1900': - config.overlay(trx_list[0], { 'arfcn' : '531' }) + for trx_i in range(len(trx_list)): + config.overlay(trx_list[trx_i], { 'arfcn' : str(531 + trx_i * 2) }) elif band == 'GSM-900': - config.overlay(trx_list[0], { 'arfcn' : '50' }) + for trx_i in range(len(trx_list)): + config.overlay(trx_list[trx_i], { 'arfcn' : str(50 + trx_i * 2) }) config.overlay(values, { 'osmobsc_bts_type': 'nanobts' }) @@ -72,9 +83,10 @@ def cleanup(self): - if self.pwsup: - self.dbg('Powering off NanoBTS') - self.pwsup.power_set(False) + for pwsup in self.pwsup_list: + self.dbg('Powering off NanoBTS TRX') + pwsup.power_set(False) + self.pwsup_list = [] ################### # PUBLIC (test API included) @@ -87,44 +99,50 @@ self._configure() unitid = int(self.conf.get('ipa_unit_id')) - bts_ip = self.remote_addr() - # This fine for now, however concurrent tests using Nanobts may run into "address already in use" since dst is broadcast. - # Once concurrency is needed, a new config attr should be added to have an extra static IP assigned on the main-unit to each Nanobts resource. - local_bind_ip =util.dst_ip_get_local_bind(bts_ip) - # Make sure nanoBTS is powered and in a clean state: - self.pwsup.power_cycle(1.0) + # Make sure all nanoBTS TRX are powered and in a clean state: + for pwsup in self.pwsup_list: + self.dbg('Powering cycling NanoBTS TRX') + pwsup.power_cycle(1.0) pcap_recorder.PcapRecorder(self.suite_run, self.run_dir.new_dir('pcap'), None, - 'host %s and port not 22' % self.remote_addr()) + '%s and port not 22' % self.get_pcap_filter_all_trx_ip()) - self.log('Finding nanobts %s, binding on %s...' % (bts_ip, local_bind_ip)) - ipfind = AbisIpFind(self.suite_run, self.run_dir, local_bind_ip, 'preconf') - ipfind.start() - ipfind.wait_bts_ready(bts_ip) - running_unitid = ipfind.get_unitid_by_ip(bts_ip) - self.log('Found nanobts %s with unit_id %d' % (bts_ip, running_unitid)) - ipfind.stop() - ipconfig = IpAccessConfig(self.suite_run, self.run_dir, bts_ip) - if running_unitid != unitid: - if not ipconfig.set_unit_id(unitid, False): - raise log.Error('Failed configuring unit id %d' % unitid) - # Apply OML IP and restart nanoBTS as it is required to apply the changes. - if not ipconfig.set_oml_ip(self.bsc.addr(), True): - raise log.Error('Failed configuring OML IP %s' % bts_ip) + # TODO: If setting N TRX, we should set up them in parallel instead of waiting for each one. + for trx_i in range(self.num_trx()): + bts_trx_ip = self.conf.get('trx_list')[trx_i].get('addr') + # This fine for now, however concurrent tests using Nanobts may run into "address already in use" since dst is broadcast. + # Once concurrency is needed, a new config attr should be added to have an extra static IP assigned on the main-unit to each Nanobts resource. + local_bind_ip = util.dst_ip_get_local_bind(bts_trx_ip) - # Let some time for BTS to restart. It takes much more than 20 secs, and - # this way we make sure we don't catch responses in abisip-find prior to - # BTS restarting. - MainLoop.sleep(self, 20) + self.log('Finding nanobts %s, binding on %s...' % (bts_trx_ip, local_bind_ip)) + ipfind = AbisIpFind(self.suite_run, self.run_dir, local_bind_ip, 'preconf') + ipfind.start() + ipfind.wait_bts_ready(bts_trx_ip) + running_unitid, running_trx = ipfind.get_unitid_by_ip(bts_trx_ip) + self.log('Found nanobts %s with unit_id %d trx %d' % (bts_trx_ip, running_unitid, running_trx)) + ipfind.stop() - self.log('Starting to connect to', self.bsc) - ipfind = AbisIpFind(self.suite_run, self.run_dir, local_bind_ip, 'postconf') - ipfind.start() - ipfind.wait_bts_ready(bts_ip) - self.log('nanoBTS configured and running') - ipfind.stop() + ipconfig = IpAccessConfig(self.suite_run, self.run_dir, bts_trx_ip) + if running_unitid != unitid or running_trx != trx_i: + if not ipconfig.set_unit_id(unitid, trx_i, False): + raise log.Error('Failed configuring unit id %d trx %d' % (unitid, trx_i)) + # Apply OML IP and restart nanoBTS as it is required to apply the changes. + if not ipconfig.set_oml_ip(self.bsc.addr(), True): + raise log.Error('Failed configuring OML IP %s' % bts_trx_ip) + + # Let some time for BTS to restart. It takes much more than 20 secs, and + # this way we make sure we don't catch responses in abisip-find prior to + # BTS restarting. + MainLoop.sleep(self, 20) + + self.log('Starting to connect id %d trx %d to' % (unitid, trx_i), self.bsc) + ipfind = AbisIpFind(self.suite_run, self.run_dir, local_bind_ip, 'postconf') + ipfind.start() + ipfind.wait_bts_ready(bts_trx_ip) + self.log('nanoBTS id %d trx %d configured and running' % (unitid, trx_i)) + ipfind.stop() MainLoop.wait(self, self.bsc.bts_is_connected, self, timeout=600) self.log('nanoBTS connected to BSC') @@ -161,7 +179,7 @@ proc = None BIN_ABISIP_FIND = 'abisip-find' - BTS_UNIT_ID_RE = re.compile("Unit_ID='(?P\d+)/\d+/\d+'") + BTS_UNIT_ID_RE = re.compile("Unit_ID='(?P\d+)/\d+/(?P\d+)'") def __init__(self, suite_run, parent_run_dir, bind_ip, name_suffix): super().__init__(log.C_RUN, AbisIpFind.BIN_ABISIP_FIND + '-' + name_suffix) @@ -207,7 +225,8 @@ res = AbisIpFind.BTS_UNIT_ID_RE.search(line) if res: unit_id = int(res.group('unit_id')) - return unit_id + trx_id = int(res.group('trx_id')) + return (unit_id, trx_id) raise log.Error('abisip-find unit_id field for nanobts %s not found in %s' %(ipaddr, line)) def bts_ready(self, ipaddr): @@ -261,13 +280,14 @@ raise e return self.proc.result - def set_unit_id(self, unitid, restart=False): + def set_unit_id(self, unitid, trx_num, restart=False): + uid_str = '%d/0/%d' % (unitid, trx_num) if restart: - retcode = self.run('unitid', '--restart', '--unit-id', '%d/0/0' % unitid, self.bts_ip) + retcode = self.run('unitid', '--restart', '--unit-id', '%s' % uid_str, self.bts_ip) else: - retcode = self.run('unitid', '--unit-id', '%d/0/0' % unitid, self.bts_ip) + retcode = self.run('unitid', '--unit-id', '%s' % uid_str, self.bts_ip) if retcode != 0: - log.err('ipaccess-config --unit-id %d/0/0 returned error code %d' % (unitid, retcode)) + log.err('ipaccess-config --unit-id %s returned error code %d' % (uid_str, retcode)) return retcode == 0 def set_oml_ip(self, omlip, restart=False): diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index 28c4117..dca8090 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -57,17 +57,18 @@ 'bts[].trx_remote_ip': schema.IPV4, 'bts[].launch_trx': schema.BOOL_STR, 'bts[].direct_pcu': schema.BOOL_STR, - 'bts[].power_supply.type': schema.STR, - 'bts[].power_supply.device': schema.STR, - 'bts[].power_supply.port': schema.STR, 'bts[].ciphers[]': schema.CIPHER, 'bts[].num_trx': schema.UINT, 'bts[].max_trx': schema.UINT, + 'bts[].trx_list[].addr': schema.IPV4, 'bts[].trx_list[].hw_addr': schema.HWADDR, 'bts[].trx_list[].net_device': schema.STR, 'bts[].trx_list[].nominal_power': schema.UINT, 'bts[].trx_list[].max_power_red': schema.UINT, 'bts[].trx_list[].timeslot_list[].phys_chan_config': schema.PHY_CHAN, + 'bts[].trx_list[].power_supply.type': schema.STR, + 'bts[].trx_list[].power_supply.device': schema.STR, + 'bts[].trx_list[].power_supply.port': schema.STR, 'arfcn[].arfcn': schema.INT, 'arfcn[].band': schema.BAND, 'modem[].label': schema.STR, -- To view, visit https://gerrit.osmocom.org/10195 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ib3962f824a804e2aa582601475a8514c6cb0d8e7 Gerrit-Change-Number: 10195 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 14:52:32 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Jul 2018 14:52:32 +0000 Subject: Change in osmo-bsc[master]: large refactoring: use FSMs for lchans; add inter-BSC HO In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9671 ) Change subject: large refactoring: use FSMs for lchans; add inter-BSC HO ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/9671 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I82e3f918295daa83274a4cf803f046979f284366 Gerrit-Change-Number: 9671 Gerrit-PatchSet: 40 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Fri, 27 Jul 2018 14:52:32 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 14:54:02 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Jul 2018 14:54:02 +0000 Subject: Change in osmo-bsc[master]: add gsm_timers, for Tnnn definitions usable by FSMs In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/9670 ) Change subject: add gsm_timers, for Tnnn definitions usable by FSMs ...................................................................... Patch Set 16: Code-Review+2 again re-adding +2 lost only by minor conflict resolution -- To view, visit https://gerrit.osmocom.org/9670 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If212fcd042051b6fa53484254223614c5b93a9c6 Gerrit-Change-Number: 9670 Gerrit-PatchSet: 16 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Fri, 27 Jul 2018 14:54:02 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 14:54:40 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 27 Jul 2018 14:54:40 +0000 Subject: Change in osmo-bsc[master]: cosmetic: rename bsc_api.h to gsm_08_08.h In-Reply-To: References: Message-ID: Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/10148 ) Change subject: cosmetic: rename bsc_api.h to gsm_08_08.h ...................................................................... Patch Set 5: Code-Review+2 re-adding +2 only lost due to conflict resolution -- To view, visit https://gerrit.osmocom.org/10148 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7179eb27183ee213f8fc8d548895b67aa43dc6a2 Gerrit-Change-Number: 10148 Gerrit-PatchSet: 5 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Fri, 27 Jul 2018 14:54:40 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Fri Jul 27 15:10:07 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Fri, 27 Jul 2018 15:10:07 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-asn1c_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#197?= In-Reply-To: <386191770.86.1532617807115.JavaMail.jenkins@jenkins.osmocom.org> References: <386191770.86.1532617807115.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <2122306959.97.1532704207054.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 3.67 KB...] + ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for style of include used by make... GNU checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking how to run the C++ preprocessor... g++ -E checking for g77... no checking for f77... no checking for xlf... no checking for frt... no checking for pgf77... no checking for cf77... no checking for fort77... no checking for fl32... no checking for af77... no checking for f90... no checking for xlf90... no checking for pgf90... no checking for pghpf... no checking for epcf90... no checking for gfortran... no checking for g95... no checking for f95... no checking for fort... no checking for xlf95... no checking for ifort... no checking for ifc... no checking for efc... no checking for pgf95... no checking for lf95... no checking for ftn... no checking whether we are using the GNU Fortran 77 compiler... no checking whether accepts -g... no checking the maximum length of command line arguments... 32768 checking command to parse /usr/bin/nm -B output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes configure: creating libtool appending configuration tag "CXX" to libtool checking for ld used by g++... /usr/bin/ld -m elf_x86_64 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC checking if g++ PIC flag -fPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate appending configuration tag "F77" to libtool checking for autoconf... /usr/bin/autoconf checking for autoheader... /usr/bin/autoheader checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking dependency style of gcc... (cached) gcc3 checking how to run the C preprocessor... gcc -E checking for a BSD-compatible install... /usr/bin/install -c checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking for bison... bison -y checking for flex... flex checking for yywrap in -lfl... yes checking lex output file root... lex.yy checking whether yytext is a pointer... yes checking for ar... /usr/bin/ar checking for ANSI C header files... (cached) yes checking sys/param.h usability... yes checking sys/param.h presence... yes checking for sys/param.h... yes checking whether byte ordering is bigendian... no checking for off_t... yes checking for size_t... yes checking whether struct tm is in sys/time.h or time.h... time.h checking for intmax_t... yes checking for library containing getopt... none required checking for strtoimax... yes checking for strtoll... yes checking for mergesort... no checking for mkstemps... yes configure: creating ./config.status config.status: creating skeletons/standard-modules/Makefile config.status: creating skeletons/tests/Makefile config.status: creating libasn1compiler/Makefile config.status: creating libasn1parser/Makefile config.status: creating libasn1print/Makefile config.status: creating asn1c/webcgi/Makefile config.status: creating asn1c/tests/Makefile config.status: creating libasn1fix/Makefile config.status: creating skeletons/Makefile config.status: creating examples/Makefile config.status: creating tests/Makefile config.status: creating asn1c/Makefile config.status: creating doc/Makefile config.status: creating asn1c.spec config.status: creating Makefile config.status: creating config.h config.status: executing depfiles commands + make -j 8 make all-recursive make[1]: Entering directory ' Making all in libasn1parser make[2]: Entering directory ' if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF ".deps/asn1parser.Tpo" -c -o asn1parser.lo asn1parser.c; \ then mv -f ".deps/asn1parser.Tpo" ".deps/asn1parser.Plo"; else rm -f ".deps/asn1parser.Tpo"; exit 1; fi bison -y -p asn1p_ -d asn1p_y.y if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF ".deps/asn1p_l.Tpo" -c -o asn1p_l.lo asn1p_l.c; \ then mv -f ".deps/asn1p_l.Tpo" ".deps/asn1p_l.Plo"; else rm -f ".deps/asn1p_l.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF ".deps/asn1p_module.Tpo" -c -o asn1p_module.lo asn1p_module.c; \ then mv -f ".deps/asn1p_module.Tpo" ".deps/asn1p_module.Plo"; else rm -f ".deps/asn1p_module.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF ".deps/asn1p_oid.Tpo" -c -o asn1p_oid.lo asn1p_oid.c; \ then mv -f ".deps/asn1p_oid.Tpo" ".deps/asn1p_oid.Plo"; else rm -f ".deps/asn1p_oid.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF ".deps/asn1p_value.Tpo" -c -o asn1p_value.lo asn1p_value.c; \ then mv -f ".deps/asn1p_value.Tpo" ".deps/asn1p_value.Plo"; else rm -f ".deps/asn1p_value.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF ".deps/asn1p_expr.Tpo" -c -o asn1p_expr.lo asn1p_expr.c; \ then mv -f ".deps/asn1p_expr.Tpo" ".deps/asn1p_expr.Plo"; else rm -f ".deps/asn1p_expr.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF ".deps/asn1p_xports.Tpo" -c -o asn1p_xports.lo asn1p_xports.c; \ then mv -f ".deps/asn1p_xports.Tpo" ".deps/asn1p_xports.Plo"; else rm -f ".deps/asn1p_xports.Tpo"; exit 1; fi asn1p_y.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] mkdir .libs gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -fPIC -DPIC -o .libs/asn1parser.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -fPIC -DPIC -o .libs/asn1p_module.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -fPIC -DPIC -o .libs/asn1p_l.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -fPIC -DPIC -o .libs/asn1p_oid.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -fPIC -DPIC -o .libs/asn1p_value.o asn1p_l.c:3521:12: warning: 'input' defined but not used [-Wunused-function] static int input() ^~~~~ gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -fPIC -DPIC -o .libs/asn1p_expr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -fPIC -DPIC -o .libs/asn1p_xports.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -o asn1parser.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -o asn1p_module.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -o asn1p_xports.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -o asn1p_oid.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF ".deps/asn1p_constr.Tpo" -c -o asn1p_constr.lo asn1p_constr.c; \ then mv -f ".deps/asn1p_constr.Tpo" ".deps/asn1p_constr.Plo"; else rm -f ".deps/asn1p_constr.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -o asn1p_value.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF ".deps/asn1p_param.Tpo" -c -o asn1p_param.lo asn1p_param.c; \ then mv -f ".deps/asn1p_param.Tpo" ".deps/asn1p_param.Plo"; else rm -f ".deps/asn1p_param.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF ".deps/asn1p_class.Tpo" -c -o asn1p_class.lo asn1p_class.c; \ then mv -f ".deps/asn1p_class.Tpo" ".deps/asn1p_class.Plo"; else rm -f ".deps/asn1p_class.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF ".deps/asn1p_ref.Tpo" -c -o asn1p_ref.lo asn1p_ref.c; \ then mv -f ".deps/asn1p_ref.Tpo" ".deps/asn1p_ref.Plo"; else rm -f ".deps/asn1p_ref.Tpo"; exit 1; fi if test -f y.tab.h; then \ to=`echo "asn1p_y_H" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \ sed -e "/^#/!b" -e "s/Y_TAB_H/$to/g" -e "s|y\.tab\.h|asn1p_y.h|" \ y.tab.h >asn1p_y.ht; \ rm -f y.tab.h; \ if cmp -s asn1p_y.ht asn1p_y.h; then \ rm -f asn1p_y.ht ;\ else \ mv asn1p_y.ht asn1p_y.h; \ fi; \ fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -o asn1p_expr.o >/dev/null 2>&1 if test -f y.output; then \ mv y.output asn1p_y.output; \ fi sed '/^#/ s|y\.tab\.c|asn1p_y.c|' y.tab.c >asn1p_y.ct && mv asn1p_y.ct asn1p_y.c rm -f y.tab.c if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF ".deps/asn1p_y.Tpo" -c -o asn1p_y.lo asn1p_y.c; \ then mv -f ".deps/asn1p_y.Tpo" ".deps/asn1p_y.Plo"; else rm -f ".deps/asn1p_y.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -o asn1p_l.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -fPIC -DPIC -o .libs/asn1p_class.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -fPIC -DPIC -o .libs/asn1p_ref.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -fPIC -DPIC -o .libs/asn1p_param.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -fPIC -DPIC -o .libs/asn1p_constr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -o asn1p_ref.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -o asn1p_class.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -o asn1p_param.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF .deps/asn1p_y.Tpo -c asn1p_y.c -fPIC -DPIC -o .libs/asn1p_y.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -o asn1p_constr.o >/dev/null 2>&1 asn1p_y.y: In function 'asn1p_parse': asn1p_y.y:357:13: error: 'param' undeclared (first use in this function) *(void **)param = $1; ^~~~~ asn1p_y.y:357:13: note: each undeclared identifier is reported only once for each function it appears in Makefile:299: recipe for target 'asn1p_y.lo' failed make[2]: *** [asn1p_y.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory ' Makefile:302: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory ' Makefile:212: recipe for target 'all' failed make: *** [all] Error 2 Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Fri Jul 27 15:26:52 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Fri, 27 Jul 2018 15:26:52 +0000 Subject: Change in osmo-ttcn3-hacks[master]: detect VTY TELNET port connection failures (attempt #2) Message-ID: Stefan Sperling has uploaded this change for review. ( https://gerrit.osmocom.org/10196 Change subject: detect VTY TELNET port connection failures (attempt #2) ...................................................................... detect VTY TELNET port connection failures (attempt #2) Pass the CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT parameter to the TELNET port by default. This allows tests to make progress into an error handling path if they are started while the osmo-* program they want to connect on VTY is not running. Observed with osmo-ggsn tests, where if the one test runs into a VTY connection failure the subsequent test would get stuck forever in a map() call on the VTY TELNET port. Teach the function f_vty_wait_for_prompt() about connection reports by the TELNET module. We may now receive an integer which represents the socket file descriptor for the telnet connection. This case was not handled by the previous change made in commit cb111b21aba1d5881da1a1d3f19754cbd15b3779. As a result, BSC tests started failing with "VTY Timeout for prompt" because the alt-statement in f_vty_wait_for_prompt() would not progress past the integer sitting on the VTY port's receive queue. Change-Id: I56925f93af6c55e93f3f417099db135744da6a40 Related: OS#3149 --- M bsc/BSC_Tests.default M bts/BTS_Tests.default M ggsn_tests/GGSN_Tests.default M hlr/HLR_Tests.default M library/Osmocom_VTY_Functions.ttcn M msc/MSC_Tests.default M sccp/SCCP_Tests.default M sgsn/SGSN_Tests.default M sip/SIP_Tests.default 9 files changed, 17 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/96/10196/1 diff --git a/bsc/BSC_Tests.default b/bsc/BSC_Tests.default index c13f7b0..8818359 100644 --- a/bsc/BSC_Tests.default +++ b/bsc/BSC_Tests.default @@ -15,6 +15,7 @@ *.BSCVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.BSCVTY.CTRL_READMODE := "buffered" *.BSCVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" +*.BSCVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.BSCVTY.PROMPT1 := "OsmoBSC> " [MODULE_PARAMETERS] diff --git a/bts/BTS_Tests.default b/bts/BTS_Tests.default index 502c17f..f254993 100644 --- a/bts/BTS_Tests.default +++ b/bts/BTS_Tests.default @@ -12,6 +12,7 @@ *.BTSVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.BTSVTY.CTRL_READMODE := "buffered" *.BTSVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" +*.BTSVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.BTSVTY.PROMPT1 := "OsmoBTS> " *.PCU.socket_type := "SEQPACKET" diff --git a/ggsn_tests/GGSN_Tests.default b/ggsn_tests/GGSN_Tests.default index ff0cd97..4d52e24 100644 --- a/ggsn_tests/GGSN_Tests.default +++ b/ggsn_tests/GGSN_Tests.default @@ -8,6 +8,7 @@ *.GGSNVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.GGSNVTY.CTRL_READMODE := "buffered" *.GGSNVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" +*.GGSNVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.GGSNVTY.PROMPT1 := "OsmoGGSN> " [MODULE_PARAMETERS] diff --git a/hlr/HLR_Tests.default b/hlr/HLR_Tests.default index f458479..84d4ff3 100644 --- a/hlr/HLR_Tests.default +++ b/hlr/HLR_Tests.default @@ -9,6 +9,7 @@ *.VTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.VTY.CTRL_READMODE := "buffered" *.VTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" +*.VTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.VTY.PROMPT1 := "OsmoHLR> " [MODULE_PARAMETERS] diff --git a/library/Osmocom_VTY_Functions.ttcn b/library/Osmocom_VTY_Functions.ttcn index 6e4eb74..427bd5c 100644 --- a/library/Osmocom_VTY_Functions.ttcn +++ b/library/Osmocom_VTY_Functions.ttcn @@ -46,6 +46,7 @@ /* wait for any of the permitted prompts; buffer + return all intermediate output */ function f_vty_wait_for_prompt(TELNETasp_PT pt) return charstring { var charstring rx, buf := ""; + var integer fd; timer T := 2.0; T.start; @@ -57,6 +58,14 @@ testcase.stop(fail, "VTY: Unknown Command"); }; [] pt.receive(charstring:?) -> value rx { buf := buf & rx; repeat }; + [] pt.receive(integer:?) -> value fd { + if (fd == -1) { + setverdict(fail, "VTY Telnet Connection Failure"); + mtc.stop; + } else { + repeat; /* telnet connection succeeded */ + } + } [] T.timeout { setverdict(fail, "VTY Timeout for prompt"); mtc.stop; diff --git a/msc/MSC_Tests.default b/msc/MSC_Tests.default index bcaae06..a24fa38 100644 --- a/msc/MSC_Tests.default +++ b/msc/MSC_Tests.default @@ -20,6 +20,7 @@ *.MSCVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.MSCVTY.CTRL_READMODE := "buffered" *.MSCVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" +*.MSCVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.MSCVTY.PROMPT1 := "OsmoMSC> " diff --git a/sccp/SCCP_Tests.default b/sccp/SCCP_Tests.default index 7d16e5b..95e0d2f 100644 --- a/sccp/SCCP_Tests.default +++ b/sccp/SCCP_Tests.default @@ -15,6 +15,7 @@ *.SCCP_DEMO_USER_VTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.SCCP_DEMO_USER_VTY.CTRL_READMODE := "buffered" *.SCCP_DEMO_USER_VTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" +*.SCCP_DEMO_USER_VTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.SCCP_DEMO_USER_VTY.PROMPT1 := "sccp-demo-user> " [MODULE_PARAMETERS] diff --git a/sgsn/SGSN_Tests.default b/sgsn/SGSN_Tests.default index bac5fdd..3957e82 100644 --- a/sgsn/SGSN_Tests.default +++ b/sgsn/SGSN_Tests.default @@ -15,6 +15,7 @@ *.SGSNVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.SGSNVTY.CTRL_READMODE := "buffered" *.SGSNVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" +*.SGSNVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.SGSNVTY.PROMPT1 := "OsmoSGSN> " diff --git a/sip/SIP_Tests.default b/sip/SIP_Tests.default index 2576b33..4434a1a 100644 --- a/sip/SIP_Tests.default +++ b/sip/SIP_Tests.default @@ -13,6 +13,7 @@ *.SIPVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.SIPVTY.CTRL_READMODE := "buffered" *.SIPVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" +*.SIPVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.SIPVTY.PROMPT1 := "OsmoSIPcon> " *.SIP.local_sip_port := "5060" -- To view, visit https://gerrit.osmocom.org/10196 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I56925f93af6c55e93f3f417099db135744da6a40 Gerrit-Change-Number: 10196 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 15:39:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 15:39:24 +0000 Subject: Change in osmo-gsm-tester[master]: nanobts: Support multiTRX In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10195 ) Change subject: nanobts: Support multiTRX ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10195 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib3962f824a804e2aa582601475a8514c6cb0d8e7 Gerrit-Change-Number: 10195 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Fri, 27 Jul 2018 15:39:24 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 15:39:42 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 15:39:42 +0000 Subject: Change in osmo-gsm-tester[master]: bts: Recreate resources.conf trx_list with len based on num_trx In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10194 ) Change subject: bts: Recreate resources.conf trx_list with len based on num_trx ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10194 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I28ed34abeedaa0ee2e7862ced45a46042192d831 Gerrit-Change-Number: 10194 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Fri, 27 Jul 2018 15:39:42 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 15:41:34 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 15:41:34 +0000 Subject: Change in libosmocore[master]: port rest octets encoding code from osmo-bsc In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10189 ) Change subject: port rest octets encoding code from osmo-bsc ...................................................................... Patch Set 1: Code-Review+1 (1 comment) good to me, but re-licensing must be checked. https://gerrit.osmocom.org/#/c/10189/1/src/gsm/gsm48_rest_octets.c File src/gsm/gsm48_rest_octets.c: https://gerrit.osmocom.org/#/c/10189/1/src/gsm/gsm48_rest_octets.c at 10 PS1, Line 10: GNU Affero we must re-license the code under GPLv2-or-later. For my own code and sysmocom code I approve of this. Please investigate if there are any other copyrights / commits in the original code. -- To view, visit https://gerrit.osmocom.org/10189 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I47888965ab11bba1186c21987f1365c9270abeab Gerrit-Change-Number: 10189 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Fri, 27 Jul 2018 15:41:34 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 15:42:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 15:42:57 +0000 Subject: Change in libosmocore[master]: port arfcn range encode support from osmo-bsc In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10185 ) Change subject: port arfcn range encode support from osmo-bsc ...................................................................... Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/10185/3/src/gsm/gsm48_arfcn_range_encode.c File src/gsm/gsm48_arfcn_range_encode.c: https://gerrit.osmocom.org/#/c/10185/3/src/gsm/gsm48_arfcn_range_encode.c at 10 PS3, Line 10: * it under the terms of the GNU Affero General Public License as published by GNU GPLv2-or-later. Please check any non-sysmocom / non-ONW authors that have contributed [significantly] tp the code that you imported here. If there are any (Holger included) we must contact them to get their approval for re-licensingu under GPLv2-or-later -- To view, visit https://gerrit.osmocom.org/10185 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c Gerrit-Change-Number: 10185 Gerrit-PatchSet: 3 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-CC: Harald Welte Gerrit-Comment-Date: Fri, 27 Jul 2018 15:42:57 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 15:43:01 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 15:43:01 +0000 Subject: Change in libosmocore[master]: port arfcn range encode support from osmo-bsc In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10185 ) Change subject: port arfcn range encode support from osmo-bsc ...................................................................... Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/10185 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c Gerrit-Change-Number: 10185 Gerrit-PatchSet: 3 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-Comment-Date: Fri, 27 Jul 2018 15:43:01 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 15:47:58 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 15:47:58 +0000 Subject: Change in osmo-bsc[master]: inter-BSC HO: neighbor_ident API: drop 9bit BSIC In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10164 ) Change subject: inter-BSC HO: neighbor_ident API: drop 9bit BSIC ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10164 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I29b92f47da2636d3a19f073755f9382fa98f9010 Gerrit-Change-Number: 10164 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Fri, 27 Jul 2018 15:47:58 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 15:49:38 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 15:49:38 +0000 Subject: Change in osmo-bsc[master]: inter-BSC HO: add neighbor_ident API to manage neighbor-BSS-cells In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9666 ) Change subject: inter-BSC HO: add neighbor_ident API to manage neighbor-BSS-cells ...................................................................... Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/9666/3/tests/handover/neighbor_ident_test.c File tests/handover/neighbor_ident_test.c: https://gerrit.osmocom.org/#/c/9666/3/tests/handover/neighbor_ident_test.c at 33 PS3, Line 33: arfcn > Leaving for the future then, but I still haven't grokked where the 0x8000 is coming from. [?] The 0x8000 is osmocom specific representation of ARFCN numbers with PCS band. It was first introduced in OsmcoomBB, AFAIR. In 3GPP, AFAIK, the ARFCN number is always only 10 bits, and the context will tell you if it's PCS or not. Or, maybe, in some instances an external bit somewhere. -- To view, visit https://gerrit.osmocom.org/9666 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0153d7069817fba9146ddc11214de2757d7d37bf Gerrit-Change-Number: 9666 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 27 Jul 2018 15:49:38 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 15:53:42 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 27 Jul 2018 15:53:42 +0000 Subject: =?UTF-8?Q?Change_in_libosmocore=5Bmaster=5D=3A_Bump_version=3A_0=2E11=2E0=2E91-9d4a3-dirty_=E2=86=92_0=2E12=2E0?= Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10197 Change subject: Bump version: 0.11.0.91-9d4a3-dirty ? 0.12.0 ...................................................................... Bump version: 0.11.0.91-9d4a3-dirty ? 0.12.0 Change-Id: I7e66432f37e13fd4c31389e3d89593fa0981e58f --- M TODO-RELEASE M debian/changelog M debian/control R debian/libosmocore11.install R debian/libosmogsm10.install M src/Makefile.am M src/codec/Makefile.am M src/coding/Makefile.am M src/ctrl/Makefile.am M src/gb/Makefile.am M src/gsm/Makefile.am M src/vty/Makefile.am 12 files changed, 131 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/97/10197/1 diff --git a/TODO-RELEASE b/TODO-RELEASE index 7b225cc..8ccfa49 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -7,6 +7,3 @@ # 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 -gsup gsup.h the 'osmo_gsup_message' struct extended with - session information => ABI changed - SS/USSD information => ABI changed diff --git a/debian/changelog b/debian/changelog index 393ea17..606d923 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,120 @@ +libosmocore (0.12.0) unstable; urgency=medium + + [ Pau Espin Pedrol ] + * control_if: Avoid heap-use-after-free in osmo_wqueue_bfd_cb + * configure: Check separately for lib implementing dlopen and dlsym + * tests: bitrev_test: Fix dynamic-stack-buffer-overflow + * tests: gea_test: Use correct max size for key in buffer + * tests: a5_test: Print wrong buffer correctly on error + * gsm: kasumi: Fix dynamic-stack-buffer-overflow on out buffers not multiple of 64 bits + * gsm: lapdm.c: Add missing new line char in notice log string + * ctrl: Log CMD TYPE on invalid ID number + * ctrl: Fix parsing of ERROR recvd msgs with id=err + * gsm0808: Add value_string for encryption algorithms + * ctrl: Introduce ctrl_cmd_parse3 API + * ctrl: ctrl_handle_msg: Avoid sending back received ERROR msgs + * tests: ctrl: Test received ERROR messages are handled correctly + * libosmocoding: clarify return values for TCH decoding functions + * libosmocodec: FR err concealment: Fix too many silent frames generated + * tests: codec: ecu_fr: Print XMAXC fields + * tests: codec: ecu_fr: Add buffer with unequal XMAXC values + * rate_ctr: Improve logging + * logging: log_vty_command_string: Fix undercount of buf alloc size + * logging_vty: Simplify code in config_write_log_single + * logging.c: Fix whitespace typo + + [ Harald Welte ] + * lapdm: Fix back-pointer from lapdm_entity to lapdm_channel + * lapdm: Implement SABM related constraints + * lapdm: cleanup: send_rslms_rll_l3_ui(): Use msgb_tv_push() + * lapdm: send_rslms_rll_l3_ui(): Don't include B4/SACCH IE unless needed + * lapdm: don't enforce contention resolution on SAPI0/DCCH + * Add osmo_timerfd_* functions for osmo_fd-wrapped timerfd + * import isdn4linux HDLC code from linux kernel + * isdnhdlc: Port from kernel to userspace + * mncc: properly export osmo_mncc_name() + * cosmetic: Whitespace fixes in control_if.c + * ctrl: Introduce libosmoctrl.map to avoid unintended exports + * ctrl: Add doxygen API documentation; generate html from it + * debian: Add libosmoctrl-doc sub-package + * gsm_08_08.h: Add enum for LCLS config, control and status + * gsm0808: Add encoding functions for LCLS BSSMAP messages + * gsm0808: Add value_string for LCLS related IEs + * tlv: Add TLVP_VAL_MINLEN() to obtain value _if_ length is >= minimum + * Add osmo_isqrt32() to compute 32bit integer square root + * fsm: Change semantics of LOGPFSML() log-level + * vty: Don't dump deprecated commands in XML export + * vty: Add logging_vty_add_deprecated_subsys + * gsup: Add osmo_gsup_get_err_msg_type() function + * gsup: Add value_string for Session State IE + * gsm 04.80: Add value_string for component type and op code + * Fix embedded (arm-none-eabi) builds + * jenkins_arm.sh: Don't run 'make check' on embedded builds + * jenkins_arch.sh: Accept "arm-none-eabi" as alias for "arm" + * jenkins_arch.sh: Exit with error on unknown architecture + * Don't call abort() directly, always use osmo_panic() + * osmo_panic(): Annotate as __attribute__ ((noreturn)) + * gprs_ns.h: Declare gprs_ns_cause_str() which already existed in c file + + [ Stefan Sperling ] + * define a constant for the max length of called party BCD IE + * introduce vty_out_rate_ctr_group_fmt() function + * Add a 'show rate-counters' VTY command. + * remove unused argument from pad_append_ctr() helper function + * check bssgp_tlv_parse() return code in bssgp_rcvmsg() + * return error to sender upon bssgp_tlv_parse() failure + + [ Neels Hofmeyr ] + * add gsm0808 channel enum to IE val conversion functions + * add gsm0808_cell_id_to_list() + * add support for gsm0808 HANDOVER REQUIRED message + * add gsm0808_create_handover_request_ack() + * add osmo_fsm_inst_state_chg_keep_timer() + * fix gsm0808_permitted_speech(): don't return HR3 for TCH_F + AMR + * add and tweak inter-BSC HO API + * vty/command.c: talloc from tall_vty_cmd_ctx, not NULL + * vty: cosmetic: cmd_deopt(): use talloc_strndup(), not memcpy() + * vty: fix use-after-free and memleaks in is_cmd_ambiguous() + * utils_test: fix isqrt_test calculation range + * utils_test: check stderr to catch sanitizer issues + * add osmo_sockaddr_to_str_and_uint() + + [ Philipp Maier ] + * fsm: guard action callback + * gsm_04_08: add function to get value string + * gsm_08_08: gsm0808_permitted_speech does not have value strings + + [ Thorsten Alteholz ] + * fix spelling + + [ Keith ] + * Add enum gsm48_cause_coding from GSM 04.08 Section 10.5.4.11 + * Add enum gsm48_progress_desc + + [ Daniel Willmann ] + * ports.h: Add ctrl port for osmo-gbproxy + * Add function gprs_nsvc_state_append + * stats_vty: Add asciidoc sections between the different counters + + [ Vadim Yanitskiy ] + * gsm0480: fix: don't overwrite the data of RELEASE_COMPLETE + * GSUP: implement TCAP-like session management + * GSUP: introduce new messages for SS/USSD payloads + * Doxygen: gitignore generated files for libosmoctrl + * gsm/gsm0480.c: introduce gsm0480_extract_ie_by_tag() + * gsm/gsm0480: refactor and expose gsm0480_parse_facility_ie() + * Don't enforce Python 2 for utilities + + [ Alexander Chemeris ] + * coding: Fix (E)GPRS BER calculation to correctly account for puncturing. + * coding: Documentation typo fix. + + [ Alexander Couzens ] + * vty: initialize termios before using it + * stats_statsd: sanitize statsd name + + -- Pau Espin Pedrol Fri, 27 Jul 2018 17:31:46 +0200 + libosmocore (0.11.0) unstable; urgency=medium [ Max ] diff --git a/debian/control b/debian/control index 1de0ceb..540a8b5 100644 --- a/debian/control +++ b/debian/control @@ -27,9 +27,9 @@ Multi-Arch: foreign Depends: libosmocodec0 (= ${binary:Version}), libosmocoding0 (= ${binary:Version}), - libosmocore10 (= ${binary:Version}), + libosmocore11 (= ${binary:Version}), libosmogb6 (= ${binary:Version}), - libosmogsm9 (= ${binary:Version}), + libosmogsm10 (= ${binary:Version}), libosmovty4 (= ${binary:Version}), libosmoctrl0 (= ${binary:Version}), libosmosim0 (= ${binary:Version}), @@ -110,7 +110,7 @@ . This package contains the documentation for the libosmocoding library. -Package: libosmocore10 +Package: libosmocore11 Section: libs Architecture: any Multi-Arch: same @@ -124,14 +124,14 @@ (at least) other programs that are developed in the sphere of Free Software / Open Source mobile communication. . - The libosmocore10 library in particular is a collection of common code used in + The libosmocore11 library in particular is a collection of common code used in various sub-projects inside the Osmocom family of projects. Package: libosmocore-doc Architecture: all Section: doc Depends: ${misc:Depends}, - libosmocore10, + libosmocore11, libjs-jquery, libosmocodec-doc, libosmocoding-doc, @@ -178,7 +178,7 @@ . This package contains the documentation for the libosmogb library. -Package: libosmogsm9 +Package: libosmogsm10 Section: libs Architecture: any Multi-Arch: same @@ -202,7 +202,7 @@ Architecture: all Section: doc Depends: ${misc:Depends}, - libosmogsm9, + libosmogsm10, libjs-jquery Description: Documentation for the Osmo GSM utility library This is part of the libosmocore "meta"-library. The libosmocore library diff --git a/debian/libosmocore10.install b/debian/libosmocore11.install similarity index 100% rename from debian/libosmocore10.install rename to debian/libosmocore11.install diff --git a/debian/libosmogsm9.install b/debian/libosmogsm10.install similarity index 100% rename from debian/libosmogsm9.install rename to debian/libosmogsm10.install diff --git a/src/Makefile.am b/src/Makefile.am index 45fb89d..e9db32f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -LIBVERSION=10:0:0 +LIBVERSION=11:0:0 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include AM_CFLAGS = -Wall $(TALLOC_CFLAGS) diff --git a/src/codec/Makefile.am b/src/codec/Makefile.am index 60fce5e..b522d43 100644 --- a/src/codec/Makefile.am +++ b/src/codec/Makefile.am @@ -1,7 +1,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -LIBVERSION=1:0:1 +LIBVERSION=1:1:1 AM_CPPFLAGS = -I$(top_srcdir)/include $(TALLOC_CFLAGS) AM_CFLAGS = -Wall diff --git a/src/coding/Makefile.am b/src/coding/Makefile.am index a17e3d1..c001c13 100644 --- a/src/coding/Makefile.am +++ b/src/coding/Makefile.am @@ -1,7 +1,7 @@ # 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:1 +LIBVERSION = 1:1:1 AM_CPPFLAGS = \ -I"$(top_srcdir)/include" \ diff --git a/src/ctrl/Makefile.am b/src/ctrl/Makefile.am index a51ae05..fe7c47d 100644 --- a/src/ctrl/Makefile.am +++ b/src/ctrl/Makefile.am @@ -1,7 +1,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -LIBVERSION=2:0:2 +LIBVERSION=3:0:3 AM_CFLAGS = -Wall $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)/include $(TALLOC_CFLAGS) diff --git a/src/gb/Makefile.am b/src/gb/Makefile.am index 70a451d..03052fa 100644 --- a/src/gb/Makefile.am +++ b/src/gb/Makefile.am @@ -1,6 +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=6:0:0 +LIBVERSION=7:0:1 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include AM_CFLAGS = -Wall ${GCC_FVISIBILITY_HIDDEN} -fno-strict-aliasing $(TALLOC_CFLAGS) @@ -23,4 +23,3 @@ endif EXTRA_DIST = libosmogb.map - diff --git a/src/gsm/Makefile.am b/src/gsm/Makefile.am index 5387e3a..900fcfa 100644 --- a/src/gsm/Makefile.am +++ b/src/gsm/Makefile.am @@ -1,7 +1,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -LIBVERSION=9:0:0 +LIBVERSION=10:0:0 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include $(TALLOC_CFLAGS) AM_CFLAGS = -Wall ${GCC_FVISIBILITY_HIDDEN} diff --git a/src/vty/Makefile.am b/src/vty/Makefile.am index 18d3a84..5d0ded7 100644 --- a/src/vty/Makefile.am +++ b/src/vty/Makefile.am @@ -1,7 +1,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -LIBVERSION=4:1:0 +LIBVERSION=5:0:5 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include AM_CFLAGS = -Wall $(TALLOC_CFLAGS) -- To view, visit https://gerrit.osmocom.org/10197 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I7e66432f37e13fd4c31389e3d89593fa0981e58f Gerrit-Change-Number: 10197 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 16:12:19 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 27 Jul 2018 16:12:19 +0000 Subject: =?UTF-8?Q?Change_in_libosmocore=5Bmaster=5D=3A_Bump_version=3A_0=2E11=2E0=2E91-9d4a3-dirty_=E2=86=92_0=2E12=2E0?= In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10197 ) Change subject: Bump version: 0.11.0.91-9d4a3-dirty ? 0.12.0 ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10197 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7e66432f37e13fd4c31389e3d89593fa0981e58f Gerrit-Change-Number: 10197 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 27 Jul 2018 16:12:19 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 16:12:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 16:12:20 +0000 Subject: =?UTF-8?Q?Change_in_libosmocore=5Bmaster=5D=3A_Bump_version=3A_0=2E11=2E0=2E91-9d4a3-dirty_=E2=86=92_0=2E12=2E0?= In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10197 ) Change subject: Bump version: 0.11.0.91-9d4a3-dirty ? 0.12.0 ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10197 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7e66432f37e13fd4c31389e3d89593fa0981e58f Gerrit-Change-Number: 10197 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 27 Jul 2018 16:12:20 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 16:12:21 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 27 Jul 2018 16:12:21 +0000 Subject: =?UTF-8?Q?Change_in_libosmocore=5Bmaster=5D=3A_Bump_version=3A_0=2E11=2E0=2E91-9d4a3-dirty_=E2=86=92_0=2E12=2E0?= In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/10197 ) Change subject: Bump version: 0.11.0.91-9d4a3-dirty ? 0.12.0 ...................................................................... Bump version: 0.11.0.91-9d4a3-dirty ? 0.12.0 Change-Id: I7e66432f37e13fd4c31389e3d89593fa0981e58f --- M TODO-RELEASE M debian/changelog M debian/control R debian/libosmocore11.install R debian/libosmogsm10.install M src/Makefile.am M src/codec/Makefile.am M src/coding/Makefile.am M src/ctrl/Makefile.am M src/gb/Makefile.am M src/gsm/Makefile.am M src/vty/Makefile.am 12 files changed, 131 insertions(+), 18 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved Harald Welte: Looks good to me, approved diff --git a/TODO-RELEASE b/TODO-RELEASE index 7b225cc..8ccfa49 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -7,6 +7,3 @@ # 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 -gsup gsup.h the 'osmo_gsup_message' struct extended with - session information => ABI changed - SS/USSD information => ABI changed diff --git a/debian/changelog b/debian/changelog index 393ea17..606d923 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,120 @@ +libosmocore (0.12.0) unstable; urgency=medium + + [ Pau Espin Pedrol ] + * control_if: Avoid heap-use-after-free in osmo_wqueue_bfd_cb + * configure: Check separately for lib implementing dlopen and dlsym + * tests: bitrev_test: Fix dynamic-stack-buffer-overflow + * tests: gea_test: Use correct max size for key in buffer + * tests: a5_test: Print wrong buffer correctly on error + * gsm: kasumi: Fix dynamic-stack-buffer-overflow on out buffers not multiple of 64 bits + * gsm: lapdm.c: Add missing new line char in notice log string + * ctrl: Log CMD TYPE on invalid ID number + * ctrl: Fix parsing of ERROR recvd msgs with id=err + * gsm0808: Add value_string for encryption algorithms + * ctrl: Introduce ctrl_cmd_parse3 API + * ctrl: ctrl_handle_msg: Avoid sending back received ERROR msgs + * tests: ctrl: Test received ERROR messages are handled correctly + * libosmocoding: clarify return values for TCH decoding functions + * libosmocodec: FR err concealment: Fix too many silent frames generated + * tests: codec: ecu_fr: Print XMAXC fields + * tests: codec: ecu_fr: Add buffer with unequal XMAXC values + * rate_ctr: Improve logging + * logging: log_vty_command_string: Fix undercount of buf alloc size + * logging_vty: Simplify code in config_write_log_single + * logging.c: Fix whitespace typo + + [ Harald Welte ] + * lapdm: Fix back-pointer from lapdm_entity to lapdm_channel + * lapdm: Implement SABM related constraints + * lapdm: cleanup: send_rslms_rll_l3_ui(): Use msgb_tv_push() + * lapdm: send_rslms_rll_l3_ui(): Don't include B4/SACCH IE unless needed + * lapdm: don't enforce contention resolution on SAPI0/DCCH + * Add osmo_timerfd_* functions for osmo_fd-wrapped timerfd + * import isdn4linux HDLC code from linux kernel + * isdnhdlc: Port from kernel to userspace + * mncc: properly export osmo_mncc_name() + * cosmetic: Whitespace fixes in control_if.c + * ctrl: Introduce libosmoctrl.map to avoid unintended exports + * ctrl: Add doxygen API documentation; generate html from it + * debian: Add libosmoctrl-doc sub-package + * gsm_08_08.h: Add enum for LCLS config, control and status + * gsm0808: Add encoding functions for LCLS BSSMAP messages + * gsm0808: Add value_string for LCLS related IEs + * tlv: Add TLVP_VAL_MINLEN() to obtain value _if_ length is >= minimum + * Add osmo_isqrt32() to compute 32bit integer square root + * fsm: Change semantics of LOGPFSML() log-level + * vty: Don't dump deprecated commands in XML export + * vty: Add logging_vty_add_deprecated_subsys + * gsup: Add osmo_gsup_get_err_msg_type() function + * gsup: Add value_string for Session State IE + * gsm 04.80: Add value_string for component type and op code + * Fix embedded (arm-none-eabi) builds + * jenkins_arm.sh: Don't run 'make check' on embedded builds + * jenkins_arch.sh: Accept "arm-none-eabi" as alias for "arm" + * jenkins_arch.sh: Exit with error on unknown architecture + * Don't call abort() directly, always use osmo_panic() + * osmo_panic(): Annotate as __attribute__ ((noreturn)) + * gprs_ns.h: Declare gprs_ns_cause_str() which already existed in c file + + [ Stefan Sperling ] + * define a constant for the max length of called party BCD IE + * introduce vty_out_rate_ctr_group_fmt() function + * Add a 'show rate-counters' VTY command. + * remove unused argument from pad_append_ctr() helper function + * check bssgp_tlv_parse() return code in bssgp_rcvmsg() + * return error to sender upon bssgp_tlv_parse() failure + + [ Neels Hofmeyr ] + * add gsm0808 channel enum to IE val conversion functions + * add gsm0808_cell_id_to_list() + * add support for gsm0808 HANDOVER REQUIRED message + * add gsm0808_create_handover_request_ack() + * add osmo_fsm_inst_state_chg_keep_timer() + * fix gsm0808_permitted_speech(): don't return HR3 for TCH_F + AMR + * add and tweak inter-BSC HO API + * vty/command.c: talloc from tall_vty_cmd_ctx, not NULL + * vty: cosmetic: cmd_deopt(): use talloc_strndup(), not memcpy() + * vty: fix use-after-free and memleaks in is_cmd_ambiguous() + * utils_test: fix isqrt_test calculation range + * utils_test: check stderr to catch sanitizer issues + * add osmo_sockaddr_to_str_and_uint() + + [ Philipp Maier ] + * fsm: guard action callback + * gsm_04_08: add function to get value string + * gsm_08_08: gsm0808_permitted_speech does not have value strings + + [ Thorsten Alteholz ] + * fix spelling + + [ Keith ] + * Add enum gsm48_cause_coding from GSM 04.08 Section 10.5.4.11 + * Add enum gsm48_progress_desc + + [ Daniel Willmann ] + * ports.h: Add ctrl port for osmo-gbproxy + * Add function gprs_nsvc_state_append + * stats_vty: Add asciidoc sections between the different counters + + [ Vadim Yanitskiy ] + * gsm0480: fix: don't overwrite the data of RELEASE_COMPLETE + * GSUP: implement TCAP-like session management + * GSUP: introduce new messages for SS/USSD payloads + * Doxygen: gitignore generated files for libosmoctrl + * gsm/gsm0480.c: introduce gsm0480_extract_ie_by_tag() + * gsm/gsm0480: refactor and expose gsm0480_parse_facility_ie() + * Don't enforce Python 2 for utilities + + [ Alexander Chemeris ] + * coding: Fix (E)GPRS BER calculation to correctly account for puncturing. + * coding: Documentation typo fix. + + [ Alexander Couzens ] + * vty: initialize termios before using it + * stats_statsd: sanitize statsd name + + -- Pau Espin Pedrol Fri, 27 Jul 2018 17:31:46 +0200 + libosmocore (0.11.0) unstable; urgency=medium [ Max ] diff --git a/debian/control b/debian/control index 1de0ceb..540a8b5 100644 --- a/debian/control +++ b/debian/control @@ -27,9 +27,9 @@ Multi-Arch: foreign Depends: libosmocodec0 (= ${binary:Version}), libosmocoding0 (= ${binary:Version}), - libosmocore10 (= ${binary:Version}), + libosmocore11 (= ${binary:Version}), libosmogb6 (= ${binary:Version}), - libosmogsm9 (= ${binary:Version}), + libosmogsm10 (= ${binary:Version}), libosmovty4 (= ${binary:Version}), libosmoctrl0 (= ${binary:Version}), libosmosim0 (= ${binary:Version}), @@ -110,7 +110,7 @@ . This package contains the documentation for the libosmocoding library. -Package: libosmocore10 +Package: libosmocore11 Section: libs Architecture: any Multi-Arch: same @@ -124,14 +124,14 @@ (at least) other programs that are developed in the sphere of Free Software / Open Source mobile communication. . - The libosmocore10 library in particular is a collection of common code used in + The libosmocore11 library in particular is a collection of common code used in various sub-projects inside the Osmocom family of projects. Package: libosmocore-doc Architecture: all Section: doc Depends: ${misc:Depends}, - libosmocore10, + libosmocore11, libjs-jquery, libosmocodec-doc, libosmocoding-doc, @@ -178,7 +178,7 @@ . This package contains the documentation for the libosmogb library. -Package: libosmogsm9 +Package: libosmogsm10 Section: libs Architecture: any Multi-Arch: same @@ -202,7 +202,7 @@ Architecture: all Section: doc Depends: ${misc:Depends}, - libosmogsm9, + libosmogsm10, libjs-jquery Description: Documentation for the Osmo GSM utility library This is part of the libosmocore "meta"-library. The libosmocore library diff --git a/debian/libosmocore10.install b/debian/libosmocore11.install similarity index 100% rename from debian/libosmocore10.install rename to debian/libosmocore11.install diff --git a/debian/libosmogsm9.install b/debian/libosmogsm10.install similarity index 100% rename from debian/libosmogsm9.install rename to debian/libosmogsm10.install diff --git a/src/Makefile.am b/src/Makefile.am index 45fb89d..e9db32f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -LIBVERSION=10:0:0 +LIBVERSION=11:0:0 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include AM_CFLAGS = -Wall $(TALLOC_CFLAGS) diff --git a/src/codec/Makefile.am b/src/codec/Makefile.am index 60fce5e..b522d43 100644 --- a/src/codec/Makefile.am +++ b/src/codec/Makefile.am @@ -1,7 +1,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -LIBVERSION=1:0:1 +LIBVERSION=1:1:1 AM_CPPFLAGS = -I$(top_srcdir)/include $(TALLOC_CFLAGS) AM_CFLAGS = -Wall diff --git a/src/coding/Makefile.am b/src/coding/Makefile.am index a17e3d1..c001c13 100644 --- a/src/coding/Makefile.am +++ b/src/coding/Makefile.am @@ -1,7 +1,7 @@ # 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:1 +LIBVERSION = 1:1:1 AM_CPPFLAGS = \ -I"$(top_srcdir)/include" \ diff --git a/src/ctrl/Makefile.am b/src/ctrl/Makefile.am index a51ae05..fe7c47d 100644 --- a/src/ctrl/Makefile.am +++ b/src/ctrl/Makefile.am @@ -1,7 +1,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -LIBVERSION=2:0:2 +LIBVERSION=3:0:3 AM_CFLAGS = -Wall $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)/include $(TALLOC_CFLAGS) diff --git a/src/gb/Makefile.am b/src/gb/Makefile.am index 70a451d..03052fa 100644 --- a/src/gb/Makefile.am +++ b/src/gb/Makefile.am @@ -1,6 +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=6:0:0 +LIBVERSION=7:0:1 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include AM_CFLAGS = -Wall ${GCC_FVISIBILITY_HIDDEN} -fno-strict-aliasing $(TALLOC_CFLAGS) @@ -23,4 +23,3 @@ endif EXTRA_DIST = libosmogb.map - diff --git a/src/gsm/Makefile.am b/src/gsm/Makefile.am index 5387e3a..900fcfa 100644 --- a/src/gsm/Makefile.am +++ b/src/gsm/Makefile.am @@ -1,7 +1,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -LIBVERSION=9:0:0 +LIBVERSION=10:0:0 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include $(TALLOC_CFLAGS) AM_CFLAGS = -Wall ${GCC_FVISIBILITY_HIDDEN} diff --git a/src/vty/Makefile.am b/src/vty/Makefile.am index 18d3a84..5d0ded7 100644 --- a/src/vty/Makefile.am +++ b/src/vty/Makefile.am @@ -1,7 +1,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -LIBVERSION=4:1:0 +LIBVERSION=5:0:5 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include AM_CFLAGS = -Wall $(TALLOC_CFLAGS) -- To view, visit https://gerrit.osmocom.org/10197 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I7e66432f37e13fd4c31389e3d89593fa0981e58f Gerrit-Change-Number: 10197 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 16:13:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 16:13:57 +0000 Subject: Change in osmo-ttcn3-hacks[master]: detect VTY TELNET port connection failures (attempt #2) In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10196 ) Change subject: detect VTY TELNET port connection failures (attempt #2) ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10196 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I56925f93af6c55e93f3f417099db135744da6a40 Gerrit-Change-Number: 10196 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Fri, 27 Jul 2018 16:13:57 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 16:15:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 16:15:24 +0000 Subject: Change in osmo-mgw[master]: mgcp_client: use IETF source port as for MGCP In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10188 ) Change subject: mgcp_client: use IETF source port as for MGCP ...................................................................... Patch Set 1: I'm still a bit ambiguous about this. It is the right thing to do, but it would mean that we can no longer run osmo-bsc and osmo-msc on the same machine with default configuration. What to do now? any ideas? We could simply adjust our default config files, or we could make sure only one of the two programs uses the "default" CA port, while the other uses e.g. default+1 ? -- To view, visit https://gerrit.osmocom.org/10188 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I96de84df3a3bf623d98b057ec3f3f621a3330a8a Gerrit-Change-Number: 10188 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Harald Welte Gerrit-Comment-Date: Fri, 27 Jul 2018 16:15:24 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 16:23:50 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 27 Jul 2018 16:23:50 +0000 Subject: =?UTF-8?Q?Change_in_libosmo-abis=5Bmaster=5D=3A_Bump_version=3A_0=2E5=2E0=2E10-a210-dirty_=E2=86=92_0=2E5=2E1?= Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10198 Change subject: Bump version: 0.5.0.10-a210-dirty ? 0.5.1 ...................................................................... Bump version: 0.5.0.10-a210-dirty ? 0.5.1 Change-Id: I9a606d5d3f9ce6baf99e69d60529332a460a9504 --- M configure.ac M debian/changelog M src/Makefile.am 3 files changed, 25 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/98/10198/1 diff --git a/configure.ac b/configure.ac index 0aca550..54d79f8 100644 --- a/configure.ac +++ b/configure.ac @@ -59,9 +59,9 @@ dnl Generate the output AM_CONFIG_HEADER(config.h) -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.11.0) -PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.11.0) -PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.11.0) +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.12.0) +PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.12.0) +PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.12.0) PKG_CHECK_MODULES(ORTP, ortp >= 0.22.0) AC_CHECK_HEADERS(dahdi/user.h,,AC_MSG_WARN(DAHDI input driver will not be built)) diff --git a/debian/changelog b/debian/changelog index 4c48e6e..8645b47 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,23 @@ +libosmo-abis (0.5.1) unstable; urgency=medium + + [ Pau Espin Pedrol ] + * ipaccess: ipaccess_rcvmsg: Drop unneeded memcpy + * ipaccess: Avoid using released line and bfd in ipaccess_fd_cb + * e1_input.c: Replace '.' in counter names with ':' + + [ Stefan Sperling ] + * fix double-free/use-after-free of pointers in struct e1inp_line + + [ Philipp Maier ] + * ortp: make sure the ortp scheduler is started + * ortp: reset rtp session on SSRC changes + * ortp: detect ssrc changes immediately + * ortp: enable scheduled mode on rtp socket creation + * Revert "ortp: make sure the ortp scheduler is started" + * Revert "ortp: enable scheduled mode on rtp socket creation" + + -- Pau Espin Pedrol Fri, 27 Jul 2018 18:15:18 +0200 + libosmo-abis (0.5.0) unstable; urgency=medium [ Max ] diff --git a/src/Makefile.am b/src/Makefile.am index ab42d38..eb2b572 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,8 +1,8 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -ABIS_LIBVERSION=6:0:0 -TRAU_LIBVERSION=3:0:1 +ABIS_LIBVERSION=6:1:0 +TRAU_LIBVERSION=3:1:1 AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir) AM_CFLAGS= -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(COVERAGE_CFLAGS) -- To view, visit https://gerrit.osmocom.org/10198 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I9a606d5d3f9ce6baf99e69d60529332a460a9504 Gerrit-Change-Number: 10198 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 16:34:01 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 27 Jul 2018 16:34:01 +0000 Subject: =?UTF-8?Q?Change_in_libosmo-netif=5Bmaster=5D=3A_Bump_version=3A_0=2E2=2E0=2E6-ac33-dirty_=E2=86=92_0=2E3=2E0?= Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10199 Change subject: Bump version: 0.2.0.6-ac33-dirty ? 0.3.0 ...................................................................... Bump version: 0.2.0.6-ac33-dirty ? 0.3.0 Change-Id: Ic9bbe8427c44ef2a9ee02537f17821048f177cdd --- M configure.ac M debian/changelog M debian/control R debian/libosmonetif6.install M src/Makefile.am 5 files changed, 22 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/99/10199/1 diff --git a/configure.ac b/configure.ac index f9346c0..4246c00 100644 --- a/configure.ac +++ b/configure.ac @@ -82,10 +82,10 @@ dnl Generate the output AM_CONFIG_HEADER(config.h) -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.11.0) -PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.11.0) +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.12.0) +PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.12.0) dnl FIXME: We depend on libosmoabis by now until we can move LAPD code here -PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.5.0) +PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.5.1) old_LIBS=$LIBS AC_SEARCH_LIBS([sctp_send], [sctp], [ diff --git a/debian/changelog b/debian/changelog index aa8e1fe..c08bf9e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,17 @@ +libosmo-netif (0.3.0) unstable; urgency=medium + + [ Pau Espin Pedrol ] + * tests: jibuf_test: Set some functions as static + * tests: jibuf_test: Add scenario to show out-of-order bug + * jibuf: Fix out-of-order seq queue around syncpoints + * osmux: change log lvl of batch full to debug + + [ Harald Welte ] + * remove "channel" layer + * stream.c: Use non-blocking connect in osmo_stream_cli + + -- Pau Espin Pedrol Fri, 27 Jul 2018 18:31:42 +0200 + libosmo-netif (0.2.0) unstable; urgency=medium [ Neels Hofmeyr ] diff --git a/debian/control b/debian/control index cec723d..b6bc17d 100644 --- a/debian/control +++ b/debian/control @@ -21,7 +21,7 @@ Vcs-Git: git://git.osmocom.org/libosmo-netif.git Homepage: https://projects.osmocom.org/projects/libosmo-netif -Package: libosmonetif4 +Package: libosmonetif6 Section: libs Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} @@ -38,7 +38,7 @@ Depends: ${misc:Depends}, libosmocore-dev, libosmocore, - libosmonetif4 (= ${binary:Version}) + libosmonetif6 (= ${binary:Version}) Multi-Arch: same Description: Development headers for Osmocom network interface The libosmo-netif library is one of the libraries needed by the @@ -52,7 +52,7 @@ Architecture: all Section: doc Depends: ${misc:Depends}, - libosmonetif4, + libosmonetif6, libjs-jquery Description: Documentation for the Osmo network interface library The libosmo-netif library is one of the libraries needed by the @@ -65,7 +65,7 @@ Section: debug Architecture: any Priority: extra -Depends: libosmonetif4 (= ${binary:Version}), ${misc:Depends} +Depends: libosmonetif6 (= ${binary:Version}), ${misc:Depends} Multi-Arch: same Description: Debug symbols for Osmocom network interface library The libosmo-netif library is one of the libraries needed by the diff --git a/debian/libosmonetif4.install b/debian/libosmonetif6.install similarity index 100% rename from debian/libosmonetif4.install rename to debian/libosmonetif6.install diff --git a/src/Makefile.am b/src/Makefile.am index 9951ca4..d88f0a7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +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=5:0:1 +LIBVERSION=6:0:0 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir) AM_CFLAGS= -fPIC -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(COVERAGE_CFLAGS) $(LIBSCTP_CFLAGS) -- To view, visit https://gerrit.osmocom.org/10199 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ic9bbe8427c44ef2a9ee02537f17821048f177cdd Gerrit-Change-Number: 10199 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 16:34:52 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 27 Jul 2018 16:34:52 +0000 Subject: =?UTF-8?Q?Change_in_libosmo-abis=5Bmaster=5D=3A_Bump_version=3A_0=2E5=2E0=2E10-a210-dirty_=E2=86=92_0=2E5=2E1?= In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10198 ) Change subject: Bump version: 0.5.0.10-a210-dirty ? 0.5.1 ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10198 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9a606d5d3f9ce6baf99e69d60529332a460a9504 Gerrit-Change-Number: 10198 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 27 Jul 2018 16:34:52 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 16:34:53 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 27 Jul 2018 16:34:53 +0000 Subject: =?UTF-8?Q?Change_in_libosmo-abis=5Bmaster=5D=3A_Bump_version=3A_0=2E5=2E0=2E10-a210-dirty_=E2=86=92_0=2E5=2E1?= In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/10198 ) Change subject: Bump version: 0.5.0.10-a210-dirty ? 0.5.1 ...................................................................... Bump version: 0.5.0.10-a210-dirty ? 0.5.1 Change-Id: I9a606d5d3f9ce6baf99e69d60529332a460a9504 --- M configure.ac M debian/changelog M src/Makefile.am 3 files changed, 25 insertions(+), 5 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/configure.ac b/configure.ac index 0aca550..54d79f8 100644 --- a/configure.ac +++ b/configure.ac @@ -59,9 +59,9 @@ dnl Generate the output AM_CONFIG_HEADER(config.h) -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.11.0) -PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.11.0) -PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.11.0) +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.12.0) +PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.12.0) +PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.12.0) PKG_CHECK_MODULES(ORTP, ortp >= 0.22.0) AC_CHECK_HEADERS(dahdi/user.h,,AC_MSG_WARN(DAHDI input driver will not be built)) diff --git a/debian/changelog b/debian/changelog index 4c48e6e..8645b47 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,23 @@ +libosmo-abis (0.5.1) unstable; urgency=medium + + [ Pau Espin Pedrol ] + * ipaccess: ipaccess_rcvmsg: Drop unneeded memcpy + * ipaccess: Avoid using released line and bfd in ipaccess_fd_cb + * e1_input.c: Replace '.' in counter names with ':' + + [ Stefan Sperling ] + * fix double-free/use-after-free of pointers in struct e1inp_line + + [ Philipp Maier ] + * ortp: make sure the ortp scheduler is started + * ortp: reset rtp session on SSRC changes + * ortp: detect ssrc changes immediately + * ortp: enable scheduled mode on rtp socket creation + * Revert "ortp: make sure the ortp scheduler is started" + * Revert "ortp: enable scheduled mode on rtp socket creation" + + -- Pau Espin Pedrol Fri, 27 Jul 2018 18:15:18 +0200 + libosmo-abis (0.5.0) unstable; urgency=medium [ Max ] diff --git a/src/Makefile.am b/src/Makefile.am index ab42d38..eb2b572 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,8 +1,8 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -ABIS_LIBVERSION=6:0:0 -TRAU_LIBVERSION=3:0:1 +ABIS_LIBVERSION=6:1:0 +TRAU_LIBVERSION=3:1:1 AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir) AM_CFLAGS= -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(COVERAGE_CFLAGS) -- To view, visit https://gerrit.osmocom.org/10198 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I9a606d5d3f9ce6baf99e69d60529332a460a9504 Gerrit-Change-Number: 10198 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 16:42:29 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 27 Jul 2018 16:42:29 +0000 Subject: =?UTF-8?Q?Change_in_libosmo-netif=5Bmaster=5D=3A_Bump_version=3A_0=2E2=2E0=2E6-ac33-dirty_=E2=86=92_0=2E3=2E0?= In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10199 ) Change subject: Bump version: 0.2.0.6-ac33-dirty ? 0.3.0 ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10199 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic9bbe8427c44ef2a9ee02537f17821048f177cdd Gerrit-Change-Number: 10199 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 27 Jul 2018 16:42:29 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 16:42:30 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 27 Jul 2018 16:42:30 +0000 Subject: =?UTF-8?Q?Change_in_libosmo-netif=5Bmaster=5D=3A_Bump_version=3A_0=2E2=2E0=2E6-ac33-dirty_=E2=86=92_0=2E3=2E0?= In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/10199 ) Change subject: Bump version: 0.2.0.6-ac33-dirty ? 0.3.0 ...................................................................... Bump version: 0.2.0.6-ac33-dirty ? 0.3.0 Change-Id: Ic9bbe8427c44ef2a9ee02537f17821048f177cdd --- M configure.ac M debian/changelog M debian/control R debian/libosmonetif6.install M src/Makefile.am 5 files changed, 22 insertions(+), 8 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/configure.ac b/configure.ac index f9346c0..4246c00 100644 --- a/configure.ac +++ b/configure.ac @@ -82,10 +82,10 @@ dnl Generate the output AM_CONFIG_HEADER(config.h) -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.11.0) -PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.11.0) +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.12.0) +PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.12.0) dnl FIXME: We depend on libosmoabis by now until we can move LAPD code here -PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.5.0) +PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.5.1) old_LIBS=$LIBS AC_SEARCH_LIBS([sctp_send], [sctp], [ diff --git a/debian/changelog b/debian/changelog index aa8e1fe..c08bf9e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,17 @@ +libosmo-netif (0.3.0) unstable; urgency=medium + + [ Pau Espin Pedrol ] + * tests: jibuf_test: Set some functions as static + * tests: jibuf_test: Add scenario to show out-of-order bug + * jibuf: Fix out-of-order seq queue around syncpoints + * osmux: change log lvl of batch full to debug + + [ Harald Welte ] + * remove "channel" layer + * stream.c: Use non-blocking connect in osmo_stream_cli + + -- Pau Espin Pedrol Fri, 27 Jul 2018 18:31:42 +0200 + libosmo-netif (0.2.0) unstable; urgency=medium [ Neels Hofmeyr ] diff --git a/debian/control b/debian/control index cec723d..b6bc17d 100644 --- a/debian/control +++ b/debian/control @@ -21,7 +21,7 @@ Vcs-Git: git://git.osmocom.org/libosmo-netif.git Homepage: https://projects.osmocom.org/projects/libosmo-netif -Package: libosmonetif4 +Package: libosmonetif6 Section: libs Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} @@ -38,7 +38,7 @@ Depends: ${misc:Depends}, libosmocore-dev, libosmocore, - libosmonetif4 (= ${binary:Version}) + libosmonetif6 (= ${binary:Version}) Multi-Arch: same Description: Development headers for Osmocom network interface The libosmo-netif library is one of the libraries needed by the @@ -52,7 +52,7 @@ Architecture: all Section: doc Depends: ${misc:Depends}, - libosmonetif4, + libosmonetif6, libjs-jquery Description: Documentation for the Osmo network interface library The libosmo-netif library is one of the libraries needed by the @@ -65,7 +65,7 @@ Section: debug Architecture: any Priority: extra -Depends: libosmonetif4 (= ${binary:Version}), ${misc:Depends} +Depends: libosmonetif6 (= ${binary:Version}), ${misc:Depends} Multi-Arch: same Description: Debug symbols for Osmocom network interface library The libosmo-netif library is one of the libraries needed by the diff --git a/debian/libosmonetif4.install b/debian/libosmonetif6.install similarity index 100% rename from debian/libosmonetif4.install rename to debian/libosmonetif6.install diff --git a/src/Makefile.am b/src/Makefile.am index 9951ca4..d88f0a7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +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=5:0:1 +LIBVERSION=6:0:0 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir) AM_CFLAGS= -fPIC -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(COVERAGE_CFLAGS) $(LIBSCTP_CFLAGS) -- To view, visit https://gerrit.osmocom.org/10199 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ic9bbe8427c44ef2a9ee02537f17821048f177cdd Gerrit-Change-Number: 10199 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 16:46:26 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 27 Jul 2018 16:46:26 +0000 Subject: =?UTF-8?Q?Change_in_libosmo-sccp=5Bmaster=5D=3A_Bump_version=3A_0=2E9=2E0=2E20-6265-dirty_=E2=86=92_0=2E10=2E0?= Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10200 Change subject: Bump version: 0.9.0.20-6265-dirty ? 0.10.0 ...................................................................... Bump version: 0.9.0.20-6265-dirty ? 0.10.0 Change-Id: Ia087b9f03a73a08f0eaa461f61c6244aaf13e3d4 --- M configure.ac M debian/changelog M debian/control M src/Makefile.am 4 files changed, 41 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/00/10200/1 diff --git a/configure.ac b/configure.ac index ff9a1c4..c0cc488 100644 --- a/configure.ac +++ b/configure.ac @@ -29,10 +29,10 @@ fi PKG_PROG_PKG_CONFIG([0.20]) -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.11.0) -PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.11.0) -PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.11.0) -PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.2.0) +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.12.0) +PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.12.0) +PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.12.0) +PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.3.0) old_LIBS=$LIBS AC_SEARCH_LIBS([sctp_send], [sctp], [ diff --git a/debian/changelog b/debian/changelog index 9d582a3..135d08e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,37 @@ +libosmo-sccp (0.10.0) unstable; urgency=medium + + [ Harald Welte ] + * debian/control: match build dependency versions with configure.ac + * osmo_ss7: Register 5000 as default port for IPA/SCCPlite + * Introduce osmo_ss7_register_rx_unknown_cb() for unknown PPID/StreamID + + [ Stefan Sperling ] + * free msgb for primitive allocated in lm_timer_cb() of lm_fsm + * fix infinite recursion with routing by global title + * fix use after free in osmo_sccp_simple_server_add_clnt() + * make it possible to pass parameters to m3ua_example + * rename m3ua_example to sccp_demo_user + * sccp_demo_user: use point code 23 for server and 1 for client + * remove unused -p option from getopt() call in sccp_demo_user + + [ Pau Espin Pedrol ] + * tests: xua_test: Fix use of wrong buffer for dest addr + * tests: xua_test: Fix array len computation + * build: Install example cfg files + * debian: Package installed example doc files + + [ Neels Hofmeyr ] + * fix memleak in ipa_rx_msg_sccp + * cosmetic: sccp2sua.c: log the IEI for parsed SCCP addr + * add osmo_xua_msg_tall_ctx_init() + * fix two memleaks in ipa_rx_msg_sccp() + * comment: explain xua_msg free in m3ua_rx_xfer() + + [ Daniel Willmann ] + * git-version-gen: Don't check for .git directory + + -- Pau Espin Pedrol Fri, 27 Jul 2018 18:45:39 +0200 + libosmo-sccp (0.9.0) unstable; urgency=medium [ Neels Hofmeyr ] diff --git a/debian/control b/debian/control index b1949cd..8680bba 100644 --- a/debian/control +++ b/debian/control @@ -5,7 +5,7 @@ Build-Depends: debhelper (>= 9), autotools-dev, pkg-config, - libosmocore-dev (>= 0.11.0), + libosmocore-dev (>= 0.12.0), autoconf, automake, libtool, @@ -13,7 +13,7 @@ git, doxygen, libdpkg-perl, - libosmo-netif-dev (>= 0.2.0), + libosmo-netif-dev (>= 0.3.0), libsctp-dev Standards-Version: 3.9.7 Vcs-Git: git://git.osmocom.org/libosmo-sccp.git diff --git a/src/Makefile.am b/src/Makefile.am index 3af23d1..9cea642 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -25,7 +25,7 @@ # 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:1 +LIBVERSION=2:0:2 libosmo_sigtran_la_SOURCES = sccp_sap.c sua.c m3ua.c xua_msg.c sccp_helpers.c \ sccp2sua.c sccp_scrc.c sccp_sclc.c sccp_scoc.c \ -- To view, visit https://gerrit.osmocom.org/10200 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ia087b9f03a73a08f0eaa461f61c6244aaf13e3d4 Gerrit-Change-Number: 10200 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 17:07:26 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 27 Jul 2018 17:07:26 +0000 Subject: =?UTF-8?Q?Change_in_libosmo-sccp=5Bmaster=5D=3A_Bump_version=3A_0=2E9=2E0=2E20-6265-dirty_=E2=86=92_0=2E10=2E0?= In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10200 ) Change subject: Bump version: 0.9.0.20-6265-dirty ? 0.10.0 ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10200 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia087b9f03a73a08f0eaa461f61c6244aaf13e3d4 Gerrit-Change-Number: 10200 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 27 Jul 2018 17:07:26 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 17:07:27 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 27 Jul 2018 17:07:27 +0000 Subject: =?UTF-8?Q?Change_in_libosmo-sccp=5Bmaster=5D=3A_Bump_version=3A_0=2E9=2E0=2E20-6265-dirty_=E2=86=92_0=2E10=2E0?= In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/10200 ) Change subject: Bump version: 0.9.0.20-6265-dirty ? 0.10.0 ...................................................................... Bump version: 0.9.0.20-6265-dirty ? 0.10.0 Change-Id: Ia087b9f03a73a08f0eaa461f61c6244aaf13e3d4 --- M configure.ac M debian/changelog M debian/control M src/Makefile.am 4 files changed, 41 insertions(+), 7 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/configure.ac b/configure.ac index ff9a1c4..c0cc488 100644 --- a/configure.ac +++ b/configure.ac @@ -29,10 +29,10 @@ fi PKG_PROG_PKG_CONFIG([0.20]) -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.11.0) -PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.11.0) -PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.11.0) -PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.2.0) +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.12.0) +PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.12.0) +PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.12.0) +PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.3.0) old_LIBS=$LIBS AC_SEARCH_LIBS([sctp_send], [sctp], [ diff --git a/debian/changelog b/debian/changelog index 9d582a3..135d08e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,37 @@ +libosmo-sccp (0.10.0) unstable; urgency=medium + + [ Harald Welte ] + * debian/control: match build dependency versions with configure.ac + * osmo_ss7: Register 5000 as default port for IPA/SCCPlite + * Introduce osmo_ss7_register_rx_unknown_cb() for unknown PPID/StreamID + + [ Stefan Sperling ] + * free msgb for primitive allocated in lm_timer_cb() of lm_fsm + * fix infinite recursion with routing by global title + * fix use after free in osmo_sccp_simple_server_add_clnt() + * make it possible to pass parameters to m3ua_example + * rename m3ua_example to sccp_demo_user + * sccp_demo_user: use point code 23 for server and 1 for client + * remove unused -p option from getopt() call in sccp_demo_user + + [ Pau Espin Pedrol ] + * tests: xua_test: Fix use of wrong buffer for dest addr + * tests: xua_test: Fix array len computation + * build: Install example cfg files + * debian: Package installed example doc files + + [ Neels Hofmeyr ] + * fix memleak in ipa_rx_msg_sccp + * cosmetic: sccp2sua.c: log the IEI for parsed SCCP addr + * add osmo_xua_msg_tall_ctx_init() + * fix two memleaks in ipa_rx_msg_sccp() + * comment: explain xua_msg free in m3ua_rx_xfer() + + [ Daniel Willmann ] + * git-version-gen: Don't check for .git directory + + -- Pau Espin Pedrol Fri, 27 Jul 2018 18:45:39 +0200 + libosmo-sccp (0.9.0) unstable; urgency=medium [ Neels Hofmeyr ] diff --git a/debian/control b/debian/control index b1949cd..8680bba 100644 --- a/debian/control +++ b/debian/control @@ -5,7 +5,7 @@ Build-Depends: debhelper (>= 9), autotools-dev, pkg-config, - libosmocore-dev (>= 0.11.0), + libosmocore-dev (>= 0.12.0), autoconf, automake, libtool, @@ -13,7 +13,7 @@ git, doxygen, libdpkg-perl, - libosmo-netif-dev (>= 0.2.0), + libosmo-netif-dev (>= 0.3.0), libsctp-dev Standards-Version: 3.9.7 Vcs-Git: git://git.osmocom.org/libosmo-sccp.git diff --git a/src/Makefile.am b/src/Makefile.am index 3af23d1..9cea642 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -25,7 +25,7 @@ # 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:1 +LIBVERSION=2:0:2 libosmo_sigtran_la_SOURCES = sccp_sap.c sua.c m3ua.c xua_msg.c sccp_helpers.c \ sccp2sua.c sccp_scrc.c sccp_sclc.c sccp_scoc.c \ -- To view, visit https://gerrit.osmocom.org/10200 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ia087b9f03a73a08f0eaa461f61c6244aaf13e3d4 Gerrit-Change-Number: 10200 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 17:10:08 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 27 Jul 2018 17:10:08 +0000 Subject: =?UTF-8?Q?Change_in_osmo-mgw=5Bmaster=5D=3A_Bump_version=3A_1=2E3=2E0=2E34-9cd52-dirty_=E2=86=92_1=2E4=2E0?= Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10201 Change subject: Bump version: 1.3.0.34-9cd52-dirty ? 1.4.0 ...................................................................... Bump version: 1.3.0.34-9cd52-dirty ? 1.4.0 Change-Id: Ice736ca8016be5ed000c30014b955f4e0f77cb4e --- M configure.ac M debian/changelog M src/libosmo-legacy-mgcp/Makefile.am M src/libosmo-mgcp-client/Makefile.am 4 files changed, 54 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/01/10201/1 diff --git a/configure.ac b/configure.ac index 0ded288..29390c6 100644 --- a/configure.ac +++ b/configure.ac @@ -39,10 +39,10 @@ AC_SUBST(LIBRARY_DL) -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.11.0) -PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.11.0) -PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.11.0) -PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.2.0) +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.12.0) +PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.12.0) +PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.12.0) +PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.3.0) AC_ARG_ENABLE(sanitize, [AS_HELP_STRING( diff --git a/debian/changelog b/debian/changelog index a8a850a..e731351 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,51 @@ +osmo-mgw (1.4.0) unstable; urgency=medium + + [ Philipp Maier ] + * network: independently initalize state->out_stream + * stats: use libosmocore rate counter for in/out_stream.err_ts_counter + * mgcp_sdp: correct apidoc of mgcp_parse_sdp_data + * vty: clean up rtp port-range command + * sdp: remove unused alt_codec field from struct mgcp_rtp_end + * sdp: remove circular inclusion + * protocol: Try whole port range on port allocation + * client: do not start connections in loopback mode + * mgcp_network: do not log destination invalid ip/port as error + * cosmetic: fix log output + * conn: call talloc_free before setting the pointer to NULL + * protocol: do not change LCO, when no LCO are present + * protocol: reject illegal lco options + * cosmetic: fix typo + * mgw: clean up codec negotiation (sdp) + * client: add features to generate and parse codec information + * mgcp_internal: remove unused struct member + * stats: replace packet statistic counters with libosmocore rate counters + * stat+vty: fix printing of rate counter values + * protocol: prevent unnecessary null pointer deref + + [ Pau Espin Pedrol ] + * legacy-mgcp: Add jitter buffer on the uplink receiver + * legacy-mgcp: switch to new osmux output APIs + * mgcp: mgcp_osmux: use conn_bts when forwarding pkts from bsc_nat + * mgcp: switch to new osmux output APIs + * debian: Package installed example doc files + * gitignore: Add m4 scripts from m4 subdir + + [ Neels Hofmeyr ] + * api doc: fix parameter name for mgcp_conn_create() + * mgcp-client: add mgcp_conn_get_ci() + * mgcp_client_fsm: improve error logging + * cosmetic: fix doxygen comment markers + * cosmetic: mgcp_network.c: merge one LOGPC to its preceding LOGP + * IuUP hack: make RTP patching less general + + [ Harald Welte ] + * cosmetic: fix typo in log message: 'abrupt' instead of 'aprupt' + + [ Daniel Willmann ] + * git-version-gen: Don't check for .git directory + + -- Pau Espin Pedrol Fri, 27 Jul 2018 19:05:22 +0200 + osmo-mgw (1.3.0) unstable; urgency=medium [ Pau Espin Pedrol ] diff --git a/src/libosmo-legacy-mgcp/Makefile.am b/src/libosmo-legacy-mgcp/Makefile.am index 4ee4e6a..2d6b6dd 100644 --- a/src/libosmo-legacy-mgcp/Makefile.am +++ b/src/libosmo-legacy-mgcp/Makefile.am @@ -24,7 +24,7 @@ # This is not at all related to the release version, but a range of supported # API versions. Read TODO_RELEASE in the source tree's root! -LEGACY_MGCP_LIBVERSION=0:1:0 +LEGACY_MGCP_LIBVERSION=1:0:1 lib_LTLIBRARIES = \ libosmo-legacy-mgcp.la \ diff --git a/src/libosmo-mgcp-client/Makefile.am b/src/libosmo-mgcp-client/Makefile.am index 01371d7..d3f8fff 100644 --- a/src/libosmo-mgcp-client/Makefile.am +++ b/src/libosmo-mgcp-client/Makefile.am @@ -20,7 +20,7 @@ # This is not at all related to the release version, but a range of supported # API versions. Read TODO_RELEASE in the source tree's root! -MGCP_CLIENT_LIBVERSION=3:0:0 +MGCP_CLIENT_LIBVERSION=4:0:1 lib_LTLIBRARIES = \ libosmo-mgcp-client.la \ -- To view, visit https://gerrit.osmocom.org/10201 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ice736ca8016be5ed000c30014b955f4e0f77cb4e Gerrit-Change-Number: 10201 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 17:12:48 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 27 Jul 2018 17:12:48 +0000 Subject: =?UTF-8?Q?Change_in_osmo-mgw=5Bmaster=5D=3A_Bump_version=3A_1=2E3=2E0=2E34-9cd52-dirty_=E2=86=92_1=2E4=2E0?= In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10201 ) Change subject: Bump version: 1.3.0.34-9cd52-dirty ? 1.4.0 ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10201 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ice736ca8016be5ed000c30014b955f4e0f77cb4e Gerrit-Change-Number: 10201 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 27 Jul 2018 17:12:48 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 17:12:51 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 27 Jul 2018 17:12:51 +0000 Subject: =?UTF-8?Q?Change_in_osmo-mgw=5Bmaster=5D=3A_Bump_version=3A_1=2E3=2E0=2E34-9cd52-dirty_=E2=86=92_1=2E4=2E0?= In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/10201 ) Change subject: Bump version: 1.3.0.34-9cd52-dirty ? 1.4.0 ...................................................................... Bump version: 1.3.0.34-9cd52-dirty ? 1.4.0 Change-Id: Ice736ca8016be5ed000c30014b955f4e0f77cb4e --- M configure.ac M debian/changelog M src/libosmo-legacy-mgcp/Makefile.am M src/libosmo-mgcp-client/Makefile.am 4 files changed, 54 insertions(+), 6 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/configure.ac b/configure.ac index 0ded288..29390c6 100644 --- a/configure.ac +++ b/configure.ac @@ -39,10 +39,10 @@ AC_SUBST(LIBRARY_DL) -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.11.0) -PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.11.0) -PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.11.0) -PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.2.0) +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.12.0) +PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.12.0) +PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.12.0) +PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.3.0) AC_ARG_ENABLE(sanitize, [AS_HELP_STRING( diff --git a/debian/changelog b/debian/changelog index a8a850a..e731351 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,51 @@ +osmo-mgw (1.4.0) unstable; urgency=medium + + [ Philipp Maier ] + * network: independently initalize state->out_stream + * stats: use libosmocore rate counter for in/out_stream.err_ts_counter + * mgcp_sdp: correct apidoc of mgcp_parse_sdp_data + * vty: clean up rtp port-range command + * sdp: remove unused alt_codec field from struct mgcp_rtp_end + * sdp: remove circular inclusion + * protocol: Try whole port range on port allocation + * client: do not start connections in loopback mode + * mgcp_network: do not log destination invalid ip/port as error + * cosmetic: fix log output + * conn: call talloc_free before setting the pointer to NULL + * protocol: do not change LCO, when no LCO are present + * protocol: reject illegal lco options + * cosmetic: fix typo + * mgw: clean up codec negotiation (sdp) + * client: add features to generate and parse codec information + * mgcp_internal: remove unused struct member + * stats: replace packet statistic counters with libosmocore rate counters + * stat+vty: fix printing of rate counter values + * protocol: prevent unnecessary null pointer deref + + [ Pau Espin Pedrol ] + * legacy-mgcp: Add jitter buffer on the uplink receiver + * legacy-mgcp: switch to new osmux output APIs + * mgcp: mgcp_osmux: use conn_bts when forwarding pkts from bsc_nat + * mgcp: switch to new osmux output APIs + * debian: Package installed example doc files + * gitignore: Add m4 scripts from m4 subdir + + [ Neels Hofmeyr ] + * api doc: fix parameter name for mgcp_conn_create() + * mgcp-client: add mgcp_conn_get_ci() + * mgcp_client_fsm: improve error logging + * cosmetic: fix doxygen comment markers + * cosmetic: mgcp_network.c: merge one LOGPC to its preceding LOGP + * IuUP hack: make RTP patching less general + + [ Harald Welte ] + * cosmetic: fix typo in log message: 'abrupt' instead of 'aprupt' + + [ Daniel Willmann ] + * git-version-gen: Don't check for .git directory + + -- Pau Espin Pedrol Fri, 27 Jul 2018 19:05:22 +0200 + osmo-mgw (1.3.0) unstable; urgency=medium [ Pau Espin Pedrol ] diff --git a/src/libosmo-legacy-mgcp/Makefile.am b/src/libosmo-legacy-mgcp/Makefile.am index 4ee4e6a..2d6b6dd 100644 --- a/src/libosmo-legacy-mgcp/Makefile.am +++ b/src/libosmo-legacy-mgcp/Makefile.am @@ -24,7 +24,7 @@ # This is not at all related to the release version, but a range of supported # API versions. Read TODO_RELEASE in the source tree's root! -LEGACY_MGCP_LIBVERSION=0:1:0 +LEGACY_MGCP_LIBVERSION=1:0:1 lib_LTLIBRARIES = \ libosmo-legacy-mgcp.la \ diff --git a/src/libosmo-mgcp-client/Makefile.am b/src/libosmo-mgcp-client/Makefile.am index 01371d7..d3f8fff 100644 --- a/src/libosmo-mgcp-client/Makefile.am +++ b/src/libosmo-mgcp-client/Makefile.am @@ -20,7 +20,7 @@ # This is not at all related to the release version, but a range of supported # API versions. Read TODO_RELEASE in the source tree's root! -MGCP_CLIENT_LIBVERSION=3:0:0 +MGCP_CLIENT_LIBVERSION=4:0:1 lib_LTLIBRARIES = \ libosmo-mgcp-client.la \ -- To view, visit https://gerrit.osmocom.org/10201 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ice736ca8016be5ed000c30014b955f4e0f77cb4e Gerrit-Change-Number: 10201 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 17:14:00 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 27 Jul 2018 17:14:00 +0000 Subject: Change in osmo-gsm-tester[master]: bts: Recreate resources.conf trx_list with len based on num_trx In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/10194 ) Change subject: bts: Recreate resources.conf trx_list with len based on num_trx ...................................................................... bts: Recreate resources.conf trx_list with len based on num_trx We are already doing this for defaults.cfg, but not for resources.conf. As a result, if we have a trx_list with 2 trx but we have set num_trx=1 (default), parsing will fail later in bsc.cfg.tmpl because conf_for_bsc_prepare() will pass a trx_list with 2 trx. Change-Id: I28ed34abeedaa0ee2e7862ced45a46042192d831 --- M src/osmo_gsm_tester/bts.py 1 file changed, 7 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/osmo_gsm_tester/bts.py b/src/osmo_gsm_tester/bts.py index ca33eb4..0f3ef1c 100644 --- a/src/osmo_gsm_tester/bts.py +++ b/src/osmo_gsm_tester/bts.py @@ -20,6 +20,7 @@ import os import pprint import tempfile +import copy from abc import ABCMeta, abstractmethod from . import log, config, util, template, process, schema, pcu_osmo @@ -112,7 +113,12 @@ config.overlay(values, { 'cell_identity': self.cellid }) if self.bvci is not None: config.overlay(values, { 'bvci': self.bvci }) - config.overlay(values, self.conf) + + conf = copy.deepcopy(self.conf) + trx_list = conf.get('trx_list') + if trx_list and len(trx_list) != self.num_trx(): + conf['trx_list'] = Bts._trx_list_recreate(trx_list, self.num_trx()) + config.overlay(values, conf) sgsn_conf = {} if self.sgsn is None else self.sgsn.conf_for_client() config.overlay(values, sgsn_conf) -- To view, visit https://gerrit.osmocom.org/10194 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I28ed34abeedaa0ee2e7862ced45a46042192d831 Gerrit-Change-Number: 10194 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 17:14:02 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 27 Jul 2018 17:14:02 +0000 Subject: Change in osmo-gsm-tester[master]: nanobts: Support multiTRX In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/10195 ) Change subject: nanobts: Support multiTRX ...................................................................... nanobts: Support multiTRX num_trx is left for now by default to 1, but it has been tested to work properly (current tests pass and both trx are configured) with num_trx=2. Change-Id: Ib3962f824a804e2aa582601475a8514c6cb0d8e7 --- M example/defaults.conf M example/resources.conf.prod M example/resources.conf.rnd M src/osmo_gsm_tester/bts_nanobts.py M src/osmo_gsm_tester/resource.py 5 files changed, 104 insertions(+), 71 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/example/defaults.conf b/example/defaults.conf index 1e84200..f7bd1b1 100644 --- a/example/defaults.conf +++ b/example/defaults.conf @@ -58,3 +58,6 @@ osmo_bts_octphy: max_trx: 2 + +nanobts: + max_trx: 2 diff --git a/example/resources.conf.prod b/example/resources.conf.prod index 6481254..6023fc4 100644 --- a/example/resources.conf.prod +++ b/example/resources.conf.prod @@ -47,22 +47,30 @@ - label: NanoBTS-ONW-1900 type: nanobts ipa_unit_id: 9 - addr: 10.42.42.120 band: GSM-1900 - power_supply: - type: 'sispm' - device: '01:01:4d:98:24' - port: '1' + trx_list: + - addr: 10.42.42.120 + power_supply: + type: 'sispm' + device: '01:01:4d:98:24' + port: '1' - label: NanoBTS-ONW-900 type: nanobts ipa_unit_id: 10 - addr: 10.42.42.121 band: GSM-900 - power_supply: - type: 'sispm' - device: '01:01:4d:98:24' - port: '2' + num_trx: 1 + trx_list: + - addr: 10.42.42.121 + power_supply: + type: 'sispm' + device: '01:01:4d:98:24' + port: '2' + - addr: 10.42.42.122 + power_supply: + type: 'sispm' + device: '01:01:4d:98:24' + port: '3' arfcn: - arfcn: 512 diff --git a/example/resources.conf.rnd b/example/resources.conf.rnd index 05fce87..4e5c173 100644 --- a/example/resources.conf.rnd +++ b/example/resources.conf.rnd @@ -30,12 +30,13 @@ - label: NanoBTS-ONW-1900 type: nanobts ipa_unit_id: 9 - addr: 10.42.42.120 band: GSM-1900 - power_supply: - type: 'sispm' - device: '01:01:55:2e:b6' - port: '1' + trx_list: + - addr: 10.42.42.120 + power_supply: + type: 'sispm' + device: '01:01:55:2e:b6' + port: '1' arfcn: - arfcn: 512 diff --git a/src/osmo_gsm_tester/bts_nanobts.py b/src/osmo_gsm_tester/bts_nanobts.py index 29a8ac5..7f0151f 100644 --- a/src/osmo_gsm_tester/bts_nanobts.py +++ b/src/osmo_gsm_tester/bts_nanobts.py @@ -28,28 +28,37 @@ class NanoBts(bts.Bts): - pwsup = None + pwsup_list = [] _pcu = None ############## # PROTECTED ############## def __init__(self, suite_run, conf): - if conf.get('addr') is None: - raise log.Error('No attribute addr provided in conf!') - super().__init__(suite_run, conf, 'nanobts_%s' % conf.get('addr'), 'nanobts') + super().__init__(suite_run, conf, 'nanobts_%s' % conf.get('label', 'nolabel'), 'nanobts') def _configure(self): if self.bsc is None: raise log.Error('BTS needs to be added to a BSC or NITB before it can be configured') - pwsup_opt = self.conf.get('power_supply', {}) - if not pwsup_opt: - raise log.Error('No power_supply attribute provided in conf!') - pwsup_type = pwsup_opt.get('type') - if not pwsup_type: - raise log.Error('No type attribute provided in power_supply conf!') + for trx_i in range(self.num_trx()): + pwsup_opt = self.conf.get('trx_list')[trx_i].get('power_supply', {}) + if not pwsup_opt: + raise log.Error('No power_supply attribute provided in conf for TRX %d!' % trx_i) + pwsup_type = pwsup_opt.get('type') + if not pwsup_type: + raise log.Error('No type attribute provided in power_supply conf for TRX %d!' % trx_i) + self.pwsup_list.append(powersupply.get_instance_by_type(pwsup_type, pwsup_opt)) - self.pwsup = powersupply.get_instance_by_type(pwsup_type, pwsup_opt) + + def get_pcap_filter_all_trx_ip(self): + ret = "(" + for trx_i in range(self.num_trx()): + if trx_i != 0: + ret = ret + " or " + bts_trx_ip = self.conf.get('trx_list')[trx_i].get('addr') + ret = ret + "host " + bts_trx_ip + ret = ret + ")" + return ret ######################## # PUBLIC - INTERNAL API @@ -61,9 +70,11 @@ band = values.get('band') trx_list = values.get('trx_list') if band == 'GSM-1900': - config.overlay(trx_list[0], { 'arfcn' : '531' }) + for trx_i in range(len(trx_list)): + config.overlay(trx_list[trx_i], { 'arfcn' : str(531 + trx_i * 2) }) elif band == 'GSM-900': - config.overlay(trx_list[0], { 'arfcn' : '50' }) + for trx_i in range(len(trx_list)): + config.overlay(trx_list[trx_i], { 'arfcn' : str(50 + trx_i * 2) }) config.overlay(values, { 'osmobsc_bts_type': 'nanobts' }) @@ -72,9 +83,10 @@ def cleanup(self): - if self.pwsup: - self.dbg('Powering off NanoBTS') - self.pwsup.power_set(False) + for pwsup in self.pwsup_list: + self.dbg('Powering off NanoBTS TRX') + pwsup.power_set(False) + self.pwsup_list = [] ################### # PUBLIC (test API included) @@ -87,44 +99,50 @@ self._configure() unitid = int(self.conf.get('ipa_unit_id')) - bts_ip = self.remote_addr() - # This fine for now, however concurrent tests using Nanobts may run into "address already in use" since dst is broadcast. - # Once concurrency is needed, a new config attr should be added to have an extra static IP assigned on the main-unit to each Nanobts resource. - local_bind_ip =util.dst_ip_get_local_bind(bts_ip) - # Make sure nanoBTS is powered and in a clean state: - self.pwsup.power_cycle(1.0) + # Make sure all nanoBTS TRX are powered and in a clean state: + for pwsup in self.pwsup_list: + self.dbg('Powering cycling NanoBTS TRX') + pwsup.power_cycle(1.0) pcap_recorder.PcapRecorder(self.suite_run, self.run_dir.new_dir('pcap'), None, - 'host %s and port not 22' % self.remote_addr()) + '%s and port not 22' % self.get_pcap_filter_all_trx_ip()) - self.log('Finding nanobts %s, binding on %s...' % (bts_ip, local_bind_ip)) - ipfind = AbisIpFind(self.suite_run, self.run_dir, local_bind_ip, 'preconf') - ipfind.start() - ipfind.wait_bts_ready(bts_ip) - running_unitid = ipfind.get_unitid_by_ip(bts_ip) - self.log('Found nanobts %s with unit_id %d' % (bts_ip, running_unitid)) - ipfind.stop() - ipconfig = IpAccessConfig(self.suite_run, self.run_dir, bts_ip) - if running_unitid != unitid: - if not ipconfig.set_unit_id(unitid, False): - raise log.Error('Failed configuring unit id %d' % unitid) - # Apply OML IP and restart nanoBTS as it is required to apply the changes. - if not ipconfig.set_oml_ip(self.bsc.addr(), True): - raise log.Error('Failed configuring OML IP %s' % bts_ip) + # TODO: If setting N TRX, we should set up them in parallel instead of waiting for each one. + for trx_i in range(self.num_trx()): + bts_trx_ip = self.conf.get('trx_list')[trx_i].get('addr') + # This fine for now, however concurrent tests using Nanobts may run into "address already in use" since dst is broadcast. + # Once concurrency is needed, a new config attr should be added to have an extra static IP assigned on the main-unit to each Nanobts resource. + local_bind_ip = util.dst_ip_get_local_bind(bts_trx_ip) - # Let some time for BTS to restart. It takes much more than 20 secs, and - # this way we make sure we don't catch responses in abisip-find prior to - # BTS restarting. - MainLoop.sleep(self, 20) + self.log('Finding nanobts %s, binding on %s...' % (bts_trx_ip, local_bind_ip)) + ipfind = AbisIpFind(self.suite_run, self.run_dir, local_bind_ip, 'preconf') + ipfind.start() + ipfind.wait_bts_ready(bts_trx_ip) + running_unitid, running_trx = ipfind.get_unitid_by_ip(bts_trx_ip) + self.log('Found nanobts %s with unit_id %d trx %d' % (bts_trx_ip, running_unitid, running_trx)) + ipfind.stop() - self.log('Starting to connect to', self.bsc) - ipfind = AbisIpFind(self.suite_run, self.run_dir, local_bind_ip, 'postconf') - ipfind.start() - ipfind.wait_bts_ready(bts_ip) - self.log('nanoBTS configured and running') - ipfind.stop() + ipconfig = IpAccessConfig(self.suite_run, self.run_dir, bts_trx_ip) + if running_unitid != unitid or running_trx != trx_i: + if not ipconfig.set_unit_id(unitid, trx_i, False): + raise log.Error('Failed configuring unit id %d trx %d' % (unitid, trx_i)) + # Apply OML IP and restart nanoBTS as it is required to apply the changes. + if not ipconfig.set_oml_ip(self.bsc.addr(), True): + raise log.Error('Failed configuring OML IP %s' % bts_trx_ip) + + # Let some time for BTS to restart. It takes much more than 20 secs, and + # this way we make sure we don't catch responses in abisip-find prior to + # BTS restarting. + MainLoop.sleep(self, 20) + + self.log('Starting to connect id %d trx %d to' % (unitid, trx_i), self.bsc) + ipfind = AbisIpFind(self.suite_run, self.run_dir, local_bind_ip, 'postconf') + ipfind.start() + ipfind.wait_bts_ready(bts_trx_ip) + self.log('nanoBTS id %d trx %d configured and running' % (unitid, trx_i)) + ipfind.stop() MainLoop.wait(self, self.bsc.bts_is_connected, self, timeout=600) self.log('nanoBTS connected to BSC') @@ -161,7 +179,7 @@ proc = None BIN_ABISIP_FIND = 'abisip-find' - BTS_UNIT_ID_RE = re.compile("Unit_ID='(?P\d+)/\d+/\d+'") + BTS_UNIT_ID_RE = re.compile("Unit_ID='(?P\d+)/\d+/(?P\d+)'") def __init__(self, suite_run, parent_run_dir, bind_ip, name_suffix): super().__init__(log.C_RUN, AbisIpFind.BIN_ABISIP_FIND + '-' + name_suffix) @@ -207,7 +225,8 @@ res = AbisIpFind.BTS_UNIT_ID_RE.search(line) if res: unit_id = int(res.group('unit_id')) - return unit_id + trx_id = int(res.group('trx_id')) + return (unit_id, trx_id) raise log.Error('abisip-find unit_id field for nanobts %s not found in %s' %(ipaddr, line)) def bts_ready(self, ipaddr): @@ -261,13 +280,14 @@ raise e return self.proc.result - def set_unit_id(self, unitid, restart=False): + def set_unit_id(self, unitid, trx_num, restart=False): + uid_str = '%d/0/%d' % (unitid, trx_num) if restart: - retcode = self.run('unitid', '--restart', '--unit-id', '%d/0/0' % unitid, self.bts_ip) + retcode = self.run('unitid', '--restart', '--unit-id', '%s' % uid_str, self.bts_ip) else: - retcode = self.run('unitid', '--unit-id', '%d/0/0' % unitid, self.bts_ip) + retcode = self.run('unitid', '--unit-id', '%s' % uid_str, self.bts_ip) if retcode != 0: - log.err('ipaccess-config --unit-id %d/0/0 returned error code %d' % (unitid, retcode)) + log.err('ipaccess-config --unit-id %s returned error code %d' % (uid_str, retcode)) return retcode == 0 def set_oml_ip(self, omlip, restart=False): diff --git a/src/osmo_gsm_tester/resource.py b/src/osmo_gsm_tester/resource.py index 28c4117..dca8090 100644 --- a/src/osmo_gsm_tester/resource.py +++ b/src/osmo_gsm_tester/resource.py @@ -57,17 +57,18 @@ 'bts[].trx_remote_ip': schema.IPV4, 'bts[].launch_trx': schema.BOOL_STR, 'bts[].direct_pcu': schema.BOOL_STR, - 'bts[].power_supply.type': schema.STR, - 'bts[].power_supply.device': schema.STR, - 'bts[].power_supply.port': schema.STR, 'bts[].ciphers[]': schema.CIPHER, 'bts[].num_trx': schema.UINT, 'bts[].max_trx': schema.UINT, + 'bts[].trx_list[].addr': schema.IPV4, 'bts[].trx_list[].hw_addr': schema.HWADDR, 'bts[].trx_list[].net_device': schema.STR, 'bts[].trx_list[].nominal_power': schema.UINT, 'bts[].trx_list[].max_power_red': schema.UINT, 'bts[].trx_list[].timeslot_list[].phys_chan_config': schema.PHY_CHAN, + 'bts[].trx_list[].power_supply.type': schema.STR, + 'bts[].trx_list[].power_supply.device': schema.STR, + 'bts[].trx_list[].power_supply.port': schema.STR, 'arfcn[].arfcn': schema.INT, 'arfcn[].band': schema.BAND, 'modem[].label': schema.STR, -- To view, visit https://gerrit.osmocom.org/10195 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ib3962f824a804e2aa582601475a8514c6cb0d8e7 Gerrit-Change-Number: 10195 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 17:19:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 17:19:36 +0000 Subject: Change in libosmocore[master]: GSMTAP: add SIM sub_types In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10167 ) Change subject: GSMTAP: add SIM sub_types ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10167 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5bd0dff5a4a90cfe96d9c4f3dec6657e1d85bf7a Gerrit-Change-Number: 10167 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Fri, 27 Jul 2018 17:19:36 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 17:19:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 17:19:47 +0000 Subject: Change in libosmocore[master]: GSMTAP: add SIM sub_types In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10167 ) Change subject: GSMTAP: add SIM sub_types ...................................................................... GSMTAP: add SIM sub_types In SIMtrace 1 the ATR was sent the same way as an APDU. The ATR is not an APDU, and could be mis-interpreted as valid APDU. This change allows to make the difference between actual APDU and the ATR, but also adds sub_types for future SIMtrace 2 use cases. Change-Id: I5bd0dff5a4a90cfe96d9c4f3dec6657e1d85bf7a --- M include/osmocom/core/gsmtap.h 1 file changed, 13 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/gsmtap.h b/include/osmocom/core/gsmtap.h index b4239f8..9f5049f 100644 --- a/include/osmocom/core/gsmtap.h +++ b/include/osmocom/core/gsmtap.h @@ -33,7 +33,7 @@ #define GSMTAP_TYPE_UM 0x01 #define GSMTAP_TYPE_ABIS 0x02 #define GSMTAP_TYPE_UM_BURST 0x03 /* raw burst bits */ -#define GSMTAP_TYPE_SIM 0x04 +#define GSMTAP_TYPE_SIM 0x04 /* ISO 7816 smart card interface */ #define GSMTAP_TYPE_TETRA_I1 0x05 /* tetra air interface */ #define GSMTAP_TYPE_TETRA_I1_BURST 0x06 /* tetra air interface */ #define GSMTAP_TYPE_WMX_BURST 0x07 /* WiMAX burst */ @@ -103,6 +103,18 @@ /* ====== DO NOT MAKE UNAPPROVED MODIFICATIONS HERE ===== */ +/* sub-types for GSMTAP_TYPE_SIM */ +#define GSMTAP_SIM_APDU 0x00 /* APDU data (complete APDU) */ +#define GSMTAP_SIM_ATR 0x01 /* card ATR data */ +#define GSMTAP_SIM_PPS_REQ 0x02 /* PPS request data */ +#define GSMTAP_SIM_PPS_RSP 0x03 /* PPS response data */ +#define GSMTAP_SIM_TPDU_HDR 0x04 /* TPDU command header */ +#define GSMTAP_SIM_TPDU_CMD 0x05 /* TPDU command body */ +#define GSMTAP_SIM_TPDU_RSP 0x06 /* TPDU response body */ +#define GSMTAP_SIM_TPDU_SW 0x07 /* TPDU response trailer */ + +/* ====== DO NOT MAKE UNAPPROVED MODIFICATIONS HERE ===== */ + /* sub-types for TYPE_TETRA_AIR */ #define GSMTAP_TETRA_BSCH 0x01 #define GSMTAP_TETRA_AACH 0x02 -- To view, visit https://gerrit.osmocom.org/10167 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I5bd0dff5a4a90cfe96d9c4f3dec6657e1d85bf7a Gerrit-Change-Number: 10167 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 17:23:46 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 27 Jul 2018 17:23:46 +0000 Subject: Change in osmo-mgw[master]: gitignore: Filter *.pc Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10202 Change subject: gitignore: Filter *.pc ...................................................................... gitignore: Filter *.pc Change-Id: I1e4e9b7342b23b4ef460801d61b4dd9c2fdc6dab --- M .gitignore 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/02/10202/1 diff --git a/.gitignore b/.gitignore index 7633c73..11a3bfb 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ *.pyc *.gcda *.gcno +*.pc #configure aclocal.m4 -- To view, visit https://gerrit.osmocom.org/10202 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I1e4e9b7342b23b4ef460801d61b4dd9c2fdc6dab Gerrit-Change-Number: 10202 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 17:26:04 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 27 Jul 2018 17:26:04 +0000 Subject: =?UTF-8?Q?Change_in_osmo-bsc=5Bmaster=5D=3A_Bump_version=3A_1=2E2=2E1=2E92-93916-dirty_=E2=86=92_1=2E3=2E0?= Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10203 Change subject: Bump version: 1.2.1.92-93916-dirty ? 1.3.0 ...................................................................... Bump version: 1.2.1.92-93916-dirty ? 1.3.0 Change-Id: Ic8f12e8a6e3a98f7c69920b27d08a5e7e3eebc31 --- M configure.ac M debian/changelog M debian/control 3 files changed, 123 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/03/10203/1 diff --git a/configure.ac b/configure.ac index a99e143..54d6a83 100644 --- a/configure.ac +++ b/configure.ac @@ -39,15 +39,15 @@ AC_SUBST(LIBRARY_DL) -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.11.0) -PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.11.0) -PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 0.11.0) -PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.11.0) -PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.5.0) -PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.2.0) -PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran >= 0.9.0) -PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.9.0) -PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.3.0) +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.12.0) +PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.12.0) +PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 0.12.0) +PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.12.0) +PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.5.1) +PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.3.0) +PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.4.0) dnl checks for header files AC_HEADER_STDC diff --git a/debian/changelog b/debian/changelog index 461b0c9..2e07507 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,111 @@ +osmo-bsc (1.3.0) unstable; urgency=medium + + [ Philipp Maier ] + * a_reset: cleanup + remove dead code + * gscon: remove dead code + * gscon: pick suitable payload type / encoding name for MGCP + * lcls: set codec info when performing MGW operation + * codec_pref: move match_codec_pref() to separate c-file and add unit-test + * codec_pref: check bts codec support + * chan_alloc: reset rtp voice related bits in lchan_free() + * rsl: use 3GPP assigned payload type constants from libosmo-netif + + [ Stefan Sperling ] + * show all global counters of osmo-bsc in vty + * add counter for connection attempts from BTS with unknown unit id + * fix misaligned memory write access in abis_nm_ipaccess_rsl_connect() + * increment 'paging responded' counter for active paging only + * fix handling of invalid pchan names in vty + + [ Pau Espin Pedrol ] + * nat: Add jitter buffer on the uplink receiver + * acc_ramp: Increase log level of some messages + * chan_alloc: Print bts nr on chan alloc failure + * abis_rsl.c: Fix whitespace + * abis_rsl: rsl_rx_chan_rqd: Format bts log string as in everywhere else + * pcu_sock: Log event pcu_sock created + * osmo-bsc: Clean help description of cmd line parameters + * osmo-bsc: Add -V param to print version + * debian: Move meas related binaries into new package osmo-bsc-meas-utils + * bsc-filter: Remove unused func barr_adapt and set barr_find static + * bsc_vty: Write access list entries when storing bsc config + * Init access_lists before passing it as a parameter + * Rename bsc_msg_acc_lst_vty_init to have more uniform prefix + * filter: vty: Print policy list in cmd show access-list + * filter: Replace '.' in counter names with ':' + * filter: Allocate each ctr group with a different idx + * ctrl: Avoid sending back received ERROR msgs + + [ Neels Hofmeyr ] + * bsc_api.c: actually log with context + * abis_rsl.h: drop unused rsl_chan_activate() declaration + * cosmetic: bsc_dyn_ts.c: make local functions static + * cosmetic: define TCH_F_PDCH_PENDING_MASK as actual bitwise or + * cosmetic: logging and ordering in handle_ass_compl() + * doc: add msc charts on Assignment/Handover internals + * tests: remove bssap_test + * tests: remove channel_test + * bsc_test: drop "scan to MSC" code path + * dissolve libbsc: move all to src/osmo-bsc, link .o files + * remove struct bsc_api + * cosmetic: magic number: use RSL_ACT_ constant for chan act + * cosmetic: gscon: undup code: add common assignment_failed() + * assignment: signal assignment failure on chan act nack + * log: fix logging in rsl_rx_chan_act_nack() + * log: assignment: add two logs on unexpected lchan release + * use libosmocore's gsm0808_permitted_speech(), gsm0808_chosen_channel() + * cosmetic: penalty timers: constify, tweak doc + * cosmetic: bsc_subscr_alloc: log initial get + * gscon: put subscriber a little later + * try to pick up subsrc IMSI on l3-compl + * store subscriber identity on paging + * cosmetic: handover_test: add IMSI to subscr for logging + * doc: tweak msc charts on Assignment/Handover: act_timer + * doc: add lchan-release.msc + * doc: add ms-channel-request.msc + * doc: charts: illustrate new plan for ts and lchans + * cosmetic: gscon: drop odd use of OSMO_STRINGIFY + * HO: introduce T7, T8, T101 timers + * drop dead code: conn->T10, handled by gscon instead + * make T10 configurable like the rest of them + * fix dyn TS init: properly identify BTS on OML OPSTART ACK + * cosmetic / linking: move str_to_imsi() out of abis_rsl.c + * cosmetic: name osmo-bsc's root ctx 'osmo-bsc', not 'openbsc' + * call osmo_xua_msg_tall_ctx_init() + * fix handover start: dealloc ho if event not permitted + * ho cfg: fix unit strings + * hodec2 log: less verbose, more concise logging + * various logging: fix missing/extra newlines + * BTS codec pref legacy compat: allow all codecs per default + + [ Harald Welte ] + * bsc: Fix check for MSC-side FSM allocation failure + * vty: Permit selection of other ASP protocol than M3UA + * bsc: Add mgcp_port_to_cic() to determine CIC from RTP Port + * bsc: Use correct MGCP endpoint name for IPA/SCCPlite + * bsc: Don't reject ASSIGNMENT for Audio in IPA/SCCPlite case + * bsc: Don't include AoIP IEs in ASSIGNMENT COMPLETE over SCCPlite + * bsc: Don't create MSC-side MGCP connection in IPA/SCCPlite case + * remove remaining bits of osmo-bsc_nat + * Remove 'struct bsc_msc_connection' + fix IPA-encapsulated CTRL + * move 'extern struct gsm_network *bsc_gsmnet" to header file + * VTY: Print some more information in "show conns" + * Add initial 3GPP LCLS support to OsmoBSC + * LCLS: add VTY config to enable/disable LCLS on per-MSC basis + * Reject ASSIGNMENT REQ with CIC but no AoIP transp addr in AoIP case + * Ignore "dest" command in MSC node + * Explicitly register CTRL-over-IPA callback with libosmo-sigtran + * Remove unused logging subsystems DCC and DMGCP + * remove traces of osmo-bsc_nat in python test (osmoappdesc/test_runner) + * Add missing event string name for GSCON_EV_LCLS_FAIL + * bsc_subscr_conn_fsm: BSC must not release SCCP connection + * absi_rsl: Fix segfault in rsl_rx_conn_fail() + + [ Daniel Willmann ] + * git-version-gen: Don't check for .git directory + + -- Pau Espin Pedrol Fri, 27 Jul 2018 19:25:05 +0200 + osmo-bsc (1.2.1) unstable; urgency=medium [ Philipp Maier ] diff --git a/debian/control b/debian/control index 0190aba..1c6c379 100644 --- a/debian/control +++ b/debian/control @@ -11,12 +11,12 @@ pkg-config, python-minimal, libtalloc-dev, - libosmocore-dev (>= 0.10.0), - libosmo-sccp-dev (>= 0.0.2), - libosmo-sigtran-dev (>= 0.8.0), - libosmo-abis-dev (>= 0.3.2), - libosmo-netif-dev (>= 0.1.0), - libosmo-mgcp-client-dev (>= 1.2.0) + libosmocore-dev (>= 0.12.0), + libosmo-sccp-dev (>= 0.10.0), + libosmo-sigtran-dev (>= 0.10.0), + libosmo-abis-dev (>= 0.5.1), + libosmo-netif-dev (>= 0.3.0), + libosmo-mgcp-client-dev (>= 1.4.0) Standards-Version: 3.9.8 Vcs-Git: git://git.osmocom.org/osmo-bsc.git Vcs-Browser: https://git.osmocom.org/osmo-bsc/ -- To view, visit https://gerrit.osmocom.org/10203 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ic8f12e8a6e3a98f7c69920b27d08a5e7e3eebc31 Gerrit-Change-Number: 10203 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 17:39:04 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 27 Jul 2018 17:39:04 +0000 Subject: =?UTF-8?Q?Change_in_osmo-bsc=5Bmaster=5D=3A_Bump_version=3A_1=2E2=2E1=2E92-93916-dirty_=E2=86=92_1=2E3=2E0?= In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10203 ) Change subject: Bump version: 1.2.1.92-93916-dirty ? 1.3.0 ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10203 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic8f12e8a6e3a98f7c69920b27d08a5e7e3eebc31 Gerrit-Change-Number: 10203 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 27 Jul 2018 17:39:04 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 17:39:30 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 27 Jul 2018 17:39:30 +0000 Subject: =?UTF-8?Q?Change_in_osmo-bsc=5Bmaster=5D=3A_Bump_version=3A_1=2E2=2E1=2E92-93916-dirty_=E2=86=92_1=2E3=2E0?= In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/10203 ) Change subject: Bump version: 1.2.1.92-93916-dirty ? 1.3.0 ...................................................................... Bump version: 1.2.1.92-93916-dirty ? 1.3.0 Change-Id: Ic8f12e8a6e3a98f7c69920b27d08a5e7e3eebc31 --- M configure.ac M debian/changelog M debian/control 3 files changed, 123 insertions(+), 15 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/configure.ac b/configure.ac index a99e143..54d6a83 100644 --- a/configure.ac +++ b/configure.ac @@ -39,15 +39,15 @@ AC_SUBST(LIBRARY_DL) -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.11.0) -PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.11.0) -PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 0.11.0) -PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.11.0) -PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.5.0) -PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.2.0) -PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran >= 0.9.0) -PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.9.0) -PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.3.0) +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.12.0) +PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.12.0) +PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 0.12.0) +PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.12.0) +PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.5.1) +PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.3.0) +PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.10.0) +PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.4.0) dnl checks for header files AC_HEADER_STDC diff --git a/debian/changelog b/debian/changelog index 461b0c9..2e07507 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,111 @@ +osmo-bsc (1.3.0) unstable; urgency=medium + + [ Philipp Maier ] + * a_reset: cleanup + remove dead code + * gscon: remove dead code + * gscon: pick suitable payload type / encoding name for MGCP + * lcls: set codec info when performing MGW operation + * codec_pref: move match_codec_pref() to separate c-file and add unit-test + * codec_pref: check bts codec support + * chan_alloc: reset rtp voice related bits in lchan_free() + * rsl: use 3GPP assigned payload type constants from libosmo-netif + + [ Stefan Sperling ] + * show all global counters of osmo-bsc in vty + * add counter for connection attempts from BTS with unknown unit id + * fix misaligned memory write access in abis_nm_ipaccess_rsl_connect() + * increment 'paging responded' counter for active paging only + * fix handling of invalid pchan names in vty + + [ Pau Espin Pedrol ] + * nat: Add jitter buffer on the uplink receiver + * acc_ramp: Increase log level of some messages + * chan_alloc: Print bts nr on chan alloc failure + * abis_rsl.c: Fix whitespace + * abis_rsl: rsl_rx_chan_rqd: Format bts log string as in everywhere else + * pcu_sock: Log event pcu_sock created + * osmo-bsc: Clean help description of cmd line parameters + * osmo-bsc: Add -V param to print version + * debian: Move meas related binaries into new package osmo-bsc-meas-utils + * bsc-filter: Remove unused func barr_adapt and set barr_find static + * bsc_vty: Write access list entries when storing bsc config + * Init access_lists before passing it as a parameter + * Rename bsc_msg_acc_lst_vty_init to have more uniform prefix + * filter: vty: Print policy list in cmd show access-list + * filter: Replace '.' in counter names with ':' + * filter: Allocate each ctr group with a different idx + * ctrl: Avoid sending back received ERROR msgs + + [ Neels Hofmeyr ] + * bsc_api.c: actually log with context + * abis_rsl.h: drop unused rsl_chan_activate() declaration + * cosmetic: bsc_dyn_ts.c: make local functions static + * cosmetic: define TCH_F_PDCH_PENDING_MASK as actual bitwise or + * cosmetic: logging and ordering in handle_ass_compl() + * doc: add msc charts on Assignment/Handover internals + * tests: remove bssap_test + * tests: remove channel_test + * bsc_test: drop "scan to MSC" code path + * dissolve libbsc: move all to src/osmo-bsc, link .o files + * remove struct bsc_api + * cosmetic: magic number: use RSL_ACT_ constant for chan act + * cosmetic: gscon: undup code: add common assignment_failed() + * assignment: signal assignment failure on chan act nack + * log: fix logging in rsl_rx_chan_act_nack() + * log: assignment: add two logs on unexpected lchan release + * use libosmocore's gsm0808_permitted_speech(), gsm0808_chosen_channel() + * cosmetic: penalty timers: constify, tweak doc + * cosmetic: bsc_subscr_alloc: log initial get + * gscon: put subscriber a little later + * try to pick up subsrc IMSI on l3-compl + * store subscriber identity on paging + * cosmetic: handover_test: add IMSI to subscr for logging + * doc: tweak msc charts on Assignment/Handover: act_timer + * doc: add lchan-release.msc + * doc: add ms-channel-request.msc + * doc: charts: illustrate new plan for ts and lchans + * cosmetic: gscon: drop odd use of OSMO_STRINGIFY + * HO: introduce T7, T8, T101 timers + * drop dead code: conn->T10, handled by gscon instead + * make T10 configurable like the rest of them + * fix dyn TS init: properly identify BTS on OML OPSTART ACK + * cosmetic / linking: move str_to_imsi() out of abis_rsl.c + * cosmetic: name osmo-bsc's root ctx 'osmo-bsc', not 'openbsc' + * call osmo_xua_msg_tall_ctx_init() + * fix handover start: dealloc ho if event not permitted + * ho cfg: fix unit strings + * hodec2 log: less verbose, more concise logging + * various logging: fix missing/extra newlines + * BTS codec pref legacy compat: allow all codecs per default + + [ Harald Welte ] + * bsc: Fix check for MSC-side FSM allocation failure + * vty: Permit selection of other ASP protocol than M3UA + * bsc: Add mgcp_port_to_cic() to determine CIC from RTP Port + * bsc: Use correct MGCP endpoint name for IPA/SCCPlite + * bsc: Don't reject ASSIGNMENT for Audio in IPA/SCCPlite case + * bsc: Don't include AoIP IEs in ASSIGNMENT COMPLETE over SCCPlite + * bsc: Don't create MSC-side MGCP connection in IPA/SCCPlite case + * remove remaining bits of osmo-bsc_nat + * Remove 'struct bsc_msc_connection' + fix IPA-encapsulated CTRL + * move 'extern struct gsm_network *bsc_gsmnet" to header file + * VTY: Print some more information in "show conns" + * Add initial 3GPP LCLS support to OsmoBSC + * LCLS: add VTY config to enable/disable LCLS on per-MSC basis + * Reject ASSIGNMENT REQ with CIC but no AoIP transp addr in AoIP case + * Ignore "dest" command in MSC node + * Explicitly register CTRL-over-IPA callback with libosmo-sigtran + * Remove unused logging subsystems DCC and DMGCP + * remove traces of osmo-bsc_nat in python test (osmoappdesc/test_runner) + * Add missing event string name for GSCON_EV_LCLS_FAIL + * bsc_subscr_conn_fsm: BSC must not release SCCP connection + * absi_rsl: Fix segfault in rsl_rx_conn_fail() + + [ Daniel Willmann ] + * git-version-gen: Don't check for .git directory + + -- Pau Espin Pedrol Fri, 27 Jul 2018 19:25:05 +0200 + osmo-bsc (1.2.1) unstable; urgency=medium [ Philipp Maier ] diff --git a/debian/control b/debian/control index 0190aba..1c6c379 100644 --- a/debian/control +++ b/debian/control @@ -11,12 +11,12 @@ pkg-config, python-minimal, libtalloc-dev, - libosmocore-dev (>= 0.10.0), - libosmo-sccp-dev (>= 0.0.2), - libosmo-sigtran-dev (>= 0.8.0), - libosmo-abis-dev (>= 0.3.2), - libosmo-netif-dev (>= 0.1.0), - libosmo-mgcp-client-dev (>= 1.2.0) + libosmocore-dev (>= 0.12.0), + libosmo-sccp-dev (>= 0.10.0), + libosmo-sigtran-dev (>= 0.10.0), + libosmo-abis-dev (>= 0.5.1), + libosmo-netif-dev (>= 0.3.0), + libosmo-mgcp-client-dev (>= 1.4.0) Standards-Version: 3.9.8 Vcs-Git: git://git.osmocom.org/osmo-bsc.git Vcs-Browser: https://git.osmocom.org/osmo-bsc/ -- To view, visit https://gerrit.osmocom.org/10203 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ic8f12e8a6e3a98f7c69920b27d08a5e7e3eebc31 Gerrit-Change-Number: 10203 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From admin at opensuse.org Fri Jul 27 17:51:45 2018 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Jul 2018 17:51:45 +0000 Subject: Build failure of network:osmocom:latest/libosmo-abis in Debian_9.0/armv7l In-Reply-To: References: Message-ID: <5b5b5bbeb8ad3_725276468425828@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/libosmo-abis/Debian_9.0/armv7l Package network:osmocom:latest/libosmo-abis failed to build in Debian_9.0/armv7l Check out the package for editing: osc checkout network:osmocom:latest libosmo-abis Last lines of build log: [ 94s] #define VERSION "0.5.1" [ 94s] #define STDC_HEADERS 1 [ 94s] #define HAVE_SYS_TYPES_H 1 [ 94s] #define HAVE_SYS_STAT_H 1 [ 94s] #define HAVE_STDLIB_H 1 [ 94s] #define HAVE_STRING_H 1 [ 94s] #define HAVE_MEMORY_H 1 [ 94s] #define HAVE_STRINGS_H 1 [ 94s] #define HAVE_INTTYPES_H 1 [ 94s] #define HAVE_STDINT_H 1 [ 94s] #define HAVE_UNISTD_H 1 [ 94s] #define HAVE_DLFCN_H 1 [ 94s] #define LT_OBJDIR ".libs/" [ 94s] [ 94s] configure: exit 1 [ 94s] dh_auto_configure: ./configure --build=arm-linux-gnueabihf --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/arm-linux-gnueabihf --libexecdir=${prefix}/lib/arm-linux-gnueabihf --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 94s] debian/rules:12: recipe for target 'build' failed [ 94s] make: *** [build] Error 2 [ 94s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 94s] [ 94s] armbuild24 failed "build libosmo-abis_0.5.1.dsc" at Fri Jul 27 17:51:28 UTC 2018. [ 94s] [ 94s] ### VM INTERACTION START ### [ 97s] [ 85.569322] SysRq : Power Off [ 97s] [ 85.570538] reboot: Power down [ 97s] ### VM INTERACTION END ### [ 97s] [ 97s] armbuild24 failed "build libosmo-abis_0.5.1.dsc" at Fri Jul 27 17:51:31 UTC 2018. [ 97s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jul 27 17:52:36 2018 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Jul 2018 17:52:36 +0000 Subject: Build failure of network:osmocom:latest/libosmo-abis in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <5b5b5bf7ae266_7252764684258342@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/libosmo-abis/xUbuntu_17.04/i586 Package network:osmocom:latest/libosmo-abis failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:latest libosmo-abis Last lines of build log: [ 161s] #define VERSION "0.5.1" [ 161s] #define STDC_HEADERS 1 [ 161s] #define HAVE_SYS_TYPES_H 1 [ 161s] #define HAVE_SYS_STAT_H 1 [ 161s] #define HAVE_STDLIB_H 1 [ 161s] #define HAVE_STRING_H 1 [ 161s] #define HAVE_MEMORY_H 1 [ 161s] #define HAVE_STRINGS_H 1 [ 161s] #define HAVE_INTTYPES_H 1 [ 161s] #define HAVE_STDINT_H 1 [ 161s] #define HAVE_UNISTD_H 1 [ 161s] #define HAVE_DLFCN_H 1 [ 161s] #define LT_OBJDIR ".libs/" [ 161s] [ 161s] configure: exit 1 [ 161s] dh_auto_configure: ./configure --build=i686-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/i386-linux-gnu --libexecdir=${prefix}/lib/i386-linux-gnu --disable-maintainer-mode --disable-dependency-tracking returned exit code 1 [ 161s] debian/rules:12: recipe for target 'build' failed [ 161s] make: *** [build] Error 2 [ 161s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 161s] [ 161s] cloud130 failed "build libosmo-abis_0.5.1.dsc" at Fri Jul 27 17:52:20 UTC 2018. [ 161s] [ 161s] ### VM INTERACTION START ### [ 165s] [ 137.252775] sysrq: SysRq : Power Off [ 165s] [ 137.280713] reboot: Power down [ 167s] ### VM INTERACTION END ### [ 167s] [ 167s] cloud130 failed "build libosmo-abis_0.5.1.dsc" at Fri Jul 27 17:52:27 UTC 2018. [ 167s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Fri Jul 27 18:15:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 18:15:24 +0000 Subject: Change in osmo-mgw[master]: gitignore: Filter *.pc In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10202 ) Change subject: gitignore: Filter *.pc ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10202 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1e4e9b7342b23b4ef460801d61b4dd9c2fdc6dab Gerrit-Change-Number: 10202 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Fri, 27 Jul 2018 18:15:24 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 18:15:30 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 18:15:30 +0000 Subject: Change in osmo-mgw[master]: gitignore: Filter *.pc In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10202 ) Change subject: gitignore: Filter *.pc ...................................................................... gitignore: Filter *.pc Change-Id: I1e4e9b7342b23b4ef460801d61b4dd9c2fdc6dab --- M .gitignore 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/.gitignore b/.gitignore index 7633c73..11a3bfb 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ *.pyc *.gcda *.gcno +*.pc #configure aclocal.m4 -- To view, visit https://gerrit.osmocom.org/10202 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I1e4e9b7342b23b4ef460801d61b4dd9c2fdc6dab Gerrit-Change-Number: 10202 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 18:15:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 18:15:44 +0000 Subject: Change in libosmocore[master]: fix strncpy bugs in gsm/ipa.c In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10174 ) Change subject: fix strncpy bugs in gsm/ipa.c ...................................................................... fix strncpy bugs in gsm/ipa.c Change-Id: I423a24c55c9b9aa6fc8f501df94fe54c71ee2b2b --- M src/gsm/ipa.c 1 file changed, 6 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Pau Espin Pedrol: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/src/gsm/ipa.c b/src/gsm/ipa.c index 0c7aaad..aecde83 100644 --- a/src/gsm/ipa.c +++ b/src/gsm/ipa.c @@ -251,23 +251,23 @@ break; case IPAC_IDTAG_LOCATION1: if (dev->location1) - strncpy(str, dev->location1, IPA_STRING_MAX); + osmo_strlcpy(str, dev->location1, sizeof(str)); break; case IPAC_IDTAG_LOCATION2: if (dev->location2) - strncpy(str, dev->location2, IPA_STRING_MAX); + osmo_strlcpy(str, dev->location2, sizeof(str)); break; case IPAC_IDTAG_EQUIPVERS: if (dev->equipvers) - strncpy(str, dev->equipvers, IPA_STRING_MAX); + osmo_strlcpy(str, dev->equipvers, sizeof(str)); break; case IPAC_IDTAG_SWVERSION: if (dev->swversion) - strncpy(str, dev->swversion, IPA_STRING_MAX); + osmo_strlcpy(str, dev->swversion, sizeof(str)); break; case IPAC_IDTAG_UNITNAME: if (dev->unit_name) { - snprintf(str, sizeof(str), dev->unit_name, IPA_STRING_MAX); + snprintf(str, sizeof(str), "%s", dev->unit_name); } else { snprintf(str, sizeof(str), "%02x-%02x-%02x-%02x-%02x-%02x", @@ -278,7 +278,7 @@ break; case IPAC_IDTAG_SERNR: if (dev->serno) - strncpy(str, dev->serno, IPA_STRING_MAX); + osmo_strlcpy(str, dev->serno, sizeof(str)); break; default: LOGP(DLINP, LOGL_NOTICE, @@ -286,7 +286,6 @@ msgb_free(msg); return NULL; } - str[IPA_STRING_MAX-1] = '\0'; LOGP(DLINP, LOGL_INFO, " tag %d: %s\n", ies_req[i], str); tag = msgb_put(msg, 3 + strlen(str) + 1); -- To view, visit https://gerrit.osmocom.org/10174 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I423a24c55c9b9aa6fc8f501df94fe54c71ee2b2b Gerrit-Change-Number: 10174 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 18:15:45 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 18:15:45 +0000 Subject: Change in libosmocore[master]: fix strncpy bugs in socket.c In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10175 ) Change subject: fix strncpy bugs in socket.c ...................................................................... fix strncpy bugs in socket.c Change-Id: Iddf36d26b23dcef4f9b291fd7ead1907e38c3486 --- M src/socket.c 1 file changed, 1 insertion(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/socket.c b/src/socket.c index 0405847..dc5590c 100644 --- a/src/socket.c +++ b/src/socket.c @@ -596,8 +596,7 @@ return -EINVAL; local.sun_family = AF_UNIX; - strncpy(local.sun_path, socket_path, sizeof(local.sun_path)); - local.sun_path[sizeof(local.sun_path) - 1] = '\0'; + osmo_strlcpy(local.sun_path, socket_path, sizeof(local.sun_path)); #if defined(BSD44SOCKETS) || defined(__UNIXWARE__) local.sun_len = strlen(local.sun_path); -- To view, visit https://gerrit.osmocom.org/10175 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iddf36d26b23dcef4f9b291fd7ead1907e38c3486 Gerrit-Change-Number: 10175 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 18:15:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 18:15:47 +0000 Subject: Change in libosmocore[master]: cosmetic: osmo-sim-test.c: use memcpy instead of strncpy In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10176 ) Change subject: cosmetic: osmo-sim-test.c: use memcpy instead of strncpy ...................................................................... cosmetic: osmo-sim-test.c: use memcpy instead of strncpy gcc 8.1.0 complains that the terminating \0 is not copied by strncpy, while this code intends to do exactly that. Use memcpy instead. Change-Id: I8d66fa22502c04d11ae153b9856d7e54f3492dd6 --- M utils/osmo-sim-test.c 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/utils/osmo-sim-test.c b/utils/osmo-sim-test.c index ea24120..5588294 100644 --- a/utils/osmo-sim-test.c +++ b/utils/osmo-sim-test.c @@ -74,7 +74,8 @@ msg = osim_new_apdumsg(0x00, 0x20, 0x00, pin_nr, 8, 0); pindst = (char *) msgb_put(msg, 8); memset(pindst, 0xFF, 8); - strncpy(pindst, pin, strlen(pin)); + /* Do not copy the terminating \0 */ + memcpy(pindst, pin, strlen(pin)); return osim_transceive_apdu(st, msg); } -- To view, visit https://gerrit.osmocom.org/10176 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I8d66fa22502c04d11ae153b9856d7e54f3492dd6 Gerrit-Change-Number: 10176 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 18:16:01 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 18:16:01 +0000 Subject: Change in libosmo-abis[master]: fix strncpy bugs in ipaccess.c, ipa_proxy.c In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10177 ) Change subject: fix strncpy bugs in ipaccess.c, ipa_proxy.c ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10177 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iad53b603521c0a8f4857bd87dca777ba8e875cde Gerrit-Change-Number: 10177 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Fri, 27 Jul 2018 18:16:01 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 18:16:12 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 18:16:12 +0000 Subject: Change in libosmo-netif[master]: fix strncpy bug in rs232.c In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10178 ) Change subject: fix strncpy bug in rs232.c ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10178 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2f3b7888acb4f25da22ffef4391e1d0831485483 Gerrit-Change-Number: 10178 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Fri, 27 Jul 2018 18:16:12 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 18:16:13 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 18:16:13 +0000 Subject: Change in libosmo-netif[master]: fix strncpy bug in rs232.c In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10178 ) Change subject: fix strncpy bug in rs232.c ...................................................................... fix strncpy bug in rs232.c Change-Id: I2f3b7888acb4f25da22ffef4391e1d0831485483 --- M src/rs232.c 1 file changed, 1 insertion(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/rs232.c b/src/rs232.c index da5b56b..28f1ba0 100644 --- a/src/rs232.c +++ b/src/rs232.c @@ -141,8 +141,7 @@ void osmo_rs232_set_serial_port(struct osmo_rs232 *r, char *serial_port) { - strncpy(r->cfg.serial_port, serial_port, PATH_MAX); - r->cfg.serial_port[PATH_MAX-1] = '\0'; + osmo_strlcpy(r->cfg.serial_port, serial_port, PATH_MAX); } void osmo_rs232_set_baudrate(struct osmo_rs232 *r, int baudrate) -- To view, visit https://gerrit.osmocom.org/10178 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I2f3b7888acb4f25da22ffef4391e1d0831485483 Gerrit-Change-Number: 10178 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 18:16:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 18:16:15 +0000 Subject: Change in libosmo-abis[master]: fix strncpy bugs in ipaccess.c, ipa_proxy.c In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10177 ) Change subject: fix strncpy bugs in ipaccess.c, ipa_proxy.c ...................................................................... fix strncpy bugs in ipaccess.c, ipa_proxy.c Change-Id: Iad53b603521c0a8f4857bd87dca777ba8e875cde --- M src/input/ipaccess.c M src/ipa_proxy.c 2 files changed, 6 insertions(+), 8 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c index 23eeda6..7d3845e 100644 --- a/src/input/ipaccess.c +++ b/src/input/ipaccess.c @@ -602,19 +602,19 @@ break; case IPAC_IDTAG_LOCATION1: if (dev->location1) - strncpy(str, dev->location1, IPA_STRING_MAX); + osmo_strlcpy(str, dev->swversion, sizeof(str)); break; case IPAC_IDTAG_LOCATION2: if (dev->location2) - strncpy(str, dev->location2, IPA_STRING_MAX); + osmo_strlcpy(str, dev->swversion, sizeof(str)); break; case IPAC_IDTAG_EQUIPVERS: if (dev->equipvers) - strncpy(str, dev->equipvers, IPA_STRING_MAX); + osmo_strlcpy(str, dev->swversion, sizeof(str)); break; case IPAC_IDTAG_SWVERSION: if (dev->swversion) - strncpy(str, dev->swversion, IPA_STRING_MAX); + osmo_strlcpy(str, dev->swversion, sizeof(str)); break; case IPAC_IDTAG_UNITNAME: snprintf(str, sizeof(str), @@ -626,7 +626,7 @@ break; case IPAC_IDTAG_SERNR: if (dev->serno) - strncpy(str, dev->serno, IPA_STRING_MAX); + osmo_strlcpy(str, dev->swversion, sizeof(str)); break; default: LOGP(DLINP, LOGL_NOTICE, @@ -634,7 +634,6 @@ msgb_free(nmsg); return NULL; } - str[IPA_STRING_MAX-1] = '\0'; LOGP(DLINP, LOGL_INFO, " tag %d: %s\n", data[1], str); tag = msgb_put(nmsg, 3 + strlen(str) + 1); diff --git a/src/ipa_proxy.c b/src/ipa_proxy.c index 94f48dc..44f5baf 100644 --- a/src/ipa_proxy.c +++ b/src/ipa_proxy.c @@ -245,8 +245,7 @@ VTY_NEWLINE); return CMD_WARNING; } - strncpy(ipi->name, argv[0], IPA_INSTANCE_NAME); - ipi->name[IPA_INSTANCE_NAME - 1] = '\0'; + osmo_strlcpy(ipi->name, argv[0], sizeof(ipi->name)); ipi->net.type = type; ipi->net.addr = talloc_strdup(tall_ipa_proxy_ctx, argv[2]); ipi->net.port = port; -- To view, visit https://gerrit.osmocom.org/10177 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iad53b603521c0a8f4857bd87dca777ba8e875cde Gerrit-Change-Number: 10177 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 18:17:35 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 18:17:35 +0000 Subject: Change in osmo-bsc[master]: fix: dispatch TS_EV_RSL_DOWN when losing RSL In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10190 ) Change subject: fix: dispatch TS_EV_RSL_DOWN when losing RSL ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10190 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I66c7fc5fcc676f4960f3d089b8c2ae5bce37ed99 Gerrit-Change-Number: 10190 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Fri, 27 Jul 2018 18:17:35 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From admin at opensuse.org Fri Jul 27 18:17:46 2018 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Jul 2018 18:17:46 +0000 Subject: Build failure of network:osmocom:latest/osmo-pcu in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <5b5b61dcee455_725276468426434c@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-pcu/Debian_8.0/x86_64 Package network:osmocom:latest/osmo-pcu failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:latest osmo-pcu Last lines of build log: [ 1321s] | #define HAVE_STDLIB_H 1 [ 1321s] | #define HAVE_STRING_H 1 [ 1321s] | #define HAVE_MEMORY_H 1 [ 1321s] | #define HAVE_STRINGS_H 1 [ 1321s] | #define HAVE_INTTYPES_H 1 [ 1321s] | #define HAVE_STDINT_H 1 [ 1321s] | #define HAVE_UNISTD_H 1 [ 1321s] | #define HAVE_DLFCN_H 1 [ 1321s] | #define LT_OBJDIR ".libs/" [ 1321s] | #define STDC_HEADERS 1 [ 1321s] | [ 1321s] | configure: exit 0 [ 1321s] [ 1321s] debian/rules:28: recipe for target 'override_dh_auto_test' failed [ 1321s] make[1]: *** [override_dh_auto_test] Error 1 [ 1321s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 1321s] debian/rules:12: recipe for target 'build' failed [ 1321s] make: *** [build] Error 2 [ 1321s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 1321s] [ 1321s] sheep84 failed "build osmo-pcu_0.5.0.dsc" at Fri Jul 27 18:17:32 UTC 2018. [ 1321s] [ 1321s] ### VM INTERACTION START ### [ 1322s] Powering off. [ 1322s] [ 1313.459997] reboot: Power down [ 1322s] ### VM INTERACTION END ### [ 1322s] [ 1322s] sheep84 failed "build osmo-pcu_0.5.0.dsc" at Fri Jul 27 18:17:34 UTC 2018. [ 1322s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Fri Jul 27 18:19:07 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Fri, 27 Jul 2018 18:19:07 +0000 Subject: Change in simtrace2[master]: sniff: send ATR over GSMTAP Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/10204 Change subject: sniff: send ATR over GSMTAP ...................................................................... sniff: send ATR over GSMTAP Change-Id: Id35129883f08002a4a796b56954a128e2b533245 --- M host/simtrace2-sniff.c 1 file changed, 14 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/04/10204/1 diff --git a/host/simtrace2-sniff.c b/host/simtrace2-sniff.c index 776253a..6d5766f 100644 --- a/host/simtrace2-sniff.c +++ b/host/simtrace2-sniff.c @@ -65,7 +65,7 @@ /* global GSMTAP instance */ static struct gsmtap_inst *g_gti; -static int gsmtap_send_sim(const uint8_t *apdu, unsigned int len) +static int gsmtap_send_sim(uint8_t sub_type, const uint8_t *data, unsigned int len) { struct gsmtap_hdr *gh; unsigned int gross_len = len + sizeof(*gh); @@ -80,8 +80,9 @@ gh->version = GSMTAP_VERSION; gh->hdr_len = sizeof(*gh)/4; gh->type = GSMTAP_TYPE_SIM; + gh->sub_type = sub_type; - memcpy(buf + sizeof(*gh), apdu, len); + memcpy(buf + sizeof(*gh), data, len); rc = write(gsmtap_inst_fd(g_gti), buf, gross_len); if (rc < 0) { @@ -235,9 +236,17 @@ } printf("\n"); - if (SIMTRACE_MSGT_SNIFF_TPDU == type) { - /* send TPDU (now considered as APDU) to GSMTAP */ - gsmtap_send_sim(data->data, data->length); + /* Send message as GSNTAP */ + switch (type) { + case SIMTRACE_MSGT_SNIFF_ATR: + gsmtap_send_sim(GSMTAP_SIM_ATR, data->data, data->length); + break; + case SIMTRACE_MSGT_SNIFF_TPDU: + /* TPDU is now considered as APDU since SIMtrace sends complete TPDU */ + gsmtap_send_sim(GSMTAP_SIM_APDU, data->data, data->length); + break; + default: + break; } return 0; -- To view, visit https://gerrit.osmocom.org/10204 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id35129883f08002a4a796b56954a128e2b533245 Gerrit-Change-Number: 10204 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 18:19:07 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Fri, 27 Jul 2018 18:19:07 +0000 Subject: Change in simtrace2[master]: sniff: rename reset hold/release to assert/deassert Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/10205 Change subject: sniff: rename reset hold/release to assert/deassert ...................................................................... sniff: rename reset hold/release to assert/deassert this change is to match the nomenclature used in cardem Change-Id: Ide99e731cad26aec949ad14d54f46fa611a0b7f8 --- M firmware/libcommon/include/simtrace_prot.h M firmware/libcommon/source/sniffer.c M host/simtrace2-sniff.c 3 files changed, 10 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/05/10205/1 diff --git a/firmware/libcommon/include/simtrace_prot.h b/firmware/libcommon/include/simtrace_prot.h index 58e51be..878bc34 100644 --- a/firmware/libcommon/include/simtrace_prot.h +++ b/firmware/libcommon/include/simtrace_prot.h @@ -291,8 +291,8 @@ /* SIMTRACE_MSGT_SNIFF_CHANGE flags */ #define SNIFF_CHANGE_FLAG_CARD_INSERT (1<<0) #define SNIFF_CHANGE_FLAG_CARD_EJECT (1<<1) -#define SNIFF_CHANGE_FLAG_RESET_HOLD (1<<2) -#define SNIFF_CHANGE_FLAG_RESET_RELEASE (1<<3) +#define SNIFF_CHANGE_FLAG_RESET_ASSERT (1<<2) +#define SNIFF_CHANGE_FLAG_RESET_DEASSERT (1<<3) #define SNIFF_CHANGE_FLAG_TIMEOUT_WT (1<<4) /* SIMTRACE_MSGT_SNIFF_ATR, SIMTRACE_MSGT_SNIFF_PPS, SIMTRACE_MSGT_SNIFF_TPDU flags */ #define SNIFF_DATA_FLAG_ERROR_INCOMPLETE (1<<5) diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index f99c25a..e800216 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -854,9 +854,9 @@ } /* Update the ISO state according to the reset change (reset is active low) */ if (PIO_Get(&pin_rst)) { - change_flags |= SNIFF_CHANGE_FLAG_RESET_RELEASE; /* set flag and let main loop send it */ + change_flags |= SNIFF_CHANGE_FLAG_RESET_DEASSERT; /* set flag and let main loop send it */ } else { - change_flags |= SNIFF_CHANGE_FLAG_RESET_HOLD; /* set flag and let main loop send it */ + change_flags |= SNIFF_CHANGE_FLAG_RESET_ASSERT; /* set flag and let main loop send it */ } } @@ -1030,12 +1030,12 @@ /* Handle flags */ if (change_flags) { /* WARNING this is not synced with the data buffer handling */ - if (change_flags & SNIFF_CHANGE_FLAG_RESET_HOLD) { + if (change_flags & SNIFF_CHANGE_FLAG_RESET_ASSERT) { if (ISO7816_S_RESET != iso_state) { change_state(ISO7816_S_RESET); } } - if (change_flags & SNIFF_CHANGE_FLAG_RESET_RELEASE) { + if (change_flags & SNIFF_CHANGE_FLAG_RESET_DEASSERT) { if (ISO7816_S_WAIT_ATR != iso_state) { change_state(ISO7816_S_WAIT_ATR); } diff --git a/host/simtrace2-sniff.c b/host/simtrace2-sniff.c index 6d5766f..aeacc6b 100644 --- a/host/simtrace2-sniff.c +++ b/host/simtrace2-sniff.c @@ -105,12 +105,12 @@ .str = "card ejected", }, { - .value = SNIFF_CHANGE_FLAG_RESET_HOLD, - .str = "reset hold", + .value = SNIFF_CHANGE_FLAG_RESET_ASSERT, + .str = "reset asserted", }, { - .value = SNIFF_CHANGE_FLAG_RESET_RELEASE, - .str = "reset release", + .value = SNIFF_CHANGE_FLAG_RESET_DEASSERT, + .str = "reset de-asserted", }, { .value = SNIFF_CHANGE_FLAG_TIMEOUT_WT, -- To view, visit https://gerrit.osmocom.org/10205 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ide99e731cad26aec949ad14d54f46fa611a0b7f8 Gerrit-Change-Number: 10205 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 18:22:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 18:22:20 +0000 Subject: Change in osmo-bsc[master]: large refactoring: use FSMs for lchans; add inter-BSC HO In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9671 ) Change subject: large refactoring: use FSMs for lchans; add inter-BSC HO ...................................................................... Patch Set 40: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9671 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I82e3f918295daa83274a4cf803f046979f284366 Gerrit-Change-Number: 9671 Gerrit-PatchSet: 40 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Fri, 27 Jul 2018 18:22:20 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 18:22:51 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 18:22:51 +0000 Subject: Change in simtrace2[master]: sniff: send ATR over GSMTAP In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10204 ) Change subject: sniff: send ATR over GSMTAP ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10204 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id35129883f08002a4a796b56954a128e2b533245 Gerrit-Change-Number: 10204 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Fri, 27 Jul 2018 18:22:51 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 18:23:07 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 18:23:07 +0000 Subject: Change in simtrace2[master]: sniff: rename reset hold/release to assert/deassert In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10205 ) Change subject: sniff: rename reset hold/release to assert/deassert ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10205 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ide99e731cad26aec949ad14d54f46fa611a0b7f8 Gerrit-Change-Number: 10205 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Fri, 27 Jul 2018 18:23:07 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 18:23:09 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 18:23:09 +0000 Subject: Change in simtrace2[master]: sniff: send ATR over GSMTAP In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10204 ) Change subject: sniff: send ATR over GSMTAP ...................................................................... sniff: send ATR over GSMTAP Change-Id: Id35129883f08002a4a796b56954a128e2b533245 --- M host/simtrace2-sniff.c 1 file changed, 14 insertions(+), 5 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/host/simtrace2-sniff.c b/host/simtrace2-sniff.c index 776253a..6d5766f 100644 --- a/host/simtrace2-sniff.c +++ b/host/simtrace2-sniff.c @@ -65,7 +65,7 @@ /* global GSMTAP instance */ static struct gsmtap_inst *g_gti; -static int gsmtap_send_sim(const uint8_t *apdu, unsigned int len) +static int gsmtap_send_sim(uint8_t sub_type, const uint8_t *data, unsigned int len) { struct gsmtap_hdr *gh; unsigned int gross_len = len + sizeof(*gh); @@ -80,8 +80,9 @@ gh->version = GSMTAP_VERSION; gh->hdr_len = sizeof(*gh)/4; gh->type = GSMTAP_TYPE_SIM; + gh->sub_type = sub_type; - memcpy(buf + sizeof(*gh), apdu, len); + memcpy(buf + sizeof(*gh), data, len); rc = write(gsmtap_inst_fd(g_gti), buf, gross_len); if (rc < 0) { @@ -235,9 +236,17 @@ } printf("\n"); - if (SIMTRACE_MSGT_SNIFF_TPDU == type) { - /* send TPDU (now considered as APDU) to GSMTAP */ - gsmtap_send_sim(data->data, data->length); + /* Send message as GSNTAP */ + switch (type) { + case SIMTRACE_MSGT_SNIFF_ATR: + gsmtap_send_sim(GSMTAP_SIM_ATR, data->data, data->length); + break; + case SIMTRACE_MSGT_SNIFF_TPDU: + /* TPDU is now considered as APDU since SIMtrace sends complete TPDU */ + gsmtap_send_sim(GSMTAP_SIM_APDU, data->data, data->length); + break; + default: + break; } return 0; -- To view, visit https://gerrit.osmocom.org/10204 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Id35129883f08002a4a796b56954a128e2b533245 Gerrit-Change-Number: 10204 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 18:23:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 18:23:11 +0000 Subject: Change in simtrace2[master]: sniff: rename reset hold/release to assert/deassert In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10205 ) Change subject: sniff: rename reset hold/release to assert/deassert ...................................................................... sniff: rename reset hold/release to assert/deassert this change is to match the nomenclature used in cardem Change-Id: Ide99e731cad26aec949ad14d54f46fa611a0b7f8 --- M firmware/libcommon/include/simtrace_prot.h M firmware/libcommon/source/sniffer.c M host/simtrace2-sniff.c 3 files changed, 10 insertions(+), 10 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libcommon/include/simtrace_prot.h b/firmware/libcommon/include/simtrace_prot.h index 58e51be..878bc34 100644 --- a/firmware/libcommon/include/simtrace_prot.h +++ b/firmware/libcommon/include/simtrace_prot.h @@ -291,8 +291,8 @@ /* SIMTRACE_MSGT_SNIFF_CHANGE flags */ #define SNIFF_CHANGE_FLAG_CARD_INSERT (1<<0) #define SNIFF_CHANGE_FLAG_CARD_EJECT (1<<1) -#define SNIFF_CHANGE_FLAG_RESET_HOLD (1<<2) -#define SNIFF_CHANGE_FLAG_RESET_RELEASE (1<<3) +#define SNIFF_CHANGE_FLAG_RESET_ASSERT (1<<2) +#define SNIFF_CHANGE_FLAG_RESET_DEASSERT (1<<3) #define SNIFF_CHANGE_FLAG_TIMEOUT_WT (1<<4) /* SIMTRACE_MSGT_SNIFF_ATR, SIMTRACE_MSGT_SNIFF_PPS, SIMTRACE_MSGT_SNIFF_TPDU flags */ #define SNIFF_DATA_FLAG_ERROR_INCOMPLETE (1<<5) diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index f99c25a..e800216 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -854,9 +854,9 @@ } /* Update the ISO state according to the reset change (reset is active low) */ if (PIO_Get(&pin_rst)) { - change_flags |= SNIFF_CHANGE_FLAG_RESET_RELEASE; /* set flag and let main loop send it */ + change_flags |= SNIFF_CHANGE_FLAG_RESET_DEASSERT; /* set flag and let main loop send it */ } else { - change_flags |= SNIFF_CHANGE_FLAG_RESET_HOLD; /* set flag and let main loop send it */ + change_flags |= SNIFF_CHANGE_FLAG_RESET_ASSERT; /* set flag and let main loop send it */ } } @@ -1030,12 +1030,12 @@ /* Handle flags */ if (change_flags) { /* WARNING this is not synced with the data buffer handling */ - if (change_flags & SNIFF_CHANGE_FLAG_RESET_HOLD) { + if (change_flags & SNIFF_CHANGE_FLAG_RESET_ASSERT) { if (ISO7816_S_RESET != iso_state) { change_state(ISO7816_S_RESET); } } - if (change_flags & SNIFF_CHANGE_FLAG_RESET_RELEASE) { + if (change_flags & SNIFF_CHANGE_FLAG_RESET_DEASSERT) { if (ISO7816_S_WAIT_ATR != iso_state) { change_state(ISO7816_S_WAIT_ATR); } diff --git a/host/simtrace2-sniff.c b/host/simtrace2-sniff.c index 6d5766f..aeacc6b 100644 --- a/host/simtrace2-sniff.c +++ b/host/simtrace2-sniff.c @@ -105,12 +105,12 @@ .str = "card ejected", }, { - .value = SNIFF_CHANGE_FLAG_RESET_HOLD, - .str = "reset hold", + .value = SNIFF_CHANGE_FLAG_RESET_ASSERT, + .str = "reset asserted", }, { - .value = SNIFF_CHANGE_FLAG_RESET_RELEASE, - .str = "reset release", + .value = SNIFF_CHANGE_FLAG_RESET_DEASSERT, + .str = "reset de-asserted", }, { .value = SNIFF_CHANGE_FLAG_TIMEOUT_WT, -- To view, visit https://gerrit.osmocom.org/10205 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ide99e731cad26aec949ad14d54f46fa611a0b7f8 Gerrit-Change-Number: 10205 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From admin at opensuse.org Fri Jul 27 18:24:22 2018 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Jul 2018 18:24:22 +0000 Subject: Build failure of network:osmocom:latest/osmo-pcu in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <5b5b6367b7bc5_72527646842661f5@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-pcu/Debian_9.0/x86_64 Package network:osmocom:latest/osmo-pcu failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:latest osmo-pcu Last lines of build log: [ 1794s] TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 70 [ 1794s] +'pcu.tbf' is not a valid counter group identifier [ 1794s] +counter group name mangled: 'pcu.tbf' -> 'pcu:tbf' [ 1794s] +counter group name mangled: 'rlc.nacked' -> 'rlc:nacked' [ 1794s] +'tbf.gprs' is not a valid counter group identifier [ 1794s] +counter group name mangled: 'tbf.gprs' -> 'tbf:gprs' [ 1794s] +counter group name mangled: 'gprs.downlink.cs1' -> 'gprs:downlink:cs1' [ 1794s] +counter group name mangled: 'gprs.downlink.cs2' -> 'gprs:downlink:cs2' [ 1794s] +counter group name mangled: 'gprs.downlink.cs3' -> 'gprs:downlink:cs3' [ 1794s] +counter group name mangled: 'gprs.downlink.cs4' -> 'gprs:downlink:cs4' [ 1794s] TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free [ 1794s] TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=RELEASING) free [ 1794s] 3. testsuite.at:18: 3. ts_alloc (testsuite.at:18): FAILED (testsuite.at:22) [ 1794s] debian/rules:28: recipe for target 'override_dh_auto_test' failed [ 1794s] make[1]: *** [override_dh_auto_test] Error 1 [ 1794s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 1794s] debian/rules:12: recipe for target 'build' failed [ 1794s] make: *** [build] Error 2 [ 1794s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 1794s] [ 1794s] wildcard3 failed "build osmo-pcu_0.5.0.dsc" at Fri Jul 27 18:22:49 UTC 2018. [ 1794s] [ 1794s] ### VM INTERACTION START ### [ 1797s] [ 1664.175153] sysrq: SysRq : Power Off [ 1797s] [ 1664.179922] reboot: Power down [ 1797s] ### VM INTERACTION END ### [ 1797s] [ 1797s] wildcard3 failed "build osmo-pcu_0.5.0.dsc" at Fri Jul 27 18:24:19 UTC 2018. [ 1797s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Fri Jul 27 18:26:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 18:26:28 +0000 Subject: Change in osmo-bsc[master]: fix nanobts: timeslot FSM: use flags to remember OML, RSL status In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10186 ) Change subject: fix nanobts: timeslot FSM: use flags to remember OML,RSL status ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10186 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4843d03b3237cdcca0ad2041ef6895ff253d8419 Gerrit-Change-Number: 10186 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Fri, 27 Jul 2018 18:26:28 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 18:26:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 18:26:44 +0000 Subject: Change in osmo-bsc[master]: timeslot FSM: permit entering broken state from anywhere In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10192 ) Change subject: timeslot FSM: permit entering broken state from anywhere ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10192 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I59abcef2ee1d9e307f8eacf1d5ea663e19099a6a Gerrit-Change-Number: 10192 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Fri, 27 Jul 2018 18:26:44 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 18:26:56 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 18:26:56 +0000 Subject: Change in osmo-bsc[master]: inter-BSC HO: add neighbor_ident API to manage neighbor-BSS-cells In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9666 ) Change subject: inter-BSC HO: add neighbor_ident API to manage neighbor-BSS-cells ...................................................................... Patch Set 14: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9666 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0153d7069817fba9146ddc11214de2757d7d37bf Gerrit-Change-Number: 9666 Gerrit-PatchSet: 14 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 27 Jul 2018 18:26:56 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From admin at opensuse.org Fri Jul 27 18:26:56 2018 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Jul 2018 18:26:56 +0000 Subject: Build failure of network:osmocom:latest/osmo-pcu in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <5b5b63fcdcb28_725276468426622d@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-pcu/xUbuntu_17.04/x86_64 Package network:osmocom:latest/osmo-pcu failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:latest osmo-pcu Last lines of build log: [ 1890s] | #define HAVE_STDLIB_H 1 [ 1890s] | #define HAVE_STRING_H 1 [ 1890s] | #define HAVE_MEMORY_H 1 [ 1890s] | #define HAVE_STRINGS_H 1 [ 1890s] | #define HAVE_INTTYPES_H 1 [ 1890s] | #define HAVE_STDINT_H 1 [ 1890s] | #define HAVE_UNISTD_H 1 [ 1890s] | #define HAVE_DLFCN_H 1 [ 1890s] | #define LT_OBJDIR ".libs/" [ 1890s] | #define STDC_HEADERS 1 [ 1890s] | [ 1890s] | configure: exit 0 [ 1890s] [ 1890s] debian/rules:28: recipe for target 'override_dh_auto_test' failed [ 1890s] make[1]: *** [override_dh_auto_test] Error 1 [ 1890s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 1890s] debian/rules:12: recipe for target 'build' failed [ 1890s] make: *** [build] Error 2 [ 1890s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 1890s] [ 1890s] lamb08 failed "build osmo-pcu_0.5.0.dsc" at Fri Jul 27 18:26:44 UTC 2018. [ 1890s] [ 1890s] ### VM INTERACTION START ### [ 1893s] [ 1882.050393] sysrq: SysRq : Power Off [ 1893s] [ 1882.055685] reboot: Power down [ 1893s] ### VM INTERACTION END ### [ 1893s] [ 1893s] lamb08 failed "build osmo-pcu_0.5.0.dsc" at Fri Jul 27 18:26:48 UTC 2018. [ 1893s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jul 27 18:26:56 2018 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Jul 2018 18:26:56 +0000 Subject: Build failure of network:osmocom:latest/osmo-pcu in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <5b5b63fd5e3d1_7252764684266334@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-pcu/xUbuntu_17.04/x86_64 Package network:osmocom:latest/osmo-pcu failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:latest osmo-pcu Last lines of build log: [ 1890s] | #define HAVE_STDLIB_H 1 [ 1890s] | #define HAVE_STRING_H 1 [ 1890s] | #define HAVE_MEMORY_H 1 [ 1890s] | #define HAVE_STRINGS_H 1 [ 1890s] | #define HAVE_INTTYPES_H 1 [ 1890s] | #define HAVE_STDINT_H 1 [ 1890s] | #define HAVE_UNISTD_H 1 [ 1890s] | #define HAVE_DLFCN_H 1 [ 1890s] | #define LT_OBJDIR ".libs/" [ 1890s] | #define STDC_HEADERS 1 [ 1890s] | [ 1890s] | configure: exit 0 [ 1890s] [ 1890s] debian/rules:28: recipe for target 'override_dh_auto_test' failed [ 1890s] make[1]: *** [override_dh_auto_test] Error 1 [ 1890s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 1890s] debian/rules:12: recipe for target 'build' failed [ 1890s] make: *** [build] Error 2 [ 1890s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 1890s] [ 1890s] lamb08 failed "build osmo-pcu_0.5.0.dsc" at Fri Jul 27 18:26:44 UTC 2018. [ 1890s] [ 1890s] ### VM INTERACTION START ### [ 1893s] [ 1882.050393] sysrq: SysRq : Power Off [ 1893s] [ 1882.055685] reboot: Power down [ 1893s] ### VM INTERACTION END ### [ 1893s] [ 1893s] lamb08 failed "build osmo-pcu_0.5.0.dsc" at Fri Jul 27 18:26:48 UTC 2018. [ 1893s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Fri Jul 27 18:27:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 18:27:27 +0000 Subject: Change in osmo-bsc[master]: timeslot FSM: fix infinite recursion on failure to send PDCH ACT In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10191 ) Change subject: timeslot FSM: fix infinite recursion on failure to send PDCH ACT ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10191 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iebaffd0547a9651c5ba435b54dedab99c2cfdd31 Gerrit-Change-Number: 10191 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Fri, 27 Jul 2018 18:27:27 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 18:27:49 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 18:27:49 +0000 Subject: Change in osmo-bsc[master]: cosmetic: gscon: don't re-enter ST_CLEARING In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10193 ) Change subject: cosmetic: gscon: don't re-enter ST_CLEARING ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10193 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ia1f171c08dcbc529f907a20eed43bf5ee3a452b3 Gerrit-Change-Number: 10193 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Fri, 27 Jul 2018 18:27:49 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From admin at opensuse.org Fri Jul 27 18:27:47 2018 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Jul 2018 18:27:47 +0000 Subject: Build failure of network:osmocom:latest/osmo-pcu in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <5b5b642ebeab7_7252764684266479@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-pcu/xUbuntu_16.10/x86_64 Package network:osmocom:latest/osmo-pcu failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:latest osmo-pcu Last lines of build log: [ 1978s] | #define HAVE_STDLIB_H 1 [ 1978s] | #define HAVE_STRING_H 1 [ 1978s] | #define HAVE_MEMORY_H 1 [ 1978s] | #define HAVE_STRINGS_H 1 [ 1978s] | #define HAVE_INTTYPES_H 1 [ 1978s] | #define HAVE_STDINT_H 1 [ 1978s] | #define HAVE_UNISTD_H 1 [ 1978s] | #define HAVE_DLFCN_H 1 [ 1978s] | #define LT_OBJDIR ".libs/" [ 1978s] | #define STDC_HEADERS 1 [ 1978s] | [ 1978s] | configure: exit 0 [ 1978s] [ 1978s] debian/rules:28: recipe for target 'override_dh_auto_test' failed [ 1978s] make[1]: *** [override_dh_auto_test] Error 1 [ 1978s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 1978s] debian/rules:12: recipe for target 'build' failed [ 1978s] make: *** [build] Error 2 [ 1978s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 1978s] [ 1978s] lamb02 failed "build osmo-pcu_0.5.0.dsc" at Fri Jul 27 18:27:30 UTC 2018. [ 1978s] [ 1978s] ### VM INTERACTION START ### [ 1981s] [ 1966.328882] sysrq: SysRq : Power Off [ 1981s] [ 1966.334714] reboot: Power down [ 1982s] ### VM INTERACTION END ### [ 1982s] [ 1982s] lamb02 failed "build osmo-pcu_0.5.0.dsc" at Fri Jul 27 18:27:34 UTC 2018. [ 1982s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jul 27 18:27:47 2018 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Jul 2018 18:27:47 +0000 Subject: Build failure of network:osmocom:latest/osmo-pcu in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <5b5b642f2c81f_72527646842665b9@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-pcu/xUbuntu_16.10/x86_64 Package network:osmocom:latest/osmo-pcu failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:latest osmo-pcu Last lines of build log: [ 1978s] | #define HAVE_STDLIB_H 1 [ 1978s] | #define HAVE_STRING_H 1 [ 1978s] | #define HAVE_MEMORY_H 1 [ 1978s] | #define HAVE_STRINGS_H 1 [ 1978s] | #define HAVE_INTTYPES_H 1 [ 1978s] | #define HAVE_STDINT_H 1 [ 1978s] | #define HAVE_UNISTD_H 1 [ 1978s] | #define HAVE_DLFCN_H 1 [ 1978s] | #define LT_OBJDIR ".libs/" [ 1978s] | #define STDC_HEADERS 1 [ 1978s] | [ 1978s] | configure: exit 0 [ 1978s] [ 1978s] debian/rules:28: recipe for target 'override_dh_auto_test' failed [ 1978s] make[1]: *** [override_dh_auto_test] Error 1 [ 1978s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 1978s] debian/rules:12: recipe for target 'build' failed [ 1978s] make: *** [build] Error 2 [ 1978s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 1978s] [ 1978s] lamb02 failed "build osmo-pcu_0.5.0.dsc" at Fri Jul 27 18:27:30 UTC 2018. [ 1978s] [ 1978s] ### VM INTERACTION START ### [ 1981s] [ 1966.328882] sysrq: SysRq : Power Off [ 1981s] [ 1966.334714] reboot: Power down [ 1982s] ### VM INTERACTION END ### [ 1982s] [ 1982s] lamb02 failed "build osmo-pcu_0.5.0.dsc" at Fri Jul 27 18:27:34 UTC 2018. [ 1982s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jul 27 18:28:38 2018 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Jul 2018 18:28:38 +0000 Subject: Build failure of network:osmocom:latest/osmo-pcu in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <5b5b64678ac2c_72527646842666c5@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-pcu/xUbuntu_16.04/x86_64 Package network:osmocom:latest/osmo-pcu failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:latest osmo-pcu Last lines of build log: [ 1968s] TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 70 [ 1968s] +'pcu.tbf' is not a valid counter group identifier [ 1968s] +counter group name mangled: 'pcu.tbf' -> 'pcu:tbf' [ 1968s] +counter group name mangled: 'rlc.nacked' -> 'rlc:nacked' [ 1968s] +'tbf.gprs' is not a valid counter group identifier [ 1968s] +counter group name mangled: 'tbf.gprs' -> 'tbf:gprs' [ 1968s] +counter group name mangled: 'gprs.downlink.cs1' -> 'gprs:downlink:cs1' [ 1968s] +counter group name mangled: 'gprs.downlink.cs2' -> 'gprs:downlink:cs2' [ 1968s] +counter group name mangled: 'gprs.downlink.cs3' -> 'gprs:downlink:cs3' [ 1968s] +counter group name mangled: 'gprs.downlink.cs4' -> 'gprs:downlink:cs4' [ 1968s] TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free [ 1968s] TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=RELEASING) free [ 1968s] 3. testsuite.at:18: 3. ts_alloc (testsuite.at:18): FAILED (testsuite.at:22) [ 1968s] debian/rules:28: recipe for target 'override_dh_auto_test' failed [ 1968s] make[1]: *** [override_dh_auto_test] Error 1 [ 1968s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 1968s] debian/rules:12: recipe for target 'build' failed [ 1968s] make: *** [build] Error 2 [ 1968s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 1968s] [ 1968s] lamb27 failed "build osmo-pcu_0.5.0.dsc" at Fri Jul 27 18:28:19 UTC 2018. [ 1968s] [ 1968s] ### VM INTERACTION START ### [ 1971s] [ 1960.733954] sysrq: SysRq : Power Off [ 1971s] [ 1960.739258] reboot: Power down [ 1971s] ### VM INTERACTION END ### [ 1971s] [ 1971s] lamb27 failed "build osmo-pcu_0.5.0.dsc" at Fri Jul 27 18:28:22 UTC 2018. [ 1971s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jul 27 18:30:39 2018 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Jul 2018 18:30:39 +0000 Subject: Build failure of network:osmocom:latest/osmo-pcu in Debian_8.0/i586 In-Reply-To: References: Message-ID: <5b5b64e3707_725276468426719e@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-pcu/Debian_8.0/i586 Package network:osmocom:latest/osmo-pcu failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:latest osmo-pcu Last lines of build log: [ 1980s] TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 70 [ 1980s] +'pcu.tbf' is not a valid counter group identifier [ 1980s] +counter group name mangled: 'pcu.tbf' -> 'pcu:tbf' [ 1980s] +counter group name mangled: 'rlc.nacked' -> 'rlc:nacked' [ 1980s] +'tbf.gprs' is not a valid counter group identifier [ 1980s] +counter group name mangled: 'tbf.gprs' -> 'tbf:gprs' [ 1980s] +counter group name mangled: 'gprs.downlink.cs1' -> 'gprs:downlink:cs1' [ 1980s] +counter group name mangled: 'gprs.downlink.cs2' -> 'gprs:downlink:cs2' [ 1980s] +counter group name mangled: 'gprs.downlink.cs3' -> 'gprs:downlink:cs3' [ 1980s] +counter group name mangled: 'gprs.downlink.cs4' -> 'gprs:downlink:cs4' [ 1980s] TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free [ 1980s] TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=RELEASING) free [ 1980s] 3. testsuite.at:18: 3. ts_alloc (testsuite.at:18): FAILED (testsuite.at:22) [ 1980s] debian/rules:28: recipe for target 'override_dh_auto_test' failed [ 1980s] make[1]: *** [override_dh_auto_test] Error 1 [ 1980s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 1980s] debian/rules:12: recipe for target 'build' failed [ 1980s] make: *** [build] Error 2 [ 1980s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 1980s] [ 1980s] lamb52 failed "build osmo-pcu_0.5.0.dsc" at Fri Jul 27 18:30:31 UTC 2018. [ 1980s] [ 1980s] ### VM INTERACTION START ### [ 1981s] Powering off. [ 1981s] [ 1968.539591] reboot: Power down [ 1981s] ### VM INTERACTION END ### [ 1981s] [ 1981s] lamb52 failed "build osmo-pcu_0.5.0.dsc" at Fri Jul 27 18:30:33 UTC 2018. [ 1981s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jul 27 18:34:04 2018 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Jul 2018 18:34:04 +0000 Subject: Build failure of network:osmocom:latest/osmo-pcu in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <5b5b65a01f7ac_72527646842676f5@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-pcu/xUbuntu_16.04/i586 Package network:osmocom:latest/osmo-pcu failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:latest osmo-pcu Last lines of build log: [ 2292s] TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 70 [ 2292s] +'pcu.tbf' is not a valid counter group identifier [ 2292s] +counter group name mangled: 'pcu.tbf' -> 'pcu:tbf' [ 2292s] +counter group name mangled: 'rlc.nacked' -> 'rlc:nacked' [ 2292s] +'tbf.gprs' is not a valid counter group identifier [ 2292s] +counter group name mangled: 'tbf.gprs' -> 'tbf:gprs' [ 2292s] +counter group name mangled: 'gprs.downlink.cs1' -> 'gprs:downlink:cs1' [ 2292s] +counter group name mangled: 'gprs.downlink.cs2' -> 'gprs:downlink:cs2' [ 2292s] +counter group name mangled: 'gprs.downlink.cs3' -> 'gprs:downlink:cs3' [ 2292s] +counter group name mangled: 'gprs.downlink.cs4' -> 'gprs:downlink:cs4' [ 2292s] TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free [ 2292s] TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=RELEASING) free [ 2292s] 3. testsuite.at:18: 3. ts_alloc (testsuite.at:18): FAILED (testsuite.at:22) [ 2292s] debian/rules:28: recipe for target 'override_dh_auto_test' failed [ 2292s] make[1]: *** [override_dh_auto_test] Error 1 [ 2292s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 2292s] debian/rules:12: recipe for target 'build' failed [ 2292s] make: *** [build] Error 2 [ 2292s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 2292s] [ 2292s] lamb57 failed "build osmo-pcu_0.5.0.dsc" at Fri Jul 27 18:33:22 UTC 2018. [ 2292s] [ 2292s] ### VM INTERACTION START ### [ 2294s] [ 2283.051134] sysrq: SysRq : Power Off [ 2294s] [ 2283.058484] reboot: Power down [ 2294s] ### VM INTERACTION END ### [ 2294s] [ 2294s] lamb57 failed "build osmo-pcu_0.5.0.dsc" at Fri Jul 27 18:33:26 UTC 2018. [ 2294s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jul 27 18:34:05 2018 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Jul 2018 18:34:05 +0000 Subject: Build failure of network:osmocom:latest/osmo-pcu in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <5b5b65a08995c_72527646842677fc@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-pcu/xUbuntu_17.04/i586 Package network:osmocom:latest/osmo-pcu failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:latest osmo-pcu Last lines of build log: [ 2233s] | #define HAVE_STDLIB_H 1 [ 2233s] | #define HAVE_STRING_H 1 [ 2233s] | #define HAVE_MEMORY_H 1 [ 2233s] | #define HAVE_STRINGS_H 1 [ 2233s] | #define HAVE_INTTYPES_H 1 [ 2233s] | #define HAVE_STDINT_H 1 [ 2233s] | #define HAVE_UNISTD_H 1 [ 2233s] | #define HAVE_DLFCN_H 1 [ 2233s] | #define LT_OBJDIR ".libs/" [ 2233s] | #define STDC_HEADERS 1 [ 2233s] | [ 2233s] | configure: exit 0 [ 2233s] [ 2233s] debian/rules:28: recipe for target 'override_dh_auto_test' failed [ 2233s] make[1]: *** [override_dh_auto_test] Error 1 [ 2233s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 2233s] debian/rules:12: recipe for target 'build' failed [ 2233s] make: *** [build] Error 2 [ 2233s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 2233s] [ 2233s] lamb57 failed "build osmo-pcu_0.5.0.dsc" at Fri Jul 27 18:33:29 UTC 2018. [ 2233s] [ 2233s] ### VM INTERACTION START ### [ 2235s] [ 2224.418812] sysrq: SysRq : Power Off [ 2236s] [ 2224.424697] reboot: Power down [ 2236s] ### VM INTERACTION END ### [ 2236s] [ 2236s] lamb57 failed "build osmo-pcu_0.5.0.dsc" at Fri Jul 27 18:33:34 UTC 2018. [ 2236s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jul 27 18:34:05 2018 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Jul 2018 18:34:05 +0000 Subject: Build failure of network:osmocom:latest/osmo-pcu in Debian_9.0/i586 In-Reply-To: References: Message-ID: <5b5b65a0c91b3_725276468426783@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-pcu/Debian_9.0/i586 Package network:osmocom:latest/osmo-pcu failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:latest osmo-pcu Last lines of build log: [ 2212s] | #define HAVE_STDLIB_H 1 [ 2212s] | #define HAVE_STRING_H 1 [ 2212s] | #define HAVE_MEMORY_H 1 [ 2212s] | #define HAVE_STRINGS_H 1 [ 2212s] | #define HAVE_INTTYPES_H 1 [ 2212s] | #define HAVE_STDINT_H 1 [ 2212s] | #define HAVE_UNISTD_H 1 [ 2212s] | #define HAVE_DLFCN_H 1 [ 2212s] | #define LT_OBJDIR ".libs/" [ 2212s] | #define STDC_HEADERS 1 [ 2212s] | [ 2212s] | configure: exit 0 [ 2212s] [ 2212s] debian/rules:28: recipe for target 'override_dh_auto_test' failed [ 2212s] make[1]: *** [override_dh_auto_test] Error 1 [ 2212s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 2212s] debian/rules:12: recipe for target 'build' failed [ 2212s] make: *** [build] Error 2 [ 2212s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 2212s] [ 2212s] lamb57 failed "build osmo-pcu_0.5.0.dsc" at Fri Jul 27 18:33:31 UTC 2018. [ 2212s] [ 2212s] ### VM INTERACTION START ### [ 2215s] [ 2202.853616] sysrq: SysRq : Power Off [ 2215s] [ 2202.858194] reboot: Power down [ 2215s] ### VM INTERACTION END ### [ 2215s] [ 2215s] lamb57 failed "build osmo-pcu_0.5.0.dsc" at Fri Jul 27 18:33:34 UTC 2018. [ 2215s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jul 27 18:34:22 2018 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Jul 2018 18:34:22 +0000 Subject: Build failure of network:osmocom:latest/osmo-pcu in xUbuntu_17.10/x86_64 In-Reply-To: References: Message-ID: <5b5b65b3287df_7252764684267943@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-pcu/xUbuntu_17.10/x86_64 Package network:osmocom:latest/osmo-pcu failed to build in xUbuntu_17.10/x86_64 Check out the package for editing: osc checkout network:osmocom:latest osmo-pcu Last lines of build log: [ 2173s] | #define HAVE_STDLIB_H 1 [ 2173s] | #define HAVE_STRING_H 1 [ 2173s] | #define HAVE_MEMORY_H 1 [ 2173s] | #define HAVE_STRINGS_H 1 [ 2173s] | #define HAVE_INTTYPES_H 1 [ 2173s] | #define HAVE_STDINT_H 1 [ 2173s] | #define HAVE_UNISTD_H 1 [ 2173s] | #define HAVE_DLFCN_H 1 [ 2173s] | #define LT_OBJDIR ".libs/" [ 2173s] | #define STDC_HEADERS 1 [ 2173s] | [ 2173s] | configure: exit 0 [ 2173s] [ 2173s] debian/rules:28: recipe for target 'override_dh_auto_test' failed [ 2173s] make[1]: *** [override_dh_auto_test] Error 1 [ 2173s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 2173s] debian/rules:12: recipe for target 'build' failed [ 2173s] make: *** [build] Error 2 [ 2173s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 2173s] [ 2173s] lamb62 failed "build osmo-pcu_0.5.0.dsc" at Fri Jul 27 18:34:00 UTC 2018. [ 2173s] [ 2173s] ### VM INTERACTION START ### [ 2176s] [ 2163.924198] sysrq: SysRq : Power Off [ 2176s] [ 2163.929533] reboot: Power down [ 2176s] ### VM INTERACTION END ### [ 2176s] [ 2176s] lamb62 failed "build osmo-pcu_0.5.0.dsc" at Fri Jul 27 18:34:04 UTC 2018. [ 2176s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jul 27 18:34:22 2018 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Jul 2018 18:34:22 +0000 Subject: Build failure of network:osmocom:latest/osmo-pcu in xUbuntu_17.10/x86_64 In-Reply-To: References: Message-ID: <5b5b65b3a485a_7252764684268053@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-pcu/xUbuntu_17.10/x86_64 Package network:osmocom:latest/osmo-pcu failed to build in xUbuntu_17.10/x86_64 Check out the package for editing: osc checkout network:osmocom:latest osmo-pcu Last lines of build log: [ 2173s] | #define HAVE_STDLIB_H 1 [ 2173s] | #define HAVE_STRING_H 1 [ 2173s] | #define HAVE_MEMORY_H 1 [ 2173s] | #define HAVE_STRINGS_H 1 [ 2173s] | #define HAVE_INTTYPES_H 1 [ 2173s] | #define HAVE_STDINT_H 1 [ 2173s] | #define HAVE_UNISTD_H 1 [ 2173s] | #define HAVE_DLFCN_H 1 [ 2173s] | #define LT_OBJDIR ".libs/" [ 2173s] | #define STDC_HEADERS 1 [ 2173s] | [ 2173s] | configure: exit 0 [ 2173s] [ 2173s] debian/rules:28: recipe for target 'override_dh_auto_test' failed [ 2173s] make[1]: *** [override_dh_auto_test] Error 1 [ 2173s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 2173s] debian/rules:12: recipe for target 'build' failed [ 2173s] make: *** [build] Error 2 [ 2173s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 2173s] [ 2173s] lamb62 failed "build osmo-pcu_0.5.0.dsc" at Fri Jul 27 18:34:00 UTC 2018. [ 2173s] [ 2173s] ### VM INTERACTION START ### [ 2176s] [ 2163.924198] sysrq: SysRq : Power Off [ 2176s] [ 2163.929533] reboot: Power down [ 2176s] ### VM INTERACTION END ### [ 2176s] [ 2176s] lamb62 failed "build osmo-pcu_0.5.0.dsc" at Fri Jul 27 18:34:04 UTC 2018. [ 2176s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jul 27 18:34:39 2018 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Jul 2018 18:34:39 +0000 Subject: Build failure of network:osmocom:latest/osmo-pcu in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <5b5b65d436f48_72527646842684d6@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-pcu/xUbuntu_16.10/i586 Package network:osmocom:latest/osmo-pcu failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:latest osmo-pcu Last lines of build log: [ 2328s] TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 70 [ 2328s] +'pcu.tbf' is not a valid counter group identifier [ 2328s] +counter group name mangled: 'pcu.tbf' -> 'pcu:tbf' [ 2328s] +counter group name mangled: 'rlc.nacked' -> 'rlc:nacked' [ 2328s] +'tbf.gprs' is not a valid counter group identifier [ 2328s] +counter group name mangled: 'tbf.gprs' -> 'tbf:gprs' [ 2328s] +counter group name mangled: 'gprs.downlink.cs1' -> 'gprs:downlink:cs1' [ 2328s] +counter group name mangled: 'gprs.downlink.cs2' -> 'gprs:downlink:cs2' [ 2328s] +counter group name mangled: 'gprs.downlink.cs3' -> 'gprs:downlink:cs3' [ 2328s] +counter group name mangled: 'gprs.downlink.cs4' -> 'gprs:downlink:cs4' [ 2328s] TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free [ 2328s] TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=RELEASING) free [ 2328s] 3. testsuite.at:18: 3. ts_alloc (testsuite.at:18): FAILED (testsuite.at:22) [ 2328s] debian/rules:28: recipe for target 'override_dh_auto_test' failed [ 2328s] make[1]: *** [override_dh_auto_test] Error 1 [ 2328s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 2328s] debian/rules:12: recipe for target 'build' failed [ 2328s] make: *** [build] Error 2 [ 2328s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 2328s] [ 2328s] lamb57 failed "build osmo-pcu_0.5.0.dsc" at Fri Jul 27 18:34:13 UTC 2018. [ 2328s] [ 2328s] ### VM INTERACTION START ### [ 2331s] [ 2320.100419] sysrq: SysRq : Power Off [ 2331s] [ 2320.106115] reboot: Power down [ 2331s] ### VM INTERACTION END ### [ 2331s] [ 2331s] lamb57 failed "build osmo-pcu_0.5.0.dsc" at Fri Jul 27 18:34:18 UTC 2018. [ 2331s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jul 27 18:34:39 2018 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Jul 2018 18:34:39 +0000 Subject: Build failure of network:osmocom:latest/osmo-pcu in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <5b5b65d4e5161_72527646842686f2@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-pcu/xUbuntu_16.10/i586 Package network:osmocom:latest/osmo-pcu failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:latest osmo-pcu Last lines of build log: [ 2328s] TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 70 [ 2328s] +'pcu.tbf' is not a valid counter group identifier [ 2328s] +counter group name mangled: 'pcu.tbf' -> 'pcu:tbf' [ 2328s] +counter group name mangled: 'rlc.nacked' -> 'rlc:nacked' [ 2328s] +'tbf.gprs' is not a valid counter group identifier [ 2328s] +counter group name mangled: 'tbf.gprs' -> 'tbf:gprs' [ 2328s] +counter group name mangled: 'gprs.downlink.cs1' -> 'gprs:downlink:cs1' [ 2328s] +counter group name mangled: 'gprs.downlink.cs2' -> 'gprs:downlink:cs2' [ 2328s] +counter group name mangled: 'gprs.downlink.cs3' -> 'gprs:downlink:cs3' [ 2328s] +counter group name mangled: 'gprs.downlink.cs4' -> 'gprs:downlink:cs4' [ 2328s] TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free [ 2328s] TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=RELEASING) free [ 2328s] 3. testsuite.at:18: 3. ts_alloc (testsuite.at:18): FAILED (testsuite.at:22) [ 2328s] debian/rules:28: recipe for target 'override_dh_auto_test' failed [ 2328s] make[1]: *** [override_dh_auto_test] Error 1 [ 2328s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 2328s] debian/rules:12: recipe for target 'build' failed [ 2328s] make: *** [build] Error 2 [ 2328s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 2328s] [ 2328s] lamb57 failed "build osmo-pcu_0.5.0.dsc" at Fri Jul 27 18:34:13 UTC 2018. [ 2328s] [ 2328s] ### VM INTERACTION START ### [ 2331s] [ 2320.100419] sysrq: SysRq : Power Off [ 2331s] [ 2320.106115] reboot: Power down [ 2331s] ### VM INTERACTION END ### [ 2331s] [ 2331s] lamb57 failed "build osmo-pcu_0.5.0.dsc" at Fri Jul 27 18:34:18 UTC 2018. [ 2331s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jul 27 18:35:30 2018 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Jul 2018 18:35:30 +0000 Subject: Build failure of network:osmocom:latest/osmo-pcu in xUbuntu_18.04/x86_64 In-Reply-To: References: Message-ID: <5b5b65fc6372f_72527646842693ec@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-pcu/xUbuntu_18.04/x86_64 Package network:osmocom:latest/osmo-pcu failed to build in xUbuntu_18.04/x86_64 Check out the package for editing: osc checkout network:osmocom:latest osmo-pcu Last lines of build log: [ 2253s] TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 70 [ 2253s] +'pcu.tbf' is not a valid counter group identifier [ 2253s] +counter group name mangled: 'pcu.tbf' -> 'pcu:tbf' [ 2253s] +counter group name mangled: 'rlc.nacked' -> 'rlc:nacked' [ 2253s] +'tbf.gprs' is not a valid counter group identifier [ 2253s] +counter group name mangled: 'tbf.gprs' -> 'tbf:gprs' [ 2253s] +counter group name mangled: 'gprs.downlink.cs1' -> 'gprs:downlink:cs1' [ 2253s] +counter group name mangled: 'gprs.downlink.cs2' -> 'gprs:downlink:cs2' [ 2253s] +counter group name mangled: 'gprs.downlink.cs3' -> 'gprs:downlink:cs3' [ 2253s] +counter group name mangled: 'gprs.downlink.cs4' -> 'gprs:downlink:cs4' [ 2253s] TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free [ 2253s] TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=RELEASING) free [ 2253s] 3. testsuite.at:18: 3. ts_alloc (testsuite.at:18): FAILED (testsuite.at:22) [ 2253s] debian/rules:28: recipe for target 'override_dh_auto_test' failed [ 2253s] make[1]: *** [override_dh_auto_test] Error 1 [ 2253s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 2253s] debian/rules:12: recipe for target 'build' failed [ 2253s] make: *** [build] Error 2 [ 2253s] dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2 [ 2253s] [ 2253s] lamb58 failed "build osmo-pcu_0.5.0.dsc" at Fri Jul 27 18:35:11 UTC 2018. [ 2253s] [ 2253s] ### VM INTERACTION START ### [ 2256s] [ 2240.593843] sysrq: SysRq : Power Off [ 2256s] [ 2240.600791] reboot: Power down [ 2256s] ### VM INTERACTION END ### [ 2256s] [ 2256s] lamb58 failed "build osmo-pcu_0.5.0.dsc" at Fri Jul 27 18:35:16 UTC 2018. [ 2256s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jul 27 18:35:30 2018 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Jul 2018 18:35:30 +0000 Subject: Build failure of network:osmocom:latest/osmo-pcu in xUbuntu_18.04/x86_64 In-Reply-To: References: Message-ID: <5b5b65fccfeb0_7252764684269432@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-pcu/xUbuntu_18.04/x86_64 Package network:osmocom:latest/osmo-pcu failed to build in xUbuntu_18.04/x86_64 Check out the package for editing: osc checkout network:osmocom:latest osmo-pcu Last lines of build log: [ 2253s] TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 70 [ 2253s] +'pcu.tbf' is not a valid counter group identifier [ 2253s] +counter group name mangled: 'pcu.tbf' -> 'pcu:tbf' [ 2253s] +counter group name mangled: 'rlc.nacked' -> 'rlc:nacked' [ 2253s] +'tbf.gprs' is not a valid counter group identifier [ 2253s] +counter group name mangled: 'tbf.gprs' -> 'tbf:gprs' [ 2253s] +counter group name mangled: 'gprs.downlink.cs1' -> 'gprs:downlink:cs1' [ 2253s] +counter group name mangled: 'gprs.downlink.cs2' -> 'gprs:downlink:cs2' [ 2253s] +counter group name mangled: 'gprs.downlink.cs3' -> 'gprs:downlink:cs3' [ 2253s] +counter group name mangled: 'gprs.downlink.cs4' -> 'gprs:downlink:cs4' [ 2253s] TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free [ 2253s] TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=RELEASING) free [ 2253s] 3. testsuite.at:18: 3. ts_alloc (testsuite.at:18): FAILED (testsuite.at:22) [ 2253s] debian/rules:28: recipe for target 'override_dh_auto_test' failed [ 2253s] make[1]: *** [override_dh_auto_test] Error 1 [ 2253s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 2253s] debian/rules:12: recipe for target 'build' failed [ 2253s] make: *** [build] Error 2 [ 2253s] dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2 [ 2253s] [ 2253s] lamb58 failed "build osmo-pcu_0.5.0.dsc" at Fri Jul 27 18:35:11 UTC 2018. [ 2253s] [ 2253s] ### VM INTERACTION START ### [ 2256s] [ 2240.593843] sysrq: SysRq : Power Off [ 2256s] [ 2240.600791] reboot: Power down [ 2256s] ### VM INTERACTION END ### [ 2256s] [ 2256s] lamb58 failed "build osmo-pcu_0.5.0.dsc" at Fri Jul 27 18:35:16 UTC 2018. [ 2256s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Fri Jul 27 19:43:21 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 27 Jul 2018 19:43:21 +0000 Subject: Change in osmocom-bb[master]: trxcon: make both Valgrind and trxcon happy Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/10206 Change subject: trxcon: make both Valgrind and trxcon happy ...................................................................... trxcon: make both Valgrind and trxcon happy Change-Id: If5c349082757bb30408477b1ef528934eded0232 --- M src/host/trxcon/trxcon.c 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/06/10206/1 diff --git a/src/host/trxcon/trxcon.c b/src/host/trxcon/trxcon.c index c746816..84d132e 100644 --- a/src/host/trxcon/trxcon.c +++ b/src/host/trxcon/trxcon.c @@ -320,6 +320,11 @@ * to be able to find and fix potential memory leaks. */ talloc_report_full(tall_trx_ctx, stderr); + talloc_free(tall_trx_ctx); + + /* Make both Valgrind and ASAN happy */ + talloc_report_full(NULL, stderr); + talloc_disable_null_tracking(); return rc; } -- To view, visit https://gerrit.osmocom.org/10206 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: If5c349082757bb30408477b1ef528934eded0232 Gerrit-Change-Number: 10206 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 19:57:23 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 27 Jul 2018 19:57:23 +0000 Subject: =?UTF-8?Q?Change_in_osmo-pcu=5Bmaster=5D=3A_Bump_version=3A_0=2E5=2E0=2E11-218e-dirty_=E2=86=92_0=2E5=2E1?= Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10207 Change subject: Bump version: 0.5.0.11-218e-dirty ? 0.5.1 ...................................................................... Bump version: 0.5.0.11-218e-dirty ? 0.5.1 Change-Id: I0c5a3f3cee8332d5088982117037d5a0b077061b --- M configure.ac M debian/changelog 2 files changed, 25 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/07/10207/1 diff --git a/configure.ac b/configure.ac index 86b4ee1..69e0775 100644 --- a/configure.ac +++ b/configure.ac @@ -73,10 +73,10 @@ fi dnl checks for libraries -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.11.0) -PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.11.0) -PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.11.0) -PKG_CHECK_MODULES(LIBOSMOGB, libosmogb >= 0.11.0) +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.12.0) +PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.12.0) +PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.12.0) +PKG_CHECK_MODULES(LIBOSMOGB, libosmogb >= 0.12.0) AC_MSG_CHECKING([whether to enable direct DSP access for PDCH of sysmocom-bts]) AC_ARG_ENABLE(sysmocom-dsp, diff --git a/debian/changelog b/debian/changelog index 8ece776..e5df5c7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,24 @@ +osmo-pcu (0.5.1) unstable; urgency=medium + + [ Harald Welte ] + * Don't register SIGHUP handler without actually handling SIGHUP + + [ Pau Espin Pedrol ] + * tbf: Fix memset(0) on object with no trivial copy-assignment + * rlc: Fix memset(0) on object with no trivial copy-assignment + * jenkins.sh: use flag --enable-werror for sysmo and none + * tbf: Use incrementing id for rate_ctr_group_alloc + * tbf: Replace '.' in counter names with ':' + + [ Stefan Sperling ] + * fix a one-byte stack buffer overrun in osmo-pcu + * read monotonic clock with clock_gettime() instead of gettimeofday() + * fix time-delta calculations for measurement reports + * change log level of "DL packet loss" log messages + * check bssgp_tlv_parse() return code in gprs_bssgp_pcu_rcvmsg() + + -- Pau Espin Pedrol Fri, 27 Jul 2018 21:56:38 +0200 + osmo-pcu (0.5.0) unstable; urgency=medium [ Neels Hofmeyr ] -- To view, visit https://gerrit.osmocom.org/10207 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I0c5a3f3cee8332d5088982117037d5a0b077061b Gerrit-Change-Number: 10207 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 20:07:37 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 27 Jul 2018 20:07:37 +0000 Subject: =?UTF-8?Q?Change_in_osmo-pcu=5Bmaster=5D=3A_Bump_version=3A_0=2E5=2E0=2E11-218e-dirty_=E2=86=92_0=2E5=2E1?= In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10207 ) Change subject: Bump version: 0.5.0.11-218e-dirty ? 0.5.1 ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10207 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0c5a3f3cee8332d5088982117037d5a0b077061b Gerrit-Change-Number: 10207 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Fri, 27 Jul 2018 20:07:37 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 20:07:38 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 27 Jul 2018 20:07:38 +0000 Subject: =?UTF-8?Q?Change_in_osmo-pcu=5Bmaster=5D=3A_Bump_version=3A_0=2E5=2E0=2E11-218e-dirty_=E2=86=92_0=2E5=2E1?= In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/10207 ) Change subject: Bump version: 0.5.0.11-218e-dirty ? 0.5.1 ...................................................................... Bump version: 0.5.0.11-218e-dirty ? 0.5.1 Change-Id: I0c5a3f3cee8332d5088982117037d5a0b077061b --- M configure.ac M debian/changelog 2 files changed, 25 insertions(+), 4 deletions(-) Approvals: Jenkins Builder: Verified Pau Espin Pedrol: Looks good to me, approved diff --git a/configure.ac b/configure.ac index 86b4ee1..69e0775 100644 --- a/configure.ac +++ b/configure.ac @@ -73,10 +73,10 @@ fi dnl checks for libraries -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.11.0) -PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.11.0) -PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.11.0) -PKG_CHECK_MODULES(LIBOSMOGB, libosmogb >= 0.11.0) +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.12.0) +PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.12.0) +PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.12.0) +PKG_CHECK_MODULES(LIBOSMOGB, libosmogb >= 0.12.0) AC_MSG_CHECKING([whether to enable direct DSP access for PDCH of sysmocom-bts]) AC_ARG_ENABLE(sysmocom-dsp, diff --git a/debian/changelog b/debian/changelog index 8ece776..e5df5c7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,24 @@ +osmo-pcu (0.5.1) unstable; urgency=medium + + [ Harald Welte ] + * Don't register SIGHUP handler without actually handling SIGHUP + + [ Pau Espin Pedrol ] + * tbf: Fix memset(0) on object with no trivial copy-assignment + * rlc: Fix memset(0) on object with no trivial copy-assignment + * jenkins.sh: use flag --enable-werror for sysmo and none + * tbf: Use incrementing id for rate_ctr_group_alloc + * tbf: Replace '.' in counter names with ':' + + [ Stefan Sperling ] + * fix a one-byte stack buffer overrun in osmo-pcu + * read monotonic clock with clock_gettime() instead of gettimeofday() + * fix time-delta calculations for measurement reports + * change log level of "DL packet loss" log messages + * check bssgp_tlv_parse() return code in gprs_bssgp_pcu_rcvmsg() + + -- Pau Espin Pedrol Fri, 27 Jul 2018 21:56:38 +0200 + osmo-pcu (0.5.0) unstable; urgency=medium [ Neels Hofmeyr ] -- To view, visit https://gerrit.osmocom.org/10207 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I0c5a3f3cee8332d5088982117037d5a0b077061b Gerrit-Change-Number: 10207 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From admin at opensuse.org Fri Jul 27 20:08:24 2018 From: admin at opensuse.org (OBS Notification) Date: Fri, 27 Jul 2018 20:08:24 +0000 Subject: Build failure of network:osmocom:latest/osmo-pcu in Debian_9.0/armv7l In-Reply-To: References: Message-ID: <5b5b7bc8d8638_725276468430128a@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/osmo-pcu/Debian_9.0/armv7l Package network:osmocom:latest/osmo-pcu failed to build in Debian_9.0/armv7l Check out the package for editing: osc checkout network:osmocom:latest osmo-pcu Last lines of build log: [ 3639s] TBF(TFI=28 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 6 [ 3639s] TBF(TFI=28 TLLI=0xc000008f DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 40, dl_slots = 40 [ 3639s] +'pcu.tbf' is not a valid counter group identifier [ 3639s] +counter group name mangled: 'pcu.tbf' -> 'pcu:tbf' [ 3639s] +counter group name mangled: 'rlc.nacked' -> 'rlc:nacked' [ 3639s] +'tbf.gprs' is not a valid counter group identifier [ 3639s] +counter group name mangled: 'tbf.gprs' -> 'tbf:gprs' [ 3639s] +counter group name mangled: 'gprs.downlink.cs1' -> 'gprs:downlink:cs1' [ 3639s] +counter group name mangled: 'gprs.downlink.cs2' -> 'gprs:downlink:cs2' [ 3639s] +counter group name mangled: 'gprs.downlink.cs3' -> 'gprs:downlink:cs3' [ 3639s] +counter group name mangled: 'gprs.downlink.cs4' -> 'gprs:downlink:cs4' [ 3639s] No TFI available (suggested TRX: 0). [ 3639s] TBF(TFI=28 TLLI=0xc0000090 DIR=DL STATE=RELEASING) free [ 3639s] Allocating DL TBF: MS_CLASS=7/0 [ 3639s] TBF(TFI=28 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 7 [ 3639s] TBF(TFI=28 TLLI=0xc0000090 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 80 [ 3639s] +'pcu.tbf' is not a valid counter group identifier [ 3639s] +counter group name mangled: 'pcu.tbf' -> 'pcu:tbf' [ 3639s] +counter group name mangled: 'rlc.nacked' -> 'rlc:nacked' [ 3639s] +'tbf.gprs' is not a valid counter group identifier [ 3639s] +counter group name mangled: 'tbf.gprs' -> 'tbf:gprs' [ 3639s] +counter group name mangled: 'gprs.downlink.cs1' -> 'gprs:downlink:cs1' [ 3639s] +counter group name mangled: 'gprs.downlink.cs2' -> 'gprs:downlink:cs2' [ 3641s] +counter group name mangled: 'gprs.downlink.cs3' -> 'gprs:downlin[ 3598.930598] SysRq : Power Off [ 3641s] [ 3598.932269] reboot: Power down [ 3641s] ### VM INTERACTION END ### [ 3641s] [ 3641s] armbuild13 failed "build osmo-pcu_0.5.0.dsc" at Fri Jul 27 20:08:20 UTC 2018. [ 3641s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Fri Jul 27 20:14:00 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 20:14:00 +0000 Subject: Change in osmocom-bb[master]: trxcon: make both Valgrind and trxcon happy In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10206 ) Change subject: trxcon: make both Valgrind and trxcon happy ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10206 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If5c349082757bb30408477b1ef528934eded0232 Gerrit-Change-Number: 10206 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Fri, 27 Jul 2018 20:14:00 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Fri Jul 27 20:14:01 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 27 Jul 2018 20:14:01 +0000 Subject: Change in osmocom-bb[master]: trxcon: make both Valgrind and trxcon happy In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10206 ) Change subject: trxcon: make both Valgrind and trxcon happy ...................................................................... trxcon: make both Valgrind and trxcon happy Change-Id: If5c349082757bb30408477b1ef528934eded0232 --- M src/host/trxcon/trxcon.c 1 file changed, 5 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/host/trxcon/trxcon.c b/src/host/trxcon/trxcon.c index c746816..84d132e 100644 --- a/src/host/trxcon/trxcon.c +++ b/src/host/trxcon/trxcon.c @@ -320,6 +320,11 @@ * to be able to find and fix potential memory leaks. */ talloc_report_full(tall_trx_ctx, stderr); + talloc_free(tall_trx_ctx); + + /* Make both Valgrind and ASAN happy */ + talloc_report_full(NULL, stderr); + talloc_disable_null_tracking(); return rc; } -- To view, visit https://gerrit.osmocom.org/10206 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: If5c349082757bb30408477b1ef528934eded0232 Gerrit-Change-Number: 10206 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 00:49:16 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sat, 28 Jul 2018 00:49:16 +0000 Subject: Change in osmo-mgw[master]: configure: Find correct libgsm's gsm.h header Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10208 Change subject: configure: Find correct libgsm's gsm.h header ...................................................................... configure: Find correct libgsm's gsm.h header Some distributions (archlinux) or versions of libgsm install gsm.h in /usr/include/gsm/gsm.h Since libgsm doesn't come with a pkfconfig, let's first check if gsm.h and take the correct path in the build setup. Change-Id: I07d3c03903e0d4bb80e843c7ed917a27b791ea53 --- M configure.ac M include/osmocom/legacy_mgcp/mgcp_transcode.h 2 files changed, 11 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/08/10208/1 diff --git a/configure.ac b/configure.ac index 29390c6..b0b0d21 100644 --- a/configure.ac +++ b/configure.ac @@ -80,6 +80,13 @@ AC_ARG_WITH([g729], [AS_HELP_STRING([--with-g729], [Enable G.729 encoding/decoding.])], [osmo_ac_with_g729="$withval"],[osmo_ac_with_g729="no"]) if test "$osmo_ac_mgcp_transcoding" = "yes" ; then + AC_CHECK_HEADERS([gsm.h gsm/gsm.h], [osmo_ac_found_gsm_headers=yes]) + if test "$osmo_ac_found_gsm_headers" != "yes" ; then + AC_MSG_ERROR([Unable to find the libgsm headers]) + fi + AC_SUBST(HAVE_GSM_H) + AC_SUBST(HAVE_GSM_GSM_H) + AC_SEARCH_LIBS([gsm_create], [gsm], [LIBRARY_GSM="$LIBS";LIBS=""], [AC_MSG_ERROR([--enable-mgcp-transcoding: cannot find usable libgsm])]) AC_SUBST(LIBRARY_GSM) if test "$osmo_ac_with_g729" = "yes" ; then diff --git a/include/osmocom/legacy_mgcp/mgcp_transcode.h b/include/osmocom/legacy_mgcp/mgcp_transcode.h index 147e48b..6892deb 100644 --- a/include/osmocom/legacy_mgcp/mgcp_transcode.h +++ b/include/osmocom/legacy_mgcp/mgcp_transcode.h @@ -21,7 +21,11 @@ #include "bscconfig.h" +#if HAVE_GSM_H #include +#elif HAVE_GSM_GSM_H +#include +#endif #ifdef HAVE_BCG729 #include #include -- To view, visit https://gerrit.osmocom.org/10208 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I07d3c03903e0d4bb80e843c7ed917a27b791ea53 Gerrit-Change-Number: 10208 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 07:35:12 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Jul 2018 07:35:12 +0000 Subject: Change in osmo-mgw[master]: configure: Find correct libgsm's gsm.h header In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10208 ) Change subject: configure: Find correct libgsm's gsm.h header ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10208 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I07d3c03903e0d4bb80e843c7ed917a27b791ea53 Gerrit-Change-Number: 10208 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Sat, 28 Jul 2018 07:35:12 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 07:35:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Jul 2018 07:35:16 +0000 Subject: Change in osmo-mgw[master]: configure: Find correct libgsm's gsm.h header In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10208 ) Change subject: configure: Find correct libgsm's gsm.h header ...................................................................... configure: Find correct libgsm's gsm.h header Some distributions (archlinux) or versions of libgsm install gsm.h in /usr/include/gsm/gsm.h Since libgsm doesn't come with a pkfconfig, let's first check if gsm.h and take the correct path in the build setup. Change-Id: I07d3c03903e0d4bb80e843c7ed917a27b791ea53 --- M configure.ac M include/osmocom/legacy_mgcp/mgcp_transcode.h 2 files changed, 11 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/configure.ac b/configure.ac index 29390c6..b0b0d21 100644 --- a/configure.ac +++ b/configure.ac @@ -80,6 +80,13 @@ AC_ARG_WITH([g729], [AS_HELP_STRING([--with-g729], [Enable G.729 encoding/decoding.])], [osmo_ac_with_g729="$withval"],[osmo_ac_with_g729="no"]) if test "$osmo_ac_mgcp_transcoding" = "yes" ; then + AC_CHECK_HEADERS([gsm.h gsm/gsm.h], [osmo_ac_found_gsm_headers=yes]) + if test "$osmo_ac_found_gsm_headers" != "yes" ; then + AC_MSG_ERROR([Unable to find the libgsm headers]) + fi + AC_SUBST(HAVE_GSM_H) + AC_SUBST(HAVE_GSM_GSM_H) + AC_SEARCH_LIBS([gsm_create], [gsm], [LIBRARY_GSM="$LIBS";LIBS=""], [AC_MSG_ERROR([--enable-mgcp-transcoding: cannot find usable libgsm])]) AC_SUBST(LIBRARY_GSM) if test "$osmo_ac_with_g729" = "yes" ; then diff --git a/include/osmocom/legacy_mgcp/mgcp_transcode.h b/include/osmocom/legacy_mgcp/mgcp_transcode.h index 147e48b..6892deb 100644 --- a/include/osmocom/legacy_mgcp/mgcp_transcode.h +++ b/include/osmocom/legacy_mgcp/mgcp_transcode.h @@ -21,7 +21,11 @@ #include "bscconfig.h" +#if HAVE_GSM_H #include +#elif HAVE_GSM_GSM_H +#include +#endif #ifdef HAVE_BCG729 #include #include -- To view, visit https://gerrit.osmocom.org/10208 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I07d3c03903e0d4bb80e843c7ed917a27b791ea53 Gerrit-Change-Number: 10208 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 10:43:51 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 28 Jul 2018 10:43:51 +0000 Subject: Change in osmo-bsc[master]: inter-BSC HO: add neighbor_ident API to manage neighbor-BSS-cells In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/9666 ) Change subject: inter-BSC HO: add neighbor_ident API to manage neighbor-BSS-cells ...................................................................... inter-BSC HO: add neighbor_ident API to manage neighbor-BSS-cells Depends: Ia71ba742108b5ff020997bfb612ad5eb30d04fcd (libosmocore) Change-Id: I0153d7069817fba9146ddc11214de2757d7d37bf --- M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/handover.h A include/osmocom/bsc/neighbor_ident.h M src/osmo-bsc/Makefile.am M src/osmo-bsc/bsc_init.c M src/osmo-bsc/bsc_vty.c M src/osmo-bsc/gsm_data.c M src/osmo-bsc/handover_logic.c A src/osmo-bsc/neighbor_ident.c A src/osmo-bsc/neighbor_ident_vty.c M src/osmo-bsc/net_init.c M src/osmo-bsc/system_information.c M tests/bsc/Makefile.am M tests/gsm0408/Makefile.am M tests/handover/Makefile.am A tests/handover/neighbor_ident_test.c A tests/handover/neighbor_ident_test.err A tests/handover/neighbor_ident_test.ok A tests/neighbor_ident.vty M tests/testsuite.at 21 files changed, 1,983 insertions(+), 5 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am index dfab592..0b576cd 100644 --- a/include/osmocom/bsc/Makefile.am +++ b/include/osmocom/bsc/Makefile.am @@ -28,6 +28,7 @@ meas_feed.h \ meas_rep.h \ misdn.h \ + neighbor_ident.h \ network_listen.h \ openbscdefines.h \ osmo_bsc.h \ diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 5794617..a16a4b7 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -35,6 +35,7 @@ struct mgcp_client_conf; struct mgcp_client; struct mgcp_ctx; +struct gsm0808_cell_id; /** annotations for msgb ownership */ #define __uses @@ -750,6 +751,12 @@ unsigned int used; }; +/* Useful to track N-N relations between BTS, for example neighbors. */ +struct gsm_bts_ref { + struct llist_head entry; + struct gsm_bts *bts; +}; + /* One BTS */ struct gsm_bts { /* list header in net->bts_list */ @@ -984,6 +991,11 @@ struct handover_cfg *ho; + /* A list of struct gsm_bts_ref, indicating neighbors of this BTS. + * When the si_common neigh_list is in automatic mode, it is populated from this list as well as + * gsm_network->neighbor_bss_cells. */ + struct llist_head local_neighbors; + /* BTS-specific overrides for timer values from struct gsm_network. */ uint8_t T3122; /* ASSIGMENT REJECT wait indication */ @@ -998,6 +1010,13 @@ struct gsm_bts *gsm_bts_alloc(struct gsm_network *net, uint8_t bts_num); struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num); +bool gsm_bts_matches_lai(const struct gsm_bts *bts, const struct osmo_location_area_id *lai); +bool gsm_bts_matches_cell_id(const struct gsm_bts *bts, const struct gsm0808_cell_id *cell_id); +struct gsm_bts *gsm_bts_by_cell_id(const struct gsm_network *net, + const struct gsm0808_cell_id *cell_id, + int match_idx); +int gsm_bts_local_neighbor_add(struct gsm_bts *bts, struct gsm_bts *neighbor); +int gsm_bts_local_neighbor_del(struct gsm_bts *bts, const struct gsm_bts *neighbor); struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts); struct gsm_bts_trx *gsm_bts_trx_num(const struct gsm_bts *bts, int num); @@ -1281,6 +1300,9 @@ struct mgcp_client_conf *conf; struct mgcp_client *client; } mgw; + + /* Remote BSS Cell Identifier Lists */ + struct neighbor_ident_list *neighbor_bss_cells; }; static inline const struct osmo_location_area_id *bts_lai(struct gsm_bts *bts) diff --git a/include/osmocom/bsc/handover.h b/include/osmocom/bsc/handover.h index 772ab98..aa117cc 100644 --- a/include/osmocom/bsc/handover.h +++ b/include/osmocom/bsc/handover.h @@ -6,6 +6,8 @@ #include #include +#include + struct gsm_lchan; struct gsm_bts; struct gsm_subscriber_connection; @@ -94,3 +96,7 @@ void handover_decision_callbacks_register(struct handover_decision_callbacks *hdc); struct handover_decision_callbacks *handover_decision_callbacks_get(int hodec_id); + +struct gsm_bts *bts_by_neighbor_ident(const struct gsm_network *net, + const struct neighbor_ident_key *search_for); +struct neighbor_ident_key *bts_ident_key(const struct gsm_bts *bts); diff --git a/include/osmocom/bsc/neighbor_ident.h b/include/osmocom/bsc/neighbor_ident.h new file mode 100644 index 0000000..bba18c3 --- /dev/null +++ b/include/osmocom/bsc/neighbor_ident.h @@ -0,0 +1,63 @@ +/* Manage identity of neighboring BSS cells for inter-BSC handover */ +#pragma once + +#include +#include + +#include + +struct vty; +struct gsm_network; +struct gsm_bts; +struct neighbor_ident_list; +struct gsm0808_cell_id_list2; + +enum bsic_kind { + BSIC_NONE, + BSIC_6BIT, + BSIC_9BIT, +}; + +#define NEIGHBOR_IDENT_KEY_ANY_BTS -1 + +struct neighbor_ident_key { + int from_bts; /*< BTS nr 0..255 or NEIGHBOR_IDENT_KEY_ANY_BTS */ + uint16_t arfcn; + enum bsic_kind bsic_kind; + uint16_t bsic; +}; + +const char *neighbor_ident_key_name(const struct neighbor_ident_key *ni_key); + +struct neighbor_ident_list *neighbor_ident_init(void *talloc_ctx); +void neighbor_ident_free(struct neighbor_ident_list *nil); + +bool neighbor_ident_key_match(const struct neighbor_ident_key *entry, + const struct neighbor_ident_key *search_for, + bool exact_match); + +int neighbor_ident_add(struct neighbor_ident_list *nil, const struct neighbor_ident_key *key, + const struct gsm0808_cell_id_list2 *val); +const struct gsm0808_cell_id_list2 *neighbor_ident_get(const struct neighbor_ident_list *nil, + const struct neighbor_ident_key *key); +bool neighbor_ident_del(struct neighbor_ident_list *nil, const struct neighbor_ident_key *key); +void neighbor_ident_clear(struct neighbor_ident_list *nil); + +void neighbor_ident_iter(const struct neighbor_ident_list *nil, + bool (* iter_cb )(const struct neighbor_ident_key *key, + const struct gsm0808_cell_id_list2 *val, + void *cb_data), + void *cb_data); + +void neighbor_ident_vty_init(struct gsm_network *net, struct neighbor_ident_list *nil); +void neighbor_ident_vty_write(struct vty *vty, const char *indent, struct gsm_bts *bts); + +#define NEIGHBOR_IDENT_VTY_KEY_PARAMS "arfcn <0-1023> (bsic|bsic9) (<0-511>|any)" +#define NEIGHBOR_IDENT_VTY_KEY_DOC \ + "ARFCN of neighbor cell\n" "ARFCN value\n" \ + "BSIC of neighbor cell\n" "9-bit BSIC of neighbor cell\n" "BSIC value\n" \ + "for all BSICs / use any BSIC in this ARFCN\n" +bool neighbor_ident_vty_parse_key_params(struct vty *vty, const char **argv, + struct neighbor_ident_key *key); +bool neighbor_ident_bts_parse_key_params(struct vty *vty, struct gsm_bts *bts, const char **argv, + struct neighbor_ident_key *key); diff --git a/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am index db63a99..bf7ef11 100644 --- a/src/osmo-bsc/Makefile.am +++ b/src/osmo-bsc/Makefile.am @@ -65,6 +65,8 @@ handover_vty.c \ meas_feed.c \ meas_rep.c \ + neighbor_ident.c \ + neighbor_ident_vty.c \ net_init.c \ osmo_bsc_api.c \ osmo_bsc_audio.c \ diff --git a/src/osmo-bsc/bsc_init.c b/src/osmo-bsc/bsc_init.c index b6bd410..1fe4847 100644 --- a/src/osmo-bsc/bsc_init.c +++ b/src/osmo-bsc/bsc_init.c @@ -247,6 +247,7 @@ net->ho = ho_cfg_init(net, NULL); net->hodec2.congestion_check_interval_s = HO_CFG_CONGESTION_CHECK_DEFAULT; + net->neighbor_bss_cells = neighbor_ident_init(net); /* init statistics */ net->bsc_ctrs = rate_ctr_group_alloc(net, &bsc_ctrg_desc, 0); diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c index 77a534d..b1e6d78 100644 --- a/src/osmo-bsc/bsc_vty.c +++ b/src/osmo-bsc/bsc_vty.c @@ -62,6 +62,8 @@ #include #include #include +#include +#include #include @@ -909,6 +911,8 @@ VTY_NEWLINE); } + neighbor_ident_vty_write(vty, " ", bts); + vty_out(vty, " codec-support fr"); if (bts->codec.hr) vty_out(vty, " hr"); @@ -4969,6 +4973,7 @@ install_element(BTS_NODE, &cfg_bts_no_acc_ramping_cmd); install_element(BTS_NODE, &cfg_bts_acc_ramping_step_interval_cmd); install_element(BTS_NODE, &cfg_bts_acc_ramping_step_size_cmd); + neighbor_ident_vty_init(network, network->neighbor_bss_cells); /* See also handover commands added on bts level from handover_vty.c */ install_element(BTS_NODE, &cfg_trx_cmd); diff --git a/src/osmo-bsc/gsm_data.c b/src/osmo-bsc/gsm_data.c index 7885dad..fc12d0f 100644 --- a/src/osmo-bsc/gsm_data.c +++ b/src/osmo-bsc/gsm_data.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -563,6 +564,118 @@ return NULL; } +bool gsm_bts_matches_lai(const struct gsm_bts *bts, const struct osmo_location_area_id *lai) +{ + return osmo_plmn_cmp(&lai->plmn, &bts->network->plmn) == 0 + && lai->lac == bts->location_area_code; +} + +bool gsm_bts_matches_cell_id(const struct gsm_bts *bts, const struct gsm0808_cell_id *cell_id) +{ + const union gsm0808_cell_id_u *id = &cell_id->id; + if (!bts || !cell_id) + return false; + + switch (cell_id->id_discr) { + case CELL_IDENT_WHOLE_GLOBAL: + return gsm_bts_matches_lai(bts, &id->global.lai) + && id->global.cell_identity == bts->cell_identity; + case CELL_IDENT_LAC_AND_CI: + return id->lac_and_ci.lac == bts->location_area_code + && id->lac_and_ci.ci == bts->cell_identity; + case CELL_IDENT_CI: + return id->ci == bts->cell_identity; + case CELL_IDENT_NO_CELL: + return false; + case CELL_IDENT_LAI_AND_LAC: + return gsm_bts_matches_lai(bts, &id->lai_and_lac); + case CELL_IDENT_LAC: + return id->lac == bts->location_area_code; + case CELL_IDENT_BSS: + return true; + case CELL_IDENT_UTRAN_PLMN_LAC_RNC: + case CELL_IDENT_UTRAN_RNC: + case CELL_IDENT_UTRAN_LAC_RNC: + return false; + default: + OSMO_ASSERT(false); + } +} + +/* From a list of local BTSes that match the cell_id, return the Nth one, or NULL if there is no such + * match. */ +struct gsm_bts *gsm_bts_by_cell_id(const struct gsm_network *net, + const struct gsm0808_cell_id *cell_id, + int match_idx) +{ + struct gsm_bts *bts; + int i = 0; + llist_for_each_entry(bts, &net->bts_list, list) { + if (!gsm_bts_matches_cell_id(bts, cell_id)) + continue; + if (i < match_idx) { + /* this is only the i'th match, we're looking for a later one... */ + i++; + continue; + } + return bts; + } + return NULL; +} + +struct gsm_bts_ref *gsm_bts_ref_find(const struct llist_head *list, const struct gsm_bts *bts) +{ + struct gsm_bts_ref *ref; + if (!bts) + return NULL; + llist_for_each_entry(ref, list, entry) { + if (ref->bts == bts) + return ref; + } + return NULL; +} + +/* Add a BTS reference to the local_neighbors list. + * Return 1 if added, 0 if such an entry already existed, and negative on errors. */ +int gsm_bts_local_neighbor_add(struct gsm_bts *bts, struct gsm_bts *neighbor) +{ + struct gsm_bts_ref *ref; + if (!bts || !neighbor) + return -ENOMEM; + + if (bts == neighbor) + return -EINVAL; + + /* Already got this entry? */ + ref = gsm_bts_ref_find(&bts->local_neighbors, neighbor); + if (ref) + return 0; + + ref = talloc_zero(bts, struct gsm_bts_ref); + if (!ref) + return -ENOMEM; + ref->bts = neighbor; + llist_add_tail(&ref->entry, &bts->local_neighbors); + return 1; +} + +/* Remove a BTS reference from the local_neighbors list. + * Return 1 if removed, 0 if no such entry existed, and negative on errors. */ +int gsm_bts_local_neighbor_del(struct gsm_bts *bts, const struct gsm_bts *neighbor) +{ + struct gsm_bts_ref *ref; + if (!bts || !neighbor) + return -ENOMEM; + + ref = gsm_bts_ref_find(&bts->local_neighbors, neighbor); + if (!ref) + return 0; + + llist_del(&ref->entry); + talloc_free(ref); + return 1; +} + struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts) { struct gsm_bts_trx *trx = talloc_zero(bts, struct gsm_bts_trx); @@ -756,6 +869,7 @@ INIT_LLIST_HEAD(&bts->abis_queue); INIT_LLIST_HEAD(&bts->loc_list); + INIT_LLIST_HEAD(&bts->local_neighbors); /* Enable all codecs by default. These get reset to a more fine grained selection IF a * 'codec-support' config appears in the config file (see bsc_vty.c). */ diff --git a/src/osmo-bsc/handover_logic.c b/src/osmo-bsc/handover_logic.c index 509de53..0f664c6 100644 --- a/src/osmo-bsc/handover_logic.c +++ b/src/osmo-bsc/handover_logic.c @@ -389,6 +389,50 @@ return 0; } +struct gsm_bts *bts_by_neighbor_ident(const struct gsm_network *net, + const struct neighbor_ident_key *search_for) +{ + struct gsm_bts *found = NULL; + struct gsm_bts *bts; + struct gsm_bts *wildcard_match = NULL; + + llist_for_each_entry(bts, &net->bts_list, list) { + struct neighbor_ident_key entry = { + .from_bts = NEIGHBOR_IDENT_KEY_ANY_BTS, + .arfcn = bts->c0->arfcn, + .bsic_kind = BSIC_6BIT, + .bsic = bts->bsic, + }; + if (neighbor_ident_key_match(&entry, search_for, true)) { + if (found) { + LOGP(DHO, LOGL_ERROR, "CONFIG ERROR: Multiple BTS match %s: %d and %d\n", + neighbor_ident_key_name(search_for), + found->nr, bts->nr); + return found; + } + found = bts; + } + if (neighbor_ident_key_match(&entry, search_for, false)) + wildcard_match = bts; + } + + if (found) + return found; + + return wildcard_match; +} + +struct neighbor_ident_key *bts_ident_key(const struct gsm_bts *bts) +{ + static struct neighbor_ident_key key; + key = (struct neighbor_ident_key){ + .arfcn = bts->c0->arfcn, + .bsic_kind = BSIC_6BIT, + .bsic = bts->bsic, + }; + return &key; +} + static int ho_logic_sig_cb(unsigned int subsys, unsigned int signal, void *handler_data, void *signal_data) { diff --git a/src/osmo-bsc/neighbor_ident.c b/src/osmo-bsc/neighbor_ident.c new file mode 100644 index 0000000..8a7c580 --- /dev/null +++ b/src/osmo-bsc/neighbor_ident.c @@ -0,0 +1,296 @@ +/* Manage identity of neighboring BSS cells for inter-BSC handover. + * + * Measurement reports tell us about neighbor ARFCN and BSIC. If that ARFCN and BSIC is not managed by + * this local BSS, we need to tell the MSC a cell identity, like CGI, LAC+CI, etc. -- hence we need a + * mapping from ARFCN+BSIC to Cell Identifier List, which needs to be configured by the user. + */ +/* (C) 2018 by sysmocom - s.f.m.c. GmbH + * + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include + +#include +#include +#include + +#include + +struct neighbor_ident_list { + struct llist_head list; +}; + +struct neighbor_ident { + struct llist_head entry; + + struct neighbor_ident_key key; + struct gsm0808_cell_id_list2 val; +}; + +#define APPEND_THING(func, args...) do { \ + int remain = buflen - (pos - buf); \ + int l = func(pos, remain, ##args); \ + if (l < 0 || l > remain) \ + pos = buf + buflen; \ + else \ + pos += l; \ + } while(0) +#define APPEND_STR(fmt, args...) APPEND_THING(snprintf, fmt, ##args) + +const char *_neighbor_ident_key_name(char *buf, size_t buflen, const struct neighbor_ident_key *ni_key) +{ + char *pos = buf; + + APPEND_STR("BTS "); + if (ni_key->from_bts == NEIGHBOR_IDENT_KEY_ANY_BTS) + APPEND_STR("*"); + else if (ni_key->from_bts >= 0 && ni_key->from_bts <= 255) + APPEND_STR("%d", ni_key->from_bts); + else + APPEND_STR("invalid(%d)", ni_key->from_bts); + + APPEND_STR(" to "); + switch (ni_key->bsic_kind) { + default: + case BSIC_NONE: + APPEND_STR("ARFCN %u (any BSIC)", ni_key->arfcn); + break; + case BSIC_6BIT: + APPEND_STR("ARFCN %u BSIC %u", ni_key->arfcn, ni_key->bsic & 0x3f); + break; + case BSIC_9BIT: + APPEND_STR("ARFCN %u BSIC %u(9bit)", ni_key->arfcn, ni_key->bsic & 0x1ff); + break; + } + return buf; +} + +const char *neighbor_ident_key_name(const struct neighbor_ident_key *ni_key) +{ + static char buf[64]; + return _neighbor_ident_key_name(buf, sizeof(buf), ni_key); +} + +struct neighbor_ident_list *neighbor_ident_init(void *talloc_ctx) +{ + struct neighbor_ident_list *nil = talloc_zero(talloc_ctx, struct neighbor_ident_list); + OSMO_ASSERT(nil); + INIT_LLIST_HEAD(&nil->list); + return nil; +} + +void neighbor_ident_free(struct neighbor_ident_list *nil) +{ + if (!nil) + return; + talloc_free(nil); +} + +/* Return true when the entry matches the search_for requirements. + * If exact_match is false, a BSIC_NONE entry acts as wildcard to match any search_for on that ARFCN, + * and a BSIC_NONE in search_for likewise returns any one entry that matches the ARFCN; + * also a from_bts == NEIGHBOR_IDENT_KEY_ANY_BTS in either entry or search_for will match. + * If exact_match is true, only identical bsic_kind values and identical from_bts values return a match. + * Note, typically wildcard BSICs are only in entry, e.g. the user configured list, and search_for + * contains a specific BSIC, e.g. as received from a Measurement Report. */ +bool neighbor_ident_key_match(const struct neighbor_ident_key *entry, + const struct neighbor_ident_key *search_for, + bool exact_match) +{ + uint16_t bsic_mask; + + if (exact_match + && entry->from_bts != search_for->from_bts) + return false; + + if (search_for->from_bts != NEIGHBOR_IDENT_KEY_ANY_BTS + && entry->from_bts != NEIGHBOR_IDENT_KEY_ANY_BTS + && entry->from_bts != search_for->from_bts) + return false; + + if (entry->arfcn != search_for->arfcn) + return false; + + switch (entry->bsic_kind) { + default: + return false; + case BSIC_NONE: + if (!exact_match) { + /* The neighbor identifier list entry matches any BSIC for this ARFCN. */ + return true; + } + /* Match exact entry */ + bsic_mask = 0; + break; + case BSIC_6BIT: + bsic_mask = 0x3f; + break; + case BSIC_9BIT: + bsic_mask = 0x1ff; + break; + } + if (!exact_match && search_for->bsic_kind == BSIC_NONE) { + /* The search is looking only for an ARFCN with any BSIC */ + return true; + } + if (search_for->bsic_kind == entry->bsic_kind + && (search_for->bsic & bsic_mask) == (entry->bsic & bsic_mask)) + return true; + return false; +} + +static struct neighbor_ident *_neighbor_ident_get(const struct neighbor_ident_list *nil, + const struct neighbor_ident_key *key, + bool exact_match) +{ + struct neighbor_ident *ni; + struct neighbor_ident *wildcard_match = NULL; + + /* Do both exact-bsic and wildcard matching in the same iteration: + * Any exact match returns immediately, while for a wildcard match we still go through all + * remaining items in case an exact match exists. */ + llist_for_each_entry(ni, &nil->list, entry) { + if (neighbor_ident_key_match(&ni->key, key, true)) + return ni; + if (!exact_match) { + if (neighbor_ident_key_match(&ni->key, key, false)) + wildcard_match = ni; + } + } + return wildcard_match; +} + +static void _neighbor_ident_free(struct neighbor_ident *ni) +{ + llist_del(&ni->entry); + talloc_free(ni); +} + +bool neighbor_ident_key_valid(const struct neighbor_ident_key *key) +{ + if (key->from_bts != NEIGHBOR_IDENT_KEY_ANY_BTS + && (key->from_bts < 0 || key->from_bts > 255)) + return false; + + switch (key->bsic_kind) { + case BSIC_6BIT: + if (key->bsic > 0x3f) + return false; + break; + case BSIC_9BIT: + if (key->bsic > 0x1ff) + return false; + break; + case BSIC_NONE: + break; + default: + return false; + } + return true; +} + +/*! Add Cell Identifiers to an ARFCN+BSIC entry. + * Exactly one kind of identifier is allowed per ARFCN+BSIC entry, and any number of entries of that kind + * may be added up to the capacity of gsm0808_cell_id_list2, by one or more calls to this function. To + * replace an existing entry, first call neighbor_ident_del(nil, key). + * \returns number of entries in the resulting identifier list, or negative on error: + * see gsm0808_cell_id_list_add() for the meaning of returned error codes; + * return -ENOMEM when the list is not initialized, -ERANGE when the BSIC value is too large. */ +int neighbor_ident_add(struct neighbor_ident_list *nil, const struct neighbor_ident_key *key, + const struct gsm0808_cell_id_list2 *val) +{ + struct neighbor_ident *ni; + int rc; + + if (!nil) + return -ENOMEM; + + if (!neighbor_ident_key_valid(key)) + return -ERANGE; + + ni = _neighbor_ident_get(nil, key, true); + if (!ni) { + ni = talloc_zero(nil, struct neighbor_ident); + OSMO_ASSERT(ni); + *ni = (struct neighbor_ident){ + .key = *key, + .val = *val, + }; + llist_add_tail(&ni->entry, &nil->list); + return ni->val.id_list_len; + } + + rc = gsm0808_cell_id_list_add(&ni->val, val); + + if (rc < 0) + return rc; + + return ni->val.id_list_len; +} + +/*! Find cell identity for given BTS, ARFCN and BSIC, as previously added by neighbor_ident_add(). + */ +const struct gsm0808_cell_id_list2 *neighbor_ident_get(const struct neighbor_ident_list *nil, + const struct neighbor_ident_key *key) +{ + struct neighbor_ident *ni; + if (!nil) + return NULL; + ni = _neighbor_ident_get(nil, key, false); + if (!ni) + return NULL; + return &ni->val; +} + +bool neighbor_ident_del(struct neighbor_ident_list *nil, const struct neighbor_ident_key *key) +{ + struct neighbor_ident *ni; + if (!nil) + return false; + ni = _neighbor_ident_get(nil, key, true); + if (!ni) + return false; + _neighbor_ident_free(ni); + return true; +} + +void neighbor_ident_clear(struct neighbor_ident_list *nil) +{ + struct neighbor_ident *ni; + while ((ni = llist_first_entry_or_null(&nil->list, struct neighbor_ident, entry))) + _neighbor_ident_free(ni); +} + +/*! Iterate all neighbor_ident_list entries and call iter_cb for each. + * If iter_cb returns false, the iteration is stopped. */ +void neighbor_ident_iter(const struct neighbor_ident_list *nil, + bool (* iter_cb )(const struct neighbor_ident_key *key, + const struct gsm0808_cell_id_list2 *val, + void *cb_data), + void *cb_data) +{ + struct neighbor_ident *ni, *ni_next; + if (!nil) + return; + llist_for_each_entry_safe(ni, ni_next, &nil->list, entry) { + if (!iter_cb(&ni->key, &ni->val, cb_data)) + return; + } +} diff --git a/src/osmo-bsc/neighbor_ident_vty.c b/src/osmo-bsc/neighbor_ident_vty.c new file mode 100644 index 0000000..44830ab --- /dev/null +++ b/src/osmo-bsc/neighbor_ident_vty.c @@ -0,0 +1,568 @@ +/* Quagga VTY implementation to manage identity of neighboring BSS cells for inter-BSC handover. */ +/* (C) 2018 by sysmocom - s.f.m.c. GmbH + * + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include + +#include +#include + +#include +#include +#include + +static struct gsm_network *g_net = NULL; +static struct neighbor_ident_list *g_neighbor_cells = NULL; + +/* Parse VTY parameters matching NEIGHBOR_IDENT_VTY_KEY_PARAMS. Pass a pointer so that argv[0] is the + * ARFCN value followed by the BSIC keyword and value. vty *must* reference a BTS_NODE. */ +bool neighbor_ident_vty_parse_key_params(struct vty *vty, const char **argv, + struct neighbor_ident_key *key) +{ + struct gsm_bts *bts = vty->index; + + OSMO_ASSERT(vty->node == BTS_NODE); + OSMO_ASSERT(bts); + + return neighbor_ident_bts_parse_key_params(vty, bts, argv, key); +} + +/* same as neighbor_ident_vty_parse_key_params() but pass an explicit bts, so it works on any node. */ +bool neighbor_ident_bts_parse_key_params(struct vty *vty, struct gsm_bts *bts, const char **argv, + struct neighbor_ident_key *key) +{ + const char *arfcn_str = argv[0]; + const char *bsic_kind = argv[1]; + const char *bsic_str = argv[2]; + + OSMO_ASSERT(bts); + + *key = (struct neighbor_ident_key){ + .from_bts = bts->nr, + .arfcn = atoi(arfcn_str), + }; + + if (!strcmp(bsic_str, "any")) + key->bsic_kind = BSIC_NONE; + else { + key->bsic_kind = (!strcmp(bsic_kind, "bsic9")) ? BSIC_9BIT : BSIC_6BIT; + key->bsic = atoi(bsic_str); + if (key->bsic_kind == BSIC_6BIT && key->bsic > 0x3f) { + vty_out(vty, "%% Error: BSIC value surpasses 6-bit range: %u, use 'bsic9' instead%s", + key->bsic, VTY_NEWLINE); + return false; + } + } + return true; +} + +#define NEIGHBOR_ADD_CMD "neighbor add " +#define NEIGHBOR_DEL_CMD "neighbor del " +#define NEIGHBOR_DOC "Neighbor cell list\n" +#define NEIGHBOR_ADD_DOC NEIGHBOR_DOC "Add local or remote-BSS neighbor cell\n" +#define NEIGHBOR_DEL_DOC NEIGHBOR_DOC "Remove local or remote-BSS neighbor cell\n" + +static struct gsm_bts *neighbor_ident_vty_parse_bts_nr(struct vty *vty, const char **argv) +{ + const char *bts_nr_str = argv[0]; + struct gsm_bts *bts = gsm_bts_num(g_net, atoi(bts_nr_str)); + if (!bts) + vty_out(vty, "%% No such BTS: nr = %s%s\n", bts_nr_str, VTY_NEWLINE); + return bts; +} + +static struct gsm_bts *bts_by_cell_id(struct vty *vty, struct gsm0808_cell_id *cell_id) +{ + struct gsm_bts *bts = gsm_bts_by_cell_id(g_net, cell_id, 0); + if (!bts) + vty_out(vty, "%% No such BTS: %s%s\n", gsm0808_cell_id_name(cell_id), VTY_NEWLINE); + return bts; +} + +static struct gsm0808_cell_id *neighbor_ident_vty_parse_lac(struct vty *vty, const char **argv) +{ + static struct gsm0808_cell_id cell_id; + cell_id = (struct gsm0808_cell_id){ + .id_discr = CELL_IDENT_LAC, + .id.lac = atoi(argv[0]), + }; + return &cell_id; +} + +static struct gsm0808_cell_id *neighbor_ident_vty_parse_lac_ci(struct vty *vty, const char **argv) +{ + static struct gsm0808_cell_id cell_id; + cell_id = (struct gsm0808_cell_id){ + .id_discr = CELL_IDENT_LAC_AND_CI, + .id.lac_and_ci = { + .lac = atoi(argv[0]), + .ci = atoi(argv[1]), + }, + }; + return &cell_id; +} + +static struct gsm0808_cell_id *neighbor_ident_vty_parse_cgi(struct vty *vty, const char **argv) +{ + static struct gsm0808_cell_id cell_id; + cell_id = (struct gsm0808_cell_id){ + .id_discr = CELL_IDENT_WHOLE_GLOBAL, + }; + struct osmo_cell_global_id *cgi = &cell_id.id.global; + const char *mcc = argv[0]; + const char *mnc = argv[1]; + const char *lac = argv[2]; + const char *ci = argv[3]; + + if (osmo_mcc_from_str(mcc, &cgi->lai.plmn.mcc)) { + vty_out(vty, "%% Error decoding MCC: %s%s", mcc, VTY_NEWLINE); + return NULL; + } + + if (osmo_mnc_from_str(mnc, &cgi->lai.plmn.mnc, &cgi->lai.plmn.mnc_3_digits)) { + vty_out(vty, "%% Error decoding MNC: %s%s", mnc, VTY_NEWLINE); + return NULL; + } + + cgi->lai.lac = atoi(lac); + cgi->cell_identity = atoi(ci); + return &cell_id; +} + +static int add_local_bts(struct vty *vty, struct gsm_bts *neigh) +{ + int rc; + struct gsm_bts *bts = vty->index; + if (vty->node != BTS_NODE) { + vty_out(vty, "%% Error: cannot add local BTS neighbor, not on BTS node%s", + VTY_NEWLINE); + return CMD_WARNING; + } + if (!bts) { + vty_out(vty, "%% Error: cannot add local BTS neighbor, no BTS on this node%s", + VTY_NEWLINE); + return CMD_WARNING; + } + if (!neigh) { + vty_out(vty, "%% Error: cannot add local BTS neighbor to BTS %u, no such neighbor BTS%s" + "%% (To add remote-BSS neighbors, pass full ARFCN and BSIC as well)%s", + bts->nr, VTY_NEWLINE, VTY_NEWLINE); + return CMD_WARNING; + } + rc = gsm_bts_local_neighbor_add(bts, neigh); + if (rc < 0) { + vty_out(vty, "%% Error: cannot add local BTS %u as neighbor to BTS %u: %s%s", + neigh->nr, bts->nr, strerror(-rc), VTY_NEWLINE); + return CMD_WARNING; + } else + vty_out(vty, "%% BTS %u %s local neighbor BTS %u with LAC %u CI %u and ARFCN %u BSIC %u%s", + bts->nr, rc? "now has" : "already had", + neigh->nr, neigh->location_area_code, neigh->cell_identity, + neigh->c0->arfcn, neigh->bsic, VTY_NEWLINE); + return CMD_SUCCESS; +} + +static int del_local_bts(struct vty *vty, struct gsm_bts *neigh) +{ + int rc; + struct gsm_bts *bts = vty->index; + if (vty->node != BTS_NODE) { + vty_out(vty, "%% Error: cannot remove local BTS neighbor, not on BTS node%s", + VTY_NEWLINE); + return CMD_WARNING; + } + if (!bts) { + vty_out(vty, "%% Error: cannot remove local BTS neighbor, no BTS on this node%s", + VTY_NEWLINE); + return CMD_WARNING; + } + if (!neigh) { + vty_out(vty, "%% Error: cannot remove local BTS neighbor from BTS %u, no such neighbor BTS%s", + bts->nr, VTY_NEWLINE); + return CMD_WARNING; + } + rc = gsm_bts_local_neighbor_del(bts, neigh); + if (rc < 0) { + vty_out(vty, "%% Error: cannot remove local BTS %u neighbor from BTS %u: %s%s", + neigh->nr, bts->nr, strerror(-rc), VTY_NEWLINE); + return CMD_WARNING; + } + if (rc == 0) + vty_out(vty, "%% BTS %u is no neighbor of BTS %u%s", + neigh->nr, bts->nr, VTY_NEWLINE); + return CMD_SUCCESS; +} + +DEFUN(cfg_neighbor_add_bts_nr, cfg_neighbor_add_bts_nr_cmd, + NEIGHBOR_ADD_CMD "bts <0-255>", + NEIGHBOR_ADD_DOC "Neighbor cell by local BTS number\n" "BTS number\n") +{ + return add_local_bts(vty, neighbor_ident_vty_parse_bts_nr(vty, argv)); +} + +DEFUN(cfg_neighbor_add_lac, cfg_neighbor_add_lac_cmd, + NEIGHBOR_ADD_CMD "lac <0-65535>", + NEIGHBOR_ADD_DOC "Neighbor cell by LAC\n" "LAC\n") +{ + return add_local_bts(vty, bts_by_cell_id(vty, neighbor_ident_vty_parse_lac(vty, argv))); +} + +DEFUN(cfg_neighbor_add_lac_ci, cfg_neighbor_add_lac_ci_cmd, + NEIGHBOR_ADD_CMD "lac-ci <0-65535> <0-255>", + NEIGHBOR_ADD_DOC "Neighbor cell by LAC and CI\n" "LAC\n" "CI\n") +{ + return add_local_bts(vty, bts_by_cell_id(vty, neighbor_ident_vty_parse_lac_ci(vty, argv))); +} + +bool neighbor_ident_key_matches_bts(const struct neighbor_ident_key *key, struct gsm_bts *bts) +{ + if (!bts || !key) + return false; + return key->arfcn == bts->c0->arfcn + && (key->bsic_kind == BSIC_NONE || key->bsic == bts->bsic); +} + +static int add_remote_or_local_bts(struct vty *vty, const struct gsm0808_cell_id *cell_id, + const struct neighbor_ident_key *key) +{ + int rc; + struct gsm_bts *local_neigh; + struct gsm0808_cell_id_list2 cil; + struct gsm_bts *bts = vty->index; + + if (vty->node != BTS_NODE) { + vty_out(vty, "%% Error: cannot add BTS neighbor, not on BTS node%s", + VTY_NEWLINE); + return CMD_WARNING; + } + if (!bts) { + vty_out(vty, "%% Error: cannot add BTS neighbor, no BTS on this node%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + /* Is there a local BTS that matches the cell_id? */ + local_neigh = gsm_bts_by_cell_id(g_net, cell_id, 0); + if (local_neigh) { + /* But do the advertised ARFCN and BSIC match as intended? + * The user may omit ARFCN and BSIC for local cells, but if they are provided, + * they need to match. */ + if (!neighbor_ident_key_matches_bts(key, local_neigh)) { + vty_out(vty, "%% Error: bts %u: neighbor cell id %s indicates local BTS %u," + " but it does not match ARFCN+BSIC %s%s", + bts->nr, gsm0808_cell_id_name(cell_id), local_neigh->nr, + neighbor_ident_key_name(key), VTY_NEWLINE); + /* TODO: error out fatally for non-interactive VTY? */ + return CMD_WARNING; + } + return add_local_bts(vty, local_neigh); + } + + /* The cell_id is not known in this BSS, so it must be a remote cell. */ + gsm0808_cell_id_to_list(&cil, cell_id); + rc = neighbor_ident_add(g_neighbor_cells, key, &cil); + + if (rc < 0) { + const char *reason; + switch (rc) { + case -EINVAL: + reason = ": mismatching type between current and newly added cell identifier"; + break; + case -ENOSPC: + reason = ": list is full"; + break; + default: + reason = ""; + break; + } + + vty_out(vty, "%% Error adding neighbor-BSS Cell Identifier %s%s%s", + gsm0808_cell_id_name(cell_id), reason, VTY_NEWLINE); + return CMD_WARNING; + } + + vty_out(vty, "%% %s now has %d remote BSS Cell Identifier List %s%s", + neighbor_ident_key_name(key), rc, rc == 1? "entry" : "entries", VTY_NEWLINE); + return CMD_SUCCESS; +} + +static int del_by_key(struct vty *vty, const struct neighbor_ident_key *key) +{ + int removed = 0; + int rc; + struct gsm_bts *bts = vty->index; + struct gsm_bts_ref *neigh, *safe; + + if (vty->node != BTS_NODE) { + vty_out(vty, "%% Error: cannot remove BTS neighbor, not on BTS node%s", + VTY_NEWLINE); + return CMD_WARNING; + } + if (!bts) { + vty_out(vty, "%% Error: cannot remove BTS neighbor, no BTS on this node%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + /* Is there a local BTS that matches the key? */ + llist_for_each_entry_safe(neigh, safe, &bts->local_neighbors, entry) { + struct gsm_bts *neigh_bts = neigh->bts; + if (!neighbor_ident_key_matches_bts(key, neigh->bts)) + continue; + rc = gsm_bts_local_neighbor_del(bts, neigh->bts); + if (rc > 0) { + vty_out(vty, "%% Removed local neighbor bts %u to bts %u%s", + bts->nr, neigh_bts->nr, VTY_NEWLINE); + removed += rc; + } + } + + if (neighbor_ident_del(g_neighbor_cells, key)) { + vty_out(vty, "%% Removed remote BSS neighbor %s%s", + neighbor_ident_key_name(key), VTY_NEWLINE); + removed ++; + } + + if (!removed) { + vty_out(vty, "%% Cannot remove, no such neighbor: %s%s", + neighbor_ident_key_name(key), VTY_NEWLINE); + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +DEFUN(cfg_neighbor_add_lac_arfcn_bsic, cfg_neighbor_add_lac_arfcn_bsic_cmd, + NEIGHBOR_ADD_CMD "lac <0-65535> " NEIGHBOR_IDENT_VTY_KEY_PARAMS, + NEIGHBOR_ADD_DOC "Neighbor cell by lac\n" "lac\n" NEIGHBOR_IDENT_VTY_KEY_DOC) +{ + struct neighbor_ident_key nik; + struct gsm0808_cell_id *cell_id = neighbor_ident_vty_parse_lac(vty, argv); + if (!cell_id) + return CMD_WARNING; + if (!neighbor_ident_vty_parse_key_params(vty, argv + 1, &nik)) + return CMD_WARNING; + return add_remote_or_local_bts(vty, cell_id, &nik); +} + +DEFUN(cfg_neighbor_add_lac_ci_arfcn_bsic, cfg_neighbor_add_lac_ci_arfcn_bsic_cmd, + NEIGHBOR_ADD_CMD "lac-ci <0-65535> <0-255> " NEIGHBOR_IDENT_VTY_KEY_PARAMS, + NEIGHBOR_ADD_DOC "Neighbor cell by LAC and CI\n" "LAC\n" "CI\n" NEIGHBOR_IDENT_VTY_KEY_DOC) +{ + struct neighbor_ident_key nik; + struct gsm0808_cell_id *cell_id = neighbor_ident_vty_parse_lac_ci(vty, argv); + if (!cell_id) + return CMD_WARNING; + if (!neighbor_ident_vty_parse_key_params(vty, argv + 2, &nik)) + return CMD_WARNING; + return add_remote_or_local_bts(vty, cell_id, &nik); +} + +DEFUN(cfg_neighbor_add_cgi_arfcn_bsic, cfg_neighbor_add_cgi_arfcn_bsic_cmd, + NEIGHBOR_ADD_CMD "cgi <0-999> <0-999> <0-65535> <0-255> " NEIGHBOR_IDENT_VTY_KEY_PARAMS, + NEIGHBOR_ADD_DOC "Neighbor cell by cgi\n" "MCC\n" "MNC\n" "LAC\n" "CI\n" NEIGHBOR_IDENT_VTY_KEY_DOC) +{ + struct neighbor_ident_key nik; + struct gsm0808_cell_id *cell_id = neighbor_ident_vty_parse_cgi(vty, argv); + if (!cell_id) + return CMD_WARNING; + if (!neighbor_ident_vty_parse_key_params(vty, argv + 4, &nik)) + return CMD_WARNING; + return add_remote_or_local_bts(vty, cell_id, &nik); +} + +DEFUN(cfg_neighbor_del_bts_nr, cfg_neighbor_del_bts_nr_cmd, + NEIGHBOR_DEL_CMD "bts <0-255>", + NEIGHBOR_DEL_DOC "Neighbor cell by local BTS number\n" "BTS number\n") +{ + return del_local_bts(vty, neighbor_ident_vty_parse_bts_nr(vty, argv)); +} + +DEFUN(cfg_neighbor_del_arfcn_bsic, cfg_neighbor_del_arfcn_bsic_cmd, + NEIGHBOR_DEL_CMD NEIGHBOR_IDENT_VTY_KEY_PARAMS, + NEIGHBOR_DEL_DOC NEIGHBOR_IDENT_VTY_KEY_DOC) +{ + struct neighbor_ident_key key; + + if (!neighbor_ident_vty_parse_key_params(vty, argv, &key)) + return CMD_WARNING; + + return del_by_key(vty, &key); +} + +struct write_neighbor_ident_entry_data { + struct vty *vty; + const char *indent; + struct gsm_bts *bts; +}; + +static bool write_neighbor_ident_list(const struct neighbor_ident_key *key, + const struct gsm0808_cell_id_list2 *val, + void *cb_data) +{ + struct write_neighbor_ident_entry_data *d = cb_data; + struct vty *vty = d->vty; + int i; + + if (d->bts) { + if (d->bts->nr != key->from_bts) + return true; + } else if (key->from_bts != NEIGHBOR_IDENT_KEY_ANY_BTS) + return true; + +#define NEIGH_BSS_WRITE(fmt, args...) do { \ + vty_out(vty, "%sneighbor add " fmt " arfcn %u ", d->indent, ## args, key->arfcn); \ + switch (key->bsic_kind) { \ + default: \ + case BSIC_NONE: \ + vty_out(vty, "bsic any"); \ + break; \ + case BSIC_6BIT: \ + vty_out(vty, "bsic %u", key->bsic & 0x3f); \ + break; \ + case BSIC_9BIT: \ + vty_out(vty, "bsic9 %u", key->bsic & 0x1ff); \ + break; \ + } \ + vty_out(vty, "%s", VTY_NEWLINE); \ + } while(0) + + switch (val->id_discr) { + case CELL_IDENT_LAC: + for (i = 0; i < val->id_list_len; i++) { + NEIGH_BSS_WRITE("lac %u", val->id_list[i].lac); + } + break; + case CELL_IDENT_LAC_AND_CI: + for (i = 0; i < val->id_list_len; i++) { + NEIGH_BSS_WRITE("lac-ci %u %u", + val->id_list[i].lac_and_ci.lac, + val->id_list[i].lac_and_ci.ci); + } + break; + case CELL_IDENT_WHOLE_GLOBAL: + for (i = 0; i < val->id_list_len; i++) { + const struct osmo_cell_global_id *cgi = &val->id_list[i].global; + NEIGH_BSS_WRITE("cgi %s %s %u %u", + osmo_mcc_name(cgi->lai.plmn.mcc), + osmo_mnc_name(cgi->lai.plmn.mnc, cgi->lai.plmn.mnc_3_digits), + cgi->lai.lac, cgi->cell_identity); + } + break; + default: + vty_out(vty, "%% Unsupported Cell Identity%s", VTY_NEWLINE); + } +#undef NEIGH_BSS_WRITE + + return true; +} + +void neighbor_ident_vty_write_remote_bss(struct vty *vty, const char *indent, struct gsm_bts *bts) +{ + struct write_neighbor_ident_entry_data d = { + .vty = vty, + .indent = indent, + .bts = bts, + }; + + neighbor_ident_iter(g_neighbor_cells, write_neighbor_ident_list, &d); +} + +void neighbor_ident_vty_write_local_neighbors(struct vty *vty, const char *indent, struct gsm_bts *bts) +{ + struct gsm_bts_ref *neigh; + + llist_for_each_entry(neigh, &bts->local_neighbors, entry) { + vty_out(vty, "%sneighbor add lac-ci %u %u%s", + indent, neigh->bts->location_area_code, neigh->bts->cell_identity, + VTY_NEWLINE); + } +} + +void neighbor_ident_vty_write(struct vty *vty, const char *indent, struct gsm_bts *bts) +{ + neighbor_ident_vty_write_local_neighbors(vty, indent, bts); + neighbor_ident_vty_write_remote_bss(vty, indent, bts); +} + +DEFUN(show_bts_neighbor, show_bts_neighbor_cmd, + "show bts <0-255> neighbor " NEIGHBOR_IDENT_VTY_KEY_PARAMS, + SHOW_STR "Display information about a BTS\n" "BTS number\n" + "Query which cell would be the target for this neighbor ARFCN+BSIC\n" + NEIGHBOR_IDENT_VTY_KEY_DOC) +{ + int found = 0; + struct neighbor_ident_key key; + struct gsm_bts_ref *neigh; + const struct gsm0808_cell_id_list2 *res; + struct gsm_bts *bts = gsm_bts_num(g_net, atoi(argv[0])); + struct write_neighbor_ident_entry_data d = { + .vty = vty, + .indent = "% ", + .bts = bts, + }; + + if (!bts) { + vty_out(vty, "%% Error: cannot find BTS '%s'%s", argv[0], + VTY_NEWLINE); + return CMD_WARNING; + } + + if (!neighbor_ident_bts_parse_key_params(vty, bts, &argv[1], &key)) + return CMD_WARNING; + + /* Is there a local BTS that matches the key? */ + llist_for_each_entry(neigh, &bts->local_neighbors, entry) { + if (!neighbor_ident_key_matches_bts(&key, neigh->bts)) + continue; + vty_out(vty, "%% %s resolves to local BTS %u lac-ci %u %u%s", + neighbor_ident_key_name(&key), neigh->bts->nr, neigh->bts->location_area_code, + neigh->bts->cell_identity, VTY_NEWLINE); + found++; + } + + res = neighbor_ident_get(g_neighbor_cells, &key); + if (res) { + write_neighbor_ident_list(&key, res, &d); + found++; + } + + if (!found) + vty_out(vty, "%% No entry for %s%s", neighbor_ident_key_name(&key), VTY_NEWLINE); + + return CMD_SUCCESS; +} + +void neighbor_ident_vty_init(struct gsm_network *net, struct neighbor_ident_list *nil) +{ + g_net = net; + g_neighbor_cells = nil; + install_element(BTS_NODE, &cfg_neighbor_add_bts_nr_cmd); + install_element(BTS_NODE, &cfg_neighbor_add_lac_cmd); + install_element(BTS_NODE, &cfg_neighbor_add_lac_ci_cmd); + install_element(BTS_NODE, &cfg_neighbor_add_lac_arfcn_bsic_cmd); + install_element(BTS_NODE, &cfg_neighbor_add_lac_ci_arfcn_bsic_cmd); + install_element(BTS_NODE, &cfg_neighbor_add_cgi_arfcn_bsic_cmd); + install_element(BTS_NODE, &cfg_neighbor_del_bts_nr_cmd); + install_element(BTS_NODE, &cfg_neighbor_del_arfcn_bsic_cmd); + install_element_ve(&show_bts_neighbor_cmd); +} diff --git a/src/osmo-bsc/net_init.c b/src/osmo-bsc/net_init.c index 3ee35fe..db3d01c 100644 --- a/src/osmo-bsc/net_init.c +++ b/src/osmo-bsc/net_init.c @@ -22,6 +22,7 @@ #include #include #include +#include /* Initialize the bare minimum of struct gsm_network, minimizing required dependencies. * This part is shared among the thin programs in osmo-bsc/src/utils/. diff --git a/src/osmo-bsc/system_information.c b/src/osmo-bsc/system_information.c index f810f52..3c0c76c 100644 --- a/src/osmo-bsc/system_information.c +++ b/src/osmo-bsc/system_information.c @@ -40,6 +40,9 @@ #include #include #include +#include + +struct gsm0808_cell_id_list2; /* * DCS1800 and PCS1900 have overlapping ARFCNs. We would need to set the @@ -588,6 +591,25 @@ return bitvec2freq_list(chan_list, bv, bts, false, false); } +struct generate_bcch_chan_list__ni_iter_data { + struct gsm_bts *bts; + struct bitvec *bv; +}; + +static bool generate_bcch_chan_list__ni_iter_cb(const struct neighbor_ident_key *key, + const struct gsm0808_cell_id_list2 *val, + void *cb_data) +{ + struct generate_bcch_chan_list__ni_iter_data *data = cb_data; + + if (key->from_bts != NEIGHBOR_IDENT_KEY_ANY_BTS + && key->from_bts != data->bts->nr) + return true; + + bitvec_set_bit_pos(data->bv, key->arfcn, 1); + return true; +} + /*! generate a cell channel list as per Section 10.5.2.22 of 04.08 * \param[out] chan_list caller-provided output buffer * \param[in] bts BTS descriptor used for input data @@ -602,6 +624,7 @@ struct bitvec *bv; int rc; + /* first we generate a bitvec of the BCCH ARFCN's in our BSC */ if (si5 && bts->neigh_list_manual_mode == NL_MODE_MANUAL_SI5SEP) bv = &bts->si_common.si5_neigh_list; else @@ -612,11 +635,29 @@ /* Zero-initialize the bit-vector */ memset(bv->data, 0, bv->data_len); - /* first we generate a bitvec of the BCCH ARFCN's in our BSC */ - llist_for_each_entry(cur_bts, &bts->network->bts_list, list) { - if (cur_bts == bts) - continue; - bitvec_set_bit_pos(bv, cur_bts->c0->arfcn, 1); + if (llist_empty(&bts->local_neighbors)) { + /* There are no explicit neighbors, assume all BTS are. */ + llist_for_each_entry(cur_bts, &bts->network->bts_list, list) { + if (cur_bts == bts) + continue; + bitvec_set_bit_pos(bv, cur_bts->c0->arfcn, 1); + } + } else { + /* Only add explicit neighbor cells */ + struct gsm_bts_ref *neigh; + llist_for_each_entry(neigh, &bts->local_neighbors, entry) { + bitvec_set_bit_pos(bv, neigh->bts->c0->arfcn, 1); + } + } + + /* Also add neighboring BSS cells' ARFCNs */ + { + struct generate_bcch_chan_list__ni_iter_data data = { + .bv = bv, + .bts = bts, + }; + neighbor_ident_iter(bts->network->neighbor_bss_cells, + generate_bcch_chan_list__ni_iter_cb, &data); } } diff --git a/tests/bsc/Makefile.am b/tests/bsc/Makefile.am index a930629..2e34d79 100644 --- a/tests/bsc/Makefile.am +++ b/tests/bsc/Makefile.am @@ -45,6 +45,7 @@ $(top_builddir)/src/osmo-bsc/gsm_data.o \ $(top_builddir)/src/osmo-bsc/handover_cfg.o \ $(top_builddir)/src/osmo-bsc/handover_logic.o \ + $(top_builddir)/src/osmo-bsc/neighbor_ident.o \ $(top_builddir)/src/osmo-bsc/net_init.o \ $(top_builddir)/src/osmo-bsc/paging.o \ $(top_builddir)/src/osmo-bsc/pcu_sock.o \ diff --git a/tests/gsm0408/Makefile.am b/tests/gsm0408/Makefile.am index 6d10b9f..3eb47f6 100644 --- a/tests/gsm0408/Makefile.am +++ b/tests/gsm0408/Makefile.am @@ -28,6 +28,7 @@ $(top_builddir)/src/osmo-bsc/net_init.o \ $(top_builddir)/src/osmo-bsc/rest_octets.o \ $(top_builddir)/src/osmo-bsc/system_information.o \ + $(top_builddir)/src/osmo-bsc/neighbor_ident.o \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOABIS_LIBS) \ diff --git a/tests/handover/Makefile.am b/tests/handover/Makefile.am index 07491d5..140d8ff 100644 --- a/tests/handover/Makefile.am +++ b/tests/handover/Makefile.am @@ -19,10 +19,13 @@ EXTRA_DIST = \ handover_test.ok \ + neighbor_ident_test.ok \ + neighbor_ident_test.err \ $(NULL) noinst_PROGRAMS = \ handover_test \ + neighbor_ident_test \ $(NULL) handover_test_SOURCES = \ @@ -56,6 +59,7 @@ $(top_builddir)/src/osmo-bsc/handover_decision_2.o \ $(top_builddir)/src/osmo-bsc/handover_logic.o \ $(top_builddir)/src/osmo-bsc/meas_rep.o \ + $(top_builddir)/src/osmo-bsc/neighbor_ident.o \ $(top_builddir)/src/osmo-bsc/osmo_bsc_lcls.o \ $(top_builddir)/src/osmo-bsc/net_init.o \ $(top_builddir)/src/osmo-bsc/paging.o \ @@ -69,3 +73,17 @@ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBOSMOMGCPCLIENT_LIBS) \ $(NULL) + +neighbor_ident_test_SOURCES = \ + neighbor_ident_test.c \ + $(NULL) + +neighbor_ident_test_LDADD = \ + $(top_builddir)/src/osmo-bsc/neighbor_ident.o \ + $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOGSM_LIBS) \ + $(NULL) + +.PHONY: update_exp +update_exp: + $(builddir)/neighbor_ident_test >$(srcdir)/neighbor_ident_test.ok 2>$(srcdir)/neighbor_ident_test.err diff --git a/tests/handover/neighbor_ident_test.c b/tests/handover/neighbor_ident_test.c new file mode 100644 index 0000000..b67219c --- /dev/null +++ b/tests/handover/neighbor_ident_test.c @@ -0,0 +1,278 @@ +/* Test the neighbor_ident.h API */ +/* + * (C) 2018 by sysmocom - s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include + +#include + +#include + +struct neighbor_ident_list *nil; + +static const struct neighbor_ident_key *k(int from_bts, uint16_t arfcn, enum bsic_kind kind, uint16_t bsic) +{ + static struct neighbor_ident_key key; + key = (struct neighbor_ident_key){ + .from_bts = from_bts, + .arfcn = arfcn, + .bsic_kind = kind, + .bsic = bsic, + }; + return &key; +} + +static const struct gsm0808_cell_id_list2 cgi1 = { + .id_discr = CELL_IDENT_WHOLE_GLOBAL, + .id_list_len = 1, + .id_list = { + { + .global = { + .lai = { + .plmn = { .mcc = 1, .mnc = 2, .mnc_3_digits = false }, + .lac = 3, + }, + .cell_identity = 4, + } + }, + }, +}; + +static const struct gsm0808_cell_id_list2 cgi2 = { + .id_discr = CELL_IDENT_WHOLE_GLOBAL, + .id_list_len = 2, + .id_list = { + { + .global = { + .lai = { + .plmn = { .mcc = 1, .mnc = 2, .mnc_3_digits = false }, + .lac = 3, + }, + .cell_identity = 4, + } + }, + { + .global = { + .lai = { + .plmn = { .mcc = 5, .mnc = 6, .mnc_3_digits = true }, + .lac = 7, + }, + .cell_identity = 8, + } + }, + }, +}; + +static const struct gsm0808_cell_id_list2 lac1 = { + .id_discr = CELL_IDENT_LAC, + .id_list_len = 1, + .id_list = { + { + .lac = 123 + }, + }, +}; + +static const struct gsm0808_cell_id_list2 lac2 = { + .id_discr = CELL_IDENT_LAC, + .id_list_len = 2, + .id_list = { + { + .lac = 456 + }, + { + .lac = 789 + }, + }, +}; + +void print_cil(const struct gsm0808_cell_id_list2 *cil) +{ + unsigned int i; + if (!cil) { + printf(" cell_id_list == NULL\n"); + return; + } + switch (cil->id_discr) { + case CELL_IDENT_WHOLE_GLOBAL: + printf(" cell_id_list cgi[%u] = {\n", cil->id_list_len); + for (i = 0; i < cil->id_list_len; i++) + printf(" %2d: %s\n", i, osmo_cgi_name(&cil->id_list[i].global)); + printf(" }\n"); + break; + case CELL_IDENT_LAC: + printf(" cell_id_list lac[%u] = {\n", cil->id_list_len); + for (i = 0; i < cil->id_list_len; i++) + printf(" %2d: %u\n", i, cil->id_list[i].lac); + printf(" }\n"); + break; + default: + printf(" Unimplemented id_disc\n"); + } +} + +static int print_nil_i; + +bool nil_cb(const struct neighbor_ident_key *key, const struct gsm0808_cell_id_list2 *val, + void *cb_data) +{ + printf(" %2d: %s\n", print_nil_i++, neighbor_ident_key_name(key)); + print_cil(val); + return true; +} + +void print_nil() +{ + print_nil_i = 0; + neighbor_ident_iter(nil, nil_cb, NULL); + if (!print_nil_i) + printf(" (empty)\n"); +} + +#define check_add(key, val, expect_rc) \ + do { \ + int rc; \ + rc = neighbor_ident_add(nil, key, val); \ + printf("neighbor_ident_add(" #key ", " #val ") --> expect rc=" #expect_rc ", got %d\n", rc); \ + if (rc != expect_rc) \ + printf("ERROR\n"); \ + print_nil(); \ + } while(0) + +#define check_del(key, expect_rc) \ + do { \ + bool rc; \ + rc = neighbor_ident_del(nil, key); \ + printf("neighbor_ident_del(" #key ") --> %s\n", rc ? "entry deleted" : "nothing deleted"); \ + if (rc != expect_rc) \ + printf("ERROR: expected: %s\n", expect_rc ? "entry deleted" : "nothing deleted"); \ + print_nil(); \ + } while(0) + +#define check_get(key, expect_rc) \ + do { \ + const struct gsm0808_cell_id_list2 *rc; \ + rc = neighbor_ident_get(nil, key); \ + printf("neighbor_ident_get(" #key ") --> %s\n", \ + rc ? "entry returned" : "NULL"); \ + if (((bool)expect_rc) != ((bool) rc)) \ + printf("ERROR: expected %s\n", expect_rc ? "an entry" : "NULL"); \ + if (rc) \ + print_cil(rc); \ + } while(0) + +int main(void) +{ + void *ctx = talloc_named_const(NULL, 0, "neighbor_ident_test"); + + printf("\n--- testing NULL neighbor_ident_list\n"); + nil = NULL; + check_add(k(0, 1, BSIC_6BIT, 2), &cgi1, -ENOMEM); + check_get(k(0, 1, BSIC_6BIT, 2), false); + check_del(k(0, 1, BSIC_6BIT, 2), false); + + printf("\n--- adding entries, test that no two identical entries are added\n"); + nil = neighbor_ident_init(ctx); + check_add(k(0, 1, BSIC_6BIT, 2), &cgi1, 1); + check_get(k(0, 1, BSIC_6BIT, 2), true); + check_add(k(0, 1, BSIC_6BIT, 2), &cgi1, 1); + check_add(k(0, 1, BSIC_6BIT, 2), &cgi2, 2); + check_add(k(0, 1, BSIC_6BIT, 2), &cgi2, 2); + check_del(k(0, 1, BSIC_6BIT, 2), true); + + printf("\n--- Cannot mix cell identifier types for one entry\n"); + check_add(k(0, 1, BSIC_6BIT, 2), &cgi1, 1); + check_add(k(0, 1, BSIC_6BIT, 2), &lac1, -EINVAL); + check_del(k(0, 1, BSIC_6BIT, 2), true); + neighbor_ident_free(nil); + + printf("\n--- BTS matching: specific BTS is stronger\n"); + nil = neighbor_ident_init(ctx); + check_add(k(NEIGHBOR_IDENT_KEY_ANY_BTS, 1, BSIC_6BIT, 2), &lac1, 1); + check_add(k(3, 1, BSIC_6BIT, 2), &lac2, 2); + check_get(k(2, 1, BSIC_6BIT, 2), true); + check_get(k(3, 1, BSIC_6BIT, 2), true); + check_get(k(4, 1, BSIC_6BIT, 2), true); + check_get(k(NEIGHBOR_IDENT_KEY_ANY_BTS, 1, BSIC_6BIT, 2), true); + neighbor_ident_free(nil); + + printf("\n--- BSIC matching: 6bit and 9bit are different realms, and wildcard match is weaker\n"); + nil = neighbor_ident_init(ctx); + check_add(k(0, 1, BSIC_NONE, 0), &cgi1, 1); + check_add(k(0, 1, BSIC_6BIT, 2), &lac1, 1); + check_add(k(0, 1, BSIC_9BIT, 2), &lac2, 2); + check_get(k(0, 1, BSIC_6BIT, 2), true); + check_get(k(0, 1, BSIC_9BIT, 2), true); + printf("--- wildcard matches both 6bit and 9bit BSIC regardless:\n"); + check_get(k(0, 1, BSIC_6BIT, 23), true); + check_get(k(0, 1, BSIC_9BIT, 23), true); + neighbor_ident_free(nil); + + printf("\n--- Value ranges\n"); + nil = neighbor_ident_init(ctx); + check_add(k(0, 6, BSIC_6BIT, 1 << 6), &lac1, -ERANGE); + check_add(k(0, 9, BSIC_9BIT, 1 << 9), &lac1, -ERANGE); + check_add(k(0, 6, BSIC_6BIT, -1), &lac1, -ERANGE); + check_add(k(0, 9, BSIC_9BIT, -1), &lac1, -ERANGE); + check_add(k(NEIGHBOR_IDENT_KEY_ANY_BTS - 1, 1, BSIC_NONE, 1), &cgi2, -ERANGE); + check_add(k(256, 1, BSIC_NONE, 1), &cgi2, -ERANGE); + check_add(k(0, 0, BSIC_NONE, 0), &cgi1, 1); + check_add(k(255, 65535, BSIC_NONE, 65535), &lac1, 1); + check_add(k(0, 0, BSIC_6BIT, 0), &cgi2, 2); + check_add(k(255, 65535, BSIC_6BIT, 0x3f), &lac2, 2); + check_add(k(0, 0, BSIC_9BIT, 0), &cgi1, 1); + check_add(k(255, 65535, BSIC_9BIT, 0x1ff), &cgi2, 2); + + neighbor_ident_free(nil); + + printf("\n--- size limits\n"); + { + int i; + struct gsm0808_cell_id_list2 a = { .id_discr = CELL_IDENT_LAC }; + struct gsm0808_cell_id_list2 b = { + .id_discr = CELL_IDENT_LAC, + .id_list = { + { .lac = 423 } + }, + .id_list_len = 1, + }; + for (i = 0; i < ARRAY_SIZE(a.id_list); i++) { + a.id_list[a.id_list_len ++].lac = i; + } + + nil = neighbor_ident_init(ctx); + + i = neighbor_ident_add(nil, k(0, 1, BSIC_6BIT, 2), &a); + printf("Added first cell identifier list (added %u) --> rc = %d\n", a.id_list_len, i); + i = neighbor_ident_add(nil, k(0, 1, BSIC_6BIT, 2), &b); + printf("Added second cell identifier list (tried to add %u) --> rc = %d\n", b.id_list_len, i); + if (i != -ENOSPC) + printf("ERROR: expected rc=%d\n", -ENOSPC); + neighbor_ident_free(nil); + } + + OSMO_ASSERT(talloc_total_blocks(ctx) == 1); + talloc_free(ctx); + + return 0; +} diff --git a/tests/handover/neighbor_ident_test.err b/tests/handover/neighbor_ident_test.err new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/handover/neighbor_ident_test.err diff --git a/tests/handover/neighbor_ident_test.ok b/tests/handover/neighbor_ident_test.ok new file mode 100644 index 0000000..280b6f2 --- /dev/null +++ b/tests/handover/neighbor_ident_test.ok @@ -0,0 +1,249 @@ + +--- testing NULL neighbor_ident_list +neighbor_ident_add(k(0, 1, BSIC_6BIT, 2), &cgi1) --> expect rc=-ENOMEM, got -12 + (empty) +neighbor_ident_get(k(0, 1, BSIC_6BIT, 2)) --> NULL +neighbor_ident_del(k(0, 1, BSIC_6BIT, 2)) --> nothing deleted + (empty) + +--- adding entries, test that no two identical entries are added +neighbor_ident_add(k(0, 1, BSIC_6BIT, 2), &cgi1) --> expect rc=1, got 1 + 0: BTS 0 to ARFCN 1 BSIC 2 + cell_id_list cgi[1] = { + 0: 001-02-3-4 + } +neighbor_ident_get(k(0, 1, BSIC_6BIT, 2)) --> entry returned + cell_id_list cgi[1] = { + 0: 001-02-3-4 + } +neighbor_ident_add(k(0, 1, BSIC_6BIT, 2), &cgi1) --> expect rc=1, got 1 + 0: BTS 0 to ARFCN 1 BSIC 2 + cell_id_list cgi[1] = { + 0: 001-02-3-4 + } +neighbor_ident_add(k(0, 1, BSIC_6BIT, 2), &cgi2) --> expect rc=2, got 2 + 0: BTS 0 to ARFCN 1 BSIC 2 + cell_id_list cgi[2] = { + 0: 001-02-3-4 + 1: 005-006-7-8 + } +neighbor_ident_add(k(0, 1, BSIC_6BIT, 2), &cgi2) --> expect rc=2, got 2 + 0: BTS 0 to ARFCN 1 BSIC 2 + cell_id_list cgi[2] = { + 0: 001-02-3-4 + 1: 005-006-7-8 + } +neighbor_ident_del(k(0, 1, BSIC_6BIT, 2)) --> entry deleted + (empty) + +--- Cannot mix cell identifier types for one entry +neighbor_ident_add(k(0, 1, BSIC_6BIT, 2), &cgi1) --> expect rc=1, got 1 + 0: BTS 0 to ARFCN 1 BSIC 2 + cell_id_list cgi[1] = { + 0: 001-02-3-4 + } +neighbor_ident_add(k(0, 1, BSIC_6BIT, 2), &lac1) --> expect rc=-EINVAL, got -22 + 0: BTS 0 to ARFCN 1 BSIC 2 + cell_id_list cgi[1] = { + 0: 001-02-3-4 + } +neighbor_ident_del(k(0, 1, BSIC_6BIT, 2)) --> entry deleted + (empty) + +--- BTS matching: specific BTS is stronger +neighbor_ident_add(k(NEIGHBOR_IDENT_KEY_ANY_BTS, 1, BSIC_6BIT, 2), &lac1) --> expect rc=1, got 1 + 0: BTS * to ARFCN 1 BSIC 2 + cell_id_list lac[1] = { + 0: 123 + } +neighbor_ident_add(k(3, 1, BSIC_6BIT, 2), &lac2) --> expect rc=2, got 2 + 0: BTS * to ARFCN 1 BSIC 2 + cell_id_list lac[1] = { + 0: 123 + } + 1: BTS 3 to ARFCN 1 BSIC 2 + cell_id_list lac[2] = { + 0: 456 + 1: 789 + } +neighbor_ident_get(k(2, 1, BSIC_6BIT, 2)) --> entry returned + cell_id_list lac[1] = { + 0: 123 + } +neighbor_ident_get(k(3, 1, BSIC_6BIT, 2)) --> entry returned + cell_id_list lac[2] = { + 0: 456 + 1: 789 + } +neighbor_ident_get(k(4, 1, BSIC_6BIT, 2)) --> entry returned + cell_id_list lac[1] = { + 0: 123 + } +neighbor_ident_get(k(NEIGHBOR_IDENT_KEY_ANY_BTS, 1, BSIC_6BIT, 2)) --> entry returned + cell_id_list lac[1] = { + 0: 123 + } + +--- BSIC matching: 6bit and 9bit are different realms, and wildcard match is weaker +neighbor_ident_add(k(0, 1, BSIC_NONE, 0), &cgi1) --> expect rc=1, got 1 + 0: BTS 0 to ARFCN 1 (any BSIC) + cell_id_list cgi[1] = { + 0: 001-02-3-4 + } +neighbor_ident_add(k(0, 1, BSIC_6BIT, 2), &lac1) --> expect rc=1, got 1 + 0: BTS 0 to ARFCN 1 (any BSIC) + cell_id_list cgi[1] = { + 0: 001-02-3-4 + } + 1: BTS 0 to ARFCN 1 BSIC 2 + cell_id_list lac[1] = { + 0: 123 + } +neighbor_ident_add(k(0, 1, BSIC_9BIT, 2), &lac2) --> expect rc=2, got 2 + 0: BTS 0 to ARFCN 1 (any BSIC) + cell_id_list cgi[1] = { + 0: 001-02-3-4 + } + 1: BTS 0 to ARFCN 1 BSIC 2 + cell_id_list lac[1] = { + 0: 123 + } + 2: BTS 0 to ARFCN 1 BSIC 2(9bit) + cell_id_list lac[2] = { + 0: 456 + 1: 789 + } +neighbor_ident_get(k(0, 1, BSIC_6BIT, 2)) --> entry returned + cell_id_list lac[1] = { + 0: 123 + } +neighbor_ident_get(k(0, 1, BSIC_9BIT, 2)) --> entry returned + cell_id_list lac[2] = { + 0: 456 + 1: 789 + } +--- wildcard matches both 6bit and 9bit BSIC regardless: +neighbor_ident_get(k(0, 1, BSIC_6BIT, 23)) --> entry returned + cell_id_list cgi[1] = { + 0: 001-02-3-4 + } +neighbor_ident_get(k(0, 1, BSIC_9BIT, 23)) --> entry returned + cell_id_list cgi[1] = { + 0: 001-02-3-4 + } + +--- Value ranges +neighbor_ident_add(k(0, 6, BSIC_6BIT, 1 << 6), &lac1) --> expect rc=-ERANGE, got -34 + (empty) +neighbor_ident_add(k(0, 9, BSIC_9BIT, 1 << 9), &lac1) --> expect rc=-ERANGE, got -34 + (empty) +neighbor_ident_add(k(0, 6, BSIC_6BIT, -1), &lac1) --> expect rc=-ERANGE, got -34 + (empty) +neighbor_ident_add(k(0, 9, BSIC_9BIT, -1), &lac1) --> expect rc=-ERANGE, got -34 + (empty) +neighbor_ident_add(k(NEIGHBOR_IDENT_KEY_ANY_BTS - 1, 1, BSIC_NONE, 1), &cgi2) --> expect rc=-ERANGE, got -34 + (empty) +neighbor_ident_add(k(256, 1, BSIC_NONE, 1), &cgi2) --> expect rc=-ERANGE, got -34 + (empty) +neighbor_ident_add(k(0, 0, BSIC_NONE, 0), &cgi1) --> expect rc=1, got 1 + 0: BTS 0 to ARFCN 0 (any BSIC) + cell_id_list cgi[1] = { + 0: 001-02-3-4 + } +neighbor_ident_add(k(255, 65535, BSIC_NONE, 65535), &lac1) --> expect rc=1, got 1 + 0: BTS 0 to ARFCN 0 (any BSIC) + cell_id_list cgi[1] = { + 0: 001-02-3-4 + } + 1: BTS 255 to ARFCN 65535 (any BSIC) + cell_id_list lac[1] = { + 0: 123 + } +neighbor_ident_add(k(0, 0, BSIC_6BIT, 0), &cgi2) --> expect rc=2, got 2 + 0: BTS 0 to ARFCN 0 (any BSIC) + cell_id_list cgi[1] = { + 0: 001-02-3-4 + } + 1: BTS 255 to ARFCN 65535 (any BSIC) + cell_id_list lac[1] = { + 0: 123 + } + 2: BTS 0 to ARFCN 0 BSIC 0 + cell_id_list cgi[2] = { + 0: 001-02-3-4 + 1: 005-006-7-8 + } +neighbor_ident_add(k(255, 65535, BSIC_6BIT, 0x3f), &lac2) --> expect rc=2, got 2 + 0: BTS 0 to ARFCN 0 (any BSIC) + cell_id_list cgi[1] = { + 0: 001-02-3-4 + } + 1: BTS 255 to ARFCN 65535 (any BSIC) + cell_id_list lac[1] = { + 0: 123 + } + 2: BTS 0 to ARFCN 0 BSIC 0 + cell_id_list cgi[2] = { + 0: 001-02-3-4 + 1: 005-006-7-8 + } + 3: BTS 255 to ARFCN 65535 BSIC 63 + cell_id_list lac[2] = { + 0: 456 + 1: 789 + } +neighbor_ident_add(k(0, 0, BSIC_9BIT, 0), &cgi1) --> expect rc=1, got 1 + 0: BTS 0 to ARFCN 0 (any BSIC) + cell_id_list cgi[1] = { + 0: 001-02-3-4 + } + 1: BTS 255 to ARFCN 65535 (any BSIC) + cell_id_list lac[1] = { + 0: 123 + } + 2: BTS 0 to ARFCN 0 BSIC 0 + cell_id_list cgi[2] = { + 0: 001-02-3-4 + 1: 005-006-7-8 + } + 3: BTS 255 to ARFCN 65535 BSIC 63 + cell_id_list lac[2] = { + 0: 456 + 1: 789 + } + 4: BTS 0 to ARFCN 0 BSIC 0(9bit) + cell_id_list cgi[1] = { + 0: 001-02-3-4 + } +neighbor_ident_add(k(255, 65535, BSIC_9BIT, 0x1ff), &cgi2) --> expect rc=2, got 2 + 0: BTS 0 to ARFCN 0 (any BSIC) + cell_id_list cgi[1] = { + 0: 001-02-3-4 + } + 1: BTS 255 to ARFCN 65535 (any BSIC) + cell_id_list lac[1] = { + 0: 123 + } + 2: BTS 0 to ARFCN 0 BSIC 0 + cell_id_list cgi[2] = { + 0: 001-02-3-4 + 1: 005-006-7-8 + } + 3: BTS 255 to ARFCN 65535 BSIC 63 + cell_id_list lac[2] = { + 0: 456 + 1: 789 + } + 4: BTS 0 to ARFCN 0 BSIC 0(9bit) + cell_id_list cgi[1] = { + 0: 001-02-3-4 + } + 5: BTS 255 to ARFCN 65535 BSIC 511(9bit) + cell_id_list cgi[2] = { + 0: 001-02-3-4 + 1: 005-006-7-8 + } + +--- size limits +Added first cell identifier list (added 127) --> rc = 127 +Added second cell identifier list (tried to add 1) --> rc = -28 diff --git a/tests/neighbor_ident.vty b/tests/neighbor_ident.vty new file mode 100644 index 0000000..11227ed --- /dev/null +++ b/tests/neighbor_ident.vty @@ -0,0 +1,260 @@ +OsmoBSC> ### Neighbor-BSS Cell Identifier List config + +OsmoBSC> list +... + show bts <0-255> neighbor arfcn <0-1023> (bsic|bsic9) (<0-511>|any) +... + +OsmoBSC> enable +OsmoBSC# list +... + show bts <0-255> neighbor arfcn <0-1023> (bsic|bsic9) (<0-511>|any) +... + +OsmoBSC# configure terminal +OsmoBSC(config)# network + +OsmoBSC(config-net)# bts 0 +OsmoBSC(config-net-bts)# type sysmobts +OsmoBSC(config-net-bts)# base_station_id_code 10 +OsmoBSC(config-net-bts)# location_area_code 20 +OsmoBSC(config-net-bts)# cell_identity 30 +OsmoBSC(config-net-bts)# trx 0 +OsmoBSC(config-net-bts-trx)# arfcn 40 +OsmoBSC(config-net-bts-trx)# exit +OsmoBSC(config-net-bts)# exit + +OsmoBSC(config-net)# bts 1 +OsmoBSC(config-net-bts)# type sysmobts +OsmoBSC(config-net-bts)# base_station_id_code 11 +OsmoBSC(config-net-bts)# location_area_code 21 +OsmoBSC(config-net-bts)# cell_identity 31 +OsmoBSC(config-net-bts)# trx 0 +OsmoBSC(config-net-bts-trx)# arfcn 41 +OsmoBSC(config-net-bts-trx)# exit +OsmoBSC(config-net-bts)# exit + +OsmoBSC(config-net)# bts 2 +OsmoBSC(config-net-bts)# type sysmobts +OsmoBSC(config-net-bts)# base_station_id_code 12 +OsmoBSC(config-net-bts)# location_area_code 22 +OsmoBSC(config-net-bts)# cell_identity 32 +OsmoBSC(config-net-bts)# trx 0 +OsmoBSC(config-net-bts-trx)# arfcn 42 +OsmoBSC(config-net-bts-trx)# exit +OsmoBSC(config-net-bts)# exit + +OsmoBSC(config-net)# show running-config +... + bts 0 +... + cell_identity 30 + location_area_code 20 + base_station_id_code 10 +... + trx 0 +... + arfcn 40 +... + bts 1 +... + cell_identity 31 + location_area_code 21 + base_station_id_code 11 +... + trx 0 +... + arfcn 41 +... + bts 2 +... + cell_identity 32 + location_area_code 22 + base_station_id_code 12 +... + trx 0 +... + arfcn 42 +... + +OsmoBSC(config-net)# bts 0 +OsmoBSC(config-net-bts)# list +... + neighbor add bts <0-255> + neighbor add lac <0-65535> + neighbor add lac-ci <0-65535> <0-255> + neighbor add lac <0-65535> arfcn <0-1023> (bsic|bsic9) (<0-511>|any) + neighbor add lac-ci <0-65535> <0-255> arfcn <0-1023> (bsic|bsic9) (<0-511>|any) + neighbor add cgi <0-999> <0-999> <0-65535> <0-255> arfcn <0-1023> (bsic|bsic9) (<0-511>|any) + neighbor del bts <0-255> + neighbor del arfcn <0-1023> (bsic|bsic9) (<0-511>|any) +... + +OsmoBSC(config-net-bts)# show running-config +... !neighbor add + +OsmoBSC(config-net-bts)# neighbor add cgi 23 42 423 5 arfcn 23 bsic 64 +% Error: BSIC value surpasses 6-bit range: 64, use 'bsic9' instead + +OsmoBSC(config-net-bts)# neighbor add bts 0 +% Error: cannot add local BTS 0 as neighbor to BTS 0: Invalid argument + +OsmoBSC(config-net-bts)# show running-config +... !neighbor add + +OsmoBSC(config-net-bts)# neighbor add bts 1 +% BTS 0 now has local neighbor BTS 1 with LAC 21 CI 31 and ARFCN 41 BSIC 11 + +OsmoBSC(config-net-bts)# neighbor add lac 22 +% BTS 0 now has local neighbor BTS 2 with LAC 22 CI 32 and ARFCN 42 BSIC 12 + +OsmoBSC(config-net-bts)# neighbor add cgi 23 42 423 5 arfcn 23 bsic 42 +% BTS 0 to ARFCN 23 BSIC 42 now has 1 remote BSS Cell Identifier List entry + +OsmoBSC(config-net-bts)# ### adding the same entry again results in no change +OsmoBSC(config-net-bts)# neighbor add bts 1 +% BTS 0 already had local neighbor BTS 1 with LAC 21 CI 31 and ARFCN 41 BSIC 11 +OsmoBSC(config-net-bts)# neighbor add lac-ci 21 31 +% BTS 0 already had local neighbor BTS 1 with LAC 21 CI 31 and ARFCN 41 BSIC 11 +OsmoBSC(config-net-bts)# neighbor add cgi 23 42 423 5 arfcn 23 bsic 42 +% BTS 0 to ARFCN 23 BSIC 42 now has 1 remote BSS Cell Identifier List entry +OsmoBSC(config-net-bts)# neighbor add cgi 23 42 423 5 arfcn 23 bsic 42 +% BTS 0 to ARFCN 23 BSIC 42 now has 1 remote BSS Cell Identifier List entry +OsmoBSC(config-net-bts)# neighbor add cgi 23 42 423 5 arfcn 23 bsic 42 +% BTS 0 to ARFCN 23 BSIC 42 now has 1 remote BSS Cell Identifier List entry + +OsmoBSC(config-net-bts)# neighbor add cgi 23 042 423 6 arfcn 23 bsic 42 +% BTS 0 to ARFCN 23 BSIC 42 now has 2 remote BSS Cell Identifier List entries + +OsmoBSC(config-net-bts)# neighbor add lac 456 arfcn 123 bsic 45 +% BTS 0 to ARFCN 123 BSIC 45 now has 1 remote BSS Cell Identifier List entry + +OsmoBSC(config-net-bts)# neighbor add cgi 23 042 234 56 arfcn 23 bsic 42 +% BTS 0 to ARFCN 23 BSIC 42 now has 3 remote BSS Cell Identifier List entries + +OsmoBSC(config-net-bts)# neighbor add lac-ci 789 10 arfcn 423 bsic any +% BTS 0 to ARFCN 423 (any BSIC) now has 1 remote BSS Cell Identifier List entry + +OsmoBSC(config-net-bts)# neighbor add lac-ci 789 10 arfcn 423 bsic9 511 +% BTS 0 to ARFCN 423 BSIC 511(9bit) now has 1 remote BSS Cell Identifier List entry + +OsmoBSC(config-net-bts)# neighbor add lac-ci 789 10 arfcn 423 bsic9 1 +% BTS 0 to ARFCN 423 BSIC 1(9bit) now has 1 remote BSS Cell Identifier List entry + +OsmoBSC(config-net-bts)# neighbor add lac-ci 789 10 arfcn 423 bsic 1 +% BTS 0 to ARFCN 423 BSIC 1 now has 1 remote BSS Cell Identifier List entry + +OsmoBSC(config-net-bts)# show running-config +... +network +... !neighbor add + bts 0 +... !neighbor add + neighbor add lac-ci 21 31 + neighbor add lac-ci 22 32 + neighbor add cgi 023 42 423 5 arfcn 23 bsic 42 + neighbor add cgi 023 042 423 6 arfcn 23 bsic 42 + neighbor add cgi 023 042 234 56 arfcn 23 bsic 42 + neighbor add lac 456 arfcn 123 bsic 45 + neighbor add lac-ci 789 10 arfcn 423 bsic any + neighbor add lac-ci 789 10 arfcn 423 bsic9 511 + neighbor add lac-ci 789 10 arfcn 423 bsic9 1 + neighbor add lac-ci 789 10 arfcn 423 bsic 1 +... !neighbor add + +OsmoBSC(config-net-bts)# do show bts 0 neighbor arfcn 99 bsic any +% No entry for BTS 0 to ARFCN 99 (any BSIC) + +OsmoBSC(config-net-bts)# do show bts 0 neighbor arfcn 41 bsic any +% BTS 0 to ARFCN 41 (any BSIC) resolves to local BTS 1 lac-ci 21 31 + +OsmoBSC(config-net-bts)# do show bts 0 neighbor arfcn 423 bsic 1 +% neighbor add lac-ci 789 10 arfcn 423 bsic 1 + +OsmoBSC(config-net-bts)# do show bts 0 neighbor arfcn 423 bsic 23 +% neighbor add lac-ci 789 10 arfcn 423 bsic 23 + +OsmoBSC(config-net-bts)# neighbor del arfcn 99 bsic 7 +% Cannot remove, no such neighbor: BTS 0 to ARFCN 99 BSIC 7 + +OsmoBSC(config-net-bts)# neighbor del arfcn 23 bsic 42 +% Removed remote BSS neighbor BTS 0 to ARFCN 23 BSIC 42 + +OsmoBSC(config-net-bts)# show running-config +... !neighbor add + neighbor add lac-ci 21 31 + neighbor add lac-ci 22 32 + neighbor add lac 456 arfcn 123 bsic 45 + neighbor add lac-ci 789 10 arfcn 423 bsic any + neighbor add lac-ci 789 10 arfcn 423 bsic9 511 + neighbor add lac-ci 789 10 arfcn 423 bsic9 1 + neighbor add lac-ci 789 10 arfcn 423 bsic 1 +... !neighbor add + +OsmoBSC(config-net-bts)# neighbor del arfcn 123 bsic 45 +% Removed remote BSS neighbor BTS 0 to ARFCN 123 BSIC 45 + +OsmoBSC(config-net-bts)# show running-config +... !neighbor add + neighbor add lac-ci 21 31 + neighbor add lac-ci 22 32 + neighbor add lac-ci 789 10 arfcn 423 bsic any + neighbor add lac-ci 789 10 arfcn 423 bsic9 511 + neighbor add lac-ci 789 10 arfcn 423 bsic9 1 + neighbor add lac-ci 789 10 arfcn 423 bsic 1 +... !neighbor add + +OsmoBSC(config-net-bts)# neighbor del arfcn 423 bsic any +% Removed remote BSS neighbor BTS 0 to ARFCN 423 (any BSIC) + +OsmoBSC(config-net-bts)# show running-config +... !neighbor add + neighbor add lac-ci 21 31 + neighbor add lac-ci 22 32 + neighbor add lac-ci 789 10 arfcn 423 bsic9 511 + neighbor add lac-ci 789 10 arfcn 423 bsic9 1 + neighbor add lac-ci 789 10 arfcn 423 bsic 1 +... !neighbor add + +OsmoBSC(config-net-bts)# neighbor del arfcn 423 bsic9 511 +% Removed remote BSS neighbor BTS 0 to ARFCN 423 BSIC 511(9bit) +OsmoBSC(config-net-bts)# neighbor del arfcn 423 bsic9 1 +% Removed remote BSS neighbor BTS 0 to ARFCN 423 BSIC 1(9bit) + +OsmoBSC(config-net-bts)# show running-config +... !neighbor add + neighbor add lac-ci 21 31 + neighbor add lac-ci 22 32 + neighbor add lac-ci 789 10 arfcn 423 bsic 1 +... !neighbor add + +OsmoBSC(config-net-bts)# neighbor del arfcn 423 bsic 1 +% Removed remote BSS neighbor BTS 0 to ARFCN 423 BSIC 1 + +OsmoBSC(config-net-bts)# show running-config +... !neighbor add + neighbor add lac-ci 21 31 + neighbor add lac-ci 22 32 +... !neighbor add + +OsmoBSC(config-net-bts)# neighbor del arfcn 41 bsic any +% Removed local neighbor bts 0 to bts 1 + +OsmoBSC(config-net-bts)# show running-config +... !neighbor add + neighbor add lac-ci 22 32 +... !neighbor add + +OsmoBSC(config-net-bts)# neighbor del arfcn 41 bsic any +% Cannot remove, no such neighbor: BTS 0 to ARFCN 41 (any BSIC) + +OsmoBSC(config-net-bts)# show running-config +... !neighbor add + neighbor add lac-ci 22 32 +... !neighbor add + +OsmoBSC(config-net-bts)# neighbor del arfcn 42 bsic 12 +% Removed local neighbor bts 0 to bts 2 + +OsmoBSC(config-net-bts)# show running-config +... !neighbor add diff --git a/tests/testsuite.at b/tests/testsuite.at index f384655..1a190dd 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -38,6 +38,13 @@ AT_CHECK([$abs_top_builddir/tests/nanobts_omlattr/nanobts_omlattr_test], [], [expout], [ignore]) AT_CLEANUP +AT_SETUP([neighbor_ident]) +AT_KEYWORDS([neighbor_ident]) +cat $abs_srcdir/handover/neighbor_ident_test.ok > expout +cat $abs_srcdir/handover/neighbor_ident_test.err > experr +AT_CHECK([$abs_top_builddir/tests/handover/neighbor_ident_test], [], [expout], [experr]) +AT_CLEANUP + AT_SETUP([handover test 0]) AT_KEYWORDS([handover]) cat $abs_srcdir/handover/handover_test.ok > expout -- To view, visit https://gerrit.osmocom.org/9666 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I0153d7069817fba9146ddc11214de2757d7d37bf Gerrit-Change-Number: 9666 Gerrit-PatchSet: 15 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 10:43:53 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 28 Jul 2018 10:43:53 +0000 Subject: Change in osmo-bsc[master]: inter-BSC HO: neighbor_ident API: drop 9bit BSIC In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10164 ) Change subject: inter-BSC HO: neighbor_ident API: drop 9bit BSIC ...................................................................... inter-BSC HO: neighbor_ident API: drop 9bit BSIC 9-bit BSIC exist in the 3GPP specs, but we don't use them anywhere. Rather remove that choice from the API and UI. Change-Id: I29b92f47da2636d3a19f073755f9382fa98f9010 --- M include/osmocom/bsc/neighbor_ident.h M src/osmo-bsc/handover_logic.c M src/osmo-bsc/neighbor_ident.c M src/osmo-bsc/neighbor_ident_vty.c M tests/handover/neighbor_ident_test.c M tests/handover/neighbor_ident_test.ok M tests/neighbor_ident.vty 7 files changed, 113 insertions(+), 257 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmocom/bsc/neighbor_ident.h b/include/osmocom/bsc/neighbor_ident.h index bba18c3..17bffbc 100644 --- a/include/osmocom/bsc/neighbor_ident.h +++ b/include/osmocom/bsc/neighbor_ident.h @@ -12,19 +12,14 @@ struct neighbor_ident_list; struct gsm0808_cell_id_list2; -enum bsic_kind { - BSIC_NONE, - BSIC_6BIT, - BSIC_9BIT, -}; - #define NEIGHBOR_IDENT_KEY_ANY_BTS -1 +#define BSIC_ANY 0xff + struct neighbor_ident_key { int from_bts; /*< BTS nr 0..255 or NEIGHBOR_IDENT_KEY_ANY_BTS */ uint16_t arfcn; - enum bsic_kind bsic_kind; - uint16_t bsic; + uint8_t bsic; }; const char *neighbor_ident_key_name(const struct neighbor_ident_key *ni_key); @@ -52,10 +47,10 @@ void neighbor_ident_vty_init(struct gsm_network *net, struct neighbor_ident_list *nil); void neighbor_ident_vty_write(struct vty *vty, const char *indent, struct gsm_bts *bts); -#define NEIGHBOR_IDENT_VTY_KEY_PARAMS "arfcn <0-1023> (bsic|bsic9) (<0-511>|any)" +#define NEIGHBOR_IDENT_VTY_KEY_PARAMS "arfcn <0-1023> bsic (<0-63>|any)" #define NEIGHBOR_IDENT_VTY_KEY_DOC \ "ARFCN of neighbor cell\n" "ARFCN value\n" \ - "BSIC of neighbor cell\n" "9-bit BSIC of neighbor cell\n" "BSIC value\n" \ + "BSIC of neighbor cell\n" "BSIC value\n" \ "for all BSICs / use any BSIC in this ARFCN\n" bool neighbor_ident_vty_parse_key_params(struct vty *vty, const char **argv, struct neighbor_ident_key *key); diff --git a/src/osmo-bsc/handover_logic.c b/src/osmo-bsc/handover_logic.c index 0f664c6..028b2d4 100644 --- a/src/osmo-bsc/handover_logic.c +++ b/src/osmo-bsc/handover_logic.c @@ -400,7 +400,6 @@ struct neighbor_ident_key entry = { .from_bts = NEIGHBOR_IDENT_KEY_ANY_BTS, .arfcn = bts->c0->arfcn, - .bsic_kind = BSIC_6BIT, .bsic = bts->bsic, }; if (neighbor_ident_key_match(&entry, search_for, true)) { @@ -427,7 +426,6 @@ static struct neighbor_ident_key key; key = (struct neighbor_ident_key){ .arfcn = bts->c0->arfcn, - .bsic_kind = BSIC_6BIT, .bsic = bts->bsic, }; return &key; diff --git a/src/osmo-bsc/neighbor_ident.c b/src/osmo-bsc/neighbor_ident.c index 8a7c580..4a0cd47 100644 --- a/src/osmo-bsc/neighbor_ident.c +++ b/src/osmo-bsc/neighbor_ident.c @@ -67,18 +67,10 @@ APPEND_STR("invalid(%d)", ni_key->from_bts); APPEND_STR(" to "); - switch (ni_key->bsic_kind) { - default: - case BSIC_NONE: + if (ni_key->bsic == BSIC_ANY) APPEND_STR("ARFCN %u (any BSIC)", ni_key->arfcn); - break; - case BSIC_6BIT: + else APPEND_STR("ARFCN %u BSIC %u", ni_key->arfcn, ni_key->bsic & 0x3f); - break; - case BSIC_9BIT: - APPEND_STR("ARFCN %u BSIC %u(9bit)", ni_key->arfcn, ni_key->bsic & 0x1ff); - break; - } return buf; } @@ -104,18 +96,16 @@ } /* Return true when the entry matches the search_for requirements. - * If exact_match is false, a BSIC_NONE entry acts as wildcard to match any search_for on that ARFCN, - * and a BSIC_NONE in search_for likewise returns any one entry that matches the ARFCN; + * If exact_match is false, a BSIC_ANY entry acts as wildcard to match any search_for on that ARFCN, + * and a BSIC_ANY in search_for likewise returns any one entry that matches the ARFCN; * also a from_bts == NEIGHBOR_IDENT_KEY_ANY_BTS in either entry or search_for will match. - * If exact_match is true, only identical bsic_kind values and identical from_bts values return a match. + * If exact_match is true, only identical bsic values and identical from_bts values return a match. * Note, typically wildcard BSICs are only in entry, e.g. the user configured list, and search_for * contains a specific BSIC, e.g. as received from a Measurement Report. */ bool neighbor_ident_key_match(const struct neighbor_ident_key *entry, const struct neighbor_ident_key *search_for, bool exact_match) { - uint16_t bsic_mask; - if (exact_match && entry->from_bts != search_for->from_bts) return false; @@ -128,32 +118,13 @@ if (entry->arfcn != search_for->arfcn) return false; - switch (entry->bsic_kind) { - default: + if (exact_match && entry->bsic != search_for->bsic) return false; - case BSIC_NONE: - if (!exact_match) { - /* The neighbor identifier list entry matches any BSIC for this ARFCN. */ - return true; - } - /* Match exact entry */ - bsic_mask = 0; - break; - case BSIC_6BIT: - bsic_mask = 0x3f; - break; - case BSIC_9BIT: - bsic_mask = 0x1ff; - break; - } - if (!exact_match && search_for->bsic_kind == BSIC_NONE) { - /* The search is looking only for an ARFCN with any BSIC */ + + if (entry->bsic == BSIC_ANY || search_for->bsic == BSIC_ANY) return true; - } - if (search_for->bsic_kind == entry->bsic_kind - && (search_for->bsic & bsic_mask) == (entry->bsic & bsic_mask)) - return true; - return false; + + return entry->bsic == search_for->bsic; } static struct neighbor_ident *_neighbor_ident_get(const struct neighbor_ident_list *nil, @@ -189,20 +160,8 @@ && (key->from_bts < 0 || key->from_bts > 255)) return false; - switch (key->bsic_kind) { - case BSIC_6BIT: - if (key->bsic > 0x3f) - return false; - break; - case BSIC_9BIT: - if (key->bsic > 0x1ff) - return false; - break; - case BSIC_NONE: - break; - default: + if (key->bsic != BSIC_ANY && key->bsic > 0x3f) return false; - } return true; } diff --git a/src/osmo-bsc/neighbor_ident_vty.c b/src/osmo-bsc/neighbor_ident_vty.c index 44830ab..a38d123 100644 --- a/src/osmo-bsc/neighbor_ident_vty.c +++ b/src/osmo-bsc/neighbor_ident_vty.c @@ -52,8 +52,7 @@ struct neighbor_ident_key *key) { const char *arfcn_str = argv[0]; - const char *bsic_kind = argv[1]; - const char *bsic_str = argv[2]; + const char *bsic_str = argv[1]; OSMO_ASSERT(bts); @@ -63,16 +62,9 @@ }; if (!strcmp(bsic_str, "any")) - key->bsic_kind = BSIC_NONE; - else { - key->bsic_kind = (!strcmp(bsic_kind, "bsic9")) ? BSIC_9BIT : BSIC_6BIT; + key->bsic = BSIC_ANY; + else key->bsic = atoi(bsic_str); - if (key->bsic_kind == BSIC_6BIT && key->bsic > 0x3f) { - vty_out(vty, "%% Error: BSIC value surpasses 6-bit range: %u, use 'bsic9' instead%s", - key->bsic, VTY_NEWLINE); - return false; - } - } return true; } @@ -239,7 +231,7 @@ if (!bts || !key) return false; return key->arfcn == bts->c0->arfcn - && (key->bsic_kind == BSIC_NONE || key->bsic == bts->bsic); + && (key->bsic == BSIC_ANY || key->bsic == bts->bsic); } static int add_remote_or_local_bts(struct vty *vty, const struct gsm0808_cell_id *cell_id, @@ -431,18 +423,10 @@ #define NEIGH_BSS_WRITE(fmt, args...) do { \ vty_out(vty, "%sneighbor add " fmt " arfcn %u ", d->indent, ## args, key->arfcn); \ - switch (key->bsic_kind) { \ - default: \ - case BSIC_NONE: \ + if (key->bsic == BSIC_ANY) \ vty_out(vty, "bsic any"); \ - break; \ - case BSIC_6BIT: \ + else \ vty_out(vty, "bsic %u", key->bsic & 0x3f); \ - break; \ - case BSIC_9BIT: \ - vty_out(vty, "bsic9 %u", key->bsic & 0x1ff); \ - break; \ - } \ vty_out(vty, "%s", VTY_NEWLINE); \ } while(0) diff --git a/tests/handover/neighbor_ident_test.c b/tests/handover/neighbor_ident_test.c index b67219c..4eddd4a 100644 --- a/tests/handover/neighbor_ident_test.c +++ b/tests/handover/neighbor_ident_test.c @@ -30,13 +30,12 @@ struct neighbor_ident_list *nil; -static const struct neighbor_ident_key *k(int from_bts, uint16_t arfcn, enum bsic_kind kind, uint16_t bsic) +static const struct neighbor_ident_key *k(int from_bts, uint16_t arfcn, uint8_t bsic) { static struct neighbor_ident_key key; key = (struct neighbor_ident_key){ .from_bts = from_bts, .arfcn = arfcn, - .bsic_kind = kind, .bsic = bsic, }; return &key; @@ -187,61 +186,54 @@ printf("\n--- testing NULL neighbor_ident_list\n"); nil = NULL; - check_add(k(0, 1, BSIC_6BIT, 2), &cgi1, -ENOMEM); - check_get(k(0, 1, BSIC_6BIT, 2), false); - check_del(k(0, 1, BSIC_6BIT, 2), false); + check_add(k(0, 1, 2), &cgi1, -ENOMEM); + check_get(k(0, 1, 2), false); + check_del(k(0, 1, 2), false); printf("\n--- adding entries, test that no two identical entries are added\n"); nil = neighbor_ident_init(ctx); - check_add(k(0, 1, BSIC_6BIT, 2), &cgi1, 1); - check_get(k(0, 1, BSIC_6BIT, 2), true); - check_add(k(0, 1, BSIC_6BIT, 2), &cgi1, 1); - check_add(k(0, 1, BSIC_6BIT, 2), &cgi2, 2); - check_add(k(0, 1, BSIC_6BIT, 2), &cgi2, 2); - check_del(k(0, 1, BSIC_6BIT, 2), true); + check_add(k(0, 1, 2), &cgi1, 1); + check_get(k(0, 1, 2), true); + check_add(k(0, 1, 2), &cgi1, 1); + check_add(k(0, 1, 2), &cgi2, 2); + check_add(k(0, 1, 2), &cgi2, 2); + check_del(k(0, 1, 2), true); printf("\n--- Cannot mix cell identifier types for one entry\n"); - check_add(k(0, 1, BSIC_6BIT, 2), &cgi1, 1); - check_add(k(0, 1, BSIC_6BIT, 2), &lac1, -EINVAL); - check_del(k(0, 1, BSIC_6BIT, 2), true); + check_add(k(0, 1, 2), &cgi1, 1); + check_add(k(0, 1, 2), &lac1, -EINVAL); + check_del(k(0, 1, 2), true); neighbor_ident_free(nil); printf("\n--- BTS matching: specific BTS is stronger\n"); nil = neighbor_ident_init(ctx); - check_add(k(NEIGHBOR_IDENT_KEY_ANY_BTS, 1, BSIC_6BIT, 2), &lac1, 1); - check_add(k(3, 1, BSIC_6BIT, 2), &lac2, 2); - check_get(k(2, 1, BSIC_6BIT, 2), true); - check_get(k(3, 1, BSIC_6BIT, 2), true); - check_get(k(4, 1, BSIC_6BIT, 2), true); - check_get(k(NEIGHBOR_IDENT_KEY_ANY_BTS, 1, BSIC_6BIT, 2), true); + check_add(k(NEIGHBOR_IDENT_KEY_ANY_BTS, 1, 2), &lac1, 1); + check_add(k(3, 1, 2), &lac2, 2); + check_get(k(2, 1, 2), true); + check_get(k(3, 1, 2), true); + check_get(k(4, 1, 2), true); + check_get(k(NEIGHBOR_IDENT_KEY_ANY_BTS, 1, 2), true); neighbor_ident_free(nil); printf("\n--- BSIC matching: 6bit and 9bit are different realms, and wildcard match is weaker\n"); nil = neighbor_ident_init(ctx); - check_add(k(0, 1, BSIC_NONE, 0), &cgi1, 1); - check_add(k(0, 1, BSIC_6BIT, 2), &lac1, 1); - check_add(k(0, 1, BSIC_9BIT, 2), &lac2, 2); - check_get(k(0, 1, BSIC_6BIT, 2), true); - check_get(k(0, 1, BSIC_9BIT, 2), true); - printf("--- wildcard matches both 6bit and 9bit BSIC regardless:\n"); - check_get(k(0, 1, BSIC_6BIT, 23), true); - check_get(k(0, 1, BSIC_9BIT, 23), true); + check_add(k(0, 1, BSIC_ANY), &cgi1, 1); + check_add(k(0, 1, 2), &lac1, 1); + check_add(k(0, 1, 2), &lac2, 2); + check_get(k(0, 1, 2), true); + check_get(k(0, 1, 2), true); neighbor_ident_free(nil); printf("\n--- Value ranges\n"); nil = neighbor_ident_init(ctx); - check_add(k(0, 6, BSIC_6BIT, 1 << 6), &lac1, -ERANGE); - check_add(k(0, 9, BSIC_9BIT, 1 << 9), &lac1, -ERANGE); - check_add(k(0, 6, BSIC_6BIT, -1), &lac1, -ERANGE); - check_add(k(0, 9, BSIC_9BIT, -1), &lac1, -ERANGE); - check_add(k(NEIGHBOR_IDENT_KEY_ANY_BTS - 1, 1, BSIC_NONE, 1), &cgi2, -ERANGE); - check_add(k(256, 1, BSIC_NONE, 1), &cgi2, -ERANGE); - check_add(k(0, 0, BSIC_NONE, 0), &cgi1, 1); - check_add(k(255, 65535, BSIC_NONE, 65535), &lac1, 1); - check_add(k(0, 0, BSIC_6BIT, 0), &cgi2, 2); - check_add(k(255, 65535, BSIC_6BIT, 0x3f), &lac2, 2); - check_add(k(0, 0, BSIC_9BIT, 0), &cgi1, 1); - check_add(k(255, 65535, BSIC_9BIT, 0x1ff), &cgi2, 2); + check_add(k(0, 6, 1 << 6), &lac1, -ERANGE); + check_add(k(0, 6, BSIC_ANY - 1), &lac1, -ERANGE); + check_add(k(NEIGHBOR_IDENT_KEY_ANY_BTS - 1, 1, BSIC_ANY), &cgi2, -ERANGE); + check_add(k(256, 1, BSIC_ANY), &cgi2, -ERANGE); + check_add(k(0, 0, BSIC_ANY), &cgi1, 1); + check_add(k(255, 65535, BSIC_ANY), &lac1, 1); + check_add(k(0, 0, 0), &cgi2, 2); + check_add(k(255, 65535, 0x3f), &lac2, 2); neighbor_ident_free(nil); @@ -262,9 +254,9 @@ nil = neighbor_ident_init(ctx); - i = neighbor_ident_add(nil, k(0, 1, BSIC_6BIT, 2), &a); + i = neighbor_ident_add(nil, k(0, 1, 2), &a); printf("Added first cell identifier list (added %u) --> rc = %d\n", a.id_list_len, i); - i = neighbor_ident_add(nil, k(0, 1, BSIC_6BIT, 2), &b); + i = neighbor_ident_add(nil, k(0, 1, 2), &b); printf("Added second cell identifier list (tried to add %u) --> rc = %d\n", b.id_list_len, i); if (i != -ENOSPC) printf("ERROR: expected rc=%d\n", -ENOSPC); diff --git a/tests/handover/neighbor_ident_test.ok b/tests/handover/neighbor_ident_test.ok index 280b6f2..961a33c 100644 --- a/tests/handover/neighbor_ident_test.ok +++ b/tests/handover/neighbor_ident_test.ok @@ -1,62 +1,62 @@ --- testing NULL neighbor_ident_list -neighbor_ident_add(k(0, 1, BSIC_6BIT, 2), &cgi1) --> expect rc=-ENOMEM, got -12 +neighbor_ident_add(k(0, 1, 2), &cgi1) --> expect rc=-ENOMEM, got -12 (empty) -neighbor_ident_get(k(0, 1, BSIC_6BIT, 2)) --> NULL -neighbor_ident_del(k(0, 1, BSIC_6BIT, 2)) --> nothing deleted +neighbor_ident_get(k(0, 1, 2)) --> NULL +neighbor_ident_del(k(0, 1, 2)) --> nothing deleted (empty) --- adding entries, test that no two identical entries are added -neighbor_ident_add(k(0, 1, BSIC_6BIT, 2), &cgi1) --> expect rc=1, got 1 +neighbor_ident_add(k(0, 1, 2), &cgi1) --> expect rc=1, got 1 0: BTS 0 to ARFCN 1 BSIC 2 cell_id_list cgi[1] = { 0: 001-02-3-4 } -neighbor_ident_get(k(0, 1, BSIC_6BIT, 2)) --> entry returned +neighbor_ident_get(k(0, 1, 2)) --> entry returned cell_id_list cgi[1] = { 0: 001-02-3-4 } -neighbor_ident_add(k(0, 1, BSIC_6BIT, 2), &cgi1) --> expect rc=1, got 1 +neighbor_ident_add(k(0, 1, 2), &cgi1) --> expect rc=1, got 1 0: BTS 0 to ARFCN 1 BSIC 2 cell_id_list cgi[1] = { 0: 001-02-3-4 } -neighbor_ident_add(k(0, 1, BSIC_6BIT, 2), &cgi2) --> expect rc=2, got 2 +neighbor_ident_add(k(0, 1, 2), &cgi2) --> expect rc=2, got 2 0: BTS 0 to ARFCN 1 BSIC 2 cell_id_list cgi[2] = { 0: 001-02-3-4 1: 005-006-7-8 } -neighbor_ident_add(k(0, 1, BSIC_6BIT, 2), &cgi2) --> expect rc=2, got 2 +neighbor_ident_add(k(0, 1, 2), &cgi2) --> expect rc=2, got 2 0: BTS 0 to ARFCN 1 BSIC 2 cell_id_list cgi[2] = { 0: 001-02-3-4 1: 005-006-7-8 } -neighbor_ident_del(k(0, 1, BSIC_6BIT, 2)) --> entry deleted +neighbor_ident_del(k(0, 1, 2)) --> entry deleted (empty) --- Cannot mix cell identifier types for one entry -neighbor_ident_add(k(0, 1, BSIC_6BIT, 2), &cgi1) --> expect rc=1, got 1 +neighbor_ident_add(k(0, 1, 2), &cgi1) --> expect rc=1, got 1 0: BTS 0 to ARFCN 1 BSIC 2 cell_id_list cgi[1] = { 0: 001-02-3-4 } -neighbor_ident_add(k(0, 1, BSIC_6BIT, 2), &lac1) --> expect rc=-EINVAL, got -22 +neighbor_ident_add(k(0, 1, 2), &lac1) --> expect rc=-EINVAL, got -22 0: BTS 0 to ARFCN 1 BSIC 2 cell_id_list cgi[1] = { 0: 001-02-3-4 } -neighbor_ident_del(k(0, 1, BSIC_6BIT, 2)) --> entry deleted +neighbor_ident_del(k(0, 1, 2)) --> entry deleted (empty) --- BTS matching: specific BTS is stronger -neighbor_ident_add(k(NEIGHBOR_IDENT_KEY_ANY_BTS, 1, BSIC_6BIT, 2), &lac1) --> expect rc=1, got 1 +neighbor_ident_add(k(NEIGHBOR_IDENT_KEY_ANY_BTS, 1, 2), &lac1) --> expect rc=1, got 1 0: BTS * to ARFCN 1 BSIC 2 cell_id_list lac[1] = { 0: 123 } -neighbor_ident_add(k(3, 1, BSIC_6BIT, 2), &lac2) --> expect rc=2, got 2 +neighbor_ident_add(k(3, 1, 2), &lac2) --> expect rc=2, got 2 0: BTS * to ARFCN 1 BSIC 2 cell_id_list lac[1] = { 0: 123 @@ -66,31 +66,31 @@ 0: 456 1: 789 } -neighbor_ident_get(k(2, 1, BSIC_6BIT, 2)) --> entry returned +neighbor_ident_get(k(2, 1, 2)) --> entry returned cell_id_list lac[1] = { 0: 123 } -neighbor_ident_get(k(3, 1, BSIC_6BIT, 2)) --> entry returned +neighbor_ident_get(k(3, 1, 2)) --> entry returned cell_id_list lac[2] = { 0: 456 1: 789 } -neighbor_ident_get(k(4, 1, BSIC_6BIT, 2)) --> entry returned +neighbor_ident_get(k(4, 1, 2)) --> entry returned cell_id_list lac[1] = { 0: 123 } -neighbor_ident_get(k(NEIGHBOR_IDENT_KEY_ANY_BTS, 1, BSIC_6BIT, 2)) --> entry returned +neighbor_ident_get(k(NEIGHBOR_IDENT_KEY_ANY_BTS, 1, 2)) --> entry returned cell_id_list lac[1] = { 0: 123 } --- BSIC matching: 6bit and 9bit are different realms, and wildcard match is weaker -neighbor_ident_add(k(0, 1, BSIC_NONE, 0), &cgi1) --> expect rc=1, got 1 +neighbor_ident_add(k(0, 1, BSIC_ANY), &cgi1) --> expect rc=1, got 1 0: BTS 0 to ARFCN 1 (any BSIC) cell_id_list cgi[1] = { 0: 001-02-3-4 } -neighbor_ident_add(k(0, 1, BSIC_6BIT, 2), &lac1) --> expect rc=1, got 1 +neighbor_ident_add(k(0, 1, 2), &lac1) --> expect rc=1, got 1 0: BTS 0 to ARFCN 1 (any BSIC) cell_id_list cgi[1] = { 0: 001-02-3-4 @@ -99,58 +99,46 @@ cell_id_list lac[1] = { 0: 123 } -neighbor_ident_add(k(0, 1, BSIC_9BIT, 2), &lac2) --> expect rc=2, got 2 +neighbor_ident_add(k(0, 1, 2), &lac2) --> expect rc=2, got 3 +ERROR 0: BTS 0 to ARFCN 1 (any BSIC) cell_id_list cgi[1] = { 0: 001-02-3-4 } 1: BTS 0 to ARFCN 1 BSIC 2 - cell_id_list lac[1] = { + cell_id_list lac[3] = { 0: 123 + 1: 456 + 2: 789 } - 2: BTS 0 to ARFCN 1 BSIC 2(9bit) - cell_id_list lac[2] = { - 0: 456 - 1: 789 - } -neighbor_ident_get(k(0, 1, BSIC_6BIT, 2)) --> entry returned - cell_id_list lac[1] = { +neighbor_ident_get(k(0, 1, 2)) --> entry returned + cell_id_list lac[3] = { 0: 123 + 1: 456 + 2: 789 } -neighbor_ident_get(k(0, 1, BSIC_9BIT, 2)) --> entry returned - cell_id_list lac[2] = { - 0: 456 - 1: 789 - } ---- wildcard matches both 6bit and 9bit BSIC regardless: -neighbor_ident_get(k(0, 1, BSIC_6BIT, 23)) --> entry returned - cell_id_list cgi[1] = { - 0: 001-02-3-4 - } -neighbor_ident_get(k(0, 1, BSIC_9BIT, 23)) --> entry returned - cell_id_list cgi[1] = { - 0: 001-02-3-4 +neighbor_ident_get(k(0, 1, 2)) --> entry returned + cell_id_list lac[3] = { + 0: 123 + 1: 456 + 2: 789 } --- Value ranges -neighbor_ident_add(k(0, 6, BSIC_6BIT, 1 << 6), &lac1) --> expect rc=-ERANGE, got -34 +neighbor_ident_add(k(0, 6, 1 << 6), &lac1) --> expect rc=-ERANGE, got -34 (empty) -neighbor_ident_add(k(0, 9, BSIC_9BIT, 1 << 9), &lac1) --> expect rc=-ERANGE, got -34 +neighbor_ident_add(k(0, 6, BSIC_ANY - 1), &lac1) --> expect rc=-ERANGE, got -34 (empty) -neighbor_ident_add(k(0, 6, BSIC_6BIT, -1), &lac1) --> expect rc=-ERANGE, got -34 +neighbor_ident_add(k(NEIGHBOR_IDENT_KEY_ANY_BTS - 1, 1, BSIC_ANY), &cgi2) --> expect rc=-ERANGE, got -34 (empty) -neighbor_ident_add(k(0, 9, BSIC_9BIT, -1), &lac1) --> expect rc=-ERANGE, got -34 +neighbor_ident_add(k(256, 1, BSIC_ANY), &cgi2) --> expect rc=-ERANGE, got -34 (empty) -neighbor_ident_add(k(NEIGHBOR_IDENT_KEY_ANY_BTS - 1, 1, BSIC_NONE, 1), &cgi2) --> expect rc=-ERANGE, got -34 - (empty) -neighbor_ident_add(k(256, 1, BSIC_NONE, 1), &cgi2) --> expect rc=-ERANGE, got -34 - (empty) -neighbor_ident_add(k(0, 0, BSIC_NONE, 0), &cgi1) --> expect rc=1, got 1 +neighbor_ident_add(k(0, 0, BSIC_ANY), &cgi1) --> expect rc=1, got 1 0: BTS 0 to ARFCN 0 (any BSIC) cell_id_list cgi[1] = { 0: 001-02-3-4 } -neighbor_ident_add(k(255, 65535, BSIC_NONE, 65535), &lac1) --> expect rc=1, got 1 +neighbor_ident_add(k(255, 65535, BSIC_ANY), &lac1) --> expect rc=1, got 1 0: BTS 0 to ARFCN 0 (any BSIC) cell_id_list cgi[1] = { 0: 001-02-3-4 @@ -159,7 +147,7 @@ cell_id_list lac[1] = { 0: 123 } -neighbor_ident_add(k(0, 0, BSIC_6BIT, 0), &cgi2) --> expect rc=2, got 2 +neighbor_ident_add(k(0, 0, 0), &cgi2) --> expect rc=2, got 2 0: BTS 0 to ARFCN 0 (any BSIC) cell_id_list cgi[1] = { 0: 001-02-3-4 @@ -173,7 +161,7 @@ 0: 001-02-3-4 1: 005-006-7-8 } -neighbor_ident_add(k(255, 65535, BSIC_6BIT, 0x3f), &lac2) --> expect rc=2, got 2 +neighbor_ident_add(k(255, 65535, 0x3f), &lac2) --> expect rc=2, got 2 0: BTS 0 to ARFCN 0 (any BSIC) cell_id_list cgi[1] = { 0: 001-02-3-4 @@ -192,57 +180,6 @@ 0: 456 1: 789 } -neighbor_ident_add(k(0, 0, BSIC_9BIT, 0), &cgi1) --> expect rc=1, got 1 - 0: BTS 0 to ARFCN 0 (any BSIC) - cell_id_list cgi[1] = { - 0: 001-02-3-4 - } - 1: BTS 255 to ARFCN 65535 (any BSIC) - cell_id_list lac[1] = { - 0: 123 - } - 2: BTS 0 to ARFCN 0 BSIC 0 - cell_id_list cgi[2] = { - 0: 001-02-3-4 - 1: 005-006-7-8 - } - 3: BTS 255 to ARFCN 65535 BSIC 63 - cell_id_list lac[2] = { - 0: 456 - 1: 789 - } - 4: BTS 0 to ARFCN 0 BSIC 0(9bit) - cell_id_list cgi[1] = { - 0: 001-02-3-4 - } -neighbor_ident_add(k(255, 65535, BSIC_9BIT, 0x1ff), &cgi2) --> expect rc=2, got 2 - 0: BTS 0 to ARFCN 0 (any BSIC) - cell_id_list cgi[1] = { - 0: 001-02-3-4 - } - 1: BTS 255 to ARFCN 65535 (any BSIC) - cell_id_list lac[1] = { - 0: 123 - } - 2: BTS 0 to ARFCN 0 BSIC 0 - cell_id_list cgi[2] = { - 0: 001-02-3-4 - 1: 005-006-7-8 - } - 3: BTS 255 to ARFCN 65535 BSIC 63 - cell_id_list lac[2] = { - 0: 456 - 1: 789 - } - 4: BTS 0 to ARFCN 0 BSIC 0(9bit) - cell_id_list cgi[1] = { - 0: 001-02-3-4 - } - 5: BTS 255 to ARFCN 65535 BSIC 511(9bit) - cell_id_list cgi[2] = { - 0: 001-02-3-4 - 1: 005-006-7-8 - } --- size limits Added first cell identifier list (added 127) --> rc = 127 diff --git a/tests/neighbor_ident.vty b/tests/neighbor_ident.vty index 11227ed..692d894 100644 --- a/tests/neighbor_ident.vty +++ b/tests/neighbor_ident.vty @@ -2,13 +2,13 @@ OsmoBSC> list ... - show bts <0-255> neighbor arfcn <0-1023> (bsic|bsic9) (<0-511>|any) + show bts <0-255> neighbor arfcn <0-1023> bsic (<0-63>|any) ... OsmoBSC> enable OsmoBSC# list ... - show bts <0-255> neighbor arfcn <0-1023> (bsic|bsic9) (<0-511>|any) + show bts <0-255> neighbor arfcn <0-1023> bsic (<0-63>|any) ... OsmoBSC# configure terminal @@ -83,18 +83,18 @@ neighbor add bts <0-255> neighbor add lac <0-65535> neighbor add lac-ci <0-65535> <0-255> - neighbor add lac <0-65535> arfcn <0-1023> (bsic|bsic9) (<0-511>|any) - neighbor add lac-ci <0-65535> <0-255> arfcn <0-1023> (bsic|bsic9) (<0-511>|any) - neighbor add cgi <0-999> <0-999> <0-65535> <0-255> arfcn <0-1023> (bsic|bsic9) (<0-511>|any) + neighbor add lac <0-65535> arfcn <0-1023> bsic (<0-63>|any) + neighbor add lac-ci <0-65535> <0-255> arfcn <0-1023> bsic (<0-63>|any) + neighbor add cgi <0-999> <0-999> <0-65535> <0-255> arfcn <0-1023> bsic (<0-63>|any) neighbor del bts <0-255> - neighbor del arfcn <0-1023> (bsic|bsic9) (<0-511>|any) + neighbor del arfcn <0-1023> bsic (<0-63>|any) ... OsmoBSC(config-net-bts)# show running-config ... !neighbor add OsmoBSC(config-net-bts)# neighbor add cgi 23 42 423 5 arfcn 23 bsic 64 -% Error: BSIC value surpasses 6-bit range: 64, use 'bsic9' instead +% Unknown command. OsmoBSC(config-net-bts)# neighbor add bts 0 % Error: cannot add local BTS 0 as neighbor to BTS 0: Invalid argument @@ -135,11 +135,8 @@ OsmoBSC(config-net-bts)# neighbor add lac-ci 789 10 arfcn 423 bsic any % BTS 0 to ARFCN 423 (any BSIC) now has 1 remote BSS Cell Identifier List entry -OsmoBSC(config-net-bts)# neighbor add lac-ci 789 10 arfcn 423 bsic9 511 -% BTS 0 to ARFCN 423 BSIC 511(9bit) now has 1 remote BSS Cell Identifier List entry - -OsmoBSC(config-net-bts)# neighbor add lac-ci 789 10 arfcn 423 bsic9 1 -% BTS 0 to ARFCN 423 BSIC 1(9bit) now has 1 remote BSS Cell Identifier List entry +OsmoBSC(config-net-bts)# neighbor add lac-ci 789 10 arfcn 423 bsic 63 +% BTS 0 to ARFCN 423 BSIC 63 now has 1 remote BSS Cell Identifier List entry OsmoBSC(config-net-bts)# neighbor add lac-ci 789 10 arfcn 423 bsic 1 % BTS 0 to ARFCN 423 BSIC 1 now has 1 remote BSS Cell Identifier List entry @@ -157,8 +154,7 @@ neighbor add cgi 023 042 234 56 arfcn 23 bsic 42 neighbor add lac 456 arfcn 123 bsic 45 neighbor add lac-ci 789 10 arfcn 423 bsic any - neighbor add lac-ci 789 10 arfcn 423 bsic9 511 - neighbor add lac-ci 789 10 arfcn 423 bsic9 1 + neighbor add lac-ci 789 10 arfcn 423 bsic 63 neighbor add lac-ci 789 10 arfcn 423 bsic 1 ... !neighbor add @@ -186,8 +182,7 @@ neighbor add lac-ci 22 32 neighbor add lac 456 arfcn 123 bsic 45 neighbor add lac-ci 789 10 arfcn 423 bsic any - neighbor add lac-ci 789 10 arfcn 423 bsic9 511 - neighbor add lac-ci 789 10 arfcn 423 bsic9 1 + neighbor add lac-ci 789 10 arfcn 423 bsic 63 neighbor add lac-ci 789 10 arfcn 423 bsic 1 ... !neighbor add @@ -199,8 +194,7 @@ neighbor add lac-ci 21 31 neighbor add lac-ci 22 32 neighbor add lac-ci 789 10 arfcn 423 bsic any - neighbor add lac-ci 789 10 arfcn 423 bsic9 511 - neighbor add lac-ci 789 10 arfcn 423 bsic9 1 + neighbor add lac-ci 789 10 arfcn 423 bsic 63 neighbor add lac-ci 789 10 arfcn 423 bsic 1 ... !neighbor add @@ -211,15 +205,12 @@ ... !neighbor add neighbor add lac-ci 21 31 neighbor add lac-ci 22 32 - neighbor add lac-ci 789 10 arfcn 423 bsic9 511 - neighbor add lac-ci 789 10 arfcn 423 bsic9 1 + neighbor add lac-ci 789 10 arfcn 423 bsic 63 neighbor add lac-ci 789 10 arfcn 423 bsic 1 ... !neighbor add -OsmoBSC(config-net-bts)# neighbor del arfcn 423 bsic9 511 -% Removed remote BSS neighbor BTS 0 to ARFCN 423 BSIC 511(9bit) -OsmoBSC(config-net-bts)# neighbor del arfcn 423 bsic9 1 -% Removed remote BSS neighbor BTS 0 to ARFCN 423 BSIC 1(9bit) +OsmoBSC(config-net-bts)# neighbor del arfcn 423 bsic 63 +% Removed remote BSS neighbor BTS 0 to ARFCN 423 BSIC 63 OsmoBSC(config-net-bts)# show running-config ... !neighbor add -- To view, visit https://gerrit.osmocom.org/10164 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I29b92f47da2636d3a19f073755f9382fa98f9010 Gerrit-Change-Number: 10164 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 10:43:54 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 28 Jul 2018 10:43:54 +0000 Subject: Change in osmo-bsc[master]: doc: update/fix FSM charts In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/9667 ) Change subject: doc: update/fix FSM charts ...................................................................... doc: update/fix FSM charts These reflect the plan for refactoring, and will be implemented by I82e3f918295daa83274a4cf803f046979f284366 and Id7a4407d9b63be05ce63f5f2768b7d7e3d5c86fb Change-Id: I29e31b753e23a4207662e0e385a337e7df836f45 --- M doc/Makefile.am A doc/assignment-fsm.dot M doc/assignment.msc A doc/handover-inter-bsc-in-fsm.dot A doc/handover-inter-bsc-in.msc D doc/handover-inter-bsc-mo.msc D doc/handover-inter-bsc-mt.msc A doc/handover-inter-bsc-out-fsm.dot A doc/handover-inter-bsc-out.msc A doc/handover-intra-bsc-fsm.dot M doc/handover.msc M doc/lchan-fsm.dot D doc/lchan-release.msc A doc/lchan-rtp-fsm.dot M doc/lchan.msc A doc/legend_for_fsm_diagrams.dot A doc/legend_for_ladder_diagrams.msc A doc/mgw-endpoint-fsm.dot A doc/mgw-endpoint.msc D doc/ms-channel-request.msc M doc/timeslot-fsm.dot M doc/timeslot.msc M doc/ts-and-lchan-fsm-lifecycle.msc 23 files changed, 833 insertions(+), 865 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/doc/Makefile.am b/doc/Makefile.am index ca0470d..9b87bf3 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -3,20 +3,27 @@ $(NULL) msc: \ + $(builddir)/legend_for_ladder_diagrams.png \ $(builddir)/handover.png \ $(builddir)/assignment.png \ - $(builddir)/lchan-release.png \ - $(builddir)/ms-channel-request.png \ $(builddir)/timeslot.png \ $(builddir)/lchan.png \ $(builddir)/ts-and-lchan-fsm-lifecycle.png \ - $(builddir)/handover-inter-bsc-mo.png \ - $(builddir)/handover-inter-bsc-mt.png \ + $(builddir)/handover-inter-bsc-out.png \ + $(builddir)/handover-inter-bsc-in.png \ + $(builddir)/mgw-endpoint.png \ $(NULL) dot: \ + $(builddir)/legend_for_fsm_diagrams.png \ + $(builddir)/assignment-fsm.png \ $(builddir)/timeslot-fsm.png \ $(builddir)/lchan-fsm.png \ + $(builddir)/lchan-rtp-fsm.png \ + $(builddir)/mgw-endpoint-fsm.png \ + $(builddir)/handover-intra-bsc-fsm.png \ + $(builddir)/handover-inter-bsc-out-fsm.png \ + $(builddir)/handover-inter-bsc-in-fsm.png \ $(NULL) $(builddir)/%.png: $(srcdir)/%.msc diff --git a/doc/assignment-fsm.dot b/doc/assignment-fsm.dot new file mode 100644 index 0000000..5a3a2b9 --- /dev/null +++ b/doc/assignment-fsm.dot @@ -0,0 +1,42 @@ +digraph G { +rankdir=TB +labelloc=t; label="Assignment FSM" + + WAIT_LCHAN_ACTIVE + WAIT_RR_ASS_COMPLETE + WAIT_LCHAN_ESTABLISHED + WAIT_MGW_ENDPOINT_TO_MSC + terminate [shape=octagon] + + gscon [label="conn FSM",shape=box3d] + gscon2 [label="conn FSM",shape=box3d] + lchan [label="lchan FSM\n(new lchan)",shape=box3d] + old_lchan [label="old lchan",shape=box3d] + + bssap [label="osmo_bsc_bssap.c",shape=box] + + invisible [style="invisible"] + invisible -> bssap [label="BSSMAP Assignment Request",style=dotted] + invisible -> old_lchan [style=invisible,arrowhead=none] + + bssap -> gscon [label="GSCON_EV_ASSIGNMENT_START\ndata=struct assignment_request",style=dotted] + + gscon -> WAIT_LCHAN_ACTIVE [label="assignment_fsm_start()",style=dotted] + WAIT_LCHAN_ACTIVE -> lchan [label="lchan_activate()\nFOR_ASSIGNMENT",style=dotted] + lchan -> WAIT_LCHAN_ACTIVE [label="ASSIGNMENT_EV_\nLCHAN_\nACTIVE,ERROR",style=dotted] + lchan -> WAIT_LCHAN_ESTABLISHED [label="ASSIGNMENT_EV_\nLCHAN_\nESTABLISHED,ERROR",style=dotted] + + WAIT_LCHAN_ACTIVE -> WAIT_RR_ASS_COMPLETE + + WAIT_RR_ASS_COMPLETE -> old_lchan [label="RR Assignment\nCommand",style=dotted,constraint=false] + lchan -> WAIT_RR_ASS_COMPLETE [label="RR Assignment\nComplete",style=dotted] + + WAIT_RR_ASS_COMPLETE -> WAIT_LCHAN_ESTABLISHED + + WAIT_LCHAN_ESTABLISHED -> WAIT_MGW_ENDPOINT_TO_MSC [label="TCH"] + WAIT_LCHAN_ESTABLISHED -> terminate [label="non-TCH"] + WAIT_MGW_ENDPOINT_TO_MSC -> terminate + WAIT_MGW_ENDPOINT_TO_MSC -> gscon2 [label="gscon_connect_\nmgw_to_msc()",style=dotted] + gscon2 -> WAIT_MGW_ENDPOINT_TO_MSC [label="ASSIGNMENT_EV_\nMSC_MGW_OK",style=dotted] + terminate -> gscon2 [label="GSCON_EV_\nASSIGNMENT_END",style=dotted] +} diff --git a/doc/assignment.msc b/doc/assignment.msc index 9f10ea1..4e690a8 100644 --- a/doc/assignment.msc +++ b/doc/assignment.msc @@ -1,126 +1,72 @@ msc { - hscale=3; - ms [label="MS/BTS"], bsc_lchan[label="BSC lchan FSM"], - bsc_gscon[label="BSC conn FSM"], bsc_mgcp[label="BSC mgcp FSM"], mgw_msc[label="MGW/MSC"]; + hscale=2; + ms [label="MS/BTS"], lchan[label="BSC lchan FSM"], ass[label="BSC Assignment FSM"], + gscon[label="BSC conn FSM"], msc_[label="MSC"]; - ms note mgw_msc [label="lchan allocation sequence for BSSMAP Assignment Request"]; + ms note msc_ [label="lchan allocation sequence for BSSMAP Assignment Request"]; - bsc_gscon <= mgw_msc [label="BSSMAP Assignment Request"]; - bsc_gscon abox bsc_gscon [label="ST_ASSIGNMENT_\nWAIT_LCHAN"]; + gscon <= msc_ [label="BSSMAP Assignment Request"]; + gscon note gscon [label="GSCON_EV_ASSIGNMENT_START\n data=struct assignment_request"]; + gscon abox gscon [label="ST_ASSIGNMENT"]; + ass <- gscon [label="assignment_fsm_start()"]; + ass abox ass [label="ASSIGNMENT_ST_\nWAIT_LCHAN_ACTIVE"]; - bsc_lchan <- bsc_gscon [label="lchan_select_by_chan_mode(chan_mode)"]; |||; - --- [label="IF returned lchan is NULL"]; - bsc_gscon => mgw_msc [label="BSSMAP Assignment Failure"]; - bsc_gscon abox bsc_gscon [label="ST_ACTIVE"]; + --- [label="On any error (no lchan, etc.)"]; + ass box ass [label="on_assignment_failure()"]; + ass => msc_ [label="BSSMAP Assignment Failure"]; + ass abox ass [label="terminate"]; + ass -> gscon [label="GSCON_EV_ASSIGNMENT_END"]; + gscon abox gscon [label="ST_ACTIVE"]; ---; |||; - bsc_gscon box bsc_gscon [label="store lchan pointer in conn->lchan_for_assignment"]; - bsc_lchan <- bsc_gscon [label="lchan_activate(FOR_ASSIGNMENT)"]; + lchan abox lchan [label="UNUSED"]; + ass box ass [label="conn->assignment.new_lchan = lchan_select_by_chan_mode()"]; + lchan <- ass [label="lchan_activate(FOR_ASSIGNMENT)"]; + lchan abox lchan [label="WAIT_TS_READY"]; + lchan rbox lchan [label="most details omitted, see lchan_fsm and lchan_rtp_fsm diagrams"]; ...; |||; --- [label="on lchan FSM error or timeout"]; - bsc_lchan -> bsc_gscon [label="GSCON_EV_LCHAN_ALLOC_ERROR"]; - bsc_gscon box bsc_gscon [label="'forget' all about conn->lchan_for_assignment"]; - bsc_gscon => mgw_msc [label="BSSMAP Assignment Failure"]; - bsc_gscon abox bsc_gscon [label="ST_ACTIVE"]; + lchan -> ass [label="ASSIGNMENT_EV_LCHAN_ERROR"]; + ass box ass [label="on_assignment_failure()"]; + ass rbox gscon [label="See 'On any error' above"]; --- [label="END: 'on error'"]; ...; ...; - --- [label="IF lchan FSM decides that it is an lchan for speech"]; - bsc_lchan -> bsc_gscon [label="GSCON_EV_ENSURE_MGW_ENDPOINT"]; - --- [label="IF there is an MGW endpoint for the BTS already (conn->user_plane.fi_bts)"]; - bsc_gscon -> bsc_lchan [label="LCHAN_EV_MGW_ENDPOINT_AVAILABLE"]; - --- [label="ELSE: no MGW endpoint for the BTS side yet"]; - bsc_gscon abox bsc_gscon [label="ST_ASSIGNMENT_\nWAIT_CRCX_BTS"]; - bsc_gscon box bsc_gscon [label="assignment_created_mgw_endpoint = true"]; - bsc_gscon -> bsc_mgcp [label="mgcp_conn_create()"]; - bsc_mgcp abox bsc_mgcp [label="ST_CRCX_RESP (MGCP_MGW_TIMEOUT = 4s)"]; - bsc_mgcp => mgw_msc [label="CRCX (for BTS)"]; - bsc_gscon note bsc_mgcp [label="conn FSM relies on mgcp FSM timeout"]; + lchan abox lchan [label="LCHAN_ST_WAIT_ACTIV_ACK"]; + ms <= lchan [label="RSL Chan Activ"]; ...; - --- [label="On Timeout"]; - bsc_mgcp note bsc_mgcp [label="On timeouit, the MGCP FSM will terminate, emitting the parent_term - event set upon mgcp_conn_create():"]; - bsc_mgcp -> bsc_gscon [label="GSCON_EV_MGW_FAIL_BTS"]; - bsc_gscon note bsc_gscon [label="GSCON_EV_MGW_FAIL_BTS is handled by the conn FSM allstate - handler. It sets conn->user_plane.fi_bts = NULL."]; - bsc_gscon -> bsc_lchan [label="LCHAN_EV_MGW_ENDPOINT_ERROR"]; - bsc_lchan note bsc_gscon [label="conn FSM timeout handler exits and relies on the lchan FSM - signalling error, which should actually happen immediately:"]; - bsc_gscon <- bsc_lchan [label="GSCON_EV_LCHAN_ALLOC_ERROR"]; - bsc_gscon abox bsc_gscon [label="ST_ACTIVE"]; - bsc_gscon box bsc_gscon [label="'forget' all about conn->lchan_for_assignment"]; - bsc_gscon => mgw_msc [label="BSSMAP Assignment Failure"]; - --- [label="END: 'On Timeout'"]; + ms => lchan [label="RSL Chan Activ ACK"]; + lchan -> ass [label="ASSIGNMENT_EV_LCHAN_ACTIVE"]; + ass abox ass [label="ASSIGNMENT_ST_\nWAIT_RR_ASS_COMPLETE"]; + ms <= ass [label="RR Assignment Command"]; + lchan note ass [label="The lchan FSM will continue with RSL and RTP while the Assignment FSM waits. + ASSIGNMENT_EV_LCHAN_ESTABLISHED means that both RSL and RTP are established. + Usually, RTP will be done first, and the ASSIGNMENT_EV_LCHAN_ESTABLISHED may be + received even before ASSIGNMENT_EV_RR_ASSIGNMENT_COMPLETE. + assignment_fsm_wait_lchan_established_onenter() decides whether to wait or not."]; ...; + ms => lchan [label="RSL EST IND"]; + lchan -> ass [label="ASSIGNMENT_EV_LCHAN_ESTABLISHED",ID="(may come as early as this, or...)"]; + ms => ass [label="RR Assignment Complete (came with EST IND)"]; + ass abox ass [label="ASSIGNMENT_ST_\nWAIT_LCHAN_ESTABLISHED"]; + --- [label="IF lchan is not in LCHAN_ST_ESTABLISHED yet (waiting for RTP)"]; + ...; + lchan rbox lchan [label="when lchan RTP FSM is done with setting up RTP"]; + lchan -> ass [label="ASSIGNMENT_EV_LCHAN_ESTABLISHED",ID="(...may come only now)"]; + ---; + ass abox ass [label="ASSIGNMENT_ST_WAIT_\nMGW_ENDPOINT_TO_MSC"]; + ass -> gscon [label="gscon_connect_mgw_to_msc()"]; + ...; + ass <- gscon [label="ASSIGNMENT_EV_MSC_MGW_OK"]; + ass box ass [label="assignment_success()"]; + ass => msc_ [label="BSSMAP Assignment Complete"]; + ass -> gscon [label="gscon_change_primary_lchan()"]; + lchan <- gscon [label="LCHAN_RTP_EV_ESTABLISHED"]; + ass abox ass [label="terminate"]; + ass -> gscon [label="GSCON_EV_ASSIGNMENT_END"]; + gscon abox gscon [label="ST_ACTIVE"]; - bsc_mgcp <= mgw_msc [label="CRCX OK (for BTS)"]; - bsc_mgcp box bsc_mgcp [label="libosmo-mgcp-client fsm_crcx_resp_cb()"]; - bsc_mgcp abox bsc_mgcp [label="ST_READY"]; - bsc_mgcp -> bsc_gscon [label="GSCON_EV_MGW_CRCX_RESP_BTS"]; - bsc_gscon abox bsc_gscon [label="ST_ASSIGNMENT_\nWAIT_LCHAN"]; - bsc_gscon -> bsc_lchan [label="LCHAN_EV_MGW_ENDPOINT_AVAILABLE"]; - --- [label="END: lchan FSM decides that it is an lchan for speech"]; - ...; - ...; - - bsc_lchan -> bsc_gscon [label="GSCON_EV_LCHAN_ACTIVE"]; - bsc_gscon abox bsc_gscon [label="ST_ASSIGNMENT_\nWAIT_COMPLETE\nT10, 6s"]; - ms <= bsc_gscon [label="RR Assignment"]; - ...; - --- [label="On Timeout"]; - bsc_gscon => mgw_msc [label="BSSMAP Assignment Failure"]; - bsc_gscon -> bsc_lchan [label="LCHAN_EV_LCHAN_RELEASE"]; - bsc_gscon box bsc_gscon [label="'forget' all about conn->lchan_for_assignment"]; - --- [label="IF assignment_created_mgw_endpoint == true"]; - bsc_gscon -> bsc_mgcp [label="mgcp_conn_delete()"]; - bsc_gscon note bsc_mgcp [label="If the MGW endpoint didn't exist before the Assignment, release - it now. If there was one before this, it is probably still in use by a previous lchan, so - keep it in place."]; - bsc_gscon abox bsc_gscon [label="ST_ACTIVE"]; - --- [label="END: 'On Timeout'"]; - ...; - ms => bsc_gscon [label="RR Assignment Complete"]; - bsc_gscon -> bsc_lchan [label="OLD lchan: LCHAN_EV_LCHAN_RELEASE"]; - bsc_gscon box bsc_gscon [label="conn->lchan = conn->lchan_for_assignment"]; - --- [label="IF: chan_mode a speech mode?"]; - bsc_gscon abox bsc_gscon [label="ST_WAIT_MDCX_BTS"]; - bsc_gscon -> bsc_mgcp [label="mgcp_conn_modify()"]; - bsc_mgcp note bsc_mgcp [label="same mgcp FSM as above, for BTS side"]; - bsc_mgcp abox bsc_mgcp [label="ST_MDCX_RESP"]; - bsc_mgcp => mgw_msc [label="MDCX (for BTS)"]; - ...; - --- [label="On Timeout"]; - bsc_gscon -> bsc_lchan [label="LCHAN_EV_RELEASE"]; - bsc_gscon -> bsc_mgcp [label="mgcp_conn_delete()"]; - bsc_gscon => mgw_msc [label="BSSMAP Assignment Failure"]; - bsc_gscon abox bsc_gscon [label="ST_WAIT_CLEAR_CMD"]; - bsc_gscon => mgw_msc [label="BSSMAP Clear Request"]; - --- [label="END: 'On Timeout'"]; - ...; - bsc_mgcp <= mgw_msc [label="MDCX OK"]; - bsc_mgcp abox bsc_mgcp [label="ST_READY"]; - bsc_mgcp -> bsc_gscon [label="GSCON_EV_MGW_MDCX_RESP_BTS"]; - bsc_gscon abox bsc_gscon [label="ST_WAIT_CRCX_MSC"]; - bsc_gscon -> bsc_mgcp [label="mgcp_conn_create()"]; - bsc_mgcp note bsc_mgcp [label="second mgcp FSM for MSC side"]; - bsc_mgcp => mgw_msc [label="CRCX (for MSC)"]; - ...; - --- [label="On Timeout"]; - bsc_gscon -> bsc_lchan [label="LCHAN_EV_RELEASE"]; - bsc_gscon -> bsc_mgcp [label="mgcp_conn_delete()"]; - bsc_gscon => mgw_msc [label="BSSMAP Assignment Failure"]; - bsc_gscon abox bsc_gscon [label="ST_WAIT_CLEAR_CMD"]; - bsc_gscon => mgw_msc [label="BSSMAP Clear Request"]; - --- [label="END: 'On Timeout'"]; - ...; - bsc_mgcp <= mgw_msc [label="CRCX OK (for MSC)"]; - bsc_gscon <- bsc_mgcp [label="GSCON_EV_MGW_CRCX_RESP_MSC"]; - --- [label="END: chan_mode a speech mode?"]; - - bsc_gscon => mgw_msc [label="BSSMAP Assignment Complete"]; - - bsc_gscon abox bsc_gscon [label="ST_ACTIVE"]; } diff --git a/doc/handover-inter-bsc-in-fsm.dot b/doc/handover-inter-bsc-in-fsm.dot new file mode 100644 index 0000000..b52a16d --- /dev/null +++ b/doc/handover-inter-bsc-in-fsm.dot @@ -0,0 +1,42 @@ +digraph G { +rankdir=TB +labelloc=t; label="Handover FSM: Inter-BSC Incoming" + + old_bss [label="old BSS",shape=box3d] + msc [label="MSC",shape=box3d] + ho_in [label="inter-BSC HO Incoming",shape=box] + gscon [label="gscon FSM",shape=box3d] + lchan [label="lchan FSM",shape=box3d] + msc2 [label="msc",shape=box3d] + old_bsc2 [label="old BSC",shape=box3d] + old_lchan [label="old lchan",shape=box3d] + terminate [shape=octagon] + + old_bss -> msc [label="BSSMAP Handover Required",style=dotted] + msc -> ho_in [label="BSSMAP Handover Request",style=dotted] + ho_in -> gscon [label="GSCON_EV_A_CONN_IND\nBSSMAP Handover Request",style=dotted] + gscon -> HO_ST_WAIT_LCHAN_ACTIVE [label="handover_start_inter_bsc_in()",style=dotted] + HO_ST_WAIT_LCHAN_ACTIVE -> lchan [label="lchan_activate()\nFOR_HANDOVER",style=dotted] + lchan -> HO_ST_WAIT_LCHAN_ACTIVE [label="HO_EV_\nLCHAN_ACTIVE,\n_ERROR",style=dotted,constraint=false] + HO_ST_WAIT_LCHAN_ACTIVE -> HO_ST_WAIT_RR_HO_DETECT + + HO_ST_WAIT_RR_HO_DETECT -> msc2 [label="BSSMAP\nHandover\nAccept\nwith\nRR Handover\nCommand",style=dotted] + msc2 -> old_bsc2 -> old_lchan [label="RR Handover\nCommand",style=dotted] + old_lchan -> lchan [label="MS moves",style=dotted,constraint=false] + + lchan -> HO_ST_WAIT_RR_HO_DETECT [label="RR Handover\nDetect",style=dotted] + HO_ST_WAIT_RR_HO_DETECT -> WAIT_RR_HO_COMPLETE + + lchan -> WAIT_RR_HO_COMPLETE [label="RR Handover\nComplete",style=dotted] + WAIT_RR_HO_COMPLETE -> WAIT_LCHAN_ESTABLISHED + lchan -> WAIT_LCHAN_ESTABLISHED [label="HO_EV_LCHAN_\nESTABLISHED",style=dotted] + + WAIT_LCHAN_ESTABLISHED -> terminate [label="non-TCH"] + WAIT_LCHAN_ESTABLISHED -> WAIT_MGW_ENDPOINT_TO_MSC + WAIT_MGW_ENDPOINT_TO_MSC -> terminate [label="handover_end()"] + terminate -> msc2 [label="BSSMAP Handover\nComplete\n/ Failure",style=dotted,constraint=false] + + err [label="on error",shape=box,style=dashed] + err -> terminate [style=dashed] + +} diff --git a/doc/handover-inter-bsc-in.msc b/doc/handover-inter-bsc-in.msc new file mode 100644 index 0000000..9534f90 --- /dev/null +++ b/doc/handover-inter-bsc-in.msc @@ -0,0 +1,74 @@ +msc { + hscale=2; + ms [label="MS/BTS"], lchan[label="BSC lchan FSM"], ho[label="BSC Handover FSM"], + gscon[label="BSC conn FSM"], msc_[label="MSC"]; + + ms note msc_ [label="inter-BSC Handover Incoming"]; + + gscon <= msc_ [label="N-Connect: BSSMAP Handover Request"]; + gscon box gscon [label="bsc_subscr_con_allocate()"]; + gscon abox gscon [label="ST_INIT"]; + gscon -> gscon [label="GSCON_EV_A_CONN_IND"]; + ho <- gscon [label="handover_start_inter_bsc_in()"]; + + ho abox ho [label="allocate\nHO_ST_NOT_STARTED"]; + ho box ho [label="lchan_select_by_chan_mode()"]; + ho abox ho [label="HO_ST_WAIT_\nLCHAN_ACTIVE"]; + lchan <- ho [label="lchan_activate(FOR_HANDOVER)"]; + lchan rbox lchan [label="(most details omitted, see lchan_fsm diagrams)"]; + + ...; + ...; + --- [label="On any error or timeout"]; + ho box ho [label="handover_end(fail)"]; + ho -> gscon [label="GSCON_EV_HANDOVER_END"]; + gscon note msc_ [label="There is no specific BSSMAP Handover Request NACK message."]; + gscon => msc_ [label="BSSMAP Clear Request"]; + gscon abox gscon [label="ST_CLEARING"]; + gscon rbox msc_ [label="the usual disconnect dance"]; + --- [label="END: 'On any error or timeout'"]; + ...; + ...; + + lchan abox lchan [label="LCHAN_ST_WAIT_\nACTIV_ACK"]; + ms <= lchan [label="RSL Chan Activ"]; + ...; + ms => lchan [label="RSL Chan Activ ACK"]; + lchan -> ho [label="HO_EV_LCHAN_ACTIVE"]; + ho abox ho [label="HO_ST_WAIT_\nRR_HO_DETECT"]; + ho => msc_ [label="BSSMAP Handover Request Acknowledge\nwith RR Handover Command"]; + + ...; + + ms => ho [label="RR Handover Detect\nHO_EV_RR_HO_DETECT"]; + ho => msc_ [label="BSSMAP Handover Detect"]; + ho abox ho [label="HO_ST_WAIT_\nRR_HO_COMPLETE"]; + + ...; + lchan note ho [label="The lchan FSM will continue with RSL and RTP while the HO FSM waits. + HO_EV_LCHAN_ESTABLISHED means that both RSL and RTP are established. + Usually, RTP will be done first, and the HO_EV_LCHAN_ESTABLISHED may be + received even before HO_EV_RR_HO_COMPLETE. + ho_fsm_wait_lchan_established_onenter() decides whether to wait or not."]; + ...; + ms => lchan [label="RSL EST IND"]; + lchan -> ho [label="HO_EV_LCHAN_ESTABLISHED",ID="(may come as early as this, or...)"]; + ms => ho [label="RR Handover Complete (from EST IND)\n HO_EV_RR_HO_COMPLETE"]; + ho abox ho [label="HO_ST_WAIT_\nLCHAN_ESTABLISHED"]; + ...; + lchan rbox lchan [label="when lchan FSM is done with setting up RTP"]; + lchan -> ho [label="HO_EV_LCHAN_ESTABLISHED",ID="(...may come only now)"]; + ho abox ho [label="HO_ST_WAIT_\nMGW_ENDPOINT_TO_MSC"]; + ho -> gscon [label="gscon_connect_mgw_to_msc()"]; + ...; + ho <- gscon [label="HO_EV_MSC_MGW_OK"]; + ho box ho [label="handover_end(OK)"]; + ho => msc_ [label="BSSMAP Handover Complete"]; + + ho -> gscon [label="gscon_change_primary_lchan()"]; + lchan <- gscon [label="LCHAN_RTP_EV_ESTABLISHED"]; + ho -> gscon [label="GSCON_EV_HANDOVER_END"]; + gscon abox gscon [label="ST_ACTIVE"]; + ho box ho [label="detach from parent to not fire another meaningless GSCON_EV_HANDOVER_END"]; + ho abox ho [label="terminate"]; +} diff --git a/doc/handover-inter-bsc-mo.msc b/doc/handover-inter-bsc-mo.msc deleted file mode 100644 index 9aff7a7..0000000 --- a/doc/handover-inter-bsc-mo.msc +++ /dev/null @@ -1,37 +0,0 @@ -msc { - hscale=2; - ms [label="MS via BTS"], bsc_lchan[label="BSC lchan FSM"], bsc_gscon[label="BSC conn FSM"], - msc_[label="MSC"]; - - ms note msc_ [label="inter-BSC Handover to another BSS"]; - - bsc_gscon abox bsc_gscon [label="ST_ACTIVE"]; - bsc_gscon box bsc_gscon [label="bsc_handover_start(): init conn->ho"]; - bsc_gscon -> bsc_gscon [label="GSCON_EV_HO_START (inter-BSC MO)"]; - bsc_gscon abox bsc_gscon [label="ST_HANDOVER_MO_\nWAIT_HO_CMD\nT7"]; - bsc_gscon => msc_ [label="BSSMAP Handover Required"]; - ...; - --- [label="On Timeout"]; - ms note bsc_gscon [label="MS happily continues on the old lchan."]; - bsc_gscon abox bsc_gscon [label="ST_ACTIVE"]; - bsc_gscon box bsc_gscon [label="handover_end(fail)"]; - --- [label="END: 'On Timeout'"]; - ...; - bsc_gscon <= msc_ [label="BSSMAP Handover Command"]; - bsc_gscon abox bsc_gscon [label="ST_HANDOVER_MO_\nWAIT_CLEAR_CMD\nT8"]; - ms <= bsc_gscon [label="RR Handover Command"]; - ...; - --- [label="On Timeout"]; - ms note bsc_gscon [label="MS happily continues on the old lchan."]; - bsc_gscon abox bsc_gscon [label="ST_ACTIVE"]; - bsc_gscon box bsc_gscon [label="handover_end(fail)"]; - --- [label="END: 'On Timeout'"]; - ...; - msc_ note msc_ [label="Remote BSS reported Handover Complete to the MSC, this connection has been - superseded."]; - bsc_gscon <= msc_ [label="BSSMAP Clear Command"]; - bsc_gscon abox bsc_gscon [label="ST_CLEARING"]; - bsc_gscon => msc_ [label="BSSMAP Clear Complete"]; - bsc_lchan <- bsc_gscon [label="LCHAN_EV_RELEASE"]; - ms <=> bsc_lchan [label="release procedure (async)"]; -} diff --git a/doc/handover-inter-bsc-mt.msc b/doc/handover-inter-bsc-mt.msc deleted file mode 100644 index 88a52da..0000000 --- a/doc/handover-inter-bsc-mt.msc +++ /dev/null @@ -1,154 +0,0 @@ -msc { - hscale=3; - ms [label="MS via BTS"], bsc_lchan[label="BSC lchan FSM"], bsc_gscon[label="BSC conn FSM"], - bsc_mgcp[label="BSC mgcp FSM"], mgw_msc[label="MGW/MSC"]; - - ms note mgw_msc [label="inter-BSC Handover, from remote BSS"]; - - bsc_gscon <= mgw_msc [label="N-Connect: BSSMAP Handover Request"]; - bsc_gscon box bsc_gscon [label="bsc_subscr_con_allocate()"]; - bsc_gscon abox bsc_gscon [label="ST_HANDOVER_MT_WAIT_LCHAN"]; - bsc_gscon box bsc_gscon [label="lchan_select_by_chan_mode()"]; - bsc_lchan <- bsc_gscon [label="lchan_activate(lchan, FOR_HANDOVER)"]; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_WAIT_TS_READY"]; - ...; - --- [label="on no lchan, lchan FSM error or timeout"]; - bsc_lchan -> bsc_gscon [label="GSCON_EV_LCHAN_ALLOC_ERROR"]; - bsc_gscon box bsc_gscon [label="handover_end(fail)"]; - bsc_gscon => mgw_msc [label="BSSMAP Handover Failure"]; - ms note bsc_gscon [label="MS happily continues on the old lchan."]; - --- [label="END: 'on error'"]; - ...; - - --- [label="IF lchan FSM decides that it is an lchan for speech"]; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_WAIT_MGW_ENDPOINT_AVAILABLE"]; - bsc_lchan -> bsc_gscon [label="GSCON_EV_ENSURE_MGW_ENDPOINT"]; - bsc_gscon abox bsc_gscon [label="ST_HANDOVER_\nWAIT_CRCX_BTS"]; - bsc_gscon box bsc_gscon [label="handover_created_mgw_endpoint = true"]; - bsc_gscon -> bsc_mgcp [label="mgcp_conn_create()"]; - bsc_mgcp => mgw_msc [label="CRCX (for BTS)"]; - bsc_mgcp abox bsc_mgcp [label="ST_CRCX_RESP (MGCP_MGW_TIMEOUT = 4s)"]; - bsc_gscon note bsc_mgcp [label="conn FSM relies on mgcp FSM timeout"]; - ...; - --- [label="On Timeout"]; - bsc_mgcp note bsc_mgcp [label="On timeout, the MGCP FSM will terminate, emitting the parent_term - event set upon mgcp_conn_create():"]; - bsc_mgcp -> bsc_gscon [label="GSCON_EV_MGW_FAIL_BTS"]; - bsc_gscon note bsc_gscon [label="GSCON_EV_MGW_FAIL_BTS is handled by the conn FSM allstate - handler. It sets conn->user_plane.fi_bts = NULL."]; - bsc_gscon -> bsc_lchan [label="LCHAN_EV_MGW_ENDPOINT_ERROR"]; - bsc_lchan note bsc_gscon [label="conn FSM error handler exits and relies on the lchan FSM - signalling error, which should actually happen immediately:"]; - bsc_gscon <- bsc_lchan [label="GSCON_EV_LCHAN_ALLOC_ERROR"]; - bsc_gscon -> bsc_mgcp [label="mgcp_conn_delete()"]; - bsc_gscon box bsc_gscon [label="handover_end(fail)"]; - bsc_gscon => mgw_msc [label="BSSMAP Handover Failure"]; - ms note bsc_gscon [label="MS happily continues on the old lchan."]; - --- [label="END: 'On Timeout'"]; - ...; - - bsc_mgcp <= mgw_msc [label="CRCX OK (for BTS)"]; - bsc_mgcp box bsc_mgcp [label="libosmo-mgcp-client fsm_crcx_resp_cb()"]; - bsc_mgcp abox bsc_mgcp [label="ST_READY"]; - bsc_mgcp -> bsc_gscon [label="GSCON_EV_MGW_CRCX_RESP_BTS"]; - bsc_gscon -> bsc_lchan [label="LCHAN_EV_MGW_ENDPOINT_AVAILABLE"]; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_WAIT_ACTIV_ACK"]; - bsc_gscon note bsc_gscon [label="MSC-side CRCX needs from Handover Required the RTP IP address - and port of the MSC's MGW; from MGW CRCX ACK (BTS) the conn->user_plane.mgw_endpoint; The - Call-ID, which we actually derive from the SCCP connection ID"]; - bsc_gscon abox bsc_gscon [label="ST_HANDOVER_MT_WAIT_CRCX_MSC"]; - bsc_gscon -> bsc_mgcp [label="mgcp_conn_create()"]; - bsc_mgcp note bsc_mgcp [label="second mgcp FSM for MSC side"]; - bsc_mgcp => mgw_msc [label="CRCX (for MSC)"]; - ...; - --- [label="On Timeout"]; - bsc_mgcp note bsc_mgcp [label="On timeout, the MGCP FSM will terminate, emitting the parent_term - event set upon mgcp_conn_create():"]; - bsc_mgcp -> bsc_gscon [label="GSCON_EV_MGW_FAIL_MSC"]; - bsc_gscon note bsc_gscon [label="GSCON_EV_MGW_FAIL_MSC is handled by the conn FSM allstate - handler. It sets conn->user_plane.fi_msc = NULL."]; - bsc_gscon -> bsc_lchan [label="LCHAN_EV_RELEASE"]; - bsc_gscon -> bsc_mgcp [label="mgcp_conn_delete() (FSM for BTS)"]; - bsc_gscon box bsc_gscon [label="handover_end(fail)"]; - bsc_gscon => mgw_msc [label="BSSMAP Handover Failure"]; - ms note bsc_gscon [label="MS happily continues on the old lchan."]; - --- [label="END: 'On Timeout'"]; - ...; - bsc_mgcp <= mgw_msc [label="CRCX OK (for MSC)"]; - bsc_gscon <- bsc_mgcp [label="GSCON_EV_MGW_CRCX_RESP_MSC"]; - bsc_gscon abox bsc_gscon [label="ST_HANDOVER_MT_WAIT_LCHAN"]; - --- [label="END: chan_mode a speech mode?"]; - --- [label="END: lchan FSM decides that it is an lchan for speech"]; - ...; - ...; - - bsc_lchan note bsc_lchan [label="TODO: when does the MS send RLL Establish Ind? I guess like - this:"]; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_WAIT_RLL_ESTABLISH"]; - ms => bsc_lchan [label="RLL Establish Ind"]; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_ACTIVE"]; - bsc_lchan -> bsc_gscon [label="GSCON_EV_LCHAN_ACTIVE"]; - bsc_gscon abox bsc_gscon [label="ST_HANDOVER_MT_\nWAIT_HO_ACCEPT\nsanity timer?"]; - bsc_gscon box bsc_gscon [label="Compose RR Handover Command"]; - bsc_gscon => mgw_msc [label="BSSMAP Handover Request Acknowledge"]; - mgw_msc note mgw_msc [label="MSC forwards the RR HO Cmd to the remote BSS"]; - - ...; - --- [label="On timeout"]; - bsc_lchan <- bsc_gscon [label="NEW lchan: LCHAN_EV_RELEASE"]; - ms <=> bsc_lchan [label="release procedure (async)"]; - bsc_gscon box bsc_gscon [label="handover_end(fail)"]; - bsc_gscon abox bsc_gscon [label="ST_WAIT_CLEAR_CMD"]; - bsc_gscon => mgw_msc [label="BSSMAP Clear Request"]; - bsc_gscon -> bsc_mgcp [label="mgcp_conn_delete()"]; - ms note bsc_gscon [label="MS happily continues on the old lchan."]; - --- [label="END: On timeout"]; - ...; - ms => bsc_gscon [label="RR Handover Accept"]; - bsc_gscon => mgw_msc [label="BSSMAP Handover Detect"]; - mgw_msc note mgw_msc [label="MSC switches call to new path"]; - bsc_gscon abox bsc_gscon [label="ST_HANDOVER_MT_WAIT_SABM\nT3105"]; - ...; - ms => bsc_gscon [label="SABM"]; - bsc_lchan note bsc_lchan [label="SABM: Layer 2 message containing ?"]; - bsc_gscon abox bsc_gscon [label="ST_HANDOVER_MT_\nWAIT_MDCX_BTS\nT?"]; - bsc_lchan note bsc_lchan [label="TODO: what is UA?"]; - ms <= bsc_gscon [label="RR UA"]; - bsc_gscon note bsc_gscon [label="TODO: at what point do we know the information needed for BTS - MDCX?"]; - bsc_gscon -> bsc_mgcp [label="mgcp_conn_modify()"]; - bsc_mgcp abox bsc_mgcp [label="ST_MDCX_RESP"]; - bsc_mgcp => mgw_msc [label="MDCX (for BTS)"]; - ...; - --- [label="Should the Handover Complete arrive early"]; - ms => bsc_gscon [label="RR Handover Complete"]; - bsc_gscon box bsc_gscon [label="handover_complete_received = true"]; - ---; - ...; - --- [label="On timeout of the mgcp FSM"]; - bsc_gscon note mgw_msc [label="MGCP FSM terminates"]; - bsc_gscon <- bsc_mgcp [label="GSCON_EV_MGW_FAIL_BTS"]; - bsc_lchan note bsc_gscon [label="The phone has already taken on the new lchan, but now we happen - to not be able to use it. The only sensible thing is to end the conn."]; - bsc_gscon abox bsc_gscon [label="ST_WAIT_CLEAR_CMD"]; - bsc_gscon => mgw_msc [label="BSSMAP Clear Request\n(Equipment Failure)"]; - bsc_lchan <- bsc_gscon [label="NEW lchan: LCHAN_EV_RELEASE"]; - ms <=> bsc_lchan [label="release procedure (async)"]; - bsc_gscon -> bsc_mgcp [label="mgcp_conn_delete()"]; - --- [label="END: On timeout of the mgcp FSM"]; - ...; - bsc_mgcp <= mgw_msc [label="MDCX OK"]; - bsc_mgcp abox bsc_mgcp [label="ST_READY"]; - bsc_mgcp -> bsc_gscon [label="GSCON_EV_MGW_MDCX_RESP_BTS"]; - --- [label="IF !handover_complete_received"]; - bsc_gscon abox bsc_gscon [label="ST_HANDOVER_MT_WAIT_HO_COMPL\nT?"]; - --- [label="ELSE"]; - bsc_gscon -> bsc_gscon [label="gscon_handover_post_complete()"]; - ---; - ...; - ms => bsc_gscon [label="RR Handover Complete"]; - bsc_gscon box bsc_gscon [label="gscon_handover_post_complete()"]; - bsc_gscon => mgw_msc [label="BSSMAP Handover Complete"]; - bsc_gscon note bsc_gscon [label="handover_end(success), conn->ho = NULL"]; - bsc_gscon abox bsc_gscon [label="ST_ACTIVE"]; -} diff --git a/doc/handover-inter-bsc-out-fsm.dot b/doc/handover-inter-bsc-out-fsm.dot new file mode 100644 index 0000000..9661b6f --- /dev/null +++ b/doc/handover-inter-bsc-out-fsm.dot @@ -0,0 +1,27 @@ +digraph G { +rankdir=TB +labelloc=t; label="Handover FSM: Inter-BSC Outgoing" + + invisible [style=invisible] + invisible -> ho_out [label="Measurement Report\nincluding neighbor\nBSS ARFCN",style=dotted] + ho_out [label="inter-BSC HO Outgoing",shape=box] + msc [label="MSC",shape=box3d] + new_bsc [label="new BSC",shape=box3d] + lchan [label="lchan",shape=box3d] + terminate [shape=octagon] + + ho_out -> HO_OUT_ST_WAIT_HO_COMMAND [label="handover_start()"] + HO_OUT_ST_WAIT_HO_COMMAND -> msc [label="BSSMAP Handover\nRequired",style=dotted] + msc -> new_bsc [label="BSSMAP Handover\nRequest",style=dotted] + new_bsc -> msc [label="BSSMAP Handover\nRequest Ack",style=dotted] + msc -> HO_OUT_ST_WAIT_HO_COMMAND [label="BSSMAP Handover\nCommand",style=dotted] + + HO_OUT_ST_WAIT_HO_COMMAND -> lchan [label="RR Handover\nCommand\nfrom new BSC",style=dotted] + + HO_OUT_ST_WAIT_HO_COMMAND -> HO_OUT_ST_WAIT_CLEAR + msc -> HO_OUT_ST_WAIT_CLEAR [label="BSSMAP\nClear\nCommand",style=dotted] + + HO_OUT_ST_WAIT_CLEAR -> terminate + + +} diff --git a/doc/handover-inter-bsc-out.msc b/doc/handover-inter-bsc-out.msc new file mode 100644 index 0000000..733b4da --- /dev/null +++ b/doc/handover-inter-bsc-out.msc @@ -0,0 +1,47 @@ +msc { + hscale=2; + ms [label="MS/BTS"], ho[label="BSC Handover FSM"], gscon[label="BSC conn FSM"], msc_[label="MSC"]; + + ms note msc_ [label="inter-BSC Handover to another BSS"]; + + gscon abox gscon [label="ST_ACTIVE"]; + + ms => ho [label="Measurement Report"]; + ho box ho [label="Handover Decision"]; + ho box ho [label="handover_request\n(struct handover_out_req)"]; + ho note gscon [label="To make sure the conn FSM permits a handover, trigger an event:"]; + ho -> gscon [label="GSCON_EV_HANDOVER_START\ndata=handover_out_req"]; + gscon abox gscon [label="ST_HANDOVER"]; + ho <- gscon [label="handover_start\n(handover_out_req)"]; + ho box ho [label="handover_start_inter_bsc_out()"]; + ho => msc_ [label="BSSMAP Handover Required"]; + ho abox ho [label="HO_OUT_ST_WAIT_HO_COMMAND"]; + ...; + ...; + --- [label="On Timeout"]; + ho box ho [label="handover_end(fail)"]; + ho -> gscon [label="GSCON_EV_HANDOVER_END"]; + gscon abox gscon [label="ST_ACTIVE"]; + ms note gscon [label="MS happily continues on the old lchan."]; + --- [label="END: 'On Timeout'"]; + ...; + ...; + ho <= msc_ [label="BSSMAP Handover Command\n HO_OUT_EV_BSSMAP_HO_COMMAND"]; + ms <= ho [label="Forward L3 Info (RR Handover Command from new BSS)"]; + ho abox ho [label="HO_OUT_ST_WAIT_CLEAR"]; + ...; + gscon abox gscon [label="ST_HANDOVER_MO_\nWAIT_CLEAR_CMD\nT8"]; + ms <= gscon [label="RR Handover Command"]; + ...; + ho rbox gscon [label="On Timeout: same as above"]; + ...; + msc_ note msc_ [label="Remote BSS reported Handover Complete to the MSC, + this connection has been superseded."]; + gscon <= msc_ [label="BSSMAP Clear Command\n GSCON_EV_A_CLEAR_CMD"]; + gscon abox gscon [label="ST_CLEARING"]; + gscon => msc_ [label="BSSMAP Clear Complete"]; + ...; + gscon <= msc_ [label="DISC IND\n GSCON_EV_A_DISC_IND"]; + ho abox ho [label="terminate\n(child of conn FSM)"]; + gscon abox gscon [label="terminate"]; +} diff --git a/doc/handover-intra-bsc-fsm.dot b/doc/handover-intra-bsc-fsm.dot new file mode 100644 index 0000000..7cb0d3c --- /dev/null +++ b/doc/handover-intra-bsc-fsm.dot @@ -0,0 +1,30 @@ +digraph G { +rankdir=TB +labelloc=t; label="Handover FSM: Intra-BSC" + + lchan [label="lchan FSM",shape=box3d] + intra [label="intra-BSC HO",shape=box] + old_lchan [label="old lchan",shape=box3d] + terminate [shape=octagon] + + invisible [style="invisible"] + invisible -> intra [label="Measurement Report",style=dotted] + invisible -> old_lchan [style=invisible,arrowhead=none] + + intra -> WAIT_LCHAN_ACTIVE [label="handover_start()",style=dotted] + WAIT_LCHAN_ACTIVE -> lchan [label="lchan_activate(FOR_HANDOVER)",style=dotted] + lchan -> WAIT_LCHAN_ACTIVE [label="HO_EV_\nLCHAN_\nACTIVE,ERROR",style=dotted,constraint=false] + WAIT_LCHAN_ACTIVE -> WAIT_RR_HO_DETECT + WAIT_RR_HO_DETECT -> old_lchan [label="RR Handover\nCommand",style=dotted,constraint=false] + + lchan -> WAIT_RR_HO_DETECT [label="RR Handover\nDetect",style=dotted] + WAIT_RR_HO_DETECT -> WAIT_RR_HO_COMPLETE + + lchan -> WAIT_RR_HO_COMPLETE [label="RR Handover\nComplete",style=dotted] + WAIT_RR_HO_COMPLETE -> WAIT_LCHAN_ESTABLISHED + lchan -> WAIT_LCHAN_ESTABLISHED [label="HO_EV_LCHAN_\nESTABLISHED",style=dotted] + + WAIT_LCHAN_ESTABLISHED -> terminate [label="non-TCH"] + WAIT_LCHAN_ESTABLISHED -> WAIT_MGW_ENDPOINT_TO_MSC + WAIT_MGW_ENDPOINT_TO_MSC -> terminate [label="handover_end()"] +} diff --git a/doc/handover.msc b/doc/handover.msc index 7529de6..1a2580a 100644 --- a/doc/handover.msc +++ b/doc/handover.msc @@ -1,123 +1,82 @@ # Handover between cells, intra-BSC msc { - hscale=3; - ms [label="MS via BTS"], bsc_lchan[label="BSC lchan FSM"], bsc_gscon[label="BSC conn FSM"], - bsc_mgcp[label="BSC mgcp FSM"], mgw_msc[label="MGW/MSC"]; + hscale=2; + ms [label="MS via BTS"], lchan[label="BSC lchan FSM"], ho[label="BSC Handover FSM"], + gscon[label="BSC conn FSM"], msc_[label="MSC"]; - ms note mgw_msc [label="intra-BSC Handover sequence"]; + ms note msc_ [label="intra-BSC Handover"]; - bsc_gscon abox bsc_gscon [label="ST_ACTIVE"]; - bsc_gscon box bsc_gscon [label="bsc_handover_start(): init conn->ho"]; - bsc_gscon -> bsc_gscon [label="GSCON_EV_HO_START (intra-BSC)"]; - bsc_gscon abox bsc_gscon [label="ST_HANDOVER_\nWAIT_LCHAN"]; - bsc_lchan <- bsc_gscon [label="lchan_activate(lchan, FOR_HANDOVER)"]; + gscon abox gscon [label="ST_ACTIVE"]; + + ms => ho [label="Measurement Report"]; + ho box ho [label="Handover Decision"]; + ho box ho [label="handover_request\n(struct handover_out_req)"]; + ho note gscon [label="To make sure the conn FSM permits a handover, trigger an event:"]; + ho -> gscon [label="GSCON_EV_HANDOVER_START\ndata=handover_out_req"]; + gscon abox gscon [label="ST_HANDOVER"]; + ho <- gscon [label="handover_start\n(handover_out_req)"]; + ho box ho [label="handover_start_intra_bsc()"]; + ho abox ho [label="allocate\nHO_ST_NOT_STARTED"]; + ...; - --- [label="on lchan FSM error or timeout"]; - bsc_lchan -> bsc_gscon [label="GSCON_EV_LCHAN_ALLOC_ERROR"]; - bsc_gscon box bsc_gscon [label="handover_end(fail)"]; - ms note bsc_gscon [label="MS happily continues on the old lchan."]; - bsc_gscon abox bsc_gscon [label="ST_ACTIVE"]; - --- [label="END: 'on error'"]; + ...; + --- [label="On any error or timeout"]; + ho box ho [label="handover_end(fail)"]; + ho -> gscon [label="GSCON_EV_HANDOVER_END"]; + gscon abox gscon [label="ST_ACTIVE"]; + ms note gscon [label="MS happily continues on the old lchan."]; + --- [label="END: 'On any error or timeout'"]; ...; ...; - --- [label="IF lchan FSM decides that it is an lchan for speech"]; - bsc_lchan -> bsc_gscon [label="GSCON_EV_ENSURE_MGW_ENDPOINT"]; - --- [label="IF there is an MGW endpoint for the BTS already (conn->user_plane.fi_bts)"]; - bsc_gscon box bsc_gscon [label="handover_created_mgw_endpoint = false"]; - bsc_gscon -> bsc_lchan [label="LCHAN_EV_MGW_ENDPOINT_AVAILABLE"]; - --- [label="ELSE: no MGW endpoint for the BTS side yet"]; - bsc_gscon abox bsc_gscon [label="ST_HANDOVER_\nWAIT_CRCX_BTS"]; - bsc_gscon box bsc_gscon [label="handover_created_mgw_endpoint = true"]; - bsc_gscon -> bsc_mgcp [label="mgcp_conn_create()"]; - bsc_mgcp => mgw_msc [label="CRCX (for BTS)"]; - bsc_mgcp abox bsc_mgcp [label="ST_CRCX_RESP (MGCP_MGW_TIMEOUT = 4s)"]; - bsc_gscon note bsc_mgcp [label="conn FSM relies on mgcp FSM timeout"]; - ...; - --- [label="On Timeout"]; - bsc_mgcp note bsc_mgcp [label="On timeout, the MGCP FSM will terminate, emitting the parent_term - event set upon mgcp_conn_create():"]; - bsc_mgcp -> bsc_gscon [label="GSCON_EV_MGW_FAIL_BTS"]; - bsc_gscon note bsc_gscon [label="GSCON_EV_MGW_FAIL_BTS is handled by the conn FSM allstate - handler. It sets conn->user_plane.fi_bts = NULL."]; - bsc_gscon -> bsc_lchan [label="LCHAN_EV_MGW_ENDPOINT_ERROR"]; - bsc_lchan note bsc_gscon [label="conn FSM error handler exits and relies on the lchan FSM - signalling error, which should actually happen immediately:"]; - bsc_gscon <- bsc_lchan [label="GSCON_EV_LCHAN_ALLOC_ERROR"]; - bsc_gscon box bsc_gscon [label="handover_end(fail)"]; - --- [label="IF handover_created_mgw_endpoint == true"]; - bsc_gscon -> bsc_mgcp [label="mgcp_conn_delete()"]; - ---; - ms note bsc_gscon [label="MS happily continues on the old lchan."]; - bsc_gscon abox bsc_gscon [label="ST_ACTIVE"]; - --- [label="END: 'On Timeout'"]; - ...; + ho box ho [label="lchan_select_by_type()"]; + ho abox ho [label="HO_ST_WAIT_\nLCHAN_ACTIVE"]; + lchan <- ho [label="lchan_activate(FOR_HANDOVER)"]; + lchan rbox lchan [label="(most details omitted, see lchan_fsm diagrams)"]; - bsc_mgcp <= mgw_msc [label="CRCX OK (for BTS)"]; - bsc_mgcp box bsc_mgcp [label="libosmo-mgcp-client fsm_crcx_resp_cb()"]; - bsc_mgcp abox bsc_mgcp [label="ST_READY"]; - bsc_mgcp -> bsc_gscon [label="GSCON_EV_MGW_CRCX_RESP_BTS"]; - bsc_gscon abox bsc_gscon [label="ST_HANDOVER_\nWAIT_LCHAN"]; - bsc_gscon -> bsc_lchan [label="LCHAN_EV_MGW_ENDPOINT_AVAILABLE"]; - --- [label="END: lchan FSM decides that it is an lchan for speech"]; + ...; + ...; + --- [label="On lchan error or timeout"]; + lchan -> ho [label="HO_EV_LCHAN_ERROR"]; + ho rbox gscon [label="same as above"]; + --- [label="END: 'On lchan error or timeout'"]; ...; ...; - bsc_lchan -> bsc_gscon [label="GSCON_EV_LCHAN_ACTIVE"]; - bsc_gscon abox bsc_gscon [label="ST_HANDOVER_\nWAIT_DETECT\nT3103"]; - bsc_gscon box bsc_gscon [label="gsm48_send_ho_cmd()"]; - ms <= bsc_gscon [label="RR Handover Command"]; - + lchan abox lchan [label="LCHAN_ST_WAIT_ACTIV_ACK"]; + ms <= lchan [label="RSL Chan Activ"]; ...; - --- [label="On timeout"]; - bsc_lchan <- bsc_gscon [label="NEW lchan: LCHAN_EV_RELEASE"]; - ms <=> bsc_lchan [label="release procedure (async)"]; - bsc_gscon box bsc_gscon [label="handover_end(fail)"]; - --- [label="IF handover_created_mgw_endpoint == true"]; - bsc_gscon -> bsc_mgcp [label="mgcp_conn_delete()"]; - ---; - ms note bsc_gscon [label="MS happily continues on the old lchan."]; - bsc_gscon abox bsc_gscon [label="ST_ACTIVE"]; - --- [label="END: On timeout"]; + ms => lchan [label="RSL Chan Activ ACK"]; + lchan -> ho [label="HO_EV_LCHAN_ACTIVE"]; + ho abox ho [label="HO_ST_WAIT_\nRR_HO_DETECT"]; ...; - ms => bsc_gscon [label="RR Handover Detect"]; - - bsc_gscon abox bsc_gscon [label="ST_HANDOVER_\nWAIT_MDCX_BTS\ncontinue T3103"]; - bsc_gscon -> bsc_lchan [label="OLD lchan: LCHAN_EV_RELEASE"]; - ms <=> bsc_lchan [label="release procedure (async)"]; - bsc_lchan note bsc_gscon [label="officially take over new lchan: conn->lchan = ho->new_lchan"]; - bsc_gscon -> bsc_mgcp [label="mgcp_conn_modify()"]; - bsc_mgcp note bsc_mgcp [label="mgcp FSM that was established for old lchan, for BTS side"]; - bsc_mgcp abox bsc_mgcp [label="ST_MDCX_RESP"]; - bsc_mgcp => mgw_msc [label="MDCX (for BTS)"]; + ms => ho [label="RR Handover Detect\nHO_EV_RR_HO_DETECT"]; + lchan note ho [label="At this point we should start to switch the MGW over to the new lchan. + But this is not implemented yet, as was not before introducing these FSMs."]; + ho abox ho [label="HO_ST_WAIT_\nRR_HO_COMPLETE"]; ...; - --- [label="Should the Handover Complete arrive early"]; - ms => bsc_gscon [label="RR Handover Complete"]; - bsc_gscon box bsc_gscon [label="handover_complete_received = true"]; - ---; + lchan note ho [label="The lchan FSM will continue with RSL and RTP while the HO FSM waits. + HO_EV_LCHAN_ESTABLISHED means that both RSL and RTP are established. + Usually, RTP will be done first, and the HO_EV_LCHAN_ESTABLISHED may be + received even before HO_EV_RR_HO_COMPLETE. + ho_fsm_wait_lchan_established_onenter() decides whether to wait or not."]; ...; - --- [label="On timeout of the mgcp FSM"]; - bsc_gscon note mgw_msc [label="MGCP FSM terminates"]; - bsc_gscon <- bsc_mgcp [label="GSCON_EV_MGW_FAIL_BTS"]; - bsc_lchan note bsc_gscon [label="The phone has already taken on the new lchan, but now we happen - to not be able to use it. The only sensible thing is to end the conn."]; - bsc_gscon abox bsc_gscon [label="ST_WAIT_CLEAR_CMD"]; - bsc_gscon => mgw_msc [label="BSSMAP Clear Request\n(Equipment Failure)"]; - bsc_lchan <- bsc_gscon [label="NEW lchan: LCHAN_EV_RELEASE"]; - ms <=> bsc_lchan [label="release procedure (async)"]; - bsc_gscon -> bsc_mgcp [label="mgcp_conn_delete()"]; + ms => lchan [label="RSL EST IND"]; + lchan -> ho [label="HO_EV_LCHAN_ESTABLISHED",ID="(may come as early as this, or...)"]; + ms => ho [label="RR Handover Complete (from EST IND)\n HO_EV_RR_HO_COMPLETE"]; + ho abox ho [label="HO_ST_WAIT_\nLCHAN_ESTABLISHED"]; ...; - bsc_mgcp <= mgw_msc [label="MDCX OK"]; - bsc_mgcp abox bsc_mgcp [label="ST_READY"]; - bsc_mgcp -> bsc_gscon [label="GSCON_EV_MGW_MDCX_RESP_BTS"]; - --- [label="IF !handover_complete_received"]; - bsc_gscon abox bsc_gscon [label="ST_HANDOVER_\nWAIT_COMPLETE\ncontinue T3103"]; - --- [label="ELSE"]; - bsc_gscon -> bsc_gscon [label="gscon_handover_post_complete()"]; - ---; + lchan rbox lchan [label="when lchan FSM is done with setting up RTP"]; + lchan -> ho [label="HO_EV_LCHAN_ESTABLISHED",ID="(...may come only now)"]; + ho abox ho [label="HO_ST_WAIT_\nMGW_ENDPOINT_TO_MSC"]; + ho -> gscon [label="gscon_connect_mgw_to_msc()"]; ...; - ms => bsc_gscon [label="RR Handover Complete"]; - bsc_gscon box bsc_gscon [label="gscon_handover_post_complete()"]; - bsc_gscon note bsc_gscon [label="handover_end(success), conn->ho = NULL"]; - bsc_gscon abox bsc_gscon [label="ST_ACTIVE"]; + ho <- gscon [label="HO_EV_MSC_MGW_OK"]; + ho box ho [label="handover_end(OK)"]; + ho -> gscon [label="gscon_change_primary_lchan()"]; + lchan <- gscon [label="LCHAN_RTP_EV_ESTABLISHED"]; + ho -> gscon [label="GSCON_EV_HANDOVER_END"]; + gscon abox gscon [label="ST_ACTIVE"]; + ho box ho [label="detach from parent to not fire another meaningless GSCON_EV_HANDOVER_END"]; + ho abox ho [label="terminate"]; } diff --git a/doc/lchan-fsm.dot b/doc/lchan-fsm.dot index dbb283c..b726b0c 100644 --- a/doc/lchan-fsm.dot +++ b/doc/lchan-fsm.dot @@ -1,38 +1,22 @@ digraph G { -rankdir=TB; +rankdir=TB +labelloc=t; label="lchan FSM" invisible [style="invisible"] UNUSED [penwidth=3.0] - WAIT_TS_READY - WAIT_MGW_ENDPOINT_AVAILABLE - WAIT_ACTIV_ACK - WAIT_IPACC_CRCX_ACK - WAIT_IPACC_MDCX_ACK - WAIT_RLL_ESTABLISH - ACTIVE [penwidth=3.0] - WAIT_SAPIS_RELEASED - WAIT_BEFORE_RF_RELEASE - WAIT_RF_RELEASE_ACK - WAIT_AFTER_ERROR - BORKEN + ESTABLISHED [penwidth=3.0] - ts [label="timeslot FSM",shape=box3d]; - gscon [label="conn FSM",shape=box3d]; + ts [label="timeslot FSM",shape=box3d] + rtp [label="lchan_rtp\nFSM",shape=box3d] UNUSED -> WAIT_TS_READY [label="lchan_allocate()"] WAIT_TS_READY -> WAIT_ACTIV_ACK - WAIT_ACTIV_ACK -> WAIT_RLL_ESTABLISH - WAIT_RLL_ESTABLISH -> WAIT_MGW_ENDPOINT_AVAILABLE [label="TCH"] - WAIT_MGW_ENDPOINT_AVAILABLE -> WAIT_IPACC_CRCX_ACK [label="IPACC BTS"] - WAIT_MGW_ENDPOINT_AVAILABLE -> ACTIVE - WAIT_IPACC_CRCX_ACK -> WAIT_IPACC_MDCX_ACK - WAIT_IPACC_MDCX_ACK -> ACTIVE - WAIT_RLL_ESTABLISH -> ACTIVE [label="non-TCH"]; - WAIT_RLL_ESTABLISH -> WAIT_RF_RELEASE_ACK [label="timeout",style=dashed,constraint=false] + WAIT_ACTIV_ACK -> WAIT_RLL_RTP_ESTABLISH + WAIT_RLL_RTP_ESTABLISH -> ESTABLISHED - ACTIVE -> WAIT_SAPIS_RELEASED [label="LCHAN_EV_\nRELEASE"] - WAIT_SAPIS_RELEASED -> WAIT_BEFORE_RF_RELEASE - WAIT_SAPIS_RELEASED -> WAIT_RF_RELEASE_ACK [label="timeout",style=dashed,constraint=false] + ESTABLISHED -> WAIT_RLL_RTP_RELEASED [label="LCHAN_EV_\nRELEASE"] + WAIT_RLL_RTP_RELEASED -> WAIT_BEFORE_RF_RELEASE + WAIT_RLL_RTP_RELEASED -> WAIT_RF_RELEASE_ACK [label="timeout",style=dashed,constraint=false] WAIT_BEFORE_RF_RELEASE -> WAIT_RF_RELEASE_ACK [label="T3111"] WAIT_RF_RELEASE_ACK -> UNUSED @@ -43,11 +27,15 @@ UNUSED -> ts [label="TS_EV_\nLCHAN_\nUNUSED",style=dotted,penwidth=3] ts -> WAIT_TS_READY [label="LCHAN_EV_\nTS_READY",style=dotted] + WAIT_TS_READY -> rtp [label="TCH",style=dotted] + WAIT_TS_READY -> UNUSED [label="error/timeout",style=dashed,constraint=false] {WAIT_ACTIV_ACK,WAIT_RF_RELEASE_ACK} -> BORKEN [label="error/timeout",style=dashed] - {WAIT_MGW_ENDPOINT_AVAILABLE,WAIT_IPACC_CRCX_ACK,WAIT_IPACC_MDCX_ACK} -> WAIT_SAPIS_RELEASED [label=error,style=dashed] + BORKEN -> WAIT_AFTER_ERROR [label="late RF Release ACK"] + WAIT_RLL_RTP_ESTABLISH -> WAIT_RLL_RTP_RELEASED [label=error,style=dashed] - WAIT_TS_READY -> gscon [label="GSCON_EV_\nENSURE_\nMGW_ENDPOINT",style=dotted] - gscon -> WAIT_MGW_ENDPOINT_AVAILABLE [label="LCHAN_EV_\nMGW_ENDPOINT_\n{AVAILABLE,ERROR}",style=dotted] + WAIT_ACTIV_ACK -> rtp [label="LCHAN_RTP_EV_LCHAN_READY",style=dotted] + rtp -> WAIT_RLL_RTP_ESTABLISH [label="LCHAN_EV_RTP_READY",style=dotted] + rtp -> ESTABLISHED [label="LCHAN_EV_RTP_RELEASED",style=dotted] } diff --git a/doc/lchan-release.msc b/doc/lchan-release.msc deleted file mode 100644 index 017c9cf..0000000 --- a/doc/lchan-release.msc +++ /dev/null @@ -1,83 +0,0 @@ -msc { - hscale=2; - ms [label="MS"], bts [label="BTS"], bsc[label="BSC"], bsc_lchan[label="BSC lchan FSM"], - bsc_gscon[label="BSC conn FSM"], msc_[label="MSC"]; - - ms note bsc_gscon [label="various lchan release scenarios"]; - - ms rbox msc_ [label="MSC releases"]; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_ACTIVE"]; - bsc_gscon abox bsc_gscon [label="ST_ACTIVE"]; - bsc_gscon <= msc_ [label="BSSMAP Clear Command"]; - bsc_gscon abox bsc_gscon [label="ST_CLEARING"]; - bsc_gscon => msc_ [label="BSSMAP Clear Complete"]; - bsc_gscon -> bsc_lchan [label="LCHAN_EV_RELEASE"]; - --- [label="IF SAPIs besides SAPI[0] are active"]; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_WAIT_\nSAPIS_RELEASED\nT3109"]; - bts <= bsc_lchan [label="RSL Release Request (Local End)..."]; - bts <= bsc_lchan [label="...for each SAPI, except link_id=0"]; - ms <= bsc_lchan [label="RR Channel Release"]; - bts <= bsc_lchan [label="RSL Deactivate SACCH",ID="if appropriate pchan"]; - ...; - bts => bsc_lchan [label="RSL Release ACKs"]; - --- [label="END: SAPIs besides SAPI[0] are active"]; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_WAIT_\nBEFORE_RF_RELEASE\nT3111"]; - bsc_lchan -> bsc_gscon [label="GSCON_EV_FORGET_LCHAN"]; - bsc_gscon note bsc_gscon [label="has already forgotten the lchan above."]; - ...; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_WAIT_\nRF_RELEASE_ACK\n4s"]; - bts <= bsc_lchan [label="RSL RF Channel Release"]; - ...; - bts => bsc_lchan [label="RSL RF Channel Release ACK"]; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_UNUSED"]; - ...; - ...; - - ms rbox msc_ [label="BSC releases, outside of conn FSM's flow"]; - bsc -> bsc_lchan [label="LCHAN_EV_RELEASE"]; - --- [label="IF SAPIs besides SAPI[0] are active"]; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_WAIT_\nSAPIS_RELEASED\nT3109"]; - bts <= bsc_lchan [label="RSL Release Request (Local End)..."]; - bts <= bsc_lchan [label="...for each SAPI, except link_id=0"]; - ms <= bsc_lchan [label="RR Channel Release",ID="if conn is present"]; - bts <= bsc_lchan [label="RSL Deactivate SACCH",ID="if appropriate pchan"]; - ...; - bts => bsc_lchan [label="RSL Release ACKs"]; - --- [label="END: SAPIs besides SAPI[0] are active"]; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_WAIT_\nBEFORE_RF_RELEASE\nT3111"]; - bsc_lchan -> bsc_gscon [label="GSCON_EV_FORGET_LCHAN"]; - bsc_gscon note bsc_gscon [label="conn FSM notices that its primary lchan is gone"]; - bsc_gscon => msc_ [label="BSSMAP Clear Request"]; - bsc_gscon abox bsc_gscon [label="ST_WAIT_CLEAR_CMD"]; - ...; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_WAIT_\nRF_RELEASE_ACK\n4s"]; - bts <= bsc_lchan [label="RSL RF Channel Release"]; - ...; - bts => bsc_lchan [label="RSL RF Channel Release ACK"]; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_UNUSED"]; - ...; - bsc_gscon <= msc_ [label="BSSMAP Clear Command"]; - bsc_gscon abox bsc_gscon [label="ST_CLEARING"]; - bsc_gscon => msc_ [label="BSSMAP Clear Complete"]; - ...; - ...; - - ms rbox msc_ [label="MS releases"]; - ms => bts [label="DISC"]; - bts => bsc_lchan [label="RLL Release Ind..."]; - bts => bsc_lchan [label="...for each SAPI"]; - bsc_lchan note bsc_lchan [label="The lchan FSM notices when all SAPIs have been released"]; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_WAIT_\nBEFORE_RF_RELEASE\nT3111"]; - ...; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_WAIT_\nRF_RELEASE_ACK\n4s"]; - bts <= bsc_lchan [label="RSL RF Channel Release"]; - bsc_lchan -> bsc_gscon [label="GSCON_EV_FORGET_LCHAN"]; - bsc_gscon note bsc_gscon [label="conn FSM notices that its primary lchan is gone"]; - bsc_gscon => msc_ [label="BSSMAP Clear Request"]; - bsc_gscon abox bsc_gscon [label="ST_WAIT_CLEAR_CMD"]; - ...; - bts => bsc_lchan [label="RSL RF Channel Release ACK"]; - ...; - bsc_gscon <= msc_ [label="BSSMAP Clear Command"]; - bsc_gscon => msc_ [label="BSSMAP Clear Complete"]; -} diff --git a/doc/lchan-rtp-fsm.dot b/doc/lchan-rtp-fsm.dot new file mode 100644 index 0000000..d5df643 --- /dev/null +++ b/doc/lchan-rtp-fsm.dot @@ -0,0 +1,44 @@ +digraph G { +rankdir=TB +labelloc=t; label="lchan RTP FSM" + + lchan [label="lchan\nFSM",shape=box3d] + lchan2 [label="lchan\nFSM",shape=box3d] + ho_as [label="Handover or Assignment FSM",shape=box3d] + invisible [style=invisible] + ho [label="Handover FSM",shape=box3d] + mgwep [label="mgw endpoint\nFSM",shape=box3d] + start [label="lchan_rtp_fsm_start()",shape=box] + WAIT_READY_TO_SWITCH_RTP [label="WAIT_READY_TO_SWITCH_RTP\nonly if wait_before_switching_rtp"] + terminate [shape=octagon] + + lchan -> start [style=dashed] + start -> WAIT_MGW_ENDPOINT_AVAILABLE + start -> WAIT_LCHAN_READY [label="re-use existing\nendpoint CI"] + + WAIT_MGW_ENDPOINT_AVAILABLE -> mgwep [label="gscon_ensure_mgw_endpoint()\nand CRCX to-BTS",style=dashed] + mgwep -> WAIT_MGW_ENDPOINT_AVAILABLE [label="LCHAN_RTP_EV_\nMGW_ENDPOINT_\n{AVAILABLE,ERROR}",style=dashed] + WAIT_MGW_ENDPOINT_AVAILABLE -> WAIT_LCHAN_READY + + lchan -> WAIT_LCHAN_READY [label="LCHAN_RTP_EV_LCHAN_READY",style=dashed] + WAIT_LCHAN_READY -> WAIT_IPACC_CRCX_ACK [label="IPACC BTS"] + WAIT_LCHAN_READY -> WAIT_READY_TO_SWITCH_RTP + WAIT_IPACC_CRCX_ACK -> WAIT_IPACC_MDCX_ACK + WAIT_IPACC_MDCX_ACK -> WAIT_READY_TO_SWITCH_RTP + invisible -> ho [label="HO DETECT",style=dashed] + ho -> WAIT_READY_TO_SWITCH_RTP [label="LCHAN_RTP_EV_READY_TO_SWITCH",style=dashed] + WAIT_READY_TO_SWITCH_RTP -> WAIT_MGW_ENDPOINT_CONFIGURED + WAIT_MGW_ENDPOINT_CONFIGURED -> mgwep [label="MDCX",style=dashed] + mgwep -> WAIT_MGW_ENDPOINT_CONFIGURED [label="LCHAN_RTP_EV_\nMGW_ENDPOINT_\nCONFIGURED",style=dashed] + WAIT_MGW_ENDPOINT_CONFIGURED -> RTP_READY + RTP_READY -> lchan2 [label="LCHAN_EV_\nRTP_READY",style=dashed] + RTP_READY -> RTP_ESTABLISHED + lchan2 -> RTP_ESTABLISHED [label="LCHAN_RTP_EV_\nRELEASE",style=dashed] + RTP_ESTABLISHED -> terminate + RTP_READY -> RTP_ROLLBACK + RTP_ROLLBACK -> terminate + terminate -> lchan2 [label="LCHAN_EV_\nRTP_RELEASED",style=dashed] + + lchan2 -> ho_as [label="XX_EV_LCHAN_\nESTABLISHED",style=dashed] + ho_as -> RTP_READY [label="LCHAN_RTP_EV_\n{ESTABLISHED,\nROLLBACK}",style=dashed] +} diff --git a/doc/lchan.msc b/doc/lchan.msc index 9b7d663..e2caa48 100644 --- a/doc/lchan.msc +++ b/doc/lchan.msc @@ -1,306 +1,216 @@ msc { hscale=2; - bts [label="MS/BTS"], bsc[label="BSC"], bsc_ts [label="BSC timeslot FSM"], - bsc_lchan[label="BSC lchan FSM"], bsc_gscon[label="BSC conn FSM"], - mgw_msc[label="MGW/MSC"]; + ms [label="MS/BTS"], ts [label="BSC timeslot FSM"], + lchan[label="BSC lchan FSM"], rtp[label="BSC lchan RTP FSM"],mgwep[label="BSC MGW endpoint FSM"]; - bts box mgw_msc [label="lchan allocation sequence"]; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_UNUSED"]; + ms box mgwep [label="lchan allocation sequence"]; + lchan abox lchan [label="LCHAN_ST_UNUSED"]; + ...; + lchan rbox lchan [label="lchan_activate(activate_info)"]; + lchan note lchan [label="Dispatching event to make sure the lchan FSM permits activation."]; + lchan -> lchan [label="LCHAN_EV_ACTIVATE\ndata = activate_info"]; + lchan abox lchan [label="LCHAN_ST_\nWAIT_TS_READY"]; + ts <- lchan [label="TS_EV_LCHAN_REQUESTED"]; + ts rbox ts [label="Most details omitted. See timeslot FSM diagrams."]; + ts note ts [label="A dyn TS may be in PDCH mode and will asynchronously switch off PDCH first. A + non-dynamic TS is ready immediately."]; + |||; + --- [label="IF requires_voice_stream"]; + lchan -> rtp [label="lchan_rtp_fsm_start()"]; + rtp abox rtp [label="allocate\n LCHAN_RTP_ST_\nWAIT_MGW_ENDPOINT_\nAVAILABLE"]; + --- [label="IF no endpoint-CI yet"]; + rtp box rtp [label="gscon_ensure_mgw_endpoint()"]; + rtp -> mgwep [label="mgw_endpoint_ci_add(to-BTS)"]; + rtp -> mgwep [label="CRCX to-BTS"]; + mgwep rbox mgwep [label="MGCP: CRCX"]; + ...; + mgwep rbox mgwep [label="MGCP: CRCX OK"]; + rtp <- mgwep [label="LCHAN_RTP_EV_MGW_ENDPOINT_AVAILABLE"]; + rtp note mgwep [label="The CRCX OK has assigned us a new endpoint CI number"]; + rtp abox rtp [label="LCHAN_RTP_ST_WAIT_LCHAN_READY"]; + --- [label="END: no endpoint-CI yet"]; + --- [label="END: requires_voice_stream"]; + |||; + ...; + ts -> lchan [label="LCHAN_EV_TS_READY"]; + lchan abox lchan [label="LCHAN_ST_\nWAIT_ACTIV_ACK"]; + --- [label="IF FOR_MS_CHANNEL_REQUEST"]; + ms <= lchan [label="RSL Chan Activ (RSL_ACT_INTRA_IMM_ASS)"]; + --- [label="ELSE: FOR_ASSIGNMENT"]; + ms <= lchan [label="RSL Chan Activ (RSL_ACT_INTRA_NORM_ASS)"]; + --- [label="ELSE: FOR_HANDOVER"]; + ms <= lchan [label="RSL Chan Activ (RSL_ACT_INTER_ASYNC)"]; + --- [label="END"]; + ...; + ms rbox lchan [label="On timeout or Chan Activ NACK, see: 'On any error', 'unrecoverable'"]; + ...; + ms => lchan [label="RSL Chan Activ ACK"]; + lchan box lchan [label="lchan_fsm_post_activ_ack()"]; - bts rbox mgw_msc [label="Channel Request from MS"]; - bts => bsc [label="RSL Channel Request"]; - bsc box bsc [label="lchan_select_by_type(chan_type)"]; - bsc -> bsc_lchan [label="lchan_activate(lchan, FOR_MS_CHANNEL_REQUEST)"]; - bsc_lchan rbox bsc_lchan [label="Continue at\nlchan_activate()\n"]; + --- [label="IF FOR_MS_CHANNEL_REQUEST"]; + ms <= lchan [label="RR Immediate Assignment"]; + --- [label="ELSE: FOR_ASSIGNMENT"]; + lchan rbox lchan [label="dispatch\nASSIGNMENT_EV_\nLCHAN_ACTIVE\n(see Assignment FSM diagrams)"]; + ms <= lchan [label="RR Assignment Command"]; + --- [label="ELSE: FOR_HANDOVER"]; + lchan rbox lchan [label="dispatch\nHO_EV_LCHAN_ACTIVE\n(see Handover FSM diagrams)"]; + --- [label="END"]; + + + lchan abox lchan [label="LCHAN_ST_WAIT_\nRLL_RTP_ESTABLISH\nT3101"]; + |||; + |||; + --- [label="IF requires_voice_stream"]; + lchan -> rtp [label="LCHAN_RTP_EV_LCHAN_READY"]; + |||; + --- [label="IF ip.access style BTS"]; + rtp abox rtp [label="LCHAN_RTP_ST_WAIT_IPACC_CRCX_ACK"]; + ms <= rtp [label="IPACC CRCX"]; + ...; + ms => rtp [label="IPACC CRCX ACK (BTS RTP port info)"]; + rtp abox rtp [label="LCHAN_RTP_ST_WAIT_IPACC_MDCX_ACK"]; + ms <= rtp [label="IPACC MDCX (MGW RTP port info)"]; + ...; + ms => rtp [label="IPACC MDCX ACK"]; + --- [label="END ip.access style BTS"]; + |||; + rtp box rtp [label="lchan_rtp_fsm_switch_rtp()"]; + |||; + --- [label="IF wait_before_switching_rtp"]; + rtp note rtp [label="During Handover, wait for HO DETECT before redirecting an existing endpoint + CI towards the new lchan."]; + rtp abox rtp [label="LCHAN_RTP_ST_WAIT_READY_TO_SWITCH_RTP"]; + ...; + ms => rtp [label="HO DETECT (via Handover FSM)"]; + --- [label="END: wait_before_switching_rtp"]; + |||; + rtp abox rtp [label="LCHAN_RTP_ST_WAIT_MGW_ENDPOINT_CONFIGURED"]; + rtp box rtp [label="connect_mgw_endpoint_to_lchan()"]; + rtp -> mgwep [label="MDCX to-BTS"]; + mgwep rbox mgwep [label="MGCP: MDCX"]; + ...; + mgwep rbox mgwep [label="MGCP: MDCX OK"]; + rtp <- mgwep [label="LCHAN_RTP_EV_MGW_ENDPOINT_CONFIGURED"]; + rtp abox rtp [label="LCHAN_RTP_ST_READY"]; + lchan <- rtp [label="LCHAN_EV_RTP_READY"]; + rtp note rtp [label="RTP FSM stays ready for Rollback until final establish event"]; + ...; + lchan -> rtp [label="LCHAN_RTP_EV_ESTABLISHED\nvia gscon_change_primary_lchan()"]; + rtp abox rtp [label="LCHAN_RTP_ST_\nESTABLISHED"]; + --- [label="END: requires_voice_stream"]; |||; |||; - bts rbox mgw_msc [label="Channel Request from BSSMAP Assignment"]; - bsc_gscon <= mgw_msc [label="BSSMAP Assignment request"]; - bsc_gscon box bsc_gscon [label="lchan_select_by_chan_mode(chan_mode)"]; - bsc_lchan <- bsc_gscon [label="lchan_activate(lchan, FOR_ASSIGNMENT)"]; - bsc_lchan rbox bsc_lchan [label="Continue at\nlchan_activate()\n"]; - |||; - |||; - - bts rbox mgw_msc [label="Channel Request from Handover Decision"]; - bsc note bsc [label="target lchan typically already chosen by Handover Decision"]; - bsc -> bsc_gscon [label="GSCON_EV_HO_START (intra-BSC)"]; - bsc_lchan <- bsc_gscon [label="lchan_activate(lchan, FOR_HANDOVER)"]; - bsc_lchan rbox bsc_lchan [label="Continue at\nlchan_activate()\n"]; - |||; - |||; - - bts rbox mgw_msc [label="Channel Request from intra-BSC-MT-Handover"]; - bsc_gscon <- mgw_msc [label="BSSMAP Handover Request"]; - bsc_gscon box bsc_gscon [label="lchan_select_by_chan_mode(chan_mode)"]; - bsc box bsc [label="lchan_activate(lchan, FOR_HANDOVER)"]; - bsc_lchan rbox bsc_lchan [label="Continue at\nlchan_activate()\n"]; - |||; - |||; - bts rbox mgw_msc [label="lchan_activate()"]; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_\nWAIT_TS_READY\n(timeout: ? s, Tnnnn)"]; - |||; - |||; - --- [label="TCH?"]; - bsc_lchan note bsc_gscon [label="This is skipped when FOR_MS_CHANNEL_REQUEST. If the MS requests - a TCH lchan, and we end up actually giving it a TCH because no SDCCH are available, we - can not set up an RTP stream because there is not even an L3 conn yet."]; - bsc_lchan note bsc_gscon [label="The lchan FSM asks the conn FSM to have an MGW endpoint ready as - early as possible. Either the conn already has such MGW endpoint from a previous lchan, - in which case it immediately replies, or it requests one from the MGW, in which case we - wait for a response in 'TCH? (2)' below."]; - bsc_lchan -> bsc_gscon [label="GSCON_EV_ENSURE_MGW_ENDPOINT"]; - --- [label="IF conn has user_plane.fi_bts in state ST_READY"]; - bsc_lchan <- bsc_gscon [label="LCHAN_EV_MGW_ENDPOINT_AVAILABLE"]; - bsc_lchan box bsc_lchan [label="mgw_endpoint_available = true"]; - bsc_lchan note bsc_lchan [label="lchan_activate() continues"]; - --- [label="ELSE (no MGW endpoint available yet)"]; - bsc_gscon => mgw_msc [label="CRCX (for BTS) via mgcp_conn_create()"]; - bsc_gscon abox bsc_gscon [label="ST_WAIT_CRCX_BTS\n(timeout: ? s, Tnnnn)"]; - bsc_lchan <- bsc_gscon [label="(event dispatch returns)"]; - bsc_lchan note bsc_lchan [label="lchan_activate() continues"]; ...; - bsc_gscon note bsc_gscon [label="async:"]; - bsc_gscon <= mgw_msc [label="CRCX OK (for BTS)"]; - bsc_lchan <- bsc_gscon [label="LCHAN_EV_MGW_ENDPOINT_AVAILABLE"]; - bsc_lchan box bsc_lchan [label="mgw_endpoint_available = true"]; - bsc_lchan note bsc_lchan [label="As soon as we reach LCHAN_ST_WAIT_MGW_ENDPOINT_AVAILABLE, this triggers - immedate action (s.b.), but until then, only the flag gets set to true."]; + ms => lchan [label="RLL Establish Ind"]; + lchan abox lchan [label="LCHAN_ST_\nESTABLISHED"]; + lchan box lchan [label="lchan_on_fully_established()"]; + --- [label="IF FOR_MS_CHANNEL_REQUEST"]; + ms note lchan [label="No action required. The MS will have sent an L3 message in the RLL + Establish Ind and is then free to dispatch DTAP."]; + --- [label="ELSE: FOR_ASSIGNMENT"]; + lchan rbox lchan [label="dispatch\nASSIGNMENT_EV_\nLCHAN_ESTABLISHED\n(see Assignment FSM diagrams)"]; + --- [label="ELSE: FOR_HANDOVER"]; + lchan rbox lchan [label="dispatch\nHO_EV_LCHAN_ESTABLISHED\n(see Handover FSM diagrams)"]; + --- [label="END"]; ...; - --- [label="CRCX timeout"]; - bsc_gscon note bsc_gscon [label="conn FSM should fire on CRCX timeout"]; - bsc_lchan <- bsc_gscon [label="LCHAN_EV_MGW_ENDPOINT_ERROR"]; - bsc_gscon note bsc_gscon [label="conn FSM should not assume anything and wait for - GSCON_EV_LCHAN_ALLOC_ERROR"]; - bsc_lchan rbox bsc_lchan [label="Do 'On any error'"]; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_UNUSED"]; - bsc_ts <- bsc_lchan [label="TS_EV_LCHAN_UNUSED"]; - --- [label="END: 'TCH?'"]; - |||; - |||; - - bsc_lchan box bsc_lchan [label="lchan_activate() exits"]; - bsc_lchan note bsc_lchan [label="still in\nlchan_request()\nLCHAN_ST_WAIT_\nTS_READY"]; - bsc_ts <- bsc_lchan [label="TS_EV_LCHAN_REQUESTED"]; + --- [label="IF requires_voice_stream"]; + lchan rbox lchan [label="Assignment or Handover FSM:"]; + lchan -> mgwep [label="CRCX/MDCX to-MSC"]; ...; - --- [label="on error from TS or timeout:"]; - bsc_ts -> bsc_lchan [label="LCHAN_EV_TS_ERROR"]; - bsc_lchan rbox bsc_lchan [label="Do 'On any error'"]; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_UNUSED"]; - bsc_ts <- bsc_lchan [label="TS_EV_LCHAN_UNUSED"]; - ---; - ...; - bsc_ts abox bsc_ts [label="TS_ST_IN_USE"]; - bsc_ts -> bsc_lchan [label="LCHAN_EV_TS_READY"]; - bsc_lchan box bsc_lchan [label="lchan_fsm_\npre_lchan_activ()"]; - - |||; - |||; - bts rbox mgw_msc [label="mode FOR_MS_CHANNEL_REQUEST"]; - bts note bsc_lchan [label="This is the simple case where the MS requested a channel, and there is no - L3 conn to the MSC; no matter if this is SDDCH or a TCH channel type, we will not prepare - an RTP stream."]; - - bsc_lchan note bsc_lchan [label="still in lchan_fsm_\npre_lchan_activ()"]; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_WAIT_\nACTIV_ACK\n(timeout: ? s, Tnnnn)"]; - bts <= bsc_lchan [label="RSL Chan Activ (RSL_ACT_INTRA_IMM_ASS)"]; - bts note bsc_lchan [label="If any errors occur from now on, we don't want to send an RR Immediate - Assignment Reject anymore."]; - bsc_lchan box bsc_lchan [label="sent_chan_activ = true"]; - ...; - --- [label="on timeout"]; - bsc_lchan rbox bsc_lchan [label="Continue at: 'On any error', 'unrecoverable'"]; - ---; - ...; - bts => bsc_lchan [label="RSL Chan Activ ACK"]; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_WAIT_\nRLL_ESTABLISH\nT3101"]; - bsc_lchan note bsc_lchan [label="Now the lchan is assigned, but has no L3 conn yet. On errors, - this will either go into graceful release or into broken state, but will not trigger any - events to a (non-existing) conn."]; - ...; - --- [label="on timeout"]; - bts <= bsc_lchan [label="RSL RF Channel Release"]; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_WAIT_RF_RELEASE_ACK\n(T?, 4s)"]; - ---; - ...; - bts => bsc_lchan [label="RLL Establish Ind"]; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_ACTIVE"]; - |||; - |||; - bts rbox mgw_msc [label="modes FOR_ASSIGNMENT and FOR_HANDOVER"]; - - bsc_lchan note bsc_lchan [label="still in lchan_fsm_\npre_lchan_activ()"]; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_WAIT_\nACTIV_ACK\n(timeout: ? s, Tnnnn)"]; - bts <= bsc_lchan [label="RSL Chan Activ (RSL_ACT_INTRA_NORM_ASS)",ID=FOR_ASSIGNMENT]; - bts <= bsc_lchan [label="RSL Chan Activ (RSL_ACT_INTER_ASYNC)",ID=FOR_HANDOVER]; - ...; - --- [label="on timeout"]; - bsc_lchan rbox bsc_lchan [label="Continue at: 'On any error', 'unrecoverable'"]; - ---; - bts => bsc_lchan [label="RSL Chan Activ ACK"]; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_WAIT_\nRLL_ESTABLISH\nT3101"]; - ...; - --- [label="on timeout"]; - bsc_lchan -> bsc_gscon [label="GSCON_EV_LCHAN_ALLOC_ERROR"]; - bsc_lchan -> bsc_lchan [label="lchan_fsm_pre_rf_release()"]; - ---; - ...; - bts => bsc_lchan [label="RLL Establish Indication"]; - |||; - - --- [label="TCH? (2)"]; - --- [label="mgw_endpoint_available == false?"]; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_WAIT_\nMGW_ENDPOINT_\nAVAILABLE"]; - bsc_lchan note bsc_lchan [label="rely on conn FSM timeout; apply only a long sanity timeout."]; - ...; - bsc_gscon <= mgw_msc [label="CRCX OK (for BTS)"]; - bsc_lchan <- bsc_gscon [label="LCHAN_EV_MGW_ENDPOINT_AVAILABLE"]; - bsc_lchan box bsc_lchan [label="mgw_endpoint_available = true"]; - bsc_lchan <- bsc_lchan [label="re-invoke lchan_fsm_pre_lchan_activ()"]; - --- [label="END: 'TCH? (2)'"]; - |||; - - --- [label="is BTS using IPA Abis? (osmo-bts, ip.access)"]; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_WAIT_\nIPACC_CRCX_ACK\n(timeout: ? s, Tnnnn)"]; - bts <= bsc_lchan [label="IPACC CRCX"]; - ...; - --- [label="on timeout"]; - bsc_lchan -> bsc_gscon [label="GSCON_EV_LCHAN_ALLOC_ERROR"]; - bsc_lchan -> bsc_lchan [label="lchan_graceful_release()"]; - ---; - ...; - bts => bsc_lchan [label="IPACC CRCX ACK"]; - bts note bsc_lchan [label="The IPACC CRCX ACK tells us what port the IPA Abis based BTS has - assigned to this lchan. AoIP: we need to forward this to the MGW (BTS side) with an MDCX; - SCCPlite: we forward this to the MSC during BSSMAP Assignment Complete (TODO: is this - correct??)"]; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_WAIT_\nIPACC_MDCX_ACK\n(timeout: ? s, Tnnnn)"]; - bts <= bsc_lchan [label="IPACC MDCX"]; - bts note bsc_lchan [label="The IPACC MDCX tells IPA Abis based BTSes the IP address and RTP port - assigned by the BTS side of the MGW. AoIP: the MGW CRCX (BTS) must thus happen before - this; SCCPlite: the RTP port is already known from the timeslot+multiplex information."]; - ...; - --- [label="on timeout"]; - bsc_lchan -> bsc_gscon [label="GSCON_EV_LCHAN_ALLOC_ERROR"]; - bsc_lchan -> bsc_lchan [label="lchan_graceful_release()"]; - ---; - ...; - bts => bsc_lchan [label="IPACC MDCX ACK"]; - --- [label="END: is BTS using IPA Abis? (osmo-bts, ip.access)"]; - |||; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_ACTIVE"]; - bsc_lchan box bsc_lchan [label="lchan_fsm_post_lchan_activ()"]; - bsc_lchan -> bsc_gscon [label="GSCON_EV_LCHAN_ACTIVE"]; - bts <= bsc_gscon [label="RR Assignment",ID="BSSMAP Assignment Request"]; - bts <= bsc_gscon [label="RR Handover Command",ID="intra-BSC HO"]; - bsc_gscon => mgw_msc [label="BSSMAP Handover\nRequest Acknowledge",ID="inter-BSC-MT HO"]; - ...; - ---[label="On error"]; - bsc_lchan rbox bsc_lchan [label="Continue at 'When the lchan is no longer used'"]; - ---; - ...; - - bts => bsc_gscon [label="RR Assignment Complete",ID="BSSMAP Assignment Request"]; - bts => bsc_gscon [label="RR Handover Detect",ID="intra-BSC HO"]; - bts => bsc_gscon [label="RR Handover Accept",ID="inter-BSC-MT HO"]; - bsc_gscon note bsc_gscon [label="conn FSM takes care of MGW endpoints for BTS side (possibly - redirect) and MSC side (possibly create). More information in e.g. assignment.msc and - handover.msc"]; + lchan <- mgwep [label="OK"]; + lchan box lchan [label="gscon_change_primary_lchan()"]; + lchan -> rtp [label="LCHAN_RTP_EV_ESTABLISHED"]; + rtp abox rtp [label="LCHAN_RTP_ST_\nESTABLISHED"]; + rtp box rtp [label="Forget any Rollback info"]; + --- [label="END: requires_voice_stream"]; ...; ...; ...; - bts rbox mgw_msc [label="When the lchan is no longer used"]; - --- [label="IF the MS or BTS release the lchan"]; - bts -> bsc_lchan [label="RLL Release Ind for SAPI=0"]; - --- [label="IF the BSC other than the conn FSM decides to release"]; - bsc -> bsc_lchan [label="LCHAN_EV_RELEASE"]; - --- [label="IF the MSC or conn FSM release the lchan"]; - bsc_lchan <- bsc_gscon [label="LCHAN_EV_RELEASE"]; - ---; - bsc note bsc_gscon [label="The LCHAN_EV_RELEASE's data pointer possibly indicates an error - cause"]; - bsc_lchan note bsc_gscon [label="If the conn FSM requested a release, it probably has already - forgotten about this lchan. However, if the MS/BTS initiated the release, make sure the conn FSM - is informed:"]; - bsc_lchan box bsc_lchan [label="lchan_graceful_release()"]; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_WAIT_\nSAPIS_RELEASED\nT3109"]; - --- [label="TCH and got as far as Chan Activ Ack?"]; - bts <= bsc_lchan [label="RSL Deactivate SACCH"]; - ---; - bts <= bsc_lchan [label="RLL Release Request (Local End)..."]; - bts <= bsc_lchan [label="...for all SAPIs except [0]"]; - |||; - --- [label="SAPI[0] in use?"]; - bsc_lchan note bsc_lchan [label="for bts->nokia.no_loc_rel_cnf we do not expect Release Confirm - messages and this state immediately advances to lchan_fsm_pre_rf_release()"]; + ms rbox mgwep [label="When the MS or BTS release the lchan"]; + lchan abox lchan [label="LCHAN_ST_\nESTABLISHED"]; + ms -> lchan [label="RLL Release Ind for SAPI=0"]; + lchan abox lchan [label="LCHAN_ST_WAIT_RLL_RTP_RELEASED"]; + lchan rbox lchan [label="Continue at 'common release' below"]; ...; - --- [label="on timeout"]; - bsc_lchan box bsc_lchan [label="Anyway try RF Channel Release, continue - with lchan_fsm_wait_before_rf_release()"]; - ---; ...; - bts => bsc_lchan [label="RLL Release Confirm..."]; - bts => bsc_lchan [label="...for each SAPI except [0]"]; - bsc_lchan box bsc_lchan [label="Stay in\nLCHAN_ST_WAIT_\nSAPIS_RELEASED\nuntil only SAPI[0] remains active"]; - --- [label="END: 'SAPI[0] in use?'"]; - |||; + ms rbox mgwep [label="When the BSC decides to release the lchan"]; + lchan box lchan [label="lchan_release()"]; + lchan abox lchan [label="LCHAN_ST_WAIT_RLL_RTP_RELEASED"]; + ms <= lchan [label="RR Release"]; + lchan rbox lchan [label="common release"]; + --- [label="IF RTP FSM present"]; + lchan -> rtp [label="LCHAN_RTP_EV_RELEASE"]; + --- [label="END: RTP FSM present"]; + ms <= lchan [label="RSL Deactivate SACCH"]; + ms <= lchan [label="RSL Release Request (Local End)",ID="for each SAPI except [0]"]; + lchan note lchan [label="for ms->nokia.no_loc_rel_cnf we do not expect Release Confirm + messages and immediately mark all SAPIs as released"]; - bsc_lchan box bsc_lchan [label="lchan_fsm_wait_before_rf_release()"]; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_WAIT_\nBEFORE_RF_RELEASE\nT3111"]; - bsc_lchan -> bsc_gscon [label="GSCON_EV_FORGET_LCHAN (data=lchan)"]; - bsc_gscon note bsc_gscon [label="conn FSM immediately forgets about the lchan"]; - bsc_gscon => mgw_msc [label="BSSMAP Clear Request?"]; ...; - bsc_lchan box bsc_lchan [label="T3111 expires"]; - bsc_lchan box bsc_lchan [label="lchan_fsm_pre_rf_release()"]; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_WAIT_\nRF_RELEASE_ACK\nT3111"]; - bsc_lchan box bsc_lchan [label="for each bsc_rll_req matching this lchan: disable timer, call - cb(BSC_RLLR_IND_REL_IND)"]; - bts <= bsc_lchan [label="RSL RF Channel Release"]; + lchan <- rtp [label="LCHAN_EV_RTP_RELEASED"]; ...; - --- [label="on timeout"]; - bsc_lchan rbox bsc_lchan [label="Continue at: 'On any error', 'unrecoverable'"]; - ---; + ms => lchan [label="RLL Release Confirm",ID="for each SAPI except [0]"]; ...; - bts => bsc_lchan [label="RSL RF Channel Release Ack"]; - - bsc_lchan box bsc_lchan [label="lchan_fsm_post_rf_release()"]; + lchan box lchan [label="Stay in\nLCHAN_ST_WAIT_\nRLL_RTP_RELEASED\nuntil only SAPI[0] remains active"]; + lchan abox lchan [label="LCHAN_ST_WAIT_\nBEFORE_RF_RELEASE\nT3111"]; + ...; + lchan box lchan [label="T3111 expires"]; + lchan box lchan [label="lchan_fsm_pre_rf_release()"]; + lchan abox lchan [label="LCHAN_ST_WAIT_\nRF_RELEASE_ACK\nT3111"]; + ms <= lchan [label="RSL RF Channel Release"]; + ...; + lchan rbox lchan [label="On timeout, continue at: 'On any error', 'unrecoverable'"]; + ...; + ms => lchan [label="RSL RF Channel Release Ack"]; |||; - --- [label="IF an error cause was indicated on LCHAN_EV_RELEASE"]; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_WAIT_\nAFTER_ERROR\n(timeout: T3111+2 s, T?)"]; + --- [label="IF release_in_error"]; + lchan abox lchan [label="LCHAN_ST_WAIT_\nAFTER_ERROR\n(timeout: T3111+2 s, T993111)"]; ...; - bsc_lchan box bsc_lchan [label="timer expires"]; - --- [label="END: 'an error cause was indicated on LCHAN_EV_RELEASE'"]; + lchan box lchan [label="timer expires"]; + --- [label="END: release_in_error"]; |||; - bsc_lchan box bsc_lchan [label="lchan_fsm_release_complete()"]; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_UNUSED"]; - bsc_ts <- bsc_lchan [label="TS_EV_LCHAN_UNUSED"]; - bsc_ts abox bsc_ts [label="TS_ST_UNUSED"]; + lchan abox lchan [label="LCHAN_ST_UNUSED"]; + ts <- lchan [label="TS_EV_LCHAN_UNUSED"]; + |||; |||; |||; - bts rbox mgw_msc [label="On any error"]; + ms rbox mgwep [label="On any error"]; |||; - --- [label="IF FOR_MS_CHANNEL_REQUEST && !sent_chan_activ"]; - bts <= bsc_lchan [label="RR Immediate Assign Reject"]; + --- [label="IF FOR_MS_CHANNEL_REQUEST"]; + ms <= lchan [label="RR Immediate Assign Reject"]; + --- [label="ELSE: FOR_ASSIGNMENT"]; + lchan rbox lchan [label="dispatch\nASSIGNMENT_EV_\nLCHAN_ERROR\n(see Assignment FSM diagrams)"]; + --- [label="ELSE: FOR_HANDOVER"]; + lchan rbox lchan [label="dispatch\nHO_EV_LCHAN_ERROR\n(see Handover FSM diagrams)"]; + --- [label="END"]; |||; - --- [label="IF FOR_ASSIGNMENT or FOR_HANDOVER"]; - bsc_lchan -> bsc_gscon [label="GSCON_EV_LCHAN_ALLOC_ERROR"]; - bsc_gscon note bsc_gscon [label="conn FSM shall immediately 'forget' the lchan"]; - bsc_gscon => mgw_msc [label="BSSMAP\nAssignment Failure",ID=FOR_ASSIGNMENT]; - bsc_gscon => mgw_msc [label="BSSMAP\nHandover Failure",ID="inter-BSC-MT HO"]; - ---; + --- [label="IF fi_rtp present"]; + lchan -> rtp [label="LCHAN_RTP_EV_ROLLBACK"]; + rtp rbox rtp [label="If to-BTS is not established yet, ROLLBACK is synonymous to LCHAN_RTP_EV_RELEASE"]; + rtp rbox rtp [label="If there is no old_lchan, just DLCX instead"]; + rtp abox rtp [label="LCHAN_RTP_ST_ROLLBACK"]; + rtp box rtp [label="connect_mgw_endpoint_to_lchan()\nusing old_lchan"]; + rtp -> mgwep [label="MDCX to-BTS"]; + mgwep rbox mgwep [label="MGCP: MDCX"]; + ...; + mgwep rbox mgwep [label="MGCP: MDCX OK"]; + rtp <- mgwep [label="LCHAN_RTP_EV_MGW_ENDPOINT_CONFIGURED"]; + rtp abox rtp [label="terminate"]; + lchan <- rtp [label="LCHAN_EV_RTP_RELEASED"]; + --- [label="END: fi_rtp present"]; + |||; |||; --- [label="IF unrecoverable error"]; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_BORKEN"]; - bsc_lchan note bsc_lchan [label="The broken state usually stays around + lchan abox lchan [label="LCHAN_ST_BORKEN"]; + ms note lchan [label="The broken state usually stays around until the BTS disconnects."]; ...; - bts note bsc_lchan [label="If an ACK comes in late, for specific BTS models, we may choose to + ms note lchan [label="If an ACK comes in late, for specific BTS models, we may choose to 'repair' the lchan so that it is usable again."]; - bts -> bsc_lchan [label="Chan Release ACK"]; - bsc_lchan -> bsc_lchan [label="lchan_fsm_post_rf_release()"]; + ms -> lchan [label="RF Chan Release ACK"]; + lchan rbox lchan [label="continue above at\nLCHAN_ST_WAIT_\nAFTER_ERROR"]; } diff --git a/doc/legend_for_fsm_diagrams.dot b/doc/legend_for_fsm_diagrams.dot new file mode 100644 index 0000000..732a894 --- /dev/null +++ b/doc/legend_for_fsm_diagrams.dot @@ -0,0 +1,24 @@ +digraph G { +rankdir=TB +labelloc=t; label="LEGEND FOR FSM GRAPHS" + + box [label="function_call()\nputs FSM into state",shape="box"] + STATE [label="FSM_STATE"] + STATE2 [label="FSM_STATE"] + STATE3 [label="FSM_STATE"] + box -> STATE + STATE -> STATE2 [label="state transition"] + STATE2 -> STATE3 + + STATE -> STATE3 [label="transition\non error",style=dashed] + + other [label="other FSM\ninstance\nor remote program",shape=box3d] + STATE2 -> other [label="event",style=dotted] + other -> STATE2 [label="event",style=dotted] + + terminate [shape=octagon] + STATE3 -> terminate + + err [label="common error\ntransition",shape=box,style=dashed] + err -> STATE3 [style=dashed] +} diff --git a/doc/legend_for_ladder_diagrams.msc b/doc/legend_for_ladder_diagrams.msc new file mode 100644 index 0000000..a581fe4 --- /dev/null +++ b/doc/legend_for_ladder_diagrams.msc @@ -0,0 +1,29 @@ +msc { + A [label="FSM instance"],B [label="FSM instance"], C [label="remote program"]; + |||; + ||| [label="LADDER DIAGRAM LEGEND"]; + |||; + + A rbox C [label="Group Heading"]; + + A box A [label="function call or action"]; + A -> B [label="event within program"]; + B abox B [label="enter FSM state"]; + B => C [label="network protocol message"]; + ...; + ... [label="asynchronous wait time"]; + ...; + B <= C [label="network protocol message"]; + |||; + ||| [label="continue synchronously"]; + |||; + A <- B [label="event within program"]; + A rbox A [label="flow detail: 'continue at...'"]; + ...; + ...; + --- [label="IF conditional"]; + ||| [label="..."]; + --- [label="END: conditional"]; + ...; + B note B [label="arbitrary prose"]; +} diff --git a/doc/mgw-endpoint-fsm.dot b/doc/mgw-endpoint-fsm.dot new file mode 100644 index 0000000..ac7c2bf --- /dev/null +++ b/doc/mgw-endpoint-fsm.dot @@ -0,0 +1,24 @@ +digraph G { +rankdir=TB +labelloc=t; label="MGW Endpoint FSM" + + gscon_ensure_mgw_endpoint [label="gscon_ensure_mgw_endpoint()",shape="box"] + UNUSED + WAIT_MGW_RESPONSE + IN_USE + terminate [shape=octagon] + mgcp [label="mgcp client FSM\n(libosmo-mgcp-client)",shape=box3d] + notify [label="notify target FI",shape=box3d] + gscon [label="parent FI\n(gscon)",shape=box3d] + + gscon_ensure_mgw_endpoint -> UNUSED + UNUSED -> WAIT_MGW_RESPONSE [label="first\nmgw_endpoint_ci_request(CRCX)"] + WAIT_MGW_RESPONSE -> mgcp [label="mgcp_conn_create()\nmgcp_conn_modify()\nmgcp_conn_delete()",style=dotted] + mgcp -> WAIT_MGW_RESPONSE [label="CI[i] event",style=dotted] + WAIT_MGW_RESPONSE -> IN_USE + IN_USE -> notify [label="notify event for\nindividual CI request",style=dotted] + IN_USE -> WAIT_MGW_RESPONSE [label="additional\nmgw_endpoint_ci_request()\nCRCX,MDCX,DLCX"] + + WAIT_MGW_RESPONSE -> terminate [label="all CI DLCX'd"] + terminate -> gscon [label="GSCON_EV_FORGET_MGW_ENDPOINT",style=dotted] +} diff --git a/doc/mgw-endpoint.msc b/doc/mgw-endpoint.msc new file mode 100644 index 0000000..7084d1d --- /dev/null +++ b/doc/mgw-endpoint.msc @@ -0,0 +1,105 @@ +msc { + hscale=2; + notify [label="calling FSM"], mgwep[label="MGW endpoint FSM"], mgcp[label="mgcp client FSM"], + mgw[label="MGW"]; + + notify note mgw [label="MGW endpoint FSM\nmanages multiple CI for one endpoint"]; + + |||; + + notify rbox notify [label="conn FSM"]; + notify box notify [label="gscon_ensure_mgw_endpoint()"]; + notify -> mgwep [label="mgw_endpoint_alloc()"]; + mgwep abox mgwep [label="MGWEP_ST_UNUSED"]; + + ...; + ...; + ...; + notify rbox mgw [label="CRCX"]; + + notify rbox notify [label="lchan RTP FSM"]; + notify -> mgwep [label="mgw_endpoint_ci_add()"]; + mgwep note mgwep [label="Return an unassigned endpoint CI slot in the local array"]; + ...; + mgwep note mgwep [label="First request on a CI must be a CRCX"]; + notify -> mgwep [label="mgw_endpoint_ci_request(CRCX)"]; + notify note mgwep [label="verb=CRCX\nverb_info='rtpbridge/*@mgw'\nnotify_event"]; + mgwep box mgwep [label="CI[x].pending=true"]; + mgwep abox mgwep [label="MGWEP_ST_WAIT_MGW_RESPONSE"]; + |||; + notify note mgwep [label="If more mgw_endpoint_ci_request() are triggered, they will be set to + 'pending' and wait until all ongoing requests are through and MGWEP_ST_IN_USE is + reached."]; + |||; + mgwep box mgwep [label="for each pending CI:\nsend_verb()"]; + mgwep -> mgcp [label="CI[x]: mgcp_conn_create()"]; + mgwep note mgcp [label="Each CI[i] has two events from the FSM instance event range assigned, one + for success, one for failure. These are passed to the mgcp client FSM."]; + mgcp => mgw [label="CRCX"]; + ...; + mgcp <= mgw [label="CRCX OK"]; + mgcp note mgw [label="MGW returns:\n'rtpbridge/123 at mgw',\nnew CI identifier '123abc',\n + MGW side RTP IP:port"]; + mgwep <- mgcp [label="CI[x] success event"]; + mgwep box mgwep [label="on_success(CI[x])"]; + mgwep note mgwep [label="CI[x].rtp_info = IP:port\nmgcp_ci_str = '123abc'\n + endpoint name = 'rtpbridge/123 at mgw'"]; + notify <- mgwep [label="notify_event from mgw_endpoint_ci_request()"]; + notify note mgwep [label="notify_event will be one of:\n + LCHAN_RTP_EV_MGW_ENDPOINT_AVAILABLE (towards BTS)\n + ASSIGNMENT_EV_MSC_MGW_OK (towards MSC)\n + HO_EV_MSC_MGW_OK (towards MSC)"]; + mgwep abox mgwep [label="MGWEP_ST_IN_USE"]; + + ...; + ...; + ...; + notify rbox mgw [label="MDCX"]; + + mgwep note mgwep [label="Second or later request on a CI must be MDCX or DLCX"]; + notify -> mgwep [label="mgw_endpoint_ci_request(MDCX)"]; + notify note mgwep [label="verb=MDCX\nverb_info=BTS RTP IP:port\n + automatic: full endpoint name as from CRCX OK\n + notify_event\n"]; + mgwep box mgwep [label="CI[x].pending=true"]; + mgwep abox mgwep [label="MGWEP_ST_WAIT_MGW_RESPONSE"]; + mgwep box mgwep [label="for each pending CI:\nsend_verb()"]; + mgwep -> mgcp [label="CI[x]: mgcp_conn_modify()"]; + mgcp => mgw [label="MDCX"]; + ...; + mgcp <= mgw [label="MDCX OK"]; + mgwep <- mgcp [label="CI[x] success event"]; + mgwep box mgwep [label="on_success(CI[x])"]; + notify <- mgwep [label="notify_event from mgw_endpoint_ci_request()"]; + notify note mgwep [label="notify_event will be one of:\n + LCHAN_RTP_EV_MGW_ENDPOINT_CONFIGURED (towards BTS)\n + ASSIGNMENT_EV_MSC_MGW_OK (towards MSC)\n + HO_EV_MSC_MGW_OK (towards MSC)"]; + mgwep abox mgwep [label="MGWEP_ST_IN_USE"]; + + ...; + ...; + ...; + notify rbox mgw [label="DLCX"]; + + notify -> mgwep [label="mgw_endpoint_ci_dlcx()"]; + mgwep box mgwep [label="mgw_endpoint_ci_request(DLCX)"]; + mgwep box mgwep [label="CI[x].pending=true"]; + mgwep abox mgwep [label="MGWEP_ST_WAIT_MGW_RESPONSE"]; + mgwep box mgwep [label="for each pending CI:\nsend_verb()"]; + mgwep -> mgcp [label="CI[x]: mgcp_conn_delete()"]; + mgcp => mgw [label="DLCX"]; + mgcp box mgcp [label="detach from parent fi"]; + mgwep box mgwep [label="forget and clear CI[x]"]; + --- [label="IF other CI remain valid"]; + mgwep abox mgwep [label="MGWEP_ST_IN_USE"]; + --- [label="IF no CI remain on endpoint"]; + mgwep abox mgwep [label="terminate"]; + notify rbox notify [label="conn FSM"]; + notify <- mgwep [label="GSCON_EV_FORGET_MGW_ENDPOINT"]; + ---; + ...; + mgcp <= mgw [label="DLCX OK"]; + mgcp abox mgcp [label="terminate"]; + +} diff --git a/doc/ms-channel-request.msc b/doc/ms-channel-request.msc deleted file mode 100644 index 1c5b4bf..0000000 --- a/doc/ms-channel-request.msc +++ /dev/null @@ -1,59 +0,0 @@ -msc { - hscale=2; - ms [label="MS"], bts [label="BTS"], bsc[label="BSC"], bsc_lchan[label="BSC lchan FSM"]; - - ms note bsc_lchan [label="lchan allocation sequence for RSL Channel Request"]; - - ms => bts [label="RR Channel Request"]; - bts => bsc [label="RSL Channel Request"]; - bsc box bsc [label="rsl_rx_chan_rqd()"]; - bsc note bsc [label="Obtain RACH data from Request: - Reference - Access Delay (TA) - - Request Reason - Channel Type"]; - bsc note bsc [label="If the reason is PDCH, the RACH Request is forwarded to PCU and BSC is no - longer concerned (rsl_rx_pchan_rqd())."]; - bsc note bsc [label="Always try to allocate an SDCCH regardless of the requested type, only if no - SDCCH is available, look for the actually requested channel type."]; - bsc box bsc [label="lchan_select_by_type(SDCCH)"]; - - --- [label="IF no lchan is available (neither SDCCH nor requested type)"]; - bsc note bsc [label="Figure out T3122 value from bts->T3122, network->T3122 or - GSM_T3122_DEFAULT"]; - bsc box bsc [label="rsl_send_imm_ass_rej(wait_ind=T3122)"]; - bsc note bsc [label="..."]; - bts <= bsc [label="RR Immediate Assign Reject"]; - ms <= bts [label="RR Immediate Assign Reject (possibly grouped with up to 4 others)"]; - bsc note bsc [label="rsl_rx_pchan_rqd() exits, no channel is allocated."]; - --- [label="END: no lchan is available"]; - - bsc box bsc [label="Store RACH data in lchan->rqd_ref, rqd_ta"]; - bsc -> bsc_lchan [label="lchan_allocate(FOR_MS_CHANNEL_REQUEST)"]; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_WAIT_ACTIV_ACK\nT3103"]; - bsc_lchan note bsc_lchan [label="The lchan FSM knows that FOR_MS_CHANNEL_REQUEST is about - Immediate Assignment."]; - bts <= bsc_lchan [label="RSL Chan Activ (Immediate Assignment)"]; - ...; - --- [label="on any error"]; - bts <= bsc_lchan [label="RR Immediate Assign Reject"]; - ms <= bts [label="RR Immediate Assign Reject (possibly grouped with up to 4 others)"]; - ---; - ...; - bts => bsc_lchan [label="RSL Chan Activ ACK"]; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_WAIT_\nRLL_ESTABLISH\ncontinue T3103"]; - ...; - --- [label="on timeout"]; - bsc_lchan box bsc_lchan [label="lchan_error_release(deact_sacch=true)"]; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_WAIT_RF_RELEASE_ACK"]; - bts <= bsc_lchan [label="RLL Release Request (Local End)..."]; - bts <= bsc_lchan [label="...for all SAPIs including [0]"]; - bts <= bsc_lchan [label="RSL Deactivate SACCH"]; - bts <= bsc_lchan [label="RSL RF Channel Release"]; - ...; - bts => bsc_lchan [label="RSL RF Channel Release ACK"]; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_WAIT_AFTER_ERROR"]; - ...; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_UNUSED"]; - ---; - ms => bsc_lchan [label="RLL Establish Ind"]; - bsc_lchan box bsc_lchan [label="associate lchan FSM with new conn FSM"]; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_ACTIVE"]; -} diff --git a/doc/timeslot-fsm.dot b/doc/timeslot-fsm.dot index 79e56c9..95a4e1f 100644 --- a/doc/timeslot-fsm.dot +++ b/doc/timeslot-fsm.dot @@ -1,10 +1,11 @@ digraph G { -rankdir=TB; +rankdir=TB +labelloc=t; label="Timeslot FSM" invisible [style="invisible"] invisible2 [style="invisible"] NOT_INITIALIZED - lchan [label="lchan FSM",shape=box3d]; + lchan [label="lchan FSM",shape=box3d] UNUSED IN_USE BORKEN diff --git a/doc/timeslot.msc b/doc/timeslot.msc index 9a8c360..02e7bb3 100644 --- a/doc/timeslot.msc +++ b/doc/timeslot.msc @@ -1,25 +1,24 @@ msc { - hscale=2; bts [label="MS/BTS"], bsc[label="BSC"], bsc_ts[label="BSC timeslot FSM"], bsc_lchan[label="BSC lchan FSM"]; - bsc_ts abox bsc_ts [label="NOT_INITIALIZED (no timeout)"]; + bsc_ts abox bsc_ts [label="NOT_INITIALIZED"]; ...; bsc note bsc_ts [label="OML and RSL may be established in any order"]; bts => bsc_ts [label="OML: Channel OPSTART ACK"]; bsc -> bsc_ts [label="RSL bootstrapped"]; - bsc_ts abox bsc_ts [label="UNUSED (no timeout)"]; + bsc_ts abox bsc_ts [label="UNUSED"]; |||; bts rbox bsc_lchan [label="UNUSED, onenter"]; bsc_ts abox bsc_ts [label="UNUSED"]; --- [label="GPRS enabled?"]; --- [label="IF: dedicated PDCH?"]; - bsc_ts abox bsc_ts [label="PDCH (no timeout)"]; + bsc_ts abox bsc_ts [label="PDCH"]; |||; --- [label="IF: dynamic timeslot"]; - bsc_ts abox bsc_ts [label="WAIT_PDCH_ACT (?s, Tnnnn)"]; + bsc_ts abox bsc_ts [label="WAIT_PDCH_ACT (4s, T23001)"]; bts <= bsc_ts [label="RSL Chan Activ of PDCH",ID="Osmocom style"]; bts <= bsc_ts [label="RSL PDCH Act",ID="ip.access style"]; ...; @@ -29,7 +28,7 @@ ...; bts => bsc_ts [label="RSL RF Chan Activ ACK",ID="Osmocom style"]; bts => bsc_ts [label="RSL PDCH Act ACK",ID="ip.access style"]; - bsc_ts abox bsc_ts [label="PDCH (no timeout)"]; + bsc_ts abox bsc_ts [label="PDCH"]; --- [label="END: GPRS enabled?"]; ...; @@ -43,12 +42,14 @@ bts <= bsc_lchan [label="RSL Chan Activ (and so on)"]; ...; bts rbox bsc_lchan [label="IN_USE, second lchan"]; + bsc_ts abox bsc_ts [label="IN_USE"]; bsc_ts <- bsc_lchan [label="TS_EV_LCHAN_REQUESTED (data=lchan)"]; bsc_ts -> bsc_lchan [label="LCHAN_EV_TS_READY"]; bts <= bsc_lchan [label="RSL Chan Activ (and so on)"]; ...; ...; bts rbox bsc_lchan [label="IN_USE, when lchan FSM releases (both regularly, or due to error)"]; + bsc_ts abox bsc_ts [label="IN_USE"]; bsc_ts <- bsc_lchan [label="TS_EV_LCHAN_UNUSED (data=lchan)"]; --- [label="IF all lchan->fi->state == LCHAN_ST_UNUSED"]; bsc_ts abox bsc_ts [label="UNUSED"]; @@ -57,13 +58,14 @@ ...; - bts rbox bsc_lchan [label="PDCH on lchan request"]; + bts rbox bsc_lchan [label="PDCH, on lchan request"]; bsc_ts note bsc_lchan [label="TS_EV_LCHAN_REQUESTED should only come in on lchans where it makes sense, both from TS kind as well as not conflicting with other users of the lchan."]; + bsc_ts abox bsc_ts [label="PDCH"]; bsc_ts <- bsc_lchan [label="TS_EV_LCHAN_REQUESTED"]; - bsc_ts abox bsc_ts [label="WAIT_PDCH_DEACT (?s, Tnnnn)"]; + bsc_ts abox bsc_ts [label="WAIT_PDCH_DEACT (4s, T23001)"]; bts <= bsc_ts [label="RSL RF Chan Release of PDCH",ID="Osmocom style"]; bts <= bsc_ts [label="RSL PDCH Deact",ID="ip.access style"]; ...; diff --git a/doc/ts-and-lchan-fsm-lifecycle.msc b/doc/ts-and-lchan-fsm-lifecycle.msc index 79d32c5..9275f1f 100644 --- a/doc/ts-and-lchan-fsm-lifecycle.msc +++ b/doc/ts-and-lchan-fsm-lifecycle.msc @@ -55,7 +55,7 @@ --- [label="dyn TS"]; bsc_ts box bsc_ts [label="onenter of TS_ST_UNUSED:"]; bsc_ts abox bsc_ts [label="TS_ST_WAIT_PDCH_ACT"]; - ...; + ... [label="..."]; bsc_ts abox bsc_ts [label="PDCH"]; --- [label="END: dyn TS"]; --- [label="END: OML and RSL ready"]; @@ -65,13 +65,13 @@ bsc_lchan -> bsc_ts [label="TS_EV_LCHAN_REQUESTED"]; --- [label="dyn TS"]; - bsc_ts note bsc_ts [label="possibly switch from PDCH...\n(see timeslot FSM)"]; + bsc_ts rbox bsc_ts [label="possibly switch from PDCH...\n(see timeslot FSM)"]; bsc_ts box bsc_ts [label="ts->pchan =\n requested GSM_PCHAN_XXX type"]; ---; bsc_ts -> bsc_lchan [label="LCHAN_EV_TS_READY"]; bsc_lchan note bsc_lchan [label="RSL Chan Alloc and so fort..."]; - bsc_lchan abox bsc_lchan [label="LCHAN_ST_ACTIVE"]; + bsc_lchan abox bsc_lchan [label="LCHAN_ST_ESTABLISHED"]; ...; bsc -> bsc_lchan [label="LCHAN_EV_RELEASE"]; bsc_lchan note bsc_lchan [label="...RSL RF Chan Release..."]; @@ -79,7 +79,7 @@ bsc_ts <- bsc_lchan [label="TS_EV_LCHAN_UNUSED"]; bsc_ts abox bsc_ts [label="TS_ST_UNUSED"]; --- [label="dyn TS"]; - bsc_ts note bsc_ts [label="possibly switch to PDCH"]; + bsc_ts rbox bsc_ts [label="possibly switch to PDCH"]; ---; ...; ...; @@ -88,8 +88,8 @@ bsc -> bsc_ts [label="ts[*]:"]; bsc_ts abox bsc_ts [label="TS_ST_NOT_INITIALIZED"]; bsc_ts note bsc_lchan [label="If it's just the RSL being dropped, transition lchan FSMs to - LCHAN_ST_UNUSED, but keep them allocated. Unless OML is re-established, any vty pchan - modifications must not take effect."]; + LCHAN_ST_UNUSED, but keep them allocated. Unless OML is re-established, any telnet + vty pchan modifications must not take effect."]; bsc_ts -> bsc_lchan [label="lchan[*]:"]; bsc_lchan abox bsc_lchan [label="LCHAN_ST_UNUSED"]; bsc_ts <- bsc_lchan [label="TS_EV_LCHAN_UNUSED (ignored)"]; -- To view, visit https://gerrit.osmocom.org/9667 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I29e31b753e23a4207662e0e385a337e7df836f45 Gerrit-Change-Number: 9667 Gerrit-PatchSet: 15 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 10:43:54 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 28 Jul 2018 10:43:54 +0000 Subject: Change in osmo-bsc[master]: fix / clarify rsl dtap cache In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/9668 ) Change subject: fix / clarify rsl dtap cache ...................................................................... fix / clarify rsl dtap cache In certain situations like handover or assignment, DTAP must not go out via RSL directly but is cached to be submitted later. Make sure that all RSL DTAP sending adheres to this: gscon_submit_rsl_dtap() is the new "public" API to request an RSL DTAP to be sent. Depending on the gscon's state, this ends up in the cache or is sent directly. When caching, there is no way to tell whether sending will succeed or not, so semantically it does not make sense to even return a result code. Just return void. Change all "public" callers to gscon_submit_rsl_dtap(). Merge gsm0808_submit_dtap() and submit_dtap() guts to gsm0808_send_rsl_dtap(), static in bsc_subscr_conn_fsm.c: directly send DTAP, assume a conn->lchan to be present, or otherwise trigger a BSSMAP Clear Request. The static submit_dtap() becomes a thin convenience wrapper. Move ho_dtap_cache* functions to bsc_subscr_conn_fsm.c and rename to gscon_dtap_cache_* -- they are not only for handover, also for assignment. Function gsm0808_submit_dtap() m Introduce function gscon_submit_rsl_dtap() Change-Id: I6ffd7aa641c8905292c769400048c96aa0949585 --- M include/osmocom/bsc/bsc_subscr_conn_fsm.h M include/osmocom/bsc/gsm_data.h M src/osmo-bsc/bsc_api.c M src/osmo-bsc/bsc_init.c M src/osmo-bsc/bsc_subscr_conn_fsm.c M src/osmo-bsc/gsm_04_08_utils.c M src/osmo-bsc/gsm_04_80_utils.c M src/osmo-bsc/osmo_bsc_api.c M tests/bsc/bsc_test.c 9 files changed, 186 insertions(+), 161 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmocom/bsc/bsc_subscr_conn_fsm.h b/include/osmocom/bsc/bsc_subscr_conn_fsm.h index 9e56f6b..70fce32 100644 --- a/include/osmocom/bsc/bsc_subscr_conn_fsm.h +++ b/include/osmocom/bsc/bsc_subscr_conn_fsm.h @@ -67,8 +67,13 @@ struct gsm_subscriber_connection; struct gsm_network; struct mgcp_conn_peer; +struct msgb; /* Allocate a subscriber connection and its associated FSM */ struct gsm_subscriber_connection *bsc_subscr_con_allocate(struct gsm_network *net); void bsc_subscr_pick_codec(struct mgcp_conn_peer *conn_peer, struct gsm_subscriber_connection *conn); + +void gscon_submit_rsl_dtap(struct gsm_subscriber_connection *conn, + struct msgb *msg, int link_id, int allow_sacch); +void gscon_dtap_queue_flush(struct gsm_subscriber_connection *conn, int send); diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index a16a4b7..2872493 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -119,9 +119,9 @@ /* buffer/cache for classmark of the ME of the subscriber */ struct gsm_classmark classmark; - /* Cache DTAP messages during handover/assignment (msgb_enqueue()/msgb_dequeue())*/ - struct llist_head ho_dtap_cache; - unsigned int ho_dtap_cache_len; + /* Queue DTAP messages during handover/assignment (msgb_enqueue()/msgb_dequeue())*/ + struct llist_head dtap_queue; + unsigned int dtap_queue_len; struct { int failures; diff --git a/src/osmo-bsc/bsc_api.c b/src/osmo-bsc/bsc_api.c index 4cf11a4..35e6977 100644 --- a/src/osmo-bsc/bsc_api.c +++ b/src/osmo-bsc/bsc_api.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -41,10 +42,6 @@ #define GSM0808_T10_VALUE 6, 0 -#define HO_DTAP_CACHE_MSGB_CB_LINK_ID 0 -#define HO_DTAP_CACHE_MSGB_CB_ALLOW_SACCH 1 - -static void rll_ind_cb(struct gsm_lchan *, uint8_t, void *, enum bsc_rllr_ind); static void handle_release(struct gsm_subscriber_connection *conn, struct gsm_lchan *lchan); static void handle_chan_ack(struct gsm_subscriber_connection *conn, struct gsm_lchan *lchan); static void handle_chan_nack(struct gsm_subscriber_connection *conn, struct gsm_lchan *lchan); @@ -116,97 +113,6 @@ return 0; } -static void ho_dtap_cache_add(struct gsm_subscriber_connection *conn, struct msgb *msg, - int link_id, bool allow_sacch) -{ - if (conn->ho_dtap_cache_len >= 23) { - LOGP(DHO, LOGL_ERROR, "%s: Cannot cache more DTAP messages," - " already reached sane maximum of %u cached messages\n", - bsc_subscr_name(conn->bsub), conn->ho_dtap_cache_len); - msgb_free(msg); - return; - } - conn->ho_dtap_cache_len ++; - LOGP(DHO, LOGL_DEBUG, "%s: Caching DTAP message during ho/ass (%u)\n", - bsc_subscr_name(conn->bsub), conn->ho_dtap_cache_len); - msg->cb[HO_DTAP_CACHE_MSGB_CB_LINK_ID] = (unsigned long)link_id; - msg->cb[HO_DTAP_CACHE_MSGB_CB_ALLOW_SACCH] = allow_sacch ? 1 : 0; - msgb_enqueue(&conn->ho_dtap_cache, msg); -} - -void ho_dtap_cache_flush(struct gsm_subscriber_connection *conn, int send) -{ - struct msgb *msg; - unsigned int flushed_count = 0; - - if (conn->secondary_lchan || conn->ho) { - LOGP(DHO, LOGL_ERROR, "%s: Cannot send cached DTAP messages, handover/assignment is still ongoing\n", - bsc_subscr_name(conn->bsub)); - send = 0; - } - - while ((msg = msgb_dequeue(&conn->ho_dtap_cache))) { - conn->ho_dtap_cache_len --; - flushed_count ++; - if (send) { - int link_id = (int)msg->cb[HO_DTAP_CACHE_MSGB_CB_LINK_ID]; - bool allow_sacch = !!msg->cb[HO_DTAP_CACHE_MSGB_CB_ALLOW_SACCH]; - LOGP(DHO, LOGL_DEBUG, "%s: Sending cached DTAP message after handover/assignment (%u/%u)\n", - bsc_subscr_name(conn->bsub), flushed_count, conn->ho_dtap_cache_len); - gsm0808_submit_dtap(conn, msg, link_id, allow_sacch); - } else - msgb_free(msg); - } -} - -/*! \brief process incoming 08.08 DTAP from MSC (send via BTS to MS) */ -int gsm0808_submit_dtap(struct gsm_subscriber_connection *conn, - struct msgb *msg, int link_id, int allow_sacch) -{ - uint8_t sapi; - - - if (!conn->lchan) { - LOGP(DMSC, LOGL_ERROR, - "%s Called submit dtap without an lchan.\n", - bsc_subscr_name(conn->bsub)); - msgb_free(msg); - return -1; - } - - /* buffer message during assignment / handover */ - if (conn->secondary_lchan || conn->ho) { - ho_dtap_cache_add(conn, msg, link_id, !! allow_sacch); - return 0; - } - - sapi = link_id & 0x7; - msg->lchan = conn->lchan; - msg->dst = msg->lchan->ts->trx->rsl_link; - - /* If we are on a TCH and need to submit a SMS (on SAPI=3) we need to use the SACH */ - if (allow_sacch && sapi != 0) { - if (conn->lchan->type == GSM_LCHAN_TCH_F || conn->lchan->type == GSM_LCHAN_TCH_H) - link_id |= 0x40; - } - - msg->l3h = msg->data; - /* is requested SAPI already up? */ - if (conn->lchan->sapis[sapi] == LCHAN_SAPI_UNUSED) { - /* Establish L2 for additional SAPI */ - OBSC_LINKID_CB(msg) = link_id; - if (rll_establish(msg->lchan, sapi, rll_ind_cb, msg) != 0) { - msgb_free(msg); - bsc_sapi_n_reject(conn, link_id); - return -1; - } - return 0; - } else { - /* Directly forward via RLL/RSL to BTS */ - return rsl_data_request(msg, link_id); - } -} - /* * \brief Check if the given channel is compatible with the mode/fullrate */ @@ -316,7 +222,7 @@ /* FIXME: release old channel */ /* send pending messages, if any */ - ho_dtap_cache_flush(conn, 1); + gscon_dtap_queue_flush(conn, 1); return; } @@ -332,7 +238,7 @@ conn->secondary_lchan = NULL; /* send pending messages, if any */ - ho_dtap_cache_flush(conn, 1); + gscon_dtap_queue_flush(conn, 1); if (is_ipaccess_bts(conn_get_bts(conn)) && conn->lchan->tch_mode != GSM48_CMODE_SIGN) rsl_ipacc_crcx(conn->lchan); @@ -359,7 +265,7 @@ /* FIXME: release allocated new channel */ /* send pending messages, if any */ - ho_dtap_cache_flush(conn, 1); + gscon_dtap_queue_flush(conn, 1); return; } @@ -377,7 +283,7 @@ } /* send pending messages, if any */ - ho_dtap_cache_flush(conn, 1); + gscon_dtap_queue_flush(conn, 1); gh = msgb_l3(msg); if (msgb_l3len(msg) - sizeof(*gh) != 1) { @@ -443,7 +349,7 @@ /* FIXME: release old channel */ /* send pending messages, if any */ - ho_dtap_cache_flush(msg->lchan->conn, 1); + gscon_dtap_queue_flush(msg->lchan->conn, 1); } /* Chapter 9.1.17 Handover Failure */ @@ -465,7 +371,7 @@ /* FIXME: release allocated new channel */ /* send pending messages, if any */ - ho_dtap_cache_flush(msg->lchan->conn, 1); + gscon_dtap_queue_flush(msg->lchan->conn, 1); } @@ -643,31 +549,6 @@ return 0; } -static void rll_ind_cb(struct gsm_lchan *lchan, uint8_t link_id, void *_data, enum bsc_rllr_ind rllr_ind) -{ - struct msgb *msg = _data; - - /* - * There seems to be a small window that the RLL timer can - * fire after a lchan_release call and before the S_CHALLOC_FREED - * is called. Check if a conn is set before proceeding. - */ - if (!lchan->conn) - return; - - switch (rllr_ind) { - case BSC_RLLR_IND_EST_CONF: - rsl_data_request(msg, OBSC_LINKID_CB(msg)); - break; - case BSC_RLLR_IND_REL_IND: - case BSC_RLLR_IND_ERR_IND: - case BSC_RLLR_IND_TIMEOUT: - bsc_sapi_n_reject(lchan->conn, OBSC_LINKID_CB(msg)); - msgb_free(msg); - break; - } -} - static int bsc_handle_lchan_signal(unsigned int subsys, unsigned int signal, void *handler_data, void *signal_data) { diff --git a/src/osmo-bsc/bsc_init.c b/src/osmo-bsc/bsc_init.c index 1fe4847..641b6db 100644 --- a/src/osmo-bsc/bsc_init.c +++ b/src/osmo-bsc/bsc_init.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c b/src/osmo-bsc/bsc_subscr_conn_fsm.c index 66cdbba..3249270 100644 --- a/src/osmo-bsc/bsc_subscr_conn_fsm.c +++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c @@ -34,6 +34,8 @@ #include #include #include +#include +#include #include #include @@ -145,6 +147,16 @@ } } +/* forward MT DTAP from BSSAP side to RSL side */ +static inline void submit_dtap(struct gsm_subscriber_connection *conn, struct msgb *msg, + struct osmo_fsm_inst *fi) +{ + OSMO_ASSERT(fi); + OSMO_ASSERT(msg); + OSMO_ASSERT(conn); + gscon_submit_rsl_dtap(conn, msg, OBSC_LINKID_CB(msg), 1); +} + /* Send data SCCP message through SCCP connection. All sigtran messages * that are send from this FSM must use this function. Never use * osmo_bsc_sigtran_send() directly since this would defeat the checks @@ -256,26 +268,6 @@ sigtran_send(conn, resp, fi); } -/* forward MT DTAP from BSSAP side to RSL side */ -static void submit_dtap(struct gsm_subscriber_connection *conn, struct msgb *msg, struct osmo_fsm_inst *fi) -{ - int rc; - struct msgb *resp = NULL; - - OSMO_ASSERT(fi); - OSMO_ASSERT(msg); - OSMO_ASSERT(conn); - - rc = gsm0808_submit_dtap(conn, msg, OBSC_LINKID_CB(msg), 1); - if (rc != 0) { - LOGPFSML(fi, LOGL_ERROR, "Tx BSSMAP CLEAR REQUEST to MSC\n"); - resp = gsm0808_create_clear_rqst(GSM0808_CAUSE_EQUIPMENT_FAILURE); - sigtran_send(conn, resp, fi); - osmo_fsm_inst_state_chg(fi, ST_ACTIVE, 0, 0); - return; - } -} - /* forward MO DTAP from RSL side to BSSAP side */ static void forward_dtap(struct gsm_subscriber_connection *conn, struct msgb *msg, struct osmo_fsm_inst *fi) { @@ -1005,8 +997,6 @@ } } -void ho_dtap_cache_flush(struct gsm_subscriber_connection *conn, int send); - static void gscon_cleanup(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause) { struct gsm_subscriber_connection *conn = fi->priv; @@ -1037,7 +1027,7 @@ } /* drop pending messages */ - ho_dtap_cache_flush(conn, 0); + gscon_dtap_queue_flush(conn, 0); penalty_timers_free(&conn->hodec2.penalty_timers); @@ -1130,7 +1120,7 @@ return NULL; conn->network = net; - INIT_LLIST_HEAD(&conn->ho_dtap_cache); + INIT_LLIST_HEAD(&conn->dtap_queue); /* BTW, penalty timers will be initialized on-demand. */ conn->sccp.conn_id = -1; @@ -1155,3 +1145,143 @@ llist_add_tail(&conn->entry, &net->subscr_conns); return conn; } + +static void gsm0808_send_rsl_dtap(struct gsm_subscriber_connection *conn, + struct msgb *msg, int link_id, int allow_sacch); + +#define GSCON_DTAP_QUEUE_MSGB_CB_LINK_ID 0 +#define GSCON_DTAP_QUEUE_MSGB_CB_ALLOW_SACCH 1 + +static void gscon_dtap_queue_add(struct gsm_subscriber_connection *conn, struct msgb *msg, + int link_id, bool allow_sacch) +{ + if (conn->dtap_queue_len >= 8) { + LOGP(DMSC, LOGL_ERROR, "%s: Cannot queue more DTAP messages," + " already reached sane maximum of %u queued messages\n", + bsc_subscr_name(conn->bsub), conn->dtap_queue_len); + msgb_free(msg); + return; + } + conn->dtap_queue_len ++; + LOGP(DMSC, LOGL_DEBUG, "%s: Queueing DTAP message during handover/assignment (%u)\n", + bsc_subscr_name(conn->bsub), conn->dtap_queue_len); + msg->cb[GSCON_DTAP_QUEUE_MSGB_CB_LINK_ID] = (unsigned long)link_id; + msg->cb[GSCON_DTAP_QUEUE_MSGB_CB_ALLOW_SACCH] = allow_sacch ? 1 : 0; + msgb_enqueue(&conn->dtap_queue, msg); +} + +void gscon_dtap_queue_flush(struct gsm_subscriber_connection *conn, int send) +{ + struct msgb *msg; + unsigned int flushed_count = 0; + + if (conn->secondary_lchan || conn->ho) { + LOGP(DMSC, LOGL_ERROR, "%s: Cannot send queued DTAP messages, handover/assignment is still ongoing\n", + bsc_subscr_name(conn->bsub)); + send = 0; + } + + while ((msg = msgb_dequeue(&conn->dtap_queue))) { + conn->dtap_queue_len --; + flushed_count ++; + if (send) { + int link_id = (int)msg->cb[GSCON_DTAP_QUEUE_MSGB_CB_LINK_ID]; + bool allow_sacch = !!msg->cb[GSCON_DTAP_QUEUE_MSGB_CB_ALLOW_SACCH]; + LOGP(DMSC, LOGL_DEBUG, "%s: Sending queued DTAP message after handover/assignment (%u/%u)\n", + bsc_subscr_name(conn->bsub), flushed_count, conn->dtap_queue_len); + gsm0808_send_rsl_dtap(conn, msg, link_id, allow_sacch); + } else + msgb_free(msg); + } +} + +static void rll_ind_cb(struct gsm_lchan *lchan, uint8_t link_id, void *_data, enum bsc_rllr_ind rllr_ind) +{ + struct msgb *msg = _data; + + /* + * There seems to be a small window that the RLL timer can + * fire after a lchan_release call and before the S_CHALLOC_FREED + * is called. Check if a conn is set before proceeding. + */ + if (!lchan->conn) + return; + + switch (rllr_ind) { + case BSC_RLLR_IND_EST_CONF: + rsl_data_request(msg, OBSC_LINKID_CB(msg)); + break; + case BSC_RLLR_IND_REL_IND: + case BSC_RLLR_IND_ERR_IND: + case BSC_RLLR_IND_TIMEOUT: + bsc_sapi_n_reject(lchan->conn, OBSC_LINKID_CB(msg)); + msgb_free(msg); + break; + } +} + +/*! \brief process incoming 08.08 DTAP from MSC (send via BTS to MS) */ +static void gsm0808_send_rsl_dtap(struct gsm_subscriber_connection *conn, + struct msgb *msg, int link_id, int allow_sacch) +{ + uint8_t sapi; + int rc; + struct msgb *resp = NULL; + + if (!conn->lchan) { + LOGP(DMSC, LOGL_ERROR, + "%s Called submit dtap without an lchan.\n", + bsc_subscr_name(conn->bsub)); + msgb_free(msg); + rc = -EINVAL; + goto failed_to_send; + } + + sapi = link_id & 0x7; + msg->lchan = conn->lchan; + msg->dst = msg->lchan->ts->trx->rsl_link; + + /* If we are on a TCH and need to submit a SMS (on SAPI=3) we need to use the SACH */ + if (allow_sacch && sapi != 0) { + if (conn->lchan->type == GSM_LCHAN_TCH_F || conn->lchan->type == GSM_LCHAN_TCH_H) + link_id |= 0x40; + } + + msg->l3h = msg->data; + /* is requested SAPI already up? */ + if (conn->lchan->sapis[sapi] == LCHAN_SAPI_UNUSED) { + /* Establish L2 for additional SAPI */ + OBSC_LINKID_CB(msg) = link_id; + rc = rll_establish(msg->lchan, sapi, rll_ind_cb, msg); + if (rc) { + msgb_free(msg); + bsc_sapi_n_reject(conn, link_id); + goto failed_to_send; + } + return; + } else { + /* Directly forward via RLL/RSL to BTS */ + rc = rsl_data_request(msg, link_id); + if (rc) + goto failed_to_send; + } + return; + +failed_to_send: + LOGPFSML(conn->fi, LOGL_ERROR, "Tx BSSMAP CLEAR REQUEST to MSC\n"); + resp = gsm0808_create_clear_rqst(GSM0808_CAUSE_EQUIPMENT_FAILURE); + sigtran_send(conn, resp, conn->fi); + osmo_fsm_inst_state_chg(conn->fi, ST_ACTIVE, 0, 0); +} + +void gscon_submit_rsl_dtap(struct gsm_subscriber_connection *conn, + struct msgb *msg, int link_id, int allow_sacch) +{ + /* buffer message during assignment / handover */ + if (conn->secondary_lchan || conn->ho) { + gscon_dtap_queue_add(conn, msg, link_id, !! allow_sacch); + return; + } + + gsm0808_send_rsl_dtap(conn, msg, link_id, allow_sacch); +} diff --git a/src/osmo-bsc/gsm_04_08_utils.c b/src/osmo-bsc/gsm_04_08_utils.c index e9aeb55..c548500 100644 --- a/src/osmo-bsc/gsm_04_08_utils.c +++ b/src/osmo-bsc/gsm_04_08_utils.c @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include /* should ip.access BTS use direct RTP streams between each other (1), @@ -600,7 +600,8 @@ DEBUGP(DMM, "-> CM SERVICE ACK\n"); - return gsm0808_submit_dtap(conn, msg, 0, 0); + gscon_submit_rsl_dtap(conn, msg, 0, 0); + return 0; } /* 9.2.6 CM service reject */ @@ -617,7 +618,8 @@ DEBUGP(DMM, "-> CM SERVICE Reject cause: %d\n", value); - return gsm0808_submit_dtap(conn, msg, 0, 0); + gscon_submit_rsl_dtap(conn, msg, 0, 0); + return 0; } /* 9.1.29 RR Status */ @@ -644,7 +646,8 @@ struct msgb *msg = gsm48_create_rr_status(cause); if (!msg) return -1; - return gsm0808_submit_dtap(conn, msg, 0, 0); + gscon_submit_rsl_dtap(conn, msg, 0, 0); + return 0; } struct msgb *gsm48_create_mm_serv_rej(enum gsm48_reject_value value) diff --git a/src/osmo-bsc/gsm_04_80_utils.c b/src/osmo-bsc/gsm_04_80_utils.c index d67f3c5..8de1262 100644 --- a/src/osmo-bsc/gsm_04_80_utils.c +++ b/src/osmo-bsc/gsm_04_80_utils.c @@ -20,7 +20,7 @@ */ #include -#include +#include int bsc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level, const char *text) @@ -28,7 +28,8 @@ struct msgb *msg = gsm0480_create_ussd_notify(level, text); if (!msg) return -1; - return gsm0808_submit_dtap(conn, msg, 0, 0); + gscon_submit_rsl_dtap(conn, msg, 0, 0); + return 0; } int bsc_send_ussd_release_complete(struct gsm_subscriber_connection *conn) @@ -36,5 +37,6 @@ struct msgb *msg = gsm0480_create_ussd_release_complete(); if (!msg) return -1; - return gsm0808_submit_dtap(conn, msg, 0, 0); + gscon_submit_rsl_dtap(conn, msg, 0, 0); + return 0; } diff --git a/src/osmo-bsc/osmo_bsc_api.c b/src/osmo-bsc/osmo_bsc_api.c index a86b4f9..d409c93 100644 --- a/src/osmo-bsc/osmo_bsc_api.c +++ b/src/osmo-bsc/osmo_bsc_api.c @@ -86,7 +86,7 @@ } msg->lchan = conn->lchan; - gsm0808_submit_dtap(conn, msg, 0, 0); + gscon_submit_rsl_dtap(conn, msg, 0, 0); } static int bsc_filter_initial(struct osmo_bsc_data *bsc, diff --git a/tests/bsc/bsc_test.c b/tests/bsc/bsc_test.c index 950eaf5..e4a5ed5 100644 --- a/tests/bsc/bsc_test.c +++ b/tests/bsc/bsc_test.c @@ -249,3 +249,6 @@ const uint8_t *cm2, uint8_t cm2_len, const uint8_t *cm3, uint8_t cm3_len) {} void bsc_mr_config(struct gsm_subscriber_connection *conn, struct gsm_lchan *lchan, int full_rate) {} +void gscon_submit_rsl_dtap(struct gsm_subscriber_connection *conn, + struct msgb *msg, int link_id, int allow_sacch) {} +void gscon_dtap_queue_flush(struct gsm_subscriber_connection *conn, int send) {} -- To view, visit https://gerrit.osmocom.org/9668 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I6ffd7aa641c8905292c769400048c96aa0949585 Gerrit-Change-Number: 9668 Gerrit-PatchSet: 15 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 10:43:55 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 28 Jul 2018 10:43:55 +0000 Subject: Change in osmo-bsc[master]: rename gsm_04_08_utils.[hc] to gsm_04_08_rr In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10145 ) Change subject: rename gsm_04_08_utils.[hc] to gsm_04_08_rr ...................................................................... rename gsm_04_08_utils.[hc] to gsm_04_08_rr "utils" suggests thin helpers to aid using a proper API, while this .c file actually *is* the proper RR API. Rename from "utils" to "rr". Change-Id: I0ffff63d57f03cb324df8e40e41caea5b55a2c85 --- M include/osmocom/bsc/Makefile.am R include/osmocom/bsc/gsm_04_08_rr.h M src/libfilter/bsc_msg_filter.c M src/osmo-bsc/Makefile.am M src/osmo-bsc/abis_rsl.c M src/osmo-bsc/bsc_api.c M src/osmo-bsc/bsc_init.c M src/osmo-bsc/bsc_vty.c M src/osmo-bsc/chan_alloc.c R src/osmo-bsc/gsm_04_08_rr.c M src/osmo-bsc/handover_logic.c M src/osmo-bsc/net_init.c M src/osmo-bsc/osmo_bsc_api.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_filter.c M src/osmo-bsc/paging.c M src/osmo-bsc/pcu_sock.c M src/osmo-bsc/system_information.c M tests/bsc/Makefile.am M tests/handover/Makefile.am 20 files changed, 20 insertions(+), 20 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am index 0b576cd..1e26c34 100644 --- a/include/osmocom/bsc/Makefile.am +++ b/include/osmocom/bsc/Makefile.am @@ -16,7 +16,7 @@ ctrl.h \ debug.h \ e1_config.h \ - gsm_04_08_utils.h \ + gsm_04_08_rr.h \ gsm_04_80.h \ gsm_data.h \ handover.h \ diff --git a/include/osmocom/bsc/gsm_04_08_utils.h b/include/osmocom/bsc/gsm_04_08_rr.h similarity index 100% rename from include/osmocom/bsc/gsm_04_08_utils.h rename to include/osmocom/bsc/gsm_04_08_rr.h diff --git a/src/libfilter/bsc_msg_filter.c b/src/libfilter/bsc_msg_filter.c index bcabc24..1318689 100644 --- a/src/libfilter/bsc_msg_filter.c +++ b/src/libfilter/bsc_msg_filter.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am index bf7ef11..0bc78d5 100644 --- a/src/osmo-bsc/Makefile.am +++ b/src/osmo-bsc/Makefile.am @@ -55,7 +55,7 @@ chan_alloc.c \ codec_pref.c \ e1_config.c \ - gsm_04_08_utils.c \ + gsm_04_08_rr.c \ gsm_04_80_utils.c \ gsm_data.c \ handover_cfg.c \ diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c index d5e69ac..bf8dfa5 100644 --- a/src/osmo-bsc/abis_rsl.c +++ b/src/osmo-bsc/abis_rsl.c @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/osmo-bsc/bsc_api.c b/src/osmo-bsc/bsc_api.c index 35e6977..2ce8d3b 100644 --- a/src/osmo-bsc/bsc_api.c +++ b/src/osmo-bsc/bsc_api.c @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/osmo-bsc/bsc_init.c b/src/osmo-bsc/bsc_init.c index 641b6db..b1388b8 100644 --- a/src/osmo-bsc/bsc_init.c +++ b/src/osmo-bsc/bsc_init.c @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c index b1e6d78..b187704 100644 --- a/src/osmo-bsc/bsc_vty.c +++ b/src/osmo-bsc/bsc_vty.c @@ -59,7 +59,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/osmo-bsc/chan_alloc.c b/src/osmo-bsc/chan_alloc.c index cec5846..c73ecb7 100644 --- a/src/osmo-bsc/chan_alloc.c +++ b/src/osmo-bsc/chan_alloc.c @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include diff --git a/src/osmo-bsc/gsm_04_08_utils.c b/src/osmo-bsc/gsm_04_08_rr.c similarity index 99% rename from src/osmo-bsc/gsm_04_08_utils.c rename to src/osmo-bsc/gsm_04_08_rr.c index c548500..64eace7 100644 --- a/src/osmo-bsc/gsm_04_08_utils.c +++ b/src/osmo-bsc/gsm_04_08_rr.c @@ -35,7 +35,7 @@ #include #include #include -#include +#include /* should ip.access BTS use direct RTP streams between each other (1), * or should OpenBSC always act as RTP relay/proxy in between (0) ? */ diff --git a/src/osmo-bsc/handover_logic.c b/src/osmo-bsc/handover_logic.c index 028b2d4..0b0a8f4 100644 --- a/src/osmo-bsc/handover_logic.c +++ b/src/osmo-bsc/handover_logic.c @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/osmo-bsc/net_init.c b/src/osmo-bsc/net_init.c index db3d01c..208b4ef 100644 --- a/src/osmo-bsc/net_init.c +++ b/src/osmo-bsc/net_init.c @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/osmo-bsc/osmo_bsc_api.c b/src/osmo-bsc/osmo_bsc_api.c index d409c93..1ce9194 100644 --- a/src/osmo-bsc/osmo_bsc_api.c +++ b/src/osmo-bsc/osmo_bsc_api.c @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 887a866..60c858f 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/osmo-bsc/osmo_bsc_filter.c b/src/osmo-bsc/osmo_bsc_filter.c index 0d0fc29..773a146 100644 --- a/src/osmo-bsc/osmo_bsc_filter.c +++ b/src/osmo-bsc/osmo_bsc_filter.c @@ -22,11 +22,11 @@ #include #include #include -#include +#include #include #include #include -#include +#include #include diff --git a/src/osmo-bsc/paging.c b/src/osmo-bsc/paging.c index feb9fea..7e833d3 100644 --- a/src/osmo-bsc/paging.c +++ b/src/osmo-bsc/paging.c @@ -50,7 +50,7 @@ #include #include #include -#include +#include void *tall_paging_ctx = NULL; diff --git a/src/osmo-bsc/pcu_sock.c b/src/osmo-bsc/pcu_sock.c index 8a3c331..82d01e1 100644 --- a/src/osmo-bsc/pcu_sock.c +++ b/src/osmo-bsc/pcu_sock.c @@ -43,7 +43,7 @@ #include #include #include -#include +#include static int pcu_sock_send(struct gsm_bts *bts, struct msgb *msg); uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx); diff --git a/src/osmo-bsc/system_information.c b/src/osmo-bsc/system_information.c index 3c0c76c..caf29ec 100644 --- a/src/osmo-bsc/system_information.c +++ b/src/osmo-bsc/system_information.c @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include diff --git a/tests/bsc/Makefile.am b/tests/bsc/Makefile.am index 2e34d79..6ffeed2 100644 --- a/tests/bsc/Makefile.am +++ b/tests/bsc/Makefile.am @@ -40,7 +40,7 @@ $(top_builddir)/src/osmo-bsc/bsc_rll.o \ $(top_builddir)/src/osmo-bsc/bsc_subscriber.o \ $(top_builddir)/src/osmo-bsc/chan_alloc.o \ - $(top_builddir)/src/osmo-bsc/gsm_04_08_utils.o \ + $(top_builddir)/src/osmo-bsc/gsm_04_08_rr.o \ $(top_builddir)/src/osmo-bsc/gsm_04_80_utils.o \ $(top_builddir)/src/osmo-bsc/gsm_data.o \ $(top_builddir)/src/osmo-bsc/handover_cfg.o \ diff --git a/tests/handover/Makefile.am b/tests/handover/Makefile.am index 140d8ff..f8c2664 100644 --- a/tests/handover/Makefile.am +++ b/tests/handover/Makefile.am @@ -51,7 +51,7 @@ $(top_builddir)/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.o \ $(top_builddir)/src/osmo-bsc/bts_sysmobts.o \ $(top_builddir)/src/osmo-bsc/chan_alloc.o \ - $(top_builddir)/src/osmo-bsc/gsm_04_08_utils.o \ + $(top_builddir)/src/osmo-bsc/gsm_04_08_rr.o \ $(top_builddir)/src/osmo-bsc/gsm_04_80_utils.o \ $(top_builddir)/src/osmo-bsc/gsm_data.o \ $(top_builddir)/src/osmo-bsc/handover_cfg.o \ -- To view, visit https://gerrit.osmocom.org/10145 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I0ffff63d57f03cb324df8e40e41caea5b55a2c85 Gerrit-Change-Number: 10145 Gerrit-PatchSet: 4 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 10:43:56 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 28 Jul 2018 10:43:56 +0000 Subject: Change in osmo-bsc[master]: cosmetic: move RR functions from bsc_api.c to gsm_04_08_rr.c In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/9669 ) Change subject: cosmetic: move RR functions from bsc_api.c to gsm_04_08_rr.c ...................................................................... cosmetic: move RR functions from bsc_api.c to gsm_04_08_rr.c Rationale: bsc_api.c used to be a kind of kitchen sink for various implementations, we want to dissolve it. Also, combining 0808 and 0408 in the same c file causes "weird" linking dependencies for utility and test programs. bsc_api.c will be completely dissolved in upcoming Ib7ce026b52d4ba3e53a8b2824e74ea92432c48c5. Change-Id: Ie8ee334145bf7bc3a601d395ea7ab9b2009b61c7 --- M include/osmocom/bsc/bsc_api.h M include/osmocom/bsc/gsm_04_08_rr.h M src/osmo-bsc/bsc_api.c M src/osmo-bsc/gsm_04_08_rr.c 4 files changed, 309 insertions(+), 307 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmocom/bsc/bsc_api.h b/include/osmocom/bsc/bsc_api.h index a90268b..9e2b44e 100644 --- a/include/osmocom/bsc/bsc_api.h +++ b/include/osmocom/bsc/bsc_api.h @@ -28,5 +28,4 @@ unsigned int mi_len, uint8_t *mi, int chan_type); int gsm0808_clear(struct gsm_subscriber_connection *conn); -int gsm0408_rcvmsg(struct msgb *msg, uint8_t link_id); #endif diff --git a/include/osmocom/bsc/gsm_04_08_rr.h b/include/osmocom/bsc/gsm_04_08_rr.h index 4349a37..69cb6ea 100644 --- a/include/osmocom/bsc/gsm_04_08_rr.h +++ b/include/osmocom/bsc/gsm_04_08_rr.h @@ -41,3 +41,5 @@ } uint64_t str_to_imsi(const char *imsi_str); + +int gsm0408_rcvmsg(struct msgb *msg, uint8_t link_id); diff --git a/src/osmo-bsc/bsc_api.c b/src/osmo-bsc/bsc_api.c index 2ce8d3b..92b64e4 100644 --- a/src/osmo-bsc/bsc_api.c +++ b/src/osmo-bsc/bsc_api.c @@ -195,312 +195,6 @@ return rsl_paging_cmd(bts, page_group, mi_len, mi, chan_type, false); } -static void handle_ass_compl(struct gsm_subscriber_connection *conn, - struct msgb *msg) -{ - struct gsm48_hdr *gh = msgb_l3(msg); - enum gsm48_rr_cause cause; - - /* Expecting gsm48_hdr + cause value */ - if (msgb_l3len(msg) != sizeof(*gh) + 1) { - LOGPLCHAN(msg->lchan, DRR, LOGL_ERROR, - "RR Assignment Complete: length invalid: %u, expected %zu\n", - msgb_l3len(msg), sizeof(*gh) + 1); - return; - } - - cause = gh->data[0]; - - LOGPLCHAN(msg->lchan, DRR, LOGL_DEBUG, "ASSIGNMENT COMPLETE cause = %s\n", - rr_cause_name(cause)); - - if (conn->ho) { - struct lchan_signal_data sig = { - .lchan = msg->lchan, - }; - osmo_signal_dispatch(SS_LCHAN, S_LCHAN_ASSIGNMENT_COMPL, &sig); - /* FIXME: release old channel */ - - /* send pending messages, if any */ - gscon_dtap_queue_flush(conn, 1); - - return; - } - - if (conn->secondary_lchan != msg->lchan) { - LOGPLCHAN(msg->lchan, DRR, LOGL_ERROR, - "RR Assignment Complete does not match conn's secondary lchan.\n"); - return; - } - - lchan_release(conn->lchan, 0, RSL_REL_LOCAL_END); - conn->lchan = conn->secondary_lchan; - conn->secondary_lchan = NULL; - - /* send pending messages, if any */ - gscon_dtap_queue_flush(conn, 1); - - if (is_ipaccess_bts(conn_get_bts(conn)) && conn->lchan->tch_mode != GSM48_CMODE_SIGN) - rsl_ipacc_crcx(conn->lchan); - - bsc_assign_compl(conn, cause); -} - -static void handle_ass_fail(struct gsm_subscriber_connection *conn, - struct msgb *msg) -{ - uint8_t *rr_failure; - struct gsm48_hdr *gh; - - if (conn->ho) { - struct lchan_signal_data sig; - struct gsm48_hdr *gh = msgb_l3(msg); - - LOGPLCHAN(msg->lchan, DRR, LOGL_DEBUG, "ASSIGNMENT FAILED cause = %s\n", - rr_cause_name(gh->data[0])); - - sig.lchan = msg->lchan; - sig.mr = NULL; - osmo_signal_dispatch(SS_LCHAN, S_LCHAN_ASSIGNMENT_FAIL, &sig); - /* FIXME: release allocated new channel */ - - /* send pending messages, if any */ - gscon_dtap_queue_flush(conn, 1); - - return; - } - - if (conn->lchan != msg->lchan) { - LOGPLCHAN(msg->lchan, DMSC, LOGL_ERROR, - "Assignment failure should occur on primary lchan.\n"); - return; - } - - /* stop the timer and release it */ - if (conn->secondary_lchan) { - lchan_release(conn->secondary_lchan, 0, RSL_REL_LOCAL_END); - conn->secondary_lchan = NULL; - } - - /* send pending messages, if any */ - gscon_dtap_queue_flush(conn, 1); - - gh = msgb_l3(msg); - if (msgb_l3len(msg) - sizeof(*gh) != 1) { - LOGPLCHAN(conn->lchan, DMSC, LOGL_ERROR, "assignment failure unhandled: %zu\n", - msgb_l3len(msg) - sizeof(*gh)); - rr_failure = NULL; - } else { - rr_failure = &gh->data[0]; - } - - bsc_assign_fail(conn, GSM0808_CAUSE_RADIO_INTERFACE_MESSAGE_FAILURE, rr_failure); -} - -static void handle_classmark_chg(struct gsm_subscriber_connection *conn, - struct msgb *msg) -{ - struct gsm48_hdr *gh = msgb_l3(msg); - unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh); - uint8_t cm2_len, cm3_len = 0; - uint8_t *cm2, *cm3 = NULL; - - LOGPLCHAN(msg->lchan, DRR, LOGL_DEBUG, "CLASSMARK CHANGE "); - - /* classmark 2 */ - cm2_len = gh->data[0]; - cm2 = &gh->data[1]; - DEBUGPC(DRR, "CM2(len=%u) ", cm2_len); - - if (payload_len > cm2_len + 1) { - /* we must have a classmark3 */ - if (gh->data[cm2_len+1] != 0x20) { - DEBUGPC(DRR, "ERR CM3 TAG\n"); - return; - } - if (cm2_len > 3) { - DEBUGPC(DRR, "CM2 too long!\n"); - return; - } - - cm3_len = gh->data[cm2_len+2]; - cm3 = &gh->data[cm2_len+3]; - if (cm3_len > 14) { - DEBUGPC(DRR, "CM3 len %u too long!\n", cm3_len); - return; - } - DEBUGPC(DRR, "CM3(len=%u)\n", cm3_len); - } - bsc_cm_update(conn, cm2, cm2_len, cm3, cm3_len); -} - -/* Chapter 9.1.16 Handover complete */ -static void handle_rr_ho_compl(struct msgb *msg) -{ - struct lchan_signal_data sig; - struct gsm48_hdr *gh = msgb_l3(msg); - - LOGPLCHAN(msg->lchan, DRR, LOGL_DEBUG, - "HANDOVER COMPLETE cause = %s\n", rr_cause_name(gh->data[0])); - - sig.lchan = msg->lchan; - sig.mr = NULL; - osmo_signal_dispatch(SS_LCHAN, S_LCHAN_HANDOVER_COMPL, &sig); - /* FIXME: release old channel */ - - /* send pending messages, if any */ - gscon_dtap_queue_flush(msg->lchan->conn, 1); -} - -/* Chapter 9.1.17 Handover Failure */ -static void handle_rr_ho_fail(struct msgb *msg) -{ - struct lchan_signal_data sig; - struct gsm48_hdr *gh = msgb_l3(msg); - - /* Log on both RR and HO categories: it is an RR message, but is still quite important when - * filtering on HO. */ - LOGPLCHAN(msg->lchan, DRR, LOGL_DEBUG, - "HANDOVER FAILED cause = %s\n", rr_cause_name(gh->data[0])); - LOGPLCHAN(msg->lchan, DHO, LOGL_DEBUG, - "HANDOVER FAILED cause = %s\n", rr_cause_name(gh->data[0])); - - sig.lchan = msg->lchan; - sig.mr = NULL; - osmo_signal_dispatch(SS_LCHAN, S_LCHAN_HANDOVER_FAIL, &sig); - /* FIXME: release allocated new channel */ - - /* send pending messages, if any */ - gscon_dtap_queue_flush(msg->lchan->conn, 1); -} - - -static void dispatch_dtap(struct gsm_subscriber_connection *conn, - uint8_t link_id, struct msgb *msg) -{ - struct gsm48_hdr *gh; - uint8_t pdisc; - uint8_t msg_type; - int rc; - - if (msgb_l3len(msg) < sizeof(*gh)) { - LOGP(DMSC, LOGL_ERROR, "(%s) Message too short for a GSM48 header.\n", - bsc_subscr_name(conn->bsub)); - return; - } - - gh = msgb_l3(msg); - pdisc = gsm48_hdr_pdisc(gh); - msg_type = gsm48_hdr_msg_type(gh); - - /* the idea is to handle all RR messages here, and only hand - * MM/CC/SMS-CP/LCS up to the MSC. Some messages like PAGING - * RESPONSE or CM SERVICE REQUEST will not be covered here, as - * they are only possible in the first L3 message of each L2 - * channel, i.e. 'conn' will not exist and gsm0408_rcvmsg() - * will call api->compl_l3() for it */ - switch (pdisc) { - case GSM48_PDISC_RR: - switch (msg_type) { - case GSM48_MT_RR_GPRS_SUSP_REQ: - LOGPLCHAN(msg->lchan, DRR, LOGL_DEBUG, - "%s\n", gsm48_rr_msg_name(GSM48_MT_RR_GPRS_SUSP_REQ)); - break; - case GSM48_MT_RR_STATUS: - LOGPLCHAN(msg->lchan, DRR, LOGL_NOTICE, - "%s (cause: %s)\n", gsm48_rr_msg_name(GSM48_MT_RR_STATUS), - rr_cause_name(gh->data[0])); - break; - case GSM48_MT_RR_MEAS_REP: - /* This shouldn't actually end up here, as RSL treats - * L3 Info of 08.58 MEASUREMENT REPORT different by calling - * directly into gsm48_parse_meas_rep */ - LOGPLCHAN(msg->lchan, DMEAS, LOGL_ERROR, - "DIRECT GSM48 MEASUREMENT REPORT ?!?\n"); - gsm48_tx_rr_status(conn, GSM48_RR_CAUSE_MSG_TYPE_N_COMPAT); - break; - case GSM48_MT_RR_HANDO_COMPL: - handle_rr_ho_compl(msg); - break; - case GSM48_MT_RR_HANDO_FAIL: - handle_rr_ho_fail(msg); - break; - case GSM48_MT_RR_CIPH_M_COMPL: - bsc_cipher_mode_compl(conn, msg, conn->lchan->encr.alg_id); - break; - case GSM48_MT_RR_ASS_COMPL: - handle_ass_compl(conn, msg); - break; - case GSM48_MT_RR_ASS_FAIL: - handle_ass_fail(conn, msg); - break; - case GSM48_MT_RR_CHAN_MODE_MODIF_ACK: - rc = gsm48_rx_rr_modif_ack(msg); - if (rc < 0) - bsc_assign_fail(conn, GSM0808_CAUSE_NO_RADIO_RESOURCE_AVAILABLE, NULL); - else - bsc_assign_compl(conn, 0); - break; - case GSM48_MT_RR_CLSM_CHG: - handle_classmark_chg(conn, msg); - break; - case GSM48_MT_RR_APP_INFO: - /* Passing RR APP INFO to MSC, not quite - * according to spec */ - bsc_dtap(conn, link_id, msg); - break; - default: - /* Drop unknown RR message */ - LOGPLCHAN(msg->lchan, DRR, LOGL_NOTICE, - "Dropping %s 04.08 RR message\n", gsm48_rr_msg_name(msg_type)); - gsm48_tx_rr_status(conn, GSM48_RR_CAUSE_MSG_TYPE_N); - break; - } - break; - default: - bsc_dtap(conn, link_id, msg); - break; - } -} - -/*! \brief RSL has received a DATA INDICATION with L3 from MS */ -int gsm0408_rcvmsg(struct msgb *msg, uint8_t link_id) -{ - int rc; - struct gsm_lchan *lchan; - - lchan = msg->lchan; - if (lchan->state != LCHAN_S_ACTIVE) { - LOGPLCHAN(msg->lchan, DRSL, LOGL_INFO, "Got data in non active state, discarding.\n"); - return -1; - } - - - if (lchan->conn) { - /* if we already have a connection, forward via DTAP to - * MSC */ - dispatch_dtap(lchan->conn, link_id, msg); - } else { - /* allocate a new connection */ - rc = BSC_API_CONN_POL_REJECT; - lchan->conn = bsc_subscr_con_allocate(msg->lchan->ts->trx->bts->network); - if (!lchan->conn) { - lchan_release(lchan, 1, RSL_REL_NORMAL); - return -1; - } - lchan->conn->lchan = lchan; - - /* fwd via bsc_api to send COMPLETE L3 INFO to MSC */ - rc = bsc_compl_l3(lchan->conn, msg, 0); - - if (rc != BSC_API_CONN_POL_ACCEPT) { - //osmo_fsm_inst_dispatch(lchan->conn->fi, FIXME, NULL); - } - } - - return 0; -} - /*! \brief We received a GSM 08.08 CIPHER MODE from the MSC */ int gsm0808_cipher_mode(struct gsm_subscriber_connection *conn, int cipher, const uint8_t *key, int len, int include_imeisv) diff --git a/src/osmo-bsc/gsm_04_08_rr.c b/src/osmo-bsc/gsm_04_08_rr.c index 64eace7..e6b654a 100644 --- a/src/osmo-bsc/gsm_04_08_rr.c +++ b/src/osmo-bsc/gsm_04_08_rr.c @@ -36,6 +36,8 @@ #include #include #include +#include +#include /* should ip.access BTS use direct RTP streams between each other (1), * or should OpenBSC always act as RTP relay/proxy in between (0) ? */ @@ -716,3 +718,308 @@ return ret; } + +static void handle_ass_compl(struct gsm_subscriber_connection *conn, + struct msgb *msg) +{ + struct gsm48_hdr *gh = msgb_l3(msg); + enum gsm48_rr_cause cause; + + /* Expecting gsm48_hdr + cause value */ + if (msgb_l3len(msg) != sizeof(*gh) + 1) { + LOGPLCHAN(msg->lchan, DRR, LOGL_ERROR, + "RR Assignment Complete: length invalid: %u, expected %zu\n", + msgb_l3len(msg), sizeof(*gh) + 1); + return; + } + + cause = gh->data[0]; + + LOGPLCHAN(msg->lchan, DRR, LOGL_DEBUG, "ASSIGNMENT COMPLETE cause = %s\n", + rr_cause_name(cause)); + + if (conn->ho) { + struct lchan_signal_data sig = { + .lchan = msg->lchan, + }; + osmo_signal_dispatch(SS_LCHAN, S_LCHAN_ASSIGNMENT_COMPL, &sig); + /* FIXME: release old channel */ + + /* send pending messages, if any */ + gscon_dtap_queue_flush(conn, 1); + + return; + } + + if (conn->secondary_lchan != msg->lchan) { + LOGPLCHAN(msg->lchan, DRR, LOGL_ERROR, + "RR Assignment Complete does not match conn's secondary lchan.\n"); + return; + } + + lchan_release(conn->lchan, 0, RSL_REL_LOCAL_END); + conn->lchan = conn->secondary_lchan; + conn->secondary_lchan = NULL; + + /* send pending messages, if any */ + gscon_dtap_queue_flush(conn, 1); + + if (is_ipaccess_bts(conn_get_bts(conn)) && conn->lchan->tch_mode != GSM48_CMODE_SIGN) + rsl_ipacc_crcx(conn->lchan); + + bsc_assign_compl(conn, cause); +} + +static void handle_ass_fail(struct gsm_subscriber_connection *conn, + struct msgb *msg) +{ + uint8_t *rr_failure; + struct gsm48_hdr *gh; + + if (conn->ho) { + struct lchan_signal_data sig; + struct gsm48_hdr *gh = msgb_l3(msg); + + LOGPLCHAN(msg->lchan, DRR, LOGL_DEBUG, "ASSIGNMENT FAILED cause = %s\n", + rr_cause_name(gh->data[0])); + + sig.lchan = msg->lchan; + sig.mr = NULL; + osmo_signal_dispatch(SS_LCHAN, S_LCHAN_ASSIGNMENT_FAIL, &sig); + /* FIXME: release allocated new channel */ + + /* send pending messages, if any */ + gscon_dtap_queue_flush(conn, 1); + + return; + } + + if (conn->lchan != msg->lchan) { + LOGPLCHAN(msg->lchan, DMSC, LOGL_ERROR, + "Assignment failure should occur on primary lchan.\n"); + return; + } + + /* stop the timer and release it */ + if (conn->secondary_lchan) { + lchan_release(conn->secondary_lchan, 0, RSL_REL_LOCAL_END); + conn->secondary_lchan = NULL; + } + + /* send pending messages, if any */ + gscon_dtap_queue_flush(conn, 1); + + gh = msgb_l3(msg); + if (msgb_l3len(msg) - sizeof(*gh) != 1) { + LOGPLCHAN(conn->lchan, DMSC, LOGL_ERROR, "assignment failure unhandled: %zu\n", + msgb_l3len(msg) - sizeof(*gh)); + rr_failure = NULL; + } else { + rr_failure = &gh->data[0]; + } + + bsc_assign_fail(conn, GSM0808_CAUSE_RADIO_INTERFACE_MESSAGE_FAILURE, rr_failure); +} + +static void handle_classmark_chg(struct gsm_subscriber_connection *conn, + struct msgb *msg) +{ + struct gsm48_hdr *gh = msgb_l3(msg); + unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh); + uint8_t cm2_len, cm3_len = 0; + uint8_t *cm2, *cm3 = NULL; + + LOGPLCHAN(msg->lchan, DRR, LOGL_DEBUG, "CLASSMARK CHANGE "); + + /* classmark 2 */ + cm2_len = gh->data[0]; + cm2 = &gh->data[1]; + DEBUGPC(DRR, "CM2(len=%u) ", cm2_len); + + if (payload_len > cm2_len + 1) { + /* we must have a classmark3 */ + if (gh->data[cm2_len+1] != 0x20) { + DEBUGPC(DRR, "ERR CM3 TAG\n"); + return; + } + if (cm2_len > 3) { + DEBUGPC(DRR, "CM2 too long!\n"); + return; + } + + cm3_len = gh->data[cm2_len+2]; + cm3 = &gh->data[cm2_len+3]; + if (cm3_len > 14) { + DEBUGPC(DRR, "CM3 len %u too long!\n", cm3_len); + return; + } + DEBUGPC(DRR, "CM3(len=%u)\n", cm3_len); + } + bsc_cm_update(conn, cm2, cm2_len, cm3, cm3_len); +} + +/* Chapter 9.1.16 Handover complete */ +static void handle_rr_ho_compl(struct msgb *msg) +{ + struct lchan_signal_data sig; + struct gsm48_hdr *gh = msgb_l3(msg); + + LOGPLCHAN(msg->lchan, DRR, LOGL_DEBUG, + "HANDOVER COMPLETE cause = %s\n", rr_cause_name(gh->data[0])); + + sig.lchan = msg->lchan; + sig.mr = NULL; + osmo_signal_dispatch(SS_LCHAN, S_LCHAN_HANDOVER_COMPL, &sig); + /* FIXME: release old channel */ + + /* send pending messages, if any */ + gscon_dtap_queue_flush(msg->lchan->conn, 1); +} + +/* Chapter 9.1.17 Handover Failure */ +static void handle_rr_ho_fail(struct msgb *msg) +{ + struct lchan_signal_data sig; + struct gsm48_hdr *gh = msgb_l3(msg); + + /* Log on both RR and HO categories: it is an RR message, but is still quite important when + * filtering on HO. */ + LOGPLCHAN(msg->lchan, DRR, LOGL_DEBUG, + "HANDOVER FAILED cause = %s\n", rr_cause_name(gh->data[0])); + LOGPLCHAN(msg->lchan, DHO, LOGL_DEBUG, + "HANDOVER FAILED cause = %s\n", rr_cause_name(gh->data[0])); + + sig.lchan = msg->lchan; + sig.mr = NULL; + osmo_signal_dispatch(SS_LCHAN, S_LCHAN_HANDOVER_FAIL, &sig); + /* FIXME: release allocated new channel */ + + /* send pending messages, if any */ + gscon_dtap_queue_flush(msg->lchan->conn, 1); +} + +static void dispatch_dtap(struct gsm_subscriber_connection *conn, + uint8_t link_id, struct msgb *msg) +{ + struct gsm48_hdr *gh; + uint8_t pdisc; + uint8_t msg_type; + int rc; + + if (msgb_l3len(msg) < sizeof(*gh)) { + LOGP(DMSC, LOGL_ERROR, "(%s) Message too short for a GSM48 header.\n", + bsc_subscr_name(conn->bsub)); + return; + } + + gh = msgb_l3(msg); + pdisc = gsm48_hdr_pdisc(gh); + msg_type = gsm48_hdr_msg_type(gh); + + /* the idea is to handle all RR messages here, and only hand + * MM/CC/SMS-CP/LCS up to the MSC. Some messages like PAGING + * RESPONSE or CM SERVICE REQUEST will not be covered here, as + * they are only possible in the first L3 message of each L2 + * channel, i.e. 'conn' will not exist and gsm0408_rcvmsg() + * will call api->compl_l3() for it */ + switch (pdisc) { + case GSM48_PDISC_RR: + switch (msg_type) { + case GSM48_MT_RR_GPRS_SUSP_REQ: + LOGPLCHAN(msg->lchan, DRR, LOGL_DEBUG, + "%s\n", gsm48_rr_msg_name(GSM48_MT_RR_GPRS_SUSP_REQ)); + break; + case GSM48_MT_RR_STATUS: + LOGPLCHAN(msg->lchan, DRR, LOGL_NOTICE, + "%s (cause: %s)\n", gsm48_rr_msg_name(GSM48_MT_RR_STATUS), + rr_cause_name(gh->data[0])); + break; + case GSM48_MT_RR_MEAS_REP: + /* This shouldn't actually end up here, as RSL treats + * L3 Info of 08.58 MEASUREMENT REPORT different by calling + * directly into gsm48_parse_meas_rep */ + LOGPLCHAN(msg->lchan, DMEAS, LOGL_ERROR, + "DIRECT GSM48 MEASUREMENT REPORT ?!?\n"); + gsm48_tx_rr_status(conn, GSM48_RR_CAUSE_MSG_TYPE_N_COMPAT); + break; + case GSM48_MT_RR_HANDO_COMPL: + handle_rr_ho_compl(msg); + break; + case GSM48_MT_RR_HANDO_FAIL: + handle_rr_ho_fail(msg); + break; + case GSM48_MT_RR_CIPH_M_COMPL: + bsc_cipher_mode_compl(conn, msg, conn->lchan->encr.alg_id); + break; + case GSM48_MT_RR_ASS_COMPL: + handle_ass_compl(conn, msg); + break; + case GSM48_MT_RR_ASS_FAIL: + handle_ass_fail(conn, msg); + break; + case GSM48_MT_RR_CHAN_MODE_MODIF_ACK: + rc = gsm48_rx_rr_modif_ack(msg); + if (rc < 0) + bsc_assign_fail(conn, GSM0808_CAUSE_NO_RADIO_RESOURCE_AVAILABLE, NULL); + else + bsc_assign_compl(conn, 0); + break; + case GSM48_MT_RR_CLSM_CHG: + handle_classmark_chg(conn, msg); + break; + case GSM48_MT_RR_APP_INFO: + /* Passing RR APP INFO to MSC, not quite + * according to spec */ + bsc_dtap(conn, link_id, msg); + break; + default: + /* Drop unknown RR message */ + LOGPLCHAN(msg->lchan, DRR, LOGL_NOTICE, + "Dropping %s 04.08 RR message\n", gsm48_rr_msg_name(msg_type)); + gsm48_tx_rr_status(conn, GSM48_RR_CAUSE_MSG_TYPE_N); + break; + } + break; + default: + bsc_dtap(conn, link_id, msg); + break; + } +} + +/*! \brief RSL has received a DATA INDICATION with L3 from MS */ +int gsm0408_rcvmsg(struct msgb *msg, uint8_t link_id) +{ + int rc; + struct gsm_lchan *lchan; + + lchan = msg->lchan; + if (lchan->state != LCHAN_S_ACTIVE) { + LOGPLCHAN(msg->lchan, DRSL, LOGL_INFO, "Got data in non active state, discarding.\n"); + return -1; + } + + + if (lchan->conn) { + /* if we already have a connection, forward via DTAP to + * MSC */ + dispatch_dtap(lchan->conn, link_id, msg); + } else { + /* allocate a new connection */ + rc = BSC_API_CONN_POL_REJECT; + lchan->conn = bsc_subscr_con_allocate(msg->lchan->ts->trx->bts->network); + if (!lchan->conn) { + lchan_release(lchan, 1, RSL_REL_NORMAL); + return -1; + } + lchan->conn->lchan = lchan; + + /* fwd via bsc_api to send COMPLETE L3 INFO to MSC */ + rc = bsc_compl_l3(lchan->conn, msg, 0); + + if (rc != BSC_API_CONN_POL_ACCEPT) { + //osmo_fsm_inst_dispatch(lchan->conn->fi, FIXME, NULL); + } + } + + return 0; +} -- To view, visit https://gerrit.osmocom.org/9669 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ie8ee334145bf7bc3a601d395ea7ab9b2009b61c7 Gerrit-Change-Number: 9669 Gerrit-PatchSet: 17 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 10:43:57 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 28 Jul 2018 10:43:57 +0000 Subject: Change in osmo-bsc[master]: add gsm_timers, for Tnnn definitions usable by FSMs In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/9670 ) Change subject: add gsm_timers, for Tnnn definitions usable by FSMs ...................................................................... add gsm_timers, for Tnnn definitions usable by FSMs Change-Id: If212fcd042051b6fa53484254223614c5b93a9c6 --- M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/gsm_data.h A include/osmocom/bsc/gsm_timers.h M src/ipaccess/Makefile.am M src/osmo-bsc/Makefile.am M src/osmo-bsc/abis_om2000.c M src/osmo-bsc/abis_rsl.c M src/osmo-bsc/bsc_subscr_conn_fsm.c M src/osmo-bsc/bsc_vty.c M src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c M src/osmo-bsc/bts_siemens_bs11.c M src/osmo-bsc/gsm_data.c A src/osmo-bsc/gsm_timers.c A src/osmo-bsc/gsm_timers_vty.c M src/osmo-bsc/net_init.c M src/osmo-bsc/paging.c M src/utils/Makefile.am M tests/abis/Makefile.am M tests/bsc/Makefile.am M tests/gsm0408/Makefile.am M tests/handover/Makefile.am M tests/nanobts_omlattr/Makefile.am M tests/nanobts_omlattr/nanobts_omlattr_test.c 23 files changed, 513 insertions(+), 180 deletions(-) Approvals: Jenkins Builder: Verified Neels Hofmeyr: Looks good to me, approved diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am index 1e26c34..0f134c8 100644 --- a/include/osmocom/bsc/Makefile.am +++ b/include/osmocom/bsc/Makefile.am @@ -19,6 +19,7 @@ gsm_04_08_rr.h \ gsm_04_80.h \ gsm_data.h \ + gsm_timers.h \ handover.h \ handover_cfg.h \ handover_decision.h \ diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 2872493..272b192 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -32,6 +32,8 @@ #include #include +#define GSM_T3122_DEFAULT 10 + struct mgcp_client_conf; struct mgcp_client; struct mgcp_ctx; @@ -1192,23 +1194,6 @@ bsc_ctr_description, }; -#define GSM_T3101_DEFAULT 3 /* s */ -#define GSM_T3103_DEFAULT 5 /* s */ -#define GSM_T3105_DEFAULT 100 /* ms */ -#define GSM_T3107_DEFAULT 5 /* s */ -#define GSM_T3109_DEFAULT 5 /* s, must be 2s + radio_link_timeout*0.48 */ -#define GSM_T3111_DEFAULT 2 /* s */ -#define GSM_T3113_DEFAULT 10 /* s */ -#define GSM_T3115_DEFAULT 10 -#define GSM_T3117_DEFAULT 10 -#define GSM_T3119_DEFAULT 10 -#define GSM_T3122_DEFAULT 10 -#define GSM_T3141_DEFAULT 10 -#define GSM_T10_DEFAULT 6 /* RR Assignment timeout, in seconds */ -#define GSM_T7_DEFAULT 10 /* inter-BSC MO Handover first timeout, in seconds */ -#define GSM_T8_DEFAULT 10 /* inter-BSC MO Handover second timeout, in seconds */ -#define GSM_T101_DEFAULT 10 /* inter-BSC MT Handover timeout, in seconds */ - struct gsm_tz { int override; /* if 0, use system's time zone instead. */ int hr; /* hour */ @@ -1240,23 +1225,8 @@ unsigned int num_bts; struct llist_head bts_list; - /* timer values */ - int T3101; - int T3103; /*< Handover timeout */ - int T3105; - int T3107; - int T3109; - int T3111; - int T3113; - int T3115; - int T3117; - int T3119; - int T3122; - int T3141; - int T10; /*< RR Assignment timeout, in seconds */ - int T7; /*< inter-BSC handover MO timeout from Handover Required to Handover Command */ - int T8; /*< inter-BSC handover MO timeout from Handover Command to final Clear*/ - int T101; /*< inter-BSC handover MT timeout from Handover Request to Handover Accept */ + /* shall reference gsm_network_T[] */ + struct T_def *T_defs; enum gsm_chan_t ctype_by_chreq[_NUM_CHREQ_T]; @@ -1290,9 +1260,6 @@ * pointer is NULL to indicate absence of a bsc_subscribers list. */ struct llist_head *bsc_subscribers; - /* Periodic location update default value */ - uint8_t t3212; - /* Timer for periodic channel load measurements to maintain each BTS's T3122. */ struct osmo_timer_list t3122_chan_load_timer; diff --git a/include/osmocom/bsc/gsm_timers.h b/include/osmocom/bsc/gsm_timers.h new file mode 100644 index 0000000..fde8c93 --- /dev/null +++ b/include/osmocom/bsc/gsm_timers.h @@ -0,0 +1,55 @@ +/* API to define Tnnn timers globally, configure in VTY and use for FSM state changes. */ +#pragma once + +#include +#include + +struct osmo_fsm_inst; +struct vty; + +enum T_unit { + T_S = 0, /*< most T are in seconds, keep 0 as default. */ + T_MS, /*< milliseconds */ + T_M, /*< minutes */ + T_CUSTOM, +}; + +extern const struct value_string T_unit_names[]; +static inline const char *T_unit_name(enum T_unit val) +{ return get_value_string(T_unit_names, val); } + +/* Define a GSM timer of the form Tnnn, with unit, default value and doc string. */ +struct T_def { + const int T; /*< T1234 number */ + const int default_val; /*< timeout duration (according to unit), default value. */ + const enum T_unit unit; + const char *desc; + int val; /*< currently active value, e.g. set by user config. */ +}; + +/* Iterate an array of struct T_def, the last item should be fully zero, i.e. "{}" */ +#define for_each_T_def(d, T_defs) \ + for (d = T_defs; d && (d->T || d->default_val || d->desc); d++) + +int T_def_get(struct T_def *T_defs, int T, enum T_unit as_unit, int val_if_not_present); +void T_defs_reset(struct T_def *T_defs); +struct T_def *T_def_get_entry(struct T_def *T_defs, int T); + +void T_defs_vty_init(struct T_def *T_defs, int cfg_parent_node); +void T_defs_vty_write(struct vty *vty, const char *indent); + + +struct state_timeout { + int T; + bool keep_timer; +}; + +struct state_timeout *get_state_timeout(uint32_t state, struct state_timeout *timeouts_array); + +#define fsm_inst_state_chg_T(fi, state, timeouts_array, T_defs, default_timeout) \ + _fsm_inst_state_chg_T(fi, state, timeouts_array, T_defs, default_timeout, \ + __FILE__, __LINE__) +int _fsm_inst_state_chg_T(struct osmo_fsm_inst *fi, uint32_t state, + struct state_timeout *timeouts_array, + struct T_def *T_defs, int default_timeout, + const char *file, int line); diff --git a/src/ipaccess/Makefile.am b/src/ipaccess/Makefile.am index 2c6282d..ec3e027 100644 --- a/src/ipaccess/Makefile.am +++ b/src/ipaccess/Makefile.am @@ -55,6 +55,7 @@ $(top_builddir)/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.o \ $(top_builddir)/src/osmo-bsc/gsm_data.o \ $(top_builddir)/src/osmo-bsc/net_init.o \ + $(top_builddir)/src/osmo-bsc/gsm_timers.o \ $(OSMO_LIBS) \ $(NULL) @@ -65,5 +66,6 @@ $(NULL) ipaccess_proxy_LDADD = \ + $(top_builddir)/src/osmo-bsc/gsm_timers.o \ $(OSMO_LIBS) \ $(NULL) diff --git a/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am index 0bc78d5..9183791 100644 --- a/src/osmo-bsc/Makefile.am +++ b/src/osmo-bsc/Makefile.am @@ -58,6 +58,8 @@ gsm_04_08_rr.c \ gsm_04_80_utils.c \ gsm_data.c \ + gsm_timers.c \ + gsm_timers_vty.c \ handover_cfg.c \ handover_decision.c \ handover_decision_2.c \ diff --git a/src/osmo-bsc/abis_om2000.c b/src/osmo-bsc/abis_om2000.c index d533ea1..2934590 100644 --- a/src/osmo-bsc/abis_om2000.c +++ b/src/osmo-bsc/abis_om2000.c @@ -42,6 +42,7 @@ #include #include #include +#include #include /* FIXME: move to libosmocore */ @@ -1382,7 +1383,8 @@ msgb_tv_put(msg, OM2K_DEI_CCCH_OPTIONS, 0x01); break; case GSM_PCHAN_CCCH_SDCCH4: - msgb_tv_put(msg, OM2K_DEI_T3105, ts->trx->bts->network->T3105 / 10); + msgb_tv_put(msg, OM2K_DEI_T3105, + T_def_get(ts->trx->bts->network->T_defs, 3105, T_MS, -1) / 10); msgb_tv_put(msg, OM2K_DEI_NY1, 35); msgb_tv_put(msg, OM2K_DEI_BA_PA_MFRMS, 0x06); msgb_tv_put(msg, OM2K_DEI_CBCH_INDICATOR, 0); @@ -1396,7 +1398,8 @@ sizeof(icm_bound_params), icm_bound_params); break; case GSM_PCHAN_SDCCH8_SACCH8C: - msgb_tv_put(msg, OM2K_DEI_T3105, ts->trx->bts->network->T3105 / 10); + msgb_tv_put(msg, OM2K_DEI_T3105, + T_def_get(ts->trx->bts->network->T_defs, 3105, T_MS, -1) / 10); msgb_tv_put(msg, OM2K_DEI_NY1, 35); msgb_tv_put(msg, OM2K_DEI_CBCH_INDICATOR, 0); msgb_tv_put(msg, OM2K_DEI_TSC, gsm_ts_tsc(ts)); @@ -1406,7 +1409,8 @@ sizeof(icm_bound_params), icm_bound_params); break; default: - msgb_tv_put(msg, OM2K_DEI_T3105, ts->trx->bts->network->T3105 / 10); + msgb_tv_put(msg, OM2K_DEI_T3105, + T_def_get(ts->trx->bts->network->T_defs, 3105, T_MS, -1) / 10); msgb_tv_put(msg, OM2K_DEI_NY1, 35); msgb_tv_put(msg, OM2K_DEI_TSC, gsm_ts_tsc(ts)); /* Disable RF RESOURCE INDICATION on idle channels */ diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c index bf8dfa5..97d2aa2 100644 --- a/src/osmo-bsc/abis_rsl.c +++ b/src/osmo-bsc/abis_rsl.c @@ -47,6 +47,7 @@ #include #include #include +#include #define RSL_ALLOC_SIZE 1024 #define RSL_ALLOC_HEADROOM 128 @@ -77,7 +78,9 @@ if (lchan->state == LCHAN_S_REL_ERR) { osmo_timer_setup(&lchan->error_timer, error_timeout_cb, lchan); osmo_timer_schedule(&lchan->error_timer, - lchan->ts->trx->bts->network->T3111 + 2, 0); + T_def_get(lchan->ts->trx->bts->network->T_defs, + 993111, T_S, -1), + 0); } else { rsl_lchan_set_state(lchan, LCHAN_S_NONE); } @@ -1911,11 +1914,10 @@ LOGP(DRSL, LOGL_NOTICE, "(bts=%d) CHAN RQD: no resources for %s 0x%x\n", msg->lchan->ts->trx->bts->nr, gsm_lchant_name(lctype), rqd_ref->ra); rate_ctr_inc(&bts->bts_ctrs->ctr[BTS_CTR_CHREQ_NO_CHANNEL]); - if (bts->T3122) - wait_ind = bts->T3122; - else if (bts->network->T3122) - wait_ind = bts->network->T3122 & 0xff; - else + wait_ind = bts->T3122; + if (!wait_ind) + wait_ind = T_def_get(bts->network->T_defs, 3122, T_S, -1); + if (!wait_ind) wait_ind = GSM_T3122_DEFAULT; /* The BTS will gather multiple CHAN RQD and reject up to 4 MS at the same time. */ rsl_send_imm_ass_rej(bts, rqd_ref, wait_ind); @@ -1997,7 +1999,7 @@ /* Start timer T3101 to wait for GSM48_MT_RR_PAG_RESP */ osmo_timer_setup(&lchan->T3101, t3101_expired, lchan); - osmo_timer_schedule(&lchan->T3101, bts->network->T3101, 0); + osmo_timer_schedule(&lchan->T3101, T_def_get(bts->network->T_defs, 3101, T_S, -1), 0); /* send IMMEDIATE ASSIGN CMD on RSL to BTS (to send on CCCH to MS) */ return rsl_imm_assign_cmd(bts, sizeof(*ia)+ia->mob_alloc_len, (uint8_t *) ia); @@ -2157,7 +2159,7 @@ osmo_timer_del(&lchan->T3109); osmo_timer_setup(&lchan->T3111, t3111_expired, lchan); bts = lchan->ts->trx->bts; - osmo_timer_schedule(&lchan->T3111, bts->network->T3111, 0); + osmo_timer_schedule(&lchan->T3111, T_def_get(bts->network->T_defs, 3111, T_S, -1), 0); } /* ESTABLISH INDICATION, LOCATION AREA UPDATE REQUEST @@ -2996,7 +2998,7 @@ struct gsm_bts *bts = lchan->ts->trx->bts; osmo_timer_setup(&lchan->T3109, t3109_expired, lchan); - osmo_timer_schedule(&lchan->T3109, bts->network->T3109, 0); + osmo_timer_schedule(&lchan->T3109, T_def_get(bts->network->T_defs, 3109, T_S, -1), 0); return 0; } diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c b/src/osmo-bsc/bsc_subscr_conn_fsm.c index 3249270..f97b778 100644 --- a/src/osmo-bsc/bsc_subscr_conn_fsm.c +++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -147,6 +148,25 @@ } } +struct state_timeout conn_fsm_timeouts[32] = { + [ST_WAIT_ASS_CMPL] = { .T = 10 }, + [ST_WAIT_CRCX_BTS] = { .T = 992427 }, + [ST_WAIT_MDCX_BTS] = { .T = 992427 }, + [ST_WAIT_CRCX_MSC] = { .T = 992427 }, + [ST_WAIT_MDCX_BTS_HO] = { .T = 992427 }, + [ST_WAIT_CC] = { .T = 993210 }, + [ST_CLEARING] = { .T = 999 }, +}; + +/* Transition to a state, using the T timer defined in conn_fsm_timeouts. + * The actual timeout value is in turn obtained from network->T_defs. + * Assumes local variable 'conn' exists. */ +#define conn_fsm_state_chg(state) \ + fsm_inst_state_chg_T(conn->fi, state, \ + conn_fsm_timeouts, \ + conn->network->T_defs, \ + -1) + /* forward MT DTAP from BSSAP side to RSL side */ static inline void submit_dtap(struct gsm_subscriber_connection *conn, struct msgb *msg, struct osmo_fsm_inst *fi) @@ -324,7 +344,7 @@ } else { /* SCCP T(conn est) is 1-2 minutes, way too long. The MS will timeout * using T3210 (20s), T3220 (5s) or T3230 (10s) */ - osmo_fsm_inst_state_chg(fi, ST_WAIT_CC, 20, 993210); + conn_fsm_state_chg(ST_WAIT_CC); } break; case GSCON_EV_A_CONN_IND: @@ -353,11 +373,12 @@ /* We've sent the CONNECTION.req to the SCCP provider and are waiting for CC from MSC */ static void gscon_fsm_wait_cc(struct osmo_fsm_inst *fi, uint32_t event, void *data) { + struct gsm_subscriber_connection *conn = fi->priv; switch (event) { case GSCON_EV_A_CONN_CFM: /* MSC has confirmed the connection, we now change into the * active state and wait there for further operations */ - osmo_fsm_inst_state_chg(fi, ST_ACTIVE, 0, 0); + conn_fsm_state_chg(ST_ACTIVE); /* if there's user payload, forward it just like EV_MT_DTAP */ /* FIXME: Question: if there's user payload attached to the CC, forward it like EV_MT_DTAP? */ break; @@ -399,7 +420,7 @@ resp = gsm0808_create_assignment_failure(cause, NULL); sigtran_send(conn, resp, fi); if (fi->state != ST_ACTIVE) - osmo_fsm_inst_state_chg(fi, ST_ACTIVE, 0, 0); + conn_fsm_state_chg(ST_ACTIVE); } /* We're on an active subscriber connection, passing DTAP back and forth */ @@ -437,7 +458,7 @@ osmo_strlcpy(conn_peer.endpoint, get_mgw_ep_name(conn), sizeof(conn_peer.endpoint)); /* (Pre)Change state and create the connection */ - osmo_fsm_inst_state_chg(fi, ST_WAIT_CRCX_BTS, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NR); + conn_fsm_state_chg(ST_WAIT_CRCX_BTS); conn->user_plane.fi_bts = mgcp_conn_create(conn->network->mgw.client, fi, GSCON_EV_MGW_FAIL_BTS, GSCON_EV_MGW_CRCX_RESP_BTS, &conn_peer); @@ -464,7 +485,7 @@ return; } - osmo_fsm_inst_state_chg(fi, ST_WAIT_ASS_CMPL, conn->network->T10, 10); + conn_fsm_state_chg(ST_WAIT_ASS_CMPL); break; default: /* An unsupported channel is requested, so we have to @@ -484,7 +505,7 @@ if (rc) { resp = gsm0808_create_clear_rqst(GSM0808_CAUSE_EQUIPMENT_FAILURE); sigtran_send(conn, resp, fi); - osmo_fsm_inst_state_chg(fi, ST_CLEARING, 0, 0); + conn_fsm_state_chg(ST_CLEARING); return; } @@ -493,7 +514,7 @@ * handover time out, so we do not need another timeout * here (maybe its worth to think about giving GSCON * more power over the actual handover process). */ - osmo_fsm_inst_state_chg(fi, ST_WAIT_HO_COMPL, 0, 0); + conn_fsm_state_chg(ST_WAIT_HO_COMPL); break; case GSCON_EV_A_HO_REQ: /* FIXME: reject any handover requests with HO FAIL until implemented */ @@ -551,7 +572,7 @@ return; } - osmo_fsm_inst_state_chg(fi, ST_WAIT_ASS_CMPL, conn->network->T10, 10); + conn_fsm_state_chg(ST_WAIT_ASS_CMPL); break; case GSCON_EV_MO_DTAP: forward_dtap(conn, (struct msgb *)data, fi); @@ -598,7 +619,7 @@ conn_peer.ptime = 20; /* (Pre)Change state and modify the connection */ - osmo_fsm_inst_state_chg(fi, ST_WAIT_MDCX_BTS, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NR); + conn_fsm_state_chg(ST_WAIT_MDCX_BTS); rc = mgcp_conn_modify(conn->user_plane.fi_bts, GSCON_EV_MGW_MDCX_RESP_BTS, &conn_peer); if (rc != 0) { assignment_failed(fi, GSM0808_CAUSE_EQUIPMENT_FAILURE); @@ -609,7 +630,7 @@ /* Confirm the successful assignment on BSSMAP and * change back into active state */ send_ass_compl(lchan, fi, false); - osmo_fsm_inst_state_chg(fi, ST_ACTIVE, 0, 0); + conn_fsm_state_chg(ST_ACTIVE); break; default: /* Unsupported modes should have been already filtered @@ -673,12 +694,11 @@ case OSMO_SS7_ASP_PROT_IPA: /* Send assignment complete message to the MSC */ send_ass_compl(conn->lchan, fi, true); - osmo_fsm_inst_state_chg(fi, ST_ACTIVE, 0, 0); + conn_fsm_state_chg(ST_ACTIVE); break; default: /* (Pre)Change state and create the connection */ - osmo_fsm_inst_state_chg(fi, ST_WAIT_CRCX_MSC, MGCP_MGW_TIMEOUT, - MGCP_MGW_TIMEOUT_TIMER_NR); + conn_fsm_state_chg(ST_WAIT_CRCX_MSC); conn->user_plane.fi_msc = mgcp_conn_create(conn->network->mgw.client, fi, GSCON_EV_MGW_FAIL_MSC, GSCON_EV_MGW_CRCX_RESP_MSC, &conn_peer); @@ -725,7 +745,7 @@ /* Send assignment complete message to the MSC */ send_ass_compl(lchan, fi, true); - osmo_fsm_inst_state_chg(fi, ST_ACTIVE, 0, 0); + conn_fsm_state_chg(ST_ACTIVE); break; case GSCON_EV_MO_DTAP: @@ -790,12 +810,12 @@ conn_peer.ptime = 20; /* (Pre)Change state and modify the connection */ - osmo_fsm_inst_state_chg(fi, ST_WAIT_MDCX_BTS_HO, MGCP_MGW_TIMEOUT, MGCP_MGW_HO_TIMEOUT_TIMER_NR); + conn_fsm_state_chg(ST_WAIT_MDCX_BTS_HO); rc = mgcp_conn_modify(conn->user_plane.fi_bts, GSCON_EV_MGW_MDCX_RESP_BTS, &conn_peer); if (rc != 0) { resp = gsm0808_create_clear_rqst(GSM0808_CAUSE_EQUIPMENT_FAILURE); sigtran_send(conn, resp, fi); - osmo_fsm_inst_state_chg(fi, ST_CLEARING, 0, 0); + conn_fsm_state_chg(ST_CLEARING); return; } break; @@ -805,7 +825,7 @@ * some reason. This means the phone stays on the TS/BTS on * which it currently is. We will change back to the active * state again as there are no further operations needed */ - osmo_fsm_inst_state_chg(fi, ST_ACTIVE, 0, 0); + conn_fsm_state_chg(ST_ACTIVE); break; default: OSMO_ASSERT(false); @@ -824,7 +844,7 @@ /* The MGW has confirmed the handover MDCX, and the handover * is now also done on the RTP side. We may now change back * to the active state. */ - osmo_fsm_inst_state_chg(fi, ST_ACTIVE, 0, 0); + conn_fsm_state_chg(ST_ACTIVE); break; case GSCON_EV_MO_DTAP: forward_dtap(conn, (struct msgb *)data, fi); @@ -955,7 +975,7 @@ break; case GSCON_EV_A_CLEAR_CMD: /* MSC tells us to cleanly shut down */ - osmo_fsm_inst_state_chg(fi, ST_CLEARING, 0, 0); + conn_fsm_state_chg(ST_CLEARING); gsm0808_clear(conn); /* FIXME: Release all terestrial resources in ST_CLEARING */ /* According to 3GPP 48.008 3.1.9.1. "The BSS need not wait for the radio channel @@ -1080,7 +1100,7 @@ assignment_failed(fi, GSM0808_CAUSE_EQUIPMENT_FAILURE); break; case MGCP_MGW_HO_TIMEOUT_TIMER_NR: /* Handover failed (no response from MGW) */ - osmo_fsm_inst_state_chg(fi, ST_ACTIVE, 0, 0); + conn_fsm_state_chg(ST_ACTIVE); break; default: OSMO_ASSERT(false); diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c index b187704..a551fb1 100644 --- a/src/osmo-bsc/bsc_vty.c +++ b/src/osmo-bsc/bsc_vty.c @@ -64,6 +64,7 @@ #include #include #include +#include #include @@ -968,11 +969,6 @@ return CMD_SUCCESS; } -/* small helper macro for conditional dumping of timer */ -#define VTY_OUT_TIMER(number) \ - if (gsmnet->T##number != GSM_T##number##_DEFAULT) \ - vty_out(vty, " timer t"#number" %u%s", gsmnet->T##number, VTY_NEWLINE) - static int config_write_net(struct vty *vty) { struct gsm_network *gsmnet = gsmnet_from_vty(vty); @@ -993,22 +989,7 @@ ho_vty_write_net(vty, gsmnet); - VTY_OUT_TIMER(3101); - VTY_OUT_TIMER(3103); - VTY_OUT_TIMER(3105); - VTY_OUT_TIMER(3107); - VTY_OUT_TIMER(3109); - VTY_OUT_TIMER(3111); - VTY_OUT_TIMER(3113); - VTY_OUT_TIMER(3115); - VTY_OUT_TIMER(3117); - VTY_OUT_TIMER(3119); - VTY_OUT_TIMER(3122); - VTY_OUT_TIMER(3141); - VTY_OUT_TIMER(10); - VTY_OUT_TIMER(7); - VTY_OUT_TIMER(8); - VTY_OUT_TIMER(101); + T_defs_vty_write(vty, " "); if (!gsmnet->dyn_ts_allow_tch_f) vty_out(vty, " dyn_ts_allow_tch_f 0%s", VTY_NEWLINE); @@ -1021,11 +1002,8 @@ vty_out(vty, " timezone %d %d%s", gsmnet->tz.hr, gsmnet->tz.mn, VTY_NEWLINE); } - if (gsmnet->t3212 == 0) - vty_out(vty, " no periodic location update%s", VTY_NEWLINE); - else - vty_out(vty, " periodic location update %u%s", - gsmnet->t3212 * 6, VTY_NEWLINE); + + /* writing T3212 from the common T_defs_vty_write() instead. */ { uint16_t meas_port; @@ -1889,48 +1867,6 @@ return CMD_SUCCESS; } -#define DEFAULT_TIMER(number) GSM_T##number##_DEFAULT -/* Add another expansion so that DEFAULT_TIMER() becomes its value */ -#define EXPAND_AND_STRINGIFY(x) OSMO_STRINGIFY(x) - -#define DECLARE_TIMER(number, doc) \ - DEFUN(cfg_net_T##number, \ - cfg_net_T##number##_cmd, \ - "timer t" #number " (default|<1-65535>)", \ - "Configure GSM Timers\n" \ - doc " (default: " EXPAND_AND_STRINGIFY(DEFAULT_TIMER(number)) " seconds)\n" \ - "Set to default timer value" \ - " (" EXPAND_AND_STRINGIFY(DEFAULT_TIMER(number)) " seconds)\n" \ - "Timer Value in seconds\n") \ -{ \ - struct gsm_network *gsmnet = gsmnet_from_vty(vty); \ - int value; \ - if (strcmp(argv[0], "default") == 0) \ - value = DEFAULT_TIMER(number); \ - else \ - value = atoi(argv[0]); \ - \ - gsmnet->T##number = value; \ - return CMD_SUCCESS; \ -} - -DECLARE_TIMER(3101, "Set the timeout value for IMMEDIATE ASSIGNMENT") -DECLARE_TIMER(3103, "Set the timeout value for HANDOVER") -DECLARE_TIMER(3105, "Set the timer for repetition of PHYSICAL INFORMATION") -DECLARE_TIMER(3107, "Currently not used") -DECLARE_TIMER(3109, "Set the RSL SACCH deactivation timeout") -DECLARE_TIMER(3111, "Set the RSL timeout to wait before releasing the RF Channel") -DECLARE_TIMER(3113, "Set the time to try paging a subscriber") -DECLARE_TIMER(3115, "Currently not used") -DECLARE_TIMER(3117, "Currently not used") -DECLARE_TIMER(3119, "Currently not used") -DECLARE_TIMER(3122, "Default waiting time (seconds) after IMM ASS REJECT") -DECLARE_TIMER(3141, "Currently not used") -DECLARE_TIMER(10, "Assignment Command timeout in seconds") -DECLARE_TIMER(7, "Set the outgoing inter-BSC Handover timeout, from Handover Required to Handover Command") -DECLARE_TIMER(8, "Set the outgoing inter-BSC Handover timeout, from Handover Command to final Clear") -DECLARE_TIMER(101, "Set the incoming inter-BSC Handover timeout, from Handover Request to Accept") - DEFUN_DEPRECATED(cfg_net_dtx, cfg_net_dtx_cmd, "dtx-used (0|1)", @@ -4736,9 +4672,11 @@ "Periodic Location Updating Interval in Minutes\n") { struct gsm_network *net = vty->index; + struct T_def *d = T_def_get_entry(net->T_defs, 3212); - net->t3212 = atoi(argv[0]) / 6; - + OSMO_ASSERT(d); + d->val = atoi(argv[0]) / 6; + vty_out(vty, "T%d = %u %s (%s)%s", d->T, d->val, "* 6min", d->desc, VTY_NEWLINE); return CMD_SUCCESS; } @@ -4750,9 +4688,11 @@ "Periodic Location Updating Interval\n") { struct gsm_network *net = vty->index; + struct T_def *d = T_def_get_entry(net->T_defs, 3212); - net->t3212 = 0; - + OSMO_ASSERT(d); + d->val = 0; + vty_out(vty, "T%d = %u %s (%s)%s", d->T, d->val, "* 6min", d->desc, VTY_NEWLINE); return CMD_SUCCESS; } @@ -4844,23 +4784,9 @@ logging_vty_add_cmds(NULL); osmo_talloc_vty_add_cmds(); + T_defs_vty_init(network->T_defs, GSMNET_NODE); + install_element(GSMNET_NODE, &cfg_net_neci_cmd); - install_element(GSMNET_NODE, &cfg_net_T3101_cmd); - install_element(GSMNET_NODE, &cfg_net_T3103_cmd); - install_element(GSMNET_NODE, &cfg_net_T3105_cmd); - install_element(GSMNET_NODE, &cfg_net_T3107_cmd); - install_element(GSMNET_NODE, &cfg_net_T3109_cmd); - install_element(GSMNET_NODE, &cfg_net_T3111_cmd); - install_element(GSMNET_NODE, &cfg_net_T3113_cmd); - install_element(GSMNET_NODE, &cfg_net_T3115_cmd); - install_element(GSMNET_NODE, &cfg_net_T3117_cmd); - install_element(GSMNET_NODE, &cfg_net_T3119_cmd); - install_element(GSMNET_NODE, &cfg_net_T3122_cmd); - install_element(GSMNET_NODE, &cfg_net_T3141_cmd); - install_element(GSMNET_NODE, &cfg_net_T10_cmd); - install_element(GSMNET_NODE, &cfg_net_T7_cmd); - install_element(GSMNET_NODE, &cfg_net_T8_cmd); - install_element(GSMNET_NODE, &cfg_net_T101_cmd); install_element(GSMNET_NODE, &cfg_net_dtx_cmd); install_element(GSMNET_NODE, &cfg_net_pag_any_tch_cmd); /* See also handover commands added on net level from handover_vty.c */ diff --git a/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c b/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c index 1a8d9b0..d674c18 100644 --- a/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c +++ b/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c @@ -23,6 +23,7 @@ #include #include #include +#include static void patch_16(uint8_t *data, const uint16_t val) { @@ -90,7 +91,7 @@ msgb_tv_fixed_put(msgb, NM_ATT_LDAVG_SLOTS, 2, buf); /* 10 milliseconds */ - msgb_tv_put(msgb, NM_ATT_BTS_AIR_TIMER, bts->network->T3105 > 0? bts->network->T3105 : 13); + msgb_tv_put(msgb, NM_ATT_BTS_AIR_TIMER, T_def_get(bts->network->T_defs, 3105, T_MS, -1)); /* 10 retransmissions of physical config */ msgb_tv_put(msgb, NM_ATT_NY1, 10); diff --git a/src/osmo-bsc/bts_siemens_bs11.c b/src/osmo-bsc/bts_siemens_bs11.c index 2d23517..1da189f 100644 --- a/src/osmo-bsc/bts_siemens_bs11.c +++ b/src/osmo-bsc/bts_siemens_bs11.c @@ -27,6 +27,7 @@ #include #include #include +#include static int bts_model_bs11_start(struct gsm_network *net); @@ -358,7 +359,7 @@ uint8_t arfcn_high = (bts->c0->arfcn >> 8) & 0x0f; /* T3105 attribute in units of 10ms */ - bs11_attr_bts[2] = bts->network->T3105 / 10; + bs11_attr_bts[2] = T_def_get(bts->network->T_defs, 3105, T_MS, -1) / 10; /* patch ARFCN into BTS Attributes */ bs11_attr_bts[69] &= 0xf0; diff --git a/src/osmo-bsc/gsm_data.c b/src/osmo-bsc/gsm_data.c index fc12d0f..99438bc 100644 --- a/src/osmo-bsc/gsm_data.c +++ b/src/osmo-bsc/gsm_data.c @@ -39,6 +39,7 @@ #include #include #include +#include void *tall_bsc_ctx = NULL; @@ -864,7 +865,7 @@ bts->si_common.chan_desc.att = 1; /* attachment required */ bts->si_common.chan_desc.bs_pa_mfrms = RSL_BS_PA_MFRMS_5; /* paging frames */ bts->si_common.chan_desc.bs_ag_blks_res = 1; /* reserved AGCH blocks */ - bts->si_common.chan_desc.t3212 = net->t3212; /* Use network's current value */ + bts->si_common.chan_desc.t3212 = T_def_get(net->T_defs, 3212, T_CUSTOM, -1); gsm_bts_set_radio_link_timeout(bts, 32); /* Use RADIO LINK TIMEOUT of 32 */ INIT_LLIST_HEAD(&bts->abis_queue); diff --git a/src/osmo-bsc/gsm_timers.c b/src/osmo-bsc/gsm_timers.c new file mode 100644 index 0000000..cc9bdd9 --- /dev/null +++ b/src/osmo-bsc/gsm_timers.c @@ -0,0 +1,206 @@ +/* Implementation to define Tnnn timers globally and use for FSM state changes. */ +/* (C) 2018 by sysmocom - s.f.m.c. GmbH + * + * Author: Neels Hofmeyr + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include + +#include + +/* a = return_val * b. Return 0 if factor is below 1. */ +static int T_factor(enum T_unit a, enum T_unit b) +{ + if (b == a + || b == T_CUSTOM || a == T_CUSTOM) + return 1; + + switch (b) { + case T_MS: + switch (a) { + case T_S: + return 1000; + case T_M: + return 60*1000; + default: + return 0; + } + case T_S: + switch (a) { + case T_M: + return 60; + default: + return 0; + } + default: + return 0; + } +} + +static int T_round(int val, enum T_unit from_unit, enum T_unit to_unit) +{ + int f; + if (!val) + return 0; + + f = T_factor(from_unit, to_unit); + if (f < 1) { + f = T_factor(to_unit, from_unit); + return (val / f) + (val % f? 1 : 0); + } + return val * f; +} + +/* Return the value of a T timer from a list of T_defs. + * Any value is rounded up to match as_unit: 1100 ms as T_S becomes 2 seconds, as T_M becomes one minute. + * If no such timer is defined, return the default value passed, or abort the program if default < 0. + * + * Usage examples: + * + * - Initialization: + * + * struct T_def global_T_defs[] = { + * { .T=7, .default_val=50, .desc="Water Boiling Timeout" }, // default is .unit=T_S == 0 + * { .T=8, .default_val=300, .desc="Tea brewing" }, + * { .T=9, .default_val=5, .unit=T_M, .desc="Let tea cool down before drinking" }, + * { .T=10, .default_val=20, .unit=T_M, .desc="Forgot to drink tea while it's warm" }, + * {} // <-- important! last entry shall be zero + * }; + * T_defs_reset(global_T_defs); // make all values the default + * T_defs_vty_init(global_T_defs, CONFIG_NODE); + * + * val = T_def_get(global_T_defs, 7, T_S, -1); // -> 50 + * sleep(val); + * + * val = T_def_get(global_T_defs, 7, T_M, -1); // 50 seconds becomes 1 minute -> 1 + * sleep_minutes(val); + * + * val = T_def_get(global_T_defs, 99, T_S, -1); // not defined, program aborts! + * + * val = T_def_get(global_T_defs, 99, T_S, 3); // not defined, returns 3 + */ +int T_def_get(struct T_def *T_defs, int T, enum T_unit as_unit, int val_if_not_present) +{ + struct T_def *d = T_def_get_entry(T_defs, T); + if (!d) { + OSMO_ASSERT(val_if_not_present >= 0); + return val_if_not_present; + } + return T_round(d->val, d->unit, as_unit); +} + +/* Set all T_def values to the default_val. */ +void T_defs_reset(struct T_def *T_defs) +{ + struct T_def *d; + for_each_T_def(d, T_defs) + d->val = d->default_val; +} + +/* Return a pointer to a T_def from an array, or NULL. */ +struct T_def *T_def_get_entry(struct T_def *T_defs, int T) +{ + struct T_def *d; + for_each_T_def(d, T_defs) { + if (d->T == T) + return d; + } + return NULL; +} + +/* Return a state_timeout entry from an array, or return NULL if the entry is zero. + * + * The timeouts_array shall contain exactly 32 elements, which corresponds to the number of states + * allowed by osmo_fsm_*. Lookup is by array index. + * + * For example: + * struct state_timeout my_fsm_timeouts[32] = { + * [MY_FSM_STATE_3] = { .T = 423 }, + * [MY_FSM_STATE_7] = { .T = 235 }, + * [MY_FSM_STATE_8] = { .keep_timer = true }, + * // any state that is omitted will remain zero == no timeout + * }; + * get_state_timeout(MY_FSM_STATE_0, &my_fsm_timeouts) -> NULL, + * get_state_timeout(MY_FSM_STATE_7, &my_fsm_timeouts) -> { .T = 235 } + * + * The intention is then to obtain the timer like T_def_get(global_T_defs, T=235); see also + * fsm_inst_state_chg_T() below. + */ +struct state_timeout *get_state_timeout(uint32_t state, struct state_timeout *timeouts_array) +{ + struct state_timeout *t; + OSMO_ASSERT(state < 32); + t = &timeouts_array[state]; + if (!t->keep_timer && !t->T) + return NULL; + return t; +} + +/* Call osmo_fsm_inst_state_chg() or osmo_fsm_inst_state_chg_keep_timer(), depending on the T value + * defined for this state in the timeouts_array, and obtaining the actual timeout value from T_defs. + * A T timer configured in sub-second precision is rounded up to the next full second. + * + * See get_state_timeout() and T_def_get(). + * + * Should a T number be defined in timeouts_array that is not defined in T_defs, use default_timeout. + * This is best used by wrapping this function call in a macro suitable for a specific FSM + * implementation, which can become as short as: my_fsm_state_chg(fi, NEXT_STATE): + * + * #define my_fsm_state_chg(fi, NEXT_STATE) \ + * fsm_inst_state_chg_T(fi, NEXT_STATE, my_fsm_timeouts, global_T_defs, 5) + * + * my_fsm_state_chg(fi, MY_FSM_STATE_1); + * // -> No timeout configured, will enter state without timeout. + * + * my_fsm_state_chg(fi, MY_FSM_STATE_3); + * // T423 configured for this state, will look up T423 in T_defs, or use 5 seconds if unset. + * + * my_fsm_state_chg(fi, MY_FSM_STATE_8); + * // keep_timer configured for this state, will invoke osmo_fsm_inst_state_chg_keep_timer(). + * + */ +int _fsm_inst_state_chg_T(struct osmo_fsm_inst *fi, uint32_t state, + struct state_timeout *timeouts_array, + struct T_def *T_defs, int default_timeout, + const char *file, int line) +{ + struct state_timeout *t = get_state_timeout(state, timeouts_array); + int val; + + /* No timeout defined for this state? */ + if (!t) + return _osmo_fsm_inst_state_chg(fi, state, 0, 0, file, line); + + if (t->keep_timer) { + int rc = _osmo_fsm_inst_state_chg_keep_timer(fi, state, file, line); + if (t->T && !rc) + fi->T = t->T; + return rc; + } + + val = T_def_get(T_defs, t->T, T_S, default_timeout); + return _osmo_fsm_inst_state_chg(fi, state, val, t->T, file, line); +} + +const struct value_string T_unit_names[] = { + { T_S, "s" }, + { T_MS, "ms" }, + { T_CUSTOM, "(custom)" }, + { 0, NULL } +}; diff --git a/src/osmo-bsc/gsm_timers_vty.c b/src/osmo-bsc/gsm_timers_vty.c new file mode 100644 index 0000000..8a13259 --- /dev/null +++ b/src/osmo-bsc/gsm_timers_vty.c @@ -0,0 +1,117 @@ +/* Implementation to configure Tnnn timers in VTY */ +/* (C) 2018 by sysmocom - s.f.m.c. GmbH + * + * Author: Neels Hofmeyr + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include + +#include +#include + +#include + +/* Global singleton list used for the VTY configuration. See T_defs_vty_init(). */ +static struct T_def *g_vty_T_defs = NULL; + +/* Parse an argument like "T1234", "t1234" or "1234" and return the corresponding T_def entry from + * g_vty_T_defs, if any. */ +static struct T_def *parse_T_arg(struct vty *vty, const char *T_str) +{ + int T; + struct T_def *d; + + if (T_str[0] == 't' || T_str[0] == 'T') + T_str++; + T = atoi(T_str); + + d = T_def_get_entry(g_vty_T_defs, T); + if (!d) + vty_out(vty, "No such timer: T%d%s", T, VTY_NEWLINE); + return d; +} + +/* Installed in the VTY on T_defs_vty_init(). */ +DEFUN(cfg_timer, cfg_timer_cmd, + "timer TNNNN (default|<1-65535>)", + "Configure GSM Timers\n" + "T-number, optionally preceded by 't' or 'T'." + "See also 'show timer' for a list of available timers.\n" + "Set to default timer value\n" "Timer value\n") +{ + const char *val_str = argv[1]; + struct T_def *d; + + d = parse_T_arg(vty, argv[0]); + if (!d) + return CMD_WARNING; + + if (!strcmp(val_str, "default")) + d->val = d->default_val; + else + d->val = atoi(val_str); + vty_out(vty, "T%d = %u %s (%s)%s", d->T, d->val, T_unit_name(d->unit), d->desc, VTY_NEWLINE); + return CMD_SUCCESS; +} + +/* Print a T_def to the VTY. */ +static void show_one_timer(struct vty *vty, struct T_def *d) +{ + vty_out(vty, "T%d = %u %s (default = %u %s) \t%s%s", + d->T, d->val, T_unit_name(d->unit), + d->default_val, T_unit_name(d->unit), d->desc, VTY_NEWLINE); +} + +/* Installed in the VTY on T_defs_vty_init(). */ +DEFUN(show_timer, show_timer_cmd, + "show timer [TNNNN]", + SHOW_STR "GSM Timers\n" + "Specific timer to show, or all timers if omitted.\n") +{ + struct T_def *d; + + if (argc) { + d = parse_T_arg(vty, argv[0]); + if (!d) + return CMD_WARNING; + show_one_timer(vty, d); + return CMD_SUCCESS; + } + + for_each_T_def(d, g_vty_T_defs) + show_one_timer(vty, d); + return CMD_SUCCESS; +} + +/* Install GSM timer configuration commands in the VTY. */ +void T_defs_vty_init(struct T_def *T_defs, int cfg_parent_node) +{ + install_element_ve(&show_timer_cmd); + install_element(cfg_parent_node, &cfg_timer_cmd); +} + +/* Write GSM timer configuration to the vty. */ +void T_defs_vty_write(struct vty *vty, const char *indent) +{ + struct T_def *d; + for_each_T_def(d, g_vty_T_defs) { + if (d->val != d->default_val) + vty_out(vty, "%stimer t%d %u%s", indent, d->T, d->val, VTY_NEWLINE); + } +} diff --git a/src/osmo-bsc/net_init.c b/src/osmo-bsc/net_init.c index 208b4ef..1199bdc 100644 --- a/src/osmo-bsc/net_init.c +++ b/src/osmo-bsc/net_init.c @@ -23,6 +23,33 @@ #include #include #include +#include + +static struct T_def gsm_network_T_defs[] = { + { .T=7, .default_val=10, .desc="inter-BSC Handover MO, HO Required to HO Command" }, + { .T=8, .default_val=10, .desc="inter-BSC Handover MO, HO Command to final Clear" }, + { .T=10, .default_val=6, .desc="RR Assignment" }, + { .T=101, .default_val=10, .desc="inter-BSC Handover MT, HO Request to HO Accept" }, + { .T=3101, .default_val=3, .desc="RR Immediate Assignment" }, + { .T=3103, .default_val=5, .desc="Handover" }, + { .T=3105, .default_val=100, .unit=T_MS, .desc="Physical Information" }, + { .T=3107, .default_val=5, .desc="(unused)" }, + { .T=3109, .default_val=5, .desc="RSL SACCH deactivation" }, + { .T=3111, .default_val=2, .desc="Wait time before RSL RF Channel Release" }, + { .T=993111, .default_val=4, .desc="Wait time after lchan was released in error (should be T3111 + 2s)" }, + { .T=3113, .default_val=10, .desc="Paging"}, + { .T=3115, .default_val=10, .desc="(unused)" }, + { .T=3117, .default_val=10, .desc="(unused)" }, + { .T=3119, .default_val=10, .desc="(unused)" }, + { .T=3122, .default_val=GSM_T3122_DEFAULT, .desc="Wait time after RR Immediate Assignment Reject" }, + { .T=3141, .default_val=10, .desc="(unused)" }, + { .T=3212, .default_val=5, .unit=T_CUSTOM, + .desc="Periodic Location Update timer, sent to MS (1 = 6 minutes)" }, + { .T=993210, .default_val=20, .desc="After L3 Complete, wait for MSC to confirm" }, + { .T=999, .default_val=60, .desc="After Clear Request, wait for MSC to Clear Command (sanity)" }, + { .T=992427, .default_val=4, .desc="MGCP timeout (2427 is the default MGCP port number)" }, + {} +}; /* Initialize the bare minimum of struct gsm_network, minimizing required dependencies. * This part is shared among the thin programs in osmo-bsc/src/utils/. @@ -43,9 +70,6 @@ /* Permit a compile-time default of A5/3 and A5/1 */ net->a5_encryption_mask = (1 << 3) | (1 << 1); - /* Use 30 min periodic update interval as sane default */ - net->t3212 = 5; - INIT_LLIST_HEAD(&net->subscr_conns); net->bsc_subscribers = talloc_zero(net, struct llist_head); @@ -53,22 +77,9 @@ INIT_LLIST_HEAD(&net->bts_list); net->num_bts = 0; - net->T3101 = GSM_T3101_DEFAULT; - net->T3103 = GSM_T3103_DEFAULT; - net->T3105 = GSM_T3105_DEFAULT; - net->T3107 = GSM_T3107_DEFAULT; - net->T3109 = GSM_T3109_DEFAULT; - net->T3111 = GSM_T3111_DEFAULT; - net->T3113 = GSM_T3113_DEFAULT; - net->T3115 = GSM_T3115_DEFAULT; - net->T3117 = GSM_T3117_DEFAULT; - net->T3119 = GSM_T3119_DEFAULT; - net->T3122 = GSM_T3122_DEFAULT; - net->T3141 = GSM_T3141_DEFAULT; - net->T10 = GSM_T10_DEFAULT; - net->T7 = GSM_T7_DEFAULT; - net->T8 = GSM_T8_DEFAULT; - net->T101 = GSM_T101_DEFAULT; + + net->T_defs = gsm_network_T_defs; + T_defs_reset(net->T_defs); return net; } diff --git a/src/osmo-bsc/paging.c b/src/osmo-bsc/paging.c index 7e833d3..8012f67 100644 --- a/src/osmo-bsc/paging.c +++ b/src/osmo-bsc/paging.c @@ -51,6 +51,7 @@ #include #include #include +#include void *tall_paging_ctx = NULL; @@ -315,7 +316,7 @@ req->chan_type = type; req->msc = msc; osmo_timer_setup(&req->T3113, paging_T3113_expired, req); - osmo_timer_schedule(&req->T3113, bts->network->T3113, 0); + osmo_timer_schedule(&req->T3113, T_def_get(bts->network->T_defs, 3113, T_S, -1), 0); llist_add_tail(&req->entry, &bts_entry->pending_requests); paging_schedule_if_needed(bts_entry); diff --git a/src/utils/Makefile.am b/src/utils/Makefile.am index 543344b..42118a0 100644 --- a/src/utils/Makefile.am +++ b/src/utils/Makefile.am @@ -54,6 +54,7 @@ $(top_builddir)/src/osmo-bsc/bts_siemens_bs11.o \ $(top_builddir)/src/osmo-bsc/e1_config.o \ $(top_builddir)/src/osmo-bsc/gsm_data.o \ + $(top_builddir)/src/osmo-bsc/gsm_timers.o \ $(top_builddir)/src/osmo-bsc/net_init.o \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ @@ -122,6 +123,7 @@ meas_json_LDADD = \ $(top_builddir)/src/osmo-bsc/gsm_data.o \ + $(top_builddir)/src/osmo-bsc/gsm_timers.o \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOABIS_LIBS) \ diff --git a/tests/abis/Makefile.am b/tests/abis/Makefile.am index 60054d9..4fc3605 100644 --- a/tests/abis/Makefile.am +++ b/tests/abis/Makefile.am @@ -27,6 +27,7 @@ abis_test_LDADD = \ $(top_builddir)/src/osmo-bsc/abis_nm.o \ $(top_builddir)/src/osmo-bsc/gsm_data.o \ + $(top_builddir)/src/osmo-bsc/gsm_timers.o \ $(top_builddir)/src/osmo-bsc/net_init.o \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOABIS_LIBS) \ diff --git a/tests/bsc/Makefile.am b/tests/bsc/Makefile.am index 6ffeed2..ce973be 100644 --- a/tests/bsc/Makefile.am +++ b/tests/bsc/Makefile.am @@ -43,6 +43,7 @@ $(top_builddir)/src/osmo-bsc/gsm_04_08_rr.o \ $(top_builddir)/src/osmo-bsc/gsm_04_80_utils.o \ $(top_builddir)/src/osmo-bsc/gsm_data.o \ + $(top_builddir)/src/osmo-bsc/gsm_timers.o \ $(top_builddir)/src/osmo-bsc/handover_cfg.o \ $(top_builddir)/src/osmo-bsc/handover_logic.o \ $(top_builddir)/src/osmo-bsc/neighbor_ident.o \ diff --git a/tests/gsm0408/Makefile.am b/tests/gsm0408/Makefile.am index 3eb47f6..d790fc8 100644 --- a/tests/gsm0408/Makefile.am +++ b/tests/gsm0408/Makefile.am @@ -25,6 +25,7 @@ gsm0408_test_LDADD = \ $(top_builddir)/src/osmo-bsc/arfcn_range_encode.o \ $(top_builddir)/src/osmo-bsc/gsm_data.o \ + $(top_builddir)/src/osmo-bsc/gsm_timers.o \ $(top_builddir)/src/osmo-bsc/net_init.o \ $(top_builddir)/src/osmo-bsc/rest_octets.o \ $(top_builddir)/src/osmo-bsc/system_information.o \ diff --git a/tests/handover/Makefile.am b/tests/handover/Makefile.am index f8c2664..6f0fed6 100644 --- a/tests/handover/Makefile.am +++ b/tests/handover/Makefile.am @@ -54,6 +54,7 @@ $(top_builddir)/src/osmo-bsc/gsm_04_08_rr.o \ $(top_builddir)/src/osmo-bsc/gsm_04_80_utils.o \ $(top_builddir)/src/osmo-bsc/gsm_data.o \ + $(top_builddir)/src/osmo-bsc/gsm_timers.o \ $(top_builddir)/src/osmo-bsc/handover_cfg.o \ $(top_builddir)/src/osmo-bsc/handover_decision.o \ $(top_builddir)/src/osmo-bsc/handover_decision_2.o \ diff --git a/tests/nanobts_omlattr/Makefile.am b/tests/nanobts_omlattr/Makefile.am index aa7045e..312cf7d 100644 --- a/tests/nanobts_omlattr/Makefile.am +++ b/tests/nanobts_omlattr/Makefile.am @@ -26,6 +26,7 @@ $(top_builddir)/src/osmo-bsc/abis_nm.o \ $(top_builddir)/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.o \ $(top_builddir)/src/osmo-bsc/gsm_data.o \ + $(top_builddir)/src/osmo-bsc/gsm_timers.o \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOABIS_LIBS) \ diff --git a/tests/nanobts_omlattr/nanobts_omlattr_test.c b/tests/nanobts_omlattr/nanobts_omlattr_test.c index 72dabe5..7a3a80e 100644 --- a/tests/nanobts_omlattr/nanobts_omlattr_test.c +++ b/tests/nanobts_omlattr/nanobts_omlattr_test.c @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -191,6 +192,13 @@ .num_cat = ARRAY_SIZE(log_categories), }; +static struct T_def gsm_network_T_defs[] = { + { .T=3105, .default_val=100, .val=13, .unit=T_MS, .desc="Physical Information" }, + { .T=3212, .default_val=5, .unit=T_CUSTOM, + .desc="Periodic Location Update timer, sent to MS (1 = 6 minutes)" }, + {} +}; + int main(int argc, char **argv) { void *ctx; @@ -207,6 +215,7 @@ /* Allocate environmental structs (bts, net, trx) */ net = talloc_zero(ctx, struct gsm_network); INIT_LLIST_HEAD(&net->bts_list); + net->T_defs = gsm_network_T_defs; gsm_bts_model_register(&bts_model_nanobts); bts = gsm_bts_alloc_register(net, GSM_BTS_TYPE_NANOBTS, 63); OSMO_ASSERT(bts); -- To view, visit https://gerrit.osmocom.org/9670 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: If212fcd042051b6fa53484254223614c5b93a9c6 Gerrit-Change-Number: 9670 Gerrit-PatchSet: 17 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 10:43:57 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 28 Jul 2018 10:43:57 +0000 Subject: Change in osmo-bsc[master]: large refactoring: use FSMs for lchans; add inter-BSC HO In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/9671 ) Change subject: large refactoring: use FSMs for lchans; add inter-BSC HO ...................................................................... large refactoring: use FSMs for lchans; add inter-BSC HO Add FSMs: - timeslot_fsm: handle dynamic timeslots and OML+RSL availability. - lchan_fsm: handle an individual lchan activation, RTP stream and release, signal the appropriate calling FSMs on success, failure, release. - mgw_endpoint_fsm: handle one entire endpoint with several CI. - assignment_fsm: BSSMAP Assignment Request. - handover_fsm: all of intra, inter-MO and inter-MT handover. Above FSMs absorb large parts of the gscon FSM. The gscon FSM was surpassing the maximum amount events (32), and it is more logical to treat assignment, handover and MGW procedures in separate FSMs. - Add logging macros for each FSM type: - LOG_TS() - LOG_LCHAN() - LOG_MGWEP(), LOG_CI() - LOG_ASSIGNMENT() - LOG_HO() These log with the osmo_fsm_inst where present. New style decision: logging without a final newline char is awkward, especially for gsmtap logging and when other logs interleave LOGPC() calls; we have various cases where the final \n goes missing, and also this invokes the log category checking N times instead of once. So I decided to make these macros *always* append a newline, but only if there is no final newline yet. I hope that the compiler optimizes the strlen() of the constant format strings away. Thus I can log with or without typing "\n" and always get an \n termination anyway. General: - replace osmo_timers, state enums and program-wide osmo_signal_dispatch() with dedicated FSM timeouts, states and events. - introduce a common way to handle Tnnn timers: gsm_timers.h/.c: struct T_def. These can be used (with some macro magic) to define a state's timeout once, and not make mistakes for each osmo_fsm_inst_state_chg(). Details: bsc_subscr_conn_fsm.c: - move most states of this FSM to lchan_fsm, assignment_fsm, handover_fsm and mgw_endpoint_fsm. - There is exactly one state for an ongoing Assignment, with all details handled in conn->assignment.fi. The state relies on the assignment_fsm's timeout. - There is one state for an ongoing Handover; except for an incoming Handover from a remote BSS, the gscon remains in ST_INIT until the new lchan and conn are both established. - move bssmap_add_lcls_status() to osmo_bsc_lcls.c abis_rsl.c: - move all dynamic timeslot logic away into timeslot_fsm. Only keep plain send/receive functions in abis_rsl.c - reduce some rsl functions to merely send a message, rename to "_tx_". - rsl_ipacc_mdcx(): add '_tx_' in the name; move parts that change the lchan state out into the lchan_fsm, the lchan->abis_ip.* are now set there prior to invoking this function. - move all timers and error/release handling away into various FSMs. - tweak ipa_smod_s_for_lchan() and ipa_rtp_pt_for_lchan() to not require an lchan passed, but just mode,type that they require. Rename to ipacc_speech_mode*() and ipacc_payload_type(). - add rsl_forward_layer3_info, used for inter-BSC HO MO, to just send the RR message received during BSSMAP Handover Command. - move various logging to LOG_LCHAN() in order to log with the lchan FSM instance. One drawback is that the lchan FSM is limited to one logging category, i.e. this moves some logging from DRR to DRSL. It might actually make sense to combine those categories. - lose LOGP...LOGPC logging cascades: they are bad for gsmtap logging and for performance. - handle_classmark_chg(): change logging, move cm2 len check out of the cm3 condition (I hope that's correct). - gsm48_send_ho_cmd(): split off gsm48_make_ho_cmd() which doesn't send right away, so that during inter-bsc HO we can make an RR Handover Command to send via the MSC to the remote BSS. assignment_fsm.c: - the Chan Mode Modify in case of re-using the same lchan is not implemented yet, because this was also missing in the previous implementation (OS#3357). osmo_bsc_api.c: - simplify bsc_mr_config() and move to lchan_fsm.c, the only caller; rename to lchan_mr_config(). (bsc_mr_config() used to copy the values to mr_bts_lv twice, once by member assignment and then again with a memcpy.) - During handover, we used to copy the MR config from the old lchan. Since we may handover between FR and HR, rather set the MR Config anew every time, so that FR rates are always available on FR lchans, and never on HR lchans. Depends: I03ee7ce840ecfa0b6a33358e7385528aabd4873f (libosmocore), I1f2918418c38918c5ac70acaa51a47adfca12b5e (libosmocore) Change-Id: I82e3f918295daa83274a4cf803f046979f284366 --- M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/abis_rsl.h A include/osmocom/bsc/assignment_fsm.h M include/osmocom/bsc/bsc_api.h M include/osmocom/bsc/bsc_msc_data.h M include/osmocom/bsc/bsc_subscr_conn_fsm.h M include/osmocom/bsc/bsc_subscriber.h M include/osmocom/bsc/chan_alloc.h M include/osmocom/bsc/codec_pref.h M include/osmocom/bsc/gsm_04_08_rr.h M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/gsm_timers.h M include/osmocom/bsc/handover.h A include/osmocom/bsc/handover_fsm.h A include/osmocom/bsc/lchan_fsm.h A include/osmocom/bsc/lchan_select.h A include/osmocom/bsc/mgw_endpoint_fsm.h M include/osmocom/bsc/osmo_bsc.h M include/osmocom/bsc/osmo_bsc_lcls.h A include/osmocom/bsc/timeslot_fsm.h M src/ipaccess/Makefile.am M src/ipaccess/stubs.c M src/osmo-bsc/Makefile.am M src/osmo-bsc/abis_om2000.c M src/osmo-bsc/abis_rsl.c A src/osmo-bsc/assignment_fsm.c M src/osmo-bsc/bsc_api.c D src/osmo-bsc/bsc_dyn_ts.c M src/osmo-bsc/bsc_subscr_conn_fsm.c M src/osmo-bsc/bsc_subscriber.c M src/osmo-bsc/bsc_vty.c M src/osmo-bsc/bts_ericsson_rbs2000.c M src/osmo-bsc/bts_ipaccess_nanobts.c M src/osmo-bsc/bts_nokia_site.c M src/osmo-bsc/bts_siemens_bs11.c M src/osmo-bsc/chan_alloc.c M src/osmo-bsc/codec_pref.c M src/osmo-bsc/gsm_04_08_rr.c M src/osmo-bsc/gsm_data.c M src/osmo-bsc/gsm_timers.c M src/osmo-bsc/handover_decision.c M src/osmo-bsc/handover_decision_2.c A src/osmo-bsc/handover_fsm.c M src/osmo-bsc/handover_logic.c A src/osmo-bsc/lchan_fsm.c A src/osmo-bsc/lchan_select.c M src/osmo-bsc/meas_feed.c A src/osmo-bsc/mgw_endpoint_fsm.c M src/osmo-bsc/osmo_bsc_api.c D src/osmo-bsc/osmo_bsc_audio.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_ctrl.c M src/osmo-bsc/osmo_bsc_filter.c M src/osmo-bsc/osmo_bsc_grace.c M src/osmo-bsc/osmo_bsc_lcls.c M src/osmo-bsc/osmo_bsc_main.c M src/osmo-bsc/osmo_bsc_sigtran.c M src/osmo-bsc/paging.c M src/osmo-bsc/pcu_sock.c M src/osmo-bsc/system_information.c A src/osmo-bsc/timeslot_fsm.c M src/utils/Makefile.am M src/utils/bs11_config.c M src/utils/meas_json.c D src/utils/stubs.c M tests/abis/abis_test.c M tests/bsc/Makefile.am M tests/bsc/bsc_test.c M tests/codec_pref/codec_pref_test.c M tests/codec_pref/codec_pref_test.ok M tests/gsm0408/gsm0408_test.c M tests/handover/Makefile.am M tests/handover/handover_test.c M tests/handover/neighbor_ident_test.c M tests/nanobts_omlattr/nanobts_omlattr_test.c 75 files changed, 8,461 insertions(+), 4,784 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved -- To view, visit https://gerrit.osmocom.org/9671 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I82e3f918295daa83274a4cf803f046979f284366 Gerrit-Change-Number: 9671 Gerrit-PatchSet: 41 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 10:43:58 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 28 Jul 2018 10:43:58 +0000 Subject: Change in osmo-bsc[master]: fix nanobts: timeslot FSM: use flags to remember OML, RSL status In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10186 ) Change subject: fix nanobts: timeslot FSM: use flags to remember OML,RSL status ...................................................................... fix nanobts: timeslot FSM: use flags to remember OML,RSL status Before this patch, the timeslot FSM receives OML and RSL ready events. Afterwards, it relies on examining the RSL and OML status to match the received events. This doesn't work for the ip.access nanobts, which fails to change the CHANNEL OM's operational status even though it has sent an Opstart ACK. We receive OML CHANNEL Opstart ACK, but the mo's state left at OP_STATE=Disabled. We apparently cannot rely on the gsm_abis_mo state as assumed before this patch, since changing the state depends on each BTS vendor's OML implementation. Also, implementation wise, it is better to not include assumptions on RSL and OML implementations in the timeslot FSM. Simply receive the OML and RSL ready events and remember that they arrived in dedicated flags. Remove the no longer needed oml_is_ts_ready() callback from struct gsm_bts_model added in: commit 91aa68f762218906e45be4817c6ea54b480da5e1 "dyn TS: init only when both RSL and the Channel OM are established" I99f29d2ba079f6f4b77f0af12d9784588d2f56b3 This keeps osmo-bts operational while fixing ip.access nanobts, where the CHANNEL OM's state prevented the timeslot FSM from entering operation. Change-Id: I4843d03b3237cdcca0ad2041ef6895ff253d8419 --- M include/osmocom/bsc/gsm_data.h M src/osmo-bsc/bts_ericsson_rbs2000.c M src/osmo-bsc/bts_ipaccess_nanobts.c M src/osmo-bsc/timeslot_fsm.c M tests/handover/handover_test.c 5 files changed, 12 insertions(+), 17 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index ce563ef..750c027 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -605,6 +605,11 @@ * enters IN_USE state, i.e. after each TCH use we try to PDCH ACT once again. */ bool pdch_act_allowed; + /* Whether TS_EV_OML_READY was received */ + bool is_oml_ready; + /* Whether TS_EV_RSL_READY was received */ + bool is_rsl_ready; + struct gsm_abis_mo mo; struct tlv_parsed nm_attr; uint8_t nm_chan_comb; @@ -739,7 +744,6 @@ int (*start)(struct gsm_network *net); int (*oml_rcvmsg)(struct msgb *msg); char * (*oml_status)(const struct gsm_bts *bts); - bool (*oml_is_ts_ready)(const struct gsm_bts_trx_ts *ts); void (*e1line_bind_ops)(struct e1inp_line *line); diff --git a/src/osmo-bsc/bts_ericsson_rbs2000.c b/src/osmo-bsc/bts_ericsson_rbs2000.c index c2975f4..ed3db93 100644 --- a/src/osmo-bsc/bts_ericsson_rbs2000.c +++ b/src/osmo-bsc/bts_ericsson_rbs2000.c @@ -175,17 +175,11 @@ e1inp_line_bind_ops(line, &bts_isdn_e1inp_line_ops); } -static bool bts_model_rbs2k_is_ts_ready(const struct gsm_bts_trx_ts *ts) -{ - return ts && ts->mo.nm_state.operational == NM_OPSTATE_ENABLED; -} - static struct gsm_bts_model model_rbs2k = { .type = GSM_BTS_TYPE_RBS2000, .name = "rbs2000", .start = bts_model_rbs2k_start, .oml_rcvmsg = &abis_om2k_rcvmsg, - .oml_is_ts_ready = bts_model_rbs2k_is_ts_ready, .config_write_bts = &config_write_bts, .e1line_bind_ops = &bts_model_rbs2k_e1line_bind_ops, }; diff --git a/src/osmo-bsc/bts_ipaccess_nanobts.c b/src/osmo-bsc/bts_ipaccess_nanobts.c index 6b6e265..80f7c9c 100644 --- a/src/osmo-bsc/bts_ipaccess_nanobts.c +++ b/src/osmo-bsc/bts_ipaccess_nanobts.c @@ -55,18 +55,12 @@ return "disconnected"; } -static bool oml_is_ts_ready(const struct gsm_bts_trx_ts *ts) -{ - return ts && ts->mo.nm_state.operational == NM_OPSTATE_ENABLED; -} - struct gsm_bts_model bts_model_nanobts = { .type = GSM_BTS_TYPE_NANOBTS, .name = "nanobts", .start = bts_model_nanobts_start, .oml_rcvmsg = &abis_nm_rcvmsg, .oml_status = &get_oml_status, - .oml_is_ts_ready = oml_is_ts_ready, .e1line_bind_ops = bts_model_nanobts_e1line_bind_ops, .nm_att_tlvdef = { .def = { diff --git a/src/osmo-bsc/timeslot_fsm.c b/src/osmo-bsc/timeslot_fsm.c index 84d80f8..245ce76 100644 --- a/src/osmo-bsc/timeslot_fsm.c +++ b/src/osmo-bsc/timeslot_fsm.c @@ -220,13 +220,13 @@ static void ts_fsm_not_initialized(struct osmo_fsm_inst *fi, uint32_t event, void *data) { struct gsm_bts_trx_ts *ts = ts_fi_ts(fi); - struct gsm_bts *bts = ts->trx->bts; switch (event) { case TS_EV_OML_READY: ts->pdch_act_allowed = true; + ts->is_oml_ready = true; ts_setup_lchans(ts); - if (!ts->trx->rsl_link) { + if (!ts->is_rsl_ready) { LOG_TS(ts, LOGL_DEBUG, "No RSL link yet\n"); return; } @@ -235,8 +235,8 @@ case TS_EV_RSL_READY: ts->pdch_act_allowed = true; - if (bts->model->oml_is_ts_ready - && !bts->model->oml_is_ts_ready(ts)) { + ts->is_rsl_ready = true; + if (!ts->is_oml_ready) { LOG_TS(ts, LOGL_DEBUG, "OML not ready yet\n"); return; } @@ -680,6 +680,7 @@ struct gsm_bts_trx_ts *ts = ts_fi_ts(fi); switch (event) { case TS_EV_OML_DOWN: + ts->is_oml_ready = false; if (fi->state != TS_ST_NOT_INITIALIZED) osmo_fsm_inst_state_chg(fi, TS_ST_NOT_INITIALIZED, 0, 0); OSMO_ASSERT(fi->state == TS_ST_NOT_INITIALIZED); @@ -689,6 +690,7 @@ break; case TS_EV_RSL_DOWN: + ts->is_rsl_ready = false; if (fi->state != TS_ST_NOT_INITIALIZED) osmo_fsm_inst_state_chg(fi, TS_ST_NOT_INITIALIZED, 0, 0); OSMO_ASSERT(fi->state == TS_ST_NOT_INITIALIZED); diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c index 3a5748e..172e620 100644 --- a/tests/handover/handover_test.c +++ b/tests/handover/handover_test.c @@ -210,6 +210,7 @@ for (i = 0; i < ARRAY_SIZE(bts->c0->ts); i++) { /* make sure ts->lchans[] get initialized */ + osmo_fsm_inst_dispatch(bts->c0->ts[i].fi, TS_EV_RSL_READY, 0); osmo_fsm_inst_dispatch(bts->c0->ts[i].fi, TS_EV_OML_READY, 0); } return bts; -- To view, visit https://gerrit.osmocom.org/10186 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I4843d03b3237cdcca0ad2041ef6895ff253d8419 Gerrit-Change-Number: 10186 Gerrit-PatchSet: 3 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 10:43:58 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 28 Jul 2018 10:43:58 +0000 Subject: Change in osmo-bsc[master]: fix: dispatch TS_EV_RSL_DOWN when losing RSL In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10190 ) Change subject: fix: dispatch TS_EV_RSL_DOWN when losing RSL ...................................................................... fix: dispatch TS_EV_RSL_DOWN when losing RSL Noticed by ttcn3-bsc-test: after TC_ms_rel_ind_does_not_cause_bssmap_reset the test TC_dyn_pdch_ipa_act_deact would fail because RSL was still indicated as available, and only OML was properly signalled as down. Before recent commit I4843d03b3237cdcca0ad2041ef6895ff253d8419 to fix nanobts and use only flags for RSL and OML presence, the timeslot FSM actually checked RSL link presence and the lacking RSL DOWN event was not noticed. Change-Id: I66c7fc5fcc676f4960f3d089b8c2ae5bce37ed99 --- M src/osmo-bsc/osmo_bsc_main.c 1 file changed, 14 insertions(+), 14 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index 218ea15..8dc9098 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -309,13 +309,22 @@ } } +static void all_ts_dispatch_event(struct gsm_bts_trx *trx, uint32_t event) +{ + int ts_i; + for (ts_i = 0; ts_i < ARRAY_SIZE(trx->ts); ts_i++) { + struct gsm_bts_trx_ts *ts = &trx->ts[ts_i]; + if (ts->fi) + osmo_fsm_inst_dispatch(ts->fi, event, 0); + } +} + /* Callback function to be called every time we receive a signal from INPUT */ static int inp_sig_cb(unsigned int subsys, unsigned int signal, void *handler_data, void *signal_data) { struct input_signal_data *isd = signal_data; struct gsm_bts_trx *trx = isd->trx; - int ts_no; /* N. B: we rely on attribute order when parsing response in abis_nm_rx_get_attr_resp() */ const uint8_t bts_attr[] = { NM_ATT_MANUF_ID, NM_ATT_SW_CONFIG, }; const uint8_t trx_attr[] = { NM_ATT_MANUF_STATE, NM_ATT_SW_CONFIG, }; @@ -360,22 +369,13 @@ case S_L_INP_TEI_DN: LOGP(DLMI, LOGL_ERROR, "Lost some E1 TEI link: %d %p\n", isd->link_type, trx); - if (isd->link_type == E1INP_SIGN_OML) + if (isd->link_type == E1INP_SIGN_OML) { rate_ctr_inc(&trx->bts->bts_ctrs->ctr[BTS_CTR_BTS_OML_FAIL]); - else if (isd->link_type == E1INP_SIGN_RSL) { + all_ts_dispatch_event(trx, TS_EV_OML_DOWN); + } else if (isd->link_type == E1INP_SIGN_RSL) { rate_ctr_inc(&trx->bts->bts_ctrs->ctr[BTS_CTR_BTS_RSL_FAIL]); acc_ramp_abort(&trx->bts->acc_ramp); - } - - /* - * free all allocated channels. change the nm_state so the - * trx and trx_ts becomes unusable and chan_alloc.c can not - * allocate from it. - */ - for (ts_no = 0; ts_no < ARRAY_SIZE(trx->ts); ++ts_no) { - struct gsm_bts_trx_ts *ts = &trx->ts[ts_no]; - if (ts->fi) - osmo_fsm_inst_dispatch(ts->fi, TS_EV_OML_DOWN, 0); + all_ts_dispatch_event(trx, TS_EV_RSL_DOWN); } gsm_bts_mo_reset(trx->bts); -- To view, visit https://gerrit.osmocom.org/10190 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I66c7fc5fcc676f4960f3d089b8c2ae5bce37ed99 Gerrit-Change-Number: 10190 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 10:43:59 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 28 Jul 2018 10:43:59 +0000 Subject: Change in osmo-bsc[master]: timeslot FSM: fix infinite recursion on failure to send PDCH ACT In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10191 ) Change subject: timeslot FSM: fix infinite recursion on failure to send PDCH ACT ...................................................................... timeslot FSM: fix infinite recursion on failure to send PDCH ACT If PDCH ACT sending fails and we go back to UNUSED, the UNUSED onenter goes right back to PDCH ACT and we loop. Avoid by going straight to broken state. Actually, if we can't send messages, the timeslot is obviously broken, so also enter the broken state if PDCH deactivation fails to be sent out. Change-Id: Iebaffd0547a9651c5ba435b54dedab99c2cfdd31 --- M src/osmo-bsc/timeslot_fsm.c 1 file changed, 7 insertions(+), 4 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/osmo-bsc/timeslot_fsm.c b/src/osmo-bsc/timeslot_fsm.c index 245ce76..4514f34 100644 --- a/src/osmo-bsc/timeslot_fsm.c +++ b/src/osmo-bsc/timeslot_fsm.c @@ -345,9 +345,11 @@ rc = rsl_tx_dyn_ts_pdch_act_deact(ts, true); - /* On error, we couldn't send the activation message and remain unused. */ + /* On error, we couldn't send the activation message. If we can't send messages, we're broken. + * (Also avoiding a recursion loop: enter UNUSED, try to PDCH act, fail, enter UNUSED, try to + * PDCH act,...). */ if (rc) - ts_fsm_error(fi, TS_ST_UNUSED, "Unable to send PDCH activation"); + ts_fsm_error(fi, TS_ST_BORKEN, "Unable to send PDCH activation"); } static void ts_fsm_wait_pdch_act(struct osmo_fsm_inst *fi, uint32_t event, void *data) @@ -464,9 +466,10 @@ rc = rsl_tx_dyn_ts_pdch_act_deact(ts, false); - /* On error, we couldn't send the deactivation message and remain in PDCH. */ + /* On error, we couldn't send the deactivation message. If we can't send messages, we're broken. + */ if (rc) - ts_fsm_error(fi, TS_ST_PDCH, "Unable to send PDCH deactivation"); + ts_fsm_error(fi, TS_ST_BORKEN, "Unable to send PDCH deactivation"); } static void ts_fsm_wait_pdch_deact(struct osmo_fsm_inst *fi, uint32_t event, void *data) -- To view, visit https://gerrit.osmocom.org/10191 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iebaffd0547a9651c5ba435b54dedab99c2cfdd31 Gerrit-Change-Number: 10191 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 10:44:00 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 28 Jul 2018 10:44:00 +0000 Subject: Change in osmo-bsc[master]: timeslot FSM: permit entering broken state from anywhere In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10192 ) Change subject: timeslot FSM: permit entering broken state from anywhere ...................................................................... timeslot FSM: permit entering broken state from anywhere Change-Id: I59abcef2ee1d9e307f8eacf1d5ea663e19099a6a --- M src/osmo-bsc/timeslot_fsm.c 1 file changed, 5 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/osmo-bsc/timeslot_fsm.c b/src/osmo-bsc/timeslot_fsm.c index 4514f34..21de2fa 100644 --- a/src/osmo-bsc/timeslot_fsm.c +++ b/src/osmo-bsc/timeslot_fsm.c @@ -720,6 +720,7 @@ , .out_state_mask = 0 | S(TS_ST_UNUSED) + | S(TS_ST_BORKEN) , }, [TS_ST_UNUSED] = { @@ -734,6 +735,7 @@ | S(TS_ST_WAIT_PDCH_ACT) | S(TS_ST_IN_USE) | S(TS_ST_NOT_INITIALIZED) + | S(TS_ST_BORKEN) , }, [TS_ST_WAIT_PDCH_ACT] = { @@ -764,6 +766,7 @@ .out_state_mask = 0 | S(TS_ST_WAIT_PDCH_DEACT) | S(TS_ST_NOT_INITIALIZED) + | S(TS_ST_BORKEN) , }, [TS_ST_WAIT_PDCH_DEACT] = { @@ -781,6 +784,7 @@ | S(TS_ST_UNUSED) | S(TS_ST_BORKEN) | S(TS_ST_NOT_INITIALIZED) + | S(TS_ST_BORKEN) , }, [TS_ST_IN_USE] = { @@ -794,6 +798,7 @@ .out_state_mask = 0 | S(TS_ST_UNUSED) | S(TS_ST_NOT_INITIALIZED) + | S(TS_ST_BORKEN) , }, [TS_ST_BORKEN] = { -- To view, visit https://gerrit.osmocom.org/10192 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I59abcef2ee1d9e307f8eacf1d5ea663e19099a6a Gerrit-Change-Number: 10192 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 10:44:01 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 28 Jul 2018 10:44:01 +0000 Subject: Change in osmo-bsc[master]: cosmetic: FSMs: allow ignorable events In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10101 ) Change subject: cosmetic: FSMs: allow ignorable events ...................................................................... cosmetic: FSMs: allow ignorable events In various FSMs, some events may appear later or earlier without need of action. Do not indicate these as 'ERROR' (event not permitted), but allow and ignore them. Debug-log about some of those. >From the old code, we've taken over the habit to change into WAIT_BEFORE_RF_RELEASE even before SAPI[0] is released. Hence we may still receive a SAPI[0] REL_IND in WAIT_BEFORE_RF_RELEASE. Don't show this as error message, just silently accept it. Change-Id: Ie320c7c6a1436184aaf2ec5a1843e04f4b3414ab --- M src/osmo-bsc/assignment_fsm.c M src/osmo-bsc/handover_fsm.c M src/osmo-bsc/lchan_fsm.c 3 files changed, 60 insertions(+), 6 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/osmo-bsc/assignment_fsm.c b/src/osmo-bsc/assignment_fsm.c index e73f902..a2b1746 100644 --- a/src/osmo-bsc/assignment_fsm.c +++ b/src/osmo-bsc/assignment_fsm.c @@ -432,8 +432,9 @@ return; case ASSIGNMENT_EV_LCHAN_ESTABLISHED: - /* The lchan is already done with all of its RTP setup. We will notice the lchan state to - * be established in assignment_fsm_wait_lchan_established_onenter(). */ + LOG_ASSIGNMENT(conn, LOGL_DEBUG, "lchan established, still waiting for RR Assignment Complete\n"); + /* The lchan is already done with all of its RTP setup. We will notice the lchan state + * being LCHAN_ST_ESTABLISHED in assignment_fsm_wait_lchan_established_onenter(). */ return; case ASSIGNMENT_EV_RR_ASSIGNMENT_FAIL: @@ -452,8 +453,10 @@ { struct gsm_subscriber_connection *conn = assignment_fi_conn(fi); /* Do we still need to wait for the RTP stream at all? */ - if (lchan_state_is(conn->assignment.new_lchan, LCHAN_ST_ESTABLISHED)) + if (lchan_state_is(conn->assignment.new_lchan, LCHAN_ST_ESTABLISHED)) { + LOG_ASSIGNMENT(conn, LOGL_DEBUG, "lchan fully established, no need to wait"); assignment_fsm_post_lchan_established(fi); + } } static void assignment_fsm_wait_lchan_established(struct osmo_fsm_inst *fi, uint32_t event, void *data) @@ -557,6 +560,7 @@ .in_event_mask = 0 | S(ASSIGNMENT_EV_RR_ASSIGNMENT_COMPLETE) | S(ASSIGNMENT_EV_RR_ASSIGNMENT_FAIL) + | S(ASSIGNMENT_EV_LCHAN_ESTABLISHED) , .out_state_mask = 0 | S(ASSIGNMENT_ST_WAIT_LCHAN_ESTABLISHED) diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c index 0430a7f..0a6ee24 100644 --- a/src/osmo-bsc/handover_fsm.c +++ b/src/osmo-bsc/handover_fsm.c @@ -870,6 +870,16 @@ switch (event) { + case HO_EV_RR_HO_DETECT: + /* Numerous HO Detect RACH bursts may follow after the initial one, ignore. */ + return; + + case HO_EV_LCHAN_ESTABLISHED: + LOG_HO(conn, LOGL_DEBUG, "lchan established, still waiting for RR Handover Complete\n"); + /* The lchan is already done with all of its RTP setup. We will notice the lchan state + * being LCHAN_ST_ESTABLISHED in ho_fsm_wait_lchan_established_onenter(). */ + return; + case HO_EV_RR_HO_COMPLETE: ho_fsm_state_chg(HO_ST_WAIT_LCHAN_ESTABLISHED); return; @@ -889,8 +899,10 @@ { struct gsm_subscriber_connection *conn = ho_fi_conn(fi); - if (conn->ho.fi && lchan_state_is(conn->ho.new_lchan, LCHAN_ST_ESTABLISHED)) + if (conn->ho.fi && lchan_state_is(conn->ho.new_lchan, LCHAN_ST_ESTABLISHED)) { + LOG_HO(conn, LOGL_DEBUG, "lchan already established earlier\n"); ho_fsm_post_lchan_established(fi); + } } static void ho_fsm_wait_lchan_established(struct osmo_fsm_inst *fi, uint32_t event, void *data) @@ -1066,6 +1078,8 @@ .name = "WAIT_RR_HO_COMPLETE", .action = ho_fsm_wait_rr_ho_complete, .in_event_mask = 0 + | S(HO_EV_RR_HO_DETECT) /* ignore extra HO RACH */ + | S(HO_EV_LCHAN_ESTABLISHED) | S(HO_EV_RR_HO_COMPLETE) | S(HO_EV_RR_HO_FAIL) , diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c index 7a9f57f..9f053ac 100644 --- a/src/osmo-bsc/lchan_fsm.c +++ b/src/osmo-bsc/lchan_fsm.c @@ -755,7 +755,11 @@ case LCHAN_EV_MGW_ENDPOINT_AVAILABLE: lchan->activate.mgw_endpoint_available = true; lchan_fsm_tch_post_endpoint_available(fi); - break; + return; + + case LCHAN_EV_RLL_ESTABLISH_IND: + /* abis_rsl.c has noticed that a SAPI was established, no need to take action here. */ + return; default: OSMO_ASSERT(false); @@ -828,6 +832,10 @@ lchan_fail("Received NACK on IPACC CRCX"); return; + case LCHAN_EV_RLL_ESTABLISH_IND: + /* abis_rsl.c has noticed that a SAPI was established, no need to take action here. */ + return; + default: OSMO_ASSERT(false); } @@ -879,6 +887,10 @@ lchan_fail("Received NACK on IPACC MDCX"); return; + case LCHAN_EV_RLL_ESTABLISH_IND: + /* abis_rsl.c has noticed that a SAPI was established, no need to take action here. */ + return; + default: OSMO_ASSERT(false); } @@ -946,6 +958,10 @@ lchan_fail("Error while redirecting the MGW to the BTS' RTP port"); return; + case LCHAN_EV_RLL_ESTABLISH_IND: + /* abis_rsl.c has noticed that a SAPI was established, no need to take action here. */ + return; + default: OSMO_ASSERT(false); } @@ -1033,7 +1049,19 @@ static void lchan_fsm_established(struct osmo_fsm_inst *fi, uint32_t event, void *data) { - handle_rll_rel_ind_or_conf(fi, event, data, true); + switch (event) { + case LCHAN_EV_RLL_ESTABLISH_IND: + /* abis_rsl.c has noticed that a SAPI was established, no need to take action here. */ + return; + + case LCHAN_EV_RLL_REL_IND: + case LCHAN_EV_RLL_REL_CONF: + handle_rll_rel_ind_or_conf(fi, event, data, true); + return; + + default: + OSMO_ASSERT(false); + } } static bool should_sacch_deact(struct gsm_lchan *lchan) @@ -1236,6 +1264,7 @@ .action = lchan_fsm_wait_mgw_endpoint_available, .in_event_mask = 0 | S(LCHAN_EV_MGW_ENDPOINT_AVAILABLE) + | S(LCHAN_EV_RLL_ESTABLISH_IND) /* ignored */ , .out_state_mask = 0 | S(LCHAN_ST_UNUSED) @@ -1252,6 +1281,7 @@ .in_event_mask = 0 | S(LCHAN_EV_IPACC_CRCX_ACK) | S(LCHAN_EV_IPACC_CRCX_NACK) + | S(LCHAN_EV_RLL_ESTABLISH_IND) /* ignored */ , .out_state_mask = 0 | S(LCHAN_ST_UNUSED) @@ -1267,6 +1297,7 @@ .in_event_mask = 0 | S(LCHAN_EV_IPACC_MDCX_ACK) | S(LCHAN_EV_IPACC_MDCX_NACK) + | S(LCHAN_EV_RLL_ESTABLISH_IND) /* ignored */ , .out_state_mask = 0 | S(LCHAN_ST_UNUSED) @@ -1281,6 +1312,7 @@ .action = lchan_fsm_wait_mgw_endpoint_configured, .in_event_mask = 0 | S(LCHAN_EV_MGW_ENDPOINT_CONFIGURED) + | S(LCHAN_EV_RLL_ESTABLISH_IND) /* ignored */ , .out_state_mask = 0 | S(LCHAN_ST_UNUSED) @@ -1296,6 +1328,7 @@ .in_event_mask = 0 | S(LCHAN_EV_RLL_REL_IND) | S(LCHAN_EV_RLL_REL_CONF) + | S(LCHAN_EV_RLL_ESTABLISH_IND) /* ignored */ , .out_state_mask = 0 | S(LCHAN_ST_UNUSED) @@ -1320,6 +1353,9 @@ }, [LCHAN_ST_WAIT_BEFORE_RF_RELEASE] = { .name = "WAIT_BEFORE_RF_RELEASE", + .in_event_mask = 0 + | S(LCHAN_EV_RLL_REL_IND) /* allow late REL_IND of SAPI[0] */ + , .out_state_mask = 0 | S(LCHAN_ST_UNUSED) | S(LCHAN_ST_WAIT_RF_RELEASE_ACK) -- To view, visit https://gerrit.osmocom.org/10101 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ie320c7c6a1436184aaf2ec5a1843e04f4b3414ab Gerrit-Change-Number: 10101 Gerrit-PatchSet: 9 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 10:44:02 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 28 Jul 2018 10:44:02 +0000 Subject: Change in osmo-bsc[master]: fix BSC_CTR_ASSIGNMENT doc strings In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10102 ) Change subject: fix BSC_CTR_ASSIGNMENT doc strings ...................................................................... fix BSC_CTR_ASSIGNMENT doc strings Change-Id: I9de0c16a14edd8bf4f02b7781ccfd211e0a79463 --- M include/osmocom/bsc/gsm_data.h 1 file changed, 7 insertions(+), 7 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 750c027..d8d10c9 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -1311,13 +1311,13 @@ }; static const struct rate_ctr_desc bsc_ctr_description[] = { - [BSC_CTR_ASSIGNMENT_ATTEMPTED] = {"assignment:attempted", "Intra-cell re-assignment attempts."}, - [BSC_CTR_ASSIGNMENT_COMPLETED] = {"assignment:completed", "Intra-cell re-assignment completed."}, - [BSC_CTR_ASSIGNMENT_STOPPED] = {"assignment:stopped", "Connection ended during re-assignment."}, - [BSC_CTR_ASSIGNMENT_NO_CHANNEL] = {"assignment:no_channel", "Failure to allocate lchan for re-assignment."}, - [BSC_CTR_ASSIGNMENT_TIMEOUT] = {"assignment:timeout", "Re-assignment timed out."}, - [BSC_CTR_ASSIGNMENT_FAILED] = {"assignment:failed", "Received FAIL message."}, - [BSC_CTR_ASSIGNMENT_ERROR] = {"assignment:error", "Re-assigment failed for other reason."}, + [BSC_CTR_ASSIGNMENT_ATTEMPTED] = {"assignment:attempted", "Assignment attempts."}, + [BSC_CTR_ASSIGNMENT_COMPLETED] = {"assignment:completed", "Assignment completed."}, + [BSC_CTR_ASSIGNMENT_STOPPED] = {"assignment:stopped", "Connection ended during Assignment."}, + [BSC_CTR_ASSIGNMENT_NO_CHANNEL] = {"assignment:no_channel", "Failure to allocate lchan for Assignment."}, + [BSC_CTR_ASSIGNMENT_TIMEOUT] = {"assignment:timeout", "Assignment timed out."}, + [BSC_CTR_ASSIGNMENT_FAILED] = {"assignment:failed", "Received Assignment Failure message."}, + [BSC_CTR_ASSIGNMENT_ERROR] = {"assignment:error", "Assigment failed for other reason."}, [BSC_CTR_HANDOVER_ATTEMPTED] = {"handover:attempted", "Intra-BSC handover attempts."}, [BSC_CTR_HANDOVER_COMPLETED] = {"handover:completed", "Intra-BSC handover completed."}, -- To view, visit https://gerrit.osmocom.org/10102 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I9de0c16a14edd8bf4f02b7781ccfd211e0a79463 Gerrit-Change-Number: 10102 Gerrit-PatchSet: 9 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 10:44:03 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 28 Jul 2018 10:44:03 +0000 Subject: Change in osmo-bsc[master]: lchan_fsm: split off lchan_rtp_fsm, establish RTP a bit earlier In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10103 ) Change subject: lchan_fsm: split off lchan_rtp_fsm, establish RTP a bit earlier ...................................................................... lchan_fsm: split off lchan_rtp_fsm, establish RTP a bit earlier Change-Id: Id7a4407d9b63be05ce63f5f2768b7d7e3d5c86fb --- M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/lchan_fsm.h A include/osmocom/bsc/lchan_rtp_fsm.h M src/osmo-bsc/Makefile.am M src/osmo-bsc/abis_rsl.c M src/osmo-bsc/bsc_subscr_conn_fsm.c M src/osmo-bsc/handover_fsm.c M src/osmo-bsc/lchan_fsm.c A src/osmo-bsc/lchan_rtp_fsm.c M tests/handover/Makefile.am M tests/handover/handover_test.c 12 files changed, 1,038 insertions(+), 481 deletions(-) Approvals: Jenkins Builder: Verified Neels Hofmeyr: Looks good to me, approved diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am index f73417e..57837ec 100644 --- a/include/osmocom/bsc/Makefile.am +++ b/include/osmocom/bsc/Makefile.am @@ -29,6 +29,7 @@ handover_vty.h \ ipaccess.h \ lchan_fsm.h \ + lchan_rtp_fsm.h \ lchan_select.h \ meas_feed.h \ meas_rep.h \ diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index d8d10c9..12bc5c3 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -499,13 +499,15 @@ char *name; struct osmo_fsm_inst *fi; + struct osmo_fsm_inst *fi_rtp; struct mgwep_ci *mgw_endpoint_ci_bts; struct { enum lchan_activate_mode activ_for; + bool activ_ack; /*< true as soon as RSL Chan Activ Ack is received */ bool concluded; /*< true as soon as LCHAN_ST_ESTABLISHED is reached */ bool requires_voice_stream; - bool mgw_endpoint_available; + bool wait_before_switching_rtp; /*< true = requires LCHAN_EV_READY_TO_SWITCH_RTP */ uint16_t msc_assigned_cic; enum gsm0808_cause gsm0808_error_cause; struct gsm_lchan *re_use_mgw_endpoint_from_lchan; diff --git a/include/osmocom/bsc/lchan_fsm.h b/include/osmocom/bsc/lchan_fsm.h index 49701c1..35b8847 100644 --- a/include/osmocom/bsc/lchan_fsm.h +++ b/include/osmocom/bsc/lchan_fsm.h @@ -16,13 +16,9 @@ LCHAN_ST_UNUSED, LCHAN_ST_WAIT_TS_READY, LCHAN_ST_WAIT_ACTIV_ACK, /*< After RSL Chan Act Ack, lchan is active but RTP not configured. */ - LCHAN_ST_WAIT_RLL_ESTABLISH, - LCHAN_ST_WAIT_MGW_ENDPOINT_AVAILABLE, - LCHAN_ST_WAIT_IPACC_CRCX_ACK, - LCHAN_ST_WAIT_IPACC_MDCX_ACK, - LCHAN_ST_WAIT_MGW_ENDPOINT_CONFIGURED, + LCHAN_ST_WAIT_RLL_RTP_ESTABLISH, LCHAN_ST_ESTABLISHED, /*< Active and RTP is fully configured. */ - LCHAN_ST_WAIT_SAPIS_RELEASED, + LCHAN_ST_WAIT_RLL_RTP_RELEASED, LCHAN_ST_WAIT_BEFORE_RF_RELEASE, LCHAN_ST_WAIT_RF_RELEASE_ACK, LCHAN_ST_WAIT_AFTER_ERROR, @@ -36,13 +32,9 @@ LCHAN_EV_RSL_CHAN_ACTIV_ACK, LCHAN_EV_RSL_CHAN_ACTIV_NACK, LCHAN_EV_RLL_ESTABLISH_IND, - LCHAN_EV_MGW_ENDPOINT_AVAILABLE, - LCHAN_EV_MGW_ENDPOINT_CONFIGURED, - LCHAN_EV_MGW_ENDPOINT_ERROR, - LCHAN_EV_IPACC_CRCX_ACK, - LCHAN_EV_IPACC_CRCX_NACK, - LCHAN_EV_IPACC_MDCX_ACK, - LCHAN_EV_IPACC_MDCX_NACK, + LCHAN_EV_RTP_READY, + LCHAN_EV_RTP_ERROR, + LCHAN_EV_RTP_RELEASED, LCHAN_EV_RLL_REL_IND, LCHAN_EV_RLL_REL_CONF, LCHAN_EV_RSL_RF_CHAN_REL_ACK, @@ -66,11 +58,13 @@ * When a dyn TS was selected, the lchan->type has been set to the desired rate. */ enum gsm48_chan_mode chan_mode; bool requires_voice_stream; + bool wait_before_switching_rtp; uint16_t msc_assigned_cic; struct gsm_lchan *old_lchan; }; void lchan_activate(struct gsm_lchan *lchan, struct lchan_activate_info *info); +void lchan_ready_to_switch_rtp(struct gsm_lchan *lchan); static inline const char *lchan_state_name(struct gsm_lchan *lchan) { @@ -86,4 +80,5 @@ bool lchan_may_receive_data(struct gsm_lchan *lchan); void lchan_forget_conn(struct gsm_lchan *lchan); -void lchan_forget_mgw_endpoint(struct gsm_lchan *lchan); + +void lchan_set_last_error(struct gsm_lchan *lchan, const char *fmt, ...); diff --git a/include/osmocom/bsc/lchan_rtp_fsm.h b/include/osmocom/bsc/lchan_rtp_fsm.h new file mode 100644 index 0000000..fa0e746 --- /dev/null +++ b/include/osmocom/bsc/lchan_rtp_fsm.h @@ -0,0 +1,45 @@ +/* osmo-bsc API to manage lchans, logical channels in GSM cells. */ +#pragma once + +#define LOG_LCHAN_RTP(lchan, level, fmt, args...) do { \ + if (lchan->fi_rtp) \ + LOGPFSML(lchan->fi_rtp, level, fmt, ## args); \ + else \ + LOGP(DLMGCP, level, "%s (not initialized) " fmt, gsm_lchan_name(lchan), \ + ## args); \ + } while(0) + +struct gsm_lchan; + +enum lchan_rtp_fsm_state { + LCHAN_RTP_ST_WAIT_MGW_ENDPOINT_AVAILABLE, + LCHAN_RTP_ST_WAIT_LCHAN_READY, + LCHAN_RTP_ST_WAIT_IPACC_CRCX_ACK, + LCHAN_RTP_ST_WAIT_IPACC_MDCX_ACK, + LCHAN_RTP_ST_WAIT_READY_TO_SWITCH_RTP, + LCHAN_RTP_ST_WAIT_MGW_ENDPOINT_CONFIGURED, + LCHAN_RTP_ST_READY, + LCHAN_RTP_ST_ROLLBACK, + LCHAN_RTP_ST_ESTABLISHED, +}; + +enum lchan_rtp_fsm_event { + LCHAN_RTP_EV_LCHAN_READY, + LCHAN_RTP_EV_READY_TO_SWITCH_RTP, + LCHAN_RTP_EV_MGW_ENDPOINT_AVAILABLE, + LCHAN_RTP_EV_MGW_ENDPOINT_ERROR, + LCHAN_RTP_EV_IPACC_CRCX_ACK, + LCHAN_RTP_EV_IPACC_CRCX_NACK, + LCHAN_RTP_EV_IPACC_MDCX_ACK, + LCHAN_RTP_EV_IPACC_MDCX_NACK, + LCHAN_RTP_EV_READY_TO_SWITCH, + LCHAN_RTP_EV_MGW_ENDPOINT_CONFIGURED, + LCHAN_RTP_EV_ROLLBACK, /*< Give the RTP back to the old lchan, if any */ + LCHAN_RTP_EV_ESTABLISHED, /*< All done, forget about the old lchan, if any */ + LCHAN_RTP_EV_RELEASE, +}; + +void lchan_rtp_fsm_start(struct gsm_lchan *lchan); +struct mgwep_ci *lchan_use_mgw_endpoint_ci_bts(struct gsm_lchan *lchan); +bool lchan_rtp_established(struct gsm_lchan *lchan); +void lchan_forget_mgw_endpoint(struct gsm_lchan *lchan); diff --git a/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am index d88c6a6..e9add36 100644 --- a/src/osmo-bsc/Makefile.am +++ b/src/osmo-bsc/Makefile.am @@ -67,6 +67,7 @@ handover_logic.c \ handover_vty.c \ lchan_fsm.c \ + lchan_rtp_fsm.c \ lchan_select.c \ meas_feed.c \ meas_rep.c \ diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c index 8b944d9..8b14b49 100644 --- a/src/osmo-bsc/abis_rsl.c +++ b/src/osmo-bsc/abis_rsl.c @@ -50,6 +50,7 @@ #include #include #include +#include #include #define RSL_ALLOC_SIZE 1024 @@ -1878,6 +1879,11 @@ struct tlv_parsed tv; struct gsm_lchan *lchan = msg->lchan; + if (!lchan->fi_rtp) { + LOG_LCHAN(msg->lchan, LOGL_ERROR, "Rx RSL IPACC: CRCX ACK message for unconfigured lchan"); + return -EINVAL; + } + /* the BTS has acknowledged a local bind, it now tells us the IP * address and port number to which it has bound the given logical * channel */ @@ -1892,17 +1898,37 @@ ipac_parse_rtp(lchan, &tv, "CRCX"); - osmo_fsm_inst_dispatch(lchan->fi, LCHAN_EV_IPACC_CRCX_ACK, 0); + osmo_fsm_inst_dispatch(lchan->fi_rtp, LCHAN_RTP_EV_IPACC_CRCX_ACK, 0); return 0; } +static int abis_rsl_rx_ipacc_crcx_nack(struct msgb *msg) +{ + struct e1inp_sign_link *sign_link = msg->dst; + struct gsm_lchan *lchan = msg->lchan; + + rate_ctr_inc(&sign_link->trx->bts->bts_ctrs->ctr[BTS_CTR_RSL_IPA_NACK]); + + if (!lchan->fi_rtp) { + LOG_LCHAN(msg->lchan, LOGL_ERROR, "Rx RSL IPACC: CRCX NACK message for unconfigured lchan"); + return -EINVAL; + } + osmo_fsm_inst_dispatch(msg->lchan->fi_rtp, LCHAN_RTP_EV_IPACC_CRCX_NACK, 0); + return 0; +} + static int abis_rsl_rx_ipacc_mdcx_ack(struct msgb *msg) { struct abis_rsl_dchan_hdr *dh = msgb_l2(msg); struct tlv_parsed tv; struct gsm_lchan *lchan = msg->lchan; + if (!lchan->fi_rtp) { + LOG_LCHAN(msg->lchan, LOGL_ERROR, "Rx RSL IPACC: MDCX ACK message for unconfigured lchan"); + return -EINVAL; + } + /* the BTS has acknowledged a remote connect request and * it now tells us the IP address and port number to which it has * connected the given logical channel */ @@ -1910,11 +1936,26 @@ rsl_tlv_parse(&tv, dh->data, msgb_l2len(msg)-sizeof(*dh)); ipac_parse_rtp(lchan, &tv, "MDCX"); - osmo_fsm_inst_dispatch(lchan->fi, LCHAN_EV_IPACC_MDCX_ACK, 0); + osmo_fsm_inst_dispatch(lchan->fi_rtp, LCHAN_RTP_EV_IPACC_MDCX_ACK, 0); return 0; } +static int abis_rsl_rx_ipacc_mdcx_nack(struct msgb *msg) +{ + struct e1inp_sign_link *sign_link = msg->dst; + struct gsm_lchan *lchan = msg->lchan; + + rate_ctr_inc(&sign_link->trx->bts->bts_ctrs->ctr[BTS_CTR_RSL_IPA_NACK]); + + if (!lchan->fi_rtp) { + LOG_LCHAN(msg->lchan, LOGL_ERROR, "Rx RSL IPACC: MDCX NACK message for unconfigured lchan"); + return -EINVAL; + } + osmo_fsm_inst_dispatch(msg->lchan->fi_rtp, LCHAN_RTP_EV_IPACC_MDCX_NACK, 0); + return 0; +} + static int abis_rsl_rx_ipacc_dlcx_ind(struct msgb *msg) { struct abis_rsl_dchan_hdr *dh = msgb_l2(msg); @@ -1957,8 +1998,7 @@ case RSL_MT_IPAC_CRCX_NACK: /* somehow the BTS was unable to bind the lchan to its local * port?!? */ - rate_ctr_inc(&sign_link->trx->bts->bts_ctrs->ctr[BTS_CTR_RSL_IPA_NACK]); - osmo_fsm_inst_dispatch(msg->lchan->fi, LCHAN_EV_IPACC_CRCX_NACK, 0); + rc = abis_rsl_rx_ipacc_crcx_nack(msg); break; case RSL_MT_IPAC_MDCX_ACK: /* the BTS tells us that a connect operation was successful */ @@ -1967,8 +2007,7 @@ case RSL_MT_IPAC_MDCX_NACK: /* somehow the BTS was unable to connect the lchan to a remote * port */ - rate_ctr_inc(&sign_link->trx->bts->bts_ctrs->ctr[BTS_CTR_RSL_IPA_NACK]); - osmo_fsm_inst_dispatch(msg->lchan->fi, LCHAN_EV_IPACC_MDCX_NACK, 0); + rc = abis_rsl_rx_ipacc_mdcx_nack(msg); break; case RSL_MT_IPAC_DLCX_IND: rc = abis_rsl_rx_ipacc_dlcx_ind(msg); diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c b/src/osmo-bsc/bsc_subscr_conn_fsm.c index 0ed98d8..bd41761 100644 --- a/src/osmo-bsc/bsc_subscr_conn_fsm.c +++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -597,7 +598,10 @@ conn->lchan = new_lchan; conn->lchan->conn = conn; - if (old_lchan) { + if (conn->lchan->fi_rtp) + osmo_fsm_inst_dispatch(conn->lchan->fi_rtp, LCHAN_RTP_EV_ESTABLISHED, 0); + + if (old_lchan && (old_lchan != new_lchan)) { lchan_forget_conn(old_lchan); lchan_release(old_lchan, false, false, 0); } diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c index 0a6ee24..ec2a53d 100644 --- a/src/osmo-bsc/handover_fsm.c +++ b/src/osmo-bsc/handover_fsm.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -359,6 +360,7 @@ .requires_voice_stream = conn->lchan->mgw_endpoint_ci_bts ? true : false, .msc_assigned_cic = conn->ho.inter_bsc_in.msc_assigned_cic, .old_lchan = conn->lchan, + .wait_before_switching_rtp = true, }; lchan_activate(ho->new_lchan, &info); @@ -843,6 +845,9 @@ } } + if (ho->new_lchan->fi_rtp) + osmo_fsm_inst_dispatch(ho->new_lchan->fi_rtp, + LCHAN_RTP_EV_READY_TO_SWITCH_RTP, 0); ho_fsm_state_chg(HO_ST_WAIT_RR_HO_COMPLETE); /* The lchan FSM will already start to redirect the RTP stream */ return; @@ -851,7 +856,9 @@ LOG_HO(conn, LOGL_ERROR, "Received RR Handover Complete, but haven't even seen a Handover Detect yet;" " Accepting handover anyway\n"); - + if (ho->new_lchan->fi_rtp) + osmo_fsm_inst_dispatch(ho->new_lchan->fi_rtp, + LCHAN_RTP_EV_READY_TO_SWITCH_RTP, 0); ho_fsm_state_chg(HO_ST_WAIT_LCHAN_ESTABLISHED); return; diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c index 9f053ac..1ecec7c 100644 --- a/src/osmo-bsc/lchan_fsm.c +++ b/src/osmo-bsc/lchan_fsm.c @@ -1,5 +1,4 @@ -/* osmo-bsc API to allocate an lchan, complete with dyn TS switchover and MGCP communication to allocate - * RTP endpoints. +/* osmo-bsc API to allocate an lchan, complete with dyn TS switchover. * * (C) 2018 by sysmocom - s.f.m.c. GmbH * All Rights Reserved @@ -26,6 +25,7 @@ #include #include +#include #include #include #include @@ -53,11 +53,7 @@ return false; switch (lchan->fi->state) { - case LCHAN_ST_WAIT_RLL_ESTABLISH: - case LCHAN_ST_WAIT_MGW_ENDPOINT_AVAILABLE: - case LCHAN_ST_WAIT_IPACC_CRCX_ACK: - case LCHAN_ST_WAIT_IPACC_MDCX_ACK: - case LCHAN_ST_WAIT_MGW_ENDPOINT_CONFIGURED: + case LCHAN_ST_WAIT_RLL_RTP_ESTABLISH: case LCHAN_ST_ESTABLISHED: return true; default: @@ -65,7 +61,7 @@ } } -static void lchan_set_last_error(struct gsm_lchan *lchan, const char *fmt, ...) +void lchan_set_last_error(struct gsm_lchan *lchan, const char *fmt, ...) { va_list ap; /* This dance allows using an existing error reason in above fmt */ @@ -137,11 +133,12 @@ } } -static void lchan_on_activation_success(struct gsm_lchan *lchan) +static void lchan_on_fully_established(struct gsm_lchan *lchan) { switch (lchan->activate.activ_for) { case FOR_MS_CHANNEL_REQUEST: - /* Nothing to do here, MS is free to use the channel. */ + /* No signalling to do here, MS is free to use the channel, and should go on to connect + * to the MSC and establish a subscriber connection. */ break; case FOR_ASSIGNMENT: @@ -161,6 +158,9 @@ } osmo_fsm_inst_dispatch(lchan->conn->assignment.fi, ASSIGNMENT_EV_LCHAN_ESTABLISHED, lchan); + /* The lchan->fi_rtp will be notified of LCHAN_RTP_EV_ESTABLISHED in + * gscon_change_primary_lchan() upon assignment_success(). On failure before then, we + * will try to roll back a modified RTP connection. */ break; case FOR_HANDOVER: @@ -178,6 +178,9 @@ break; } osmo_fsm_inst_dispatch(lchan->conn->ho.fi, HO_EV_LCHAN_ESTABLISHED, lchan); + /* The lchan->fi_rtp will be notified of LCHAN_RTP_EV_ESTABLISHED in + * gscon_change_primary_lchan() upon handover_end(HO_RESULT_OK). On failure before then, + * we will try to roll back a modified RTP connection. */ break; default: @@ -190,12 +193,8 @@ struct state_timeout lchan_fsm_timeouts[32] = { [LCHAN_ST_WAIT_TS_READY] = { .T=23001 }, [LCHAN_ST_WAIT_ACTIV_ACK] = { .T=23002 }, - [LCHAN_ST_WAIT_RLL_ESTABLISH] = { .T=3101 }, - [LCHAN_ST_WAIT_MGW_ENDPOINT_AVAILABLE] = { .T=23004 }, - [LCHAN_ST_WAIT_IPACC_CRCX_ACK] = { .T=23005 }, - [LCHAN_ST_WAIT_IPACC_MDCX_ACK] = { .T=23006 }, - [LCHAN_ST_WAIT_MGW_ENDPOINT_CONFIGURED] = { .T=23004 }, - [LCHAN_ST_WAIT_SAPIS_RELEASED] = { .T=3109 }, + [LCHAN_ST_WAIT_RLL_RTP_ESTABLISH] = { .T=3101 }, + [LCHAN_ST_WAIT_RLL_RTP_RELEASED] = { .T=3109 }, [LCHAN_ST_WAIT_BEFORE_RF_RELEASE] = { .T=3111 }, [LCHAN_ST_WAIT_RF_RELEASE_ACK] = { .T=3111 }, [LCHAN_ST_WAIT_AFTER_ERROR] = { .T=993111 }, @@ -215,7 +214,7 @@ #define lchan_fail_to(state_chg, fmt, args...) do { \ struct gsm_lchan *_lchan = fi->priv; \ uint32_t state_was = fi->state; \ - lchan_set_last_error(fi->priv, "lchan %s in state %s: " fmt, \ + lchan_set_last_error(_lchan, "lchan %s in state %s: " fmt, \ _lchan->activate.concluded ? "failure" : "allocation failed", \ osmo_fsm_state_name(fi->fsm, state_was), ## args); \ if (!_lchan->activate.concluded) \ @@ -229,13 +228,9 @@ [LCHAN_ST_UNUSED] = LCHAN_ST_UNUSED, [LCHAN_ST_WAIT_TS_READY] = LCHAN_ST_UNUSED, [LCHAN_ST_WAIT_ACTIV_ACK] = LCHAN_ST_BORKEN, - [LCHAN_ST_WAIT_RLL_ESTABLISH] = LCHAN_ST_WAIT_RF_RELEASE_ACK, - [LCHAN_ST_WAIT_MGW_ENDPOINT_AVAILABLE] = LCHAN_ST_WAIT_SAPIS_RELEASED, - [LCHAN_ST_WAIT_IPACC_CRCX_ACK] = LCHAN_ST_WAIT_SAPIS_RELEASED, - [LCHAN_ST_WAIT_IPACC_MDCX_ACK] = LCHAN_ST_WAIT_SAPIS_RELEASED, - [LCHAN_ST_WAIT_MGW_ENDPOINT_CONFIGURED] = LCHAN_ST_WAIT_SAPIS_RELEASED, - [LCHAN_ST_ESTABLISHED] = LCHAN_ST_WAIT_SAPIS_RELEASED, - [LCHAN_ST_WAIT_SAPIS_RELEASED] = LCHAN_ST_WAIT_RF_RELEASE_ACK, + [LCHAN_ST_WAIT_RLL_RTP_ESTABLISH] = LCHAN_ST_WAIT_RF_RELEASE_ACK, + [LCHAN_ST_ESTABLISHED] = LCHAN_ST_WAIT_RLL_RTP_RELEASED, + [LCHAN_ST_WAIT_RLL_RTP_RELEASED] = LCHAN_ST_WAIT_RF_RELEASE_ACK, [LCHAN_ST_WAIT_BEFORE_RF_RELEASE] = LCHAN_ST_WAIT_RF_RELEASE_ACK, [LCHAN_ST_WAIT_RF_RELEASE_ACK] = LCHAN_ST_BORKEN, [LCHAN_ST_WAIT_AFTER_ERROR] = LCHAN_ST_UNUSED, @@ -322,11 +317,16 @@ osmo_fsm_inst_update_id_f(lchan->fi, "%u-%u-%u-%s-%u", lchan->ts->trx->bts->nr, lchan->ts->trx->nr, lchan->ts->nr, gsm_pchan_id(lchan->ts->pchan_on_init), lchan->nr); + if (lchan->fi_rtp) + osmo_fsm_inst_update_id_f(lchan->fi_rtp, lchan->fi->id); } +extern void lchan_rtp_fsm_init(); + void lchan_fsm_init() { OSMO_ASSERT(osmo_fsm_register(&lchan_fsm) == 0); + lchan_rtp_fsm_init(); } void lchan_fsm_alloc(struct gsm_lchan *lchan) @@ -357,6 +357,8 @@ talloc_free(lchan->rqd_ref); lchan->rqd_ref = NULL; } + if (lchan->fi_rtp) + osmo_fsm_inst_term(lchan->fi_rtp, OSMO_FSM_TERM_REQUEST, 0); if (lchan->mgw_endpoint_ci_bts) { mgw_endpoint_ci_dlcx(lchan->mgw_endpoint_ci_bts); lchan->mgw_endpoint_ci_bts = NULL; @@ -424,6 +426,7 @@ lchan->conn = info->for_conn; lchan->activate.activ_for = info->activ_for; lchan->activate.requires_voice_stream = info->requires_voice_stream; + lchan->activate.wait_before_switching_rtp = info->wait_before_switching_rtp; lchan->activate.msc_assigned_cic = info->msc_assigned_cic; lchan->activate.concluded = false; lchan->activate.re_use_mgw_endpoint_from_lchan = info->old_lchan; @@ -477,24 +480,8 @@ } } -/* While activating an lchan, for example for Handover, we may want to re-use another lchan's MGW - * endpoint CI. If Handover fails half way, the old lchan must keep its MGW endpoint CI, and we must not - * clean it up. Hence keep another lchan's mgw_endpoint_ci_bts out of lchan until all is done. */ -static struct mgwep_ci *lchan_use_mgw_endpoint_ci_bts(struct gsm_lchan *lchan) -{ - if (lchan->mgw_endpoint_ci_bts) - return lchan->mgw_endpoint_ci_bts; - if (lchan_state_is(lchan, LCHAN_ST_ESTABLISHED)) - return NULL; - if (lchan->activate.re_use_mgw_endpoint_from_lchan) - return lchan->activate.re_use_mgw_endpoint_from_lchan->mgw_endpoint_ci_bts; - return NULL; -} - static void lchan_fsm_wait_ts_ready_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) { - struct mgw_endpoint *mgwep; - struct mgcp_conn_peer crcx_info = {}; struct gsm_lchan *lchan = lchan_fi_lchan(fi); struct mgwep_ci *use_mgwep_ci = lchan_use_mgw_endpoint_ci_bts(lchan); @@ -518,32 +505,8 @@ osmo_fsm_inst_dispatch(lchan->ts->fi, TS_EV_LCHAN_REQUESTED, lchan); /* Prepare an MGW endpoint CI if appropriate. */ - if (!lchan->activate.requires_voice_stream) - return; - - if (use_mgwep_ci) { - lchan->activate.mgw_endpoint_available = true; - return; - } - - mgwep = gscon_ensure_mgw_endpoint(lchan->conn, lchan->activate.msc_assigned_cic); - if (!mgwep) { - lchan_fail("Internal error: cannot obtain MGW endpoint handle for conn"); - return; - } - - lchan->mgw_endpoint_ci_bts = mgw_endpoint_ci_add(mgwep, "to-BTS"); - - if (lchan->conn) - crcx_info.call_id = lchan->conn->sccp.conn_id; - crcx_info.ptime = 20; - mgcp_pick_codec(&crcx_info, lchan); - - mgw_endpoint_ci_request(lchan->mgw_endpoint_ci_bts, - MGCP_VERB_CRCX, &crcx_info, - lchan->fi, - LCHAN_EV_MGW_ENDPOINT_AVAILABLE, - LCHAN_EV_MGW_ENDPOINT_ERROR, 0); + if (lchan->activate.requires_voice_stream) + lchan_rtp_fsm_start(lchan); } static void lchan_fsm_wait_ts_ready(struct osmo_fsm_inst *fi, uint32_t event, void *data) @@ -556,10 +519,18 @@ lchan_fsm_state_chg(LCHAN_ST_WAIT_ACTIV_ACK); break; - case LCHAN_EV_MGW_ENDPOINT_AVAILABLE: - /* conn FSM is already done preparing an MGW endpoint. Remember that. */ - lchan->activate.mgw_endpoint_available = true; - break; + case LCHAN_EV_RTP_RELEASED: + case LCHAN_EV_RTP_ERROR: + if (lchan->release_requested) { + /* Already in release, the RTP is not the initial cause of failure. + * Just ignore. */ + return; + } + + lchan_fail("Failed to setup RTP stream: %s in state %s\n", + osmo_fsm_event_name(fi->fsm, event), + osmo_fsm_inst_state_name(fi)); + return; default: OSMO_ASSERT(false); @@ -597,18 +568,16 @@ lchan_fail_to(LCHAN_ST_UNUSED, "Tx Chan Activ failed: %s (%d)", strerror(-rc), rc); } +static void lchan_fsm_post_activ_ack(struct osmo_fsm_inst *fi); + static void lchan_fsm_wait_activ_ack(struct osmo_fsm_inst *fi, uint32_t event, void *data) { struct gsm_lchan *lchan = lchan_fi_lchan(fi); switch (event) { - case LCHAN_EV_MGW_ENDPOINT_AVAILABLE: - lchan->activate.mgw_endpoint_available = true; - break; - case LCHAN_EV_RSL_CHAN_ACTIV_ACK: - /* Chan Activ was ack'd, but we need an RLL Establish to be sure it's working out. */ - lchan_fsm_state_chg(LCHAN_ST_WAIT_RLL_ESTABLISH); + lchan->activate.activ_ack = true; + lchan_fsm_post_activ_ack(fi); break; case LCHAN_EV_RSL_CHAN_ACTIV_NACK: @@ -632,12 +601,26 @@ } break; + case LCHAN_EV_RTP_RELEASED: + case LCHAN_EV_RTP_ERROR: + if (lchan->release_requested) { + /* Already in release, the RTP is not the initial cause of failure. + * Just ignore. */ + return; + } + + lchan_fail_to(LCHAN_ST_WAIT_RF_RELEASE_ACK, + "Failed to setup RTP stream: %s in state %s\n", + osmo_fsm_event_name(fi->fsm, event), + osmo_fsm_inst_state_name(fi)); + return; + default: OSMO_ASSERT(false); } } -static void lchan_fsm_wait_rll_establish_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +static void lchan_fsm_post_activ_ack(struct osmo_fsm_inst *fi) { int rc; struct gsm_lchan *lchan = lchan_fi_lchan(fi); @@ -703,62 +686,44 @@ lchan_activate_mode_name(lchan->activate.activ_for)); break; } + + lchan_fsm_state_chg(LCHAN_ST_WAIT_RLL_RTP_ESTABLISH); } -static void lchan_fsm_wait_rll_establish(struct osmo_fsm_inst *fi, uint32_t event, void *data) +static void lchan_fsm_wait_rll_rtp_establish_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + struct gsm_lchan *lchan = lchan_fi_lchan(fi); + if (lchan->fi_rtp) + osmo_fsm_inst_dispatch(lchan->fi_rtp, LCHAN_RTP_EV_LCHAN_READY, 0); +} + +static void lchan_fsm_wait_rll_rtp_establish(struct osmo_fsm_inst *fi, uint32_t event, void *data) { struct gsm_lchan *lchan = lchan_fi_lchan(fi); switch (event) { - case LCHAN_EV_MGW_ENDPOINT_AVAILABLE: - lchan->activate.mgw_endpoint_available = true; - break; - case LCHAN_EV_RLL_ESTABLISH_IND: - lchan->sapis[0] = LCHAN_SAPI_MS; - if (lchan->activate.requires_voice_stream) { - /* For Abis/IP, we would technically only need the MGW endpoint one step later, - * on IPACC MDCX. But usually the MGW endpoint is anyway done by now, so keep one - * common endpoint wait state for all BTS types. */ - lchan_fsm_state_chg(LCHAN_ST_WAIT_MGW_ENDPOINT_AVAILABLE); - } else + if (!lchan->activate.requires_voice_stream + || lchan_rtp_established(lchan)) lchan_fsm_state_chg(LCHAN_ST_ESTABLISHED); - break; - - default: - OSMO_ASSERT(false); - } -} - -static void lchan_fsm_tch_post_endpoint_available(struct osmo_fsm_inst *fi); - -static void lchan_fsm_wait_mgw_endpoint_available_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) -{ - struct gsm_lchan *lchan = lchan_fi_lchan(fi); - - if (lchan->release_requested) { - lchan_fail("Release requested while activating"); - return; - } - - if (lchan->activate.mgw_endpoint_available) { - LOG_LCHAN(lchan, LOGL_DEBUG, "MGW endpoint already available\n"); - lchan_fsm_tch_post_endpoint_available(fi); - } -} - -static void lchan_fsm_wait_mgw_endpoint_available(struct osmo_fsm_inst *fi, uint32_t event, void *data) -{ - struct gsm_lchan *lchan = lchan_fi_lchan(fi); - switch (event) { - - case LCHAN_EV_MGW_ENDPOINT_AVAILABLE: - lchan->activate.mgw_endpoint_available = true; - lchan_fsm_tch_post_endpoint_available(fi); return; - case LCHAN_EV_RLL_ESTABLISH_IND: - /* abis_rsl.c has noticed that a SAPI was established, no need to take action here. */ + case LCHAN_EV_RTP_READY: + if (lchan->sapis[0] != LCHAN_SAPI_UNUSED) + lchan_fsm_state_chg(LCHAN_ST_ESTABLISHED); + return; + + case LCHAN_EV_RTP_RELEASED: + case LCHAN_EV_RTP_ERROR: + if (lchan->release_requested) { + /* Already in release, the RTP is not the initial cause of failure. + * Just ignore. */ + return; + } + + lchan_fail("Failed to setup RTP stream: %s in state %s\n", + osmo_fsm_event_name(fi->fsm, event), + osmo_fsm_inst_state_name(fi)); return; default: @@ -766,208 +731,6 @@ } } -static void lchan_fsm_tch_post_endpoint_available(struct osmo_fsm_inst *fi) -{ - struct gsm_lchan *lchan = lchan_fi_lchan(fi); - - LOG_LCHAN(lchan, LOGL_DEBUG, "MGW endpoint: %s\n", - mgwep_ci_name(lchan_use_mgw_endpoint_ci_bts(lchan))); - - if (is_ipaccess_bts(lchan->ts->trx->bts)) - lchan_fsm_state_chg(LCHAN_ST_WAIT_IPACC_CRCX_ACK); - else - lchan_fsm_state_chg(LCHAN_ST_WAIT_MGW_ENDPOINT_CONFIGURED); -} - -static void lchan_fsm_wait_ipacc_crcx_ack_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) -{ - int rc; - int val; - struct gsm_lchan *lchan = lchan_fi_lchan(fi); - - if (lchan->release_requested) { - lchan_fail("Release requested while activating"); - return; - } - - val = ipacc_speech_mode(lchan->tch_mode, lchan->type); - if (val < 0) { - lchan_fail("Cannot determine Abis/IP speech mode for tch_mode=%s type=%s\n", - get_value_string(gsm48_chan_mode_names, lchan->tch_mode), - gsm_lchant_name(lchan->type)); - return; - } - lchan->abis_ip.speech_mode = val; - - val = ipacc_payload_type(lchan->tch_mode, lchan->type); - if (val < 0) { - lchan_fail("Cannot determine Abis/IP payload type for tch_mode=%s type=%s\n", - get_value_string(gsm48_chan_mode_names, lchan->tch_mode), - gsm_lchant_name(lchan->type)); - return; - } - lchan->abis_ip.rtp_payload = val; - - /* recv-only */ - ipacc_speech_mode_set_direction(&lchan->abis_ip.speech_mode, false); - - rc = rsl_tx_ipacc_crcx(lchan); - if (rc) - lchan_fail("Failure to transmit IPACC CRCX to BTS (rc=%d, %s)", - rc, strerror(-rc)); -} - -static void lchan_fsm_wait_ipacc_crcx_ack(struct osmo_fsm_inst *fi, uint32_t event, void *data) -{ - switch (event) { - - case LCHAN_EV_IPACC_CRCX_ACK: - /* the CRCX ACK parsing has already noted the RTP port information at - * lchan->abis_ip.bound_*, see ipac_parse_rtp(). We'll use that in - * lchan_fsm_wait_mgw_endpoint_configured_onenter(). */ - lchan_fsm_state_chg(LCHAN_ST_WAIT_IPACC_MDCX_ACK); - return; - - case LCHAN_EV_IPACC_CRCX_NACK: - lchan_fail("Received NACK on IPACC CRCX"); - return; - - case LCHAN_EV_RLL_ESTABLISH_IND: - /* abis_rsl.c has noticed that a SAPI was established, no need to take action here. */ - return; - - default: - OSMO_ASSERT(false); - } -} - -static void lchan_fsm_wait_ipacc_mdcx_ack_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) -{ - int rc; - struct gsm_lchan *lchan = lchan_fi_lchan(fi); - const struct mgcp_conn_peer *mgw_rtp; - - if (lchan->release_requested) { - lchan_fail("Release requested while activating"); - return; - } - - mgw_rtp = mgwep_ci_get_rtp_info(lchan_use_mgw_endpoint_ci_bts(lchan)); - - if (!mgw_rtp) { - lchan_fail("Cannot send IPACC MDCX to BTS:" - " there is no RTP IP+port set that the BTS should send RTP to."); - return; - } - - /* Other RTP settings were already setup in lchan_fsm_wait_ipacc_crcx_ack_onenter() */ - lchan->abis_ip.connect_ip = ntohl(inet_addr(mgw_rtp->addr)); - lchan->abis_ip.connect_port = mgw_rtp->port; - - /* send-recv */ - ipacc_speech_mode_set_direction(&lchan->abis_ip.speech_mode, true); - - rc = rsl_tx_ipacc_mdcx(lchan); - if (rc) - lchan_fail("Failure to transmit IPACC MDCX to BTS (rc=%d, %s)", - rc, strerror(-rc)); - -} - -static void lchan_fsm_wait_ipacc_mdcx_ack(struct osmo_fsm_inst *fi, uint32_t event, void *data) -{ - switch (event) { - - case LCHAN_EV_IPACC_MDCX_ACK: - /* Finally, the lchan and its RTP are established. */ - lchan_fsm_state_chg(LCHAN_ST_WAIT_MGW_ENDPOINT_CONFIGURED); - return; - - case LCHAN_EV_IPACC_MDCX_NACK: - lchan_fail("Received NACK on IPACC MDCX"); - return; - - case LCHAN_EV_RLL_ESTABLISH_IND: - /* abis_rsl.c has noticed that a SAPI was established, no need to take action here. */ - return; - - default: - OSMO_ASSERT(false); - } -} - -/* Tell the MGW endpoint about the RTP port allocated on BTS side. */ -static void lchan_fsm_wait_mgw_endpoint_configured_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) -{ - int rc; - struct mgcp_conn_peer mdcx_info; - struct in_addr addr; - const char *addr_str; - struct gsm_lchan *lchan = lchan_fi_lchan(fi); - - if (lchan->release_requested) { - lchan_fail("Release requested while activating"); - return; - } - - mdcx_info = (struct mgcp_conn_peer){ - .port = lchan->abis_ip.bound_port, - .ptime = 20, - }; - mgcp_pick_codec(&mdcx_info, lchan); - - addr.s_addr = osmo_ntohl(lchan->abis_ip.bound_ip); - addr_str = inet_ntoa(addr); - rc = osmo_strlcpy(mdcx_info.addr, addr_str, sizeof(mdcx_info.addr)); - if (rc <= 0 || rc >= sizeof(mdcx_info.addr)) { - lchan_fail("Cannot compose BTS side RTP IP address to send to MGW: '%s'", - addr_str); - return; - } - - /* At this point, we are taking over an old lchan's MGW endpoint (if any). */ - if (!lchan->mgw_endpoint_ci_bts - && lchan->activate.re_use_mgw_endpoint_from_lchan) { - lchan->mgw_endpoint_ci_bts = - lchan->activate.re_use_mgw_endpoint_from_lchan->mgw_endpoint_ci_bts; - /* The old lchan shall forget the enpoint now. */ - lchan->activate.re_use_mgw_endpoint_from_lchan->mgw_endpoint_ci_bts = NULL; - } - - if (!lchan->mgw_endpoint_ci_bts) { - lchan_fail("No MGW endpoint ci configured"); - return; - } - - LOG_LCHAN(lchan, LOGL_DEBUG, "Sending BTS side RTP port info %s:%u to MGW %s\n", - mdcx_info.addr, mdcx_info.port, mgwep_ci_name(lchan->mgw_endpoint_ci_bts)); - mgw_endpoint_ci_request(lchan->mgw_endpoint_ci_bts, MGCP_VERB_MDCX, - &mdcx_info, fi, LCHAN_EV_MGW_ENDPOINT_CONFIGURED, - LCHAN_EV_MGW_ENDPOINT_ERROR, 0); -} - -static void lchan_fsm_wait_mgw_endpoint_configured(struct osmo_fsm_inst *fi, uint32_t event, void *data) -{ - switch (event) { - - case LCHAN_EV_MGW_ENDPOINT_CONFIGURED: - lchan_fsm_state_chg(LCHAN_ST_ESTABLISHED); - return; - - case LCHAN_EV_MGW_ENDPOINT_ERROR: - lchan_fail("Error while redirecting the MGW to the BTS' RTP port"); - return; - - case LCHAN_EV_RLL_ESTABLISH_IND: - /* abis_rsl.c has noticed that a SAPI was established, no need to take action here. */ - return; - - default: - OSMO_ASSERT(false); - } -} - - static void lchan_fsm_established_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) { struct gsm_lchan *lchan = lchan_fi_lchan(fi); @@ -981,7 +744,7 @@ * like Immediate Assignment or BSSMAP Assignment Complete, and if then, way later, some other * error occurs, e.g. during release, that we don't send a NACK out of context. */ lchan->activate.concluded = true; - lchan_on_activation_success(lchan); + lchan_on_fully_established(lchan); } #define for_each_sapi(sapi, start, lchan) \ @@ -1015,8 +778,7 @@ return sapis; } -static void handle_rll_rel_ind_or_conf(struct osmo_fsm_inst *fi, uint32_t event, void *data, - bool wait_for_sapi0_rel) +static void handle_rll_rel_ind_or_conf(struct osmo_fsm_inst *fi, uint32_t event, void *data) { uint8_t link_id; uint8_t sapi; @@ -1043,12 +805,13 @@ gscon_lchan_releasing(lchan->conn, lchan); } - if (!lchan_active_sapis(lchan, wait_for_sapi0_rel? 0 : 1)) - lchan_fsm_state_chg(LCHAN_ST_WAIT_BEFORE_RF_RELEASE); + /* The caller shall check whether all SAPIs are released and cause a state chg */ } static void lchan_fsm_established(struct osmo_fsm_inst *fi, uint32_t event, void *data) { + struct gsm_lchan *lchan = lchan_fi_lchan(fi); + switch (event) { case LCHAN_EV_RLL_ESTABLISH_IND: /* abis_rsl.c has noticed that a SAPI was established, no need to take action here. */ @@ -1056,7 +819,22 @@ case LCHAN_EV_RLL_REL_IND: case LCHAN_EV_RLL_REL_CONF: - handle_rll_rel_ind_or_conf(fi, event, data, true); + handle_rll_rel_ind_or_conf(fi, event, data); + if (!lchan_active_sapis(lchan, 0)) + lchan_fsm_state_chg(LCHAN_ST_WAIT_RLL_RTP_RELEASED); + return; + + case LCHAN_EV_RTP_RELEASED: + case LCHAN_EV_RTP_ERROR: + if (lchan->release_requested) { + /* Already in release, the RTP is not the initial cause of failure. + * Just ignore. */ + return; + } + + lchan_fail("RTP stream closed unexpectedly: %s in state %s\n", + osmo_fsm_event_name(fi->fsm, event), + osmo_fsm_inst_state_name(fi)); return; default: @@ -1079,7 +857,7 @@ } } -static void lchan_fsm_wait_sapis_released_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +static void lchan_fsm_wait_rll_rtp_released_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) { int sapis; int sapi; @@ -1089,9 +867,12 @@ if (lchan->sapis[sapi]) LOG_LCHAN(lchan, LOGL_DEBUG, "SAPI[%d] = %d\n", sapi, lchan->sapis[sapi]); - if (lchan->conn) + if (lchan->conn && lchan->sapis[0] != LCHAN_SAPI_UNUSED) gsm48_send_rr_release(lchan); + if (lchan->fi_rtp) + osmo_fsm_inst_dispatch(lchan->fi_rtp, LCHAN_RTP_EV_RELEASE, 0); + if (lchan->deact_sacch && should_sacch_deact(lchan)) rsl_deact_sacch(lchan); @@ -1117,16 +898,33 @@ sapis = 0; } - if (!sapis) + if (!sapis && !lchan->fi_rtp) lchan_fsm_state_chg(LCHAN_ST_WAIT_BEFORE_RF_RELEASE); } -static void lchan_fsm_wait_sapis_released(struct osmo_fsm_inst *fi, uint32_t event, void *data) +static void lchan_fsm_wait_rll_rtp_released(struct osmo_fsm_inst *fi, uint32_t event, void *data) { - /* When we're telling the MS to release, we're fine to carry on with RF Channel Release when SAPI - * 0 release is not confirmed yet. - * TODO: that's how the code was before lchan FSM, is this correct/useful? */ - handle_rll_rel_ind_or_conf(fi, event, data, false); + struct gsm_lchan *lchan = lchan_fi_lchan(fi); + switch (event) { + + case LCHAN_EV_RLL_REL_IND: + case LCHAN_EV_RLL_REL_CONF: + /* When we're telling the MS to release, we're fine to carry on with RF Channel Release + * when SAPI 0 release is not confirmed yet. + * TODO: that's how the code was before lchan FSM, is this correct/useful? */ + handle_rll_rel_ind_or_conf(fi, event, data); + break; + + case LCHAN_EV_RTP_RELEASED: + case LCHAN_EV_RTP_ERROR: + break; + + default: + OSMO_ASSERT(false); + } + + if (!lchan_active_sapis(lchan, 1) && !lchan->fi_rtp) + lchan_fsm_state_chg(LCHAN_ST_WAIT_BEFORE_RF_RELEASE); } static void lchan_fsm_wait_rf_release_ack_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) @@ -1194,6 +992,10 @@ * independently from the BTS model, right?? */ return; + case LCHAN_EV_RTP_RELEASED: + case LCHAN_EV_RTP_ERROR: + return; + default: OSMO_ASSERT(false); } @@ -1219,7 +1021,8 @@ .action = lchan_fsm_wait_ts_ready, .in_event_mask = 0 | S(LCHAN_EV_TS_READY) - | S(LCHAN_EV_MGW_ENDPOINT_AVAILABLE) + | S(LCHAN_EV_RTP_ERROR) + | S(LCHAN_EV_RTP_RELEASED) , .out_state_mask = 0 | S(LCHAN_ST_UNUSED) @@ -1231,94 +1034,33 @@ .onenter = lchan_fsm_wait_activ_ack_onenter, .action = lchan_fsm_wait_activ_ack, .in_event_mask = 0 - | S(LCHAN_EV_MGW_ENDPOINT_AVAILABLE) | S(LCHAN_EV_RSL_CHAN_ACTIV_ACK) | S(LCHAN_EV_RSL_CHAN_ACTIV_NACK) + | S(LCHAN_EV_RTP_ERROR) + | S(LCHAN_EV_RTP_RELEASED) , .out_state_mask = 0 | S(LCHAN_ST_UNUSED) - | S(LCHAN_ST_WAIT_RLL_ESTABLISH) + | S(LCHAN_ST_WAIT_RLL_RTP_ESTABLISH) | S(LCHAN_ST_BORKEN) | S(LCHAN_ST_WAIT_RF_RELEASE_ACK) , }, - [LCHAN_ST_WAIT_RLL_ESTABLISH] = { - .name = "WAIT_RLL_ESTABLISH", - .onenter = lchan_fsm_wait_rll_establish_onenter, - .action = lchan_fsm_wait_rll_establish, + [LCHAN_ST_WAIT_RLL_RTP_ESTABLISH] = { + .name = "WAIT_RLL_RTP_ESTABLISH", + .onenter = lchan_fsm_wait_rll_rtp_establish_onenter, + .action = lchan_fsm_wait_rll_rtp_establish, .in_event_mask = 0 - | S(LCHAN_EV_MGW_ENDPOINT_AVAILABLE) | S(LCHAN_EV_RLL_ESTABLISH_IND) - , - .out_state_mask = 0 - | S(LCHAN_ST_UNUSED) - | S(LCHAN_ST_WAIT_MGW_ENDPOINT_AVAILABLE) - | S(LCHAN_ST_ESTABLISHED) - | S(LCHAN_ST_WAIT_RF_RELEASE_ACK) - | S(LCHAN_ST_WAIT_SAPIS_RELEASED) - , - }, - [LCHAN_ST_WAIT_MGW_ENDPOINT_AVAILABLE] = { - .name = "WAIT_MGW_ENDPOINT_AVAILABLE", - .onenter = lchan_fsm_wait_mgw_endpoint_available_onenter, - .action = lchan_fsm_wait_mgw_endpoint_available, - .in_event_mask = 0 - | S(LCHAN_EV_MGW_ENDPOINT_AVAILABLE) - | S(LCHAN_EV_RLL_ESTABLISH_IND) /* ignored */ - , - .out_state_mask = 0 - | S(LCHAN_ST_UNUSED) - | S(LCHAN_ST_WAIT_IPACC_CRCX_ACK) - | S(LCHAN_ST_WAIT_MGW_ENDPOINT_CONFIGURED) - | S(LCHAN_ST_WAIT_SAPIS_RELEASED) - | S(LCHAN_ST_WAIT_RF_RELEASE_ACK) - , - }, - [LCHAN_ST_WAIT_IPACC_CRCX_ACK] = { - .name = "WAIT_IPACC_CRCX_ACK", - .onenter = lchan_fsm_wait_ipacc_crcx_ack_onenter, - .action = lchan_fsm_wait_ipacc_crcx_ack, - .in_event_mask = 0 - | S(LCHAN_EV_IPACC_CRCX_ACK) - | S(LCHAN_EV_IPACC_CRCX_NACK) - | S(LCHAN_EV_RLL_ESTABLISH_IND) /* ignored */ - , - .out_state_mask = 0 - | S(LCHAN_ST_UNUSED) - | S(LCHAN_ST_WAIT_IPACC_MDCX_ACK) - | S(LCHAN_ST_WAIT_SAPIS_RELEASED) - | S(LCHAN_ST_WAIT_RF_RELEASE_ACK) - , - }, - [LCHAN_ST_WAIT_IPACC_MDCX_ACK] = { - .name = "WAIT_IPACC_MDCX_ACK", - .onenter = lchan_fsm_wait_ipacc_mdcx_ack_onenter, - .action = lchan_fsm_wait_ipacc_mdcx_ack, - .in_event_mask = 0 - | S(LCHAN_EV_IPACC_MDCX_ACK) - | S(LCHAN_EV_IPACC_MDCX_NACK) - | S(LCHAN_EV_RLL_ESTABLISH_IND) /* ignored */ - , - .out_state_mask = 0 - | S(LCHAN_ST_UNUSED) - | S(LCHAN_ST_WAIT_MGW_ENDPOINT_CONFIGURED) - | S(LCHAN_ST_WAIT_SAPIS_RELEASED) - | S(LCHAN_ST_WAIT_RF_RELEASE_ACK) - , - }, - [LCHAN_ST_WAIT_MGW_ENDPOINT_CONFIGURED] = { - .name = "WAIT_MGW_ENDPOINT_CONFIGURED", - .onenter = lchan_fsm_wait_mgw_endpoint_configured_onenter, - .action = lchan_fsm_wait_mgw_endpoint_configured, - .in_event_mask = 0 - | S(LCHAN_EV_MGW_ENDPOINT_CONFIGURED) - | S(LCHAN_EV_RLL_ESTABLISH_IND) /* ignored */ + | S(LCHAN_EV_RTP_READY) + | S(LCHAN_EV_RTP_ERROR) + | S(LCHAN_EV_RTP_RELEASED) , .out_state_mask = 0 | S(LCHAN_ST_UNUSED) | S(LCHAN_ST_ESTABLISHED) - | S(LCHAN_ST_WAIT_SAPIS_RELEASED) | S(LCHAN_ST_WAIT_RF_RELEASE_ACK) + | S(LCHAN_ST_WAIT_RLL_RTP_RELEASED) , }, [LCHAN_ST_ESTABLISHED] = { @@ -1329,21 +1071,25 @@ | S(LCHAN_EV_RLL_REL_IND) | S(LCHAN_EV_RLL_REL_CONF) | S(LCHAN_EV_RLL_ESTABLISH_IND) /* ignored */ + | S(LCHAN_EV_RTP_ERROR) + | S(LCHAN_EV_RTP_RELEASED) , .out_state_mask = 0 | S(LCHAN_ST_UNUSED) - | S(LCHAN_ST_WAIT_SAPIS_RELEASED) + | S(LCHAN_ST_WAIT_RLL_RTP_RELEASED) | S(LCHAN_ST_WAIT_BEFORE_RF_RELEASE) | S(LCHAN_ST_WAIT_RF_RELEASE_ACK) , }, - [LCHAN_ST_WAIT_SAPIS_RELEASED] = { - .name = "WAIT_SAPIS_RELEASED", - .onenter = lchan_fsm_wait_sapis_released_onenter, - .action = lchan_fsm_wait_sapis_released, + [LCHAN_ST_WAIT_RLL_RTP_RELEASED] = { + .name = "WAIT_RLL_RTP_RELEASED", + .onenter = lchan_fsm_wait_rll_rtp_released_onenter, + .action = lchan_fsm_wait_rll_rtp_released, .in_event_mask = 0 | S(LCHAN_EV_RLL_REL_IND) | S(LCHAN_EV_RLL_REL_CONF) + | S(LCHAN_EV_RTP_ERROR) + | S(LCHAN_EV_RTP_RELEASED) , .out_state_mask = 0 | S(LCHAN_ST_UNUSED) @@ -1388,6 +1134,8 @@ | S(LCHAN_EV_RSL_CHAN_ACTIV_ACK) | S(LCHAN_EV_RSL_CHAN_ACTIV_NACK) | S(LCHAN_EV_RSL_RF_CHAN_REL_ACK) + | S(LCHAN_EV_RTP_ERROR) + | S(LCHAN_EV_RTP_RELEASED) , .out_state_mask = 0 | S(LCHAN_ST_UNUSED) @@ -1403,13 +1151,9 @@ OSMO_VALUE_STRING(LCHAN_EV_RSL_CHAN_ACTIV_ACK), OSMO_VALUE_STRING(LCHAN_EV_RSL_CHAN_ACTIV_NACK), OSMO_VALUE_STRING(LCHAN_EV_RLL_ESTABLISH_IND), - OSMO_VALUE_STRING(LCHAN_EV_MGW_ENDPOINT_AVAILABLE), - OSMO_VALUE_STRING(LCHAN_EV_MGW_ENDPOINT_CONFIGURED), - OSMO_VALUE_STRING(LCHAN_EV_MGW_ENDPOINT_ERROR), - OSMO_VALUE_STRING(LCHAN_EV_IPACC_CRCX_ACK), - OSMO_VALUE_STRING(LCHAN_EV_IPACC_CRCX_NACK), - OSMO_VALUE_STRING(LCHAN_EV_IPACC_MDCX_ACK), - OSMO_VALUE_STRING(LCHAN_EV_IPACC_MDCX_NACK), + OSMO_VALUE_STRING(LCHAN_EV_RTP_READY), + OSMO_VALUE_STRING(LCHAN_EV_RTP_ERROR), + OSMO_VALUE_STRING(LCHAN_EV_RTP_RELEASED), OSMO_VALUE_STRING(LCHAN_EV_RLL_REL_IND), OSMO_VALUE_STRING(LCHAN_EV_RLL_REL_CONF), OSMO_VALUE_STRING(LCHAN_EV_RSL_RF_CHAN_REL_ACK), @@ -1421,27 +1165,12 @@ void lchan_fsm_allstate_action(struct osmo_fsm_inst *fi, uint32_t event, void *data) { - struct gsm_lchan *lchan = lchan_fi_lchan(fi); - switch (event) { case LCHAN_EV_TS_ERROR: lchan_fail_to(LCHAN_ST_UNUSED, "LCHAN_EV_TS_ERROR"); return; - case LCHAN_EV_MGW_ENDPOINT_ERROR: - /* This event during activation means that it was not possible to establish an endpoint. - * After activation was successful, it could also come in at any point to signal that the - * MGW side has become unavailable, which should lead to graceful release. */ - if (fi->state == LCHAN_ST_WAIT_MGW_ENDPOINT_AVAILABLE) { - /* This state is actually waiting for availability. Fail it immediately. */ - lchan_fail("LCHAN_EV_MGW_ENDPOINT_ERROR"); - return; - } - LOG_LCHAN(lchan, LOGL_ERROR, "Releasing due to MGW endpoint error\n"); - lchan_release(lchan, false, true, RSL_ERR_EQUIPMENT_FAIL); - return; - default: return; } @@ -1477,28 +1206,26 @@ lchan->rsl_error_cause = cause_rr; lchan->deact_sacch = sacch_deact; - /* This would also happen later, but better to do this a sooner. */ - if (lchan->mgw_endpoint_ci_bts) { - mgw_endpoint_ci_dlcx(lchan->mgw_endpoint_ci_bts); - lchan->mgw_endpoint_ci_bts = NULL; - } - /* States waiting for events will notice the desire to release when done waiting, so it is enough * to mark for release. */ lchan->release_requested = true; - /* But when in error, shortcut that. */ + /* If we took the RTP over from another lchan, put it back. */ + if (lchan->fi_rtp && lchan->release_in_error) + osmo_fsm_inst_dispatch(lchan->fi_rtp, LCHAN_RTP_EV_ROLLBACK, 0); + + /* But when in error, don't wait for the next state to pick up release_requested. */ if (lchan->release_in_error) { switch (lchan->fi->state) { default: - /* Normally we deact SACCH in lchan_fsm_wait_sapis_released_onenter(). When + /* Normally we deact SACCH in lchan_fsm_wait_rll_rtp_released_onenter(). When * skipping that, but asked to SACCH deact, do it now. */ if (lchan->deact_sacch) rsl_deact_sacch(lchan); lchan_fsm_state_chg(LCHAN_ST_WAIT_RF_RELEASE_ACK); return; case LCHAN_ST_WAIT_TS_READY: - lchan_fsm_state_chg(LCHAN_ST_UNUSED); + lchan_fsm_state_chg(LCHAN_ST_WAIT_RLL_RTP_RELEASED); return; case LCHAN_ST_WAIT_RF_RELEASE_ACK: case LCHAN_ST_BORKEN: @@ -1509,7 +1236,7 @@ /* The only non-broken state that would stay stuck without noticing the release_requested flag * is: */ if (fi->state == LCHAN_ST_ESTABLISHED) - lchan_fsm_state_chg(LCHAN_ST_WAIT_SAPIS_RELEASED); + lchan_fsm_state_chg(LCHAN_ST_WAIT_RLL_RTP_RELEASED); } void lchan_fsm_cleanup(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause) @@ -1525,14 +1252,6 @@ lchan->fi = NULL; } -/* The mgw_endpoint was invalidated, just and simply forget the pointer without cleanup. */ -void lchan_forget_mgw_endpoint(struct gsm_lchan *lchan) -{ - if (!lchan) - return; - lchan->mgw_endpoint_ci_bts = NULL; -} - /* The conn is deallocating, just forget all about it */ void lchan_forget_conn(struct gsm_lchan *lchan) { @@ -1551,7 +1270,6 @@ .allstate_action = lchan_fsm_allstate_action, .allstate_event_mask = 0 | S(LCHAN_EV_TS_ERROR) - | S(LCHAN_EV_MGW_ENDPOINT_ERROR) , .timer_cb = lchan_fsm_timer_cb, .cleanup = lchan_fsm_cleanup, diff --git a/src/osmo-bsc/lchan_rtp_fsm.c b/src/osmo-bsc/lchan_rtp_fsm.c new file mode 100644 index 0000000..3530b8a --- /dev/null +++ b/src/osmo-bsc/lchan_rtp_fsm.c @@ -0,0 +1,743 @@ +/* osmo-bsc API to switch the RTP stream for an lchan. + * + * (C) 2018 by sysmocom - s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include + +#include +#include +#include +#include +#include +#include +#include + +static struct osmo_fsm lchan_rtp_fsm; + +struct gsm_lchan *lchan_rtp_fi_lchan(struct osmo_fsm_inst *fi) +{ + OSMO_ASSERT(fi); + OSMO_ASSERT(fi->fsm == &lchan_rtp_fsm); + OSMO_ASSERT(fi->priv); + return fi->priv; +} + +struct state_timeout lchan_rtp_fsm_timeouts[32] = { + [LCHAN_RTP_ST_WAIT_MGW_ENDPOINT_AVAILABLE] = { .T=23004 }, + [LCHAN_RTP_ST_WAIT_IPACC_CRCX_ACK] = { .T=23005 }, + [LCHAN_RTP_ST_WAIT_IPACC_MDCX_ACK] = { .T=23006 }, + [LCHAN_RTP_ST_WAIT_MGW_ENDPOINT_CONFIGURED] = { .T=23004 }, +}; + +/* Transition to a state, using the T timer defined in lchan_rtp_fsm_timeouts. + * The actual timeout value is in turn obtained from network->T_defs. + * Assumes local variable fi exists. */ +#define lchan_rtp_fsm_state_chg(state) \ + fsm_inst_state_chg_T(fi, state, \ + lchan_rtp_fsm_timeouts, \ + ((struct gsm_lchan*)(fi->priv))->ts->trx->bts->network->T_defs, \ + 5) + +/* Set a failure message, trigger the common actions to take on failure, transition to a state to + * continue with (using state timeouts from lchan_rtp_fsm_timeouts[]). Assumes local variable fi exists. */ +#define lchan_rtp_fail(fmt, args...) do { \ + struct gsm_lchan *_lchan = fi->priv; \ + uint32_t state_was = fi->state; \ + lchan_set_last_error(_lchan, "lchan-rtp failure in state %s: " fmt, \ + osmo_fsm_state_name(fi->fsm, state_was), ## args); \ + osmo_fsm_inst_dispatch(_lchan->fi, LCHAN_EV_RTP_ERROR, 0); \ + } while(0) + +/* Called from lchan_fsm_init(), does not need to be visible in lchan_rtp_fsm.h */ +void lchan_rtp_fsm_init() +{ + OSMO_ASSERT(osmo_fsm_register(&lchan_rtp_fsm) == 0); +} + +static void lchan_rtp_fsm_update_id(struct gsm_lchan *lchan) +{ + OSMO_ASSERT(lchan->fi); + OSMO_ASSERT(lchan->fi_rtp); + osmo_fsm_inst_update_id_f(lchan->fi_rtp, lchan->fi->id); +} + +bool lchan_rtp_established(struct gsm_lchan *lchan) +{ + if (!lchan->fi_rtp) + return false; + switch (lchan->fi_rtp->state) { + case LCHAN_RTP_ST_READY: + case LCHAN_RTP_ST_ESTABLISHED: + case LCHAN_RTP_ST_ROLLBACK: + return true; + default: + return false; + } +} + +void lchan_rtp_fsm_start(struct gsm_lchan *lchan) +{ + struct osmo_fsm_inst *fi; + + OSMO_ASSERT(lchan->ts); + OSMO_ASSERT(lchan->ts->fi); + OSMO_ASSERT(lchan->fi); + OSMO_ASSERT(!lchan->fi_rtp); + + fi = osmo_fsm_inst_alloc_child(&lchan_rtp_fsm, lchan->fi, LCHAN_EV_RTP_RELEASED); + OSMO_ASSERT(fi); + fi->priv = lchan; + lchan->fi_rtp = fi; + lchan_rtp_fsm_update_id(lchan); + + /* Use old lchan only if there is an MGW endpoint present. Otherwise, on ROLLBACK, we might put + * an endpoint "back" to an lchan that never had one to begin with. */ + if (lchan->activate.re_use_mgw_endpoint_from_lchan + && !lchan->activate.re_use_mgw_endpoint_from_lchan->mgw_endpoint_ci_bts) + lchan->activate.re_use_mgw_endpoint_from_lchan = NULL; + + lchan_rtp_fsm_state_chg(LCHAN_RTP_ST_WAIT_MGW_ENDPOINT_AVAILABLE); +} + +/* While activating an lchan, for example for Handover, we may want to re-use another lchan's MGW + * endpoint CI. If Handover fails half way, the old lchan must keep its MGW endpoint CI, and we must not + * clean it up. Hence keep another lchan's mgw_endpoint_ci_bts out of lchan until all is done. */ +struct mgwep_ci *lchan_use_mgw_endpoint_ci_bts(struct gsm_lchan *lchan) +{ + if (lchan->mgw_endpoint_ci_bts) + return lchan->mgw_endpoint_ci_bts; + if (lchan_state_is(lchan, LCHAN_ST_ESTABLISHED)) + return NULL; + if (lchan->activate.re_use_mgw_endpoint_from_lchan) + return lchan->activate.re_use_mgw_endpoint_from_lchan->mgw_endpoint_ci_bts; + return NULL; +} + +static void lchan_rtp_fsm_wait_mgw_endpoint_available_onenter(struct osmo_fsm_inst *fi, + uint32_t prev_state) +{ + struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); + struct mgw_endpoint *mgwep; + struct mgwep_ci *use_mgwep_ci = lchan_use_mgw_endpoint_ci_bts(lchan); + struct mgcp_conn_peer crcx_info = {}; + + if (use_mgwep_ci) { + LOG_LCHAN_RTP(lchan, LOGL_DEBUG, "MGW endpoint already available: %s", + mgwep_ci_name(use_mgwep_ci)); + lchan_rtp_fsm_state_chg(LCHAN_RTP_ST_WAIT_LCHAN_READY); + return; + } + + mgwep = gscon_ensure_mgw_endpoint(lchan->conn, lchan->activate.msc_assigned_cic); + if (!mgwep) { + lchan_rtp_fail("Internal error: cannot obtain MGW endpoint handle for conn"); + return; + } + + lchan->mgw_endpoint_ci_bts = mgw_endpoint_ci_add(mgwep, "to-BTS"); + + if (lchan->conn) + crcx_info.call_id = lchan->conn->sccp.conn_id; + crcx_info.ptime = 20; + mgcp_pick_codec(&crcx_info, lchan); + + mgw_endpoint_ci_request(lchan->mgw_endpoint_ci_bts, MGCP_VERB_CRCX, &crcx_info, + fi, LCHAN_RTP_EV_MGW_ENDPOINT_AVAILABLE, LCHAN_RTP_EV_MGW_ENDPOINT_ERROR, + 0); +} + +static void lchan_rtp_fsm_wait_mgw_endpoint_available(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); + switch (event) { + + case LCHAN_RTP_EV_MGW_ENDPOINT_AVAILABLE: + LOG_LCHAN_RTP(lchan, LOGL_DEBUG, "MGW endpoint: %s", + mgwep_ci_name(lchan_use_mgw_endpoint_ci_bts(lchan))); + lchan_rtp_fsm_state_chg(LCHAN_RTP_ST_WAIT_LCHAN_READY); + return; + + case LCHAN_RTP_EV_LCHAN_READY: + /* will notice lchan->activate.activ_ack == true in + * lchan_rtp_fsm_wait_lchan_ready_onenter() */ + return; + + case LCHAN_RTP_EV_MGW_ENDPOINT_ERROR: + lchan_rtp_fail("Failure to create MGW endpoint"); + return; + + case LCHAN_RTP_EV_ROLLBACK: + case LCHAN_RTP_EV_RELEASE: + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REQUEST, 0); + return; + + default: + OSMO_ASSERT(false); + } +} + +static void lchan_rtp_fsm_post_lchan_ready(struct osmo_fsm_inst *fi); + +static void lchan_rtp_fsm_wait_lchan_ready_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); + + if (lchan->activate.activ_ack) { + LOG_LCHAN_RTP(lchan, LOGL_DEBUG, "Activ Ack received earlier, no need to wait"); + lchan_rtp_fsm_post_lchan_ready(fi); + } +} + +static void lchan_rtp_fsm_wait_lchan_ready(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + switch (event) { + + case LCHAN_RTP_EV_LCHAN_READY: + lchan_rtp_fsm_post_lchan_ready(fi); + return; + + case LCHAN_RTP_EV_ROLLBACK: + case LCHAN_RTP_EV_RELEASE: + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REQUEST, 0); + return; + + default: + OSMO_ASSERT(false); + } +} + +static void lchan_rtp_fsm_switch_rtp(struct osmo_fsm_inst *fi) +{ + struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); + + if (lchan->activate.wait_before_switching_rtp) { + LOG_LCHAN_RTP(lchan, LOGL_DEBUG, + "Waiting for an event by caller before switching RTP\n"); + lchan_rtp_fsm_state_chg(LCHAN_RTP_ST_WAIT_READY_TO_SWITCH_RTP); + } else + lchan_rtp_fsm_state_chg(LCHAN_RTP_ST_WAIT_MGW_ENDPOINT_CONFIGURED); +} + +static void lchan_rtp_fsm_post_lchan_ready(struct osmo_fsm_inst *fi) +{ + struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); + + if (is_ipaccess_bts(lchan->ts->trx->bts)) + lchan_rtp_fsm_state_chg(LCHAN_RTP_ST_WAIT_IPACC_CRCX_ACK); + else + lchan_rtp_fsm_switch_rtp(fi); +} + +static void lchan_rtp_fsm_wait_ipacc_crcx_ack_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + int rc; + int val; + struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); + + if (lchan->release_requested) { + lchan_rtp_fail("Release requested while activating"); + return; + } + + val = ipacc_speech_mode(lchan->tch_mode, lchan->type); + if (val < 0) { + lchan_rtp_fail("Cannot determine Abis/IP speech mode for tch_mode=%s type=%s\n", + get_value_string(gsm48_chan_mode_names, lchan->tch_mode), + gsm_lchant_name(lchan->type)); + return; + } + lchan->abis_ip.speech_mode = val; + + val = ipacc_payload_type(lchan->tch_mode, lchan->type); + if (val < 0) { + lchan_rtp_fail("Cannot determine Abis/IP payload type for tch_mode=%s type=%s\n", + get_value_string(gsm48_chan_mode_names, lchan->tch_mode), + gsm_lchant_name(lchan->type)); + return; + } + lchan->abis_ip.rtp_payload = val; + + /* recv-only */ + ipacc_speech_mode_set_direction(&lchan->abis_ip.speech_mode, false); + + rc = rsl_tx_ipacc_crcx(lchan); + if (rc) + lchan_rtp_fail("Failure to transmit IPACC CRCX to BTS (rc=%d, %s)", + rc, strerror(-rc)); +} + +static void lchan_rtp_fsm_wait_ipacc_crcx_ack(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); + switch (event) { + + case LCHAN_RTP_EV_IPACC_CRCX_ACK: + /* the CRCX ACK parsing has already noted the RTP port information at + * lchan->abis_ip.bound_*, see ipac_parse_rtp(). We'll use that in + * lchan_rtp_fsm_wait_mgw_endpoint_configured_onenter(). */ + lchan_rtp_fsm_state_chg(LCHAN_RTP_ST_WAIT_IPACC_MDCX_ACK); + return; + + case LCHAN_RTP_EV_IPACC_CRCX_NACK: + lchan_rtp_fail("Received NACK on IPACC CRCX"); + return; + + case LCHAN_RTP_EV_READY_TO_SWITCH_RTP: + lchan->activate.wait_before_switching_rtp = false; + return; + + case LCHAN_RTP_EV_RELEASE: + case LCHAN_RTP_EV_ROLLBACK: + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REQUEST, 0); + return; + + default: + OSMO_ASSERT(false); + } +} + +static void lchan_rtp_fsm_wait_ipacc_mdcx_ack_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + int rc; + struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); + const struct mgcp_conn_peer *mgw_rtp; + + if (lchan->release_requested) { + lchan_rtp_fail("Release requested while activating"); + return; + } + + mgw_rtp = mgwep_ci_get_rtp_info(lchan_use_mgw_endpoint_ci_bts(lchan)); + + if (!mgw_rtp) { + lchan_rtp_fail("Cannot send IPACC MDCX to BTS:" + " there is no RTP IP+port set that the BTS should send RTP to."); + return; + } + + /* Other RTP settings were already setup in lchan_rtp_fsm_wait_ipacc_crcx_ack_onenter() */ + lchan->abis_ip.connect_ip = ntohl(inet_addr(mgw_rtp->addr)); + lchan->abis_ip.connect_port = mgw_rtp->port; + + /* send-recv */ + ipacc_speech_mode_set_direction(&lchan->abis_ip.speech_mode, true); + + rc = rsl_tx_ipacc_mdcx(lchan); + if (rc) + lchan_rtp_fail("Failure to transmit IPACC MDCX to BTS (rc=%d, %s)", + rc, strerror(-rc)); + +} + +static void lchan_rtp_fsm_wait_ipacc_mdcx_ack(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); + switch (event) { + + case LCHAN_RTP_EV_IPACC_MDCX_ACK: + lchan_rtp_fsm_switch_rtp(fi); + return; + + case LCHAN_RTP_EV_IPACC_MDCX_NACK: + lchan_rtp_fail("Received NACK on IPACC MDCX"); + return; + + case LCHAN_RTP_EV_READY_TO_SWITCH_RTP: + lchan->activate.wait_before_switching_rtp = false; + return; + + case LCHAN_RTP_EV_RELEASE: + case LCHAN_RTP_EV_ROLLBACK: + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REQUEST, 0); + return; + + default: + OSMO_ASSERT(false); + } +} + +static void lchan_rtp_fsm_wait_ready_to_switch_rtp(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + switch (event) { + + case LCHAN_RTP_EV_READY_TO_SWITCH_RTP: + lchan_rtp_fsm_state_chg(LCHAN_RTP_ST_WAIT_MGW_ENDPOINT_CONFIGURED); + return; + + case LCHAN_RTP_EV_RELEASE: + case LCHAN_RTP_EV_ROLLBACK: + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REQUEST, 0); + return; + + default: + OSMO_ASSERT(false); + } +} + +static void connect_mgw_endpoint_to_lchan(struct osmo_fsm_inst *fi, + struct mgwep_ci *ci, + struct gsm_lchan *to_lchan) +{ + int rc; + struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); + struct mgcp_conn_peer mdcx_info; + struct in_addr addr; + const char *addr_str; + + mdcx_info = (struct mgcp_conn_peer){ + .port = to_lchan->abis_ip.bound_port, + .ptime = 20, + }; + mgcp_pick_codec(&mdcx_info, to_lchan); + + addr.s_addr = ntohl(to_lchan->abis_ip.bound_ip); + addr_str = inet_ntoa(addr); + rc = osmo_strlcpy(mdcx_info.addr, addr_str, sizeof(mdcx_info.addr)); + if (rc <= 0 || rc >= sizeof(mdcx_info.addr)) { + lchan_rtp_fail("Cannot compose BTS side RTP IP address to send to MGW: '%s'", + addr_str); + return; + } + + if (!ci) { + lchan_rtp_fail("No MGW endpoint ci configured"); + return; + } + + LOG_LCHAN_RTP(lchan, LOGL_DEBUG, "Sending BTS side RTP port info %s:%u to MGW %s", + mdcx_info.addr, mdcx_info.port, mgwep_ci_name(ci)); + mgw_endpoint_ci_request(ci, MGCP_VERB_MDCX, &mdcx_info, + fi, LCHAN_RTP_EV_MGW_ENDPOINT_CONFIGURED, + LCHAN_RTP_EV_MGW_ENDPOINT_ERROR, 0); +} + +static void lchan_rtp_fsm_wait_mgw_endpoint_configured_onenter(struct osmo_fsm_inst *fi, + uint32_t prev_state) +{ + struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); + struct gsm_lchan *old_lchan = lchan->activate.re_use_mgw_endpoint_from_lchan; + + if (lchan->release_requested) { + lchan_rtp_fail("Release requested while activating"); + return; + } + + /* At this point, we are taking over an old lchan's MGW endpoint (if any). */ + if (!lchan->mgw_endpoint_ci_bts && old_lchan) { + /* The old lchan shall forget the enpoint now. We might put it back upon ROLLBACK */ + lchan->mgw_endpoint_ci_bts = old_lchan->mgw_endpoint_ci_bts; + old_lchan->mgw_endpoint_ci_bts = NULL; + } + + if (!lchan->mgw_endpoint_ci_bts) { + lchan_rtp_fail("No MGW endpoint ci configured"); + return; + } + + connect_mgw_endpoint_to_lchan(fi, lchan->mgw_endpoint_ci_bts, lchan); +} + +static void lchan_rtp_fsm_wait_mgw_endpoint_configured(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + switch (event) { + + case LCHAN_RTP_EV_MGW_ENDPOINT_CONFIGURED: + lchan_rtp_fsm_state_chg(LCHAN_RTP_ST_READY); + return; + + case LCHAN_RTP_EV_MGW_ENDPOINT_ERROR: + lchan_rtp_fail("Error while redirecting the MGW to the lchan's RTP port"); + return; + + default: + OSMO_ASSERT(false); + } +} + +static void lchan_rtp_fsm_ready_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); + osmo_fsm_inst_dispatch(lchan->fi, LCHAN_EV_RTP_READY, 0); +} + +static void lchan_rtp_fsm_ready(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + switch (event) { + + case LCHAN_RTP_EV_ESTABLISHED: + lchan_rtp_fsm_state_chg(LCHAN_RTP_ST_ESTABLISHED); + return; + + case LCHAN_RTP_EV_RELEASE: + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REQUEST, 0); + return; + + case LCHAN_RTP_EV_ROLLBACK: + lchan_rtp_fsm_state_chg(LCHAN_RTP_ST_ROLLBACK); + return; + + default: + OSMO_ASSERT(false); + } +} + +static void lchan_rtp_fsm_rollback_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); + struct gsm_lchan *old_lchan = lchan->activate.re_use_mgw_endpoint_from_lchan; + + if (!lchan->mgw_endpoint_ci_bts || !old_lchan) { + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REQUEST, 0); + return; + } + connect_mgw_endpoint_to_lchan(fi, lchan->mgw_endpoint_ci_bts, old_lchan); +} + +static void lchan_rtp_fsm_rollback(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); + struct gsm_lchan *old_lchan = lchan->activate.re_use_mgw_endpoint_from_lchan; + + switch (event) { + + case LCHAN_RTP_EV_MGW_ENDPOINT_CONFIGURED: + old_lchan->mgw_endpoint_ci_bts = lchan->mgw_endpoint_ci_bts; + lchan->mgw_endpoint_ci_bts = NULL; + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, 0); + return; + + case LCHAN_RTP_EV_MGW_ENDPOINT_ERROR: + LOG_LCHAN_RTP(lchan, LOGL_ERROR, + "Error while connecting the MGW back to the old lchan's RTP port:" + " %s %s\n", + mgwep_ci_name(lchan->mgw_endpoint_ci_bts), + gsm_lchan_name(old_lchan)); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, 0); + return; + + default: + OSMO_ASSERT(false); + } +} + +static void lchan_rtp_fsm_established_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); + + /* Make sure that we will not hand back the MGW endpoint to any old lchan from here on. */ + lchan->activate.re_use_mgw_endpoint_from_lchan = NULL; +} + +static void lchan_rtp_fsm_established(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + switch (event) { + + case LCHAN_RTP_EV_RELEASE: + case LCHAN_RTP_EV_ROLLBACK: + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, 0); + return; + + default: + OSMO_ASSERT(false); + } +} + +#define S(x) (1 << (x)) + +static const struct osmo_fsm_state lchan_rtp_fsm_states[] = { + [LCHAN_RTP_ST_WAIT_MGW_ENDPOINT_AVAILABLE] = { + .name = "WAIT_MGW_ENDPOINT_AVAILABLE", + .onenter = lchan_rtp_fsm_wait_mgw_endpoint_available_onenter, + .action = lchan_rtp_fsm_wait_mgw_endpoint_available, + .in_event_mask = 0 + | S(LCHAN_RTP_EV_MGW_ENDPOINT_AVAILABLE) + | S(LCHAN_RTP_EV_MGW_ENDPOINT_ERROR) + | S(LCHAN_RTP_EV_LCHAN_READY) + | S(LCHAN_RTP_EV_RELEASE) + | S(LCHAN_RTP_EV_ROLLBACK) + , + .out_state_mask = 0 + | S(LCHAN_RTP_ST_WAIT_MGW_ENDPOINT_AVAILABLE) /* for init */ + | S(LCHAN_RTP_ST_WAIT_LCHAN_READY) + , + }, + [LCHAN_RTP_ST_WAIT_LCHAN_READY] = { + .name = "WAIT_LCHAN_READY", + .onenter = lchan_rtp_fsm_wait_lchan_ready_onenter, + .action = lchan_rtp_fsm_wait_lchan_ready, + .in_event_mask = 0 + | S(LCHAN_RTP_EV_LCHAN_READY) + | S(LCHAN_RTP_EV_RELEASE) + | S(LCHAN_RTP_EV_ROLLBACK) + , + .out_state_mask = 0 + | S(LCHAN_RTP_ST_WAIT_IPACC_CRCX_ACK) + | S(LCHAN_RTP_ST_WAIT_READY_TO_SWITCH_RTP) + | S(LCHAN_RTP_ST_WAIT_MGW_ENDPOINT_CONFIGURED) + , + }, + [LCHAN_RTP_ST_WAIT_IPACC_CRCX_ACK] = { + .name = "WAIT_IPACC_CRCX_ACK", + .onenter = lchan_rtp_fsm_wait_ipacc_crcx_ack_onenter, + .action = lchan_rtp_fsm_wait_ipacc_crcx_ack, + .in_event_mask = 0 + | S(LCHAN_RTP_EV_READY_TO_SWITCH_RTP) + | S(LCHAN_RTP_EV_IPACC_CRCX_ACK) + | S(LCHAN_RTP_EV_IPACC_CRCX_NACK) + | S(LCHAN_RTP_EV_RELEASE) + | S(LCHAN_RTP_EV_ROLLBACK) + , + .out_state_mask = 0 + | S(LCHAN_RTP_ST_WAIT_IPACC_MDCX_ACK) + , + }, + [LCHAN_RTP_ST_WAIT_IPACC_MDCX_ACK] = { + .name = "WAIT_IPACC_MDCX_ACK", + .onenter = lchan_rtp_fsm_wait_ipacc_mdcx_ack_onenter, + .action = lchan_rtp_fsm_wait_ipacc_mdcx_ack, + .in_event_mask = 0 + | S(LCHAN_RTP_EV_READY_TO_SWITCH_RTP) + | S(LCHAN_RTP_EV_IPACC_MDCX_ACK) + | S(LCHAN_RTP_EV_IPACC_MDCX_NACK) + | S(LCHAN_RTP_EV_RELEASE) + | S(LCHAN_RTP_EV_ROLLBACK) + , + .out_state_mask = 0 + | S(LCHAN_RTP_ST_WAIT_READY_TO_SWITCH_RTP) + | S(LCHAN_RTP_ST_WAIT_MGW_ENDPOINT_CONFIGURED) + , + }, + [LCHAN_RTP_ST_WAIT_READY_TO_SWITCH_RTP] = { + .name = "WAIT_READY_TO_SWITCH_RTP", + .action = lchan_rtp_fsm_wait_ready_to_switch_rtp, + .in_event_mask = 0 + | S(LCHAN_RTP_EV_READY_TO_SWITCH_RTP) + | S(LCHAN_RTP_EV_RELEASE) + | S(LCHAN_RTP_EV_ROLLBACK) + , + .out_state_mask = 0 + | S(LCHAN_RTP_ST_WAIT_MGW_ENDPOINT_CONFIGURED) + , + }, + [LCHAN_RTP_ST_WAIT_MGW_ENDPOINT_CONFIGURED] = { + .name = "WAIT_MGW_ENDPOINT_CONFIGURED", + .onenter = lchan_rtp_fsm_wait_mgw_endpoint_configured_onenter, + .action = lchan_rtp_fsm_wait_mgw_endpoint_configured, + .in_event_mask = 0 + | S(LCHAN_RTP_EV_MGW_ENDPOINT_CONFIGURED) + | S(LCHAN_RTP_EV_MGW_ENDPOINT_ERROR) + | S(LCHAN_RTP_EV_RELEASE) + | S(LCHAN_RTP_EV_ROLLBACK) + , + .out_state_mask = 0 + | S(LCHAN_RTP_ST_READY) + , + }, + [LCHAN_RTP_ST_READY] = { + .name = "READY", + .onenter = lchan_rtp_fsm_ready_onenter, + .action = lchan_rtp_fsm_ready, + .in_event_mask = 0 + | S(LCHAN_RTP_EV_ESTABLISHED) + | S(LCHAN_RTP_EV_RELEASE) + | S(LCHAN_RTP_EV_ROLLBACK) + , + .out_state_mask = 0 + | S(LCHAN_RTP_ST_ESTABLISHED) + | S(LCHAN_RTP_ST_ROLLBACK) + , + }, + [LCHAN_RTP_ST_ESTABLISHED] = { + .name = "ESTABLISHED", + .onenter = lchan_rtp_fsm_established_onenter, + .action = lchan_rtp_fsm_established, + .in_event_mask = 0 + | S(LCHAN_RTP_EV_RELEASE) + | S(LCHAN_RTP_EV_ROLLBACK) + , + }, + [LCHAN_RTP_ST_ROLLBACK] = { + .name = "ROLLBACK", + .onenter = lchan_rtp_fsm_rollback_onenter, + .action = lchan_rtp_fsm_rollback, + .in_event_mask = 0 + | S(LCHAN_RTP_EV_MGW_ENDPOINT_CONFIGURED) + | S(LCHAN_RTP_EV_MGW_ENDPOINT_ERROR) + | S(LCHAN_RTP_EV_RELEASE) + | S(LCHAN_RTP_EV_ROLLBACK) + , + }, +}; + +static const struct value_string lchan_rtp_fsm_event_names[] = { + OSMO_VALUE_STRING(LCHAN_RTP_EV_LCHAN_READY), + OSMO_VALUE_STRING(LCHAN_RTP_EV_READY_TO_SWITCH_RTP), + OSMO_VALUE_STRING(LCHAN_RTP_EV_MGW_ENDPOINT_AVAILABLE), + OSMO_VALUE_STRING(LCHAN_RTP_EV_MGW_ENDPOINT_ERROR), + OSMO_VALUE_STRING(LCHAN_RTP_EV_IPACC_CRCX_ACK), + OSMO_VALUE_STRING(LCHAN_RTP_EV_IPACC_CRCX_NACK), + OSMO_VALUE_STRING(LCHAN_RTP_EV_IPACC_MDCX_ACK), + OSMO_VALUE_STRING(LCHAN_RTP_EV_IPACC_MDCX_NACK), + OSMO_VALUE_STRING(LCHAN_RTP_EV_READY_TO_SWITCH), + OSMO_VALUE_STRING(LCHAN_RTP_EV_MGW_ENDPOINT_CONFIGURED), + OSMO_VALUE_STRING(LCHAN_RTP_EV_ROLLBACK), + OSMO_VALUE_STRING(LCHAN_RTP_EV_ESTABLISHED), + OSMO_VALUE_STRING(LCHAN_RTP_EV_RELEASE), + {} +}; + +int lchan_rtp_fsm_timer_cb(struct osmo_fsm_inst *fi) +{ + struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); + lchan->release_in_error = true; + lchan_rtp_fail("Timeout"); + return 0; +} + +void lchan_rtp_fsm_cleanup(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause) +{ + struct gsm_lchan *lchan = lchan_rtp_fi_lchan(fi); + if (lchan->mgw_endpoint_ci_bts) { + mgw_endpoint_ci_dlcx(lchan->mgw_endpoint_ci_bts); + lchan->mgw_endpoint_ci_bts = NULL; + } + lchan->fi_rtp = NULL; + if (lchan->fi) + osmo_fsm_inst_dispatch(lchan->fi, LCHAN_EV_RTP_RELEASED, 0); +} + +/* The mgw_endpoint was invalidated, just and simply forget the pointer without cleanup. */ +void lchan_forget_mgw_endpoint(struct gsm_lchan *lchan) +{ + if (!lchan) + return; + lchan->mgw_endpoint_ci_bts = NULL; +} + +static struct osmo_fsm lchan_rtp_fsm = { + .name = "lchan_rtp", + .states = lchan_rtp_fsm_states, + .num_states = ARRAY_SIZE(lchan_rtp_fsm_states), + .log_subsys = DRSL, + .event_names = lchan_rtp_fsm_event_names, + .timer_cb = lchan_rtp_fsm_timer_cb, + .cleanup = lchan_rtp_fsm_cleanup, +}; diff --git a/tests/handover/Makefile.am b/tests/handover/Makefile.am index 107a234..3ce870b 100644 --- a/tests/handover/Makefile.am +++ b/tests/handover/Makefile.am @@ -63,6 +63,7 @@ $(top_builddir)/src/osmo-bsc/handover_fsm.o \ $(top_builddir)/src/osmo-bsc/handover_logic.o \ $(top_builddir)/src/osmo-bsc/lchan_fsm.o \ + $(top_builddir)/src/osmo-bsc/lchan_rtp_fsm.o \ $(top_builddir)/src/osmo-bsc/lchan_select.o \ $(top_builddir)/src/osmo-bsc/meas_rep.o \ $(top_builddir)/src/osmo-bsc/mgw_endpoint_fsm.o \ diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c index 172e620..92c002d 100644 --- a/tests/handover/handover_test.c +++ b/tests/handover/handover_test.c @@ -394,6 +394,7 @@ struct gsm48_ho_cpl *hc; send_est_ind(lchan); + osmo_fsm_inst_dispatch(lchan->fi, LCHAN_EV_RTP_READY, 0); rh = (struct abis_rsl_rll_hdr *) msgb_put(msg, sizeof(*rh)); rh->c.msg_discr = ABIS_RSL_MDISC_RLL; -- To view, visit https://gerrit.osmocom.org/10103 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Id7a4407d9b63be05ce63f5f2768b7d7e3d5c86fb Gerrit-Change-Number: 10103 Gerrit-PatchSet: 9 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 10:44:05 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 28 Jul 2018 10:44:05 +0000 Subject: Change in osmo-bsc[master]: lchan_fsm: add in_release_handler flag In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10104 ) Change subject: lchan_fsm: add in_release_handler flag ...................................................................... lchan_fsm: add in_release_handler flag If a release event is being handled, ignore other ricocheting release events until that release handling has concluded. For example, if an lchan is regularly released, it signals the lchan RTP FSM to release, which then calls back to say "RTP is released" on termination -- this should not trigger other state changes than the initial release intends. Change-Id: Iec41e006b6ab9d0f618d36925341f9536353e5d8 --- M include/osmocom/bsc/gsm_data.h M src/osmo-bsc/lchan_fsm.c 2 files changed, 21 insertions(+), 7 deletions(-) Approvals: Jenkins Builder: Verified Neels Hofmeyr: Looks good to me, approved diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 12bc5c3..448924c 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -525,6 +525,10 @@ /* RSL error code, RSL_ERR_* */ uint8_t rsl_error_cause; + /* If a release event is being handled, ignore other ricocheting release events until that + * release handling has concluded. */ + bool in_release_handler; + /* The logical channel type */ enum gsm_chan_t type; /* RSL channel mode */ diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c index 1ecec7c..940afe8 100644 --- a/src/osmo-bsc/lchan_fsm.c +++ b/src/osmo-bsc/lchan_fsm.c @@ -521,7 +521,7 @@ case LCHAN_EV_RTP_RELEASED: case LCHAN_EV_RTP_ERROR: - if (lchan->release_requested) { + if (lchan->in_release_handler) { /* Already in release, the RTP is not the initial cause of failure. * Just ignore. */ return; @@ -581,6 +581,7 @@ break; case LCHAN_EV_RSL_CHAN_ACTIV_NACK: + lchan->in_release_handler = true; if (data) { uint32_t next_state; lchan->rsl_error_cause = *(uint8_t*)data; @@ -599,11 +600,12 @@ lchan->release_in_error = true; lchan_fail_to(LCHAN_ST_BORKEN, "Chan Activ NACK without cause IE"); } + lchan->in_release_handler = false; break; case LCHAN_EV_RTP_RELEASED: case LCHAN_EV_RTP_ERROR: - if (lchan->release_requested) { + if (lchan->in_release_handler) { /* Already in release, the RTP is not the initial cause of failure. * Just ignore. */ return; @@ -715,7 +717,7 @@ case LCHAN_EV_RTP_RELEASED: case LCHAN_EV_RTP_ERROR: - if (lchan->release_requested) { + if (lchan->in_release_handler) { /* Already in release, the RTP is not the initial cause of failure. * Just ignore. */ return; @@ -826,7 +828,7 @@ case LCHAN_EV_RTP_RELEASED: case LCHAN_EV_RTP_ERROR: - if (lchan->release_requested) { + if (lchan->in_release_handler) { /* Already in release, the RTP is not the initial cause of failure. * Just ignore. */ return; @@ -1201,6 +1203,11 @@ { if (!lchan || !lchan->fi) return; + + if (lchan->in_release_handler) + return; + lchan->in_release_handler = true; + struct osmo_fsm_inst *fi = lchan->fi; lchan->release_in_error = err; lchan->rsl_error_cause = cause_rr; @@ -1223,13 +1230,13 @@ if (lchan->deact_sacch) rsl_deact_sacch(lchan); lchan_fsm_state_chg(LCHAN_ST_WAIT_RF_RELEASE_ACK); - return; + goto exit_release_handler; case LCHAN_ST_WAIT_TS_READY: lchan_fsm_state_chg(LCHAN_ST_WAIT_RLL_RTP_RELEASED); - return; + goto exit_release_handler; case LCHAN_ST_WAIT_RF_RELEASE_ACK: case LCHAN_ST_BORKEN: - return; + goto exit_release_handler; } } @@ -1237,6 +1244,9 @@ * is: */ if (fi->state == LCHAN_ST_ESTABLISHED) lchan_fsm_state_chg(LCHAN_ST_WAIT_RLL_RTP_RELEASED); + +exit_release_handler: + lchan->in_release_handler = false; } void lchan_fsm_cleanup(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause) -- To view, visit https://gerrit.osmocom.org/10104 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iec41e006b6ab9d0f618d36925341f9536353e5d8 Gerrit-Change-Number: 10104 Gerrit-PatchSet: 9 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 10:44:07 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 28 Jul 2018 10:44:07 +0000 Subject: Change in osmo-bsc[master]: allocate larger lchans if no SDCCH are available In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10105 ) Change subject: allocate larger lchans if no SDCCH are available ...................................................................... allocate larger lchans if no SDCCH are available Related: OS#3332 Change-Id: I2fcf9e9baa7d03974a367763f3f52f59dfc2cc51 --- M src/osmo-bsc/abis_rsl.c 1 file changed, 16 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c index 8b14b49..d72bfa3 100644 --- a/src/osmo-bsc/abis_rsl.c +++ b/src/osmo-bsc/abis_rsl.c @@ -1389,6 +1389,22 @@ gsm_lchant_name(lctype)); lchan = lchan_select_by_type(bts, lctype); } + if (!lchan && lctype == GSM_LCHAN_SDCCH) { + LOGP(DRSL, LOGL_NOTICE, "(bts=%d) CHAN RQD: no resources for %s " + "0x%x, retrying with %s\n", + msg->lchan->ts->trx->bts->nr, + gsm_lchant_name(GSM_LCHAN_SDCCH), rqd_ref->ra, + gsm_lchant_name(GSM_LCHAN_TCH_H)); + lchan = lchan_select_by_type(bts, GSM_LCHAN_TCH_H); + } + if (!lchan && lctype == GSM_LCHAN_SDCCH) { + LOGP(DRSL, LOGL_NOTICE, "(bts=%d) CHAN RQD: no resources for %s " + "0x%x, retrying with %s\n", + msg->lchan->ts->trx->bts->nr, + gsm_lchant_name(GSM_LCHAN_SDCCH), rqd_ref->ra, + gsm_lchant_name(GSM_LCHAN_TCH_F)); + lchan = lchan_select_by_type(bts, GSM_LCHAN_TCH_F); + } if (!lchan) { LOGP(DRSL, LOGL_NOTICE, "(bts=%d) CHAN RQD: no resources for %s 0x%x\n", msg->lchan->ts->trx->bts->nr, gsm_lchant_name(lctype), rqd_ref->ra); -- To view, visit https://gerrit.osmocom.org/10105 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I2fcf9e9baa7d03974a367763f3f52f59dfc2cc51 Gerrit-Change-Number: 10105 Gerrit-PatchSet: 9 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 10:44:08 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 28 Jul 2018 10:44:08 +0000 Subject: Change in osmo-bsc[master]: create separate logging categories for lchan, ts, as FSMs In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10106 ) Change subject: create separate logging categories for lchan,ts,as FSMs ...................................................................... create separate logging categories for lchan,ts,as FSMs Change-Id: Ie889b8860a4a63c7c22ef65025f690d64cd7330c --- M include/osmocom/bsc/debug.h M src/osmo-bsc/assignment_fsm.c M src/osmo-bsc/lchan_fsm.c M src/osmo-bsc/lchan_rtp_fsm.c M src/osmo-bsc/osmo_bsc_main.c M src/osmo-bsc/timeslot_fsm.c M tests/handover/handover_test.c 7 files changed, 43 insertions(+), 4 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmocom/bsc/debug.h b/include/osmocom/bsc/debug.h index 1133bf6..e78ba59 100644 --- a/include/osmocom/bsc/debug.h +++ b/include/osmocom/bsc/debug.h @@ -24,5 +24,8 @@ DFILTER, DPCU, DLCLS, + DCHAN, + DTS, + DAS, Debug_LastEntry, }; diff --git a/src/osmo-bsc/assignment_fsm.c b/src/osmo-bsc/assignment_fsm.c index a2b1746..e37ec9c 100644 --- a/src/osmo-bsc/assignment_fsm.c +++ b/src/osmo-bsc/assignment_fsm.c @@ -642,7 +642,7 @@ .name = "assignment", .states = assignment_fsm_states, .num_states = ARRAY_SIZE(assignment_fsm_states), - .log_subsys = DRSL, + .log_subsys = DAS, .event_names = assignment_fsm_event_names, .allstate_action = assignment_fsm_allstate_action, .allstate_event_mask = 0 diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c index 940afe8..9c22bde 100644 --- a/src/osmo-bsc/lchan_fsm.c +++ b/src/osmo-bsc/lchan_fsm.c @@ -1275,7 +1275,7 @@ .name = "lchan", .states = lchan_fsm_states, .num_states = ARRAY_SIZE(lchan_fsm_states), - .log_subsys = DRSL, + .log_subsys = DCHAN, .event_names = lchan_fsm_event_names, .allstate_action = lchan_fsm_allstate_action, .allstate_event_mask = 0 diff --git a/src/osmo-bsc/lchan_rtp_fsm.c b/src/osmo-bsc/lchan_rtp_fsm.c index 3530b8a..f7efc1b 100644 --- a/src/osmo-bsc/lchan_rtp_fsm.c +++ b/src/osmo-bsc/lchan_rtp_fsm.c @@ -736,7 +736,7 @@ .name = "lchan_rtp", .states = lchan_rtp_fsm_states, .num_states = ARRAY_SIZE(lchan_rtp_fsm_states), - .log_subsys = DRSL, + .log_subsys = DCHAN, .event_names = lchan_rtp_fsm_event_names, .timer_cb = lchan_rtp_fsm_timer_cb, .cleanup = lchan_rtp_fsm_cleanup, diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index 8dc9098..37e8665 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -679,6 +679,24 @@ .color = "\033[1;35m", .enabled = 1, .loglevel = LOGL_NOTICE, }, + [DCHAN] = { + .name = "DCHAN", + .description = "lchan FSM", + .color = "\033[1;32m", + .enabled = 1, .loglevel = LOGL_NOTICE, + }, + [DTS] = { + .name = "DTS", + .description = "timeslot FSM", + .color = "\033[1;31m", + .enabled = 1, .loglevel = LOGL_NOTICE, + }, + [DAS] = { + .name = "DAS", + .description = "assignment FSM", + .color = "\033[1;33m", + .enabled = 1, .loglevel = LOGL_NOTICE, + }, [DNM] = { .name = "DNM", .description = "A-bis Network Management / O&M (NM/OML)", diff --git a/src/osmo-bsc/timeslot_fsm.c b/src/osmo-bsc/timeslot_fsm.c index 21de2fa..56b3357 100644 --- a/src/osmo-bsc/timeslot_fsm.c +++ b/src/osmo-bsc/timeslot_fsm.c @@ -834,7 +834,7 @@ .states = ts_fsm_states, .num_states = ARRAY_SIZE(ts_fsm_states), .timer_cb = ts_fsm_timer_cb, - .log_subsys = DRSL, + .log_subsys = DTS, .event_names = ts_fsm_event_names, .allstate_event_mask = 0 | S(TS_EV_OML_DOWN) diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c index 92c002d..a962777 100644 --- a/tests/handover/handover_test.c +++ b/tests/handover/handover_test.c @@ -1357,6 +1357,24 @@ .description = "Mobile Switching Center", .enabled = 1, .loglevel = LOGL_DEBUG, }, + [DCHAN] = { + .name = "DCHAN", + .description = "lchan FSM", + .color = "\033[1;32m", + .enabled = 1, .loglevel = LOGL_DEBUG, + }, + [DTS] = { + .name = "DTS", + .description = "timeslot FSM", + .color = "\033[1;31m", + .enabled = 1, .loglevel = LOGL_DEBUG, + }, + [DAS] = { + .name = "DAS", + .description = "assignment FSM", + .color = "\033[1;33m", + .enabled = 1, .loglevel = LOGL_DEBUG, + }, }; const struct log_info log_info = { -- To view, visit https://gerrit.osmocom.org/10106 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ie889b8860a4a63c7c22ef65025f690d64cd7330c Gerrit-Change-Number: 10106 Gerrit-PatchSet: 9 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 10:44:10 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 28 Jul 2018 10:44:10 +0000 Subject: Change in osmo-bsc[master]: cosmetic: constify gsm_bts_num() net arg In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10107 ) Change subject: cosmetic: constify gsm_bts_num() net arg ...................................................................... cosmetic: constify gsm_bts_num() net arg Change-Id: I9a078ffb781ee55c0ca114fa0d752c1b53067419 --- M include/osmocom/bsc/gsm_data.h M src/osmo-bsc/gsm_data.c 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 448924c..f85887a 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -1134,7 +1134,7 @@ struct gsm_network *gsm_network_init(void *ctx); struct gsm_bts *gsm_bts_alloc(struct gsm_network *net, uint8_t bts_num); -struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num); +struct gsm_bts *gsm_bts_num(const struct gsm_network *net, int num); bool gsm_bts_matches_lai(const struct gsm_bts *bts, const struct osmo_location_area_id *lai); bool gsm_bts_matches_cell_id(const struct gsm_bts *bts, const struct gsm0808_cell_id *cell_id); struct gsm_bts *gsm_bts_by_cell_id(const struct gsm_network *net, diff --git a/src/osmo-bsc/gsm_data.c b/src/osmo-bsc/gsm_data.c index 3cd3432..ac965e2 100644 --- a/src/osmo-bsc/gsm_data.c +++ b/src/osmo-bsc/gsm_data.c @@ -554,7 +554,7 @@ return get_value_string(chreq_names, c); } -struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num) +struct gsm_bts *gsm_bts_num(const struct gsm_network *net, int num) { struct gsm_bts *bts; -- To view, visit https://gerrit.osmocom.org/10107 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I9a078ffb781ee55c0ca114fa0d752c1b53067419 Gerrit-Change-Number: 10107 Gerrit-PatchSet: 9 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 10:44:10 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 28 Jul 2018 10:44:10 +0000 Subject: Change in osmo-bsc[master]: vty: 'handover any': pick more random chans, use lchan_select_by_type() In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10108 ) Change subject: vty: 'handover any': pick more random chans, use lchan_select_by_type() ...................................................................... vty: 'handover any': pick more random chans, use lchan_select_by_type() The 'handover any' VTY command is only useful for testing. It is even more useful if it doesn't always pick the first used lchan but produces more random handovers. The algorithm takes a random number as input, iterates over used lchans once, and if the random number is larger, takes modulo of the nr of used lchans counted. A second iteration will then produce a match. Instead of figuring out the lchan type logic in bsc_vty.c, just use lchan_select_by_type(); Change-Id: I50b70e02d665b967e401db65581e110bc83101e7 --- M src/osmo-bsc/bsc_vty.c 1 file changed, 43 insertions(+), 47 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c index 5940696..e99029a 100644 --- a/src/osmo-bsc/bsc_vty.c +++ b/src/osmo-bsc/bsc_vty.c @@ -68,6 +68,7 @@ #include #include #include +#include #include #include @@ -1605,36 +1606,48 @@ return ho_or_as(vty, argv, argc); } -static struct gsm_lchan *find_used_voice_lchan(struct vty *vty) +static struct gsm_lchan *find_used_voice_lchan(struct vty *vty, int random_idx) { struct gsm_bts *bts; struct gsm_network *network = gsmnet_from_vty(vty); - llist_for_each_entry(bts, &network->bts_list, list) { - struct gsm_bts_trx *trx; + while (1) { + int count = 0; + llist_for_each_entry(bts, &network->bts_list, list) { + struct gsm_bts_trx *trx; - llist_for_each_entry(trx, &bts->trx_list, list) { - int i; - for (i = 0; i < ARRAY_SIZE(trx->ts); i++) { - struct gsm_bts_trx_ts *ts = &trx->ts[i]; - struct gsm_lchan *lchan; + llist_for_each_entry(trx, &bts->trx_list, list) { + int i; + for (i = 0; i < ARRAY_SIZE(trx->ts); i++) { + struct gsm_bts_trx_ts *ts = &trx->ts[i]; + struct gsm_lchan *lchan; - if (ts->fi->state != TS_ST_IN_USE) - continue; + if (ts->fi->state != TS_ST_IN_USE) + continue; - ts_for_each_lchan(lchan, ts) { - if (lchan_state_is(lchan, LCHAN_ST_ESTABLISHED) - && (lchan->type == GSM_LCHAN_TCH_F - || lchan->type == GSM_LCHAN_TCH_H)) { + ts_for_each_lchan(lchan, ts) { + if (lchan_state_is(lchan, LCHAN_ST_ESTABLISHED) + && (lchan->type == GSM_LCHAN_TCH_F + || lchan->type == GSM_LCHAN_TCH_H)) { - vty_out(vty, "Found voice call: %s%s", - gsm_lchan_name(lchan), VTY_NEWLINE); - lchan_dump_full_vty(vty, lchan); - return lchan; + if (count == random_idx) { + vty_out(vty, "Found voice call: %s%s", + gsm_lchan_name(lchan), + VTY_NEWLINE); + lchan_dump_full_vty(vty, lchan); + return lchan; + } + count ++; + } } } } } + + if (!count) + break; + /* there are used lchans, but random_idx is > count. Iterate again. */ + random_idx %= count; } vty_out(vty, "Cannot find any ongoing voice calls%s", VTY_NEWLINE); @@ -1642,7 +1655,7 @@ } static struct gsm_bts *find_other_bts_with_free_slots(struct vty *vty, struct gsm_bts *not_this_bts, - enum gsm_phys_chan_config free_type) + enum gsm_chan_t free_type) { struct gsm_bts *bts; struct gsm_network *network = gsmnet_from_vty(vty); @@ -1654,30 +1667,14 @@ continue; llist_for_each_entry(trx, &bts->trx_list, list) { - int i; - /* FIXME: use lchan_select_by_type() instead */ - for (i = 0; i < ARRAY_SIZE(trx->ts); i++) { - struct gsm_bts_trx_ts *ts = &trx->ts[i]; - struct gsm_lchan *lchan; + struct gsm_lchan *lchan = lchan_select_by_type(bts, free_type); + if (!lchan) + continue; - /* skip administratively deactivated timeslots */ - if (!nm_is_running(&ts->mo.nm_state)) - continue; - - if (ts->pchan_is != free_type) - continue; - - ts_for_each_lchan(lchan, ts) { - if (lchan->fi->state != LCHAN_ST_UNUSED) - continue; - vty_out(vty, "Found unused %s slot: %s%s", - gsm_pchan_name(free_type), - gsm_lchan_name(lchan), - VTY_NEWLINE); - lchan_dump_full_vty(vty, lchan); - return bts; - } - } + vty_out(vty, "Found unused %s slot: %s%s", + gsm_lchant_name(free_type), gsm_lchan_name(lchan), VTY_NEWLINE); + lchan_dump_full_vty(vty, lchan); + return bts; } } vty_out(vty, "Cannot find any BTS (other than BTS %u) with free %s lchan%s", @@ -1694,12 +1691,11 @@ struct gsm_lchan *from_lchan; struct gsm_bts *to_bts; - from_lchan = find_used_voice_lchan(vty); + from_lchan = find_used_voice_lchan(vty, random()); if (!from_lchan) return CMD_WARNING; - to_bts = find_other_bts_with_free_slots(vty, from_lchan->ts->trx->bts, - from_lchan->ts->pchan_is); + to_bts = find_other_bts_with_free_slots(vty, from_lchan->ts->trx->bts, from_lchan->type); if (!to_bts) return CMD_WARNING; @@ -1714,7 +1710,7 @@ { struct gsm_lchan *from_lchan; - from_lchan = find_used_voice_lchan(vty); + from_lchan = find_used_voice_lchan(vty, random()); if (!from_lchan) return CMD_WARNING; @@ -1733,7 +1729,7 @@ struct handover_out_req req; struct gsm_lchan *from_lchan; - from_lchan = find_used_voice_lchan(vty); + from_lchan = find_used_voice_lchan(vty, random()); if (!from_lchan) return CMD_WARNING; -- To view, visit https://gerrit.osmocom.org/10108 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I50b70e02d665b967e401db65581e110bc83101e7 Gerrit-Change-Number: 10108 Gerrit-PatchSet: 9 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 10:44:11 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 28 Jul 2018 10:44:11 +0000 Subject: Change in osmo-bsc[master]: cosmetic: dissolve bsc_api.c In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10146 ) Change subject: cosmetic: dissolve bsc_api.c ...................................................................... cosmetic: dissolve bsc_api.c gsm0808_page() is just a thin wrapper for rsl_paging_cmd(), the only caller is page_ms() from paging.c. Directly call rsl_paging_cmd() instead. Move gsm0808_cipher_mode() to the only caller in osmo_bsc_bssap.c, make static. Change-Id: Ib7ce026b52d4ba3e53a8b2824e74ea92432c48c5 --- M include/osmocom/bsc/bsc_api.h M src/osmo-bsc/Makefile.am D src/osmo-bsc/bsc_api.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/paging.c M tests/handover/Makefile.am 6 files changed, 29 insertions(+), 82 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmocom/bsc/bsc_api.h b/include/osmocom/bsc/bsc_api.h index bc6c676..dcfcc45 100644 --- a/include/osmocom/bsc/bsc_api.h +++ b/include/osmocom/bsc/bsc_api.h @@ -20,10 +20,6 @@ int gsm0808_submit_dtap(struct gsm_subscriber_connection *conn, struct msgb *msg, uint8_t link_id, bool allow_sacch); int gsm0808_assign_req(struct gsm_subscriber_connection *conn, int chan_mode, int full_rate); -int gsm0808_cipher_mode(struct gsm_subscriber_connection *conn, int cipher, - const uint8_t *key, int len, int include_imeisv); -int gsm0808_page(struct gsm_bts *bts, unsigned int page_group, - unsigned int mi_len, uint8_t *mi, int chan_type); int gsm0808_clear(struct gsm_subscriber_connection *conn); bool msc_connected(struct gsm_subscriber_connection *conn); diff --git a/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am index e9add36..2d479c1 100644 --- a/src/osmo-bsc/Makefile.am +++ b/src/osmo-bsc/Makefile.am @@ -35,7 +35,6 @@ acc_ramp.c \ arfcn_range_encode.c \ assignment_fsm.c \ - bsc_api.c \ bsc_ctrl_commands.c \ bsc_ctrl_lookup.c \ bsc_init.c \ diff --git a/src/osmo-bsc/bsc_api.c b/src/osmo-bsc/bsc_api.c deleted file mode 100644 index e5424c4..0000000 --- a/src/osmo-bsc/bsc_api.c +++ /dev/null @@ -1,75 +0,0 @@ -/* GSM 08.08 like API for OpenBSC. The bridge from MSC to BSC */ - -/* (C) 2010-2011 by Holger Hans Peter Freyther - * (C) 2010-2011 by On-Waves - * (C) 2009,2017 by Harald Welte - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include - -int gsm0808_page(struct gsm_bts *bts, unsigned int page_group, unsigned int mi_len, - uint8_t *mi, int chan_type) -{ - return rsl_paging_cmd(bts, page_group, mi_len, mi, chan_type, false); -} - -/*! \brief We received a GSM 08.08 CIPHER MODE from the MSC */ -int gsm0808_cipher_mode(struct gsm_subscriber_connection *conn, int cipher, - const uint8_t *key, int len, int include_imeisv) -{ - if (cipher > 0 && key == NULL) { - LOGP(DRSL, LOGL_ERROR, "%s: Need to have an encryption key.\n", - bsc_subscr_name(conn->bsub)); - return -1; - } - - if (len > MAX_A5_KEY_LEN) { - LOGP(DRSL, LOGL_ERROR, "%s: The key is too long: %d\n", - bsc_subscr_name(conn->bsub), len); - return -1; - } - - LOGP(DRSL, LOGL_DEBUG, "(subscr %s) Cipher Mode: cipher=%d key=%s include_imeisv=%d\n", - bsc_subscr_name(conn->bsub), cipher, osmo_hexdump_nospc(key, len), include_imeisv); - - conn->lchan->encr.alg_id = RSL_ENC_ALG_A5(cipher); - if (key) { - conn->lchan->encr.key_len = len; - memcpy(conn->lchan->encr.key, key, len); - } - - return gsm48_send_rr_ciph_mode(conn->lchan, include_imeisv); -} diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index c6fbe23..95bad7b 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -386,6 +386,34 @@ return -1; } +/*! We received a GSM 08.08 CIPHER MODE from the MSC */ +static int gsm0808_cipher_mode(struct gsm_subscriber_connection *conn, int cipher, + const uint8_t *key, int len, int include_imeisv) +{ + if (cipher > 0 && key == NULL) { + LOGP(DRSL, LOGL_ERROR, "%s: Need to have an encryption key.\n", + bsc_subscr_name(conn->bsub)); + return -1; + } + + if (len > MAX_A5_KEY_LEN) { + LOGP(DRSL, LOGL_ERROR, "%s: The key is too long: %d\n", + bsc_subscr_name(conn->bsub), len); + return -1; + } + + LOGP(DRSL, LOGL_DEBUG, "(subscr %s) Cipher Mode: cipher=%d key=%s include_imeisv=%d\n", + bsc_subscr_name(conn->bsub), cipher, osmo_hexdump_nospc(key, len), include_imeisv); + + conn->lchan->encr.alg_id = RSL_ENC_ALG_A5(cipher); + if (key) { + conn->lchan->encr.key_len = len; + memcpy(conn->lchan->encr.key, key, len); + } + + return gsm48_send_rr_ciph_mode(conn->lchan, include_imeisv); +} + /* * GSM 08.08 ? 3.4.7 cipher mode handling. We will have to pick * the cipher to be used for this. In case we are already using diff --git a/src/osmo-bsc/paging.c b/src/osmo-bsc/paging.c index bc1927e..0ef89c1 100644 --- a/src/osmo-bsc/paging.c +++ b/src/osmo-bsc/paging.c @@ -96,7 +96,7 @@ page_group = gsm0502_calc_paging_group(&bts->si_common.chan_desc, str_to_imsi(request->bsub->imsi)); - gsm0808_page(bts, page_group, mi_len, mi, request->chan_type); + rsl_paging_cmd(bts, page_group, mi_len, mi, request->chan_type, false); log_set_context(LOG_CTX_BSC_SUBSCR, NULL); } diff --git a/tests/handover/Makefile.am b/tests/handover/Makefile.am index 3ce870b..5e9af04 100644 --- a/tests/handover/Makefile.am +++ b/tests/handover/Makefile.am @@ -43,7 +43,6 @@ $(top_builddir)/src/osmo-bsc/abis_rsl.o \ $(top_builddir)/src/osmo-bsc/arfcn_range_encode.o \ $(top_builddir)/src/osmo-bsc/assignment_fsm.o \ - $(top_builddir)/src/osmo-bsc/bsc_api.o \ $(top_builddir)/src/osmo-bsc/bsc_init.o \ $(top_builddir)/src/osmo-bsc/bsc_rll.o \ $(top_builddir)/src/osmo-bsc/bsc_subscr_conn_fsm.o \ -- To view, visit https://gerrit.osmocom.org/10146 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ib7ce026b52d4ba3e53a8b2824e74ea92432c48c5 Gerrit-Change-Number: 10146 Gerrit-PatchSet: 6 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 10:44:12 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 28 Jul 2018 10:44:12 +0000 Subject: Change in osmo-bsc[master]: cosmetic: reduce bsc_api.h In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10147 ) Change subject: cosmetic: reduce bsc_api.h ...................................................................... cosmetic: reduce bsc_api.h Remove as much as possible from bsc_api.h. Use '#pragma once'. Tweak head comment. BSC_API_CONN_POL_{ACCEPT,REJECT}: only user is static complete_layer3(), just use a bool return value instead. msc_connected(): only used in osmo_bsc_api.c, make static there. Instead of including gsm_data.h, declare structs opaquely, include stdint.h. codec_pref_test.c used this as indirect gsm_data.h include via osmo_bsc.h, include gsm_data.h there directly. osmo_bsc.h: instead of including bsc_api.h, declare opaque structs. gsm_04_08_rr.h: declare opaque structs to replace indirect include of gsm_data.h. Change-Id: Ia9c0f9828317236048e40ec9ecf9990592e2190a --- M include/osmocom/bsc/bsc_api.h M include/osmocom/bsc/gsm_04_08_rr.h M include/osmocom/bsc/osmo_bsc.h M src/osmo-bsc/osmo_bsc_api.c M tests/codec_pref/codec_pref_test.c 5 files changed, 31 insertions(+), 25 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmocom/bsc/bsc_api.h b/include/osmocom/bsc/bsc_api.h index dcfcc45..5241295 100644 --- a/include/osmocom/bsc/bsc_api.h +++ b/include/osmocom/bsc/bsc_api.h @@ -1,12 +1,10 @@ -/* GSM 08.08 like API for OpenBSC */ +/* GSM 08.08 function declarations for osmo-bsc */ -#ifndef OPENBSC_BSC_API_H -#define OPENBSC_BSC_API_H +#pragma once -#include "gsm_data.h" +#include -#define BSC_API_CONN_POL_ACCEPT 0 -#define BSC_API_CONN_POL_REJECT 1 +struct gsm_subscriber_connection; void bsc_sapi_n_reject(struct gsm_subscriber_connection *conn, int dlci); void bsc_cipher_mode_compl(struct gsm_subscriber_connection *conn, struct msgb *msg, uint8_t chosen_encr); @@ -16,11 +14,3 @@ void bsc_cm_update(struct gsm_subscriber_connection *conn, const uint8_t *cm2, uint8_t cm2_len, const uint8_t *cm3, uint8_t cm3_len); - -int gsm0808_submit_dtap(struct gsm_subscriber_connection *conn, struct msgb *msg, uint8_t link_id, - bool allow_sacch); -int gsm0808_assign_req(struct gsm_subscriber_connection *conn, int chan_mode, int full_rate); -int gsm0808_clear(struct gsm_subscriber_connection *conn); - -bool msc_connected(struct gsm_subscriber_connection *conn); -#endif diff --git a/include/osmocom/bsc/gsm_04_08_rr.h b/include/osmocom/bsc/gsm_04_08_rr.h index 63bec7a..8f46922 100644 --- a/include/osmocom/bsc/gsm_04_08_rr.h +++ b/include/osmocom/bsc/gsm_04_08_rr.h @@ -1,5 +1,18 @@ #pragma once +#include + +struct amr_mode; +struct amr_multirate_conf; +struct bsc_subscr; +struct gsm48_chan_desc; +struct gsm48_pag_resp; +struct gsm_lchan; +struct gsm_meas_rep; +struct gsm_network; +struct gsm_subscriber_connection; +struct msgb; + void gsm_net_update_ctype(struct gsm_network *network); enum gsm_chan_t get_ctype_by_chreq(struct gsm_network *network, uint8_t ra); int get_reason_by_chreq(uint8_t ra, int neci); diff --git a/include/osmocom/bsc/osmo_bsc.h b/include/osmocom/bsc/osmo_bsc.h index 0e19b0b..bebfb2f 100644 --- a/include/osmocom/bsc/osmo_bsc.h +++ b/include/osmocom/bsc/osmo_bsc.h @@ -2,7 +2,6 @@ #include -#include #include #define BSS_SEND_USSD 1 @@ -18,6 +17,8 @@ struct gsm0808_channel_type; struct gsm0808_speech_codec_list; struct gsm_audio_support; +struct gsm_subscriber_connection; +struct gsm_bts; struct bsc_api *osmo_bsc_api(); diff --git a/src/osmo-bsc/osmo_bsc_api.c b/src/osmo-bsc/osmo_bsc_api.c index b4d080d..dfec19a 100644 --- a/src/osmo-bsc/osmo_bsc_api.c +++ b/src/osmo-bsc/osmo_bsc_api.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -36,7 +37,7 @@ #include /* Check if we have a proper connection to the MSC */ -bool msc_connected(struct gsm_subscriber_connection *conn) +static bool msc_connected(struct gsm_subscriber_connection *conn) { /* No subscriber conn at all */ if (!conn) @@ -53,8 +54,8 @@ return true; } -static int complete_layer3(struct gsm_subscriber_connection *conn, - struct msgb *msg, struct bsc_msc_data *msc); +static bool complete_layer3(struct gsm_subscriber_connection *conn, + struct msgb *msg, struct bsc_msc_data *msc); static struct osmo_cell_global_id *cgi_for_msc(struct bsc_msc_data *msc, struct gsm_bts *bts) { @@ -438,8 +439,8 @@ return 0; } -static int complete_layer3(struct gsm_subscriber_connection *conn, - struct msgb *msg, struct bsc_msc_data *msc) +static bool complete_layer3(struct gsm_subscriber_connection *conn, + struct msgb *msg, struct bsc_msc_data *msc) { int con_type, rc, lu_cause; char *imsi = NULL; @@ -451,7 +452,7 @@ &imsi, &con_type, &lu_cause); if (rc < 0) { bsc_maybe_lu_reject(conn, con_type, lu_cause); - return BSC_API_CONN_POL_REJECT; + return false; } /* allocate resource for a new connection */ @@ -464,7 +465,7 @@ else if (ret == BSC_CON_REJECT_RF_GRACE) bsc_send_ussd_no_srv(conn, msg, msc->ussd_grace_txt); - return BSC_API_CONN_POL_REJECT; + return false; } /* TODO: also extract TMSI. We get an IMSI only when an initial L3 Complete comes in that @@ -493,12 +494,12 @@ resp = gsm0808_create_layer3_2(msg, cgi_for_msc(conn->sccp.msc, conn_get_bts(conn)), NULL); if (!resp) { LOGP(DMSC, LOGL_DEBUG, "Failed to create layer3 message.\n"); - return BSC_API_CONN_POL_REJECT; + return false; } osmo_fsm_inst_dispatch(conn->fi, GSCON_EV_A_CONN_REQ, resp); - return BSC_API_CONN_POL_ACCEPT; + return true; } /* @@ -519,7 +520,7 @@ * MSC. If it fails the caller will need to handle this * properly. */ - if (complete_layer3(_conn, msg, msc) != BSC_API_CONN_POL_ACCEPT) { + if (!complete_layer3(_conn, msg, msc)) { /* FIXME: I have not the slightest idea what move_to_msc() intends to do; during lchan * FSM introduction, I changed this and hope it is the appropriate action. I actually * assume this is unused legacy code for osmo-bsc_nat?? */ diff --git a/tests/codec_pref/codec_pref_test.c b/tests/codec_pref/codec_pref_test.c index 0f908e5..b0b9f5e 100644 --- a/tests/codec_pref/codec_pref_test.c +++ b/tests/codec_pref/codec_pref_test.c @@ -19,6 +19,7 @@ * */ +#include #include #include #include -- To view, visit https://gerrit.osmocom.org/10147 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ia9c0f9828317236048e40ec9ecf9990592e2190a Gerrit-Change-Number: 10147 Gerrit-PatchSet: 6 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 10:44:13 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 28 Jul 2018 10:44:13 +0000 Subject: Change in osmo-bsc[master]: cosmetic: rename bsc_api.h to gsm_08_08.h In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10148 ) Change subject: cosmetic: rename bsc_api.h to gsm_08_08.h ...................................................................... cosmetic: rename bsc_api.h to gsm_08_08.h See also I91922f557072d0fb8cfe213a8a7b50f3bb23dea0, which renames osmo_bsc_api.c to gsm_08_08.c. Change-Id: I7179eb27183ee213f8fc8d548895b67aa43dc6a2 --- M include/osmocom/bsc/Makefile.am R include/osmocom/bsc/gsm_08_08.h M src/osmo-bsc/abis_rsl.c M src/osmo-bsc/assignment_fsm.c M src/osmo-bsc/bsc_subscr_conn_fsm.c M src/osmo-bsc/gsm_04_08_rr.c M src/osmo-bsc/osmo_bsc_api.c M src/osmo-bsc/paging.c M tests/handover/handover_test.c 9 files changed, 8 insertions(+), 8 deletions(-) Approvals: Jenkins Builder: Verified Neels Hofmeyr: Looks good to me, approved diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am index 57837ec..02a4ad8 100644 --- a/include/osmocom/bsc/Makefile.am +++ b/include/osmocom/bsc/Makefile.am @@ -54,7 +54,7 @@ timeslot_fsm.h \ ussd.h \ vty.h \ - bsc_api.h \ + gsm_08_08.h \ penalty_timers.h \ osmo_bsc_lcls.h \ $(NULL) diff --git a/include/osmocom/bsc/bsc_api.h b/include/osmocom/bsc/gsm_08_08.h similarity index 100% rename from include/osmocom/bsc/bsc_api.h rename to include/osmocom/bsc/gsm_08_08.h diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c index d72bfa3..0dd27fd 100644 --- a/src/osmo-bsc/abis_rsl.c +++ b/src/osmo-bsc/abis_rsl.c @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/osmo-bsc/assignment_fsm.c b/src/osmo-bsc/assignment_fsm.c index e37ec9c..41615ac 100644 --- a/src/osmo-bsc/assignment_fsm.c +++ b/src/osmo-bsc/assignment_fsm.c @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c b/src/osmo-bsc/bsc_subscr_conn_fsm.c index bd41761..60a9a75 100644 --- a/src/osmo-bsc/bsc_subscr_conn_fsm.c +++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/osmo-bsc/gsm_04_08_rr.c b/src/osmo-bsc/gsm_04_08_rr.c index 8950d93..2b4a1ba 100644 --- a/src/osmo-bsc/gsm_04_08_rr.c +++ b/src/osmo-bsc/gsm_04_08_rr.c @@ -39,7 +39,7 @@ #include #include #include -#include +#include /* should ip.access BTS use direct RTP streams between each other (1), * or should OpenBSC always act as RTP relay/proxy in between (0) ? */ diff --git a/src/osmo-bsc/osmo_bsc_api.c b/src/osmo-bsc/osmo_bsc_api.c index dfec19a..d1a6a96 100644 --- a/src/osmo-bsc/osmo_bsc_api.c +++ b/src/osmo-bsc/osmo_bsc_api.c @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/osmo-bsc/paging.c b/src/osmo-bsc/paging.c index 0ef89c1..afe3245 100644 --- a/src/osmo-bsc/paging.c +++ b/src/osmo-bsc/paging.c @@ -49,7 +49,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c index a962777..76e5fe1 100644 --- a/tests/handover/handover_test.c +++ b/tests/handover/handover_test.c @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include #include -- To view, visit https://gerrit.osmocom.org/10148 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I7179eb27183ee213f8fc8d548895b67aa43dc6a2 Gerrit-Change-Number: 10148 Gerrit-PatchSet: 6 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 10:44:14 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 28 Jul 2018 10:44:14 +0000 Subject: Change in osmo-bsc[master]: cosmetic: rename osmo_bsc_api.c to gsm_08_08.c In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10149 ) Change subject: cosmetic: rename osmo_bsc_api.c to gsm_08_08.c ...................................................................... cosmetic: rename osmo_bsc_api.c to gsm_08_08.c Change-Id: I91922f557072d0fb8cfe213a8a7b50f3bb23dea0 --- M src/osmo-bsc/Makefile.am R src/osmo-bsc/gsm_08_08.c 2 files changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am index 2d479c1..364228d 100644 --- a/src/osmo-bsc/Makefile.am +++ b/src/osmo-bsc/Makefile.am @@ -74,7 +74,7 @@ neighbor_ident.c \ neighbor_ident_vty.c \ net_init.c \ - osmo_bsc_api.c \ + gsm_08_08.c \ osmo_bsc_bssap.c \ osmo_bsc_ctrl.c \ osmo_bsc_filter.c \ diff --git a/src/osmo-bsc/osmo_bsc_api.c b/src/osmo-bsc/gsm_08_08.c similarity index 100% rename from src/osmo-bsc/osmo_bsc_api.c rename to src/osmo-bsc/gsm_08_08.c -- To view, visit https://gerrit.osmocom.org/10149 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I91922f557072d0fb8cfe213a8a7b50f3bb23dea0 Gerrit-Change-Number: 10149 Gerrit-PatchSet: 6 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 10:44:15 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 28 Jul 2018 10:44:15 +0000 Subject: Change in osmo-bsc[master]: cosmetic: gscon: don't re-enter ST_CLEARING In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10193 ) Change subject: cosmetic: gscon: don't re-enter ST_CLEARING ...................................................................... cosmetic: gscon: don't re-enter ST_CLEARING I often see "ERROR [ST_CLEARING] Entering ST_CLEARING not permitted!", avoid the bogus error messages by checking entering ST_CLEARING only if not in it yet. Still don't allow re-entering, to not restart the timeout. Change-Id: Ia1f171c08dcbc529f907a20eed43bf5ee3a452b3 --- M src/osmo-bsc/bsc_subscr_conn_fsm.c 1 file changed, 6 insertions(+), 3 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c b/src/osmo-bsc/bsc_subscr_conn_fsm.c index 60a9a75..fd3c293 100644 --- a/src/osmo-bsc/bsc_subscr_conn_fsm.c +++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c @@ -290,7 +290,8 @@ osmo_fsm_inst_state_name(conn->fi)); } gscon_bssmap_clear(conn, GSM0808_CAUSE_EQUIPMENT_FAILURE); - osmo_fsm_inst_state_chg(fi, ST_CLEARING, 60, 999); + if (conn->fi->state != ST_CLEARING) + osmo_fsm_inst_state_chg(fi, ST_CLEARING, 60, 999); return; default: OSMO_ASSERT(false); @@ -626,7 +627,8 @@ conn->lchan = NULL; } if (!conn->lchan) { - osmo_fsm_inst_state_chg(conn->fi, ST_CLEARING, 60, 999); + if (conn->fi->state != ST_CLEARING) + osmo_fsm_inst_state_chg(conn->fi, ST_CLEARING, 60, 999); gscon_bssmap_clear(conn, GSM0808_CAUSE_EQUIPMENT_FAILURE); } } @@ -670,7 +672,8 @@ switch (event) { case GSCON_EV_A_CLEAR_CMD: /* MSC tells us to cleanly shut down */ - osmo_fsm_inst_state_chg(fi, ST_CLEARING, 60, 999); + if (conn->fi->state != ST_CLEARING) + osmo_fsm_inst_state_chg(fi, ST_CLEARING, 60, 999); LOGPFSML(fi, LOGL_DEBUG, "Releasing all lchans (if any) after BSSMAP Clear Command\n"); gscon_release_lchans(conn, true); /* FIXME: Release all terestrial resources in ST_CLEARING */ -- To view, visit https://gerrit.osmocom.org/10193 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ia1f171c08dcbc529f907a20eed43bf5ee3a452b3 Gerrit-Change-Number: 10193 Gerrit-PatchSet: 2 Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 13:47:25 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sat, 28 Jul 2018 13:47:25 +0000 Subject: Change in meta-telephony[201705]: recipes-osmocom: update to latests releases Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10209 Change subject: recipes-osmocom: update to latests releases ...................................................................... recipes-osmocom: update to latests releases Change-Id: I8b13f82f32ba775bd56276edaafabdc51a0f5c64 --- M recipes-osmocom/libosmo-abis/libosmo-abis_git.bb M recipes-osmocom/libosmo-netif/libosmo-netif_git.bb M recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb M recipes-osmocom/libosmocore/libosmocore_git.bb M recipes-osmocom/osmo-bsc/osmo-bsc_git.bb M recipes-osmocom/osmo-mgw/osmo-mgw_git.bb 6 files changed, 12 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/09/10209/1 diff --git a/recipes-osmocom/libosmo-abis/libosmo-abis_git.bb b/recipes-osmocom/libosmo-abis/libosmo-abis_git.bb index 1bfdb18..98e5192 100644 --- a/recipes-osmocom/libosmo-abis/libosmo-abis_git.bb +++ b/recipes-osmocom/libosmo-abis/libosmo-abis_git.bb @@ -1,7 +1,7 @@ require ${PN}.inc S = "${WORKDIR}/git" -SRCREV = "7b89f12e66a280746fc8e7906505b2d769d19706" +SRCREV = "026ff4574daedcf91a474f9bc67e90e8537a9d86" SRC_URI = "git://git.osmocom.org/libosmo-abis.git;protocol=git" -PV = "0.5.0+gitr${SRCPV}" +PV = "0.5.1+gitr${SRCPV}" PR = "${INC_PR}.0" diff --git a/recipes-osmocom/libosmo-netif/libosmo-netif_git.bb b/recipes-osmocom/libosmo-netif/libosmo-netif_git.bb index 419cb2c..d71810f 100644 --- a/recipes-osmocom/libosmo-netif/libosmo-netif_git.bb +++ b/recipes-osmocom/libosmo-netif/libosmo-netif_git.bb @@ -1,7 +1,7 @@ require ${PN}.inc S = "${WORKDIR}/git" -SRCREV = "e38ee9b808970cd49663221cb823365ef18797d5" +SRCREV = "322dbbeaa29cb90c6917fa7e78a66b96b8ce3689" SRC_URI = "git://git.osmocom.org/libosmo-netif.git;protocol=git" -PV = "0.2.0+gitr${SRCPV}" +PV = "0.3.0+gitr${SRCPV}" PR = "${INC_PR}.0" diff --git a/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb b/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb index bb83638..751bf70 100644 --- a/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb +++ b/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb @@ -1,7 +1,7 @@ require ${PN}.inc S = "${WORKDIR}/git" -SRCREV = "c88605c41c25b34d2e2b08f0e1028c2bd6d9404b" +SRCREV = "688f2304056029f47073a549d7e41043eab5a0fd" SRC_URI = "git://git.osmocom.org/libosmo-sccp.git;protocol=git" -PV = "0.9.0+gitr${SRCPV}" +PV = "0.10.0+gitr${SRCPV}" PR = "${INC_PR}.0" diff --git a/recipes-osmocom/libosmocore/libosmocore_git.bb b/recipes-osmocom/libosmocore/libosmocore_git.bb index c2c37f5..9aedec1 100644 --- a/recipes-osmocom/libosmocore/libosmocore_git.bb +++ b/recipes-osmocom/libosmocore/libosmocore_git.bb @@ -1,9 +1,9 @@ require ${PN}.inc S = "${WORKDIR}/git" -SRCREV = "cacaa4a1616d7c0ea370ff197d816f706909bde5" +SRCREV = "924ef0bc72c1be165e8d5c22859f8b4eddbc0f06" SRC_URI = "git://git.osmocom.org/libosmocore.git;protocol=git;nobranch=1" -PV = "0.11.0+gitr${SRCPV}" +PV = "0.12.0+gitr${SRCPV}" PR = "r0" PACKAGES =+ "libosmoctrl libosmocodec libosmogb libosmogsm libosmovty osmo-arfcn osmo-auc-gen" diff --git a/recipes-osmocom/osmo-bsc/osmo-bsc_git.bb b/recipes-osmocom/osmo-bsc/osmo-bsc_git.bb index 2d8a71f..e31dc59 100644 --- a/recipes-osmocom/osmo-bsc/osmo-bsc_git.bb +++ b/recipes-osmocom/osmo-bsc/osmo-bsc_git.bb @@ -1,7 +1,7 @@ require ${PN}.inc S = "${WORKDIR}/git" -SRCREV = "e5a9665c009f9b81bbc370480405cb91cbe99b66" +SRCREV = "08d02dd5100cbff47922427e3beb31a3373bf75c" SRC_URI = "git://git.osmocom.org/osmo-bsc.git;protocol=git" -PV = "1.2.1+gitr${SRCPV}" +PV = "1.3.0+gitr${SRCPV}" PR = "${INC_PR}.0" diff --git a/recipes-osmocom/osmo-mgw/osmo-mgw_git.bb b/recipes-osmocom/osmo-mgw/osmo-mgw_git.bb index d863300..c3e7582 100644 --- a/recipes-osmocom/osmo-mgw/osmo-mgw_git.bb +++ b/recipes-osmocom/osmo-mgw/osmo-mgw_git.bb @@ -1,7 +1,7 @@ require ${PN}.inc S = "${WORKDIR}/git" -SRCREV = "d761d355f9b71b1dfe462e55a6e030bb026d8bf1" +SRCREV = "304b3eb32876cf69b202ee5688e00905fdb336f9" SRC_URI = "git://git.osmocom.org/osmo-mgw.git;protocol=git" -PV = "1.3.0+gitr${SRCPV}" +PV = "1.4.0+gitr${SRCPV}" PR = "${INC_PR}.0" -- To view, visit https://gerrit.osmocom.org/10209 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-MessageType: newchange Gerrit-Change-Id: I8b13f82f32ba775bd56276edaafabdc51a0f5c64 Gerrit-Change-Number: 10209 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 13:47:27 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sat, 28 Jul 2018 13:47:27 +0000 Subject: Change in meta-telephony[201705]: osmo-bsc: Don't try to package anything bsc-nat related Message-ID: Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/10210 Change subject: osmo-bsc: Don't try to package anything bsc-nat related ...................................................................... osmo-bsc: Don't try to package anything bsc-nat related osmo-bsc_nat has been fully removed from osmo-bsc.git in 1c9b8b19176854ecf4a3d57e9eef6b495361557f. Instead, build the one from openbsc.git. Change-Id: I98109914d53cce1880f259f5d8d366879c2aff61 --- M recipes-osmocom/openbsc/openbsc.inc M recipes-osmocom/osmo-bsc/osmo-bsc.inc 2 files changed, 11 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/10/10210/1 diff --git a/recipes-osmocom/openbsc/openbsc.inc b/recipes-osmocom/openbsc/openbsc.inc index 36c57e7..9f23d52 100644 --- a/recipes-osmocom/openbsc/openbsc.inc +++ b/recipes-osmocom/openbsc/openbsc.inc @@ -11,9 +11,9 @@ file://osmo-bsc-sccplite.service \ " -INC_PR = "r0.${META_TELEPHONY_OSMO_INC}" +INC_PR = "r1.${META_TELEPHONY_OSMO_INC}" -EXTRA_OECONF += "--enable-osmo-bsc --enable-smpp --enable-mgcp-transcoding --with-g729" +EXTRA_OECONF += "--enable-nat --enable-osmo-bsc --enable-smpp --enable-mgcp-transcoding --with-g729" inherit autotools update-rc.d pkgconfig @@ -21,6 +21,7 @@ install -d ${D}${sysconfdir}/osmocom install -m 0660 ${S}/doc/examples/osmo-nitb/nanobts/openbsc.cfg ${D}${sysconfdir}/osmocom/osmo-nitb.cfg install -m 0660 ${S}/doc/examples/osmo-bsc-sccplite/osmo-bsc-sccplite.cfg ${D}${sysconfdir}/osmocom/osmo-bsc-sccplite.cfg + install -m 0644 ${S}/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg ${D}${sysconfdir}/osmocom/ # Install sysv-init files install -d ${D}${sysconfdir}/init.d @@ -37,7 +38,7 @@ } -PACKAGES =+ "osmo-bsc-sccplite osmo-nitb" +PACKAGES =+ "osmo-bsc-nat osmo-bsc-sccplite osmo-nitb" INITSCRIPT_PACKAGES = "osmo-bsc-sccplite osmo-nitb" @@ -62,3 +63,9 @@ ${sysconfdir}/osmocom/osmo-nitb.cfg \ ${systemd_unitdir}/system/osmo-nitb.service \ " + +CONFFILES_osmo-bsc-nat = "${sysconfdir}/osmocom/osmo-bsc_nat.cfg" +FILES_osmo-bsc-nat = " \ + ${bindir}/osmo-bsc_nat \ + ${sysconfdir}/osmocom/osmo-bsc_nat.cfg \ + " diff --git a/recipes-osmocom/osmo-bsc/osmo-bsc.inc b/recipes-osmocom/osmo-bsc/osmo-bsc.inc index f20362f..d066a58 100644 --- a/recipes-osmocom/osmo-bsc/osmo-bsc.inc +++ b/recipes-osmocom/osmo-bsc/osmo-bsc.inc @@ -14,12 +14,11 @@ install -d ${D}${sysconfdir}/osmocom/ install -m 0644 ${S}/doc/examples/osmo-bsc/osmo-bsc.cfg ${D}${sysconfdir}/osmocom/ - install -m 0644 ${S}/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg ${D}${sysconfdir}/osmocom/ install -m 0644 ${S}/contrib/systemd/osmo-bsc.service ${D}${systemd_system_unitdir}/ } -PACKAGES =+ "osmo-bsc-nat-doc osmo-bsc-nat meas-utils ipaccess-utils bs11-utils abisip-find" +PACKAGES =+ "meas-utils ipaccess-utils bs11-utils abisip-find" SYSTEMD_PACKAGES = "osmo-bsc" SYSTEMD_SERVICE_osmo-bsc = "osmo-bsc.service" @@ -43,11 +42,3 @@ ${bindir}/osmo-meas-pcap2db \ ${bindir}/meas_json \ " - -FILES_osmo-bsc-nat = " \ - ${bindir}/osmo-bsc_nat \ - ${sysconfdir}/osmocom/osmo-bsc_nat.cfg \ - " -CONFFILES_osmo-bsc-nat = "${sysconfdir}/osmocom/osmo-bsc_nat.cfg" - -FILES_osmo-bsc-nat-doc = " ${docdir}/osmo-bsc/examples/osmo-bsc_nat " -- To view, visit https://gerrit.osmocom.org/10210 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-MessageType: newchange Gerrit-Change-Id: I98109914d53cce1880f259f5d8d366879c2aff61 Gerrit-Change-Number: 10210 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 14:00:38 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sat, 28 Jul 2018 14:00:38 +0000 Subject: Change in meta-telephony[201705]: recipes-osmocom: update to latests releases In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10209 ) Change subject: recipes-osmocom: update to latests releases ...................................................................... Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/10209 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-MessageType: comment Gerrit-Change-Id: I8b13f82f32ba775bd56276edaafabdc51a0f5c64 Gerrit-Change-Number: 10209 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Sat, 28 Jul 2018 14:00:38 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 14:00:46 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sat, 28 Jul 2018 14:00:46 +0000 Subject: Change in meta-telephony[201705]: osmo-bsc: Don't try to package anything bsc-nat related In-Reply-To: References: Message-ID: Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/10210 ) Change subject: osmo-bsc: Don't try to package anything bsc-nat related ...................................................................... Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/10210 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-MessageType: comment Gerrit-Change-Id: I98109914d53cce1880f259f5d8d366879c2aff61 Gerrit-Change-Number: 10210 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Sat, 28 Jul 2018 14:00:46 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Sat Jul 28 15:10:07 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Sat, 28 Jul 2018 15:10:07 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-asn1c_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#198?= In-Reply-To: <2122306959.97.1532704207054.JavaMail.jenkins@jenkins.osmocom.org> References: <2122306959.97.1532704207054.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <1162022103.105.1532790607108.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 3.67 KB...] + ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for style of include used by make... GNU checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking how to run the C++ preprocessor... g++ -E checking for g77... no checking for f77... no checking for xlf... no checking for frt... no checking for pgf77... no checking for cf77... no checking for fort77... no checking for fl32... no checking for af77... no checking for f90... no checking for xlf90... no checking for pgf90... no checking for pghpf... no checking for epcf90... no checking for gfortran... no checking for g95... no checking for f95... no checking for fort... no checking for xlf95... no checking for ifort... no checking for ifc... no checking for efc... no checking for pgf95... no checking for lf95... no checking for ftn... no checking whether we are using the GNU Fortran 77 compiler... no checking whether accepts -g... no checking the maximum length of command line arguments... 32768 checking command to parse /usr/bin/nm -B output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes configure: creating libtool appending configuration tag "CXX" to libtool checking for ld used by g++... /usr/bin/ld -m elf_x86_64 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC checking if g++ PIC flag -fPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate appending configuration tag "F77" to libtool checking for autoconf... /usr/bin/autoconf checking for autoheader... /usr/bin/autoheader checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking dependency style of gcc... (cached) gcc3 checking how to run the C preprocessor... gcc -E checking for a BSD-compatible install... /usr/bin/install -c checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking for bison... bison -y checking for flex... flex checking for yywrap in -lfl... yes checking lex output file root... lex.yy checking whether yytext is a pointer... yes checking for ar... /usr/bin/ar checking for ANSI C header files... (cached) yes checking sys/param.h usability... yes checking sys/param.h presence... yes checking for sys/param.h... yes checking whether byte ordering is bigendian... no checking for off_t... yes checking for size_t... yes checking whether struct tm is in sys/time.h or time.h... time.h checking for intmax_t... yes checking for library containing getopt... none required checking for strtoimax... yes checking for strtoll... yes checking for mergesort... no checking for mkstemps... yes configure: creating ./config.status config.status: creating skeletons/standard-modules/Makefile config.status: creating skeletons/tests/Makefile config.status: creating libasn1compiler/Makefile config.status: creating libasn1parser/Makefile config.status: creating libasn1print/Makefile config.status: creating asn1c/webcgi/Makefile config.status: creating asn1c/tests/Makefile config.status: creating libasn1fix/Makefile config.status: creating skeletons/Makefile config.status: creating examples/Makefile config.status: creating tests/Makefile config.status: creating asn1c/Makefile config.status: creating doc/Makefile config.status: creating asn1c.spec config.status: creating Makefile config.status: creating config.h config.status: executing depfiles commands + make -j 8 make all-recursive make[1]: Entering directory ' Making all in libasn1parser make[2]: Entering directory ' if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF ".deps/asn1parser.Tpo" -c -o asn1parser.lo asn1parser.c; \ then mv -f ".deps/asn1parser.Tpo" ".deps/asn1parser.Plo"; else rm -f ".deps/asn1parser.Tpo"; exit 1; fi bison -y -p asn1p_ -d asn1p_y.y if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF ".deps/asn1p_l.Tpo" -c -o asn1p_l.lo asn1p_l.c; \ then mv -f ".deps/asn1p_l.Tpo" ".deps/asn1p_l.Plo"; else rm -f ".deps/asn1p_l.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF ".deps/asn1p_module.Tpo" -c -o asn1p_module.lo asn1p_module.c; \ then mv -f ".deps/asn1p_module.Tpo" ".deps/asn1p_module.Plo"; else rm -f ".deps/asn1p_module.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF ".deps/asn1p_oid.Tpo" -c -o asn1p_oid.lo asn1p_oid.c; \ then mv -f ".deps/asn1p_oid.Tpo" ".deps/asn1p_oid.Plo"; else rm -f ".deps/asn1p_oid.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF ".deps/asn1p_value.Tpo" -c -o asn1p_value.lo asn1p_value.c; \ then mv -f ".deps/asn1p_value.Tpo" ".deps/asn1p_value.Plo"; else rm -f ".deps/asn1p_value.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF ".deps/asn1p_expr.Tpo" -c -o asn1p_expr.lo asn1p_expr.c; \ then mv -f ".deps/asn1p_expr.Tpo" ".deps/asn1p_expr.Plo"; else rm -f ".deps/asn1p_expr.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF ".deps/asn1p_xports.Tpo" -c -o asn1p_xports.lo asn1p_xports.c; \ then mv -f ".deps/asn1p_xports.Tpo" ".deps/asn1p_xports.Plo"; else rm -f ".deps/asn1p_xports.Tpo"; exit 1; fi asn1p_y.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] mkdir .libs gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -fPIC -DPIC -o .libs/asn1p_module.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -fPIC -DPIC -o .libs/asn1p_oid.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -fPIC -DPIC -o .libs/asn1p_expr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -fPIC -DPIC -o .libs/asn1p_value.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -o asn1p_module.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -fPIC -DPIC -o .libs/asn1p_xports.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -o asn1p_oid.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -fPIC -DPIC -o .libs/asn1parser.o if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF ".deps/asn1p_constr.Tpo" -c -o asn1p_constr.lo asn1p_constr.c; \ then mv -f ".deps/asn1p_constr.Tpo" ".deps/asn1p_constr.Plo"; else rm -f ".deps/asn1p_constr.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -o asn1p_xports.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -o asn1p_value.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -fPIC -DPIC -o .libs/asn1p_l.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -o asn1p_expr.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF ".deps/asn1p_param.Tpo" -c -o asn1p_param.lo asn1p_param.c; \ then mv -f ".deps/asn1p_param.Tpo" ".deps/asn1p_param.Plo"; else rm -f ".deps/asn1p_param.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -o asn1parser.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF ".deps/asn1p_class.Tpo" -c -o asn1p_class.lo asn1p_class.c; \ then mv -f ".deps/asn1p_class.Tpo" ".deps/asn1p_class.Plo"; else rm -f ".deps/asn1p_class.Tpo"; exit 1; fi if test -f y.tab.h; then \ to=`echo "asn1p_y_H" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \ sed -e "/^#/!b" -e "s/Y_TAB_H/$to/g" -e "s|y\.tab\.h|asn1p_y.h|" \ y.tab.h >asn1p_y.ht; \ rm -f y.tab.h; \ if cmp -s asn1p_y.ht asn1p_y.h; then \ rm -f asn1p_y.ht ;\ else \ mv asn1p_y.ht asn1p_y.h; \ fi; \ fi asn1p_l.c:3521:12: warning: 'input' defined but not used [-Wunused-function] static int input() ^~~~~ if test -f y.output; then \ mv y.output asn1p_y.output; \ fi sed '/^#/ s|y\.tab\.c|asn1p_y.c|' y.tab.c >asn1p_y.ct && mv asn1p_y.ct asn1p_y.c rm -f y.tab.c if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF ".deps/asn1p_ref.Tpo" -c -o asn1p_ref.lo asn1p_ref.c; \ then mv -f ".deps/asn1p_ref.Tpo" ".deps/asn1p_ref.Plo"; else rm -f ".deps/asn1p_ref.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF ".deps/asn1p_y.Tpo" -c -o asn1p_y.lo asn1p_y.c; \ then mv -f ".deps/asn1p_y.Tpo" ".deps/asn1p_y.Plo"; else rm -f ".deps/asn1p_y.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -fPIC -DPIC -o .libs/asn1p_constr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -fPIC -DPIC -o .libs/asn1p_param.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -o asn1p_constr.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -fPIC -DPIC -o .libs/asn1p_class.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -o asn1p_param.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF .deps/asn1p_y.Tpo -c asn1p_y.c -fPIC -DPIC -o .libs/asn1p_y.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -fPIC -DPIC -o .libs/asn1p_ref.o asn1p_y.y: In function 'asn1p_parse': asn1p_y.y:357:13: error: 'param' undeclared (first use in this function) *(void **)param = $1; ^~~~~ asn1p_y.y:357:13: note: each undeclared identifier is reported only once for each function it appears in gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -o asn1p_class.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -o asn1p_ref.o >/dev/null 2>&1 Makefile:299: recipe for target 'asn1p_y.lo' failed make[2]: *** [asn1p_y.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -o asn1p_l.o >/dev/null 2>&1 make[2]: Leaving directory ' Makefile:302: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory ' Makefile:212: recipe for target 'all' failed make: *** [all] Error 2 Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Sat Jul 28 15:16:28 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Sat, 28 Jul 2018 15:16:28 +0000 Subject: Change in simtrace2[master]: sniff: ensure the checksum error flag is also printed Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/10211 Change subject: sniff: ensure the checksum error flag is also printed ...................................................................... sniff: ensure the checksum error flag is also printed the firmware now also use a generic value_string array (as does the host application) Change-Id: I861bd8b52e8f2f2a4786bbe1cc834917119dc394 --- M firmware/libcommon/source/sniffer.c M host/simtrace2-sniff.c 2 files changed, 36 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/11/10211/1 diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index e800216..5cf96fd 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -302,6 +302,38 @@ //TRACE_INFO("Changed to ISO 7816-3 state %u\n\r", iso_state); /* don't print since this is function is also called by ISRs */ } +const struct value_string data_flags[] = { + { + .value = SNIFF_DATA_FLAG_ERROR_INCOMPLETE, + .str = "incomplete", + }, + { + .value = SNIFF_DATA_FLAG_ERROR_MALFORMED, + .str = "malformed", + }, + { + .value = SNIFF_DATA_FLAG_ERROR_CHECKSUM, + .str = "checksum error", + }, + { + .value = 0, + .str = NULL, + }, +}; + +static void print_flags(const struct value_string* flag_meanings, uint32_t nb_flags, uint32_t flags) { + uint32_t i; + for (i = 0; i < nb_flags; i++) { + if (flags & flag_meanings[i].value) { + printf(flag_meanings[i].str); + flags &= ~flag_meanings[i].value; + if (flags) { + printf(", "); + } + } + } +} + static void usb_send_data(enum simtrace_msg_type_sniff type, const uint8_t* data, uint16_t length, uint32_t flags) { /* Sanity check */ @@ -329,20 +361,7 @@ } if (flags) { printf(" ("); - if (flags & SNIFF_DATA_FLAG_ERROR_INCOMPLETE) { - printf("incomplete"); - flags &= ~SNIFF_DATA_FLAG_ERROR_INCOMPLETE; - if (flags) { - printf(", "); - } - } - if (flags & SNIFF_DATA_FLAG_ERROR_MALFORMED) { - printf("malformed"); - flags &= ~SNIFF_DATA_FLAG_ERROR_MALFORMED; - if (flags) { - printf(", "); - } - } + print_flags(data_flags, ARRAY_SIZE(data_flags), flags); putchar(')'); } printf(": "); diff --git a/host/simtrace2-sniff.c b/host/simtrace2-sniff.c index aeacc6b..4ba43f4 100644 --- a/host/simtrace2-sniff.c +++ b/host/simtrace2-sniff.c @@ -131,14 +131,13 @@ .value = SNIFF_DATA_FLAG_ERROR_MALFORMED, .str = "malformed", }, + .value = SNIFF_DATA_FLAG_ERROR_CHECKSUM, + .str = "checksum error", + }, { .value = 0, .str = NULL, }, - { - .value = SNIFF_DATA_FLAG_ERROR_CHECKSUM, - .str = "checksum error", - }, }; static void print_flags(const struct value_string* flag_meanings, uint32_t nb_flags, uint32_t flags) { -- To view, visit https://gerrit.osmocom.org/10211 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I861bd8b52e8f2f2a4786bbe1cc834917119dc394 Gerrit-Change-Number: 10211 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 15:16:29 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Sat, 28 Jul 2018 15:16:29 +0000 Subject: Change in simtrace2[master]: sniff: fix ATR checksum calculation Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/10212 Change subject: sniff: fix ATR checksum calculation ...................................................................... sniff: fix ATR checksum calculation this issue also cause the sent ATR to be empty Change-Id: I6edff7aeb3185c835656acde75886fb6c90c0582 --- M firmware/libcommon/source/sniffer.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/12/10212/1 diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 5cf96fd..c57877f 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -505,7 +505,7 @@ if (ATR_S_WAIT_TCK == atr_state) { uint8_t ui; uint8_t checksum = 0; - for (ui = 1; ui < atr_i; atr_i++) { + for (ui = 1; ui < atr_i; ui++) { checksum ^= atr[ui]; } if (checksum) { -- To view, visit https://gerrit.osmocom.org/10212 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I6edff7aeb3185c835656acde75886fb6c90c0582 Gerrit-Change-Number: 10212 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 15:16:30 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Sat, 28 Jul 2018 15:16:30 +0000 Subject: Change in simtrace2[master]: sniff: increase debug output Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/10213 Change subject: sniff: increase debug output ...................................................................... sniff: increase debug output Change-Id: Ife0bbcf4a25aaa445a36768c00004e6e0d9a4947 --- M firmware/libcommon/source/sniffer.c 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/13/10213/1 diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index c57877f..c67ca94 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -299,7 +299,7 @@ /* save new state */ iso_state = iso_state_new; - //TRACE_INFO("Changed to ISO 7816-3 state %u\n\r", iso_state); /* don't print since this is function is also called by ISRs */ + TRACE_INFO("Changed to ISO 7816-3 state %u\n\r", iso_state); /* don't print since this is function is also called by ISRs */ } const struct value_string data_flags[] = { @@ -1052,11 +1052,13 @@ if (change_flags & SNIFF_CHANGE_FLAG_RESET_ASSERT) { if (ISO7816_S_RESET != iso_state) { change_state(ISO7816_S_RESET); + printf("reset asserted\n\r"); } } if (change_flags & SNIFF_CHANGE_FLAG_RESET_DEASSERT) { if (ISO7816_S_WAIT_ATR != iso_state) { change_state(ISO7816_S_WAIT_ATR); + printf("reset de-asserted\n\r"); } } if (change_flags & SNIFF_CHANGE_FLAG_TIMEOUT_WT) { -- To view, visit https://gerrit.osmocom.org/10213 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ife0bbcf4a25aaa445a36768c00004e6e0d9a4947 Gerrit-Change-Number: 10213 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 19:00:01 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Sat, 28 Jul 2018 19:00:01 +0000 Subject: Change in simtrace2[master]: sniff: ensure the checksum error flag is also printed In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10211 to look at the new patch set (#2). Change subject: sniff: ensure the checksum error flag is also printed ...................................................................... sniff: ensure the checksum error flag is also printed the firmware now also use a generic value_string array (as does the host application) Change-Id: I861bd8b52e8f2f2a4786bbe1cc834917119dc394 --- M firmware/libcommon/source/sniffer.c M host/simtrace2-sniff.c 2 files changed, 37 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/11/10211/2 -- To view, visit https://gerrit.osmocom.org/10211 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I861bd8b52e8f2f2a4786bbe1cc834917119dc394 Gerrit-Change-Number: 10211 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 19:00:01 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Sat, 28 Jul 2018 19:00:01 +0000 Subject: Change in simtrace2[master]: cardem: show detailed reset cause Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/10214 Change subject: cardem: show detailed reset cause ...................................................................... cardem: show detailed reset cause this helps detecting when a reset was due to the watchdog Change-Id: I2d59c2f2c8fe9e559eddfafacf25879263ef81ff --- M firmware/apps/cardem/main.c 1 file changed, 15 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/14/10214/1 diff --git a/firmware/apps/cardem/main.c b/firmware/apps/cardem/main.c index ae46794..7d65c7e 100644 --- a/firmware/apps/cardem/main.c +++ b/firmware/apps/cardem/main.c @@ -157,11 +157,25 @@ "SIMtrace2 firmware " GIT_VERSION " (C) 2010-2016 by Harald Welte\n\r" "=============================================================================\n\r"); +#if (TRACE_LEVEL >= TRACE_LEVEL_INFO) TRACE_INFO("Chip ID: 0x%08x (Ext 0x%08x)\n\r", CHIPID->CHIPID_CIDR, CHIPID->CHIPID_EXID); TRACE_INFO("Serial Nr. %08x-%08x-%08x-%08x\n\r", g_unique_id[0], g_unique_id[1], g_unique_id[2], g_unique_id[3]); - TRACE_INFO("Reset Cause: 0x%x\n\r", (RSTC->RSTC_SR & RSTC_SR_RSTTYP_Msk) >> RSTC_SR_RSTTYP_Pos); + uint8_t reset_cause = (RSTC->RSTC_SR & RSTC_SR_RSTTYP_Msk) >> RSTC_SR_RSTTYP_Pos; + static const char* reset_causes[] = { + "general reset (first power-up reset)", + "backup reset (return from backup mode)", + "watchdog reset (watchdog fault occurred)", + "software reset (processor reset required by the software)", + "user reset (NRST pin detected low)", + }; + if (reset_cause < ARRAY_SIZE(reset_causes)) { + TRACE_INFO("Reset Cause: %s\n\r", reset_causes[reset_cause]); + } else { + TRACE_INFO("Reset Cause: 0x%x\n\r", (RSTC->RSTC_SR & RSTC_SR_RSTTYP_Msk) >> RSTC_SR_RSTTYP_Pos); + } +#endif board_main_top(); -- To view, visit https://gerrit.osmocom.org/10214 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I2d59c2f2c8fe9e559eddfafacf25879263ef81ff Gerrit-Change-Number: 10214 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 19:00:02 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Sat, 28 Jul 2018 19:00:02 +0000 Subject: Change in simtrace2[master]: cardem: increase watchdog to 2 seconds Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/10215 Change subject: cardem: increase watchdog to 2 seconds ...................................................................... cardem: increase watchdog to 2 seconds a lot of the procedures are done in ISRs, but the watchdog is only reset in the main loop. this causes frequent reset, particularly at the beginning were states have to the initialized. Change-Id: Iad364444fca9d18f9a8cf47d5e0840ccd7bac2ef --- M firmware/apps/cardem/main.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/15/10215/1 diff --git a/firmware/apps/cardem/main.c b/firmware/apps/cardem/main.c index 7d65c7e..6cd3439 100644 --- a/firmware/apps/cardem/main.c +++ b/firmware/apps/cardem/main.c @@ -144,9 +144,9 @@ led_init(); led_blink(LED_RED, BLINK_3O_5F); - /* Enable watchdog for 500ms, with no window */ + /* Enable watchdog for 2000ms, with no window */ WDT_Enable(WDT, WDT_MR_WDRSTEN | WDT_MR_WDDBGHLT | WDT_MR_WDIDLEHLT | - (WDT_GetPeriod(500) << 16) | WDT_GetPeriod(500)); + (WDT_GetPeriod(2000) << 16) | WDT_GetPeriod(2000)); PIO_InitializeInterrupts(0); -- To view, visit https://gerrit.osmocom.org/10215 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iad364444fca9d18f9a8cf47d5e0840ccd7bac2ef Gerrit-Change-Number: 10215 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 19:40:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Jul 2018 19:40:17 +0000 Subject: Change in libosmocore[master]: ipa_ccm_idtag_parse*: Fix reported length value Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10216 Change subject: ipa_ccm_idtag_parse*: Fix reported length value ...................................................................... ipa_ccm_idtag_parse*: Fix reported length value IPA CCM is using a somewhat weird TLV encoding scheme: * 16bit length (of tag and value) * 8bit tag * value Our existing code mapping the CCM to 'struct tlv_parse' used the plain length value without accounting for the one-byte tag. This patch ensures we only report the length of the "value" part, excluding the tag. Change-Id: I435aaa33605bd48635715a2c81aa2d231c1abf51 --- M src/gsm/ipa.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/16/10216/1 diff --git a/src/gsm/ipa.c b/src/gsm/ipa.c index aecde83..f03bc38 100644 --- a/src/gsm/ipa.c +++ b/src/gsm/ipa.c @@ -128,7 +128,7 @@ DEBUGPC(DLMI, "%s='%s' ", ipa_ccm_idtag_name(t_tag), cur); - dec->lv[t_tag].len = t_len - len_offset; + dec->lv[t_tag].len = t_len - 1 - len_offset; dec->lv[t_tag].val = cur; cur += t_len - len_offset; -- To view, visit https://gerrit.osmocom.org/10216 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I435aaa33605bd48635715a2c81aa2d231c1abf51 Gerrit-Change-Number: 10216 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From admin at opensuse.org Sat Jul 28 20:03:56 2018 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Jul 2018 20:03:56 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <5b5ccc354582d_725276468462382@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 98s] ^ [ 98s] handover_fsm.c:489:4: error: format not a string literal and no format arguments [-Werror=format-security] [ 99s] cc1: some warnings being treated as errors [ 99s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 99s] make[4]: *** [handover_fsm.o] Error 1 [ 99s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 99s] Makefile:407: recipe for target 'all-recursive' failed [ 99s] make[3]: *** [all-recursive] Error 1 [ 99s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 99s] Makefile:441: recipe for target 'all-recursive' failed [ 99s] make[2]: *** [all-recursive] Error 1 [ 99s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 99s] Makefile:373: recipe for target 'all' failed [ 99s] make[1]: *** [all] Error 2 [ 99s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 99s] dh_auto_build: make -j1 returned exit code 2 [ 99s] debian/rules:45: recipe for target 'build' failed [ 99s] make: *** [build] Error 2 [ 99s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 99s] [ 99s] lamb17 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:03:45 UTC 2018. [ 99s] [ 99s] ### VM INTERACTION START ### [ 102s] [ 91.646743] sysrq: SysRq : Power Off [ 102s] [ 91.655275] reboot: Power down [ 102s] ### VM INTERACTION END ### [ 102s] [ 102s] lamb17 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:03:48 UTC 2018. [ 102s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jul 28 20:03:56 2018 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Jul 2018 20:03:56 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <5b5ccc361907f_7252764684623997@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 98s] ^ [ 98s] handover_fsm.c:489:4: error: format not a string literal and no format arguments [-Werror=format-security] [ 99s] cc1: some warnings being treated as errors [ 99s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 99s] make[4]: *** [handover_fsm.o] Error 1 [ 99s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 99s] Makefile:407: recipe for target 'all-recursive' failed [ 99s] make[3]: *** [all-recursive] Error 1 [ 99s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 99s] Makefile:441: recipe for target 'all-recursive' failed [ 99s] make[2]: *** [all-recursive] Error 1 [ 99s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 99s] Makefile:373: recipe for target 'all' failed [ 99s] make[1]: *** [all] Error 2 [ 99s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 99s] dh_auto_build: make -j1 returned exit code 2 [ 99s] debian/rules:45: recipe for target 'build' failed [ 99s] make: *** [build] Error 2 [ 99s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 99s] [ 99s] lamb17 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:03:45 UTC 2018. [ 99s] [ 99s] ### VM INTERACTION START ### [ 102s] [ 91.646743] sysrq: SysRq : Power Off [ 102s] [ 91.655275] reboot: Power down [ 102s] ### VM INTERACTION END ### [ 102s] [ 102s] lamb17 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:03:48 UTC 2018. [ 102s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jul 28 20:05:38 2018 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Jul 2018 20:05:38 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_18.04/i586 In-Reply-To: References: Message-ID: <5b5ccca89f84e_7252764684624212@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_18.04/i586 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_18.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 133s] gsm0808_cell_id_name(&req->cell_id_target)); [ 133s] ^~~~~~~~~~~~~~~~~~~~ [ 135s] cc1: some warnings being treated as errors [ 135s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 135s] make[4]: *** [handover_fsm.o] Error 1 [ 135s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 135s] Makefile:407: recipe for target 'all-recursive' failed [ 135s] make[3]: *** [all-recursive] Error 1 [ 135s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 135s] Makefile:441: recipe for target 'all-recursive' failed [ 135s] make[2]: *** [all-recursive] Error 1 [ 135s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 135s] Makefile:373: recipe for target 'all' failed [ 135s] make[1]: *** [all] Error 2 [ 135s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 135s] dh_auto_build: make -j1 returned exit code 2 [ 135s] debian/rules:45: recipe for target 'build' failed [ 135s] make: *** [build] Error 2 [ 135s] dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2 [ 135s] [ 135s] lamb03 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:05:32 UTC 2018. [ 135s] [ 135s] ### VM INTERACTION START ### [ 138s] [ 126.133696] sysrq: SysRq : Power Off [ 138s] [ 126.140112] reboot: Power down [ 138s] ### VM INTERACTION END ### [ 138s] [ 138s] lamb03 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:05:36 UTC 2018. [ 138s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jul 28 20:05:38 2018 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Jul 2018 20:05:38 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_18.04/i586 In-Reply-To: References: Message-ID: <5b5ccca93819e_72527646846243cb@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_18.04/i586 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_18.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 133s] gsm0808_cell_id_name(&req->cell_id_target)); [ 133s] ^~~~~~~~~~~~~~~~~~~~ [ 135s] cc1: some warnings being treated as errors [ 135s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 135s] make[4]: *** [handover_fsm.o] Error 1 [ 135s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 135s] Makefile:407: recipe for target 'all-recursive' failed [ 135s] make[3]: *** [all-recursive] Error 1 [ 135s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 135s] Makefile:441: recipe for target 'all-recursive' failed [ 135s] make[2]: *** [all-recursive] Error 1 [ 135s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 135s] Makefile:373: recipe for target 'all' failed [ 135s] make[1]: *** [all] Error 2 [ 135s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 135s] dh_auto_build: make -j1 returned exit code 2 [ 135s] debian/rules:45: recipe for target 'build' failed [ 135s] make: *** [build] Error 2 [ 135s] dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2 [ 135s] [ 135s] lamb03 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:05:32 UTC 2018. [ 135s] [ 135s] ### VM INTERACTION START ### [ 138s] [ 126.133696] sysrq: SysRq : Power Off [ 138s] [ 126.140112] reboot: Power down [ 138s] ### VM INTERACTION END ### [ 138s] [ 138s] lamb03 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:05:36 UTC 2018. [ 138s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jul 28 20:06:13 2018 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Jul 2018 20:06:13 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_18.04/x86_64 In-Reply-To: References: Message-ID: <5b5ccccba5193_725276468462488d@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_18.04/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_18.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 131s] gsm0808_cell_id_name(&req->cell_id_target)); [ 131s] ^~~~~~~~~~~~~~~~~~~~ [ 132s] cc1: some warnings being treated as errors [ 132s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 132s] make[4]: *** [handover_fsm.o] Error 1 [ 132s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 132s] Makefile:407: recipe for target 'all-recursive' failed [ 132s] make[3]: *** [all-recursive] Error 1 [ 132s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 132s] Makefile:441: recipe for target 'all-recursive' failed [ 132s] make[2]: *** [all-recursive] Error 1 [ 132s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 132s] Makefile:373: recipe for target 'all' failed [ 132s] make[1]: *** [all] Error 2 [ 132s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 132s] dh_auto_build: make -j1 returned exit code 2 [ 132s] debian/rules:45: recipe for target 'build' failed [ 132s] make: *** [build] Error 2 [ 132s] dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2 [ 132s] [ 132s] lamb02 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:06:05 UTC 2018. [ 132s] [ 132s] ### VM INTERACTION START ### [ 135s] [ 122.896423] sysrq: SysRq : Power Off [ 135s] [ 122.903209] reboot: Power down [ 135s] ### VM INTERACTION END ### [ 135s] [ 135s] lamb02 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:06:08 UTC 2018. [ 135s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jul 28 20:06:13 2018 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Jul 2018 20:06:13 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_18.04/x86_64 In-Reply-To: References: Message-ID: <5b5ccccc477ee_7252764684624977@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_18.04/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_18.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 131s] gsm0808_cell_id_name(&req->cell_id_target)); [ 131s] ^~~~~~~~~~~~~~~~~~~~ [ 132s] cc1: some warnings being treated as errors [ 132s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 132s] make[4]: *** [handover_fsm.o] Error 1 [ 132s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 132s] Makefile:407: recipe for target 'all-recursive' failed [ 132s] make[3]: *** [all-recursive] Error 1 [ 132s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 132s] Makefile:441: recipe for target 'all-recursive' failed [ 132s] make[2]: *** [all-recursive] Error 1 [ 132s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 132s] Makefile:373: recipe for target 'all' failed [ 132s] make[1]: *** [all] Error 2 [ 132s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 132s] dh_auto_build: make -j1 returned exit code 2 [ 132s] debian/rules:45: recipe for target 'build' failed [ 132s] make: *** [build] Error 2 [ 132s] dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2 [ 132s] [ 132s] lamb02 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:06:05 UTC 2018. [ 132s] [ 132s] ### VM INTERACTION START ### [ 135s] [ 122.896423] sysrq: SysRq : Power Off [ 135s] [ 122.903209] reboot: Power down [ 135s] ### VM INTERACTION END ### [ 135s] [ 135s] lamb02 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:06:08 UTC 2018. [ 135s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jul 28 20:06:30 2018 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Jul 2018 20:06:30 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <5b5cccd17e6ae_725276468462507b@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_8.0/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 159s] ^ [ 159s] handover_fsm.c:489:4: error: format not a string literal and no format arguments [-Werror=format-security] [ 160s] cc1: some warnings being treated as errors [ 160s] Makefile:614: recipe for target 'handover_fsm.o' failed [ 160s] make[4]: *** [handover_fsm.o] Error 1 [ 160s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 160s] Makefile:395: recipe for target 'all-recursive' failed [ 160s] make[3]: *** [all-recursive] Error 1 [ 160s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 160s] Makefile:429: recipe for target 'all-recursive' failed [ 160s] make[2]: *** [all-recursive] Error 1 [ 160s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 160s] Makefile:360: recipe for target 'all' failed [ 160s] make[1]: *** [all] Error 2 [ 160s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 160s] dh_auto_build: make -j1 returned exit code 2 [ 160s] debian/rules:45: recipe for target 'build' failed [ 160s] make: *** [build] Error 2 [ 160s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 160s] [ 160s] cloud113 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:06:19 UTC 2018. [ 160s] [ 160s] ### VM INTERACTION START ### [ 161s] Powering off. [ 161s] [ 132.477602] reboot: Power down [ 162s] ### VM INTERACTION END ### [ 162s] [ 162s] cloud113 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:06:21 UTC 2018. [ 162s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jul 28 20:06:30 2018 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Jul 2018 20:06:30 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <5b5cccd1c10c2_725276468462518e@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_8.0/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 159s] ^ [ 159s] handover_fsm.c:489:4: error: format not a string literal and no format arguments [-Werror=format-security] [ 160s] cc1: some warnings being treated as errors [ 160s] Makefile:614: recipe for target 'handover_fsm.o' failed [ 160s] make[4]: *** [handover_fsm.o] Error 1 [ 160s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 160s] Makefile:395: recipe for target 'all-recursive' failed [ 160s] make[3]: *** [all-recursive] Error 1 [ 160s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 160s] Makefile:429: recipe for target 'all-recursive' failed [ 160s] make[2]: *** [all-recursive] Error 1 [ 160s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 160s] Makefile:360: recipe for target 'all' failed [ 160s] make[1]: *** [all] Error 2 [ 160s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 160s] dh_auto_build: make -j1 returned exit code 2 [ 160s] debian/rules:45: recipe for target 'build' failed [ 160s] make: *** [build] Error 2 [ 160s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 160s] [ 160s] cloud113 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:06:19 UTC 2018. [ 160s] [ 160s] ### VM INTERACTION START ### [ 161s] Powering off. [ 161s] [ 132.477602] reboot: Power down [ 162s] ### VM INTERACTION END ### [ 162s] [ 162s] cloud113 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:06:21 UTC 2018. [ 162s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jul 28 20:06:30 2018 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Jul 2018 20:06:30 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_17.10/i586 In-Reply-To: References: Message-ID: <5b5cccd230049_72527646846252cb@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_17.10/i586 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_17.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 100s] gsm0808_cell_id_name(&req->cell_id_target)); [ 100s] ^~~~~~~~~~~~~~~~~~~~ [ 101s] cc1: some warnings being treated as errors [ 101s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 101s] make[4]: *** [handover_fsm.o] Error 1 [ 101s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 101s] Makefile:407: recipe for target 'all-recursive' failed [ 101s] make[3]: *** [all-recursive] Error 1 [ 101s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 101s] Makefile:441: recipe for target 'all-recursive' failed [ 101s] make[2]: *** [all-recursive] Error 1 [ 101s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 101s] Makefile:373: recipe for target 'all' failed [ 101s] make[1]: *** [all] Error 2 [ 101s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 101s] dh_auto_build: make -j1 returned exit code 2 [ 101s] debian/rules:45: recipe for target 'build' failed [ 101s] make: *** [build] Error 2 [ 101s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 101s] [ 101s] lamb26 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:06:21 UTC 2018. [ 101s] [ 101s] ### VM INTERACTION START ### [ 104s] [ 93.617875] sysrq: SysRq : Power Off [ 104s] [ 93.623947] reboot: Power down [ 104s] ### VM INTERACTION END ### [ 104s] [ 104s] lamb26 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:06:24 UTC 2018. [ 104s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jul 28 20:06:30 2018 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Jul 2018 20:06:30 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_17.10/i586 In-Reply-To: References: Message-ID: <5b5cccd26e373_7252764684625360@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_17.10/i586 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_17.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 100s] gsm0808_cell_id_name(&req->cell_id_target)); [ 100s] ^~~~~~~~~~~~~~~~~~~~ [ 101s] cc1: some warnings being treated as errors [ 101s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 101s] make[4]: *** [handover_fsm.o] Error 1 [ 101s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 101s] Makefile:407: recipe for target 'all-recursive' failed [ 101s] make[3]: *** [all-recursive] Error 1 [ 101s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 101s] Makefile:441: recipe for target 'all-recursive' failed [ 101s] make[2]: *** [all-recursive] Error 1 [ 101s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 101s] Makefile:373: recipe for target 'all' failed [ 101s] make[1]: *** [all] Error 2 [ 101s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 101s] dh_auto_build: make -j1 returned exit code 2 [ 101s] debian/rules:45: recipe for target 'build' failed [ 101s] make: *** [build] Error 2 [ 101s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 101s] [ 101s] lamb26 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:06:21 UTC 2018. [ 101s] [ 101s] ### VM INTERACTION START ### [ 104s] [ 93.617875] sysrq: SysRq : Power Off [ 104s] [ 93.623947] reboot: Power down [ 104s] ### VM INTERACTION END ### [ 104s] [ 104s] lamb26 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:06:24 UTC 2018. [ 104s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jul 28 20:06:47 2018 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Jul 2018 20:06:47 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_9.0/i586 In-Reply-To: References: Message-ID: <5b5ccce6d7fd7_72527646846254ba@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_9.0/i586 Package network:osmocom:nightly/osmo-bsc failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 163s] gsm0808_cell_id_name(&req->cell_id_target)); [ 163s] ^~~~~~~~~~~~~~~~~~~~ [ 164s] cc1: some warnings being treated as errors [ 164s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 164s] make[4]: *** [handover_fsm.o] Error 1 [ 164s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 164s] Makefile:407: recipe for target 'all-recursive' failed [ 164s] make[3]: *** [all-recursive] Error 1 [ 164s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 164s] Makefile:441: recipe for target 'all-recursive' failed [ 164s] make[2]: *** [all-recursive] Error 1 [ 164s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 164s] Makefile:373: recipe for target 'all' failed [ 164s] make[1]: *** [all] Error 2 [ 164s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 164s] dh_auto_build: make -j1 returned exit code 2 [ 164s] debian/rules:45: recipe for target 'build' failed [ 164s] make: *** [build] Error 2 [ 164s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 165s] [ 165s] cloud122 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:06:37 UTC 2018. [ 165s] [ 165s] ### VM INTERACTION START ### [ 168s] [ 128.654147] sysrq: SysRq : Power Off [ 168s] [ 128.679840] reboot: Power down [ 169s] ### VM INTERACTION END ### [ 169s] [ 169s] cloud122 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:06:42 UTC 2018. [ 169s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jul 28 20:06:47 2018 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Jul 2018 20:06:47 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_9.0/i586 In-Reply-To: References: Message-ID: <5b5ccce74acbb_7252764684625574@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_9.0/i586 Package network:osmocom:nightly/osmo-bsc failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 163s] gsm0808_cell_id_name(&req->cell_id_target)); [ 163s] ^~~~~~~~~~~~~~~~~~~~ [ 164s] cc1: some warnings being treated as errors [ 164s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 164s] make[4]: *** [handover_fsm.o] Error 1 [ 164s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 164s] Makefile:407: recipe for target 'all-recursive' failed [ 164s] make[3]: *** [all-recursive] Error 1 [ 164s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 164s] Makefile:441: recipe for target 'all-recursive' failed [ 164s] make[2]: *** [all-recursive] Error 1 [ 164s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 164s] Makefile:373: recipe for target 'all' failed [ 164s] make[1]: *** [all] Error 2 [ 164s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 164s] dh_auto_build: make -j1 returned exit code 2 [ 164s] debian/rules:45: recipe for target 'build' failed [ 164s] make: *** [build] Error 2 [ 164s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 165s] [ 165s] cloud122 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:06:37 UTC 2018. [ 165s] [ 165s] ### VM INTERACTION START ### [ 168s] [ 128.654147] sysrq: SysRq : Power Off [ 168s] [ 128.679840] reboot: Power down [ 169s] ### VM INTERACTION END ### [ 169s] [ 169s] cloud122 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:06:42 UTC 2018. [ 169s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jul 28 20:07:38 2018 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Jul 2018 20:07:38 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <5b5ccd21aace7_72527646846256f6@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_9.0/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 195s] gsm0808_cell_id_name(&req->cell_id_target)); [ 195s] ^~~~~~~~~~~~~~~~~~~~ [ 196s] cc1: some warnings being treated as errors [ 196s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 196s] make[4]: *** [handover_fsm.o] Error 1 [ 196s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 196s] Makefile:407: recipe for target 'all-recursive' failed [ 196s] make[3]: *** [all-recursive] Error 1 [ 196s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 196s] Makefile:441: recipe for target 'all-recursive' failed [ 196s] make[2]: *** [all-recursive] Error 1 [ 196s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 196s] Makefile:373: recipe for target 'all' failed [ 196s] make[1]: *** [all] Error 2 [ 196s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 196s] dh_auto_build: make -j1 returned exit code 2 [ 196s] debian/rules:45: recipe for target 'build' failed [ 196s] make: *** [build] Error 2 [ 196s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 197s] [ 197s] cloud113 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:07:23 UTC 2018. [ 197s] [ 197s] ### VM INTERACTION START ### [ 200s] [ 157.475827] sysrq: SysRq : Power Off [ 200s] [ 157.481424] reboot: Power down [ 200s] ### VM INTERACTION END ### [ 200s] [ 200s] cloud113 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:07:27 UTC 2018. [ 200s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jul 28 20:07:38 2018 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Jul 2018 20:07:38 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <5b5ccd21ee436_72527646846257b8@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_9.0/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 195s] gsm0808_cell_id_name(&req->cell_id_target)); [ 195s] ^~~~~~~~~~~~~~~~~~~~ [ 196s] cc1: some warnings being treated as errors [ 196s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 196s] make[4]: *** [handover_fsm.o] Error 1 [ 196s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 196s] Makefile:407: recipe for target 'all-recursive' failed [ 196s] make[3]: *** [all-recursive] Error 1 [ 196s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 196s] Makefile:441: recipe for target 'all-recursive' failed [ 196s] make[2]: *** [all-recursive] Error 1 [ 196s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 196s] Makefile:373: recipe for target 'all' failed [ 196s] make[1]: *** [all] Error 2 [ 196s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 196s] dh_auto_build: make -j1 returned exit code 2 [ 196s] debian/rules:45: recipe for target 'build' failed [ 196s] make: *** [build] Error 2 [ 196s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 197s] [ 197s] cloud113 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:07:23 UTC 2018. [ 197s] [ 197s] ### VM INTERACTION START ### [ 200s] [ 157.475827] sysrq: SysRq : Power Off [ 200s] [ 157.481424] reboot: Power down [ 200s] ### VM INTERACTION END ### [ 200s] [ 200s] cloud113 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:07:27 UTC 2018. [ 200s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jul 28 20:08:47 2018 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Jul 2018 20:08:47 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_17.10/x86_64 In-Reply-To: References: Message-ID: <5b5ccd5ce8310_72527646846260e9@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_17.10/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_17.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 80s] gsm0808_cell_id_name(&req->cell_id_target)); [ 80s] ^~~~~~~~~~~~~~~~~~~~ [ 81s] cc1: some warnings being treated as errors [ 81s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 81s] make[4]: *** [handover_fsm.o] Error 1 [ 81s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 81s] Makefile:407: recipe for target 'all-recursive' failed [ 81s] make[3]: *** [all-recursive] Error 1 [ 81s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 81s] Makefile:441: recipe for target 'all-recursive' failed [ 81s] make[2]: *** [all-recursive] Error 1 [ 81s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 81s] Makefile:373: recipe for target 'all' failed [ 81s] make[1]: *** [all] Error 2 [ 81s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 81s] dh_auto_build: make -j1 returned exit code 2 [ 81s] debian/rules:45: recipe for target 'build' failed [ 81s] make: *** [build] Error 2 [ 81s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 81s] [ 81s] build85 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:08:27 UTC 2018. [ 81s] [ 81s] ### VM INTERACTION START ### [ 84s] [ 74.438815] sysrq: SysRq : Power Off [ 84s] [ 74.446105] reboot: Power down [ 84s] ### VM INTERACTION END ### [ 84s] [ 84s] build85 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:08:31 UTC 2018. [ 84s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jul 28 20:08:47 2018 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Jul 2018 20:08:47 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_17.10/x86_64 In-Reply-To: References: Message-ID: <5b5ccd5d3d618_72527646846261a9@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_17.10/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_17.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 80s] gsm0808_cell_id_name(&req->cell_id_target)); [ 80s] ^~~~~~~~~~~~~~~~~~~~ [ 81s] cc1: some warnings being treated as errors [ 81s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 81s] make[4]: *** [handover_fsm.o] Error 1 [ 81s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 81s] Makefile:407: recipe for target 'all-recursive' failed [ 81s] make[3]: *** [all-recursive] Error 1 [ 81s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 81s] Makefile:441: recipe for target 'all-recursive' failed [ 81s] make[2]: *** [all-recursive] Error 1 [ 81s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 81s] Makefile:373: recipe for target 'all' failed [ 81s] make[1]: *** [all] Error 2 [ 81s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 81s] dh_auto_build: make -j1 returned exit code 2 [ 81s] debian/rules:45: recipe for target 'build' failed [ 81s] make: *** [build] Error 2 [ 81s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 81s] [ 81s] build85 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:08:27 UTC 2018. [ 81s] [ 81s] ### VM INTERACTION START ### [ 84s] [ 74.438815] sysrq: SysRq : Power Off [ 84s] [ 74.446105] reboot: Power down [ 84s] ### VM INTERACTION END ### [ 84s] [ 84s] build85 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:08:31 UTC 2018. [ 84s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jul 28 20:09:21 2018 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Jul 2018 20:09:21 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <5b5ccd7db010_72527646846262c3@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_16.04/i586 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 140s] ^ [ 140s] handover_fsm.c:489:4: error: format not a string literal and no format arguments [-Werror=format-security] [ 141s] cc1: some warnings being treated as errors [ 141s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 141s] make[4]: *** [handover_fsm.o] Error 1 [ 141s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 141s] Makefile:407: recipe for target 'all-recursive' failed [ 141s] make[3]: *** [all-recursive] Error 1 [ 141s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 141s] Makefile:441: recipe for target 'all-recursive' failed [ 141s] make[2]: *** [all-recursive] Error 1 [ 141s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 141s] Makefile:373: recipe for target 'all' failed [ 141s] make[1]: *** [all] Error 2 [ 141s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 141s] dh_auto_build: make -j1 returned exit code 2 [ 141s] debian/rules:45: recipe for target 'build' failed [ 141s] make: *** [build] Error 2 [ 141s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 141s] [ 141s] cloud130 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:09:00 UTC 2018. [ 141s] [ 141s] ### VM INTERACTION START ### [ 145s] [ 114.922312] sysrq: SysRq : Power Off [ 145s] [ 114.937541] reboot: Power down [ 146s] ### VM INTERACTION END ### [ 146s] [ 146s] cloud130 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:09:05 UTC 2018. [ 146s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jul 28 20:09:21 2018 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Jul 2018 20:09:21 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <5b5ccd7d62c0b_72527646846263eb@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_16.04/i586 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 140s] ^ [ 140s] handover_fsm.c:489:4: error: format not a string literal and no format arguments [-Werror=format-security] [ 141s] cc1: some warnings being treated as errors [ 141s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 141s] make[4]: *** [handover_fsm.o] Error 1 [ 141s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 141s] Makefile:407: recipe for target 'all-recursive' failed [ 141s] make[3]: *** [all-recursive] Error 1 [ 141s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 141s] Makefile:441: recipe for target 'all-recursive' failed [ 141s] make[2]: *** [all-recursive] Error 1 [ 141s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 141s] Makefile:373: recipe for target 'all' failed [ 141s] make[1]: *** [all] Error 2 [ 141s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 141s] dh_auto_build: make -j1 returned exit code 2 [ 141s] debian/rules:45: recipe for target 'build' failed [ 141s] make: *** [build] Error 2 [ 141s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 141s] [ 141s] cloud130 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:09:00 UTC 2018. [ 141s] [ 141s] ### VM INTERACTION START ### [ 145s] [ 114.922312] sysrq: SysRq : Power Off [ 145s] [ 114.937541] reboot: Power down [ 146s] ### VM INTERACTION END ### [ 146s] [ 146s] cloud130 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:09:05 UTC 2018. [ 146s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jul 28 20:10:47 2018 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Jul 2018 20:10:47 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_8.0/i586 In-Reply-To: References: Message-ID: <5b5ccdd45bbf1_72527646846265c0@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_8.0/i586 Package network:osmocom:nightly/osmo-bsc failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 127s] ^ [ 127s] handover_fsm.c:489:4: error: format not a string literal and no format arguments [-Werror=format-security] [ 129s] cc1: some warnings being treated as errors [ 129s] Makefile:614: recipe for target 'handover_fsm.o' failed [ 129s] make[4]: *** [handover_fsm.o] Error 1 [ 129s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 129s] Makefile:395: recipe for target 'all-recursive' failed [ 129s] make[3]: *** [all-recursive] Error 1 [ 129s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 129s] Makefile:429: recipe for target 'all-recursive' failed [ 129s] make[2]: *** [all-recursive] Error 1 [ 129s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 129s] Makefile:360: recipe for target 'all' failed [ 129s] make[1]: *** [all] Error 2 [ 129s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 129s] dh_auto_build: make -j1 returned exit code 2 [ 129s] debian/rules:45: recipe for target 'build' failed [ 129s] make: *** [build] Error 2 [ 129s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 129s] [ 129s] lamb55 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:10:38 UTC 2018. [ 129s] [ 129s] ### VM INTERACTION START ### [ 130s] Powering off. [ 130s] [ 118.817559] reboot: Power down [ 130s] ### VM INTERACTION END ### [ 130s] [ 130s] lamb55 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:10:39 UTC 2018. [ 130s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jul 28 20:10:47 2018 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Jul 2018 20:10:47 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_8.0/i586 In-Reply-To: References: Message-ID: <5b5ccdd3d8198_7252764684626486@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_8.0/i586 Package network:osmocom:nightly/osmo-bsc failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 127s] ^ [ 127s] handover_fsm.c:489:4: error: format not a string literal and no format arguments [-Werror=format-security] [ 129s] cc1: some warnings being treated as errors [ 129s] Makefile:614: recipe for target 'handover_fsm.o' failed [ 129s] make[4]: *** [handover_fsm.o] Error 1 [ 129s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 129s] Makefile:395: recipe for target 'all-recursive' failed [ 129s] make[3]: *** [all-recursive] Error 1 [ 129s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 129s] Makefile:429: recipe for target 'all-recursive' failed [ 129s] make[2]: *** [all-recursive] Error 1 [ 129s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 129s] Makefile:360: recipe for target 'all' failed [ 129s] make[1]: *** [all] Error 2 [ 129s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 129s] dh_auto_build: make -j1 returned exit code 2 [ 129s] debian/rules:45: recipe for target 'build' failed [ 129s] make: *** [build] Error 2 [ 129s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 129s] [ 129s] lamb55 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:10:38 UTC 2018. [ 129s] [ 129s] ### VM INTERACTION START ### [ 130s] Powering off. [ 130s] [ 118.817559] reboot: Power down [ 130s] ### VM INTERACTION END ### [ 130s] [ 130s] lamb55 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:10:39 UTC 2018. [ 130s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jul 28 20:32:30 2018 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Jul 2018 20:32:30 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_9.0/armv7l In-Reply-To: References: Message-ID: <5b5cd2e1ef660_72527646846326dd@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_9.0/armv7l Package network:osmocom:nightly/osmo-bsc failed to build in Debian_9.0/armv7l Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 238s] gsm0808_cell_id_name(&req->cell_id_target)); [ 238s] ^~~~~~~~~~~~~~~~~~~~ [ 240s] cc1: some warnings being treated as errors [ 240s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 240s] make[4]: *** [handover_fsm.o] Error 1 [ 240s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 240s] Makefile:407: recipe for target 'all-recursive' failed [ 240s] make[3]: *** [all-recursive] Error 1 [ 240s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 240s] Makefile:441: recipe for target 'all-recursive' failed [ 240s] make[2]: *** [all-recursive] Error 1 [ 240s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 240s] Makefile:373: recipe for target 'all' failed [ 240s] make[1]: *** [all] Error 2 [ 240s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 240s] dh_auto_build: make -j1 returned exit code 2 [ 240s] debian/rules:45: recipe for target 'build' failed [ 240s] make: *** [build] Error 2 [ 240s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 240s] [ 240s] armbuild01 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:32:14 UTC 2018. [ 240s] [ 240s] ### VM INTERACTION START ### [ 244s] [ 212.220722] SysRq : Power Off [ 244s] [ 212.221898] reboot: Power down [ 244s] ### VM INTERACTION END ### [ 244s] [ 244s] armbuild01 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:32:18 UTC 2018. [ 244s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jul 28 20:32:30 2018 From: admin at opensuse.org (OBS Notification) Date: Sat, 28 Jul 2018 20:32:30 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_9.0/armv7l In-Reply-To: References: Message-ID: <5b5cd2e191d7a_72527646846325fd@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_9.0/armv7l Package network:osmocom:nightly/osmo-bsc failed to build in Debian_9.0/armv7l Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 238s] gsm0808_cell_id_name(&req->cell_id_target)); [ 238s] ^~~~~~~~~~~~~~~~~~~~ [ 240s] cc1: some warnings being treated as errors [ 240s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 240s] make[4]: *** [handover_fsm.o] Error 1 [ 240s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 240s] Makefile:407: recipe for target 'all-recursive' failed [ 240s] make[3]: *** [all-recursive] Error 1 [ 240s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 240s] Makefile:441: recipe for target 'all-recursive' failed [ 240s] make[2]: *** [all-recursive] Error 1 [ 240s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 240s] Makefile:373: recipe for target 'all' failed [ 240s] make[1]: *** [all] Error 2 [ 240s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 240s] dh_auto_build: make -j1 returned exit code 2 [ 240s] debian/rules:45: recipe for target 'build' failed [ 240s] make: *** [build] Error 2 [ 240s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 240s] [ 240s] armbuild01 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:32:14 UTC 2018. [ 240s] [ 240s] ### VM INTERACTION START ### [ 244s] [ 212.220722] SysRq : Power Off [ 244s] [ 212.221898] reboot: Power down [ 244s] ### VM INTERACTION END ### [ 244s] [ 244s] armbuild01 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sat Jul 28 20:32:18 UTC 2018. [ 244s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Sat Jul 28 21:20:50 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Jul 2018 21:20:50 +0000 Subject: Change in simtrace2[master]: sniff: ensure the checksum error flag is also printed In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10211 ) Change subject: sniff: ensure the checksum error flag is also printed ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10211 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I861bd8b52e8f2f2a4786bbe1cc834917119dc394 Gerrit-Change-Number: 10211 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Sat, 28 Jul 2018 21:20:50 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 21:21:02 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Jul 2018 21:21:02 +0000 Subject: Change in simtrace2[master]: sniff: fix ATR checksum calculation In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10212 ) Change subject: sniff: fix ATR checksum calculation ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10212 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6edff7aeb3185c835656acde75886fb6c90c0582 Gerrit-Change-Number: 10212 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Sat, 28 Jul 2018 21:21:02 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 21:21:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Jul 2018 21:21:53 +0000 Subject: Change in simtrace2[master]: sniff: increase debug output In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10213 ) Change subject: sniff: increase debug output ...................................................................... Patch Set 2: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/10213/2/firmware/libcommon/source/sniffer.c File firmware/libcommon/source/sniffer.c: https://gerrit.osmocom.org/#/c/10213/2/firmware/libcommon/source/sniffer.c at 302 PS2, Line 302: don't print since this is function is also called by ISRs is the function now no longer called by ISRs? If not, then remove the comment. If it's still called from ISRs, enabling debug will likely create timing problems :/ -- To view, visit https://gerrit.osmocom.org/10213 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ife0bbcf4a25aaa445a36768c00004e6e0d9a4947 Gerrit-Change-Number: 10213 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Sat, 28 Jul 2018 21:21:53 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 21:23:01 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Jul 2018 21:23:01 +0000 Subject: Change in simtrace2[master]: cardem: show detailed reset cause In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10214 ) Change subject: cardem: show detailed reset cause ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/10214/1/firmware/apps/cardem/main.c File firmware/apps/cardem/main.c: https://gerrit.osmocom.org/#/c/10214/1/firmware/apps/cardem/main.c at 166 PS1, Line 166: static const char* reset_causes[] = { are you sure only one reset cause is reported here? I might be thinking of STM32, but AFAIR multiple causes can exist in parallel (like a flag-mask?) Sorry for not checking SAM3 data sheet myself :/ -- To view, visit https://gerrit.osmocom.org/10214 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2d59c2f2c8fe9e559eddfafacf25879263ef81ff Gerrit-Change-Number: 10214 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Harald Welte Gerrit-Comment-Date: Sat, 28 Jul 2018 21:23:01 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 21:23:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Jul 2018 21:23:15 +0000 Subject: Change in simtrace2[master]: cardem: increase watchdog to 2 seconds In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10215 ) Change subject: cardem: increase watchdog to 2 seconds ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10215 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iad364444fca9d18f9a8cf47d5e0840ccd7bac2ef Gerrit-Change-Number: 10215 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Sat, 28 Jul 2018 21:23:15 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 21:23:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Jul 2018 21:23:20 +0000 Subject: Change in simtrace2[master]: sniff: ensure the checksum error flag is also printed In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10211 ) Change subject: sniff: ensure the checksum error flag is also printed ...................................................................... sniff: ensure the checksum error flag is also printed the firmware now also use a generic value_string array (as does the host application) Change-Id: I861bd8b52e8f2f2a4786bbe1cc834917119dc394 --- M firmware/libcommon/source/sniffer.c M host/simtrace2-sniff.c 2 files changed, 37 insertions(+), 18 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index e800216..5cf96fd 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -302,6 +302,38 @@ //TRACE_INFO("Changed to ISO 7816-3 state %u\n\r", iso_state); /* don't print since this is function is also called by ISRs */ } +const struct value_string data_flags[] = { + { + .value = SNIFF_DATA_FLAG_ERROR_INCOMPLETE, + .str = "incomplete", + }, + { + .value = SNIFF_DATA_FLAG_ERROR_MALFORMED, + .str = "malformed", + }, + { + .value = SNIFF_DATA_FLAG_ERROR_CHECKSUM, + .str = "checksum error", + }, + { + .value = 0, + .str = NULL, + }, +}; + +static void print_flags(const struct value_string* flag_meanings, uint32_t nb_flags, uint32_t flags) { + uint32_t i; + for (i = 0; i < nb_flags; i++) { + if (flags & flag_meanings[i].value) { + printf(flag_meanings[i].str); + flags &= ~flag_meanings[i].value; + if (flags) { + printf(", "); + } + } + } +} + static void usb_send_data(enum simtrace_msg_type_sniff type, const uint8_t* data, uint16_t length, uint32_t flags) { /* Sanity check */ @@ -329,20 +361,7 @@ } if (flags) { printf(" ("); - if (flags & SNIFF_DATA_FLAG_ERROR_INCOMPLETE) { - printf("incomplete"); - flags &= ~SNIFF_DATA_FLAG_ERROR_INCOMPLETE; - if (flags) { - printf(", "); - } - } - if (flags & SNIFF_DATA_FLAG_ERROR_MALFORMED) { - printf("malformed"); - flags &= ~SNIFF_DATA_FLAG_ERROR_MALFORMED; - if (flags) { - printf(", "); - } - } + print_flags(data_flags, ARRAY_SIZE(data_flags), flags); putchar(')'); } printf(": "); diff --git a/host/simtrace2-sniff.c b/host/simtrace2-sniff.c index aeacc6b..368ae60 100644 --- a/host/simtrace2-sniff.c +++ b/host/simtrace2-sniff.c @@ -132,13 +132,13 @@ .str = "malformed", }, { - .value = 0, - .str = NULL, - }, - { .value = SNIFF_DATA_FLAG_ERROR_CHECKSUM, .str = "checksum error", }, + { + .value = 0, + .str = NULL, + }, }; static void print_flags(const struct value_string* flag_meanings, uint32_t nb_flags, uint32_t flags) { -- To view, visit https://gerrit.osmocom.org/10211 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I861bd8b52e8f2f2a4786bbe1cc834917119dc394 Gerrit-Change-Number: 10211 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sat Jul 28 21:23:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 28 Jul 2018 21:23:21 +0000 Subject: Change in simtrace2[master]: sniff: fix ATR checksum calculation In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10212 ) Change subject: sniff: fix ATR checksum calculation ...................................................................... sniff: fix ATR checksum calculation this issue also cause the sent ATR to be empty Change-Id: I6edff7aeb3185c835656acde75886fb6c90c0582 --- M firmware/libcommon/source/sniffer.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index 5cf96fd..c57877f 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -505,7 +505,7 @@ if (ATR_S_WAIT_TCK == atr_state) { uint8_t ui; uint8_t checksum = 0; - for (ui = 1; ui < atr_i; atr_i++) { + for (ui = 1; ui < atr_i; ui++) { checksum ^= atr[ui]; } if (checksum) { -- To view, visit https://gerrit.osmocom.org/10212 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I6edff7aeb3185c835656acde75886fb6c90c0582 Gerrit-Change-Number: 10212 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 29 07:52:21 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Sun, 29 Jul 2018 07:52:21 +0000 Subject: Change in simtrace2[master]: cardem: use TC_ETU to trigger ATR sending Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/10217 Change subject: cardem: use TC_ETU to trigger ATR sending ...................................................................... cardem: use TC_ETU to trigger ATR sending this changes how ATR is handled. the ATR is also printed when set (as important debug information). Change-Id: I69df797e2feadffa9f5f977cb71b69386cee7cd0 --- M firmware/libcommon/source/card_emu.c 1 file changed, 75 insertions(+), 22 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/17/10217/1 diff --git a/firmware/libcommon/source/card_emu.c b/firmware/libcommon/source/card_emu.c index 25ec36a..aa06707 100644 --- a/firmware/libcommon/source/card_emu.c +++ b/firmware/libcommon/source/card_emu.c @@ -296,32 +296,39 @@ card_emu_uart_enable(ch->uart_chan, 0); break; case ISO_S_WAIT_ATR: - set_pts_state(ch, PTS_S_WAIT_REQ_PTSS); /* Reset to initial Fi / Di ratio */ ch->fi = 1; ch->di = 1; emu_update_fidi(ch); + /* the ATR should only be sent 400 to 40k clock cycles after the RESET. + * we use the tc_etu mechanism to wait this time. + * since the initial ETU is Fd=372/Dd=1 clock cycles long, we have to wait 2-107 ETU. + */ + tc_etu_set_wtime(ch->tc_chan, 2); + /* ensure the TC_ETU timer is enabled */ + tc_etu_enable(ch->tc_chan); + break; + case ISO_S_IN_ATR: /* initialize to default WI, this will be overwritten if we - * receive TC2, and it will be programmed into hardware after + * send TC2, and it will be programmed into hardware after * ATR is finished */ ch->wi = ISO7816_3_DEFAULT_WI; /* update waiting time to initial waiting time */ ch->waiting_time = ISO7816_3_INIT_WTIME; + /* set initial waiting time */ tc_etu_set_wtime(ch->tc_chan, ch->waiting_time); /* Set ATR sub-state to initial state */ ch->atr.idx = 0; - //set_atr_state(ch, ATR_S_WAIT_TS); - /* Notice that we are just coming out of reset */ - //ch->sh.flags |= SIMTRACE_FLAG_ATR; + /* enable USART transmission to reader */ card_emu_uart_enable(ch->uart_chan, ENABLE_TX); - break; + /* sent first ATR byte TS */ + card_emu_tx_byte(ch); break; case ISO_S_WAIT_TPDU: /* enable the receiver, disable transmitter */ set_tpdu_state(ch, TPDU_S_WAIT_CLA); card_emu_uart_enable(ch->uart_chan, ENABLE_RX); break; - case ISO_S_IN_ATR: case ISO_S_IN_PTS: case ISO_S_IN_TPDU: /* do nothing */ @@ -329,6 +336,47 @@ } } +/********************************************************************** + * ATR handling + **********************************************************************/ + +/*! Transmit ATR data to reader + * @param[in] ch card interface connected to reader + * @return numbers of bytes transmitted + */ +static int tx_byte_atr(struct card_handle *ch) +{ + if (NULL == ch) { + TRACE_ERROR("ATR TX: no card handle provided\n\r"); + return 0; + } + if (ISO_S_IN_ATR != ch->state) { + TRACE_ERROR("%u: ATR TX: no in ATR state\n\r", ch->num); + return 0; + } + + /* Transmit ATR */ + if (ch->atr.idx < ch->atr.len) { + uint8_t byte = ch->atr.atr[ch->atr.idx++]; + card_emu_uart_tx(ch->uart_chan, byte); + TRACE_DEBUG("%u: ATR TX: %02x\n\r", ch->num, byte); + return 1; + } else { /* The ATR has been completely transmitted */ + /* TODO update WI using optional TC2 and then update WT */ + //ch->wi = ISO7816_3_DEFAULT_WI; + /* update waiting time */ + //ch->waiting_time = ISO7816_3_INIT_WTIME; + //tc_etu_set_wtime(ch->tc_chan, ch->waiting_time); + /* reset PTS to initial state */ + set_pts_state(ch, PTS_S_WAIT_REQ_PTSS); + /* go to next state */ + card_set_state(ch, ISO_S_WAIT_TPDU); + return 0; + } + + /* return number of bytes transmitted */ + return 1; +} /********************************************************************** * PTS / PPS handling @@ -793,17 +841,7 @@ switch (ch->state) { case ISO_S_IN_ATR: - if (ch->atr.idx < ch->atr.len) { - uint8_t byte; - byte = ch->atr.atr[ch->atr.idx++]; - rc = 1; - - card_emu_uart_tx(ch->uart_chan, byte); - - /* detect end of ATR */ - if (ch->atr.idx >= ch->atr.len) - card_set_state(ch, ISO_S_WAIT_TPDU); - } + rc = tx_byte_atr(ch); break; case ISO_S_IN_PTS: rc = tx_byte_pts(ch); @@ -898,9 +936,8 @@ if (ch->vcc_active && ch->clocked) { /* enable the TC/ETU counter once reset has been released */ tc_etu_enable(ch->tc_chan); + /* prepare to send the ATR */ card_set_state(ch, ISO_S_WAIT_ATR); - /* FIXME: wait 400 to 40k clock cycles before sending ATR */ - card_set_state(ch, ISO_S_IN_ATR); } } else if (active && !ch->in_reset) { TRACE_INFO("%u: RST asserted\r\n", ch->num); @@ -921,7 +958,15 @@ ch->atr.len = len; ch->atr.idx = 0; - /* FIXME: race condition with trasmitting ATR to reader? */ +#if TRACE_LEVEL >= TRACE_LEVEL_INFO + uint8_t i; + TRACE_INFO("%u: ATR set: ", ch->num); + for (i = 0; i < ch->atr.len; i++) { + TRACE_INFO_WP("%02x ", atr[i]); + } + TRACE_INFO_WP("\n\r"); +#endif + /* FIXME: race condition with transmitting ATR to reader? */ return 0; } @@ -952,7 +997,15 @@ void tc_etu_wtime_expired(void *handle) { struct card_handle *ch = handle; - TRACE_ERROR("%u: wtime_exp\r\n", ch->num); + switch (ch->state) { + case ISO_S_WAIT_ATR: + /* ISO 7816-3 6.2.1 time tc has passed, we can now send the ATR */ + card_set_state(ch, ISO_S_IN_ATR); + break; + default: + TRACE_ERROR("%u: wtime_exp\r\n", ch->num); + break; + } } /* shortest ATR found in smartcard_list.txt */ -- To view, visit https://gerrit.osmocom.org/10217 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I69df797e2feadffa9f5f977cb71b69386cee7cd0 Gerrit-Change-Number: 10217 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 29 07:52:28 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Sun, 29 Jul 2018 07:52:28 +0000 Subject: Change in simtrace2[master]: remsim: add msg payload after header Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/10218 Change subject: remsim: add msg payload after header ...................................................................... remsim: add msg payload after header before the message header was written over the payload, leading to corrupted data. Change-Id: If971699993617fc50557d20582c344ea06645a3f --- M host/simtrace2-remsim.c 1 file changed, 26 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/18/10218/1 diff --git a/host/simtrace2-remsim.c b/host/simtrace2-remsim.c index 462f73e..5304e6f 100644 --- a/host/simtrace2-remsim.c +++ b/host/simtrace2-remsim.c @@ -153,33 +153,40 @@ return rc; } -static struct simtrace_msg_hdr *st_push_hdr(struct msgb *msg, uint8_t msg_class, uint8_t msg_type, - uint8_t slot_nr) -{ - struct simtrace_msg_hdr *sh; - - sh = (struct simtrace_msg_hdr *) msgb_push(msg, sizeof(*sh)); - memset(sh, 0, sizeof(*sh)); - sh->msg_class = msg_class; - sh->msg_type = msg_type; - sh->slot_nr = slot_nr; - sh->msg_len = msgb_length(msg); - - return sh; -} - /* transmit a given message to a specified slot. Expects all headers * present before calling the function */ int st_slot_tx_msg(struct st_slot *slot, struct msgb *msg, uint8_t msg_class, uint8_t msg_type) { - struct simtrace_msg_hdr *sh = (struct simtrace_msg_hdr *) msg->data; + int rc = 0; + struct msgb *st = st_msgb_alloc(); + if (!st) { + rc = ENOMEM; + goto error; + } + st->l1h = msgb_put(st, sizeof(struct simtrace_msg_hdr*)); + struct simtrace_msg_hdr *sh = (struct simtrace_msg_hdr*) st->l1h; + if (!sh) { + rc = ENOMEM; + goto error; + } + memset(sh, 0, sizeof(*sh)); + sh->msg_class = msg_class; + sh->msg_type = msg_type; sh->slot_nr = slot->slot_nr; + st->l2h = msgb_put(st, msgb_length(msg)); + if (!st->l2h) { + rc = ENOMEM; + goto error; + } + memcpy(st->l2h, msg->data, msgb_length(msg)); + sh->msg_len = msgb_length(st); + rc = st_transp_tx_msg(slot->transp, st); - st_push_hdr(msg, msg_class, msg_type, slot->slot_nr); - - return st_transp_tx_msg(slot->transp, msg); +error: + msgb_free(msg); + return rc; } -- To view, visit https://gerrit.osmocom.org/10218 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: If971699993617fc50557d20582c344ea06645a3f Gerrit-Change-Number: 10218 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 29 07:58:54 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Sun, 29 Jul 2018 07:58:54 +0000 Subject: Change in simtrace2[master]: sniff: increase debug output In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10213 to look at the new patch set (#3). Change subject: sniff: increase debug output ...................................................................... sniff: increase debug output Change-Id: Ife0bbcf4a25aaa445a36768c00004e6e0d9a4947 --- M firmware/libcommon/source/sniffer.c 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/13/10213/3 -- To view, visit https://gerrit.osmocom.org/10213 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ife0bbcf4a25aaa445a36768c00004e6e0d9a4947 Gerrit-Change-Number: 10213 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 29 08:02:17 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Sun, 29 Jul 2018 08:02:17 +0000 Subject: Change in simtrace2[master]: sniff: increase debug output In-Reply-To: References: Message-ID: K?vin Redon has posted comments on this change. ( https://gerrit.osmocom.org/10213 ) Change subject: sniff: increase debug output ...................................................................... Patch Set 3: I missed the comment. this function (chage state) is not called by ISRs anymore, but only by the main loop. There are still TRACE output messaged in ISR (direct or indirect), but only level >= WARNING (no INFO) -- To view, visit https://gerrit.osmocom.org/10213 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ife0bbcf4a25aaa445a36768c00004e6e0d9a4947 Gerrit-Change-Number: 10213 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon Gerrit-Comment-Date: Sun, 29 Jul 2018 08:02:17 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 29 08:07:12 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Sun, 29 Jul 2018 08:07:12 +0000 Subject: Change in simtrace2[master]: cardem: show detailed reset cause In-Reply-To: References: Message-ID: K?vin Redon has posted comments on this change. ( https://gerrit.osmocom.org/10214 ) Change subject: cardem: show detailed reset cause ...................................................................... Patch Set 2: the causes are not flags, but a unique value. the table is in 13.4.2 Reset Controller Status Register -- To view, visit https://gerrit.osmocom.org/10214 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2d59c2f2c8fe9e559eddfafacf25879263ef81ff Gerrit-Change-Number: 10214 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon Gerrit-CC: Harald Welte Gerrit-Comment-Date: Sun, 29 Jul 2018 08:07:12 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 29 08:08:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Jul 2018 08:08:44 +0000 Subject: Change in simtrace2[master]: cardem: show detailed reset cause In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10214 ) Change subject: cardem: show detailed reset cause ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10214 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2d59c2f2c8fe9e559eddfafacf25879263ef81ff Gerrit-Change-Number: 10214 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon Gerrit-Comment-Date: Sun, 29 Jul 2018 08:08:44 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 29 08:08:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Jul 2018 08:08:57 +0000 Subject: Change in simtrace2[master]: sniff: increase debug output In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10213 ) Change subject: sniff: increase debug output ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10213 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ife0bbcf4a25aaa445a36768c00004e6e0d9a4947 Gerrit-Change-Number: 10213 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon Gerrit-Comment-Date: Sun, 29 Jul 2018 08:08:57 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 29 08:10:19 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Jul 2018 08:10:19 +0000 Subject: Change in simtrace2[master]: cardem: use TC_ETU to trigger ATR sending In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10217 ) Change subject: cardem: use TC_ETU to trigger ATR sending ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10217 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I69df797e2feadffa9f5f977cb71b69386cee7cd0 Gerrit-Change-Number: 10217 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-CC: Jenkins Builder Gerrit-Comment-Date: Sun, 29 Jul 2018 08:10:19 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 29 08:12:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Jul 2018 08:12:47 +0000 Subject: Change in simtrace2[master]: remsim: add msg payload after header In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10218 ) Change subject: remsim: add msg payload after header ...................................................................... Patch Set 2: Code-Review-1 I don't think this is the right solution, sorry. Message buffers exist exactly to avoid ever copying data around, but to have a flexible buffer to which data can be pre-pended (pushed) and appended (put) at any point in time. If the old code was overwriting something, the msgb must have been in a bad state or there's some other bug in the code using msgb's. I don't understand why we'd want to alloacate a new one and copy data over? -- To view, visit https://gerrit.osmocom.org/10218 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If971699993617fc50557d20582c344ea06645a3f Gerrit-Change-Number: 10218 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Sun, 29 Jul 2018 08:12:47 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 29 09:12:20 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Sun, 29 Jul 2018 09:12:20 +0000 Subject: Change in simtrace2[master]: remsim: fix payload overwriting In-Reply-To: References: Message-ID: Hello Harald Welte, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10218 to look at the new patch set (#3). Change subject: remsim: fix payload overwriting ...................................................................... remsim: fix payload overwriting The slot number is in the header, and correctly set in st_push_hdr. Setting the slot in st_slot_tx_msg will overwrite the payload data. This caused bytes three of the ATR to be changed from 0x96 to 0x00, corrupting the ATR. This corruption is caught by the ATR checksum, and the modem would reset the card (2 additional times) to try to get correct ATR. Change-Id: If971699993617fc50557d20582c344ea06645a3f --- M host/simtrace2-remsim.c 1 file changed, 0 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/18/10218/3 -- To view, visit https://gerrit.osmocom.org/10218 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: If971699993617fc50557d20582c344ea06645a3f Gerrit-Change-Number: 10218 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 29 09:13:24 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Sun, 29 Jul 2018 09:13:24 +0000 Subject: Change in simtrace2[master]: remsim: fix payload overwriting In-Reply-To: References: Message-ID: K?vin Redon has posted comments on this change. ( https://gerrit.osmocom.org/10218 ) Change subject: remsim: fix payload overwriting ...................................................................... Patch Set 3: instead of replacing the code I located the actual corruption and fixed it -- To view, visit https://gerrit.osmocom.org/10218 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If971699993617fc50557d20582c344ea06645a3f Gerrit-Change-Number: 10218 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: K?vin Redon Gerrit-Comment-Date: Sun, 29 Jul 2018 09:13:24 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 29 09:17:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Jul 2018 09:17:11 +0000 Subject: Change in simtrace2[master]: remsim: fix payload overwriting In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10218 ) Change subject: remsim: fix payload overwriting ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10218 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If971699993617fc50557d20582c344ea06645a3f Gerrit-Change-Number: 10218 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: K?vin Redon Gerrit-Comment-Date: Sun, 29 Jul 2018 09:17:11 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 29 09:22:35 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Jul 2018 09:22:35 +0000 Subject: Change in simtrace2[master]: sniff: increase debug output In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10213 ) Change subject: sniff: increase debug output ...................................................................... sniff: increase debug output Change-Id: Ife0bbcf4a25aaa445a36768c00004e6e0d9a4947 --- M firmware/libcommon/source/sniffer.c 1 file changed, 3 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/firmware/libcommon/source/sniffer.c b/firmware/libcommon/source/sniffer.c index c57877f..982653c 100644 --- a/firmware/libcommon/source/sniffer.c +++ b/firmware/libcommon/source/sniffer.c @@ -299,7 +299,7 @@ /* save new state */ iso_state = iso_state_new; - //TRACE_INFO("Changed to ISO 7816-3 state %u\n\r", iso_state); /* don't print since this is function is also called by ISRs */ + TRACE_INFO("Changed to ISO 7816-3 state %u\n\r", iso_state); } const struct value_string data_flags[] = { @@ -1052,11 +1052,13 @@ if (change_flags & SNIFF_CHANGE_FLAG_RESET_ASSERT) { if (ISO7816_S_RESET != iso_state) { change_state(ISO7816_S_RESET); + printf("reset asserted\n\r"); } } if (change_flags & SNIFF_CHANGE_FLAG_RESET_DEASSERT) { if (ISO7816_S_WAIT_ATR != iso_state) { change_state(ISO7816_S_WAIT_ATR); + printf("reset de-asserted\n\r"); } } if (change_flags & SNIFF_CHANGE_FLAG_TIMEOUT_WT) { -- To view, visit https://gerrit.osmocom.org/10213 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ife0bbcf4a25aaa445a36768c00004e6e0d9a4947 Gerrit-Change-Number: 10213 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 29 09:22:38 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Jul 2018 09:22:38 +0000 Subject: Change in simtrace2[master]: cardem: show detailed reset cause In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10214 ) Change subject: cardem: show detailed reset cause ...................................................................... cardem: show detailed reset cause this helps detecting when a reset was due to the watchdog Change-Id: I2d59c2f2c8fe9e559eddfafacf25879263ef81ff --- M firmware/apps/cardem/main.c 1 file changed, 15 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/firmware/apps/cardem/main.c b/firmware/apps/cardem/main.c index ae46794..7d65c7e 100644 --- a/firmware/apps/cardem/main.c +++ b/firmware/apps/cardem/main.c @@ -157,11 +157,25 @@ "SIMtrace2 firmware " GIT_VERSION " (C) 2010-2016 by Harald Welte\n\r" "=============================================================================\n\r"); +#if (TRACE_LEVEL >= TRACE_LEVEL_INFO) TRACE_INFO("Chip ID: 0x%08x (Ext 0x%08x)\n\r", CHIPID->CHIPID_CIDR, CHIPID->CHIPID_EXID); TRACE_INFO("Serial Nr. %08x-%08x-%08x-%08x\n\r", g_unique_id[0], g_unique_id[1], g_unique_id[2], g_unique_id[3]); - TRACE_INFO("Reset Cause: 0x%x\n\r", (RSTC->RSTC_SR & RSTC_SR_RSTTYP_Msk) >> RSTC_SR_RSTTYP_Pos); + uint8_t reset_cause = (RSTC->RSTC_SR & RSTC_SR_RSTTYP_Msk) >> RSTC_SR_RSTTYP_Pos; + static const char* reset_causes[] = { + "general reset (first power-up reset)", + "backup reset (return from backup mode)", + "watchdog reset (watchdog fault occurred)", + "software reset (processor reset required by the software)", + "user reset (NRST pin detected low)", + }; + if (reset_cause < ARRAY_SIZE(reset_causes)) { + TRACE_INFO("Reset Cause: %s\n\r", reset_causes[reset_cause]); + } else { + TRACE_INFO("Reset Cause: 0x%x\n\r", (RSTC->RSTC_SR & RSTC_SR_RSTTYP_Msk) >> RSTC_SR_RSTTYP_Pos); + } +#endif board_main_top(); -- To view, visit https://gerrit.osmocom.org/10214 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I2d59c2f2c8fe9e559eddfafacf25879263ef81ff Gerrit-Change-Number: 10214 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 29 09:22:39 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Jul 2018 09:22:39 +0000 Subject: Change in simtrace2[master]: cardem: increase watchdog to 2 seconds In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10215 ) Change subject: cardem: increase watchdog to 2 seconds ...................................................................... cardem: increase watchdog to 2 seconds a lot of the procedures are done in ISRs, but the watchdog is only reset in the main loop. this causes frequent reset, particularly at the beginning were states have to the initialized. Change-Id: Iad364444fca9d18f9a8cf47d5e0840ccd7bac2ef --- M firmware/apps/cardem/main.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/apps/cardem/main.c b/firmware/apps/cardem/main.c index 7d65c7e..6cd3439 100644 --- a/firmware/apps/cardem/main.c +++ b/firmware/apps/cardem/main.c @@ -144,9 +144,9 @@ led_init(); led_blink(LED_RED, BLINK_3O_5F); - /* Enable watchdog for 500ms, with no window */ + /* Enable watchdog for 2000ms, with no window */ WDT_Enable(WDT, WDT_MR_WDRSTEN | WDT_MR_WDDBGHLT | WDT_MR_WDIDLEHLT | - (WDT_GetPeriod(500) << 16) | WDT_GetPeriod(500)); + (WDT_GetPeriod(2000) << 16) | WDT_GetPeriod(2000)); PIO_InitializeInterrupts(0); -- To view, visit https://gerrit.osmocom.org/10215 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iad364444fca9d18f9a8cf47d5e0840ccd7bac2ef Gerrit-Change-Number: 10215 Gerrit-PatchSet: 2 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 29 09:51:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Jul 2018 09:51:32 +0000 Subject: Change in meta-telephony[201705]: recipes-osmocom: update to latests releases In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10209 ) Change subject: recipes-osmocom: update to latests releases ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10209 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-MessageType: comment Gerrit-Change-Id: I8b13f82f32ba775bd56276edaafabdc51a0f5c64 Gerrit-Change-Number: 10209 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Sun, 29 Jul 2018 09:51:32 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 29 09:51:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Jul 2018 09:51:53 +0000 Subject: Change in meta-telephony[201705]: osmo-bsc: Don't try to package anything bsc-nat related In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10210 ) Change subject: osmo-bsc: Don't try to package anything bsc-nat related ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10210 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-MessageType: comment Gerrit-Change-Id: I98109914d53cce1880f259f5d8d366879c2aff61 Gerrit-Change-Number: 10210 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Comment-Date: Sun, 29 Jul 2018 09:51:53 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 29 09:51:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Jul 2018 09:51:57 +0000 Subject: Change in meta-telephony[201705]: recipes-osmocom: update to latests releases In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10209 ) Change subject: recipes-osmocom: update to latests releases ...................................................................... recipes-osmocom: update to latests releases Change-Id: I8b13f82f32ba775bd56276edaafabdc51a0f5c64 --- M recipes-osmocom/libosmo-abis/libosmo-abis_git.bb M recipes-osmocom/libosmo-netif/libosmo-netif_git.bb M recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb M recipes-osmocom/libosmocore/libosmocore_git.bb M recipes-osmocom/osmo-bsc/osmo-bsc_git.bb M recipes-osmocom/osmo-mgw/osmo-mgw_git.bb 6 files changed, 12 insertions(+), 12 deletions(-) Approvals: Pau Espin Pedrol: Verified Harald Welte: Looks good to me, approved diff --git a/recipes-osmocom/libosmo-abis/libosmo-abis_git.bb b/recipes-osmocom/libosmo-abis/libosmo-abis_git.bb index 1bfdb18..98e5192 100644 --- a/recipes-osmocom/libosmo-abis/libosmo-abis_git.bb +++ b/recipes-osmocom/libosmo-abis/libosmo-abis_git.bb @@ -1,7 +1,7 @@ require ${PN}.inc S = "${WORKDIR}/git" -SRCREV = "7b89f12e66a280746fc8e7906505b2d769d19706" +SRCREV = "026ff4574daedcf91a474f9bc67e90e8537a9d86" SRC_URI = "git://git.osmocom.org/libosmo-abis.git;protocol=git" -PV = "0.5.0+gitr${SRCPV}" +PV = "0.5.1+gitr${SRCPV}" PR = "${INC_PR}.0" diff --git a/recipes-osmocom/libosmo-netif/libosmo-netif_git.bb b/recipes-osmocom/libosmo-netif/libosmo-netif_git.bb index 419cb2c..d71810f 100644 --- a/recipes-osmocom/libosmo-netif/libosmo-netif_git.bb +++ b/recipes-osmocom/libosmo-netif/libosmo-netif_git.bb @@ -1,7 +1,7 @@ require ${PN}.inc S = "${WORKDIR}/git" -SRCREV = "e38ee9b808970cd49663221cb823365ef18797d5" +SRCREV = "322dbbeaa29cb90c6917fa7e78a66b96b8ce3689" SRC_URI = "git://git.osmocom.org/libosmo-netif.git;protocol=git" -PV = "0.2.0+gitr${SRCPV}" +PV = "0.3.0+gitr${SRCPV}" PR = "${INC_PR}.0" diff --git a/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb b/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb index bb83638..751bf70 100644 --- a/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb +++ b/recipes-osmocom/libosmo-sccp/libosmo-sccp_git.bb @@ -1,7 +1,7 @@ require ${PN}.inc S = "${WORKDIR}/git" -SRCREV = "c88605c41c25b34d2e2b08f0e1028c2bd6d9404b" +SRCREV = "688f2304056029f47073a549d7e41043eab5a0fd" SRC_URI = "git://git.osmocom.org/libosmo-sccp.git;protocol=git" -PV = "0.9.0+gitr${SRCPV}" +PV = "0.10.0+gitr${SRCPV}" PR = "${INC_PR}.0" diff --git a/recipes-osmocom/libosmocore/libosmocore_git.bb b/recipes-osmocom/libosmocore/libosmocore_git.bb index c2c37f5..9aedec1 100644 --- a/recipes-osmocom/libosmocore/libosmocore_git.bb +++ b/recipes-osmocom/libosmocore/libosmocore_git.bb @@ -1,9 +1,9 @@ require ${PN}.inc S = "${WORKDIR}/git" -SRCREV = "cacaa4a1616d7c0ea370ff197d816f706909bde5" +SRCREV = "924ef0bc72c1be165e8d5c22859f8b4eddbc0f06" SRC_URI = "git://git.osmocom.org/libosmocore.git;protocol=git;nobranch=1" -PV = "0.11.0+gitr${SRCPV}" +PV = "0.12.0+gitr${SRCPV}" PR = "r0" PACKAGES =+ "libosmoctrl libosmocodec libosmogb libosmogsm libosmovty osmo-arfcn osmo-auc-gen" diff --git a/recipes-osmocom/osmo-bsc/osmo-bsc_git.bb b/recipes-osmocom/osmo-bsc/osmo-bsc_git.bb index 2d8a71f..e31dc59 100644 --- a/recipes-osmocom/osmo-bsc/osmo-bsc_git.bb +++ b/recipes-osmocom/osmo-bsc/osmo-bsc_git.bb @@ -1,7 +1,7 @@ require ${PN}.inc S = "${WORKDIR}/git" -SRCREV = "e5a9665c009f9b81bbc370480405cb91cbe99b66" +SRCREV = "08d02dd5100cbff47922427e3beb31a3373bf75c" SRC_URI = "git://git.osmocom.org/osmo-bsc.git;protocol=git" -PV = "1.2.1+gitr${SRCPV}" +PV = "1.3.0+gitr${SRCPV}" PR = "${INC_PR}.0" diff --git a/recipes-osmocom/osmo-mgw/osmo-mgw_git.bb b/recipes-osmocom/osmo-mgw/osmo-mgw_git.bb index d863300..c3e7582 100644 --- a/recipes-osmocom/osmo-mgw/osmo-mgw_git.bb +++ b/recipes-osmocom/osmo-mgw/osmo-mgw_git.bb @@ -1,7 +1,7 @@ require ${PN}.inc S = "${WORKDIR}/git" -SRCREV = "d761d355f9b71b1dfe462e55a6e030bb026d8bf1" +SRCREV = "304b3eb32876cf69b202ee5688e00905fdb336f9" SRC_URI = "git://git.osmocom.org/osmo-mgw.git;protocol=git" -PV = "1.3.0+gitr${SRCPV}" +PV = "1.4.0+gitr${SRCPV}" PR = "${INC_PR}.0" -- To view, visit https://gerrit.osmocom.org/10209 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-MessageType: merged Gerrit-Change-Id: I8b13f82f32ba775bd56276edaafabdc51a0f5c64 Gerrit-Change-Number: 10209 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 29 09:51:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Jul 2018 09:51:57 +0000 Subject: Change in meta-telephony[201705]: osmo-bsc: Don't try to package anything bsc-nat related In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10210 ) Change subject: osmo-bsc: Don't try to package anything bsc-nat related ...................................................................... osmo-bsc: Don't try to package anything bsc-nat related osmo-bsc_nat has been fully removed from osmo-bsc.git in 1c9b8b19176854ecf4a3d57e9eef6b495361557f. Instead, build the one from openbsc.git. Change-Id: I98109914d53cce1880f259f5d8d366879c2aff61 --- M recipes-osmocom/openbsc/openbsc.inc M recipes-osmocom/osmo-bsc/osmo-bsc.inc 2 files changed, 11 insertions(+), 13 deletions(-) Approvals: Pau Espin Pedrol: Verified Harald Welte: Looks good to me, approved diff --git a/recipes-osmocom/openbsc/openbsc.inc b/recipes-osmocom/openbsc/openbsc.inc index 36c57e7..9f23d52 100644 --- a/recipes-osmocom/openbsc/openbsc.inc +++ b/recipes-osmocom/openbsc/openbsc.inc @@ -11,9 +11,9 @@ file://osmo-bsc-sccplite.service \ " -INC_PR = "r0.${META_TELEPHONY_OSMO_INC}" +INC_PR = "r1.${META_TELEPHONY_OSMO_INC}" -EXTRA_OECONF += "--enable-osmo-bsc --enable-smpp --enable-mgcp-transcoding --with-g729" +EXTRA_OECONF += "--enable-nat --enable-osmo-bsc --enable-smpp --enable-mgcp-transcoding --with-g729" inherit autotools update-rc.d pkgconfig @@ -21,6 +21,7 @@ install -d ${D}${sysconfdir}/osmocom install -m 0660 ${S}/doc/examples/osmo-nitb/nanobts/openbsc.cfg ${D}${sysconfdir}/osmocom/osmo-nitb.cfg install -m 0660 ${S}/doc/examples/osmo-bsc-sccplite/osmo-bsc-sccplite.cfg ${D}${sysconfdir}/osmocom/osmo-bsc-sccplite.cfg + install -m 0644 ${S}/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg ${D}${sysconfdir}/osmocom/ # Install sysv-init files install -d ${D}${sysconfdir}/init.d @@ -37,7 +38,7 @@ } -PACKAGES =+ "osmo-bsc-sccplite osmo-nitb" +PACKAGES =+ "osmo-bsc-nat osmo-bsc-sccplite osmo-nitb" INITSCRIPT_PACKAGES = "osmo-bsc-sccplite osmo-nitb" @@ -62,3 +63,9 @@ ${sysconfdir}/osmocom/osmo-nitb.cfg \ ${systemd_unitdir}/system/osmo-nitb.service \ " + +CONFFILES_osmo-bsc-nat = "${sysconfdir}/osmocom/osmo-bsc_nat.cfg" +FILES_osmo-bsc-nat = " \ + ${bindir}/osmo-bsc_nat \ + ${sysconfdir}/osmocom/osmo-bsc_nat.cfg \ + " diff --git a/recipes-osmocom/osmo-bsc/osmo-bsc.inc b/recipes-osmocom/osmo-bsc/osmo-bsc.inc index f20362f..d066a58 100644 --- a/recipes-osmocom/osmo-bsc/osmo-bsc.inc +++ b/recipes-osmocom/osmo-bsc/osmo-bsc.inc @@ -14,12 +14,11 @@ install -d ${D}${sysconfdir}/osmocom/ install -m 0644 ${S}/doc/examples/osmo-bsc/osmo-bsc.cfg ${D}${sysconfdir}/osmocom/ - install -m 0644 ${S}/doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg ${D}${sysconfdir}/osmocom/ install -m 0644 ${S}/contrib/systemd/osmo-bsc.service ${D}${systemd_system_unitdir}/ } -PACKAGES =+ "osmo-bsc-nat-doc osmo-bsc-nat meas-utils ipaccess-utils bs11-utils abisip-find" +PACKAGES =+ "meas-utils ipaccess-utils bs11-utils abisip-find" SYSTEMD_PACKAGES = "osmo-bsc" SYSTEMD_SERVICE_osmo-bsc = "osmo-bsc.service" @@ -43,11 +42,3 @@ ${bindir}/osmo-meas-pcap2db \ ${bindir}/meas_json \ " - -FILES_osmo-bsc-nat = " \ - ${bindir}/osmo-bsc_nat \ - ${sysconfdir}/osmocom/osmo-bsc_nat.cfg \ - " -CONFFILES_osmo-bsc-nat = "${sysconfdir}/osmocom/osmo-bsc_nat.cfg" - -FILES_osmo-bsc-nat-doc = " ${docdir}/osmo-bsc/examples/osmo-bsc_nat " -- To view, visit https://gerrit.osmocom.org/10210 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-MessageType: merged Gerrit-Change-Id: I98109914d53cce1880f259f5d8d366879c2aff61 Gerrit-Change-Number: 10210 Gerrit-PatchSet: 1 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 29 14:21:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Jul 2018 14:21:21 +0000 Subject: Change in libosmocore[master]: gsm0480: Factor out msgb allocation helper function Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10219 Change subject: gsm0480: Factor out msgb allocation helper function ...................................................................... gsm0480: Factor out msgb allocation helper function Change-Id: If25b467481023eadaaf3f78157eceff4b81d24d2 --- M include/osmocom/gsm/gsm0480.h M src/gsm/gsm0480.c M src/gsm/libosmogsm.map 3 files changed, 9 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/19/10219/1 diff --git a/include/osmocom/gsm/gsm0480.h b/include/osmocom/gsm/gsm0480.h index e928d83..6a596ea 100644 --- a/include/osmocom/gsm/gsm0480.h +++ b/include/osmocom/gsm/gsm0480.h @@ -108,6 +108,8 @@ int gsm0480_decode_ss_request(const struct gsm48_hdr *hdr, uint16_t len, struct ss_request *request); +struct msgb *gsm0480_msgb_alloc_name(const char *name); + struct msgb *gsm0480_create_ussd_resp(uint8_t invoke_id, uint8_t trans_id, const char *text); struct msgb *gsm0480_create_unstructuredSS_Notify(int alertPattern, const char *text); struct msgb *gsm0480_create_notifySS(const char *text); diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 165b309..ac0fa12 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -787,13 +787,18 @@ return rc; } +struct msgb *gsm0480_msgb_alloc_name(const char *name) +{ + return msgb_alloc_headroom(1024, 128, name); +} + struct msgb *gsm0480_create_ussd_resp(uint8_t invoke_id, uint8_t trans_id, const char *text) { struct msgb *msg; uint8_t *ptr8; int response_len; - msg = msgb_alloc_headroom(1024, 128, "GSM 04.80"); + msg = gsm0480_msgb_alloc_name("TS 04.80 USSD Resp"); if (!msg) return NULL; diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 3b403c2..312c990 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -97,6 +97,7 @@ gsm0480_wrap_invoke; gsm0480_comp_type_names; gsm0480_op_code_names; +gsm0480_msgb_alloc_name; gsm0502_calc_paging_group; -- To view, visit https://gerrit.osmocom.org/10219 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: If25b467481023eadaaf3f78157eceff4b81d24d2 Gerrit-Change-Number: 10219 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 29 14:21:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Jul 2018 14:21:21 +0000 Subject: Change in libosmocore[master]: USSD: Introduce gsm0480_gen_ussd_resp_7bit() Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10220 Change subject: USSD: Introduce gsm0480_gen_ussd_resp_7bit() ...................................................................... USSD: Introduce gsm0480_gen_ussd_resp_7bit() Contrary to the existing gsm0480_create_ussd_resp(), the new function only generates the value part of the FACILITY IE, and not the IE Tag/Length or the 04.08 L3 header. This is needed in the context of GSUP-encapsulated USSD, as here we don't work with L3 messages, but only pass on the FACILITY IE value. Change-Id: Ide240279240322f643e142229eb7829f538c6314 --- M include/osmocom/gsm/gsm0480.h M src/gsm/gsm0480.c M src/gsm/libosmogsm.map 3 files changed, 24 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/20/10220/1 diff --git a/include/osmocom/gsm/gsm0480.h b/include/osmocom/gsm/gsm0480.h index 6a596ea..9fa84b0 100644 --- a/include/osmocom/gsm/gsm0480.h +++ b/include/osmocom/gsm/gsm0480.h @@ -109,6 +109,7 @@ struct ss_request *request); struct msgb *gsm0480_msgb_alloc_name(const char *name); +struct msgb *gsm0480_gen_ussd_resp_7bit(uint8_t invoke_id, const char *text); struct msgb *gsm0480_create_ussd_resp(uint8_t invoke_id, uint8_t trans_id, const char *text); struct msgb *gsm0480_create_unstructuredSS_Notify(int alertPattern, const char *text); diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index ac0fa12..db28f0d 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -792,7 +792,11 @@ return msgb_alloc_headroom(1024, 128, name); } -struct msgb *gsm0480_create_ussd_resp(uint8_t invoke_id, uint8_t trans_id, const char *text) +/*! Generate a USSD ReturnResult component containing a string in default GSM alphabet. + * \param[in] invoke_id InvokeID of the request to which we respond + * \param[in] text USSD text in ASCII; to be encoded as GSM 7-but alphabet + */ +struct msgb *gsm0480_gen_ussd_resp_7bit(uint8_t invoke_id, const char *text) { struct msgb *msg; uint8_t *ptr8; @@ -829,6 +833,23 @@ /* Wrap this up as a Return Result component */ msgb_wrap_with_TL(msg, GSM0480_CTYPE_RETURN_RESULT); + return msg; +} + +/*! Legacy helper: Generate USSD response including FACILITY IE + L3 header. + * + * This function is just like \ref gsm0480_gen_ussd_resp_7bit, but it generates + * not only the FACILITY value, but the full L3 message including message header + * and FACILITY IE Tag+Length. + */ +struct msgb *gsm0480_create_ussd_resp(uint8_t invoke_id, uint8_t trans_id, const char *text) +{ + struct msgb *msg; + + msg = gsm0480_gen_ussd_resp_7bit(invoke_id, text); + if (!msg) + return NULL; + /* Wrap the component in a Facility message */ msgb_wrap_with_TL(msg, GSM0480_IE_FACILITY); diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 312c990..d21514c 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -98,6 +98,7 @@ gsm0480_comp_type_names; gsm0480_op_code_names; gsm0480_msgb_alloc_name; +gsm0480_gen_ussd_resp_7bit; gsm0502_calc_paging_group; -- To view, visit https://gerrit.osmocom.org/10220 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ide240279240322f643e142229eb7829f538c6314 Gerrit-Change-Number: 10220 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 29 14:21:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Jul 2018 14:21:23 +0000 Subject: Change in libosmocore[master]: 04.80: New gsm0480_gen_{reject, return_error}() functions Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10221 Change subject: 04.80: New gsm0480_gen_{reject,return_error}() functions ...................................................................... 04.80: New gsm0480_gen_{reject,return_error}() functions Add functions to generate TS 04.80 (supplementary services) Reject and ReturnError components. Change-Id: I6e5ee39c3d03364f7833ec717593d5ddb0a4c5f9 --- M include/osmocom/gsm/gsm0480.h M src/gsm/gsm0480.c M src/gsm/libosmogsm.map 3 files changed, 68 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/21/10221/1 diff --git a/include/osmocom/gsm/gsm0480.h b/include/osmocom/gsm/gsm0480.h index 9fa84b0..246f4b3 100644 --- a/include/osmocom/gsm/gsm0480.h +++ b/include/osmocom/gsm/gsm0480.h @@ -110,6 +110,8 @@ struct msgb *gsm0480_msgb_alloc_name(const char *name); struct msgb *gsm0480_gen_ussd_resp_7bit(uint8_t invoke_id, const char *text); +struct msgb *gsm0480_gen_return_error(uint8_t invoke_id, uint8_t error_code); +struct msgb *gsm0480_gen_reject(int invoke_id, uint8_t problem_tag, uint8_t problem_code); struct msgb *gsm0480_create_ussd_resp(uint8_t invoke_id, uint8_t trans_id, const char *text); struct msgb *gsm0480_create_unstructuredSS_Notify(int alertPattern, const char *text); diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index db28f0d..2d2df4a 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -87,6 +87,15 @@ return data; } +static inline unsigned char *msgb_push_NULL(struct msgb *msgb) +{ + uint8_t *data = msgb_push(msgb, 2); + + data[0] = ASN1_NULL_TYPE_TAG; + data[1] = 0; + return data; +} + /* wrap an invoke around it... the other way around * * 1.) Invoke Component tag @@ -861,6 +870,61 @@ return msg; } +/*! Generate a ReturnError component (see section 3.6.1) and given error code (see section 3.6.6). + * \param[in] invoke_id InvokeID of the request + * \param[in] error_code Error code (section 4.5) + * \return message buffer containing the Reject component + * + * Note: if InvokeID is not available, e.g. when message parsing failed, any incorrect vlue + * can be passed (0x00 > x > 0xff), so the universal NULL-tag (see table 3.6) will be used instead. + */ +struct msgb *gsm0480_gen_return_error(uint8_t invoke_id, uint8_t error_code) +{ + struct msgb *msg = gsm0480_msgb_alloc_name("TS 04.80 ReturnError"); + + /* First insert the problem code */ + msgb_push_TLV1(msg, GSM_0480_ERROR_CODE_TAG, error_code); + + /* Before it, insert the invoke ID */ + msgb_push_TLV1(msg, GSM0480_COMPIDTAG_INVOKE_ID, invoke_id); + + /* Wrap this up as a Reject component */ + msgb_wrap_with_TL(msg, GSM0480_CTYPE_RETURN_ERROR); + + /* FIXME: Wrap in Facility + L3? */ + return msg; +} + +/*! Generate a Reject component (see section 3.6.1) and given error code (see section 3.6.7). + * \param[in] invoke_id InvokeID of the request + * \param[in] problem_tag Problem code tag (table 3.13) + * \param[in] problem_code Problem code (table 3.14-3.17) + * \return message buffer containing the Reject component + * + * Note: if InvokeID is not available, e.g. when message parsing failed, any incorrect vlue + * can be passed (0x00 > x > 0xff), so the universal NULL-tag (see table 3.6) will be used instead. + */ +struct msgb *gsm0480_gen_reject(int invoke_id, uint8_t problem_tag, uint8_t problem_code) +{ + struct msgb *msg = gsm0480_msgb_alloc_name("TS 04.80 Reject"); + + /* First insert the problem code */ + msgb_push_TLV1(msg, problem_tag, problem_code); + + /* If the Invoke ID is not available, Universal NULL (table 3.9) with length=0 shall be used */ + if (invoke_id < 0 || invoke_id > 255) + msgb_push_NULL(msg); + else + msgb_push_TLV1(msg, GSM0480_COMPIDTAG_INVOKE_ID, invoke_id); + + /* Wrap this up as a Reject component */ + msgb_wrap_with_TL(msg, GSM0480_CTYPE_REJECT); + + /* FIXME: Wrap in Facility + L3? */ + return msg; +} + + struct gsm48_hdr *gsm0480_l3hdr_push(struct msgb *msg, uint8_t proto_discr, uint8_t msg_type) { diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index d21514c..b44cfd2 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -99,6 +99,8 @@ gsm0480_op_code_names; gsm0480_msgb_alloc_name; gsm0480_gen_ussd_resp_7bit; +gsm0480_gen_return_error; +gsm0480_gen_reject; gsm0502_calc_paging_group; -- To view, visit https://gerrit.osmocom.org/10221 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I6e5ee39c3d03364f7833ec717593d5ddb0a4c5f9 Gerrit-Change-Number: 10221 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 29 14:23:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Jul 2018 14:23:29 +0000 Subject: Change in libosmocore[master]: gsm0480: Factor out msgb allocation helper function In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10219 ) Change subject: gsm0480: Factor out msgb allocation helper function ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10219 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: If25b467481023eadaaf3f78157eceff4b81d24d2 Gerrit-Change-Number: 10219 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-CC: Jenkins Builder Gerrit-Comment-Date: Sun, 29 Jul 2018 14:23:29 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 29 14:23:49 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Jul 2018 14:23:49 +0000 Subject: Change in libosmocore[master]: USSD: Introduce gsm0480_gen_ussd_resp_7bit() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10220 ) Change subject: USSD: Introduce gsm0480_gen_ussd_resp_7bit() ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10220 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ide240279240322f643e142229eb7829f538c6314 Gerrit-Change-Number: 10220 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Sun, 29 Jul 2018 14:23:49 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 29 14:24:03 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Jul 2018 14:24:03 +0000 Subject: Change in libosmocore[master]: 04.80: New gsm0480_gen_{reject, return_error}() functions In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10221 ) Change subject: 04.80: New gsm0480_gen_{reject,return_error}() functions ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10221 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6e5ee39c3d03364f7833ec717593d5ddb0a4c5f9 Gerrit-Change-Number: 10221 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Sun, 29 Jul 2018 14:24:03 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 29 14:34:59 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Jul 2018 14:34:59 +0000 Subject: Change in libosmocore[master]: ctrl/vty: fsm: use correct element when iterating over fsm->proc.chil... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10031 ) Change subject: ctrl/vty: fsm: use correct element when iterating over fsm->proc.children ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10031 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4ae0bee7f7f57ec6675cfb52ca6cf0d523d15362 Gerrit-Change-Number: 10031 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Sun, 29 Jul 2018 14:34:59 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 29 14:35:01 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Jul 2018 14:35:01 +0000 Subject: Change in libosmocore[master]: ctrl/vty: fsm: use correct element when iterating over fsm->proc.chil... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10031 ) Change subject: ctrl/vty: fsm: use correct element when iterating over fsm->proc.children ...................................................................... ctrl/vty: fsm: use correct element when iterating over fsm->proc.children Fixes crashes when using vty `show fsm-instances all` when fsm children are present. Change-Id: I4ae0bee7f7f57ec6675cfb52ca6cf0d523d15362 --- M src/ctrl/fsm_ctrl_commands.c M src/vty/fsm_vty.c 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/ctrl/fsm_ctrl_commands.c b/src/ctrl/fsm_ctrl_commands.c index 3c7e1bd..c93d3a5 100644 --- a/src/ctrl/fsm_ctrl_commands.c +++ b/src/ctrl/fsm_ctrl_commands.c @@ -156,7 +156,7 @@ if (fi->proc.parent) cmd->reply = talloc_asprintf_append(cmd->reply, ",parent='%s'", fi->proc.parent->name); - llist_for_each_entry(child, &fi->proc.children, list) { + llist_for_each_entry(child, &fi->proc.children, proc.child) { cmd->reply = talloc_asprintf_append(cmd->reply, ",child='%s'", child->name); } diff --git a/src/vty/fsm_vty.c b/src/vty/fsm_vty.c index 8628d15..9bde241 100644 --- a/src/vty/fsm_vty.c +++ b/src/vty/fsm_vty.c @@ -102,7 +102,7 @@ fsmi->proc.parent_term_event), VTY_NEWLINE); } - llist_for_each_entry(child, &fsmi->proc.children, list) { + llist_for_each_entry(child, &fsmi->proc.children, proc.child) { vty_out(vty, " Child: '%s'%s", child->name, VTY_NEWLINE); } } -- To view, visit https://gerrit.osmocom.org/10031 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I4ae0bee7f7f57ec6675cfb52ca6cf0d523d15362 Gerrit-Change-Number: 10031 Gerrit-PatchSet: 3 Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 29 14:39:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Jul 2018 14:39:36 +0000 Subject: Change in libosmocore[master]: gsm0480: Factor out msgb allocation helper function In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10219 ) Change subject: gsm0480: Factor out msgb allocation helper function ...................................................................... gsm0480: Factor out msgb allocation helper function Change-Id: If25b467481023eadaaf3f78157eceff4b81d24d2 --- M include/osmocom/gsm/gsm0480.h M src/gsm/gsm0480.c M src/gsm/libosmogsm.map 3 files changed, 9 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/gsm0480.h b/include/osmocom/gsm/gsm0480.h index e928d83..6a596ea 100644 --- a/include/osmocom/gsm/gsm0480.h +++ b/include/osmocom/gsm/gsm0480.h @@ -108,6 +108,8 @@ int gsm0480_decode_ss_request(const struct gsm48_hdr *hdr, uint16_t len, struct ss_request *request); +struct msgb *gsm0480_msgb_alloc_name(const char *name); + struct msgb *gsm0480_create_ussd_resp(uint8_t invoke_id, uint8_t trans_id, const char *text); struct msgb *gsm0480_create_unstructuredSS_Notify(int alertPattern, const char *text); struct msgb *gsm0480_create_notifySS(const char *text); diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 165b309..ac0fa12 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -787,13 +787,18 @@ return rc; } +struct msgb *gsm0480_msgb_alloc_name(const char *name) +{ + return msgb_alloc_headroom(1024, 128, name); +} + struct msgb *gsm0480_create_ussd_resp(uint8_t invoke_id, uint8_t trans_id, const char *text) { struct msgb *msg; uint8_t *ptr8; int response_len; - msg = msgb_alloc_headroom(1024, 128, "GSM 04.80"); + msg = gsm0480_msgb_alloc_name("TS 04.80 USSD Resp"); if (!msg) return NULL; diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 3b403c2..312c990 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -97,6 +97,7 @@ gsm0480_wrap_invoke; gsm0480_comp_type_names; gsm0480_op_code_names; +gsm0480_msgb_alloc_name; gsm0502_calc_paging_group; -- To view, visit https://gerrit.osmocom.org/10219 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: If25b467481023eadaaf3f78157eceff4b81d24d2 Gerrit-Change-Number: 10219 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 29 14:39:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Jul 2018 14:39:36 +0000 Subject: Change in libosmocore[master]: USSD: Introduce gsm0480_gen_ussd_resp_7bit() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10220 ) Change subject: USSD: Introduce gsm0480_gen_ussd_resp_7bit() ...................................................................... USSD: Introduce gsm0480_gen_ussd_resp_7bit() Contrary to the existing gsm0480_create_ussd_resp(), the new function only generates the value part of the FACILITY IE, and not the IE Tag/Length or the 04.08 L3 header. This is needed in the context of GSUP-encapsulated USSD, as here we don't work with L3 messages, but only pass on the FACILITY IE value. Change-Id: Ide240279240322f643e142229eb7829f538c6314 --- M include/osmocom/gsm/gsm0480.h M src/gsm/gsm0480.c M src/gsm/libosmogsm.map 3 files changed, 24 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/gsm0480.h b/include/osmocom/gsm/gsm0480.h index 6a596ea..9fa84b0 100644 --- a/include/osmocom/gsm/gsm0480.h +++ b/include/osmocom/gsm/gsm0480.h @@ -109,6 +109,7 @@ struct ss_request *request); struct msgb *gsm0480_msgb_alloc_name(const char *name); +struct msgb *gsm0480_gen_ussd_resp_7bit(uint8_t invoke_id, const char *text); struct msgb *gsm0480_create_ussd_resp(uint8_t invoke_id, uint8_t trans_id, const char *text); struct msgb *gsm0480_create_unstructuredSS_Notify(int alertPattern, const char *text); diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index ac0fa12..db28f0d 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -792,7 +792,11 @@ return msgb_alloc_headroom(1024, 128, name); } -struct msgb *gsm0480_create_ussd_resp(uint8_t invoke_id, uint8_t trans_id, const char *text) +/*! Generate a USSD ReturnResult component containing a string in default GSM alphabet. + * \param[in] invoke_id InvokeID of the request to which we respond + * \param[in] text USSD text in ASCII; to be encoded as GSM 7-but alphabet + */ +struct msgb *gsm0480_gen_ussd_resp_7bit(uint8_t invoke_id, const char *text) { struct msgb *msg; uint8_t *ptr8; @@ -829,6 +833,23 @@ /* Wrap this up as a Return Result component */ msgb_wrap_with_TL(msg, GSM0480_CTYPE_RETURN_RESULT); + return msg; +} + +/*! Legacy helper: Generate USSD response including FACILITY IE + L3 header. + * + * This function is just like \ref gsm0480_gen_ussd_resp_7bit, but it generates + * not only the FACILITY value, but the full L3 message including message header + * and FACILITY IE Tag+Length. + */ +struct msgb *gsm0480_create_ussd_resp(uint8_t invoke_id, uint8_t trans_id, const char *text) +{ + struct msgb *msg; + + msg = gsm0480_gen_ussd_resp_7bit(invoke_id, text); + if (!msg) + return NULL; + /* Wrap the component in a Facility message */ msgb_wrap_with_TL(msg, GSM0480_IE_FACILITY); diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 312c990..d21514c 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -98,6 +98,7 @@ gsm0480_comp_type_names; gsm0480_op_code_names; gsm0480_msgb_alloc_name; +gsm0480_gen_ussd_resp_7bit; gsm0502_calc_paging_group; -- To view, visit https://gerrit.osmocom.org/10220 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ide240279240322f643e142229eb7829f538c6314 Gerrit-Change-Number: 10220 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 29 14:39:37 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Jul 2018 14:39:37 +0000 Subject: Change in libosmocore[master]: 04.80: New gsm0480_gen_{reject, return_error}() functions In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10221 ) Change subject: 04.80: New gsm0480_gen_{reject,return_error}() functions ...................................................................... 04.80: New gsm0480_gen_{reject,return_error}() functions Add functions to generate TS 04.80 (supplementary services) Reject and ReturnError components. Change-Id: I6e5ee39c3d03364f7833ec717593d5ddb0a4c5f9 --- M include/osmocom/gsm/gsm0480.h M src/gsm/gsm0480.c M src/gsm/libosmogsm.map 3 files changed, 68 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/gsm0480.h b/include/osmocom/gsm/gsm0480.h index 9fa84b0..246f4b3 100644 --- a/include/osmocom/gsm/gsm0480.h +++ b/include/osmocom/gsm/gsm0480.h @@ -110,6 +110,8 @@ struct msgb *gsm0480_msgb_alloc_name(const char *name); struct msgb *gsm0480_gen_ussd_resp_7bit(uint8_t invoke_id, const char *text); +struct msgb *gsm0480_gen_return_error(uint8_t invoke_id, uint8_t error_code); +struct msgb *gsm0480_gen_reject(int invoke_id, uint8_t problem_tag, uint8_t problem_code); struct msgb *gsm0480_create_ussd_resp(uint8_t invoke_id, uint8_t trans_id, const char *text); struct msgb *gsm0480_create_unstructuredSS_Notify(int alertPattern, const char *text); diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index db28f0d..2d2df4a 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -87,6 +87,15 @@ return data; } +static inline unsigned char *msgb_push_NULL(struct msgb *msgb) +{ + uint8_t *data = msgb_push(msgb, 2); + + data[0] = ASN1_NULL_TYPE_TAG; + data[1] = 0; + return data; +} + /* wrap an invoke around it... the other way around * * 1.) Invoke Component tag @@ -861,6 +870,61 @@ return msg; } +/*! Generate a ReturnError component (see section 3.6.1) and given error code (see section 3.6.6). + * \param[in] invoke_id InvokeID of the request + * \param[in] error_code Error code (section 4.5) + * \return message buffer containing the Reject component + * + * Note: if InvokeID is not available, e.g. when message parsing failed, any incorrect vlue + * can be passed (0x00 > x > 0xff), so the universal NULL-tag (see table 3.6) will be used instead. + */ +struct msgb *gsm0480_gen_return_error(uint8_t invoke_id, uint8_t error_code) +{ + struct msgb *msg = gsm0480_msgb_alloc_name("TS 04.80 ReturnError"); + + /* First insert the problem code */ + msgb_push_TLV1(msg, GSM_0480_ERROR_CODE_TAG, error_code); + + /* Before it, insert the invoke ID */ + msgb_push_TLV1(msg, GSM0480_COMPIDTAG_INVOKE_ID, invoke_id); + + /* Wrap this up as a Reject component */ + msgb_wrap_with_TL(msg, GSM0480_CTYPE_RETURN_ERROR); + + /* FIXME: Wrap in Facility + L3? */ + return msg; +} + +/*! Generate a Reject component (see section 3.6.1) and given error code (see section 3.6.7). + * \param[in] invoke_id InvokeID of the request + * \param[in] problem_tag Problem code tag (table 3.13) + * \param[in] problem_code Problem code (table 3.14-3.17) + * \return message buffer containing the Reject component + * + * Note: if InvokeID is not available, e.g. when message parsing failed, any incorrect vlue + * can be passed (0x00 > x > 0xff), so the universal NULL-tag (see table 3.6) will be used instead. + */ +struct msgb *gsm0480_gen_reject(int invoke_id, uint8_t problem_tag, uint8_t problem_code) +{ + struct msgb *msg = gsm0480_msgb_alloc_name("TS 04.80 Reject"); + + /* First insert the problem code */ + msgb_push_TLV1(msg, problem_tag, problem_code); + + /* If the Invoke ID is not available, Universal NULL (table 3.9) with length=0 shall be used */ + if (invoke_id < 0 || invoke_id > 255) + msgb_push_NULL(msg); + else + msgb_push_TLV1(msg, GSM0480_COMPIDTAG_INVOKE_ID, invoke_id); + + /* Wrap this up as a Reject component */ + msgb_wrap_with_TL(msg, GSM0480_CTYPE_REJECT); + + /* FIXME: Wrap in Facility + L3? */ + return msg; +} + + struct gsm48_hdr *gsm0480_l3hdr_push(struct msgb *msg, uint8_t proto_discr, uint8_t msg_type) { diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index d21514c..b44cfd2 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -99,6 +99,8 @@ gsm0480_op_code_names; gsm0480_msgb_alloc_name; gsm0480_gen_ussd_resp_7bit; +gsm0480_gen_return_error; +gsm0480_gen_reject; gsm0502_calc_paging_group; -- To view, visit https://gerrit.osmocom.org/10221 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I6e5ee39c3d03364f7833ec717593d5ddb0a4c5f9 Gerrit-Change-Number: 10221 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 29 14:39:43 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Jul 2018 14:39:43 +0000 Subject: Change in osmo-msc[master]: msc_vlr_tests: don't abuse USSD-request to conclude connections In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9657 ) Change subject: msc_vlr_tests: don't abuse USSD-request to conclude connections ...................................................................... msc_vlr_tests: don't abuse USSD-request to conclude connections Previously the '*#100#' USSD-request was abused in order to conclude the current subscriber connection. This makes the unit tests depend on each other, for example, if one break something in the GSM 09.11 implementation, a half of tests would fail. Moreover, the further changes in the GSM 09.11 implementation will make the results less predictable (i.e. session ID, etc.). So let's introduce a separate unit test with simple request- response logic, while more complex tests will be in TTCN. Change-Id: I40b4caac3113263f5a06c861dff5e10d43c319b5 --- M tests/msc_vlr/Makefile.am M tests/msc_vlr/msc_vlr_test_authen_reuse.c M tests/msc_vlr/msc_vlr_test_authen_reuse.err M tests/msc_vlr/msc_vlr_test_gsm_authen.c M tests/msc_vlr/msc_vlr_test_gsm_authen.err M tests/msc_vlr/msc_vlr_test_gsm_ciph.c M tests/msc_vlr/msc_vlr_test_gsm_ciph.err M tests/msc_vlr/msc_vlr_test_no_authen.c M tests/msc_vlr/msc_vlr_test_no_authen.err M tests/msc_vlr/msc_vlr_test_reject_concurrency.c M tests/msc_vlr/msc_vlr_test_reject_concurrency.err A tests/msc_vlr/msc_vlr_test_ss.c A tests/msc_vlr/msc_vlr_test_ss.err A tests/msc_vlr/msc_vlr_test_ss.ok M tests/msc_vlr/msc_vlr_test_umts_authen.c M tests/msc_vlr/msc_vlr_test_umts_authen.err M tests/msc_vlr/msc_vlr_tests.c M tests/msc_vlr/msc_vlr_tests.h M tests/testsuite.at 19 files changed, 488 insertions(+), 659 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/tests/msc_vlr/Makefile.am b/tests/msc_vlr/Makefile.am index bafe743..8b29f79 100644 --- a/tests/msc_vlr/Makefile.am +++ b/tests/msc_vlr/Makefile.am @@ -80,6 +80,8 @@ msc_vlr_test_call.err \ msc_vlr_test_rest.ok \ msc_vlr_test_rest.err \ + msc_vlr_test_ss.ok \ + msc_vlr_test_ss.err \ $(NULL) noinst_PROGRAMS = \ @@ -94,6 +96,7 @@ msc_vlr_test_reject_concurrency \ msc_vlr_test_call \ msc_vlr_test_rest \ + msc_vlr_test_ss \ $(NULL) msc_vlr_test_no_authen_SOURCES = \ @@ -151,6 +154,11 @@ msc_vlr_tests.c \ $(NULL) +msc_vlr_test_ss_SOURCES = \ + msc_vlr_test_ss.c \ + msc_vlr_tests.c \ + $(NULL) + .PHONY: update_exp update_exp: $(builddir)/msc_vlr_test_no_authen >$(srcdir)/msc_vlr_test_no_authen.ok 2>$(srcdir)/msc_vlr_test_no_authen.err @@ -164,3 +172,4 @@ $(builddir)/msc_vlr_test_reject_concurrency >$(srcdir)/msc_vlr_test_reject_concurrency.ok 2>$(srcdir)/msc_vlr_test_reject_concurrency.err $(builddir)/msc_vlr_test_call >$(srcdir)/msc_vlr_test_call.ok 2>$(srcdir)/msc_vlr_test_call.err $(builddir)/msc_vlr_test_rest >$(srcdir)/msc_vlr_test_rest.ok 2>$(srcdir)/msc_vlr_test_rest.err + $(builddir)/msc_vlr_test_ss >$(srcdir)/msc_vlr_test_ss.ok 2>$(srcdir)/msc_vlr_test_ss.err diff --git a/tests/msc_vlr/msc_vlr_test_authen_reuse.c b/tests/msc_vlr/msc_vlr_test_authen_reuse.c index 389837a..3b80e83 100644 --- a/tests/msc_vlr/msc_vlr_test_authen_reuse.c +++ b/tests/msc_vlr/msc_vlr_test_authen_reuse.c @@ -177,12 +177,9 @@ VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); } - btw("a USSD request is serviced"); - dtap_expect_tx_ussd("Your extension is 42342\r"); + /* Release connection */ expect_release_clear(via_ran); - ms_sends_msg("0b3b1c15a11302010002013b300b04010f0406aa510c061b017f0100"); - OSMO_ASSERT(dtap_tx_confirmed); - ASSERT_RELEASE_CLEAR(via_ran); + conn_conclude_cm_service_req(g_conn, via_ran); bss_rnc_sends_release_clear_complete(via_ran); btw("all requests serviced, conn has been released"); @@ -252,12 +249,9 @@ VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); } - btw("a USSD request is serviced"); - dtap_expect_tx_ussd("Your extension is 42342\r"); + /* Release connection */ expect_release_clear(via_ran); - ms_sends_msg("0b3b1c15a11302010002013b300b04010f0406aa510c061b017f0100"); - OSMO_ASSERT(dtap_tx_confirmed); - ASSERT_RELEASE_CLEAR(via_ran); + conn_conclude_cm_service_req(g_conn, via_ran); bss_rnc_sends_release_clear_complete(via_ran); btw("all requests serviced, conn has been released"); diff --git a/tests/msc_vlr/msc_vlr_test_authen_reuse.err b/tests/msc_vlr/msc_vlr_test_authen_reuse.err index 2fae418..e25396d 100644 --- a/tests/msc_vlr/msc_vlr_test_authen_reuse.err +++ b/tests/msc_vlr/msc_vlr_test_authen_reuse.err @@ -253,31 +253,10 @@ DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: subscr_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request DREF MSISDN:42342: MSC conn use - dtap == 1 (0x8: cm_service) cm_service_result_sent == 1 -- a USSD request is serviced - expecting USSD: - Your extension is 42342 - MSC <--RAN_GERAN_A-- MS: GSM0480_MTYPE_REGISTER -DREF MSISDN:42342: MSC conn use + dtap == 2 (0xa: dtap,cm_service) -DRLL Dispatching 04.08 message GSM0480_MTYPE_REGISTER (0xb:0x3b) -DMM Received SS/USSD data (trans_id=8, msg_type=GSM0480_MTYPE_REGISTER) -DMM -> (new transaction) -DCC (ti 08 sub MSISDN:42342 callref 20000001) New transaction -DREF VLR subscr MSISDN:42342 usage increases to: 3 -DREF MSISDN:42342: MSC conn use + trans_nc_ss == 3 (0x4a: dtap,cm_service,trans_nc_ss) -DMM MSISDN:42342: rx msg GSM0480_MTYPE_REGISTER: received_cm_service_request changes to false -DREF MSISDN:42342: MSC conn use - cm_service == 2 (0x42: dtap,trans_nc_ss) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING -DMM USSD: Own number requested -DMM MSISDN:42342: MSISDN = 42342 -DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM0480_MTYPE_RELEASE_COMPLETE: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d -- DTAP matches expected message -DREF VLR subscr MSISDN:42342 usage decreases to: 2 -DREF MSISDN:42342: MSC conn use - trans_nc_ss == 1 (0x2: dtap) -DREF MSISDN:42342: MSC conn use - dtap == 0 (0x0: ) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_UNUSED -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASING +- Concluding CM Service Request +DREF MSISDN:42342: MSC conn use - cm_service == 0 (0x0: ) +DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_UNUSED +DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASING DREF MSISDN:42342: MSC conn use + release == 1 (0x100: release) DREF VLR subscr MSISDN:42342 usage increases to: 3 DREF VLR subscr MSISDN:42342 usage decreases to: 2 @@ -382,31 +361,10 @@ DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: subscr_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request DREF MSISDN:42342: MSC conn use - dtap == 1 (0x8: cm_service) cm_service_result_sent == 1 -- a USSD request is serviced - expecting USSD: - Your extension is 42342 - MSC <--RAN_GERAN_A-- MS: GSM0480_MTYPE_REGISTER -DREF MSISDN:42342: MSC conn use + dtap == 2 (0xa: dtap,cm_service) -DRLL Dispatching 04.08 message GSM0480_MTYPE_REGISTER (0xb:0x3b) -DMM Received SS/USSD data (trans_id=8, msg_type=GSM0480_MTYPE_REGISTER) -DMM -> (new transaction) -DCC (ti 08 sub MSISDN:42342 callref 20000002) New transaction -DREF VLR subscr MSISDN:42342 usage increases to: 3 -DREF MSISDN:42342: MSC conn use + trans_nc_ss == 3 (0x4a: dtap,cm_service,trans_nc_ss) -DMM MSISDN:42342: rx msg GSM0480_MTYPE_REGISTER: received_cm_service_request changes to false -DREF MSISDN:42342: MSC conn use - cm_service == 2 (0x42: dtap,trans_nc_ss) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING -DMM USSD: Own number requested -DMM MSISDN:42342: MSISDN = 42342 -DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM0480_MTYPE_RELEASE_COMPLETE: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d -- DTAP matches expected message -DREF VLR subscr MSISDN:42342 usage decreases to: 2 -DREF MSISDN:42342: MSC conn use - trans_nc_ss == 1 (0x2: dtap) -DREF MSISDN:42342: MSC conn use - dtap == 0 (0x0: ) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_UNUSED -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASING +- Concluding CM Service Request +DREF MSISDN:42342: MSC conn use - cm_service == 0 (0x0: ) +DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_UNUSED +DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASING DREF MSISDN:42342: MSC conn use + release == 1 (0x100: release) DREF VLR subscr MSISDN:42342 usage increases to: 3 DREF VLR subscr MSISDN:42342 usage decreases to: 2 @@ -739,31 +697,10 @@ DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_AUTH_CIPH}: state_chg to SUBSCR_CONN_S_ACCEPTED DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: subscr_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request cm_service_result_sent == 0 -- a USSD request is serviced - expecting USSD: - Your extension is 42342 - MSC <--RAN_UTRAN_IU-- MS: GSM0480_MTYPE_REGISTER -DREF MSISDN:42342: MSC conn use + dtap == 2 (0xa: dtap,cm_service) -DRLL Dispatching 04.08 message GSM0480_MTYPE_REGISTER (0xb:0x3b) -DMM Received SS/USSD data (trans_id=8, msg_type=GSM0480_MTYPE_REGISTER) -DMM -> (new transaction) -DCC (ti 08 sub MSISDN:42342 callref 20000003) New transaction -DREF VLR subscr MSISDN:42342 usage increases to: 3 -DREF MSISDN:42342: MSC conn use + trans_nc_ss == 3 (0x4a: dtap,cm_service,trans_nc_ss) -DMM MSISDN:42342: rx msg GSM0480_MTYPE_REGISTER: received_cm_service_request changes to false -DREF MSISDN:42342: MSC conn use - cm_service == 2 (0x42: dtap,trans_nc_ss) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING -DMM USSD: Own number requested -DMM MSISDN:42342: MSISDN = 42342 -DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_UTRAN_IU -- DTAP --RAN_UTRAN_IU--> MS: GSM0480_MTYPE_RELEASE_COMPLETE: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d -- DTAP matches expected message -DREF VLR subscr MSISDN:42342 usage decreases to: 2 -DREF MSISDN:42342: MSC conn use - trans_nc_ss == 1 (0x2: dtap) -DREF MSISDN:42342: MSC conn use - dtap == 0 (0x0: ) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_UNUSED -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASING +- Concluding CM Service Request +DREF MSISDN:42342: MSC conn use - cm_service == 0 (0x0: ) +DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_UNUSED +DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASING DREF MSISDN:42342: MSC conn use + release == 1 (0x100: release) DREF VLR subscr MSISDN:42342 usage increases to: 3 DREF VLR subscr MSISDN:42342 usage decreases to: 2 @@ -881,31 +818,10 @@ DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_AUTH_CIPH}: state_chg to SUBSCR_CONN_S_ACCEPTED DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: subscr_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request cm_service_result_sent == 0 -- a USSD request is serviced - expecting USSD: - Your extension is 42342 - MSC <--RAN_UTRAN_IU-- MS: GSM0480_MTYPE_REGISTER -DREF MSISDN:42342: MSC conn use + dtap == 2 (0xa: dtap,cm_service) -DRLL Dispatching 04.08 message GSM0480_MTYPE_REGISTER (0xb:0x3b) -DMM Received SS/USSD data (trans_id=8, msg_type=GSM0480_MTYPE_REGISTER) -DMM -> (new transaction) -DCC (ti 08 sub MSISDN:42342 callref 20000004) New transaction -DREF VLR subscr MSISDN:42342 usage increases to: 3 -DREF MSISDN:42342: MSC conn use + trans_nc_ss == 3 (0x4a: dtap,cm_service,trans_nc_ss) -DMM MSISDN:42342: rx msg GSM0480_MTYPE_REGISTER: received_cm_service_request changes to false -DREF MSISDN:42342: MSC conn use - cm_service == 2 (0x42: dtap,trans_nc_ss) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING -DMM USSD: Own number requested -DMM MSISDN:42342: MSISDN = 42342 -DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_UTRAN_IU -- DTAP --RAN_UTRAN_IU--> MS: GSM0480_MTYPE_RELEASE_COMPLETE: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d -- DTAP matches expected message -DREF VLR subscr MSISDN:42342 usage decreases to: 2 -DREF MSISDN:42342: MSC conn use - trans_nc_ss == 1 (0x2: dtap) -DREF MSISDN:42342: MSC conn use - dtap == 0 (0x0: ) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_UNUSED -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASING +- Concluding CM Service Request +DREF MSISDN:42342: MSC conn use - cm_service == 0 (0x0: ) +DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_UNUSED +DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASING DREF MSISDN:42342: MSC conn use + release == 1 (0x100: release) DREF VLR subscr MSISDN:42342 usage increases to: 3 DREF VLR subscr MSISDN:42342 usage decreases to: 2 @@ -1213,31 +1129,10 @@ DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: subscr_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request DREF MSISDN:42342: MSC conn use - dtap == 1 (0x8: cm_service) cm_service_result_sent == 1 -- a USSD request is serviced - expecting USSD: - Your extension is 42342 - MSC <--RAN_GERAN_A-- MS: GSM0480_MTYPE_REGISTER -DREF MSISDN:42342: MSC conn use + dtap == 2 (0xa: dtap,cm_service) -DRLL Dispatching 04.08 message GSM0480_MTYPE_REGISTER (0xb:0x3b) -DMM Received SS/USSD data (trans_id=8, msg_type=GSM0480_MTYPE_REGISTER) -DMM -> (new transaction) -DCC (ti 08 sub MSISDN:42342 callref 20000005) New transaction -DREF VLR subscr MSISDN:42342 usage increases to: 3 -DREF MSISDN:42342: MSC conn use + trans_nc_ss == 3 (0x4a: dtap,cm_service,trans_nc_ss) -DMM MSISDN:42342: rx msg GSM0480_MTYPE_REGISTER: received_cm_service_request changes to false -DREF MSISDN:42342: MSC conn use - cm_service == 2 (0x42: dtap,trans_nc_ss) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING -DMM USSD: Own number requested -DMM MSISDN:42342: MSISDN = 42342 -DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM0480_MTYPE_RELEASE_COMPLETE: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d -- DTAP matches expected message -DREF VLR subscr MSISDN:42342 usage decreases to: 2 -DREF MSISDN:42342: MSC conn use - trans_nc_ss == 1 (0x2: dtap) -DREF MSISDN:42342: MSC conn use - dtap == 0 (0x0: ) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_UNUSED -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASING +- Concluding CM Service Request +DREF MSISDN:42342: MSC conn use - cm_service == 0 (0x0: ) +DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_UNUSED +DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASING DREF MSISDN:42342: MSC conn use + release == 1 (0x100: release) DREF VLR subscr MSISDN:42342 usage increases to: 3 DREF VLR subscr MSISDN:42342 usage decreases to: 2 @@ -1328,31 +1223,10 @@ DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: subscr_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request DREF MSISDN:42342: MSC conn use - dtap == 1 (0x8: cm_service) cm_service_result_sent == 1 -- a USSD request is serviced - expecting USSD: - Your extension is 42342 - MSC <--RAN_GERAN_A-- MS: GSM0480_MTYPE_REGISTER -DREF MSISDN:42342: MSC conn use + dtap == 2 (0xa: dtap,cm_service) -DRLL Dispatching 04.08 message GSM0480_MTYPE_REGISTER (0xb:0x3b) -DMM Received SS/USSD data (trans_id=8, msg_type=GSM0480_MTYPE_REGISTER) -DMM -> (new transaction) -DCC (ti 08 sub MSISDN:42342 callref 20000006) New transaction -DREF VLR subscr MSISDN:42342 usage increases to: 3 -DREF MSISDN:42342: MSC conn use + trans_nc_ss == 3 (0x4a: dtap,cm_service,trans_nc_ss) -DMM MSISDN:42342: rx msg GSM0480_MTYPE_REGISTER: received_cm_service_request changes to false -DREF MSISDN:42342: MSC conn use - cm_service == 2 (0x42: dtap,trans_nc_ss) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING -DMM USSD: Own number requested -DMM MSISDN:42342: MSISDN = 42342 -DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM0480_MTYPE_RELEASE_COMPLETE: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d -- DTAP matches expected message -DREF VLR subscr MSISDN:42342 usage decreases to: 2 -DREF MSISDN:42342: MSC conn use - trans_nc_ss == 1 (0x2: dtap) -DREF MSISDN:42342: MSC conn use - dtap == 0 (0x0: ) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_UNUSED -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASING +- Concluding CM Service Request +DREF MSISDN:42342: MSC conn use - cm_service == 0 (0x0: ) +DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_UNUSED +DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASING DREF MSISDN:42342: MSC conn use + release == 1 (0x100: release) DREF VLR subscr MSISDN:42342 usage increases to: 3 DREF VLR subscr MSISDN:42342 usage decreases to: 2 @@ -1443,31 +1317,10 @@ DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: subscr_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request DREF MSISDN:42342: MSC conn use - dtap == 1 (0x8: cm_service) cm_service_result_sent == 1 -- a USSD request is serviced - expecting USSD: - Your extension is 42342 - MSC <--RAN_GERAN_A-- MS: GSM0480_MTYPE_REGISTER -DREF MSISDN:42342: MSC conn use + dtap == 2 (0xa: dtap,cm_service) -DRLL Dispatching 04.08 message GSM0480_MTYPE_REGISTER (0xb:0x3b) -DMM Received SS/USSD data (trans_id=8, msg_type=GSM0480_MTYPE_REGISTER) -DMM -> (new transaction) -DCC (ti 08 sub MSISDN:42342 callref 20000007) New transaction -DREF VLR subscr MSISDN:42342 usage increases to: 3 -DREF MSISDN:42342: MSC conn use + trans_nc_ss == 3 (0x4a: dtap,cm_service,trans_nc_ss) -DMM MSISDN:42342: rx msg GSM0480_MTYPE_REGISTER: received_cm_service_request changes to false -DREF MSISDN:42342: MSC conn use - cm_service == 2 (0x42: dtap,trans_nc_ss) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING -DMM USSD: Own number requested -DMM MSISDN:42342: MSISDN = 42342 -DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM0480_MTYPE_RELEASE_COMPLETE: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d -- DTAP matches expected message -DREF VLR subscr MSISDN:42342 usage decreases to: 2 -DREF MSISDN:42342: MSC conn use - trans_nc_ss == 1 (0x2: dtap) -DREF MSISDN:42342: MSC conn use - dtap == 0 (0x0: ) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_UNUSED -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASING +- Concluding CM Service Request +DREF MSISDN:42342: MSC conn use - cm_service == 0 (0x0: ) +DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_UNUSED +DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASING DREF MSISDN:42342: MSC conn use + release == 1 (0x100: release) DREF VLR subscr MSISDN:42342 usage increases to: 3 DREF VLR subscr MSISDN:42342 usage decreases to: 2 @@ -1800,31 +1653,10 @@ DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_AUTH_CIPH}: state_chg to SUBSCR_CONN_S_ACCEPTED DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: subscr_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request cm_service_result_sent == 0 -- a USSD request is serviced - expecting USSD: - Your extension is 42342 - MSC <--RAN_UTRAN_IU-- MS: GSM0480_MTYPE_REGISTER -DREF MSISDN:42342: MSC conn use + dtap == 2 (0xa: dtap,cm_service) -DRLL Dispatching 04.08 message GSM0480_MTYPE_REGISTER (0xb:0x3b) -DMM Received SS/USSD data (trans_id=8, msg_type=GSM0480_MTYPE_REGISTER) -DMM -> (new transaction) -DCC (ti 08 sub MSISDN:42342 callref 20000008) New transaction -DREF VLR subscr MSISDN:42342 usage increases to: 3 -DREF MSISDN:42342: MSC conn use + trans_nc_ss == 3 (0x4a: dtap,cm_service,trans_nc_ss) -DMM MSISDN:42342: rx msg GSM0480_MTYPE_REGISTER: received_cm_service_request changes to false -DREF MSISDN:42342: MSC conn use - cm_service == 2 (0x42: dtap,trans_nc_ss) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING -DMM USSD: Own number requested -DMM MSISDN:42342: MSISDN = 42342 -DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_UTRAN_IU -- DTAP --RAN_UTRAN_IU--> MS: GSM0480_MTYPE_RELEASE_COMPLETE: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d -- DTAP matches expected message -DREF VLR subscr MSISDN:42342 usage decreases to: 2 -DREF MSISDN:42342: MSC conn use - trans_nc_ss == 1 (0x2: dtap) -DREF MSISDN:42342: MSC conn use - dtap == 0 (0x0: ) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_UNUSED -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASING +- Concluding CM Service Request +DREF MSISDN:42342: MSC conn use - cm_service == 0 (0x0: ) +DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_UNUSED +DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASING DREF MSISDN:42342: MSC conn use + release == 1 (0x100: release) DREF VLR subscr MSISDN:42342 usage increases to: 3 DREF VLR subscr MSISDN:42342 usage decreases to: 2 @@ -1928,31 +1760,10 @@ DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_AUTH_CIPH}: state_chg to SUBSCR_CONN_S_ACCEPTED DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: subscr_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request cm_service_result_sent == 0 -- a USSD request is serviced - expecting USSD: - Your extension is 42342 - MSC <--RAN_UTRAN_IU-- MS: GSM0480_MTYPE_REGISTER -DREF MSISDN:42342: MSC conn use + dtap == 2 (0xa: dtap,cm_service) -DRLL Dispatching 04.08 message GSM0480_MTYPE_REGISTER (0xb:0x3b) -DMM Received SS/USSD data (trans_id=8, msg_type=GSM0480_MTYPE_REGISTER) -DMM -> (new transaction) -DCC (ti 08 sub MSISDN:42342 callref 20000009) New transaction -DREF VLR subscr MSISDN:42342 usage increases to: 3 -DREF MSISDN:42342: MSC conn use + trans_nc_ss == 3 (0x4a: dtap,cm_service,trans_nc_ss) -DMM MSISDN:42342: rx msg GSM0480_MTYPE_REGISTER: received_cm_service_request changes to false -DREF MSISDN:42342: MSC conn use - cm_service == 2 (0x42: dtap,trans_nc_ss) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING -DMM USSD: Own number requested -DMM MSISDN:42342: MSISDN = 42342 -DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_UTRAN_IU -- DTAP --RAN_UTRAN_IU--> MS: GSM0480_MTYPE_RELEASE_COMPLETE: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d -- DTAP matches expected message -DREF VLR subscr MSISDN:42342 usage decreases to: 2 -DREF MSISDN:42342: MSC conn use - trans_nc_ss == 1 (0x2: dtap) -DREF MSISDN:42342: MSC conn use - dtap == 0 (0x0: ) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_UNUSED -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASING +- Concluding CM Service Request +DREF MSISDN:42342: MSC conn use - cm_service == 0 (0x0: ) +DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_UNUSED +DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASING DREF MSISDN:42342: MSC conn use + release == 1 (0x100: release) DREF VLR subscr MSISDN:42342 usage increases to: 3 DREF VLR subscr MSISDN:42342 usage decreases to: 2 @@ -2056,31 +1867,10 @@ DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_AUTH_CIPH}: state_chg to SUBSCR_CONN_S_ACCEPTED DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: subscr_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request cm_service_result_sent == 0 -- a USSD request is serviced - expecting USSD: - Your extension is 42342 - MSC <--RAN_UTRAN_IU-- MS: GSM0480_MTYPE_REGISTER -DREF MSISDN:42342: MSC conn use + dtap == 2 (0xa: dtap,cm_service) -DRLL Dispatching 04.08 message GSM0480_MTYPE_REGISTER (0xb:0x3b) -DMM Received SS/USSD data (trans_id=8, msg_type=GSM0480_MTYPE_REGISTER) -DMM -> (new transaction) -DCC (ti 08 sub MSISDN:42342 callref 2000000a) New transaction -DREF VLR subscr MSISDN:42342 usage increases to: 3 -DREF MSISDN:42342: MSC conn use + trans_nc_ss == 3 (0x4a: dtap,cm_service,trans_nc_ss) -DMM MSISDN:42342: rx msg GSM0480_MTYPE_REGISTER: received_cm_service_request changes to false -DREF MSISDN:42342: MSC conn use - cm_service == 2 (0x42: dtap,trans_nc_ss) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING -DMM USSD: Own number requested -DMM MSISDN:42342: MSISDN = 42342 -DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_UTRAN_IU -- DTAP --RAN_UTRAN_IU--> MS: GSM0480_MTYPE_RELEASE_COMPLETE: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d -- DTAP matches expected message -DREF VLR subscr MSISDN:42342 usage decreases to: 2 -DREF MSISDN:42342: MSC conn use - trans_nc_ss == 1 (0x2: dtap) -DREF MSISDN:42342: MSC conn use - dtap == 0 (0x0: ) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_UNUSED -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASING +- Concluding CM Service Request +DREF MSISDN:42342: MSC conn use - cm_service == 0 (0x0: ) +DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_UNUSED +DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASING DREF MSISDN:42342: MSC conn use + release == 1 (0x100: release) DREF VLR subscr MSISDN:42342 usage increases to: 3 DREF VLR subscr MSISDN:42342 usage decreases to: 2 @@ -2402,31 +2192,10 @@ DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: subscr_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request DREF MSISDN:42342: MSC conn use - dtap == 1 (0x8: cm_service) cm_service_result_sent == 1 -- a USSD request is serviced - expecting USSD: - Your extension is 42342 - MSC <--RAN_GERAN_A-- MS: GSM0480_MTYPE_REGISTER -DREF MSISDN:42342: MSC conn use + dtap == 2 (0xa: dtap,cm_service) -DRLL Dispatching 04.08 message GSM0480_MTYPE_REGISTER (0xb:0x3b) -DMM Received SS/USSD data (trans_id=8, msg_type=GSM0480_MTYPE_REGISTER) -DMM -> (new transaction) -DCC (ti 08 sub MSISDN:42342 callref 2000000b) New transaction -DREF VLR subscr MSISDN:42342 usage increases to: 3 -DREF MSISDN:42342: MSC conn use + trans_nc_ss == 3 (0x4a: dtap,cm_service,trans_nc_ss) -DMM MSISDN:42342: rx msg GSM0480_MTYPE_REGISTER: received_cm_service_request changes to false -DREF MSISDN:42342: MSC conn use - cm_service == 2 (0x42: dtap,trans_nc_ss) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING -DMM USSD: Own number requested -DMM MSISDN:42342: MSISDN = 42342 -DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM0480_MTYPE_RELEASE_COMPLETE: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d -- DTAP matches expected message -DREF VLR subscr MSISDN:42342 usage decreases to: 2 -DREF MSISDN:42342: MSC conn use - trans_nc_ss == 1 (0x2: dtap) -DREF MSISDN:42342: MSC conn use - dtap == 0 (0x0: ) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_UNUSED -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASING +- Concluding CM Service Request +DREF MSISDN:42342: MSC conn use - cm_service == 0 (0x0: ) +DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_UNUSED +DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASING DREF MSISDN:42342: MSC conn use + release == 1 (0x100: release) DREF VLR subscr MSISDN:42342 usage increases to: 3 DREF VLR subscr MSISDN:42342 usage decreases to: 2 @@ -2773,31 +2542,10 @@ DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_AUTH_CIPH}: state_chg to SUBSCR_CONN_S_ACCEPTED DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: subscr_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request cm_service_result_sent == 0 -- a USSD request is serviced - expecting USSD: - Your extension is 42342 - MSC <--RAN_UTRAN_IU-- MS: GSM0480_MTYPE_REGISTER -DREF MSISDN:42342: MSC conn use + dtap == 2 (0xa: dtap,cm_service) -DRLL Dispatching 04.08 message GSM0480_MTYPE_REGISTER (0xb:0x3b) -DMM Received SS/USSD data (trans_id=8, msg_type=GSM0480_MTYPE_REGISTER) -DMM -> (new transaction) -DCC (ti 08 sub MSISDN:42342 callref 2000000c) New transaction -DREF VLR subscr MSISDN:42342 usage increases to: 3 -DREF MSISDN:42342: MSC conn use + trans_nc_ss == 3 (0x4a: dtap,cm_service,trans_nc_ss) -DMM MSISDN:42342: rx msg GSM0480_MTYPE_REGISTER: received_cm_service_request changes to false -DREF MSISDN:42342: MSC conn use - cm_service == 2 (0x42: dtap,trans_nc_ss) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING -DMM USSD: Own number requested -DMM MSISDN:42342: MSISDN = 42342 -DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_UTRAN_IU -- DTAP --RAN_UTRAN_IU--> MS: GSM0480_MTYPE_RELEASE_COMPLETE: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d -- DTAP matches expected message -DREF VLR subscr MSISDN:42342 usage decreases to: 2 -DREF MSISDN:42342: MSC conn use - trans_nc_ss == 1 (0x2: dtap) -DREF MSISDN:42342: MSC conn use - dtap == 0 (0x0: ) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_UNUSED -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASING +- Concluding CM Service Request +DREF MSISDN:42342: MSC conn use - cm_service == 0 (0x0: ) +DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_UNUSED +DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASING DREF MSISDN:42342: MSC conn use + release == 1 (0x100: release) DREF VLR subscr MSISDN:42342 usage increases to: 3 DREF VLR subscr MSISDN:42342 usage decreases to: 2 diff --git a/tests/msc_vlr/msc_vlr_test_gsm_authen.c b/tests/msc_vlr/msc_vlr_test_gsm_authen.c index a863d90..6555fbd 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_authen.c +++ b/tests/msc_vlr/msc_vlr_test_gsm_authen.c @@ -114,12 +114,9 @@ ms_sends_msg("0554" "20bde240" /* 2nd vector's sres, s.a. */); VERBOSE_ASSERT(cm_service_result_sent, == RES_ACCEPT, "%d"); - btw("a USSD request is serviced"); - dtap_expect_tx_ussd("Your extension is 46071\r"); - expect_bssap_clear(); - ms_sends_msg("0b3b1c15a11302010002013b300b04010f0406aa510c061b017f0100"); - OSMO_ASSERT(dtap_tx_confirmed); - VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); + /* Release connection */ + expect_bssap_clear(RAN_GERAN_A); + conn_conclude_cm_service_req(g_conn, RAN_GERAN_A); btw("all requests serviced, conn has been released"); bss_sends_clear_complete(); @@ -335,12 +332,9 @@ ms_sends_msg("0554" "20bde240" /* 2nd vector's sres, s.a. */); VERBOSE_ASSERT(cm_service_result_sent, == RES_ACCEPT, "%d"); - btw("a USSD request is serviced"); - dtap_expect_tx_ussd("Your extension is 46071\r"); - expect_bssap_clear(); - ms_sends_msg("0b3b1c15a11302010002013b300b04010f0406aa510c061b017f0100"); - OSMO_ASSERT(dtap_tx_confirmed); - VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); + /* Release connection */ + expect_bssap_clear(RAN_GERAN_A); + conn_conclude_cm_service_req(g_conn, RAN_GERAN_A); btw("all requests serviced, conn has been released"); bss_sends_clear_complete(); @@ -833,12 +827,9 @@ ms_sends_msg("0554" "85aa3130"); /* 2nd vector's sres, s.a. */ VERBOSE_ASSERT(cm_service_result_sent, == RES_ACCEPT, "%d"); - btw("a USSD request is serviced"); - dtap_expect_tx_ussd("Your extension is 42342\r"); - expect_bssap_clear(); - ms_sends_msg("0b3b1c15a11302010002013b300b04010f0406aa510c061b017f0100"); - OSMO_ASSERT(dtap_tx_confirmed); - VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); + /* Release connection */ + expect_bssap_clear(RAN_GERAN_A); + conn_conclude_cm_service_req(g_conn, RAN_GERAN_A); btw("all requests serviced, conn has been released"); bss_sends_clear_complete(); diff --git a/tests/msc_vlr/msc_vlr_test_gsm_authen.err b/tests/msc_vlr/msc_vlr_test_gsm_authen.err index 22f5824..954934a 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_authen.err +++ b/tests/msc_vlr/msc_vlr_test_gsm_authen.err @@ -246,31 +246,10 @@ DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_ACCEPTED}: subscr_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request DREF MSISDN:46071: MSC conn use - dtap == 1 (0x8: cm_service) cm_service_result_sent == 1 -- a USSD request is serviced - expecting USSD: - Your extension is 46071 - MSC <--RAN_GERAN_A-- MS: GSM0480_MTYPE_REGISTER -DREF MSISDN:46071: MSC conn use + dtap == 2 (0xa: dtap,cm_service) -DRLL Dispatching 04.08 message GSM0480_MTYPE_REGISTER (0xb:0x3b) -DMM Received SS/USSD data (trans_id=8, msg_type=GSM0480_MTYPE_REGISTER) -DMM -> (new transaction) -DCC (ti 08 sub MSISDN:46071 callref 20000001) New transaction -DREF VLR subscr MSISDN:46071 usage increases to: 3 -DREF MSISDN:46071: MSC conn use + trans_nc_ss == 3 (0x4a: dtap,cm_service,trans_nc_ss) -DMM MSISDN:46071: rx msg GSM0480_MTYPE_REGISTER: received_cm_service_request changes to false -DREF MSISDN:46071: MSC conn use - cm_service == 2 (0x42: dtap,trans_nc_ss) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING -DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING -DMM USSD: Own number requested -DMM MSISDN:46071: MSISDN = 46071 -DMSC msc_tx 43 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM0480_MTYPE_RELEASE_COMPLETE: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d -- DTAP matches expected message -DREF VLR subscr MSISDN:46071 usage decreases to: 2 -DREF MSISDN:46071: MSC conn use - trans_nc_ss == 1 (0x2: dtap) -DREF MSISDN:46071: MSC conn use - dtap == 0 (0x0: ) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_UNUSED -DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASING +- Concluding CM Service Request +DREF MSISDN:46071: MSC conn use - cm_service == 0 (0x0: ) +DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_UNUSED +DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASING DREF MSISDN:46071: MSC conn use + release == 1 (0x100: release) DREF VLR subscr MSISDN:46071 usage increases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 @@ -754,31 +733,10 @@ DMM Subscr_Conn(CM_SERVICE_REQ:50462976){SUBSCR_CONN_S_ACCEPTED}: subscr_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request DREF MSISDN:46071: MSC conn use - dtap == 1 (0x8: cm_service) cm_service_result_sent == 1 -- a USSD request is serviced - expecting USSD: - Your extension is 46071 - MSC <--RAN_GERAN_A-- MS: GSM0480_MTYPE_REGISTER -DREF MSISDN:46071: MSC conn use + dtap == 2 (0xa: dtap,cm_service) -DRLL Dispatching 04.08 message GSM0480_MTYPE_REGISTER (0xb:0x3b) -DMM Received SS/USSD data (trans_id=8, msg_type=GSM0480_MTYPE_REGISTER) -DMM -> (new transaction) -DCC (ti 08 sub MSISDN:46071 callref 20000002) New transaction -DREF VLR subscr MSISDN:46071 usage increases to: 3 -DREF MSISDN:46071: MSC conn use + trans_nc_ss == 3 (0x4a: dtap,cm_service,trans_nc_ss) -DMM MSISDN:46071: rx msg GSM0480_MTYPE_REGISTER: received_cm_service_request changes to false -DREF MSISDN:46071: MSC conn use - cm_service == 2 (0x42: dtap,trans_nc_ss) -DMM Subscr_Conn(CM_SERVICE_REQ:50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING -DMM Subscr_Conn(CM_SERVICE_REQ:50462976){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING -DMM USSD: Own number requested -DMM MSISDN:46071: MSISDN = 46071 -DMSC msc_tx 43 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM0480_MTYPE_RELEASE_COMPLETE: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d -- DTAP matches expected message -DREF VLR subscr MSISDN:46071 usage decreases to: 2 -DREF MSISDN:46071: MSC conn use - trans_nc_ss == 1 (0x2: dtap) -DREF MSISDN:46071: MSC conn use - dtap == 0 (0x0: ) -DMM Subscr_Conn(CM_SERVICE_REQ:50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_UNUSED -DMM Subscr_Conn(CM_SERVICE_REQ:50462976){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASING +- Concluding CM Service Request +DREF MSISDN:46071: MSC conn use - cm_service == 0 (0x0: ) +DMM Subscr_Conn(CM_SERVICE_REQ:50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_UNUSED +DMM Subscr_Conn(CM_SERVICE_REQ:50462976){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASING DREF MSISDN:46071: MSC conn use + release == 1 (0x100: release) DREF VLR subscr MSISDN:46071 usage increases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 @@ -1886,31 +1844,10 @@ DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: subscr_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request DREF MSISDN:42342: MSC conn use - dtap == 1 (0x8: cm_service) cm_service_result_sent == 1 -- a USSD request is serviced - expecting USSD: - Your extension is 42342 - MSC <--RAN_GERAN_A-- MS: GSM0480_MTYPE_REGISTER -DREF MSISDN:42342: MSC conn use + dtap == 2 (0xa: dtap,cm_service) -DRLL Dispatching 04.08 message GSM0480_MTYPE_REGISTER (0xb:0x3b) -DMM Received SS/USSD data (trans_id=8, msg_type=GSM0480_MTYPE_REGISTER) -DMM -> (new transaction) -DCC (ti 08 sub MSISDN:42342 callref 20000003) New transaction -DREF VLR subscr MSISDN:42342 usage increases to: 3 -DREF MSISDN:42342: MSC conn use + trans_nc_ss == 3 (0x4a: dtap,cm_service,trans_nc_ss) -DMM MSISDN:42342: rx msg GSM0480_MTYPE_REGISTER: received_cm_service_request changes to false -DREF MSISDN:42342: MSC conn use - cm_service == 2 (0x42: dtap,trans_nc_ss) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING -DMM USSD: Own number requested -DMM MSISDN:42342: MSISDN = 42342 -DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM0480_MTYPE_RELEASE_COMPLETE: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d -- DTAP matches expected message -DREF VLR subscr MSISDN:42342 usage decreases to: 2 -DREF MSISDN:42342: MSC conn use - trans_nc_ss == 1 (0x2: dtap) -DREF MSISDN:42342: MSC conn use - dtap == 0 (0x0: ) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_UNUSED -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASING +- Concluding CM Service Request +DREF MSISDN:42342: MSC conn use - cm_service == 0 (0x0: ) +DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_UNUSED +DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASING DREF MSISDN:42342: MSC conn use + release == 1 (0x100: release) DREF VLR subscr MSISDN:42342 usage increases to: 3 DREF VLR subscr MSISDN:42342 usage decreases to: 2 diff --git a/tests/msc_vlr/msc_vlr_test_gsm_ciph.c b/tests/msc_vlr/msc_vlr_test_gsm_ciph.c index b426981..add9f7f 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_ciph.c +++ b/tests/msc_vlr/msc_vlr_test_gsm_ciph.c @@ -125,12 +125,9 @@ ms_sends_msg("0632"); VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); - btw("a USSD request is serviced"); - dtap_expect_tx_ussd("Your extension is 46071\r"); - expect_bssap_clear(); - ms_sends_msg("0b3b1c15a11302010002013b300b04010f0406aa510c061b017f0100"); - OSMO_ASSERT(dtap_tx_confirmed); - VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); + /* Release connection */ + expect_bssap_clear(RAN_GERAN_A); + conn_conclude_cm_service_req(g_conn, RAN_GERAN_A); btw("all requests serviced, conn has been released"); bss_sends_clear_complete(); @@ -368,12 +365,9 @@ ms_sends_msg("0632"); VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); - btw("a USSD request is serviced"); - dtap_expect_tx_ussd("Your extension is 46071\r"); - expect_bssap_clear(); - ms_sends_msg("0b3b1c15a11302010002013b300b04010f0406aa510c061b017f0100"); - OSMO_ASSERT(dtap_tx_confirmed); - VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); + /* Release connection */ + expect_bssap_clear(RAN_GERAN_A); + conn_conclude_cm_service_req(g_conn, RAN_GERAN_A); btw("all requests serviced, conn has been released"); bss_sends_clear_complete(); @@ -968,12 +962,9 @@ ms_sends_msg("0632"); VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); - btw("a USSD request is serviced"); - dtap_expect_tx_ussd("Your extension is 42342\r"); - expect_bssap_clear(); - ms_sends_msg("0b3b1c15a11302010002013b300b04010f0406aa510c061b017f0100"); - OSMO_ASSERT(dtap_tx_confirmed); - VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); + /* Release connection */ + expect_bssap_clear(RAN_GERAN_A); + conn_conclude_cm_service_req(g_conn, RAN_GERAN_A); btw("all requests serviced, conn has been released"); bss_sends_clear_complete(); diff --git a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err index e309c2e..83723ab 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err +++ b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err @@ -275,31 +275,10 @@ DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_AUTH_CIPH}: state_chg to SUBSCR_CONN_S_ACCEPTED DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_ACCEPTED}: subscr_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request cm_service_result_sent == 0 -- a USSD request is serviced - expecting USSD: - Your extension is 46071 - MSC <--RAN_GERAN_A-- MS: GSM0480_MTYPE_REGISTER -DREF MSISDN:46071: MSC conn use + dtap == 2 (0xa: dtap,cm_service) -DRLL Dispatching 04.08 message GSM0480_MTYPE_REGISTER (0xb:0x3b) -DMM Received SS/USSD data (trans_id=8, msg_type=GSM0480_MTYPE_REGISTER) -DMM -> (new transaction) -DCC (ti 08 sub MSISDN:46071 callref 20000001) New transaction -DREF VLR subscr MSISDN:46071 usage increases to: 3 -DREF MSISDN:46071: MSC conn use + trans_nc_ss == 3 (0x4a: dtap,cm_service,trans_nc_ss) -DMM MSISDN:46071: rx msg GSM0480_MTYPE_REGISTER: received_cm_service_request changes to false -DREF MSISDN:46071: MSC conn use - cm_service == 2 (0x42: dtap,trans_nc_ss) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING -DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING -DMM USSD: Own number requested -DMM MSISDN:46071: MSISDN = 46071 -DMSC msc_tx 43 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM0480_MTYPE_RELEASE_COMPLETE: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d -- DTAP matches expected message -DREF VLR subscr MSISDN:46071 usage decreases to: 2 -DREF MSISDN:46071: MSC conn use - trans_nc_ss == 1 (0x2: dtap) -DREF MSISDN:46071: MSC conn use - dtap == 0 (0x0: ) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_UNUSED -DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASING +- Concluding CM Service Request +DREF MSISDN:46071: MSC conn use - cm_service == 0 (0x0: ) +DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_UNUSED +DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASING DREF MSISDN:46071: MSC conn use + release == 1 (0x100: release) DREF VLR subscr MSISDN:46071 usage increases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 @@ -838,31 +817,10 @@ DMM Subscr_Conn(CM_SERVICE_REQ:50462976){SUBSCR_CONN_S_AUTH_CIPH}: state_chg to SUBSCR_CONN_S_ACCEPTED DMM Subscr_Conn(CM_SERVICE_REQ:50462976){SUBSCR_CONN_S_ACCEPTED}: subscr_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request cm_service_result_sent == 0 -- a USSD request is serviced - expecting USSD: - Your extension is 46071 - MSC <--RAN_GERAN_A-- MS: GSM0480_MTYPE_REGISTER -DREF MSISDN:46071: MSC conn use + dtap == 2 (0xa: dtap,cm_service) -DRLL Dispatching 04.08 message GSM0480_MTYPE_REGISTER (0xb:0x3b) -DMM Received SS/USSD data (trans_id=8, msg_type=GSM0480_MTYPE_REGISTER) -DMM -> (new transaction) -DCC (ti 08 sub MSISDN:46071 callref 20000002) New transaction -DREF VLR subscr MSISDN:46071 usage increases to: 3 -DREF MSISDN:46071: MSC conn use + trans_nc_ss == 3 (0x4a: dtap,cm_service,trans_nc_ss) -DMM MSISDN:46071: rx msg GSM0480_MTYPE_REGISTER: received_cm_service_request changes to false -DREF MSISDN:46071: MSC conn use - cm_service == 2 (0x42: dtap,trans_nc_ss) -DMM Subscr_Conn(CM_SERVICE_REQ:50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING -DMM Subscr_Conn(CM_SERVICE_REQ:50462976){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING -DMM USSD: Own number requested -DMM MSISDN:46071: MSISDN = 46071 -DMSC msc_tx 43 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM0480_MTYPE_RELEASE_COMPLETE: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d -- DTAP matches expected message -DREF VLR subscr MSISDN:46071 usage decreases to: 2 -DREF MSISDN:46071: MSC conn use - trans_nc_ss == 1 (0x2: dtap) -DREF MSISDN:46071: MSC conn use - dtap == 0 (0x0: ) -DMM Subscr_Conn(CM_SERVICE_REQ:50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_UNUSED -DMM Subscr_Conn(CM_SERVICE_REQ:50462976){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASING +- Concluding CM Service Request +DREF MSISDN:46071: MSC conn use - cm_service == 0 (0x0: ) +DMM Subscr_Conn(CM_SERVICE_REQ:50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_UNUSED +DMM Subscr_Conn(CM_SERVICE_REQ:50462976){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASING DREF MSISDN:46071: MSC conn use + release == 1 (0x100: release) DREF VLR subscr MSISDN:46071 usage increases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 @@ -2087,31 +2045,10 @@ DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_AUTH_CIPH}: state_chg to SUBSCR_CONN_S_ACCEPTED DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: subscr_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request cm_service_result_sent == 0 -- a USSD request is serviced - expecting USSD: - Your extension is 42342 - MSC <--RAN_GERAN_A-- MS: GSM0480_MTYPE_REGISTER -DREF MSISDN:42342: MSC conn use + dtap == 2 (0xa: dtap,cm_service) -DRLL Dispatching 04.08 message GSM0480_MTYPE_REGISTER (0xb:0x3b) -DMM Received SS/USSD data (trans_id=8, msg_type=GSM0480_MTYPE_REGISTER) -DMM -> (new transaction) -DCC (ti 08 sub MSISDN:42342 callref 20000003) New transaction -DREF VLR subscr MSISDN:42342 usage increases to: 3 -DREF MSISDN:42342: MSC conn use + trans_nc_ss == 3 (0x4a: dtap,cm_service,trans_nc_ss) -DMM MSISDN:42342: rx msg GSM0480_MTYPE_REGISTER: received_cm_service_request changes to false -DREF MSISDN:42342: MSC conn use - cm_service == 2 (0x42: dtap,trans_nc_ss) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING -DMM USSD: Own number requested -DMM MSISDN:42342: MSISDN = 42342 -DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM0480_MTYPE_RELEASE_COMPLETE: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d -- DTAP matches expected message -DREF VLR subscr MSISDN:42342 usage decreases to: 2 -DREF MSISDN:42342: MSC conn use - trans_nc_ss == 1 (0x2: dtap) -DREF MSISDN:42342: MSC conn use - dtap == 0 (0x0: ) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_UNUSED -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASING +- Concluding CM Service Request +DREF MSISDN:42342: MSC conn use - cm_service == 0 (0x0: ) +DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_UNUSED +DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASING DREF MSISDN:42342: MSC conn use + release == 1 (0x100: release) DREF VLR subscr MSISDN:42342 usage increases to: 3 DREF VLR subscr MSISDN:42342 usage decreases to: 2 diff --git a/tests/msc_vlr/msc_vlr_test_no_authen.c b/tests/msc_vlr/msc_vlr_test_no_authen.c index 85c01d9..afa03c3 100644 --- a/tests/msc_vlr/msc_vlr_test_no_authen.c +++ b/tests/msc_vlr/msc_vlr_test_no_authen.c @@ -72,12 +72,9 @@ VERBOSE_ASSERT(cm_service_result_sent, == RES_ACCEPT, "%d"); EXPECT_ACCEPTED(true); - btw("a USSD request is serviced"); - dtap_expect_tx_ussd("Your extension is 46071\r"); - expect_bssap_clear(); - ms_sends_msg("0b3b1c15a11302010002013b300b04010f0406aa510c061b017f0100"); - VERBOSE_ASSERT(dtap_tx_confirmed, == true, "%d"); - VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); + /* Release connection */ + expect_bssap_clear(RAN_GERAN_A); + conn_conclude_cm_service_req(g_conn, RAN_GERAN_A); btw("all requests serviced, conn has been released"); bss_sends_clear_complete(); @@ -238,11 +235,9 @@ VERBOSE_ASSERT(cm_service_result_sent, == RES_ACCEPT, "%d"); EXPECT_ACCEPTED(true); - btw("a USSD request is serviced"); - dtap_expect_tx_ussd("Your extension is 46071\r"); - expect_bssap_clear(); - ms_sends_msg("0b3b1c15a11302010002013b300b04010f0406aa510c061b017f0100"); - VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); + /* Release connection */ + expect_bssap_clear(RAN_GERAN_A); + conn_conclude_cm_service_req(g_conn, RAN_GERAN_A); btw("all requests serviced, conn has been released"); bss_sends_clear_complete(); diff --git a/tests/msc_vlr/msc_vlr_test_no_authen.err b/tests/msc_vlr/msc_vlr_test_no_authen.err index af80da2..0a36094 100644 --- a/tests/msc_vlr/msc_vlr_test_no_authen.err +++ b/tests/msc_vlr/msc_vlr_test_no_authen.err @@ -159,36 +159,14 @@ DREF MSISDN:46071: MSC conn use - compl_l3 == 1 (0x8: cm_service) cm_service_result_sent == 1 msc_subscr_conn_is_accepted() == true -- a USSD request is serviced - expecting USSD: - Your extension is 46071 - MSC <--RAN_GERAN_A-- MS: GSM0480_MTYPE_REGISTER -DREF MSISDN:46071: MSC conn use + dtap == 2 (0xa: dtap,cm_service) -DRLL Dispatching 04.08 message GSM0480_MTYPE_REGISTER (0xb:0x3b) -DMM Received SS/USSD data (trans_id=8, msg_type=GSM0480_MTYPE_REGISTER) -DMM -> (new transaction) -DCC (ti 08 sub MSISDN:46071 callref 20000001) New transaction -DREF VLR subscr MSISDN:46071 usage increases to: 3 -DREF MSISDN:46071: MSC conn use + trans_nc_ss == 3 (0x4a: dtap,cm_service,trans_nc_ss) -DMM MSISDN:46071: rx msg GSM0480_MTYPE_REGISTER: received_cm_service_request changes to false -DREF MSISDN:46071: MSC conn use - cm_service == 2 (0x42: dtap,trans_nc_ss) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING -DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING -DMM USSD: Own number requested -DMM MSISDN:46071: MSISDN = 46071 -DMSC msc_tx 43 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM0480_MTYPE_RELEASE_COMPLETE: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d -- DTAP matches expected message -DREF VLR subscr MSISDN:46071 usage decreases to: 2 -DREF MSISDN:46071: MSC conn use - trans_nc_ss == 1 (0x2: dtap) -DREF MSISDN:46071: MSC conn use - dtap == 0 (0x0: ) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_UNUSED -DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASING +- Concluding CM Service Request +DREF MSISDN:46071: MSC conn use - cm_service == 0 (0x0: ) +DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_UNUSED +DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASING DREF MSISDN:46071: MSC conn use + release == 1 (0x100: release) DREF VLR subscr MSISDN:46071 usage increases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 - BSSAP Clear --RAN_GERAN_A--> MS - dtap_tx_confirmed == 1 bssap_clear_sent == 1 - all requests serviced, conn has been released - BSS sends BSSMAP Clear Complete @@ -542,31 +520,10 @@ DREF MSISDN:46071: MSC conn use - compl_l3 == 1 (0x8: cm_service) cm_service_result_sent == 1 msc_subscr_conn_is_accepted() == true -- a USSD request is serviced - expecting USSD: - Your extension is 46071 - MSC <--RAN_GERAN_A-- MS: GSM0480_MTYPE_REGISTER -DREF MSISDN:46071: MSC conn use + dtap == 2 (0xa: dtap,cm_service) -DRLL Dispatching 04.08 message GSM0480_MTYPE_REGISTER (0xb:0x3b) -DMM Received SS/USSD data (trans_id=8, msg_type=GSM0480_MTYPE_REGISTER) -DMM -> (new transaction) -DCC (ti 08 sub MSISDN:46071 callref 20000002) New transaction -DREF VLR subscr MSISDN:46071 usage increases to: 3 -DREF MSISDN:46071: MSC conn use + trans_nc_ss == 3 (0x4a: dtap,cm_service,trans_nc_ss) -DMM MSISDN:46071: rx msg GSM0480_MTYPE_REGISTER: received_cm_service_request changes to false -DREF MSISDN:46071: MSC conn use - cm_service == 2 (0x42: dtap,trans_nc_ss) -DMM Subscr_Conn(CM_SERVICE_REQ:50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING -DMM Subscr_Conn(CM_SERVICE_REQ:50462976){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING -DMM USSD: Own number requested -DMM MSISDN:46071: MSISDN = 46071 -DMSC msc_tx 43 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM0480_MTYPE_RELEASE_COMPLETE: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d -- DTAP matches expected message -DREF VLR subscr MSISDN:46071 usage decreases to: 2 -DREF MSISDN:46071: MSC conn use - trans_nc_ss == 1 (0x2: dtap) -DREF MSISDN:46071: MSC conn use - dtap == 0 (0x0: ) -DMM Subscr_Conn(CM_SERVICE_REQ:50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_UNUSED -DMM Subscr_Conn(CM_SERVICE_REQ:50462976){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASING +- Concluding CM Service Request +DREF MSISDN:46071: MSC conn use - cm_service == 0 (0x0: ) +DMM Subscr_Conn(CM_SERVICE_REQ:50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_UNUSED +DMM Subscr_Conn(CM_SERVICE_REQ:50462976){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASING DREF MSISDN:46071: MSC conn use + release == 1 (0x100: release) DREF VLR subscr MSISDN:46071 usage increases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 diff --git a/tests/msc_vlr/msc_vlr_test_reject_concurrency.c b/tests/msc_vlr/msc_vlr_test_reject_concurrency.c index ea8c32c..580135a 100644 --- a/tests/msc_vlr/msc_vlr_test_reject_concurrency.c +++ b/tests/msc_vlr/msc_vlr_test_reject_concurrency.c @@ -313,11 +313,10 @@ EXPECT_CONN_COUNT(1); BTW("The original CM Service Request can conclude"); - btw("a USSD request is serviced"); - dtap_expect_tx_ussd("Your extension is 46071\r"); - expect_bssap_clear(); - ms_sends_msg("0b3b1c15a11302010002013b300b04010f0406aa510c061b017f0100"); - VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); + + /* Release connection */ + expect_bssap_clear(RAN_GERAN_A); + conn_conclude_cm_service_req(g_conn, RAN_GERAN_A); btw("all requests serviced, conn has been released"); bss_sends_clear_complete(); diff --git a/tests/msc_vlr/msc_vlr_test_reject_concurrency.err b/tests/msc_vlr/msc_vlr_test_reject_concurrency.err index 8221e78..39199ef 100644 --- a/tests/msc_vlr/msc_vlr_test_reject_concurrency.err +++ b/tests/msc_vlr/msc_vlr_test_reject_concurrency.err @@ -1115,31 +1115,10 @@ llist_count(&net->subscr_conns) == 1 --- - The original CM Service Request can conclude -- a USSD request is serviced - expecting USSD: - Your extension is 46071 - MSC <--RAN_GERAN_A-- MS: GSM0480_MTYPE_REGISTER -DREF MSISDN:46071: MSC conn use + dtap == 2 (0xa: dtap,cm_service) -DRLL Dispatching 04.08 message GSM0480_MTYPE_REGISTER (0xb:0x3b) -DMM Received SS/USSD data (trans_id=8, msg_type=GSM0480_MTYPE_REGISTER) -DMM -> (new transaction) -DCC (ti 08 sub MSISDN:46071 callref 20000001) New transaction -DREF VLR subscr MSISDN:46071 usage increases to: 3 -DREF MSISDN:46071: MSC conn use + trans_nc_ss == 3 (0x4a: dtap,cm_service,trans_nc_ss) -DMM MSISDN:46071: rx msg GSM0480_MTYPE_REGISTER: received_cm_service_request changes to false -DREF MSISDN:46071: MSC conn use - cm_service == 2 (0x42: dtap,trans_nc_ss) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING -DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING -DMM USSD: Own number requested -DMM MSISDN:46071: MSISDN = 46071 -DMSC msc_tx 43 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM0480_MTYPE_RELEASE_COMPLETE: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d -- DTAP matches expected message -DREF VLR subscr MSISDN:46071 usage decreases to: 2 -DREF MSISDN:46071: MSC conn use - trans_nc_ss == 1 (0x2: dtap) -DREF MSISDN:46071: MSC conn use - dtap == 0 (0x0: ) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_UNUSED -DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASING +- Concluding CM Service Request +DREF MSISDN:46071: MSC conn use - cm_service == 0 (0x0: ) +DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_UNUSED +DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASING DREF MSISDN:46071: MSC conn use + release == 1 (0x100: release) DREF VLR subscr MSISDN:46071 usage increases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 diff --git a/tests/msc_vlr/msc_vlr_test_ss.c b/tests/msc_vlr/msc_vlr_test_ss.c new file mode 100644 index 0000000..f3a1f68 --- /dev/null +++ b/tests/msc_vlr/msc_vlr_test_ss.c @@ -0,0 +1,122 @@ +/* + * Osmocom MSC+VLR end-to-end tests + * + * (C) 2018 by Vadim Yanitskiy + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include "msc_vlr_tests.h" + +#define IMSI "901700000004620" + +#define FACILITY_IE_REQ \ + "a113" /* Invoke component, len=19 */ \ + "020101" /* InvokeID=1 */ \ + "02013b" /* OpCode=GSM0480_OP_CODE_PROCESS_USS_REQ */ \ + "300b" /* Sequence tag, len=11 */ \ + "04010f" /* DCS: Default 7-bit alphabet */ \ + "0406aa510c061b01" /* USSD text: *#100#, len=6 */ + +#define FACILITY_IE_RSP \ + "a225" /* ReturnResult, len=37 */ \ + "020101" /* InvokeID=1 */ \ + "3020" /* Sequence tag, len=32 */ \ + "02013b" /* OpCode=GSM0480_OP_CODE_PROCESS_USS_REQ */ \ + "301b" /* Sequence tag, len=27 */ \ + "04010f" /* DCS: Default 7-bit alphabet */ \ + "0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d" + +static void perform_lu(void) +{ + struct vlr_subscr *vsub; + + btw("Location Update request causes a GSUP LU request to HLR"); + lu_result_sent = RES_NONE; + gsup_expect_tx("04010809710000004026f0"); + ms_sends_msg("050802008168000130089910070000006402"); + OSMO_ASSERT(gsup_tx_confirmed); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT"); + gsup_rx("10010809710000004026f00804036470f1", + "12010809710000004026f0"); + VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); + + btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT"); + expect_bssap_clear(); + gsup_rx("06010809710000004026f0", NULL); + + btw("LU was successful, and the conn has already been closed"); + VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d"); + VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); + + vsub = vlr_subscr_find_by_imsi(net->vlr, IMSI); + VERBOSE_ASSERT(vsub != NULL, == true, "%d"); + VERBOSE_ASSERT(strcmp(vsub->imsi, IMSI), == 0, "%d"); + VERBOSE_ASSERT(vsub->lac, == 23, "%u"); + vlr_subscr_put(vsub); + + bss_sends_clear_complete(); + EXPECT_CONN_COUNT(0); +} + +static void _test_ss_ussd(enum ran_type via_ran) +{ + /* TODO: UTRAN requires auth and ciph */ + rx_from_ran = via_ran; + + /* Perform Location Update */ + perform_lu(); + + BTW("after a while, a new conn sends a CM Service Request"); + + cm_service_result_sent = RES_NONE; + ms_sends_msg("05247803305886089910070000006402"); + OSMO_ASSERT(g_conn); + OSMO_ASSERT(g_conn->fi); + OSMO_ASSERT(g_conn->vsub); + VERBOSE_ASSERT(cm_service_result_sent, == RES_ACCEPT, "%d"); + EXPECT_ACCEPTED(true); + + /* MT: GSM 04.80 RELEASE COMPLETE with Facility IE */ + dtap_expect_tx("8b2a" "1c27" FACILITY_IE_RSP); + expect_release_clear(via_ran); + + /* MO: GSM 04.80 REGISTER with Facility IE and SS version IE */ + ms_sends_msg("0b7b" "1c15" FACILITY_IE_REQ "7f0100"); + VERBOSE_ASSERT(dtap_tx_confirmed, == true, "%d"); + ASSERT_RELEASE_CLEAR(via_ran); + + btw("all requests serviced, conn has been released"); + bss_sends_clear_complete(); + EXPECT_CONN_COUNT(0); +} + +static void test_ss_ussd_geran() +{ + comment_start(); + _test_ss_ussd(RAN_GERAN_A); + clear_vlr(); + comment_end(); +} + +msc_vlr_test_func_t msc_vlr_tests[] = { + /* TODO: UTRAN requires auth and enc */ + test_ss_ussd_geran, + NULL +}; diff --git a/tests/msc_vlr/msc_vlr_test_ss.err b/tests/msc_vlr/msc_vlr_test_ss.err new file mode 100644 index 0000000..c7f7711 --- /dev/null +++ b/tests/msc_vlr/msc_vlr_test_ss.err @@ -0,0 +1,206 @@ +full talloc report on 'msgb' (total 0 bytes in 1 blocks) +talloc_total_blocks(tall_bsc_ctx) == 12 + +===== test_ss_ussd_geran +- Location Update request causes a GSUP LU request to HLR + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST + new conn +DMM Subscr_Conn{SUBSCR_CONN_S_NEW}: Allocated +DREF unknown: MSC conn use + compl_l3 == 1 (0x1: compl_l3) +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) +DMM Subscr_Conn(LU:901700000004620){SUBSCR_CONN_S_NEW}: Updated ID +DMM LOCATION UPDATING REQUEST: MI(IMSI)=901700000004620 type=IMSI ATTACH +DMM LU/new-LAC: 1/23 +DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_IDLE}: Allocated +DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_IDLE}: is child of Subscr_Conn(LU:901700000004620) +DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_IDLE}: rev=GSM net=GERAN (no Auth) +DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA +DREF VLR subscr unknown usage increases to: 1 +DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 +DVLR New subscr, IMSI: 901700000004620 +DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 +DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() +DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() +DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() +DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node_4() +DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_HLR_UPD +DVLR upd_hlr_vlr_fsm(LU:901700000004620){UPD_HLR_VLR_S_INIT}: Allocated +DVLR upd_hlr_vlr_fsm(LU:901700000004620){UPD_HLR_VLR_S_INIT}: is child of vlr_lu_fsm(LU:901700000004620) +DVLR upd_hlr_vlr_fsm(LU:901700000004620){UPD_HLR_VLR_S_INIT}: Received Event UPD_HLR_VLR_E_START +DVLR GSUP tx: 04010809710000004026f0 +GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 +DVLR upd_hlr_vlr_fsm(LU:901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA +DMM Subscr_Conn(LU:901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_COMPLETE_LAYER_3 +DMM Subscr_Conn(LU:901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_AUTH_CIPH +DREF IMSI:901700000004620: MSC conn use - compl_l3 == 0 (0x0: ) +DMM Subscr_Conn(LU:901700000004620){SUBSCR_CONN_S_AUTH_CIPH}: Received Event SUBSCR_CONN_E_UNUSED +DMM Subscr_Conn(LU:901700000004620){SUBSCR_CONN_S_AUTH_CIPH}: Awaiting results for Auth+Ciph, overruling event SUBSCR_CONN_E_UNUSED + lu_result_sent == 0 +- HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: 10010809710000004026f00804036470f1 +DVLR GSUP rx 17: 10010809710000004026f00804036470f1 +DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DVLR IMSI:901700000004620 has MSISDN:46071 +DVLR SUBSCR(MSISDN:46071) VLR: update for IMSI=901700000004620 (MSISDN=46071, used=2) +DVLR GSUP tx: 12010809710000004026f0 +GSUP --> HLR: OSMO_GSUP_MSGT_INSERT_DATA_RESULT: 12010809710000004026f0 +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: vlr_gsupc_read_cb() returns 0 + lu_result_sent == 0 +- HLR also sends GSUP _UPDATE_LOCATION_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 +DVLR GSUP rx 11: 06010809710000004026f0 +DREF VLR subscr MSISDN:46071 usage increases to: 2 +DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_HLR_LU_RES +DVLR upd_hlr_vlr_fsm(LU:901700000004620){UPD_HLR_VLR_S_WAIT_FOR_DATA}: Received Event UPD_HLR_VLR_E_UPD_LOC_ACK +DVLR upd_hlr_vlr_fsm(LU:901700000004620){UPD_HLR_VLR_S_WAIT_FOR_DATA}: state_chg to UPD_HLR_VLR_S_DONE +DVLR upd_hlr_vlr_fsm(LU:901700000004620){UPD_HLR_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR upd_hlr_vlr_fsm(LU:901700000004620){UPD_HLR_VLR_S_DONE}: Removing from parent vlr_lu_fsm(LU:901700000004620) +DVLR upd_hlr_vlr_fsm(LU:901700000004620){UPD_HLR_VLR_S_DONE}: Freeing instance +DVLR upd_hlr_vlr_fsm(LU:901700000004620){UPD_HLR_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_UPD_HLR_COMPL +DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: state_chg to VLR_ULA_S_WAIT_LU_COMPL +DVLR lu_compl_vlr_fsm(LU:901700000004620){LU_COMPL_VLR_S_INIT}: Allocated +DVLR lu_compl_vlr_fsm(LU:901700000004620){LU_COMPL_VLR_S_INIT}: is child of vlr_lu_fsm(LU:901700000004620) +DVLR lu_compl_vlr_fsm(LU:901700000004620){LU_COMPL_VLR_S_INIT}: Received Event LU_COMPL_VLR_E_START +DVLR lu_compl_vlr_fsm(LU:901700000004620){LU_COMPL_VLR_S_INIT}: state_chg to LU_COMPL_VLR_S_WAIT_SUB_PRES +DVLR sub_pres_vlr_fsm(LU:901700000004620){SUB_PRES_VLR_S_INIT}: Allocated +DVLR sub_pres_vlr_fsm(LU:901700000004620){SUB_PRES_VLR_S_INIT}: is child of lu_compl_vlr_fsm(LU:901700000004620) +DVLR sub_pres_vlr_fsm(LU:901700000004620){SUB_PRES_VLR_S_INIT}: Received Event SUB_PRES_VLR_E_START +DVLR sub_pres_vlr_fsm(LU:901700000004620){SUB_PRES_VLR_S_INIT}: state_chg to SUB_PRES_VLR_S_DONE +DVLR sub_pres_vlr_fsm(LU:901700000004620){SUB_PRES_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR sub_pres_vlr_fsm(LU:901700000004620){SUB_PRES_VLR_S_DONE}: Removing from parent lu_compl_vlr_fsm(LU:901700000004620) +DVLR sub_pres_vlr_fsm(LU:901700000004620){SUB_PRES_VLR_S_DONE}: Freeing instance +DVLR sub_pres_vlr_fsm(LU:901700000004620){SUB_PRES_VLR_S_DONE}: Deallocated +DVLR lu_compl_vlr_fsm(LU:901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL +- sending LU Accept for MSISDN:46071 +DREF VLR subscr MSISDN:46071 usage increases to: 3 +DVLR lu_compl_vlr_fsm(LU:901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_DONE +DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_LU_COMPL_SUCCESS +DVLR lu_compl_vlr_fsm(LU:901700000004620){LU_COMPL_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR lu_compl_vlr_fsm(LU:901700000004620){LU_COMPL_VLR_S_DONE}: Removing from parent vlr_lu_fsm(LU:901700000004620) +DVLR lu_compl_vlr_fsm(LU:901700000004620){LU_COMPL_VLR_S_DONE}: Freeing instance +DVLR lu_compl_vlr_fsm(LU:901700000004620){LU_COMPL_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: state_chg to VLR_ULA_S_DONE +DMM Subscr_Conn(LU:901700000004620){SUBSCR_CONN_S_AUTH_CIPH}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(LU:901700000004620){SUBSCR_CONN_S_AUTH_CIPH}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(LU:901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_UNUSED +DMM Subscr_Conn(LU:901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASING +DREF MSISDN:46071: MSC conn use + release == 1 (0x100: release) +DREF VLR subscr MSISDN:46071 usage increases to: 4 +DREF VLR subscr MSISDN:46071 usage decreases to: 3 +- BSSAP Clear --RAN_GERAN_A--> MS +DREF VLR subscr MSISDN:46071 usage decreases to: 2 +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 +- LU was successful, and the conn has already been closed + lu_result_sent == 1 + bssap_clear_sent == 1 +DREF VLR subscr MSISDN:46071 usage increases to: 3 + vsub != NULL == 1 + strcmp(vsub->imsi, IMSI) == 0 + vsub->lac == 23 +DREF VLR subscr MSISDN:46071 usage decreases to: 2 +- BSS sends BSSMAP Clear Complete +DREF MSISDN:46071: MSC conn use - release == 0 (0x0: ) +DMM Subscr_Conn(LU:901700000004620){SUBSCR_CONN_S_RELEASING}: Received Event SUBSCR_CONN_E_UNUSED +DMM Subscr_Conn(LU:901700000004620){SUBSCR_CONN_S_RELEASING}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(LU:901700000004620){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_DONE}: Removing from parent Subscr_Conn(LU:901700000004620) +DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_DONE}: fsm_lu_cleanup called with cause OSMO_FSM_TERM_PARENT +DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_DONE}: Freeing instance +DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_DONE}: Deallocated +DRLL MSISDN:46071: Freeing subscriber connection +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +DMM Subscr_Conn(LU:901700000004620){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(LU:901700000004620){SUBSCR_CONN_S_RELEASED}: Deallocated + llist_count(&net->subscr_conns) == 0 +--- +- after a while, a new conn sends a CM Service Request + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_CM_SERV_REQ + new conn +DMM Subscr_Conn{SUBSCR_CONN_S_NEW}: Allocated +DREF unknown: MSC conn use + compl_l3 == 1 (0x1: compl_l3) +DRLL Dispatching 04.08 message GSM48_MT_MM_CM_SERV_REQ (0x5:0x24) +DMM <- CM SERVICE REQUEST serv_type=0x08 MI(IMSI)=901700000004620 +DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_NEW}: Updated ID +DVLR Process_Access_Request_VLR(CM_SERVICE_REQ:901700000004620){PR_ARQ_S_INIT}: Allocated +DVLR Process_Access_Request_VLR(CM_SERVICE_REQ:901700000004620){PR_ARQ_S_INIT}: is child of Subscr_Conn(CM_SERVICE_REQ:901700000004620) +DVLR Process_Access_Request_VLR(CM_SERVICE_REQ:901700000004620){PR_ARQ_S_INIT}: rev=GSM net=GERAN (no Auth) +DVLR Process_Access_Request_VLR(CM_SERVICE_REQ:901700000004620){PR_ARQ_S_INIT}: Received Event PR_ARQ_E_START +DREF VLR subscr MSISDN:46071 usage increases to: 2 +DREF VLR subscr MSISDN:46071 usage increases to: 3 +DVLR Process_Access_Request_VLR(CM_SERVICE_REQ:901700000004620){PR_ARQ_S_INIT}: proc_arq_vlr_fn_post_imsi() +DVLR Process_Access_Request_VLR(CM_SERVICE_REQ:901700000004620){PR_ARQ_S_INIT}: _proc_arq_vlr_node2() +DVLR Process_Access_Request_VLR(CM_SERVICE_REQ:901700000004620){PR_ARQ_S_INIT}: _proc_arq_vlr_node2_post_ciph() +DVLR Process_Access_Request_VLR(CM_SERVICE_REQ:901700000004620){PR_ARQ_S_INIT}: _proc_arq_vlr_node2_post_vlr() +DVLR Process_Access_Request_VLR(CM_SERVICE_REQ:901700000004620){PR_ARQ_S_INIT}: _proc_arq_vlr_post_pres() +DVLR Process_Access_Request_VLR(CM_SERVICE_REQ:901700000004620){PR_ARQ_S_INIT}: _proc_arq_vlr_post_trace() +DVLR Process_Access_Request_VLR(CM_SERVICE_REQ:901700000004620){PR_ARQ_S_INIT}: _proc_arq_vlr_post_imei() +DVLR Process_Access_Request_VLR(CM_SERVICE_REQ:901700000004620){PR_ARQ_S_INIT}: proc_arq_fsm_done(PASSED) +DVLR Process_Access_Request_VLR(CM_SERVICE_REQ:901700000004620){PR_ARQ_S_INIT}: state_chg to PR_ARQ_S_DONE +DVLR Process_Access_Request_VLR(CM_SERVICE_REQ:901700000004620){PR_ARQ_S_DONE}: Process Access Request result: PASSED +- sending CM Service Accept for MSISDN:46071 +DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DREF MSISDN:46071: MSC conn use + cm_service == 2 (0x9: compl_l3,cm_service) +DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_ACCEPTED}: subscr_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request +DREF VLR subscr MSISDN:46071 usage decreases to: 2 +DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMPLETE_LAYER_3 +DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_ACCEPTED}: Event SUBSCR_CONN_E_COMPLETE_LAYER_3 not permitted +DREF MSISDN:46071: MSC conn use - compl_l3 == 1 (0x8: cm_service) + cm_service_result_sent == 1 +msc_subscr_conn_is_accepted() == true + MSC <--RAN_GERAN_A-- MS: GSM0480_MTYPE_REGISTER +DREF MSISDN:46071: MSC conn use + dtap == 2 (0xa: dtap,cm_service) +DRLL Dispatching 04.08 message GSM0480_MTYPE_REGISTER (0xb:0x3b) +DMM Received SS/USSD data (trans_id=8, msg_type=GSM0480_MTYPE_REGISTER) +DMM -> (new transaction) +DCC (ti 08 sub MSISDN:46071 callref 20000001) New transaction +DREF VLR subscr MSISDN:46071 usage increases to: 3 +DREF MSISDN:46071: MSC conn use + trans_nc_ss == 3 (0x4a: dtap,cm_service,trans_nc_ss) +DMM MSISDN:46071: rx msg GSM0480_MTYPE_REGISTER: received_cm_service_request changes to false +DREF MSISDN:46071: MSC conn use - cm_service == 2 (0x42: dtap,trans_nc_ss) +DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING +DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING +DMM USSD: Own number requested +DMM MSISDN:46071: MSISDN = 46071 +DMSC msc_tx 43 bytes to MSISDN:46071 via RAN_GERAN_A +- DTAP --RAN_GERAN_A--> MS: GSM0480_MTYPE_RELEASE_COMPLETE: 8b2a1c27a225020101302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP matches expected message +DREF VLR subscr MSISDN:46071 usage decreases to: 2 +DREF MSISDN:46071: MSC conn use - trans_nc_ss == 1 (0x2: dtap) +DREF MSISDN:46071: MSC conn use - dtap == 0 (0x0: ) +DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_UNUSED +DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASING +DREF MSISDN:46071: MSC conn use + release == 1 (0x100: release) +DREF VLR subscr MSISDN:46071 usage increases to: 3 +DREF VLR subscr MSISDN:46071 usage decreases to: 2 +- BSSAP Clear --RAN_GERAN_A--> MS + dtap_tx_confirmed == 1 + bssap_clear_sent == 1 +- all requests serviced, conn has been released +- BSS sends BSSMAP Clear Complete +DREF MSISDN:46071: MSC conn use - release == 0 (0x0: ) +DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_RELEASING}: Received Event SUBSCR_CONN_E_UNUSED +DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_RELEASING}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR Process_Access_Request_VLR(CM_SERVICE_REQ:901700000004620){PR_ARQ_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR Process_Access_Request_VLR(CM_SERVICE_REQ:901700000004620){PR_ARQ_S_DONE}: Removing from parent Subscr_Conn(CM_SERVICE_REQ:901700000004620) +DVLR Process_Access_Request_VLR(CM_SERVICE_REQ:901700000004620){PR_ARQ_S_DONE}: Freeing instance +DVLR Process_Access_Request_VLR(CM_SERVICE_REQ:901700000004620){PR_ARQ_S_DONE}: Deallocated +DRLL MSISDN:46071: Freeing subscriber connection +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_RELEASED}: Deallocated + llist_count(&net->subscr_conns) == 0 +DREF freeing VLR subscr MSISDN:46071 +===== test_ss_ussd_geran: SUCCESS + +full talloc report on 'msgb' (total 0 bytes in 1 blocks) +talloc_total_blocks(tall_bsc_ctx) == 12 + +full talloc report on 'msgb' (total 0 bytes in 1 blocks) +talloc_total_blocks(tall_bsc_ctx) == 12 + diff --git a/tests/msc_vlr/msc_vlr_test_ss.ok b/tests/msc_vlr/msc_vlr_test_ss.ok new file mode 100644 index 0000000..a965a70 --- /dev/null +++ b/tests/msc_vlr/msc_vlr_test_ss.ok @@ -0,0 +1 @@ +Done diff --git a/tests/msc_vlr/msc_vlr_test_umts_authen.c b/tests/msc_vlr/msc_vlr_test_umts_authen.c index 42d406c..03f516f 100644 --- a/tests/msc_vlr/msc_vlr_test_umts_authen.c +++ b/tests/msc_vlr/msc_vlr_test_umts_authen.c @@ -211,12 +211,9 @@ VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); } - btw("a USSD request is serviced"); - dtap_expect_tx_ussd("Your extension is 42342\r"); + /* Release connection */ expect_release_clear(via_ran); - ms_sends_msg("0b3b1c15a11302010002013b300b04010f0406aa510c061b017f0100"); - OSMO_ASSERT(dtap_tx_confirmed); - ASSERT_RELEASE_CLEAR(via_ran); + conn_conclude_cm_service_req(g_conn, via_ran); bss_rnc_sends_release_clear_complete(via_ran); btw("all requests serviced, conn has been released"); diff --git a/tests/msc_vlr/msc_vlr_test_umts_authen.err b/tests/msc_vlr/msc_vlr_test_umts_authen.err index fcaaa97..4a060af 100644 --- a/tests/msc_vlr/msc_vlr_test_umts_authen.err +++ b/tests/msc_vlr/msc_vlr_test_umts_authen.err @@ -259,31 +259,10 @@ DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: subscr_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request DREF MSISDN:42342: MSC conn use - dtap == 1 (0x8: cm_service) cm_service_result_sent == 1 -- a USSD request is serviced - expecting USSD: - Your extension is 42342 - MSC <--RAN_GERAN_A-- MS: GSM0480_MTYPE_REGISTER -DREF MSISDN:42342: MSC conn use + dtap == 2 (0xa: dtap,cm_service) -DRLL Dispatching 04.08 message GSM0480_MTYPE_REGISTER (0xb:0x3b) -DMM Received SS/USSD data (trans_id=8, msg_type=GSM0480_MTYPE_REGISTER) -DMM -> (new transaction) -DCC (ti 08 sub MSISDN:42342 callref 20000001) New transaction -DREF VLR subscr MSISDN:42342 usage increases to: 3 -DREF MSISDN:42342: MSC conn use + trans_nc_ss == 3 (0x4a: dtap,cm_service,trans_nc_ss) -DMM MSISDN:42342: rx msg GSM0480_MTYPE_REGISTER: received_cm_service_request changes to false -DREF MSISDN:42342: MSC conn use - cm_service == 2 (0x42: dtap,trans_nc_ss) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING -DMM USSD: Own number requested -DMM MSISDN:42342: MSISDN = 42342 -DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM0480_MTYPE_RELEASE_COMPLETE: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d -- DTAP matches expected message -DREF VLR subscr MSISDN:42342 usage decreases to: 2 -DREF MSISDN:42342: MSC conn use - trans_nc_ss == 1 (0x2: dtap) -DREF MSISDN:42342: MSC conn use - dtap == 0 (0x0: ) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_UNUSED -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASING +- Concluding CM Service Request +DREF MSISDN:42342: MSC conn use - cm_service == 0 (0x0: ) +DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_UNUSED +DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASING DREF MSISDN:42342: MSC conn use + release == 1 (0x100: release) DREF VLR subscr MSISDN:42342 usage increases to: 3 DREF VLR subscr MSISDN:42342 usage decreases to: 2 @@ -770,31 +749,10 @@ DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_AUTH_CIPH}: state_chg to SUBSCR_CONN_S_ACCEPTED DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: subscr_conn_fsm_has_active_transactions: still awaiting first request after a CM Service Request cm_service_result_sent == 0 -- a USSD request is serviced - expecting USSD: - Your extension is 42342 - MSC <--RAN_UTRAN_IU-- MS: GSM0480_MTYPE_REGISTER -DREF MSISDN:42342: MSC conn use + dtap == 2 (0xa: dtap,cm_service) -DRLL Dispatching 04.08 message GSM0480_MTYPE_REGISTER (0xb:0x3b) -DMM Received SS/USSD data (trans_id=8, msg_type=GSM0480_MTYPE_REGISTER) -DMM -> (new transaction) -DCC (ti 08 sub MSISDN:42342 callref 20000002) New transaction -DREF VLR subscr MSISDN:42342 usage increases to: 3 -DREF MSISDN:42342: MSC conn use + trans_nc_ss == 3 (0x4a: dtap,cm_service,trans_nc_ss) -DMM MSISDN:42342: rx msg GSM0480_MTYPE_REGISTER: received_cm_service_request changes to false -DREF MSISDN:42342: MSC conn use - cm_service == 2 (0x42: dtap,trans_nc_ss) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING -DMM USSD: Own number requested -DMM MSISDN:42342: MSISDN = 42342 -DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_UTRAN_IU -- DTAP --RAN_UTRAN_IU--> MS: GSM0480_MTYPE_RELEASE_COMPLETE: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d -- DTAP matches expected message -DREF VLR subscr MSISDN:42342 usage decreases to: 2 -DREF MSISDN:42342: MSC conn use - trans_nc_ss == 1 (0x2: dtap) -DREF MSISDN:42342: MSC conn use - dtap == 0 (0x0: ) -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_UNUSED -DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASING +- Concluding CM Service Request +DREF MSISDN:42342: MSC conn use - cm_service == 0 (0x0: ) +DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_UNUSED +DMM Subscr_Conn(CM_SERVICE_REQ:901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASING DREF MSISDN:42342: MSC conn use + release == 1 (0x100: release) DREF VLR subscr MSISDN:42342 usage increases to: 3 DREF VLR subscr MSISDN:42342 usage decreases to: 2 diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index 8910e32..b38bfe0 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -138,22 +138,6 @@ dtap_tx_confirmed = false; } -void dtap_expect_tx_ussd(char *ussd_text) -{ - uint8_t ussd_enc[128]; - int len; - /* header */ - char ussd_msg_hex[128] = "8b2a1c27a225020100302002013b301b04010f0416"; - - log("expecting USSD:\n %s", ussd_text); - /* append encoded USSD text */ - gsm_7bit_encode_n_ussd(ussd_enc, sizeof(ussd_enc), ussd_text, - &len); - strncat(ussd_msg_hex, osmo_hexdump_nospc(ussd_enc, len), - sizeof(ussd_msg_hex) - strlen(ussd_msg_hex)); - dtap_expect_tx(ussd_msg_hex); -} - int vlr_gsupc_read_cb(struct gsup_client *gsupc, struct msgb *msg); void gsup_rx(const char *rx_hex, const char *expect_tx_hex) @@ -186,6 +170,21 @@ return false; } +/* Simplified version of the cm_service_request_concludes() */ +void conn_conclude_cm_service_req(struct gsm_subscriber_connection *conn, + enum ran_type via_ran) +{ + btw("Concluding CM Service Request"); + + OSMO_ASSERT(conn); + OSMO_ASSERT(conn->received_cm_service_request); + + conn->received_cm_service_request = false; + msc_subscr_conn_put(conn, MSC_CONN_USE_CM_SERVICE); + + ASSERT_RELEASE_CLEAR(via_ran); +} + enum ran_type rx_from_ran = RAN_GERAN_A; struct gsm_subscriber_connection *conn_new(void) diff --git a/tests/msc_vlr/msc_vlr_tests.h b/tests/msc_vlr/msc_vlr_tests.h index a62cffa..4ca05d2 100644 --- a/tests/msc_vlr/msc_vlr_tests.h +++ b/tests/msc_vlr/msc_vlr_tests.h @@ -153,6 +153,8 @@ void clear_vlr(); bool conn_exists(struct gsm_subscriber_connection *conn); +void conn_conclude_cm_service_req(struct gsm_subscriber_connection *conn, + enum ran_type via_ran); void dtap_expect_tx(const char *hex); void dtap_expect_tx_ussd(char *ussd_text); diff --git a/tests/testsuite.at b/tests/testsuite.at index 5307899..f27b60c 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -92,3 +92,10 @@ cat $abs_srcdir/msc_vlr/msc_vlr_test_rest.err > experr AT_CHECK([$abs_top_builddir/tests/msc_vlr/msc_vlr_test_rest], [], [expout], [experr]) AT_CLEANUP + +AT_SETUP([msc_vlr_test_ss]) +AT_KEYWORDS([msc_vlr_test_ss]) +cat $abs_srcdir/msc_vlr/msc_vlr_test_ss.ok > expout +cat $abs_srcdir/msc_vlr/msc_vlr_test_ss.err > experr +AT_CHECK([$abs_top_builddir/tests/msc_vlr/msc_vlr_test_ss], [], [expout], [experr]) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/9657 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I40b4caac3113263f5a06c861dff5e10d43c319b5 Gerrit-Change-Number: 9657 Gerrit-PatchSet: 5 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 29 14:39:45 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 29 Jul 2018 14:39:45 +0000 Subject: Change in osmo-msc[master]: libvlr/vlr.c: forward unhandled GSUP messages towards MSC In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9656 ) Change subject: libvlr/vlr.c: forward unhandled GSUP messages towards MSC ...................................................................... libvlr/vlr.c: forward unhandled GSUP messages towards MSC Some internal sub-systems, such as SS/USSD or SMS implementation, may also need to use GSUP connection with HLR. Previously, it was only available within the libvlr code, and nowhere else. Let's introduce the generic GSUP message router, which will receive messages unhandled by VLR itself, and route them to a handler depending on the message type. Change-Id: Ib8146ce5788c8f249dcaa39d61bd0388574bf892 --- M include/osmocom/msc/vlr.h M src/libmsc/gsm_04_08.c M src/libvlr/vlr.c 3 files changed, 20 insertions(+), 4 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmocom/msc/vlr.h b/include/osmocom/msc/vlr.h index f12d758..b54aa55 100644 --- a/include/osmocom/msc/vlr.h +++ b/include/osmocom/msc/vlr.h @@ -8,6 +8,7 @@ #include #include #include +#include #include // for GSM_NAME_LENGTH #include @@ -226,6 +227,9 @@ /* notify MSC/SGSN that the given subscriber has been associated * with this msc_conn_ref */ void (*subscr_assoc)(void *msc_conn_ref, struct vlr_subscr *vsub); + + /* Forward a parsed GSUP message towards MSC message router */ + int (*forward_gsup_msg)(struct vlr_subscr *vsub, struct osmo_gsup_message *gsup_msg); }; enum vlr_timer { diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index f81a6fa..c10a701 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -1698,6 +1698,18 @@ conn->vsub->cs.attached_via_ran = conn->via_ran; } +static int msc_vlr_route_gsup_msg(struct vlr_subscr *vsub, + struct osmo_gsup_message *gsup_msg) +{ + switch (gsup_msg->message_type) { + /* Nowhere to route for now */ + default: + LOGP(DMM, LOGL_ERROR, "No handler found for %s, dropping message...\n", + osmo_gsup_message_type_name(gsup_msg->message_type)); + return -GMM_CAUSE_MSGT_NOTEXIST_NOTIMPL; + } +} + /* operations that we need to implement for libvlr */ static const struct vlr_ops msc_vlr_ops = { .tx_auth_req = msc_vlr_tx_auth_req, @@ -1712,6 +1724,7 @@ .tx_mm_info = msc_vlr_tx_mm_info, .subscr_update = msc_vlr_subscr_update, .subscr_assoc = msc_vlr_subscr_assoc, + .forward_gsup_msg = msc_vlr_route_gsup_msg, }; /* Allocate net->vlr so that the VTY may configure the VLR's data structures */ diff --git a/src/libvlr/vlr.c b/src/libvlr/vlr.c index cff2e12..2f7dc30 100644 --- a/src/libvlr/vlr.c +++ b/src/libvlr/vlr.c @@ -1042,10 +1042,8 @@ rc = -GMM_CAUSE_MSGT_NOTEXIST_NOTIMPL; break; default: - LOGVSUBP(LOGL_ERROR, vsub, - "Rx GSUP msg_type=%d not valid at VLR/SGSN side\n", - gsup.message_type); - rc = -GMM_CAUSE_MSGT_NOTEXIST_NOTIMPL; + /* Forward message towards MSC */ + rc = vlr->ops.forward_gsup_msg(vsub, &gsup); break; } @@ -1192,6 +1190,7 @@ OSMO_ASSERT(ops->tx_common_id); OSMO_ASSERT(ops->subscr_update); OSMO_ASSERT(ops->subscr_assoc); + OSMO_ASSERT(ops->forward_gsup_msg); INIT_LLIST_HEAD(&vlr->subscribers); INIT_LLIST_HEAD(&vlr->operations); -- To view, visit https://gerrit.osmocom.org/9656 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ib8146ce5788c8f249dcaa39d61bd0388574bf892 Gerrit-Change-Number: 9656 Gerrit-PatchSet: 5 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Sun Jul 29 15:13:43 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Sun, 29 Jul 2018 15:13:43 +0000 (UTC) Subject: =?UTF-8?Q?Jenkins_build_is_back_to_normal_:_master-asn1c_=C2=BB_a1=3Dde?= =?UTF-8?Q?fault,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#199?= In-Reply-To: <1162022103.105.1532790607108.JavaMail.jenkins@jenkins.osmocom.org> References: <1162022103.105.1532790607108.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <550605736.112.1532877223257.JavaMail.jenkins@jenkins.osmocom.org> See From admin at opensuse.org Sun Jul 29 20:01:21 2018 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Jul 2018 20:01:21 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <5b5e1d1be9031_72527646848936cf@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 102s] ^ [ 102s] handover_fsm.c:489:4: error: format not a string literal and no format arguments [-Werror=format-security] [ 103s] cc1: some warnings being treated as errors [ 103s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 103s] make[4]: *** [handover_fsm.o] Error 1 [ 103s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 103s] Makefile:407: recipe for target 'all-recursive' failed [ 103s] make[3]: *** [all-recursive] Error 1 [ 103s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 103s] Makefile:441: recipe for target 'all-recursive' failed [ 103s] make[2]: *** [all-recursive] Error 1 [ 103s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 103s] Makefile:373: recipe for target 'all' failed [ 103s] make[1]: *** [all] Error 2 [ 103s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 103s] dh_auto_build: make -j1 returned exit code 2 [ 103s] debian/rules:45: recipe for target 'build' failed [ 103s] make: *** [build] Error 2 [ 103s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 103s] [ 103s] build33 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:01:14 UTC 2018. [ 103s] [ 103s] ### VM INTERACTION START ### [ 106s] [ 93.136312] sysrq: SysRq : Power Off [ 106s] [ 93.139194] reboot: Power down [ 107s] ### VM INTERACTION END ### [ 107s] [ 107s] build33 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:01:18 UTC 2018. [ 107s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jul 29 20:01:21 2018 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Jul 2018 20:01:21 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <5b5e1d1c351b8_7252764684893734@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 102s] ^ [ 102s] handover_fsm.c:489:4: error: format not a string literal and no format arguments [-Werror=format-security] [ 103s] cc1: some warnings being treated as errors [ 103s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 103s] make[4]: *** [handover_fsm.o] Error 1 [ 103s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 103s] Makefile:407: recipe for target 'all-recursive' failed [ 103s] make[3]: *** [all-recursive] Error 1 [ 103s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 103s] Makefile:441: recipe for target 'all-recursive' failed [ 103s] make[2]: *** [all-recursive] Error 1 [ 103s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 103s] Makefile:373: recipe for target 'all' failed [ 103s] make[1]: *** [all] Error 2 [ 103s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 103s] dh_auto_build: make -j1 returned exit code 2 [ 103s] debian/rules:45: recipe for target 'build' failed [ 103s] make: *** [build] Error 2 [ 103s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 103s] [ 103s] build33 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:01:14 UTC 2018. [ 103s] [ 103s] ### VM INTERACTION START ### [ 106s] [ 93.136312] sysrq: SysRq : Power Off [ 106s] [ 93.139194] reboot: Power down [ 107s] ### VM INTERACTION END ### [ 107s] [ 107s] build33 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:01:18 UTC 2018. [ 107s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jul 29 20:01:38 2018 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Jul 2018 20:01:38 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_17.10/i586 In-Reply-To: References: Message-ID: <5b5e1d37837ca_725276468489397c@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_17.10/i586 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_17.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 127s] gsm0808_cell_id_name(&req->cell_id_target)); [ 127s] ^~~~~~~~~~~~~~~~~~~~ [ 128s] cc1: some warnings being treated as errors [ 128s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 128s] make[4]: *** [handover_fsm.o] Error 1 [ 128s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 128s] Makefile:407: recipe for target 'all-recursive' failed [ 128s] make[3]: *** [all-recursive] Error 1 [ 128s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 128s] Makefile:441: recipe for target 'all-recursive' failed [ 128s] make[2]: *** [all-recursive] Error 1 [ 128s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 128s] Makefile:373: recipe for target 'all' failed [ 128s] make[1]: *** [all] Error 2 [ 128s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 128s] dh_auto_build: make -j1 returned exit code 2 [ 128s] debian/rules:45: recipe for target 'build' failed [ 128s] make: *** [build] Error 2 [ 128s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 128s] [ 128s] cloud115 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:01:21 UTC 2018. [ 128s] [ 128s] ### VM INTERACTION START ### [ 131s] [ 110.899077] sysrq: SysRq : Power Off [ 131s] [ 110.919048] reboot: Power down [ 133s] ### VM INTERACTION END ### [ 133s] [ 133s] cloud115 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:01:27 UTC 2018. [ 133s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jul 29 20:01:38 2018 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Jul 2018 20:01:38 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_17.10/i586 In-Reply-To: References: Message-ID: <5b5e1d3735946_7252764684893861@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_17.10/i586 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_17.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 127s] gsm0808_cell_id_name(&req->cell_id_target)); [ 127s] ^~~~~~~~~~~~~~~~~~~~ [ 128s] cc1: some warnings being treated as errors [ 128s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 128s] make[4]: *** [handover_fsm.o] Error 1 [ 128s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 128s] Makefile:407: recipe for target 'all-recursive' failed [ 128s] make[3]: *** [all-recursive] Error 1 [ 128s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 128s] Makefile:441: recipe for target 'all-recursive' failed [ 128s] make[2]: *** [all-recursive] Error 1 [ 128s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 128s] Makefile:373: recipe for target 'all' failed [ 128s] make[1]: *** [all] Error 2 [ 128s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 128s] dh_auto_build: make -j1 returned exit code 2 [ 128s] debian/rules:45: recipe for target 'build' failed [ 128s] make: *** [build] Error 2 [ 128s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 128s] [ 128s] cloud115 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:01:21 UTC 2018. [ 128s] [ 128s] ### VM INTERACTION START ### [ 131s] [ 110.899077] sysrq: SysRq : Power Off [ 131s] [ 110.919048] reboot: Power down [ 133s] ### VM INTERACTION END ### [ 133s] [ 133s] cloud115 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:01:27 UTC 2018. [ 133s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jul 29 20:01:56 2018 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Jul 2018 20:01:56 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <5b5e1d39c979d_72527646848942ee@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_9.0/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 91s] gsm0808_cell_id_name(&req->cell_id_target)); [ 91s] ^~~~~~~~~~~~~~~~~~~~ [ 92s] cc1: some warnings being treated as errors [ 92s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 92s] make[4]: *** [handover_fsm.o] Error 1 [ 92s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 92s] Makefile:407: recipe for target 'all-recursive' failed [ 92s] make[3]: *** [all-recursive] Error 1 [ 92s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 92s] Makefile:441: recipe for target 'all-recursive' failed [ 92s] make[2]: *** [all-recursive] Error 1 [ 92s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 92s] Makefile:373: recipe for target 'all' failed [ 92s] make[1]: *** [all] Error 2 [ 92s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 92s] dh_auto_build: make -j1 returned exit code 2 [ 92s] debian/rules:45: recipe for target 'build' failed [ 92s] make: *** [build] Error 2 [ 92s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 92s] [ 92s] lamb27 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:01:47 UTC 2018. [ 92s] [ 92s] ### VM INTERACTION START ### [ 95s] [ 83.675731] sysrq: SysRq : Power Off [ 95s] [ 83.683126] reboot: Power down [ 95s] ### VM INTERACTION END ### [ 95s] [ 95s] lamb27 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:01:51 UTC 2018. [ 95s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jul 29 20:01:56 2018 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Jul 2018 20:01:56 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <5b5e1d3a23d7b_725276468489431f@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_9.0/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 91s] gsm0808_cell_id_name(&req->cell_id_target)); [ 91s] ^~~~~~~~~~~~~~~~~~~~ [ 92s] cc1: some warnings being treated as errors [ 92s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 92s] make[4]: *** [handover_fsm.o] Error 1 [ 92s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 92s] Makefile:407: recipe for target 'all-recursive' failed [ 92s] make[3]: *** [all-recursive] Error 1 [ 92s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 92s] Makefile:441: recipe for target 'all-recursive' failed [ 92s] make[2]: *** [all-recursive] Error 1 [ 92s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 92s] Makefile:373: recipe for target 'all' failed [ 92s] make[1]: *** [all] Error 2 [ 92s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 92s] dh_auto_build: make -j1 returned exit code 2 [ 92s] debian/rules:45: recipe for target 'build' failed [ 92s] make: *** [build] Error 2 [ 92s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 92s] [ 92s] lamb27 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:01:47 UTC 2018. [ 92s] [ 92s] ### VM INTERACTION START ### [ 95s] [ 83.675731] sysrq: SysRq : Power Off [ 95s] [ 83.683126] reboot: Power down [ 95s] ### VM INTERACTION END ### [ 95s] [ 95s] lamb27 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:01:51 UTC 2018. [ 95s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jul 29 20:02:47 2018 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Jul 2018 20:02:47 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <5b5e1d7620768_725276468489452@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_16.04/i586 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 98s] ^ [ 98s] handover_fsm.c:489:4: error: format not a string literal and no format arguments [-Werror=format-security] [ 98s] cc1: some warnings being treated as errors [ 98s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 98s] make[4]: *** [handover_fsm.o] Error 1 [ 98s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 98s] Makefile:407: recipe for target 'all-recursive' failed [ 98s] make[3]: *** [all-recursive] Error 1 [ 98s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 98s] Makefile:441: recipe for target 'all-recursive' failed [ 98s] make[2]: *** [all-recursive] Error 1 [ 98s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 98s] Makefile:373: recipe for target 'all' failed [ 98s] make[1]: *** [all] Error 2 [ 98s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 98s] dh_auto_build: make -j1 returned exit code 2 [ 98s] debian/rules:45: recipe for target 'build' failed [ 98s] make: *** [build] Error 2 [ 98s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 98s] [ 98s] lamb04 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:02:33 UTC 2018. [ 98s] [ 98s] ### VM INTERACTION START ### [ 102s] [ 92.286930] sysrq: SysRq : Power Off [ 102s] [ 92.294181] reboot: Power down [ 102s] ### VM INTERACTION END ### [ 102s] [ 102s] lamb04 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:02:37 UTC 2018. [ 102s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jul 29 20:02:47 2018 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Jul 2018 20:02:47 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <5b5e1d759d543_725276468489449d@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_16.04/i586 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 98s] ^ [ 98s] handover_fsm.c:489:4: error: format not a string literal and no format arguments [-Werror=format-security] [ 98s] cc1: some warnings being treated as errors [ 98s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 98s] make[4]: *** [handover_fsm.o] Error 1 [ 98s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 98s] Makefile:407: recipe for target 'all-recursive' failed [ 98s] make[3]: *** [all-recursive] Error 1 [ 98s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 98s] Makefile:441: recipe for target 'all-recursive' failed [ 98s] make[2]: *** [all-recursive] Error 1 [ 98s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 98s] Makefile:373: recipe for target 'all' failed [ 98s] make[1]: *** [all] Error 2 [ 98s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 98s] dh_auto_build: make -j1 returned exit code 2 [ 98s] debian/rules:45: recipe for target 'build' failed [ 98s] make: *** [build] Error 2 [ 98s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 98s] [ 98s] lamb04 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:02:33 UTC 2018. [ 98s] [ 98s] ### VM INTERACTION START ### [ 102s] [ 92.286930] sysrq: SysRq : Power Off [ 102s] [ 92.294181] reboot: Power down [ 102s] ### VM INTERACTION END ### [ 102s] [ 102s] lamb04 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:02:37 UTC 2018. [ 102s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jul 29 20:02:47 2018 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Jul 2018 20:02:47 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_18.04/i586 In-Reply-To: References: Message-ID: <5b5e1d76b5b6d_725276468489466@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_18.04/i586 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_18.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 120s] gsm0808_cell_id_name(&req->cell_id_target)); [ 120s] ^~~~~~~~~~~~~~~~~~~~ [ 121s] cc1: some warnings being treated as errors [ 121s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 121s] make[4]: *** [handover_fsm.o] Error 1 [ 121s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 121s] Makefile:407: recipe for target 'all-recursive' failed [ 121s] make[3]: *** [all-recursive] Error 1 [ 121s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 121s] Makefile:441: recipe for target 'all-recursive' failed [ 121s] make[2]: *** [all-recursive] Error 1 [ 121s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 121s] Makefile:373: recipe for target 'all' failed [ 121s] make[1]: *** [all] Error 2 [ 121s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 121s] dh_auto_build: make -j1 returned exit code 2 [ 121s] debian/rules:45: recipe for target 'build' failed [ 121s] make: *** [build] Error 2 [ 121s] dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2 [ 121s] [ 121s] lamb76 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:02:36 UTC 2018. [ 121s] [ 121s] ### VM INTERACTION START ### [ 124s] [ 113.244420] sysrq: SysRq : Power Off [ 124s] [ 113.251751] reboot: Power down [ 124s] ### VM INTERACTION END ### [ 124s] [ 124s] lamb76 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:02:40 UTC 2018. [ 124s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jul 29 20:02:47 2018 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Jul 2018 20:02:47 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_18.04/i586 In-Reply-To: References: Message-ID: <5b5e1d774dfae_72527646848948a1@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_18.04/i586 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_18.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 120s] gsm0808_cell_id_name(&req->cell_id_target)); [ 120s] ^~~~~~~~~~~~~~~~~~~~ [ 121s] cc1: some warnings being treated as errors [ 121s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 121s] make[4]: *** [handover_fsm.o] Error 1 [ 121s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 121s] Makefile:407: recipe for target 'all-recursive' failed [ 121s] make[3]: *** [all-recursive] Error 1 [ 121s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 121s] Makefile:441: recipe for target 'all-recursive' failed [ 121s] make[2]: *** [all-recursive] Error 1 [ 121s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 121s] Makefile:373: recipe for target 'all' failed [ 121s] make[1]: *** [all] Error 2 [ 121s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 121s] dh_auto_build: make -j1 returned exit code 2 [ 121s] debian/rules:45: recipe for target 'build' failed [ 121s] make: *** [build] Error 2 [ 121s] dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2 [ 121s] [ 121s] lamb76 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:02:36 UTC 2018. [ 121s] [ 121s] ### VM INTERACTION START ### [ 124s] [ 113.244420] sysrq: SysRq : Power Off [ 124s] [ 113.251751] reboot: Power down [ 124s] ### VM INTERACTION END ### [ 124s] [ 124s] lamb76 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:02:40 UTC 2018. [ 124s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jul 29 20:02:47 2018 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Jul 2018 20:02:47 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_8.0/i586 In-Reply-To: References: Message-ID: <5b5e1d779eb30_7252764684894957@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_8.0/i586 Package network:osmocom:nightly/osmo-bsc failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 95s] ^ [ 95s] handover_fsm.c:489:4: error: format not a string literal and no format arguments [-Werror=format-security] [ 96s] cc1: some warnings being treated as errors [ 96s] Makefile:614: recipe for target 'handover_fsm.o' failed [ 96s] make[4]: *** [handover_fsm.o] Error 1 [ 96s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 96s] Makefile:395: recipe for target 'all-recursive' failed [ 96s] make[3]: *** [all-recursive] Error 1 [ 96s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 96s] Makefile:429: recipe for target 'all-recursive' failed [ 96s] make[2]: *** [all-recursive] Error 1 [ 96s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 96s] Makefile:360: recipe for target 'all' failed [ 96s] make[1]: *** [all] Error 2 [ 96s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 96s] dh_auto_build: make -j1 returned exit code 2 [ 96s] debian/rules:45: recipe for target 'build' failed [ 96s] make: *** [build] Error 2 [ 96s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 96s] [ 96s] build34 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:02:39 UTC 2018. [ 96s] [ 96s] ### VM INTERACTION START ### [ 97s] Powering off. [ 97s] [ 84.974446] reboot: Power down [ 97s] ### VM INTERACTION END ### [ 97s] [ 97s] build34 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:02:41 UTC 2018. [ 97s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jul 29 20:02:47 2018 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Jul 2018 20:02:47 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_8.0/i586 In-Reply-To: References: Message-ID: <5b5e1d7788e6_72527646848947e5@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_8.0/i586 Package network:osmocom:nightly/osmo-bsc failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 95s] ^ [ 95s] handover_fsm.c:489:4: error: format not a string literal and no format arguments [-Werror=format-security] [ 96s] cc1: some warnings being treated as errors [ 96s] Makefile:614: recipe for target 'handover_fsm.o' failed [ 96s] make[4]: *** [handover_fsm.o] Error 1 [ 96s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 96s] Makefile:395: recipe for target 'all-recursive' failed [ 96s] make[3]: *** [all-recursive] Error 1 [ 96s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 96s] Makefile:429: recipe for target 'all-recursive' failed [ 96s] make[2]: *** [all-recursive] Error 1 [ 96s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 96s] Makefile:360: recipe for target 'all' failed [ 96s] make[1]: *** [all] Error 2 [ 96s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 96s] dh_auto_build: make -j1 returned exit code 2 [ 96s] debian/rules:45: recipe for target 'build' failed [ 96s] make: *** [build] Error 2 [ 96s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 96s] [ 96s] build34 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:02:39 UTC 2018. [ 96s] [ 96s] ### VM INTERACTION START ### [ 97s] Powering off. [ 97s] [ 84.974446] reboot: Power down [ 97s] ### VM INTERACTION END ### [ 97s] [ 97s] build34 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:02:41 UTC 2018. [ 97s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jul 29 20:03:21 2018 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Jul 2018 20:03:21 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_17.10/x86_64 In-Reply-To: References: Message-ID: <5b5e1d93752a_725276468489505b@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_17.10/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_17.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 94s] gsm0808_cell_id_name(&req->cell_id_target)); [ 94s] ^~~~~~~~~~~~~~~~~~~~ [ 95s] cc1: some warnings being treated as errors [ 95s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 95s] make[4]: *** [handover_fsm.o] Error 1 [ 95s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 95s] Makefile:407: recipe for target 'all-recursive' failed [ 95s] make[3]: *** [all-recursive] Error 1 [ 95s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 95s] Makefile:441: recipe for target 'all-recursive' failed [ 95s] make[2]: *** [all-recursive] Error 1 [ 95s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 95s] Makefile:373: recipe for target 'all' failed [ 95s] make[1]: *** [all] Error 2 [ 95s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 95s] dh_auto_build: make -j1 returned exit code 2 [ 95s] debian/rules:45: recipe for target 'build' failed [ 95s] make: *** [build] Error 2 [ 95s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 95s] [ 95s] lamb58 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:03:05 UTC 2018. [ 95s] [ 95s] ### VM INTERACTION START ### [ 98s] [ 88.359861] sysrq: SysRq : Power Off [ 98s] [ 88.367484] reboot: Power down [ 98s] ### VM INTERACTION END ### [ 98s] [ 98s] lamb58 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:03:08 UTC 2018. [ 98s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jul 29 20:03:21 2018 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Jul 2018 20:03:21 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_17.10/x86_64 In-Reply-To: References: Message-ID: <5b5e1d934d093_7252764684895149@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_17.10/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_17.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 94s] gsm0808_cell_id_name(&req->cell_id_target)); [ 94s] ^~~~~~~~~~~~~~~~~~~~ [ 95s] cc1: some warnings being treated as errors [ 95s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 95s] make[4]: *** [handover_fsm.o] Error 1 [ 95s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 95s] Makefile:407: recipe for target 'all-recursive' failed [ 95s] make[3]: *** [all-recursive] Error 1 [ 95s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 95s] Makefile:441: recipe for target 'all-recursive' failed [ 95s] make[2]: *** [all-recursive] Error 1 [ 95s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 95s] Makefile:373: recipe for target 'all' failed [ 95s] make[1]: *** [all] Error 2 [ 95s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 95s] dh_auto_build: make -j1 returned exit code 2 [ 95s] debian/rules:45: recipe for target 'build' failed [ 95s] make: *** [build] Error 2 [ 95s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 95s] [ 95s] lamb58 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:03:05 UTC 2018. [ 95s] [ 95s] ### VM INTERACTION START ### [ 98s] [ 88.359861] sysrq: SysRq : Power Off [ 98s] [ 88.367484] reboot: Power down [ 98s] ### VM INTERACTION END ### [ 98s] [ 98s] lamb58 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:03:08 UTC 2018. [ 98s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jul 29 20:03:56 2018 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Jul 2018 20:03:56 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <5b5e1dae5e87f_7252764684895274@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_8.0/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 93s] ^ [ 93s] handover_fsm.c:489:4: error: format not a string literal and no format arguments [-Werror=format-security] [ 94s] cc1: some warnings being treated as errors [ 94s] Makefile:614: recipe for target 'handover_fsm.o' failed [ 94s] make[4]: *** [handover_fsm.o] Error 1 [ 94s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 94s] Makefile:395: recipe for target 'all-recursive' failed [ 94s] make[3]: *** [all-recursive] Error 1 [ 94s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 94s] Makefile:429: recipe for target 'all-recursive' failed [ 94s] make[2]: *** [all-recursive] Error 1 [ 94s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 94s] Makefile:360: recipe for target 'all' failed [ 94s] make[1]: *** [all] Error 2 [ 94s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 94s] dh_auto_build: make -j1 returned exit code 2 [ 94s] debian/rules:45: recipe for target 'build' failed [ 94s] make: *** [build] Error 2 [ 94s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 94s] [ 94s] lamb10 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:03:42 UTC 2018. [ 94s] [ 94s] ### VM INTERACTION START ### [ 95s] Powering off. [ 95s] [ 84.248520] reboot: Power down [ 95s] ### VM INTERACTION END ### [ 95s] [ 95s] lamb10 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:03:44 UTC 2018. [ 95s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jul 29 20:03:56 2018 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Jul 2018 20:03:56 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <5b5e1dae9e365_725276468489535c@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_8.0/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 93s] ^ [ 93s] handover_fsm.c:489:4: error: format not a string literal and no format arguments [-Werror=format-security] [ 94s] cc1: some warnings being treated as errors [ 94s] Makefile:614: recipe for target 'handover_fsm.o' failed [ 94s] make[4]: *** [handover_fsm.o] Error 1 [ 94s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 94s] Makefile:395: recipe for target 'all-recursive' failed [ 94s] make[3]: *** [all-recursive] Error 1 [ 94s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 94s] Makefile:429: recipe for target 'all-recursive' failed [ 94s] make[2]: *** [all-recursive] Error 1 [ 94s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 94s] Makefile:360: recipe for target 'all' failed [ 94s] make[1]: *** [all] Error 2 [ 94s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 94s] dh_auto_build: make -j1 returned exit code 2 [ 94s] debian/rules:45: recipe for target 'build' failed [ 94s] make: *** [build] Error 2 [ 94s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 94s] [ 94s] lamb10 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:03:42 UTC 2018. [ 94s] [ 94s] ### VM INTERACTION START ### [ 95s] Powering off. [ 95s] [ 84.248520] reboot: Power down [ 95s] ### VM INTERACTION END ### [ 95s] [ 95s] lamb10 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:03:44 UTC 2018. [ 95s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jul 29 20:04:30 2018 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Jul 2018 20:04:30 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_18.04/x86_64 In-Reply-To: References: Message-ID: <5b5e1dcf938dc_72527646848954ea@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_18.04/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_18.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 116s] gsm0808_cell_id_name(&req->cell_id_target)); [ 116s] ^~~~~~~~~~~~~~~~~~~~ [ 117s] cc1: some warnings being treated as errors [ 117s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 117s] make[4]: *** [handover_fsm.o] Error 1 [ 117s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 117s] Makefile:407: recipe for target 'all-recursive' failed [ 117s] make[3]: *** [all-recursive] Error 1 [ 117s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 117s] Makefile:441: recipe for target 'all-recursive' failed [ 117s] make[2]: *** [all-recursive] Error 1 [ 117s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 117s] Makefile:373: recipe for target 'all' failed [ 117s] make[1]: *** [all] Error 2 [ 117s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 117s] dh_auto_build: make -j1 returned exit code 2 [ 117s] debian/rules:45: recipe for target 'build' failed [ 117s] make: *** [build] Error 2 [ 117s] dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2 [ 117s] [ 117s] lamb53 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:04:10 UTC 2018. [ 117s] [ 117s] ### VM INTERACTION START ### [ 120s] [ 109.178020] sysrq: SysRq : Power Off [ 120s] [ 109.185591] reboot: Power down [ 120s] ### VM INTERACTION END ### [ 120s] [ 120s] lamb53 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:04:14 UTC 2018. [ 120s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jul 29 20:04:30 2018 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Jul 2018 20:04:30 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_18.04/x86_64 In-Reply-To: References: Message-ID: <5b5e1dcff2d26_72527646848955bd@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_18.04/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_18.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 116s] gsm0808_cell_id_name(&req->cell_id_target)); [ 116s] ^~~~~~~~~~~~~~~~~~~~ [ 117s] cc1: some warnings being treated as errors [ 117s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 117s] make[4]: *** [handover_fsm.o] Error 1 [ 117s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 117s] Makefile:407: recipe for target 'all-recursive' failed [ 117s] make[3]: *** [all-recursive] Error 1 [ 117s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 117s] Makefile:441: recipe for target 'all-recursive' failed [ 117s] make[2]: *** [all-recursive] Error 1 [ 117s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 117s] Makefile:373: recipe for target 'all' failed [ 117s] make[1]: *** [all] Error 2 [ 117s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 117s] dh_auto_build: make -j1 returned exit code 2 [ 117s] debian/rules:45: recipe for target 'build' failed [ 117s] make: *** [build] Error 2 [ 117s] dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2 [ 117s] [ 117s] lamb53 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:04:10 UTC 2018. [ 117s] [ 117s] ### VM INTERACTION START ### [ 120s] [ 109.178020] sysrq: SysRq : Power Off [ 120s] [ 109.185591] reboot: Power down [ 120s] ### VM INTERACTION END ### [ 120s] [ 120s] lamb53 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:04:14 UTC 2018. [ 120s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jul 29 20:05:56 2018 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Jul 2018 20:05:56 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_9.0/i586 In-Reply-To: References: Message-ID: <5b5e1e2575e18_72527646848956a0@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_9.0/i586 Package network:osmocom:nightly/osmo-bsc failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 95s] gsm0808_cell_id_name(&req->cell_id_target)); [ 95s] ^~~~~~~~~~~~~~~~~~~~ [ 96s] cc1: some warnings being treated as errors [ 96s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 96s] make[4]: *** [handover_fsm.o] Error 1 [ 96s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 96s] Makefile:407: recipe for target 'all-recursive' failed [ 96s] make[3]: *** [all-recursive] Error 1 [ 96s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 96s] Makefile:441: recipe for target 'all-recursive' failed [ 96s] make[2]: *** [all-recursive] Error 1 [ 97s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 97s] Makefile:373: recipe for target 'all' failed [ 97s] make[1]: *** [all] Error 2 [ 97s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 97s] dh_auto_build: make -j1 returned exit code 2 [ 97s] debian/rules:45: recipe for target 'build' failed [ 97s] make: *** [build] Error 2 [ 97s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 97s] [ 97s] lamb22 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:05:42 UTC 2018. [ 97s] [ 97s] ### VM INTERACTION START ### [ 100s] [ 88.178733] sysrq: SysRq : Power Off [ 100s] [ 88.186754] reboot: Power down [ 100s] ### VM INTERACTION END ### [ 100s] [ 100s] lamb22 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:05:46 UTC 2018. [ 100s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jul 29 20:05:56 2018 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Jul 2018 20:05:56 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_9.0/i586 In-Reply-To: References: Message-ID: <5b5e1e25bd800_72527646848957d7@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_9.0/i586 Package network:osmocom:nightly/osmo-bsc failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 95s] gsm0808_cell_id_name(&req->cell_id_target)); [ 95s] ^~~~~~~~~~~~~~~~~~~~ [ 96s] cc1: some warnings being treated as errors [ 96s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 96s] make[4]: *** [handover_fsm.o] Error 1 [ 96s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 96s] Makefile:407: recipe for target 'all-recursive' failed [ 96s] make[3]: *** [all-recursive] Error 1 [ 96s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 96s] Makefile:441: recipe for target 'all-recursive' failed [ 96s] make[2]: *** [all-recursive] Error 1 [ 97s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 97s] Makefile:373: recipe for target 'all' failed [ 97s] make[1]: *** [all] Error 2 [ 97s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 97s] dh_auto_build: make -j1 returned exit code 2 [ 97s] debian/rules:45: recipe for target 'build' failed [ 97s] make: *** [build] Error 2 [ 97s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 97s] [ 97s] lamb22 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:05:42 UTC 2018. [ 97s] [ 97s] ### VM INTERACTION START ### [ 100s] [ 88.178733] sysrq: SysRq : Power Off [ 100s] [ 88.186754] reboot: Power down [ 100s] ### VM INTERACTION END ### [ 100s] [ 100s] lamb22 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 20:05:46 UTC 2018. [ 100s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Sun Jul 29 21:12:03 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 29 Jul 2018 21:12:03 +0000 Subject: Change in osmo-hlr[master]: hlr.c: move deinitialization code from SIGINT handler Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/10222 Change subject: hlr.c: move deinitialization code from SIGINT handler ...................................................................... hlr.c: move deinitialization code from SIGINT handler There were a few lines of dead code below the osmo_select_main() loop, while the actual deinitialization code was a part of SIGINT handler. Let's reanimate this dead zone by moving the code there and introducing a global 'loop-breaker' variable. Change-Id: I0e2d673b420193e2bdc1a92377aca542f3a19229 --- M src/hlr.c 1 file changed, 7 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/22/10222/1 diff --git a/src/hlr.c b/src/hlr.c index 643dfff..7fdb27e 100644 --- a/src/hlr.c +++ b/src/hlr.c @@ -44,6 +44,7 @@ #include "hlr_vty.h" static struct hlr *g_hlr; +static int quit = 0; /* Trigger 'Insert Subscriber Data' messages to all connected GSUP clients. * @@ -523,11 +524,7 @@ switch (signal) { case SIGINT: LOGP(DMAIN, LOGL_NOTICE, "Terminating due to SIGINT\n"); - osmo_gsup_server_destroy(g_hlr->gs); - db_close(g_hlr->dbc); - log_fini(); - talloc_report_full(hlr_ctx, stderr); - exit(0); + quit++; break; case SIGUSR1: LOGP(DMAIN, LOGL_DEBUG, "Talloc Report due to SIGUSR1\n"); @@ -621,13 +618,14 @@ } } - while (1) { + while (!quit) osmo_select_main(0); - } + osmo_gsup_server_destroy(g_hlr->gs); db_close(g_hlr->dbc); - log_fini(); - exit(0); + talloc_report_full(hlr_ctx, stderr); + + return 0; } -- To view, visit https://gerrit.osmocom.org/10222 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I0e2d673b420193e2bdc1a92377aca542f3a19229 Gerrit-Change-Number: 10222 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 29 21:12:04 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 29 Jul 2018 21:12:04 +0000 Subject: Change in osmo-hlr[master]: hlr.c: free root talloc context on exit Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/10223 Change subject: hlr.c: free root talloc context on exit ...................................................................... hlr.c: free root talloc context on exit This makes both ASAN and Valgrind happy, because they do expect all allocated heap chunks to be released on exit. Change-Id: I7345dec8d06b0b71a859c16132dc0008cfe17cba --- M src/hlr.c 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/23/10223/1 diff --git a/src/hlr.c b/src/hlr.c index 7fdb27e..6c0cb0a 100644 --- a/src/hlr.c +++ b/src/hlr.c @@ -625,7 +625,12 @@ db_close(g_hlr->dbc); log_fini(); + /** + * Report the heap state of root context, then free, + * so both ASAN and Valgrind are happy... + */ talloc_report_full(hlr_ctx, stderr); + talloc_free(hlr_ctx); return 0; } -- To view, visit https://gerrit.osmocom.org/10223 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I7345dec8d06b0b71a859c16132dc0008cfe17cba Gerrit-Change-Number: 10223 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 29 21:12:04 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 29 Jul 2018 21:12:04 +0000 Subject: Change in osmo-hlr[master]: hlr.c: track the use of talloc NULL memory contexts Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/10224 Change subject: hlr.c: track the use of talloc NULL memory contexts ...................................................................... hlr.c: track the use of talloc NULL memory contexts Tracking NULL memory contexts allows one to detect memory chunks allocated outside the application's root context, which in most cases are the result of some mistake. For example, the VTY implementation still uses the NULL context, so we have to clean up it manually until this is fixed. At the moment we have at least one chunk allocated outside the application's root context (excluding the VTY context): full talloc report on 'null_context' (total 24 bytes in 2 blocks) struct lookup_helper contains 24 bytes in 1 blocks Change-Id: I7ea86730e090c06b2a5966ae4d04b8144b1cd20a --- M src/hlr.c 1 file changed, 13 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/24/10224/1 diff --git a/src/hlr.c b/src/hlr.c index 6c0cb0a..8732587 100644 --- a/src/hlr.c +++ b/src/hlr.c @@ -551,6 +551,9 @@ { int rc; + /* Track the use of talloc NULL memory contexts */ + talloc_enable_null_tracking(); + hlr_ctx = talloc_named_const(NULL, 1, "OsmoHLR"); msgb_talloc_ctx_init(hlr_ctx, 0); vty_info.tall_ctx = hlr_ctx; @@ -632,5 +635,15 @@ talloc_report_full(hlr_ctx, stderr); talloc_free(hlr_ctx); + /* FIXME: VTY code still uses NULL-context */ + talloc_free(tall_vty_ctx); + + /** + * Report the heap state of NULL context, then free, + * so both ASAN and Valgrind are happy... + */ + talloc_report_full(NULL, stderr); + talloc_disable_null_tracking(); + return 0; } -- To view, visit https://gerrit.osmocom.org/10224 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I7ea86730e090c06b2a5966ae4d04b8144b1cd20a Gerrit-Change-Number: 10224 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Sun Jul 29 21:16:19 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 29 Jul 2018 21:16:19 +0000 Subject: Change in libosmocore[master]: vty/vty.c: remove dead unused tall_bsc_ctx Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/10225 Change subject: vty/vty.c: remove dead unused tall_bsc_ctx ...................................................................... vty/vty.c: remove dead unused tall_bsc_ctx Change-Id: I160728544c0effe45757df22f1ff2314fcb13dd1 --- M src/vty/vty.c 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/25/10225/1 diff --git a/src/vty/vty.c b/src/vty/vty.c index 6ca7a15..aab0607 100644 --- a/src/vty/vty.c +++ b/src/vty/vty.c @@ -1766,8 +1766,6 @@ vtyvec = vector_init(VECTOR_MIN_SIZE); } -extern void *tall_bsc_ctx; - /*! Initialize VTY layer * \param[in] app_info application information */ -- To view, visit https://gerrit.osmocom.org/10225 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I160728544c0effe45757df22f1ff2314fcb13dd1 Gerrit-Change-Number: 10225 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From admin at opensuse.org Sun Jul 29 21:22:21 2018 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Jul 2018 21:22:21 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_9.0/armv7l In-Reply-To: References: Message-ID: <5b5e3014c5e12_72527646848998dd@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_9.0/armv7l Package network:osmocom:nightly/osmo-bsc failed to build in Debian_9.0/armv7l Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 144s] gsm0808_cell_id_name(&req->cell_id_target)); [ 144s] ^~~~~~~~~~~~~~~~~~~~ [ 146s] cc1: some warnings being treated as errors [ 146s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 146s] make[4]: *** [handover_fsm.o] Error 1 [ 146s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 146s] Makefile:407: recipe for target 'all-recursive' failed [ 146s] make[3]: *** [all-recursive] Error 1 [ 146s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 146s] Makefile:441: recipe for target 'all-recursive' failed [ 146s] make[2]: *** [all-recursive] Error 1 [ 146s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 146s] Makefile:373: recipe for target 'all' failed [ 146s] make[1]: *** [all] Error 2 [ 146s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 146s] dh_auto_build: make -j1 returned exit code 2 [ 146s] debian/rules:45: recipe for target 'build' failed [ 146s] make: *** [build] Error 2 [ 146s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 146s] [ 146s] armbuild24 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 21:22:14 UTC 2018. [ 146s] [ 146s] ### VM INTERACTION START ### [ 149s] [ 136.740679] SysRq : Power Off [ 149s] [ 136.750627] reboot: Power down [ 149s] ### VM INTERACTION END ### [ 149s] [ 149s] armbuild24 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 21:22:17 UTC 2018. [ 149s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jul 29 21:22:21 2018 From: admin at opensuse.org (OBS Notification) Date: Sun, 29 Jul 2018 21:22:21 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_9.0/armv7l In-Reply-To: References: Message-ID: <5b5e301476b10_7252764684899779@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_9.0/armv7l Package network:osmocom:nightly/osmo-bsc failed to build in Debian_9.0/armv7l Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 144s] gsm0808_cell_id_name(&req->cell_id_target)); [ 144s] ^~~~~~~~~~~~~~~~~~~~ [ 146s] cc1: some warnings being treated as errors [ 146s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 146s] make[4]: *** [handover_fsm.o] Error 1 [ 146s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 146s] Makefile:407: recipe for target 'all-recursive' failed [ 146s] make[3]: *** [all-recursive] Error 1 [ 146s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 146s] Makefile:441: recipe for target 'all-recursive' failed [ 146s] make[2]: *** [all-recursive] Error 1 [ 146s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 146s] Makefile:373: recipe for target 'all' failed [ 146s] make[1]: *** [all] Error 2 [ 146s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 146s] dh_auto_build: make -j1 returned exit code 2 [ 146s] debian/rules:45: recipe for target 'build' failed [ 146s] make: *** [build] Error 2 [ 146s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 146s] [ 146s] armbuild24 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 21:22:14 UTC 2018. [ 146s] [ 146s] ### VM INTERACTION START ### [ 149s] [ 136.740679] SysRq : Power Off [ 149s] [ 136.750627] reboot: Power down [ 149s] ### VM INTERACTION END ### [ 149s] [ 149s] armbuild24 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Sun Jul 29 21:22:17 UTC 2018. [ 149s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From jenkins at lists.osmocom.org Mon Jul 30 00:47:17 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Mon, 30 Jul 2018 00:47:17 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-osmo-bts_=C2=BB_sysmo,s?= =?UTF-8?Q?uperfemto=5Fv5.1,default,osmocom-master-debian9_#957?= Message-ID: <1478855809.113.1532911637639.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 48.83 KB...] make[3]: Leaving directory ' make[2]: Leaving directory ' Making install in src make[2]: Entering directory ' GEN crc8gen.c GEN crc16gen.c GEN crc32gen.c GEN crc64gen.c make install-am make[3]: Entering directory ' CC timer_gettimeofday.lo CC timer.lo CC select.lo CC bitvec.lo CC bits.lo CC msgb.lo CC timer_clockgettime.lo CC signal.lo CC bitcomp.lo CC counter.lo CC fsm.lo CC write_queue.lo CC utils.lo CC socket.lo CC logging.lo CC logging_syslog.lo CC logging_gsmtap.lo CC rate_ctr.lo CC gsmtap_util.lo CC crc16.lo CC panic.lo CC backtrace.lo CC conv.lo CC rbtree.lo CC application.lo CC loggingrb.lo CC strrb.lo CC crc8gen.lo CC crc16gen.lo CC crc32gen.lo CC crc64gen.lo CC stats.lo CC macaddr.lo CC stat_item.lo CC prim.lo CC stats_statsd.lo CC conv_acc.lo CC conv_acc_generic.lo CC sercomm.lo CC prbs.lo CC isdnhdlc.lo CC conv_acc_sse.lo CC conv_acc_sse_avx.lo CC plugin.lo CC serial.lo CC msgfile.lo CCLD libosmocore.la make[4]: Entering directory ' make[4]: Nothing to be done for 'install-data-am'. /bin/mkdir -p ' /bin/bash ../libtool --mode=install /usr/bin/install -c libosmocore.la ' libtool: install: /usr/bin/install -c .libs/libosmocore.so.11.0.0 libtool: install: (cd && { ln -s -f libosmocore.so.11.0.0 libosmocore.so.11 || { rm -f libosmocore.so.11 && ln -s libosmocore.so.11.0.0 libosmocore.so.11; }; }) libtool: install: (cd && { ln -s -f libosmocore.so.11.0.0 libosmocore.so || { rm -f libosmocore.so && ln -s libosmocore.so.11.0.0 libosmocore.so; }; }) libtool: install: /usr/bin/install -c .libs/libosmocore.lai libtool: finish: PATH="/usr/local/bin:/usr/bin:/bin:/usr/games:/home/osmocom-build/bin:/sbin" ldconfig -n ---------------------------------------------------------------------- Libraries have been installed in: If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the '-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the 'LD_RUN_PATH' environment variable during linking - use the '-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to '/etc/ld.so.conf' See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- make[4]: Leaving directory ' make[3]: Leaving directory ' make[2]: Leaving directory ' Making install in src/vty make[2]: Entering directory ' CC buffer.lo CC logging_vty.lo CC stats_vty.lo CC command.lo CC vector.lo CC vty.lo CC telnet_interface.lo CC utils.lo CC fsm_vty.lo CC talloc_ctx_vty.lo CCLD libosmovty.la make[3]: Entering directory ' make[3]: Nothing to be done for 'install-data-am'. /bin/mkdir -p ' /bin/bash ../../libtool --mode=install /usr/bin/install -c libosmovty.la ' libtool: warning: relinking 'libosmovty.la' libtool: install: (cd /bin/bash " --silent --tag CC --mode=relink gcc -Wall -g -O2 -DBUILDING_LIBOSMOCORE -Wall -version-info 5:0:5 -no-undefined -o libosmovty.la -rpath buffer.lo command.lo vty.lo vector.lo utils.lo telnet_interface.lo logging_vty.lo stats_vty.lo fsm_vty.lo talloc_ctx_vty.lo ../../src/libosmocore.la -ltalloc ) libtool: install: /usr/bin/install -c .libs/libosmovty.so.0.5.0T libtool: install: (cd && { ln -s -f libosmovty.so.0.5.0 libosmovty.so.0 || { rm -f libosmovty.so.0 && ln -s libosmovty.so.0.5.0 libosmovty.so.0; }; }) libtool: install: (cd && { ln -s -f libosmovty.so.0.5.0 libosmovty.so || { rm -f libosmovty.so && ln -s libosmovty.so.0.5.0 libosmovty.so; }; }) libtool: install: /usr/bin/install -c .libs/libosmovty.lai libtool: finish: PATH="/usr/local/bin:/usr/bin:/bin:/usr/games:/home/osmocom-build/bin:/sbin" ldconfig -n ---------------------------------------------------------------------- Libraries have been installed in: If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the '-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the 'LD_RUN_PATH' environment variable during linking - use the '-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to '/etc/ld.so.conf' See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- make[3]: Leaving directory ' make[2]: Leaving directory ' Making install in src/codec make[2]: Entering directory ' CC gsm610.lo CC gsm620.lo CC gsm690.lo CC gsm660.lo CC ecu_fr.lo CCLD libosmocodec.la make[3]: Entering directory ' make[3]: Nothing to be done for 'install-data-am'. /bin/mkdir -p ' /bin/bash ../../libtool --mode=install /usr/bin/install -c libosmocodec.la ' libtool: warning: relinking 'libosmocodec.la' libtool: install: (cd /bin/bash " --silent --tag CC --mode=relink gcc -Wall -g -O2 -DBUILDING_LIBOSMOCORE -Wall -version-info 1:1:1 -no-undefined -o libosmocodec.la -rpath gsm610.lo gsm620.lo gsm660.lo gsm690.lo ecu_fr.lo ../../src/libosmocore.la ) libtool: install: /usr/bin/install -c .libs/libosmocodec.so.0.1.1T libtool: install: (cd && { ln -s -f libosmocodec.so.0.1.1 libosmocodec.so.0 || { rm -f libosmocodec.so.0 && ln -s libosmocodec.so.0.1.1 libosmocodec.so.0; }; }) libtool: install: (cd && { ln -s -f libosmocodec.so.0.1.1 libosmocodec.so || { rm -f libosmocodec.so && ln -s libosmocodec.so.0.1.1 libosmocodec.so; }; }) libtool: install: /usr/bin/install -c .libs/libosmocodec.lai libtool: finish: PATH="/usr/local/bin:/usr/bin:/bin:/usr/games:/home/osmocom-build/bin:/sbin" ldconfig -n ---------------------------------------------------------------------- Libraries have been installed in: If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the '-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the 'LD_RUN_PATH' environment variable during linking - use the '-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to '/etc/ld.so.conf' See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- make[3]: Leaving directory ' make[2]: Leaving directory ' Making install in src/gsm make[2]: Entering directory ' GEN gsm0503_conv.c Generating convolutional codes... Generate 'xcch' definition Generate 'rach' definition Generate 'rach_ext' definition Generate 'sch' definition Generate 'cs2' definition Generate 'cs3' definition Generate 'cs2_np' definition Generate 'cs3_np' definition Generate 'tch_afs_12_2' definition Generate 'tch_afs_10_2' definition Generate 'tch_afs_7_95' definition Generate 'tch_afs_7_4' definition Generate 'tch_afs_6_7' definition Generate 'tch_afs_5_9' definition Generate 'tch_afs_5_15' definition Generate 'tch_afs_4_75' definition Generate 'tch_fr' definition Generate 'tch_hr' definition Generate 'tch_ahs_7_95' definition Generate 'tch_ahs_7_4' definition Generate 'tch_ahs_6_7' definition Generate 'tch_ahs_5_9' definition Generate 'tch_ahs_5_15' definition Generate 'tch_ahs_4_75' definition Generate 'mcs1_dl_hdr' definition Generate 'mcs1_ul_hdr' definition Generate 'mcs1' definition Generate 'mcs2' definition Generate 'mcs3' definition Generate 'mcs4' definition Generate 'mcs5_dl_hdr' definition Generate 'mcs5_ul_hdr' definition Generate 'mcs5' definition Generate 'mcs6' definition Generate 'mcs7_dl_hdr' definition Generate 'mcs7_ul_hdr' definition Generate 'mcs7' definition Generate 'mcs8' definition Generate 'mcs9' definition Generation complete. make install-am make[3]: Entering directory ' CC gsm_utils.lo CC comp128.lo CC tlv_parser.lo CC rxlev_stat.lo CC gsm48.lo CC a5.lo CC rsl.lo CC comp128v23.lo /bin/bash: line 2: 9640 Segmentation fault /bin/bash ../../libtool --silent --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../include -I/usr/include/p11-kit-1 -DBUILDING_LIBOSMOCORE -Wall -Wall -g -O2 -DBUILDING_LIBOSMOCORE -Wall -MT comp128v23.lo -MD -MP -MF $depbase.Tpo -c -o comp128v23.lo comp128v23.c Makefile:580: recipe for target 'comp128v23.lo' failed make[3]: *** [comp128v23.lo] Error 139 make[3]: *** Waiting for unfinished jobs.... gsm_utils.c:112:9: note: #pragma message: including GnuTLS for getrandom fallback. #pragma message ("including GnuTLS for getrandom fallback.") ^~~~~~~ gsm_utils.c: In function ?osmo_get_rand_id?: gsm_utils.c:448:9: note: #pragma message: Using direct syscall access for getrandom(): consider upgrading to glibc >= 2.25 #pragma message ("Using direct syscall access for getrandom(): consider upgrading to glibc >= 2.25") ^~~~~~~ gsm_utils.c:456:9: note: #pragma message: Secure random failed: using GnuTLS fallback. #pragma message ("Secure random failed: using GnuTLS fallback.") ^~~~~~~ make[3]: Leaving directory ' Makefile:685: recipe for target 'install' failed make[2]: *** [install] Error 2 make[2]: Leaving directory ' Makefile:604: recipe for target 'install-recursive' failed make[1]: *** [install-recursive] Error 1 make[1]: Leaving directory ' Makefile:903: recipe for target 'install' failed make: *** [install] Error 2 Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Mon Jul 30 07:07:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 07:07:36 +0000 Subject: Change in libosmocore[master]: vty/vty.c: remove dead unused tall_bsc_ctx In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10225 ) Change subject: vty/vty.c: remove dead unused tall_bsc_ctx ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10225 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I160728544c0effe45757df22f1ff2314fcb13dd1 Gerrit-Change-Number: 10225 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 30 Jul 2018 07:07:36 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 07:07:39 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 07:07:39 +0000 Subject: Change in libosmocore[master]: vty/vty.c: remove dead unused tall_bsc_ctx In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10225 ) Change subject: vty/vty.c: remove dead unused tall_bsc_ctx ...................................................................... vty/vty.c: remove dead unused tall_bsc_ctx Change-Id: I160728544c0effe45757df22f1ff2314fcb13dd1 --- M src/vty/vty.c 1 file changed, 0 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/vty/vty.c b/src/vty/vty.c index 6ca7a15..aab0607 100644 --- a/src/vty/vty.c +++ b/src/vty/vty.c @@ -1766,8 +1766,6 @@ vtyvec = vector_init(VECTOR_MIN_SIZE); } -extern void *tall_bsc_ctx; - /*! Initialize VTY layer * \param[in] app_info application information */ -- To view, visit https://gerrit.osmocom.org/10225 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I160728544c0effe45757df22f1ff2314fcb13dd1 Gerrit-Change-Number: 10225 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 07:07:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 07:07:46 +0000 Subject: Change in osmo-hlr[master]: hlr.c: move deinitialization code from SIGINT handler In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10222 ) Change subject: hlr.c: move deinitialization code from SIGINT handler ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10222 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0e2d673b420193e2bdc1a92377aca542f3a19229 Gerrit-Change-Number: 10222 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 30 Jul 2018 07:07:46 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 07:07:50 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 07:07:50 +0000 Subject: Change in osmo-hlr[master]: hlr.c: free root talloc context on exit In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10223 ) Change subject: hlr.c: free root talloc context on exit ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10223 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7345dec8d06b0b71a859c16132dc0008cfe17cba Gerrit-Change-Number: 10223 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 30 Jul 2018 07:07:50 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 07:08:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 07:08:20 +0000 Subject: Change in osmo-hlr[master]: hlr.c: track the use of talloc NULL memory contexts In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10224 ) Change subject: hlr.c: track the use of talloc NULL memory contexts ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10224 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7ea86730e090c06b2a5966ae4d04b8144b1cd20a Gerrit-Change-Number: 10224 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 30 Jul 2018 07:08:20 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 07:08:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 07:08:21 +0000 Subject: Change in osmo-hlr[master]: hlr.c: move deinitialization code from SIGINT handler In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10222 ) Change subject: hlr.c: move deinitialization code from SIGINT handler ...................................................................... hlr.c: move deinitialization code from SIGINT handler There were a few lines of dead code below the osmo_select_main() loop, while the actual deinitialization code was a part of SIGINT handler. Let's reanimate this dead zone by moving the code there and introducing a global 'loop-breaker' variable. Change-Id: I0e2d673b420193e2bdc1a92377aca542f3a19229 --- M src/hlr.c 1 file changed, 7 insertions(+), 9 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/hlr.c b/src/hlr.c index 643dfff..7fdb27e 100644 --- a/src/hlr.c +++ b/src/hlr.c @@ -44,6 +44,7 @@ #include "hlr_vty.h" static struct hlr *g_hlr; +static int quit = 0; /* Trigger 'Insert Subscriber Data' messages to all connected GSUP clients. * @@ -523,11 +524,7 @@ switch (signal) { case SIGINT: LOGP(DMAIN, LOGL_NOTICE, "Terminating due to SIGINT\n"); - osmo_gsup_server_destroy(g_hlr->gs); - db_close(g_hlr->dbc); - log_fini(); - talloc_report_full(hlr_ctx, stderr); - exit(0); + quit++; break; case SIGUSR1: LOGP(DMAIN, LOGL_DEBUG, "Talloc Report due to SIGUSR1\n"); @@ -621,13 +618,14 @@ } } - while (1) { + while (!quit) osmo_select_main(0); - } + osmo_gsup_server_destroy(g_hlr->gs); db_close(g_hlr->dbc); - log_fini(); - exit(0); + talloc_report_full(hlr_ctx, stderr); + + return 0; } -- To view, visit https://gerrit.osmocom.org/10222 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I0e2d673b420193e2bdc1a92377aca542f3a19229 Gerrit-Change-Number: 10222 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 07:08:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 07:08:21 +0000 Subject: Change in osmo-hlr[master]: hlr.c: free root talloc context on exit In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10223 ) Change subject: hlr.c: free root talloc context on exit ...................................................................... hlr.c: free root talloc context on exit This makes both ASAN and Valgrind happy, because they do expect all allocated heap chunks to be released on exit. Change-Id: I7345dec8d06b0b71a859c16132dc0008cfe17cba --- M src/hlr.c 1 file changed, 5 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/hlr.c b/src/hlr.c index 7fdb27e..6c0cb0a 100644 --- a/src/hlr.c +++ b/src/hlr.c @@ -625,7 +625,12 @@ db_close(g_hlr->dbc); log_fini(); + /** + * Report the heap state of root context, then free, + * so both ASAN and Valgrind are happy... + */ talloc_report_full(hlr_ctx, stderr); + talloc_free(hlr_ctx); return 0; } -- To view, visit https://gerrit.osmocom.org/10223 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I7345dec8d06b0b71a859c16132dc0008cfe17cba Gerrit-Change-Number: 10223 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 07:08:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 07:08:22 +0000 Subject: Change in osmo-hlr[master]: hlr.c: track the use of talloc NULL memory contexts In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10224 ) Change subject: hlr.c: track the use of talloc NULL memory contexts ...................................................................... hlr.c: track the use of talloc NULL memory contexts Tracking NULL memory contexts allows one to detect memory chunks allocated outside the application's root context, which in most cases are the result of some mistake. For example, the VTY implementation still uses the NULL context, so we have to clean up it manually until this is fixed. At the moment we have at least one chunk allocated outside the application's root context (excluding the VTY context): full talloc report on 'null_context' (total 24 bytes in 2 blocks) struct lookup_helper contains 24 bytes in 1 blocks Change-Id: I7ea86730e090c06b2a5966ae4d04b8144b1cd20a --- M src/hlr.c 1 file changed, 13 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/hlr.c b/src/hlr.c index 6c0cb0a..8732587 100644 --- a/src/hlr.c +++ b/src/hlr.c @@ -551,6 +551,9 @@ { int rc; + /* Track the use of talloc NULL memory contexts */ + talloc_enable_null_tracking(); + hlr_ctx = talloc_named_const(NULL, 1, "OsmoHLR"); msgb_talloc_ctx_init(hlr_ctx, 0); vty_info.tall_ctx = hlr_ctx; @@ -632,5 +635,15 @@ talloc_report_full(hlr_ctx, stderr); talloc_free(hlr_ctx); + /* FIXME: VTY code still uses NULL-context */ + talloc_free(tall_vty_ctx); + + /** + * Report the heap state of NULL context, then free, + * so both ASAN and Valgrind are happy... + */ + talloc_report_full(NULL, stderr); + talloc_disable_null_tracking(); + return 0; } -- To view, visit https://gerrit.osmocom.org/10224 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I7ea86730e090c06b2a5966ae4d04b8144b1cd20a Gerrit-Change-Number: 10224 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Mon Jul 30 07:17:09 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Mon, 30 Jul 2018 07:17:09 +0000 (UTC) Subject: =?UTF-8?Q?Jenkins_build_is_back_to_normal_:_master-osmo-bts_=C2=BB_sy?= =?UTF-8?Q?smo,superfemto=5Fv5.1,default,osmocom-master-debian9_#958?= In-Reply-To: <1478855809.113.1532911637639.JavaMail.jenkins@jenkins.osmocom.org> References: <1478855809.113.1532911637639.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <998317320.119.1532935029167.JavaMail.jenkins@jenkins.osmocom.org> See From jenkins at lists.osmocom.org Mon Jul 30 07:30:36 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Mon, 30 Jul 2018 07:30:36 +0000 (UTC) Subject: =?UTF-8?Q?Jenkins_build_is_back_to_normal_:_master-osmo-pcu_=C2=BB_ori?= =?UTF-8?Q?gin/nrw/litecell15,osmocom-master-debian9,lc15,True_#686?= Message-ID: <851620548.0.1532935836977.JavaMail.jenkins@jenkins.osmocom.org> See From jenkins at lists.osmocom.org Mon Jul 30 07:39:07 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Mon, 30 Jul 2018 07:39:07 +0000 (UTC) Subject: =?UTF-8?Q?Jenkins_build_is_back_to_normal_:_master-osmo-sgsn_=C2=BB_--en?= =?UTF-8?Q?able-iu,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#4587?= Message-ID: <369677831.1.1532936347224.JavaMail.jenkins@jenkins.osmocom.org> See From jenkins at lists.osmocom.org Mon Jul 30 08:32:25 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Mon, 30 Jul 2018 08:32:25 +0000 (UTC) Subject: =?UTF-8?Q?Jenkins_build_is_back_to_normal_?= =?UTF-8?Q?:_master-osmo-mgw_=C2=BB_--disable-mg?= =?UTF-8?Q?cp-transcoding,a2=3Ddefault,a3=3Ddef?= =?UTF-8?Q?ault,osmocom-master-debian9_#1214?= Message-ID: <518898367.3.1532939545274.JavaMail.jenkins@jenkins.osmocom.org> See From gerrit-no-reply at lists.osmocom.org Mon Jul 30 10:44:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 10:44:27 +0000 Subject: Change in libosmocore[master]: import oap_client into libosmogsm Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10236 Change subject: import oap_client into libosmogsm ...................................................................... import oap_client into libosmogsm This imports the code from osmo-msc 6afef893e17bce67e4d4119acd34d480ed03ba77 with minimal changes to make it compile. Symbol renaming to osmo_ prefix is done separately in a follow-up patch to have a as-clean-as-possible import first. Change-Id: I9bc38102318da02d1fe46ef516df3cfd6bf8e3da --- M include/Makefile.am A include/osmocom/gsm/oap_client.h M src/gsm/Makefile.am M src/gsm/libosmogsm.map A src/gsm/oap_client.c 5 files changed, 369 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/36/10236/1 diff --git a/include/Makefile.am b/include/Makefile.am index 38ba14c..ef8ec65 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -100,6 +100,7 @@ osmocom/gsm/prim.h \ osmocom/gsm/l1sap.h \ osmocom/gsm/oap.h \ + osmocom/gsm/oap_client.h \ osmocom/gsm/protocol/gsm_03_40.h \ osmocom/gsm/protocol/gsm_03_41.h \ osmocom/gsm/protocol/gsm_04_08.h \ diff --git a/include/osmocom/gsm/oap_client.h b/include/osmocom/gsm/oap_client.h new file mode 100644 index 0000000..80c86d5 --- /dev/null +++ b/include/osmocom/gsm/oap_client.h @@ -0,0 +1,82 @@ +/* Osmocom Authentication Protocol API */ + +/* (C) 2015 by Sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#pragma once + +#include + +struct msgb; +struct osmo_oap_message; + +/* This is the config part for vty. It is essentially copied in + * oap_client_state, where values are copied over once the config is + * considered valid. */ +struct oap_client_config { + uint16_t client_id; + int secret_k_present; + uint8_t secret_k[16]; + int secret_opc_present; + uint8_t secret_opc[16]; +}; + +/* The runtime state of the OAP client. client_id and the secrets are in fact + * duplicated from oap_client_config, so that a separate validation of the + * config data is possible, and so that only a struct oap_client_state* is + * passed around. */ +struct oap_client_state { + enum { + OAP_UNINITIALIZED = 0, /* just allocated. */ + OAP_DISABLED, /* disabled by config. */ + OAP_INITIALIZED, /* enabled, config is valid. */ + OAP_REQUESTED_CHALLENGE, + OAP_SENT_CHALLENGE_RESULT, + OAP_REGISTERED + } state; + uint16_t client_id; + uint8_t secret_k[16]; + uint8_t secret_opc[16]; + int registration_failures; +}; + +/* From config, initialize state. Return 0 on success. */ +int oap_client_init(struct oap_client_config *config, + struct oap_client_state *state); + +/* Construct an OAP registration message and return in *msg_tx. Use + * state->client_id and update state->state. + * Return 0 on success, or a negative value on error. + * If an error is returned, *msg_tx is guaranteed to be NULL. */ +int oap_client_register(struct oap_client_state *state, struct msgb **msg_tx); + +/* Decode and act on a received OAP message msg_rx. Update state->state. If a + * non-NULL pointer is returned in *msg_tx, that msgb should be sent to the OAP + * server (and freed) by the caller. The received msg_rx is not freed. + * Return 0 on success, or a negative value on error. + * If an error is returned, *msg_tx is guaranteed to be NULL. */ +int oap_client_handle(struct oap_client_state *state, + const struct msgb *msg_rx, struct msgb **msg_tx); + +/* Allocate a msgb and in it, return the encoded oap_client_msg. Return + * NULL on error. (Like oap_client_encode(), but also allocates a msgb.) + * About the name: the idea is do_something(oap_client_encoded(my_struct)) + */ +struct msgb *oap_client_encoded(const struct osmo_oap_message *oap_client_msg); diff --git a/src/gsm/Makefile.am b/src/gsm/Makefile.am index 900fcfa..29299a6 100644 --- a/src/gsm/Makefile.am +++ b/src/gsm/Makefile.am @@ -30,7 +30,7 @@ milenage/aes-internal.c milenage/aes-internal-enc.c \ milenage/milenage.c gan.c ipa.c gsm0341.c apn.c \ gsup.c gprs_gea.c gsm0503_conv.c oap.c gsm0808_utils.c \ - gsm23003.c mncc.c bts_features.c + gsm23003.c mncc.c bts_features.c oap_client.c libgsmint_la_LDFLAGS = -no-undefined libgsmint_la_LIBADD = $(top_builddir)/src/libosmocore.la diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index b44cfd2..6eb60cc 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -493,5 +493,10 @@ osmo_mncc_names; _osmo_mncc_log; +oap_client_encoded; +oap_client_handle; +oap_client_init; +oap_client_register; + local: *; }; diff --git a/src/gsm/oap_client.c b/src/gsm/oap_client.c new file mode 100644 index 0000000..2227a3c --- /dev/null +++ b/src/gsm/oap_client.c @@ -0,0 +1,280 @@ +/* Osmocom Authentication Protocol API */ + +/* (C) 2015 by Sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include + +#include +#include +#include +#include + +#include + +int oap_client_init(struct oap_client_config *config, + struct oap_client_state *state) +{ + OSMO_ASSERT(state->state == OAP_UNINITIALIZED); + + if (!config) + goto disable; + + if (config->client_id == 0) + goto disable; + + if (config->secret_k_present == 0) { + LOGP(DLOAP, LOGL_NOTICE, "OAP: client ID set, but secret K missing.\n"); + goto disable; + } + + if (config->secret_opc_present == 0) { + LOGP(DLOAP, LOGL_NOTICE, "OAP: client ID set, but secret OPC missing.\n"); + goto disable; + } + + state->client_id = config->client_id; + memcpy(state->secret_k, config->secret_k, sizeof(state->secret_k)); + memcpy(state->secret_opc, config->secret_opc, sizeof(state->secret_opc)); + state->state = OAP_INITIALIZED; + return 0; + +disable: + state->state = OAP_DISABLED; + return 0; +} + +/* From the given state and received RAND and AUTN octets, validate the + * server's authenticity and formulate the matching milenage reply octets in + * *tx_xres. The state is not modified. + * On success, and if tx_res is not NULL, exactly 8 octets will be written to + * *tx_res. If not NULL, tx_res must point at allocated memory of at least 8 + * octets. The caller will want to send XRES back to the server in a challenge + * response message and update the state. + * Return 0 on success; -1 if OAP is disabled; -2 if rx_random and rx_autn fail + * the authentication check; -3 for any other errors. */ +static int oap_evaluate_challenge(const struct oap_client_state *state, + const uint8_t *rx_random, + const uint8_t *rx_autn, + uint8_t *tx_xres) +{ + struct osmo_auth_vector vec; + + struct osmo_sub_auth_data auth = { + .type = OSMO_AUTH_TYPE_UMTS, + .algo = OSMO_AUTH_ALG_MILENAGE, + }; + + osmo_static_assert(sizeof(((struct osmo_sub_auth_data*)0)->u.umts.k) + == sizeof(state->secret_k), _secret_k_size_match); + osmo_static_assert(sizeof(((struct osmo_sub_auth_data*)0)->u.umts.opc) + == sizeof(state->secret_opc), _secret_opc_size_match); + + switch (state->state) { + case OAP_UNINITIALIZED: + case OAP_DISABLED: + return -1; + default: + break; + } + + memcpy(auth.u.umts.k, state->secret_k, sizeof(auth.u.umts.k)); + memcpy(auth.u.umts.opc, state->secret_opc, sizeof(auth.u.umts.opc)); + memset(auth.u.umts.amf, '\0', sizeof(auth.u.umts.amf)); + auth.u.umts.sqn = 41; /* TODO use incrementing sequence nr */ + + memset(&vec, 0, sizeof(vec)); + osmo_auth_gen_vec(&vec, &auth, rx_random); + + if (vec.res_len != 8) { + LOGP(DLOAP, LOGL_ERROR, "OAP: Expected XRES to be 8 octets, got %d\n", + vec.res_len); + return -3; + } + + if (osmo_constant_time_cmp(vec.autn, rx_autn, sizeof(vec.autn)) != 0) { + LOGP(DLOAP, LOGL_ERROR, "OAP: AUTN mismatch!\n"); + LOGP(DLOAP, LOGL_INFO, "OAP: AUTN from server: %s\n", + osmo_hexdump_nospc(rx_autn, sizeof(vec.autn))); + LOGP(DLOAP, LOGL_INFO, "OAP: AUTN expected: %s\n", + osmo_hexdump_nospc(vec.autn, sizeof(vec.autn))); + return -2; + } + + if (tx_xres != NULL) + memcpy(tx_xres, vec.res, 8); + return 0; +} + +struct msgb *oap_client_encoded(const struct osmo_oap_message *oap_msg) +{ + struct msgb *msg = msgb_alloc_headroom(1000, 64, __func__); + OSMO_ASSERT(msg); + osmo_oap_encode(msg, oap_msg); + return msg; +} + +/* Create a new msgb containing an OAP registration message. + * On error, return NULL. */ +static struct msgb* oap_msg_register(uint16_t client_id) +{ + struct osmo_oap_message oap_msg = {0}; + + if (client_id < 1) { + LOGP(DLOAP, LOGL_ERROR, "OAP: Invalid client ID: %d\n", client_id); + return NULL; + } + + oap_msg.message_type = OAP_MSGT_REGISTER_REQUEST; + oap_msg.client_id = client_id; + return oap_client_encoded(&oap_msg); +} + +int oap_client_register(struct oap_client_state *state, struct msgb **msg_tx) +{ + *msg_tx = oap_msg_register(state->client_id); + if (!(*msg_tx)) + return -1; + + state->state = OAP_REQUESTED_CHALLENGE; + return 0; +} + +/* Create a new msgb containing an OAP challenge response message. + * xres must point at 8 octets to return as challenge response. + * On error, return NULL. */ +static struct msgb* oap_msg_challenge_response(uint8_t *xres) +{ + struct osmo_oap_message oap_reply = {0}; + + oap_reply.message_type = OAP_MSGT_CHALLENGE_RESULT; + memcpy(oap_reply.xres, xres, sizeof(oap_reply.xres)); + oap_reply.xres_present = 1; + return oap_client_encoded(&oap_reply); +} + +static int handle_challenge(struct oap_client_state *state, + struct osmo_oap_message *oap_rx, + struct msgb **msg_tx) +{ + int rc; + uint8_t xres[8]; + + if (!(oap_rx->rand_present && oap_rx->autn_present)) { + LOGP(DLOAP, LOGL_ERROR, + "OAP challenge incomplete (rand_present: %d, autn_present: %d)\n", + oap_rx->rand_present, oap_rx->autn_present); + rc = -2; + goto failure; + } + + rc = oap_evaluate_challenge(state, + oap_rx->rand, + oap_rx->autn, + xres); + if (rc < 0) + goto failure; + + *msg_tx = oap_msg_challenge_response(xres); + if ((*msg_tx) == NULL) { + rc = -1; + goto failure; + } + + state->state = OAP_SENT_CHALLENGE_RESULT; + return 0; + +failure: + OSMO_ASSERT(rc < 0); + state->state = OAP_INITIALIZED; + return rc; +} + +int oap_client_handle(struct oap_client_state *state, + const struct msgb *msg_rx, struct msgb **msg_tx) +{ + uint8_t *data = msgb_l2(msg_rx); + size_t data_len = msgb_l2len(msg_rx); + struct osmo_oap_message oap_msg = {0}; + int rc = 0; + + *msg_tx = NULL; + + OSMO_ASSERT(data); + + rc = osmo_oap_decode(&oap_msg, data, data_len); + if (rc < 0) { + LOGP(DLOAP, LOGL_ERROR, + "Decoding OAP message failed with error '%s' (%d)\n", + get_value_string(gsm48_gmm_cause_names, -rc), -rc); + return -10; + } + + switch (state->state) { + case OAP_UNINITIALIZED: + LOGP(DLOAP, LOGL_ERROR, + "Received OAP message %d, but the OAP client is" + " not initialized\n", oap_msg.message_type); + return -ENOTCONN; + case OAP_DISABLED: + LOGP(DLOAP, LOGL_ERROR, + "Received OAP message %d, but the OAP client is" + " disabled\n", oap_msg.message_type); + return -ENOTCONN; + default: + break; + } + + switch (oap_msg.message_type) { + case OAP_MSGT_CHALLENGE_REQUEST: + return handle_challenge(state, &oap_msg, msg_tx); + + case OAP_MSGT_REGISTER_RESULT: + /* successfully registered */ + state->state = OAP_REGISTERED; + break; + + case OAP_MSGT_REGISTER_ERROR: + LOGP(DLOAP, LOGL_ERROR, + "OAP registration failed\n"); + state->state = OAP_INITIALIZED; + if (state->registration_failures < 3) { + state->registration_failures++; + return oap_client_register(state, msg_tx); + } + return -11; + + case OAP_MSGT_REGISTER_REQUEST: + case OAP_MSGT_CHALLENGE_RESULT: + LOGP(DLOAP, LOGL_ERROR, + "Received invalid OAP message type for OAP client side: %d\n", + (int)oap_msg.message_type); + return -12; + + default: + LOGP(DLOAP, LOGL_ERROR, + "Unknown OAP message type: %d\n", + (int)oap_msg.message_type); + return -13; + } + + return 0; +} -- To view, visit https://gerrit.osmocom.org/10236 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I9bc38102318da02d1fe46ef516df3cfd6bf8e3da Gerrit-Change-Number: 10236 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 10:44:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 10:44:27 +0000 Subject: Change in libosmocore[master]: oap_client: Rename symbols with osmo_ prefix Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10237 Change subject: oap_client: Rename symbols with osmo_ prefix ...................................................................... oap_client: Rename symbols with osmo_ prefix As we're moving this to a common/shared library now, we need to use the osmo_ namespace prefix for symbol names, struct/type names and constants. Change-Id: Ie36729996abd30b84d1c30a09f62ebc6a9794950 --- M include/osmocom/gsm/oap_client.h M src/gsm/libosmogsm.map M src/gsm/oap_client.c 3 files changed, 42 insertions(+), 42 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/37/10237/1 diff --git a/include/osmocom/gsm/oap_client.h b/include/osmocom/gsm/oap_client.h index 80c86d5..763f982 100644 --- a/include/osmocom/gsm/oap_client.h +++ b/include/osmocom/gsm/oap_client.h @@ -30,7 +30,7 @@ /* This is the config part for vty. It is essentially copied in * oap_client_state, where values are copied over once the config is * considered valid. */ -struct oap_client_config { +struct osmo_oap_client_config { uint16_t client_id; int secret_k_present; uint8_t secret_k[16]; @@ -42,14 +42,14 @@ * duplicated from oap_client_config, so that a separate validation of the * config data is possible, and so that only a struct oap_client_state* is * passed around. */ -struct oap_client_state { +struct osmo_oap_client_state { enum { - OAP_UNINITIALIZED = 0, /* just allocated. */ - OAP_DISABLED, /* disabled by config. */ - OAP_INITIALIZED, /* enabled, config is valid. */ - OAP_REQUESTED_CHALLENGE, - OAP_SENT_CHALLENGE_RESULT, - OAP_REGISTERED + OSMO_OAP_UNINITIALIZED = 0, /* just allocated. */ + OSMO_OAP_DISABLED, /* disabled by config. */ + OSMO_OAP_INITIALIZED, /* enabled, config is valid. */ + OSMO_OAP_REQUESTED_CHALLENGE, + OSMO_OAP_SENT_CHALLENGE_RESULT, + OSMO_OAP_REGISTERED } state; uint16_t client_id; uint8_t secret_k[16]; @@ -58,25 +58,25 @@ }; /* From config, initialize state. Return 0 on success. */ -int oap_client_init(struct oap_client_config *config, - struct oap_client_state *state); +int osmo_oap_client_init(struct osmo_oap_client_config *config, + struct osmo_oap_client_state *state); /* Construct an OAP registration message and return in *msg_tx. Use * state->client_id and update state->state. * Return 0 on success, or a negative value on error. * If an error is returned, *msg_tx is guaranteed to be NULL. */ -int oap_client_register(struct oap_client_state *state, struct msgb **msg_tx); +int osmo_oap_client_register(struct osmo_oap_client_state *state, struct msgb **msg_tx); /* Decode and act on a received OAP message msg_rx. Update state->state. If a * non-NULL pointer is returned in *msg_tx, that msgb should be sent to the OAP * server (and freed) by the caller. The received msg_rx is not freed. * Return 0 on success, or a negative value on error. * If an error is returned, *msg_tx is guaranteed to be NULL. */ -int oap_client_handle(struct oap_client_state *state, - const struct msgb *msg_rx, struct msgb **msg_tx); +int osmo_oap_client_handle(struct osmo_oap_client_state *state, + const struct msgb *msg_rx, struct msgb **msg_tx); /* Allocate a msgb and in it, return the encoded oap_client_msg. Return * NULL on error. (Like oap_client_encode(), but also allocates a msgb.) * About the name: the idea is do_something(oap_client_encoded(my_struct)) */ -struct msgb *oap_client_encoded(const struct osmo_oap_message *oap_client_msg); +struct msgb *osmo_oap_client_encoded(const struct osmo_oap_message *oap_client_msg); diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 6eb60cc..bc9ed52 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -493,10 +493,10 @@ osmo_mncc_names; _osmo_mncc_log; -oap_client_encoded; -oap_client_handle; -oap_client_init; -oap_client_register; +osmo_oap_client_encoded; +osmo_oap_client_handle; +osmo_oap_client_init; +osmo_oap_client_register; local: *; }; diff --git a/src/gsm/oap_client.c b/src/gsm/oap_client.c index 2227a3c..26b0fe0 100644 --- a/src/gsm/oap_client.c +++ b/src/gsm/oap_client.c @@ -28,12 +28,12 @@ #include #include -#include +#include -int oap_client_init(struct oap_client_config *config, - struct oap_client_state *state) +int osmo_oap_client_init(struct osmo_oap_client_config *config, + struct osmo_oap_client_state *state) { - OSMO_ASSERT(state->state == OAP_UNINITIALIZED); + OSMO_ASSERT(state->state == OSMO_OAP_UNINITIALIZED); if (!config) goto disable; @@ -54,11 +54,11 @@ state->client_id = config->client_id; memcpy(state->secret_k, config->secret_k, sizeof(state->secret_k)); memcpy(state->secret_opc, config->secret_opc, sizeof(state->secret_opc)); - state->state = OAP_INITIALIZED; + state->state = OSMO_OAP_INITIALIZED; return 0; disable: - state->state = OAP_DISABLED; + state->state = OSMO_OAP_DISABLED; return 0; } @@ -71,7 +71,7 @@ * response message and update the state. * Return 0 on success; -1 if OAP is disabled; -2 if rx_random and rx_autn fail * the authentication check; -3 for any other errors. */ -static int oap_evaluate_challenge(const struct oap_client_state *state, +static int oap_evaluate_challenge(const struct osmo_oap_client_state *state, const uint8_t *rx_random, const uint8_t *rx_autn, uint8_t *tx_xres) @@ -89,8 +89,8 @@ == sizeof(state->secret_opc), _secret_opc_size_match); switch (state->state) { - case OAP_UNINITIALIZED: - case OAP_DISABLED: + case OSMO_OAP_UNINITIALIZED: + case OSMO_OAP_DISABLED: return -1; default: break; @@ -124,7 +124,7 @@ return 0; } -struct msgb *oap_client_encoded(const struct osmo_oap_message *oap_msg) +struct msgb *osmo_oap_client_encoded(const struct osmo_oap_message *oap_msg) { struct msgb *msg = msgb_alloc_headroom(1000, 64, __func__); OSMO_ASSERT(msg); @@ -145,16 +145,16 @@ oap_msg.message_type = OAP_MSGT_REGISTER_REQUEST; oap_msg.client_id = client_id; - return oap_client_encoded(&oap_msg); + return osmo_oap_client_encoded(&oap_msg); } -int oap_client_register(struct oap_client_state *state, struct msgb **msg_tx) +int osmo_oap_client_register(struct osmo_oap_client_state *state, struct msgb **msg_tx) { *msg_tx = oap_msg_register(state->client_id); if (!(*msg_tx)) return -1; - state->state = OAP_REQUESTED_CHALLENGE; + state->state = OSMO_OAP_REQUESTED_CHALLENGE; return 0; } @@ -168,10 +168,10 @@ oap_reply.message_type = OAP_MSGT_CHALLENGE_RESULT; memcpy(oap_reply.xres, xres, sizeof(oap_reply.xres)); oap_reply.xres_present = 1; - return oap_client_encoded(&oap_reply); + return osmo_oap_client_encoded(&oap_reply); } -static int handle_challenge(struct oap_client_state *state, +static int handle_challenge(struct osmo_oap_client_state *state, struct osmo_oap_message *oap_rx, struct msgb **msg_tx) { @@ -199,17 +199,17 @@ goto failure; } - state->state = OAP_SENT_CHALLENGE_RESULT; + state->state = OSMO_OAP_SENT_CHALLENGE_RESULT; return 0; failure: OSMO_ASSERT(rc < 0); - state->state = OAP_INITIALIZED; + state->state = OSMO_OAP_INITIALIZED; return rc; } -int oap_client_handle(struct oap_client_state *state, - const struct msgb *msg_rx, struct msgb **msg_tx) +int osmo_oap_client_handle(struct osmo_oap_client_state *state, + const struct msgb *msg_rx, struct msgb **msg_tx) { uint8_t *data = msgb_l2(msg_rx); size_t data_len = msgb_l2len(msg_rx); @@ -229,12 +229,12 @@ } switch (state->state) { - case OAP_UNINITIALIZED: + case OSMO_OAP_UNINITIALIZED: LOGP(DLOAP, LOGL_ERROR, "Received OAP message %d, but the OAP client is" " not initialized\n", oap_msg.message_type); return -ENOTCONN; - case OAP_DISABLED: + case OSMO_OAP_DISABLED: LOGP(DLOAP, LOGL_ERROR, "Received OAP message %d, but the OAP client is" " disabled\n", oap_msg.message_type); @@ -249,16 +249,16 @@ case OAP_MSGT_REGISTER_RESULT: /* successfully registered */ - state->state = OAP_REGISTERED; + state->state = OSMO_OAP_REGISTERED; break; case OAP_MSGT_REGISTER_ERROR: LOGP(DLOAP, LOGL_ERROR, "OAP registration failed\n"); - state->state = OAP_INITIALIZED; + state->state = OSMO_OAP_INITIALIZED; if (state->registration_failures < 3) { state->registration_failures++; - return oap_client_register(state, msg_tx); + return osmo_oap_client_register(state, msg_tx); } return -11; -- To view, visit https://gerrit.osmocom.org/10237 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ie36729996abd30b84d1c30a09f62ebc6a9794950 Gerrit-Change-Number: 10237 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 10:46:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 10:46:20 +0000 Subject: Change in osmo-hlr[master]: oap_client: rename oa_* to osmo_oap_* In-Reply-To: References: Message-ID: Harald Welte has abandoned this change. ( https://gerrit.osmocom.org/10115 ) Change subject: oap_client: rename oa_* to osmo_oap_* ...................................................................... Abandoned oap_client goes to libosmocore. -- To view, visit https://gerrit.osmocom.org/10115 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: Ifa777de6293bac5d4817c11dc2420fa6631c8b41 Gerrit-Change-Number: 10115 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 10:49:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 10:49:47 +0000 Subject: Change in libosmocore[master]: import oap_client into libosmogsm In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10236 ) Change subject: import oap_client into libosmogsm ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10236 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9bc38102318da02d1fe46ef516df3cfd6bf8e3da Gerrit-Change-Number: 10236 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 30 Jul 2018 10:49:47 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 10:51:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 10:51:18 +0000 Subject: Change in libosmocore[master]: oap_client: Rename symbols with osmo_ prefix In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10237 to look at the new patch set (#2). Change subject: oap_client: Rename symbols with osmo_ prefix ...................................................................... oap_client: Rename symbols with osmo_ prefix As we're moving this to a common/shared library now, we need to use the osmo_ namespace prefix for symbol names, struct/type names and constants. Change-Id: Ie36729996abd30b84d1c30a09f62ebc6a9794950 --- M include/osmocom/gsm/oap_client.h M src/gsm/libosmogsm.map M src/gsm/oap_client.c 3 files changed, 41 insertions(+), 41 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/37/10237/2 -- To view, visit https://gerrit.osmocom.org/10237 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie36729996abd30b84d1c30a09f62ebc6a9794950 Gerrit-Change-Number: 10237 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 10:57:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 10:57:41 +0000 Subject: Change in libosmocore[master]: oap_client: Rename symbols with osmo_ prefix In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10237 ) Change subject: oap_client: Rename symbols with osmo_ prefix ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10237 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie36729996abd30b84d1c30a09f62ebc6a9794950 Gerrit-Change-Number: 10237 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 30 Jul 2018 10:57:41 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 10:57:43 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 10:57:43 +0000 Subject: Change in libosmocore[master]: import oap_client into libosmogsm In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10236 ) Change subject: import oap_client into libosmogsm ...................................................................... import oap_client into libosmogsm This imports the code from osmo-msc 6afef893e17bce67e4d4119acd34d480ed03ba77 with minimal changes to make it compile. Symbol renaming to osmo_ prefix is done separately in a follow-up patch to have a as-clean-as-possible import first. Change-Id: I9bc38102318da02d1fe46ef516df3cfd6bf8e3da --- M include/Makefile.am A include/osmocom/gsm/oap_client.h M src/gsm/Makefile.am M src/gsm/libosmogsm.map A src/gsm/oap_client.c 5 files changed, 369 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/Makefile.am b/include/Makefile.am index 38ba14c..ef8ec65 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -100,6 +100,7 @@ osmocom/gsm/prim.h \ osmocom/gsm/l1sap.h \ osmocom/gsm/oap.h \ + osmocom/gsm/oap_client.h \ osmocom/gsm/protocol/gsm_03_40.h \ osmocom/gsm/protocol/gsm_03_41.h \ osmocom/gsm/protocol/gsm_04_08.h \ diff --git a/include/osmocom/gsm/oap_client.h b/include/osmocom/gsm/oap_client.h new file mode 100644 index 0000000..80c86d5 --- /dev/null +++ b/include/osmocom/gsm/oap_client.h @@ -0,0 +1,82 @@ +/* Osmocom Authentication Protocol API */ + +/* (C) 2015 by Sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#pragma once + +#include + +struct msgb; +struct osmo_oap_message; + +/* This is the config part for vty. It is essentially copied in + * oap_client_state, where values are copied over once the config is + * considered valid. */ +struct oap_client_config { + uint16_t client_id; + int secret_k_present; + uint8_t secret_k[16]; + int secret_opc_present; + uint8_t secret_opc[16]; +}; + +/* The runtime state of the OAP client. client_id and the secrets are in fact + * duplicated from oap_client_config, so that a separate validation of the + * config data is possible, and so that only a struct oap_client_state* is + * passed around. */ +struct oap_client_state { + enum { + OAP_UNINITIALIZED = 0, /* just allocated. */ + OAP_DISABLED, /* disabled by config. */ + OAP_INITIALIZED, /* enabled, config is valid. */ + OAP_REQUESTED_CHALLENGE, + OAP_SENT_CHALLENGE_RESULT, + OAP_REGISTERED + } state; + uint16_t client_id; + uint8_t secret_k[16]; + uint8_t secret_opc[16]; + int registration_failures; +}; + +/* From config, initialize state. Return 0 on success. */ +int oap_client_init(struct oap_client_config *config, + struct oap_client_state *state); + +/* Construct an OAP registration message and return in *msg_tx. Use + * state->client_id and update state->state. + * Return 0 on success, or a negative value on error. + * If an error is returned, *msg_tx is guaranteed to be NULL. */ +int oap_client_register(struct oap_client_state *state, struct msgb **msg_tx); + +/* Decode and act on a received OAP message msg_rx. Update state->state. If a + * non-NULL pointer is returned in *msg_tx, that msgb should be sent to the OAP + * server (and freed) by the caller. The received msg_rx is not freed. + * Return 0 on success, or a negative value on error. + * If an error is returned, *msg_tx is guaranteed to be NULL. */ +int oap_client_handle(struct oap_client_state *state, + const struct msgb *msg_rx, struct msgb **msg_tx); + +/* Allocate a msgb and in it, return the encoded oap_client_msg. Return + * NULL on error. (Like oap_client_encode(), but also allocates a msgb.) + * About the name: the idea is do_something(oap_client_encoded(my_struct)) + */ +struct msgb *oap_client_encoded(const struct osmo_oap_message *oap_client_msg); diff --git a/src/gsm/Makefile.am b/src/gsm/Makefile.am index 900fcfa..29299a6 100644 --- a/src/gsm/Makefile.am +++ b/src/gsm/Makefile.am @@ -30,7 +30,7 @@ milenage/aes-internal.c milenage/aes-internal-enc.c \ milenage/milenage.c gan.c ipa.c gsm0341.c apn.c \ gsup.c gprs_gea.c gsm0503_conv.c oap.c gsm0808_utils.c \ - gsm23003.c mncc.c bts_features.c + gsm23003.c mncc.c bts_features.c oap_client.c libgsmint_la_LDFLAGS = -no-undefined libgsmint_la_LIBADD = $(top_builddir)/src/libosmocore.la diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index b44cfd2..6eb60cc 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -493,5 +493,10 @@ osmo_mncc_names; _osmo_mncc_log; +oap_client_encoded; +oap_client_handle; +oap_client_init; +oap_client_register; + local: *; }; diff --git a/src/gsm/oap_client.c b/src/gsm/oap_client.c new file mode 100644 index 0000000..2227a3c --- /dev/null +++ b/src/gsm/oap_client.c @@ -0,0 +1,280 @@ +/* Osmocom Authentication Protocol API */ + +/* (C) 2015 by Sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include + +#include +#include +#include +#include + +#include + +int oap_client_init(struct oap_client_config *config, + struct oap_client_state *state) +{ + OSMO_ASSERT(state->state == OAP_UNINITIALIZED); + + if (!config) + goto disable; + + if (config->client_id == 0) + goto disable; + + if (config->secret_k_present == 0) { + LOGP(DLOAP, LOGL_NOTICE, "OAP: client ID set, but secret K missing.\n"); + goto disable; + } + + if (config->secret_opc_present == 0) { + LOGP(DLOAP, LOGL_NOTICE, "OAP: client ID set, but secret OPC missing.\n"); + goto disable; + } + + state->client_id = config->client_id; + memcpy(state->secret_k, config->secret_k, sizeof(state->secret_k)); + memcpy(state->secret_opc, config->secret_opc, sizeof(state->secret_opc)); + state->state = OAP_INITIALIZED; + return 0; + +disable: + state->state = OAP_DISABLED; + return 0; +} + +/* From the given state and received RAND and AUTN octets, validate the + * server's authenticity and formulate the matching milenage reply octets in + * *tx_xres. The state is not modified. + * On success, and if tx_res is not NULL, exactly 8 octets will be written to + * *tx_res. If not NULL, tx_res must point at allocated memory of at least 8 + * octets. The caller will want to send XRES back to the server in a challenge + * response message and update the state. + * Return 0 on success; -1 if OAP is disabled; -2 if rx_random and rx_autn fail + * the authentication check; -3 for any other errors. */ +static int oap_evaluate_challenge(const struct oap_client_state *state, + const uint8_t *rx_random, + const uint8_t *rx_autn, + uint8_t *tx_xres) +{ + struct osmo_auth_vector vec; + + struct osmo_sub_auth_data auth = { + .type = OSMO_AUTH_TYPE_UMTS, + .algo = OSMO_AUTH_ALG_MILENAGE, + }; + + osmo_static_assert(sizeof(((struct osmo_sub_auth_data*)0)->u.umts.k) + == sizeof(state->secret_k), _secret_k_size_match); + osmo_static_assert(sizeof(((struct osmo_sub_auth_data*)0)->u.umts.opc) + == sizeof(state->secret_opc), _secret_opc_size_match); + + switch (state->state) { + case OAP_UNINITIALIZED: + case OAP_DISABLED: + return -1; + default: + break; + } + + memcpy(auth.u.umts.k, state->secret_k, sizeof(auth.u.umts.k)); + memcpy(auth.u.umts.opc, state->secret_opc, sizeof(auth.u.umts.opc)); + memset(auth.u.umts.amf, '\0', sizeof(auth.u.umts.amf)); + auth.u.umts.sqn = 41; /* TODO use incrementing sequence nr */ + + memset(&vec, 0, sizeof(vec)); + osmo_auth_gen_vec(&vec, &auth, rx_random); + + if (vec.res_len != 8) { + LOGP(DLOAP, LOGL_ERROR, "OAP: Expected XRES to be 8 octets, got %d\n", + vec.res_len); + return -3; + } + + if (osmo_constant_time_cmp(vec.autn, rx_autn, sizeof(vec.autn)) != 0) { + LOGP(DLOAP, LOGL_ERROR, "OAP: AUTN mismatch!\n"); + LOGP(DLOAP, LOGL_INFO, "OAP: AUTN from server: %s\n", + osmo_hexdump_nospc(rx_autn, sizeof(vec.autn))); + LOGP(DLOAP, LOGL_INFO, "OAP: AUTN expected: %s\n", + osmo_hexdump_nospc(vec.autn, sizeof(vec.autn))); + return -2; + } + + if (tx_xres != NULL) + memcpy(tx_xres, vec.res, 8); + return 0; +} + +struct msgb *oap_client_encoded(const struct osmo_oap_message *oap_msg) +{ + struct msgb *msg = msgb_alloc_headroom(1000, 64, __func__); + OSMO_ASSERT(msg); + osmo_oap_encode(msg, oap_msg); + return msg; +} + +/* Create a new msgb containing an OAP registration message. + * On error, return NULL. */ +static struct msgb* oap_msg_register(uint16_t client_id) +{ + struct osmo_oap_message oap_msg = {0}; + + if (client_id < 1) { + LOGP(DLOAP, LOGL_ERROR, "OAP: Invalid client ID: %d\n", client_id); + return NULL; + } + + oap_msg.message_type = OAP_MSGT_REGISTER_REQUEST; + oap_msg.client_id = client_id; + return oap_client_encoded(&oap_msg); +} + +int oap_client_register(struct oap_client_state *state, struct msgb **msg_tx) +{ + *msg_tx = oap_msg_register(state->client_id); + if (!(*msg_tx)) + return -1; + + state->state = OAP_REQUESTED_CHALLENGE; + return 0; +} + +/* Create a new msgb containing an OAP challenge response message. + * xres must point at 8 octets to return as challenge response. + * On error, return NULL. */ +static struct msgb* oap_msg_challenge_response(uint8_t *xres) +{ + struct osmo_oap_message oap_reply = {0}; + + oap_reply.message_type = OAP_MSGT_CHALLENGE_RESULT; + memcpy(oap_reply.xres, xres, sizeof(oap_reply.xres)); + oap_reply.xres_present = 1; + return oap_client_encoded(&oap_reply); +} + +static int handle_challenge(struct oap_client_state *state, + struct osmo_oap_message *oap_rx, + struct msgb **msg_tx) +{ + int rc; + uint8_t xres[8]; + + if (!(oap_rx->rand_present && oap_rx->autn_present)) { + LOGP(DLOAP, LOGL_ERROR, + "OAP challenge incomplete (rand_present: %d, autn_present: %d)\n", + oap_rx->rand_present, oap_rx->autn_present); + rc = -2; + goto failure; + } + + rc = oap_evaluate_challenge(state, + oap_rx->rand, + oap_rx->autn, + xres); + if (rc < 0) + goto failure; + + *msg_tx = oap_msg_challenge_response(xres); + if ((*msg_tx) == NULL) { + rc = -1; + goto failure; + } + + state->state = OAP_SENT_CHALLENGE_RESULT; + return 0; + +failure: + OSMO_ASSERT(rc < 0); + state->state = OAP_INITIALIZED; + return rc; +} + +int oap_client_handle(struct oap_client_state *state, + const struct msgb *msg_rx, struct msgb **msg_tx) +{ + uint8_t *data = msgb_l2(msg_rx); + size_t data_len = msgb_l2len(msg_rx); + struct osmo_oap_message oap_msg = {0}; + int rc = 0; + + *msg_tx = NULL; + + OSMO_ASSERT(data); + + rc = osmo_oap_decode(&oap_msg, data, data_len); + if (rc < 0) { + LOGP(DLOAP, LOGL_ERROR, + "Decoding OAP message failed with error '%s' (%d)\n", + get_value_string(gsm48_gmm_cause_names, -rc), -rc); + return -10; + } + + switch (state->state) { + case OAP_UNINITIALIZED: + LOGP(DLOAP, LOGL_ERROR, + "Received OAP message %d, but the OAP client is" + " not initialized\n", oap_msg.message_type); + return -ENOTCONN; + case OAP_DISABLED: + LOGP(DLOAP, LOGL_ERROR, + "Received OAP message %d, but the OAP client is" + " disabled\n", oap_msg.message_type); + return -ENOTCONN; + default: + break; + } + + switch (oap_msg.message_type) { + case OAP_MSGT_CHALLENGE_REQUEST: + return handle_challenge(state, &oap_msg, msg_tx); + + case OAP_MSGT_REGISTER_RESULT: + /* successfully registered */ + state->state = OAP_REGISTERED; + break; + + case OAP_MSGT_REGISTER_ERROR: + LOGP(DLOAP, LOGL_ERROR, + "OAP registration failed\n"); + state->state = OAP_INITIALIZED; + if (state->registration_failures < 3) { + state->registration_failures++; + return oap_client_register(state, msg_tx); + } + return -11; + + case OAP_MSGT_REGISTER_REQUEST: + case OAP_MSGT_CHALLENGE_RESULT: + LOGP(DLOAP, LOGL_ERROR, + "Received invalid OAP message type for OAP client side: %d\n", + (int)oap_msg.message_type); + return -12; + + default: + LOGP(DLOAP, LOGL_ERROR, + "Unknown OAP message type: %d\n", + (int)oap_msg.message_type); + return -13; + } + + return 0; +} -- To view, visit https://gerrit.osmocom.org/10236 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I9bc38102318da02d1fe46ef516df3cfd6bf8e3da Gerrit-Change-Number: 10236 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 10:57:43 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 10:57:43 +0000 Subject: Change in libosmocore[master]: oap_client: Rename symbols with osmo_ prefix In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10237 ) Change subject: oap_client: Rename symbols with osmo_ prefix ...................................................................... oap_client: Rename symbols with osmo_ prefix As we're moving this to a common/shared library now, we need to use the osmo_ namespace prefix for symbol names, struct/type names and constants. Change-Id: Ie36729996abd30b84d1c30a09f62ebc6a9794950 --- M include/osmocom/gsm/oap_client.h M src/gsm/libosmogsm.map M src/gsm/oap_client.c 3 files changed, 41 insertions(+), 41 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmocom/gsm/oap_client.h b/include/osmocom/gsm/oap_client.h index 80c86d5..763f982 100644 --- a/include/osmocom/gsm/oap_client.h +++ b/include/osmocom/gsm/oap_client.h @@ -30,7 +30,7 @@ /* This is the config part for vty. It is essentially copied in * oap_client_state, where values are copied over once the config is * considered valid. */ -struct oap_client_config { +struct osmo_oap_client_config { uint16_t client_id; int secret_k_present; uint8_t secret_k[16]; @@ -42,14 +42,14 @@ * duplicated from oap_client_config, so that a separate validation of the * config data is possible, and so that only a struct oap_client_state* is * passed around. */ -struct oap_client_state { +struct osmo_oap_client_state { enum { - OAP_UNINITIALIZED = 0, /* just allocated. */ - OAP_DISABLED, /* disabled by config. */ - OAP_INITIALIZED, /* enabled, config is valid. */ - OAP_REQUESTED_CHALLENGE, - OAP_SENT_CHALLENGE_RESULT, - OAP_REGISTERED + OSMO_OAP_UNINITIALIZED = 0, /* just allocated. */ + OSMO_OAP_DISABLED, /* disabled by config. */ + OSMO_OAP_INITIALIZED, /* enabled, config is valid. */ + OSMO_OAP_REQUESTED_CHALLENGE, + OSMO_OAP_SENT_CHALLENGE_RESULT, + OSMO_OAP_REGISTERED } state; uint16_t client_id; uint8_t secret_k[16]; @@ -58,25 +58,25 @@ }; /* From config, initialize state. Return 0 on success. */ -int oap_client_init(struct oap_client_config *config, - struct oap_client_state *state); +int osmo_oap_client_init(struct osmo_oap_client_config *config, + struct osmo_oap_client_state *state); /* Construct an OAP registration message and return in *msg_tx. Use * state->client_id and update state->state. * Return 0 on success, or a negative value on error. * If an error is returned, *msg_tx is guaranteed to be NULL. */ -int oap_client_register(struct oap_client_state *state, struct msgb **msg_tx); +int osmo_oap_client_register(struct osmo_oap_client_state *state, struct msgb **msg_tx); /* Decode and act on a received OAP message msg_rx. Update state->state. If a * non-NULL pointer is returned in *msg_tx, that msgb should be sent to the OAP * server (and freed) by the caller. The received msg_rx is not freed. * Return 0 on success, or a negative value on error. * If an error is returned, *msg_tx is guaranteed to be NULL. */ -int oap_client_handle(struct oap_client_state *state, - const struct msgb *msg_rx, struct msgb **msg_tx); +int osmo_oap_client_handle(struct osmo_oap_client_state *state, + const struct msgb *msg_rx, struct msgb **msg_tx); /* Allocate a msgb and in it, return the encoded oap_client_msg. Return * NULL on error. (Like oap_client_encode(), but also allocates a msgb.) * About the name: the idea is do_something(oap_client_encoded(my_struct)) */ -struct msgb *oap_client_encoded(const struct osmo_oap_message *oap_client_msg); +struct msgb *osmo_oap_client_encoded(const struct osmo_oap_message *oap_client_msg); diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 6eb60cc..bc9ed52 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -493,10 +493,10 @@ osmo_mncc_names; _osmo_mncc_log; -oap_client_encoded; -oap_client_handle; -oap_client_init; -oap_client_register; +osmo_oap_client_encoded; +osmo_oap_client_handle; +osmo_oap_client_init; +osmo_oap_client_register; local: *; }; diff --git a/src/gsm/oap_client.c b/src/gsm/oap_client.c index 2227a3c..ea40634 100644 --- a/src/gsm/oap_client.c +++ b/src/gsm/oap_client.c @@ -30,10 +30,10 @@ #include -int oap_client_init(struct oap_client_config *config, - struct oap_client_state *state) +int osmo_oap_client_init(struct osmo_oap_client_config *config, + struct osmo_oap_client_state *state) { - OSMO_ASSERT(state->state == OAP_UNINITIALIZED); + OSMO_ASSERT(state->state == OSMO_OAP_UNINITIALIZED); if (!config) goto disable; @@ -54,11 +54,11 @@ state->client_id = config->client_id; memcpy(state->secret_k, config->secret_k, sizeof(state->secret_k)); memcpy(state->secret_opc, config->secret_opc, sizeof(state->secret_opc)); - state->state = OAP_INITIALIZED; + state->state = OSMO_OAP_INITIALIZED; return 0; disable: - state->state = OAP_DISABLED; + state->state = OSMO_OAP_DISABLED; return 0; } @@ -71,7 +71,7 @@ * response message and update the state. * Return 0 on success; -1 if OAP is disabled; -2 if rx_random and rx_autn fail * the authentication check; -3 for any other errors. */ -static int oap_evaluate_challenge(const struct oap_client_state *state, +static int oap_evaluate_challenge(const struct osmo_oap_client_state *state, const uint8_t *rx_random, const uint8_t *rx_autn, uint8_t *tx_xres) @@ -89,8 +89,8 @@ == sizeof(state->secret_opc), _secret_opc_size_match); switch (state->state) { - case OAP_UNINITIALIZED: - case OAP_DISABLED: + case OSMO_OAP_UNINITIALIZED: + case OSMO_OAP_DISABLED: return -1; default: break; @@ -124,7 +124,7 @@ return 0; } -struct msgb *oap_client_encoded(const struct osmo_oap_message *oap_msg) +struct msgb *osmo_oap_client_encoded(const struct osmo_oap_message *oap_msg) { struct msgb *msg = msgb_alloc_headroom(1000, 64, __func__); OSMO_ASSERT(msg); @@ -145,16 +145,16 @@ oap_msg.message_type = OAP_MSGT_REGISTER_REQUEST; oap_msg.client_id = client_id; - return oap_client_encoded(&oap_msg); + return osmo_oap_client_encoded(&oap_msg); } -int oap_client_register(struct oap_client_state *state, struct msgb **msg_tx) +int osmo_oap_client_register(struct osmo_oap_client_state *state, struct msgb **msg_tx) { *msg_tx = oap_msg_register(state->client_id); if (!(*msg_tx)) return -1; - state->state = OAP_REQUESTED_CHALLENGE; + state->state = OSMO_OAP_REQUESTED_CHALLENGE; return 0; } @@ -168,10 +168,10 @@ oap_reply.message_type = OAP_MSGT_CHALLENGE_RESULT; memcpy(oap_reply.xres, xres, sizeof(oap_reply.xres)); oap_reply.xres_present = 1; - return oap_client_encoded(&oap_reply); + return osmo_oap_client_encoded(&oap_reply); } -static int handle_challenge(struct oap_client_state *state, +static int handle_challenge(struct osmo_oap_client_state *state, struct osmo_oap_message *oap_rx, struct msgb **msg_tx) { @@ -199,17 +199,17 @@ goto failure; } - state->state = OAP_SENT_CHALLENGE_RESULT; + state->state = OSMO_OAP_SENT_CHALLENGE_RESULT; return 0; failure: OSMO_ASSERT(rc < 0); - state->state = OAP_INITIALIZED; + state->state = OSMO_OAP_INITIALIZED; return rc; } -int oap_client_handle(struct oap_client_state *state, - const struct msgb *msg_rx, struct msgb **msg_tx) +int osmo_oap_client_handle(struct osmo_oap_client_state *state, + const struct msgb *msg_rx, struct msgb **msg_tx) { uint8_t *data = msgb_l2(msg_rx); size_t data_len = msgb_l2len(msg_rx); @@ -229,12 +229,12 @@ } switch (state->state) { - case OAP_UNINITIALIZED: + case OSMO_OAP_UNINITIALIZED: LOGP(DLOAP, LOGL_ERROR, "Received OAP message %d, but the OAP client is" " not initialized\n", oap_msg.message_type); return -ENOTCONN; - case OAP_DISABLED: + case OSMO_OAP_DISABLED: LOGP(DLOAP, LOGL_ERROR, "Received OAP message %d, but the OAP client is" " disabled\n", oap_msg.message_type); @@ -249,16 +249,16 @@ case OAP_MSGT_REGISTER_RESULT: /* successfully registered */ - state->state = OAP_REGISTERED; + state->state = OSMO_OAP_REGISTERED; break; case OAP_MSGT_REGISTER_ERROR: LOGP(DLOAP, LOGL_ERROR, "OAP registration failed\n"); - state->state = OAP_INITIALIZED; + state->state = OSMO_OAP_INITIALIZED; if (state->registration_failures < 3) { state->registration_failures++; - return oap_client_register(state, msg_tx); + return osmo_oap_client_register(state, msg_tx); } return -11; -- To view, visit https://gerrit.osmocom.org/10237 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ie36729996abd30b84d1c30a09f62ebc6a9794950 Gerrit-Change-Number: 10237 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 11:00:07 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 11:00:07 +0000 Subject: Change in osmo-hlr[master]: import gsup_client.c as new libosmo-gsup-client In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10113 to look at the new patch set (#3). Change subject: import gsup_client.c as new libosmo-gsup-client ...................................................................... import gsup_client.c as new libosmo-gsup-client This imports the code from osmo-msc 6afef893e17bce67e4d4119acd34d480ed03ba77 with minimal changes to make it compile. Symbol renaming ot osmo_ prefix is done separately in a follow-up patch to have a as-clean-as-possible import first. Requires: libosmocore.git Change-Id Ie36729996abd30b84d1c30a09f62ebc6a9794950 Change-Id: Ief50054ad135551625b684ed8a0486f7af0b2940 --- M .gitignore M Makefile.am M configure.ac A include/Makefile.am A include/osmocom/gsupclient/gsup_client.h A libosmo-gsup-client.pc.in M src/Makefile.am A src/gsupclient/Makefile.am A src/gsupclient/gsup_client.c A src/gsupclient/gsup_test_client.c 10 files changed, 770 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/13/10113/3 -- To view, visit https://gerrit.osmocom.org/10113 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ief50054ad135551625b684ed8a0486f7af0b2940 Gerrit-Change-Number: 10113 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 11:00:07 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 11:00:07 +0000 Subject: Change in osmo-hlr[master]: gsup_client: rename gsup_client_* to osmo_gsup_client_* In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10114 to look at the new patch set (#3). Change subject: gsup_client: rename gsup_client_* to osmo_gsup_client_* ...................................................................... gsup_client: rename gsup_client_* to osmo_gsup_client_* As we're moving this to a common/shared library now, we need to use the osmo_ namespace prefix for symbol names, struct/type names and constants. Change-Id: I294f8f96af4c5daa2b128962534426e04909290e --- M include/osmocom/gsupclient/gsup_client.h M src/gsupclient/gsup_client.c 2 files changed, 42 insertions(+), 43 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/14/10114/3 -- To view, visit https://gerrit.osmocom.org/10114 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I294f8f96af4c5daa2b128962534426e04909290e Gerrit-Change-Number: 10114 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Mon Jul 30 11:03:25 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Mon, 30 Jul 2018 11:03:25 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-osmo-gmr_=C2=BB_a1=3Ddefau?= =?UTF-8?Q?lt,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#771?= Message-ID: <22747682.4.1532948605231.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 33.65 KB...] - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the 'LD_RUN_PATH' environment variable during linking - use the '-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to '/etc/ld.so.conf' See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- make[3]: Leaving directory ' make[2]: Leaving directory ' Making install in src/codec make[2]: Entering directory ' CC gsm620.lo CC ecu_fr.lo CC gsm690.lo CC gsm660.lo CC gsm610.lo CCLD libosmocodec.la make[3]: Entering directory ' make[3]: Nothing to be done for 'install-data-am'. /bin/mkdir -p ' /bin/bash ../../libtool --mode=install /usr/bin/install -c libosmocodec.la ' libtool: warning: relinking 'libosmocodec.la' libtool: install: (cd /bin/bash " --silent --tag CC --mode=relink gcc -Wall -g -O2 -DBUILDING_LIBOSMOCORE -Wall -version-info 1:1:1 -no-undefined -o libosmocodec.la -rpath gsm610.lo gsm620.lo gsm660.lo gsm690.lo ecu_fr.lo ../../src/libosmocore.la ) libtool: install: /usr/bin/install -c .libs/libosmocodec.so.0.1.1T libtool: install: (cd && { ln -s -f libosmocodec.so.0.1.1 libosmocodec.so.0 || { rm -f libosmocodec.so.0 && ln -s libosmocodec.so.0.1.1 libosmocodec.so.0; }; }) libtool: install: (cd && { ln -s -f libosmocodec.so.0.1.1 libosmocodec.so || { rm -f libosmocodec.so && ln -s libosmocodec.so.0.1.1 libosmocodec.so; }; }) libtool: install: /usr/bin/install -c .libs/libosmocodec.lai libtool: finish: PATH="/usr/local/bin:/usr/bin:/bin:/usr/games:/home/osmocom-build/bin:/sbin" ldconfig -n ---------------------------------------------------------------------- Libraries have been installed in: If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the '-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the 'LD_RUN_PATH' environment variable during linking - use the '-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to '/etc/ld.so.conf' See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- make[3]: Leaving directory ' make[2]: Leaving directory ' Making install in src/gsm make[2]: Entering directory ' GEN gsm0503_conv.c Generating convolutional codes... Generate 'xcch' definition Generate 'rach' definition Generate 'rach_ext' definition Generate 'sch' definition Generate 'cs2' definition Generate 'cs3' definition Generate 'cs2_np' definition Generate 'cs3_np' definition Generate 'tch_afs_12_2' definition Generate 'tch_afs_10_2' definition Generate 'tch_afs_7_95' definition Generate 'tch_afs_7_4' definition Generate 'tch_afs_6_7' definition Generate 'tch_afs_5_9' definition Generate 'tch_afs_5_15' definition Generate 'tch_afs_4_75' definition Generate 'tch_fr' definition Generate 'tch_hr' definition Generate 'tch_ahs_7_95' definition Generate 'tch_ahs_7_4' definition Generate 'tch_ahs_6_7' definition Generate 'tch_ahs_5_9' definition Generate 'tch_ahs_5_15' definition Generate 'tch_ahs_4_75' definition Generate 'mcs1_dl_hdr' definition Generate 'mcs1_ul_hdr' definition Generate 'mcs1' definition Generate 'mcs2' definition Generate 'mcs3' definition Generate 'mcs4' definition Generate 'mcs5_dl_hdr' definition Generate 'mcs5_ul_hdr' definition Generate 'mcs5' definition Generate 'mcs6' definition Generate 'mcs7_dl_hdr' definition Generate 'mcs7_ul_hdr' definition Generate 'mcs7' definition Generate 'mcs8' definition Generate 'mcs9' definition Generation complete. make install-am make[3]: Entering directory ' CC tlv_parser.lo CC a5.lo CC rsl.lo CC comp128.lo CC gsm48.lo CC rxlev_stat.lo CC comp128v23.lo CC gsm_utils.lo gsm_utils.c:112:9: note: #pragma message: including GnuTLS for getrandom fallback. #pragma message ("including GnuTLS for getrandom fallback.") ^~~~~~~ gsm_utils.c: In function ?osmo_get_rand_id?: gsm_utils.c:448:9: note: #pragma message: Using direct syscall access for getrandom(): consider upgrading to glibc >= 2.25 #pragma message ("Using direct syscall access for getrandom(): consider upgrading to glibc >= 2.25") ^~~~~~~ gsm_utils.c:456:9: note: #pragma message: Secure random failed: using GnuTLS fallback. #pragma message ("Secure random failed: using GnuTLS fallback.") ^~~~~~~ CC gsm48_ie.lo CC gsm0808.lo CC sysinfo.lo CC gprs_cipher_core.lo CC gprs_rlc.lo CC gsm0480.lo CC abis_nm.lo CC gsm0411_utils.lo CC gsm0502.lo CC gsm0411_smc.lo CC gsm0411_smr.lo CC gsm0414.lo CC lapd_core.lo CC lapdm.lo CC kasumi.lo CC gsm_04_08_gprs.lo CC auth_core.lo CC auth_comp128v1.lo CC auth_comp128v23.lo CC auth_milenage.lo CC gea.lo CC milenage/aes-internal.lo CC milenage/aes-internal-enc.lo CC milenage/milenage.lo CC gan.lo CC ipa.lo CC gsm0341.lo CC apn.lo CC gsup.lo CC gprs_gea.lo CC gsm0503_conv.lo CC oap.lo CC gsm0808_utils.lo CC gsm23003.lo CC mncc.lo CC bts_features.lo CC oap_client.lo CC milenage/aes-encblock.lo CCLD libgsmint.la ar: `u' modifier ignored since `D' is the default (see `U') CCLD libosmogsm.la make[4]: Entering directory ' make[4]: Nothing to be done for 'install-data-am'. /bin/mkdir -p ' /bin/bash ../../libtool --mode=install /usr/bin/install -c libosmogsm.la ' libtool: warning: relinking 'libosmogsm.la' libtool: install: (cd /bin/bash " --silent --tag CC --mode=relink gcc -Wall -g -O2 -DBUILDING_LIBOSMOCORE -Wall -Wl,--version-script=./libosmogsm.map -version-info 10:0:0 -no-undefined -o libosmogsm.la -rpath libgsmint.la -ltalloc -lgnutls ) libtool: install: /usr/bin/install -c .libs/libosmogsm.so.10.0.0T libtool: install: (cd && { ln -s -f libosmogsm.so.10.0.0 libosmogsm.so.10 || { rm -f libosmogsm.so.10 && ln -s libosmogsm.so.10.0.0 libosmogsm.so.10; }; }) libtool: install: (cd && { ln -s -f libosmogsm.so.10.0.0 libosmogsm.so || { rm -f libosmogsm.so && ln -s libosmogsm.so.10.0.0 libosmogsm.so; }; }) libtool: install: /usr/bin/install -c .libs/libosmogsm.lai libtool: finish: PATH="/usr/local/bin:/usr/bin:/bin:/usr/games:/home/osmocom-build/bin:/sbin" ldconfig -n ---------------------------------------------------------------------- Libraries have been installed in: If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the '-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the 'LD_RUN_PATH' environment variable during linking - use the '-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to '/etc/ld.so.conf' See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- make[4]: Leaving directory ' make[3]: Leaving directory ' make[2]: Leaving directory ' Making install in src/coding make[2]: Entering directory ' CC gsm0503_mapping.lo CC gsm0503_tables.lo CC gsm0503_interleaving.lo CC gsm0503_coding.lo CC gsm0503_parity.lo CCLD libosmocoding.la make[3]: Entering directory ' make[3]: Nothing to be done for 'install-data-am'. /bin/mkdir -p ' /bin/bash ../../libtool --mode=install /usr/bin/install -c libosmocoding.la ' libtool: warning: relinking 'libosmocoding.la' libtool: install: (cd /bin/bash " --silent --tag CC --mode=relink gcc -Wall -g -O2 -DBUILDING_LIBOSMOCORE -Wall -Wl,--version-script=./libosmocoding.map -version-info 1:1:1 -no-undefined -ltalloc -o libosmocoding.la -rpath gsm0503_interleaving.lo gsm0503_mapping.lo gsm0503_tables.lo gsm0503_parity.lo gsm0503_coding.lo ../libosmocore.la ../gsm/libosmogsm.la ../codec/libosmocodec.la ) libtool: install: /usr/bin/install -c .libs/libosmocoding.so.0.1.1T libtool: install: (cd && { ln -s -f libosmocoding.so.0.1.1 libosmocoding.so.0 || { rm -f libosmocoding.so.0 && ln -s libosmocoding.so.0.1.1 libosmocoding.so.0; }; }) libtool: install: (cd && { ln -s -f libosmocoding.so.0.1.1 libosmocoding.so || { rm -f libosmocoding.so && ln -s libosmocoding.so.0.1.1 libosmocoding.so; }; }) libtool: install: /usr/bin/install -c .libs/libosmocoding.lai libtool: finish: PATH="/usr/local/bin:/usr/bin:/bin:/usr/games:/home/osmocom-build/bin:/sbin" ldconfig -n ---------------------------------------------------------------------- Libraries have been installed in: If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the '-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the 'LD_RUN_PATH' environment variable during linking - use the '-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to '/etc/ld.so.conf' See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- make[3]: Leaving directory ' make[2]: Leaving directory ' Making install in src/gb make[2]: Entering directory ' CC gprs_ns.lo CC gprs_ns_vty.lo CC gprs_bssgp.lo CC gprs_bssgp_util.lo CC gprs_bssgp_vty.lo CC gprs_bssgp_bss.lo CC common_vty.lo CC gprs_ns_frgre.lo /bin/bash: line 2: 6601 Segmentation fault /bin/bash ../../libtool --silent --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../include -DBUILDING_LIBOSMOCORE -Wall -Wall -fno-strict-aliasing -g -O2 -DBUILDING_LIBOSMOCORE -Wall -MT gprs_ns_vty.lo -MD -MP -MF $depbase.Tpo -c -o gprs_ns_vty.lo gprs_ns_vty.c Makefile:485: recipe for target 'gprs_ns_vty.lo' failed make[2]: *** [gprs_ns_vty.lo] Error 139 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory ' Makefile:604: recipe for target 'install-recursive' failed make[1]: *** [install-recursive] Error 1 make[1]: Leaving directory ' Makefile:903: recipe for target 'install' failed make: *** [install] Error 2 Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From jenkins at lists.osmocom.org Mon Jul 30 11:06:13 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Mon, 30 Jul 2018 11:06:13 +0000 (UTC) Subject: =?UTF-8?Q?Jenkins_build_is_back_to_normal_:_master-osmo-bts_=C2=BB?= =?UTF-8?Q?_oct+trx,master,default,osmocom-master-debian9_#959?= Message-ID: <1943778820.5.1532948773945.JavaMail.jenkins@jenkins.osmocom.org> See From jenkins at lists.osmocom.org Mon Jul 30 11:06:22 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Mon, 30 Jul 2018 11:06:22 +0000 (UTC) Subject: =?UTF-8?Q?Jenkins_build_is_back_to_normal_:_master-osmo-bts?= =?UTF-8?Q?_=C2=BB_lc15,master,default,osmocom-master-debian9_#959?= Message-ID: <629271801.6.1532948782048.JavaMail.jenkins@jenkins.osmocom.org> See From jenkins at lists.osmocom.org Mon Jul 30 11:06:28 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Mon, 30 Jul 2018 11:06:28 +0000 (UTC) Subject: =?UTF-8?Q?Jenkins_build_is_back_to_normal_:_master-osmo-bts_=C2=BB_sy?= =?UTF-8?Q?smo,superfemto=5Fv3.1,default,osmocom-master-debian9_#959?= Message-ID: <2104052038.7.1532948788836.JavaMail.jenkins@jenkins.osmocom.org> See From jenkins at lists.osmocom.org Mon Jul 30 11:07:49 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Mon, 30 Jul 2018 11:07:49 +0000 (UTC) Subject: =?UTF-8?Q?Jenkins_build_is_back_to_normal_:_master-osmo-bts_=C2=BB_sysmo?= =?UTF-8?Q?,superfemto=5Fv3.0.1pre,default,osmocom-master-debian9_#959?= Message-ID: <1376189157.8.1532948869033.JavaMail.jenkins@jenkins.osmocom.org> See From gerrit-no-reply at lists.osmocom.org Mon Jul 30 11:08:02 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 11:08:02 +0000 Subject: Change in osmo-hlr[master]: import gsup_client.c as new libosmo-gsup-client In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10113 to look at the new patch set (#4). Change subject: import gsup_client.c as new libosmo-gsup-client ...................................................................... import gsup_client.c as new libosmo-gsup-client This imports the code from osmo-msc 6afef893e17bce67e4d4119acd34d480ed03ba77 with minimal changes to make it compile. Symbol renaming ot osmo_ prefix is done separately in a follow-up patch to have a as-clean-as-possible import first. Requires: libosmocore.git Change-Id Ie36729996abd30b84d1c30a09f62ebc6a9794950 Change-Id: Ief50054ad135551625b684ed8a0486f7af0b2940 --- M .gitignore M Makefile.am M configure.ac A include/Makefile.am A include/osmocom/gsupclient/gsup_client.h A libosmo-gsup-client.pc.in M src/Makefile.am A src/gsupclient/Makefile.am A src/gsupclient/gsup_client.c A src/gsupclient/gsup_test_client.c 10 files changed, 776 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/13/10113/4 -- To view, visit https://gerrit.osmocom.org/10113 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ief50054ad135551625b684ed8a0486f7af0b2940 Gerrit-Change-Number: 10113 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 11:08:02 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 11:08:02 +0000 Subject: Change in osmo-hlr[master]: gsup_client: rename gsup_client_* to osmo_gsup_client_* In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10114 to look at the new patch set (#4). Change subject: gsup_client: rename gsup_client_* to osmo_gsup_client_* ...................................................................... gsup_client: rename gsup_client_* to osmo_gsup_client_* As we're moving this to a common/shared library now, we need to use the osmo_ namespace prefix for symbol names, struct/type names and constants. Change-Id: I294f8f96af4c5daa2b128962534426e04909290e --- M include/osmocom/gsupclient/gsup_client.h M src/gsupclient/gsup_client.c M src/gsupclient/gsup_test_client.c 3 files changed, 49 insertions(+), 50 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/14/10114/4 -- To view, visit https://gerrit.osmocom.org/10114 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I294f8f96af4c5daa2b128962534426e04909290e Gerrit-Change-Number: 10114 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Mon Jul 30 11:08:35 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Mon, 30 Jul 2018 11:08:35 +0000 (UTC) Subject: =?UTF-8?Q?Jenkins_build_is_back_to_normal_:_master-osmo-bts?= =?UTF-8?Q?_=C2=BB_oct,master,default,osmocom-master-debian9_#959?= Message-ID: <130033545.9.1532948915796.JavaMail.jenkins@jenkins.osmocom.org> See From gerrit-no-reply at lists.osmocom.org Mon Jul 30 11:35:58 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 30 Jul 2018 11:35:58 +0000 Subject: Change in osmo-hlr[master]: import gsup_client.c as new libosmo-gsup-client In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/10113 ) Change subject: import gsup_client.c as new libosmo-gsup-client ...................................................................... Patch Set 4: (1 comment) https://gerrit.osmocom.org/#/c/10113/4//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/10113/4//COMMIT_MSG at 9 PS4, Line 9: 6afef893e17bce67e4d4119acd34d480ed03ba77 6afef893e17bce67e4d4119acd34d480ed03ba77 -> "libmsc/gsm_09_11.c: introduce counter for active sessions"? -- To view, visit https://gerrit.osmocom.org/10113 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ief50054ad135551625b684ed8a0486f7af0b2940 Gerrit-Change-Number: 10113 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 30 Jul 2018 11:35:58 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 11:53:23 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 30 Jul 2018 11:53:23 +0000 Subject: Change in osmo-hlr[master]: import gsup_client.c as new libosmo-gsup-client In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/10113 ) Change subject: import gsup_client.c as new libosmo-gsup-client ...................................................................... Patch Set 4: (3 comments) Please interpret all my comments just as notes for the further comments, I got the idea of having a clean import... https://gerrit.osmocom.org/#/c/10113/4/.gitignore File .gitignore: https://gerrit.osmocom.org/#/c/10113/4/.gitignore at 25 PS4, Line 25: *.pc Also makes sense to ignore gsup-test-client binary... https://gerrit.osmocom.org/#/c/10113/4/include/osmocom/gsupclient/gsup_client.h File include/osmocom/gsupclient/gsup_client.h: https://gerrit.osmocom.org/#/c/10113/4/include/osmocom/gsupclient/gsup_client.h at 1 PS4, Line 1: GPRS s/GPRS/Generic/ according to libosmocore's documentation. Probably, makes sense to do it in a separate commit due to 'as-clean-as-possible import'. Or even completely drop this license header, as we usually don't have them in *.h files... https://gerrit.osmocom.org/#/c/10113/4/src/gsupclient/Makefile.am File src/gsupclient/Makefile.am: https://gerrit.osmocom.org/#/c/10113/4/src/gsupclient/Makefile.am at 16 PS4, Line 16: noinst_PROGRAMS = gsup-test-client Do we really need this? Does anybody use this binary? -- To view, visit https://gerrit.osmocom.org/10113 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ief50054ad135551625b684ed8a0486f7af0b2940 Gerrit-Change-Number: 10113 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 30 Jul 2018 11:53:23 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 11:56:31 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 30 Jul 2018 11:56:31 +0000 Subject: Change in osmo-hlr[master]: gsup_client: rename gsup_client_* to osmo_gsup_client_* In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/10114 ) Change subject: gsup_client: rename gsup_client_* to osmo_gsup_client_* ...................................................................... Patch Set 4: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/10114 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I294f8f96af4c5daa2b128962534426e04909290e Gerrit-Change-Number: 10114 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 30 Jul 2018 11:56:31 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 12:12:05 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 30 Jul 2018 12:12:05 +0000 Subject: Change in gr-gsm[master]: README.md: fix white space In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/9971 ) Change subject: README.md: fix white space ...................................................................... Patch Set 2: @Piotr, ping? I think it makes sense to merge this change ;) -- To view, visit https://gerrit.osmocom.org/9971 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: gr-gsm Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I818b5296e2a208df9f096bcc9d13b88ffe01379c Gerrit-Change-Number: 9971 Gerrit-PatchSet: 2 Gerrit-Owner: Piotr Krysik Gerrit-Reviewer: Piotr Krysik Gerrit-Reviewer: Vadim Yanitskiy Gerrit-CC: Pau Espin Pedrol Gerrit-Comment-Date: Mon, 30 Jul 2018 12:12:05 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 12:15:54 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Mon, 30 Jul 2018 12:15:54 +0000 Subject: Change in osmo-ttcn3-hacks[master]: detect VTY TELNET port connection failures (attempt #2) In-Reply-To: References: Message-ID: Stefan Sperling has submitted this change and it was merged. ( https://gerrit.osmocom.org/10196 ) Change subject: detect VTY TELNET port connection failures (attempt #2) ...................................................................... detect VTY TELNET port connection failures (attempt #2) Pass the CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT parameter to the TELNET port by default. This allows tests to make progress into an error handling path if they are started while the osmo-* program they want to connect on VTY is not running. Observed with osmo-ggsn tests, where if the one test runs into a VTY connection failure the subsequent test would get stuck forever in a map() call on the VTY TELNET port. Teach the function f_vty_wait_for_prompt() about connection reports by the TELNET module. We may now receive an integer which represents the socket file descriptor for the telnet connection. This case was not handled by the previous change made in commit cb111b21aba1d5881da1a1d3f19754cbd15b3779. As a result, BSC tests started failing with "VTY Timeout for prompt" because the alt-statement in f_vty_wait_for_prompt() would not progress past the integer sitting on the VTY port's receive queue. Change-Id: I56925f93af6c55e93f3f417099db135744da6a40 Related: OS#3149 --- M bsc/BSC_Tests.default M bts/BTS_Tests.default M ggsn_tests/GGSN_Tests.default M hlr/HLR_Tests.default M library/Osmocom_VTY_Functions.ttcn M msc/MSC_Tests.default M sccp/SCCP_Tests.default M sgsn/SGSN_Tests.default M sip/SIP_Tests.default 9 files changed, 17 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/bsc/BSC_Tests.default b/bsc/BSC_Tests.default index c13f7b0..8818359 100644 --- a/bsc/BSC_Tests.default +++ b/bsc/BSC_Tests.default @@ -15,6 +15,7 @@ *.BSCVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.BSCVTY.CTRL_READMODE := "buffered" *.BSCVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" +*.BSCVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.BSCVTY.PROMPT1 := "OsmoBSC> " [MODULE_PARAMETERS] diff --git a/bts/BTS_Tests.default b/bts/BTS_Tests.default index 502c17f..f254993 100644 --- a/bts/BTS_Tests.default +++ b/bts/BTS_Tests.default @@ -12,6 +12,7 @@ *.BTSVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.BTSVTY.CTRL_READMODE := "buffered" *.BTSVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" +*.BTSVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.BTSVTY.PROMPT1 := "OsmoBTS> " *.PCU.socket_type := "SEQPACKET" diff --git a/ggsn_tests/GGSN_Tests.default b/ggsn_tests/GGSN_Tests.default index ff0cd97..4d52e24 100644 --- a/ggsn_tests/GGSN_Tests.default +++ b/ggsn_tests/GGSN_Tests.default @@ -8,6 +8,7 @@ *.GGSNVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.GGSNVTY.CTRL_READMODE := "buffered" *.GGSNVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" +*.GGSNVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.GGSNVTY.PROMPT1 := "OsmoGGSN> " [MODULE_PARAMETERS] diff --git a/hlr/HLR_Tests.default b/hlr/HLR_Tests.default index f458479..84d4ff3 100644 --- a/hlr/HLR_Tests.default +++ b/hlr/HLR_Tests.default @@ -9,6 +9,7 @@ *.VTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.VTY.CTRL_READMODE := "buffered" *.VTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" +*.VTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.VTY.PROMPT1 := "OsmoHLR> " [MODULE_PARAMETERS] diff --git a/library/Osmocom_VTY_Functions.ttcn b/library/Osmocom_VTY_Functions.ttcn index 6e4eb74..427bd5c 100644 --- a/library/Osmocom_VTY_Functions.ttcn +++ b/library/Osmocom_VTY_Functions.ttcn @@ -46,6 +46,7 @@ /* wait for any of the permitted prompts; buffer + return all intermediate output */ function f_vty_wait_for_prompt(TELNETasp_PT pt) return charstring { var charstring rx, buf := ""; + var integer fd; timer T := 2.0; T.start; @@ -57,6 +58,14 @@ testcase.stop(fail, "VTY: Unknown Command"); }; [] pt.receive(charstring:?) -> value rx { buf := buf & rx; repeat }; + [] pt.receive(integer:?) -> value fd { + if (fd == -1) { + setverdict(fail, "VTY Telnet Connection Failure"); + mtc.stop; + } else { + repeat; /* telnet connection succeeded */ + } + } [] T.timeout { setverdict(fail, "VTY Timeout for prompt"); mtc.stop; diff --git a/msc/MSC_Tests.default b/msc/MSC_Tests.default index bcaae06..a24fa38 100644 --- a/msc/MSC_Tests.default +++ b/msc/MSC_Tests.default @@ -20,6 +20,7 @@ *.MSCVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.MSCVTY.CTRL_READMODE := "buffered" *.MSCVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" +*.MSCVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.MSCVTY.PROMPT1 := "OsmoMSC> " diff --git a/sccp/SCCP_Tests.default b/sccp/SCCP_Tests.default index 7d16e5b..95e0d2f 100644 --- a/sccp/SCCP_Tests.default +++ b/sccp/SCCP_Tests.default @@ -15,6 +15,7 @@ *.SCCP_DEMO_USER_VTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.SCCP_DEMO_USER_VTY.CTRL_READMODE := "buffered" *.SCCP_DEMO_USER_VTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" +*.SCCP_DEMO_USER_VTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.SCCP_DEMO_USER_VTY.PROMPT1 := "sccp-demo-user> " [MODULE_PARAMETERS] diff --git a/sgsn/SGSN_Tests.default b/sgsn/SGSN_Tests.default index bac5fdd..3957e82 100644 --- a/sgsn/SGSN_Tests.default +++ b/sgsn/SGSN_Tests.default @@ -15,6 +15,7 @@ *.SGSNVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.SGSNVTY.CTRL_READMODE := "buffered" *.SGSNVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" +*.SGSNVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.SGSNVTY.PROMPT1 := "OsmoSGSN> " diff --git a/sip/SIP_Tests.default b/sip/SIP_Tests.default index 2576b33..4434a1a 100644 --- a/sip/SIP_Tests.default +++ b/sip/SIP_Tests.default @@ -13,6 +13,7 @@ *.SIPVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" *.SIPVTY.CTRL_READMODE := "buffered" *.SIPVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" +*.SIPVTY.CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT := "yes" *.SIPVTY.PROMPT1 := "OsmoSIPcon> " *.SIP.local_sip_port := "5060" -- To view, visit https://gerrit.osmocom.org/10196 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I56925f93af6c55e93f3f417099db135744da6a40 Gerrit-Change-Number: 10196 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 12:34:13 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 30 Jul 2018 12:34:13 +0000 Subject: Change in osmo-bsc[master]: handover_logic: make sure IPACC is done before MGCP In-Reply-To: References: Message-ID: dexter has abandoned this change. ( https://gerrit.osmocom.org/10039 ) Change subject: handover_logic: make sure IPACC is done before MGCP ...................................................................... Abandoned tc_ho_int is passing without this patch being merged. -- To view, visit https://gerrit.osmocom.org/10039 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: abandon Gerrit-Change-Id: I01f05f5d8abe07a0d063e84a1984ac5797afb4f7 Gerrit-Change-Number: 10039 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Assignee: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Harald Welte Gerrit-CC: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 12:50:36 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 30 Jul 2018 12:50:36 +0000 Subject: Change in osmo-mgw[master]: mgcp_client: use IETF source port as for MGCP In-Reply-To: References: Message-ID: dexter has posted comments on this change. ( https://gerrit.osmocom.org/10188 ) Change subject: mgcp_client: use IETF source port as for MGCP ...................................................................... Patch Set 1: > I'm still a bit ambiguous about this. It is the right thing to do, > but it would mean that we can no longer run osmo-bsc and osmo-msc > on the same machine with default configuration. What to do now? > any ideas? We could simply adjust our default config files, or we > could make sure only one of the two programs uses the "default" CA > port, while the other uses e.g. default+1 ? We should definitely update the default configs in osmo-bsc and osmo-msc. I will do this as soon as possible. I think automatically incrementing the ports is ok, lets try that. -- To view, visit https://gerrit.osmocom.org/10188 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I96de84df3a3bf623d98b057ec3f3f621a3330a8a Gerrit-Change-Number: 10188 Gerrit-PatchSet: 1 Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-CC: Harald Welte Gerrit-Comment-Date: Mon, 30 Jul 2018 12:50:36 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 13:05:20 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Mon, 30 Jul 2018 13:05:20 +0000 Subject: Change in simtrace2[master]: cardem: use TC_ETU to trigger ATR sending In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10217 to look at the new patch set (#3). Change subject: cardem: use TC_ETU to trigger ATR sending ...................................................................... cardem: use TC_ETU to trigger ATR sending this changes how ATR is handled. the ATR is also printed when set (as important debug information). the test is also updated to correspond to the new mechanism ( simulating the timeout before sending the ATR) Change-Id: I69df797e2feadffa9f5f977cb71b69386cee7cd0 --- M firmware/libcommon/include/card_emu.h M firmware/libcommon/source/card_emu.c M firmware/libcommon/source/mode_cardemu.c M firmware/test/card_emu_tests.c 4 files changed, 104 insertions(+), 30 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/17/10217/3 -- To view, visit https://gerrit.osmocom.org/10217 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I69df797e2feadffa9f5f977cb71b69386cee7cd0 Gerrit-Change-Number: 10217 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 13:07:04 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 13:07:04 +0000 Subject: Change in osmo-hlr[master]: import gsup_client.c as new libosmo-gsup-client In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10113 ) Change subject: import gsup_client.c as new libosmo-gsup-client ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10113 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ief50054ad135551625b684ed8a0486f7af0b2940 Gerrit-Change-Number: 10113 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 30 Jul 2018 13:07:04 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 13:07:07 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 13:07:07 +0000 Subject: Change in osmo-hlr[master]: gsup_client: rename gsup_client_* to osmo_gsup_client_* In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10114 ) Change subject: gsup_client: rename gsup_client_* to osmo_gsup_client_* ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10114 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I294f8f96af4c5daa2b128962534426e04909290e Gerrit-Change-Number: 10114 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 30 Jul 2018 13:07:07 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 13:07:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 13:07:08 +0000 Subject: Change in osmo-hlr[master]: import gsup_client.c as new libosmo-gsup-client In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10113 ) Change subject: import gsup_client.c as new libosmo-gsup-client ...................................................................... import gsup_client.c as new libosmo-gsup-client This imports the code from osmo-msc 6afef893e17bce67e4d4119acd34d480ed03ba77 with minimal changes to make it compile. Symbol renaming ot osmo_ prefix is done separately in a follow-up patch to have a as-clean-as-possible import first. Requires: libosmocore.git Change-Id Ie36729996abd30b84d1c30a09f62ebc6a9794950 Change-Id: Ief50054ad135551625b684ed8a0486f7af0b2940 --- M .gitignore M Makefile.am M configure.ac A include/Makefile.am A include/osmocom/gsupclient/gsup_client.h A libosmo-gsup-client.pc.in M src/Makefile.am A src/gsupclient/Makefile.am A src/gsupclient/gsup_client.c A src/gsupclient/gsup_test_client.c 10 files changed, 776 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitignore b/.gitignore index d65cb68..571f5b1 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,8 @@ missing .deps +*.pc + src/db_test src/db_bootstrap.h src/osmo-hlr diff --git a/Makefile.am b/Makefile.am index f5062a2..8e18167 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,6 +3,7 @@ SUBDIRS = \ doc \ src \ + include \ sql \ tests \ $(NULL) @@ -11,6 +12,9 @@ .version \ $(NULL) +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libosmo-gsup-client.pc + @RELMAKE@ BUILT_SOURCES = $(top_srcdir)/.version diff --git a/configure.ac b/configure.ac index cedba45..16c8b51 100644 --- a/configure.ac +++ b/configure.ac @@ -99,6 +99,9 @@ Makefile doc/Makefile src/Makefile + src/gsupclient/Makefile + include/Makefile + libosmo-gsup-client.pc sql/Makefile tests/Makefile tests/auc/Makefile diff --git a/include/Makefile.am b/include/Makefile.am new file mode 100644 index 0000000..dac7011 --- /dev/null +++ b/include/Makefile.am @@ -0,0 +1,2 @@ +nobase_include_HEADERS = osmocom/gsupclient/gsup_client.h + diff --git a/include/osmocom/gsupclient/gsup_client.h b/include/osmocom/gsupclient/gsup_client.h new file mode 100644 index 0000000..f4362df --- /dev/null +++ b/include/osmocom/gsupclient/gsup_client.h @@ -0,0 +1,66 @@ +/* GPRS Subscriber Update Protocol client */ + +/* (C) 2014 by Sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Jacob Erlbeck + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ +#pragma once + +#include +#include + +/* a loss of GSUP between MSC and HLR is considered quite serious, let's try to recover as quickly as + * possible. Even one new connection attempt per second should be quite acceptable until the link is + * re-established */ +#define GSUP_CLIENT_RECONNECT_INTERVAL 1 +#define GSUP_CLIENT_PING_INTERVAL 20 + +struct msgb; +struct ipa_client_conn; +struct gsup_client; + +/* Expects message in msg->l2h */ +typedef int (*gsup_client_read_cb_t)(struct gsup_client *gsupc, + struct msgb *msg); + +struct gsup_client { + const char *unit_name; + + struct ipa_client_conn *link; + gsup_client_read_cb_t read_cb; + void *data; + + struct osmo_oap_client_state oap_state; + + struct osmo_timer_list ping_timer; + struct osmo_timer_list connect_timer; + int is_connected; + int got_ipa_pong; +}; + +struct gsup_client *gsup_client_create(void *talloc_ctx, + const char *unit_name, + const char *ip_addr, + unsigned int tcp_port, + gsup_client_read_cb_t read_cb, + struct osmo_oap_client_config *oapc_config); + +void gsup_client_destroy(struct gsup_client *gsupc); +int gsup_client_send(struct gsup_client *gsupc, struct msgb *msg); +struct msgb *gsup_client_msgb_alloc(void); + diff --git a/libosmo-gsup-client.pc.in b/libosmo-gsup-client.pc.in new file mode 100644 index 0000000..4210a4a --- /dev/null +++ b/libosmo-gsup-client.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: Osmocom GSUP and OAP Client Library +Description: C Utility Library +Version: @VERSION@ +Libs: -L${libdir} @TALLOC_LIBS@ -losmogsm -losmocore +Cflags: -I${includedir}/ + diff --git a/src/Makefile.am b/src/Makefile.am index ea5023d..e4506bb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,3 +1,5 @@ +SUBDIRS = gsupclient + AM_CFLAGS = \ -Wall \ $(LIBOSMOCORE_CFLAGS) \ diff --git a/src/gsupclient/Makefile.am b/src/gsupclient/Makefile.am new file mode 100644 index 0000000..4a449ec --- /dev/null +++ b/src/gsupclient/Makefile.am @@ -0,0 +1,20 @@ +# This is _NOT_ the library release version, it's an API version. +# Please read chapter "Library interface versions" of the libtool documentation +# before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html +LIBVERSION=0:0:0 + +AM_CFLAGS = -Wall $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)/include \ + $(TALLOC_CFLAGS) $(LIBOSMOCORE_CFLAGS) $(LIBOSMOABIS_CFLAGS) + +lib_LTLIBRARIES = libosmo-gsup-client.la + +libosmo_gsup_client_la_SOURCES = gsup_client.c + +libosmo_gsup_client_la_LDFLAGS = -version-info $(LIBVERSION) -no-undefined +libosmo_gsup_client_la_LIBADD = $(TALLOC_LIBS) $(LIBOSMOCORE_LIBS) $(LIBOSMOABIS_LIBS) + +noinst_PROGRAMS = gsup-test-client + +gsup_test_client_SOURCES = gsup_test_client.c +gsup_test_client_LDADD = $(TALLOC_LIBS) $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) \ + libosmo-gsup-client.la diff --git a/src/gsupclient/gsup_client.c b/src/gsupclient/gsup_client.c new file mode 100644 index 0000000..761e8bd --- /dev/null +++ b/src/gsupclient/gsup_client.c @@ -0,0 +1,345 @@ +/* Generic Subscriber Update Protocol client */ + +/* (C) 2014-2016 by Sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Jacob Erlbeck + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include + +#include +#include +#include +#include +#include + +#include +#include + +static void start_test_procedure(struct gsup_client *gsupc); + +static void gsup_client_send_ping(struct gsup_client *gsupc) +{ + struct msgb *msg = gsup_client_msgb_alloc(); + + msg->l2h = msgb_put(msg, 1); + msg->l2h[0] = IPAC_MSGT_PING; + ipa_msg_push_header(msg, IPAC_PROTO_IPACCESS); + ipa_client_conn_send(gsupc->link, msg); +} + +static int gsup_client_connect(struct gsup_client *gsupc) +{ + int rc; + + if (gsupc->is_connected) + return 0; + + if (osmo_timer_pending(&gsupc->connect_timer)) { + LOGP(DLGSUP, LOGL_DEBUG, + "GSUP connect: connect timer already running\n"); + osmo_timer_del(&gsupc->connect_timer); + } + + if (osmo_timer_pending(&gsupc->ping_timer)) { + LOGP(DLGSUP, LOGL_DEBUG, + "GSUP connect: ping timer already running\n"); + osmo_timer_del(&gsupc->ping_timer); + } + + if (ipa_client_conn_clear_queue(gsupc->link) > 0) + LOGP(DLGSUP, LOGL_DEBUG, "GSUP connect: discarded stored messages\n"); + + rc = ipa_client_conn_open(gsupc->link); + + if (rc >= 0) { + LOGP(DLGSUP, LOGL_NOTICE, "GSUP connecting to %s:%d\n", + gsupc->link->addr, gsupc->link->port); + return 0; + } + + LOGP(DLGSUP, LOGL_ERROR, "GSUP failed to connect to %s:%d: %s\n", + gsupc->link->addr, gsupc->link->port, strerror(-rc)); + + if (rc == -EBADF || rc == -ENOTSOCK || rc == -EAFNOSUPPORT || + rc == -EINVAL) + return rc; + + osmo_timer_schedule(&gsupc->connect_timer, + GSUP_CLIENT_RECONNECT_INTERVAL, 0); + + LOGP(DLGSUP, LOGL_INFO, "Scheduled timer to retry GSUP connect to %s:%d\n", + gsupc->link->addr, gsupc->link->port); + + return 0; +} + +static void connect_timer_cb(void *gsupc_) +{ + struct gsup_client *gsupc = gsupc_; + + if (gsupc->is_connected) + return; + + gsup_client_connect(gsupc); +} + +static void client_send(struct gsup_client *gsupc, int proto_ext, + struct msgb *msg_tx) +{ + ipa_prepend_header_ext(msg_tx, proto_ext); + ipa_msg_push_header(msg_tx, IPAC_PROTO_OSMO); + ipa_client_conn_send(gsupc->link, msg_tx); + /* msg_tx is now queued and will be freed. */ +} + +static void gsup_client_oap_register(struct gsup_client *gsupc) +{ + struct msgb *msg_tx; + int rc; + rc = osmo_oap_client_register(&gsupc->oap_state, &msg_tx); + + if ((rc < 0) || (!msg_tx)) { + LOGP(DLGSUP, LOGL_ERROR, "GSUP OAP set up, but cannot register.\n"); + return; + } + + client_send(gsupc, IPAC_PROTO_EXT_OAP, msg_tx); +} + +static void gsup_client_updown_cb(struct ipa_client_conn *link, int up) +{ + struct gsup_client *gsupc = link->data; + + LOGP(DLGSUP, LOGL_INFO, "GSUP link to %s:%d %s\n", + link->addr, link->port, up ? "UP" : "DOWN"); + + gsupc->is_connected = up; + + if (up) { + start_test_procedure(gsupc); + + if (gsupc->oap_state.state == OSMO_OAP_INITIALIZED) + gsup_client_oap_register(gsupc); + + osmo_timer_del(&gsupc->connect_timer); + } else { + osmo_timer_del(&gsupc->ping_timer); + + osmo_timer_schedule(&gsupc->connect_timer, + GSUP_CLIENT_RECONNECT_INTERVAL, 0); + } +} + +static int gsup_client_oap_handle(struct gsup_client *gsupc, struct msgb *msg_rx) +{ + int rc; + struct msgb *msg_tx; + + /* If the oap_state is disabled, this will reject the messages. */ + rc = osmo_oap_client_handle(&gsupc->oap_state, msg_rx, &msg_tx); + msgb_free(msg_rx); + if (rc < 0) + return rc; + + if (msg_tx) + client_send(gsupc, IPAC_PROTO_EXT_OAP, msg_tx); + + return 0; +} + +static int gsup_client_read_cb(struct ipa_client_conn *link, struct msgb *msg) +{ + struct ipaccess_head *hh = (struct ipaccess_head *) msg->data; + struct ipaccess_head_ext *he = (struct ipaccess_head_ext *) msgb_l2(msg); + struct gsup_client *gsupc = (struct gsup_client *)link->data; + int rc; + struct ipaccess_unit ipa_dev = { + /* see gsup_client_create() on const vs non-const */ + .unit_name = (char*)gsupc->unit_name, + }; + + OSMO_ASSERT(ipa_dev.unit_name); + + msg->l2h = &hh->data[0]; + + rc = ipaccess_bts_handle_ccm(link, &ipa_dev, msg); + + if (rc < 0) { + LOGP(DLGSUP, LOGL_NOTICE, + "GSUP received an invalid IPA/CCM message from %s:%d\n", + link->addr, link->port); + /* Link has been closed */ + gsupc->is_connected = 0; + msgb_free(msg); + return -1; + } + + if (rc == 1) { + uint8_t msg_type = *(msg->l2h); + /* CCM message */ + if (msg_type == IPAC_MSGT_PONG) { + LOGP(DLGSUP, LOGL_DEBUG, "GSUP receiving PONG\n"); + gsupc->got_ipa_pong = 1; + } + + msgb_free(msg); + return 0; + } + + if (hh->proto != IPAC_PROTO_OSMO) + goto invalid; + + if (!he || msgb_l2len(msg) < sizeof(*he)) + goto invalid; + + msg->l2h = &he->data[0]; + + if (he->proto == IPAC_PROTO_EXT_GSUP) { + OSMO_ASSERT(gsupc->read_cb != NULL); + gsupc->read_cb(gsupc, msg); + /* expecting read_cb() to free msg */ + } else if (he->proto == IPAC_PROTO_EXT_OAP) { + return gsup_client_oap_handle(gsupc, msg); + /* gsup_client_oap_handle frees msg */ + } else + goto invalid; + + return 0; + +invalid: + LOGP(DLGSUP, LOGL_NOTICE, + "GSUP received an invalid IPA message from %s:%d, size = %d\n", + link->addr, link->port, msgb_length(msg)); + + msgb_free(msg); + return -1; +} + +static void ping_timer_cb(void *gsupc_) +{ + struct gsup_client *gsupc = gsupc_; + + LOGP(DLGSUP, LOGL_INFO, "GSUP ping callback (%s, %s PONG)\n", + gsupc->is_connected ? "connected" : "not connected", + gsupc->got_ipa_pong ? "got" : "didn't get"); + + if (gsupc->got_ipa_pong) { + start_test_procedure(gsupc); + return; + } + + LOGP(DLGSUP, LOGL_NOTICE, "GSUP ping timed out, reconnecting\n"); + ipa_client_conn_close(gsupc->link); + gsupc->is_connected = 0; + + gsup_client_connect(gsupc); +} + +static void start_test_procedure(struct gsup_client *gsupc) +{ + osmo_timer_setup(&gsupc->ping_timer, ping_timer_cb, gsupc); + + gsupc->got_ipa_pong = 0; + osmo_timer_schedule(&gsupc->ping_timer, GSUP_CLIENT_PING_INTERVAL, 0); + LOGP(DLGSUP, LOGL_DEBUG, "GSUP sending PING\n"); + gsup_client_send_ping(gsupc); +} + +struct gsup_client *gsup_client_create(void *talloc_ctx, + const char *unit_name, + const char *ip_addr, + unsigned int tcp_port, + gsup_client_read_cb_t read_cb, + struct osmo_oap_client_config *oapc_config) +{ + struct gsup_client *gsupc; + int rc; + + gsupc = talloc_zero(talloc_ctx, struct gsup_client); + OSMO_ASSERT(gsupc); + + /* struct ipaccess_unit has a non-const unit_name, so let's copy to be + * able to have a non-const unit_name here as well. To not taint the + * public gsup_client API, let's store it in a const char* anyway. */ + gsupc->unit_name = talloc_strdup(gsupc, unit_name); + OSMO_ASSERT(gsupc->unit_name); + + /* a NULL oapc_config will mark oap_state disabled. */ + rc = osmo_oap_client_init(oapc_config, &gsupc->oap_state); + if (rc != 0) + goto failed; + + gsupc->link = ipa_client_conn_create(gsupc, + /* no e1inp */ NULL, + 0, + ip_addr, tcp_port, + gsup_client_updown_cb, + gsup_client_read_cb, + /* default write_cb */ NULL, + gsupc); + if (!gsupc->link) + goto failed; + + osmo_timer_setup(&gsupc->connect_timer, connect_timer_cb, gsupc); + + rc = gsup_client_connect(gsupc); + + if (rc < 0) + goto failed; + + gsupc->read_cb = read_cb; + + return gsupc; + +failed: + gsup_client_destroy(gsupc); + return NULL; +} + +void gsup_client_destroy(struct gsup_client *gsupc) +{ + osmo_timer_del(&gsupc->connect_timer); + osmo_timer_del(&gsupc->ping_timer); + + if (gsupc->link) { + ipa_client_conn_close(gsupc->link); + ipa_client_conn_destroy(gsupc->link); + gsupc->link = NULL; + } + talloc_free(gsupc); +} + +int gsup_client_send(struct gsup_client *gsupc, struct msgb *msg) +{ + if (!gsupc || !gsupc->is_connected) { + LOGP(DLGSUP, LOGL_ERROR, "GSUP not connected, unable to send %s\n", msgb_hexdump(msg)); + msgb_free(msg); + return -ENOTCONN; + } + + client_send(gsupc, IPAC_PROTO_EXT_GSUP, msg); + + return 0; +} + +struct msgb *gsup_client_msgb_alloc(void) +{ + return msgb_alloc_headroom(4000, 64, __func__); +} diff --git a/src/gsupclient/gsup_test_client.c b/src/gsupclient/gsup_test_client.c new file mode 100644 index 0000000..cfbd55e --- /dev/null +++ b/src/gsupclient/gsup_test_client.c @@ -0,0 +1,321 @@ +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +static struct gsup_client *g_gc; + + +/*********************************************************************** + * IMSI Operation + ***********************************************************************/ +static LLIST_HEAD(g_imsi_ops); + +struct imsi_op_stats { + uint32_t num_alloc; + uint32_t num_released; + uint32_t num_rx_success; + uint32_t num_rx_error; + uint32_t num_timeout; +}; + +enum imsi_op_type { + IMSI_OP_SAI, + IMSI_OP_LU, + IMSI_OP_ISD, + _NUM_IMSI_OP +}; + +static const struct value_string imsi_op_names[] = { + { IMSI_OP_SAI, "SAI" }, + { IMSI_OP_LU, "LU" }, + { IMSI_OP_ISD, "ISD" }, + { 0, NULL } +}; + +static struct imsi_op_stats imsi_op_stats[_NUM_IMSI_OP]; + +struct imsi_op { + struct llist_head list; + char imsi[17]; + enum imsi_op_type type; + struct osmo_timer_list timer; +}; + +static struct imsi_op *imsi_op_find(const char *imsi, + enum imsi_op_type type) +{ + struct imsi_op *io; + + llist_for_each_entry(io, &g_imsi_ops, list) { + if (!strcmp(io->imsi, imsi) && io->type == type) + return io; + } + return NULL; +} + +static void imsi_op_timer_cb(void *data); + +static struct imsi_op *imsi_op_alloc(void *ctx, const char *imsi, + enum imsi_op_type type) +{ + struct imsi_op *io; + + if (imsi_op_find(imsi, type)) + return NULL; + + io = talloc_zero(ctx, struct imsi_op); + OSMO_STRLCPY_ARRAY(io->imsi, imsi); + io->type = type; + osmo_timer_setup(&io->timer, imsi_op_timer_cb, io); + llist_add(&io->list, &g_imsi_ops); + imsi_op_stats[type].num_alloc++; + + return io; +} + +static void imsi_op_release(struct imsi_op *io) +{ + osmo_timer_del(&io->timer); + llist_del(&io->list); + imsi_op_stats[io->type].num_released++; + talloc_free(io); +} + +static void imsi_op_timer_cb(void *data) +{ + struct imsi_op *io = data; + printf("%s: Timer expiration\n", io->imsi); + imsi_op_stats[io->type].num_timeout++; + imsi_op_release(io); +} + +/* allocate + generate + send Send-Auth-Info */ +static int req_auth_info(const char *imsi) +{ + struct imsi_op *io = imsi_op_alloc(g_gc, imsi, IMSI_OP_SAI); + struct osmo_gsup_message gsup = {0}; + struct msgb *msg = msgb_alloc_headroom(1200, 200, __func__); + int rc; + + OSMO_STRLCPY_ARRAY(gsup.imsi, io->imsi); + gsup.message_type = OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST; + + rc = osmo_gsup_encode(msg, &gsup); + if (rc < 0) { + printf("%s: encoding failure (%s)\n", imsi, strerror(-rc)); + return rc; + } + + return gsup_client_send(g_gc, msg); +} + +/* allocate + generate + send Send-Auth-Info */ +static int req_loc_upd(const char *imsi) +{ + struct imsi_op *io = imsi_op_alloc(g_gc, imsi, IMSI_OP_LU); + struct osmo_gsup_message gsup = {0}; + struct msgb *msg = msgb_alloc_headroom(1200, 200, __func__); + int rc; + + OSMO_STRLCPY_ARRAY(gsup.imsi, io->imsi); + gsup.message_type = OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST; + + rc = osmo_gsup_encode(msg, &gsup); + if (rc < 0) { + printf("%s: encoding failure (%s)\n", imsi, strerror(-rc)); + return rc; + } + + return gsup_client_send(g_gc, msg); +} + +static int resp_isd(struct imsi_op *io) +{ + struct osmo_gsup_message gsup = {0}; + struct msgb *msg = msgb_alloc_headroom(1200, 200, __func__); + int rc; + + OSMO_STRLCPY_ARRAY(gsup.imsi, io->imsi); + gsup.message_type = OSMO_GSUP_MSGT_INSERT_DATA_RESULT; + + rc = osmo_gsup_encode(msg, &gsup); + if (rc < 0) { + printf("%s: encoding failure (%s)\n", io->imsi, strerror(-rc)); + return rc; + } + + imsi_op_release(io); + + return gsup_client_send(g_gc, msg); +} + +/* receive an incoming GSUP message */ +static void imsi_op_rx_gsup(struct imsi_op *io, const struct osmo_gsup_message *gsup) +{ + int is_error = 0, rc; + + if (OSMO_GSUP_IS_MSGT_ERROR(gsup->message_type)) { + imsi_op_stats[io->type].num_rx_error++; + is_error = 1; + } else + imsi_op_stats[io->type].num_rx_success++; + + switch (io->type) { + case IMSI_OP_SAI: + printf("%s; SAI Response%s\n", io->imsi, is_error ? ": ERROR" : ""); + /* now that we have auth tuples, request LU */ + rc = req_loc_upd(io->imsi); + if (rc < 0) + printf("Failed to request Location Update for %s\n", io->imsi); + imsi_op_release(io); + break; + case IMSI_OP_LU: + printf("%s; LU Response%s\n", io->imsi, is_error ? ": ERROR" : ""); + imsi_op_release(io); + break; + case IMSI_OP_ISD: + printf("%s; ISD Request%s\n", io->imsi, is_error ? ": ERROR" : ""); + rc = resp_isd(io); + if (rc < 0) + printf("Failed to insert subscriber data for %s\n", io->imsi); + break; + default: + printf("%s: Unknown\n", io->imsi); + imsi_op_release(io); + break; + } +} + +static int op_type_by_gsup_msgt(enum osmo_gsup_message_type msg_type) +{ + switch (msg_type) { + case OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: + case OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR: + return IMSI_OP_SAI; + case OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: + case OSMO_GSUP_MSGT_UPDATE_LOCATION_ERROR: + return IMSI_OP_LU; + case OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: + return IMSI_OP_ISD; + default: + printf("Unknown GSUP msg_type %u\n", msg_type); + return -1; + } +} + +static int gsupc_read_cb(struct gsup_client *gsupc, struct msgb *msg) +{ + struct osmo_gsup_message gsup_msg = {0}; + struct imsi_op *io = NULL; + int rc; + + DEBUGP(DLGSUP, "Rx GSUP %s\n", msgb_hexdump(msg)); + + rc = osmo_gsup_decode(msgb_l2(msg), msgb_l2len(msg), &gsup_msg); + if (rc < 0) + return rc; + + if (!gsup_msg.imsi[0]) + return -1; + + rc = op_type_by_gsup_msgt(gsup_msg.message_type); + if (rc < 0) + return rc; + + switch (rc) { + case IMSI_OP_SAI: + case IMSI_OP_LU: + io = imsi_op_find(gsup_msg.imsi, rc); + break; + case IMSI_OP_ISD: + /* ISD is an inbound transaction */ + io = imsi_op_alloc(g_gc, gsup_msg.imsi, IMSI_OP_ISD); + break; + } + if (!io) + return -1; + + imsi_op_rx_gsup(io, &gsup_msg); + msgb_free(msg); + + return 0; +} + +static void print_report(void) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(imsi_op_stats); i++) { + struct imsi_op_stats *st = &imsi_op_stats[i]; + const char *name = get_value_string(imsi_op_names, i); + printf("%s: %u alloc, %u released, %u success, %u error , %u tout\n", + name, st->num_alloc, st->num_released, st->num_rx_success, + st->num_rx_error, st->num_timeout); + } +} + +static void sig_cb(int sig) +{ + switch (sig) { + case SIGINT: + print_report(); + exit(0); + break; + } +} + +/* default categories */ +static struct log_info_cat default_categories[] = { +}; + +static const struct log_info gsup_test_client_log_info = { + .cat = default_categories, + .num_cat = ARRAY_SIZE(default_categories), +}; + +int main(int argc, char **argv) +{ + unsigned long long i; + char *server_host = "127.0.0.1"; + uint16_t server_port = OSMO_GSUP_PORT; + void *ctx = talloc_named_const(NULL, 0, "gsup_test_client"); + + osmo_init_logging2(ctx, &gsup_test_client_log_info); + + g_gc = gsup_client_create(ctx, "GSUPTEST", server_host, server_port, + gsupc_read_cb, NULL); + + + signal(SIGINT, sig_cb); + + for (i = 0; i < 10000; i++) { + unsigned long long imsi = 901790000000000 + i; + char imsi_buf[17] = { 0 }; + int rc; + + snprintf(imsi_buf, sizeof(imsi_buf), "%015llu", imsi); + rc = req_auth_info(imsi_buf); + if (rc < 0) + printf("Failed to request Auth Info for %s\n", imsi_buf); + + osmo_select_main(0); + } + + while (1) { + osmo_select_main(0); + } + + print_report(); + exit(0); +} -- To view, visit https://gerrit.osmocom.org/10113 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ief50054ad135551625b684ed8a0486f7af0b2940 Gerrit-Change-Number: 10113 Gerrit-PatchSet: 5 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 13:07:09 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 13:07:09 +0000 Subject: Change in osmo-hlr[master]: gsup_client: rename gsup_client_* to osmo_gsup_client_* In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10114 ) Change subject: gsup_client: rename gsup_client_* to osmo_gsup_client_* ...................................................................... gsup_client: rename gsup_client_* to osmo_gsup_client_* As we're moving this to a common/shared library now, we need to use the osmo_ namespace prefix for symbol names, struct/type names and constants. Change-Id: I294f8f96af4c5daa2b128962534426e04909290e --- M include/osmocom/gsupclient/gsup_client.h M src/gsupclient/gsup_client.c M src/gsupclient/gsup_test_client.c 3 files changed, 49 insertions(+), 50 deletions(-) Approvals: Harald Welte: Looks good to me, approved Vadim Yanitskiy: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/include/osmocom/gsupclient/gsup_client.h b/include/osmocom/gsupclient/gsup_client.h index f4362df..981751b 100644 --- a/include/osmocom/gsupclient/gsup_client.h +++ b/include/osmocom/gsupclient/gsup_client.h @@ -27,22 +27,21 @@ /* a loss of GSUP between MSC and HLR is considered quite serious, let's try to recover as quickly as * possible. Even one new connection attempt per second should be quite acceptable until the link is * re-established */ -#define GSUP_CLIENT_RECONNECT_INTERVAL 1 -#define GSUP_CLIENT_PING_INTERVAL 20 +#define OSMO_GSUP_CLIENT_RECONNECT_INTERVAL 1 +#define OSMO_GSUP_CLIENT_PING_INTERVAL 20 struct msgb; struct ipa_client_conn; -struct gsup_client; +struct osmo_gsup_client; /* Expects message in msg->l2h */ -typedef int (*gsup_client_read_cb_t)(struct gsup_client *gsupc, - struct msgb *msg); +typedef int (*osmo_gsup_client_read_cb_t)(struct osmo_gsup_client *gsupc, struct msgb *msg); -struct gsup_client { +struct osmo_gsup_client { const char *unit_name; struct ipa_client_conn *link; - gsup_client_read_cb_t read_cb; + osmo_gsup_client_read_cb_t read_cb; void *data; struct osmo_oap_client_state oap_state; @@ -53,14 +52,14 @@ int got_ipa_pong; }; -struct gsup_client *gsup_client_create(void *talloc_ctx, - const char *unit_name, - const char *ip_addr, - unsigned int tcp_port, - gsup_client_read_cb_t read_cb, - struct osmo_oap_client_config *oapc_config); +struct osmo_gsup_client *osmo_gsup_client_create(void *talloc_ctx, + const char *unit_name, + const char *ip_addr, + unsigned int tcp_port, + osmo_gsup_client_read_cb_t read_cb, + struct osmo_oap_client_config *oapc_config); -void gsup_client_destroy(struct gsup_client *gsupc); -int gsup_client_send(struct gsup_client *gsupc, struct msgb *msg); -struct msgb *gsup_client_msgb_alloc(void); +void osmo_gsup_client_destroy(struct osmo_gsup_client *gsupc); +int osmo_gsup_client_send(struct osmo_gsup_client *gsupc, struct msgb *msg); +struct msgb *osmo_gsup_client_msgb_alloc(void); diff --git a/src/gsupclient/gsup_client.c b/src/gsupclient/gsup_client.c index 761e8bd..a7fdc5f 100644 --- a/src/gsupclient/gsup_client.c +++ b/src/gsupclient/gsup_client.c @@ -32,11 +32,11 @@ #include #include -static void start_test_procedure(struct gsup_client *gsupc); +static void start_test_procedure(struct osmo_gsup_client *gsupc); -static void gsup_client_send_ping(struct gsup_client *gsupc) +static void gsup_client_send_ping(struct osmo_gsup_client *gsupc) { - struct msgb *msg = gsup_client_msgb_alloc(); + struct msgb *msg = osmo_gsup_client_msgb_alloc(); msg->l2h = msgb_put(msg, 1); msg->l2h[0] = IPAC_MSGT_PING; @@ -44,7 +44,7 @@ ipa_client_conn_send(gsupc->link, msg); } -static int gsup_client_connect(struct gsup_client *gsupc) +static int gsup_client_connect(struct osmo_gsup_client *gsupc) { int rc; @@ -82,7 +82,7 @@ return rc; osmo_timer_schedule(&gsupc->connect_timer, - GSUP_CLIENT_RECONNECT_INTERVAL, 0); + OSMO_GSUP_CLIENT_RECONNECT_INTERVAL, 0); LOGP(DLGSUP, LOGL_INFO, "Scheduled timer to retry GSUP connect to %s:%d\n", gsupc->link->addr, gsupc->link->port); @@ -92,7 +92,7 @@ static void connect_timer_cb(void *gsupc_) { - struct gsup_client *gsupc = gsupc_; + struct osmo_gsup_client *gsupc = gsupc_; if (gsupc->is_connected) return; @@ -100,7 +100,7 @@ gsup_client_connect(gsupc); } -static void client_send(struct gsup_client *gsupc, int proto_ext, +static void client_send(struct osmo_gsup_client *gsupc, int proto_ext, struct msgb *msg_tx) { ipa_prepend_header_ext(msg_tx, proto_ext); @@ -109,7 +109,7 @@ /* msg_tx is now queued and will be freed. */ } -static void gsup_client_oap_register(struct gsup_client *gsupc) +static void gsup_client_oap_register(struct osmo_gsup_client *gsupc) { struct msgb *msg_tx; int rc; @@ -125,7 +125,7 @@ static void gsup_client_updown_cb(struct ipa_client_conn *link, int up) { - struct gsup_client *gsupc = link->data; + struct osmo_gsup_client *gsupc = link->data; LOGP(DLGSUP, LOGL_INFO, "GSUP link to %s:%d %s\n", link->addr, link->port, up ? "UP" : "DOWN"); @@ -143,11 +143,11 @@ osmo_timer_del(&gsupc->ping_timer); osmo_timer_schedule(&gsupc->connect_timer, - GSUP_CLIENT_RECONNECT_INTERVAL, 0); + OSMO_GSUP_CLIENT_RECONNECT_INTERVAL, 0); } } -static int gsup_client_oap_handle(struct gsup_client *gsupc, struct msgb *msg_rx) +static int gsup_client_oap_handle(struct osmo_gsup_client *gsupc, struct msgb *msg_rx) { int rc; struct msgb *msg_tx; @@ -168,7 +168,7 @@ { struct ipaccess_head *hh = (struct ipaccess_head *) msg->data; struct ipaccess_head_ext *he = (struct ipaccess_head_ext *) msgb_l2(msg); - struct gsup_client *gsupc = (struct gsup_client *)link->data; + struct osmo_gsup_client *gsupc = (struct osmo_gsup_client *)link->data; int rc; struct ipaccess_unit ipa_dev = { /* see gsup_client_create() on const vs non-const */ @@ -234,7 +234,7 @@ static void ping_timer_cb(void *gsupc_) { - struct gsup_client *gsupc = gsupc_; + struct osmo_gsup_client *gsupc = gsupc_; LOGP(DLGSUP, LOGL_INFO, "GSUP ping callback (%s, %s PONG)\n", gsupc->is_connected ? "connected" : "not connected", @@ -252,27 +252,27 @@ gsup_client_connect(gsupc); } -static void start_test_procedure(struct gsup_client *gsupc) +static void start_test_procedure(struct osmo_gsup_client *gsupc) { osmo_timer_setup(&gsupc->ping_timer, ping_timer_cb, gsupc); gsupc->got_ipa_pong = 0; - osmo_timer_schedule(&gsupc->ping_timer, GSUP_CLIENT_PING_INTERVAL, 0); + osmo_timer_schedule(&gsupc->ping_timer, OSMO_GSUP_CLIENT_PING_INTERVAL, 0); LOGP(DLGSUP, LOGL_DEBUG, "GSUP sending PING\n"); gsup_client_send_ping(gsupc); } -struct gsup_client *gsup_client_create(void *talloc_ctx, - const char *unit_name, - const char *ip_addr, - unsigned int tcp_port, - gsup_client_read_cb_t read_cb, - struct osmo_oap_client_config *oapc_config) +struct osmo_gsup_client *osmo_gsup_client_create(void *talloc_ctx, + const char *unit_name, + const char *ip_addr, + unsigned int tcp_port, + osmo_gsup_client_read_cb_t read_cb, + struct osmo_oap_client_config *oapc_config) { - struct gsup_client *gsupc; + struct osmo_gsup_client *gsupc; int rc; - gsupc = talloc_zero(talloc_ctx, struct gsup_client); + gsupc = talloc_zero(talloc_ctx, struct osmo_gsup_client); OSMO_ASSERT(gsupc); /* struct ipaccess_unit has a non-const unit_name, so let's copy to be @@ -309,11 +309,11 @@ return gsupc; failed: - gsup_client_destroy(gsupc); + osmo_gsup_client_destroy(gsupc); return NULL; } -void gsup_client_destroy(struct gsup_client *gsupc) +void osmo_gsup_client_destroy(struct osmo_gsup_client *gsupc) { osmo_timer_del(&gsupc->connect_timer); osmo_timer_del(&gsupc->ping_timer); @@ -326,7 +326,7 @@ talloc_free(gsupc); } -int gsup_client_send(struct gsup_client *gsupc, struct msgb *msg) +int osmo_gsup_client_send(struct osmo_gsup_client *gsupc, struct msgb *msg) { if (!gsupc || !gsupc->is_connected) { LOGP(DLGSUP, LOGL_ERROR, "GSUP not connected, unable to send %s\n", msgb_hexdump(msg)); @@ -339,7 +339,7 @@ return 0; } -struct msgb *gsup_client_msgb_alloc(void) +struct msgb *osmo_gsup_client_msgb_alloc(void) { return msgb_alloc_headroom(4000, 64, __func__); } diff --git a/src/gsupclient/gsup_test_client.c b/src/gsupclient/gsup_test_client.c index cfbd55e..b0362ad 100644 --- a/src/gsupclient/gsup_test_client.c +++ b/src/gsupclient/gsup_test_client.c @@ -13,7 +13,7 @@ #include -static struct gsup_client *g_gc; +static struct osmo_gsup_client *g_gc; /*********************************************************************** @@ -117,7 +117,7 @@ return rc; } - return gsup_client_send(g_gc, msg); + return osmo_gsup_client_send(g_gc, msg); } /* allocate + generate + send Send-Auth-Info */ @@ -137,7 +137,7 @@ return rc; } - return gsup_client_send(g_gc, msg); + return osmo_gsup_client_send(g_gc, msg); } static int resp_isd(struct imsi_op *io) @@ -157,7 +157,7 @@ imsi_op_release(io); - return gsup_client_send(g_gc, msg); + return osmo_gsup_client_send(g_gc, msg); } /* receive an incoming GSUP message */ @@ -214,7 +214,7 @@ } } -static int gsupc_read_cb(struct gsup_client *gsupc, struct msgb *msg) +static int gsupc_read_cb(struct osmo_gsup_client *gsupc, struct msgb *msg) { struct osmo_gsup_message gsup_msg = {0}; struct imsi_op *io = NULL; @@ -293,8 +293,8 @@ osmo_init_logging2(ctx, &gsup_test_client_log_info); - g_gc = gsup_client_create(ctx, "GSUPTEST", server_host, server_port, - gsupc_read_cb, NULL); + g_gc = osmo_gsup_client_create(ctx, "GSUPTEST", server_host, server_port, + gsupc_read_cb, NULL); signal(SIGINT, sig_cb); -- To view, visit https://gerrit.osmocom.org/10114 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I294f8f96af4c5daa2b128962534426e04909290e Gerrit-Change-Number: 10114 Gerrit-PatchSet: 5 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 13:27:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 13:27:21 +0000 Subject: Change in simtrace2[master]: cardem: use TC_ETU to trigger ATR sending In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10217 ) Change subject: cardem: use TC_ETU to trigger ATR sending ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10217 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I69df797e2feadffa9f5f977cb71b69386cee7cd0 Gerrit-Change-Number: 10217 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 30 Jul 2018 13:27:21 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 13:27:25 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 13:27:25 +0000 Subject: Change in simtrace2[master]: cardem: use TC_ETU to trigger ATR sending In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10217 ) Change subject: cardem: use TC_ETU to trigger ATR sending ...................................................................... cardem: use TC_ETU to trigger ATR sending this changes how ATR is handled. the ATR is also printed when set (as important debug information). the test is also updated to correspond to the new mechanism ( simulating the timeout before sending the ATR) Change-Id: I69df797e2feadffa9f5f977cb71b69386cee7cd0 --- M firmware/libcommon/include/card_emu.h M firmware/libcommon/source/card_emu.c M firmware/libcommon/source/mode_cardemu.c M firmware/test/card_emu_tests.c 4 files changed, 104 insertions(+), 30 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/libcommon/include/card_emu.h b/firmware/libcommon/include/card_emu.h index 7144168..a3c1cf2 100644 --- a/firmware/libcommon/include/card_emu.h +++ b/firmware/libcommon/include/card_emu.h @@ -1,6 +1,7 @@ /* ISO7816-3 state machine for the card side * * (C) 2010-2017 by Harald Welte + * (C) 2018 by sysmocom -s.f.m.c. GmbH, Author: Kevin Redon * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -54,3 +55,4 @@ int card_emu_uart_tx(uint8_t uart_chan, uint8_t byte); void card_emu_uart_enable(uint8_t uart_chan, uint8_t rxtx); void card_emu_uart_wait_tx_idle(uint8_t uart_chan); +void card_emu_uart_interrupt(uint8_t uart_chan); diff --git a/firmware/libcommon/source/card_emu.c b/firmware/libcommon/source/card_emu.c index 25ec36a..51fd923 100644 --- a/firmware/libcommon/source/card_emu.c +++ b/firmware/libcommon/source/card_emu.c @@ -1,6 +1,7 @@ /* ISO7816-3 state machine for the card side * * (C) 2010-2017 by Harald Welte + * (C) 2018 by sysmocom -s.f.m.c. GmbH, Author: Kevin Redon * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -296,32 +297,39 @@ card_emu_uart_enable(ch->uart_chan, 0); break; case ISO_S_WAIT_ATR: - set_pts_state(ch, PTS_S_WAIT_REQ_PTSS); /* Reset to initial Fi / Di ratio */ ch->fi = 1; ch->di = 1; emu_update_fidi(ch); + /* the ATR should only be sent 400 to 40k clock cycles after the RESET. + * we use the tc_etu mechanism to wait this time. + * since the initial ETU is Fd=372/Dd=1 clock cycles long, we have to wait 2-107 ETU. + */ + tc_etu_set_wtime(ch->tc_chan, 2); + /* ensure the TC_ETU timer is enabled */ + tc_etu_enable(ch->tc_chan); + break; + case ISO_S_IN_ATR: /* initialize to default WI, this will be overwritten if we - * receive TC2, and it will be programmed into hardware after + * send TC2, and it will be programmed into hardware after * ATR is finished */ ch->wi = ISO7816_3_DEFAULT_WI; /* update waiting time to initial waiting time */ ch->waiting_time = ISO7816_3_INIT_WTIME; + /* set initial waiting time */ tc_etu_set_wtime(ch->tc_chan, ch->waiting_time); /* Set ATR sub-state to initial state */ ch->atr.idx = 0; - //set_atr_state(ch, ATR_S_WAIT_TS); - /* Notice that we are just coming out of reset */ - //ch->sh.flags |= SIMTRACE_FLAG_ATR; + /* enable USART transmission to reader */ card_emu_uart_enable(ch->uart_chan, ENABLE_TX); - break; + /* trigger USART TX IRQ to sent first ATR byte TS */ + card_emu_uart_interrupt(ch->uart_chan); break; case ISO_S_WAIT_TPDU: /* enable the receiver, disable transmitter */ set_tpdu_state(ch, TPDU_S_WAIT_CLA); card_emu_uart_enable(ch->uart_chan, ENABLE_RX); break; - case ISO_S_IN_ATR: case ISO_S_IN_PTS: case ISO_S_IN_TPDU: /* do nothing */ @@ -329,6 +337,47 @@ } } +/********************************************************************** + * ATR handling + **********************************************************************/ + +/*! Transmit ATR data to reader + * @param[in] ch card interface connected to reader + * @return numbers of bytes transmitted + */ +static int tx_byte_atr(struct card_handle *ch) +{ + if (NULL == ch) { + TRACE_ERROR("ATR TX: no card handle provided\n\r"); + return 0; + } + if (ISO_S_IN_ATR != ch->state) { + TRACE_ERROR("%u: ATR TX: no in ATR state\n\r", ch->num); + return 0; + } + + /* Transmit ATR */ + if (ch->atr.idx < ch->atr.len) { + uint8_t byte = ch->atr.atr[ch->atr.idx++]; + card_emu_uart_tx(ch->uart_chan, byte); + TRACE_DEBUG("%u: ATR TX: %02x\n\r", ch->num, byte); + return 1; + } else { /* The ATR has been completely transmitted */ + /* TODO update WI using optional TC2 and then update WT */ + //ch->wi = ISO7816_3_DEFAULT_WI; + /* update waiting time */ + //ch->waiting_time = ISO7816_3_INIT_WTIME; + //tc_etu_set_wtime(ch->tc_chan, ch->waiting_time); + /* reset PTS to initial state */ + set_pts_state(ch, PTS_S_WAIT_REQ_PTSS); + /* go to next state */ + card_set_state(ch, ISO_S_WAIT_TPDU); + return 0; + } + + /* return number of bytes transmitted */ + return 1; +} /********************************************************************** * PTS / PPS handling @@ -793,17 +842,7 @@ switch (ch->state) { case ISO_S_IN_ATR: - if (ch->atr.idx < ch->atr.len) { - uint8_t byte; - byte = ch->atr.atr[ch->atr.idx++]; - rc = 1; - - card_emu_uart_tx(ch->uart_chan, byte); - - /* detect end of ATR */ - if (ch->atr.idx >= ch->atr.len) - card_set_state(ch, ISO_S_WAIT_TPDU); - } + rc = tx_byte_atr(ch); break; case ISO_S_IN_PTS: rc = tx_byte_pts(ch); @@ -898,9 +937,8 @@ if (ch->vcc_active && ch->clocked) { /* enable the TC/ETU counter once reset has been released */ tc_etu_enable(ch->tc_chan); + /* prepare to send the ATR */ card_set_state(ch, ISO_S_WAIT_ATR); - /* FIXME: wait 400 to 40k clock cycles before sending ATR */ - card_set_state(ch, ISO_S_IN_ATR); } } else if (active && !ch->in_reset) { TRACE_INFO("%u: RST asserted\r\n", ch->num); @@ -921,7 +959,15 @@ ch->atr.len = len; ch->atr.idx = 0; - /* FIXME: race condition with trasmitting ATR to reader? */ +#if TRACE_LEVEL >= TRACE_LEVEL_INFO + uint8_t i; + TRACE_INFO("%u: ATR set: ", ch->num); + for (i = 0; i < ch->atr.len; i++) { + TRACE_INFO_WP("%02x ", atr[i]); + } + TRACE_INFO_WP("\n\r"); +#endif + /* FIXME: race condition with transmitting ATR to reader? */ return 0; } @@ -952,7 +998,15 @@ void tc_etu_wtime_expired(void *handle) { struct card_handle *ch = handle; - TRACE_ERROR("%u: wtime_exp\r\n", ch->num); + switch (ch->state) { + case ISO_S_WAIT_ATR: + /* ISO 7816-3 6.2.1 time tc has passed, we can now send the ATR */ + card_set_state(ch, ISO_S_IN_ATR); + break; + default: + TRACE_ERROR("%u: wtime_exp\r\n", ch->num); + break; + } } /* shortest ATR found in smartcard_list.txt */ diff --git a/firmware/libcommon/source/mode_cardemu.c b/firmware/libcommon/source/mode_cardemu.c index 57d541b..76b3a01 100644 --- a/firmware/libcommon/source/mode_cardemu.c +++ b/firmware/libcommon/source/mode_cardemu.c @@ -1,6 +1,7 @@ /* card emulation mode * * (C) 2015-2017 by Harald Welte + * (C) 2018 by sysmocom -s.f.m.c. GmbH, Author: Kevin Redon * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -98,15 +99,11 @@ static Usart *get_usart_by_chan(uint8_t uart_chan) { - switch (uart_chan) { - case 0: - return USART1; -#ifdef CARDEMU_SECOND_UART - case 1: - return USART0; -#endif + if (uart_chan < ARRAY_SIZE(cardem_inst)) { + return cardem_inst[uart_chan].usart_info.base; + } else { + return NULL; } - return NULL; } /*********************************************************************** @@ -244,6 +241,20 @@ return 0; } +/* call-back from card_emu.c to force a USART interrupt */ +void card_emu_uart_interrupt(uint8_t uart_chan) +{ + Usart *usart = get_usart_by_chan(uart_chan); + if (!usart) { + return; + } + if (USART0 == usart) { + NVIC_SetPendingIRQ(USART0_IRQn); + } else if (USART1 == usart) { + NVIC_SetPendingIRQ(USART1_IRQn); + } +} + /*********************************************************************** * ADC for VCC voltage detection ***********************************************************************/ diff --git a/firmware/test/card_emu_tests.c b/firmware/test/card_emu_tests.c index 3ea0678..09b2e0d 100644 --- a/firmware/test/card_emu_tests.c +++ b/firmware/test/card_emu_tests.c @@ -65,6 +65,11 @@ printf("uart_enable(uart_chan=%u, %s)\n", uart_chan, rts); } +void card_emu_uart_interrupt(uint8_t uart_chan) +{ + printf("uart_interrupt(uart_chan=%u)\n", uart_chan); +} + void tc_etu_set_wtime(uint8_t tc_chan, uint16_t wtime) { printf("tc_etu_set_wtime(tc_chan=%u, wtime=%u)\n", tc_chan, wtime); @@ -120,6 +125,8 @@ /* release from reset and verify th ATR */ card_emu_io_statechg(ch, CARD_IO_RST, 0); + /* simulate waiting time before ATR expired */ + tc_etu_wtime_expired(ch); verify_atr(ch); } -- To view, visit https://gerrit.osmocom.org/10217 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I69df797e2feadffa9f5f977cb71b69386cee7cd0 Gerrit-Change-Number: 10217 Gerrit-PatchSet: 3 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 13:31:20 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 30 Jul 2018 13:31:20 +0000 Subject: Change in osmo-hlr[master]: src/db.c: fix: make sure the database is properly closed Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/10238 Change subject: src/db.c: fix: make sure the database is properly closed ...................................................................... src/db.c: fix: make sure the database is properly closed Thanks to ASAN, it was discovered that some part of heap is not released on exit: ==19736==ERROR: LeakSanitizer: detected memory leaks Indirect leak of 94616 byte(s) in 214 object(s) allocated from: #0 0x4e05c6 (/home/wmn/osmocom/osmo-hlr/src/osmo-hlr+0x4e05c6) #1 0x7f9b01061dc6 (/usr/lib/x86_64-linux-gnu/libsqlite3.so.0+0x33dc6) Indirect leak of 1160 byte(s) in 1 object(s) allocated from: #0 0x4e097d (/home/wmn/osmocom/osmo-hlr/src/osmo-hlr+0x4e097d) #1 0x7f9b01061d58 (/usr/lib/x86_64-linux-gnu/libsqlite3.so.0+0x33d58) SUMMARY: AddressSanitizer: 95776 byte(s) leaked in 215 allocation(s). After a long investigation, it was figured out that *sqlite never closes the database* due to 'unfinalized statements or unfinished backups'. The problem was in db_bootstrap(), where several statements were prepared, but not finalized in loop. This was also the reason of *.db-shm / *.db-wal files remaining after the program is closed, and the reason of the following message db.c:77 (283) recovered 18 frames from WAL file *.db-wal Let's fix this and stop ignoring the result of sqlite3_close(). Change-Id: Ibe620d7723b1947d4f60f820bd18435ad0193112 Related: OS#3434 --- M src/db.c 1 file changed, 10 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/38/10238/1 diff --git a/src/db.c b/src/db.c index cc06ee6..2d1bdde 100644 --- a/src/db.c +++ b/src/db.c @@ -173,12 +173,20 @@ void db_close(struct db_context *dbc) { unsigned int i; + int rc; for (i = 0; i < ARRAY_SIZE(dbc->stmt); i++) { /* it is ok to call finalize on NULL */ sqlite3_finalize(dbc->stmt[i]); } - sqlite3_close(dbc->db); + + /* Ask sqlite3 to close DB */ + rc = sqlite3_close(dbc->db); + if (rc != SQLITE_OK) { /* Make sure it's actually closed! */ + LOGP(DDB, LOGL_ERROR, "Couldn't close database: (rc=%d) %s\n", + rc, sqlite3_errmsg(dbc->db)); + } + talloc_free(dbc); } @@ -200,6 +208,7 @@ /* execute the statement */ rc = sqlite3_step(stmt); db_remove_reset(stmt); + sqlite3_finalize(stmt); if (rc != SQLITE_DONE) { LOGP(DDB, LOGL_ERROR, "Cannot bootstrap database: SQL error: (%d) %s," " during stmt '%s'", -- To view, visit https://gerrit.osmocom.org/10238 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ibe620d7723b1947d4f60f820bd18435ad0193112 Gerrit-Change-Number: 10238 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 13:34:43 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 30 Jul 2018 13:34:43 +0000 Subject: Change in osmo-bsc[master]: doc: update mgw settings in example config file Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/10239 Change subject: doc: update mgw settings in example config file ...................................................................... doc: update mgw settings in example config file The example config file lacks a default port setting for the local mgcp client port. Lets update that. Change-Id: I6b1c5097d98ec2ab97d51f99b1105db3de85c75f Related: OS#2874 --- M doc/examples/osmo-bsc/osmo-bsc.cfg 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/39/10239/1 diff --git a/doc/examples/osmo-bsc/osmo-bsc.cfg b/doc/examples/osmo-bsc/osmo-bsc.cfg index a5ff1ea..a1bc7e3 100644 --- a/doc/examples/osmo-bsc/osmo-bsc.cfg +++ b/doc/examples/osmo-bsc/osmo-bsc.cfg @@ -93,6 +93,7 @@ amr-config 4_75k forbidden mgw remote-ip 127.0.0.1 mgw remote-port 2427 + mgw local-port 2727 mgw endpoint-range 1 31 bsc mid-call-timeout 0 -- To view, visit https://gerrit.osmocom.org/10239 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I6b1c5097d98ec2ab97d51f99b1105db3de85c75f Gerrit-Change-Number: 10239 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 13:34:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 13:34:54 +0000 Subject: Change in simtrace2[master]: remsim: fix payload overwriting In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10218 ) Change subject: remsim: fix payload overwriting ...................................................................... remsim: fix payload overwriting The slot number is in the header, and correctly set in st_push_hdr. Setting the slot in st_slot_tx_msg will overwrite the payload data. This caused bytes three of the ATR to be changed from 0x96 to 0x00, corrupting the ATR. This corruption is caught by the ATR checksum, and the modem would reset the card (2 additional times) to try to get correct ATR. Change-Id: If971699993617fc50557d20582c344ea06645a3f --- M host/simtrace2-remsim.c 1 file changed, 0 insertions(+), 5 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/host/simtrace2-remsim.c b/host/simtrace2-remsim.c index 462f73e..52c5051 100644 --- a/host/simtrace2-remsim.c +++ b/host/simtrace2-remsim.c @@ -173,16 +173,11 @@ int st_slot_tx_msg(struct st_slot *slot, struct msgb *msg, uint8_t msg_class, uint8_t msg_type) { - struct simtrace_msg_hdr *sh = (struct simtrace_msg_hdr *) msg->data; - - sh->slot_nr = slot->slot_nr; - st_push_hdr(msg, msg_class, msg_type, slot->slot_nr); return st_transp_tx_msg(slot->transp, msg); } - /*********************************************************************** * Card Emulation protocol ***********************************************************************/ -- To view, visit https://gerrit.osmocom.org/10218 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: If971699993617fc50557d20582c344ea06645a3f Gerrit-Change-Number: 10218 Gerrit-PatchSet: 4 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 13:35:31 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 13:35:31 +0000 Subject: Change in osmo-hlr[master]: src/db.c: fix: make sure the database is properly closed In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10238 ) Change subject: src/db.c: fix: make sure the database is properly closed ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10238 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ibe620d7723b1947d4f60f820bd18435ad0193112 Gerrit-Change-Number: 10238 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 30 Jul 2018 13:35:31 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 13:35:33 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 13:35:33 +0000 Subject: Change in osmo-hlr[master]: src/db.c: fix: make sure the database is properly closed In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10238 ) Change subject: src/db.c: fix: make sure the database is properly closed ...................................................................... src/db.c: fix: make sure the database is properly closed Thanks to ASAN, it was discovered that some part of heap is not released on exit: ==19736==ERROR: LeakSanitizer: detected memory leaks Indirect leak of 94616 byte(s) in 214 object(s) allocated from: #0 0x4e05c6 (/home/wmn/osmocom/osmo-hlr/src/osmo-hlr+0x4e05c6) #1 0x7f9b01061dc6 (/usr/lib/x86_64-linux-gnu/libsqlite3.so.0+0x33dc6) Indirect leak of 1160 byte(s) in 1 object(s) allocated from: #0 0x4e097d (/home/wmn/osmocom/osmo-hlr/src/osmo-hlr+0x4e097d) #1 0x7f9b01061d58 (/usr/lib/x86_64-linux-gnu/libsqlite3.so.0+0x33d58) SUMMARY: AddressSanitizer: 95776 byte(s) leaked in 215 allocation(s). After a long investigation, it was figured out that *sqlite never closes the database* due to 'unfinalized statements or unfinished backups'. The problem was in db_bootstrap(), where several statements were prepared, but not finalized in loop. This was also the reason of *.db-shm / *.db-wal files remaining after the program is closed, and the reason of the following message db.c:77 (283) recovered 18 frames from WAL file *.db-wal Let's fix this and stop ignoring the result of sqlite3_close(). Change-Id: Ibe620d7723b1947d4f60f820bd18435ad0193112 Related: OS#3434 --- M src/db.c 1 file changed, 10 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/db.c b/src/db.c index cc06ee6..2d1bdde 100644 --- a/src/db.c +++ b/src/db.c @@ -173,12 +173,20 @@ void db_close(struct db_context *dbc) { unsigned int i; + int rc; for (i = 0; i < ARRAY_SIZE(dbc->stmt); i++) { /* it is ok to call finalize on NULL */ sqlite3_finalize(dbc->stmt[i]); } - sqlite3_close(dbc->db); + + /* Ask sqlite3 to close DB */ + rc = sqlite3_close(dbc->db); + if (rc != SQLITE_OK) { /* Make sure it's actually closed! */ + LOGP(DDB, LOGL_ERROR, "Couldn't close database: (rc=%d) %s\n", + rc, sqlite3_errmsg(dbc->db)); + } + talloc_free(dbc); } @@ -200,6 +208,7 @@ /* execute the statement */ rc = sqlite3_step(stmt); db_remove_reset(stmt); + sqlite3_finalize(stmt); if (rc != SQLITE_DONE) { LOGP(DDB, LOGL_ERROR, "Cannot bootstrap database: SQL error: (%d) %s," " during stmt '%s'", -- To view, visit https://gerrit.osmocom.org/10238 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ibe620d7723b1947d4f60f820bd18435ad0193112 Gerrit-Change-Number: 10238 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 13:40:44 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 30 Jul 2018 13:40:44 +0000 Subject: Change in osmo-msc[master]: doc: update mgw settings in example config file Message-ID: dexter has uploaded this change for review. ( https://gerrit.osmocom.org/10240 Change subject: doc: update mgw settings in example config file ...................................................................... doc: update mgw settings in example config file This example configuration files lack port settings for the mgcp client. Lets explicitly assign a port for the MGW and a local port. For the local port lets use the IETF port number + 1. The reason for this is that the default config for osmo-bsc already uses the IETF port and in osmo-bsc and osmo-msc run on the same machine in many setups. Change-Id: I17453e0d30eec757aba9530b63eb5d1539cbdffc --- M doc/examples/osmo-msc/osmo-msc.cfg M doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg M doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg 3 files changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/40/10240/1 diff --git a/doc/examples/osmo-msc/osmo-msc.cfg b/doc/examples/osmo-msc/osmo-msc.cfg index 91c9eee..f80143d 100644 --- a/doc/examples/osmo-msc/osmo-msc.cfg +++ b/doc/examples/osmo-msc/osmo-msc.cfg @@ -14,6 +14,8 @@ mm info 1 msc mgw remote-ip 10.23.24.1 + mgw remote-port 2427 + mgw local-port 2728 assign-tmsi auth-tuple-max-reuse-count 3 auth-tuple-reuse-on-error 1 diff --git a/doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg b/doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg index 0b9fd2a..39ca9d4 100644 --- a/doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg +++ b/doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg @@ -22,4 +22,6 @@ cs7-instance-a 0 cs7-instance-iu 0 mgw remote-ip 10.23.24.1 + mgw remote-port 2427 + mgw local-port 2728 assign-tmsi diff --git a/doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg b/doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg index 44ac3f8..2af1726 100644 --- a/doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg +++ b/doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg @@ -24,4 +24,6 @@ cs7-instance-a 0 cs7-instance-iu 1 mgw remote-ip 10.23.24.1 + mgw remote-port 2427 + mgw local-port 2728 assign-tmsi -- To view, visit https://gerrit.osmocom.org/10240 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I17453e0d30eec757aba9530b63eb5d1539cbdffc Gerrit-Change-Number: 10240 Gerrit-PatchSet: 1 Gerrit-Owner: dexter -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 13:49:30 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 30 Jul 2018 13:49:30 +0000 Subject: Change in osmo-hlr[master]: src/db.c: don't ignore the result of db_bootstrap() Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/10241 Change subject: src/db.c: don't ignore the result of db_bootstrap() ...................................................................... src/db.c: don't ignore the result of db_bootstrap() Change-Id: I0de3d4c4355c4dee8b832faae347586d1e1b3516 --- M src/db.c 1 file changed, 9 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/41/10241/1 diff --git a/src/db.c b/src/db.c index 2d1bdde..4b0577f 100644 --- a/src/db.c +++ b/src/db.c @@ -202,7 +202,7 @@ if (rc != SQLITE_OK) { LOGP(DDB, LOGL_ERROR, "Unable to prepare SQL statement '%s'\n", stmt_bootstrap_sql[i]); - return -1; + return rc; } /* execute the statement */ @@ -214,10 +214,10 @@ " during stmt '%s'", rc, sqlite3_errmsg(dbc->db), stmt_bootstrap_sql[i]); - return -1; + return rc; } } - return 0; + return SQLITE_OK; } struct db_context *db_open(void *ctx, const char *fname, bool enable_sqlite_logging) @@ -274,7 +274,12 @@ LOGP(DDB, LOGL_ERROR, "Unable to set Write-Ahead Logging: %s\n", err_msg); - db_bootstrap(dbc); + rc = db_bootstrap(dbc); + if (rc != SQLITE_OK) { + LOGP(DDB, LOGL_ERROR, "Failed to bootstrap DB: (rc=%d) %s\n", + rc, sqlite3_errmsg(dbc->db)); + goto out_free; + } /* prepare all SQL statements */ for (i = 0; i < ARRAY_SIZE(dbc->stmt); i++) { -- To view, visit https://gerrit.osmocom.org/10241 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I0de3d4c4355c4dee8b832faae347586d1e1b3516 Gerrit-Change-Number: 10241 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 14:12:00 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 14:12:00 +0000 Subject: Change in osmo-hlr[master]: src/db.c: don't ignore the result of db_bootstrap() In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10241 ) Change subject: src/db.c: don't ignore the result of db_bootstrap() ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10241 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0de3d4c4355c4dee8b832faae347586d1e1b3516 Gerrit-Change-Number: 10241 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 30 Jul 2018 14:12:00 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 14:19:37 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 30 Jul 2018 14:19:37 +0000 Subject: Change in osmo-hlr[master]: src/db.c: don't ignore the result of db_bootstrap() In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. ( https://gerrit.osmocom.org/10241 ) Change subject: src/db.c: don't ignore the result of db_bootstrap() ...................................................................... src/db.c: don't ignore the result of db_bootstrap() Change-Id: I0de3d4c4355c4dee8b832faae347586d1e1b3516 --- M src/db.c 1 file changed, 9 insertions(+), 4 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/db.c b/src/db.c index 2d1bdde..4b0577f 100644 --- a/src/db.c +++ b/src/db.c @@ -202,7 +202,7 @@ if (rc != SQLITE_OK) { LOGP(DDB, LOGL_ERROR, "Unable to prepare SQL statement '%s'\n", stmt_bootstrap_sql[i]); - return -1; + return rc; } /* execute the statement */ @@ -214,10 +214,10 @@ " during stmt '%s'", rc, sqlite3_errmsg(dbc->db), stmt_bootstrap_sql[i]); - return -1; + return rc; } } - return 0; + return SQLITE_OK; } struct db_context *db_open(void *ctx, const char *fname, bool enable_sqlite_logging) @@ -274,7 +274,12 @@ LOGP(DDB, LOGL_ERROR, "Unable to set Write-Ahead Logging: %s\n", err_msg); - db_bootstrap(dbc); + rc = db_bootstrap(dbc); + if (rc != SQLITE_OK) { + LOGP(DDB, LOGL_ERROR, "Failed to bootstrap DB: (rc=%d) %s\n", + rc, sqlite3_errmsg(dbc->db)); + goto out_free; + } /* prepare all SQL statements */ for (i = 0; i < ARRAY_SIZE(dbc->stmt); i++) { -- To view, visit https://gerrit.osmocom.org/10241 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I0de3d4c4355c4dee8b832faae347586d1e1b3516 Gerrit-Change-Number: 10241 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 14:34:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 14:34:47 +0000 Subject: Change in osmo-hlr[master]: GSUP: Log GSUP route add/remove Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10242 Change subject: GSUP: Log GSUP route add/remove ...................................................................... GSUP: Log GSUP route add/remove Change-Id: I1768d0b8ee7e2821e40a799c9a1c1d900a7ddc48 --- M src/gsup_router.c 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/42/10242/1 diff --git a/src/gsup_router.c b/src/gsup_router.c index e9aed78..6038ee6 100644 --- a/src/gsup_router.c +++ b/src/gsup_router.c @@ -23,6 +23,7 @@ #include #include +#include "logging.h" #include "gsup_server.h" struct gsup_route { @@ -60,6 +61,8 @@ if (!gr) return -ENOMEM; + LOGP(DMAIN, LOGL_INFO, "Adding GSUP route for %s\n", addr); + gr->addr = talloc_memdup(gr, addr, addrlen); gr->conn = conn; llist_add_tail(&gr->list, &conn->server->routes); @@ -75,6 +78,8 @@ llist_for_each_entry_safe(gr, gr2, &conn->server->routes, list) { if (gr->conn == conn) { + LOGP(DMAIN, LOGL_INFO, "Removing GSUP route for %s (GSUP disconnect)\n", + gr->addr); llist_del(&gr->list); talloc_free(gr); num_deleted++; -- To view, visit https://gerrit.osmocom.org/10242 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I1768d0b8ee7e2821e40a799c9a1c1d900a7ddc48 Gerrit-Change-Number: 10242 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 14:34:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 14:34:47 +0000 Subject: Change in osmo-hlr[master]: hlr: Export + Declare global g_hlr symbol Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10243 Change subject: hlr: Export + Declare global g_hlr symbol ...................................................................... hlr: Export + Declare global g_hlr symbol Change-Id: I6f3e50f071fb2fbbe58413b4760dc2215055a444 --- M src/hlr.c M src/hlr.h M src/hlr_vty.c M src/hlr_vty_subscr.c 4 files changed, 3 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/43/10243/1 diff --git a/src/hlr.c b/src/hlr.c index 8732587..0b1ff4f 100644 --- a/src/hlr.c +++ b/src/hlr.c @@ -43,7 +43,7 @@ #include "luop.h" #include "hlr_vty.h" -static struct hlr *g_hlr; +struct hlr *g_hlr; static int quit = 0; /* Trigger 'Insert Subscriber Data' messages to all connected GSUP clients. diff --git a/src/hlr.h b/src/hlr.h index 368a052..8f73806 100644 --- a/src/hlr.h +++ b/src/hlr.h @@ -39,6 +39,8 @@ char *gsup_bind_addr; }; +extern struct hlr *g_hlr; + struct hlr_subscriber; void osmo_hlr_subscriber_update_notify(struct hlr_subscriber *subscr); diff --git a/src/hlr_vty.c b/src/hlr_vty.c index ecc2f5c..7c20a0b 100644 --- a/src/hlr_vty.c +++ b/src/hlr_vty.c @@ -32,8 +32,6 @@ #include "hlr_vty_subscr.h" #include "gsup_server.h" -static struct hlr *g_hlr = NULL; - struct cmd_node hlr_node = { HLR_NODE, "%s(config-hlr)# ", @@ -154,8 +152,6 @@ void hlr_vty_init(struct hlr *hlr, const struct log_info *cat) { - g_hlr = hlr; - logging_vty_add_cmds(cat); osmo_talloc_vty_add_cmds(); diff --git a/src/hlr_vty_subscr.c b/src/hlr_vty_subscr.c index 4092a8f..bbda6c5 100644 --- a/src/hlr_vty_subscr.c +++ b/src/hlr_vty_subscr.c @@ -33,8 +33,6 @@ #define hexdump_buf(buf) osmo_hexdump_nospc((void*)buf, sizeof(buf)) -static struct hlr *g_hlr = NULL; - static void subscr_dump_full_vty(struct vty *vty, struct hlr_subscriber *subscr) { int rc; @@ -478,8 +476,6 @@ void hlr_vty_subscriber_init(struct hlr *hlr) { - g_hlr = hlr; - install_element_ve(&subscriber_show_cmd); install_element(ENABLE_NODE, &subscriber_create_cmd); install_element(ENABLE_NODE, &subscriber_delete_cmd); -- To view, visit https://gerrit.osmocom.org/10243 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I6f3e50f071fb2fbbe58413b4760dc2215055a444 Gerrit-Change-Number: 10243 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 14:34:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 14:34:47 +0000 Subject: Change in osmo-hlr[master]: USSD: Add Core USSD handling + VTY routing config to HLR Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10244 Change subject: USSD: Add Core USSD handling + VTY routing config to HLR ...................................................................... USSD: Add Core USSD handling + VTY routing config to HLR Change-Id: I3cfd7cd401ea32b7e92f1124d129099d9f7dc6e6 --- M src/Makefile.am M src/hlr.c M src/hlr.h A src/hlr_ussd.c A src/hlr_ussd.h M src/hlr_vty.c M src/hlr_vty.h 7 files changed, 286 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/44/10244/1 diff --git a/src/Makefile.am b/src/Makefile.am index e4506bb..c531ed3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -32,6 +32,7 @@ ctrl.h \ hlr_vty.h \ hlr_vty_subscr.h \ + hlr_ussd.h \ db_bootstrap.h \ $(NULL) @@ -55,6 +56,7 @@ hlr_vty.c \ hlr_vty_subscr.c \ gsup_send.c \ + hlr_ussd.c \ $(NULL) osmo_hlr_LDADD = \ diff --git a/src/hlr.c b/src/hlr.c index 0b1ff4f..79c4c86 100644 --- a/src/hlr.c +++ b/src/hlr.c @@ -559,6 +559,7 @@ vty_info.tall_ctx = hlr_ctx; g_hlr = talloc_zero(hlr_ctx, struct hlr); + INIT_LLIST_HEAD(&g_hlr->euse_list); rc = osmo_init_logging2(hlr_ctx, &hlr_log_info); if (rc < 0) { diff --git a/src/hlr.h b/src/hlr.h index 8f73806..938f7f9 100644 --- a/src/hlr.h +++ b/src/hlr.h @@ -23,6 +23,9 @@ #pragma once #include +#include + +struct hlr_euse; struct hlr { /* GSUP server pointer */ @@ -37,6 +40,9 @@ /* Local bind addr */ char *gsup_bind_addr; + + struct llist_head euse_list; + struct hlr_euse *euse_default; }; extern struct hlr *g_hlr; diff --git a/src/hlr_ussd.c b/src/hlr_ussd.c new file mode 100644 index 0000000..785eafd --- /dev/null +++ b/src/hlr_ussd.c @@ -0,0 +1,93 @@ +/* OsmoHLR VTY implementation */ + +/* (C) 2018 Harald Welte + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + + +#include +#include +#include + +#include "hlr.h" +#include "hlr_ussd.h" + +struct hlr_euse *euse_find(struct hlr *hlr, const char *name) +{ + struct hlr_euse *euse; + + llist_for_each_entry(euse, &hlr->euse_list, list) { + if (!strcmp(euse->name, name)) + return euse; + } + return NULL; +} + +struct hlr_euse *euse_alloc(struct hlr *hlr, const char *name) +{ + struct hlr_euse *euse = euse_find(hlr, name); + if (euse) + return NULL; + + euse = talloc_zero(hlr, struct hlr_euse); + euse->name = talloc_strdup(euse, name); + euse->hlr = hlr; + INIT_LLIST_HEAD(&euse->routes); + llist_add_tail(&euse->list, &hlr->euse_list); + + return euse; +} + +void euse_del(struct hlr_euse *euse) +{ + llist_del(&euse->list); + talloc_free(euse); +} + + +struct hlr_euse_route *euse_route_find(struct hlr_euse *euse, const char *prefix) +{ + struct hlr_euse_route *rt; + + llist_for_each_entry(rt, &euse->routes, list) { + if (!strcmp(rt->prefix, prefix)) + return rt; + } + return NULL; +} + +struct hlr_euse_route *euse_route_prefix_alloc(struct hlr_euse *euse, const char *prefix) +{ + struct hlr_euse_route *rt; + + if (euse_route_find(euse, prefix)) + return NULL; + + rt = talloc_zero(euse, struct hlr_euse_route); + rt->prefix = talloc_strdup(rt, prefix); + rt->euse = euse; + llist_add_tail(&rt->list, &euse->routes); + + return rt; +} + +void euse_route_del(struct hlr_euse_route *rt) +{ + llist_del(&rt->list); + talloc_free(rt); +} diff --git a/src/hlr_ussd.h b/src/hlr_ussd.h new file mode 100644 index 0000000..05d2099 --- /dev/null +++ b/src/hlr_ussd.h @@ -0,0 +1,30 @@ +#include +#include + +struct hlr_euse_route { + /* hlr_euse.routes */ + struct llist_head list; + struct hlr_euse *euse; + const char *prefix; +}; + +struct hlr_euse { + /* list in the per-hlr list of EUSEs */ + struct llist_head list; + struct hlr *hlr; + /* name (must match the IPA ID tag) */ + const char *name; + /* human-readable description */ + const char *description; + /* list of hlr_euse_route */ + struct llist_head routes; +}; + + +struct hlr_euse *euse_find(struct hlr *hlr, const char *name); +struct hlr_euse *euse_alloc(struct hlr *hlr, const char *name); +void euse_del(struct hlr_euse *euse); + +struct hlr_euse_route *euse_route_find(struct hlr_euse *euse, const char *prefix); +struct hlr_euse_route *euse_route_prefix_alloc(struct hlr_euse *euse, const char *prefix); +void euse_route_del(struct hlr_euse_route *rt); diff --git a/src/hlr_vty.c b/src/hlr_vty.c index 7c20a0b..4e6f952 100644 --- a/src/hlr_vty.c +++ b/src/hlr_vty.c @@ -6,6 +6,10 @@ * * All Rights Reserved * + * (C) 2018 Harald Welte + * + * All Rights Reserved + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation; either version 3 of the License, or @@ -117,12 +121,153 @@ return CMD_SUCCESS; } +/*********************************************************************** + * External USSD Entity + ***********************************************************************/ + +#include "hlr_ussd.h" + +DEFUN(cfg_euse_route_pfx, cfg_euse_route_pfx_cmd, + "route prefix PREFIX", + "") +{ + struct hlr_euse *euse = vty->index; + struct hlr_euse_route *rt = euse_route_find(euse, argv[0]); + + if (rt) { + vty_out(vty, "%% Cannot add [another?] route for prefix %s%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + euse_route_prefix_alloc(euse, argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_euse_no_route_pfx, cfg_euse_no_route_pfx_cmd, + "no route prefix PREFIX", + NO_STR "") +{ + struct hlr_euse *euse = vty->index; + struct hlr_euse_route *rt = euse_route_find(euse, argv[0]); + if (!rt) { + vty_out(vty, "%% Cannot find route for prefix %s%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + euse_route_del(rt); + + return CMD_SUCCESS; +} + +DEFUN(cfg_euse_defaultroute, cfg_euse_defaultroute_cmd, + "default-route", + "Set this EUSE as default-route for all USSD to unknown destinations\n") +{ + struct hlr_euse *euse = vty->index; + + if (g_hlr->euse_default != euse) { + vty_out(vty, "Switching default route from %s to %s%s", + g_hlr->euse_default->name, euse->name, VTY_NEWLINE); + g_hlr->euse_default = euse; + } + + return CMD_SUCCESS; +} + +DEFUN(cfg_euse_no_defaultroute, cfg_euse_no_defaultroute_cmd, + "no default-route", + NO_STR "Remove this EUSE as default-route for all USSD to unknown destinations\n") +{ + struct hlr_euse *euse = vty->index; + + if (g_hlr->euse_default != euse) { + vty_out(vty, "%% Current EUSE is no default route, cannot delete it%s", VTY_NEWLINE); + return CMD_WARNING; + } + g_hlr->euse_default = NULL; + + return CMD_SUCCESS; +} + +struct cmd_node euse_node = { + EUSE_NODE, + "%s(config-hlr-euse)# ", + 1, +}; + +DEFUN(cfg_euse, cfg_euse_cmd, + "euse NAME", + "Configure a particular External USSD Entity\n" + "Alphanumeric name of the External USSD Entity\n") +{ + struct hlr_euse *euse; + const char *id = argv[0]; + + euse = euse_find(g_hlr, id); + if (!euse) { + euse = euse_alloc(g_hlr, id); + if (!euse) + return CMD_WARNING; + } + vty->index = euse; + vty->index_sub = &euse->description; + vty->node = EUSE_NODE; + + return CMD_SUCCESS; +} + +DEFUN(cfg_no_euse, cfg_no_euse_cmd, + "no euse NAME", + NO_STR "Remove a particular External USSD Entity\n" + "Alphanumeric name of the External USSD Entity\n") +{ + struct hlr_euse *euse = euse_find(g_hlr, argv[0]); + if (!euse) { + vty_out(vty, "%% Cannot remove non-existant EUSE %s%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + if (g_hlr->euse_default == euse) { + vty_out(vty, "%% Cannot remove EUSE %s, it is the default route%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + euse_del(euse); + return CMD_SUCCESS; +} + +static void dump_one_euse(struct vty *vty, struct hlr_euse *euse) +{ + struct hlr_euse_route *er; + + vty_out(vty, " euse %s%s", euse->name, VTY_NEWLINE); + + llist_for_each_entry(er, &euse->routes, list) + vty_out(vty, " route prefix %s%s", er->prefix, VTY_NEWLINE); + + if (g_hlr->euse_default == euse) + vty_out(vty, " default-route%s", VTY_NEWLINE); +} + +static int config_write_euse(struct vty *vty) +{ + struct hlr_euse *euse; + + llist_for_each_entry(euse, &g_hlr->euse_list, list) + dump_one_euse(vty, euse); + + return 0; +} + +/*********************************************************************** + * Common Code + ***********************************************************************/ + int hlr_vty_go_parent(struct vty *vty) { switch (vty->node) { case GSUP_NODE: + case EUSE_NODE: vty->node = HLR_NODE; vty->index = NULL; + vty->index_sub = NULL; break; default: case HLR_NODE: @@ -165,5 +310,13 @@ install_element(GSUP_NODE, &cfg_hlr_gsup_bind_ip_cmd); + install_element(HLR_NODE, &cfg_euse_cmd); + install_element(HLR_NODE, &cfg_no_euse_cmd); + install_node(&euse_node, config_write_euse); + install_element(EUSE_NODE, &cfg_euse_route_pfx_cmd); + install_element(EUSE_NODE, &cfg_euse_no_route_pfx_cmd); + install_element(EUSE_NODE, &cfg_euse_defaultroute_cmd); + install_element(EUSE_NODE, &cfg_euse_no_defaultroute_cmd); + hlr_vty_subscriber_init(hlr); } diff --git a/src/hlr_vty.h b/src/hlr_vty.h index cd2ff73..dd086ab 100644 --- a/src/hlr_vty.h +++ b/src/hlr_vty.h @@ -30,6 +30,7 @@ enum hlr_vty_node { HLR_NODE = _LAST_OSMOVTY_NODE + 1, GSUP_NODE, + EUSE_NODE, }; int hlr_vty_is_config_node(struct vty *vty, int node); -- To view, visit https://gerrit.osmocom.org/10244 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I3cfd7cd401ea32b7e92f1124d129099d9f7dc6e6 Gerrit-Change-Number: 10244 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 14:34:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 14:34:48 +0000 Subject: Change in osmo-hlr[master]: USSD: Add basic dispatch + decode of GSUP-encapsulated SS/USSD Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10245 Change subject: USSD: Add basic dispatch + decode of GSUP-encapsulated SS/USSD ...................................................................... USSD: Add basic dispatch + decode of GSUP-encapsulated SS/USSD We don't want any SS session to run for more than 30s. The timeout is currently not refreshed. If we need more comprehensive timeout handling, using osmo_fsm for SS sessions might make sense. Change-Id: I5c9fb6b619402d2a23fea9db99590143d85ac11a --- M src/hlr.c M src/hlr.h M src/hlr_ussd.c M src/hlr_ussd.h 4 files changed, 323 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/45/10245/1 diff --git a/src/hlr.c b/src/hlr.c index 79c4c86..74b65c4 100644 --- a/src/hlr.c +++ b/src/hlr.c @@ -42,6 +42,7 @@ #include "rand.h" #include "luop.h" #include "hlr_vty.h" +#include "hlr_ussd.h" struct hlr *g_hlr; static int quit = 0; @@ -402,6 +403,13 @@ LOGP(DMAIN, LOGL_ERROR, "Deleting subscriber data for IMSI %s\n", gsup.imsi); break; + case OSMO_GSUP_MSGT_PROC_SS_REQUEST: + case OSMO_GSUP_MSGT_PROC_SS_RESULT: + rx_proc_ss_req(conn, &gsup); + break; + case OSMO_GSUP_MSGT_PROC_SS_ERROR: + rx_proc_ss_error(conn, &gsup); + break; case OSMO_GSUP_MSGT_INSERT_DATA_ERROR: case OSMO_GSUP_MSGT_INSERT_DATA_RESULT: case OSMO_GSUP_MSGT_LOCATION_CANCEL_ERROR: @@ -560,6 +568,7 @@ g_hlr = talloc_zero(hlr_ctx, struct hlr); INIT_LLIST_HEAD(&g_hlr->euse_list); + INIT_LLIST_HEAD(&g_hlr->ss_sessions); rc = osmo_init_logging2(hlr_ctx, &hlr_log_info); if (rc < 0) { diff --git a/src/hlr.h b/src/hlr.h index 938f7f9..7112352 100644 --- a/src/hlr.h +++ b/src/hlr.h @@ -43,6 +43,8 @@ struct llist_head euse_list; struct hlr_euse *euse_default; + + struct llist_head ss_sessions; }; extern struct hlr *g_hlr; diff --git a/src/hlr_ussd.c b/src/hlr_ussd.c index 785eafd..41fba34 100644 --- a/src/hlr_ussd.c +++ b/src/hlr_ussd.c @@ -1,4 +1,4 @@ -/* OsmoHLR VTY implementation */ +/* OsmoHLR SS/USSD implementation */ /* (C) 2018 Harald Welte * @@ -21,11 +21,22 @@ #include +#include +#include +#include +#include #include #include #include "hlr.h" #include "hlr_ussd.h" +#include "gsup_server.h" +#include "gsup_router.h" +#include "logging.h" + +/*********************************************************************** + * core data structures expressing config from VTY + ***********************************************************************/ struct hlr_euse *euse_find(struct hlr *hlr, const char *name) { @@ -91,3 +102,293 @@ llist_del(&rt->list); talloc_free(rt); } + +struct hlr_euse *ussd_euse_find_7bit_gsm(struct hlr *hlr, const char *ussd_code) +{ + struct hlr_euse *euse; + + llist_for_each_entry(euse, &hlr->euse_list, list) { + struct hlr_euse_route *rt; + llist_for_each_entry(rt, &euse->routes, list) { + if (!strncmp(ussd_code, rt->prefix, strlen(rt->prefix))) { + LOGP(DMAIN, LOGL_DEBUG, "Found EUSE %s (prefix %s) for USSD Code '%s'\n", + rt->euse->name, rt->prefix, ussd_code); + return rt->euse; + } + } + } + + LOGP(DMAIN, LOGL_DEBUG, "Could not find Route/EUSE for USSD Code '%s'\n", ussd_code); + return NULL; +} + +/*********************************************************************** + * handling functions for individual GSUP messages + ***********************************************************************/ + +struct ss_session { + /* link us to hlr->ss_sessions */ + struct llist_head list; + /* imsi of this session */ + char imsi[GSM23003_IMSI_MAX_DIGITS+2]; + /* ID of this session (unique per IMSI) */ + uint32_t session_id; + /* state of the session */ + enum osmo_gsup_session_state state; + /* time-out when we will delete the session */ + struct osmo_timer_list timeout; + + /* external USSD Entity responsible for this session */ + struct hlr_euse *euse; + /* we don't keep a pointer to the osmo_gsup_{route,conn} towards the MSC/VLR here, + * as this might change during inter-VLR hand-over, and we simply look-up the serving MSC/VLR + * every time we receive an USSD component from the EUSE */ +}; + +struct ss_session *ss_session_find(struct hlr *hlr, const char *imsi, uint32_t session_id) +{ + struct ss_session *ss; + llist_for_each_entry(ss, &hlr->ss_sessions, list) { + if (!strcmp(ss->imsi, imsi) && ss->session_id == session_id) + return ss; + } + return NULL; +} + +void ss_session_free(struct ss_session *ss) +{ + osmo_timer_del(&ss->timeout); + llist_del(&ss->list); + talloc_free(ss); +} + +static void ss_session_timeout(void *data) +{ + struct ss_session *ss = data; + + LOGP(DMAIN, LOGL_NOTICE, "%s/0x%08x: SS Session Timeout, destroying\n", ss->imsi, ss->session_id); + /* FIXME: should we send a ReturnError component to the MS? */ + ss_session_free(ss); +} + +struct ss_session *ss_session_alloc(struct hlr *hlr, const char *imsi, uint32_t session_id) +{ + struct ss_session *ss; + + OSMO_ASSERT(!ss_session_find(hlr, imsi, session_id)); + + ss = talloc_zero(hlr, struct ss_session); + OSMO_ASSERT(ss); + + OSMO_STRLCPY_ARRAY(ss->imsi, imsi); + ss->session_id = session_id; + osmo_timer_setup(&ss->timeout, ss_session_timeout, ss); + /* NOTE: The timeout is currently global and not refreshed with subsequent messages + * within the SS/USSD session. So 30s after the initial SS message, the session will + * timeout! */ + osmo_timer_schedule(&ss->timeout, 30, 0); + + llist_add_tail(&ss->list, &hlr->ss_sessions); + return ss; +} + +/*********************************************************************** + * handling functions for individual GSUP messages + ***********************************************************************/ + +static bool ss_op_is_ussd(uint8_t opcode) +{ + switch (opcode) { + case GSM0480_OP_CODE_PROCESS_USS_DATA: + case GSM0480_OP_CODE_PROCESS_USS_REQ: + case GSM0480_OP_CODE_USS_REQUEST: + case GSM0480_OP_CODE_USS_NOTIFY: + return true; + default: + return false; + } +} + +/* is this GSUP connection an EUSE (true) or not (false)? */ +static bool conn_is_euse(struct osmo_gsup_conn *conn) +{ + int rc; + uint8_t *addr; + + rc = osmo_gsup_conn_ccm_get(conn, &addr, IPAC_IDTAG_SERNR); + if (rc <= 5) + return false; + if (!strncmp((char *)addr, "EUSE-", 5)) + return true; + else + return false; +} + +static struct hlr_euse *euse_by_conn(struct osmo_gsup_conn *conn) +{ + int rc; + char *addr; + struct hlr *hlr = conn->server->priv; + + rc = osmo_gsup_conn_ccm_get(conn, (uint8_t **) &addr, IPAC_IDTAG_SERNR); + if (rc <= 5) + return NULL; + if (strncmp(addr, "EUSE-", 5)) + return NULL; + + return euse_find(hlr, addr+5); +} + +static int handle_ss(struct ss_session *ss, const struct osmo_gsup_message *gsup, + const struct ss_request *req) +{ + uint8_t comp_type = gsup->ss_info[0]; + + LOGP(DMAIN, LOGL_INFO, "%s: SS CompType=%s, OpCode=%s\n", gsup->imsi, + gsm0480_comp_type_name(comp_type), gsm0480_op_code_name(req->opcode)); + /* FIXME */ + return 0; +} + +static int handle_ussd(struct osmo_gsup_conn *conn, struct ss_session *ss, + const struct osmo_gsup_message *gsup, const struct ss_request *req) +{ + uint8_t comp_type = gsup->ss_info[0]; + struct msgb *msg_out; + bool is_euse_originated = conn_is_euse(conn); + + LOGP(DMAIN, LOGL_INFO, "%s: USSD CompType=%s, OpCode=%s '%s'\n", gsup->imsi, + gsm0480_comp_type_name(comp_type), gsm0480_op_code_name(req->opcode), + req->ussd_text); + + msg_out = msgb_alloc_headroom(1024+16, 16, "GSUP USSD FW"); + OSMO_ASSERT(msg_out); + + if (!ss->euse) { + LOGP(DMAIN, LOGL_NOTICE, "%s: USSD for unknown code '%s'\n", gsup->imsi, req->ussd_text); + /* FIXME: send proper error */ + return 0; + } + + if (is_euse_originated) { + /* Received from EUSE, Forward to VLR */ + osmo_gsup_encode(msg_out, gsup); + /* FIXME: resolve this based on the database vlr_addr */ + osmo_gsup_addr_send(conn->server, (uint8_t *)"MSC-00-00-00-00-00-00", 22, msg_out); + } else { + /* Received from VLR, Forward to EUSE */ + char addr[128]; + strcpy(addr, "EUSE-"); + osmo_strlcpy(addr+5, ss->euse->name, sizeof(addr)-5); + conn = gsup_route_find(conn->server, (uint8_t *)addr, strlen(addr)+1); + if (!conn) { + LOGP(DMAIN, LOGL_ERROR, "Cannot find conn for EUSE %s\n", addr); + /* FIXME: send proper error */ + return -1; + } + osmo_gsup_encode(msg_out, gsup); + osmo_gsup_conn_send(conn, msg_out); + } + + return 0; +} + + +/* this function is called for any SS_REQ/SS_RESP messages from both the MSC/VLR side as well + * as from the EUSE side */ +int rx_proc_ss_req(struct osmo_gsup_conn *conn, const struct osmo_gsup_message *gsup) +{ + struct hlr *hlr = conn->server->priv; + struct ss_session *ss; + struct ss_request req = {0}; + + LOGP(DMAIN, LOGL_INFO, "%s: Process SS (0x%08x, %s)\n", gsup->imsi, gsup->session_id, + osmo_gsup_session_state_name(gsup->session_state)); + + /* decode and find out what kind of SS message it is */ + if (gsup->ss_info && gsup->ss_info_len) { + if (gsm0480_parse_facility_ie(gsup->ss_info, gsup->ss_info_len, &req)) { + LOGP(DMAIN, LOGL_ERROR, "%s: Unable to parse SS request for 0x%08x: %s\n", + gsup->imsi, gsup->session_id, + osmo_hexdump(gsup->ss_info, gsup->ss_info_len)); + goto out_err; + } + } + + switch (gsup->session_state) { + case OSMO_GSUP_SESSION_STATE_BEGIN: + /* Check for overlapping Session ID usage */ + if (ss_session_find(hlr, gsup->imsi, gsup->session_id)) { + LOGP(DMAIN, LOGL_ERROR, "%s/0x%08x: BEGIN with non-uinque session ID!\n", + gsup->imsi, gsup->session_id); + goto out_err; + } + ss = ss_session_alloc(hlr, gsup->imsi, gsup->session_id); + if (!ss) { + LOGP(DMAIN, LOGL_ERROR, "%s: Unable to allocate SS session for 0x%08x\n", + gsup->imsi, gsup->session_id); + goto out_err; + } + if (ss_op_is_ussd(req.opcode)) { + if (conn_is_euse(conn)) { + /* EUSE->VLR: MT USSD. EUSE is known ('conn'), VLR is to be resolved */ + ss->euse = euse_by_conn(conn); + } else { + /* VLR->EUSE: MO USSD. VLR is known ('conn'), EUSE is to be resolved */ + ss->euse = ussd_euse_find_7bit_gsm(hlr, (const char *) req.ussd_text); + } + /* dispatch unstructured SS to routing */ + handle_ussd(conn, ss, gsup, &req); + } else { + /* dispatch non-call SS to internal code */ + handle_ss(ss, gsup, &req); + } + break; + case OSMO_GSUP_SESSION_STATE_CONTINUE: + ss = ss_session_find(hlr, gsup->imsi, gsup->session_id); + if (!ss) { + LOGP(DMAIN, LOGL_ERROR, "%s: CONTINUE for unknwon SS session 0x%08x\n", + gsup->imsi, gsup->session_id); + goto out_err; + } + if (ss_op_is_ussd(req.opcode)) { + /* dispatch unstructured SS to routing */ + handle_ussd(conn, ss, gsup, &req); + } else { + /* dispatch non-call SS to internal code */ + handle_ss(ss, gsup, &req); + } + break; + case OSMO_GSUP_SESSION_STATE_END: + ss = ss_session_find(hlr, gsup->imsi, gsup->session_id); + if (!ss) { + LOGP(DMAIN, LOGL_ERROR, "%s: END for unknwon SS session 0x%08x\n", + gsup->imsi, gsup->session_id); + goto out_err; + } + if (ss_op_is_ussd(req.opcode)) { + /* dispatch unstructured SS to routing */ + handle_ussd(conn, ss, gsup, &req); + } else { + /* dispatch non-call SS to internal code */ + handle_ss(ss, gsup, &req); + } + ss_session_free(ss); + break; + default: + LOGP(DMAIN, LOGL_ERROR, "%s: Unknown SS State %d\n", gsup->imsi, gsup->session_state); + goto out_err; + } + + return 0; + +out_err: + return 0; +} + +int rx_proc_ss_error(struct osmo_gsup_conn *conn, const struct osmo_gsup_message *gsup) +{ + LOGP(DMAIN, LOGL_NOTICE, "%s: Process SS ERROR (0x%08x, %s)\n", gsup->imsi, gsup->session_id, + osmo_gsup_session_state_name(gsup->session_state)); + return 0; +} diff --git a/src/hlr_ussd.h b/src/hlr_ussd.h index 05d2099..433a7f2 100644 --- a/src/hlr_ussd.h +++ b/src/hlr_ussd.h @@ -1,5 +1,9 @@ #include #include +#include +#include "gsup_server.h" + +struct osmo_gsup_conn; struct hlr_euse_route { /* hlr_euse.routes */ @@ -18,6 +22,9 @@ const char *description; /* list of hlr_euse_route */ struct llist_head routes; + + /* GSUP connection to the EUSE, if any */ + struct osmo_gsup_conn *conn; }; @@ -28,3 +35,6 @@ struct hlr_euse_route *euse_route_find(struct hlr_euse *euse, const char *prefix); struct hlr_euse_route *euse_route_prefix_alloc(struct hlr_euse *euse, const char *prefix); void euse_route_del(struct hlr_euse_route *rt); + +int rx_proc_ss_req(struct osmo_gsup_conn *conn, const struct osmo_gsup_message *gsup); +int rx_proc_ss_error(struct osmo_gsup_conn *conn, const struct osmo_gsup_message *gsup); -- To view, visit https://gerrit.osmocom.org/10245 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I5c9fb6b619402d2a23fea9db99590143d85ac11a Gerrit-Change-Number: 10245 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 14:34:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 14:34:48 +0000 Subject: Change in osmo-hlr[master]: hlr_ussd: Introduce LOGPSS() macro Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10246 Change subject: hlr_ussd: Introduce LOGPSS() macro ...................................................................... hlr_ussd: Introduce LOGPSS() macro Change-Id: I1058ef9fd67af2224c991e43bab02bcf21c9f174 --- M src/hlr_ussd.c 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/46/10246/1 diff --git a/src/hlr_ussd.c b/src/hlr_ussd.c index 41fba34..ef4063c 100644 --- a/src/hlr_ussd.c +++ b/src/hlr_ussd.c @@ -126,6 +126,9 @@ * handling functions for individual GSUP messages ***********************************************************************/ +#define LOGPSS(ss, lvl, fmt, args...) \ + LOGP(DMAIN, lvl, "%s/0x%08x: " fmt, (ss)->imsi, (ss)->session_id, ## args) + struct ss_session { /* link us to hlr->ss_sessions */ struct llist_head list; @@ -166,7 +169,7 @@ { struct ss_session *ss = data; - LOGP(DMAIN, LOGL_NOTICE, "%s/0x%08x: SS Session Timeout, destroying\n", ss->imsi, ss->session_id); + LOGPSS(ss, LOGL_NOTICE, "SS Session Timeout, destroying\n"); /* FIXME: should we send a ReturnError component to the MS? */ ss_session_free(ss); } -- To view, visit https://gerrit.osmocom.org/10246 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I1058ef9fd67af2224c991e43bab02bcf21c9f174 Gerrit-Change-Number: 10246 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 14:34:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 14:34:48 +0000 Subject: Change in osmo-hlr[master]: USSD: Send ReturnError component if USSD Code unknown / EUSE disconne... Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10247 Change subject: USSD: Send ReturnError component if USSD Code unknown / EUSE disconnected ...................................................................... USSD: Send ReturnError component if USSD Code unknown / EUSE disconnected Change-Id: Ieef06cec05dd81f600594465d18804362e0fafd6 --- M src/hlr_ussd.c 1 file changed, 64 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/47/10247/1 diff --git a/src/hlr_ussd.c b/src/hlr_ussd.c index ef4063c..fdbde9d 100644 --- a/src/hlr_ussd.c +++ b/src/hlr_ussd.c @@ -196,6 +196,60 @@ } /*********************************************************************** + * handling functions for encoding SS messages + wrapping them in GSUP + ***********************************************************************/ + +static int ss_tx_to_ms(struct ss_session *ss, enum osmo_gsup_message_type gsup_msg_type, + bool final, struct msgb *ss_msg) + +{ + struct osmo_gsup_message resp = {0}; + struct msgb *resp_msg; + + resp.message_type = gsup_msg_type; + OSMO_STRLCPY_ARRAY(resp.imsi, ss->imsi); + if (final) + resp.session_state = OSMO_GSUP_SESSION_STATE_END; + else + resp.session_state = OSMO_GSUP_SESSION_STATE_CONTINUE; + resp.session_id = ss->session_id; + if (ss_msg) { + resp.ss_info = msgb_data(ss_msg); + resp.ss_info_len = msgb_length(ss_msg); + } + + resp_msg = gsm0480_msgb_alloc_name(__func__); + OSMO_ASSERT(resp_msg); + osmo_gsup_encode(resp_msg, &resp); + msgb_free(ss_msg); + + /* FIXME: resolve this based on the database vlr_addr */ + return osmo_gsup_addr_send(g_hlr->gs, (uint8_t *)"MSC-00-00-00-00-00-00", 22, resp_msg); +} + +#if 0 +static int ss_tx_reject(struct ss_session *ss, int invoke_id, uint8_t problem_tag, + uint8_t problem_code) +{ + struct msgb *msg = gsm0480_gen_reject(invoke_id, problem_tag, problem_code); + LOGPSS(ss, LOGL_NOTICE, "Tx Reject(%u, 0x%02x, 0x%02x)\n", invoke_id, + problem_tag, problem_code); + OSMO_ASSERT(msg); + return ss_tx_to_ms(ss, OSMO_GSUP_MSGT_PROC_SS_RESULT, true, msg); +} +#endif + +static int ss_tx_error(struct ss_session *ss, uint8_t invoke_id, uint8_t error_code) +{ + struct msgb *msg = gsm0480_gen_return_error(invoke_id, error_code); + LOGPSS(ss, LOGL_NOTICE, "Tx ReturnError(%u, 0x%02x)\n", invoke_id, error_code); + OSMO_ASSERT(msg); + return ss_tx_to_ms(ss, OSMO_GSUP_MSGT_PROC_SS_RESULT, true, msg); +} + + + +/*********************************************************************** * handling functions for individual GSUP messages ***********************************************************************/ @@ -264,16 +318,16 @@ gsm0480_comp_type_name(comp_type), gsm0480_op_code_name(req->opcode), req->ussd_text); - msg_out = msgb_alloc_headroom(1024+16, 16, "GSUP USSD FW"); - OSMO_ASSERT(msg_out); if (!ss->euse) { LOGP(DMAIN, LOGL_NOTICE, "%s: USSD for unknown code '%s'\n", gsup->imsi, req->ussd_text); - /* FIXME: send proper error */ + ss_tx_error(ss, req->invoke_id, GSM0480_ERR_CODE_SS_NOT_AVAILABLE); return 0; } if (is_euse_originated) { + msg_out = msgb_alloc_headroom(1024+16, 16, "GSUP USSD FW"); + OSMO_ASSERT(msg_out); /* Received from EUSE, Forward to VLR */ osmo_gsup_encode(msg_out, gsup); /* FIXME: resolve this based on the database vlr_addr */ @@ -286,11 +340,13 @@ conn = gsup_route_find(conn->server, (uint8_t *)addr, strlen(addr)+1); if (!conn) { LOGP(DMAIN, LOGL_ERROR, "Cannot find conn for EUSE %s\n", addr); - /* FIXME: send proper error */ - return -1; + ss_tx_error(ss, req->invoke_id, GSM0480_ERR_CODE_SYSTEM_FAILURE); + } else { + msg_out = msgb_alloc_headroom(1024+16, 16, "GSUP USSD FW"); + OSMO_ASSERT(msg_out); + osmo_gsup_encode(msg_out, gsup); + osmo_gsup_conn_send(conn, msg_out); } - osmo_gsup_encode(msg_out, gsup); - osmo_gsup_conn_send(conn, msg_out); } return 0; @@ -314,6 +370,7 @@ LOGP(DMAIN, LOGL_ERROR, "%s: Unable to parse SS request for 0x%08x: %s\n", gsup->imsi, gsup->session_id, osmo_hexdump(gsup->ss_info, gsup->ss_info_len)); + /* FIXME: Send a Reject component? */ goto out_err; } } -- To view, visit https://gerrit.osmocom.org/10247 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ieef06cec05dd81f600594465d18804362e0fafd6 Gerrit-Change-Number: 10247 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 14:34:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 14:34:48 +0000 Subject: Change in osmo-hlr[master]: USSD: Further unification of log output; Use LOGPSS when possible Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10248 Change subject: USSD: Further unification of log output; Use LOGPSS when possible ...................................................................... USSD: Further unification of log output; Use LOGPSS when possible Change-Id: I2c508fe70337d24c4a8b48e0393ad3c979eea0e7 --- M src/hlr_ussd.c 1 file changed, 13 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/48/10248/1 diff --git a/src/hlr_ussd.c b/src/hlr_ussd.c index fdbde9d..8710061 100644 --- a/src/hlr_ussd.c +++ b/src/hlr_ussd.c @@ -301,7 +301,7 @@ { uint8_t comp_type = gsup->ss_info[0]; - LOGP(DMAIN, LOGL_INFO, "%s: SS CompType=%s, OpCode=%s\n", gsup->imsi, + LOGPSS(ss, LOGL_INFO, "SS CompType=%s, OpCode=%s\n", gsm0480_comp_type_name(comp_type), gsm0480_op_code_name(req->opcode)); /* FIXME */ return 0; @@ -314,13 +314,13 @@ struct msgb *msg_out; bool is_euse_originated = conn_is_euse(conn); - LOGP(DMAIN, LOGL_INFO, "%s: USSD CompType=%s, OpCode=%s '%s'\n", gsup->imsi, + LOGPSS(ss, LOGL_INFO, "USSD CompType=%s, OpCode=%s '%s'\n", gsm0480_comp_type_name(comp_type), gsm0480_op_code_name(req->opcode), req->ussd_text); if (!ss->euse) { - LOGP(DMAIN, LOGL_NOTICE, "%s: USSD for unknown code '%s'\n", gsup->imsi, req->ussd_text); + LOGPSS(ss, LOGL_NOTICE, "USSD for unknown code '%s'\n", req->ussd_text); ss_tx_error(ss, req->invoke_id, GSM0480_ERR_CODE_SS_NOT_AVAILABLE); return 0; } @@ -339,7 +339,7 @@ osmo_strlcpy(addr+5, ss->euse->name, sizeof(addr)-5); conn = gsup_route_find(conn->server, (uint8_t *)addr, strlen(addr)+1); if (!conn) { - LOGP(DMAIN, LOGL_ERROR, "Cannot find conn for EUSE %s\n", addr); + LOGPSS(ss, LOGL_ERROR, "Cannot find conn for EUSE %s\n", addr); ss_tx_error(ss, req->invoke_id, GSM0480_ERR_CODE_SYSTEM_FAILURE); } else { msg_out = msgb_alloc_headroom(1024+16, 16, "GSUP USSD FW"); @@ -361,13 +361,13 @@ struct ss_session *ss; struct ss_request req = {0}; - LOGP(DMAIN, LOGL_INFO, "%s: Process SS (0x%08x, %s)\n", gsup->imsi, gsup->session_id, + LOGP(DMAIN, LOGL_INFO, "%s/0x%08x: Process SS (%s)\n", gsup->imsi, gsup->session_id, osmo_gsup_session_state_name(gsup->session_state)); /* decode and find out what kind of SS message it is */ if (gsup->ss_info && gsup->ss_info_len) { if (gsm0480_parse_facility_ie(gsup->ss_info, gsup->ss_info_len, &req)) { - LOGP(DMAIN, LOGL_ERROR, "%s: Unable to parse SS request for 0x%08x: %s\n", + LOGP(DMAIN, LOGL_ERROR, "%s/0x%082x: Unable to parse SS request: %s\n", gsup->imsi, gsup->session_id, osmo_hexdump(gsup->ss_info, gsup->ss_info_len)); /* FIXME: Send a Reject component? */ @@ -379,13 +379,13 @@ case OSMO_GSUP_SESSION_STATE_BEGIN: /* Check for overlapping Session ID usage */ if (ss_session_find(hlr, gsup->imsi, gsup->session_id)) { - LOGP(DMAIN, LOGL_ERROR, "%s/0x%08x: BEGIN with non-uinque session ID!\n", + LOGP(DMAIN, LOGL_ERROR, "%s/0x%08x: BEGIN with non-unique session ID!\n", gsup->imsi, gsup->session_id); goto out_err; } ss = ss_session_alloc(hlr, gsup->imsi, gsup->session_id); if (!ss) { - LOGP(DMAIN, LOGL_ERROR, "%s: Unable to allocate SS session for 0x%08x\n", + LOGP(DMAIN, LOGL_ERROR, "%s/0x%08x: Unable to allocate SS session\n", gsup->imsi, gsup->session_id); goto out_err; } @@ -407,7 +407,7 @@ case OSMO_GSUP_SESSION_STATE_CONTINUE: ss = ss_session_find(hlr, gsup->imsi, gsup->session_id); if (!ss) { - LOGP(DMAIN, LOGL_ERROR, "%s: CONTINUE for unknwon SS session 0x%08x\n", + LOGP(DMAIN, LOGL_ERROR, "%s/0x%08x: CONTINUE for unknown SS session\n", gsup->imsi, gsup->session_id); goto out_err; } @@ -422,7 +422,7 @@ case OSMO_GSUP_SESSION_STATE_END: ss = ss_session_find(hlr, gsup->imsi, gsup->session_id); if (!ss) { - LOGP(DMAIN, LOGL_ERROR, "%s: END for unknwon SS session 0x%08x\n", + LOGP(DMAIN, LOGL_ERROR, "%s/0x%08x: END for unknown SS session\n", gsup->imsi, gsup->session_id); goto out_err; } @@ -436,7 +436,8 @@ ss_session_free(ss); break; default: - LOGP(DMAIN, LOGL_ERROR, "%s: Unknown SS State %d\n", gsup->imsi, gsup->session_state); + LOGP(DMAIN, LOGL_ERROR, "%s/0x%08x: Unknown SS State %d\n", gsup->imsi, + gsup->session_id, gsup->session_state); goto out_err; } @@ -448,7 +449,7 @@ int rx_proc_ss_error(struct osmo_gsup_conn *conn, const struct osmo_gsup_message *gsup) { - LOGP(DMAIN, LOGL_NOTICE, "%s: Process SS ERROR (0x%08x, %s)\n", gsup->imsi, gsup->session_id, + LOGP(DMAIN, LOGL_NOTICE, "%s/0x%08x: Process SS ERROR (%s)\n", gsup->imsi, gsup->session_id, osmo_gsup_session_state_name(gsup->session_state)); return 0; } -- To view, visit https://gerrit.osmocom.org/10248 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I2c508fe70337d24c4a8b48e0393ad3c979eea0e7 Gerrit-Change-Number: 10248 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 14:34:49 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 14:34:49 +0000 Subject: Change in osmo-hlr[master]: USSD: Add new "DSS" logging category and use it appropriately Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10249 Change subject: USSD: Add new "DSS" logging category and use it appropriately ...................................................................... USSD: Add new "DSS" logging category and use it appropriately Change-Id: I0ac198a49ba70ea40fea18464325f1925797a6e8 --- M src/hlr_ussd.c M src/logging.c M src/logging.h 3 files changed, 19 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/49/10249/1 diff --git a/src/hlr_ussd.c b/src/hlr_ussd.c index 8710061..d23debf 100644 --- a/src/hlr_ussd.c +++ b/src/hlr_ussd.c @@ -111,14 +111,14 @@ struct hlr_euse_route *rt; llist_for_each_entry(rt, &euse->routes, list) { if (!strncmp(ussd_code, rt->prefix, strlen(rt->prefix))) { - LOGP(DMAIN, LOGL_DEBUG, "Found EUSE %s (prefix %s) for USSD Code '%s'\n", + LOGP(DSS, LOGL_DEBUG, "Found EUSE %s (prefix %s) for USSD Code '%s'\n", rt->euse->name, rt->prefix, ussd_code); return rt->euse; } } } - LOGP(DMAIN, LOGL_DEBUG, "Could not find Route/EUSE for USSD Code '%s'\n", ussd_code); + LOGP(DSS, LOGL_DEBUG, "Could not find Route/EUSE for USSD Code '%s'\n", ussd_code); return NULL; } @@ -127,7 +127,7 @@ ***********************************************************************/ #define LOGPSS(ss, lvl, fmt, args...) \ - LOGP(DMAIN, lvl, "%s/0x%08x: " fmt, (ss)->imsi, (ss)->session_id, ## args) + LOGP(DSS, lvl, "%s/0x%08x: " fmt, (ss)->imsi, (ss)->session_id, ## args) struct ss_session { /* link us to hlr->ss_sessions */ @@ -361,13 +361,13 @@ struct ss_session *ss; struct ss_request req = {0}; - LOGP(DMAIN, LOGL_INFO, "%s/0x%08x: Process SS (%s)\n", gsup->imsi, gsup->session_id, + LOGP(DSS, LOGL_DEBUG, "%s/0x%08x: Process SS (%s)\n", gsup->imsi, gsup->session_id, osmo_gsup_session_state_name(gsup->session_state)); /* decode and find out what kind of SS message it is */ if (gsup->ss_info && gsup->ss_info_len) { if (gsm0480_parse_facility_ie(gsup->ss_info, gsup->ss_info_len, &req)) { - LOGP(DMAIN, LOGL_ERROR, "%s/0x%082x: Unable to parse SS request: %s\n", + LOGP(DSS, LOGL_ERROR, "%s/0x%082x: Unable to parse SS request: %s\n", gsup->imsi, gsup->session_id, osmo_hexdump(gsup->ss_info, gsup->ss_info_len)); /* FIXME: Send a Reject component? */ @@ -379,13 +379,13 @@ case OSMO_GSUP_SESSION_STATE_BEGIN: /* Check for overlapping Session ID usage */ if (ss_session_find(hlr, gsup->imsi, gsup->session_id)) { - LOGP(DMAIN, LOGL_ERROR, "%s/0x%08x: BEGIN with non-unique session ID!\n", + LOGP(DSS, LOGL_ERROR, "%s/0x%08x: BEGIN with non-unique session ID!\n", gsup->imsi, gsup->session_id); goto out_err; } ss = ss_session_alloc(hlr, gsup->imsi, gsup->session_id); if (!ss) { - LOGP(DMAIN, LOGL_ERROR, "%s/0x%08x: Unable to allocate SS session\n", + LOGP(DSS, LOGL_ERROR, "%s/0x%08x: Unable to allocate SS session\n", gsup->imsi, gsup->session_id); goto out_err; } @@ -407,7 +407,7 @@ case OSMO_GSUP_SESSION_STATE_CONTINUE: ss = ss_session_find(hlr, gsup->imsi, gsup->session_id); if (!ss) { - LOGP(DMAIN, LOGL_ERROR, "%s/0x%08x: CONTINUE for unknown SS session\n", + LOGP(DSS, LOGL_ERROR, "%s/0x%08x: CONTINUE for unknown SS session\n", gsup->imsi, gsup->session_id); goto out_err; } @@ -422,7 +422,7 @@ case OSMO_GSUP_SESSION_STATE_END: ss = ss_session_find(hlr, gsup->imsi, gsup->session_id); if (!ss) { - LOGP(DMAIN, LOGL_ERROR, "%s/0x%08x: END for unknown SS session\n", + LOGP(DSS, LOGL_ERROR, "%s/0x%08x: END for unknown SS session\n", gsup->imsi, gsup->session_id); goto out_err; } @@ -436,7 +436,7 @@ ss_session_free(ss); break; default: - LOGP(DMAIN, LOGL_ERROR, "%s/0x%08x: Unknown SS State %d\n", gsup->imsi, + LOGP(DSS, LOGL_ERROR, "%s/0x%08x: Unknown SS State %d\n", gsup->imsi, gsup->session_id, gsup->session_state); goto out_err; } @@ -449,7 +449,7 @@ int rx_proc_ss_error(struct osmo_gsup_conn *conn, const struct osmo_gsup_message *gsup) { - LOGP(DMAIN, LOGL_NOTICE, "%s/0x%08x: Process SS ERROR (%s)\n", gsup->imsi, gsup->session_id, + LOGP(DSS, LOGL_NOTICE, "%s/0x%08x: Process SS ERROR (%s)\n", gsup->imsi, gsup->session_id, osmo_gsup_session_state_name(gsup->session_state)); return 0; } diff --git a/src/logging.c b/src/logging.c index f81781d..3fa2a69 100644 --- a/src/logging.c +++ b/src/logging.c @@ -19,6 +19,13 @@ .color = "\033[1;33m", .enabled = 1, .loglevel = LOGL_NOTICE, }, + [DSS] = { + .name = "DSS", + .description = "Supplementary Services", + .color = "\033[1;34m", + .enabled = 1, .loglevel = LOGL_NOTICE, + }, + }; const struct log_info hlr_log_info = { diff --git a/src/logging.h b/src/logging.h index fdaf5d1..ed24075 100644 --- a/src/logging.h +++ b/src/logging.h @@ -7,6 +7,7 @@ DDB, DGSUP, DAUC, + DSS, }; extern const struct log_info hlr_log_info; -- To view, visit https://gerrit.osmocom.org/10249 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I0ac198a49ba70ea40fea18464325f1925797a6e8 Gerrit-Change-Number: 10249 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 14:34:49 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 14:34:49 +0000 Subject: Change in osmo-hlr[master]: Add osmo-euse-demo as minimalistic test of a External USSD (EUSE) han... Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10250 Change subject: Add osmo-euse-demo as minimalistic test of a External USSD (EUSE) handler ...................................................................... Add osmo-euse-demo as minimalistic test of a External USSD (EUSE) handler This is a small program which simply echo's the USSD request message it gets in a quote back to the sender. Its purpose is to illustrate how EUSEs can be implemented using libosmo-gsup-client. Change-Id: I3fb8554ca329cb609c591058254117006f665e73 --- M src/Makefile.am A src/osmo-euse-demo.c 2 files changed, 207 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/50/10250/1 diff --git a/src/Makefile.am b/src/Makefile.am index c531ed3..d6de114 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -39,6 +39,7 @@ bin_PROGRAMS = \ osmo-hlr \ osmo-hlr-db-tool \ + osmo-euse-demo \ $(NULL) osmo_hlr_SOURCES = \ @@ -98,6 +99,16 @@ $(SQLITE3_LIBS) \ $(NULL) +osmo_euse_demo_SOURCES = \ + osmo-euse-demo.c \ + $(NULL) + +osmo_euse_demo_LDADD = \ + $(top_builddir)/src/gsupclient/libosmo-gsup-client.la \ + $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOGSM_LIBS) \ + $(NULL) + BOOTSTRAP_SQL = $(top_srcdir)/sql/hlr.sql db_bootstrap.h: $(BOOTSTRAP_SQL) $(srcdir)/db_bootstrap.sed diff --git a/src/osmo-euse-demo.c b/src/osmo-euse-demo.c new file mode 100644 index 0000000..1ddd6be --- /dev/null +++ b/src/osmo-euse-demo.c @@ -0,0 +1,196 @@ +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include "logging.h" + +static struct osmo_gsup_client *g_gc; + +/*! send a SS/USSD response to a given imsi/session. + * \param[in] gsupc GSUP client connection through which to send + * \param[in] imsi IMSI of the subscriber + * \param[in] session_id Unique identifier of SS session for which this response is + * \param[in] gsup_msg_type GSUP message type (OSMO_GSUP_MSGT_PROC_SS_{REQUEST,RESULT,ERROR}) + * \param[in] final Is this the final result (true=END) or an intermediate result (false=CONTINUE) + * \param[in] msg Optional binary/BER encoded SS date (for FACILITY IE). Can be NULL. Freed in + * this function call. + */ +static int euse_tx_ss(struct osmo_gsup_client *gsupc, const char *imsi, uint32_t session_id, + enum osmo_gsup_message_type gsup_msg_type, bool final, struct msgb *ss_msg) +{ + struct osmo_gsup_message resp = {0}; + struct msgb *resp_msg; + + switch (gsup_msg_type) { + case OSMO_GSUP_MSGT_PROC_SS_REQUEST: + case OSMO_GSUP_MSGT_PROC_SS_RESULT: + case OSMO_GSUP_MSGT_PROC_SS_ERROR: + break; + default: + msgb_free(ss_msg); + return -EINVAL; + } + + resp.message_type = gsup_msg_type; + OSMO_STRLCPY_ARRAY(resp.imsi, imsi); + if (final) + resp.session_state = OSMO_GSUP_SESSION_STATE_END; + else + resp.session_state = OSMO_GSUP_SESSION_STATE_CONTINUE; + resp.session_id = session_id; + if (ss_msg) { + resp.ss_info = msgb_data(ss_msg); + resp.ss_info_len = msgb_length(ss_msg); + } + + resp_msg = gsm0480_msgb_alloc_name(__func__); + OSMO_ASSERT(resp_msg); + osmo_gsup_encode(resp_msg, &resp); + msgb_free(ss_msg); + return osmo_gsup_client_send(gsupc, resp_msg); +} + +/*! send a SS/USSD reject to a given IMSI/session. + * \param[in] gsupc GSUP client connection through which to send + * \param[in] imsi IMSI of the subscriber + * \param[in] session_id Unique identifier of SS session for which this response is + * \param[in] invoke_id InvokeID of the request + * \param[in] problem_tag Problem code tag (table 3.13) + * \param[in] problem_code Problem code (table 3.14-3.17) + */ +static int euse_tx_ussd_reject(struct osmo_gsup_client *gsupc, const char *imsi, uint32_t session_id, + int invoke_id, uint8_t problem_tag, uint8_t problem_code) +{ + struct msgb *msg = gsm0480_gen_reject(invoke_id, problem_tag, problem_code); + LOGP(DMAIN, LOGL_NOTICE, "Tx %s/0x%08x: Reject(%d, 0x%02x, 0x%02x)\n", imsi, session_id, + invoke_id, problem_tag, problem_code); + OSMO_ASSERT(msg); + return euse_tx_ss(gsupc, imsi, session_id, OSMO_GSUP_MSGT_PROC_SS_RESULT, true, msg); +} + +/*! send a SS/USSD response in 7-bit GSM default alphabet o a given imsi/session. + * \param[in] gsupc GSUP client connection through which to send + * \param[in] imsi IMSI of the subscriber + * \param[in] session_id Unique identifier of SS session for which this response is + * \param[in] final Is this the final result (true=END) or an intermediate result + * (false=CONTINUE) + * \param[in] invoke_id InvokeID of the request + */ +static int euse_tx_ussd_resp_7bit(struct osmo_gsup_client *gsupc, const char *imsi, uint32_t session_id, + bool final, uint8_t invoke_id, const char *text) +{ + struct msgb *ss_msg; + + /* encode response; remove L3 header */ + ss_msg = gsm0480_gen_ussd_resp_7bit(invoke_id, text); + LOGP(DMAIN, LOGL_DEBUG, "Tx %s/0x%08x: USSD Result(%d, %s, '%s')\n", imsi, session_id, + invoke_id, final ? "END" : "CONTINUE", text); + OSMO_ASSERT(ss_msg); + return euse_tx_ss(gsupc, imsi, session_id, OSMO_GSUP_MSGT_PROC_SS_RESULT, final, ss_msg); +} + +static int euse_rx_proc_ss_req(struct osmo_gsup_client *gsupc, const struct osmo_gsup_message *gsup) +{ + char buf[GSM0480_USSD_7BIT_STRING_LEN+1]; + struct ss_request req = {0}; + + if (gsup->ss_info && gsup->ss_info_len) { + if (gsm0480_parse_facility_ie(gsup->ss_info, gsup->ss_info_len, &req)) { + return euse_tx_ussd_reject(gsupc, gsup->imsi, gsup->session_id, -1, + GSM_0480_PROBLEM_CODE_TAG_GENERAL, + GSM_0480_GEN_PROB_CODE_BAD_STRUCTURE); + } + } + + LOGP(DMAIN, LOGL_INFO, "Rx %s/0x%08x: USSD SessionState=%s, OpCode=%s, '%s'\n", gsup->imsi, + gsup->session_id, osmo_gsup_session_state_name(gsup->session_state), + gsm0480_op_code_name(req.opcode), req.ussd_text); + + /* we only handle single-request-response USSD in this demo */ + if (gsup->session_state != OSMO_GSUP_SESSION_STATE_BEGIN) { + return euse_tx_ussd_reject(gsupc, gsup->imsi, gsup->session_id, req.invoke_id, + GSM_0480_PROBLEM_CODE_TAG_GENERAL, + GSM_0480_GEN_PROB_CODE_UNRECOGNISED); + } + + snprintf(buf, sizeof(buf), "You sent \"%s\"", req.ussd_text); + return euse_tx_ussd_resp_7bit(gsupc, gsup->imsi, gsup->session_id, true, req.invoke_id, buf); +} + +static int gsupc_read_cb(struct osmo_gsup_client *gsupc, struct msgb *msg) +{ + struct osmo_gsup_message gsup_msg = {0}; + int rc; + + rc = osmo_gsup_decode(msgb_l2(msg), msgb_l2len(msg), &gsup_msg); + if (rc < 0) { + LOGP(DMAIN, LOGL_ERROR, "Error decoding GSUP: %s\n", msgb_hexdump(msg)); + return rc; + } + DEBUGP(DMAIN, "Rx GSUP %s: %s\n", osmo_gsup_message_type_name(gsup_msg.message_type), + msgb_hexdump(msg)); + + //if (strlen(gsup_msg.imsi) < 5) + //return gsup_send_err_reply(gsupc, gsup.imsi, gsup.message_type, GMM_CAUSE_INV_MAND_INFO); + + switch (gsup_msg.message_type) { + case OSMO_GSUP_MSGT_PROC_SS_REQUEST: + case OSMO_GSUP_MSGT_PROC_SS_RESULT: + euse_rx_proc_ss_req(gsupc, &gsup_msg); + break; + case OSMO_GSUP_MSGT_PROC_SS_ERROR: + break; + default: + LOGP(DMAIN, LOGL_DEBUG, "Unhandled GSUP message type %s\n", + osmo_gsup_message_type_name(gsup_msg.message_type)); + break; + } + + msgb_free(msg); + return 0; +} + + +static struct log_info_cat default_categories[] = { + [DMAIN] = { + .name = "DMAIN", + .description = "Main Program", + .enabled = 1, .loglevel = LOGL_DEBUG, + }, +}; + +static const struct log_info gsup_log_info = { + .cat = default_categories, + .num_cat = ARRAY_SIZE(default_categories), +}; + +int main(int argc, char **argv) +{ + char *server_host = "127.0.0.1"; + uint16_t server_port = OSMO_GSUP_PORT; + void *ctx = talloc_named_const(NULL, 0, "demo-euse"); + + osmo_init_logging2(ctx, &gsup_log_info); + + g_gc = osmo_gsup_client_create(ctx, "EUSE-foobar", server_host, server_port, gsupc_read_cb, NULL); + + while (1) { + osmo_select_main(0); + } + + exit(0); +} + -- To view, visit https://gerrit.osmocom.org/10250 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I3fb8554ca329cb609c591058254117006f665e73 Gerrit-Change-Number: 10250 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 14:34:49 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 14:34:49 +0000 Subject: Change in osmo-hlr[master]: USSD: Add support for internal USSD handlers Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10251 Change subject: USSD: Add support for internal USSD handlers ...................................................................... USSD: Add support for internal USSD handlers There are some requests that are best served inside the HLR, as it has access to subscriber information such as MSISDN and IMSI. This unfortunately required quite some restructuring of the USSD related structures including the VTY syntax for adding routes. The default config file has been updated to replicate the *#100# built-in behavior of old OsmoNITB. Closes: OS#2566 Change-Id: I1d09fab810a6bb9ab02904de72dbc9e8a414f9f9 --- M doc/examples/osmo-hlr.cfg M src/hlr.c M src/hlr.h M src/hlr_ussd.c M src/hlr_ussd.h M src/hlr_vty.c 6 files changed, 248 insertions(+), 86 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/51/10251/1 diff --git a/doc/examples/osmo-hlr.cfg b/doc/examples/osmo-hlr.cfg index 853d3c2..c7ccd54 100644 --- a/doc/examples/osmo-hlr.cfg +++ b/doc/examples/osmo-hlr.cfg @@ -17,3 +17,4 @@ hlr gsup bind ip 127.0.0.1 + ussd route prefix *#100# internal own-msisdn diff --git a/src/hlr.c b/src/hlr.c index 74b65c4..7abd6ca 100644 --- a/src/hlr.c +++ b/src/hlr.c @@ -568,7 +568,9 @@ g_hlr = talloc_zero(hlr_ctx, struct hlr); INIT_LLIST_HEAD(&g_hlr->euse_list); + INIT_LLIST_HEAD(&g_hlr->iuse_list); INIT_LLIST_HEAD(&g_hlr->ss_sessions); + INIT_LLIST_HEAD(&g_hlr->ussd_routes); rc = osmo_init_logging2(hlr_ctx, &hlr_log_info); if (rc < 0) { diff --git a/src/hlr.h b/src/hlr.h index 7112352..315c3dd 100644 --- a/src/hlr.h +++ b/src/hlr.h @@ -43,6 +43,9 @@ struct llist_head euse_list; struct hlr_euse *euse_default; + struct llist_head iuse_list; + + struct llist_head ussd_routes; struct llist_head ss_sessions; }; diff --git a/src/hlr_ussd.c b/src/hlr_ussd.c index d23debf..f9399d2 100644 --- a/src/hlr_ussd.c +++ b/src/hlr_ussd.c @@ -27,6 +27,7 @@ #include #include #include +#include #include "hlr.h" #include "hlr_ussd.h" @@ -58,7 +59,6 @@ euse = talloc_zero(hlr, struct hlr_euse); euse->name = talloc_strdup(euse, name); euse->hlr = hlr; - INIT_LLIST_HEAD(&euse->routes); llist_add_tail(&euse->list, &hlr->euse_list); return euse; @@ -71,54 +71,68 @@ } -struct hlr_euse_route *euse_route_find(struct hlr_euse *euse, const char *prefix) +struct hlr_ussd_route *ussd_route_find_prefix(struct hlr *hlr, const char *prefix) { - struct hlr_euse_route *rt; + struct hlr_ussd_route *rt; - llist_for_each_entry(rt, &euse->routes, list) { + llist_for_each_entry(rt, &hlr->ussd_routes, list) { if (!strcmp(rt->prefix, prefix)) return rt; } return NULL; } -struct hlr_euse_route *euse_route_prefix_alloc(struct hlr_euse *euse, const char *prefix) +struct hlr_ussd_route *ussd_route_prefix_alloc_int(struct hlr *hlr, const char *prefix, + const struct hlr_iuse *iuse) { - struct hlr_euse_route *rt; + struct hlr_ussd_route *rt; - if (euse_route_find(euse, prefix)) + if (ussd_route_find_prefix(hlr, prefix)) return NULL; - rt = talloc_zero(euse, struct hlr_euse_route); + rt = talloc_zero(hlr, struct hlr_ussd_route); rt->prefix = talloc_strdup(rt, prefix); - rt->euse = euse; - llist_add_tail(&rt->list, &euse->routes); + rt->u.iuse = iuse; + llist_add_tail(&rt->list, &hlr->ussd_routes); return rt; } -void euse_route_del(struct hlr_euse_route *rt) +struct hlr_ussd_route *ussd_route_prefix_alloc_ext(struct hlr *hlr, const char *prefix, + struct hlr_euse *euse) +{ + struct hlr_ussd_route *rt; + + if (ussd_route_find_prefix(hlr, prefix)) + return NULL; + + rt = talloc_zero(hlr, struct hlr_ussd_route); + rt->prefix = talloc_strdup(rt, prefix); + rt->is_external = true; + rt->u.euse = euse; + llist_add_tail(&rt->list, &hlr->ussd_routes); + + return rt; +} + +void ussd_route_del(struct hlr_ussd_route *rt) { llist_del(&rt->list); talloc_free(rt); } -struct hlr_euse *ussd_euse_find_7bit_gsm(struct hlr *hlr, const char *ussd_code) +static struct hlr_ussd_route *ussd_route_lookup_7bit(struct hlr *hlr, const char *ussd_code) { - struct hlr_euse *euse; - - llist_for_each_entry(euse, &hlr->euse_list, list) { - struct hlr_euse_route *rt; - llist_for_each_entry(rt, &euse->routes, list) { - if (!strncmp(ussd_code, rt->prefix, strlen(rt->prefix))) { - LOGP(DSS, LOGL_DEBUG, "Found EUSE %s (prefix %s) for USSD Code '%s'\n", - rt->euse->name, rt->prefix, ussd_code); - return rt->euse; - } + struct hlr_ussd_route *rt; + llist_for_each_entry(rt, &hlr->ussd_routes, list) { + if (!strncmp(ussd_code, rt->prefix, strlen(rt->prefix))) { + LOGP(DSS, LOGL_DEBUG, "Found EUSE %s (prefix %s) for USSD Code '%s'\n", + rt->u.euse->name, rt->prefix, ussd_code); + return rt; } } - LOGP(DSS, LOGL_DEBUG, "Could not find Route/EUSE for USSD Code '%s'\n", ussd_code); + LOGP(DSS, LOGL_DEBUG, "Could not find Route for USSD Code '%s'\n", ussd_code); return NULL; } @@ -141,8 +155,15 @@ /* time-out when we will delete the session */ struct osmo_timer_list timeout; - /* external USSD Entity responsible for this session */ - struct hlr_euse *euse; + /* is this USSD for an external handler (EUSE): true */ + bool is_external; + union { + /* external USSD Entity responsible for this session */ + struct hlr_euse *euse; + /* internal USSD Entity responsible for this session */ + const struct hlr_iuse *iuse; + } u; + /* we don't keep a pointer to the osmo_gsup_{route,conn} towards the MSC/VLR here, * as this might change during inter-VLR hand-over, and we simply look-up the serving MSC/VLR * every time we receive an USSD component from the EUSE */ @@ -247,6 +268,79 @@ return ss_tx_to_ms(ss, OSMO_GSUP_MSGT_PROC_SS_RESULT, true, msg); } +static int ss_tx_ussd_7bit(struct ss_session *ss, bool final, uint8_t invoke_id, const char *text) +{ + struct msgb *msg = gsm0480_gen_ussd_resp_7bit(invoke_id, text); + LOGPSS(ss, LOGL_INFO, "Tx USSD '%s'\n", text); + OSMO_ASSERT(msg); + return ss_tx_to_ms(ss, OSMO_GSUP_MSGT_PROC_SS_RESULT, final, msg); +} + +/*********************************************************************** + * Internal USSD Handlers + ***********************************************************************/ + +#include "db.h" + +static int handle_ussd_own_msisdn(struct osmo_gsup_conn *conn, struct ss_session *ss, + const struct osmo_gsup_message *gsup, const struct ss_request *req) +{ + struct hlr_subscriber subscr; + char buf[GSM0480_USSD_7BIT_STRING_LEN+1]; + int rc; + + rc = db_subscr_get_by_imsi(g_hlr->dbc, ss->imsi, &subscr); + switch (rc) { + case 0: + if (strlen(subscr.msisdn) == 0) + snprintf(buf, sizeof(buf), "You have no MSISDN!"); + else + snprintf(buf, sizeof(buf), "Your extension is %s\r", subscr.msisdn); + ss_tx_ussd_7bit(ss, true, req->invoke_id, buf); + break; + case -ENOENT: + ss_tx_error(ss, true, GSM0480_ERR_CODE_UNKNOWN_SUBSCRIBER); + break; + case -EIO: + default: + ss_tx_error(ss, true, GSM0480_ERR_CODE_SYSTEM_FAILURE); + break; + } + return 0; +} + +static int handle_ussd_own_imsi(struct osmo_gsup_conn *conn, struct ss_session *ss, + const struct osmo_gsup_message *gsup, const struct ss_request *req) +{ + char buf[GSM0480_USSD_7BIT_STRING_LEN+1]; + snprintf(buf, sizeof(buf), "Your IMSI is %s!\n", ss->imsi); + ss_tx_ussd_7bit(ss, true, req->invoke_id, buf); + return 0; +} + + +static const struct hlr_iuse hlr_iuses[] = { + { + .name = "own-msisdn", + .handle_ussd = handle_ussd_own_msisdn, + }, + { + .name = "own-imsi", + .handle_ussd = handle_ussd_own_imsi, + }, +}; + +const struct hlr_iuse *iuse_find(const char *name) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(hlr_iuses); i++) { + const struct hlr_iuse *iuse = &hlr_iuses[i]; + if (!strcmp(name, iuse->name)) + return iuse; + } + return NULL; +} /*********************************************************************** @@ -307,6 +401,7 @@ return 0; } +/* Handle a USSD GSUP message for a given SS Session received from VLR or EUSE */ static int handle_ussd(struct osmo_gsup_conn *conn, struct ss_session *ss, const struct osmo_gsup_message *gsup, const struct ss_request *req) { @@ -318,8 +413,7 @@ gsm0480_comp_type_name(comp_type), gsm0480_op_code_name(req->opcode), req->ussd_text); - - if (!ss->euse) { + if ((ss->is_external && !ss->u.euse) || !ss->u.iuse) { LOGPSS(ss, LOGL_NOTICE, "USSD for unknown code '%s'\n", req->ussd_text); ss_tx_error(ss, req->invoke_id, GSM0480_ERR_CODE_SS_NOT_AVAILABLE); return 0; @@ -333,19 +427,25 @@ /* FIXME: resolve this based on the database vlr_addr */ osmo_gsup_addr_send(conn->server, (uint8_t *)"MSC-00-00-00-00-00-00", 22, msg_out); } else { - /* Received from VLR, Forward to EUSE */ - char addr[128]; - strcpy(addr, "EUSE-"); - osmo_strlcpy(addr+5, ss->euse->name, sizeof(addr)-5); - conn = gsup_route_find(conn->server, (uint8_t *)addr, strlen(addr)+1); - if (!conn) { - LOGPSS(ss, LOGL_ERROR, "Cannot find conn for EUSE %s\n", addr); - ss_tx_error(ss, req->invoke_id, GSM0480_ERR_CODE_SYSTEM_FAILURE); + /* Received from VLR (MS) */ + if (ss->is_external) { + /* Forward to EUSE */ + char addr[128]; + strcpy(addr, "EUSE-"); + osmo_strlcpy(addr+5, ss->u.euse->name, sizeof(addr)-5); + conn = gsup_route_find(conn->server, (uint8_t *)addr, strlen(addr)+1); + if (!conn) { + LOGPSS(ss, LOGL_ERROR, "Cannot find conn for EUSE %s\n", addr); + ss_tx_error(ss, req->invoke_id, GSM0480_ERR_CODE_SYSTEM_FAILURE); + } else { + msg_out = msgb_alloc_headroom(1024+16, 16, "GSUP USSD FW"); + OSMO_ASSERT(msg_out); + osmo_gsup_encode(msg_out, gsup); + osmo_gsup_conn_send(conn, msg_out); + } } else { - msg_out = msgb_alloc_headroom(1024+16, 16, "GSUP USSD FW"); - OSMO_ASSERT(msg_out); - osmo_gsup_encode(msg_out, gsup); - osmo_gsup_conn_send(conn, msg_out); + /* Handle internally */ + ss->u.iuse->handle_ussd(conn, ss, gsup, req); } } @@ -392,10 +492,20 @@ if (ss_op_is_ussd(req.opcode)) { if (conn_is_euse(conn)) { /* EUSE->VLR: MT USSD. EUSE is known ('conn'), VLR is to be resolved */ - ss->euse = euse_by_conn(conn); + ss->u.euse = euse_by_conn(conn); } else { /* VLR->EUSE: MO USSD. VLR is known ('conn'), EUSE is to be resolved */ - ss->euse = ussd_euse_find_7bit_gsm(hlr, (const char *) req.ussd_text); + struct hlr_ussd_route *rt; + rt = ussd_route_lookup_7bit(hlr, (const char *) req.ussd_text); + if (rt) { + if (rt->is_external) { + ss->is_external = true; + ss->u.euse = rt->u.euse; + } else if (rt) { + ss->is_external = false; + ss->u.iuse = rt->u.iuse; + } + } } /* dispatch unstructured SS to routing */ handle_ussd(conn, ss, gsup, &req); diff --git a/src/hlr_ussd.h b/src/hlr_ussd.h index 433a7f2..d1b9fe0 100644 --- a/src/hlr_ussd.h +++ b/src/hlr_ussd.h @@ -5,11 +5,15 @@ struct osmo_gsup_conn; -struct hlr_euse_route { - /* hlr_euse.routes */ +struct hlr_ussd_route { + /* g_hlr.routes */ struct llist_head list; - struct hlr_euse *euse; const char *prefix; + bool is_external; + union { + struct hlr_euse *euse; + const struct hlr_iuse *iuse; + } u; }; struct hlr_euse { @@ -20,21 +24,34 @@ const char *name; /* human-readable description */ const char *description; - /* list of hlr_euse_route */ - struct llist_head routes; /* GSUP connection to the EUSE, if any */ struct osmo_gsup_conn *conn; }; - struct hlr_euse *euse_find(struct hlr *hlr, const char *name); struct hlr_euse *euse_alloc(struct hlr *hlr, const char *name); void euse_del(struct hlr_euse *euse); -struct hlr_euse_route *euse_route_find(struct hlr_euse *euse, const char *prefix); -struct hlr_euse_route *euse_route_prefix_alloc(struct hlr_euse *euse, const char *prefix); -void euse_route_del(struct hlr_euse_route *rt); +const struct hlr_iuse *iuse_find(const char *name); + +struct hlr_ussd_route *ussd_route_find_prefix(struct hlr *hlr, const char *prefix); +struct hlr_ussd_route *ussd_route_prefix_alloc_int(struct hlr *hlr, const char *prefix, + const struct hlr_iuse *iuse); +struct hlr_ussd_route *ussd_route_prefix_alloc_ext(struct hlr *hlr, const char *prefix, + struct hlr_euse *euse); +void ussd_route_del(struct hlr_ussd_route *rt); int rx_proc_ss_req(struct osmo_gsup_conn *conn, const struct osmo_gsup_message *gsup); int rx_proc_ss_error(struct osmo_gsup_conn *conn, const struct osmo_gsup_message *gsup); + +struct ss_session; +struct ss_request; + +/* Internal USSD Handler */ +struct hlr_iuse { + const char *name; + /* call-back to be called for any incoming USSD messages for this IUSE */ + int (*handle_ussd)(struct osmo_gsup_conn *conn, struct ss_session *ss, + const struct osmo_gsup_message *gsup, const struct ss_request *req); +}; diff --git a/src/hlr_vty.c b/src/hlr_vty.c index 4e6f952..3ee3e14 100644 --- a/src/hlr_vty.c +++ b/src/hlr_vty.c @@ -32,6 +32,7 @@ #include #include +#include "hlr.h" #include "hlr_vty.h" #include "hlr_vty_subscr.h" #include "gsup_server.h" @@ -122,47 +123,77 @@ } /*********************************************************************** - * External USSD Entity + * USSD Entity ***********************************************************************/ #include "hlr_ussd.h" -DEFUN(cfg_euse_route_pfx, cfg_euse_route_pfx_cmd, - "route prefix PREFIX", - "") -{ - struct hlr_euse *euse = vty->index; - struct hlr_euse_route *rt = euse_route_find(euse, argv[0]); +#define USSD_STR "USSD Configuration\n" +#define UROUTE_STR "Routing Configuration\n" +#define PREFIX_STR "Prefix-Matching Route\n" "USSD Prefix\n" +#define INT_CHOICE "(own-msisdn|own-imsi)" +#define INT_STR "Internal USSD Handler\n" \ + "Respond with subscribers' own MSISDN\n" \ + "Respond with subscribers' own IMSI\n" + +#define EXT_STR "External USSD Handler\n" \ + "Name of External USSD Handler (IPA CCM ID)\n" + +DEFUN(cfg_ussd_route_pfx_int, cfg_ussd_route_pfx_int_cmd, + "ussd route prefix PREFIX internal " INT_CHOICE, + USSD_STR UROUTE_STR PREFIX_STR INT_STR) +{ + const struct hlr_iuse *iuse = iuse_find(argv[1]); + struct hlr_ussd_route *rt = ussd_route_find_prefix(g_hlr, argv[0]); if (rt) { vty_out(vty, "%% Cannot add [another?] route for prefix %s%s", argv[0], VTY_NEWLINE); return CMD_WARNING; } - euse_route_prefix_alloc(euse, argv[0]); + ussd_route_prefix_alloc_int(g_hlr, argv[0], iuse); return CMD_SUCCESS; } -DEFUN(cfg_euse_no_route_pfx, cfg_euse_no_route_pfx_cmd, - "no route prefix PREFIX", - NO_STR "") +DEFUN(cfg_ussd_route_pfx_ext, cfg_ussd_route_pfx_ext_cmd, + "ussd route prefix PREFIX external EUSE", + USSD_STR UROUTE_STR PREFIX_STR EXT_STR) { - struct hlr_euse *euse = vty->index; - struct hlr_euse_route *rt = euse_route_find(euse, argv[0]); + struct hlr_euse *euse = euse_find(g_hlr, argv[1]); + struct hlr_ussd_route *rt = ussd_route_find_prefix(g_hlr, argv[0]); + if (rt) { + vty_out(vty, "%% Cannot add [another?] route for prefix %s%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + if (!euse) { + vty_out(vty, "%% Cannot find euse '%s'%s", argv[1], VTY_NEWLINE); + return CMD_WARNING; + } + ussd_route_prefix_alloc_ext(g_hlr, argv[0], euse); + + return CMD_SUCCESS; +} + +DEFUN(cfg_ussd_no_route_pfx, cfg_ussd_no_route_pfx_cmd, + "no ussd route prefix PREFIX", + NO_STR USSD_STR UROUTE_STR PREFIX_STR) +{ + struct hlr_ussd_route *rt = ussd_route_find_prefix(g_hlr, argv[0]); if (!rt) { vty_out(vty, "%% Cannot find route for prefix %s%s", argv[0], VTY_NEWLINE); return CMD_WARNING; } - euse_route_del(rt); + ussd_route_del(rt); return CMD_SUCCESS; } -DEFUN(cfg_euse_defaultroute, cfg_euse_defaultroute_cmd, - "default-route", - "Set this EUSE as default-route for all USSD to unknown destinations\n") +DEFUN(cfg_ussd_defaultroute, cfg_ussd_defaultroute_cmd, + "ussd default-route external EUSE", + USSD_STR "Configure default-route for all USSD to unknown destinations\n" + EXT_STR) { - struct hlr_euse *euse = vty->index; + struct hlr_euse *euse = euse_find(g_hlr, argv[0]); if (g_hlr->euse_default != euse) { vty_out(vty, "Switching default route from %s to %s%s", @@ -173,16 +204,10 @@ return CMD_SUCCESS; } -DEFUN(cfg_euse_no_defaultroute, cfg_euse_no_defaultroute_cmd, - "no default-route", - NO_STR "Remove this EUSE as default-route for all USSD to unknown destinations\n") +DEFUN(cfg_ussd_no_defaultroute, cfg_ussd_no_defaultroute_cmd, + "no ussd default-route", + NO_STR USSD_STR "Remove the default-route for all USSD to unknown destinations\n") { - struct hlr_euse *euse = vty->index; - - if (g_hlr->euse_default != euse) { - vty_out(vty, "%% Current EUSE is no default route, cannot delete it%s", VTY_NEWLINE); - return CMD_WARNING; - } g_hlr->euse_default = NULL; return CMD_SUCCESS; @@ -235,13 +260,8 @@ static void dump_one_euse(struct vty *vty, struct hlr_euse *euse) { - struct hlr_euse_route *er; - vty_out(vty, " euse %s%s", euse->name, VTY_NEWLINE); - llist_for_each_entry(er, &euse->routes, list) - vty_out(vty, " route prefix %s%s", er->prefix, VTY_NEWLINE); - if (g_hlr->euse_default == euse) vty_out(vty, " default-route%s", VTY_NEWLINE); } @@ -249,10 +269,18 @@ static int config_write_euse(struct vty *vty) { struct hlr_euse *euse; + struct hlr_ussd_route *rt; llist_for_each_entry(euse, &g_hlr->euse_list, list) dump_one_euse(vty, euse); + llist_for_each_entry(rt, &g_hlr->ussd_routes, list) { + vty_out(vty, " ussd route prefix %s %s %s%s", rt->prefix, + rt->is_external ? "external" : "internal", + rt->is_external ? rt->u.euse->name : rt->u.iuse->name, + VTY_NEWLINE); + } + return 0; } @@ -313,10 +341,11 @@ install_element(HLR_NODE, &cfg_euse_cmd); install_element(HLR_NODE, &cfg_no_euse_cmd); install_node(&euse_node, config_write_euse); - install_element(EUSE_NODE, &cfg_euse_route_pfx_cmd); - install_element(EUSE_NODE, &cfg_euse_no_route_pfx_cmd); - install_element(EUSE_NODE, &cfg_euse_defaultroute_cmd); - install_element(EUSE_NODE, &cfg_euse_no_defaultroute_cmd); + install_element(HLR_NODE, &cfg_ussd_route_pfx_int_cmd); + install_element(HLR_NODE, &cfg_ussd_route_pfx_ext_cmd); + install_element(HLR_NODE, &cfg_ussd_no_route_pfx_cmd); + install_element(HLR_NODE, &cfg_ussd_defaultroute_cmd); + install_element(HLR_NODE, &cfg_ussd_no_defaultroute_cmd); hlr_vty_subscriber_init(hlr); } -- To view, visit https://gerrit.osmocom.org/10251 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I1d09fab810a6bb9ab02904de72dbc9e8a414f9f9 Gerrit-Change-Number: 10251 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 14:36:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 14:36:18 +0000 Subject: Change in osmo-hlr[master]: GSUP: Log GSUP route add/remove In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10242 ) Change subject: GSUP: Log GSUP route add/remove ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10242 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1768d0b8ee7e2821e40a799c9a1c1d900a7ddc48 Gerrit-Change-Number: 10242 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-CC: Jenkins Builder Gerrit-Comment-Date: Mon, 30 Jul 2018 14:36:18 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 14:40:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 14:40:46 +0000 Subject: Change in osmo-hlr[master]: hlr: Export + Declare global g_hlr symbol In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10243 ) Change subject: hlr: Export + Declare global g_hlr symbol ...................................................................... Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/10243/1/src/hlr_vty.c File src/hlr_vty.c: https://gerrit.osmocom.org/#/c/10243/1/src/hlr_vty.c at a155 PS1, Line 155: we can get rid of this unused function argument now. -- To view, visit https://gerrit.osmocom.org/10243 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6f3e50f071fb2fbbe58413b4760dc2215055a444 Gerrit-Change-Number: 10243 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 30 Jul 2018 14:40:46 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 14:41:06 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 14:41:06 +0000 Subject: Change in osmo-hlr[master]: USSD: Add Core USSD handling + VTY routing config to HLR In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10244 ) Change subject: USSD: Add Core USSD handling + VTY routing config to HLR ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10244 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3cfd7cd401ea32b7e92f1124d129099d9f7dc6e6 Gerrit-Change-Number: 10244 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Mon, 30 Jul 2018 14:41:06 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 14:44:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 14:44:17 +0000 Subject: Change in osmo-hlr[master]: hlr: Export + Declare global g_hlr symbol In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10243 to look at the new patch set (#2). Change subject: hlr: Export + Declare global g_hlr symbol ...................................................................... hlr: Export + Declare global g_hlr symbol It is a global variable, and it's sort of bogus if every C file re-declares it as a static global variable that is assigned to the same value as the "real" global one during start-up. Change-Id: I6f3e50f071fb2fbbe58413b4760dc2215055a444 --- M src/hlr.c M src/hlr.h M src/hlr_vty.c M src/hlr_vty.h M src/hlr_vty_subscr.c M src/hlr_vty_subscr.h 6 files changed, 9 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/43/10243/2 -- To view, visit https://gerrit.osmocom.org/10243 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6f3e50f071fb2fbbe58413b4760dc2215055a444 Gerrit-Change-Number: 10243 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 14:44:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 14:44:17 +0000 Subject: Change in osmo-hlr[master]: USSD: Add Core USSD handling + VTY routing config to HLR In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10244 to look at the new patch set (#2). Change subject: USSD: Add Core USSD handling + VTY routing config to HLR ...................................................................... USSD: Add Core USSD handling + VTY routing config to HLR Change-Id: I3cfd7cd401ea32b7e92f1124d129099d9f7dc6e6 --- M src/Makefile.am M src/hlr.c M src/hlr.h A src/hlr_ussd.c A src/hlr_ussd.h M src/hlr_vty.c M src/hlr_vty.h M tests/test_nodes.vty 8 files changed, 288 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/44/10244/2 -- To view, visit https://gerrit.osmocom.org/10244 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3cfd7cd401ea32b7e92f1124d129099d9f7dc6e6 Gerrit-Change-Number: 10244 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 14:44:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 14:44:32 +0000 Subject: Change in osmo-hlr[master]: hlr: Export + Declare global g_hlr symbol In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10243 ) Change subject: hlr: Export + Declare global g_hlr symbol ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10243 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6f3e50f071fb2fbbe58413b4760dc2215055a444 Gerrit-Change-Number: 10243 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 30 Jul 2018 14:44:32 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 14:44:39 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 14:44:39 +0000 Subject: Change in osmo-hlr[master]: USSD: Add Core USSD handling + VTY routing config to HLR In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10244 ) Change subject: USSD: Add Core USSD handling + VTY routing config to HLR ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10244 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3cfd7cd401ea32b7e92f1124d129099d9f7dc6e6 Gerrit-Change-Number: 10244 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 30 Jul 2018 14:44:39 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 14:44:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 14:44:46 +0000 Subject: Change in osmo-hlr[master]: USSD: Add basic dispatch + decode of GSUP-encapsulated SS/USSD In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10245 ) Change subject: USSD: Add basic dispatch + decode of GSUP-encapsulated SS/USSD ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10245 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5c9fb6b619402d2a23fea9db99590143d85ac11a Gerrit-Change-Number: 10245 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 30 Jul 2018 14:44:46 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 14:44:59 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 14:44:59 +0000 Subject: Change in osmo-hlr[master]: hlr_ussd: Introduce LOGPSS() macro In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10246 ) Change subject: hlr_ussd: Introduce LOGPSS() macro ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10246 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1058ef9fd67af2224c991e43bab02bcf21c9f174 Gerrit-Change-Number: 10246 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 30 Jul 2018 14:44:59 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 14:45:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 14:45:11 +0000 Subject: Change in osmo-hlr[master]: USSD: Send ReturnError component if USSD Code unknown / EUSE disconne... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10247 ) Change subject: USSD: Send ReturnError component if USSD Code unknown / EUSE disconnected ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10247 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ieef06cec05dd81f600594465d18804362e0fafd6 Gerrit-Change-Number: 10247 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 30 Jul 2018 14:45:11 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 14:45:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 14:45:24 +0000 Subject: Change in osmo-hlr[master]: USSD: Further unification of log output; Use LOGPSS when possible In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10248 ) Change subject: USSD: Further unification of log output; Use LOGPSS when possible ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10248 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2c508fe70337d24c4a8b48e0393ad3c979eea0e7 Gerrit-Change-Number: 10248 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 30 Jul 2018 14:45:24 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 14:51:34 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 14:51:34 +0000 Subject: Change in osmo-hlr[master]: Add osmo-euse-demo as minimalistic test of a External USSD (EUSE) han... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10250 ) Change subject: Add osmo-euse-demo as minimalistic test of a External USSD (EUSE) handler ...................................................................... Patch Set 2: Code-Review-1 (3 comments) https://gerrit.osmocom.org/#/c/10250/2/src/osmo-euse-demo.c File src/osmo-euse-demo.c: https://gerrit.osmocom.org/#/c/10250/2/src/osmo-euse-demo.c at 1 PS2, Line 1: #include some description/intro required https://gerrit.osmocom.org/#/c/10250/2/src/osmo-euse-demo.c at 146 PS2, Line 146: //if (strlen(gsup_msg.imsi) < 5) : //return gsup_send_err_reply(gsupc, gsup.imsi, gsup.message_type, GMM_CAUSE_INV_MAND_INFO); remove https://gerrit.osmocom.org/#/c/10250/2/src/osmo-euse-demo.c at 182 PS2, Line 182: char *server_host = "127.0.0.1"; let's make at least the host name configurable -- To view, visit https://gerrit.osmocom.org/10250 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3fb8554ca329cb609c591058254117006f665e73 Gerrit-Change-Number: 10250 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 30 Jul 2018 14:51:34 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 14:52:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 14:52:20 +0000 Subject: Change in osmo-hlr[master]: USSD: Add new "DSS" logging category and use it appropriately In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10249 ) Change subject: USSD: Add new "DSS" logging category and use it appropriately ...................................................................... Patch Set 2: Code-Review-1 update example config file -- To view, visit https://gerrit.osmocom.org/10249 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0ac198a49ba70ea40fea18464325f1925797a6e8 Gerrit-Change-Number: 10249 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 30 Jul 2018 14:52:20 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 14:53:13 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 14:53:13 +0000 Subject: Change in osmo-hlr[master]: GSUP: Log GSUP route add/remove In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10242 ) Change subject: GSUP: Log GSUP route add/remove ...................................................................... GSUP: Log GSUP route add/remove Change-Id: I1768d0b8ee7e2821e40a799c9a1c1d900a7ddc48 --- M src/gsup_router.c 1 file changed, 5 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gsup_router.c b/src/gsup_router.c index e9aed78..6038ee6 100644 --- a/src/gsup_router.c +++ b/src/gsup_router.c @@ -23,6 +23,7 @@ #include #include +#include "logging.h" #include "gsup_server.h" struct gsup_route { @@ -60,6 +61,8 @@ if (!gr) return -ENOMEM; + LOGP(DMAIN, LOGL_INFO, "Adding GSUP route for %s\n", addr); + gr->addr = talloc_memdup(gr, addr, addrlen); gr->conn = conn; llist_add_tail(&gr->list, &conn->server->routes); @@ -75,6 +78,8 @@ llist_for_each_entry_safe(gr, gr2, &conn->server->routes, list) { if (gr->conn == conn) { + LOGP(DMAIN, LOGL_INFO, "Removing GSUP route for %s (GSUP disconnect)\n", + gr->addr); llist_del(&gr->list); talloc_free(gr); num_deleted++; -- To view, visit https://gerrit.osmocom.org/10242 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I1768d0b8ee7e2821e40a799c9a1c1d900a7ddc48 Gerrit-Change-Number: 10242 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 14:53:13 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 14:53:13 +0000 Subject: Change in osmo-hlr[master]: hlr: Export + Declare global g_hlr symbol In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10243 ) Change subject: hlr: Export + Declare global g_hlr symbol ...................................................................... hlr: Export + Declare global g_hlr symbol It is a global variable, and it's sort of bogus if every C file re-declares it as a static global variable that is assigned to the same value as the "real" global one during start-up. Change-Id: I6f3e50f071fb2fbbe58413b4760dc2215055a444 --- M src/hlr.c M src/hlr.h M src/hlr_vty.c M src/hlr_vty.h M src/hlr_vty_subscr.c M src/hlr_vty_subscr.h 6 files changed, 9 insertions(+), 15 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/hlr.c b/src/hlr.c index 8732587..c38f13f 100644 --- a/src/hlr.c +++ b/src/hlr.c @@ -43,7 +43,7 @@ #include "luop.h" #include "hlr_vty.h" -static struct hlr *g_hlr; +struct hlr *g_hlr; static int quit = 0; /* Trigger 'Insert Subscriber Data' messages to all connected GSUP clients. @@ -569,7 +569,7 @@ vty_init(&vty_info); ctrl_vty_init(hlr_ctx); handle_options(argc, argv); - hlr_vty_init(g_hlr, &hlr_log_info); + hlr_vty_init(&hlr_log_info); rc = vty_read_config_file(cmdline_opts.config_file, NULL); if (rc < 0) { diff --git a/src/hlr.h b/src/hlr.h index 368a052..8f73806 100644 --- a/src/hlr.h +++ b/src/hlr.h @@ -39,6 +39,8 @@ char *gsup_bind_addr; }; +extern struct hlr *g_hlr; + struct hlr_subscriber; void osmo_hlr_subscriber_update_notify(struct hlr_subscriber *subscr); diff --git a/src/hlr_vty.c b/src/hlr_vty.c index ecc2f5c..ae27975 100644 --- a/src/hlr_vty.c +++ b/src/hlr_vty.c @@ -32,8 +32,6 @@ #include "hlr_vty_subscr.h" #include "gsup_server.h" -static struct hlr *g_hlr = NULL; - struct cmd_node hlr_node = { HLR_NODE, "%s(config-hlr)# ", @@ -152,10 +150,8 @@ } } -void hlr_vty_init(struct hlr *hlr, const struct log_info *cat) +void hlr_vty_init(const struct log_info *cat) { - g_hlr = hlr; - logging_vty_add_cmds(cat); osmo_talloc_vty_add_cmds(); @@ -169,5 +165,5 @@ install_element(GSUP_NODE, &cfg_hlr_gsup_bind_ip_cmd); - hlr_vty_subscriber_init(hlr); + hlr_vty_subscriber_init(); } diff --git a/src/hlr_vty.h b/src/hlr_vty.h index cd2ff73..bc9c2e5 100644 --- a/src/hlr_vty.h +++ b/src/hlr_vty.h @@ -34,4 +34,4 @@ int hlr_vty_is_config_node(struct vty *vty, int node); int hlr_vty_go_parent(struct vty *vty); -void hlr_vty_init(struct hlr *hlr, const struct log_info *cat); +void hlr_vty_init(const struct log_info *cat); diff --git a/src/hlr_vty_subscr.c b/src/hlr_vty_subscr.c index 4092a8f..9ee6948 100644 --- a/src/hlr_vty_subscr.c +++ b/src/hlr_vty_subscr.c @@ -33,8 +33,6 @@ #define hexdump_buf(buf) osmo_hexdump_nospc((void*)buf, sizeof(buf)) -static struct hlr *g_hlr = NULL; - static void subscr_dump_full_vty(struct vty *vty, struct hlr_subscriber *subscr) { int rc; @@ -476,10 +474,8 @@ return CMD_SUCCESS; } -void hlr_vty_subscriber_init(struct hlr *hlr) +void hlr_vty_subscriber_init(void) { - g_hlr = hlr; - install_element_ve(&subscriber_show_cmd); install_element(ENABLE_NODE, &subscriber_create_cmd); install_element(ENABLE_NODE, &subscriber_delete_cmd); diff --git a/src/hlr_vty_subscr.h b/src/hlr_vty_subscr.h index 841db5a..5dd0772 100644 --- a/src/hlr_vty_subscr.h +++ b/src/hlr_vty_subscr.h @@ -1,3 +1,3 @@ #pragma once -void hlr_vty_subscriber_init(struct hlr *hlr); +void hlr_vty_subscriber_init(void); -- To view, visit https://gerrit.osmocom.org/10243 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I6f3e50f071fb2fbbe58413b4760dc2215055a444 Gerrit-Change-Number: 10243 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 14:53:13 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 14:53:13 +0000 Subject: Change in osmo-hlr[master]: USSD: Add Core USSD handling + VTY routing config to HLR In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10244 ) Change subject: USSD: Add Core USSD handling + VTY routing config to HLR ...................................................................... USSD: Add Core USSD handling + VTY routing config to HLR Change-Id: I3cfd7cd401ea32b7e92f1124d129099d9f7dc6e6 --- M src/Makefile.am M src/hlr.c M src/hlr.h A src/hlr_ussd.c A src/hlr_ussd.h M src/hlr_vty.c M src/hlr_vty.h M tests/test_nodes.vty 8 files changed, 288 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/Makefile.am b/src/Makefile.am index e4506bb..c531ed3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -32,6 +32,7 @@ ctrl.h \ hlr_vty.h \ hlr_vty_subscr.h \ + hlr_ussd.h \ db_bootstrap.h \ $(NULL) @@ -55,6 +56,7 @@ hlr_vty.c \ hlr_vty_subscr.c \ gsup_send.c \ + hlr_ussd.c \ $(NULL) osmo_hlr_LDADD = \ diff --git a/src/hlr.c b/src/hlr.c index c38f13f..4fece7a 100644 --- a/src/hlr.c +++ b/src/hlr.c @@ -559,6 +559,7 @@ vty_info.tall_ctx = hlr_ctx; g_hlr = talloc_zero(hlr_ctx, struct hlr); + INIT_LLIST_HEAD(&g_hlr->euse_list); rc = osmo_init_logging2(hlr_ctx, &hlr_log_info); if (rc < 0) { diff --git a/src/hlr.h b/src/hlr.h index 8f73806..938f7f9 100644 --- a/src/hlr.h +++ b/src/hlr.h @@ -23,6 +23,9 @@ #pragma once #include +#include + +struct hlr_euse; struct hlr { /* GSUP server pointer */ @@ -37,6 +40,9 @@ /* Local bind addr */ char *gsup_bind_addr; + + struct llist_head euse_list; + struct hlr_euse *euse_default; }; extern struct hlr *g_hlr; diff --git a/src/hlr_ussd.c b/src/hlr_ussd.c new file mode 100644 index 0000000..785eafd --- /dev/null +++ b/src/hlr_ussd.c @@ -0,0 +1,93 @@ +/* OsmoHLR VTY implementation */ + +/* (C) 2018 Harald Welte + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + + +#include +#include +#include + +#include "hlr.h" +#include "hlr_ussd.h" + +struct hlr_euse *euse_find(struct hlr *hlr, const char *name) +{ + struct hlr_euse *euse; + + llist_for_each_entry(euse, &hlr->euse_list, list) { + if (!strcmp(euse->name, name)) + return euse; + } + return NULL; +} + +struct hlr_euse *euse_alloc(struct hlr *hlr, const char *name) +{ + struct hlr_euse *euse = euse_find(hlr, name); + if (euse) + return NULL; + + euse = talloc_zero(hlr, struct hlr_euse); + euse->name = talloc_strdup(euse, name); + euse->hlr = hlr; + INIT_LLIST_HEAD(&euse->routes); + llist_add_tail(&euse->list, &hlr->euse_list); + + return euse; +} + +void euse_del(struct hlr_euse *euse) +{ + llist_del(&euse->list); + talloc_free(euse); +} + + +struct hlr_euse_route *euse_route_find(struct hlr_euse *euse, const char *prefix) +{ + struct hlr_euse_route *rt; + + llist_for_each_entry(rt, &euse->routes, list) { + if (!strcmp(rt->prefix, prefix)) + return rt; + } + return NULL; +} + +struct hlr_euse_route *euse_route_prefix_alloc(struct hlr_euse *euse, const char *prefix) +{ + struct hlr_euse_route *rt; + + if (euse_route_find(euse, prefix)) + return NULL; + + rt = talloc_zero(euse, struct hlr_euse_route); + rt->prefix = talloc_strdup(rt, prefix); + rt->euse = euse; + llist_add_tail(&rt->list, &euse->routes); + + return rt; +} + +void euse_route_del(struct hlr_euse_route *rt) +{ + llist_del(&rt->list); + talloc_free(rt); +} diff --git a/src/hlr_ussd.h b/src/hlr_ussd.h new file mode 100644 index 0000000..05d2099 --- /dev/null +++ b/src/hlr_ussd.h @@ -0,0 +1,30 @@ +#include +#include + +struct hlr_euse_route { + /* hlr_euse.routes */ + struct llist_head list; + struct hlr_euse *euse; + const char *prefix; +}; + +struct hlr_euse { + /* list in the per-hlr list of EUSEs */ + struct llist_head list; + struct hlr *hlr; + /* name (must match the IPA ID tag) */ + const char *name; + /* human-readable description */ + const char *description; + /* list of hlr_euse_route */ + struct llist_head routes; +}; + + +struct hlr_euse *euse_find(struct hlr *hlr, const char *name); +struct hlr_euse *euse_alloc(struct hlr *hlr, const char *name); +void euse_del(struct hlr_euse *euse); + +struct hlr_euse_route *euse_route_find(struct hlr_euse *euse, const char *prefix); +struct hlr_euse_route *euse_route_prefix_alloc(struct hlr_euse *euse, const char *prefix); +void euse_route_del(struct hlr_euse_route *rt); diff --git a/src/hlr_vty.c b/src/hlr_vty.c index ae27975..e1349e7 100644 --- a/src/hlr_vty.c +++ b/src/hlr_vty.c @@ -6,6 +6,10 @@ * * All Rights Reserved * + * (C) 2018 Harald Welte + * + * All Rights Reserved + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation; either version 3 of the License, or @@ -117,12 +121,153 @@ return CMD_SUCCESS; } +/*********************************************************************** + * External USSD Entity + ***********************************************************************/ + +#include "hlr_ussd.h" + +DEFUN(cfg_euse_route_pfx, cfg_euse_route_pfx_cmd, + "route prefix PREFIX", + "") +{ + struct hlr_euse *euse = vty->index; + struct hlr_euse_route *rt = euse_route_find(euse, argv[0]); + + if (rt) { + vty_out(vty, "%% Cannot add [another?] route for prefix %s%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + euse_route_prefix_alloc(euse, argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_euse_no_route_pfx, cfg_euse_no_route_pfx_cmd, + "no route prefix PREFIX", + NO_STR "") +{ + struct hlr_euse *euse = vty->index; + struct hlr_euse_route *rt = euse_route_find(euse, argv[0]); + if (!rt) { + vty_out(vty, "%% Cannot find route for prefix %s%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + euse_route_del(rt); + + return CMD_SUCCESS; +} + +DEFUN(cfg_euse_defaultroute, cfg_euse_defaultroute_cmd, + "default-route", + "Set this EUSE as default-route for all USSD to unknown destinations\n") +{ + struct hlr_euse *euse = vty->index; + + if (g_hlr->euse_default != euse) { + vty_out(vty, "Switching default route from %s to %s%s", + g_hlr->euse_default->name, euse->name, VTY_NEWLINE); + g_hlr->euse_default = euse; + } + + return CMD_SUCCESS; +} + +DEFUN(cfg_euse_no_defaultroute, cfg_euse_no_defaultroute_cmd, + "no default-route", + NO_STR "Remove this EUSE as default-route for all USSD to unknown destinations\n") +{ + struct hlr_euse *euse = vty->index; + + if (g_hlr->euse_default != euse) { + vty_out(vty, "%% Current EUSE is no default route, cannot delete it%s", VTY_NEWLINE); + return CMD_WARNING; + } + g_hlr->euse_default = NULL; + + return CMD_SUCCESS; +} + +struct cmd_node euse_node = { + EUSE_NODE, + "%s(config-hlr-euse)# ", + 1, +}; + +DEFUN(cfg_euse, cfg_euse_cmd, + "euse NAME", + "Configure a particular External USSD Entity\n" + "Alphanumeric name of the External USSD Entity\n") +{ + struct hlr_euse *euse; + const char *id = argv[0]; + + euse = euse_find(g_hlr, id); + if (!euse) { + euse = euse_alloc(g_hlr, id); + if (!euse) + return CMD_WARNING; + } + vty->index = euse; + vty->index_sub = &euse->description; + vty->node = EUSE_NODE; + + return CMD_SUCCESS; +} + +DEFUN(cfg_no_euse, cfg_no_euse_cmd, + "no euse NAME", + NO_STR "Remove a particular External USSD Entity\n" + "Alphanumeric name of the External USSD Entity\n") +{ + struct hlr_euse *euse = euse_find(g_hlr, argv[0]); + if (!euse) { + vty_out(vty, "%% Cannot remove non-existant EUSE %s%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + if (g_hlr->euse_default == euse) { + vty_out(vty, "%% Cannot remove EUSE %s, it is the default route%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + euse_del(euse); + return CMD_SUCCESS; +} + +static void dump_one_euse(struct vty *vty, struct hlr_euse *euse) +{ + struct hlr_euse_route *er; + + vty_out(vty, " euse %s%s", euse->name, VTY_NEWLINE); + + llist_for_each_entry(er, &euse->routes, list) + vty_out(vty, " route prefix %s%s", er->prefix, VTY_NEWLINE); + + if (g_hlr->euse_default == euse) + vty_out(vty, " default-route%s", VTY_NEWLINE); +} + +static int config_write_euse(struct vty *vty) +{ + struct hlr_euse *euse; + + llist_for_each_entry(euse, &g_hlr->euse_list, list) + dump_one_euse(vty, euse); + + return 0; +} + +/*********************************************************************** + * Common Code + ***********************************************************************/ + int hlr_vty_go_parent(struct vty *vty) { switch (vty->node) { case GSUP_NODE: + case EUSE_NODE: vty->node = HLR_NODE; vty->index = NULL; + vty->index_sub = NULL; break; default: case HLR_NODE: @@ -165,5 +310,13 @@ install_element(GSUP_NODE, &cfg_hlr_gsup_bind_ip_cmd); + install_element(HLR_NODE, &cfg_euse_cmd); + install_element(HLR_NODE, &cfg_no_euse_cmd); + install_node(&euse_node, config_write_euse); + install_element(EUSE_NODE, &cfg_euse_route_pfx_cmd); + install_element(EUSE_NODE, &cfg_euse_no_route_pfx_cmd); + install_element(EUSE_NODE, &cfg_euse_defaultroute_cmd); + install_element(EUSE_NODE, &cfg_euse_no_defaultroute_cmd); + hlr_vty_subscriber_init(); } diff --git a/src/hlr_vty.h b/src/hlr_vty.h index bc9c2e5..1f3b87f 100644 --- a/src/hlr_vty.h +++ b/src/hlr_vty.h @@ -30,6 +30,7 @@ enum hlr_vty_node { HLR_NODE = _LAST_OSMOVTY_NODE + 1, GSUP_NODE, + EUSE_NODE, }; int hlr_vty_is_config_node(struct vty *vty, int node); diff --git a/tests/test_nodes.vty b/tests/test_nodes.vty index 21809c8..d499962 100644 --- a/tests/test_nodes.vty +++ b/tests/test_nodes.vty @@ -70,6 +70,8 @@ exit end gsup + euse NAME + no euse NAME OsmoHLR(config-hlr)# gsup OsmoHLR(config-hlr-gsup)# list -- To view, visit https://gerrit.osmocom.org/10244 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I3cfd7cd401ea32b7e92f1124d129099d9f7dc6e6 Gerrit-Change-Number: 10244 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 14:53:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 14:53:14 +0000 Subject: Change in osmo-hlr[master]: USSD: Add basic dispatch + decode of GSUP-encapsulated SS/USSD In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10245 ) Change subject: USSD: Add basic dispatch + decode of GSUP-encapsulated SS/USSD ...................................................................... USSD: Add basic dispatch + decode of GSUP-encapsulated SS/USSD We don't want any SS session to run for more than 30s. The timeout is currently not refreshed. If we need more comprehensive timeout handling, using osmo_fsm for SS sessions might make sense. Change-Id: I5c9fb6b619402d2a23fea9db99590143d85ac11a --- M src/hlr.c M src/hlr.h M src/hlr_ussd.c M src/hlr_ussd.h 4 files changed, 323 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/hlr.c b/src/hlr.c index 4fece7a..bcf620d 100644 --- a/src/hlr.c +++ b/src/hlr.c @@ -42,6 +42,7 @@ #include "rand.h" #include "luop.h" #include "hlr_vty.h" +#include "hlr_ussd.h" struct hlr *g_hlr; static int quit = 0; @@ -402,6 +403,13 @@ LOGP(DMAIN, LOGL_ERROR, "Deleting subscriber data for IMSI %s\n", gsup.imsi); break; + case OSMO_GSUP_MSGT_PROC_SS_REQUEST: + case OSMO_GSUP_MSGT_PROC_SS_RESULT: + rx_proc_ss_req(conn, &gsup); + break; + case OSMO_GSUP_MSGT_PROC_SS_ERROR: + rx_proc_ss_error(conn, &gsup); + break; case OSMO_GSUP_MSGT_INSERT_DATA_ERROR: case OSMO_GSUP_MSGT_INSERT_DATA_RESULT: case OSMO_GSUP_MSGT_LOCATION_CANCEL_ERROR: @@ -560,6 +568,7 @@ g_hlr = talloc_zero(hlr_ctx, struct hlr); INIT_LLIST_HEAD(&g_hlr->euse_list); + INIT_LLIST_HEAD(&g_hlr->ss_sessions); rc = osmo_init_logging2(hlr_ctx, &hlr_log_info); if (rc < 0) { diff --git a/src/hlr.h b/src/hlr.h index 938f7f9..7112352 100644 --- a/src/hlr.h +++ b/src/hlr.h @@ -43,6 +43,8 @@ struct llist_head euse_list; struct hlr_euse *euse_default; + + struct llist_head ss_sessions; }; extern struct hlr *g_hlr; diff --git a/src/hlr_ussd.c b/src/hlr_ussd.c index 785eafd..41fba34 100644 --- a/src/hlr_ussd.c +++ b/src/hlr_ussd.c @@ -1,4 +1,4 @@ -/* OsmoHLR VTY implementation */ +/* OsmoHLR SS/USSD implementation */ /* (C) 2018 Harald Welte * @@ -21,11 +21,22 @@ #include +#include +#include +#include +#include #include #include #include "hlr.h" #include "hlr_ussd.h" +#include "gsup_server.h" +#include "gsup_router.h" +#include "logging.h" + +/*********************************************************************** + * core data structures expressing config from VTY + ***********************************************************************/ struct hlr_euse *euse_find(struct hlr *hlr, const char *name) { @@ -91,3 +102,293 @@ llist_del(&rt->list); talloc_free(rt); } + +struct hlr_euse *ussd_euse_find_7bit_gsm(struct hlr *hlr, const char *ussd_code) +{ + struct hlr_euse *euse; + + llist_for_each_entry(euse, &hlr->euse_list, list) { + struct hlr_euse_route *rt; + llist_for_each_entry(rt, &euse->routes, list) { + if (!strncmp(ussd_code, rt->prefix, strlen(rt->prefix))) { + LOGP(DMAIN, LOGL_DEBUG, "Found EUSE %s (prefix %s) for USSD Code '%s'\n", + rt->euse->name, rt->prefix, ussd_code); + return rt->euse; + } + } + } + + LOGP(DMAIN, LOGL_DEBUG, "Could not find Route/EUSE for USSD Code '%s'\n", ussd_code); + return NULL; +} + +/*********************************************************************** + * handling functions for individual GSUP messages + ***********************************************************************/ + +struct ss_session { + /* link us to hlr->ss_sessions */ + struct llist_head list; + /* imsi of this session */ + char imsi[GSM23003_IMSI_MAX_DIGITS+2]; + /* ID of this session (unique per IMSI) */ + uint32_t session_id; + /* state of the session */ + enum osmo_gsup_session_state state; + /* time-out when we will delete the session */ + struct osmo_timer_list timeout; + + /* external USSD Entity responsible for this session */ + struct hlr_euse *euse; + /* we don't keep a pointer to the osmo_gsup_{route,conn} towards the MSC/VLR here, + * as this might change during inter-VLR hand-over, and we simply look-up the serving MSC/VLR + * every time we receive an USSD component from the EUSE */ +}; + +struct ss_session *ss_session_find(struct hlr *hlr, const char *imsi, uint32_t session_id) +{ + struct ss_session *ss; + llist_for_each_entry(ss, &hlr->ss_sessions, list) { + if (!strcmp(ss->imsi, imsi) && ss->session_id == session_id) + return ss; + } + return NULL; +} + +void ss_session_free(struct ss_session *ss) +{ + osmo_timer_del(&ss->timeout); + llist_del(&ss->list); + talloc_free(ss); +} + +static void ss_session_timeout(void *data) +{ + struct ss_session *ss = data; + + LOGP(DMAIN, LOGL_NOTICE, "%s/0x%08x: SS Session Timeout, destroying\n", ss->imsi, ss->session_id); + /* FIXME: should we send a ReturnError component to the MS? */ + ss_session_free(ss); +} + +struct ss_session *ss_session_alloc(struct hlr *hlr, const char *imsi, uint32_t session_id) +{ + struct ss_session *ss; + + OSMO_ASSERT(!ss_session_find(hlr, imsi, session_id)); + + ss = talloc_zero(hlr, struct ss_session); + OSMO_ASSERT(ss); + + OSMO_STRLCPY_ARRAY(ss->imsi, imsi); + ss->session_id = session_id; + osmo_timer_setup(&ss->timeout, ss_session_timeout, ss); + /* NOTE: The timeout is currently global and not refreshed with subsequent messages + * within the SS/USSD session. So 30s after the initial SS message, the session will + * timeout! */ + osmo_timer_schedule(&ss->timeout, 30, 0); + + llist_add_tail(&ss->list, &hlr->ss_sessions); + return ss; +} + +/*********************************************************************** + * handling functions for individual GSUP messages + ***********************************************************************/ + +static bool ss_op_is_ussd(uint8_t opcode) +{ + switch (opcode) { + case GSM0480_OP_CODE_PROCESS_USS_DATA: + case GSM0480_OP_CODE_PROCESS_USS_REQ: + case GSM0480_OP_CODE_USS_REQUEST: + case GSM0480_OP_CODE_USS_NOTIFY: + return true; + default: + return false; + } +} + +/* is this GSUP connection an EUSE (true) or not (false)? */ +static bool conn_is_euse(struct osmo_gsup_conn *conn) +{ + int rc; + uint8_t *addr; + + rc = osmo_gsup_conn_ccm_get(conn, &addr, IPAC_IDTAG_SERNR); + if (rc <= 5) + return false; + if (!strncmp((char *)addr, "EUSE-", 5)) + return true; + else + return false; +} + +static struct hlr_euse *euse_by_conn(struct osmo_gsup_conn *conn) +{ + int rc; + char *addr; + struct hlr *hlr = conn->server->priv; + + rc = osmo_gsup_conn_ccm_get(conn, (uint8_t **) &addr, IPAC_IDTAG_SERNR); + if (rc <= 5) + return NULL; + if (strncmp(addr, "EUSE-", 5)) + return NULL; + + return euse_find(hlr, addr+5); +} + +static int handle_ss(struct ss_session *ss, const struct osmo_gsup_message *gsup, + const struct ss_request *req) +{ + uint8_t comp_type = gsup->ss_info[0]; + + LOGP(DMAIN, LOGL_INFO, "%s: SS CompType=%s, OpCode=%s\n", gsup->imsi, + gsm0480_comp_type_name(comp_type), gsm0480_op_code_name(req->opcode)); + /* FIXME */ + return 0; +} + +static int handle_ussd(struct osmo_gsup_conn *conn, struct ss_session *ss, + const struct osmo_gsup_message *gsup, const struct ss_request *req) +{ + uint8_t comp_type = gsup->ss_info[0]; + struct msgb *msg_out; + bool is_euse_originated = conn_is_euse(conn); + + LOGP(DMAIN, LOGL_INFO, "%s: USSD CompType=%s, OpCode=%s '%s'\n", gsup->imsi, + gsm0480_comp_type_name(comp_type), gsm0480_op_code_name(req->opcode), + req->ussd_text); + + msg_out = msgb_alloc_headroom(1024+16, 16, "GSUP USSD FW"); + OSMO_ASSERT(msg_out); + + if (!ss->euse) { + LOGP(DMAIN, LOGL_NOTICE, "%s: USSD for unknown code '%s'\n", gsup->imsi, req->ussd_text); + /* FIXME: send proper error */ + return 0; + } + + if (is_euse_originated) { + /* Received from EUSE, Forward to VLR */ + osmo_gsup_encode(msg_out, gsup); + /* FIXME: resolve this based on the database vlr_addr */ + osmo_gsup_addr_send(conn->server, (uint8_t *)"MSC-00-00-00-00-00-00", 22, msg_out); + } else { + /* Received from VLR, Forward to EUSE */ + char addr[128]; + strcpy(addr, "EUSE-"); + osmo_strlcpy(addr+5, ss->euse->name, sizeof(addr)-5); + conn = gsup_route_find(conn->server, (uint8_t *)addr, strlen(addr)+1); + if (!conn) { + LOGP(DMAIN, LOGL_ERROR, "Cannot find conn for EUSE %s\n", addr); + /* FIXME: send proper error */ + return -1; + } + osmo_gsup_encode(msg_out, gsup); + osmo_gsup_conn_send(conn, msg_out); + } + + return 0; +} + + +/* this function is called for any SS_REQ/SS_RESP messages from both the MSC/VLR side as well + * as from the EUSE side */ +int rx_proc_ss_req(struct osmo_gsup_conn *conn, const struct osmo_gsup_message *gsup) +{ + struct hlr *hlr = conn->server->priv; + struct ss_session *ss; + struct ss_request req = {0}; + + LOGP(DMAIN, LOGL_INFO, "%s: Process SS (0x%08x, %s)\n", gsup->imsi, gsup->session_id, + osmo_gsup_session_state_name(gsup->session_state)); + + /* decode and find out what kind of SS message it is */ + if (gsup->ss_info && gsup->ss_info_len) { + if (gsm0480_parse_facility_ie(gsup->ss_info, gsup->ss_info_len, &req)) { + LOGP(DMAIN, LOGL_ERROR, "%s: Unable to parse SS request for 0x%08x: %s\n", + gsup->imsi, gsup->session_id, + osmo_hexdump(gsup->ss_info, gsup->ss_info_len)); + goto out_err; + } + } + + switch (gsup->session_state) { + case OSMO_GSUP_SESSION_STATE_BEGIN: + /* Check for overlapping Session ID usage */ + if (ss_session_find(hlr, gsup->imsi, gsup->session_id)) { + LOGP(DMAIN, LOGL_ERROR, "%s/0x%08x: BEGIN with non-uinque session ID!\n", + gsup->imsi, gsup->session_id); + goto out_err; + } + ss = ss_session_alloc(hlr, gsup->imsi, gsup->session_id); + if (!ss) { + LOGP(DMAIN, LOGL_ERROR, "%s: Unable to allocate SS session for 0x%08x\n", + gsup->imsi, gsup->session_id); + goto out_err; + } + if (ss_op_is_ussd(req.opcode)) { + if (conn_is_euse(conn)) { + /* EUSE->VLR: MT USSD. EUSE is known ('conn'), VLR is to be resolved */ + ss->euse = euse_by_conn(conn); + } else { + /* VLR->EUSE: MO USSD. VLR is known ('conn'), EUSE is to be resolved */ + ss->euse = ussd_euse_find_7bit_gsm(hlr, (const char *) req.ussd_text); + } + /* dispatch unstructured SS to routing */ + handle_ussd(conn, ss, gsup, &req); + } else { + /* dispatch non-call SS to internal code */ + handle_ss(ss, gsup, &req); + } + break; + case OSMO_GSUP_SESSION_STATE_CONTINUE: + ss = ss_session_find(hlr, gsup->imsi, gsup->session_id); + if (!ss) { + LOGP(DMAIN, LOGL_ERROR, "%s: CONTINUE for unknwon SS session 0x%08x\n", + gsup->imsi, gsup->session_id); + goto out_err; + } + if (ss_op_is_ussd(req.opcode)) { + /* dispatch unstructured SS to routing */ + handle_ussd(conn, ss, gsup, &req); + } else { + /* dispatch non-call SS to internal code */ + handle_ss(ss, gsup, &req); + } + break; + case OSMO_GSUP_SESSION_STATE_END: + ss = ss_session_find(hlr, gsup->imsi, gsup->session_id); + if (!ss) { + LOGP(DMAIN, LOGL_ERROR, "%s: END for unknwon SS session 0x%08x\n", + gsup->imsi, gsup->session_id); + goto out_err; + } + if (ss_op_is_ussd(req.opcode)) { + /* dispatch unstructured SS to routing */ + handle_ussd(conn, ss, gsup, &req); + } else { + /* dispatch non-call SS to internal code */ + handle_ss(ss, gsup, &req); + } + ss_session_free(ss); + break; + default: + LOGP(DMAIN, LOGL_ERROR, "%s: Unknown SS State %d\n", gsup->imsi, gsup->session_state); + goto out_err; + } + + return 0; + +out_err: + return 0; +} + +int rx_proc_ss_error(struct osmo_gsup_conn *conn, const struct osmo_gsup_message *gsup) +{ + LOGP(DMAIN, LOGL_NOTICE, "%s: Process SS ERROR (0x%08x, %s)\n", gsup->imsi, gsup->session_id, + osmo_gsup_session_state_name(gsup->session_state)); + return 0; +} diff --git a/src/hlr_ussd.h b/src/hlr_ussd.h index 05d2099..433a7f2 100644 --- a/src/hlr_ussd.h +++ b/src/hlr_ussd.h @@ -1,5 +1,9 @@ #include #include +#include +#include "gsup_server.h" + +struct osmo_gsup_conn; struct hlr_euse_route { /* hlr_euse.routes */ @@ -18,6 +22,9 @@ const char *description; /* list of hlr_euse_route */ struct llist_head routes; + + /* GSUP connection to the EUSE, if any */ + struct osmo_gsup_conn *conn; }; @@ -28,3 +35,6 @@ struct hlr_euse_route *euse_route_find(struct hlr_euse *euse, const char *prefix); struct hlr_euse_route *euse_route_prefix_alloc(struct hlr_euse *euse, const char *prefix); void euse_route_del(struct hlr_euse_route *rt); + +int rx_proc_ss_req(struct osmo_gsup_conn *conn, const struct osmo_gsup_message *gsup); +int rx_proc_ss_error(struct osmo_gsup_conn *conn, const struct osmo_gsup_message *gsup); -- To view, visit https://gerrit.osmocom.org/10245 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I5c9fb6b619402d2a23fea9db99590143d85ac11a Gerrit-Change-Number: 10245 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 14:53:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 14:53:14 +0000 Subject: Change in osmo-hlr[master]: hlr_ussd: Introduce LOGPSS() macro In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10246 ) Change subject: hlr_ussd: Introduce LOGPSS() macro ...................................................................... hlr_ussd: Introduce LOGPSS() macro Change-Id: I1058ef9fd67af2224c991e43bab02bcf21c9f174 --- M src/hlr_ussd.c 1 file changed, 4 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/hlr_ussd.c b/src/hlr_ussd.c index 41fba34..ef4063c 100644 --- a/src/hlr_ussd.c +++ b/src/hlr_ussd.c @@ -126,6 +126,9 @@ * handling functions for individual GSUP messages ***********************************************************************/ +#define LOGPSS(ss, lvl, fmt, args...) \ + LOGP(DMAIN, lvl, "%s/0x%08x: " fmt, (ss)->imsi, (ss)->session_id, ## args) + struct ss_session { /* link us to hlr->ss_sessions */ struct llist_head list; @@ -166,7 +169,7 @@ { struct ss_session *ss = data; - LOGP(DMAIN, LOGL_NOTICE, "%s/0x%08x: SS Session Timeout, destroying\n", ss->imsi, ss->session_id); + LOGPSS(ss, LOGL_NOTICE, "SS Session Timeout, destroying\n"); /* FIXME: should we send a ReturnError component to the MS? */ ss_session_free(ss); } -- To view, visit https://gerrit.osmocom.org/10246 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I1058ef9fd67af2224c991e43bab02bcf21c9f174 Gerrit-Change-Number: 10246 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 14:53:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 14:53:15 +0000 Subject: Change in osmo-hlr[master]: USSD: Send ReturnError component if USSD Code unknown / EUSE disconne... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10247 ) Change subject: USSD: Send ReturnError component if USSD Code unknown / EUSE disconnected ...................................................................... USSD: Send ReturnError component if USSD Code unknown / EUSE disconnected Change-Id: Ieef06cec05dd81f600594465d18804362e0fafd6 --- M src/hlr_ussd.c 1 file changed, 64 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/hlr_ussd.c b/src/hlr_ussd.c index ef4063c..fdbde9d 100644 --- a/src/hlr_ussd.c +++ b/src/hlr_ussd.c @@ -196,6 +196,60 @@ } /*********************************************************************** + * handling functions for encoding SS messages + wrapping them in GSUP + ***********************************************************************/ + +static int ss_tx_to_ms(struct ss_session *ss, enum osmo_gsup_message_type gsup_msg_type, + bool final, struct msgb *ss_msg) + +{ + struct osmo_gsup_message resp = {0}; + struct msgb *resp_msg; + + resp.message_type = gsup_msg_type; + OSMO_STRLCPY_ARRAY(resp.imsi, ss->imsi); + if (final) + resp.session_state = OSMO_GSUP_SESSION_STATE_END; + else + resp.session_state = OSMO_GSUP_SESSION_STATE_CONTINUE; + resp.session_id = ss->session_id; + if (ss_msg) { + resp.ss_info = msgb_data(ss_msg); + resp.ss_info_len = msgb_length(ss_msg); + } + + resp_msg = gsm0480_msgb_alloc_name(__func__); + OSMO_ASSERT(resp_msg); + osmo_gsup_encode(resp_msg, &resp); + msgb_free(ss_msg); + + /* FIXME: resolve this based on the database vlr_addr */ + return osmo_gsup_addr_send(g_hlr->gs, (uint8_t *)"MSC-00-00-00-00-00-00", 22, resp_msg); +} + +#if 0 +static int ss_tx_reject(struct ss_session *ss, int invoke_id, uint8_t problem_tag, + uint8_t problem_code) +{ + struct msgb *msg = gsm0480_gen_reject(invoke_id, problem_tag, problem_code); + LOGPSS(ss, LOGL_NOTICE, "Tx Reject(%u, 0x%02x, 0x%02x)\n", invoke_id, + problem_tag, problem_code); + OSMO_ASSERT(msg); + return ss_tx_to_ms(ss, OSMO_GSUP_MSGT_PROC_SS_RESULT, true, msg); +} +#endif + +static int ss_tx_error(struct ss_session *ss, uint8_t invoke_id, uint8_t error_code) +{ + struct msgb *msg = gsm0480_gen_return_error(invoke_id, error_code); + LOGPSS(ss, LOGL_NOTICE, "Tx ReturnError(%u, 0x%02x)\n", invoke_id, error_code); + OSMO_ASSERT(msg); + return ss_tx_to_ms(ss, OSMO_GSUP_MSGT_PROC_SS_RESULT, true, msg); +} + + + +/*********************************************************************** * handling functions for individual GSUP messages ***********************************************************************/ @@ -264,16 +318,16 @@ gsm0480_comp_type_name(comp_type), gsm0480_op_code_name(req->opcode), req->ussd_text); - msg_out = msgb_alloc_headroom(1024+16, 16, "GSUP USSD FW"); - OSMO_ASSERT(msg_out); if (!ss->euse) { LOGP(DMAIN, LOGL_NOTICE, "%s: USSD for unknown code '%s'\n", gsup->imsi, req->ussd_text); - /* FIXME: send proper error */ + ss_tx_error(ss, req->invoke_id, GSM0480_ERR_CODE_SS_NOT_AVAILABLE); return 0; } if (is_euse_originated) { + msg_out = msgb_alloc_headroom(1024+16, 16, "GSUP USSD FW"); + OSMO_ASSERT(msg_out); /* Received from EUSE, Forward to VLR */ osmo_gsup_encode(msg_out, gsup); /* FIXME: resolve this based on the database vlr_addr */ @@ -286,11 +340,13 @@ conn = gsup_route_find(conn->server, (uint8_t *)addr, strlen(addr)+1); if (!conn) { LOGP(DMAIN, LOGL_ERROR, "Cannot find conn for EUSE %s\n", addr); - /* FIXME: send proper error */ - return -1; + ss_tx_error(ss, req->invoke_id, GSM0480_ERR_CODE_SYSTEM_FAILURE); + } else { + msg_out = msgb_alloc_headroom(1024+16, 16, "GSUP USSD FW"); + OSMO_ASSERT(msg_out); + osmo_gsup_encode(msg_out, gsup); + osmo_gsup_conn_send(conn, msg_out); } - osmo_gsup_encode(msg_out, gsup); - osmo_gsup_conn_send(conn, msg_out); } return 0; @@ -314,6 +370,7 @@ LOGP(DMAIN, LOGL_ERROR, "%s: Unable to parse SS request for 0x%08x: %s\n", gsup->imsi, gsup->session_id, osmo_hexdump(gsup->ss_info, gsup->ss_info_len)); + /* FIXME: Send a Reject component? */ goto out_err; } } -- To view, visit https://gerrit.osmocom.org/10247 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ieef06cec05dd81f600594465d18804362e0fafd6 Gerrit-Change-Number: 10247 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 15:03:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 15:03:18 +0000 Subject: Change in osmo-hlr[master]: USSD: Add new "DSS" logging category and use it appropriately In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10249 to look at the new patch set (#3). Change subject: USSD: Add new "DSS" logging category and use it appropriately ...................................................................... USSD: Add new "DSS" logging category and use it appropriately Change-Id: I0ac198a49ba70ea40fea18464325f1925797a6e8 --- M doc/examples/osmo-hlr.cfg M src/hlr_ussd.c M src/logging.c M src/logging.h 4 files changed, 20 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/49/10249/3 -- To view, visit https://gerrit.osmocom.org/10249 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0ac198a49ba70ea40fea18464325f1925797a6e8 Gerrit-Change-Number: 10249 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 15:03:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 15:03:20 +0000 Subject: Change in osmo-hlr[master]: osmo-hlr.cfg: Don't enable DEBUG logging by default Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10252 Change subject: osmo-hlr.cfg: Don't enable DEBUG logging by default ...................................................................... osmo-hlr.cfg: Don't enable DEBUG logging by default This is not a setting that normal users should use in production. Change-Id: I6594fb083cad70ec596af872d85f805897b29644 --- M doc/examples/osmo-hlr.cfg 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/52/10252/1 diff --git a/doc/examples/osmo-hlr.cfg b/doc/examples/osmo-hlr.cfg index 853d3c2..cda1712 100644 --- a/doc/examples/osmo-hlr.cfg +++ b/doc/examples/osmo-hlr.cfg @@ -7,7 +7,10 @@ logging print category 1 logging timestamp 1 logging print extended-timestamp 1 - logging level all debug + logging level all notice + logging level main notice + logging level db notice + logging level auc notice logging level linp error ! line vty -- To view, visit https://gerrit.osmocom.org/10252 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I6594fb083cad70ec596af872d85f805897b29644 Gerrit-Change-Number: 10252 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 15:08:38 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 30 Jul 2018 15:08:38 +0000 Subject: Change in osmo-hlr[master]: hlr_vty_subscr.c: fix subscriber creation command help Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/10253 Change subject: hlr_vty_subscr.c: fix subscriber creation command help ...................................................................... hlr_vty_subscr.c: fix subscriber creation command help Change-Id: Id8dda53cdd10aeedf5451109f9e61d6438c3e09b --- M src/hlr_vty_subscr.c 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/53/10253/1 diff --git a/src/hlr_vty_subscr.c b/src/hlr_vty_subscr.c index 9ee6948..6ce96fe 100644 --- a/src/hlr_vty_subscr.c +++ b/src/hlr_vty_subscr.c @@ -163,8 +163,9 @@ subscriber_create_cmd, SUBSCR_CMD "imsi IDENT create", SUBSCR_CMD_HELP - "Create subscriber by IMSI\n" - "IMSI/MSISDN/ID of the subscriber\n") + "Identify subscriber by IMSI\n" + "IMSI/MSISDN/ID of the subscriber\n" + "Create subscriber by IMSI\n") { int rc; struct hlr_subscriber subscr; -- To view, visit https://gerrit.osmocom.org/10253 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Id8dda53cdd10aeedf5451109f9e61d6438c3e09b Gerrit-Change-Number: 10253 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 15:08:38 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 30 Jul 2018 15:08:38 +0000 Subject: Change in osmo-hlr[master]: Update .gitignore: add missing build products Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/10254 Change subject: Update .gitignore: add missing build products ...................................................................... Update .gitignore: add missing build products Change-Id: I71809105c631703477d8226ba28a57121807b5ed --- M .gitignore 1 file changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/54/10254/1 diff --git a/.gitignore b/.gitignore index 571f5b1..baaaeb6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ *.o +*.lo +*.la *.db *.pyc .*.sw? @@ -23,16 +25,22 @@ .deps *.pc +.libs src/db_test src/db_bootstrap.h src/osmo-hlr src/osmo-hlr-db-tool +src/gsupclient/gsup-test-client tests/atconfig tests/testsuite +tests/testsuite.log + tests/auc/auc_3g_test tests/auc/auc_ts_55_205_test_sets.c tests/auc/auc_ts_55_205_test_sets tests/auc/auc_test tests/gsup_server/gsup_server_test +tests/gsup/gsup_test +tests/db/db_test -- To view, visit https://gerrit.osmocom.org/10254 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I71809105c631703477d8226ba28a57121807b5ed Gerrit-Change-Number: 10254 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 15:08:38 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 30 Jul 2018 15:08:38 +0000 Subject: Change in osmo-hlr[master]: tests/Makefile.am: also remove temporary sqlite files Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/10255 Change subject: tests/Makefile.am: also remove temporary sqlite files ...................................................................... tests/Makefile.am: also remove temporary sqlite files The osmo_verify_transcript_*.py do terminate the osmo-hlr process in some unusual way, so the database file is not closed properly. Let's remove temporary files after the tests execution. Change-Id: I9e4c98e86c1d6b627bfee1acb4fa116460687483 --- M tests/Makefile.am 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/55/10255/1 diff --git a/tests/Makefile.am b/tests/Makefile.am index 58679ed..7e45da4 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -57,6 +57,7 @@ -r "$(top_builddir)/src/osmo-hlr -c $(top_srcdir)/doc/examples/osmo-hlr.cfg -l $(VTY_TEST_DB)" \ $(U) $(srcdir)/*.vty -rm -f $(VTY_TEST_DB) + -rm $(VTY_TEST_DB)-* CTRL_TEST_DB = hlr_ctrl_test.db @@ -72,6 +73,7 @@ -r "$(top_builddir)/src/osmo-hlr -c $(top_srcdir)/doc/examples/osmo-hlr.cfg -l $(CTRL_TEST_DB)" \ $(U) $(srcdir)/*.ctrl -rm -f $(CTRL_TEST_DB) + -rm $(CTRL_TEST_DB)-* else python-tests: -- To view, visit https://gerrit.osmocom.org/10255 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I9e4c98e86c1d6b627bfee1acb4fa116460687483 Gerrit-Change-Number: 10255 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Mon Jul 30 15:10:06 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Mon, 30 Jul 2018 15:10:06 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-asn1c_=C2=BB_a1=3Ddefault?= =?UTF-8?Q?,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#200?= Message-ID: <1069749641.10.1532963406493.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 3.67 KB...] + ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for style of include used by make... GNU checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking how to run the C++ preprocessor... g++ -E checking for g77... no checking for f77... no checking for xlf... no checking for frt... no checking for pgf77... no checking for cf77... no checking for fort77... no checking for fl32... no checking for af77... no checking for f90... no checking for xlf90... no checking for pgf90... no checking for pghpf... no checking for epcf90... no checking for gfortran... no checking for g95... no checking for f95... no checking for fort... no checking for xlf95... no checking for ifort... no checking for ifc... no checking for efc... no checking for pgf95... no checking for lf95... no checking for ftn... no checking whether we are using the GNU Fortran 77 compiler... no checking whether accepts -g... no checking the maximum length of command line arguments... 32768 checking command to parse /usr/bin/nm -B output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes configure: creating libtool appending configuration tag "CXX" to libtool checking for ld used by g++... /usr/bin/ld -m elf_x86_64 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC checking if g++ PIC flag -fPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate appending configuration tag "F77" to libtool checking for autoconf... /usr/bin/autoconf checking for autoheader... /usr/bin/autoheader checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking dependency style of gcc... (cached) gcc3 checking how to run the C preprocessor... gcc -E checking for a BSD-compatible install... /usr/bin/install -c checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking for bison... bison -y checking for flex... flex checking for yywrap in -lfl... yes checking lex output file root... lex.yy checking whether yytext is a pointer... yes checking for ar... /usr/bin/ar checking for ANSI C header files... (cached) yes checking sys/param.h usability... yes checking sys/param.h presence... yes checking for sys/param.h... yes checking whether byte ordering is bigendian... no checking for off_t... yes checking for size_t... yes checking whether struct tm is in sys/time.h or time.h... time.h checking for intmax_t... yes checking for library containing getopt... none required checking for strtoimax... yes checking for strtoll... yes checking for mergesort... no checking for mkstemps... yes configure: creating ./config.status config.status: creating skeletons/standard-modules/Makefile config.status: creating skeletons/tests/Makefile config.status: creating libasn1compiler/Makefile config.status: creating libasn1parser/Makefile config.status: creating libasn1print/Makefile config.status: creating asn1c/webcgi/Makefile config.status: creating asn1c/tests/Makefile config.status: creating libasn1fix/Makefile config.status: creating skeletons/Makefile config.status: creating examples/Makefile config.status: creating tests/Makefile config.status: creating asn1c/Makefile config.status: creating doc/Makefile config.status: creating asn1c.spec config.status: creating Makefile config.status: creating config.h config.status: executing depfiles commands + make -j 8 make all-recursive make[1]: Entering directory ' Making all in libasn1parser make[2]: Entering directory ' if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF ".deps/asn1parser.Tpo" -c -o asn1parser.lo asn1parser.c; \ then mv -f ".deps/asn1parser.Tpo" ".deps/asn1parser.Plo"; else rm -f ".deps/asn1parser.Tpo"; exit 1; fi bison -y -p asn1p_ -d asn1p_y.y if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF ".deps/asn1p_l.Tpo" -c -o asn1p_l.lo asn1p_l.c; \ then mv -f ".deps/asn1p_l.Tpo" ".deps/asn1p_l.Plo"; else rm -f ".deps/asn1p_l.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF ".deps/asn1p_module.Tpo" -c -o asn1p_module.lo asn1p_module.c; \ then mv -f ".deps/asn1p_module.Tpo" ".deps/asn1p_module.Plo"; else rm -f ".deps/asn1p_module.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF ".deps/asn1p_oid.Tpo" -c -o asn1p_oid.lo asn1p_oid.c; \ then mv -f ".deps/asn1p_oid.Tpo" ".deps/asn1p_oid.Plo"; else rm -f ".deps/asn1p_oid.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF ".deps/asn1p_value.Tpo" -c -o asn1p_value.lo asn1p_value.c; \ then mv -f ".deps/asn1p_value.Tpo" ".deps/asn1p_value.Plo"; else rm -f ".deps/asn1p_value.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF ".deps/asn1p_expr.Tpo" -c -o asn1p_expr.lo asn1p_expr.c; \ then mv -f ".deps/asn1p_expr.Tpo" ".deps/asn1p_expr.Plo"; else rm -f ".deps/asn1p_expr.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF ".deps/asn1p_xports.Tpo" -c -o asn1p_xports.lo asn1p_xports.c; \ then mv -f ".deps/asn1p_xports.Tpo" ".deps/asn1p_xports.Plo"; else rm -f ".deps/asn1p_xports.Tpo"; exit 1; fi asn1p_y.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] mkdir .libs gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -fPIC -DPIC -o .libs/asn1p_module.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -fPIC -DPIC -o .libs/asn1p_l.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -fPIC -DPIC -o .libs/asn1p_expr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -fPIC -DPIC -o .libs/asn1p_value.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -fPIC -DPIC -o .libs/asn1parser.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -fPIC -DPIC -o .libs/asn1p_oid.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -fPIC -DPIC -o .libs/asn1p_xports.o asn1p_l.c:3521:12: warning: 'input' defined but not used [-Wunused-function] static int input() ^~~~~ gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_module.lo -MD -MP -MF .deps/asn1p_module.Tpo -c asn1p_module.c -o asn1p_module.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_xports.lo -MD -MP -MF .deps/asn1p_xports.Tpo -c asn1p_xports.c -o asn1p_xports.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1parser.lo -MD -MP -MF .deps/asn1parser.Tpo -c asn1parser.c -o asn1parser.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_oid.lo -MD -MP -MF .deps/asn1p_oid.Tpo -c asn1p_oid.c -o asn1p_oid.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_value.lo -MD -MP -MF .deps/asn1p_value.Tpo -c asn1p_value.c -o asn1p_value.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_expr.lo -MD -MP -MF .deps/asn1p_expr.Tpo -c asn1p_expr.c -o asn1p_expr.o >/dev/null 2>&1 if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF ".deps/asn1p_constr.Tpo" -c -o asn1p_constr.lo asn1p_constr.c; \ then mv -f ".deps/asn1p_constr.Tpo" ".deps/asn1p_constr.Plo"; else rm -f ".deps/asn1p_constr.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF ".deps/asn1p_param.Tpo" -c -o asn1p_param.lo asn1p_param.c; \ then mv -f ".deps/asn1p_param.Tpo" ".deps/asn1p_param.Plo"; else rm -f ".deps/asn1p_param.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF ".deps/asn1p_class.Tpo" -c -o asn1p_class.lo asn1p_class.c; \ then mv -f ".deps/asn1p_class.Tpo" ".deps/asn1p_class.Plo"; else rm -f ".deps/asn1p_class.Tpo"; exit 1; fi if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF ".deps/asn1p_ref.Tpo" -c -o asn1p_ref.lo asn1p_ref.c; \ then mv -f ".deps/asn1p_ref.Tpo" ".deps/asn1p_ref.Plo"; else rm -f ".deps/asn1p_ref.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -fPIC -DPIC -o .libs/asn1p_constr.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -fPIC -DPIC -o .libs/asn1p_param.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -fPIC -DPIC -o .libs/asn1p_class.o if test -f y.tab.h; then \ to=`echo "asn1p_y_H" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \ sed -e "/^#/!b" -e "s/Y_TAB_H/$to/g" -e "s|y\.tab\.h|asn1p_y.h|" \ y.tab.h >asn1p_y.ht; \ rm -f y.tab.h; \ if cmp -s asn1p_y.ht asn1p_y.h; then \ rm -f asn1p_y.ht ;\ else \ mv asn1p_y.ht asn1p_y.h; \ fi; \ fi if test -f y.output; then \ mv y.output asn1p_y.output; \ fi sed '/^#/ s|y\.tab\.c|asn1p_y.c|' y.tab.c >asn1p_y.ct && mv asn1p_y.ct asn1p_y.c rm -f y.tab.c if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF ".deps/asn1p_y.Tpo" -c -o asn1p_y.lo asn1p_y.c; \ then mv -f ".deps/asn1p_y.Tpo" ".deps/asn1p_y.Plo"; else rm -f ".deps/asn1p_y.Tpo"; exit 1; fi gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -fPIC -DPIC -o .libs/asn1p_ref.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_constr.lo -MD -MP -MF .deps/asn1p_constr.Tpo -c asn1p_constr.c -o asn1p_constr.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_param.lo -MD -MP -MF .deps/asn1p_param.Tpo -c asn1p_param.c -o asn1p_param.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_class.lo -MD -MP -MF .deps/asn1p_class.Tpo -c asn1p_class.c -o asn1p_class.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_ref.lo -MD -MP -MF .deps/asn1p_ref.Tpo -c asn1p_ref.c -o asn1p_ref.o >/dev/null 2>&1 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_y.lo -MD -MP -MF .deps/asn1p_y.Tpo -c asn1p_y.c -fPIC -DPIC -o .libs/asn1p_y.o gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -Wall -Wshadow -Wcast-qual -Wcast-align -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -MT asn1p_l.lo -MD -MP -MF .deps/asn1p_l.Tpo -c asn1p_l.c -o asn1p_l.o >/dev/null 2>&1 asn1p_y.y: In function 'asn1p_parse': asn1p_y.y:357:13: error: 'param' undeclared (first use in this function) *(void **)param = $1; ^~~~~ asn1p_y.y:357:13: note: each undeclared identifier is reported only once for each function it appears in Makefile:299: recipe for target 'asn1p_y.lo' failed make[2]: *** [asn1p_y.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory ' Makefile:302: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory ' Makefile:212: recipe for target 'all' failed make: *** [all] Error 2 Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From gerrit-no-reply at lists.osmocom.org Mon Jul 30 15:10:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 15:10:48 +0000 Subject: Change in osmo-hlr[master]: USSD: Further unification of log output; Use LOGPSS when possible In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10248 ) Change subject: USSD: Further unification of log output; Use LOGPSS when possible ...................................................................... USSD: Further unification of log output; Use LOGPSS when possible Change-Id: I2c508fe70337d24c4a8b48e0393ad3c979eea0e7 --- M src/hlr_ussd.c 1 file changed, 13 insertions(+), 12 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/hlr_ussd.c b/src/hlr_ussd.c index fdbde9d..8710061 100644 --- a/src/hlr_ussd.c +++ b/src/hlr_ussd.c @@ -301,7 +301,7 @@ { uint8_t comp_type = gsup->ss_info[0]; - LOGP(DMAIN, LOGL_INFO, "%s: SS CompType=%s, OpCode=%s\n", gsup->imsi, + LOGPSS(ss, LOGL_INFO, "SS CompType=%s, OpCode=%s\n", gsm0480_comp_type_name(comp_type), gsm0480_op_code_name(req->opcode)); /* FIXME */ return 0; @@ -314,13 +314,13 @@ struct msgb *msg_out; bool is_euse_originated = conn_is_euse(conn); - LOGP(DMAIN, LOGL_INFO, "%s: USSD CompType=%s, OpCode=%s '%s'\n", gsup->imsi, + LOGPSS(ss, LOGL_INFO, "USSD CompType=%s, OpCode=%s '%s'\n", gsm0480_comp_type_name(comp_type), gsm0480_op_code_name(req->opcode), req->ussd_text); if (!ss->euse) { - LOGP(DMAIN, LOGL_NOTICE, "%s: USSD for unknown code '%s'\n", gsup->imsi, req->ussd_text); + LOGPSS(ss, LOGL_NOTICE, "USSD for unknown code '%s'\n", req->ussd_text); ss_tx_error(ss, req->invoke_id, GSM0480_ERR_CODE_SS_NOT_AVAILABLE); return 0; } @@ -339,7 +339,7 @@ osmo_strlcpy(addr+5, ss->euse->name, sizeof(addr)-5); conn = gsup_route_find(conn->server, (uint8_t *)addr, strlen(addr)+1); if (!conn) { - LOGP(DMAIN, LOGL_ERROR, "Cannot find conn for EUSE %s\n", addr); + LOGPSS(ss, LOGL_ERROR, "Cannot find conn for EUSE %s\n", addr); ss_tx_error(ss, req->invoke_id, GSM0480_ERR_CODE_SYSTEM_FAILURE); } else { msg_out = msgb_alloc_headroom(1024+16, 16, "GSUP USSD FW"); @@ -361,13 +361,13 @@ struct ss_session *ss; struct ss_request req = {0}; - LOGP(DMAIN, LOGL_INFO, "%s: Process SS (0x%08x, %s)\n", gsup->imsi, gsup->session_id, + LOGP(DMAIN, LOGL_INFO, "%s/0x%08x: Process SS (%s)\n", gsup->imsi, gsup->session_id, osmo_gsup_session_state_name(gsup->session_state)); /* decode and find out what kind of SS message it is */ if (gsup->ss_info && gsup->ss_info_len) { if (gsm0480_parse_facility_ie(gsup->ss_info, gsup->ss_info_len, &req)) { - LOGP(DMAIN, LOGL_ERROR, "%s: Unable to parse SS request for 0x%08x: %s\n", + LOGP(DMAIN, LOGL_ERROR, "%s/0x%082x: Unable to parse SS request: %s\n", gsup->imsi, gsup->session_id, osmo_hexdump(gsup->ss_info, gsup->ss_info_len)); /* FIXME: Send a Reject component? */ @@ -379,13 +379,13 @@ case OSMO_GSUP_SESSION_STATE_BEGIN: /* Check for overlapping Session ID usage */ if (ss_session_find(hlr, gsup->imsi, gsup->session_id)) { - LOGP(DMAIN, LOGL_ERROR, "%s/0x%08x: BEGIN with non-uinque session ID!\n", + LOGP(DMAIN, LOGL_ERROR, "%s/0x%08x: BEGIN with non-unique session ID!\n", gsup->imsi, gsup->session_id); goto out_err; } ss = ss_session_alloc(hlr, gsup->imsi, gsup->session_id); if (!ss) { - LOGP(DMAIN, LOGL_ERROR, "%s: Unable to allocate SS session for 0x%08x\n", + LOGP(DMAIN, LOGL_ERROR, "%s/0x%08x: Unable to allocate SS session\n", gsup->imsi, gsup->session_id); goto out_err; } @@ -407,7 +407,7 @@ case OSMO_GSUP_SESSION_STATE_CONTINUE: ss = ss_session_find(hlr, gsup->imsi, gsup->session_id); if (!ss) { - LOGP(DMAIN, LOGL_ERROR, "%s: CONTINUE for unknwon SS session 0x%08x\n", + LOGP(DMAIN, LOGL_ERROR, "%s/0x%08x: CONTINUE for unknown SS session\n", gsup->imsi, gsup->session_id); goto out_err; } @@ -422,7 +422,7 @@ case OSMO_GSUP_SESSION_STATE_END: ss = ss_session_find(hlr, gsup->imsi, gsup->session_id); if (!ss) { - LOGP(DMAIN, LOGL_ERROR, "%s: END for unknwon SS session 0x%08x\n", + LOGP(DMAIN, LOGL_ERROR, "%s/0x%08x: END for unknown SS session\n", gsup->imsi, gsup->session_id); goto out_err; } @@ -436,7 +436,8 @@ ss_session_free(ss); break; default: - LOGP(DMAIN, LOGL_ERROR, "%s: Unknown SS State %d\n", gsup->imsi, gsup->session_state); + LOGP(DMAIN, LOGL_ERROR, "%s/0x%08x: Unknown SS State %d\n", gsup->imsi, + gsup->session_id, gsup->session_state); goto out_err; } @@ -448,7 +449,7 @@ int rx_proc_ss_error(struct osmo_gsup_conn *conn, const struct osmo_gsup_message *gsup) { - LOGP(DMAIN, LOGL_NOTICE, "%s: Process SS ERROR (0x%08x, %s)\n", gsup->imsi, gsup->session_id, + LOGP(DMAIN, LOGL_NOTICE, "%s/0x%08x: Process SS ERROR (%s)\n", gsup->imsi, gsup->session_id, osmo_gsup_session_state_name(gsup->session_state)); return 0; } -- To view, visit https://gerrit.osmocom.org/10248 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I2c508fe70337d24c4a8b48e0393ad3c979eea0e7 Gerrit-Change-Number: 10248 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 15:15:13 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 15:15:13 +0000 Subject: Change in osmo-hlr[master]: osmo-hlr.cfg: Don't enable DEBUG logging by default In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10252 to look at the new patch set (#2). Change subject: osmo-hlr.cfg: Don't enable DEBUG logging by default ...................................................................... osmo-hlr.cfg: Don't enable DEBUG logging by default This is not a setting that normal users should use in production. Change-Id: I6594fb083cad70ec596af872d85f805897b29644 --- M doc/examples/osmo-hlr.cfg M tests/test_nodes.vty 2 files changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/52/10252/2 -- To view, visit https://gerrit.osmocom.org/10252 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6594fb083cad70ec596af872d85f805897b29644 Gerrit-Change-Number: 10252 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 15:15:13 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 15:15:13 +0000 Subject: Change in osmo-hlr[master]: USSD: Add new "DSS" logging category and use it appropriately In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10249 to look at the new patch set (#4). Change subject: USSD: Add new "DSS" logging category and use it appropriately ...................................................................... USSD: Add new "DSS" logging category and use it appropriately Change-Id: I0ac198a49ba70ea40fea18464325f1925797a6e8 --- M doc/examples/osmo-hlr.cfg M src/hlr_ussd.c M src/logging.c M src/logging.h M tests/test_nodes.vty 5 files changed, 21 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/49/10249/4 -- To view, visit https://gerrit.osmocom.org/10249 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0ac198a49ba70ea40fea18464325f1925797a6e8 Gerrit-Change-Number: 10249 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 15:15:13 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 15:15:13 +0000 Subject: Change in osmo-hlr[master]: Add osmo-euse-demo as minimalistic test of a External USSD (EUSE) han... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10250 to look at the new patch set (#4). Change subject: Add osmo-euse-demo as minimalistic test of a External USSD (EUSE) handler ...................................................................... Add osmo-euse-demo as minimalistic test of a External USSD (EUSE) handler This is a small program which simply echo's the USSD request message it gets in a quote back to the sender. Its purpose is to illustrate how EUSEs can be implemented using libosmo-gsup-client. Change-Id: I3fb8554ca329cb609c591058254117006f665e73 --- M src/Makefile.am A src/osmo-euse-demo.c 2 files changed, 253 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/50/10250/4 -- To view, visit https://gerrit.osmocom.org/10250 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3fb8554ca329cb609c591058254117006f665e73 Gerrit-Change-Number: 10250 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 15:15:42 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 15:15:42 +0000 Subject: Change in osmo-hlr[master]: osmo-hlr.cfg: Don't enable DEBUG logging by default In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10252 ) Change subject: osmo-hlr.cfg: Don't enable DEBUG logging by default ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10252 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6594fb083cad70ec596af872d85f805897b29644 Gerrit-Change-Number: 10252 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 30 Jul 2018 15:15:42 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 15:15:49 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 15:15:49 +0000 Subject: Change in osmo-hlr[master]: USSD: Add new "DSS" logging category and use it appropriately In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10249 ) Change subject: USSD: Add new "DSS" logging category and use it appropriately ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10249 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0ac198a49ba70ea40fea18464325f1925797a6e8 Gerrit-Change-Number: 10249 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 30 Jul 2018 15:15:49 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 15:16:38 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 15:16:38 +0000 Subject: Change in osmo-hlr[master]: Add osmo-euse-demo as minimalistic test of a External USSD (EUSE) han... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10250 to look at the new patch set (#5). Change subject: Add osmo-euse-demo as minimalistic test of a External USSD (EUSE) handler ...................................................................... Add osmo-euse-demo as minimalistic test of a External USSD (EUSE) handler This is a small program which simply echo's the USSD request message it gets in a quote back to the sender. Its purpose is to illustrate how EUSEs can be implemented using libosmo-gsup-client. Change-Id: I3fb8554ca329cb609c591058254117006f665e73 --- M src/Makefile.am A src/osmo-euse-demo.c 2 files changed, 250 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/50/10250/5 -- To view, visit https://gerrit.osmocom.org/10250 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3fb8554ca329cb609c591058254117006f665e73 Gerrit-Change-Number: 10250 Gerrit-PatchSet: 5 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 15:16:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 15:16:57 +0000 Subject: Change in osmo-hlr[master]: Add osmo-euse-demo as minimalistic test of a External USSD (EUSE) han... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10250 ) Change subject: Add osmo-euse-demo as minimalistic test of a External USSD (EUSE) handler ...................................................................... Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10250 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3fb8554ca329cb609c591058254117006f665e73 Gerrit-Change-Number: 10250 Gerrit-PatchSet: 5 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 30 Jul 2018 15:16:57 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 15:18:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 15:18:44 +0000 Subject: Change in osmo-hlr[master]: osmo-hlr.cfg: Don't enable DEBUG logging by default In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10252 ) Change subject: osmo-hlr.cfg: Don't enable DEBUG logging by default ...................................................................... osmo-hlr.cfg: Don't enable DEBUG logging by default This is not a setting that normal users should use in production. Change-Id: I6594fb083cad70ec596af872d85f805897b29644 --- M doc/examples/osmo-hlr.cfg M tests/test_nodes.vty 2 files changed, 5 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/doc/examples/osmo-hlr.cfg b/doc/examples/osmo-hlr.cfg index 853d3c2..cda1712 100644 --- a/doc/examples/osmo-hlr.cfg +++ b/doc/examples/osmo-hlr.cfg @@ -7,7 +7,10 @@ logging print category 1 logging timestamp 1 logging print extended-timestamp 1 - logging level all debug + logging level all notice + logging level main notice + logging level db notice + logging level auc notice logging level linp error ! line vty diff --git a/tests/test_nodes.vty b/tests/test_nodes.vty index d499962..8857860 100644 --- a/tests/test_nodes.vty +++ b/tests/test_nodes.vty @@ -107,7 +107,7 @@ logging print category 1 logging print extended-timestamp 1 logging print file 1 - logging level all debug + logging level all notice logging level main notice logging level db notice logging level auc notice -- To view, visit https://gerrit.osmocom.org/10252 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I6594fb083cad70ec596af872d85f805897b29644 Gerrit-Change-Number: 10252 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 15:18:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 15:18:44 +0000 Subject: Change in osmo-hlr[master]: USSD: Add new "DSS" logging category and use it appropriately In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10249 ) Change subject: USSD: Add new "DSS" logging category and use it appropriately ...................................................................... USSD: Add new "DSS" logging category and use it appropriately Change-Id: I0ac198a49ba70ea40fea18464325f1925797a6e8 --- M doc/examples/osmo-hlr.cfg M src/hlr_ussd.c M src/logging.c M src/logging.h M tests/test_nodes.vty 5 files changed, 21 insertions(+), 11 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/doc/examples/osmo-hlr.cfg b/doc/examples/osmo-hlr.cfg index cda1712..ebc22ec 100644 --- a/doc/examples/osmo-hlr.cfg +++ b/doc/examples/osmo-hlr.cfg @@ -11,6 +11,7 @@ logging level main notice logging level db notice logging level auc notice + logging level ss info logging level linp error ! line vty diff --git a/src/hlr_ussd.c b/src/hlr_ussd.c index 8710061..d23debf 100644 --- a/src/hlr_ussd.c +++ b/src/hlr_ussd.c @@ -111,14 +111,14 @@ struct hlr_euse_route *rt; llist_for_each_entry(rt, &euse->routes, list) { if (!strncmp(ussd_code, rt->prefix, strlen(rt->prefix))) { - LOGP(DMAIN, LOGL_DEBUG, "Found EUSE %s (prefix %s) for USSD Code '%s'\n", + LOGP(DSS, LOGL_DEBUG, "Found EUSE %s (prefix %s) for USSD Code '%s'\n", rt->euse->name, rt->prefix, ussd_code); return rt->euse; } } } - LOGP(DMAIN, LOGL_DEBUG, "Could not find Route/EUSE for USSD Code '%s'\n", ussd_code); + LOGP(DSS, LOGL_DEBUG, "Could not find Route/EUSE for USSD Code '%s'\n", ussd_code); return NULL; } @@ -127,7 +127,7 @@ ***********************************************************************/ #define LOGPSS(ss, lvl, fmt, args...) \ - LOGP(DMAIN, lvl, "%s/0x%08x: " fmt, (ss)->imsi, (ss)->session_id, ## args) + LOGP(DSS, lvl, "%s/0x%08x: " fmt, (ss)->imsi, (ss)->session_id, ## args) struct ss_session { /* link us to hlr->ss_sessions */ @@ -361,13 +361,13 @@ struct ss_session *ss; struct ss_request req = {0}; - LOGP(DMAIN, LOGL_INFO, "%s/0x%08x: Process SS (%s)\n", gsup->imsi, gsup->session_id, + LOGP(DSS, LOGL_DEBUG, "%s/0x%08x: Process SS (%s)\n", gsup->imsi, gsup->session_id, osmo_gsup_session_state_name(gsup->session_state)); /* decode and find out what kind of SS message it is */ if (gsup->ss_info && gsup->ss_info_len) { if (gsm0480_parse_facility_ie(gsup->ss_info, gsup->ss_info_len, &req)) { - LOGP(DMAIN, LOGL_ERROR, "%s/0x%082x: Unable to parse SS request: %s\n", + LOGP(DSS, LOGL_ERROR, "%s/0x%082x: Unable to parse SS request: %s\n", gsup->imsi, gsup->session_id, osmo_hexdump(gsup->ss_info, gsup->ss_info_len)); /* FIXME: Send a Reject component? */ @@ -379,13 +379,13 @@ case OSMO_GSUP_SESSION_STATE_BEGIN: /* Check for overlapping Session ID usage */ if (ss_session_find(hlr, gsup->imsi, gsup->session_id)) { - LOGP(DMAIN, LOGL_ERROR, "%s/0x%08x: BEGIN with non-unique session ID!\n", + LOGP(DSS, LOGL_ERROR, "%s/0x%08x: BEGIN with non-unique session ID!\n", gsup->imsi, gsup->session_id); goto out_err; } ss = ss_session_alloc(hlr, gsup->imsi, gsup->session_id); if (!ss) { - LOGP(DMAIN, LOGL_ERROR, "%s/0x%08x: Unable to allocate SS session\n", + LOGP(DSS, LOGL_ERROR, "%s/0x%08x: Unable to allocate SS session\n", gsup->imsi, gsup->session_id); goto out_err; } @@ -407,7 +407,7 @@ case OSMO_GSUP_SESSION_STATE_CONTINUE: ss = ss_session_find(hlr, gsup->imsi, gsup->session_id); if (!ss) { - LOGP(DMAIN, LOGL_ERROR, "%s/0x%08x: CONTINUE for unknown SS session\n", + LOGP(DSS, LOGL_ERROR, "%s/0x%08x: CONTINUE for unknown SS session\n", gsup->imsi, gsup->session_id); goto out_err; } @@ -422,7 +422,7 @@ case OSMO_GSUP_SESSION_STATE_END: ss = ss_session_find(hlr, gsup->imsi, gsup->session_id); if (!ss) { - LOGP(DMAIN, LOGL_ERROR, "%s/0x%08x: END for unknown SS session\n", + LOGP(DSS, LOGL_ERROR, "%s/0x%08x: END for unknown SS session\n", gsup->imsi, gsup->session_id); goto out_err; } @@ -436,7 +436,7 @@ ss_session_free(ss); break; default: - LOGP(DMAIN, LOGL_ERROR, "%s/0x%08x: Unknown SS State %d\n", gsup->imsi, + LOGP(DSS, LOGL_ERROR, "%s/0x%08x: Unknown SS State %d\n", gsup->imsi, gsup->session_id, gsup->session_state); goto out_err; } @@ -449,7 +449,7 @@ int rx_proc_ss_error(struct osmo_gsup_conn *conn, const struct osmo_gsup_message *gsup) { - LOGP(DMAIN, LOGL_NOTICE, "%s/0x%08x: Process SS ERROR (%s)\n", gsup->imsi, gsup->session_id, + LOGP(DSS, LOGL_NOTICE, "%s/0x%08x: Process SS ERROR (%s)\n", gsup->imsi, gsup->session_id, osmo_gsup_session_state_name(gsup->session_state)); return 0; } diff --git a/src/logging.c b/src/logging.c index f81781d..3fa2a69 100644 --- a/src/logging.c +++ b/src/logging.c @@ -19,6 +19,13 @@ .color = "\033[1;33m", .enabled = 1, .loglevel = LOGL_NOTICE, }, + [DSS] = { + .name = "DSS", + .description = "Supplementary Services", + .color = "\033[1;34m", + .enabled = 1, .loglevel = LOGL_NOTICE, + }, + }; const struct log_info hlr_log_info = { diff --git a/src/logging.h b/src/logging.h index fdaf5d1..ed24075 100644 --- a/src/logging.h +++ b/src/logging.h @@ -7,6 +7,7 @@ DDB, DGSUP, DAUC, + DSS, }; extern const struct log_info hlr_log_info; diff --git a/tests/test_nodes.vty b/tests/test_nodes.vty index 8857860..4badad5 100644 --- a/tests/test_nodes.vty +++ b/tests/test_nodes.vty @@ -111,6 +111,7 @@ logging level main notice logging level db notice logging level auc notice + logging level ss info ... ! line vty -- To view, visit https://gerrit.osmocom.org/10249 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I0ac198a49ba70ea40fea18464325f1925797a6e8 Gerrit-Change-Number: 10249 Gerrit-PatchSet: 4 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 15:26:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 15:26:57 +0000 Subject: Change in osmo-hlr[master]: USSD: fix null-pointer deref in "default-route" vty/config cmd Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10256 Change subject: USSD: fix null-pointer deref in "default-route" vty/config cmd ...................................................................... USSD: fix null-pointer deref in "default-route" vty/config cmd Change-Id: I5ebaea77be6beaf88771fb584477358a4d80a47f --- M src/hlr_vty.c 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/56/10256/1 diff --git a/src/hlr_vty.c b/src/hlr_vty.c index e1349e7..5c359b7 100644 --- a/src/hlr_vty.c +++ b/src/hlr_vty.c @@ -166,7 +166,8 @@ if (g_hlr->euse_default != euse) { vty_out(vty, "Switching default route from %s to %s%s", - g_hlr->euse_default->name, euse->name, VTY_NEWLINE); + g_hlr->euse_default ? g_hlr->euse_default->name : "", + euse->name, VTY_NEWLINE); g_hlr->euse_default = euse; } -- To view, visit https://gerrit.osmocom.org/10256 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I5ebaea77be6beaf88771fb584477358a4d80a47f Gerrit-Change-Number: 10256 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 15:29:07 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 15:29:07 +0000 Subject: Change in osmo-hlr[master]: USSD: Add support for internal USSD handlers In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10251 to look at the new patch set (#6). Change subject: USSD: Add support for internal USSD handlers ...................................................................... USSD: Add support for internal USSD handlers There are some requests that are best served inside the HLR, as it has access to subscriber information such as MSISDN and IMSI. This unfortunately required quite some restructuring of the USSD related structures including the VTY syntax for adding routes. The default config file has been updated to replicate the *#100# built-in behavior of old OsmoNITB. Closes: OS#2566 Change-Id: I1d09fab810a6bb9ab02904de72dbc9e8a414f9f9 --- M doc/examples/osmo-hlr.cfg M src/hlr.c M src/hlr.h M src/hlr_ussd.c M src/hlr_ussd.h M src/hlr_vty.c 6 files changed, 251 insertions(+), 89 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/51/10251/6 -- To view, visit https://gerrit.osmocom.org/10251 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1d09fab810a6bb9ab02904de72dbc9e8a414f9f9 Gerrit-Change-Number: 10251 Gerrit-PatchSet: 6 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 15:29:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 15:29:17 +0000 Subject: Change in osmo-hlr[master]: USSD: fix null-pointer deref in "default-route" vty/config cmd In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10256 ) Change subject: USSD: fix null-pointer deref in "default-route" vty/config cmd ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10256 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5ebaea77be6beaf88771fb584477358a4d80a47f Gerrit-Change-Number: 10256 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 30 Jul 2018 15:29:17 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 15:29:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 15:29:24 +0000 Subject: Change in osmo-hlr[master]: USSD: fix null-pointer deref in "default-route" vty/config cmd In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10256 ) Change subject: USSD: fix null-pointer deref in "default-route" vty/config cmd ...................................................................... USSD: fix null-pointer deref in "default-route" vty/config cmd Change-Id: I5ebaea77be6beaf88771fb584477358a4d80a47f --- M src/hlr_vty.c 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/hlr_vty.c b/src/hlr_vty.c index e1349e7..5c359b7 100644 --- a/src/hlr_vty.c +++ b/src/hlr_vty.c @@ -166,7 +166,8 @@ if (g_hlr->euse_default != euse) { vty_out(vty, "Switching default route from %s to %s%s", - g_hlr->euse_default->name, euse->name, VTY_NEWLINE); + g_hlr->euse_default ? g_hlr->euse_default->name : "", + euse->name, VTY_NEWLINE); g_hlr->euse_default = euse; } -- To view, visit https://gerrit.osmocom.org/10256 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I5ebaea77be6beaf88771fb584477358a4d80a47f Gerrit-Change-Number: 10256 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 15:32:25 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 15:32:25 +0000 Subject: Change in osmo-hlr[master]: Add osmo-euse-demo as minimalistic test of a External USSD (EUSE) han... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10250 to look at the new patch set (#7). Change subject: Add osmo-euse-demo as minimalistic test of a External USSD (EUSE) handler ...................................................................... Add osmo-euse-demo as minimalistic test of a External USSD (EUSE) handler This is a small program which simply echo's the USSD request message it gets in a quote back to the sender. Its purpose is to illustrate how EUSEs can be implemented using libosmo-gsup-client. Change-Id: I3fb8554ca329cb609c591058254117006f665e73 --- M src/Makefile.am A src/osmo-euse-demo.c 2 files changed, 253 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/50/10250/7 -- To view, visit https://gerrit.osmocom.org/10250 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3fb8554ca329cb609c591058254117006f665e73 Gerrit-Change-Number: 10250 Gerrit-PatchSet: 7 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 15:35:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 15:35:16 +0000 Subject: Change in osmo-msc[master]: libmsc/gsm_09_11.c: forward SS/USSD messages to HLR over GSUP In-Reply-To: References: Message-ID: Harald Welte has uploaded a new patch set (#10) to the change originally created by Vadim Yanitskiy. ( https://gerrit.osmocom.org/9658 ) Change subject: libmsc/gsm_09_11.c: forward SS/USSD messages to HLR over GSUP ...................................................................... libmsc/gsm_09_11.c: forward SS/USSD messages to HLR over GSUP In order to be able to support external SS/USSD gateway, we should not terminate the GSM 04.80 messages at OsmoMSC. Instead, we need to follow the GSM TS 09.11 specification, and forward all messages unhandled by OsmoMSC to OsmoHLR over GSUP protocol. This change implements forwarding of MO SS/USSD messages. The forwarding assumes transcoding between GSM 04.80 messages and GSUP messages. The payload of Facility IE is carried 'as is'. As a side-effect, this will disable the osmo-msc internal handler implementing the "*#100#" for obtaining the subscribers own phone number. In order to re-gain this functionality, you will need a modern osmo-hlr (Change-Id I1d09fab810a6bb9ab02904de72dbc9e8a414f9f9) and the following line in your osmo-hlr.cfg: hlr ussd route prefix *#100# internal own-msisdn TTCN-3 test case: I01de73aced6057328a121577a5a83bc2615fb2d4 Change-Id: Ide5f7e350b537db80cd8326fc59c8bf2e01cb68c --- M include/osmocom/msc/gsm_09_11.h M src/libmsc/gsm_04_08.c M src/libmsc/gsm_09_11.c M tests/msc_vlr/msc_vlr_test_ss.c M tests/msc_vlr/msc_vlr_test_ss.err 5 files changed, 225 insertions(+), 63 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/58/9658/10 -- To view, visit https://gerrit.osmocom.org/9658 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ide5f7e350b537db80cd8326fc59c8bf2e01cb68c Gerrit-Change-Number: 9658 Gerrit-PatchSet: 10 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 15:35:34 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 15:35:34 +0000 Subject: Change in osmo-msc[master]: libmsc/gsm_09_11.c: forward SS/USSD messages to HLR over GSUP In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9658 ) Change subject: libmsc/gsm_09_11.c: forward SS/USSD messages to HLR over GSUP ...................................................................... Patch Set 10: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9658 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ide5f7e350b537db80cd8326fc59c8bf2e01cb68c Gerrit-Change-Number: 9658 Gerrit-PatchSet: 10 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 30 Jul 2018 15:35:34 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 15:35:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 15:35:54 +0000 Subject: Change in osmo-hlr[master]: Add osmo-euse-demo as minimalistic test of a External USSD (EUSE) han... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10250 ) Change subject: Add osmo-euse-demo as minimalistic test of a External USSD (EUSE) handler ...................................................................... Patch Set 7: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10250 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3fb8554ca329cb609c591058254117006f665e73 Gerrit-Change-Number: 10250 Gerrit-PatchSet: 7 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 30 Jul 2018 15:35:54 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 15:37:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 15:37:32 +0000 Subject: Change in osmo-hlr[master]: USSD: Add support for internal USSD handlers In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10251 to look at the new patch set (#8). Change subject: USSD: Add support for internal USSD handlers ...................................................................... USSD: Add support for internal USSD handlers There are some requests that are best served inside the HLR, as it has access to subscriber information such as MSISDN and IMSI. This unfortunately required quite some restructuring of the USSD related structures including the VTY syntax for adding routes. The default config file has been updated to replicate the *#100# built-in behavior of old OsmoNITB. Closes: OS#2566 Change-Id: I1d09fab810a6bb9ab02904de72dbc9e8a414f9f9 --- M doc/examples/osmo-hlr.cfg M src/hlr.c M src/hlr.h M src/hlr_ussd.c M src/hlr_ussd.h M src/hlr_vty.c M tests/test_nodes.vty 7 files changed, 256 insertions(+), 89 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/51/10251/8 -- To view, visit https://gerrit.osmocom.org/10251 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1d09fab810a6bb9ab02904de72dbc9e8a414f9f9 Gerrit-Change-Number: 10251 Gerrit-PatchSet: 8 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 15:37:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 15:37:41 +0000 Subject: Change in osmo-hlr[master]: Add osmo-euse-demo as minimalistic test of a External USSD (EUSE) han... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10250 ) Change subject: Add osmo-euse-demo as minimalistic test of a External USSD (EUSE) handler ...................................................................... Add osmo-euse-demo as minimalistic test of a External USSD (EUSE) handler This is a small program which simply echo's the USSD request message it gets in a quote back to the sender. Its purpose is to illustrate how EUSEs can be implemented using libosmo-gsup-client. Change-Id: I3fb8554ca329cb609c591058254117006f665e73 --- M src/Makefile.am A src/osmo-euse-demo.c 2 files changed, 253 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/Makefile.am b/src/Makefile.am index c531ed3..4f167f0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -10,6 +10,9 @@ $(SQLITE3_CFLAGS) \ $(NULL) +AM_CPPFLAGS = -I$(top_srcdir)/include \ + $(NULL) + EXTRA_DIST = \ populate_hlr_db.pl \ db_bootstrap.sed \ @@ -39,6 +42,7 @@ bin_PROGRAMS = \ osmo-hlr \ osmo-hlr-db-tool \ + osmo-euse-demo \ $(NULL) osmo_hlr_SOURCES = \ @@ -98,6 +102,16 @@ $(SQLITE3_LIBS) \ $(NULL) +osmo_euse_demo_SOURCES = \ + osmo-euse-demo.c \ + $(NULL) + +osmo_euse_demo_LDADD = \ + $(top_builddir)/src/gsupclient/libosmo-gsup-client.la \ + $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOGSM_LIBS) \ + $(NULL) + BOOTSTRAP_SQL = $(top_srcdir)/sql/hlr.sql db_bootstrap.h: $(BOOTSTRAP_SQL) $(srcdir)/db_bootstrap.sed diff --git a/src/osmo-euse-demo.c b/src/osmo-euse-demo.c new file mode 100644 index 0000000..4e4ef78 --- /dev/null +++ b/src/osmo-euse-demo.c @@ -0,0 +1,239 @@ +/* osmo-demo-euse: An External USSD Entity (EUSE) for demo purpose */ + +/* (C) 2018 by Harald Welte + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +/* + * This program illustrates how to implement an external USSD application using + * the existing osmocom libraries, particularly libosmocore, libosmogsm and libosmo-gsup-client. + * + * It will receive any MS-originated USSD message that is routed to it via the HLR, and + * simply respond it quoted in the following string: 'You sent "foobar"' (assuming the original + * message was 'foobar'). + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include "logging.h" + +static struct osmo_gsup_client *g_gc; + +/*! send a SS/USSD response to a given imsi/session. + * \param[in] gsupc GSUP client connection through which to send + * \param[in] imsi IMSI of the subscriber + * \param[in] session_id Unique identifier of SS session for which this response is + * \param[in] gsup_msg_type GSUP message type (OSMO_GSUP_MSGT_PROC_SS_{REQUEST,RESULT,ERROR}) + * \param[in] final Is this the final result (true=END) or an intermediate result (false=CONTINUE) + * \param[in] msg Optional binary/BER encoded SS date (for FACILITY IE). Can be NULL. Freed in + * this function call. + */ +static int euse_tx_ss(struct osmo_gsup_client *gsupc, const char *imsi, uint32_t session_id, + enum osmo_gsup_message_type gsup_msg_type, bool final, struct msgb *ss_msg) +{ + struct osmo_gsup_message resp = {0}; + struct msgb *resp_msg; + + switch (gsup_msg_type) { + case OSMO_GSUP_MSGT_PROC_SS_REQUEST: + case OSMO_GSUP_MSGT_PROC_SS_RESULT: + case OSMO_GSUP_MSGT_PROC_SS_ERROR: + break; + default: + msgb_free(ss_msg); + return -EINVAL; + } + + resp.message_type = gsup_msg_type; + OSMO_STRLCPY_ARRAY(resp.imsi, imsi); + if (final) + resp.session_state = OSMO_GSUP_SESSION_STATE_END; + else + resp.session_state = OSMO_GSUP_SESSION_STATE_CONTINUE; + resp.session_id = session_id; + if (ss_msg) { + resp.ss_info = msgb_data(ss_msg); + resp.ss_info_len = msgb_length(ss_msg); + } + + resp_msg = gsm0480_msgb_alloc_name(__func__); + OSMO_ASSERT(resp_msg); + osmo_gsup_encode(resp_msg, &resp); + msgb_free(ss_msg); + return osmo_gsup_client_send(gsupc, resp_msg); +} + +/*! send a SS/USSD reject to a given IMSI/session. + * \param[in] gsupc GSUP client connection through which to send + * \param[in] imsi IMSI of the subscriber + * \param[in] session_id Unique identifier of SS session for which this response is + * \param[in] invoke_id InvokeID of the request + * \param[in] problem_tag Problem code tag (table 3.13) + * \param[in] problem_code Problem code (table 3.14-3.17) + */ +static int euse_tx_ussd_reject(struct osmo_gsup_client *gsupc, const char *imsi, uint32_t session_id, + int invoke_id, uint8_t problem_tag, uint8_t problem_code) +{ + struct msgb *msg = gsm0480_gen_reject(invoke_id, problem_tag, problem_code); + LOGP(DMAIN, LOGL_NOTICE, "Tx %s/0x%08x: Reject(%d, 0x%02x, 0x%02x)\n", imsi, session_id, + invoke_id, problem_tag, problem_code); + OSMO_ASSERT(msg); + return euse_tx_ss(gsupc, imsi, session_id, OSMO_GSUP_MSGT_PROC_SS_RESULT, true, msg); +} + +/*! send a SS/USSD response in 7-bit GSM default alphabet o a given imsi/session. + * \param[in] gsupc GSUP client connection through which to send + * \param[in] imsi IMSI of the subscriber + * \param[in] session_id Unique identifier of SS session for which this response is + * \param[in] final Is this the final result (true=END) or an intermediate result + * (false=CONTINUE) + * \param[in] invoke_id InvokeID of the request + */ +static int euse_tx_ussd_resp_7bit(struct osmo_gsup_client *gsupc, const char *imsi, uint32_t session_id, + bool final, uint8_t invoke_id, const char *text) +{ + struct msgb *ss_msg; + + /* encode response; remove L3 header */ + ss_msg = gsm0480_gen_ussd_resp_7bit(invoke_id, text); + LOGP(DMAIN, LOGL_DEBUG, "Tx %s/0x%08x: USSD Result(%d, %s, '%s')\n", imsi, session_id, + invoke_id, final ? "END" : "CONTINUE", text); + OSMO_ASSERT(ss_msg); + return euse_tx_ss(gsupc, imsi, session_id, OSMO_GSUP_MSGT_PROC_SS_RESULT, final, ss_msg); +} + +static int euse_rx_proc_ss_req(struct osmo_gsup_client *gsupc, const struct osmo_gsup_message *gsup) +{ + char buf[GSM0480_USSD_7BIT_STRING_LEN+1]; + struct ss_request req = {0}; + + if (gsup->ss_info && gsup->ss_info_len) { + if (gsm0480_parse_facility_ie(gsup->ss_info, gsup->ss_info_len, &req)) { + return euse_tx_ussd_reject(gsupc, gsup->imsi, gsup->session_id, -1, + GSM_0480_PROBLEM_CODE_TAG_GENERAL, + GSM_0480_GEN_PROB_CODE_BAD_STRUCTURE); + } + } + + LOGP(DMAIN, LOGL_INFO, "Rx %s/0x%08x: USSD SessionState=%s, OpCode=%s, '%s'\n", gsup->imsi, + gsup->session_id, osmo_gsup_session_state_name(gsup->session_state), + gsm0480_op_code_name(req.opcode), req.ussd_text); + + /* we only handle single-request-response USSD in this demo */ + if (gsup->session_state != OSMO_GSUP_SESSION_STATE_BEGIN) { + return euse_tx_ussd_reject(gsupc, gsup->imsi, gsup->session_id, req.invoke_id, + GSM_0480_PROBLEM_CODE_TAG_GENERAL, + GSM_0480_GEN_PROB_CODE_UNRECOGNISED); + } + + snprintf(buf, sizeof(buf), "You sent \"%s\"", req.ussd_text); + return euse_tx_ussd_resp_7bit(gsupc, gsup->imsi, gsup->session_id, true, req.invoke_id, buf); +} + +static int gsupc_read_cb(struct osmo_gsup_client *gsupc, struct msgb *msg) +{ + struct osmo_gsup_message gsup_msg = {0}; + int rc; + + rc = osmo_gsup_decode(msgb_l2(msg), msgb_l2len(msg), &gsup_msg); + if (rc < 0) { + LOGP(DMAIN, LOGL_ERROR, "Error decoding GSUP: %s\n", msgb_hexdump(msg)); + return rc; + } + DEBUGP(DMAIN, "Rx GSUP %s: %s\n", osmo_gsup_message_type_name(gsup_msg.message_type), + msgb_hexdump(msg)); + + switch (gsup_msg.message_type) { + case OSMO_GSUP_MSGT_PROC_SS_REQUEST: + case OSMO_GSUP_MSGT_PROC_SS_RESULT: + euse_rx_proc_ss_req(gsupc, &gsup_msg); + break; + case OSMO_GSUP_MSGT_PROC_SS_ERROR: + break; + default: + LOGP(DMAIN, LOGL_DEBUG, "Unhandled GSUP message type %s\n", + osmo_gsup_message_type_name(gsup_msg.message_type)); + break; + } + + msgb_free(msg); + return 0; +} + + +static struct log_info_cat default_categories[] = { + [DMAIN] = { + .name = "DMAIN", + .description = "Main Program", + .enabled = 1, .loglevel = LOGL_DEBUG, + }, +}; + +static const struct log_info gsup_log_info = { + .cat = default_categories, + .num_cat = ARRAY_SIZE(default_categories), +}; + +static void print_usage(void) +{ + printf("Usage: osmo-euse-demo [hlr-ip [hlr-gsup-port]]\n"); +} + +int main(int argc, char **argv) +{ + char *server_host = "127.0.0.1"; + uint16_t server_port = OSMO_GSUP_PORT; + void *ctx = talloc_named_const(NULL, 0, "demo-euse"); + + osmo_init_logging2(ctx, &gsup_log_info); + + printf("argc=%d\n", argc); + + if (argc > 1) { + if (!strcmp(argv[1], "--help") || !strcmp(argv[1], "-h")) { + print_usage(); + exit(0); + } else + server_host = argv[1]; + } + if (argc > 2) + server_port = atoi(argv[2]); + + g_gc = osmo_gsup_client_create(ctx, "EUSE-foobar", server_host, server_port, gsupc_read_cb, NULL); + + while (1) { + osmo_select_main(0); + } + + exit(0); +} + -- To view, visit https://gerrit.osmocom.org/10250 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I3fb8554ca329cb609c591058254117006f665e73 Gerrit-Change-Number: 10250 Gerrit-PatchSet: 7 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 15:37:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 15:37:55 +0000 Subject: Change in osmo-hlr[master]: USSD: Add support for internal USSD handlers In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10251 ) Change subject: USSD: Add support for internal USSD handlers ...................................................................... Patch Set 8: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10251 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1d09fab810a6bb9ab02904de72dbc9e8a414f9f9 Gerrit-Change-Number: 10251 Gerrit-PatchSet: 8 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 30 Jul 2018 15:37:55 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 15:43:30 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 15:43:30 +0000 Subject: Change in osmo-hlr[master]: USSD: Add support for internal USSD handlers In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10251 to look at the new patch set (#9). Change subject: USSD: Add support for internal USSD handlers ...................................................................... USSD: Add support for internal USSD handlers There are some requests that are best served inside the HLR, as it has access to subscriber information such as MSISDN and IMSI. This unfortunately required quite some restructuring of the USSD related structures including the VTY syntax for adding routes. The default config file has been updated to replicate the *#100# built-in behavior of old OsmoNITB. Closes: OS#2566 Change-Id: I1d09fab810a6bb9ab02904de72dbc9e8a414f9f9 --- M doc/examples/osmo-hlr.cfg M src/hlr.c M src/hlr.h M src/hlr_ussd.c M src/hlr_ussd.h M src/hlr_vty.c M tests/test_nodes.vty 7 files changed, 257 insertions(+), 89 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/51/10251/9 -- To view, visit https://gerrit.osmocom.org/10251 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1d09fab810a6bb9ab02904de72dbc9e8a414f9f9 Gerrit-Change-Number: 10251 Gerrit-PatchSet: 9 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 15:44:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 15:44:47 +0000 Subject: Change in osmo-hlr[master]: USSD: Add support for internal USSD handlers In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10251 ) Change subject: USSD: Add support for internal USSD handlers ...................................................................... Patch Set 9: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10251 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1d09fab810a6bb9ab02904de72dbc9e8a414f9f9 Gerrit-Change-Number: 10251 Gerrit-PatchSet: 9 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 30 Jul 2018 15:44:47 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 15:48:25 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 15:48:25 +0000 Subject: Change in osmo-hlr[master]: USSD: Add support for internal USSD handlers In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10251 ) Change subject: USSD: Add support for internal USSD handlers ...................................................................... USSD: Add support for internal USSD handlers There are some requests that are best served inside the HLR, as it has access to subscriber information such as MSISDN and IMSI. This unfortunately required quite some restructuring of the USSD related structures including the VTY syntax for adding routes. The default config file has been updated to replicate the *#100# built-in behavior of old OsmoNITB. Closes: OS#2566 Change-Id: I1d09fab810a6bb9ab02904de72dbc9e8a414f9f9 --- M doc/examples/osmo-hlr.cfg M src/hlr.c M src/hlr.h M src/hlr_ussd.c M src/hlr_ussd.h M src/hlr_vty.c M tests/test_nodes.vty 7 files changed, 257 insertions(+), 89 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/doc/examples/osmo-hlr.cfg b/doc/examples/osmo-hlr.cfg index ebc22ec..35d942d 100644 --- a/doc/examples/osmo-hlr.cfg +++ b/doc/examples/osmo-hlr.cfg @@ -21,3 +21,4 @@ hlr gsup bind ip 127.0.0.1 + ussd route prefix *#100# internal own-msisdn diff --git a/src/hlr.c b/src/hlr.c index bcf620d..df48a99 100644 --- a/src/hlr.c +++ b/src/hlr.c @@ -568,7 +568,9 @@ g_hlr = talloc_zero(hlr_ctx, struct hlr); INIT_LLIST_HEAD(&g_hlr->euse_list); + INIT_LLIST_HEAD(&g_hlr->iuse_list); INIT_LLIST_HEAD(&g_hlr->ss_sessions); + INIT_LLIST_HEAD(&g_hlr->ussd_routes); rc = osmo_init_logging2(hlr_ctx, &hlr_log_info); if (rc < 0) { diff --git a/src/hlr.h b/src/hlr.h index 7112352..315c3dd 100644 --- a/src/hlr.h +++ b/src/hlr.h @@ -43,6 +43,9 @@ struct llist_head euse_list; struct hlr_euse *euse_default; + struct llist_head iuse_list; + + struct llist_head ussd_routes; struct llist_head ss_sessions; }; diff --git a/src/hlr_ussd.c b/src/hlr_ussd.c index d23debf..f9399d2 100644 --- a/src/hlr_ussd.c +++ b/src/hlr_ussd.c @@ -27,6 +27,7 @@ #include #include #include +#include #include "hlr.h" #include "hlr_ussd.h" @@ -58,7 +59,6 @@ euse = talloc_zero(hlr, struct hlr_euse); euse->name = talloc_strdup(euse, name); euse->hlr = hlr; - INIT_LLIST_HEAD(&euse->routes); llist_add_tail(&euse->list, &hlr->euse_list); return euse; @@ -71,54 +71,68 @@ } -struct hlr_euse_route *euse_route_find(struct hlr_euse *euse, const char *prefix) +struct hlr_ussd_route *ussd_route_find_prefix(struct hlr *hlr, const char *prefix) { - struct hlr_euse_route *rt; + struct hlr_ussd_route *rt; - llist_for_each_entry(rt, &euse->routes, list) { + llist_for_each_entry(rt, &hlr->ussd_routes, list) { if (!strcmp(rt->prefix, prefix)) return rt; } return NULL; } -struct hlr_euse_route *euse_route_prefix_alloc(struct hlr_euse *euse, const char *prefix) +struct hlr_ussd_route *ussd_route_prefix_alloc_int(struct hlr *hlr, const char *prefix, + const struct hlr_iuse *iuse) { - struct hlr_euse_route *rt; + struct hlr_ussd_route *rt; - if (euse_route_find(euse, prefix)) + if (ussd_route_find_prefix(hlr, prefix)) return NULL; - rt = talloc_zero(euse, struct hlr_euse_route); + rt = talloc_zero(hlr, struct hlr_ussd_route); rt->prefix = talloc_strdup(rt, prefix); - rt->euse = euse; - llist_add_tail(&rt->list, &euse->routes); + rt->u.iuse = iuse; + llist_add_tail(&rt->list, &hlr->ussd_routes); return rt; } -void euse_route_del(struct hlr_euse_route *rt) +struct hlr_ussd_route *ussd_route_prefix_alloc_ext(struct hlr *hlr, const char *prefix, + struct hlr_euse *euse) +{ + struct hlr_ussd_route *rt; + + if (ussd_route_find_prefix(hlr, prefix)) + return NULL; + + rt = talloc_zero(hlr, struct hlr_ussd_route); + rt->prefix = talloc_strdup(rt, prefix); + rt->is_external = true; + rt->u.euse = euse; + llist_add_tail(&rt->list, &hlr->ussd_routes); + + return rt; +} + +void ussd_route_del(struct hlr_ussd_route *rt) { llist_del(&rt->list); talloc_free(rt); } -struct hlr_euse *ussd_euse_find_7bit_gsm(struct hlr *hlr, const char *ussd_code) +static struct hlr_ussd_route *ussd_route_lookup_7bit(struct hlr *hlr, const char *ussd_code) { - struct hlr_euse *euse; - - llist_for_each_entry(euse, &hlr->euse_list, list) { - struct hlr_euse_route *rt; - llist_for_each_entry(rt, &euse->routes, list) { - if (!strncmp(ussd_code, rt->prefix, strlen(rt->prefix))) { - LOGP(DSS, LOGL_DEBUG, "Found EUSE %s (prefix %s) for USSD Code '%s'\n", - rt->euse->name, rt->prefix, ussd_code); - return rt->euse; - } + struct hlr_ussd_route *rt; + llist_for_each_entry(rt, &hlr->ussd_routes, list) { + if (!strncmp(ussd_code, rt->prefix, strlen(rt->prefix))) { + LOGP(DSS, LOGL_DEBUG, "Found EUSE %s (prefix %s) for USSD Code '%s'\n", + rt->u.euse->name, rt->prefix, ussd_code); + return rt; } } - LOGP(DSS, LOGL_DEBUG, "Could not find Route/EUSE for USSD Code '%s'\n", ussd_code); + LOGP(DSS, LOGL_DEBUG, "Could not find Route for USSD Code '%s'\n", ussd_code); return NULL; } @@ -141,8 +155,15 @@ /* time-out when we will delete the session */ struct osmo_timer_list timeout; - /* external USSD Entity responsible for this session */ - struct hlr_euse *euse; + /* is this USSD for an external handler (EUSE): true */ + bool is_external; + union { + /* external USSD Entity responsible for this session */ + struct hlr_euse *euse; + /* internal USSD Entity responsible for this session */ + const struct hlr_iuse *iuse; + } u; + /* we don't keep a pointer to the osmo_gsup_{route,conn} towards the MSC/VLR here, * as this might change during inter-VLR hand-over, and we simply look-up the serving MSC/VLR * every time we receive an USSD component from the EUSE */ @@ -247,6 +268,79 @@ return ss_tx_to_ms(ss, OSMO_GSUP_MSGT_PROC_SS_RESULT, true, msg); } +static int ss_tx_ussd_7bit(struct ss_session *ss, bool final, uint8_t invoke_id, const char *text) +{ + struct msgb *msg = gsm0480_gen_ussd_resp_7bit(invoke_id, text); + LOGPSS(ss, LOGL_INFO, "Tx USSD '%s'\n", text); + OSMO_ASSERT(msg); + return ss_tx_to_ms(ss, OSMO_GSUP_MSGT_PROC_SS_RESULT, final, msg); +} + +/*********************************************************************** + * Internal USSD Handlers + ***********************************************************************/ + +#include "db.h" + +static int handle_ussd_own_msisdn(struct osmo_gsup_conn *conn, struct ss_session *ss, + const struct osmo_gsup_message *gsup, const struct ss_request *req) +{ + struct hlr_subscriber subscr; + char buf[GSM0480_USSD_7BIT_STRING_LEN+1]; + int rc; + + rc = db_subscr_get_by_imsi(g_hlr->dbc, ss->imsi, &subscr); + switch (rc) { + case 0: + if (strlen(subscr.msisdn) == 0) + snprintf(buf, sizeof(buf), "You have no MSISDN!"); + else + snprintf(buf, sizeof(buf), "Your extension is %s\r", subscr.msisdn); + ss_tx_ussd_7bit(ss, true, req->invoke_id, buf); + break; + case -ENOENT: + ss_tx_error(ss, true, GSM0480_ERR_CODE_UNKNOWN_SUBSCRIBER); + break; + case -EIO: + default: + ss_tx_error(ss, true, GSM0480_ERR_CODE_SYSTEM_FAILURE); + break; + } + return 0; +} + +static int handle_ussd_own_imsi(struct osmo_gsup_conn *conn, struct ss_session *ss, + const struct osmo_gsup_message *gsup, const struct ss_request *req) +{ + char buf[GSM0480_USSD_7BIT_STRING_LEN+1]; + snprintf(buf, sizeof(buf), "Your IMSI is %s!\n", ss->imsi); + ss_tx_ussd_7bit(ss, true, req->invoke_id, buf); + return 0; +} + + +static const struct hlr_iuse hlr_iuses[] = { + { + .name = "own-msisdn", + .handle_ussd = handle_ussd_own_msisdn, + }, + { + .name = "own-imsi", + .handle_ussd = handle_ussd_own_imsi, + }, +}; + +const struct hlr_iuse *iuse_find(const char *name) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(hlr_iuses); i++) { + const struct hlr_iuse *iuse = &hlr_iuses[i]; + if (!strcmp(name, iuse->name)) + return iuse; + } + return NULL; +} /*********************************************************************** @@ -307,6 +401,7 @@ return 0; } +/* Handle a USSD GSUP message for a given SS Session received from VLR or EUSE */ static int handle_ussd(struct osmo_gsup_conn *conn, struct ss_session *ss, const struct osmo_gsup_message *gsup, const struct ss_request *req) { @@ -318,8 +413,7 @@ gsm0480_comp_type_name(comp_type), gsm0480_op_code_name(req->opcode), req->ussd_text); - - if (!ss->euse) { + if ((ss->is_external && !ss->u.euse) || !ss->u.iuse) { LOGPSS(ss, LOGL_NOTICE, "USSD for unknown code '%s'\n", req->ussd_text); ss_tx_error(ss, req->invoke_id, GSM0480_ERR_CODE_SS_NOT_AVAILABLE); return 0; @@ -333,19 +427,25 @@ /* FIXME: resolve this based on the database vlr_addr */ osmo_gsup_addr_send(conn->server, (uint8_t *)"MSC-00-00-00-00-00-00", 22, msg_out); } else { - /* Received from VLR, Forward to EUSE */ - char addr[128]; - strcpy(addr, "EUSE-"); - osmo_strlcpy(addr+5, ss->euse->name, sizeof(addr)-5); - conn = gsup_route_find(conn->server, (uint8_t *)addr, strlen(addr)+1); - if (!conn) { - LOGPSS(ss, LOGL_ERROR, "Cannot find conn for EUSE %s\n", addr); - ss_tx_error(ss, req->invoke_id, GSM0480_ERR_CODE_SYSTEM_FAILURE); + /* Received from VLR (MS) */ + if (ss->is_external) { + /* Forward to EUSE */ + char addr[128]; + strcpy(addr, "EUSE-"); + osmo_strlcpy(addr+5, ss->u.euse->name, sizeof(addr)-5); + conn = gsup_route_find(conn->server, (uint8_t *)addr, strlen(addr)+1); + if (!conn) { + LOGPSS(ss, LOGL_ERROR, "Cannot find conn for EUSE %s\n", addr); + ss_tx_error(ss, req->invoke_id, GSM0480_ERR_CODE_SYSTEM_FAILURE); + } else { + msg_out = msgb_alloc_headroom(1024+16, 16, "GSUP USSD FW"); + OSMO_ASSERT(msg_out); + osmo_gsup_encode(msg_out, gsup); + osmo_gsup_conn_send(conn, msg_out); + } } else { - msg_out = msgb_alloc_headroom(1024+16, 16, "GSUP USSD FW"); - OSMO_ASSERT(msg_out); - osmo_gsup_encode(msg_out, gsup); - osmo_gsup_conn_send(conn, msg_out); + /* Handle internally */ + ss->u.iuse->handle_ussd(conn, ss, gsup, req); } } @@ -392,10 +492,20 @@ if (ss_op_is_ussd(req.opcode)) { if (conn_is_euse(conn)) { /* EUSE->VLR: MT USSD. EUSE is known ('conn'), VLR is to be resolved */ - ss->euse = euse_by_conn(conn); + ss->u.euse = euse_by_conn(conn); } else { /* VLR->EUSE: MO USSD. VLR is known ('conn'), EUSE is to be resolved */ - ss->euse = ussd_euse_find_7bit_gsm(hlr, (const char *) req.ussd_text); + struct hlr_ussd_route *rt; + rt = ussd_route_lookup_7bit(hlr, (const char *) req.ussd_text); + if (rt) { + if (rt->is_external) { + ss->is_external = true; + ss->u.euse = rt->u.euse; + } else if (rt) { + ss->is_external = false; + ss->u.iuse = rt->u.iuse; + } + } } /* dispatch unstructured SS to routing */ handle_ussd(conn, ss, gsup, &req); diff --git a/src/hlr_ussd.h b/src/hlr_ussd.h index 433a7f2..d1b9fe0 100644 --- a/src/hlr_ussd.h +++ b/src/hlr_ussd.h @@ -5,11 +5,15 @@ struct osmo_gsup_conn; -struct hlr_euse_route { - /* hlr_euse.routes */ +struct hlr_ussd_route { + /* g_hlr.routes */ struct llist_head list; - struct hlr_euse *euse; const char *prefix; + bool is_external; + union { + struct hlr_euse *euse; + const struct hlr_iuse *iuse; + } u; }; struct hlr_euse { @@ -20,21 +24,34 @@ const char *name; /* human-readable description */ const char *description; - /* list of hlr_euse_route */ - struct llist_head routes; /* GSUP connection to the EUSE, if any */ struct osmo_gsup_conn *conn; }; - struct hlr_euse *euse_find(struct hlr *hlr, const char *name); struct hlr_euse *euse_alloc(struct hlr *hlr, const char *name); void euse_del(struct hlr_euse *euse); -struct hlr_euse_route *euse_route_find(struct hlr_euse *euse, const char *prefix); -struct hlr_euse_route *euse_route_prefix_alloc(struct hlr_euse *euse, const char *prefix); -void euse_route_del(struct hlr_euse_route *rt); +const struct hlr_iuse *iuse_find(const char *name); + +struct hlr_ussd_route *ussd_route_find_prefix(struct hlr *hlr, const char *prefix); +struct hlr_ussd_route *ussd_route_prefix_alloc_int(struct hlr *hlr, const char *prefix, + const struct hlr_iuse *iuse); +struct hlr_ussd_route *ussd_route_prefix_alloc_ext(struct hlr *hlr, const char *prefix, + struct hlr_euse *euse); +void ussd_route_del(struct hlr_ussd_route *rt); int rx_proc_ss_req(struct osmo_gsup_conn *conn, const struct osmo_gsup_message *gsup); int rx_proc_ss_error(struct osmo_gsup_conn *conn, const struct osmo_gsup_message *gsup); + +struct ss_session; +struct ss_request; + +/* Internal USSD Handler */ +struct hlr_iuse { + const char *name; + /* call-back to be called for any incoming USSD messages for this IUSE */ + int (*handle_ussd)(struct osmo_gsup_conn *conn, struct ss_session *ss, + const struct osmo_gsup_message *gsup, const struct ss_request *req); +}; diff --git a/src/hlr_vty.c b/src/hlr_vty.c index 5c359b7..9532a03 100644 --- a/src/hlr_vty.c +++ b/src/hlr_vty.c @@ -32,6 +32,7 @@ #include #include +#include "hlr.h" #include "hlr_vty.h" #include "hlr_vty_subscr.h" #include "gsup_server.h" @@ -122,47 +123,77 @@ } /*********************************************************************** - * External USSD Entity + * USSD Entity ***********************************************************************/ #include "hlr_ussd.h" -DEFUN(cfg_euse_route_pfx, cfg_euse_route_pfx_cmd, - "route prefix PREFIX", - "") -{ - struct hlr_euse *euse = vty->index; - struct hlr_euse_route *rt = euse_route_find(euse, argv[0]); +#define USSD_STR "USSD Configuration\n" +#define UROUTE_STR "Routing Configuration\n" +#define PREFIX_STR "Prefix-Matching Route\n" "USSD Prefix\n" +#define INT_CHOICE "(own-msisdn|own-imsi)" +#define INT_STR "Internal USSD Handler\n" \ + "Respond with subscribers' own MSISDN\n" \ + "Respond with subscribers' own IMSI\n" + +#define EXT_STR "External USSD Handler\n" \ + "Name of External USSD Handler (IPA CCM ID)\n" + +DEFUN(cfg_ussd_route_pfx_int, cfg_ussd_route_pfx_int_cmd, + "ussd route prefix PREFIX internal " INT_CHOICE, + USSD_STR UROUTE_STR PREFIX_STR INT_STR) +{ + const struct hlr_iuse *iuse = iuse_find(argv[1]); + struct hlr_ussd_route *rt = ussd_route_find_prefix(g_hlr, argv[0]); if (rt) { vty_out(vty, "%% Cannot add [another?] route for prefix %s%s", argv[0], VTY_NEWLINE); return CMD_WARNING; } - euse_route_prefix_alloc(euse, argv[0]); + ussd_route_prefix_alloc_int(g_hlr, argv[0], iuse); return CMD_SUCCESS; } -DEFUN(cfg_euse_no_route_pfx, cfg_euse_no_route_pfx_cmd, - "no route prefix PREFIX", - NO_STR "") +DEFUN(cfg_ussd_route_pfx_ext, cfg_ussd_route_pfx_ext_cmd, + "ussd route prefix PREFIX external EUSE", + USSD_STR UROUTE_STR PREFIX_STR EXT_STR) { - struct hlr_euse *euse = vty->index; - struct hlr_euse_route *rt = euse_route_find(euse, argv[0]); + struct hlr_euse *euse = euse_find(g_hlr, argv[1]); + struct hlr_ussd_route *rt = ussd_route_find_prefix(g_hlr, argv[0]); + if (rt) { + vty_out(vty, "%% Cannot add [another?] route for prefix %s%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + if (!euse) { + vty_out(vty, "%% Cannot find euse '%s'%s", argv[1], VTY_NEWLINE); + return CMD_WARNING; + } + ussd_route_prefix_alloc_ext(g_hlr, argv[0], euse); + + return CMD_SUCCESS; +} + +DEFUN(cfg_ussd_no_route_pfx, cfg_ussd_no_route_pfx_cmd, + "no ussd route prefix PREFIX", + NO_STR USSD_STR UROUTE_STR PREFIX_STR) +{ + struct hlr_ussd_route *rt = ussd_route_find_prefix(g_hlr, argv[0]); if (!rt) { vty_out(vty, "%% Cannot find route for prefix %s%s", argv[0], VTY_NEWLINE); return CMD_WARNING; } - euse_route_del(rt); + ussd_route_del(rt); return CMD_SUCCESS; } -DEFUN(cfg_euse_defaultroute, cfg_euse_defaultroute_cmd, - "default-route", - "Set this EUSE as default-route for all USSD to unknown destinations\n") +DEFUN(cfg_ussd_defaultroute, cfg_ussd_defaultroute_cmd, + "ussd default-route external EUSE", + USSD_STR "Configure default-route for all USSD to unknown destinations\n" + EXT_STR) { - struct hlr_euse *euse = vty->index; + struct hlr_euse *euse = euse_find(g_hlr, argv[0]); if (g_hlr->euse_default != euse) { vty_out(vty, "Switching default route from %s to %s%s", @@ -174,16 +205,10 @@ return CMD_SUCCESS; } -DEFUN(cfg_euse_no_defaultroute, cfg_euse_no_defaultroute_cmd, - "no default-route", - NO_STR "Remove this EUSE as default-route for all USSD to unknown destinations\n") +DEFUN(cfg_ussd_no_defaultroute, cfg_ussd_no_defaultroute_cmd, + "no ussd default-route", + NO_STR USSD_STR "Remove the default-route for all USSD to unknown destinations\n") { - struct hlr_euse *euse = vty->index; - - if (g_hlr->euse_default != euse) { - vty_out(vty, "%% Current EUSE is no default route, cannot delete it%s", VTY_NEWLINE); - return CMD_WARNING; - } g_hlr->euse_default = NULL; return CMD_SUCCESS; @@ -236,24 +261,27 @@ static void dump_one_euse(struct vty *vty, struct hlr_euse *euse) { - struct hlr_euse_route *er; - vty_out(vty, " euse %s%s", euse->name, VTY_NEWLINE); - - llist_for_each_entry(er, &euse->routes, list) - vty_out(vty, " route prefix %s%s", er->prefix, VTY_NEWLINE); - - if (g_hlr->euse_default == euse) - vty_out(vty, " default-route%s", VTY_NEWLINE); } static int config_write_euse(struct vty *vty) { struct hlr_euse *euse; + struct hlr_ussd_route *rt; llist_for_each_entry(euse, &g_hlr->euse_list, list) dump_one_euse(vty, euse); + llist_for_each_entry(rt, &g_hlr->ussd_routes, list) { + vty_out(vty, " ussd route prefix %s %s %s%s", rt->prefix, + rt->is_external ? "external" : "internal", + rt->is_external ? rt->u.euse->name : rt->u.iuse->name, + VTY_NEWLINE); + } + + if (g_hlr->euse_default) + vty_out(vty, " ussd default-route external %s%s", g_hlr->euse_default->name, VTY_NEWLINE); + return 0; } @@ -314,10 +342,11 @@ install_element(HLR_NODE, &cfg_euse_cmd); install_element(HLR_NODE, &cfg_no_euse_cmd); install_node(&euse_node, config_write_euse); - install_element(EUSE_NODE, &cfg_euse_route_pfx_cmd); - install_element(EUSE_NODE, &cfg_euse_no_route_pfx_cmd); - install_element(EUSE_NODE, &cfg_euse_defaultroute_cmd); - install_element(EUSE_NODE, &cfg_euse_no_defaultroute_cmd); + install_element(HLR_NODE, &cfg_ussd_route_pfx_int_cmd); + install_element(HLR_NODE, &cfg_ussd_route_pfx_ext_cmd); + install_element(HLR_NODE, &cfg_ussd_no_route_pfx_cmd); + install_element(HLR_NODE, &cfg_ussd_defaultroute_cmd); + install_element(HLR_NODE, &cfg_ussd_no_defaultroute_cmd); hlr_vty_subscriber_init(); } diff --git a/tests/test_nodes.vty b/tests/test_nodes.vty index 4badad5..58f5c61 100644 --- a/tests/test_nodes.vty +++ b/tests/test_nodes.vty @@ -72,6 +72,11 @@ gsup euse NAME no euse NAME + ussd route prefix PREFIX internal (own-msisdn|own-imsi) + ussd route prefix PREFIX external EUSE + no ussd route prefix PREFIX + ussd default-route external EUSE + no ussd default-route OsmoHLR(config-hlr)# gsup OsmoHLR(config-hlr-gsup)# list @@ -122,4 +127,5 @@ hlr gsup bind ip 127.0.0.1 + ussd route prefix *#100# internal own-msisdn end -- To view, visit https://gerrit.osmocom.org/10251 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I1d09fab810a6bb9ab02904de72dbc9e8a414f9f9 Gerrit-Change-Number: 10251 Gerrit-PatchSet: 9 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 16:00:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 16:00:16 +0000 Subject: Change in osmo-msc[master]: migrate to oap_client in libosmogsm Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10257 Change subject: migrate to oap_client in libosmogsm ...................................................................... migrate to oap_client in libosmogsm libosmogsm in libosmocore.git from Change-Id Ie36729996abd30b84d1c30a09f62ebc6a9794950 onwards contains oap_client.c, so we don't need our local copy here in this repo anymore. Change-Id: Ib6496c35d0ce6eb531e97129dc45a9f68e503b34 Requires: libosmocore.git Change-Id Ie36729996abd30b84d1c30a09f62ebc6a9794950 --- M include/osmocom/msc/Makefile.am M include/osmocom/msc/gsup_client.h D include/osmocom/msc/oap_client.h M src/libgsupclient/Makefile.am M src/libgsupclient/gsup_client.c D src/libgsupclient/oap_client.c M tests/msc_vlr/msc_vlr_tests.c 7 files changed, 11 insertions(+), 375 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/57/10257/1 diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am index 5be51ea..b1a4810 100644 --- a/include/osmocom/msc/Makefile.am +++ b/include/osmocom/msc/Makefile.am @@ -21,7 +21,6 @@ mncc_int.h \ msc_ifaces.h \ msc_mgcp.h \ - oap_client.h \ openbscdefines.h \ a_reset.h \ osmo_msc.h \ diff --git a/include/osmocom/msc/gsup_client.h b/include/osmocom/msc/gsup_client.h index 59e650f..2f6170b 100644 --- a/include/osmocom/msc/gsup_client.h +++ b/include/osmocom/msc/gsup_client.h @@ -23,7 +23,7 @@ #include -#include +#include /* a loss of GSUP between MSC and HLR is considered quite serious, let's try to recover as quickly as * possible. Even one new connection attempt per second should be quite acceptable until the link is @@ -46,7 +46,7 @@ gsup_client_read_cb_t read_cb; void *data; - struct oap_client_state oap_state; + struct osmo_oap_client_state oap_state; struct osmo_timer_list ping_timer; struct osmo_timer_list connect_timer; @@ -59,7 +59,7 @@ const char *ip_addr, unsigned int tcp_port, gsup_client_read_cb_t read_cb, - struct oap_client_config *oapc_config); + struct osmo_oap_client_config *oapc_config); void gsup_client_destroy(struct gsup_client *gsupc); int gsup_client_send(struct gsup_client *gsupc, struct msgb *msg); diff --git a/include/osmocom/msc/oap_client.h b/include/osmocom/msc/oap_client.h deleted file mode 100644 index 80c86d5..0000000 --- a/include/osmocom/msc/oap_client.h +++ /dev/null @@ -1,82 +0,0 @@ -/* Osmocom Authentication Protocol API */ - -/* (C) 2015 by Sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * Author: Neels Hofmeyr - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#pragma once - -#include - -struct msgb; -struct osmo_oap_message; - -/* This is the config part for vty. It is essentially copied in - * oap_client_state, where values are copied over once the config is - * considered valid. */ -struct oap_client_config { - uint16_t client_id; - int secret_k_present; - uint8_t secret_k[16]; - int secret_opc_present; - uint8_t secret_opc[16]; -}; - -/* The runtime state of the OAP client. client_id and the secrets are in fact - * duplicated from oap_client_config, so that a separate validation of the - * config data is possible, and so that only a struct oap_client_state* is - * passed around. */ -struct oap_client_state { - enum { - OAP_UNINITIALIZED = 0, /* just allocated. */ - OAP_DISABLED, /* disabled by config. */ - OAP_INITIALIZED, /* enabled, config is valid. */ - OAP_REQUESTED_CHALLENGE, - OAP_SENT_CHALLENGE_RESULT, - OAP_REGISTERED - } state; - uint16_t client_id; - uint8_t secret_k[16]; - uint8_t secret_opc[16]; - int registration_failures; -}; - -/* From config, initialize state. Return 0 on success. */ -int oap_client_init(struct oap_client_config *config, - struct oap_client_state *state); - -/* Construct an OAP registration message and return in *msg_tx. Use - * state->client_id and update state->state. - * Return 0 on success, or a negative value on error. - * If an error is returned, *msg_tx is guaranteed to be NULL. */ -int oap_client_register(struct oap_client_state *state, struct msgb **msg_tx); - -/* Decode and act on a received OAP message msg_rx. Update state->state. If a - * non-NULL pointer is returned in *msg_tx, that msgb should be sent to the OAP - * server (and freed) by the caller. The received msg_rx is not freed. - * Return 0 on success, or a negative value on error. - * If an error is returned, *msg_tx is guaranteed to be NULL. */ -int oap_client_handle(struct oap_client_state *state, - const struct msgb *msg_rx, struct msgb **msg_tx); - -/* Allocate a msgb and in it, return the encoded oap_client_msg. Return - * NULL on error. (Like oap_client_encode(), but also allocates a msgb.) - * About the name: the idea is do_something(oap_client_encoded(my_struct)) - */ -struct msgb *oap_client_encoded(const struct osmo_oap_message *oap_client_msg); diff --git a/src/libgsupclient/Makefile.am b/src/libgsupclient/Makefile.am index a33fb38..6381687 100644 --- a/src/libgsupclient/Makefile.am +++ b/src/libgsupclient/Makefile.am @@ -19,7 +19,6 @@ libgsupclient_a_SOURCES = \ gsup_client.c \ - oap_client.c \ $(NULL) noinst_PROGRAMS = \ diff --git a/src/libgsupclient/gsup_client.c b/src/libgsupclient/gsup_client.c index 1f395ee..39dc181 100644 --- a/src/libgsupclient/gsup_client.c +++ b/src/libgsupclient/gsup_client.c @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -114,7 +115,7 @@ { struct msgb *msg_tx; int rc; - rc = oap_client_register(&gsupc->oap_state, &msg_tx); + rc = osmo_oap_client_register(&gsupc->oap_state, &msg_tx); if ((rc < 0) || (!msg_tx)) { LOGP(DLGSUP, LOGL_ERROR, "GSUP OAP set up, but cannot register.\n"); @@ -136,7 +137,7 @@ if (up) { start_test_procedure(gsupc); - if (gsupc->oap_state.state == OAP_INITIALIZED) + if (gsupc->oap_state.state == OSMO_OAP_INITIALIZED) gsup_client_oap_register(gsupc); osmo_timer_del(&gsupc->connect_timer); @@ -154,7 +155,7 @@ struct msgb *msg_tx; /* If the oap_state is disabled, this will reject the messages. */ - rc = oap_client_handle(&gsupc->oap_state, msg_rx, &msg_tx); + rc = osmo_oap_client_handle(&gsupc->oap_state, msg_rx, &msg_tx); msgb_free(msg_rx); if (rc < 0) return rc; @@ -268,7 +269,7 @@ const char *ip_addr, unsigned int tcp_port, gsup_client_read_cb_t read_cb, - struct oap_client_config *oapc_config) + struct osmo_oap_client_config *oapc_config) { struct gsup_client *gsupc; int rc; @@ -283,7 +284,7 @@ OSMO_ASSERT(gsupc->unit_name); /* a NULL oapc_config will mark oap_state disabled. */ - rc = oap_client_init(oapc_config, &gsupc->oap_state); + rc = osmo_oap_client_init(oapc_config, &gsupc->oap_state); if (rc != 0) goto failed; diff --git a/src/libgsupclient/oap_client.c b/src/libgsupclient/oap_client.c deleted file mode 100644 index 137515a..0000000 --- a/src/libgsupclient/oap_client.c +++ /dev/null @@ -1,281 +0,0 @@ -/* Osmocom Authentication Protocol API */ - -/* (C) 2015 by Sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * Author: Neels Hofmeyr - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include - -#include -#include -#include -#include - -#include -#include - -int oap_client_init(struct oap_client_config *config, - struct oap_client_state *state) -{ - OSMO_ASSERT(state->state == OAP_UNINITIALIZED); - - if (!config) - goto disable; - - if (config->client_id == 0) - goto disable; - - if (config->secret_k_present == 0) { - LOGP(DLOAP, LOGL_NOTICE, "OAP: client ID set, but secret K missing.\n"); - goto disable; - } - - if (config->secret_opc_present == 0) { - LOGP(DLOAP, LOGL_NOTICE, "OAP: client ID set, but secret OPC missing.\n"); - goto disable; - } - - state->client_id = config->client_id; - memcpy(state->secret_k, config->secret_k, sizeof(state->secret_k)); - memcpy(state->secret_opc, config->secret_opc, sizeof(state->secret_opc)); - state->state = OAP_INITIALIZED; - return 0; - -disable: - state->state = OAP_DISABLED; - return 0; -} - -/* From the given state and received RAND and AUTN octets, validate the - * server's authenticity and formulate the matching milenage reply octets in - * *tx_xres. The state is not modified. - * On success, and if tx_res is not NULL, exactly 8 octets will be written to - * *tx_res. If not NULL, tx_res must point at allocated memory of at least 8 - * octets. The caller will want to send XRES back to the server in a challenge - * response message and update the state. - * Return 0 on success; -1 if OAP is disabled; -2 if rx_random and rx_autn fail - * the authentication check; -3 for any other errors. */ -static int oap_evaluate_challenge(const struct oap_client_state *state, - const uint8_t *rx_random, - const uint8_t *rx_autn, - uint8_t *tx_xres) -{ - struct osmo_auth_vector vec; - - struct osmo_sub_auth_data auth = { - .type = OSMO_AUTH_TYPE_UMTS, - .algo = OSMO_AUTH_ALG_MILENAGE, - }; - - osmo_static_assert(sizeof(((struct osmo_sub_auth_data*)0)->u.umts.k) - == sizeof(state->secret_k), _secret_k_size_match); - osmo_static_assert(sizeof(((struct osmo_sub_auth_data*)0)->u.umts.opc) - == sizeof(state->secret_opc), _secret_opc_size_match); - - switch (state->state) { - case OAP_UNINITIALIZED: - case OAP_DISABLED: - return -1; - default: - break; - } - - memcpy(auth.u.umts.k, state->secret_k, sizeof(auth.u.umts.k)); - memcpy(auth.u.umts.opc, state->secret_opc, sizeof(auth.u.umts.opc)); - memset(auth.u.umts.amf, '\0', sizeof(auth.u.umts.amf)); - auth.u.umts.sqn = 41; /* TODO use incrementing sequence nr */ - - memset(&vec, 0, sizeof(vec)); - osmo_auth_gen_vec(&vec, &auth, rx_random); - - if (vec.res_len != 8) { - LOGP(DLOAP, LOGL_ERROR, "OAP: Expected XRES to be 8 octets, got %d\n", - vec.res_len); - return -3; - } - - if (osmo_constant_time_cmp(vec.autn, rx_autn, sizeof(vec.autn)) != 0) { - LOGP(DLOAP, LOGL_ERROR, "OAP: AUTN mismatch!\n"); - LOGP(DLOAP, LOGL_INFO, "OAP: AUTN from server: %s\n", - osmo_hexdump_nospc(rx_autn, sizeof(vec.autn))); - LOGP(DLOAP, LOGL_INFO, "OAP: AUTN expected: %s\n", - osmo_hexdump_nospc(vec.autn, sizeof(vec.autn))); - return -2; - } - - if (tx_xres != NULL) - memcpy(tx_xres, vec.res, 8); - return 0; -} - -struct msgb *oap_client_encoded(const struct osmo_oap_message *oap_msg) -{ - struct msgb *msg = msgb_alloc_headroom(1000, 64, __func__); - OSMO_ASSERT(msg); - osmo_oap_encode(msg, oap_msg); - return msg; -} - -/* Create a new msgb containing an OAP registration message. - * On error, return NULL. */ -static struct msgb* oap_msg_register(uint16_t client_id) -{ - struct osmo_oap_message oap_msg = {0}; - - if (client_id < 1) { - LOGP(DLOAP, LOGL_ERROR, "OAP: Invalid client ID: %d\n", client_id); - return NULL; - } - - oap_msg.message_type = OAP_MSGT_REGISTER_REQUEST; - oap_msg.client_id = client_id; - return oap_client_encoded(&oap_msg); -} - -int oap_client_register(struct oap_client_state *state, struct msgb **msg_tx) -{ - *msg_tx = oap_msg_register(state->client_id); - if (!(*msg_tx)) - return -1; - - state->state = OAP_REQUESTED_CHALLENGE; - return 0; -} - -/* Create a new msgb containing an OAP challenge response message. - * xres must point at 8 octets to return as challenge response. - * On error, return NULL. */ -static struct msgb* oap_msg_challenge_response(uint8_t *xres) -{ - struct osmo_oap_message oap_reply = {0}; - - oap_reply.message_type = OAP_MSGT_CHALLENGE_RESULT; - memcpy(oap_reply.xres, xres, sizeof(oap_reply.xres)); - oap_reply.xres_present = 1; - return oap_client_encoded(&oap_reply); -} - -static int handle_challenge(struct oap_client_state *state, - struct osmo_oap_message *oap_rx, - struct msgb **msg_tx) -{ - int rc; - uint8_t xres[8]; - - if (!(oap_rx->rand_present && oap_rx->autn_present)) { - LOGP(DLOAP, LOGL_ERROR, - "OAP challenge incomplete (rand_present: %d, autn_present: %d)\n", - oap_rx->rand_present, oap_rx->autn_present); - rc = -2; - goto failure; - } - - rc = oap_evaluate_challenge(state, - oap_rx->rand, - oap_rx->autn, - xres); - if (rc < 0) - goto failure; - - *msg_tx = oap_msg_challenge_response(xres); - if ((*msg_tx) == NULL) { - rc = -1; - goto failure; - } - - state->state = OAP_SENT_CHALLENGE_RESULT; - return 0; - -failure: - OSMO_ASSERT(rc < 0); - state->state = OAP_INITIALIZED; - return rc; -} - -int oap_client_handle(struct oap_client_state *state, - const struct msgb *msg_rx, struct msgb **msg_tx) -{ - uint8_t *data = msgb_l2(msg_rx); - size_t data_len = msgb_l2len(msg_rx); - struct osmo_oap_message oap_msg = {0}; - int rc = 0; - - *msg_tx = NULL; - - OSMO_ASSERT(data); - - rc = osmo_oap_decode(&oap_msg, data, data_len); - if (rc < 0) { - LOGP(DLOAP, LOGL_ERROR, - "Decoding OAP message failed with error '%s' (%d)\n", - get_value_string(gsm48_gmm_cause_names, -rc), -rc); - return -10; - } - - switch (state->state) { - case OAP_UNINITIALIZED: - LOGP(DLOAP, LOGL_ERROR, - "Received OAP message %d, but the OAP client is" - " not initialized\n", oap_msg.message_type); - return -ENOTCONN; - case OAP_DISABLED: - LOGP(DLOAP, LOGL_ERROR, - "Received OAP message %d, but the OAP client is" - " disabled\n", oap_msg.message_type); - return -ENOTCONN; - default: - break; - } - - switch (oap_msg.message_type) { - case OAP_MSGT_CHALLENGE_REQUEST: - return handle_challenge(state, &oap_msg, msg_tx); - - case OAP_MSGT_REGISTER_RESULT: - /* successfully registered */ - state->state = OAP_REGISTERED; - break; - - case OAP_MSGT_REGISTER_ERROR: - LOGP(DLOAP, LOGL_ERROR, - "OAP registration failed\n"); - state->state = OAP_INITIALIZED; - if (state->registration_failures < 3) { - state->registration_failures++; - return oap_client_register(state, msg_tx); - } - return -11; - - case OAP_MSGT_REGISTER_REQUEST: - case OAP_MSGT_CHALLENGE_RESULT: - LOGP(DLOAP, LOGL_ERROR, - "Received invalid OAP message type for OAP client side: %d\n", - (int)oap_msg.message_type); - return -12; - - default: - LOGP(DLOAP, LOGL_ERROR, - "Unknown OAP message type: %d\n", - (int)oap_msg.message_type); - return -13; - } - - return 0; -} diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index b38bfe0..1488109 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -497,11 +497,11 @@ struct gsup_client * __real_gsup_client_create(const char *ip_addr, unsigned int tcp_port, gsup_client_read_cb_t read_cb, - struct oap_client_config *oap_config); + struct osmo_oap_client_config *oap_config); struct gsup_client * __wrap_gsup_client_create(const char *ip_addr, unsigned int tcp_port, gsup_client_read_cb_t read_cb, - struct oap_client_config *oap_config) + struct osmo_oap_client_config *oap_config) { struct gsup_client *gsupc; gsupc = talloc_zero(msc_vlr_tests_ctx, struct gsup_client); -- To view, visit https://gerrit.osmocom.org/10257 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ib6496c35d0ce6eb531e97129dc45a9f68e503b34 Gerrit-Change-Number: 10257 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 16:17:04 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 16:17:04 +0000 Subject: Change in libosmocore[master]: import oap_client_test from osmo-sgsn Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10258 Change subject: import oap_client_test from osmo-sgsn ...................................................................... import oap_client_test from osmo-sgsn As oap_client has moved from osmo-sgsn to libosmogsm, it is only fair that the related unit test shall also be moved here. Change-Id: I9d64e10b4bacac9b530cf077841bad762fc6d558 --- M tests/Makefile.am D tests/oap/Makefile.am A tests/oap/oap_client_test.c A tests/oap/oap_client_test.err A tests/oap/oap_client_test.ok M tests/testsuite.at 6 files changed, 322 insertions(+), 39 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/58/10258/1 diff --git a/tests/Makefile.am b/tests/Makefile.am index eaaa8df..12623ed 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -23,7 +23,8 @@ coding/coding_test conv/conv_gsm0503_test \ abis/abis_test endian/endian_test sercomm/sercomm_test \ prbs/prbs_test gsm23003/gsm23003_test \ - codec/codec_ecu_fr_test timer/clk_override_test + codec/codec_ecu_fr_test timer/clk_override_test \ + oap/oap_client_test if ENABLE_MSGFILE check_PROGRAMS += msgfile/msgfile_test @@ -172,6 +173,9 @@ oap_oap_test_SOURCES = oap/oap_test.c oap_oap_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la +oap_oap_client_test_SOURCES = oap/oap_client_test.c +oap_oap_client_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la + fsm_fsm_test_SOURCES = fsm/fsm_test.c fsm_fsm_test_LDADD = $(LDADD) $(top_builddir)/src/ctrl/libosmoctrl.la @@ -253,7 +257,8 @@ conv/conv_gsm0503_test.ok endian/endian_test.ok \ sercomm/sercomm_test.ok prbs/prbs_test.ok \ gsm23003/gsm23003_test.ok \ - timer/clk_override_test.ok + timer/clk_override_test.ok \ + oap/oap_client_test.ok DISTCLEANFILES = atconfig atlocal conv/gsm0503_test_vectors.c BUILT_SOURCES = conv/gsm0503_test_vectors.c diff --git a/tests/oap/Makefile.am b/tests/oap/Makefile.am deleted file mode 100644 index 06ccf33..0000000 --- a/tests/oap/Makefile.am +++ /dev/null @@ -1,37 +0,0 @@ -AM_CPPFLAGS = \ - $(all_includes) \ - -I$(top_srcdir)/include \ - $(NULL) - -AM_CFLAGS = \ - -Wall \ - -ggdb3 \ - $(LIBOSMOCORE_CFLAGS) \ - $(LIBOSMOGSM_CFLAGS) \ - $(NULL) - -EXTRA_DIST = \ - oap_test.ok \ - $(NULL) - -if HAVE_LIBGTP -if HAVE_LIBCARES -noinst_PROGRAMS = \ - oap_test \ - $(NULL) -endif -endif - -oap_test_SOURCES = \ - oap_test.c \ - $(NULL) - -oap_test_LDADD = \ - $(top_builddir)/src/gprs/oap.o \ - $(top_builddir)/src/gprs/oap_messages.o \ - $(top_builddir)/src/gprs/gprs_utils.o \ - $(top_builddir)/src/libcommon/libcommon.a \ - $(LIBOSMOCORE_LIBS) \ - $(LIBOSMOGSM_LIBS) \ - -lrt - diff --git a/tests/oap/oap_client_test.c b/tests/oap/oap_client_test.c new file mode 100644 index 0000000..a841b38 --- /dev/null +++ b/tests/oap/oap_client_test.c @@ -0,0 +1,271 @@ +/* Test Osmocom Authentication Protocol */ +/* + * (C) 2015 by sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include + +#include + +#include +#include + +static void test_oap_api(void) +{ + printf("Testing OAP API\n"); + + struct osmo_oap_client_config _config; + struct osmo_oap_client_config *config = &_config; + + struct osmo_oap_client_state _state; + struct osmo_oap_client_state *state = &_state; + + struct osmo_oap_message oap_rx; + struct msgb *msg_rx; + + struct osmo_oap_message oap_tx; + struct msgb *msg_tx; + + memset(config, 0, sizeof(*config)); + memset(state, 0, sizeof(*state)); + + OSMO_ASSERT(osmo_hexparse("0102030405060708090a0b0c0d0e0f10", config->secret_k, 16) == 16); + OSMO_ASSERT(osmo_hexparse("1112131415161718191a1b1c1d1e1f20", config->secret_opc, 16) == 16); + + fprintf(stderr, "- make sure filling with zeros means uninitialized\n"); + OSMO_ASSERT(state->state == OSMO_OAP_UNINITIALIZED); + + fprintf(stderr, "- reject messages in uninitialized state\n"); + memset(&oap_rx, 0, sizeof(oap_rx)); + state->client_id = 1; + oap_rx.message_type = OAP_MSGT_REGISTER_ERROR; + msg_rx = osmo_oap_client_encoded(&oap_rx); + OSMO_ASSERT(osmo_oap_client_handle(state, msg_rx, &msg_tx) < 0); + OSMO_ASSERT(state->state == OSMO_OAP_UNINITIALIZED); + msgb_free(msg_rx); + OSMO_ASSERT(!msg_tx); + + fprintf(stderr, "- NULL config should disable\n"); + OSMO_ASSERT( osmo_oap_client_init(NULL, state) == 0 ); + OSMO_ASSERT(state->state == OSMO_OAP_DISABLED); + + fprintf(stderr, "- reject messages in disabled state\n"); + memset(state, 0, sizeof(*state)); + memset(&oap_rx, 0, sizeof(oap_rx)); + state->state = OSMO_OAP_DISABLED; + state->client_id = 1; + oap_rx.message_type = OAP_MSGT_REGISTER_ERROR; + msg_rx = osmo_oap_client_encoded(&oap_rx); + OSMO_ASSERT(osmo_oap_client_handle(state, msg_rx, &msg_tx) < 0); + OSMO_ASSERT(state->state == OSMO_OAP_DISABLED); + msgb_free(msg_rx); + OSMO_ASSERT(!msg_tx); + + fprintf(stderr, "- invalid client_id and shared secret\n"); + memset(state, 0, sizeof(*state)); + config->client_id = 0; + config->secret_k_present = 0; + config->secret_opc_present = 0; + OSMO_ASSERT( osmo_oap_client_init(config, state) == 0 ); + OSMO_ASSERT(state->state == OSMO_OAP_DISABLED); + + fprintf(stderr, "- reset state\n"); + memset(state, 0, sizeof(*state)); + + fprintf(stderr, "- only client_id is invalid\n"); + config->client_id = 0; + config->secret_k_present = 1; + config->secret_opc_present = 1; + OSMO_ASSERT( osmo_oap_client_init(config, state) == 0 ); + OSMO_ASSERT(state->state == OSMO_OAP_DISABLED); + + memset(state, 0, sizeof(*state)); + + fprintf(stderr, "- valid id, but omitted shared_secret (1/2)\n"); + config->client_id = 12345; + config->secret_k_present = 0; + config->secret_opc_present = 1; + OSMO_ASSERT( osmo_oap_client_init(config, state) == 0 ); + OSMO_ASSERT(state->state == OSMO_OAP_DISABLED); + + memset(state, 0, sizeof(*state)); + + fprintf(stderr, "- valid id, but omitted shared_secret (2/2)\n"); + config->client_id = 12345; + config->secret_k_present = 1; + config->secret_opc_present = 0; + OSMO_ASSERT( osmo_oap_client_init(config, state) == 0 ); + OSMO_ASSERT(state->state == OSMO_OAP_DISABLED); + + memset(state, 0, sizeof(*state)); + + + fprintf(stderr, "- mint configuration\n"); + config->client_id = 12345; + config->secret_k_present = 1; + config->secret_opc_present = 1; + /*config->secret_* buffers are still set from the top */ + OSMO_ASSERT( osmo_oap_client_init(config, state) == 0 ); + OSMO_ASSERT(state->state == OSMO_OAP_INITIALIZED); + + + fprintf(stderr, "- Missing challenge data\n"); + memset(&oap_rx, 0, sizeof(oap_rx)); + oap_rx.message_type = OAP_MSGT_CHALLENGE_REQUEST; + oap_rx.rand_present = 0; + oap_rx.autn_present = 0; + msg_rx = osmo_oap_client_encoded(&oap_rx); + OSMO_ASSERT(osmo_oap_client_handle(state, msg_rx, &msg_tx) == -2); + msgb_free(msg_rx); + OSMO_ASSERT(!msg_tx); + + fprintf(stderr, "- AUTN missing\n"); + osmo_hexparse("0102030405060708090a0b0c0d0e0f10", + oap_rx.rand, 16); + oap_rx.rand_present = 1; + msg_rx = osmo_oap_client_encoded(&oap_rx); + OSMO_ASSERT(osmo_oap_client_handle(state, msg_rx, &msg_tx) == -2); + msgb_free(msg_rx); + OSMO_ASSERT(!msg_tx); + + fprintf(stderr, "- RAND missing\n"); + oap_rx.rand_present = 0; + osmo_hexparse("cec4e3848a33000086781158ca40f136", + oap_rx.autn, 16); + oap_rx.autn_present = 1; + msg_rx = osmo_oap_client_encoded(&oap_rx); + OSMO_ASSERT(osmo_oap_client_handle(state, msg_rx, &msg_tx) == -2); + msgb_free(msg_rx); + OSMO_ASSERT(!msg_tx); + + fprintf(stderr, "- wrong autn (by one bit)\n"); + osmo_hexparse("0102030405060708090a0b0c0d0e0f10", + oap_rx.rand, 16); + osmo_hexparse("dec4e3848a33000086781158ca40f136", + oap_rx.autn, 16); + oap_rx.rand_present = 1; + oap_rx.autn_present = 1; + msg_rx = osmo_oap_client_encoded(&oap_rx); + OSMO_ASSERT(osmo_oap_client_handle(state, msg_rx, &msg_tx) == -2); + msgb_free(msg_rx); + OSMO_ASSERT(!msg_tx); + + fprintf(stderr, "- all data correct\n"); + osmo_hexparse("cec4e3848a33000086781158ca40f136", + oap_rx.autn, 16); + msg_rx = osmo_oap_client_encoded(&oap_rx); + + fprintf(stderr, "- but refuse to evaluate in uninitialized state\n"); + OSMO_ASSERT(state->state == OSMO_OAP_INITIALIZED); + + state->state = OSMO_OAP_UNINITIALIZED; + OSMO_ASSERT(osmo_oap_client_handle(state, msg_rx, &msg_tx) < 0); + OSMO_ASSERT(!msg_tx); + + state->state = OSMO_OAP_DISABLED; + OSMO_ASSERT(osmo_oap_client_handle(state, msg_rx, &msg_tx) < 0); + OSMO_ASSERT(!msg_tx); + + state->state = OSMO_OAP_INITIALIZED; + + fprintf(stderr, "- now everything is correct\n"); + /* a successful return value here indicates correct autn */ + OSMO_ASSERT(osmo_oap_client_handle(state, msg_rx, &msg_tx) == 0); + msgb_free(msg_rx); + + fprintf(stderr, "- Expect the challenge response in msg_tx\n"); + OSMO_ASSERT(msg_tx); + OSMO_ASSERT(osmo_oap_decode(&oap_tx, msg_tx->data, msg_tx->len) == 0); + OSMO_ASSERT(oap_tx.message_type == OAP_MSGT_CHALLENGE_RESULT); + OSMO_ASSERT(strcmp("e2d05b598c61d9ba", + osmo_hexdump_nospc(oap_tx.xres, sizeof(oap_tx.xres))) + == 0); + OSMO_ASSERT(state->state == OSMO_OAP_SENT_CHALLENGE_RESULT); + msgb_free(msg_tx); + msg_tx = 0; + + struct osmo_oap_client_state saved_state = _state; + + fprintf(stderr, "- Receive registration error for the first time.\n"); + + memset(&oap_rx, 0, sizeof(oap_rx)); + oap_rx.message_type = OAP_MSGT_REGISTER_ERROR; + oap_rx.cause = GMM_CAUSE_PROTO_ERR_UNSPEC; + msg_rx = osmo_oap_client_encoded(&oap_rx); + + OSMO_ASSERT(state->registration_failures == 0); + OSMO_ASSERT(osmo_oap_client_handle(state, msg_rx, &msg_tx) == 0); + OSMO_ASSERT(state->registration_failures == 1); + OSMO_ASSERT(msg_tx); + OSMO_ASSERT(osmo_oap_decode(&oap_tx, msg_tx->data, msg_tx->len) == 0); + OSMO_ASSERT(oap_tx.message_type == OAP_MSGT_REGISTER_REQUEST); + OSMO_ASSERT(state->state == OSMO_OAP_REQUESTED_CHALLENGE); + msgb_free(msg_tx); + msg_tx = 0; + + fprintf(stderr, "- Receive registration error for the Nth time.\n"); + state->registration_failures = 999; + OSMO_ASSERT(osmo_oap_client_handle(state, msg_rx, &msg_tx) == -11); + OSMO_ASSERT(!msg_tx); + OSMO_ASSERT(state->state == OSMO_OAP_INITIALIZED); + msgb_free(msg_tx); + msg_tx = 0; + + msgb_free(msg_rx); + + fprintf(stderr, "- Registration success\n"); + + _state = saved_state; + memset(&oap_rx, 0, sizeof(oap_rx)); + oap_rx.message_type = OAP_MSGT_REGISTER_RESULT; + msg_rx = osmo_oap_client_encoded(&oap_rx); + OSMO_ASSERT(osmo_oap_client_handle(state, msg_rx, &msg_tx) == 0); + OSMO_ASSERT(!msg_tx); + OSMO_ASSERT(state->state == OSMO_OAP_REGISTERED); + msgb_free(msg_rx); +} + +static struct log_info_cat oap_client_test_categories[] = { +}; + +static struct log_info info = { + .cat = oap_client_test_categories, + .num_cat = ARRAY_SIZE(oap_client_test_categories), +}; + +int main(int argc, char **argv) +{ + void *ctx = talloc_named_const(NULL, 0, "oap_client_test"); + msgb_talloc_ctx_init(ctx, 0); + osmo_init_logging2(ctx, &info); + + OSMO_ASSERT(osmo_stderr_target); + log_set_use_color(osmo_stderr_target, 0); + log_set_print_timestamp(osmo_stderr_target, 0); + log_set_print_filename(osmo_stderr_target, 0); + log_set_print_category(osmo_stderr_target, 1); + log_parse_category_mask(osmo_stderr_target, "DLOAP,1"); + + test_oap_api(); + printf("Done\n"); + + return 0; +} + diff --git a/tests/oap/oap_client_test.err b/tests/oap/oap_client_test.err new file mode 100644 index 0000000..62ddc9e --- /dev/null +++ b/tests/oap/oap_client_test.err @@ -0,0 +1,35 @@ +- make sure filling with zeros means uninitialized +- reject messages in uninitialized state +DLOAP Received OAP message 5, but the OAP client is not initialized +- NULL config should disable +- reject messages in disabled state +DLOAP Received OAP message 5, but the OAP client is disabled +- invalid client_id and shared secret +- reset state +- only client_id is invalid +- valid id, but omitted shared_secret (1/2) +DLOAP OAP: client ID set, but secret K missing. +- valid id, but omitted shared_secret (2/2) +DLOAP OAP: client ID set, but secret OPC missing. +- mint configuration +- Missing challenge data +DLOAP OAP challenge incomplete (rand_present: 0, autn_present: 0) +- AUTN missing +DLOAP OAP challenge incomplete (rand_present: 1, autn_present: 0) +- RAND missing +DLOAP OAP challenge incomplete (rand_present: 0, autn_present: 1) +- wrong autn (by one bit) +DLOAP OAP: AUTN mismatch! +DLOAP OAP: AUTN from server: dec4e3848a33000086781158ca40f136 +DLOAP OAP: AUTN expected: cec4e3848a33000086781158ca40f136 +- all data correct +- but refuse to evaluate in uninitialized state +DLOAP Received OAP message 8, but the OAP client is not initialized +DLOAP Received OAP message 8, but the OAP client is disabled +- now everything is correct +- Expect the challenge response in msg_tx +- Receive registration error for the first time. +DLOAP OAP registration failed +- Receive registration error for the Nth time. +DLOAP OAP registration failed +- Registration success diff --git a/tests/oap/oap_client_test.ok b/tests/oap/oap_client_test.ok new file mode 100644 index 0000000..59108a7 --- /dev/null +++ b/tests/oap/oap_client_test.ok @@ -0,0 +1,2 @@ +Testing OAP API +Done diff --git a/tests/testsuite.at b/tests/testsuite.at index 43b58e8..a1cf98a 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -274,6 +274,13 @@ AT_CHECK([$abs_top_builddir/tests/oap/oap_test], [0], [expout], [experr]) AT_CLEANUP +AT_SETUP([oap_client]) +AT_KEYWORDS([oap_client]) +cat $abs_srcdir/oap/oap_client_test.ok > expout +cat $abs_srcdir/oap/oap_client_test.err > experr +AT_CHECK([$abs_top_builddir/tests/oap/oap_client_test], [0], [expout], [experr]) +AT_CLEANUP + AT_SETUP([socket]) AT_KEYWORDS([socket]) cat $abs_srcdir/socket/socket_test.ok > expout -- To view, visit https://gerrit.osmocom.org/10258 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I9d64e10b4bacac9b530cf077841bad762fc6d558 Gerrit-Change-Number: 10258 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 16:25:04 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 16:25:04 +0000 Subject: Change in libosmocore[master]: import oap_client_test from osmo-sgsn In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10258 to look at the new patch set (#2). Change subject: import oap_client_test from osmo-sgsn ...................................................................... import oap_client_test from osmo-sgsn As oap_client has moved from osmo-sgsn to libosmogsm, it is only fair that the related unit test shall also be moved here. Change-Id: I9d64e10b4bacac9b530cf077841bad762fc6d558 --- M tests/Makefile.am D tests/oap/Makefile.am A tests/oap/oap_client_test.c A tests/oap/oap_client_test.err A tests/oap/oap_client_test.ok M tests/testsuite.at 6 files changed, 322 insertions(+), 39 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/58/10258/2 -- To view, visit https://gerrit.osmocom.org/10258 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9d64e10b4bacac9b530cf077841bad762fc6d558 Gerrit-Change-Number: 10258 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 16:26:04 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 16:26:04 +0000 Subject: Change in osmo-sgsn[master]: migrate to oap_client in libosmogsm Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10259 Change subject: migrate to oap_client in libosmogsm ...................................................................... migrate to oap_client in libosmogsm libosmogsm in libosmocore.git from Change-Id Ie36729996abd30b84d1c30a09f62ebc6a9794950 onwards contains oap_client.c, so we don't need our local copy here in this repo anymore. Change-Id: I7b194f98ef3f925b6178d8a8dbd9fcf2f0c6e132 Requires: libosmocore.git Change-Id Ie36729996abd30b84d1c30a09f62ebc6a9794950 --- M include/osmocom/sgsn/Makefile.am M include/osmocom/sgsn/gsup_client.h D include/osmocom/sgsn/oap_client.h M include/osmocom/sgsn/sgsn.h M src/gprs/Makefile.am M src/gprs/gsup_client.c D src/gprs/oap_client.c M src/libcommon/gsup_client.c D src/libcommon/oap_client.c M tests/Makefile.am D tests/oap/Makefile.am D tests/oap/oap_client_test.c D tests/oap/oap_client_test.err D tests/oap/oap_client_test.ok M tests/testsuite.at 15 files changed, 15 insertions(+), 1,008 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/59/10259/1 diff --git a/include/osmocom/sgsn/Makefile.am b/include/osmocom/sgsn/Makefile.am index 3f63b9f..269cebc 100644 --- a/include/osmocom/sgsn/Makefile.am +++ b/include/osmocom/sgsn/Makefile.am @@ -17,7 +17,6 @@ gprs_utils.h \ gsup_client.h \ gtphub.h \ - oap_client.h \ sgsn.h \ signal.h \ slhc.h \ diff --git a/include/osmocom/sgsn/gsup_client.h b/include/osmocom/sgsn/gsup_client.h index 29092ad..6ba0d15 100644 --- a/include/osmocom/sgsn/gsup_client.h +++ b/include/osmocom/sgsn/gsup_client.h @@ -23,7 +23,7 @@ #include -#include +#include #define GSUP_CLIENT_RECONNECT_INTERVAL 10 #define GSUP_CLIENT_PING_INTERVAL 20 @@ -43,7 +43,7 @@ gsup_client_read_cb_t read_cb; void *data; - struct oap_client_state oap_state; + struct osmo_oap_client_state oap_state; struct osmo_timer_list ping_timer; struct osmo_timer_list connect_timer; @@ -55,7 +55,7 @@ const char *ip_addr, unsigned int tcp_port, gsup_client_read_cb_t read_cb, - struct oap_client_config *oapc_config); + struct osmo_oap_client_config *oapc_config); void gsup_client_destroy(struct gsup_client *gsupc); int gsup_client_send(struct gsup_client *gsupc, struct msgb *msg); diff --git a/include/osmocom/sgsn/oap_client.h b/include/osmocom/sgsn/oap_client.h deleted file mode 100644 index 80c86d5..0000000 --- a/include/osmocom/sgsn/oap_client.h +++ /dev/null @@ -1,82 +0,0 @@ -/* Osmocom Authentication Protocol API */ - -/* (C) 2015 by Sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * Author: Neels Hofmeyr - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#pragma once - -#include - -struct msgb; -struct osmo_oap_message; - -/* This is the config part for vty. It is essentially copied in - * oap_client_state, where values are copied over once the config is - * considered valid. */ -struct oap_client_config { - uint16_t client_id; - int secret_k_present; - uint8_t secret_k[16]; - int secret_opc_present; - uint8_t secret_opc[16]; -}; - -/* The runtime state of the OAP client. client_id and the secrets are in fact - * duplicated from oap_client_config, so that a separate validation of the - * config data is possible, and so that only a struct oap_client_state* is - * passed around. */ -struct oap_client_state { - enum { - OAP_UNINITIALIZED = 0, /* just allocated. */ - OAP_DISABLED, /* disabled by config. */ - OAP_INITIALIZED, /* enabled, config is valid. */ - OAP_REQUESTED_CHALLENGE, - OAP_SENT_CHALLENGE_RESULT, - OAP_REGISTERED - } state; - uint16_t client_id; - uint8_t secret_k[16]; - uint8_t secret_opc[16]; - int registration_failures; -}; - -/* From config, initialize state. Return 0 on success. */ -int oap_client_init(struct oap_client_config *config, - struct oap_client_state *state); - -/* Construct an OAP registration message and return in *msg_tx. Use - * state->client_id and update state->state. - * Return 0 on success, or a negative value on error. - * If an error is returned, *msg_tx is guaranteed to be NULL. */ -int oap_client_register(struct oap_client_state *state, struct msgb **msg_tx); - -/* Decode and act on a received OAP message msg_rx. Update state->state. If a - * non-NULL pointer is returned in *msg_tx, that msgb should be sent to the OAP - * server (and freed) by the caller. The received msg_rx is not freed. - * Return 0 on success, or a negative value on error. - * If an error is returned, *msg_tx is guaranteed to be NULL. */ -int oap_client_handle(struct oap_client_state *state, - const struct msgb *msg_rx, struct msgb **msg_tx); - -/* Allocate a msgb and in it, return the encoded oap_client_msg. Return - * NULL on error. (Like oap_client_encode(), but also allocates a msgb.) - * About the name: the idea is do_something(oap_client_encoded(my_struct)) - */ -struct msgb *oap_client_encoded(const struct osmo_oap_message *oap_client_msg); diff --git a/include/osmocom/sgsn/sgsn.h b/include/osmocom/sgsn/sgsn.h index dae9d12..59d0bd7 100644 --- a/include/osmocom/sgsn/sgsn.h +++ b/include/osmocom/sgsn/sgsn.h @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include "../../bscconfig.h" @@ -101,7 +101,7 @@ int dynamic_lookup; - struct oap_client_config oap; + struct osmo_oap_client_config oap; /* RFC1144 TCP/IP header compression */ struct { diff --git a/src/gprs/Makefile.am b/src/gprs/Makefile.am index 1cf6785..46d94d4 100644 --- a/src/gprs/Makefile.am +++ b/src/gprs/Makefile.am @@ -84,7 +84,6 @@ gprs_llc_xid.c \ v42bis.c \ gsup_client.c \ - oap_client.c \ $(NULL) osmo_sgsn_LDADD = \ $(OSMO_LIBS) \ diff --git a/src/gprs/gsup_client.c b/src/gprs/gsup_client.c index 48357b4..95c4988 100644 --- a/src/gprs/gsup_client.c +++ b/src/gprs/gsup_client.c @@ -116,7 +116,7 @@ { struct msgb *msg_tx; int rc; - rc = oap_client_register(&gsupc->oap_state, &msg_tx); + rc = osmo_oap_client_register(&gsupc->oap_state, &msg_tx); if ((rc < 0) || (!msg_tx)) { LOGP(DLGSUP, LOGL_ERROR, "GSUP OAP set up, but cannot register.\n"); @@ -138,7 +138,7 @@ if (up) { start_test_procedure(gsupc); - if (gsupc->oap_state.state == OAP_INITIALIZED) + if (gsupc->oap_state.state == OSMO_OAP_INITIALIZED) gsup_client_oap_register(gsupc); osmo_timer_del(&gsupc->connect_timer); @@ -156,7 +156,7 @@ struct msgb *msg_tx; /* If the oap_state is disabled, this will reject the messages. */ - rc = oap_client_handle(&gsupc->oap_state, msg_rx, &msg_tx); + rc = osmo_oap_client_handle(&gsupc->oap_state, msg_rx, &msg_tx); msgb_free(msg_rx); if (rc < 0) return rc; @@ -269,7 +269,7 @@ const char *ip_addr, unsigned int tcp_port, gsup_client_read_cb_t read_cb, - struct oap_client_config *oapc_config) + struct osmo_oap_client_config *oapc_config) { struct gsup_client *gsupc; int rc; @@ -284,7 +284,7 @@ OSMO_ASSERT(gsupc->unit_name); /* a NULL oapc_config will mark oap_state disabled. */ - rc = oap_client_init(oapc_config, &gsupc->oap_state); + rc = osmo_oap_client_init(oapc_config, &gsupc->oap_state); if (rc != 0) goto failed; diff --git a/src/gprs/oap_client.c b/src/gprs/oap_client.c deleted file mode 100644 index 9ff84a6..0000000 --- a/src/gprs/oap_client.c +++ /dev/null @@ -1,280 +0,0 @@ -/* Osmocom Authentication Protocol API */ - -/* (C) 2015 by Sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * Author: Neels Hofmeyr - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include - -#include -#include -#include - -#include -#include - -int oap_client_init(struct oap_client_config *config, - struct oap_client_state *state) -{ - OSMO_ASSERT(state->state == OAP_UNINITIALIZED); - - if (!config) - goto disable; - - if (config->client_id == 0) - goto disable; - - if (config->secret_k_present == 0) { - LOGP(DLOAP, LOGL_NOTICE, "OAP: client ID set, but secret K missing.\n"); - goto disable; - } - - if (config->secret_opc_present == 0) { - LOGP(DLOAP, LOGL_NOTICE, "OAP: client ID set, but secret OPC missing.\n"); - goto disable; - } - - state->client_id = config->client_id; - memcpy(state->secret_k, config->secret_k, sizeof(state->secret_k)); - memcpy(state->secret_opc, config->secret_opc, sizeof(state->secret_opc)); - state->state = OAP_INITIALIZED; - return 0; - -disable: - state->state = OAP_DISABLED; - return 0; -} - -/* >From the given state and received RAND and AUTN octets, validate the - * server's authenticity and formulate the matching milenage reply octets in - * *tx_xres. The state is not modified. - * On success, and if tx_res is not NULL, exactly 8 octets will be written to - * *tx_res. If not NULL, tx_res must point at allocated memory of at least 8 - * octets. The caller will want to send XRES back to the server in a challenge - * response message and update the state. - * Return 0 on success; -1 if OAP is disabled; -2 if rx_random and rx_autn fail - * the authentication check; -3 for any other errors. */ -static int oap_evaluate_challenge(const struct oap_client_state *state, - const uint8_t *rx_random, - const uint8_t *rx_autn, - uint8_t *tx_xres) -{ - struct osmo_auth_vector vec; - - struct osmo_sub_auth_data auth = { - .type = OSMO_AUTH_TYPE_UMTS, - .algo = OSMO_AUTH_ALG_MILENAGE, - }; - - osmo_static_assert(sizeof(((struct osmo_sub_auth_data*)0)->u.umts.k) - == sizeof(state->secret_k), _secret_k_size_match); - osmo_static_assert(sizeof(((struct osmo_sub_auth_data*)0)->u.umts.opc) - == sizeof(state->secret_opc), _secret_opc_size_match); - - switch (state->state) { - case OAP_UNINITIALIZED: - case OAP_DISABLED: - return -1; - default: - break; - } - - memcpy(auth.u.umts.k, state->secret_k, sizeof(auth.u.umts.k)); - memcpy(auth.u.umts.opc, state->secret_opc, sizeof(auth.u.umts.opc)); - memset(auth.u.umts.amf, '\0', sizeof(auth.u.umts.amf)); - auth.u.umts.sqn = 41; /* TODO use incrementing sequence nr */ - - memset(&vec, 0, sizeof(vec)); - osmo_auth_gen_vec(&vec, &auth, rx_random); - - if (vec.res_len != 8) { - LOGP(DLOAP, LOGL_ERROR, "OAP: Expected XRES to be 8 octets, got %d\n", - vec.res_len); - return -3; - } - - if (osmo_constant_time_cmp(vec.autn, rx_autn, sizeof(vec.autn)) != 0) { - LOGP(DLOAP, LOGL_ERROR, "OAP: AUTN mismatch!\n"); - LOGP(DLOAP, LOGL_INFO, "OAP: AUTN from server: %s\n", - osmo_hexdump_nospc(rx_autn, sizeof(vec.autn))); - LOGP(DLOAP, LOGL_INFO, "OAP: AUTN expected: %s\n", - osmo_hexdump_nospc(vec.autn, sizeof(vec.autn))); - return -2; - } - - if (tx_xres != NULL) - memcpy(tx_xres, vec.res, 8); - return 0; -} - -struct msgb *oap_client_encoded(const struct osmo_oap_message *oap_msg) -{ - struct msgb *msg = msgb_alloc_headroom(1000, 64, __func__); - OSMO_ASSERT(msg); - osmo_oap_encode(msg, oap_msg); - return msg; -} - -/* Create a new msgb containing an OAP registration message. - * On error, return NULL. */ -static struct msgb* oap_msg_register(uint16_t client_id) -{ - struct osmo_oap_message oap_msg = {0}; - - if (client_id < 1) { - LOGP(DLOAP, LOGL_ERROR, "OAP: Invalid client ID: %d\n", client_id); - return NULL; - } - - oap_msg.message_type = OAP_MSGT_REGISTER_REQUEST; - oap_msg.client_id = client_id; - return oap_client_encoded(&oap_msg); -} - -int oap_client_register(struct oap_client_state *state, struct msgb **msg_tx) -{ - *msg_tx = oap_msg_register(state->client_id); - if (!(*msg_tx)) - return -1; - - state->state = OAP_REQUESTED_CHALLENGE; - return 0; -} - -/* Create a new msgb containing an OAP challenge response message. - * xres must point at 8 octets to return as challenge response. - * On error, return NULL. */ -static struct msgb* oap_msg_challenge_response(uint8_t *xres) -{ - struct osmo_oap_message oap_reply = {0}; - - oap_reply.message_type = OAP_MSGT_CHALLENGE_RESULT; - memcpy(oap_reply.xres, xres, sizeof(oap_reply.xres)); - oap_reply.xres_present = 1; - return oap_client_encoded(&oap_reply); -} - -static int handle_challenge(struct oap_client_state *state, - struct osmo_oap_message *oap_rx, - struct msgb **msg_tx) -{ - int rc; - uint8_t xres[8]; - - if (!(oap_rx->rand_present && oap_rx->autn_present)) { - LOGP(DLOAP, LOGL_ERROR, - "OAP challenge incomplete (rand_present: %d, autn_present: %d)\n", - oap_rx->rand_present, oap_rx->autn_present); - rc = -2; - goto failure; - } - - rc = oap_evaluate_challenge(state, - oap_rx->rand, - oap_rx->autn, - xres); - if (rc < 0) - goto failure; - - *msg_tx = oap_msg_challenge_response(xres); - if ((*msg_tx) == NULL) { - rc = -1; - goto failure; - } - - state->state = OAP_SENT_CHALLENGE_RESULT; - return 0; - -failure: - OSMO_ASSERT(rc < 0); - state->state = OAP_INITIALIZED; - return rc; -} - -int oap_client_handle(struct oap_client_state *state, - const struct msgb *msg_rx, struct msgb **msg_tx) -{ - uint8_t *data = msgb_l2(msg_rx); - size_t data_len = msgb_l2len(msg_rx); - struct osmo_oap_message oap_msg = {0}; - int rc = 0; - - *msg_tx = NULL; - - OSMO_ASSERT(data); - - rc = osmo_oap_decode(&oap_msg, data, data_len); - if (rc < 0) { - LOGP(DLOAP, LOGL_ERROR, - "Decoding OAP message failed with error '%s' (%d)\n", - get_value_string(gsm48_gmm_cause_names, -rc), -rc); - return -10; - } - - switch (state->state) { - case OAP_UNINITIALIZED: - LOGP(DLOAP, LOGL_ERROR, - "Received OAP message %d, but the OAP client is" - " not initialized\n", oap_msg.message_type); - return -ENOTCONN; - case OAP_DISABLED: - LOGP(DLOAP, LOGL_ERROR, - "Received OAP message %d, but the OAP client is" - " disabled\n", oap_msg.message_type); - return -ENOTCONN; - default: - break; - } - - switch (oap_msg.message_type) { - case OAP_MSGT_CHALLENGE_REQUEST: - return handle_challenge(state, &oap_msg, msg_tx); - - case OAP_MSGT_REGISTER_RESULT: - /* successfully registered */ - state->state = OAP_REGISTERED; - break; - - case OAP_MSGT_REGISTER_ERROR: - LOGP(DLOAP, LOGL_ERROR, - "OAP registration failed\n"); - state->state = OAP_INITIALIZED; - if (state->registration_failures < 3) { - state->registration_failures ++; - return oap_client_register(state, msg_tx); - } - return -11; - - case OAP_MSGT_REGISTER_REQUEST: - case OAP_MSGT_CHALLENGE_RESULT: - LOGP(DLOAP, LOGL_ERROR, - "Received invalid OAP message type for OAP client side: %d\n", - (int)oap_msg.message_type); - return -12; - - default: - LOGP(DLOAP, LOGL_ERROR, - "Unknown OAP message type: %d\n", - (int)oap_msg.message_type); - return -13; - } - - return 0; -} diff --git a/src/libcommon/gsup_client.c b/src/libcommon/gsup_client.c index 89a9f70..0520045 100644 --- a/src/libcommon/gsup_client.c +++ b/src/libcommon/gsup_client.c @@ -116,7 +116,7 @@ { struct msgb *msg_tx; int rc; - rc = oap_client_register(&gsupc->oap_state, &msg_tx); + rc = osmo_oap_client_register(&gsupc->oap_state, &msg_tx); if ((rc < 0) || (!msg_tx)) { LOGP(DLGSUP, LOGL_ERROR, "GSUP OAP set up, but cannot register.\n"); @@ -138,7 +138,7 @@ if (up) { start_test_procedure(gsupc); - if (gsupc->oap_state.state == OAP_INITIALIZED) + if (gsupc->osmo_oap_state.state == OSMO_OAP_INITIALIZED) gsup_client_oap_register(gsupc); osmo_timer_del(&gsupc->connect_timer); @@ -156,7 +156,7 @@ struct msgb *msg_tx; /* If the oap_state is disabled, this will reject the messages. */ - rc = oap_client_handle(&gsupc->oap_state, msg_rx, &msg_tx); + rc = osmo_oap_client_handle(&gsupc->oap_state, msg_rx, &msg_tx); msgb_free(msg_rx); if (rc < 0) return rc; @@ -269,7 +269,7 @@ const char *ip_addr, unsigned int tcp_port, gsup_client_read_cb_t read_cb, - struct oap_client_config *oapc_config) + struct osmo_oap_client_config *oapc_config) { struct gsup_client *gsupc; int rc; @@ -284,7 +284,7 @@ OSMO_ASSERT(gsupc->unit_name); /* a NULL oapc_config will mark oap_state disabled. */ - rc = oap_client_init(oapc_config, &gsupc->oap_state); + rc = osmo_oap_client_init(oapc_config, &gsupc->oap_state); if (rc != 0) goto failed; diff --git a/src/libcommon/oap_client.c b/src/libcommon/oap_client.c deleted file mode 100644 index 9ff84a6..0000000 --- a/src/libcommon/oap_client.c +++ /dev/null @@ -1,280 +0,0 @@ -/* Osmocom Authentication Protocol API */ - -/* (C) 2015 by Sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * Author: Neels Hofmeyr - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include - -#include -#include -#include - -#include -#include - -int oap_client_init(struct oap_client_config *config, - struct oap_client_state *state) -{ - OSMO_ASSERT(state->state == OAP_UNINITIALIZED); - - if (!config) - goto disable; - - if (config->client_id == 0) - goto disable; - - if (config->secret_k_present == 0) { - LOGP(DLOAP, LOGL_NOTICE, "OAP: client ID set, but secret K missing.\n"); - goto disable; - } - - if (config->secret_opc_present == 0) { - LOGP(DLOAP, LOGL_NOTICE, "OAP: client ID set, but secret OPC missing.\n"); - goto disable; - } - - state->client_id = config->client_id; - memcpy(state->secret_k, config->secret_k, sizeof(state->secret_k)); - memcpy(state->secret_opc, config->secret_opc, sizeof(state->secret_opc)); - state->state = OAP_INITIALIZED; - return 0; - -disable: - state->state = OAP_DISABLED; - return 0; -} - -/* From the given state and received RAND and AUTN octets, validate the - * server's authenticity and formulate the matching milenage reply octets in - * *tx_xres. The state is not modified. - * On success, and if tx_res is not NULL, exactly 8 octets will be written to - * *tx_res. If not NULL, tx_res must point at allocated memory of at least 8 - * octets. The caller will want to send XRES back to the server in a challenge - * response message and update the state. - * Return 0 on success; -1 if OAP is disabled; -2 if rx_random and rx_autn fail - * the authentication check; -3 for any other errors. */ -static int oap_evaluate_challenge(const struct oap_client_state *state, - const uint8_t *rx_random, - const uint8_t *rx_autn, - uint8_t *tx_xres) -{ - struct osmo_auth_vector vec; - - struct osmo_sub_auth_data auth = { - .type = OSMO_AUTH_TYPE_UMTS, - .algo = OSMO_AUTH_ALG_MILENAGE, - }; - - osmo_static_assert(sizeof(((struct osmo_sub_auth_data*)0)->u.umts.k) - == sizeof(state->secret_k), _secret_k_size_match); - osmo_static_assert(sizeof(((struct osmo_sub_auth_data*)0)->u.umts.opc) - == sizeof(state->secret_opc), _secret_opc_size_match); - - switch (state->state) { - case OAP_UNINITIALIZED: - case OAP_DISABLED: - return -1; - default: - break; - } - - memcpy(auth.u.umts.k, state->secret_k, sizeof(auth.u.umts.k)); - memcpy(auth.u.umts.opc, state->secret_opc, sizeof(auth.u.umts.opc)); - memset(auth.u.umts.amf, '\0', sizeof(auth.u.umts.amf)); - auth.u.umts.sqn = 41; /* TODO use incrementing sequence nr */ - - memset(&vec, 0, sizeof(vec)); - osmo_auth_gen_vec(&vec, &auth, rx_random); - - if (vec.res_len != 8) { - LOGP(DLOAP, LOGL_ERROR, "OAP: Expected XRES to be 8 octets, got %d\n", - vec.res_len); - return -3; - } - - if (osmo_constant_time_cmp(vec.autn, rx_autn, sizeof(vec.autn)) != 0) { - LOGP(DLOAP, LOGL_ERROR, "OAP: AUTN mismatch!\n"); - LOGP(DLOAP, LOGL_INFO, "OAP: AUTN from server: %s\n", - osmo_hexdump_nospc(rx_autn, sizeof(vec.autn))); - LOGP(DLOAP, LOGL_INFO, "OAP: AUTN expected: %s\n", - osmo_hexdump_nospc(vec.autn, sizeof(vec.autn))); - return -2; - } - - if (tx_xres != NULL) - memcpy(tx_xres, vec.res, 8); - return 0; -} - -struct msgb *oap_client_encoded(const struct osmo_oap_message *oap_msg) -{ - struct msgb *msg = msgb_alloc_headroom(1000, 64, __func__); - OSMO_ASSERT(msg); - osmo_oap_encode(msg, oap_msg); - return msg; -} - -/* Create a new msgb containing an OAP registration message. - * On error, return NULL. */ -static struct msgb* oap_msg_register(uint16_t client_id) -{ - struct osmo_oap_message oap_msg = {0}; - - if (client_id < 1) { - LOGP(DLOAP, LOGL_ERROR, "OAP: Invalid client ID: %d\n", client_id); - return NULL; - } - - oap_msg.message_type = OAP_MSGT_REGISTER_REQUEST; - oap_msg.client_id = client_id; - return oap_client_encoded(&oap_msg); -} - -int oap_client_register(struct oap_client_state *state, struct msgb **msg_tx) -{ - *msg_tx = oap_msg_register(state->client_id); - if (!(*msg_tx)) - return -1; - - state->state = OAP_REQUESTED_CHALLENGE; - return 0; -} - -/* Create a new msgb containing an OAP challenge response message. - * xres must point at 8 octets to return as challenge response. - * On error, return NULL. */ -static struct msgb* oap_msg_challenge_response(uint8_t *xres) -{ - struct osmo_oap_message oap_reply = {0}; - - oap_reply.message_type = OAP_MSGT_CHALLENGE_RESULT; - memcpy(oap_reply.xres, xres, sizeof(oap_reply.xres)); - oap_reply.xres_present = 1; - return oap_client_encoded(&oap_reply); -} - -static int handle_challenge(struct oap_client_state *state, - struct osmo_oap_message *oap_rx, - struct msgb **msg_tx) -{ - int rc; - uint8_t xres[8]; - - if (!(oap_rx->rand_present && oap_rx->autn_present)) { - LOGP(DLOAP, LOGL_ERROR, - "OAP challenge incomplete (rand_present: %d, autn_present: %d)\n", - oap_rx->rand_present, oap_rx->autn_present); - rc = -2; - goto failure; - } - - rc = oap_evaluate_challenge(state, - oap_rx->rand, - oap_rx->autn, - xres); - if (rc < 0) - goto failure; - - *msg_tx = oap_msg_challenge_response(xres); - if ((*msg_tx) == NULL) { - rc = -1; - goto failure; - } - - state->state = OAP_SENT_CHALLENGE_RESULT; - return 0; - -failure: - OSMO_ASSERT(rc < 0); - state->state = OAP_INITIALIZED; - return rc; -} - -int oap_client_handle(struct oap_client_state *state, - const struct msgb *msg_rx, struct msgb **msg_tx) -{ - uint8_t *data = msgb_l2(msg_rx); - size_t data_len = msgb_l2len(msg_rx); - struct osmo_oap_message oap_msg = {0}; - int rc = 0; - - *msg_tx = NULL; - - OSMO_ASSERT(data); - - rc = osmo_oap_decode(&oap_msg, data, data_len); - if (rc < 0) { - LOGP(DLOAP, LOGL_ERROR, - "Decoding OAP message failed with error '%s' (%d)\n", - get_value_string(gsm48_gmm_cause_names, -rc), -rc); - return -10; - } - - switch (state->state) { - case OAP_UNINITIALIZED: - LOGP(DLOAP, LOGL_ERROR, - "Received OAP message %d, but the OAP client is" - " not initialized\n", oap_msg.message_type); - return -ENOTCONN; - case OAP_DISABLED: - LOGP(DLOAP, LOGL_ERROR, - "Received OAP message %d, but the OAP client is" - " disabled\n", oap_msg.message_type); - return -ENOTCONN; - default: - break; - } - - switch (oap_msg.message_type) { - case OAP_MSGT_CHALLENGE_REQUEST: - return handle_challenge(state, &oap_msg, msg_tx); - - case OAP_MSGT_REGISTER_RESULT: - /* successfully registered */ - state->state = OAP_REGISTERED; - break; - - case OAP_MSGT_REGISTER_ERROR: - LOGP(DLOAP, LOGL_ERROR, - "OAP registration failed\n"); - state->state = OAP_INITIALIZED; - if (state->registration_failures < 3) { - state->registration_failures ++; - return oap_client_register(state, msg_tx); - } - return -11; - - case OAP_MSGT_REGISTER_REQUEST: - case OAP_MSGT_CHALLENGE_RESULT: - LOGP(DLOAP, LOGL_ERROR, - "Received invalid OAP message type for OAP client side: %d\n", - (int)oap_msg.message_type); - return -12; - - default: - LOGP(DLOAP, LOGL_ERROR, - "Unknown OAP message type: %d\n", - (int)oap_msg.message_type); - return -13; - } - - return 0; -} diff --git a/tests/Makefile.am b/tests/Makefile.am index f6a1efc..035cfb0 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -3,7 +3,6 @@ gbproxy \ gtphub \ sgsn \ - oap \ xid \ sndcp_xid \ slhc \ diff --git a/tests/oap/Makefile.am b/tests/oap/Makefile.am deleted file mode 100644 index ccc6d8c..0000000 --- a/tests/oap/Makefile.am +++ /dev/null @@ -1,32 +0,0 @@ -AM_CPPFLAGS = \ - $(all_includes) \ - -I$(top_srcdir)/include \ - $(NULL) - -AM_CFLAGS = \ - -Wall \ - -ggdb3 \ - $(LIBOSMOCORE_CFLAGS) \ - $(LIBOSMOGSM_CFLAGS) \ - $(NULL) - -EXTRA_DIST = \ - oap_client_test.ok \ - oap_client_test.err \ - $(NULL) - -noinst_PROGRAMS = \ - oap_client_test \ - $(NULL) - -oap_client_test_SOURCES = \ - oap_client_test.c \ - $(NULL) - -oap_client_test_LDADD = \ - $(top_builddir)/src/gprs/gprs_utils.o \ - $(top_builddir)/src/gprs/oap_client.o \ - $(LIBOSMOCORE_LIBS) \ - $(LIBOSMOGSM_LIBS) \ - -lrt - diff --git a/tests/oap/oap_client_test.c b/tests/oap/oap_client_test.c deleted file mode 100644 index 87d2070..0000000 --- a/tests/oap/oap_client_test.c +++ /dev/null @@ -1,271 +0,0 @@ -/* Test Osmocom Authentication Protocol */ -/* - * (C) 2015 by sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include - -#include -#include - -#include -#include - -static void test_oap_api(void) -{ - printf("Testing OAP API\n"); - - struct oap_client_config _config; - struct oap_client_config *config = &_config; - - struct oap_client_state _state; - struct oap_client_state *state = &_state; - - struct osmo_oap_message oap_rx; - struct msgb *msg_rx; - - struct osmo_oap_message oap_tx; - struct msgb *msg_tx; - - memset(config, 0, sizeof(*config)); - memset(state, 0, sizeof(*state)); - - OSMO_ASSERT(osmo_hexparse("0102030405060708090a0b0c0d0e0f10", config->secret_k, 16) == 16); - OSMO_ASSERT(osmo_hexparse("1112131415161718191a1b1c1d1e1f20", config->secret_opc, 16) == 16); - - fprintf(stderr, "- make sure filling with zeros means uninitialized\n"); - OSMO_ASSERT(state->state == OAP_UNINITIALIZED); - - fprintf(stderr, "- reject messages in uninitialized state\n"); - memset(&oap_rx, 0, sizeof(oap_rx)); - state->client_id = 1; - oap_rx.message_type = OAP_MSGT_REGISTER_ERROR; - msg_rx = oap_client_encoded(&oap_rx); - OSMO_ASSERT(oap_client_handle(state, msg_rx, &msg_tx) < 0); - OSMO_ASSERT(state->state == OAP_UNINITIALIZED); - msgb_free(msg_rx); - OSMO_ASSERT(!msg_tx); - - fprintf(stderr, "- NULL config should disable\n"); - OSMO_ASSERT( oap_client_init(NULL, state) == 0 ); - OSMO_ASSERT(state->state == OAP_DISABLED); - - fprintf(stderr, "- reject messages in disabled state\n"); - memset(state, 0, sizeof(*state)); - memset(&oap_rx, 0, sizeof(oap_rx)); - state->state = OAP_DISABLED; - state->client_id = 1; - oap_rx.message_type = OAP_MSGT_REGISTER_ERROR; - msg_rx = oap_client_encoded(&oap_rx); - OSMO_ASSERT(oap_client_handle(state, msg_rx, &msg_tx) < 0); - OSMO_ASSERT(state->state == OAP_DISABLED); - msgb_free(msg_rx); - OSMO_ASSERT(!msg_tx); - - fprintf(stderr, "- invalid client_id and shared secret\n"); - memset(state, 0, sizeof(*state)); - config->client_id = 0; - config->secret_k_present = 0; - config->secret_opc_present = 0; - OSMO_ASSERT( oap_client_init(config, state) == 0 ); - OSMO_ASSERT(state->state == OAP_DISABLED); - - fprintf(stderr, "- reset state\n"); - memset(state, 0, sizeof(*state)); - - fprintf(stderr, "- only client_id is invalid\n"); - config->client_id = 0; - config->secret_k_present = 1; - config->secret_opc_present = 1; - OSMO_ASSERT( oap_client_init(config, state) == 0 ); - OSMO_ASSERT(state->state == OAP_DISABLED); - - memset(state, 0, sizeof(*state)); - - fprintf(stderr, "- valid id, but omitted shared_secret (1/2)\n"); - config->client_id = 12345; - config->secret_k_present = 0; - config->secret_opc_present = 1; - OSMO_ASSERT( oap_client_init(config, state) == 0 ); - OSMO_ASSERT(state->state == OAP_DISABLED); - - memset(state, 0, sizeof(*state)); - - fprintf(stderr, "- valid id, but omitted shared_secret (2/2)\n"); - config->client_id = 12345; - config->secret_k_present = 1; - config->secret_opc_present = 0; - OSMO_ASSERT( oap_client_init(config, state) == 0 ); - OSMO_ASSERT(state->state == OAP_DISABLED); - - memset(state, 0, sizeof(*state)); - - - fprintf(stderr, "- mint configuration\n"); - config->client_id = 12345; - config->secret_k_present = 1; - config->secret_opc_present = 1; - /*config->secret_* buffers are still set from the top */ - OSMO_ASSERT( oap_client_init(config, state) == 0 ); - OSMO_ASSERT(state->state == OAP_INITIALIZED); - - - fprintf(stderr, "- Missing challenge data\n"); - memset(&oap_rx, 0, sizeof(oap_rx)); - oap_rx.message_type = OAP_MSGT_CHALLENGE_REQUEST; - oap_rx.rand_present = 0; - oap_rx.autn_present = 0; - msg_rx = oap_client_encoded(&oap_rx); - OSMO_ASSERT(oap_client_handle(state, msg_rx, &msg_tx) == -2); - msgb_free(msg_rx); - OSMO_ASSERT(!msg_tx); - - fprintf(stderr, "- AUTN missing\n"); - osmo_hexparse("0102030405060708090a0b0c0d0e0f10", - oap_rx.rand, 16); - oap_rx.rand_present = 1; - msg_rx = oap_client_encoded(&oap_rx); - OSMO_ASSERT(oap_client_handle(state, msg_rx, &msg_tx) == -2); - msgb_free(msg_rx); - OSMO_ASSERT(!msg_tx); - - fprintf(stderr, "- RAND missing\n"); - oap_rx.rand_present = 0; - osmo_hexparse("cec4e3848a33000086781158ca40f136", - oap_rx.autn, 16); - oap_rx.autn_present = 1; - msg_rx = oap_client_encoded(&oap_rx); - OSMO_ASSERT(oap_client_handle(state, msg_rx, &msg_tx) == -2); - msgb_free(msg_rx); - OSMO_ASSERT(!msg_tx); - - fprintf(stderr, "- wrong autn (by one bit)\n"); - osmo_hexparse("0102030405060708090a0b0c0d0e0f10", - oap_rx.rand, 16); - osmo_hexparse("dec4e3848a33000086781158ca40f136", - oap_rx.autn, 16); - oap_rx.rand_present = 1; - oap_rx.autn_present = 1; - msg_rx = oap_client_encoded(&oap_rx); - OSMO_ASSERT(oap_client_handle(state, msg_rx, &msg_tx) == -2); - msgb_free(msg_rx); - OSMO_ASSERT(!msg_tx); - - fprintf(stderr, "- all data correct\n"); - osmo_hexparse("cec4e3848a33000086781158ca40f136", - oap_rx.autn, 16); - msg_rx = oap_client_encoded(&oap_rx); - - fprintf(stderr, "- but refuse to evaluate in uninitialized state\n"); - OSMO_ASSERT(state->state == OAP_INITIALIZED); - - state->state = OAP_UNINITIALIZED; - OSMO_ASSERT(oap_client_handle(state, msg_rx, &msg_tx) < 0); - OSMO_ASSERT(!msg_tx); - - state->state = OAP_DISABLED; - OSMO_ASSERT(oap_client_handle(state, msg_rx, &msg_tx) < 0); - OSMO_ASSERT(!msg_tx); - - state->state = OAP_INITIALIZED; - - fprintf(stderr, "- now everything is correct\n"); - /* a successful return value here indicates correct autn */ - OSMO_ASSERT(oap_client_handle(state, msg_rx, &msg_tx) == 0); - msgb_free(msg_rx); - - fprintf(stderr, "- Expect the challenge response in msg_tx\n"); - OSMO_ASSERT(msg_tx); - OSMO_ASSERT(osmo_oap_decode(&oap_tx, msg_tx->data, msg_tx->len) == 0); - OSMO_ASSERT(oap_tx.message_type == OAP_MSGT_CHALLENGE_RESULT); - OSMO_ASSERT(strcmp("e2d05b598c61d9ba", - osmo_hexdump_nospc(oap_tx.xres, sizeof(oap_tx.xres))) - == 0); - OSMO_ASSERT(state->state == OAP_SENT_CHALLENGE_RESULT); - msgb_free(msg_tx); - msg_tx = 0; - - struct oap_client_state saved_state = _state; - - fprintf(stderr, "- Receive registration error for the first time.\n"); - - memset(&oap_rx, 0, sizeof(oap_rx)); - oap_rx.message_type = OAP_MSGT_REGISTER_ERROR; - oap_rx.cause = GMM_CAUSE_PROTO_ERR_UNSPEC; - msg_rx = oap_client_encoded(&oap_rx); - - OSMO_ASSERT(state->registration_failures == 0); - OSMO_ASSERT(oap_client_handle(state, msg_rx, &msg_tx) == 0); - OSMO_ASSERT(state->registration_failures == 1); - OSMO_ASSERT(msg_tx); - OSMO_ASSERT(osmo_oap_decode(&oap_tx, msg_tx->data, msg_tx->len) == 0); - OSMO_ASSERT(oap_tx.message_type == OAP_MSGT_REGISTER_REQUEST); - OSMO_ASSERT(state->state == OAP_REQUESTED_CHALLENGE); - msgb_free(msg_tx); - msg_tx = 0; - - fprintf(stderr, "- Receive registration error for the Nth time.\n"); - state->registration_failures = 999; - OSMO_ASSERT(oap_client_handle(state, msg_rx, &msg_tx) == -11); - OSMO_ASSERT(!msg_tx); - OSMO_ASSERT(state->state == OAP_INITIALIZED); - msgb_free(msg_tx); - msg_tx = 0; - - msgb_free(msg_rx); - - fprintf(stderr, "- Registration success\n"); - - _state = saved_state; - memset(&oap_rx, 0, sizeof(oap_rx)); - oap_rx.message_type = OAP_MSGT_REGISTER_RESULT; - msg_rx = oap_client_encoded(&oap_rx); - OSMO_ASSERT(oap_client_handle(state, msg_rx, &msg_tx) == 0); - OSMO_ASSERT(!msg_tx); - OSMO_ASSERT(state->state == OAP_REGISTERED); - msgb_free(msg_rx); -} - -static struct log_info_cat oap_client_test_categories[] = { -}; - -static struct log_info info = { - .cat = oap_client_test_categories, - .num_cat = ARRAY_SIZE(oap_client_test_categories), -}; - -int main(int argc, char **argv) -{ - void *ctx = talloc_named_const(NULL, 0, "oap_client_test"); - msgb_talloc_ctx_init(ctx, 0); - osmo_init_logging2(ctx, &info); - - OSMO_ASSERT(osmo_stderr_target); - log_set_use_color(osmo_stderr_target, 0); - log_set_print_timestamp(osmo_stderr_target, 0); - log_set_print_filename(osmo_stderr_target, 0); - log_set_print_category(osmo_stderr_target, 1); - log_parse_category_mask(osmo_stderr_target, "DLOAP,1"); - - test_oap_api(); - printf("Done\n"); - - return 0; -} - diff --git a/tests/oap/oap_client_test.err b/tests/oap/oap_client_test.err deleted file mode 100644 index 62ddc9e..0000000 --- a/tests/oap/oap_client_test.err +++ /dev/null @@ -1,35 +0,0 @@ -- make sure filling with zeros means uninitialized -- reject messages in uninitialized state -DLOAP Received OAP message 5, but the OAP client is not initialized -- NULL config should disable -- reject messages in disabled state -DLOAP Received OAP message 5, but the OAP client is disabled -- invalid client_id and shared secret -- reset state -- only client_id is invalid -- valid id, but omitted shared_secret (1/2) -DLOAP OAP: client ID set, but secret K missing. -- valid id, but omitted shared_secret (2/2) -DLOAP OAP: client ID set, but secret OPC missing. -- mint configuration -- Missing challenge data -DLOAP OAP challenge incomplete (rand_present: 0, autn_present: 0) -- AUTN missing -DLOAP OAP challenge incomplete (rand_present: 1, autn_present: 0) -- RAND missing -DLOAP OAP challenge incomplete (rand_present: 0, autn_present: 1) -- wrong autn (by one bit) -DLOAP OAP: AUTN mismatch! -DLOAP OAP: AUTN from server: dec4e3848a33000086781158ca40f136 -DLOAP OAP: AUTN expected: cec4e3848a33000086781158ca40f136 -- all data correct -- but refuse to evaluate in uninitialized state -DLOAP Received OAP message 8, but the OAP client is not initialized -DLOAP Received OAP message 8, but the OAP client is disabled -- now everything is correct -- Expect the challenge response in msg_tx -- Receive registration error for the first time. -DLOAP OAP registration failed -- Receive registration error for the Nth time. -DLOAP OAP registration failed -- Registration success diff --git a/tests/oap/oap_client_test.ok b/tests/oap/oap_client_test.ok deleted file mode 100644 index 59108a7..0000000 --- a/tests/oap/oap_client_test.ok +++ /dev/null @@ -1,2 +0,0 @@ -Testing OAP API -Done diff --git a/tests/testsuite.at b/tests/testsuite.at index 81cd713..d30115e 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -20,14 +20,6 @@ AT_CHECK([$abs_top_builddir/tests/sgsn/sgsn_test], [], [expout], [ignore]) AT_CLEANUP -AT_SETUP([oap]) -AT_KEYWORDS([oap]) -AT_CHECK([test "$enable_oap_test" != no || exit 77]) -cat $abs_srcdir/oap/oap_client_test.ok > expout -cat $abs_srcdir/oap/oap_client_test.err > experr -AT_CHECK([$abs_top_builddir/tests/oap/oap_client_test], [], [expout], [experr]) -AT_CLEANUP - AT_SETUP([gtphub]) AT_KEYWORDS([gtphub]) AT_CHECK([test "$enable_gtphub_test" != no || exit 77]) -- To view, visit https://gerrit.osmocom.org/10259 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I7b194f98ef3f925b6178d8a8dbd9fcf2f0c6e132 Gerrit-Change-Number: 10259 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 16:29:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 16:29:20 +0000 Subject: Change in osmo-sgsn[master]: migrate to oap_client in libosmogsm In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10259 to look at the new patch set (#2). Change subject: migrate to oap_client in libosmogsm ...................................................................... migrate to oap_client in libosmogsm libosmogsm in libosmocore.git from Change-Id Ie36729996abd30b84d1c30a09f62ebc6a9794950 onwards contains oap_client.c, so we don't need our local copy here in this repo anymore. Change-Id: I7b194f98ef3f925b6178d8a8dbd9fcf2f0c6e132 Requires: libosmocore.git Change-Id Ie36729996abd30b84d1c30a09f62ebc6a9794950 --- M configure.ac M include/osmocom/sgsn/Makefile.am M include/osmocom/sgsn/gsup_client.h D include/osmocom/sgsn/oap_client.h M include/osmocom/sgsn/sgsn.h M src/gprs/Makefile.am M src/gprs/gsup_client.c D src/gprs/oap_client.c M src/libcommon/gsup_client.c D src/libcommon/oap_client.c M tests/Makefile.am D tests/oap/Makefile.am D tests/oap/oap_client_test.c D tests/oap/oap_client_test.err D tests/oap/oap_client_test.ok M tests/testsuite.at 16 files changed, 15 insertions(+), 1,009 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/59/10259/2 -- To view, visit https://gerrit.osmocom.org/10259 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7b194f98ef3f925b6178d8a8dbd9fcf2f0c6e132 Gerrit-Change-Number: 10259 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 16:29:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 16:29:20 +0000 Subject: Change in osmo-sgsn[master]: remove libcommon Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10260 Change subject: remove libcommon ...................................................................... remove libcommon This seems to b remaining from ancient days. The code in there is either no longer needed, or has been moved to libosmocore. Change-Id: I9307f9da7f48dd0a2e1cb213072068736e569722 --- D src/libcommon/Makefile.am D src/libcommon/debug.c D src/libcommon/gsm_data.c D src/libcommon/gsm_data_shared.c D src/libcommon/gsm_subscriber_base.c D src/libcommon/gsup_client.c D src/libcommon/gsup_test_client.c D src/libcommon/socket.c D src/libcommon/talloc_ctx.c 9 files changed, 0 insertions(+), 2,446 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/60/10260/1 diff --git a/src/libcommon/Makefile.am b/src/libcommon/Makefile.am deleted file mode 100644 index 69fb37d..0000000 --- a/src/libcommon/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -AM_CPPFLAGS = \ - $(all_includes) \ - -I$(top_srcdir)/include \ - -I$(top_builddir) \ - $(NULL) - -AM_CFLAGS = \ - -Wall \ - $(LIBOSMOCORE_CFLAGS) \ - $(LIBOSMOGSM_CFLAGS) \ - $(LIBOSMOVTY_CFLAGS) \ - $(LIBOSMOABIS_CFLAGS) \ - $(COVERAGE_CFLAGS) \ - $(NULL) - -noinst_LIBRARIES = \ - libcommon.a \ - $(NULL) - -libcommon_a_SOURCES = \ - debug.c \ - gsm_data.c \ - gsm_data_shared.c \ - gsup_client.c \ - oap_client.c \ - socket.c \ - talloc_ctx.c \ - gsm_subscriber_base.c \ - $(NULL) - -noinst_PROGRAMS = \ - gsup_test_client \ - $(NULL) - -gsup_test_client_SOURCES = \ - gsup_test_client.c \ - $(NULL) -gsup_test_client_LDADD = \ - libcommon.a \ - $(LIBOSMOCORE_LIBS) \ - $(LIBOSMOGSM_LIBS) \ - $(LIBOSMOVTY_LIBS) \ - $(LIBOSMOABIS_LIBS) \ - -lrt \ - $(NULL) diff --git a/src/libcommon/debug.c b/src/libcommon/debug.c deleted file mode 100644 index 27d7575..0000000 --- a/src/libcommon/debug.c +++ /dev/null @@ -1,222 +0,0 @@ -/* OpenBSC Debugging/Logging support code */ - -/* (C) 2008-2010 by Harald Welte - * (C) 2008 by Holger Hans Peter Freyther - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -/* default categories */ -static const struct log_info_cat default_categories[] = { - [DRLL] = { - .name = "DRLL", - .description = "A-bis Radio Link Layer (RLL)", - .color = "\033[1;31m", - .enabled = 1, .loglevel = LOGL_NOTICE, - }, - [DCC] = { - .name = "DCC", - .description = "Layer3 Call Control (CC)", - .color = "\033[1;32m", - .enabled = 1, .loglevel = LOGL_NOTICE, - }, - [DMM] = { - .name = "DMM", - .description = "Layer3 Mobility Management (MM)", - .color = "\033[1;33m", - .enabled = 1, .loglevel = LOGL_NOTICE, - }, - [DRR] = { - .name = "DRR", - .description = "Layer3 Radio Resource (RR)", - .color = "\033[1;34m", - .enabled = 1, .loglevel = LOGL_NOTICE, - }, - [DRSL] = { - .name = "DRSL", - .description = "A-bis Radio Siganlling Link (RSL)", - .color = "\033[1;35m", - .enabled = 1, .loglevel = LOGL_NOTICE, - }, - [DNM] = { - .name = "DNM", - .description = "A-bis Network Management / O&M (NM/OML)", - .color = "\033[1;36m", - .enabled = 1, .loglevel = LOGL_INFO, - }, - [DMNCC] = { - .name = "DMNCC", - .description = "MNCC API for Call Control application", - .color = "\033[1;39m", - .enabled = 1, .loglevel = LOGL_NOTICE, - }, - [DPAG] = { - .name = "DPAG", - .description = "Paging Subsystem", - .color = "\033[1;38m", - .enabled = 1, .loglevel = LOGL_NOTICE, - }, - [DMEAS] = { - .name = "DMEAS", - .description = "Radio Measurement Processing", - .enabled = 0, .loglevel = LOGL_NOTICE, - }, - [DSCCP] = { - .name = "DSCCP", - .description = "SCCP Protocol", - .enabled = 1, .loglevel = LOGL_NOTICE, - }, - [DMSC] = { - .name = "DMSC", - .description = "Mobile Switching Center", - .enabled = 1, .loglevel = LOGL_NOTICE, - }, - [DHO] = { - .name = "DHO", - .description = "Hand-Over", - .enabled = 1, .loglevel = LOGL_NOTICE, - }, - [DDB] = { - .name = "DDB", - .description = "Database Layer", - .enabled = 1, .loglevel = LOGL_NOTICE, - }, - [DREF] = { - .name = "DREF", - .description = "Reference Counting", - .enabled = 0, .loglevel = LOGL_NOTICE, - }, - [DGPRS] = { - .name = "DGPRS", - .description = "GPRS Packet Service", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, - [DNS] = { - .name = "DNS", - .description = "GPRS Network Service (NS)", - .enabled = 1, .loglevel = LOGL_INFO, - }, - [DBSSGP] = { - .name = "DBSSGP", - .description = "GPRS BSS Gateway Protocol (BSSGP)", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, - [DLLC] = { - .name = "DLLC", - .description = "GPRS Logical Link Control Protocol (LLC)", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, - [DSNDCP] = { - .name = "DSNDCP", - .description = "GPRS Sub-Network Dependent Control Protocol (SNDCP)", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, - [DNAT] = { - .name = "DNAT", - .description = "GSM 08.08 NAT/Multiplexer", - .enabled = 1, .loglevel = LOGL_NOTICE, - }, - [DCTRL] = { - .name = "DCTRL", - .description = "Control interface", - .enabled = 1, .loglevel = LOGL_NOTICE, - }, - [DFILTER] = { - .name = "DFILTER", - .description = "BSC/NAT IMSI based filtering", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, - [DRANAP] = { - .name = "DRANAP", - .description = "Radio Access Network Application Part Protocol", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, - [DSUA] = { - .name = "DSUA", - .description = "SCCP User Adaptation Protocol", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, - [DPCU] = { - .name = "DPCU", - .description = "PCU Interface", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, - [DVLR] = { - .name = "DVLR", - .description = "Visitor Location Register", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, - [DIUCS] = { - .name = "DIUCS", - .description = "Iu-CS Protocol", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, - [DSIGTRAN] = { - .name = "DSIGTRAN", - .description = "SIGTRAN Signalling Transport", - .color = "\033[1;29m", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, -}; - -static int filter_fn(const struct log_context *ctx, struct log_target *tar) -{ - const struct vlr_subscr *vsub = ctx->ctx[LOG_CTX_VLR_SUBSCR]; - const struct bsc_subscr *bsub = ctx->ctx[LOG_CTX_BSC_SUBSCR]; - const struct gprs_nsvc *nsvc = ctx->ctx[LOG_CTX_GB_NSVC]; - const struct gprs_nsvc *bvc = ctx->ctx[LOG_CTX_GB_BVC]; - - if ((tar->filter_map & (1 << LOG_FLT_VLR_SUBSCR)) != 0 - && vsub && vsub == tar->filter_data[LOG_FLT_VLR_SUBSCR]) - return 1; - - if ((tar->filter_map & (1 << LOG_FLT_BSC_SUBSCR)) != 0 - && bsub && bsub == tar->filter_data[LOG_FLT_BSC_SUBSCR]) - return 1; - - /* Filter on the NS Virtual Connection */ - if ((tar->filter_map & (1 << LOG_FLT_GB_NSVC)) != 0 - && nsvc && (nsvc == tar->filter_data[LOG_FLT_GB_NSVC])) - return 1; - - /* Filter on the NS Virtual Connection */ - if ((tar->filter_map & (1 << LOG_FLT_GB_BVC)) != 0 - && bvc && (bvc == tar->filter_data[LOG_FLT_GB_BVC])) - return 1; - - return 0; -} - -const struct log_info log_info = { - .filter_fn = filter_fn, - .cat = default_categories, - .num_cat = ARRAY_SIZE(default_categories), -}; diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c deleted file mode 100644 index 6400963..0000000 --- a/src/libcommon/gsm_data.c +++ /dev/null @@ -1,450 +0,0 @@ -/* (C) 2008-2010 by Harald Welte - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -void *tall_bsc_ctx; - -static LLIST_HEAD(bts_models); - -void set_ts_e1link(struct gsm_bts_trx_ts *ts, uint8_t e1_nr, - uint8_t e1_ts, uint8_t e1_ts_ss) -{ - ts->e1_link.e1_nr = e1_nr; - ts->e1_link.e1_ts = e1_ts; - ts->e1_link.e1_ts_ss = e1_ts_ss; -} - -static struct gsm_bts_model *bts_model_find(enum gsm_bts_type type) -{ - struct gsm_bts_model *model; - - llist_for_each_entry(model, &bts_models, list) { - if (model->type == type) - return model; - } - - return NULL; -} - -int gsm_bts_model_register(struct gsm_bts_model *model) -{ - if (bts_model_find(model->type)) - return -EEXIST; - - tlv_def_patch(&model->nm_att_tlvdef, &abis_nm_att_tlvdef); - llist_add_tail(&model->list, &bts_models); - return 0; -} - -const struct value_string bts_type_descs[_NUM_GSM_BTS_TYPE+1] = { - { GSM_BTS_TYPE_UNKNOWN, "Unknown BTS Type" }, - { GSM_BTS_TYPE_BS11, "Siemens BTS (BS-11 or compatible)" }, - { GSM_BTS_TYPE_NANOBTS, "ip.access nanoBTS or compatible" }, - { GSM_BTS_TYPE_RBS2000, "Ericsson RBS2000 Series" }, - { GSM_BTS_TYPE_NOKIA_SITE, "Nokia {Metro,Ultra,In}Site" }, - { GSM_BTS_TYPE_OSMOBTS, "sysmocom sysmoBTS" }, - { 0, NULL } -}; - -struct gsm_bts_trx *gsm_bts_trx_by_nr(struct gsm_bts *bts, int nr) -{ - struct gsm_bts_trx *trx; - - llist_for_each_entry(trx, &bts->trx_list, list) { - if (trx->nr == nr) - return trx; - } - return NULL; -} - -/* Search for a BTS in the given Location Area; optionally start searching - * with start_bts (for continuing to search after the first result) */ -struct gsm_bts *gsm_bts_by_lac(struct gsm_network *net, unsigned int lac, - struct gsm_bts *start_bts) -{ - int i; - struct gsm_bts *bts; - int skip = 0; - - if (start_bts) - skip = 1; - - for (i = 0; i < net->num_bts; i++) { - bts = gsm_bts_num(net, i); - - if (skip) { - if (start_bts == bts) - skip = 0; - continue; - } - - if (lac == GSM_LAC_RESERVED_ALL_BTS || bts->location_area_code == lac) - return bts; - } - return NULL; -} - -static const struct value_string auth_policy_names[] = { - { GSM_AUTH_POLICY_CLOSED, "closed" }, - { GSM_AUTH_POLICY_ACCEPT_ALL, "accept-all" }, - { GSM_AUTH_POLICY_TOKEN, "token" }, - { GSM_AUTH_POLICY_REGEXP, "regexp" }, - { 0, NULL } -}; - -enum gsm_auth_policy gsm_auth_policy_parse(const char *arg) -{ - return get_string_value(auth_policy_names, arg); -} - -const char *gsm_auth_policy_name(enum gsm_auth_policy policy) -{ - return get_value_string(auth_policy_names, policy); -} - -static const struct value_string rrlp_mode_names[] = { - { RRLP_MODE_NONE, "none" }, - { RRLP_MODE_MS_BASED, "ms-based" }, - { RRLP_MODE_MS_PREF, "ms-preferred" }, - { RRLP_MODE_ASS_PREF, "ass-preferred" }, - { 0, NULL } -}; - -enum rrlp_mode rrlp_mode_parse(const char *arg) -{ - return get_string_value(rrlp_mode_names, arg); -} - -const char *rrlp_mode_name(enum rrlp_mode mode) -{ - return get_value_string(rrlp_mode_names, mode); -} - -static const struct value_string bts_gprs_mode_names[] = { - { BTS_GPRS_NONE, "none" }, - { BTS_GPRS_GPRS, "gprs" }, - { BTS_GPRS_EGPRS, "egprs" }, - { 0, NULL } -}; - -enum bts_gprs_mode bts_gprs_mode_parse(const char *arg, int *valid) -{ - int rc; - - rc = get_string_value(bts_gprs_mode_names, arg); - if (valid) - *valid = rc != -EINVAL; - return rc; -} - -const char *bts_gprs_mode_name(enum bts_gprs_mode mode) -{ - return get_value_string(bts_gprs_mode_names, mode); -} - -int bts_gprs_mode_is_compat(struct gsm_bts *bts, enum bts_gprs_mode mode) -{ - if (mode != BTS_GPRS_NONE && - !gsm_btsmodel_has_feature(bts->model, BTS_FEAT_GPRS)) { - return 0; - } - if (mode == BTS_GPRS_EGPRS && - !gsm_btsmodel_has_feature(bts->model, BTS_FEAT_EGPRS)) { - return 0; - } - - return 1; -} - -int gsm_btsmodel_set_feature(struct gsm_bts_model *model, enum gsm_bts_features feat) -{ - OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES); - return bitvec_set_bit_pos(&model->features, feat, 1); -} - -bool gsm_btsmodel_has_feature(struct gsm_bts_model *model, enum gsm_bts_features feat) -{ - OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES); - return bitvec_get_bit_pos(&model->features, feat); -} - -int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type) -{ - struct gsm_bts_model *model; - - model = bts_model_find(type); - if (!model) - return -EINVAL; - - bts->type = type; - bts->model = model; - - if (model->start && !model->started) { - int ret = model->start(bts->network); - if (ret < 0) - return ret; - - model->started = true; - } - - switch (bts->type) { - case GSM_BTS_TYPE_NANOBTS: - case GSM_BTS_TYPE_OSMOBTS: - /* Set the default OML Stream ID to 0xff */ - bts->oml_tei = 0xff; - bts->c0->nominal_power = 23; - break; - case GSM_BTS_TYPE_RBS2000: - INIT_LLIST_HEAD(&bts->rbs2000.is.conn_groups); - INIT_LLIST_HEAD(&bts->rbs2000.con.conn_groups); - break; - case GSM_BTS_TYPE_BS11: - case GSM_BTS_TYPE_UNKNOWN: - case GSM_BTS_TYPE_NOKIA_SITE: - /* Set default BTS reset timer */ - bts->nokia.bts_reset_timer_cnf = 15; - case _NUM_GSM_BTS_TYPE: - break; - } - - return 0; -} - -struct gsm_bts *gsm_bts_alloc_register(struct gsm_network *net, enum gsm_bts_type type, - uint8_t bsic) -{ - struct gsm_bts_model *model = bts_model_find(type); - struct gsm_bts *bts; - - if (!model && type != GSM_BTS_TYPE_UNKNOWN) - return NULL; - - bts = gsm_bts_alloc(net, net->num_bts); - if (!bts) - return NULL; - - net->num_bts++; - - bts->network = net; - bts->type = type; - bts->model = model; - bts->bsic = bsic; - bts->dtxu = GSM48_DTX_SHALL_NOT_BE_USED; - bts->dtxd = false; - bts->gprs.ctrl_ack_type_use_block = true; /* use RLC/MAC control block */ - bts->neigh_list_manual_mode = 0; - bts->si_common.cell_sel_par.cell_resel_hyst = 2; /* 4 dB */ - bts->si_common.cell_sel_par.rxlev_acc_min = 0; - bts->si_common.si2quater_neigh_list.arfcn = bts->si_common.data.earfcn_list; - bts->si_common.si2quater_neigh_list.meas_bw = bts->si_common.data.meas_bw_list; - bts->si_common.si2quater_neigh_list.length = MAX_EARFCN_LIST; - bts->si_common.si2quater_neigh_list.thresh_hi = 0; - osmo_earfcn_init(&bts->si_common.si2quater_neigh_list); - bts->si_common.neigh_list.data = bts->si_common.data.neigh_list; - bts->si_common.neigh_list.data_len = - sizeof(bts->si_common.data.neigh_list); - bts->si_common.si5_neigh_list.data = bts->si_common.data.si5_neigh_list; - bts->si_common.si5_neigh_list.data_len = - sizeof(bts->si_common.data.si5_neigh_list); - bts->si_common.cell_alloc.data = bts->si_common.data.cell_alloc; - bts->si_common.cell_alloc.data_len = - sizeof(bts->si_common.data.cell_alloc); - bts->si_common.rach_control.re = 1; /* no re-establishment */ - bts->si_common.rach_control.tx_integer = 9; /* 12 slots spread - 217/115 slots delay */ - bts->si_common.rach_control.max_trans = 3; /* 7 retransmissions */ - bts->si_common.rach_control.t2 = 4; /* no emergency calls */ - bts->si_common.chan_desc.att = 1; /* attachment required */ - bts->si_common.chan_desc.bs_pa_mfrms = RSL_BS_PA_MFRMS_5; /* paging frames */ - bts->si_common.chan_desc.bs_ag_blks_res = 1; /* reserved AGCH blocks */ - bts->si_common.chan_desc.t3212 = net->t3212; /* Use network's current value */ - gsm_bts_set_radio_link_timeout(bts, 32); /* Use RADIO LINK TIMEOUT of 32 */ - - llist_add_tail(&bts->list, &net->bts_list); - - INIT_LLIST_HEAD(&bts->abis_queue); - - INIT_LLIST_HEAD(&bts->loc_list); - - return bts; -} - -void gprs_ra_id_by_bts(struct gprs_ra_id *raid, struct gsm_bts *bts) -{ - raid->mcc = bts->network->country_code; - raid->mnc = bts->network->network_code; - raid->lac = bts->location_area_code; - raid->rac = bts->gprs.rac; -} - -int gsm_parse_reg(void *ctx, regex_t *reg, char **str, int argc, const char **argv) -{ - int ret; - - ret = 0; - if (*str) { - talloc_free(*str); - *str = NULL; - } - regfree(reg); - - if (argc > 0) { - *str = talloc_strdup(ctx, argv[0]); - ret = regcomp(reg, argv[0], 0); - - /* handle compilation failures */ - if (ret != 0) { - talloc_free(*str); - *str = NULL; - } - } - - return ret; -} - -/* Assume there are only 256 possible bts */ -osmo_static_assert(sizeof(((struct gsm_bts *) 0)->nr) == 1, _bts_nr_is_256); -static void depends_calc_index_bit(int bts_nr, int *idx, int *bit) -{ - *idx = bts_nr / (8 * 4); - *bit = bts_nr % (8 * 4); -} - -void bts_depend_mark(struct gsm_bts *bts, int dep) -{ - int idx, bit; - depends_calc_index_bit(dep, &idx, &bit); - - bts->depends_on[idx] |= 1 << bit; -} - -void bts_depend_clear(struct gsm_bts *bts, int dep) -{ - int idx, bit; - depends_calc_index_bit(dep, &idx, &bit); - - bts->depends_on[idx] &= ~(1 << bit); -} - -int bts_depend_is_depedency(struct gsm_bts *base, struct gsm_bts *other) -{ - int idx, bit; - depends_calc_index_bit(other->nr, &idx, &bit); - - /* Check if there is a depends bit */ - return (base->depends_on[idx] & (1 << bit)) > 0; -} - -static int bts_is_online(struct gsm_bts *bts) -{ - /* TODO: support E1 BTS too */ - if (!is_ipaccess_bts(bts)) - return 1; - - if (!bts->oml_link) - return 0; - - return bts->mo.nm_state.operational == NM_OPSTATE_ENABLED; -} - -int bts_depend_check(struct gsm_bts *bts) -{ - struct gsm_bts *other_bts; - - llist_for_each_entry(other_bts, &bts->network->bts_list, list) { - if (!bts_depend_is_depedency(bts, other_bts)) - continue; - if (bts_is_online(other_bts)) - continue; - return 0; - } - return 1; -} - -/* get the radio link timeout (based on SACCH decode errors, according - * to algorithm specified in TS 05.08 section 5.2. A value of -1 - * indicates we should use an infinitely long timeout, which only works - * with OsmoBTS as the BTS implementation */ -int gsm_bts_get_radio_link_timeout(const struct gsm_bts *bts) -{ - const struct gsm48_cell_options *cell_options = &bts->si_common.cell_options; - - if (bts->infinite_radio_link_timeout) - return -1; - else { - /* Encoding as per Table 10.5.21 of TS 04.08 */ - return (cell_options->radio_link_timeout + 1) << 2; - } -} - -/* set the radio link timeout (based on SACCH decode errors, according - * to algorithm specified in TS 05.08 Section 5.2. A value of -1 - * indicates we should use an infinitely long timeout, which only works - * with OsmoBTS as the BTS implementation */ -void gsm_bts_set_radio_link_timeout(struct gsm_bts *bts, int value) -{ - struct gsm48_cell_options *cell_options = &bts->si_common.cell_options; - - if (value < 0) - bts->infinite_radio_link_timeout = true; - else { - bts->infinite_radio_link_timeout = false; - /* Encoding as per Table 10.5.21 of TS 04.08 */ - if (value < 4) - value = 4; - if (value > 64) - value = 64; - cell_options->radio_link_timeout = (value >> 2) - 1; - } -} - -bool classmark_is_r99(struct gsm_classmark *cm) -{ - int rev_lev = 0; - if (cm->classmark1_set) - rev_lev = cm->classmark1.rev_lev; - else if (cm->classmark2_len > 0) - rev_lev = (cm->classmark2[0] >> 5) & 0x3; - return rev_lev >= 2; -} - -const struct value_string ran_type_names[] = { - OSMO_VALUE_STRING(RAN_UNKNOWN), - OSMO_VALUE_STRING(RAN_GERAN_A), - OSMO_VALUE_STRING(RAN_UTRAN_IU), - { 0, NULL } -}; diff --git a/src/libcommon/gsm_data_shared.c b/src/libcommon/gsm_data_shared.c deleted file mode 100644 index 8d5f990..0000000 --- a/src/libcommon/gsm_data_shared.c +++ /dev/null @@ -1,853 +0,0 @@ -/* (C) 2008-2010 by Harald Welte - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - - -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include - -#include - -void gsm_abis_mo_reset(struct gsm_abis_mo *mo) -{ - mo->nm_state.operational = NM_OPSTATE_NULL; - mo->nm_state.availability = NM_AVSTATE_POWER_OFF; -} - -static void gsm_mo_init(struct gsm_abis_mo *mo, struct gsm_bts *bts, - uint8_t obj_class, uint8_t p1, uint8_t p2, uint8_t p3) -{ - mo->bts = bts; - mo->obj_class = obj_class; - mo->obj_inst.bts_nr = p1; - mo->obj_inst.trx_nr = p2; - mo->obj_inst.ts_nr = p3; - gsm_abis_mo_reset(mo); -} - -const struct value_string bts_attribute_names[] = { - OSMO_VALUE_STRING(BTS_TYPE_VARIANT), - OSMO_VALUE_STRING(BTS_SUB_MODEL), - OSMO_VALUE_STRING(TRX_PHY_VERSION), - { 0, NULL } -}; - -enum bts_attribute str2btsattr(const char *s) -{ - return get_string_value(bts_attribute_names, s); -} - -const char *btsatttr2str(enum bts_attribute v) -{ - return get_value_string(bts_attribute_names, v); -} - -const struct value_string osmo_bts_variant_names[_NUM_BTS_VARIANT + 1] = { - { BTS_UNKNOWN, "unknown" }, - { BTS_OSMO_LITECELL15, "osmo-bts-lc15" }, - { BTS_OSMO_OCTPHY, "osmo-bts-octphy" }, - { BTS_OSMO_SYSMO, "osmo-bts-sysmo" }, - { BTS_OSMO_TRX, "omso-bts-trx" }, - { 0, NULL } -}; - -enum gsm_bts_type_variant str2btsvariant(const char *arg) -{ - return get_string_value(osmo_bts_variant_names, arg); -} - -const char *btsvariant2str(enum gsm_bts_type_variant v) -{ - return get_value_string(osmo_bts_variant_names, v); -} - -const struct value_string bts_type_names[_NUM_GSM_BTS_TYPE + 1] = { - { GSM_BTS_TYPE_UNKNOWN, "unknown" }, - { GSM_BTS_TYPE_BS11, "bs11" }, - { GSM_BTS_TYPE_NANOBTS, "nanobts" }, - { GSM_BTS_TYPE_RBS2000, "rbs2000" }, - { GSM_BTS_TYPE_NOKIA_SITE, "nokia_site" }, - { GSM_BTS_TYPE_OSMOBTS, "sysmobts" }, - { 0, NULL } -}; - -enum gsm_bts_type str2btstype(const char *arg) -{ - return get_string_value(bts_type_names, arg); -} - -const char *btstype2str(enum gsm_bts_type type) -{ - return get_value_string(bts_type_names, type); -} - -const struct value_string gsm_bts_features_descs[] = { - { BTS_FEAT_HSCSD, "HSCSD" }, - { BTS_FEAT_GPRS, "GPRS" }, - { BTS_FEAT_EGPRS, "EGPRS" }, - { BTS_FEAT_ECSD, "ECSD" }, - { BTS_FEAT_HOPPING, "Frequency Hopping" }, - { BTS_FEAT_MULTI_TSC, "Multi-TSC" }, - { BTS_FEAT_OML_ALERTS, "OML Alerts" }, - { BTS_FEAT_AGCH_PCH_PROP, "AGCH/PCH proportional allocation" }, - { BTS_FEAT_CBCH, "CBCH" }, - { 0, NULL } -}; - -const struct value_string gsm_chreq_descs[] = { - { GSM_CHREQ_REASON_EMERG, "emergency call" }, - { GSM_CHREQ_REASON_PAG, "answer to paging" }, - { GSM_CHREQ_REASON_CALL, "call re-establishment" }, - { GSM_CHREQ_REASON_LOCATION_UPD,"Location updating" }, - { GSM_CHREQ_REASON_PDCH, "one phase packet access" }, - { GSM_CHREQ_REASON_OTHER, "other" }, - { 0, NULL } -}; - -const struct value_string gsm_pchant_names[13] = { - { GSM_PCHAN_NONE, "NONE" }, - { GSM_PCHAN_CCCH, "CCCH" }, - { GSM_PCHAN_CCCH_SDCCH4,"CCCH+SDCCH4" }, - { GSM_PCHAN_TCH_F, "TCH/F" }, - { GSM_PCHAN_TCH_H, "TCH/H" }, - { GSM_PCHAN_SDCCH8_SACCH8C, "SDCCH8" }, - { GSM_PCHAN_PDCH, "PDCH" }, - { GSM_PCHAN_TCH_F_PDCH, "TCH/F_PDCH" }, - { GSM_PCHAN_UNKNOWN, "UNKNOWN" }, - { GSM_PCHAN_CCCH_SDCCH4_CBCH, "CCCH+SDCCH4+CBCH" }, - { GSM_PCHAN_SDCCH8_SACCH8C_CBCH, "SDCCH8+CBCH" }, - { GSM_PCHAN_TCH_F_TCH_H_PDCH, "TCH/F_TCH/H_PDCH" }, - { 0, NULL } -}; - -const struct value_string gsm_pchant_descs[13] = { - { GSM_PCHAN_NONE, "Physical Channel not configured" }, - { GSM_PCHAN_CCCH, "FCCH + SCH + BCCH + CCCH (Comb. IV)" }, - { GSM_PCHAN_CCCH_SDCCH4, - "FCCH + SCH + BCCH + CCCH + 4 SDCCH + 2 SACCH (Comb. V)" }, - { GSM_PCHAN_TCH_F, "TCH/F + FACCH/F + SACCH (Comb. I)" }, - { GSM_PCHAN_TCH_H, "2 TCH/H + 2 FACCH/H + 2 SACCH (Comb. II)" }, - { GSM_PCHAN_SDCCH8_SACCH8C, "8 SDCCH + 4 SACCH (Comb. VII)" }, - { GSM_PCHAN_PDCH, "Packet Data Channel for GPRS/EDGE" }, - { GSM_PCHAN_TCH_F_PDCH, "Dynamic TCH/F or GPRS PDCH" }, - { GSM_PCHAN_UNKNOWN, "Unknown / Unsupported channel combination" }, - { GSM_PCHAN_CCCH_SDCCH4_CBCH, "FCCH + SCH + BCCH + CCCH + CBCH + 3 SDCCH + 2 SACCH (Comb. V)" }, - { GSM_PCHAN_SDCCH8_SACCH8C_CBCH, "7 SDCCH + 4 SACCH + CBCH (Comb. VII)" }, - { GSM_PCHAN_TCH_F_TCH_H_PDCH, "Dynamic TCH/F or TCH/H or GPRS PDCH" }, - { 0, NULL } -}; - -const char *gsm_pchan_name(enum gsm_phys_chan_config c) -{ - return get_value_string(gsm_pchant_names, c); -} - -enum gsm_phys_chan_config gsm_pchan_parse(const char *name) -{ - return get_string_value(gsm_pchant_names, name); -} - -/* TODO: move to libosmocore, next to gsm_chan_t_names? */ -const char *gsm_lchant_name(enum gsm_chan_t c) -{ - return get_value_string(gsm_chan_t_names, c); -} - -static const struct value_string lchan_s_names[] = { - { LCHAN_S_NONE, "NONE" }, - { LCHAN_S_ACT_REQ, "ACTIVATION REQUESTED" }, - { LCHAN_S_ACTIVE, "ACTIVE" }, - { LCHAN_S_INACTIVE, "INACTIVE" }, - { LCHAN_S_REL_REQ, "RELEASE REQUESTED" }, - { LCHAN_S_REL_ERR, "RELEASE DUE ERROR" }, - { LCHAN_S_BROKEN, "BROKEN UNUSABLE" }, - { 0, NULL } -}; - -const char *gsm_lchans_name(enum gsm_lchan_state s) -{ - return get_value_string(lchan_s_names, s); -} - -static const struct value_string chreq_names[] = { - { GSM_CHREQ_REASON_EMERG, "EMERGENCY" }, - { GSM_CHREQ_REASON_PAG, "PAGING" }, - { GSM_CHREQ_REASON_CALL, "CALL" }, - { GSM_CHREQ_REASON_LOCATION_UPD,"LOCATION_UPDATE" }, - { GSM_CHREQ_REASON_OTHER, "OTHER" }, - { 0, NULL } -}; - -const char *gsm_chreq_name(enum gsm_chreq_reason_t c) -{ - return get_value_string(chreq_names, c); -} - -struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num) -{ - struct gsm_bts *bts; - - if (num >= net->num_bts) - return NULL; - - llist_for_each_entry(bts, &net->bts_list, list) { - if (bts->nr == num) - return bts; - } - - return NULL; -} - -struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts) -{ - struct gsm_bts_trx *trx = talloc_zero(bts, struct gsm_bts_trx); - int k; - - if (!trx) - return NULL; - - trx->bts = bts; - trx->nr = bts->num_trx++; - trx->mo.nm_state.administrative = NM_STATE_UNLOCKED; - - gsm_mo_init(&trx->mo, bts, NM_OC_RADIO_CARRIER, - bts->nr, trx->nr, 0xff); - gsm_mo_init(&trx->bb_transc.mo, bts, NM_OC_BASEB_TRANSC, - bts->nr, trx->nr, 0xff); - - for (k = 0; k < TRX_NR_TS; k++) { - struct gsm_bts_trx_ts *ts = &trx->ts[k]; - int l; - - ts->trx = trx; - ts->nr = k; - ts->pchan = GSM_PCHAN_NONE; - ts->dyn.pchan_is = GSM_PCHAN_NONE; - ts->dyn.pchan_want = GSM_PCHAN_NONE; - ts->tsc = -1; - - gsm_mo_init(&ts->mo, bts, NM_OC_CHANNEL, - bts->nr, trx->nr, ts->nr); - - ts->hopping.arfcns.data_len = sizeof(ts->hopping.arfcns_data); - ts->hopping.arfcns.data = ts->hopping.arfcns_data; - ts->hopping.ma.data_len = sizeof(ts->hopping.ma_data); - ts->hopping.ma.data = ts->hopping.ma_data; - - for (l = 0; l < TS_MAX_LCHAN; l++) { - struct gsm_lchan *lchan; - char *name; - lchan = &ts->lchan[l]; - - lchan->ts = ts; - lchan->nr = l; - lchan->type = GSM_LCHAN_NONE; - - name = gsm_lchan_name_compute(lchan); - lchan->name = talloc_strdup(trx, name); -#ifndef ROLE_BSC - INIT_LLIST_HEAD(&lchan->sapi_cmds); -#endif - } - } - - if (trx->nr != 0) - trx->nominal_power = bts->c0->nominal_power; - - llist_add_tail(&trx->list, &bts->trx_list); - - return trx; -} - - -static const uint8_t bts_nse_timer_default[] = { 3, 3, 3, 3, 30, 3, 10 }; -static const uint8_t bts_cell_timer_default[] = - { 3, 3, 3, 3, 3, 10, 3, 10, 3, 10, 3 }; -static const struct gprs_rlc_cfg rlc_cfg_default = { - .parameter = { - [RLC_T3142] = 20, - [RLC_T3169] = 5, - [RLC_T3191] = 5, - [RLC_T3193] = 160, /* 10ms */ - [RLC_T3195] = 5, - [RLC_N3101] = 10, - [RLC_N3103] = 4, - [RLC_N3105] = 8, - [CV_COUNTDOWN] = 15, - [T_DL_TBF_EXT] = 250 * 10, /* ms */ - [T_UL_TBF_EXT] = 250 * 10, /* ms */ - }, - .paging = { - .repeat_time = 5 * 50, /* ms */ - .repeat_count = 3, - }, - .cs_mask = 0x1fff, - .initial_cs = 2, - .initial_mcs = 6, -}; - -struct gsm_bts *gsm_bts_alloc(void *ctx, uint8_t bts_num) -{ - struct gsm_bts *bts = talloc_zero(ctx, struct gsm_bts); - int i; - - if (!bts) - return NULL; - - bts->nr = bts_num; - bts->num_trx = 0; - INIT_LLIST_HEAD(&bts->trx_list); - bts->ms_max_power = 15; /* dBm */ - - gsm_mo_init(&bts->mo, bts, NM_OC_BTS, - bts->nr, 0xff, 0xff); - gsm_mo_init(&bts->site_mgr.mo, bts, NM_OC_SITE_MANAGER, - 0xff, 0xff, 0xff); - - for (i = 0; i < ARRAY_SIZE(bts->gprs.nsvc); i++) { - bts->gprs.nsvc[i].bts = bts; - bts->gprs.nsvc[i].id = i; - gsm_mo_init(&bts->gprs.nsvc[i].mo, bts, NM_OC_GPRS_NSVC, - bts->nr, i, 0xff); - } - memcpy(&bts->gprs.nse.timer, bts_nse_timer_default, - sizeof(bts->gprs.nse.timer)); - gsm_mo_init(&bts->gprs.nse.mo, bts, NM_OC_GPRS_NSE, - bts->nr, 0xff, 0xff); - memcpy(&bts->gprs.cell.timer, bts_cell_timer_default, - sizeof(bts->gprs.cell.timer)); - gsm_mo_init(&bts->gprs.cell.mo, bts, NM_OC_GPRS_CELL, - bts->nr, 0xff, 0xff); - memcpy(&bts->gprs.cell.rlc_cfg, &rlc_cfg_default, - sizeof(bts->gprs.cell.rlc_cfg)); - - /* create our primary TRX */ - bts->c0 = gsm_bts_trx_alloc(bts); - if (!bts->c0) { - talloc_free(bts); - return NULL; - } - bts->c0->ts[0].pchan = GSM_PCHAN_CCCH_SDCCH4; - - bts->rach_b_thresh = -1; - bts->rach_ldavg_slots = -1; - bts->paging.free_chans_need = -1; - bts->features.data = &bts->_features_data[0]; - bts->features.data_len = sizeof(bts->_features_data); - - /* si handling */ - bts->bcch_change_mark = 1; - - return bts; -} - -/* reset the state of all MO in the BTS */ -void gsm_bts_mo_reset(struct gsm_bts *bts) -{ - struct gsm_bts_trx *trx; - unsigned int i; - - gsm_abis_mo_reset(&bts->mo); - gsm_abis_mo_reset(&bts->site_mgr.mo); - for (i = 0; i < ARRAY_SIZE(bts->gprs.nsvc); i++) - gsm_abis_mo_reset(&bts->gprs.nsvc[i].mo); - gsm_abis_mo_reset(&bts->gprs.nse.mo); - gsm_abis_mo_reset(&bts->gprs.cell.mo); - - llist_for_each_entry(trx, &bts->trx_list, list) { - gsm_abis_mo_reset(&trx->mo); - gsm_abis_mo_reset(&trx->bb_transc.mo); - - for (i = 0; i < ARRAY_SIZE(trx->ts); i++) { - struct gsm_bts_trx_ts *ts = &trx->ts[i]; - gsm_abis_mo_reset(&ts->mo); - } - } -} - -struct gsm_bts_trx *gsm_bts_trx_num(const struct gsm_bts *bts, int num) -{ - struct gsm_bts_trx *trx; - - if (num >= bts->num_trx) - return NULL; - - llist_for_each_entry(trx, &bts->trx_list, list) { - if (trx->nr == num) - return trx; - } - - return NULL; -} - -static char ts2str[255]; - -char *gsm_trx_name(const struct gsm_bts_trx *trx) -{ - if (!trx) - snprintf(ts2str, sizeof(ts2str), "(trx=NULL)"); - else - snprintf(ts2str, sizeof(ts2str), "(bts=%d,trx=%d)", - trx->bts->nr, trx->nr); - - return ts2str; -} - - -char *gsm_ts_name(const struct gsm_bts_trx_ts *ts) -{ - snprintf(ts2str, sizeof(ts2str), "(bts=%d,trx=%d,ts=%d)", - ts->trx->bts->nr, ts->trx->nr, ts->nr); - - return ts2str; -} - -/*! Log timeslot number with full pchan information */ -char *gsm_ts_and_pchan_name(const struct gsm_bts_trx_ts *ts) -{ - switch (ts->pchan) { - case GSM_PCHAN_TCH_F_TCH_H_PDCH: - if (ts->dyn.pchan_is == ts->dyn.pchan_want) - snprintf(ts2str, sizeof(ts2str), - "(bts=%d,trx=%d,ts=%d,pchan=%s as %s)", - ts->trx->bts->nr, ts->trx->nr, ts->nr, - gsm_pchan_name(ts->pchan), - gsm_pchan_name(ts->dyn.pchan_is)); - else - snprintf(ts2str, sizeof(ts2str), - "(bts=%d,trx=%d,ts=%d,pchan=%s" - " switching %s -> %s)", - ts->trx->bts->nr, ts->trx->nr, ts->nr, - gsm_pchan_name(ts->pchan), - gsm_pchan_name(ts->dyn.pchan_is), - gsm_pchan_name(ts->dyn.pchan_want)); - break; - case GSM_PCHAN_TCH_F_PDCH: - if ((ts->flags & TS_F_PDCH_PENDING_MASK) == 0) - snprintf(ts2str, sizeof(ts2str), - "(bts=%d,trx=%d,ts=%d,pchan=%s as %s)", - ts->trx->bts->nr, ts->trx->nr, ts->nr, - gsm_pchan_name(ts->pchan), - (ts->flags & TS_F_PDCH_ACTIVE)? "PDCH" - : "TCH/F"); - else - snprintf(ts2str, sizeof(ts2str), - "(bts=%d,trx=%d,ts=%d,pchan=%s" - " switching %s -> %s)", - ts->trx->bts->nr, ts->trx->nr, ts->nr, - gsm_pchan_name(ts->pchan), - (ts->flags & TS_F_PDCH_ACTIVE)? "PDCH" - : "TCH/F", - (ts->flags & TS_F_PDCH_ACT_PENDING)? "PDCH" - : "TCH/F"); - break; - default: - snprintf(ts2str, sizeof(ts2str), "(bts=%d,trx=%d,ts=%d,pchan=%s)", - ts->trx->bts->nr, ts->trx->nr, ts->nr, - gsm_pchan_name(ts->pchan)); - break; - } - - return ts2str; -} - -char *gsm_lchan_name_compute(const struct gsm_lchan *lchan) -{ - struct gsm_bts_trx_ts *ts = lchan->ts; - - snprintf(ts2str, sizeof(ts2str), "(bts=%d,trx=%d,ts=%d,ss=%d)", - ts->trx->bts->nr, ts->trx->nr, ts->nr, lchan->nr); - - return ts2str; -} - -/* obtain the MO structure for a given object instance */ -struct gsm_abis_mo * -gsm_objclass2mo(struct gsm_bts *bts, uint8_t obj_class, - const struct abis_om_obj_inst *obj_inst) -{ - struct gsm_bts_trx *trx; - struct gsm_abis_mo *mo = NULL; - - switch (obj_class) { - case NM_OC_BTS: - mo = &bts->mo; - break; - case NM_OC_RADIO_CARRIER: - if (obj_inst->trx_nr >= bts->num_trx) { - return NULL; - } - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - mo = &trx->mo; - break; - case NM_OC_BASEB_TRANSC: - if (obj_inst->trx_nr >= bts->num_trx) { - return NULL; - } - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - mo = &trx->bb_transc.mo; - break; - case NM_OC_CHANNEL: - if (obj_inst->trx_nr >= bts->num_trx) { - return NULL; - } - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - if (obj_inst->ts_nr >= TRX_NR_TS) - return NULL; - mo = &trx->ts[obj_inst->ts_nr].mo; - break; - case NM_OC_SITE_MANAGER: - mo = &bts->site_mgr.mo; - break; - case NM_OC_BS11: - switch (obj_inst->bts_nr) { - case BS11_OBJ_CCLK: - mo = &bts->bs11.cclk.mo; - break; - case BS11_OBJ_BBSIG: - if (obj_inst->ts_nr > bts->num_trx) - return NULL; - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - mo = &trx->bs11.bbsig.mo; - break; - case BS11_OBJ_PA: - if (obj_inst->ts_nr > bts->num_trx) - return NULL; - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - mo = &trx->bs11.pa.mo; - break; - default: - return NULL; - } - break; - case NM_OC_BS11_RACK: - mo = &bts->bs11.rack.mo; - break; - case NM_OC_BS11_ENVABTSE: - if (obj_inst->trx_nr >= ARRAY_SIZE(bts->bs11.envabtse)) - return NULL; - mo = &bts->bs11.envabtse[obj_inst->trx_nr].mo; - break; - case NM_OC_GPRS_NSE: - mo = &bts->gprs.nse.mo; - break; - case NM_OC_GPRS_CELL: - mo = &bts->gprs.cell.mo; - break; - case NM_OC_GPRS_NSVC: - if (obj_inst->trx_nr >= ARRAY_SIZE(bts->gprs.nsvc)) - return NULL; - mo = &bts->gprs.nsvc[obj_inst->trx_nr].mo; - break; - } - return mo; -} - -/* obtain the gsm_nm_state data structure for a given object instance */ -struct gsm_nm_state * -gsm_objclass2nmstate(struct gsm_bts *bts, uint8_t obj_class, - const struct abis_om_obj_inst *obj_inst) -{ - struct gsm_abis_mo *mo; - - mo = gsm_objclass2mo(bts, obj_class, obj_inst); - if (!mo) - return NULL; - - return &mo->nm_state; -} - -/* obtain the in-memory data structure of a given object instance */ -void * -gsm_objclass2obj(struct gsm_bts *bts, uint8_t obj_class, - const struct abis_om_obj_inst *obj_inst) -{ - struct gsm_bts_trx *trx; - void *obj = NULL; - - switch (obj_class) { - case NM_OC_BTS: - obj = bts; - break; - case NM_OC_RADIO_CARRIER: - if (obj_inst->trx_nr >= bts->num_trx) { - return NULL; - } - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - obj = trx; - break; - case NM_OC_BASEB_TRANSC: - if (obj_inst->trx_nr >= bts->num_trx) { - return NULL; - } - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - obj = &trx->bb_transc; - break; - case NM_OC_CHANNEL: - if (obj_inst->trx_nr >= bts->num_trx) { - return NULL; - } - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - if (obj_inst->ts_nr >= TRX_NR_TS) - return NULL; - obj = &trx->ts[obj_inst->ts_nr]; - break; - case NM_OC_SITE_MANAGER: - obj = &bts->site_mgr; - break; - case NM_OC_GPRS_NSE: - obj = &bts->gprs.nse; - break; - case NM_OC_GPRS_CELL: - obj = &bts->gprs.cell; - break; - case NM_OC_GPRS_NSVC: - if (obj_inst->trx_nr >= ARRAY_SIZE(bts->gprs.nsvc)) - return NULL; - obj = &bts->gprs.nsvc[obj_inst->trx_nr]; - break; - } - return obj; -} - -/* See Table 10.5.25 of GSM04.08 */ -uint8_t gsm_pchan2chan_nr(enum gsm_phys_chan_config pchan, - uint8_t ts_nr, uint8_t lchan_nr) -{ - uint8_t cbits, chan_nr; - - switch (pchan) { - case GSM_PCHAN_TCH_F: - case GSM_PCHAN_TCH_F_PDCH: - OSMO_ASSERT(lchan_nr == 0); - cbits = 0x01; - break; - case GSM_PCHAN_PDCH: - OSMO_ASSERT(lchan_nr == 0); - cbits = RSL_CHAN_OSMO_PDCH >> 3; - break; - case GSM_PCHAN_TCH_H: - OSMO_ASSERT(lchan_nr < 2); - cbits = 0x02; - cbits += lchan_nr; - break; - case GSM_PCHAN_CCCH_SDCCH4: - case GSM_PCHAN_CCCH_SDCCH4_CBCH: - /* - * As a special hack for BCCH, lchan_nr == 4 may be passed - * here. This should never be sent in an RSL message. - * See osmo-bts-xxx/oml.c:opstart_compl(). - */ - if (lchan_nr == CCCH_LCHAN) - chan_nr = 0; - else - OSMO_ASSERT(lchan_nr < 4); - cbits = 0x04; - cbits += lchan_nr; - break; - case GSM_PCHAN_SDCCH8_SACCH8C: - case GSM_PCHAN_SDCCH8_SACCH8C_CBCH: - OSMO_ASSERT(lchan_nr < 8); - cbits = 0x08; - cbits += lchan_nr; - break; - default: - case GSM_PCHAN_CCCH: -#ifdef ROLE_BSC - OSMO_ASSERT(lchan_nr == 0); -#else - /* - * FIXME: On octphy and litecell, we hit above assertion (see - * Max's comment at https://gerrit.osmocom.org/589 ); disabled - * for BTS until this is clarified; remove the #ifdef when it - * is fixed. - */ -#warning "fix caller that passes lchan_nr != 0" -#endif - cbits = 0x10; - break; - } - - chan_nr = (cbits << 3) | (ts_nr & 0x7); - - return chan_nr; -} - -uint8_t gsm_lchan2chan_nr(const struct gsm_lchan *lchan) -{ - enum gsm_phys_chan_config pchan = lchan->ts->pchan; - if (pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH) - return gsm_lchan_as_pchan2chan_nr(lchan, - lchan->ts->dyn.pchan_is); - return gsm_pchan2chan_nr(lchan->ts->pchan, lchan->ts->nr, lchan->nr); -} - -uint8_t gsm_lchan_as_pchan2chan_nr(const struct gsm_lchan *lchan, - enum gsm_phys_chan_config as_pchan) -{ - if (lchan->ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH - && as_pchan == GSM_PCHAN_PDCH) - return RSL_CHAN_OSMO_PDCH | (lchan->ts->nr & ~RSL_CHAN_NR_MASK); - return gsm_pchan2chan_nr(as_pchan, lchan->ts->nr, lchan->nr); -} - -/* return the gsm_lchan for the CBCH (if it exists at all) */ -struct gsm_lchan *gsm_bts_get_cbch(struct gsm_bts *bts) -{ - struct gsm_lchan *lchan = NULL; - struct gsm_bts_trx *trx = bts->c0; - - if (trx->ts[0].pchan == GSM_PCHAN_CCCH_SDCCH4_CBCH) - lchan = &trx->ts[0].lchan[2]; - else { - int i; - for (i = 0; i < 8; i++) { - if (trx->ts[i].pchan == GSM_PCHAN_SDCCH8_SACCH8C_CBCH) { - lchan = &trx->ts[i].lchan[2]; - break; - } - } - } - - return lchan; -} - -/* determine logical channel based on TRX and channel number IE */ -struct gsm_lchan *rsl_lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr, - int *rc) -{ - uint8_t ts_nr = chan_nr & 0x07; - uint8_t cbits = chan_nr >> 3; - uint8_t lch_idx; - struct gsm_bts_trx_ts *ts = &trx->ts[ts_nr]; - bool ok = true; - - if (rc) - *rc = -EINVAL; - - if (cbits == 0x01) { - lch_idx = 0; /* TCH/F */ - if (ts->pchan != GSM_PCHAN_TCH_F && - ts->pchan != GSM_PCHAN_PDCH && - ts->pchan != GSM_PCHAN_TCH_F_PDCH - && !(ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH - && (ts->dyn.pchan_is == GSM_PCHAN_TCH_F - || ts->dyn.pchan_want == GSM_PCHAN_TCH_F))) - ok = false; - } else if ((cbits & 0x1e) == 0x02) { - lch_idx = cbits & 0x1; /* TCH/H */ - if (ts->pchan != GSM_PCHAN_TCH_H - && !(ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH - && (ts->dyn.pchan_is == GSM_PCHAN_TCH_H - || ts->dyn.pchan_want == GSM_PCHAN_TCH_H))) - ok = false; - } else if ((cbits & 0x1c) == 0x04) { - lch_idx = cbits & 0x3; /* SDCCH/4 */ - if (ts->pchan != GSM_PCHAN_CCCH_SDCCH4 && - ts->pchan != GSM_PCHAN_CCCH_SDCCH4_CBCH) - ok = false; - } else if ((cbits & 0x18) == 0x08) { - lch_idx = cbits & 0x7; /* SDCCH/8 */ - if (ts->pchan != GSM_PCHAN_SDCCH8_SACCH8C && - ts->pchan != GSM_PCHAN_SDCCH8_SACCH8C_CBCH) - ok = false; - } else if (cbits == 0x10 || cbits == 0x11 || cbits == 0x12) { - lch_idx = 0; - if (ts->pchan != GSM_PCHAN_CCCH && - ts->pchan != GSM_PCHAN_CCCH_SDCCH4 && - ts->pchan != GSM_PCHAN_CCCH_SDCCH4_CBCH) - ok = false; - /* FIXME: we should not return first sdcch4 !!! */ - } else if ((chan_nr & RSL_CHAN_NR_MASK) == RSL_CHAN_OSMO_PDCH) { - lch_idx = 0; - if (ts->pchan != GSM_PCHAN_TCH_F_TCH_H_PDCH) - ok = false; - } else - return NULL; - - if (rc && ok) - *rc = 0; - - return &ts->lchan[lch_idx]; -} - -static const uint8_t subslots_per_pchan[] = { - [GSM_PCHAN_NONE] = 0, - [GSM_PCHAN_CCCH] = 0, - [GSM_PCHAN_PDCH] = 0, - [GSM_PCHAN_CCCH_SDCCH4] = 4, - [GSM_PCHAN_TCH_F] = 1, - [GSM_PCHAN_TCH_H] = 2, - [GSM_PCHAN_SDCCH8_SACCH8C] = 8, - [GSM_PCHAN_CCCH_SDCCH4_CBCH] = 4, - [GSM_PCHAN_SDCCH8_SACCH8C_CBCH] = 8, - /* - * GSM_PCHAN_TCH_F_PDCH and GSM_PCHAN_TCH_F_TCH_H_PDCH should not be - * part of this, those TS are handled according to their dynamic state. - */ -}; - -/*! Return the actual pchan type, also heeding dynamic TS. */ -enum gsm_phys_chan_config ts_pchan(struct gsm_bts_trx_ts *ts) -{ - switch (ts->pchan) { - case GSM_PCHAN_TCH_F_TCH_H_PDCH: - return ts->dyn.pchan_is; - case GSM_PCHAN_TCH_F_PDCH: - if (ts->flags & TS_F_PDCH_ACTIVE) - return GSM_PCHAN_PDCH; - else - return GSM_PCHAN_TCH_F; - default: - return ts->pchan; - } -} - -/*! According to ts->pchan and possibly ts->dyn_pchan, return the number of - * logical channels available in the timeslot. */ -uint8_t ts_subslots(struct gsm_bts_trx_ts *ts) -{ - return subslots_per_pchan[ts_pchan(ts)]; -} - -static bool pchan_is_tch(enum gsm_phys_chan_config pchan) -{ - switch (pchan) { - case GSM_PCHAN_TCH_F: - case GSM_PCHAN_TCH_H: - return true; - default: - return false; - } -} - -bool ts_is_tch(struct gsm_bts_trx_ts *ts) -{ - return pchan_is_tch(ts_pchan(ts)); -} diff --git a/src/libcommon/gsm_subscriber_base.c b/src/libcommon/gsm_subscriber_base.c deleted file mode 100644 index 2a8a59f..0000000 --- a/src/libcommon/gsm_subscriber_base.c +++ /dev/null @@ -1,64 +0,0 @@ -/* The concept of a subscriber as seen by the BSC */ - -/* (C) 2008 by Harald Welte - * (C) 2009-2010 by Holger Hans Peter Freyther - * (C) 2010 by On-Waves - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -LLIST_HEAD(active_subscribers); -void *tall_subscr_ctx; - -/* return static buffer with printable name of VLR subscriber */ -const char *vlr_subscr_name(struct vlr_subscr *vsub) -{ - static char buf[32]; - if (!vsub) - return "unknown"; - if (vsub->msisdn[0]) - snprintf(buf, sizeof(buf), "MSISDN:%s", vsub->msisdn); - else if (vsub->imsi[0]) - snprintf(buf, sizeof(buf), "IMSI:%s", vsub->imsi); - else if (vsub->tmsi != GSM_RESERVED_TMSI) - snprintf(buf, sizeof(buf), "TMSI:0x%08x", vsub->tmsi); - else if (vsub->tmsi_new != GSM_RESERVED_TMSI) - snprintf(buf, sizeof(buf), "TMSI(new):0x%08x", vsub->tmsi_new); - else - return "unknown"; - buf[sizeof(buf)-1] = '\0'; - return buf; -} - -const char *vlr_subscr_msisdn_or_name(struct vlr_subscr *vsub) -{ - if (!vsub || !vsub->msisdn[0]) - return vlr_subscr_name(vsub); - return vsub->msisdn; -} diff --git a/src/libcommon/gsup_client.c b/src/libcommon/gsup_client.c deleted file mode 100644 index 0520045..0000000 --- a/src/libcommon/gsup_client.c +++ /dev/null @@ -1,347 +0,0 @@ -/* Generic Subscriber Update Protocol client */ - -/* (C) 2014-2016 by Sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * Author: Jacob Erlbeck - * Author: Neels Hofmeyr - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include - -#include -#include -#include -#include - -#include - -#include -#include - -extern void *tall_bsc_ctx; - -static void start_test_procedure(struct gsup_client *gsupc); - -static void gsup_client_send_ping(struct gsup_client *gsupc) -{ - struct msgb *msg = gsup_client_msgb_alloc(); - - msg->l2h = msgb_put(msg, 1); - msg->l2h[0] = IPAC_MSGT_PING; - ipa_msg_push_header(msg, IPAC_PROTO_IPACCESS); - ipa_client_conn_send(gsupc->link, msg); -} - -static int gsup_client_connect(struct gsup_client *gsupc) -{ - int rc; - - if (gsupc->is_connected) - return 0; - - if (osmo_timer_pending(&gsupc->connect_timer)) { - LOGP(DLGSUP, LOGL_DEBUG, - "GSUP connect: connect timer already running\n"); - osmo_timer_del(&gsupc->connect_timer); - } - - if (osmo_timer_pending(&gsupc->ping_timer)) { - LOGP(DLGSUP, LOGL_DEBUG, - "GSUP connect: ping timer already running\n"); - osmo_timer_del(&gsupc->ping_timer); - } - - if (ipa_client_conn_clear_queue(gsupc->link) > 0) - LOGP(DLGSUP, LOGL_DEBUG, "GSUP connect: discarded stored messages\n"); - - rc = ipa_client_conn_open(gsupc->link); - - if (rc >= 0) { - LOGP(DLGSUP, LOGL_NOTICE, "GSUP connecting to %s:%d\n", - gsupc->link->addr, gsupc->link->port); - return 0; - } - - LOGP(DLGSUP, LOGL_ERROR, "GSUP failed to connect to %s:%d: %s\n", - gsupc->link->addr, gsupc->link->port, strerror(-rc)); - - if (rc == -EBADF || rc == -ENOTSOCK || rc == -EAFNOSUPPORT || - rc == -EINVAL) - return rc; - - osmo_timer_schedule(&gsupc->connect_timer, - GSUP_CLIENT_RECONNECT_INTERVAL, 0); - - LOGP(DLGSUP, LOGL_INFO, "Scheduled timer to retry GSUP connect to %s:%d\n", - gsupc->link->addr, gsupc->link->port); - - return 0; -} - -static void connect_timer_cb(void *gsupc_) -{ - struct gsup_client *gsupc = gsupc_; - - if (gsupc->is_connected) - return; - - gsup_client_connect(gsupc); -} - -static void client_send(struct gsup_client *gsupc, int proto_ext, - struct msgb *msg_tx) -{ - ipa_prepend_header_ext(msg_tx, proto_ext); - ipa_msg_push_header(msg_tx, IPAC_PROTO_OSMO); - ipa_client_conn_send(gsupc->link, msg_tx); - /* msg_tx is now queued and will be freed. */ -} - -static void gsup_client_oap_register(struct gsup_client *gsupc) -{ - struct msgb *msg_tx; - int rc; - rc = osmo_oap_client_register(&gsupc->oap_state, &msg_tx); - - if ((rc < 0) || (!msg_tx)) { - LOGP(DLGSUP, LOGL_ERROR, "GSUP OAP set up, but cannot register.\n"); - return; - } - - client_send(gsupc, IPAC_PROTO_EXT_OAP, msg_tx); -} - -static void gsup_client_updown_cb(struct ipa_client_conn *link, int up) -{ - struct gsup_client *gsupc = link->data; - - LOGP(DLGSUP, LOGL_INFO, "GSUP link to %s:%d %s\n", - link->addr, link->port, up ? "UP" : "DOWN"); - - gsupc->is_connected = up; - - if (up) { - start_test_procedure(gsupc); - - if (gsupc->osmo_oap_state.state == OSMO_OAP_INITIALIZED) - gsup_client_oap_register(gsupc); - - osmo_timer_del(&gsupc->connect_timer); - } else { - osmo_timer_del(&gsupc->ping_timer); - - osmo_timer_schedule(&gsupc->connect_timer, - GSUP_CLIENT_RECONNECT_INTERVAL, 0); - } -} - -static int gsup_client_oap_handle(struct gsup_client *gsupc, struct msgb *msg_rx) -{ - int rc; - struct msgb *msg_tx; - - /* If the oap_state is disabled, this will reject the messages. */ - rc = osmo_oap_client_handle(&gsupc->oap_state, msg_rx, &msg_tx); - msgb_free(msg_rx); - if (rc < 0) - return rc; - - if (msg_tx) - client_send(gsupc, IPAC_PROTO_EXT_OAP, msg_tx); - - return 0; -} - -static int gsup_client_read_cb(struct ipa_client_conn *link, struct msgb *msg) -{ - struct ipaccess_head *hh = (struct ipaccess_head *) msg->data; - struct ipaccess_head_ext *he = (struct ipaccess_head_ext *) msgb_l2(msg); - struct gsup_client *gsupc = (struct gsup_client *)link->data; - int rc; - struct ipaccess_unit ipa_dev = { - /* see gsup_client_create() on const vs non-const */ - .unit_name = (char*)gsupc->unit_name, - }; - - OSMO_ASSERT(ipa_dev.unit_name); - - msg->l2h = &hh->data[0]; - - rc = ipaccess_bts_handle_ccm(link, &ipa_dev, msg); - - if (rc < 0) { - LOGP(DLGSUP, LOGL_NOTICE, - "GSUP received an invalid IPA/CCM message from %s:%d\n", - link->addr, link->port); - /* Link has been closed */ - gsupc->is_connected = 0; - msgb_free(msg); - return -1; - } - - if (rc == 1) { - uint8_t msg_type = *(msg->l2h); - /* CCM message */ - if (msg_type == IPAC_MSGT_PONG) { - LOGP(DLGSUP, LOGL_DEBUG, "GSUP receiving PONG\n"); - gsupc->got_ipa_pong = 1; - } - - msgb_free(msg); - return 0; - } - - if (hh->proto != IPAC_PROTO_OSMO) - goto invalid; - - if (!he || msgb_l2len(msg) < sizeof(*he)) - goto invalid; - - msg->l2h = &he->data[0]; - - if (he->proto == IPAC_PROTO_EXT_GSUP) { - OSMO_ASSERT(gsupc->read_cb != NULL); - gsupc->read_cb(gsupc, msg); - /* expecting read_cb() to free msg */ - } else if (he->proto == IPAC_PROTO_EXT_OAP) { - return gsup_client_oap_handle(gsupc, msg); - /* gsup_client_oap_handle frees msg */ - } else - goto invalid; - - return 0; - -invalid: - LOGP(DLGSUP, LOGL_NOTICE, - "GSUP received an invalid IPA message from %s:%d, size = %d\n", - link->addr, link->port, msgb_length(msg)); - - msgb_free(msg); - return -1; -} - -static void ping_timer_cb(void *gsupc_) -{ - struct gsup_client *gsupc = gsupc_; - - LOGP(DLGSUP, LOGL_INFO, "GSUP ping callback (%s, %s PONG)\n", - gsupc->is_connected ? "connected" : "not connected", - gsupc->got_ipa_pong ? "got" : "didn't get"); - - if (gsupc->got_ipa_pong) { - start_test_procedure(gsupc); - return; - } - - LOGP(DLGSUP, LOGL_NOTICE, "GSUP ping timed out, reconnecting\n"); - ipa_client_conn_close(gsupc->link); - gsupc->is_connected = 0; - - gsup_client_connect(gsupc); -} - -static void start_test_procedure(struct gsup_client *gsupc) -{ - osmo_timer_setup(&gsupc->ping_timer, ping_timer_cb, gsupc); - - gsupc->got_ipa_pong = 0; - osmo_timer_schedule(&gsupc->ping_timer, GSUP_CLIENT_PING_INTERVAL, 0); - LOGP(DLGSUP, LOGL_DEBUG, "GSUP sending PING\n"); - gsup_client_send_ping(gsupc); -} - -struct gsup_client *gsup_client_create(const char *unit_name, - const char *ip_addr, - unsigned int tcp_port, - gsup_client_read_cb_t read_cb, - struct osmo_oap_client_config *oapc_config) -{ - struct gsup_client *gsupc; - int rc; - - gsupc = talloc_zero(tall_bsc_ctx, struct gsup_client); - OSMO_ASSERT(gsupc); - - /* struct ipaccess_unit has a non-const unit_name, so let's copy to be - * able to have a non-const unit_name here as well. To not taint the - * public gsup_client API, let's store it in a const char* anyway. */ - gsupc->unit_name = talloc_strdup(gsupc, unit_name); - OSMO_ASSERT(gsupc->unit_name); - - /* a NULL oapc_config will mark oap_state disabled. */ - rc = osmo_oap_client_init(oapc_config, &gsupc->oap_state); - if (rc != 0) - goto failed; - - gsupc->link = ipa_client_conn_create(gsupc, - /* no e1inp */ NULL, - 0, - ip_addr, tcp_port, - gsup_client_updown_cb, - gsup_client_read_cb, - /* default write_cb */ NULL, - gsupc); - if (!gsupc->link) - goto failed; - - osmo_timer_setup(&gsupc->connect_timer, connect_timer_cb, gsupc); - - rc = gsup_client_connect(gsupc); - - if (rc < 0) - goto failed; - - gsupc->read_cb = read_cb; - - return gsupc; - -failed: - gsup_client_destroy(gsupc); - return NULL; -} - -void gsup_client_destroy(struct gsup_client *gsupc) -{ - osmo_timer_del(&gsupc->connect_timer); - osmo_timer_del(&gsupc->ping_timer); - - if (gsupc->link) { - ipa_client_conn_close(gsupc->link); - ipa_client_conn_destroy(gsupc->link); - gsupc->link = NULL; - } - talloc_free(gsupc); -} - -int gsup_client_send(struct gsup_client *gsupc, struct msgb *msg) -{ - if (!gsupc || !gsupc->is_connected) { - LOGP(DGPRS, LOGL_ERROR, "GSUP not connected, unable to send %s\n", msgb_hexdump(msg)); - msgb_free(msg); - return -ENOTCONN; - } - - client_send(gsupc, IPAC_PROTO_EXT_GSUP, msg); - - return 0; -} - -struct msgb *gsup_client_msgb_alloc(void) -{ - return msgb_alloc_headroom(4000, 64, __func__); -} diff --git a/src/libcommon/gsup_test_client.c b/src/libcommon/gsup_test_client.c deleted file mode 100644 index 2357ba5..0000000 --- a/src/libcommon/gsup_test_client.c +++ /dev/null @@ -1,299 +0,0 @@ -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include - -static struct gsup_client *g_gc; - - -/*********************************************************************** - * IMSI Operation - ***********************************************************************/ -static LLIST_HEAD(g_imsi_ops); - -struct imsi_op_stats { - uint32_t num_alloc; - uint32_t num_released; - uint32_t num_rx_success; - uint32_t num_rx_error; - uint32_t num_timeout; -}; - -enum imsi_op_type { - IMSI_OP_SAI, - IMSI_OP_LU, - IMSI_OP_ISD, - _NUM_IMSI_OP -}; - -static const struct value_string imsi_op_names[] = { - { IMSI_OP_SAI, "SAI" }, - { IMSI_OP_LU, "LU" }, - { IMSI_OP_ISD, "ISD" }, - { 0, NULL } -}; - -static struct imsi_op_stats imsi_op_stats[_NUM_IMSI_OP]; - -struct imsi_op { - struct llist_head list; - char imsi[17]; - enum imsi_op_type type; - struct osmo_timer_list timer; -}; - -static struct imsi_op *imsi_op_find(const char *imsi, - enum imsi_op_type type) -{ - struct imsi_op *io; - - llist_for_each_entry(io, &g_imsi_ops, list) { - if (!strcmp(io->imsi, imsi) && io->type == type) - return io; - } - return NULL; -} - -static void imsi_op_timer_cb(void *data); - -static struct imsi_op *imsi_op_alloc(void *ctx, const char *imsi, - enum imsi_op_type type) -{ - struct imsi_op *io; - - if (imsi_op_find(imsi, type)) - return NULL; - - io = talloc_zero(ctx, struct imsi_op); - osmo_strlcpy(io->imsi, imsi, sizeof(io->imsi)); - io->type = type; - osmo_timer_setup(&io->timer, imsi_op_timer_cb, io); - llist_add(&io->list, &g_imsi_ops); - imsi_op_stats[type].num_alloc++; - - return io; -} - -static void imsi_op_release(struct imsi_op *io) -{ - osmo_timer_del(&io->timer); - llist_del(&io->list); - imsi_op_stats[io->type].num_released++; - talloc_free(io); -} - -static void imsi_op_timer_cb(void *data) -{ - struct imsi_op *io = data; - printf("%s: Timer expiration\n", io->imsi); - imsi_op_stats[io->type].num_timeout++; - imsi_op_release(io); -} - -/* allocate + generate + send Send-Auth-Info */ -int req_auth_info(const char *imsi) -{ - struct imsi_op *io = imsi_op_alloc(g_gc, imsi, IMSI_OP_SAI); - struct osmo_gsup_message gsup = {0}; - struct msgb *msg = msgb_alloc_headroom(1200, 200, __func__); - - osmo_strlcpy(gsup.imsi, io->imsi, sizeof(gsup.imsi)); - gsup.message_type = OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST; - - osmo_gsup_encode(msg, &gsup); - - return gsup_client_send(g_gc, msg); -} - -/* allocate + generate + send Send-Auth-Info */ -int req_loc_upd(const char *imsi) -{ - struct imsi_op *io = imsi_op_alloc(g_gc, imsi, IMSI_OP_LU); - struct osmo_gsup_message gsup = {0}; - struct msgb *msg = msgb_alloc_headroom(1200, 200, __func__); - - osmo_strlcpy(gsup.imsi, io->imsi, sizeof(gsup.imsi)); - gsup.message_type = OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST; - - osmo_gsup_encode(msg, &gsup); - - return gsup_client_send(g_gc, msg); -} - -int resp_isd(struct imsi_op *io) -{ - struct osmo_gsup_message gsup = {0}; - struct msgb *msg = msgb_alloc_headroom(1200, 200, __func__); - - osmo_strlcpy(gsup.imsi, io->imsi, sizeof(gsup.imsi)); - gsup.message_type = OSMO_GSUP_MSGT_INSERT_DATA_RESULT; - - osmo_gsup_encode(msg, &gsup); - - imsi_op_release(io); - - return gsup_client_send(g_gc, msg); -} - -/* receive an incoming GSUP message */ -static void imsi_op_rx_gsup(struct imsi_op *io, const struct osmo_gsup_message *gsup) -{ - int is_error = 0; - - if (OSMO_GSUP_IS_MSGT_ERROR(gsup->message_type)) { - imsi_op_stats[io->type].num_rx_error++; - is_error = 1; - } else - imsi_op_stats[io->type].num_rx_success++; - - switch (io->type) { - case IMSI_OP_SAI: - printf("%s; SAI Response%s\n", io->imsi, is_error ? ": ERROR" : ""); - /* now that we have auth tuples, request LU */ - req_loc_upd(io->imsi); - imsi_op_release(io); - break; - case IMSI_OP_LU: - printf("%s; LU Response%s\n", io->imsi, is_error ? ": ERROR" : ""); - imsi_op_release(io); - break; - case IMSI_OP_ISD: - printf("%s; ISD Request%s\n", io->imsi, is_error ? ": ERROR" : ""); - resp_isd(io); - break; - default: - printf("%s: Unknown\n", io->imsi); - imsi_op_release(io); - break; - } -} - -static int op_type_by_gsup_msgt(enum osmo_gsup_message_type msg_type) -{ - switch (msg_type) { - case OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: - case OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR: - return IMSI_OP_SAI; - case OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: - case OSMO_GSUP_MSGT_UPDATE_LOCATION_ERROR: - return IMSI_OP_LU; - case OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: - return IMSI_OP_ISD; - default: - printf("Unknown GSUP msg_type %u\n", msg_type); - return -1; - } -} - -static int gsupc_read_cb(struct gsup_client *gsupc, struct msgb *msg) -{ - struct osmo_gsup_message gsup_msg = {0}; - struct imsi_op *io; - int rc; - - DEBUGP(DGPRS, "Rx GSUP %s\n", osmo_hexdump(msgb_l2(msg), msgb_l2len(msg))); - - rc = osmo_gsup_decode(msgb_l2(msg), msgb_l2len(msg), &gsup_msg); - if (rc < 0) - return rc; - - if (!gsup_msg.imsi[0]) - return -1; - - rc = op_type_by_gsup_msgt(gsup_msg.message_type); - if (rc < 0) - return rc; - - switch (rc) { - case IMSI_OP_SAI: - case IMSI_OP_LU: - io = imsi_op_find(gsup_msg.imsi, rc); - if (!io) - return -1; - break; - case IMSI_OP_ISD: - /* ISD is an inbound transaction */ - io = imsi_op_alloc(g_gc, gsup_msg.imsi, IMSI_OP_ISD); - break; - } - - imsi_op_rx_gsup(io, &gsup_msg); - msgb_free(msg); - - return 0; -} - -static void print_report(void) -{ - unsigned int i; - - for (i = 0; i < ARRAY_SIZE(imsi_op_stats); i++) { - struct imsi_op_stats *st = &imsi_op_stats[i]; - const char *name = get_value_string(imsi_op_names, i); - printf("%s: %u alloc, %u released, %u success, %u error , %u tout\n", - name, st->num_alloc, st->num_released, st->num_rx_success, - st->num_rx_error, st->num_timeout); - } -} - -static void sig_cb(int sig) -{ - switch (sig) { - case SIGINT: - print_report(); - exit(0); - break; - } -} - -void *tall_bsc_ctx = NULL; - -/* default categories */ -static struct log_info_cat default_categories[] = { -}; - -static const struct log_info gsup_test_client_log_info = { - .cat = default_categories, - .num_cat = ARRAY_SIZE(default_categories), -}; - -int main(int argc, char **argv) -{ - unsigned long long i; - char *server_host = "127.0.0.1"; - uint16_t server_port = OSMO_GSUP_PORT; - void *ctx = talloc_named_const(NULL, 0, "gsup_test_client"); - - osmo_init_logging2(ctx, &gsup_test_client_log_info); - - g_gc = gsup_client_create(ctx, "GSUPTEST", server_host, server_port, - gsupc_read_cb, NULL); - - - signal(SIGINT, sig_cb); - - for (i = 0; i < 10000; i++) { - unsigned long long imsi = 901790000000000 + i; - char imsi_buf[17]; - snprintf(imsi_buf, sizeof(imsi_buf), "%015llu", imsi); - req_auth_info(imsi_buf); - osmo_select_main(0); - } - - while (1) { - osmo_select_main(0); - } - - print_report(); - exit(0); -} diff --git a/src/libcommon/socket.c b/src/libcommon/socket.c deleted file mode 100644 index dfcb393..0000000 --- a/src/libcommon/socket.c +++ /dev/null @@ -1,111 +0,0 @@ -/* OpenBSC sokcet code, taken from Abis input driver for ip.access */ - -/* (C) 2009 by Harald Welte - * (C) 2010 by Holger Hans Peter Freyther - * (C) 2010 by On-Waves - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -int make_sock(struct osmo_fd *bfd, int proto, - uint32_t ip, uint16_t port, int priv_nr, - int (*cb)(struct osmo_fd *fd, unsigned int what), void *data) -{ - struct sockaddr_in addr; - int ret, on = 1; - int type = SOCK_STREAM; - - switch (proto) { - case IPPROTO_TCP: - type = SOCK_STREAM; - break; - case IPPROTO_UDP: - type = SOCK_DGRAM; - break; -#ifdef IPPROTO_GRE - case IPPROTO_GRE: - type = SOCK_RAW; - break; -#endif - default: - return -EINVAL; - } - - bfd->fd = socket(AF_INET, type, proto); - bfd->cb = cb; - bfd->when = BSC_FD_READ; - bfd->data = data; - bfd->priv_nr = priv_nr; - - if (bfd->fd < 0) { - LOGP(DLINP, LOGL_ERROR, "could not create socket.\n"); - return -EIO; - } - - memset(&addr, 0, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(port); - if (ip != INADDR_ANY) - addr.sin_addr.s_addr = htonl(ip); - else - addr.sin_addr.s_addr = INADDR_ANY; - - setsockopt(bfd->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); - - ret = bind(bfd->fd, (struct sockaddr *) &addr, sizeof(addr)); - if (ret < 0) { - LOGP(DLINP, LOGL_ERROR, "could not bind socket %s\n", - strerror(errno)); - close(bfd->fd); - return -EIO; - } - - if (proto == IPPROTO_TCP) { - ret = listen(bfd->fd, 1); - if (ret < 0) { - perror("listen"); - close(bfd->fd); - return ret; - } - } - - ret = osmo_fd_register(bfd); - if (ret < 0) { - perror("register_listen_fd"); - close(bfd->fd); - return ret; - } - return 0; -} diff --git a/src/libcommon/talloc_ctx.c b/src/libcommon/talloc_ctx.c deleted file mode 100644 index c8e9cd3..0000000 --- a/src/libcommon/talloc_ctx.c +++ /dev/null @@ -1,55 +0,0 @@ -/* OpenBSC allocation contexts initialization code */ -/* (C) 2011-2016 by sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include - -extern void *tall_bsc_ctx; -extern void *tall_fle_ctx; -extern void *tall_locop_ctx; -extern void *tall_authciphop_ctx; -extern void *tall_gsms_ctx; -extern void *tall_subscr_ctx; -extern void *tall_sub_req_ctx; -extern void *tall_call_ctx; -extern void *tall_paging_ctx; -extern void *tall_sigh_ctx; -extern void *tall_tqe_ctx; -extern void *tall_trans_ctx; -extern void *tall_map_ctx; -extern void *tall_upq_ctx; -extern void *tall_ctr_ctx; - -void talloc_ctx_init(void *ctx_root) -{ - msgb_talloc_ctx_init(ctx_root, 0); - tall_fle_ctx = talloc_named_const(ctx_root, 0, "bs11_file_list_entry"); - tall_locop_ctx = talloc_named_const(ctx_root, 0, "loc_updating_oper"); - tall_authciphop_ctx = talloc_named_const(ctx_root, 0, "auth_ciph_oper"); - tall_gsms_ctx = talloc_named_const(ctx_root, 0, "sms"); - tall_subscr_ctx = talloc_named_const(ctx_root, 0, "subscriber"); - tall_call_ctx = talloc_named_const(ctx_root, 0, "gsm_call"); - tall_paging_ctx = talloc_named_const(ctx_root, 0, "paging_request"); - tall_sigh_ctx = talloc_named_const(ctx_root, 0, "signal_handler"); - tall_tqe_ctx = talloc_named_const(ctx_root, 0, "subch_txq_entry"); - tall_trans_ctx = talloc_named_const(ctx_root, 0, "transaction"); - tall_map_ctx = talloc_named_const(ctx_root, 0, "trau_map_entry"); - tall_upq_ctx = talloc_named_const(ctx_root, 0, "trau_upq_entry"); - tall_ctr_ctx = talloc_named_const(ctx_root, 0, "counter"); -} -- To view, visit https://gerrit.osmocom.org/10260 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I9307f9da7f48dd0a2e1cb213072068736e569722 Gerrit-Change-Number: 10260 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 16:29:37 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 16:29:37 +0000 Subject: Change in libosmocore[master]: import oap_client_test from osmo-sgsn In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10258 ) Change subject: import oap_client_test from osmo-sgsn ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10258 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9d64e10b4bacac9b530cf077841bad762fc6d558 Gerrit-Change-Number: 10258 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 30 Jul 2018 16:29:37 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 16:29:39 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 16:29:39 +0000 Subject: Change in libosmocore[master]: import oap_client_test from osmo-sgsn In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10258 ) Change subject: import oap_client_test from osmo-sgsn ...................................................................... import oap_client_test from osmo-sgsn As oap_client has moved from osmo-sgsn to libosmogsm, it is only fair that the related unit test shall also be moved here. Change-Id: I9d64e10b4bacac9b530cf077841bad762fc6d558 --- M tests/Makefile.am D tests/oap/Makefile.am A tests/oap/oap_client_test.c A tests/oap/oap_client_test.err A tests/oap/oap_client_test.ok M tests/testsuite.at 6 files changed, 322 insertions(+), 39 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/tests/Makefile.am b/tests/Makefile.am index eaaa8df..072bb4a 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -23,7 +23,8 @@ coding/coding_test conv/conv_gsm0503_test \ abis/abis_test endian/endian_test sercomm/sercomm_test \ prbs/prbs_test gsm23003/gsm23003_test \ - codec/codec_ecu_fr_test timer/clk_override_test + codec/codec_ecu_fr_test timer/clk_override_test \ + oap/oap_client_test if ENABLE_MSGFILE check_PROGRAMS += msgfile/msgfile_test @@ -172,6 +173,9 @@ oap_oap_test_SOURCES = oap/oap_test.c oap_oap_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la +oap_oap_client_test_SOURCES = oap/oap_client_test.c +oap_oap_client_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la + fsm_fsm_test_SOURCES = fsm/fsm_test.c fsm_fsm_test_LDADD = $(LDADD) $(top_builddir)/src/ctrl/libosmoctrl.la @@ -253,7 +257,8 @@ conv/conv_gsm0503_test.ok endian/endian_test.ok \ sercomm/sercomm_test.ok prbs/prbs_test.ok \ gsm23003/gsm23003_test.ok \ - timer/clk_override_test.ok + timer/clk_override_test.ok \ + oap/oap_client_test.ok oap/oap_client_test.err DISTCLEANFILES = atconfig atlocal conv/gsm0503_test_vectors.c BUILT_SOURCES = conv/gsm0503_test_vectors.c diff --git a/tests/oap/Makefile.am b/tests/oap/Makefile.am deleted file mode 100644 index 06ccf33..0000000 --- a/tests/oap/Makefile.am +++ /dev/null @@ -1,37 +0,0 @@ -AM_CPPFLAGS = \ - $(all_includes) \ - -I$(top_srcdir)/include \ - $(NULL) - -AM_CFLAGS = \ - -Wall \ - -ggdb3 \ - $(LIBOSMOCORE_CFLAGS) \ - $(LIBOSMOGSM_CFLAGS) \ - $(NULL) - -EXTRA_DIST = \ - oap_test.ok \ - $(NULL) - -if HAVE_LIBGTP -if HAVE_LIBCARES -noinst_PROGRAMS = \ - oap_test \ - $(NULL) -endif -endif - -oap_test_SOURCES = \ - oap_test.c \ - $(NULL) - -oap_test_LDADD = \ - $(top_builddir)/src/gprs/oap.o \ - $(top_builddir)/src/gprs/oap_messages.o \ - $(top_builddir)/src/gprs/gprs_utils.o \ - $(top_builddir)/src/libcommon/libcommon.a \ - $(LIBOSMOCORE_LIBS) \ - $(LIBOSMOGSM_LIBS) \ - -lrt - diff --git a/tests/oap/oap_client_test.c b/tests/oap/oap_client_test.c new file mode 100644 index 0000000..a841b38 --- /dev/null +++ b/tests/oap/oap_client_test.c @@ -0,0 +1,271 @@ +/* Test Osmocom Authentication Protocol */ +/* + * (C) 2015 by sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include + +#include + +#include +#include + +static void test_oap_api(void) +{ + printf("Testing OAP API\n"); + + struct osmo_oap_client_config _config; + struct osmo_oap_client_config *config = &_config; + + struct osmo_oap_client_state _state; + struct osmo_oap_client_state *state = &_state; + + struct osmo_oap_message oap_rx; + struct msgb *msg_rx; + + struct osmo_oap_message oap_tx; + struct msgb *msg_tx; + + memset(config, 0, sizeof(*config)); + memset(state, 0, sizeof(*state)); + + OSMO_ASSERT(osmo_hexparse("0102030405060708090a0b0c0d0e0f10", config->secret_k, 16) == 16); + OSMO_ASSERT(osmo_hexparse("1112131415161718191a1b1c1d1e1f20", config->secret_opc, 16) == 16); + + fprintf(stderr, "- make sure filling with zeros means uninitialized\n"); + OSMO_ASSERT(state->state == OSMO_OAP_UNINITIALIZED); + + fprintf(stderr, "- reject messages in uninitialized state\n"); + memset(&oap_rx, 0, sizeof(oap_rx)); + state->client_id = 1; + oap_rx.message_type = OAP_MSGT_REGISTER_ERROR; + msg_rx = osmo_oap_client_encoded(&oap_rx); + OSMO_ASSERT(osmo_oap_client_handle(state, msg_rx, &msg_tx) < 0); + OSMO_ASSERT(state->state == OSMO_OAP_UNINITIALIZED); + msgb_free(msg_rx); + OSMO_ASSERT(!msg_tx); + + fprintf(stderr, "- NULL config should disable\n"); + OSMO_ASSERT( osmo_oap_client_init(NULL, state) == 0 ); + OSMO_ASSERT(state->state == OSMO_OAP_DISABLED); + + fprintf(stderr, "- reject messages in disabled state\n"); + memset(state, 0, sizeof(*state)); + memset(&oap_rx, 0, sizeof(oap_rx)); + state->state = OSMO_OAP_DISABLED; + state->client_id = 1; + oap_rx.message_type = OAP_MSGT_REGISTER_ERROR; + msg_rx = osmo_oap_client_encoded(&oap_rx); + OSMO_ASSERT(osmo_oap_client_handle(state, msg_rx, &msg_tx) < 0); + OSMO_ASSERT(state->state == OSMO_OAP_DISABLED); + msgb_free(msg_rx); + OSMO_ASSERT(!msg_tx); + + fprintf(stderr, "- invalid client_id and shared secret\n"); + memset(state, 0, sizeof(*state)); + config->client_id = 0; + config->secret_k_present = 0; + config->secret_opc_present = 0; + OSMO_ASSERT( osmo_oap_client_init(config, state) == 0 ); + OSMO_ASSERT(state->state == OSMO_OAP_DISABLED); + + fprintf(stderr, "- reset state\n"); + memset(state, 0, sizeof(*state)); + + fprintf(stderr, "- only client_id is invalid\n"); + config->client_id = 0; + config->secret_k_present = 1; + config->secret_opc_present = 1; + OSMO_ASSERT( osmo_oap_client_init(config, state) == 0 ); + OSMO_ASSERT(state->state == OSMO_OAP_DISABLED); + + memset(state, 0, sizeof(*state)); + + fprintf(stderr, "- valid id, but omitted shared_secret (1/2)\n"); + config->client_id = 12345; + config->secret_k_present = 0; + config->secret_opc_present = 1; + OSMO_ASSERT( osmo_oap_client_init(config, state) == 0 ); + OSMO_ASSERT(state->state == OSMO_OAP_DISABLED); + + memset(state, 0, sizeof(*state)); + + fprintf(stderr, "- valid id, but omitted shared_secret (2/2)\n"); + config->client_id = 12345; + config->secret_k_present = 1; + config->secret_opc_present = 0; + OSMO_ASSERT( osmo_oap_client_init(config, state) == 0 ); + OSMO_ASSERT(state->state == OSMO_OAP_DISABLED); + + memset(state, 0, sizeof(*state)); + + + fprintf(stderr, "- mint configuration\n"); + config->client_id = 12345; + config->secret_k_present = 1; + config->secret_opc_present = 1; + /*config->secret_* buffers are still set from the top */ + OSMO_ASSERT( osmo_oap_client_init(config, state) == 0 ); + OSMO_ASSERT(state->state == OSMO_OAP_INITIALIZED); + + + fprintf(stderr, "- Missing challenge data\n"); + memset(&oap_rx, 0, sizeof(oap_rx)); + oap_rx.message_type = OAP_MSGT_CHALLENGE_REQUEST; + oap_rx.rand_present = 0; + oap_rx.autn_present = 0; + msg_rx = osmo_oap_client_encoded(&oap_rx); + OSMO_ASSERT(osmo_oap_client_handle(state, msg_rx, &msg_tx) == -2); + msgb_free(msg_rx); + OSMO_ASSERT(!msg_tx); + + fprintf(stderr, "- AUTN missing\n"); + osmo_hexparse("0102030405060708090a0b0c0d0e0f10", + oap_rx.rand, 16); + oap_rx.rand_present = 1; + msg_rx = osmo_oap_client_encoded(&oap_rx); + OSMO_ASSERT(osmo_oap_client_handle(state, msg_rx, &msg_tx) == -2); + msgb_free(msg_rx); + OSMO_ASSERT(!msg_tx); + + fprintf(stderr, "- RAND missing\n"); + oap_rx.rand_present = 0; + osmo_hexparse("cec4e3848a33000086781158ca40f136", + oap_rx.autn, 16); + oap_rx.autn_present = 1; + msg_rx = osmo_oap_client_encoded(&oap_rx); + OSMO_ASSERT(osmo_oap_client_handle(state, msg_rx, &msg_tx) == -2); + msgb_free(msg_rx); + OSMO_ASSERT(!msg_tx); + + fprintf(stderr, "- wrong autn (by one bit)\n"); + osmo_hexparse("0102030405060708090a0b0c0d0e0f10", + oap_rx.rand, 16); + osmo_hexparse("dec4e3848a33000086781158ca40f136", + oap_rx.autn, 16); + oap_rx.rand_present = 1; + oap_rx.autn_present = 1; + msg_rx = osmo_oap_client_encoded(&oap_rx); + OSMO_ASSERT(osmo_oap_client_handle(state, msg_rx, &msg_tx) == -2); + msgb_free(msg_rx); + OSMO_ASSERT(!msg_tx); + + fprintf(stderr, "- all data correct\n"); + osmo_hexparse("cec4e3848a33000086781158ca40f136", + oap_rx.autn, 16); + msg_rx = osmo_oap_client_encoded(&oap_rx); + + fprintf(stderr, "- but refuse to evaluate in uninitialized state\n"); + OSMO_ASSERT(state->state == OSMO_OAP_INITIALIZED); + + state->state = OSMO_OAP_UNINITIALIZED; + OSMO_ASSERT(osmo_oap_client_handle(state, msg_rx, &msg_tx) < 0); + OSMO_ASSERT(!msg_tx); + + state->state = OSMO_OAP_DISABLED; + OSMO_ASSERT(osmo_oap_client_handle(state, msg_rx, &msg_tx) < 0); + OSMO_ASSERT(!msg_tx); + + state->state = OSMO_OAP_INITIALIZED; + + fprintf(stderr, "- now everything is correct\n"); + /* a successful return value here indicates correct autn */ + OSMO_ASSERT(osmo_oap_client_handle(state, msg_rx, &msg_tx) == 0); + msgb_free(msg_rx); + + fprintf(stderr, "- Expect the challenge response in msg_tx\n"); + OSMO_ASSERT(msg_tx); + OSMO_ASSERT(osmo_oap_decode(&oap_tx, msg_tx->data, msg_tx->len) == 0); + OSMO_ASSERT(oap_tx.message_type == OAP_MSGT_CHALLENGE_RESULT); + OSMO_ASSERT(strcmp("e2d05b598c61d9ba", + osmo_hexdump_nospc(oap_tx.xres, sizeof(oap_tx.xres))) + == 0); + OSMO_ASSERT(state->state == OSMO_OAP_SENT_CHALLENGE_RESULT); + msgb_free(msg_tx); + msg_tx = 0; + + struct osmo_oap_client_state saved_state = _state; + + fprintf(stderr, "- Receive registration error for the first time.\n"); + + memset(&oap_rx, 0, sizeof(oap_rx)); + oap_rx.message_type = OAP_MSGT_REGISTER_ERROR; + oap_rx.cause = GMM_CAUSE_PROTO_ERR_UNSPEC; + msg_rx = osmo_oap_client_encoded(&oap_rx); + + OSMO_ASSERT(state->registration_failures == 0); + OSMO_ASSERT(osmo_oap_client_handle(state, msg_rx, &msg_tx) == 0); + OSMO_ASSERT(state->registration_failures == 1); + OSMO_ASSERT(msg_tx); + OSMO_ASSERT(osmo_oap_decode(&oap_tx, msg_tx->data, msg_tx->len) == 0); + OSMO_ASSERT(oap_tx.message_type == OAP_MSGT_REGISTER_REQUEST); + OSMO_ASSERT(state->state == OSMO_OAP_REQUESTED_CHALLENGE); + msgb_free(msg_tx); + msg_tx = 0; + + fprintf(stderr, "- Receive registration error for the Nth time.\n"); + state->registration_failures = 999; + OSMO_ASSERT(osmo_oap_client_handle(state, msg_rx, &msg_tx) == -11); + OSMO_ASSERT(!msg_tx); + OSMO_ASSERT(state->state == OSMO_OAP_INITIALIZED); + msgb_free(msg_tx); + msg_tx = 0; + + msgb_free(msg_rx); + + fprintf(stderr, "- Registration success\n"); + + _state = saved_state; + memset(&oap_rx, 0, sizeof(oap_rx)); + oap_rx.message_type = OAP_MSGT_REGISTER_RESULT; + msg_rx = osmo_oap_client_encoded(&oap_rx); + OSMO_ASSERT(osmo_oap_client_handle(state, msg_rx, &msg_tx) == 0); + OSMO_ASSERT(!msg_tx); + OSMO_ASSERT(state->state == OSMO_OAP_REGISTERED); + msgb_free(msg_rx); +} + +static struct log_info_cat oap_client_test_categories[] = { +}; + +static struct log_info info = { + .cat = oap_client_test_categories, + .num_cat = ARRAY_SIZE(oap_client_test_categories), +}; + +int main(int argc, char **argv) +{ + void *ctx = talloc_named_const(NULL, 0, "oap_client_test"); + msgb_talloc_ctx_init(ctx, 0); + osmo_init_logging2(ctx, &info); + + OSMO_ASSERT(osmo_stderr_target); + log_set_use_color(osmo_stderr_target, 0); + log_set_print_timestamp(osmo_stderr_target, 0); + log_set_print_filename(osmo_stderr_target, 0); + log_set_print_category(osmo_stderr_target, 1); + log_parse_category_mask(osmo_stderr_target, "DLOAP,1"); + + test_oap_api(); + printf("Done\n"); + + return 0; +} + diff --git a/tests/oap/oap_client_test.err b/tests/oap/oap_client_test.err new file mode 100644 index 0000000..62ddc9e --- /dev/null +++ b/tests/oap/oap_client_test.err @@ -0,0 +1,35 @@ +- make sure filling with zeros means uninitialized +- reject messages in uninitialized state +DLOAP Received OAP message 5, but the OAP client is not initialized +- NULL config should disable +- reject messages in disabled state +DLOAP Received OAP message 5, but the OAP client is disabled +- invalid client_id and shared secret +- reset state +- only client_id is invalid +- valid id, but omitted shared_secret (1/2) +DLOAP OAP: client ID set, but secret K missing. +- valid id, but omitted shared_secret (2/2) +DLOAP OAP: client ID set, but secret OPC missing. +- mint configuration +- Missing challenge data +DLOAP OAP challenge incomplete (rand_present: 0, autn_present: 0) +- AUTN missing +DLOAP OAP challenge incomplete (rand_present: 1, autn_present: 0) +- RAND missing +DLOAP OAP challenge incomplete (rand_present: 0, autn_present: 1) +- wrong autn (by one bit) +DLOAP OAP: AUTN mismatch! +DLOAP OAP: AUTN from server: dec4e3848a33000086781158ca40f136 +DLOAP OAP: AUTN expected: cec4e3848a33000086781158ca40f136 +- all data correct +- but refuse to evaluate in uninitialized state +DLOAP Received OAP message 8, but the OAP client is not initialized +DLOAP Received OAP message 8, but the OAP client is disabled +- now everything is correct +- Expect the challenge response in msg_tx +- Receive registration error for the first time. +DLOAP OAP registration failed +- Receive registration error for the Nth time. +DLOAP OAP registration failed +- Registration success diff --git a/tests/oap/oap_client_test.ok b/tests/oap/oap_client_test.ok new file mode 100644 index 0000000..59108a7 --- /dev/null +++ b/tests/oap/oap_client_test.ok @@ -0,0 +1,2 @@ +Testing OAP API +Done diff --git a/tests/testsuite.at b/tests/testsuite.at index 43b58e8..a1cf98a 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -274,6 +274,13 @@ AT_CHECK([$abs_top_builddir/tests/oap/oap_test], [0], [expout], [experr]) AT_CLEANUP +AT_SETUP([oap_client]) +AT_KEYWORDS([oap_client]) +cat $abs_srcdir/oap/oap_client_test.ok > expout +cat $abs_srcdir/oap/oap_client_test.err > experr +AT_CHECK([$abs_top_builddir/tests/oap/oap_client_test], [0], [expout], [experr]) +AT_CLEANUP + AT_SETUP([socket]) AT_KEYWORDS([socket]) cat $abs_srcdir/socket/socket_test.ok > expout -- To view, visit https://gerrit.osmocom.org/10258 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I9d64e10b4bacac9b530cf077841bad762fc6d558 Gerrit-Change-Number: 10258 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 16:30:33 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 16:30:33 +0000 Subject: Change in osmo-msc[master]: migrate to oap_client in libosmogsm In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10257 ) Change subject: migrate to oap_client in libosmogsm ...................................................................... Patch Set 1: let's delay merging this until tomorrow, to avoid ttcn3 tests failing due to OBS nightly packages not yet including oap_client -- To view, visit https://gerrit.osmocom.org/10257 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib6496c35d0ce6eb531e97129dc45a9f68e503b34 Gerrit-Change-Number: 10257 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 30 Jul 2018 16:30:33 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 16:30:40 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 16:30:40 +0000 Subject: Change in osmo-sgsn[master]: migrate to oap_client in libosmogsm In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10259 ) Change subject: migrate to oap_client in libosmogsm ...................................................................... Patch Set 2: let's delay merging this until tomorrow, to avoid ttcn3 tests failing due to OBS nightly packages not yet including oap_client -- To view, visit https://gerrit.osmocom.org/10259 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7b194f98ef3f925b6178d8a8dbd9fcf2f0c6e132 Gerrit-Change-Number: 10259 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 30 Jul 2018 16:30:40 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Mon Jul 30 16:34:13 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Mon, 30 Jul 2018 16:34:13 +0000 (UTC) Subject: =?UTF-8?Q?Jenkins_build_is_back_to_normal_:_master-osmo-gmr_=C2=BB_a1=3Dd?= =?UTF-8?Q?efault,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#772?= In-Reply-To: <22747682.4.1532948605231.JavaMail.jenkins@jenkins.osmocom.org> References: <22747682.4.1532948605231.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <1222860920.11.1532968453445.JavaMail.jenkins@jenkins.osmocom.org> See From gerrit-no-reply at lists.osmocom.org Mon Jul 30 16:37:09 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 16:37:09 +0000 Subject: Change in osmo-hlr[master]: hlr_vty_subscr.c: fix subscriber creation command help In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10253 ) Change subject: hlr_vty_subscr.c: fix subscriber creation command help ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10253 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id8dda53cdd10aeedf5451109f9e61d6438c3e09b Gerrit-Change-Number: 10253 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 30 Jul 2018 16:37:09 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 16:37:19 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 16:37:19 +0000 Subject: Change in osmo-hlr[master]: Update .gitignore: add missing build products In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10254 ) Change subject: Update .gitignore: add missing build products ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10254 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I71809105c631703477d8226ba28a57121807b5ed Gerrit-Change-Number: 10254 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 30 Jul 2018 16:37:19 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 16:37:26 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 16:37:26 +0000 Subject: Change in osmo-hlr[master]: tests/Makefile.am: also remove temporary sqlite files In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10255 ) Change subject: tests/Makefile.am: also remove temporary sqlite files ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10255 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9e4c98e86c1d6b627bfee1acb4fa116460687483 Gerrit-Change-Number: 10255 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 30 Jul 2018 16:37:26 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 16:37:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 16:37:27 +0000 Subject: Change in osmo-hlr[master]: hlr_vty_subscr.c: fix subscriber creation command help In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10253 ) Change subject: hlr_vty_subscr.c: fix subscriber creation command help ...................................................................... hlr_vty_subscr.c: fix subscriber creation command help Change-Id: Id8dda53cdd10aeedf5451109f9e61d6438c3e09b --- M src/hlr_vty_subscr.c 1 file changed, 3 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/hlr_vty_subscr.c b/src/hlr_vty_subscr.c index 9ee6948..6ce96fe 100644 --- a/src/hlr_vty_subscr.c +++ b/src/hlr_vty_subscr.c @@ -163,8 +163,9 @@ subscriber_create_cmd, SUBSCR_CMD "imsi IDENT create", SUBSCR_CMD_HELP - "Create subscriber by IMSI\n" - "IMSI/MSISDN/ID of the subscriber\n") + "Identify subscriber by IMSI\n" + "IMSI/MSISDN/ID of the subscriber\n" + "Create subscriber by IMSI\n") { int rc; struct hlr_subscriber subscr; -- To view, visit https://gerrit.osmocom.org/10253 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Id8dda53cdd10aeedf5451109f9e61d6438c3e09b Gerrit-Change-Number: 10253 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 16:37:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 16:37:27 +0000 Subject: Change in osmo-hlr[master]: Update .gitignore: add missing build products In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10254 ) Change subject: Update .gitignore: add missing build products ...................................................................... Update .gitignore: add missing build products Change-Id: I71809105c631703477d8226ba28a57121807b5ed --- M .gitignore 1 file changed, 8 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitignore b/.gitignore index 571f5b1..baaaeb6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ *.o +*.lo +*.la *.db *.pyc .*.sw? @@ -23,16 +25,22 @@ .deps *.pc +.libs src/db_test src/db_bootstrap.h src/osmo-hlr src/osmo-hlr-db-tool +src/gsupclient/gsup-test-client tests/atconfig tests/testsuite +tests/testsuite.log + tests/auc/auc_3g_test tests/auc/auc_ts_55_205_test_sets.c tests/auc/auc_ts_55_205_test_sets tests/auc/auc_test tests/gsup_server/gsup_server_test +tests/gsup/gsup_test +tests/db/db_test -- To view, visit https://gerrit.osmocom.org/10254 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I71809105c631703477d8226ba28a57121807b5ed Gerrit-Change-Number: 10254 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 16:37:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 16:37:28 +0000 Subject: Change in osmo-hlr[master]: tests/Makefile.am: also remove temporary sqlite files In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10255 ) Change subject: tests/Makefile.am: also remove temporary sqlite files ...................................................................... tests/Makefile.am: also remove temporary sqlite files The osmo_verify_transcript_*.py do terminate the osmo-hlr process in some unusual way, so the database file is not closed properly. Let's remove temporary files after the tests execution. Change-Id: I9e4c98e86c1d6b627bfee1acb4fa116460687483 --- M tests/Makefile.am 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/Makefile.am b/tests/Makefile.am index 58679ed..7e45da4 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -57,6 +57,7 @@ -r "$(top_builddir)/src/osmo-hlr -c $(top_srcdir)/doc/examples/osmo-hlr.cfg -l $(VTY_TEST_DB)" \ $(U) $(srcdir)/*.vty -rm -f $(VTY_TEST_DB) + -rm $(VTY_TEST_DB)-* CTRL_TEST_DB = hlr_ctrl_test.db @@ -72,6 +73,7 @@ -r "$(top_builddir)/src/osmo-hlr -c $(top_srcdir)/doc/examples/osmo-hlr.cfg -l $(CTRL_TEST_DB)" \ $(U) $(srcdir)/*.ctrl -rm -f $(CTRL_TEST_DB) + -rm $(CTRL_TEST_DB)-* else python-tests: -- To view, visit https://gerrit.osmocom.org/10255 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I9e4c98e86c1d6b627bfee1acb4fa116460687483 Gerrit-Change-Number: 10255 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 16:43:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 16:43:18 +0000 Subject: Change in osmo-sgsn[master]: migrate to oap_client in libosmogsm In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10259 ) Change subject: migrate to oap_client in libosmogsm ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/10259 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7b194f98ef3f925b6178d8a8dbd9fcf2f0c6e132 Gerrit-Change-Number: 10259 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 30 Jul 2018 16:43:18 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 16:43:58 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 30 Jul 2018 16:43:58 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc/USSD: introduce common GSUP/DTAP matching functions In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9687 to look at the new patch set (#4). Change subject: msc/USSD: introduce common GSUP/DTAP matching functions ...................................................................... msc/USSD: introduce common GSUP/DTAP matching functions In order to avoid code duplication in the upcoming test cases, let's introduce a few functions which basically do a GSUP/DTAP message matching within the alternative statement. Change-Id: I846c2d40a7c37afa8647e644673b4df905e3e116 --- M msc/MSC_Tests.ttcn 1 file changed, 42 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/87/9687/4 -- To view, visit https://gerrit.osmocom.org/9687 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I846c2d40a7c37afa8647e644673b4df905e3e116 Gerrit-Change-Number: 9687 Gerrit-PatchSet: 4 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 16:43:58 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 30 Jul 2018 16:43:58 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc/USSD: expect and reply SS/USSD messages over GSUP In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9685 to look at the new patch set (#4). Change subject: msc/USSD: expect and reply SS/USSD messages over GSUP ...................................................................... msc/USSD: expect and reply SS/USSD messages over GSUP As we are about to finish the implementation of GSM TS 09.11, OsmoMSC will forward all SS/USSD messages over GSUP to HLR, and will expect responses back from HLR. The SS/USSD payload processing will be out of scope for OsmoMSC itself. Let's modify the existing test cases in order to expect and reply SS/USSD messages over GSUP protocol. Change-Id: I01de73aced6057328a121577a5a83bc2615fb2d4 --- M msc/MSC_Tests.ttcn 1 file changed, 81 insertions(+), 40 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/85/9685/4 -- To view, visit https://gerrit.osmocom.org/9685 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I01de73aced6057328a121577a5a83bc2615fb2d4 Gerrit-Change-Number: 9685 Gerrit-PatchSet: 4 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 16:43:58 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 30 Jul 2018 16:43:58 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc/USSD: add test cases with network-initiaded SS/USSD In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9686 to look at the new patch set (#5). Change subject: msc/USSD: add test cases with network-initiaded SS/USSD ...................................................................... msc/USSD: add test cases with network-initiaded SS/USSD This change introduces two new test cases for network-initiaded USSD notification and network-initiaded USSD request, which are based on the existing SS/USSD related test cases. The idea of TC_lu_and_mt_ussd_notification is to verify that a network-initiaded USSD notification can arrive subscriber in IDLE mode using Paging procedure. The idea of TC_lu_and_mt_ussd_during_mt_call is to verify that a network-initiaded USSD notification can arrive subscriber in DEDICATED mode (in this case during a call) on a separate transaction. Change-Id: I073893c6e11be27e9e36f98f11c1491d0c173985 --- M msc/MSC_Tests.ttcn M msc/expected-results.xml 2 files changed, 209 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/86/9686/5 -- To view, visit https://gerrit.osmocom.org/9686 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I073893c6e11be27e9e36f98f11c1491d0c173985 Gerrit-Change-Number: 9686 Gerrit-PatchSet: 5 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 16:43:58 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 30 Jul 2018 16:43:58 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc/USSD: introduce TC_lu_and_mo_ussd_mo_release In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/9689 to look at the new patch set (#3). Change subject: msc/USSD: introduce TC_lu_and_mo_ussd_mo_release ...................................................................... msc/USSD: introduce TC_lu_and_mo_ussd_mo_release The idea of this test case is to check the reaction of OsmoMSC on MS-initiated release during an active transaction. In other words, when the network is waiting for some response from a MS, subscriber can press the 'red button' in order to terminate this conversation. It is expected that the MSC would terminate the transaction as on DTAP interface, as on GSUP interface. Change-Id: I7936ed5072ed2ae02f039dc90a1fece1e7f70a70 --- M msc/MSC_Tests.ttcn M msc/expected-results.xml 2 files changed, 99 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/89/9689/3 -- To view, visit https://gerrit.osmocom.org/9689 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7936ed5072ed2ae02f039dc90a1fece1e7f70a70 Gerrit-Change-Number: 9689 Gerrit-PatchSet: 3 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 16:49:45 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 16:49:45 +0000 Subject: Change in osmo-sgsn[master]: remove libcommon In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10260 ) Change subject: remove libcommon ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10260 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I9307f9da7f48dd0a2e1cb213072068736e569722 Gerrit-Change-Number: 10260 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 30 Jul 2018 16:49:45 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 18:53:37 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 18:53:37 +0000 Subject: Change in libosmocore[master]: logging: Fix logging level all In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10116 ) Change subject: logging: Fix logging level all ...................................................................... Patch Set 3: Code-Review-2 See my mailing list post. Do we really have no more pressing needs than re-desinging/defining how the log configuration works? If at all, we should *remove* some of the cruft / "features" there are. Make it simpler, rather than more complex. And first of all, make sure *everything* about the existing implementation is properly documented in manuals / howtos / ... -- To view, visit https://gerrit.osmocom.org/10116 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0f50ad8d6fd038398f7d751287417505c8dcdeff Gerrit-Change-Number: 10116 Gerrit-PatchSet: 3 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 30 Jul 2018 18:53:37 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 18:54:13 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 18:54:13 +0000 Subject: Change in libosmocore[master]: logging: Add VTY cmd: logging level default In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10136 ) Change subject: logging: Add VTY cmd: logging level default ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10136 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iee0d4da16b075e798f85c3f6adeb513057fd5402 Gerrit-Change-Number: 10136 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 30 Jul 2018 18:54:13 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 18:54:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 18:54:21 +0000 Subject: Change in libosmocore[master]: logging: Add VTY cmd: logging level default In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10136 ) Change subject: logging: Add VTY cmd: logging level default ...................................................................... Patch Set 2: Code-Review-2 -- To view, visit https://gerrit.osmocom.org/10136 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iee0d4da16b075e798f85c3f6adeb513057fd5402 Gerrit-Change-Number: 10136 Gerrit-PatchSet: 2 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 30 Jul 2018 18:54:21 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 19:23:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 19:23:55 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc/USSD: introduce common GSUP/DTAP matching functions In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9687 ) Change subject: msc/USSD: introduce common GSUP/DTAP matching functions ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9687 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I846c2d40a7c37afa8647e644673b4df905e3e116 Gerrit-Change-Number: 9687 Gerrit-PatchSet: 4 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 30 Jul 2018 19:23:55 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 19:23:59 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 19:23:59 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc/USSD: expect and reply SS/USSD messages over GSUP In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9685 ) Change subject: msc/USSD: expect and reply SS/USSD messages over GSUP ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9685 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I01de73aced6057328a121577a5a83bc2615fb2d4 Gerrit-Change-Number: 9685 Gerrit-PatchSet: 4 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 30 Jul 2018 19:23:59 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 19:24:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 19:24:57 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc/USSD: add test cases with network-initiaded SS/USSD In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9686 ) Change subject: msc/USSD: add test cases with network-initiaded SS/USSD ...................................................................... Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9686 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I073893c6e11be27e9e36f98f11c1491d0c173985 Gerrit-Change-Number: 9686 Gerrit-PatchSet: 5 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Mon, 30 Jul 2018 19:24:57 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 19:25:07 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 19:25:07 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc/USSD: introduce TC_lu_and_mo_ussd_mo_release In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/9689 ) Change subject: msc/USSD: introduce TC_lu_and_mo_ussd_mo_release ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/9689 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7936ed5072ed2ae02f039dc90a1fece1e7f70a70 Gerrit-Change-Number: 9689 Gerrit-PatchSet: 3 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Mon, 30 Jul 2018 19:25:07 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 19:25:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 19:25:08 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc/USSD: introduce common GSUP/DTAP matching functions In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9687 ) Change subject: msc/USSD: introduce common GSUP/DTAP matching functions ...................................................................... msc/USSD: introduce common GSUP/DTAP matching functions In order to avoid code duplication in the upcoming test cases, let's introduce a few functions which basically do a GSUP/DTAP message matching within the alternative statement. Change-Id: I846c2d40a7c37afa8647e644673b4df905e3e116 --- M msc/MSC_Tests.ttcn 1 file changed, 42 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index 4a6b822..640940d 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -2141,6 +2141,48 @@ * USSD Testing ***********************************************************************/ +private altstep as_unexp_gsup_or_bssap_msg() +runs on BSC_ConnHdlr { + [] GSUP.receive { + setverdict(fail, "Unknown/unexpected GSUP received"); + self.stop; + } + [] BSSAP.receive { + setverdict(fail, "Unknown/unexpected BSSAP message received"); + self.stop; + } +} + +private function f_expect_gsup_msg(template GSUP_PDU msg) +runs on BSC_ConnHdlr return GSUP_PDU { + var GSUP_PDU gsup_msg_complete; + + alt { + [] GSUP.receive(msg) -> value gsup_msg_complete { + setverdict(pass); + } + /* We don't expect anything else */ + [] as_unexp_gsup_or_bssap_msg(); + } + + return gsup_msg_complete; +} + +private function f_expect_mt_dtap_msg(template PDU_ML3_NW_MS msg) +runs on BSC_ConnHdlr return PDU_ML3_NW_MS { + var PDU_DTAP_MT bssap_msg_complete; + + alt { + [] BSSAP.receive(tr_PDU_DTAP_MT(msg)) -> value bssap_msg_complete { + setverdict(pass); + } + /* We don't expect anything else */ + [] as_unexp_gsup_or_bssap_msg(); + } + + return bssap_msg_complete.dtap; +} + /* LU followed by MO USSD request */ private function f_tc_lu_and_mo_ussd_single_request(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { -- To view, visit https://gerrit.osmocom.org/9687 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I846c2d40a7c37afa8647e644673b4df905e3e116 Gerrit-Change-Number: 9687 Gerrit-PatchSet: 4 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 19:25:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 19:25:08 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc/USSD: expect and reply SS/USSD messages over GSUP In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9685 ) Change subject: msc/USSD: expect and reply SS/USSD messages over GSUP ...................................................................... msc/USSD: expect and reply SS/USSD messages over GSUP As we are about to finish the implementation of GSM TS 09.11, OsmoMSC will forward all SS/USSD messages over GSUP to HLR, and will expect responses back from HLR. The SS/USSD payload processing will be out of scope for OsmoMSC itself. Let's modify the existing test cases in order to expect and reply SS/USSD messages over GSUP protocol. Change-Id: I01de73aced6057328a121577a5a83bc2615fb2d4 --- M msc/MSC_Tests.ttcn 1 file changed, 81 insertions(+), 40 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index 640940d..e7c0a2a 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -2194,40 +2194,62 @@ /* Send CM Service Request for SS/USSD */ f_establish_fully(EST_TYPE_SS_ACT); + /* We need to inspect GSUP activity */ + f_create_gsup_expect(hex2str(g_pars.imsi)); + + var template OCTN facility_req := f_USSD_FACILITY_IE_INVOKE( + invoke_id := 5, /* Phone may not start from 0 or 1 */ + op_code := SS_OP_CODE_PROCESS_USS_REQ, + ussd_string := "*#100#" + ); + + var template OCTN facility_rsp := f_USSD_FACILITY_IE_RETURN_RESULT( + invoke_id := 5, /* InvokeID shall be the same for both REQ and RSP */ + op_code := SS_OP_CODE_PROCESS_USS_REQ, + ussd_string := "Your extension is " & hex2str(g_pars.msisdn) & "\r" + ) + /* Compose a new SS/REGISTER message with request */ var template (value) PDU_ML3_MS_NW ussd_req := ts_ML3_MO_SS_REGISTER( tid := 1, /* We just need a single transaction */ ti_flag := c_TIF_ORIG, /* Sent from the side that originates the TI */ - facility := f_USSD_FACILITY_IE_INVOKE( - invoke_id := 5, /* Phone may not start from 0 or 1 */ - op_code := SS_OP_CODE_PROCESS_USS_REQ, - ussd_string := "*#100#" - ) + facility := valueof(facility_req) ); /* Compose SS/RELEASE_COMPLETE template with expected response */ var template PDU_ML3_NW_MS ussd_rsp := tr_ML3_MT_SS_RELEASE_COMPLETE( tid := 1, /* Response should arrive within the same transaction */ ti_flag := c_TIF_REPL, /* Sent to the side that originates the TI */ - facility := f_USSD_FACILITY_IE_RETURN_RESULT( - invoke_id := 5, /* InvokeID shall be the same for both REQ and RSP */ - op_code := SS_OP_CODE_PROCESS_USS_REQ, - ussd_string := "Your extension is " & hex2str(g_pars.msisdn) & "\r" - ) + facility := valueof(facility_rsp) ); - /* Request own number request */ + /* Compose expected MSC -> HLR message */ + var template GSUP_PDU gsup_req := tr_GSUP_PROC_SS_REQ( + imsi := g_pars.imsi, + state := OSMO_GSUP_SESSION_STATE_BEGIN, + ss := valueof(facility_req) + ); + + /* To be used for sending response with correct session ID */ + var GSUP_PDU gsup_req_complete; + + /* Request own number */ BSSAP.send(ts_PDU_DTAP_MO(ussd_req)); - alt { - /* We expect RELEASE_COMPLETE message with the response */ - [] BSSAP.receive(tr_PDU_DTAP_MT(ussd_rsp)) { - setverdict(pass); - } - [] BSSAP.receive { - setverdict(fail, "Unknown/unexpected BSSAP received"); - mtc.stop; - } - } + /* Expect GSUP message containing the SS payload */ + gsup_req_complete := f_expect_gsup_msg(gsup_req); + + /* Compose the response from HLR using received session ID */ + var template GSUP_PDU gsup_rsp := ts_GSUP_PROC_SS_REQ( + imsi := g_pars.imsi, + sid := gsup_req_complete.ies[1].val.session_id, + state := OSMO_GSUP_SESSION_STATE_END, + ss := valueof(facility_rsp) + ); + + /* Finally, HLR terminates the session */ + GSUP.send(gsup_rsp); + /* Expect RELEASE_COMPLETE message with the response */ + f_expect_mt_dtap_msg(ussd_rsp); f_expect_clear(); } @@ -2259,38 +2281,57 @@ /* Hold the call for some time */ f_sleep(1.0); + var template OCTN facility_req := f_USSD_FACILITY_IE_INVOKE( + op_code := SS_OP_CODE_PROCESS_USS_REQ, + ussd_string := "*#100#" + ); + + var template OCTN facility_rsp := f_USSD_FACILITY_IE_RETURN_RESULT( + op_code := SS_OP_CODE_PROCESS_USS_REQ, + ussd_string := "Your extension is " & hex2str(g_pars.msisdn) & "\r" + ) + /* Compose a new SS/REGISTER message with request */ var template (value) PDU_ML3_MS_NW ussd_req := ts_ML3_MO_SS_REGISTER( tid := 1, /* We just need a single transaction */ ti_flag := c_TIF_ORIG, /* Sent from the side that originates the TI */ - facility := f_USSD_FACILITY_IE_INVOKE( - op_code := SS_OP_CODE_PROCESS_USS_REQ, - ussd_string := "*#100#" - ) + facility := valueof(facility_req) ); /* Compose SS/RELEASE_COMPLETE template with expected response */ var template PDU_ML3_NW_MS ussd_rsp := tr_ML3_MT_SS_RELEASE_COMPLETE( tid := 1, /* Response should arrive within the same transaction */ ti_flag := c_TIF_REPL, /* Sent to the side that originates the TI */ - facility := f_USSD_FACILITY_IE_RETURN_RESULT( - op_code := SS_OP_CODE_PROCESS_USS_REQ, - ussd_string := "Your extension is " & hex2str(g_pars.msisdn) & "\r" - ) + facility := valueof(facility_rsp) ); - /* Request own number request */ + /* Compose expected MSC -> HLR message */ + var template GSUP_PDU gsup_req := tr_GSUP_PROC_SS_REQ( + imsi := g_pars.imsi, + state := OSMO_GSUP_SESSION_STATE_BEGIN, + ss := valueof(facility_req) + ); + + /* To be used for sending response with correct session ID */ + var GSUP_PDU gsup_req_complete; + + /* Request own number */ BSSAP.send(ts_PDU_DTAP_MO(ussd_req)); - alt { - /* We expect RELEASE_COMPLETE message with the response */ - [] BSSAP.receive(tr_PDU_DTAP_MT(ussd_rsp)) { - setverdict(pass); - } - [] BSSAP.receive { - setverdict(fail, "Unknown/unexpected BSSAP received"); - mtc.stop; - } - } + /* Expect GSUP message containing the SS payload */ + gsup_req_complete := f_expect_gsup_msg(gsup_req); + + /* Compose the response from HLR using received session ID */ + var template GSUP_PDU gsup_rsp := ts_GSUP_PROC_SS_REQ( + imsi := g_pars.imsi, + sid := gsup_req_complete.ies[1].val.session_id, + state := OSMO_GSUP_SESSION_STATE_END, + ss := valueof(facility_rsp) + ); + + /* Finally, HLR terminates the session */ + GSUP.send(gsup_rsp); + /* Expect RELEASE_COMPLETE message with the response */ + f_expect_mt_dtap_msg(ussd_rsp); /* Hold the call for some time */ f_sleep(1.0); -- To view, visit https://gerrit.osmocom.org/9685 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I01de73aced6057328a121577a5a83bc2615fb2d4 Gerrit-Change-Number: 9685 Gerrit-PatchSet: 4 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 19:25:09 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 19:25:09 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc/USSD: add test cases with network-initiaded SS/USSD In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9686 ) Change subject: msc/USSD: add test cases with network-initiaded SS/USSD ...................................................................... msc/USSD: add test cases with network-initiaded SS/USSD This change introduces two new test cases for network-initiaded USSD notification and network-initiaded USSD request, which are based on the existing SS/USSD related test cases. The idea of TC_lu_and_mt_ussd_notification is to verify that a network-initiaded USSD notification can arrive subscriber in IDLE mode using Paging procedure. The idea of TC_lu_and_mt_ussd_during_mt_call is to verify that a network-initiaded USSD notification can arrive subscriber in DEDICATED mode (in this case during a call) on a separate transaction. Change-Id: I073893c6e11be27e9e36f98f11c1491d0c173985 --- M msc/MSC_Tests.ttcn M msc/expected-results.xml 2 files changed, 209 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index e7c0a2a..b247f23 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -2260,6 +2260,109 @@ vc_conn.done; } +/* LU followed by MT USSD notification */ +private function f_tc_lu_and_mt_ussd_notification(charstring id, BSC_ConnHdlrPars pars) +runs on BSC_ConnHdlr { + f_init_handler(pars); + + /* Perform location update */ + f_perform_lu(); + + f_bssmap_register_imsi(g_pars.imsi, g_pars.tmsi); + + /* We need to inspect GSUP activity */ + f_create_gsup_expect(hex2str(g_pars.imsi)); + + /* Facility IE with network-originated USSD notification */ + var template OCTN facility_req := f_USSD_FACILITY_IE_INVOKE( + op_code := SS_OP_CODE_USS_NOTIFY, + ussd_string := "Mahlzeit!" + ); + + /* Facility IE with acknowledgment to the USSD notification */ + var template OCTN facility_rsp := enc_SS_FacilityInformation( + /* In case of USSD notification, Return Result is empty */ + valueof(ts_SS_USSD_FACILITY_RETURN_RESULT_EMPTY()) + ); + + /* Compose a new MT SS/REGISTER message with USSD notification */ + var template PDU_ML3_NW_MS ussd_ntf := tr_ML3_MT_SS_REGISTER( + tid := 0, /* FIXME: most likely, it should be 0 */ + ti_flag := c_TIF_ORIG, /* Sent from the side that originates the TI */ + facility := valueof(facility_req) + ); + + /* Compose HLR -> MSC GSUP message */ + var template (value) GSUP_PDU gsup_req := ts_GSUP_PROC_SS_REQ( + imsi := g_pars.imsi, + sid := '20000101'O, + state := OSMO_GSUP_SESSION_STATE_BEGIN, + ss := valueof(facility_req) + ); + + /* Send it to MSC and expect Paging Request */ + GSUP.send(gsup_req); + alt { + [] BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)) { + setverdict(pass); + } + /* We don't expect anything else */ + [] as_unexp_gsup_or_bssap_msg(); + } + + /* Send Paging Response and expect USSD notification */ + f_establish_fully(EST_TYPE_PAG_RESP); + /* Expect MT REGISTER message with USSD notification */ + f_expect_mt_dtap_msg(ussd_ntf); + + /* Compose a new MO SS/FACILITY message with empty response */ + var template (value) PDU_ML3_MS_NW ussd_rsp := ts_ML3_MO_SS_FACILITY( + tid := 0, /* FIXME: it shall match the request tid */ + ti_flag := c_TIF_REPL, /* Sent to the side that originates the TI */ + facility := valueof(facility_rsp) + ); + + /* Compose expected MSC -> HLR GSUP message */ + var template GSUP_PDU gsup_rsp := tr_GSUP_PROC_SS_REQ( + imsi := g_pars.imsi, + sid := '20000101'O, + state := OSMO_GSUP_SESSION_STATE_CONTINUE, + ss := valueof(facility_rsp) + ); + + /* MS sends response to the notification */ + BSSAP.send(ts_PDU_DTAP_MO(ussd_rsp)); + /* Expect GSUP message containing the SS payload */ + f_expect_gsup_msg(gsup_rsp); + + /* Compose expected MT SS/RELEASE COMPLETE message */ + var template PDU_ML3_NW_MS ussd_term := tr_ML3_MT_SS_RELEASE_COMPLETE( + tid := 0, /* FIXME: it shall match the request tid */ + ti_flag := c_TIF_ORIG, /* Sent from the side that originates the TI */ + facility := omit + ); + + /* Compose MSC -> HLR GSUP message */ + var template GSUP_PDU gsup_term := ts_GSUP_PROC_SS_REQ( + imsi := g_pars.imsi, + sid := '20000101'O, + state := OSMO_GSUP_SESSION_STATE_END + ); + + /* Finally, HLR terminates the session */ + GSUP.send(gsup_term) + /* Expect MT RELEASE COMPLETE without Facility IE */ + f_expect_mt_dtap_msg(ussd_term); + + f_expect_clear(); +} +testcase TC_lu_and_mt_ussd_notification() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + vc_conn := f_start_handler(refers(f_tc_lu_and_mt_ussd_notification), 47); + vc_conn.done; +} + /* LU followed by MT call and MO USSD request during this call */ private function f_tc_lu_and_mo_ussd_during_mt_call(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { @@ -2388,6 +2491,108 @@ vc_conn.done; } +/* LU followed by MT call and MT USSD request during this call */ +private function f_tc_lu_and_mt_ussd_during_mt_call(charstring id, BSC_ConnHdlrPars pars) +runs on BSC_ConnHdlr { + f_init_handler(pars); + + /* Call parameters taken from f_tc_lu_and_mt_call */ + var CallParameters cpars := valueof(t_CallParams('123456'H, 0)); + cpars.mgcp_connection_id_bss := '10004'H; + cpars.mgcp_connection_id_mss := '10005'H; + cpars.mgcp_ep := "rtpbridge/1 at mgw"; + cpars.bss_rtp_port := 1110; + + /* Perform location update */ + f_perform_lu(); + + /* Establish a MT call */ + f_mt_call_establish(cpars); + + /* Hold the call for some time */ + f_sleep(1.0); + + var template OCTN facility_req := f_USSD_FACILITY_IE_INVOKE( + op_code := SS_OP_CODE_USS_REQUEST, + ussd_string := "Please type anything..." + ); + + var template OCTN facility_rsp := f_USSD_FACILITY_IE_RETURN_RESULT( + op_code := SS_OP_CODE_USS_REQUEST, + ussd_string := "Nope." + ) + + /* Compose MT SS/REGISTER message with network-originated request */ + var template (value) PDU_ML3_NW_MS ussd_req := ts_ML3_MT_SS_REGISTER( + tid := 0, /* FIXME: most likely, it should be 0 */ + ti_flag := c_TIF_ORIG, /* Sent from the side that originates the TI */ + facility := valueof(facility_req) + ); + + /* Compose HLR -> MSC GSUP message */ + var template (value) GSUP_PDU gsup_req := ts_GSUP_PROC_SS_REQ( + imsi := g_pars.imsi, + sid := '20000101'O, + state := OSMO_GSUP_SESSION_STATE_BEGIN, + ss := valueof(facility_req) + ); + + /* Send it to MSC */ + GSUP.send(gsup_req); + /* Expect MT REGISTER message with USSD request */ + f_expect_mt_dtap_msg(ussd_req); + + /* Compose a new MO SS/FACILITY message with response */ + var template (value) PDU_ML3_MS_NW ussd_rsp := ts_ML3_MO_SS_FACILITY( + tid := 0, /* FIXME: it shall match the request tid */ + ti_flag := c_TIF_REPL, /* Sent to the side that originates the TI */ + facility := valueof(facility_rsp) + ); + + /* Compose expected MSC -> HLR GSUP message */ + var template GSUP_PDU gsup_rsp := tr_GSUP_PROC_SS_REQ( + imsi := g_pars.imsi, + sid := '20000101'O, + state := OSMO_GSUP_SESSION_STATE_CONTINUE, + ss := valueof(facility_rsp) + ); + + /* MS sends response */ + BSSAP.send(ts_PDU_DTAP_MO(ussd_rsp)); + f_expect_gsup_msg(gsup_rsp); + + /* Compose expected MT SS/RELEASE COMPLETE message */ + var template PDU_ML3_NW_MS ussd_term := tr_ML3_MT_SS_RELEASE_COMPLETE( + tid := 0, /* FIXME: it shall match the request tid */ + ti_flag := c_TIF_ORIG, /* Sent from the side that originates the TI */ + facility := omit + ); + + /* Compose MSC -> HLR GSUP message */ + var template GSUP_PDU gsup_term := ts_GSUP_PROC_SS_REQ( + imsi := g_pars.imsi, + sid := '20000101'O, + state := OSMO_GSUP_SESSION_STATE_END + ); + + /* Finally, HLR terminates the session */ + GSUP.send(gsup_term); + /* Expect MT RELEASE COMPLETE without Facility IE */ + f_expect_mt_dtap_msg(ussd_term); + + /* Hold the call for some time */ + f_sleep(1.0); + + /* Release the call (does Clear Complete itself) */ + f_call_hangup(cpars, true); +} +testcase TC_lu_and_mt_ussd_during_mt_call() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + vc_conn := f_start_handler(refers(f_tc_lu_and_mt_ussd_during_mt_call), 49); + vc_conn.done; +} + /* TODO (SMS): * different user data lengths * SMPP transaction mode with unsuccessful delivery @@ -2470,7 +2675,9 @@ execute( TC_smpp_mt_sms() ); execute( TC_lu_and_mo_ussd_single_request() ); + execute( TC_lu_and_mt_ussd_notification() ); execute( TC_lu_and_mo_ussd_during_mt_call() ); + execute( TC_lu_and_mt_ussd_during_mt_call() ); /* Run this last: at the time of writing this test crashes the MSC */ execute( TC_lu_imsi_auth_tmsi_encr_3_1_log_msc_debug() ); diff --git a/msc/expected-results.xml b/msc/expected-results.xml index 9595f17..198b9bd 100644 --- a/msc/expected-results.xml +++ b/msc/expected-results.xml @@ -72,5 +72,7 @@ + + -- To view, visit https://gerrit.osmocom.org/9686 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I073893c6e11be27e9e36f98f11c1491d0c173985 Gerrit-Change-Number: 9686 Gerrit-PatchSet: 5 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 19:25:09 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 19:25:09 +0000 Subject: Change in osmo-ttcn3-hacks[master]: msc/USSD: introduce TC_lu_and_mo_ussd_mo_release In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9689 ) Change subject: msc/USSD: introduce TC_lu_and_mo_ussd_mo_release ...................................................................... msc/USSD: introduce TC_lu_and_mo_ussd_mo_release The idea of this test case is to check the reaction of OsmoMSC on MS-initiated release during an active transaction. In other words, when the network is waiting for some response from a MS, subscriber can press the 'red button' in order to terminate this conversation. It is expected that the MSC would terminate the transaction as on DTAP interface, as on GSUP interface. Change-Id: I7936ed5072ed2ae02f039dc90a1fece1e7f70a70 --- M msc/MSC_Tests.ttcn M msc/expected-results.xml 2 files changed, 99 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index b247f23..df1d1c2 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -2593,6 +2593,103 @@ vc_conn.done; } +/* LU followed by MO USSD request and MO Release during transaction */ +private function f_tc_lu_and_mo_ussd_mo_release(charstring id, BSC_ConnHdlrPars pars) +runs on BSC_ConnHdlr { + f_init_handler(pars); + + /* Perform location update */ + f_perform_lu(); + + /* Send CM Service Request for SS/USSD */ + f_establish_fully(EST_TYPE_SS_ACT); + + /* We need to inspect GSUP activity */ + f_create_gsup_expect(hex2str(g_pars.imsi)); + + var template OCTN facility_ms_req := f_USSD_FACILITY_IE_INVOKE( + invoke_id := 1, /* Initial request */ + op_code := SS_OP_CODE_PROCESS_USS_REQ, + ussd_string := "*6766*266#" + ); + + var template OCTN facility_net_req := f_USSD_FACILITY_IE_INVOKE( + invoke_id := 2, /* Counter request */ + op_code := SS_OP_CODE_USS_REQUEST, + ussd_string := "Password?!?" + ) + + /* Compose MO SS/REGISTER message with request */ + var template (value) PDU_ML3_MS_NW ussd_ms_req := ts_ML3_MO_SS_REGISTER( + tid := 1, /* We just need a single transaction */ + ti_flag := c_TIF_ORIG, /* Sent from the side that originates the TI */ + facility := valueof(facility_ms_req) + ); + + /* Compose expected MSC -> HLR message */ + var template GSUP_PDU gsup_ms_req := tr_GSUP_PROC_SS_REQ( + imsi := g_pars.imsi, + state := OSMO_GSUP_SESSION_STATE_BEGIN, + ss := valueof(facility_ms_req) + ); + + /* To be used for sending response with correct session ID */ + var GSUP_PDU gsup_ms_req_complete; + + /* Initiate a new transaction */ + BSSAP.send(ts_PDU_DTAP_MO(ussd_ms_req)); + /* Expect GSUP request with original Facility IE */ + gsup_ms_req_complete := f_expect_gsup_msg(gsup_ms_req); + + /* Compose the response from HLR using received session ID */ + var template (value) GSUP_PDU gsup_net_req := ts_GSUP_PROC_SS_REQ( + imsi := g_pars.imsi, + sid := gsup_ms_req_complete.ies[1].val.session_id, + state := OSMO_GSUP_SESSION_STATE_CONTINUE, + ss := valueof(facility_net_req) + ); + + /* Compose expected MT SS/FACILITY template with counter request */ + var template PDU_ML3_NW_MS ussd_net_req := tr_ML3_MT_SS_FACILITY( + tid := 1, /* Response should arrive within the same transaction */ + ti_flag := c_TIF_REPL, /* Sent to the side that originates the TI */ + facility := valueof(facility_net_req) + ); + + /* Send response over GSUP */ + GSUP.send(gsup_net_req); + /* Expect MT SS/FACILITY message with counter request */ + f_expect_mt_dtap_msg(ussd_net_req); + + /* Compose MO SS/RELEASE COMPLETE */ + var template (value) PDU_ML3_MS_NW ussd_abort := ts_ML3_MO_SS_RELEASE_COMPLETE( + tid := 1, /* Response should arrive within the same transaction */ + ti_flag := c_TIF_ORIG, /* Sent from the side that originates the TI */ + facility := omit + /* TODO: cause? */ + ); + + /* Compose expected HLR -> MSC abort message */ + var template GSUP_PDU gsup_abort := tr_GSUP_PROC_SS_REQ( + imsi := g_pars.imsi, + sid := gsup_ms_req_complete.ies[1].val.session_id, + state := OSMO_GSUP_SESSION_STATE_END + ); + + /* Abort transaction */ + BSSAP.send(ts_PDU_DTAP_MO(ussd_abort)); + /* Expect GSUP message indicating abort */ + f_expect_gsup_msg(gsup_abort); + + f_expect_clear(); +} +testcase TC_lu_and_mo_ussd_mo_release() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + vc_conn := f_start_handler(refers(f_tc_lu_and_mo_ussd_mo_release), 50); + vc_conn.done; +} + /* TODO (SMS): * different user data lengths * SMPP transaction mode with unsuccessful delivery @@ -2678,6 +2775,7 @@ execute( TC_lu_and_mt_ussd_notification() ); execute( TC_lu_and_mo_ussd_during_mt_call() ); execute( TC_lu_and_mt_ussd_during_mt_call() ); + execute( TC_lu_and_mo_ussd_mo_release() ); /* Run this last: at the time of writing this test crashes the MSC */ execute( TC_lu_imsi_auth_tmsi_encr_3_1_log_msc_debug() ); diff --git a/msc/expected-results.xml b/msc/expected-results.xml index 198b9bd..296d918 100644 --- a/msc/expected-results.xml +++ b/msc/expected-results.xml @@ -75,4 +75,5 @@ + -- To view, visit https://gerrit.osmocom.org/9689 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I7936ed5072ed2ae02f039dc90a1fece1e7f70a70 Gerrit-Change-Number: 9689 Gerrit-PatchSet: 3 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 19:25:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 19:25:44 +0000 Subject: Change in osmo-msc[master]: libmsc/gsm_09_11.c: forward SS/USSD messages to HLR over GSUP In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9658 ) Change subject: libmsc/gsm_09_11.c: forward SS/USSD messages to HLR over GSUP ...................................................................... libmsc/gsm_09_11.c: forward SS/USSD messages to HLR over GSUP In order to be able to support external SS/USSD gateway, we should not terminate the GSM 04.80 messages at OsmoMSC. Instead, we need to follow the GSM TS 09.11 specification, and forward all messages unhandled by OsmoMSC to OsmoHLR over GSUP protocol. This change implements forwarding of MO SS/USSD messages. The forwarding assumes transcoding between GSM 04.80 messages and GSUP messages. The payload of Facility IE is carried 'as is'. As a side-effect, this will disable the osmo-msc internal handler implementing the "*#100#" for obtaining the subscribers own phone number. In order to re-gain this functionality, you will need a modern osmo-hlr (Change-Id I1d09fab810a6bb9ab02904de72dbc9e8a414f9f9) and the following line in your osmo-hlr.cfg: hlr ussd route prefix *#100# internal own-msisdn TTCN-3 test case: I01de73aced6057328a121577a5a83bc2615fb2d4 Change-Id: Ide5f7e350b537db80cd8326fc59c8bf2e01cb68c --- M include/osmocom/msc/gsm_09_11.h M src/libmsc/gsm_04_08.c M src/libmsc/gsm_09_11.c M tests/msc_vlr/msc_vlr_test_ss.c M tests/msc_vlr/msc_vlr_test_ss.err 5 files changed, 225 insertions(+), 63 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/msc/gsm_09_11.h b/include/osmocom/msc/gsm_09_11.h index 4e7a5b6..5e689fb 100644 --- a/include/osmocom/msc/gsm_09_11.h +++ b/include/osmocom/msc/gsm_09_11.h @@ -1,5 +1,7 @@ #pragma once #include +#include int gsm0911_rcv_nc_ss(struct gsm_subscriber_connection *conn, struct msgb *msg); +int gsm0911_gsup_handler(struct vlr_subscr *vsub, struct osmo_gsup_message *gsup); diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index c10a701..19b0572 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -1702,7 +1702,13 @@ struct osmo_gsup_message *gsup_msg) { switch (gsup_msg->message_type) { - /* Nowhere to route for now */ + /* GSM 09.11 code implementing SS/USSD */ + case OSMO_GSUP_MSGT_PROC_SS_REQUEST: + case OSMO_GSUP_MSGT_PROC_SS_RESULT: + case OSMO_GSUP_MSGT_PROC_SS_ERROR: + DEBUGP(DMSC, "Routed to GSM 09.11 SS/USSD handler\n"); + return gsm0911_gsup_handler(vsub, gsup_msg); + default: LOGP(DMM, LOGL_ERROR, "No handler found for %s, dropping message...\n", osmo_gsup_message_type_name(gsup_msg->message_type)); diff --git a/src/libmsc/gsm_09_11.c b/src/libmsc/gsm_09_11.c index 799dfaa..219325e 100644 --- a/src/libmsc/gsm_09_11.c +++ b/src/libmsc/gsm_09_11.c @@ -1,6 +1,7 @@ /* (C) 2008-2009 by Harald Welte * (C) 2008, 2009 by Holger Hans Peter Freyther * (C) 2009 by Mike Haben + * (C) 2018 by Vadim Yanitskiy * * All Rights Reserved * @@ -26,9 +27,12 @@ */ #include -#include -#include #include +#include + +#include +#include +#include #include #include @@ -37,34 +41,21 @@ #include #include #include +#include +#include /* FIXME: choose a proper range */ static uint32_t new_callref = 0x20000001; -/* Declarations of USSD strings to be recognised */ -const char USSD_TEXT_OWN_NUMBER[] = "*#100#"; - -/* A network-specific handler function */ -static int send_own_number(struct gsm_subscriber_connection *conn, - uint8_t tid, uint8_t invoke_id) -{ - char *own_number = conn->vsub->msisdn; - char response_string[GSM_EXTENSION_LENGTH + 20]; - - DEBUGP(DMM, "%s: MSISDN = %s\n", vlr_subscr_name(conn->vsub), - own_number); - - /* Need trailing CR as EOT character */ - snprintf(response_string, sizeof(response_string), "Your extension is %s\r", own_number); - return gsm0480_send_ussd_response(conn, tid, invoke_id, response_string); -} - /* Entry point for call independent MO SS messages */ int gsm0911_rcv_nc_ss(struct gsm_subscriber_connection *conn, struct msgb *msg) { struct gsm48_hdr *gh = msgb_l3(msg); + struct osmo_gsup_message gsup_msg; struct gsm_trans *trans; - struct ss_request req; + struct msgb *gsup_msgb; + uint16_t facility_ie_len; + uint8_t *facility_ie; uint8_t pdisc, tid; uint8_t msg_type; int rc; @@ -116,47 +107,195 @@ cm_service_request_concludes(conn, msg); } - memset(&req, 0, sizeof(req)); - rc = gsm0480_decode_ss_request(gh, msgb_l3len(msg), &req); - if (!rc) { - LOGP(DMM, LOGL_ERROR, "SS/USSD message parsing error, " - "rejecting request...\n"); - gsm0480_send_ussd_reject(conn, tid, -1, - GSM_0480_PROBLEM_CODE_TAG_GENERAL, - GSM_0480_GEN_PROB_CODE_UNRECOGNISED); - /* The GSM 04.80 API uses inverted codes (0 means error) */ - return -EPROTO; + /* Attempt to extract Facility IE */ + rc = gsm0480_extract_ie_by_tag(gh, msgb_l3len(msg), + &facility_ie, &facility_ie_len, GSM0480_IE_FACILITY); + if (rc) { + LOGP(DMM, LOGL_ERROR, "GSM 04.80 message parsing error, " + "couldn't extract Facility IE\n"); + goto error; } - /* Interrogation or releaseComplete? */ - if (req.ussd_text[0] == '\0' || req.ussd_text[0] == 0xFF) { - if (req.ss_code > 0) { - /* Assume interrogateSS or modification of it and reject */ - return gsm0480_send_ussd_return_error(conn, tid, - req.invoke_id, GSM0480_ERR_CODE_ILLEGAL_SS_OPERATION); + /* Facility IE is optional for RELEASE COMPLETE */ + if (msg_type != GSM0480_MTYPE_RELEASE_COMPLETE) { + if (!facility_ie || facility_ie_len < 2) { + LOGP(DMM, LOGL_ERROR, "GSM 04.80 message parsing error, " + "missing mandatory Facility IE\n"); + rc = -EINVAL; + goto error; } - /* Still assuming a Release-Complete and returning */ + } + + /* Compose a mew GSUP message */ + memset(&gsup_msg, 0x00, sizeof(gsup_msg)); + gsup_msg.message_type = OSMO_GSUP_MSGT_PROC_SS_REQUEST; + gsup_msg.session_id = trans->callref; + + /** + * Perform A-interface to GSUP-interface mapping, + * according to GSM TS 09.11, table 4.2. + */ + switch (msg_type) { + case GSM0480_MTYPE_REGISTER: + gsup_msg.session_state = OSMO_GSUP_SESSION_STATE_BEGIN; + break; + case GSM0480_MTYPE_FACILITY: + gsup_msg.session_state = OSMO_GSUP_SESSION_STATE_CONTINUE; + break; + case GSM0480_MTYPE_RELEASE_COMPLETE: + gsup_msg.session_state = OSMO_GSUP_SESSION_STATE_END; + break; + } + + /* Fill in the (optional) message payload */ + if (facility_ie) { + gsup_msg.ss_info_len = facility_ie_len; + gsup_msg.ss_info = facility_ie; + } + + /* Fill in subscriber's IMSI */ + OSMO_STRLCPY_ARRAY(gsup_msg.imsi, conn->vsub->imsi); + + /* Allocate GSUP message buffer */ + gsup_msgb = gsup_client_msgb_alloc(); + if (!gsup_msgb) { + LOGP(DMM, LOGL_ERROR, "Couldn't allocate GSUP message\n"); + rc = -ENOMEM; + goto error; + } + + /* Encode GSUP message */ + rc = osmo_gsup_encode(gsup_msgb, &gsup_msg); + if (rc) { + LOGP(DMM, LOGL_ERROR, "Couldn't encode GSUP message\n"); + goto error; + } + + /* Finally send */ + rc = gsup_client_send(conn->network->vlr->gsup_client, gsup_msgb); + if (rc) { + LOGP(DMM, LOGL_ERROR, "Couldn't send GSUP message\n"); + goto error; + } + + /* Don't release connection, wait for response */ + msc_subscr_conn_communicating(conn); + + return 0; + +error: + /* Abort transaction on DTAP-interface */ + gsm0480_send_ussd_reject(conn, tid, -1, + GSM_0480_PROBLEM_CODE_TAG_GENERAL, + GSM_0480_GEN_PROB_CODE_UNRECOGNISED); + if (trans) + trans_free(trans); + + /* TODO: abort transaction on GSUP interface if any */ + return rc; +} + +int gsm0911_gsup_handler(struct vlr_subscr *vsub, + struct osmo_gsup_message *gsup_msg) +{ + struct vlr_instance *vlr; + struct gsm_network *net; + struct gsm_trans *trans; + struct gsm48_hdr *gh; + struct msgb *ss_msg; + bool trans_end; + + /* Associate logging messages with this subscriber */ + log_set_context(LOG_CTX_VLR_SUBSCR, vsub); + + /* Obtain pointer to vlr_instance */ + vlr = vsub->vlr; + OSMO_ASSERT(vlr); + + /* Obtain pointer to gsm_network */ + net = (struct gsm_network *) vlr->user_ctx; + OSMO_ASSERT(net); + + /* Handle errors */ + if (OSMO_GSUP_IS_MSGT_ERROR(gsup_msg->message_type)) { + /* FIXME: handle this error somehow! */ return 0; } - msc_subscr_conn_communicating(conn); - if (!strcmp(USSD_TEXT_OWN_NUMBER, (const char *)req.ussd_text)) { - DEBUGP(DMM, "USSD: Own number requested\n"); - rc = send_own_number(conn, tid, req.invoke_id); - } else { - DEBUGP(DMM, "Unhandled USSD %s\n", req.ussd_text); - rc = gsm0480_send_ussd_return_error(conn, - tid, req.invoke_id, - GSM0480_ERR_CODE_UNEXPECTED_DATA_VALUE); + /* Attempt to find DTAP-transaction */ + trans = trans_find_by_callref(net, gsup_msg->session_id); + if (!trans) { + /* FIXME: network-originated sessions are not supported yet */ + LOGP(DMM, LOGL_ERROR, "Network-originated sessions " + "are not supported, dropping request...\n"); + return -ENOTSUP; } - /** - * TODO: as we only handle *#100# for now, and always - * respond with RELEASE COMPLETE, let's manually free - * the transaction here, until the external interface - * is implemented. - */ - trans_free(trans); + /* Allocate and prepare a new MT message */ + ss_msg = gsm48_msgb_alloc_name("GSM 04.08 SS/USSD"); + gh = (struct gsm48_hdr *) msgb_push(ss_msg, sizeof(*gh)); + gh->proto_discr = GSM48_PDISC_NC_SS; + gh->proto_discr |= trans->transaction_id << 4; - return rc; + /** + * Perform GSUP-interface to A-interface mapping, + * according to GSM TS 09.11, table 4.1. + * + * TODO: see (note 3), both CONTINUE and END may + * be also mapped to REGISTER if a new transaction + * has to be established. + */ + switch (gsup_msg->session_state) { + case OSMO_GSUP_SESSION_STATE_BEGIN: + gh->msg_type = GSM0480_MTYPE_REGISTER; + break; + case OSMO_GSUP_SESSION_STATE_CONTINUE: + gh->msg_type = GSM0480_MTYPE_FACILITY; + break; + case OSMO_GSUP_SESSION_STATE_END: + gh->msg_type = GSM0480_MTYPE_RELEASE_COMPLETE; + break; + + /* Missing or incorrect session state */ + case OSMO_GSUP_SESSION_STATE_NONE: + default: + LOGP(DMM, LOGL_ERROR, "Unexpected session state %d\n", + gsup_msg->session_state); + /* FIXME: send ERROR back to the HLR */ + msgb_free(ss_msg); + return -EINVAL; + } + + /* Facility IE is optional only for RELEASE COMPLETE */ + if (gh->msg_type != GSM0480_MTYPE_RELEASE_COMPLETE) { + if (!gsup_msg->ss_info || gsup_msg->ss_info_len < 2) { + LOGP(DMM, LOGL_ERROR, "Missing mandatory Facility IE " + "for mapped 0x%02x message\n", gh->msg_type); + /* FIXME: send ERROR back to the HLR */ + msgb_free(ss_msg); + return -EINVAL; + } + } + + /* Append Facility IE if preset */ + if (gsup_msg->ss_info && gsup_msg->ss_info_len > 2) { + /* Facility IE carries LV, others carry TLV */ + if (gh->msg_type == GSM0480_MTYPE_FACILITY) + msgb_lv_put(ss_msg, gsup_msg->ss_info_len, gsup_msg->ss_info); + else + msgb_tlv_put(ss_msg, GSM0480_IE_FACILITY, + gsup_msg->ss_info_len, gsup_msg->ss_info); + } + + /* Should we release the transaction? */ + trans_end = (gh->msg_type == GSM0480_MTYPE_RELEASE_COMPLETE); + + /* Sent to the MS, give ownership of ss_msg */ + msc_tx_dtap(trans->conn, ss_msg); + + /* Release transaction if required */ + if (trans_end) + trans_free(trans); + + return 0; } diff --git a/tests/msc_vlr/msc_vlr_test_ss.c b/tests/msc_vlr/msc_vlr_test_ss.c index f3a1f68..f0652b0 100644 --- a/tests/msc_vlr/msc_vlr_test_ss.c +++ b/tests/msc_vlr/msc_vlr_test_ss.c @@ -94,11 +94,21 @@ EXPECT_ACCEPTED(true); /* MT: GSM 04.80 RELEASE COMPLETE with Facility IE */ + gsup_expect_tx("20" /* OSMO_GSUP_MSGT_PROC_SS_REQUEST */ + "0108" "09710000004026f0" /* IMSI TLV */ + "3004" "20000001" /* Session ID TLV */ + "3101" "01" /* Session state: BEGIN */ + "3515" FACILITY_IE_REQ); dtap_expect_tx("8b2a" "1c27" FACILITY_IE_RSP); expect_release_clear(via_ran); /* MO: GSM 04.80 REGISTER with Facility IE and SS version IE */ ms_sends_msg("0b7b" "1c15" FACILITY_IE_REQ "7f0100"); + gsup_rx("20" /* OSMO_GSUP_MSGT_PROC_SS_REQUEST */ + "0108" "09710000004026f0" /* IMSI TLV */ + "3004" "20000001" /* Session ID TLV */ + "3101" "03" /* Session state: END */ + "3527" FACILITY_IE_RSP, NULL); VERBOSE_ASSERT(dtap_tx_confirmed, == true, "%d"); ASSERT_RELEASE_CLEAR(via_ran); diff --git a/tests/msc_vlr/msc_vlr_test_ss.err b/tests/msc_vlr/msc_vlr_test_ss.err index c7f7711..fce5bb6 100644 --- a/tests/msc_vlr/msc_vlr_test_ss.err +++ b/tests/msc_vlr/msc_vlr_test_ss.err @@ -162,22 +162,27 @@ DREF MSISDN:46071: MSC conn use + trans_nc_ss == 3 (0x4a: dtap,cm_service,trans_nc_ss) DMM MSISDN:46071: rx msg GSM0480_MTYPE_REGISTER: received_cm_service_request changes to false DREF MSISDN:46071: MSC conn use - cm_service == 2 (0x42: dtap,trans_nc_ss) +GSUP --> HLR: OSMO_GSUP_MSGT_PROC_SS_REQUEST: 20010809710000004026f03004200000013101013515a11302010102013b300b04010f0406aa510c061b01 DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING -DMM USSD: Own number requested -DMM MSISDN:46071: MSISDN = 46071 +DREF MSISDN:46071: MSC conn use - dtap == 1 (0x40: trans_nc_ss) +<-- GSUP rx OSMO_GSUP_MSGT_PROC_SS_REQUEST: 20010809710000004026f03004200000013101033527a225020101302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +DVLR GSUP rx 61: 20010809710000004026f03004200000013101033527a225020101302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +DREF VLR subscr MSISDN:46071 usage increases to: 4 +DMSC Routed to GSM 09.11 SS/USSD handler DMSC msc_tx 43 bytes to MSISDN:46071 via RAN_GERAN_A - DTAP --RAN_GERAN_A--> MS: GSM0480_MTYPE_RELEASE_COMPLETE: 8b2a1c27a225020101302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d - DTAP matches expected message -DREF VLR subscr MSISDN:46071 usage decreases to: 2 -DREF MSISDN:46071: MSC conn use - trans_nc_ss == 1 (0x2: dtap) -DREF MSISDN:46071: MSC conn use - dtap == 0 (0x0: ) +DREF VLR subscr MSISDN:46071 usage decreases to: 3 +DREF MSISDN:46071: MSC conn use - trans_nc_ss == 0 (0x0: ) DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_UNUSED DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASING DREF MSISDN:46071: MSC conn use + release == 1 (0x100: release) -DREF VLR subscr MSISDN:46071 usage increases to: 3 -DREF VLR subscr MSISDN:46071 usage decreases to: 2 +DREF VLR subscr MSISDN:46071 usage increases to: 4 +DREF VLR subscr MSISDN:46071 usage decreases to: 3 - BSSAP Clear --RAN_GERAN_A--> MS +DREF VLR subscr MSISDN:46071 usage decreases to: 2 +<-- GSUP rx OSMO_GSUP_MSGT_PROC_SS_REQUEST: vlr_gsupc_read_cb() returns 0 dtap_tx_confirmed == 1 bssap_clear_sent == 1 - all requests serviced, conn has been released -- To view, visit https://gerrit.osmocom.org/9658 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ide5f7e350b537db80cd8326fc59c8bf2e01cb68c Gerrit-Change-Number: 9658 Gerrit-PatchSet: 10 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 19:28:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 19:28:14 +0000 Subject: Change in osmo-msc[master]: libmsc/gsm_09_11.c: implement network-initiated sessions In-Reply-To: References: Message-ID: Harald Welte has uploaded a new patch set (#8) to the change originally created by Vadim Yanitskiy. ( https://gerrit.osmocom.org/9661 ) Change subject: libmsc/gsm_09_11.c: implement network-initiated sessions ...................................................................... libmsc/gsm_09_11.c: implement network-initiated sessions This change introduces a possibility to establish network-initiated SS/USSD transactions with a subscriber in either IDLE, or DEDICATED state. In the first case, a new transaction is established using Paging procedure. If a subscriber already has an active connection, a separate new transaction is established. TTCN-3 test case: I073893c6e11be27e9e36f98f11c1491d0c173985 Change-Id: Ief14f8914ef013bd6efd7be842f81fbf053f02e2 --- M include/osmocom/msc/transaction.h M src/libmsc/gsm_09_11.c M src/libmsc/transaction.c M tests/msc_vlr/msc_vlr_test_ss.c M tests/msc_vlr/msc_vlr_test_ss.err 5 files changed, 500 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/61/9661/8 -- To view, visit https://gerrit.osmocom.org/9661 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ief14f8914ef013bd6efd7be842f81fbf053f02e2 Gerrit-Change-Number: 9661 Gerrit-PatchSet: 8 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 19:28:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 19:28:14 +0000 Subject: Change in osmo-msc[master]: libmsc/gsm_09_11.c: properly handle MS-initiated release In-Reply-To: References: Message-ID: Harald Welte has uploaded a new patch set (#6) to the change originally created by Vadim Yanitskiy. ( https://gerrit.osmocom.org/9703 ) Change subject: libmsc/gsm_09_11.c: properly handle MS-initiated release ...................................................................... libmsc/gsm_09_11.c: properly handle MS-initiated release According to GSM TS 02.90, section 4.3, release of the connection used for SS/USSD is normally the responsibility of the network. But the user may also initiate connection release, e.g. by pressing the 'red button'. TTCN-3 test case: I7936ed5072ed2ae02f039dc90a1fece1e7f70a70 Change-Id: I76fc277bf9db614a97824b1541cd5bb75aa3e29d --- M src/libmsc/gsm_09_11.c 1 file changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/03/9703/6 -- To view, visit https://gerrit.osmocom.org/9703 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I76fc277bf9db614a97824b1541cd5bb75aa3e29d Gerrit-Change-Number: 9703 Gerrit-PatchSet: 6 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 19:28:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 19:28:14 +0000 Subject: Change in osmo-msc[master]: libmsc/gsm_09_11.c: introduce rate counters for NC_SS sessions In-Reply-To: References: Message-ID: Harald Welte has uploaded a new patch set (#6) to the change originally created by Vadim Yanitskiy. ( https://gerrit.osmocom.org/9711 ) Change subject: libmsc/gsm_09_11.c: introduce rate counters for NC_SS sessions ...................................................................... libmsc/gsm_09_11.c: introduce rate counters for NC_SS sessions This change introduces some new rate counters for call-independent SS/USSD connections. As OsmoMSC doesn't handle the messages itself, and only responsible for dispatching messages between both A and GSUP interfaces, the following is taken into account: - MS-initiated and network-initiated requests to establish a NC SS/USSD session (transaction) - "nc_ss:m{o|t}_requests"; - successfully established MS-initiated and network-initiated SS/USSD sessions (transactions) - "nc_ss:m{o|t}_established". Change-Id: I23c9475abc9951d82f3342fdc5aaa367836f7741 --- M include/osmocom/msc/gsm_data.h M src/libmsc/gsm_09_11.c M src/libmsc/msc_vty.c 3 files changed, 38 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/11/9711/6 -- To view, visit https://gerrit.osmocom.org/9711 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I23c9475abc9951d82f3342fdc5aaa367836f7741 Gerrit-Change-Number: 9711 Gerrit-PatchSet: 6 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 19:28:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 19:28:14 +0000 Subject: Change in osmo-msc[master]: libmsc/gsm_09_11.c: introduce counter for active sessions In-Reply-To: References: Message-ID: Harald Welte has uploaded a new patch set (#4) to the change originally created by Vadim Yanitskiy. ( https://gerrit.osmocom.org/9745 ) Change subject: libmsc/gsm_09_11.c: introduce counter for active sessions ...................................................................... libmsc/gsm_09_11.c: introduce counter for active sessions Change-Id: Ia17e7c747fffb5267d3ca5bc4193c1be4a57ef3a --- M include/osmocom/msc/gsm_data.h M src/libmsc/gsm_09_11.c M src/libmsc/osmo_msc.c 3 files changed, 11 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/45/9745/4 -- To view, visit https://gerrit.osmocom.org/9745 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia17e7c747fffb5267d3ca5bc4193c1be4a57ef3a Gerrit-Change-Number: 9745 Gerrit-PatchSet: 4 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 19:29:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 19:29:18 +0000 Subject: Change in osmo-msc[master]: libmsc/gsm_09_11.c: implement network-initiated sessions In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9661 ) Change subject: libmsc/gsm_09_11.c: implement network-initiated sessions ...................................................................... libmsc/gsm_09_11.c: implement network-initiated sessions This change introduces a possibility to establish network-initiated SS/USSD transactions with a subscriber in either IDLE, or DEDICATED state. In the first case, a new transaction is established using Paging procedure. If a subscriber already has an active connection, a separate new transaction is established. TTCN-3 test case: I073893c6e11be27e9e36f98f11c1491d0c173985 Change-Id: Ief14f8914ef013bd6efd7be842f81fbf053f02e2 --- M include/osmocom/msc/transaction.h M src/libmsc/gsm_09_11.c M src/libmsc/transaction.c M tests/msc_vlr/msc_vlr_test_ss.c M tests/msc_vlr/msc_vlr_test_ss.err 5 files changed, 500 insertions(+), 10 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmocom/msc/transaction.h b/include/osmocom/msc/transaction.h index 63b1cc5..4ffb468 100644 --- a/include/osmocom/msc/transaction.h +++ b/include/osmocom/msc/transaction.h @@ -77,6 +77,13 @@ struct gsm_sms *sms; } sms; + struct { + /** + * Stores a GSM 04.80 message to be sent to + * a subscriber after successful Paging Response + */ + struct msgb *msg; + } ss; }; struct { diff --git a/src/libmsc/gsm_09_11.c b/src/libmsc/gsm_09_11.c index 219325e..9423ec7 100644 --- a/src/libmsc/gsm_09_11.c +++ b/src/libmsc/gsm_09_11.c @@ -30,6 +30,7 @@ #include #include +#include #include #include #include @@ -195,6 +196,163 @@ return rc; } +/* Call-back from paging the B-end of the connection */ +static int handle_paging_event(unsigned int hooknum, unsigned int event, + struct msgb *msg, void *_conn, void *_transt) +{ + struct gsm_subscriber_connection *conn = _conn; + enum gsm_paging_event paging_event = event; + struct gsm_trans *transt = _transt; + struct gsm48_hdr *gh; + struct msgb *ss_msg; + + OSMO_ASSERT(!transt->conn); + OSMO_ASSERT(transt->ss.msg); + + switch (paging_event) { + case GSM_PAGING_SUCCEEDED: + DEBUGP(DMM, "Paging subscr %s succeeded!\n", + vlr_subscr_msisdn_or_name(transt->vsub)); + + /* Assign connection */ + transt->conn = msc_subscr_conn_get(conn, MSC_CONN_USE_TRANS_NC_SS); + transt->paging_request = NULL; + + /* Send stored message */ + ss_msg = transt->ss.msg; + OSMO_ASSERT(ss_msg); + + gh = (struct gsm48_hdr *) msgb_push(ss_msg, sizeof(*gh)); + gh->proto_discr = GSM48_PDISC_NC_SS; + gh->proto_discr |= transt->transaction_id << 4; + gh->msg_type = GSM0480_MTYPE_REGISTER; + + /* Sent to the MS, give ownership of ss_msg */ + msc_tx_dtap(transt->conn, ss_msg); + transt->ss.msg = NULL; + break; + case GSM_PAGING_EXPIRED: + case GSM_PAGING_BUSY: + DEBUGP(DMM, "Paging subscr %s %s!\n", + vlr_subscr_msisdn_or_name(transt->vsub), + paging_event == GSM_PAGING_EXPIRED ? "expired" : "busy"); + + /* TODO: inform HLR about this failure */ + + msgb_free(transt->ss.msg); + transt->ss.msg = NULL; + + transt->callref = 0; + transt->paging_request = NULL; + trans_free(transt); + break; + } + + return 0; +} + +static struct gsm_trans *establish_nc_ss_trans(struct gsm_network *net, + struct vlr_subscr *vsub, struct osmo_gsup_message *gsup_msg) +{ + struct gsm_subscriber_connection *conn; + struct gsm_trans *trans, *transt; + int tid; + + if (gsup_msg->session_state != OSMO_GSUP_SESSION_STATE_BEGIN) { + LOGP(DMM, LOGL_ERROR, "Received non-BEGIN message " + "for non-existing transaction\n"); + return NULL; + } + + if (!gsup_msg->ss_info || gsup_msg->ss_info_len < 2) { + LOGP(DMM, LOGL_ERROR, "Missing mandatory Facility IE\n"); + return NULL; + } + + /* If subscriber is not "attached" */ + if (!vsub->lac) { + LOGP(DMM, LOGL_ERROR, "Network-originated session " + "rejected - subscriber is not attached\n"); + return NULL; + } + + DEBUGP(DMM, "Establishing network-originated session\n"); + + /* Allocate a new transaction */ + trans = trans_alloc(net, vsub, GSM48_PDISC_NC_SS, + 0xff, gsup_msg->session_id); + if (!trans) { + DEBUGP(DMM, " -> No memory for trans\n"); + return NULL; + } + + /* Assign transaction ID */ + tid = trans_assign_trans_id(trans->net, + trans->vsub, GSM48_PDISC_NC_SS, 0); + if (tid < 0) { + LOGP(DMM, LOGL_ERROR, "No free transaction ID\n"); + /* TODO: inform HLR about this */ + /* TODO: release connection with subscriber */ + trans->callref = 0; + trans_free(trans); + return NULL; + } + trans->transaction_id = tid; + + /* Attempt to find connection */ + conn = connection_for_subscr(vsub); + if (conn) { + /* Assign connection */ + trans->conn = msc_subscr_conn_get(conn, MSC_CONN_USE_TRANS_NC_SS); + trans->dlci = 0x00; /* SAPI=0, not SACCH */ + return trans; + } + + DEBUGP(DMM, "Triggering Paging Request\n"); + + /* Find transaction with this subscriber already paging */ + llist_for_each_entry(transt, &net->trans_list, entry) { + /* Transaction of our conn? */ + if (transt == trans || transt->vsub != vsub) + continue; + + LOGP(DMM, LOGL_ERROR, "Paging already started, " + "rejecting message...\n"); + trans_free(trans); + return NULL; + } + + /* Trigger Paging Request */ + trans->paging_request = subscr_request_conn(vsub, + &handle_paging_event, trans, "GSM 09.11 SS/USSD"); + if (!trans->paging_request) { + LOGP(DMM, LOGL_ERROR, "Failed to allocate paging token\n"); + trans_free(trans); + return NULL; + } + + /* Store the Facility IE to be sent */ + OSMO_ASSERT(trans->ss.msg == NULL); + trans->ss.msg = gsm48_msgb_alloc_name("GSM 04.08 SS/USSD"); + msgb_tlv_put(trans->ss.msg, GSM0480_IE_FACILITY, + gsup_msg->ss_info_len, gsup_msg->ss_info); + + return NULL; +} + +/* NC SS specific transaction release. + * Gets called by trans_free, DO NOT CALL YOURSELF! */ +void _gsm911_nc_ss_trans_free(struct gsm_trans *trans) +{ + /** + * TODO: if transaction wasn't properly terminated, + * we need to do it here by releasing the subscriber + * connection and sending notification via GSUP... + */ + if (trans->ss.msg != NULL) + msgb_free(trans->ss.msg); +} + int gsm0911_gsup_handler(struct vlr_subscr *vsub, struct osmo_gsup_message *gsup_msg) { @@ -225,10 +383,16 @@ /* Attempt to find DTAP-transaction */ trans = trans_find_by_callref(net, gsup_msg->session_id); if (!trans) { - /* FIXME: network-originated sessions are not supported yet */ - LOGP(DMM, LOGL_ERROR, "Network-originated sessions " - "are not supported, dropping request...\n"); - return -ENOTSUP; + /* Attempt to establish a new transaction */ + trans = establish_nc_ss_trans(net, vsub, gsup_msg); + if (!trans) { + /* FIXME: send ERROR back to the HLR */ + return -EINVAL; + } + + /* Wait for Paging Response */ + if (trans->paging_request) + return 0; } /* Allocate and prepare a new MT message */ diff --git a/src/libmsc/transaction.c b/src/libmsc/transaction.c index f2c80d7..4c351d3 100644 --- a/src/libmsc/transaction.c +++ b/src/libmsc/transaction.c @@ -31,6 +31,7 @@ void *tall_trans_ctx; void _gsm48_cc_trans_free(struct gsm_trans *trans); +void _gsm911_nc_ss_trans_free(struct gsm_trans *trans); /*! Find a transaction in connection for given protocol + transaction ID * \param[in] conn Connection in whihc we want to find transaction @@ -129,6 +130,7 @@ conn_usage_token = MSC_CONN_USE_TRANS_SMS; break; case GSM48_PDISC_NC_SS: + _gsm911_nc_ss_trans_free(trans); conn_usage_token = MSC_CONN_USE_TRANS_NC_SS; break; } diff --git a/tests/msc_vlr/msc_vlr_test_ss.c b/tests/msc_vlr/msc_vlr_test_ss.c index f0652b0..88e8036 100644 --- a/tests/msc_vlr/msc_vlr_test_ss.c +++ b/tests/msc_vlr/msc_vlr_test_ss.c @@ -75,7 +75,7 @@ EXPECT_CONN_COUNT(0); } -static void _test_ss_ussd(enum ran_type via_ran) +static void _test_ss_ussd_mo(enum ran_type via_ran) { /* TODO: UTRAN requires auth and ciph */ rx_from_ran = via_ran; @@ -117,16 +117,99 @@ EXPECT_CONN_COUNT(0); } -static void test_ss_ussd_geran() +static void _test_ss_ussd_no(enum ran_type via_ran) +{ + struct vlr_subscr *vsub; + + /* TODO: UTRAN requires auth and ciph */ + rx_from_ran = via_ran; + + /* Perform Location Update */ + perform_lu(); + + BTW("after a while, HLR initiates SS/USSD session"); + + paging_expect_imsi(IMSI); + paging_sent = false; + vsub = vlr_subscr_find_by_imsi(net->vlr, IMSI); + OSMO_ASSERT(vsub); + VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 0, "%d"); + + /* MT: GSM 04.80 REGISTER with request */ + gsup_rx("20" /* OSMO_GSUP_MSGT_PROC_SS_REQUEST */ + "0108" "09710000004026f0" /* IMSI TLV */ + "3004" "20000101" /* Session ID TLV */ + "3101" "01" /* Session state: BEGIN */ + "3515" FACILITY_IE_REQ, NULL); + + VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 1, "%d"); + vlr_subscr_put(vsub); + vsub = NULL; + VERBOSE_ASSERT(paging_sent, == true, "%d"); + VERBOSE_ASSERT(paging_stopped, == false, "%d"); + + btw("the subscriber and its pending request should remain"); + vsub = vlr_subscr_find_by_imsi(net->vlr, IMSI); + OSMO_ASSERT(vsub); + VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 1, "%d"); + vlr_subscr_put(vsub); + + btw("MS replies with Paging Response, we deliver the NC/USSD"); + + dtap_expect_tx("0b3b" "1c15" FACILITY_IE_REQ); + ms_sends_msg("06270703305882089910070000006402"); + VERBOSE_ASSERT(dtap_tx_confirmed, == true, "%d"); + VERBOSE_ASSERT(paging_stopped, == true, "%d"); + + btw("MS responds to SS/USSD request"); + + /* MO: GSM 04.80 FACILITY with response */ + gsup_expect_tx("20" /* OSMO_GSUP_MSGT_PROC_SS_REQUEST */ + "0108" "09710000004026f0" /* IMSI TLV */ + "3004" "20000101" /* Session ID TLV */ + "3101" "02" /* Session state: CONTINUE */ + "3527" FACILITY_IE_RSP); + ms_sends_msg("8b3a" "27" FACILITY_IE_RSP); + VERBOSE_ASSERT(dtap_tx_confirmed, == true, "%d"); + VERBOSE_ASSERT(paging_stopped, == true, "%d"); + + btw("HLR terminates the session"); + + /* MT: GSM 04.80 RELEASE COMPLETE without Facility IE */ + dtap_expect_tx("0b2a"); + expect_release_clear(via_ran); + gsup_rx("20" /* OSMO_GSUP_MSGT_PROC_SS_REQUEST */ + "0108" "09710000004026f0" /* IMSI TLV */ + "3004" "20000101" /* Session ID TLV */ + "3101" "03", /* Session state: END */ + NULL); + VERBOSE_ASSERT(dtap_tx_confirmed, == true, "%d"); + ASSERT_RELEASE_CLEAR(via_ran); + + btw("all requests serviced, conn has been released"); + bss_sends_clear_complete(); + EXPECT_CONN_COUNT(0); +} + +static void test_ss_ussd_mo_geran() { comment_start(); - _test_ss_ussd(RAN_GERAN_A); + _test_ss_ussd_mo(RAN_GERAN_A); + clear_vlr(); + comment_end(); +} + +static void test_ss_ussd_no_geran() +{ + comment_start(); + _test_ss_ussd_no(RAN_GERAN_A); clear_vlr(); comment_end(); } msc_vlr_test_func_t msc_vlr_tests[] = { /* TODO: UTRAN requires auth and enc */ - test_ss_ussd_geran, + test_ss_ussd_mo_geran, /* MS-originated */ + test_ss_ussd_no_geran, /* Network-originated */ NULL }; diff --git a/tests/msc_vlr/msc_vlr_test_ss.err b/tests/msc_vlr/msc_vlr_test_ss.err index fce5bb6..338b5aa 100644 --- a/tests/msc_vlr/msc_vlr_test_ss.err +++ b/tests/msc_vlr/msc_vlr_test_ss.err @@ -1,7 +1,7 @@ full talloc report on 'msgb' (total 0 bytes in 1 blocks) talloc_total_blocks(tall_bsc_ctx) == 12 -===== test_ss_ussd_geran +===== test_ss_ussd_mo_geran - Location Update request causes a GSUP LU request to HLR MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST new conn @@ -201,7 +201,241 @@ DMM Subscr_Conn(CM_SERVICE_REQ:901700000004620){SUBSCR_CONN_S_RELEASED}: Deallocated llist_count(&net->subscr_conns) == 0 DREF freeing VLR subscr MSISDN:46071 -===== test_ss_ussd_geran: SUCCESS +===== test_ss_ussd_mo_geran: SUCCESS + +full talloc report on 'msgb' (total 0 bytes in 1 blocks) +talloc_total_blocks(tall_bsc_ctx) == 12 + +===== test_ss_ussd_no_geran +- Location Update request causes a GSUP LU request to HLR + MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_LOC_UPD_REQUEST + new conn +DMM Subscr_Conn{SUBSCR_CONN_S_NEW}: Allocated +DREF unknown: MSC conn use + compl_l3 == 1 (0x1: compl_l3) +DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) +DMM Subscr_Conn(LU:901700000004620){SUBSCR_CONN_S_NEW}: Updated ID +DMM LOCATION UPDATING REQUEST: MI(IMSI)=901700000004620 type=IMSI ATTACH +DMM LU/new-LAC: 1/23 +DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_IDLE}: Allocated +DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_IDLE}: is child of Subscr_Conn(LU:901700000004620) +DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_IDLE}: rev=GSM net=GERAN (no Auth) +DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_IDLE}: Received Event VLR_ULA_E_UPDATE_LA +DREF VLR subscr unknown usage increases to: 1 +DVLR set IMSI on subscriber; IMSI=901700000004620 id=901700000004620 +DVLR New subscr, IMSI: 901700000004620 +DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DREF VLR subscr IMSI:901700000004620 usage decreases to: 1 +DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node1() +DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_auth() +DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_post_ciph() +DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_IDLE}: vlr_loc_upd_node_4() +DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_IDLE}: state_chg to VLR_ULA_S_WAIT_HLR_UPD +DVLR upd_hlr_vlr_fsm(LU:901700000004620){UPD_HLR_VLR_S_INIT}: Allocated +DVLR upd_hlr_vlr_fsm(LU:901700000004620){UPD_HLR_VLR_S_INIT}: is child of vlr_lu_fsm(LU:901700000004620) +DVLR upd_hlr_vlr_fsm(LU:901700000004620){UPD_HLR_VLR_S_INIT}: Received Event UPD_HLR_VLR_E_START +DVLR GSUP tx: 04010809710000004026f0 +GSUP --> HLR: OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST: 04010809710000004026f0 +DVLR upd_hlr_vlr_fsm(LU:901700000004620){UPD_HLR_VLR_S_INIT}: state_chg to UPD_HLR_VLR_S_WAIT_FOR_DATA +DMM Subscr_Conn(LU:901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_COMPLETE_LAYER_3 +DMM Subscr_Conn(LU:901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_AUTH_CIPH +DREF IMSI:901700000004620: MSC conn use - compl_l3 == 0 (0x0: ) +DMM Subscr_Conn(LU:901700000004620){SUBSCR_CONN_S_AUTH_CIPH}: Received Event SUBSCR_CONN_E_UNUSED +DMM Subscr_Conn(LU:901700000004620){SUBSCR_CONN_S_AUTH_CIPH}: Awaiting results for Auth+Ciph, overruling event SUBSCR_CONN_E_UNUSED + lu_result_sent == 0 +- HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: 10010809710000004026f00804036470f1 +DVLR GSUP rx 17: 10010809710000004026f00804036470f1 +DREF VLR subscr IMSI:901700000004620 usage increases to: 2 +DVLR IMSI:901700000004620 has MSISDN:46071 +DVLR SUBSCR(MSISDN:46071) VLR: update for IMSI=901700000004620 (MSISDN=46071, used=2) +DVLR GSUP tx: 12010809710000004026f0 +GSUP --> HLR: OSMO_GSUP_MSGT_INSERT_DATA_RESULT: 12010809710000004026f0 +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +<-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: vlr_gsupc_read_cb() returns 0 + lu_result_sent == 0 +- HLR also sends GSUP _UPDATE_LOCATION_RESULT +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 +DVLR GSUP rx 11: 06010809710000004026f0 +DREF VLR subscr MSISDN:46071 usage increases to: 2 +DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_HLR_LU_RES +DVLR upd_hlr_vlr_fsm(LU:901700000004620){UPD_HLR_VLR_S_WAIT_FOR_DATA}: Received Event UPD_HLR_VLR_E_UPD_LOC_ACK +DVLR upd_hlr_vlr_fsm(LU:901700000004620){UPD_HLR_VLR_S_WAIT_FOR_DATA}: state_chg to UPD_HLR_VLR_S_DONE +DVLR upd_hlr_vlr_fsm(LU:901700000004620){UPD_HLR_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR upd_hlr_vlr_fsm(LU:901700000004620){UPD_HLR_VLR_S_DONE}: Removing from parent vlr_lu_fsm(LU:901700000004620) +DVLR upd_hlr_vlr_fsm(LU:901700000004620){UPD_HLR_VLR_S_DONE}: Freeing instance +DVLR upd_hlr_vlr_fsm(LU:901700000004620){UPD_HLR_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Received Event VLR_ULA_E_UPD_HLR_COMPL +DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: state_chg to VLR_ULA_S_WAIT_LU_COMPL +DVLR lu_compl_vlr_fsm(LU:901700000004620){LU_COMPL_VLR_S_INIT}: Allocated +DVLR lu_compl_vlr_fsm(LU:901700000004620){LU_COMPL_VLR_S_INIT}: is child of vlr_lu_fsm(LU:901700000004620) +DVLR lu_compl_vlr_fsm(LU:901700000004620){LU_COMPL_VLR_S_INIT}: Received Event LU_COMPL_VLR_E_START +DVLR lu_compl_vlr_fsm(LU:901700000004620){LU_COMPL_VLR_S_INIT}: state_chg to LU_COMPL_VLR_S_WAIT_SUB_PRES +DVLR sub_pres_vlr_fsm(LU:901700000004620){SUB_PRES_VLR_S_INIT}: Allocated +DVLR sub_pres_vlr_fsm(LU:901700000004620){SUB_PRES_VLR_S_INIT}: is child of lu_compl_vlr_fsm(LU:901700000004620) +DVLR sub_pres_vlr_fsm(LU:901700000004620){SUB_PRES_VLR_S_INIT}: Received Event SUB_PRES_VLR_E_START +DVLR sub_pres_vlr_fsm(LU:901700000004620){SUB_PRES_VLR_S_INIT}: state_chg to SUB_PRES_VLR_S_DONE +DVLR sub_pres_vlr_fsm(LU:901700000004620){SUB_PRES_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR sub_pres_vlr_fsm(LU:901700000004620){SUB_PRES_VLR_S_DONE}: Removing from parent lu_compl_vlr_fsm(LU:901700000004620) +DVLR sub_pres_vlr_fsm(LU:901700000004620){SUB_PRES_VLR_S_DONE}: Freeing instance +DVLR sub_pres_vlr_fsm(LU:901700000004620){SUB_PRES_VLR_S_DONE}: Deallocated +DVLR lu_compl_vlr_fsm(LU:901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: Received Event LU_COMPL_VLR_E_SUB_PRES_COMPL +- sending LU Accept for MSISDN:46071 +DREF VLR subscr MSISDN:46071 usage increases to: 3 +DVLR lu_compl_vlr_fsm(LU:901700000004620){LU_COMPL_VLR_S_WAIT_SUB_PRES}: state_chg to LU_COMPL_VLR_S_DONE +DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event VLR_ULA_E_LU_COMPL_SUCCESS +DVLR lu_compl_vlr_fsm(LU:901700000004620){LU_COMPL_VLR_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR lu_compl_vlr_fsm(LU:901700000004620){LU_COMPL_VLR_S_DONE}: Removing from parent vlr_lu_fsm(LU:901700000004620) +DVLR lu_compl_vlr_fsm(LU:901700000004620){LU_COMPL_VLR_S_DONE}: Freeing instance +DVLR lu_compl_vlr_fsm(LU:901700000004620){LU_COMPL_VLR_S_DONE}: Deallocated +DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_WAIT_LU_COMPL}: state_chg to VLR_ULA_S_DONE +DMM Subscr_Conn(LU:901700000004620){SUBSCR_CONN_S_AUTH_CIPH}: Received Event SUBSCR_CONN_E_ACCEPTED +DMM Subscr_Conn(LU:901700000004620){SUBSCR_CONN_S_AUTH_CIPH}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(LU:901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_UNUSED +DMM Subscr_Conn(LU:901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_RELEASING +DREF MSISDN:46071: MSC conn use + release == 1 (0x100: release) +DREF VLR subscr MSISDN:46071 usage increases to: 4 +DREF VLR subscr MSISDN:46071 usage decreases to: 3 +- BSSAP Clear --RAN_GERAN_A--> MS +DREF VLR subscr MSISDN:46071 usage decreases to: 2 +<-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: vlr_gsupc_read_cb() returns 0 +- LU was successful, and the conn has already been closed + lu_result_sent == 1 + bssap_clear_sent == 1 +DREF VLR subscr MSISDN:46071 usage increases to: 3 + vsub != NULL == 1 + strcmp(vsub->imsi, IMSI) == 0 + vsub->lac == 23 +DREF VLR subscr MSISDN:46071 usage decreases to: 2 +- BSS sends BSSMAP Clear Complete +DREF MSISDN:46071: MSC conn use - release == 0 (0x0: ) +DMM Subscr_Conn(LU:901700000004620){SUBSCR_CONN_S_RELEASING}: Received Event SUBSCR_CONN_E_UNUSED +DMM Subscr_Conn(LU:901700000004620){SUBSCR_CONN_S_RELEASING}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(LU:901700000004620){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_DONE}: Removing from parent Subscr_Conn(LU:901700000004620) +DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_DONE}: fsm_lu_cleanup called with cause OSMO_FSM_TERM_PARENT +DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_DONE}: Freeing instance +DVLR vlr_lu_fsm(LU:901700000004620){VLR_ULA_S_DONE}: Deallocated +DRLL MSISDN:46071: Freeing subscriber connection +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +DMM Subscr_Conn(LU:901700000004620){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(LU:901700000004620){SUBSCR_CONN_S_RELEASED}: Deallocated + llist_count(&net->subscr_conns) == 0 +--- +- after a while, HLR initiates SS/USSD session +DREF VLR subscr MSISDN:46071 usage increases to: 2 + llist_count(&vsub->cs.requests) == 0 +<-- GSUP rx OSMO_GSUP_MSGT_PROC_SS_REQUEST: 20010809710000004026f03004200001013101013515a11302010102013b300b04010f0406aa510c061b01 +DVLR GSUP rx 43: 20010809710000004026f03004200001013101013515a11302010102013b300b04010f0406aa510c061b01 +DREF VLR subscr MSISDN:46071 usage increases to: 3 +DMSC Routed to GSM 09.11 SS/USSD handler +DMM Establishing network-originated session +DCC (ti ff sub MSISDN:46071 callref 20000101) New transaction +DREF VLR subscr MSISDN:46071 usage increases to: 4 +DMM Triggering Paging Request +DMM Subscriber MSISDN:46071 not paged yet, start paging. + RAN_GERAN_A sends out paging request to IMSI 901700000004620, TMSI 0xffffffff, LAC 23 + strcmp(paging_expecting_imsi, imsi) == 0 +DREF VLR subscr MSISDN:46071 usage increases to: 5 +DREF VLR subscr MSISDN:46071 usage decreases to: 4 +<-- GSUP rx OSMO_GSUP_MSGT_PROC_SS_REQUEST: vlr_gsupc_read_cb() returns -22 + llist_count(&vsub->cs.requests) == 1 +DREF VLR subscr MSISDN:46071 usage decreases to: 3 + paging_sent == 1 + paging_stopped == 0 +- the subscriber and its pending request should remain +DREF VLR subscr MSISDN:46071 usage increases to: 4 + llist_count(&vsub->cs.requests) == 1 +DREF VLR subscr MSISDN:46071 usage decreases to: 3 +- MS replies with Paging Response, we deliver the NC/USSD + MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_PAG_RESP + new conn +DMM Subscr_Conn{SUBSCR_CONN_S_NEW}: Allocated +DREF unknown: MSC conn use + compl_l3 == 1 (0x1: compl_l3) +DRLL Dispatching 04.08 message GSM48_MT_RR_PAG_RESP (0x6:0x27) +DRR PAGING RESPONSE: MI(IMSI)=901700000004620 +DMM Subscr_Conn(PAGING_RESP:901700000004620){SUBSCR_CONN_S_NEW}: Updated ID +DVLR Process_Access_Request_VLR(PAGING_RESP:901700000004620){PR_ARQ_S_INIT}: Allocated +DVLR Process_Access_Request_VLR(PAGING_RESP:901700000004620){PR_ARQ_S_INIT}: is child of Subscr_Conn(PAGING_RESP:901700000004620) +DVLR Process_Access_Request_VLR(PAGING_RESP:901700000004620){PR_ARQ_S_INIT}: rev=GSM net=GERAN (no Auth) +DVLR Process_Access_Request_VLR(PAGING_RESP:901700000004620){PR_ARQ_S_INIT}: Received Event PR_ARQ_E_START +DREF VLR subscr MSISDN:46071 usage increases to: 4 +DREF VLR subscr MSISDN:46071 usage increases to: 5 +DVLR Process_Access_Request_VLR(PAGING_RESP:901700000004620){PR_ARQ_S_INIT}: proc_arq_vlr_fn_post_imsi() +DVLR Process_Access_Request_VLR(PAGING_RESP:901700000004620){PR_ARQ_S_INIT}: _proc_arq_vlr_node2() +DVLR Process_Access_Request_VLR(PAGING_RESP:901700000004620){PR_ARQ_S_INIT}: _proc_arq_vlr_node2_post_ciph() +DVLR Process_Access_Request_VLR(PAGING_RESP:901700000004620){PR_ARQ_S_INIT}: _proc_arq_vlr_node2_post_vlr() +DVLR Process_Access_Request_VLR(PAGING_RESP:901700000004620){PR_ARQ_S_INIT}: _proc_arq_vlr_post_pres() +DVLR Process_Access_Request_VLR(PAGING_RESP:901700000004620){PR_ARQ_S_INIT}: _proc_arq_vlr_post_trace() +DVLR Process_Access_Request_VLR(PAGING_RESP:901700000004620){PR_ARQ_S_INIT}: _proc_arq_vlr_post_imei() +DVLR Process_Access_Request_VLR(PAGING_RESP:901700000004620){PR_ARQ_S_INIT}: proc_arq_fsm_done(PASSED) +DVLR Process_Access_Request_VLR(PAGING_RESP:901700000004620){PR_ARQ_S_INIT}: state_chg to PR_ARQ_S_DONE +DVLR Process_Access_Request_VLR(PAGING_RESP:901700000004620){PR_ARQ_S_DONE}: Process Access Request result: PASSED +DMM Subscr_Conn(PAGING_RESP:901700000004620){SUBSCR_CONN_S_NEW}: Received Event SUBSCR_CONN_E_ACCEPTED +DPAG Paging success for MSISDN:46071 (event=0) +DPAG Calling paging cbfn. +DMM Paging subscr 46071 succeeded! +DREF MSISDN:46071: MSC conn use + trans_nc_ss == 2 (0x41: compl_l3,trans_nc_ss) +DMSC msc_tx 25 bytes to MSISDN:46071 via RAN_GERAN_A +- DTAP --RAN_GERAN_A--> MS: GSM0480_MTYPE_REGISTER: 0b3b1c15a11302010102013b300b04010f0406aa510c061b01 +- DTAP matches expected message +DREF VLR subscr MSISDN:46071 usage decreases to: 4 +DMM Subscr_Conn(PAGING_RESP:901700000004620){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED +DMM Subscr_Conn(PAGING_RESP:901700000004620){SUBSCR_CONN_S_ACCEPTED}: subscr_conn_fsm_has_active_transactions: connection still has active transaction: NCSS +DREF VLR subscr MSISDN:46071 usage decreases to: 3 +DMM Subscr_Conn(PAGING_RESP:901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMPLETE_LAYER_3 +DMM Subscr_Conn(PAGING_RESP:901700000004620){SUBSCR_CONN_S_ACCEPTED}: Event SUBSCR_CONN_E_COMPLETE_LAYER_3 not permitted +DREF MSISDN:46071: MSC conn use - compl_l3 == 1 (0x40: trans_nc_ss) + dtap_tx_confirmed == 1 + paging_stopped == 1 +- MS responds to SS/USSD request + MSC <--RAN_GERAN_A-- MS: GSM0480_MTYPE_FACILITY +DREF MSISDN:46071: MSC conn use + dtap == 2 (0x42: dtap,trans_nc_ss) +DRLL Dispatching 04.08 message GSM0480_MTYPE_FACILITY (0xb:0x3a) +DMM Received SS/USSD data (trans_id=0, msg_type=GSM0480_MTYPE_FACILITY) +GSUP --> HLR: OSMO_GSUP_MSGT_PROC_SS_REQUEST: 20010809710000004026f03004200001013101023527a225020101302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +DMM Subscr_Conn(PAGING_RESP:901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING +DMM Subscr_Conn(PAGING_RESP:901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING +DREF MSISDN:46071: MSC conn use - dtap == 1 (0x40: trans_nc_ss) + dtap_tx_confirmed == 1 + paging_stopped == 1 +- HLR terminates the session +<-- GSUP rx OSMO_GSUP_MSGT_PROC_SS_REQUEST: 20010809710000004026f0300420000101310103 +DVLR GSUP rx 20: 20010809710000004026f0300420000101310103 +DREF VLR subscr MSISDN:46071 usage increases to: 4 +DMSC Routed to GSM 09.11 SS/USSD handler +DMSC msc_tx 2 bytes to MSISDN:46071 via RAN_GERAN_A +- DTAP --RAN_GERAN_A--> MS: GSM0480_MTYPE_RELEASE_COMPLETE: 0b2a +- DTAP matches expected message +DREF VLR subscr MSISDN:46071 usage decreases to: 3 +DREF MSISDN:46071: MSC conn use - trans_nc_ss == 0 (0x0: ) +DMM Subscr_Conn(PAGING_RESP:901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_UNUSED +DMM Subscr_Conn(PAGING_RESP:901700000004620){SUBSCR_CONN_S_COMMUNICATING}: state_chg to SUBSCR_CONN_S_RELEASING +DREF MSISDN:46071: MSC conn use + release == 1 (0x100: release) +DREF VLR subscr MSISDN:46071 usage increases to: 4 +DREF VLR subscr MSISDN:46071 usage decreases to: 3 +- BSSAP Clear --RAN_GERAN_A--> MS +DREF VLR subscr MSISDN:46071 usage decreases to: 2 +<-- GSUP rx OSMO_GSUP_MSGT_PROC_SS_REQUEST: vlr_gsupc_read_cb() returns 0 + dtap_tx_confirmed == 1 + bssap_clear_sent == 1 +- all requests serviced, conn has been released +- BSS sends BSSMAP Clear Complete +DREF MSISDN:46071: MSC conn use - release == 0 (0x0: ) +DMM Subscr_Conn(PAGING_RESP:901700000004620){SUBSCR_CONN_S_RELEASING}: Received Event SUBSCR_CONN_E_UNUSED +DMM Subscr_Conn(PAGING_RESP:901700000004620){SUBSCR_CONN_S_RELEASING}: state_chg to SUBSCR_CONN_S_RELEASED +DMM Subscr_Conn(PAGING_RESP:901700000004620){SUBSCR_CONN_S_RELEASED}: Terminating (cause = OSMO_FSM_TERM_REGULAR) +DVLR Process_Access_Request_VLR(PAGING_RESP:901700000004620){PR_ARQ_S_DONE}: Terminating (cause = OSMO_FSM_TERM_PARENT) +DVLR Process_Access_Request_VLR(PAGING_RESP:901700000004620){PR_ARQ_S_DONE}: Removing from parent Subscr_Conn(PAGING_RESP:901700000004620) +DVLR Process_Access_Request_VLR(PAGING_RESP:901700000004620){PR_ARQ_S_DONE}: Freeing instance +DVLR Process_Access_Request_VLR(PAGING_RESP:901700000004620){PR_ARQ_S_DONE}: Deallocated +DRLL MSISDN:46071: Freeing subscriber connection +DREF VLR subscr MSISDN:46071 usage decreases to: 1 +DMM Subscr_Conn(PAGING_RESP:901700000004620){SUBSCR_CONN_S_RELEASED}: Freeing instance +DMM Subscr_Conn(PAGING_RESP:901700000004620){SUBSCR_CONN_S_RELEASED}: Deallocated + llist_count(&net->subscr_conns) == 0 +DREF freeing VLR subscr MSISDN:46071 +===== test_ss_ussd_no_geran: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) talloc_total_blocks(tall_bsc_ctx) == 12 -- To view, visit https://gerrit.osmocom.org/9661 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ief14f8914ef013bd6efd7be842f81fbf053f02e2 Gerrit-Change-Number: 9661 Gerrit-PatchSet: 8 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 19:29:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 19:29:18 +0000 Subject: Change in osmo-msc[master]: libmsc/gsm_09_11.c: properly handle MS-initiated release In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9703 ) Change subject: libmsc/gsm_09_11.c: properly handle MS-initiated release ...................................................................... libmsc/gsm_09_11.c: properly handle MS-initiated release According to GSM TS 02.90, section 4.3, release of the connection used for SS/USSD is normally the responsibility of the network. But the user may also initiate connection release, e.g. by pressing the 'red button'. TTCN-3 test case: I7936ed5072ed2ae02f039dc90a1fece1e7f70a70 Change-Id: I76fc277bf9db614a97824b1541cd5bb75aa3e29d --- M src/libmsc/gsm_09_11.c 1 file changed, 5 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Alexander Chemeris: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/src/libmsc/gsm_09_11.c b/src/libmsc/gsm_09_11.c index 9423ec7..96acd8c 100644 --- a/src/libmsc/gsm_09_11.c +++ b/src/libmsc/gsm_09_11.c @@ -179,8 +179,11 @@ goto error; } - /* Don't release connection, wait for response */ - msc_subscr_conn_communicating(conn); + /* Should we release connection? Or wait for response? */ + if (msg_type == GSM0480_MTYPE_RELEASE_COMPLETE) + trans_free(trans); + else + msc_subscr_conn_communicating(conn); return 0; -- To view, visit https://gerrit.osmocom.org/9703 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I76fc277bf9db614a97824b1541cd5bb75aa3e29d Gerrit-Change-Number: 9703 Gerrit-PatchSet: 6 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 19:29:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 19:29:18 +0000 Subject: Change in osmo-msc[master]: libmsc/gsm_09_11.c: introduce rate counters for NC_SS sessions In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9711 ) Change subject: libmsc/gsm_09_11.c: introduce rate counters for NC_SS sessions ...................................................................... libmsc/gsm_09_11.c: introduce rate counters for NC_SS sessions This change introduces some new rate counters for call-independent SS/USSD connections. As OsmoMSC doesn't handle the messages itself, and only responsible for dispatching messages between both A and GSUP interfaces, the following is taken into account: - MS-initiated and network-initiated requests to establish a NC SS/USSD session (transaction) - "nc_ss:m{o|t}_requests"; - successfully established MS-initiated and network-initiated SS/USSD sessions (transactions) - "nc_ss:m{o|t}_established". Change-Id: I23c9475abc9951d82f3342fdc5aaa367836f7741 --- M include/osmocom/msc/gsm_data.h M src/libmsc/gsm_09_11.c M src/libmsc/msc_vty.c 3 files changed, 38 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index 73047ee..3af619d 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -200,6 +200,10 @@ MSC_CTR_CALL_ACTIVE, MSC_CTR_CALL_COMPLETE, MSC_CTR_CALL_INCOMPLETE, + MSC_CTR_NC_SS_MO_REQUESTS, + MSC_CTR_NC_SS_MO_ESTABLISHED, + MSC_CTR_NC_SS_MT_REQUESTS, + MSC_CTR_NC_SS_MT_ESTABLISHED, }; static const struct rate_ctr_desc msc_ctr_description[] = { @@ -227,6 +231,10 @@ [MSC_CTR_CALL_ACTIVE] = {"call:active", "Count total amount of calls that ever reached active state."}, [MSC_CTR_CALL_COMPLETE] = {"call:complete", "Count total amount of calls which got terminated by disconnect req or ind after reaching active state."}, [MSC_CTR_CALL_INCOMPLETE] = {"call:incomplete", "Count total amount of call which got terminated by any other reason after reaching active state."}, + [MSC_CTR_NC_SS_MO_REQUESTS] = {"nc_ss:mo_requests", "Received MS-initiated call independent SS/USSD requests."}, + [MSC_CTR_NC_SS_MO_ESTABLISHED] = {"nc_ss:mo_established", "Established MS-initiated call independent SS/USSD sessions."}, + [MSC_CTR_NC_SS_MT_REQUESTS] = {"nc_ss:mt_requests", "Received network-initiated call independent SS/USSD requests."}, + [MSC_CTR_NC_SS_MT_ESTABLISHED] = {"nc_ss:mt_established", "Established network-initiated call independent SS/USSD sessions."}, }; static const struct rate_ctr_group_desc msc_ctrg_desc = { diff --git a/src/libmsc/gsm_09_11.c b/src/libmsc/gsm_09_11.c index 96acd8c..2c5afb3 100644 --- a/src/libmsc/gsm_09_11.c +++ b/src/libmsc/gsm_09_11.c @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -74,6 +75,9 @@ /* Reuse existing transaction, or create a new one */ trans = trans_find_by_id(conn, pdisc, tid); if (!trans) { + /* Count MS-initiated attempts to establish a NC SS/USSD session */ + rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_NC_SS_MO_REQUESTS]); + /** * According to GSM TS 04.80, section 2.4.2 "Register * (mobile station to network direction)", the REGISTER @@ -185,6 +189,10 @@ else msc_subscr_conn_communicating(conn); + /* Count established MS-initiated NC SS/USSD sessions */ + if (msg_type == GSM0480_MTYPE_REGISTER) + rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_NC_SS_MO_ESTABLISHED]); + return 0; error: @@ -233,6 +241,9 @@ /* Sent to the MS, give ownership of ss_msg */ msc_tx_dtap(transt->conn, ss_msg); transt->ss.msg = NULL; + + /* Count established network-initiated NC SS/USSD sessions */ + rate_ctr_inc(&conn->network->msc_ctrs->ctr[MSC_CTR_NC_SS_MT_ESTABLISHED]); break; case GSM_PAGING_EXPIRED: case GSM_PAGING_BUSY: @@ -386,6 +397,9 @@ /* Attempt to find DTAP-transaction */ trans = trans_find_by_callref(net, gsup_msg->session_id); if (!trans) { + /* Count network-initiated attempts to establish a NC SS/USSD session */ + rate_ctr_inc(&net->msc_ctrs->ctr[MSC_CTR_NC_SS_MT_REQUESTS]); + /* Attempt to establish a new transaction */ trans = establish_nc_ss_trans(net, vsub, gsup_msg); if (!trans) { @@ -464,5 +478,9 @@ if (trans_end) trans_free(trans); + /* Count established network-initiated NC SS/USSD sessions */ + if (gsup_msg->session_state == OSMO_GSUP_SESSION_STATE_BEGIN) + rate_ctr_inc(&net->msc_ctrs->ctr[MSC_CTR_NC_SS_MT_ESTABLISHED]); + return 0; } diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c index d10028e..3cbb001 100644 --- a/src/libmsc/msc_vty.c +++ b/src/libmsc/msc_vty.c @@ -1217,6 +1217,18 @@ gsmnet->msc_ctrs->ctr[MSC_CTR_CALL_MT_SETUP].current, gsmnet->msc_ctrs->ctr[MSC_CTR_CALL_MT_CONNECT].current, VTY_NEWLINE); + vty_out(vty, "MO NC SS/USSD : %lu requests, %lu established, %lu rejected%s", + gsmnet->msc_ctrs->ctr[MSC_CTR_NC_SS_MO_REQUESTS].current, + gsmnet->msc_ctrs->ctr[MSC_CTR_NC_SS_MO_ESTABLISHED].current, + gsmnet->msc_ctrs->ctr[MSC_CTR_NC_SS_MO_REQUESTS].current + - gsmnet->msc_ctrs->ctr[MSC_CTR_NC_SS_MO_ESTABLISHED].current, + VTY_NEWLINE); + vty_out(vty, "MT NC SS/USSD : %lu requests, %lu established, %lu rejected%s", + gsmnet->msc_ctrs->ctr[MSC_CTR_NC_SS_MT_REQUESTS].current, + gsmnet->msc_ctrs->ctr[MSC_CTR_NC_SS_MT_ESTABLISHED].current, + gsmnet->msc_ctrs->ctr[MSC_CTR_NC_SS_MT_REQUESTS].current + - gsmnet->msc_ctrs->ctr[MSC_CTR_NC_SS_MT_ESTABLISHED].current, + VTY_NEWLINE); return CMD_SUCCESS; } -- To view, visit https://gerrit.osmocom.org/9711 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I23c9475abc9951d82f3342fdc5aaa367836f7741 Gerrit-Change-Number: 9711 Gerrit-PatchSet: 6 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 19:29:19 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 30 Jul 2018 19:29:19 +0000 Subject: Change in osmo-msc[master]: libmsc/gsm_09_11.c: introduce counter for active sessions In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9745 ) Change subject: libmsc/gsm_09_11.c: introduce counter for active sessions ...................................................................... libmsc/gsm_09_11.c: introduce counter for active sessions Change-Id: Ia17e7c747fffb5267d3ca5bc4193c1be4a57ef3a --- M include/osmocom/msc/gsm_data.h M src/libmsc/gsm_09_11.c M src/libmsc/osmo_msc.c 3 files changed, 11 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Alexander Chemeris: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index 3af619d..c79adde 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -276,6 +276,7 @@ struct rate_ctr_group *msc_ctrs; struct osmo_counter *active_calls; + struct osmo_counter *active_nc_ss; /* layer 4 */ struct mncc_sock_state *mncc_state; diff --git a/src/libmsc/gsm_09_11.c b/src/libmsc/gsm_09_11.c index 2c5afb3..9b0a9e4 100644 --- a/src/libmsc/gsm_09_11.c +++ b/src/libmsc/gsm_09_11.c @@ -107,6 +107,9 @@ return -ENOMEM; } + /* Count active NC SS/USSD sessions */ + osmo_counter_inc(conn->network->active_nc_ss); + trans->conn = msc_subscr_conn_get(conn, MSC_CONN_USE_TRANS_NC_SS); trans->dlci = OMSC_LINKID_CB(msg); cm_service_request_concludes(conn, msg); @@ -300,6 +303,9 @@ return NULL; } + /* Count active NC SS/USSD sessions */ + osmo_counter_inc(net->active_nc_ss); + /* Assign transaction ID */ tid = trans_assign_trans_id(trans->net, trans->vsub, GSM48_PDISC_NC_SS, 0); @@ -365,6 +371,9 @@ */ if (trans->ss.msg != NULL) msgb_free(trans->ss.msg); + + /* One session less */ + osmo_counter_dec(trans->net->active_nc_ss); } int gsm0911_gsup_handler(struct vlr_subscr *vsub, diff --git a/src/libmsc/osmo_msc.c b/src/libmsc/osmo_msc.c index 62a449f..a6618c0 100644 --- a/src/libmsc/osmo_msc.c +++ b/src/libmsc/osmo_msc.c @@ -67,6 +67,7 @@ return NULL; } net->active_calls = osmo_counter_alloc("msc.active_calls"); + net->active_nc_ss = osmo_counter_alloc("msc.active_nc_ss"); net->mncc_recv = mncc_recv; -- To view, visit https://gerrit.osmocom.org/9745 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ia17e7c747fffb5267d3ca5bc4193c1be4a57ef3a Gerrit-Change-Number: 9745 Gerrit-PatchSet: 4 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 19:38:14 2018 From: gerrit-no-reply at lists.osmocom.org (Jan Hrach) Date: Mon, 30 Jul 2018 19:38:14 +0000 Subject: Change in osmo-tetra[master]: add script for testing performance and number of correctly decoded fr... Message-ID: Jan Hrach has uploaded this change for review. ( https://gerrit.osmocom.org/10261 Change subject: add script for testing performance and number of correctly decoded frames ...................................................................... add script for testing performance and number of correctly decoded frames Change-Id: I6d8030969eed4519520745207591ce4731939201 --- M src/.gitignore A src/tetra-rx-tests.sh 2 files changed, 83 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-tetra refs/changes/61/10261/1 diff --git a/src/.gitignore b/src/.gitignore index 8451771..a72cffe 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -7,3 +7,4 @@ float_to_bits crc_test tunctl +tests_data/* diff --git a/src/tetra-rx-tests.sh b/src/tetra-rx-tests.sh new file mode 100755 index 0000000..f84a1ad --- /dev/null +++ b/src/tetra-rx-tests.sh @@ -0,0 +1,82 @@ +#!/bin/bash + +if [ $# -lt 1 ]; then + echo "$0" + echo "Runs tetra-rx on bit files provided as args, prints the number of correct frames" + echo " and the time it took and compares it to previous runs." + echo "" + echo "Extra options:" + echo " -n (default: git head id) (no spaces and \"-\" please)" + echo " -o overwrite previous measurement" + echo " -t parameters for tetra-rx" + echo "" + echo "Examples:" + echo "$0 path/to/file.bits" + echo "$0 -n \"something changed\" path/to/file.bits path/to/file2.bits" + exit 1 +fi + +if ! command -v bc > /dev/null; then + echo "Please install \"bc\"" +fi + +TESTS_DIR="tests_data/" +mkdir -p "$TESTS_DIR" + +n=`git rev-parse HEAD` +o=0 +t=" " +while getopts ":n:ot:" opt; do + case $opt in + n) + n="$OPTARG" + ;; + o) + o=1 + ;; + t) + t="$OPTARG" + ;; + \?) + echo "Unknown option $OPTARG" >&2 + exit 1 + ;; + :) + echo "-$OPTARG requires argument" >&2 + exit 1 + ;; + esac +done + +shift $(( $OPTIND - 1 )) + +tmpdir=`mktemp -d /tmp/tetraXXX` + +for f in $@; do + corrects=`"time" -o "$tmpdir/time" ./tetra-rx "$f" $t 2>/dev/null | grep -E "^CRC COMP: 0x.+ OK" | wc -l` + tt=`grep user "$tmpdir/time" | head -n 1 | cut -d u -f 1` + echo "$f: $corrects frames, $tt s" + hash=`sha256sum "$f" | cut -c 1-20` + fnb="$TESTS_DIR/rx-$hash-" + for meas in "$fnb"*; do + if ! [ -s "$meas" ]; then + continue + fi + tag=`echo "$meas" | rev | cut -d - -f 1 | rev` + if [ "$tag" = "$n" ]; then + continue + fi + pf=`cat "$meas" | cut -d " " -f 1` + pt=`cat "$meas" | cut -d " " -f 2` + deltaf=`echo "scale=7; $corrects/$pf" | bc -l` + deltat=`echo "scale=3; $tt/$pt" | bc -l` + echo "... ${deltaf}x frames than $tag" + echo "... ${deltat}x time than $tag" + done + fn="$fnb$n" + if [ "$o" -eq 1 -o ! -s "$fn" ]; then + echo "$corrects $tt" > "$fn" + fi +done + +rm -r "$tmpdir" -- To view, visit https://gerrit.osmocom.org/10261 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-tetra Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I6d8030969eed4519520745207591ce4731939201 Gerrit-Change-Number: 10261 Gerrit-PatchSet: 1 Gerrit-Owner: Jan Hrach -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 19:42:14 2018 From: gerrit-no-reply at lists.osmocom.org (Jan Hrach) Date: Mon, 30 Jul 2018 19:42:14 +0000 Subject: Change in osmo-tetra[master]: Makefile: -O3 and debug build Message-ID: Jan Hrach has uploaded this change for review. ( https://gerrit.osmocom.org/10262 Change subject: Makefile: -O3 and debug build ...................................................................... Makefile: -O3 and debug build Build standard builds with -O3. Add a "debug" target with -Og and asan. Change-Id: Ie943babb808ffdb1d807bcd7ce4ace54723b49a9 --- M src/Makefile 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-tetra refs/changes/62/10262/1 diff --git a/src/Makefile b/src/Makefile index f6ff0fc..b21f846 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,8 +1,12 @@ -CFLAGS=-g -O0 -Wall `pkg-config --cflags libosmocore 2> /dev/null` -I. +CFLAGS=-g -O3 -Wall `pkg-config --cflags libosmocore 2> /dev/null` -I. LDLIBS=`pkg-config --libs libosmocore 2> /dev/null` -losmocore all: conv_enc_test crc_test tetra-rx float_to_bits tunctl +debug: CFLAGS := -lasan $(CFLAGS) -fsanitize=address -fno-omit-frame-pointer -g -Og +debug: LDLIBS := -lasan $(LDLIBS) +debug: all + %.o: %.c $(CC) $(CFLAGS) -c $^ -o $@ -- To view, visit https://gerrit.osmocom.org/10262 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-tetra Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ie943babb808ffdb1d807bcd7ce4ace54723b49a9 Gerrit-Change-Number: 10262 Gerrit-PatchSet: 1 Gerrit-Owner: Jan Hrach -------------- next part -------------- An HTML attachment was scrubbed... URL: From admin at opensuse.org Mon Jul 30 20:02:51 2018 From: admin at opensuse.org (OBS Notification) Date: Mon, 30 Jul 2018 20:02:51 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_8.0/i586 In-Reply-To: References: Message-ID: <5b5f6ef6b4755_68b3107a688452ae@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_8.0/i586 Package network:osmocom:nightly/osmo-bsc failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 88s] ^ [ 88s] handover_fsm.c:489:4: error: format not a string literal and no format arguments [-Werror=format-security] [ 89s] cc1: some warnings being treated as errors [ 89s] Makefile:614: recipe for target 'handover_fsm.o' failed [ 89s] make[4]: *** [handover_fsm.o] Error 1 [ 89s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 89s] Makefile:395: recipe for target 'all-recursive' failed [ 89s] make[3]: *** [all-recursive] Error 1 [ 89s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 89s] Makefile:429: recipe for target 'all-recursive' failed [ 89s] make[2]: *** [all-recursive] Error 1 [ 89s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 89s] Makefile:360: recipe for target 'all' failed [ 89s] make[1]: *** [all] Error 2 [ 89s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 89s] dh_auto_build: make -j1 returned exit code 2 [ 89s] debian/rules:45: recipe for target 'build' failed [ 89s] make: *** [build] Error 2 [ 89s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 89s] [ 89s] build71 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:02:41 UTC 2018. [ 89s] [ 89s] ### VM INTERACTION START ### [ 90s] Powering off. [ 90s] [ 78.879762] reboot: Power down [ 90s] ### VM INTERACTION END ### [ 90s] [ 90s] build71 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:02:43 UTC 2018. [ 90s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jul 30 20:02:51 2018 From: admin at opensuse.org (OBS Notification) Date: Mon, 30 Jul 2018 20:02:51 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_8.0/i586 In-Reply-To: References: Message-ID: <5b5f6ef7241c3_68b3107a6884538c@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_8.0/i586 Package network:osmocom:nightly/osmo-bsc failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 88s] ^ [ 88s] handover_fsm.c:489:4: error: format not a string literal and no format arguments [-Werror=format-security] [ 89s] cc1: some warnings being treated as errors [ 89s] Makefile:614: recipe for target 'handover_fsm.o' failed [ 89s] make[4]: *** [handover_fsm.o] Error 1 [ 89s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 89s] Makefile:395: recipe for target 'all-recursive' failed [ 89s] make[3]: *** [all-recursive] Error 1 [ 89s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 89s] Makefile:429: recipe for target 'all-recursive' failed [ 89s] make[2]: *** [all-recursive] Error 1 [ 89s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 89s] Makefile:360: recipe for target 'all' failed [ 89s] make[1]: *** [all] Error 2 [ 89s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 89s] dh_auto_build: make -j1 returned exit code 2 [ 89s] debian/rules:45: recipe for target 'build' failed [ 89s] make: *** [build] Error 2 [ 89s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 89s] [ 89s] build71 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:02:41 UTC 2018. [ 89s] [ 89s] ### VM INTERACTION START ### [ 90s] Powering off. [ 90s] [ 78.879762] reboot: Power down [ 90s] ### VM INTERACTION END ### [ 90s] [ 90s] build71 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:02:43 UTC 2018. [ 90s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Mon Jul 30 20:03:22 2018 From: gerrit-no-reply at lists.osmocom.org (Jan Hrach) Date: Mon, 30 Jul 2018 20:03:22 +0000 Subject: Change in osmo-tetra[master]: phy/tetra_burst.c: use bitwise operations to speed up synchronization Message-ID: Jan Hrach has uploaded this change for review. ( https://gerrit.osmocom.org/10263 Change subject: phy/tetra_burst.c: use bitwise operations to speed up synchronization ...................................................................... phy/tetra_burst.c: use bitwise operations to speed up synchronization Finding synchronization sequence eats several times more CPU time than the actual decoding. This is especially pronounced on channels with lots of errors (where synchronization is lost frequently) and channels that are most of the time empty (such as uplink channels, support for which is coming in following patches). Profiling shows that all the time is spent in memcmp calls. A complicated and efficient algorithm, e.g. Aho-Corasick, turned out to be not necessary. Compilers can optimize even a simple bit filter into fast code. This provides only a modest (~25 %) performance gain, more fixes are coming. Fixes: OS#1897 Change-Id: I3b90cc70c2ec67253a0fd2f00c6957a80971c38b --- M src/phy/tetra_burst.c 1 file changed, 30 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-tetra refs/changes/63/10263/1 diff --git a/src/phy/tetra_burst.c b/src/phy/tetra_burst.c index 62efb72..5bede06 100644 --- a/src/phy/tetra_burst.c +++ b/src/phy/tetra_burst.c @@ -269,9 +269,39 @@ int tetra_find_train_seq(const uint8_t *in, unsigned int end_of_in, uint32_t mask_of_train_seq, unsigned int *offset) { + static uint32_t tsq_bytes[5]; + + if (tsq_bytes[0] == 0) { +#define FILTER_LOOKAHEAD_LEN 22 +#define FILTER_LOOKAHEAD_MASK ((1< -------------- next part -------------- An HTML attachment was scrubbed... URL: From admin at opensuse.org Mon Jul 30 20:03:08 2018 From: admin at opensuse.org (OBS Notification) Date: Mon, 30 Jul 2018 20:03:08 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <5b5f6f126bec0_68b3107a68845470@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_16.04/i586 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 95s] ^ [ 95s] handover_fsm.c:489:4: error: format not a string literal and no format arguments [-Werror=format-security] [ 96s] cc1: some warnings being treated as errors [ 96s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 96s] make[4]: *** [handover_fsm.o] Error 1 [ 96s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 96s] Makefile:407: recipe for target 'all-recursive' failed [ 96s] make[3]: *** [all-recursive] Error 1 [ 96s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 96s] Makefile:441: recipe for target 'all-recursive' failed [ 96s] make[2]: *** [all-recursive] Error 1 [ 96s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 96s] Makefile:373: recipe for target 'all' failed [ 96s] make[1]: *** [all] Error 2 [ 96s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 96s] dh_auto_build: make -j1 returned exit code 2 [ 96s] debian/rules:45: recipe for target 'build' failed [ 96s] make: *** [build] Error 2 [ 96s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 96s] [ 96s] lamb14 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:02:48 UTC 2018. [ 96s] [ 96s] ### VM INTERACTION START ### [ 99s] [ 89.340738] sysrq: SysRq : Power Off [ 99s] [ 89.347395] reboot: Power down [ 99s] ### VM INTERACTION END ### [ 99s] [ 99s] lamb14 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:02:52 UTC 2018. [ 99s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jul 30 20:03:08 2018 From: admin at opensuse.org (OBS Notification) Date: Mon, 30 Jul 2018 20:03:08 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <5b5f6f12c0a0b_68b3107a6884551b@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_16.04/i586 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 95s] ^ [ 95s] handover_fsm.c:489:4: error: format not a string literal and no format arguments [-Werror=format-security] [ 96s] cc1: some warnings being treated as errors [ 96s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 96s] make[4]: *** [handover_fsm.o] Error 1 [ 96s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 96s] Makefile:407: recipe for target 'all-recursive' failed [ 96s] make[3]: *** [all-recursive] Error 1 [ 96s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 96s] Makefile:441: recipe for target 'all-recursive' failed [ 96s] make[2]: *** [all-recursive] Error 1 [ 96s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 96s] Makefile:373: recipe for target 'all' failed [ 96s] make[1]: *** [all] Error 2 [ 96s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 96s] dh_auto_build: make -j1 returned exit code 2 [ 96s] debian/rules:45: recipe for target 'build' failed [ 96s] make: *** [build] Error 2 [ 96s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 96s] [ 96s] lamb14 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:02:48 UTC 2018. [ 96s] [ 96s] ### VM INTERACTION START ### [ 99s] [ 89.340738] sysrq: SysRq : Power Off [ 99s] [ 89.347395] reboot: Power down [ 99s] ### VM INTERACTION END ### [ 99s] [ 99s] lamb14 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:02:52 UTC 2018. [ 99s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jul 30 20:05:08 2018 From: admin at opensuse.org (OBS Notification) Date: Mon, 30 Jul 2018 20:05:08 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <5b5f6f90b5eeb_68b3107a68848141@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_9.0/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 92s] gsm0808_cell_id_name(&req->cell_id_target)); [ 92s] ^~~~~~~~~~~~~~~~~~~~ [ 93s] cc1: some warnings being treated as errors [ 93s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 93s] make[4]: *** [handover_fsm.o] Error 1 [ 93s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 93s] Makefile:407: recipe for target 'all-recursive' failed [ 93s] make[3]: *** [all-recursive] Error 1 [ 93s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 93s] Makefile:441: recipe for target 'all-recursive' failed [ 93s] make[2]: *** [all-recursive] Error 1 [ 93s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 93s] Makefile:373: recipe for target 'all' failed [ 93s] make[1]: *** [all] Error 2 [ 93s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 93s] dh_auto_build: make -j1 returned exit code 2 [ 93s] debian/rules:45: recipe for target 'build' failed [ 93s] make: *** [build] Error 2 [ 93s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 93s] [ 93s] lamb08 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:04:56 UTC 2018. [ 93s] [ 93s] ### VM INTERACTION START ### [ 96s] [ 84.214218] sysrq: SysRq : Power Off [ 96s] [ 84.220671] reboot: Power down [ 96s] ### VM INTERACTION END ### [ 96s] [ 96s] lamb08 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:05:00 UTC 2018. [ 96s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jul 30 20:05:08 2018 From: admin at opensuse.org (OBS Notification) Date: Mon, 30 Jul 2018 20:05:08 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <5b5f6f9038aee_68b3107a688480bb@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_9.0/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 92s] gsm0808_cell_id_name(&req->cell_id_target)); [ 92s] ^~~~~~~~~~~~~~~~~~~~ [ 93s] cc1: some warnings being treated as errors [ 93s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 93s] make[4]: *** [handover_fsm.o] Error 1 [ 93s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 93s] Makefile:407: recipe for target 'all-recursive' failed [ 93s] make[3]: *** [all-recursive] Error 1 [ 93s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 93s] Makefile:441: recipe for target 'all-recursive' failed [ 93s] make[2]: *** [all-recursive] Error 1 [ 93s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 93s] Makefile:373: recipe for target 'all' failed [ 93s] make[1]: *** [all] Error 2 [ 93s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 93s] dh_auto_build: make -j1 returned exit code 2 [ 93s] debian/rules:45: recipe for target 'build' failed [ 93s] make: *** [build] Error 2 [ 93s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 93s] [ 93s] lamb08 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:04:56 UTC 2018. [ 93s] [ 93s] ### VM INTERACTION START ### [ 96s] [ 84.214218] sysrq: SysRq : Power Off [ 96s] [ 84.220671] reboot: Power down [ 96s] ### VM INTERACTION END ### [ 96s] [ 96s] lamb08 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:05:00 UTC 2018. [ 96s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jul 30 20:05:25 2018 From: admin at opensuse.org (OBS Notification) Date: Mon, 30 Jul 2018 20:05:25 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_9.0/i586 In-Reply-To: References: Message-ID: <5b5f6f91e2a2b_68b3107a68848259@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_9.0/i586 Package network:osmocom:nightly/osmo-bsc failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 112s] gsm0808_cell_id_name(&req->cell_id_target)); [ 112s] ^~~~~~~~~~~~~~~~~~~~ [ 113s] cc1: some warnings being treated as errors [ 113s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 113s] make[4]: *** [handover_fsm.o] Error 1 [ 113s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 113s] Makefile:407: recipe for target 'all-recursive' failed [ 113s] make[3]: *** [all-recursive] Error 1 [ 113s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 113s] Makefile:441: recipe for target 'all-recursive' failed [ 113s] make[2]: *** [all-recursive] Error 1 [ 113s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 113s] Makefile:373: recipe for target 'all' failed [ 113s] make[1]: *** [all] Error 2 [ 113s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 113s] dh_auto_build: make -j1 returned exit code 2 [ 113s] debian/rules:45: recipe for target 'build' failed [ 113s] make: *** [build] Error 2 [ 113s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 113s] [ 113s] build31 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:05:08 UTC 2018. [ 113s] [ 113s] ### VM INTERACTION START ### [ 116s] [ 102.837496] sysrq: SysRq : Power Off [ 116s] [ 102.874082] reboot: Power down [ 117s] ### VM INTERACTION END ### [ 117s] [ 117s] build31 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:05:12 UTC 2018. [ 117s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jul 30 20:05:25 2018 From: admin at opensuse.org (OBS Notification) Date: Mon, 30 Jul 2018 20:05:25 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_9.0/i586 In-Reply-To: References: Message-ID: <5b5f6f9241546_68b3107a68848362@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_9.0/i586 Package network:osmocom:nightly/osmo-bsc failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 112s] gsm0808_cell_id_name(&req->cell_id_target)); [ 112s] ^~~~~~~~~~~~~~~~~~~~ [ 113s] cc1: some warnings being treated as errors [ 113s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 113s] make[4]: *** [handover_fsm.o] Error 1 [ 113s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 113s] Makefile:407: recipe for target 'all-recursive' failed [ 113s] make[3]: *** [all-recursive] Error 1 [ 113s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 113s] Makefile:441: recipe for target 'all-recursive' failed [ 113s] make[2]: *** [all-recursive] Error 1 [ 113s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 113s] Makefile:373: recipe for target 'all' failed [ 113s] make[1]: *** [all] Error 2 [ 113s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 113s] dh_auto_build: make -j1 returned exit code 2 [ 113s] debian/rules:45: recipe for target 'build' failed [ 113s] make: *** [build] Error 2 [ 113s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 113s] [ 113s] build31 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:05:08 UTC 2018. [ 113s] [ 113s] ### VM INTERACTION START ### [ 116s] [ 102.837496] sysrq: SysRq : Power Off [ 116s] [ 102.874082] reboot: Power down [ 117s] ### VM INTERACTION END ### [ 117s] [ 117s] build31 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:05:12 UTC 2018. [ 117s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jul 30 20:06:00 2018 From: admin at opensuse.org (OBS Notification) Date: Mon, 30 Jul 2018 20:06:00 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_17.10/x86_64 In-Reply-To: References: Message-ID: <5b5f6fac28d39_68b3107a688486cc@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_17.10/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_17.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 149s] gsm0808_cell_id_name(&req->cell_id_target)); [ 149s] ^~~~~~~~~~~~~~~~~~~~ [ 150s] cc1: some warnings being treated as errors [ 150s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 150s] make[4]: *** [handover_fsm.o] Error 1 [ 150s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 150s] Makefile:407: recipe for target 'all-recursive' failed [ 150s] make[3]: *** [all-recursive] Error 1 [ 150s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 150s] Makefile:441: recipe for target 'all-recursive' failed [ 150s] make[2]: *** [all-recursive] Error 1 [ 150s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 150s] Makefile:373: recipe for target 'all' failed [ 150s] make[1]: *** [all] Error 2 [ 150s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 150s] dh_auto_build: make -j1 returned exit code 2 [ 150s] debian/rules:45: recipe for target 'build' failed [ 150s] make: *** [build] Error 2 [ 150s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 150s] [ 150s] wildcard2 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:05:45 UTC 2018. [ 150s] [ 150s] ### VM INTERACTION START ### [ 153s] [ 131.487116] sysrq: SysRq : Power Off [ 153s] [ 131.489769] reboot: Power down [ 153s] ### VM INTERACTION END ### [ 153s] [ 153s] wildcard2 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:05:49 UTC 2018. [ 153s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jul 30 20:06:00 2018 From: admin at opensuse.org (OBS Notification) Date: Mon, 30 Jul 2018 20:06:00 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_17.10/x86_64 In-Reply-To: References: Message-ID: <5b5f6fac7cd64_68b3107a68848793@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_17.10/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_17.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 149s] gsm0808_cell_id_name(&req->cell_id_target)); [ 149s] ^~~~~~~~~~~~~~~~~~~~ [ 150s] cc1: some warnings being treated as errors [ 150s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 150s] make[4]: *** [handover_fsm.o] Error 1 [ 150s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 150s] Makefile:407: recipe for target 'all-recursive' failed [ 150s] make[3]: *** [all-recursive] Error 1 [ 150s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 150s] Makefile:441: recipe for target 'all-recursive' failed [ 150s] make[2]: *** [all-recursive] Error 1 [ 150s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 150s] Makefile:373: recipe for target 'all' failed [ 150s] make[1]: *** [all] Error 2 [ 150s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 150s] dh_auto_build: make -j1 returned exit code 2 [ 150s] debian/rules:45: recipe for target 'build' failed [ 150s] make: *** [build] Error 2 [ 150s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 150s] [ 150s] wildcard2 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:05:45 UTC 2018. [ 150s] [ 150s] ### VM INTERACTION START ### [ 153s] [ 131.487116] sysrq: SysRq : Power Off [ 153s] [ 131.489769] reboot: Power down [ 153s] ### VM INTERACTION END ### [ 153s] [ 153s] wildcard2 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:05:49 UTC 2018. [ 153s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jul 30 20:06:51 2018 From: admin at opensuse.org (OBS Notification) Date: Mon, 30 Jul 2018 20:06:51 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <5b5f6ff11dcca_68b3107a688492e1@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_8.0/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 91s] ^ [ 91s] handover_fsm.c:489:4: error: format not a string literal and no format arguments [-Werror=format-security] [ 92s] cc1: some warnings being treated as errors [ 92s] Makefile:614: recipe for target 'handover_fsm.o' failed [ 92s] make[4]: *** [handover_fsm.o] Error 1 [ 92s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 92s] Makefile:395: recipe for target 'all-recursive' failed [ 92s] make[3]: *** [all-recursive] Error 1 [ 92s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 92s] Makefile:429: recipe for target 'all-recursive' failed [ 92s] make[2]: *** [all-recursive] Error 1 [ 92s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 92s] Makefile:360: recipe for target 'all' failed [ 92s] make[1]: *** [all] Error 2 [ 92s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 92s] dh_auto_build: make -j1 returned exit code 2 [ 92s] debian/rules:45: recipe for target 'build' failed [ 92s] make: *** [build] Error 2 [ 92s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 92s] [ 92s] lamb51 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:06:36 UTC 2018. [ 92s] [ 92s] ### VM INTERACTION START ### [ 93s] Powering off. [ 93s] [ 81.848580] reboot: Power down [ 93s] ### VM INTERACTION END ### [ 93s] [ 93s] lamb51 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:06:38 UTC 2018. [ 93s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jul 30 20:06:51 2018 From: admin at opensuse.org (OBS Notification) Date: Mon, 30 Jul 2018 20:06:51 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <5b5f6ff16d2ab_68b3107a68849374@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_8.0/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 91s] ^ [ 91s] handover_fsm.c:489:4: error: format not a string literal and no format arguments [-Werror=format-security] [ 92s] cc1: some warnings being treated as errors [ 92s] Makefile:614: recipe for target 'handover_fsm.o' failed [ 92s] make[4]: *** [handover_fsm.o] Error 1 [ 92s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 92s] Makefile:395: recipe for target 'all-recursive' failed [ 92s] make[3]: *** [all-recursive] Error 1 [ 92s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 92s] Makefile:429: recipe for target 'all-recursive' failed [ 92s] make[2]: *** [all-recursive] Error 1 [ 92s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 92s] Makefile:360: recipe for target 'all' failed [ 92s] make[1]: *** [all] Error 2 [ 92s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 92s] dh_auto_build: make -j1 returned exit code 2 [ 92s] debian/rules:45: recipe for target 'build' failed [ 92s] make: *** [build] Error 2 [ 92s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 92s] [ 92s] lamb51 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:06:36 UTC 2018. [ 92s] [ 92s] ### VM INTERACTION START ### [ 93s] Powering off. [ 93s] [ 81.848580] reboot: Power down [ 93s] ### VM INTERACTION END ### [ 93s] [ 93s] lamb51 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:06:38 UTC 2018. [ 93s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jul 30 20:06:51 2018 From: admin at opensuse.org (OBS Notification) Date: Mon, 30 Jul 2018 20:06:51 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <5b5f6ff27451d_68b3107a688494e8@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 96s] ^ [ 96s] handover_fsm.c:489:4: error: format not a string literal and no format arguments [-Werror=format-security] [ 97s] cc1: some warnings being treated as errors [ 97s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 97s] make[4]: *** [handover_fsm.o] Error 1 [ 97s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 97s] Makefile:407: recipe for target 'all-recursive' failed [ 97s] make[3]: *** [all-recursive] Error 1 [ 97s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 97s] Makefile:441: recipe for target 'all-recursive' failed [ 97s] make[2]: *** [all-recursive] Error 1 [ 97s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 97s] Makefile:373: recipe for target 'all' failed [ 97s] make[1]: *** [all] Error 2 [ 97s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 97s] dh_auto_build: make -j1 returned exit code 2 [ 97s] debian/rules:45: recipe for target 'build' failed [ 97s] make: *** [build] Error 2 [ 97s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 97s] [ 97s] lamb58 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:06:45 UTC 2018. [ 97s] [ 97s] ### VM INTERACTION START ### [ 100s] [ 90.062361] sysrq: SysRq : Power Off [ 100s] [ 90.069734] reboot: Power down [ 100s] ### VM INTERACTION END ### [ 100s] [ 100s] lamb58 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:06:49 UTC 2018. [ 100s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jul 30 20:06:51 2018 From: admin at opensuse.org (OBS Notification) Date: Mon, 30 Jul 2018 20:06:51 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <5b5f6ff2c1464_68b3107a68849520@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 96s] ^ [ 96s] handover_fsm.c:489:4: error: format not a string literal and no format arguments [-Werror=format-security] [ 97s] cc1: some warnings being treated as errors [ 97s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 97s] make[4]: *** [handover_fsm.o] Error 1 [ 97s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 97s] Makefile:407: recipe for target 'all-recursive' failed [ 97s] make[3]: *** [all-recursive] Error 1 [ 97s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 97s] Makefile:441: recipe for target 'all-recursive' failed [ 97s] make[2]: *** [all-recursive] Error 1 [ 97s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 97s] Makefile:373: recipe for target 'all' failed [ 97s] make[1]: *** [all] Error 2 [ 97s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 97s] dh_auto_build: make -j1 returned exit code 2 [ 97s] debian/rules:45: recipe for target 'build' failed [ 97s] make: *** [build] Error 2 [ 97s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 97s] [ 97s] lamb58 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:06:45 UTC 2018. [ 97s] [ 97s] ### VM INTERACTION START ### [ 100s] [ 90.062361] sysrq: SysRq : Power Off [ 100s] [ 90.069734] reboot: Power down [ 100s] ### VM INTERACTION END ### [ 100s] [ 100s] lamb58 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:06:49 UTC 2018. [ 100s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jul 30 20:08:17 2018 From: admin at opensuse.org (OBS Notification) Date: Mon, 30 Jul 2018 20:08:17 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_17.10/i586 In-Reply-To: References: Message-ID: <5b5f704288f6e_68b3107a6884974b@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_17.10/i586 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_17.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 96s] gsm0808_cell_id_name(&req->cell_id_target)); [ 96s] ^~~~~~~~~~~~~~~~~~~~ [ 97s] cc1: some warnings being treated as errors [ 97s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 97s] make[4]: *** [handover_fsm.o] Error 1 [ 97s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 97s] Makefile:407: recipe for target 'all-recursive' failed [ 97s] make[3]: *** [all-recursive] Error 1 [ 97s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 97s] Makefile:441: recipe for target 'all-recursive' failed [ 97s] make[2]: *** [all-recursive] Error 1 [ 97s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 97s] Makefile:373: recipe for target 'all' failed [ 97s] make[1]: *** [all] Error 2 [ 97s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 97s] dh_auto_build: make -j1 returned exit code 2 [ 97s] debian/rules:45: recipe for target 'build' failed [ 97s] make: *** [build] Error 2 [ 97s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 97s] [ 97s] lamb01 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:07:58 UTC 2018. [ 97s] [ 97s] ### VM INTERACTION START ### [ 100s] [ 90.102408] sysrq: SysRq : Power Off [ 100s] [ 90.114560] reboot: Power down [ 100s] ### VM INTERACTION END ### [ 100s] [ 100s] lamb01 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:08:02 UTC 2018. [ 100s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jul 30 20:08:17 2018 From: admin at opensuse.org (OBS Notification) Date: Mon, 30 Jul 2018 20:08:17 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_17.10/i586 In-Reply-To: References: Message-ID: <5b5f704249261_68b3107a6884965f@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_17.10/i586 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_17.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 96s] gsm0808_cell_id_name(&req->cell_id_target)); [ 96s] ^~~~~~~~~~~~~~~~~~~~ [ 97s] cc1: some warnings being treated as errors [ 97s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 97s] make[4]: *** [handover_fsm.o] Error 1 [ 97s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 97s] Makefile:407: recipe for target 'all-recursive' failed [ 97s] make[3]: *** [all-recursive] Error 1 [ 97s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 97s] Makefile:441: recipe for target 'all-recursive' failed [ 97s] make[2]: *** [all-recursive] Error 1 [ 97s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 97s] Makefile:373: recipe for target 'all' failed [ 97s] make[1]: *** [all] Error 2 [ 97s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 97s] dh_auto_build: make -j1 returned exit code 2 [ 97s] debian/rules:45: recipe for target 'build' failed [ 97s] make: *** [build] Error 2 [ 97s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 97s] [ 97s] lamb01 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:07:58 UTC 2018. [ 97s] [ 97s] ### VM INTERACTION START ### [ 100s] [ 90.102408] sysrq: SysRq : Power Off [ 100s] [ 90.114560] reboot: Power down [ 100s] ### VM INTERACTION END ### [ 100s] [ 100s] lamb01 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:08:02 UTC 2018. [ 100s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jul 30 20:08:34 2018 From: admin at opensuse.org (OBS Notification) Date: Mon, 30 Jul 2018 20:08:34 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_18.04/i586 In-Reply-To: References: Message-ID: <5b5f70458ecbd_68b3107a68849825@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_18.04/i586 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_18.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 121s] gsm0808_cell_id_name(&req->cell_id_target)); [ 121s] ^~~~~~~~~~~~~~~~~~~~ [ 123s] cc1: some warnings being treated as errors [ 123s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 123s] make[4]: *** [handover_fsm.o] Error 1 [ 123s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 123s] Makefile:407: recipe for target 'all-recursive' failed [ 123s] make[3]: *** [all-recursive] Error 1 [ 123s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 123s] Makefile:441: recipe for target 'all-recursive' failed [ 123s] make[2]: *** [all-recursive] Error 1 [ 123s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 123s] Makefile:373: recipe for target 'all' failed [ 123s] make[1]: *** [all] Error 2 [ 123s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 123s] dh_auto_build: make -j1 returned exit code 2 [ 123s] debian/rules:45: recipe for target 'build' failed [ 123s] make: *** [build] Error 2 [ 123s] dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2 [ 123s] [ 123s] lamb25 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:08:23 UTC 2018. [ 123s] [ 123s] ### VM INTERACTION START ### [ 126s] [ 114.525210] sysrq: SysRq : Power Off [ 126s] [ 114.531182] reboot: Power down [ 126s] ### VM INTERACTION END ### [ 126s] [ 126s] lamb25 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:08:27 UTC 2018. [ 126s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jul 30 20:08:34 2018 From: admin at opensuse.org (OBS Notification) Date: Mon, 30 Jul 2018 20:08:34 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_18.04/i586 In-Reply-To: References: Message-ID: <5b5f7045daa49_68b3107a68849920@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_18.04/i586 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_18.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 121s] gsm0808_cell_id_name(&req->cell_id_target)); [ 121s] ^~~~~~~~~~~~~~~~~~~~ [ 123s] cc1: some warnings being treated as errors [ 123s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 123s] make[4]: *** [handover_fsm.o] Error 1 [ 123s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 123s] Makefile:407: recipe for target 'all-recursive' failed [ 123s] make[3]: *** [all-recursive] Error 1 [ 123s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 123s] Makefile:441: recipe for target 'all-recursive' failed [ 123s] make[2]: *** [all-recursive] Error 1 [ 123s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 123s] Makefile:373: recipe for target 'all' failed [ 123s] make[1]: *** [all] Error 2 [ 123s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 123s] dh_auto_build: make -j1 returned exit code 2 [ 123s] debian/rules:45: recipe for target 'build' failed [ 123s] make: *** [build] Error 2 [ 123s] dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2 [ 123s] [ 123s] lamb25 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:08:23 UTC 2018. [ 123s] [ 123s] ### VM INTERACTION START ### [ 126s] [ 114.525210] sysrq: SysRq : Power Off [ 126s] [ 114.531182] reboot: Power down [ 126s] ### VM INTERACTION END ### [ 126s] [ 126s] lamb25 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:08:27 UTC 2018. [ 126s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jul 30 20:09:08 2018 From: admin at opensuse.org (OBS Notification) Date: Mon, 30 Jul 2018 20:09:08 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_18.04/x86_64 In-Reply-To: References: Message-ID: <5b5f707c56577_68b3107a6885009b@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_18.04/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_18.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 123s] gsm0808_cell_id_name(&req->cell_id_target)); [ 123s] ^~~~~~~~~~~~~~~~~~~~ [ 124s] cc1: some warnings being treated as errors [ 124s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 124s] make[4]: *** [handover_fsm.o] Error 1 [ 124s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 124s] Makefile:407: recipe for target 'all-recursive' failed [ 124s] make[3]: *** [all-recursive] Error 1 [ 124s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 124s] Makefile:441: recipe for target 'all-recursive' failed [ 124s] make[2]: *** [all-recursive] Error 1 [ 124s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 124s] Makefile:373: recipe for target 'all' failed [ 124s] make[1]: *** [all] Error 2 [ 124s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 124s] dh_auto_build: make -j1 returned exit code 2 [ 124s] debian/rules:45: recipe for target 'build' failed [ 124s] make: *** [build] Error 2 [ 124s] dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2 [ 124s] [ 124s] wildcard2 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:09:00 UTC 2018. [ 124s] [ 124s] ### VM INTERACTION START ### [ 127s] [ 110.609260] sysrq: SysRq : Power Off [ 127s] [ 110.614073] reboot: Power down [ 129s] ### VM INTERACTION END ### [ 129s] [ 129s] wildcard2 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:09:05 UTC 2018. [ 129s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jul 30 20:09:08 2018 From: admin at opensuse.org (OBS Notification) Date: Mon, 30 Jul 2018 20:09:08 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_18.04/x86_64 In-Reply-To: References: Message-ID: <5b5f707c90cf4_68b3107a6885017b@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_18.04/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_18.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 123s] gsm0808_cell_id_name(&req->cell_id_target)); [ 123s] ^~~~~~~~~~~~~~~~~~~~ [ 124s] cc1: some warnings being treated as errors [ 124s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 124s] make[4]: *** [handover_fsm.o] Error 1 [ 124s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 124s] Makefile:407: recipe for target 'all-recursive' failed [ 124s] make[3]: *** [all-recursive] Error 1 [ 124s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 124s] Makefile:441: recipe for target 'all-recursive' failed [ 124s] make[2]: *** [all-recursive] Error 1 [ 124s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 124s] Makefile:373: recipe for target 'all' failed [ 124s] make[1]: *** [all] Error 2 [ 124s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 124s] dh_auto_build: make -j1 returned exit code 2 [ 124s] debian/rules:45: recipe for target 'build' failed [ 124s] make: *** [build] Error 2 [ 124s] dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2 [ 124s] [ 124s] wildcard2 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:09:00 UTC 2018. [ 124s] [ 124s] ### VM INTERACTION START ### [ 127s] [ 110.609260] sysrq: SysRq : Power Off [ 127s] [ 110.614073] reboot: Power down [ 129s] ### VM INTERACTION END ### [ 129s] [ 129s] wildcard2 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 20:09:05 UTC 2018. [ 129s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Mon Jul 30 20:42:16 2018 From: gerrit-no-reply at lists.osmocom.org (Jan Hrach) Date: Mon, 30 Jul 2018 20:42:16 +0000 Subject: Change in osmo-tetra[master]: add traffic dumping patch, use getopt to parse arguments Message-ID: Jan Hrach has uploaded this change for review. ( https://gerrit.osmocom.org/10264 Change subject: add traffic dumping patch, use getopt to parse arguments ...................................................................... add traffic dumping patch, use getopt to parse arguments Enable the user to specify a directory, where contents of traffic channel will be saved. Together with this dump, a text file with SSIs of the engaged stations is saved too. Based on 0004-HACK-Quick-hack-to-save-the-speech-data-from-TCH.patch available at https://build.opensuse.org/package/view_file/home:mnhauke:sdr/osmo-tetra/0004-HACK-Quick-hack-to-save-the-speech-data-from-TCH.patch Change-Id: I94135753a76cadfa373167ffca18e89bee5bcff8 --- M src/lower_mac/tetra_lower_mac.c M src/tetra-rx.c M src/tetra_common.h M src/tetra_gsmtap.c M src/tetra_gsmtap.h M src/tetra_upper_mac.c 6 files changed, 84 insertions(+), 22 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-tetra refs/changes/64/10264/1 diff --git a/src/lower_mac/tetra_lower_mac.c b/src/lower_mac/tetra_lower_mac.c index 7b62bb4..81832bc 100644 --- a/src/lower_mac/tetra_lower_mac.c +++ b/src/lower_mac/tetra_lower_mac.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -184,6 +185,48 @@ DEBUGP("%s %s type4: %s\n", tbp->name, time_str, osmo_ubit_dump(type4, tbp->type345_bits)); + /* If this is a traffic channel, dump. */ + if ((type == TPSAP_T_SCH_F) && tms->cur_burst.is_traffic && tms->dumpdir) { + char fname[PATH_MAX]; + int16_t block[690]; + FILE *f; + int i; + + /* Open target file */ + snprintf(fname, sizeof(fname), "%s/traffic_%d_%d.out", tms->dumpdir, + tms->cur_burst.is_traffic, tms->tsn); + f = fopen(fname, "ab"); + + /* Generate a block */ + memset(block, 0x00, sizeof(int16_t) * 690); + for (i = 0; i < 6; i++) + block[115*i] = 0x6b21 + i; + + for (i = 0; i < 114; i++) + block[1+i] = type4[i] ? -127 : 127; + + for (i = 0; i < 114; i++) + block[116+i] = type4[114+i] ? -127 : 127; + + for (i = 0; i < 114; i++) + block[231+i] = type4[228+i] ? -127 : 127; + + for (i = 0; i < 90; i++) + block[346+i] = type4[342+i] ? -127 : 127; + + /* Write it */ + fwrite(block, sizeof(int16_t), 690, f); + + fclose(f); + + /* Write used ssi */ + snprintf(fname, sizeof(fname), "%s/traffic_%d_%d.txt", tms->dumpdir, + tms->cur_burst.is_traffic, tms->tsn); + f = fopen(fname, "a"); + fprintf(f, "%d\n", tms->ssi); + fclose(f); + } + if (tbp->interleave_a) { /* Run block deinterleaving: type-3 bits */ block_deinterleave(tbp->type345_bits, tbp->interleave_a, type4, type3); diff --git a/src/tetra-rx.c b/src/tetra-rx.c index c751772..ed4d252 100644 --- a/src/tetra-rx.c +++ b/src/tetra-rx.c @@ -39,28 +39,39 @@ int main(int argc, char **argv) { int fd; + int opt; struct tetra_rx_state *trs; struct tetra_mac_state *tms; - if (argc < 2) { - fprintf(stderr, "Usage: %s \n", argv[0]); - exit(1); - } - - fd = open(argv[1], O_RDONLY); - if (fd < 0) { - perror("open"); - exit(2); - } - - tetra_gsmtap_init("localhost", 0); - tms = talloc_zero(tetra_tall_ctx, struct tetra_mac_state); tetra_mac_state_init(tms); trs = talloc_zero(tetra_tall_ctx, struct tetra_rx_state); trs->burst_cb_priv = tms; + while ((opt = getopt(argc, argv, "d:")) != -1) { + switch (opt) { + case 'd': + tms->dumpdir = strdup(optarg); + break; + default: + fprintf(stderr, "Unknown option %c\n", opt); + } + } + + if (argc <= optind) { + fprintf(stderr, "Usage: %s [-d DUMPDIR] \n", argv[0]); + exit(1); + } + + fd = open(argv[optind], O_RDONLY); + if (fd < 0) { + perror("open"); + exit(2); + } + + tetra_gsmtap_init("localhost", 0); + while (1) { uint8_t buf[64]; int len; @@ -76,6 +87,7 @@ tetra_burst_sync_in(trs, buf, len); } + free(tms->dumpdir); talloc_free(trs); talloc_free(tms); diff --git a/src/tetra_common.h b/src/tetra_common.h index 3207c0d..d141e9b 100644 --- a/src/tetra_common.h +++ b/src/tetra_common.h @@ -47,7 +47,11 @@ struct { int is_traffic; } cur_burst; - struct tetra_si_decoded last_sid; + struct tetra_si_decoded last_sid; + + char *dumpdir; /* Where to save traffic channel dump */ + int ssi; /* SSI */ + int tsn; /* Timeslon number */ }; void tetra_mac_state_init(struct tetra_mac_state *tms); diff --git a/src/tetra_gsmtap.c b/src/tetra_gsmtap.c index f575c20..79b48a7 100644 --- a/src/tetra_gsmtap.c +++ b/src/tetra_gsmtap.c @@ -28,9 +28,9 @@ }; -struct msgb *tetra_gsmtap_makemsg(struct tetra_tdma_time *tm, enum tetra_log_chan lchan, - uint8_t ts, uint8_t ss, int8_t signal_dbm, - uint8_t snr, const ubit_t *bitdata, unsigned int bitlen) +struct msgb *tetra_gsmtap_makemsg(struct tetra_tdma_time *tm, enum tetra_log_chan lchan, uint8_t ts, uint8_t ss, + int8_t signal_dbm, uint8_t snr, const ubit_t *bitdata, unsigned int bitlen, + struct tetra_mac_state *tms) { struct msgb *msg; struct gsmtap_hdr *gh; @@ -47,6 +47,7 @@ gh->hdr_len = sizeof(*gh)/4; gh->type = GSMTAP_TYPE_TETRA_I1; gh->timeslot = ts; + tms->tsn = ts; gh->sub_slot = ss; gh->snr_db = snr; gh->signal_dbm = signal_dbm; diff --git a/src/tetra_gsmtap.h b/src/tetra_gsmtap.h index b62a4c5..34963d0 100644 --- a/src/tetra_gsmtap.h +++ b/src/tetra_gsmtap.h @@ -2,9 +2,9 @@ #define TETRA_GSMTAP_H #include "tetra_common.h" -struct msgb *tetra_gsmtap_makemsg(struct tetra_tdma_time *tm, enum tetra_log_chan lchan, - uint8_t ts, uint8_t ss, int8_t signal_dbm, - uint8_t snr, const uint8_t *data, unsigned int len); +struct msgb *tetra_gsmtap_makemsg(struct tetra_tdma_time *tm, enum tetra_log_chan lchan, uint8_t ts, uint8_t ss, + int8_t signal_dbm, uint8_t snr, const uint8_t *bitdata, unsigned int bitlen, + struct tetra_mac_state *tms); int tetra_gsmtap_sendmsg(struct msgb *msg); diff --git a/src/tetra_upper_mac.c b/src/tetra_upper_mac.c index fdc8c73..a4c7e59 100644 --- a/src/tetra_upper_mac.c +++ b/src/tetra_upper_mac.c @@ -181,6 +181,8 @@ rx_tm_sdu(tms, msg, len_bits); } + tms->ssi = rsd.addr.ssi; + out: printf("\n"); } @@ -241,7 +243,7 @@ /* save the state whether the current burst is traffic or not */ if (aad.dl_usage > 3) - tms->cur_burst.is_traffic = 1; + tms->cur_burst.is_traffic = aad.dl_usage; else tms->cur_burst.is_traffic = 0; @@ -276,7 +278,7 @@ gsmtap_msg = tetra_gsmtap_makemsg(&tup->tdma_time, tup->lchan, tup->tdma_time.tn, /* FIXME: */ 0, 0, 0, - msg->l1h, msgb_l1len(msg)); + msg->l1h, msgb_l1len(msg), tms); if (gsmtap_msg) tetra_gsmtap_sendmsg(gsmtap_msg); -- To view, visit https://gerrit.osmocom.org/10264 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-tetra Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I94135753a76cadfa373167ffca18e89bee5bcff8 Gerrit-Change-Number: 10264 Gerrit-PatchSet: 1 Gerrit-Owner: Jan Hrach -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 20:57:31 2018 From: gerrit-no-reply at lists.osmocom.org (Jan Hrach) Date: Mon, 30 Jul 2018 20:57:31 +0000 Subject: Change in osmo-tetra[master]: allow dumping GSMTAP to PCAP file Message-ID: Jan Hrach has uploaded this change for review. ( https://gerrit.osmocom.org/10265 Change subject: allow dumping GSMTAP to PCAP file ...................................................................... allow dumping GSMTAP to PCAP file When lots of packets are streamed to loopback, some of them get mixed up and lost. Add an option to write GSMTAP frames to a file (or a pipe for realtime processing). Also add an option to disable streaming them via network. Change-Id: I955589a1d576f180fc4b80dba8ed8dc364e43d8b --- A src/pcap.h M src/tetra-rx-tests.sh M src/tetra-rx.c M src/tetra_common.h M src/tetra_gsmtap.c M src/tetra_gsmtap.h 6 files changed, 132 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-tetra refs/changes/65/10265/1 diff --git a/src/pcap.h b/src/pcap.h new file mode 100644 index 0000000..f3efe07 --- /dev/null +++ b/src/pcap.h @@ -0,0 +1,51 @@ +#ifndef PCAP_H +#define PCAP_H +#include + +typedef uint32_t guint32; +typedef uint16_t guint16; +typedef int32_t gint32; + +typedef struct __attribute__ ((__packed__)) pcap_hdr_s { + guint32 magic_number; /* magic number */ + guint16 version_major; /* major version number */ + guint16 version_minor; /* minor version number */ + gint32 thiszone; /* GMT to local correction */ + guint32 sigfigs; /* accuracy of timestamps */ + guint32 snaplen; /* max length of captured packets, in octets */ + guint32 network; /* data link type */ +} pcap_hdr_t; + +typedef struct __attribute__ ((__packed__)) pcaprec_hdr_s { + guint32 ts_sec; /* timestamp seconds */ + guint32 ts_usec; /* timestamp microseconds */ + guint32 incl_len; /* number of octets of packet saved in file */ + guint32 orig_len; /* actual length of packet */ +} pcaprec_hdr_t; + +#define PCAP_MAGIC 0xa1b2c3d4 +#define PCAP_MAJOR 2 +#define PCAP_MINOR 4 +#define PCAP_SNAPLEN 65535 +#define PCAP_ETHERNET 1 + +unsigned char fake_frame_header[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Ethernet frame, dst and src MAC + 0x08, 0x00, // EtherType 0800 = IPv4 + 0x45, // IPv4 (0x4_), 20B header (0x_5) + 0x00, // no diffserv + 0x00, 0xff, // length + 0xc6, 0xd1, // some random frag + 0x40, 0x00, // don't frag + 0x3f, // TTL + 0x11, // IP proto = UDP + 0x00, 0x00, // checksum + 0x7f, 0x00, 0x00, 0x01, // src = 127.0.0.1 + 0x7f, 0x00, 0x00, 0x01, // dst = 127.0.0.1 + 0xbb, 0x13, // source port + 0x12, 0x79, // dst port = 4729 + 0x00, 0xeb, // length = iplen-20 + 0x00, 0x00 // checksum +}; +#endif + diff --git a/src/tetra-rx-tests.sh b/src/tetra-rx-tests.sh index f84a1ad..d841f0c 100755 --- a/src/tetra-rx-tests.sh +++ b/src/tetra-rx-tests.sh @@ -53,7 +53,7 @@ tmpdir=`mktemp -d /tmp/tetraXXX` for f in $@; do - corrects=`"time" -o "$tmpdir/time" ./tetra-rx "$f" $t 2>/dev/null | grep -E "^CRC COMP: 0x.+ OK" | wc -l` + corrects=`"time" -o "$tmpdir/time" ./tetra-rx -n "$f" $t 2>/dev/null | grep -E "^CRC COMP: 0x.+ OK" | wc -l` tt=`grep user "$tmpdir/time" | head -n 1 | cut -d u -f 1` echo "$f: $corrects frames, $tt s" hash=`sha256sum "$f" | cut -c 1-20` diff --git a/src/tetra-rx.c b/src/tetra-rx.c index ed4d252..8498f8c 100644 --- a/src/tetra-rx.c +++ b/src/tetra-rx.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -43,24 +44,42 @@ struct tetra_rx_state *trs; struct tetra_mac_state *tms; + char *pcap_file_path = NULL; + bool no_udp_tap = false; + bool err = false; + tms = talloc_zero(tetra_tall_ctx, struct tetra_mac_state); tetra_mac_state_init(tms); trs = talloc_zero(tetra_tall_ctx, struct tetra_rx_state); trs->burst_cb_priv = tms; - while ((opt = getopt(argc, argv, "d:")) != -1) { + while ((opt = getopt(argc, argv, "a:t:d:n")) != -1) { switch (opt) { + case 'a': + tms->arfcn = atoi(optarg); + break; + case 't': + pcap_file_path = strdup(optarg); + break; case 'd': tms->dumpdir = strdup(optarg); break; + case 'n': + no_udp_tap = 1; + break; default: fprintf(stderr, "Unknown option %c\n", opt); + err = true; } } - if (argc <= optind) { - fprintf(stderr, "Usage: %s [-d DUMPDIR] \n", argv[0]); + if (argc <= optind || err) { + fprintf(stderr, "Usage: %s [params] \n", argv[0]); + fprintf(stderr, " -a arfcn .. set ARFCN used in GSMTAP\n"); + fprintf(stderr, " -t filename .. output PCAP to file\n"); + fprintf(stderr, " -d directory .. dump traffic channel to directory\n"); + fprintf(stderr, " -n .. disable GSMTAP over UDP\n"); exit(1); } @@ -70,7 +89,11 @@ exit(2); } - tetra_gsmtap_init("localhost", 0); + if (!no_udp_tap) + tetra_gsmtap_init_network("localhost", 0); + + if (pcap_file_path) + tetra_gsmtap_init_file(pcap_file_path); while (1) { uint8_t buf[64]; diff --git a/src/tetra_common.h b/src/tetra_common.h index d141e9b..a270a26 100644 --- a/src/tetra_common.h +++ b/src/tetra_common.h @@ -52,6 +52,7 @@ char *dumpdir; /* Where to save traffic channel dump */ int ssi; /* SSI */ int tsn; /* Timeslon number */ + int arfcn; }; void tetra_mac_state_init(struct tetra_mac_state *tms); diff --git a/src/tetra_gsmtap.c b/src/tetra_gsmtap.c index 79b48a7..b656ff6 100644 --- a/src/tetra_gsmtap.c +++ b/src/tetra_gsmtap.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include @@ -13,6 +14,9 @@ #include "tetra_common.h" #include "tetra_tdma.h" +#include "pcap.h" + +static FILE * pcap_file; static struct gsmtap_inst *g_gti = NULL; @@ -62,15 +66,38 @@ return msg; } +static void pcap_file_write(void *buf, size_t n) +{ + if (pcap_file) { + fwrite(buf, n, 1, pcap_file); + fflush(pcap_file); + } +} + int tetra_gsmtap_sendmsg(struct msgb *msg) { + pcaprec_hdr_t hdr = {0}; + + struct timespec now; + + clock_gettime(CLOCK_REALTIME, &now); + + hdr.ts_sec = now.tv_sec; + hdr.ts_usec = now.tv_nsec/1000; + hdr.incl_len = msg->len + sizeof(fake_frame_header); + hdr.orig_len = hdr.incl_len; + + pcap_file_write(&hdr, sizeof(hdr)); + pcap_file_write(&fake_frame_header, sizeof(fake_frame_header)); + pcap_file_write(msg->data, msg->len); + if (g_gti) return gsmtap_sendmsg(g_gti, msg); else return 0; } -int tetra_gsmtap_init(const char *host, uint16_t port) +int tetra_gsmtap_init_network(const char *host, uint16_t port) { g_gti = gsmtap_source_init(host, port, 0); if (!g_gti) @@ -79,3 +106,25 @@ return 0; } + +int tetra_gsmtap_init_file(const char *filename) +{ + pcap_hdr_t hdr; + + memset(&hdr, 0, sizeof(hdr)); + + hdr.magic_number = PCAP_MAGIC; + hdr.version_major = PCAP_MAJOR; + hdr.version_minor = PCAP_MINOR; + hdr.snaplen = PCAP_SNAPLEN; + hdr.network = PCAP_ETHERNET; + + pcap_file = fopen(filename, "wb"); + if (!pcap_file) { + perror("pcap file open"); + exit(1); + } + pcap_file_write(&hdr, sizeof(pcap_hdr_t)); + + return 0; +} diff --git a/src/tetra_gsmtap.h b/src/tetra_gsmtap.h index 34963d0..6f77240 100644 --- a/src/tetra_gsmtap.h +++ b/src/tetra_gsmtap.h @@ -8,6 +8,7 @@ int tetra_gsmtap_sendmsg(struct msgb *msg); -int tetra_gsmtap_init(const char *host, uint16_t port); +int tetra_gsmtap_init_network(const char *host, uint16_t port); +int tetra_gsmtap_init_file(const char *filename); #endif -- To view, visit https://gerrit.osmocom.org/10265 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-tetra Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I955589a1d576f180fc4b80dba8ed8dc364e43d8b Gerrit-Change-Number: 10265 Gerrit-PatchSet: 1 Gerrit-Owner: Jan Hrach -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 21:06:54 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 30 Jul 2018 21:06:54 +0000 Subject: Change in osmo-hlr[master]: hlr_ussd.h: add #pragma once include guard Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/10266 Change subject: hlr_ussd.h: add #pragma once include guard ...................................................................... hlr_ussd.h: add #pragma once include guard Change-Id: Iba9470e11af2f2609486b9b0b6bfa3207b883a3a --- M src/hlr_ussd.h 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/66/10266/1 diff --git a/src/hlr_ussd.h b/src/hlr_ussd.h index d1b9fe0..67e5d0d 100644 --- a/src/hlr_ussd.h +++ b/src/hlr_ussd.h @@ -1,3 +1,5 @@ +#pragma once + #include #include #include -- To view, visit https://gerrit.osmocom.org/10266 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iba9470e11af2f2609486b9b0b6bfa3207b883a3a Gerrit-Change-Number: 10266 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 21:06:54 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 30 Jul 2018 21:06:54 +0000 Subject: Change in osmo-hlr[master]: hlr_ussd.h: use proper libc headers Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/10267 Change subject: hlr_ussd.h: use proper libc headers ...................................................................... hlr_ussd.h: use proper libc headers Change-Id: I2b9485be08c6cbf188ed1f4059ff28ab65c61dbf --- M src/hlr_ussd.h 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/67/10267/1 diff --git a/src/hlr_ussd.h b/src/hlr_ussd.h index 67e5d0d..a190dc6 100644 --- a/src/hlr_ussd.h +++ b/src/hlr_ussd.h @@ -1,6 +1,7 @@ #pragma once -#include +#include + #include #include #include "gsup_server.h" -- To view, visit https://gerrit.osmocom.org/10267 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I2b9485be08c6cbf188ed1f4059ff28ab65c61dbf Gerrit-Change-Number: 10267 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 21:06:55 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 30 Jul 2018 21:06:55 +0000 Subject: Change in osmo-hlr[master]: hlr_ussd.h: drop meaningless forward declaration Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/10268 Change subject: hlr_ussd.h: drop meaningless forward declaration ...................................................................... hlr_ussd.h: drop meaningless forward declaration Change-Id: I70a5c7c83c2356b779fb1ea7ffe07ccc1e279c22 --- M src/hlr_ussd.h 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/68/10268/1 diff --git a/src/hlr_ussd.h b/src/hlr_ussd.h index a190dc6..0414924 100644 --- a/src/hlr_ussd.h +++ b/src/hlr_ussd.h @@ -4,9 +4,8 @@ #include #include -#include "gsup_server.h" -struct osmo_gsup_conn; +#include "gsup_server.h" struct hlr_ussd_route { /* g_hlr.routes */ -- To view, visit https://gerrit.osmocom.org/10268 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I70a5c7c83c2356b779fb1ea7ffe07ccc1e279c22 Gerrit-Change-Number: 10268 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 21:06:55 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 30 Jul 2018 21:06:55 +0000 Subject: Change in osmo-hlr[master]: Update .gitignore: ignore osmo-euse-demo Message-ID: Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/10269 Change subject: Update .gitignore: ignore osmo-euse-demo ...................................................................... Update .gitignore: ignore osmo-euse-demo Change-Id: I1e2fb003d507a00f9255e021dd8956269f0657ee --- M .gitignore 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/69/10269/1 diff --git a/.gitignore b/.gitignore index baaaeb6..0fd74be 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,7 @@ src/db_bootstrap.h src/osmo-hlr src/osmo-hlr-db-tool +src/osmo-euse-demo src/gsupclient/gsup-test-client tests/atconfig -- To view, visit https://gerrit.osmocom.org/10269 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I1e2fb003d507a00f9255e021dd8956269f0657ee Gerrit-Change-Number: 10269 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 21:22:33 2018 From: gerrit-no-reply at lists.osmocom.org (Jan Hrach) Date: Mon, 30 Jul 2018 21:22:33 +0000 Subject: Change in osmo-tetra[master]: update scrambling only if we have good CRC Message-ID: Jan Hrach has uploaded this change for review. ( https://gerrit.osmocom.org/10270 Change subject: update scrambling only if we have good CRC ...................................................................... update scrambling only if we have good CRC When a bad frame is received, the scrambling should not be updated, because setting scrambling to wrong values will completely break further decoding (until another SYNC frame is received). Change-Id: I5e88b52fcbb98532d7ab6ca85e4f956589a595ab --- M src/lower_mac/tetra_lower_mac.c 1 file changed, 10 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-tetra refs/changes/70/10270/1 diff --git a/src/lower_mac/tetra_lower_mac.c b/src/lower_mac/tetra_lower_mac.c index 81832bc..d6f9e41 100644 --- a/src/lower_mac/tetra_lower_mac.c +++ b/src/lower_mac/tetra_lower_mac.c @@ -272,14 +272,16 @@ printf("MCC %s(%u) ", osmo_ubit_dump(type2+31, 10), bits_to_uint(type2+31, 10)); printf("MNC %s(%u)\n", osmo_ubit_dump(type2+41, 14), bits_to_uint(type2+41, 14)); /* obtain information from SYNC PDU */ - tcd->colour_code = bits_to_uint(type2+4, 6); - tcd->time.tn = bits_to_uint(type2+10, 2); - tcd->time.fn = bits_to_uint(type2+12, 5); - tcd->time.mn = bits_to_uint(type2+17, 6); - tcd->mcc = bits_to_uint(type2+31, 10); - tcd->mnc = bits_to_uint(type2+41, 14); - /* compute the scrambling code for the current cell */ - tcd->scramb_init = tetra_scramb_get_init(tcd->mcc, tcd->mnc, tcd->colour_code); + if (tup->crc_ok) { + tcd->colour_code = bits_to_uint(type2+4, 6); + tcd->time.tn = bits_to_uint(type2+10, 2); + tcd->time.fn = bits_to_uint(type2+12, 5); + tcd->time.mn = bits_to_uint(type2+17, 6); + tcd->mcc = bits_to_uint(type2+31, 10); + tcd->mnc = bits_to_uint(type2+41, 14); + /* compute the scrambling code for the current cell */ + tcd->scramb_init = tetra_scramb_get_init(tcd->mcc, tcd->mnc, tcd->colour_code); + } /* update the PHY layer time */ memcpy(&t_phy_state.time, &tcd->time, sizeof(t_phy_state.time)); tup->lchan = TETRA_LC_BSCH; -- To view, visit https://gerrit.osmocom.org/10270 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-tetra Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I5e88b52fcbb98532d7ab6ca85e4f956589a595ab Gerrit-Change-Number: 10270 Gerrit-PatchSet: 1 Gerrit-Owner: Jan Hrach -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Mon Jul 30 21:29:23 2018 From: gerrit-no-reply at lists.osmocom.org (Jan Hrach) Date: Mon, 30 Jul 2018 21:29:23 +0000 Subject: Change in osmo-tetra[master]: simplify and speed up the burst synchronizer Message-ID: Jan Hrach has uploaded this change for review. ( https://gerrit.osmocom.org/10271 Change subject: simplify and speed up the burst synchronizer ...................................................................... simplify and speed up the burst synchronizer Rewrite the burst synchronizer so we simply jump to the next training sequence. I believe the state machine is not needed, the only reason for it - speeding up search for the next frame - has been fixed in ca6a3bc. Simplifying the synchronizer allows it to be easily extended to support uplink and direct modes. Additionally, we process the entire buffer at once (the previous version used 64-byte chunks), so the overhead is much smaller (up to 20 times on sparse channels). Change-Id: I74a13ced4c11b6d98afa7916c1f4109875c20101 --- M src/phy/tetra_burst_sync.c M src/phy/tetra_burst_sync.h M src/tetra-rx.c M src/tetra_common.h 4 files changed, 65 insertions(+), 94 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-tetra refs/changes/71/10271/1 diff --git a/src/phy/tetra_burst_sync.c b/src/phy/tetra_burst_sync.c index ae210dc..f3b759f 100644 --- a/src/phy/tetra_burst_sync.c +++ b/src/phy/tetra_burst_sync.c @@ -21,6 +21,7 @@ #include #include #include +#include #include @@ -35,7 +36,7 @@ void tetra_burst_rx_cb(const uint8_t *burst, unsigned int len, enum tetra_train_seq type, void *priv); -static void make_bitbuf_space(struct tetra_rx_state *trs, unsigned int len) +static unsigned int make_bitbuf_space(struct tetra_rx_state *trs, unsigned int len) { unsigned int bitbuf_space = sizeof(trs->bitbuf) - trs->bits_in_buf; @@ -48,9 +49,20 @@ trs->bitbuf_start_bitnum += delta; bitbuf_space = sizeof(trs->bitbuf) - trs->bits_in_buf; } + return bitbuf_space; } -/* input a raw bitstream into the tetra burst synchronizaer */ +static unsigned int conserve_bits(struct tetra_rx_state *trs, unsigned int howmany) +{ + assert(howmany < sizeof(trs->bitbuf)); + return make_bitbuf_space(trs, sizeof(trs->bitbuf) - howmany); +} + +/* input a raw bitstream into the tetra burst synchronizer + * returns the number which in absolute value is the number of bits + * we can safely consume the next time + * if the result is negative, we are done with processing + */ int tetra_burst_sync_in(struct tetra_rx_state *trs, uint8_t *bits, unsigned int len) { int rc; @@ -63,92 +75,35 @@ memcpy(trs->bitbuf + trs->bits_in_buf, bits, len); trs->bits_in_buf += len; - switch (trs->state) { - case RX_S_UNLOCKED: - if (trs->bits_in_buf < TETRA_BITS_PER_TS*2) { - /* wait for more bits to arrive */ - DEBUGP("-> waiting for more bits to arrive\n"); - return len; - } - DEBUGP("-> trying to find training sequence between bit %u and %u\n", - trs->bitbuf_start_bitnum, trs->bits_in_buf); - rc = tetra_find_train_seq(trs->bitbuf, trs->bits_in_buf, - (1 << TETRA_TRAIN_SYNC), &train_seq_offs); - if (rc < 0) - return rc; - printf("found SYNC training sequence in bit #%u\n", train_seq_offs); - trs->state = RX_S_KNOW_FSTART; - trs->next_frame_start_bitnum = trs->bitbuf_start_bitnum + train_seq_offs + 296; -#if 0 - if (train_seq_offs < 214) { - /* not enough leading bits for start of burst */ - /* we just drop everything that we received so far */ - trs->bitbuf_start_bitnum += trs->bits_in_buf; - trs->bits_in_buf = 0; - } -#endif + rc = tetra_find_train_seq(trs->bitbuf+214, trs->bits_in_buf, + (1 << TETRA_TRAIN_NORM_1)| + (1 << TETRA_TRAIN_NORM_2)| + (1 << TETRA_TRAIN_SYNC), &train_seq_offs); + train_seq_offs += 214; + + if ((rc < 0) || (train_seq_offs + TETRA_BITS_PER_TS > trs->bits_in_buf)) + return -conserve_bits(trs, 2*TETRA_BITS_PER_TS); + + tetra_tdma_time_add_tn(&t_phy_state.time, 1); + printf("\nBURST @ %u", trs->bitbuf_start_bitnum+train_seq_offs); + DEBUGP(": %s", osmo_ubit_dump(trs->bitbuf, TETRA_BITS_PER_TS)); + printf("\n"); + + switch (rc) { + case TETRA_TRAIN_SYNC: + if (train_seq_offs >= 214) + tetra_burst_rx_cb(trs->bitbuf+train_seq_offs-214, TETRA_BITS_PER_TS, rc, trs->burst_cb_priv); break; - case RX_S_KNOW_FSTART: - /* we are locked, i.e. already know when the next frame should start */ - if (trs->bitbuf_start_bitnum + trs->bits_in_buf < trs->next_frame_start_bitnum) - return 0; - else { - /* shift start of frame to start of bitbuf */ - int offset = trs->next_frame_start_bitnum - trs->bitbuf_start_bitnum; - int bits_remaining = trs->bits_in_buf - offset; - - memmove(trs->bitbuf, trs->bitbuf+offset, bits_remaining); - trs->bits_in_buf = bits_remaining; - trs->bitbuf_start_bitnum += offset; - - trs->next_frame_start_bitnum += TETRA_BITS_PER_TS; - trs->state = RX_S_LOCKED; - } - case RX_S_LOCKED: - if (trs->bits_in_buf < TETRA_BITS_PER_TS) { - /* not sufficient data for the full frame yet */ - return len; - } else { - /* we have successfully received (at least) one frame */ - tetra_tdma_time_add_tn(&t_phy_state.time, 1); - printf("\nBURST"); - DEBUGP(": %s", osmo_ubit_dump(trs->bitbuf, TETRA_BITS_PER_TS)); - printf("\n"); - rc = tetra_find_train_seq(trs->bitbuf, trs->bits_in_buf, - (1 << TETRA_TRAIN_NORM_1)| - (1 << TETRA_TRAIN_NORM_2)| - (1 << TETRA_TRAIN_SYNC), &train_seq_offs); - switch (rc) { - case TETRA_TRAIN_SYNC: - if (train_seq_offs == 214) - tetra_burst_rx_cb(trs->bitbuf, TETRA_BITS_PER_TS, rc, trs->burst_cb_priv); - else { - fprintf(stderr, "#### SYNC burst at offset %u?!?\n", train_seq_offs); - trs->state = RX_S_UNLOCKED; - } - break; - case TETRA_TRAIN_NORM_1: - case TETRA_TRAIN_NORM_2: - case TETRA_TRAIN_NORM_3: - if (train_seq_offs == 244) - tetra_burst_rx_cb(trs->bitbuf, TETRA_BITS_PER_TS, rc, trs->burst_cb_priv); - else - fprintf(stderr, "#### SYNC burst at offset %u?!?\n", train_seq_offs); - break; - default: - fprintf(stderr, "#### could not find successive burst training sequence\n"); - trs->state = RX_S_UNLOCKED; - break; - } - - /* move remainder to start of buffer */ - trs->bits_in_buf -= TETRA_BITS_PER_TS; - memmove(trs->bitbuf, trs->bitbuf+TETRA_BITS_PER_TS, trs->bits_in_buf); - trs->bitbuf_start_bitnum += TETRA_BITS_PER_TS; - trs->next_frame_start_bitnum += TETRA_BITS_PER_TS; - } + case TETRA_TRAIN_NORM_1: + case TETRA_TRAIN_NORM_2: + case TETRA_TRAIN_NORM_3: + if (train_seq_offs >= 244) + tetra_burst_rx_cb(trs->bitbuf+train_seq_offs-244, TETRA_BITS_PER_TS, rc, trs->burst_cb_priv); break; - + default: + fprintf(stderr, "#### unsupported burst training sequence\n"); + break; } - return len; + return train_seq_offs+1; + } diff --git a/src/phy/tetra_burst_sync.h b/src/phy/tetra_burst_sync.h index 7862461..4ec8b53 100644 --- a/src/phy/tetra_burst_sync.h +++ b/src/phy/tetra_burst_sync.h @@ -3,6 +3,8 @@ #include +#define BUFSIZE 4096 + enum rx_state { RX_S_UNLOCKED, /* we're completely unlocked */ RX_S_KNOW_FSTART, /* we know the next frame start */ @@ -12,7 +14,7 @@ struct tetra_rx_state { enum rx_state state; unsigned int bits_in_buf; /* how many bits are currently in bitbuf */ - uint8_t bitbuf[4096]; + uint8_t bitbuf[BUFSIZE]; unsigned int bitbuf_start_bitnum; /* bit number at first element in bitbuf */ unsigned int next_frame_start_bitnum; /* frame start expected at this bitnum */ diff --git a/src/tetra-rx.c b/src/tetra-rx.c index 8498f8c..78bdfea 100644 --- a/src/tetra-rx.c +++ b/src/tetra-rx.c @@ -95,19 +95,29 @@ if (pcap_file_path) tetra_gsmtap_init_file(pcap_file_path); - while (1) { - uint8_t buf[64]; - int len; + int to_consume = BUFSIZE; + uint8_t buf[BUFSIZE]; - len = read(fd, buf, sizeof(buf)); + while (1) { + int len, rlen; + + len = read(fd, buf, to_consume); if (len < 0) { perror("read"); exit(1); - } else if (len == 0) { + } + rlen = len; + if (len == 0) { + memset(buf, 0, BUFSIZE); + rlen = to_consume; + } + int rc = tetra_burst_sync_in(trs, buf, rlen); + + if (len == 0 && rc <= 0) { printf("EOF"); break; } - tetra_burst_sync_in(trs, buf, len); + to_consume = MIN(abs(rc), BUFSIZE); } free(tms->dumpdir); diff --git a/src/tetra_common.h b/src/tetra_common.h index a270a26..c63e6ca 100644 --- a/src/tetra_common.h +++ b/src/tetra_common.h @@ -11,6 +11,10 @@ #define DEBUGP(x, args...) do { } while(0) #endif +#define MIN(a, b) (((a) < (b))?(a):(b)) +#define MAX(a, b) (((a) > (b))?(a):(b)) +#define CLAMP(x, lower, upper) (MIN(upper, MAX(x, lower))) + #define TETRA_SYM_PER_TS 255 #define TETRA_BITS_PER_TS (TETRA_SYM_PER_TS*2) -- To view, visit https://gerrit.osmocom.org/10271 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-tetra Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I74a13ced4c11b6d98afa7916c1f4109875c20101 Gerrit-Change-Number: 10271 Gerrit-PatchSet: 1 Gerrit-Owner: Jan Hrach -------------- next part -------------- An HTML attachment was scrubbed... URL: From admin at opensuse.org Mon Jul 30 21:58:05 2018 From: admin at opensuse.org (OBS Notification) Date: Mon, 30 Jul 2018 21:58:05 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_9.0/armv7l In-Reply-To: References: Message-ID: <5b5f8a09cbe5a_68b3107a6885948b@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_9.0/armv7l Package network:osmocom:nightly/osmo-bsc failed to build in Debian_9.0/armv7l Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 131s] gsm0808_cell_id_name(&req->cell_id_target)); [ 131s] ^~~~~~~~~~~~~~~~~~~~ [ 133s] cc1: some warnings being treated as errors [ 133s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 133s] make[4]: *** [handover_fsm.o] Error 1 [ 133s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 133s] Makefile:407: recipe for target 'all-recursive' failed [ 133s] make[3]: *** [all-recursive] Error 1 [ 133s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 133s] Makefile:441: recipe for target 'all-recursive' failed [ 133s] make[2]: *** [all-recursive] Error 1 [ 133s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 133s] Makefile:373: recipe for target 'all' failed [ 133s] make[1]: *** [all] Error 2 [ 133s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 133s] dh_auto_build: make -j1 returned exit code 2 [ 133s] debian/rules:45: recipe for target 'build' failed [ 133s] make: *** [build] Error 2 [ 133s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 133s] [ 133s] armbuild21 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 21:57:50 UTC 2018. [ 133s] [ 133s] ### VM INTERACTION START ### [ 136s] [ 125.150448] SysRq : Power Off [ 136s] [ 125.151645] reboot: Power down [ 136s] ### VM INTERACTION END ### [ 136s] [ 136s] armbuild21 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Mon Jul 30 21:57:53 UTC 2018. [ 136s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From jenkins at lists.osmocom.org Tue Jul 31 00:05:47 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Tue, 31 Jul 2018 00:05:47 +0000 (UTC) Subject: =?UTF-8?Q?Build_failed_in_Jenkins:_master-osmo-sgsn_=C2=BB_--enable-?= =?UTF-8?Q?iu,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#4603?= Message-ID: <23054054.12.1532995547297.JavaMail.jenkins@jenkins.osmocom.org> See ------------------------------------------ [...truncated 188.57 KB...] libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `.'. libtoolize: copying file `./ltmain.sh' libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'. libtoolize: copying file `m4/libtool.m4' libtoolize: copying file `m4/ltoptions.m4' libtoolize: copying file `m4/ltsugar.m4' libtoolize: copying file `m4/ltversion.m4' libtoolize: copying file `m4/lt~obsolete.m4' configure.ac:20: installing './compile' configure.ac:22: installing './config.guess' configure.ac:22: installing './config.sub' configure.ac:8: installing './install-sh' configure.ac:8: installing './missing' examples/Makefile.am: installing './depcomp' + ./configure --prefix=/build/deps/install/stow/libosmo-netif checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking whether make supports nested variables... (cached) yes checking whether make sets $(MAKE)... (cached) yes checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking whether gcc understands -c and -o together... yes checking for style of include used by make... GNU checking dependency style of gcc... gcc3 checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking how to print strings... printf checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for fgrep... /bin/grep -F checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B checking the name lister (/usr/bin/nm -B) interface... BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 1572864 checking whether the shell understands some XSI constructs... yes checking whether the shell understands "+="... yes checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop checking for /usr/bin/ld option to reload object files... -r checking for objdump... objdump checking how to recognize dependent libraries... pass_all checking for dlltool... no checking how to associate runtime and link libraries... printf %s\n checking for ar... ar checking for archiver @FILE support... @ checking for strip... strip checking for ranlib... ranlib checking command to parse /usr/bin/nm -B output from gcc object... ok checking for sysroot... no checking for mt... mt checking if mt is a manifest tool... no checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking for objdir... .libs checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC -DPIC checking if gcc PIC flag -fPIC -DPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.o... (cached) yes checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes checking for pkg-config... /usr/bin/pkg-config checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.20... yes checking for ANSI C header files... (cached) yes checking execinfo.h usability... yes checking execinfo.h presence... yes checking for execinfo.h... yes checking sys/select.h usability... yes checking sys/select.h presence... yes checking for sys/select.h... yes checking sys/socket.h usability... yes checking sys/socket.h presence... yes checking for sys/socket.h... yes checking syslog.h usability... yes checking syslog.h presence... yes checking for syslog.h... yes checking ctype.h usability... yes checking ctype.h presence... yes checking for ctype.h... yes checking if gcc supports -fvisibility=hidden... yes checking for LIBOSMOCORE... yes checking for LIBOSMOGSM... yes checking for LIBOSMOABIS... yes checking for library containing sctp_send... -lsctp checking dahdi/user.h usability... no checking dahdi/user.h presence... no checking for dahdi/user.h... no configure: WARNING: DAHDI input driver will not be built checking pcap.h usability... yes checking pcap.h presence... yes checking for pcap.h... yes checking for doxygen... /usr/bin/doxygen checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating libosmo-netif.pc config.status: creating include/Makefile config.status: creating include/osmocom/Makefile config.status: creating include/osmocom/netif/Makefile config.status: creating src/Makefile config.status: creating examples/Makefile config.status: creating tests/Makefile config.status: creating Doxyfile config.status: creating Makefile config.status: creating config.h config.status: executing tests/atconfig commands config.status: executing depfiles commands config.status: executing libtool commands + make -j 8 install echo 0.3.0.1-d5a3 > .version-t && mv .version-t .version make install-recursive make[1]: Entering directory '/build/deps/libosmo-netif' Making install in include make[2]: Entering directory '/build/deps/libosmo-netif/include' Making install in osmocom make[3]: Entering directory '/build/deps/libosmo-netif/include/osmocom' Making install in netif make[4]: Entering directory '/build/deps/libosmo-netif/include/osmocom/netif' make[5]: Entering directory '/build/deps/libosmo-netif/include/osmocom/netif' make[5]: Nothing to be done for 'install-exec-am'. /bin/mkdir -p '/build/deps/install/stow/libosmo-netif/include/osmocom/netif' /usr/bin/install -c -m 644 amr.h datagram.h jibuf.h osmux.h ipa.h ipa_unit.h rs232.h rtp.h stream.h '/build/deps/install/stow/libosmo-netif/include/osmocom/netif' make[5]: Leaving directory '/build/deps/libosmo-netif/include/osmocom/netif' make[4]: Leaving directory '/build/deps/libosmo-netif/include/osmocom/netif' make[4]: Entering directory '/build/deps/libosmo-netif/include/osmocom' make[5]: Entering directory '/build/deps/libosmo-netif/include/osmocom' make[5]: Nothing to be done for 'install-exec-am'. make[5]: Nothing to be done for 'install-data-am'. make[5]: Leaving directory '/build/deps/libosmo-netif/include/osmocom' make[4]: Leaving directory '/build/deps/libosmo-netif/include/osmocom' make[3]: Leaving directory '/build/deps/libosmo-netif/include/osmocom' make[3]: Entering directory '/build/deps/libosmo-netif/include' make[4]: Entering directory '/build/deps/libosmo-netif/include' make[4]: Nothing to be done for 'install-exec-am'. make[4]: Nothing to be done for 'install-data-am'. make[4]: Leaving directory '/build/deps/libosmo-netif/include' make[3]: Leaving directory '/build/deps/libosmo-netif/include' make[2]: Leaving directory '/build/deps/libosmo-netif/include' Making install in src make[2]: Entering directory '/build/deps/libosmo-netif/src' CC amr.lo CC datagram.lo CC ipa.lo CC ipa_unit.lo CC jibuf.lo CC osmux.lo CC rs232.lo CC rtp.lo CC stream.lo CCLD libosmonetif.la make[3]: Entering directory '/build/deps/libosmo-netif/src' make[3]: Nothing to be done for 'install-data-am'. /bin/mkdir -p '/build/deps/install/stow/libosmo-netif/lib' /bin/bash ../libtool --mode=install /usr/bin/install -c libosmonetif.la '/build/deps/install/stow/libosmo-netif/lib' libtool: install: /usr/bin/install -c .libs/libosmonetif.so.6.0.0 /build/deps/install/stow/libosmo-netif/lib/libosmonetif.so.6.0.0 libtool: install: (cd /build/deps/install/stow/libosmo-netif/lib && { ln -s -f libosmonetif.so.6.0.0 libosmonetif.so.6 || { rm -f libosmonetif.so.6 && ln -s libosmonetif.so.6.0.0 libosmonetif.so.6; }; }) libtool: install: (cd /build/deps/install/stow/libosmo-netif/lib && { ln -s -f libosmonetif.so.6.0.0 libosmonetif.so || { rm -f libosmonetif.so && ln -s libosmonetif.so.6.0.0 libosmonetif.so; }; }) libtool: install: /usr/bin/install -c .libs/libosmonetif.lai /build/deps/install/stow/libosmo-netif/lib/libosmonetif.la libtool: install: /usr/bin/install -c .libs/libosmonetif.a /build/deps/install/stow/libosmo-netif/lib/libosmonetif.a libtool: install: chmod 644 /build/deps/install/stow/libosmo-netif/lib/libosmonetif.a libtool: install: ranlib /build/deps/install/stow/libosmo-netif/lib/libosmonetif.a libtool: finish: PATH="/usr/local/bin:/usr/bin:/bin:/usr/games:/home/osmocom-build/bin:/build_bin:/sbin" ldconfig -n /build/deps/install/stow/libosmo-netif/lib ---------------------------------------------------------------------- Libraries have been installed in: /build/deps/install/stow/libosmo-netif/lib If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the `-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the `LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the `LD_RUN_PATH' environment variable during linking - use the `-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to `/etc/ld.so.conf' See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- make[3]: Leaving directory '/build/deps/libosmo-netif/src' make[2]: Leaving directory '/build/deps/libosmo-netif/src' Making install in examples make[2]: Entering directory '/build/deps/libosmo-netif/examples' CC ipa-stream-client.o CC stream-client.o CC lapd-over-datagram-network.o CC ipa-stream-server.o CC lapd-over-datagram-user.o CC rs232-read.o CC rs232-write.o CC stream-server.o CC rtp-udp-test-client.o CC rtp-udp-test-server.o CC udp-test-client.o CC udp-test-server.o CC osmux-test-input.o CC osmux-test-output.o CCLD ipa-stream-client CCLD ipa-stream-server CCLD lapd-over-datagram-user CCLD lapd-over-datagram-network CCLD stream-client CCLD stream-server CCLD rs232-read CCLD rs232-write /bin/bash: line 1: 14825 Illegal instruction (core dumped) /bin/bash ../libtool --silent --tag=CC --mode=link gcc -Wall -g -I/build/deps/install/stow/libosmocore/include/ -I/build/deps/install/stow/libosmocore/include/ -I/build/deps/install/stow/libosmo-abis/include/ -g -O2 -Wall -o stream-server stream-server.o ../src/libosmonetif.la -L/build/deps/install/stow/libosmocore/lib -ltalloc -losmocore -L/build/deps/install/stow/libosmocore/lib -ltalloc -losmogsm -losmocore Makefile:523: recipe for target 'stream-server' failed make[2]: *** [stream-server] Error 132 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory '/build/deps/libosmo-netif/examples' Makefile:483: recipe for target 'install-recursive' failed make[1]: Leaving directory '/build/deps/libosmo-netif' make[1]: *** [install-recursive] Error 1 Makefile:782: recipe for target 'install' failed make: *** [install] Error 2 Build step 'Execute shell' marked build as failure [WARNINGS]Skipping publisher since build result is FAILURE From jenkins at lists.osmocom.org Tue Jul 31 00:12:24 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Tue, 31 Jul 2018 00:12:24 +0000 (UTC) Subject: =?UTF-8?Q?Jenkins_build_is_back_to_normal_:_master-osmo-sgsn_=C2=BB_--en?= =?UTF-8?Q?able-iu,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#4604?= In-Reply-To: <23054054.12.1532995547297.JavaMail.jenkins@jenkins.osmocom.org> References: <23054054.12.1532995547297.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <257201607.13.1532995944776.JavaMail.jenkins@jenkins.osmocom.org> See From gerrit-no-reply at lists.osmocom.org Tue Jul 31 06:27:00 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Tue, 31 Jul 2018 06:27:00 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BSC_Tests: Avoid race condition between paging cmd and reset ack Message-ID: daniel has uploaded this change for review. ( https://gerrit.osmocom.org/10272 Change subject: BSC_Tests: Avoid race condition between paging cmd and reset ack ...................................................................... BSC_Tests: Avoid race condition between paging cmd and reset ack Sometimes (under heavy load and when the last paging cmd arrives near the reset ack) some messages are not enqueued in the IPA_RSL port after we have received the reset ack from BSSAP. In the failures I have seen wireshark reports that no paging cmd arrived after the reset ack, see jenkins job 285: https://jenkins.osmocom.org/jenkins/view/TTCN3/job/ttcn3-bsc-test/285/ Adding a sleep is always a bit crude, but since the paging cmd is scheduled through TCP while the reset ack is sent through sctp I don't see another way. Running the test under load in a loop showed improvements where I was not able to reproduce the failure with this patch. Change-Id: Ib2d60e2c59baf98e437e078d844adcc6dbdbfcd8 --- M bsc/BSC_Tests.ttcn 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/72/10272/1 diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index c802a6b..5af4573 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -1390,6 +1390,10 @@ [] BSSAP.receive { repeat; } } + /* Wait to avoid a possible race condition if a paging message is + * received right before the reset ACK. */ + f_sleep(0.2); + /* Clear the queue, it might still contain stuff like BCCH FILLING */ for (var integer i := 0; i < sizeof(IPA_RSL); i := i+1) { IPA_RSL[i].clear; -- To view, visit https://gerrit.osmocom.org/10272 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ib2d60e2c59baf98e437e078d844adcc6dbdbfcd8 Gerrit-Change-Number: 10272 Gerrit-PatchSet: 1 Gerrit-Owner: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 06:50:39 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 06:50:39 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BSC_Tests: Avoid race condition between paging cmd and reset ack In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10272 ) Change subject: BSC_Tests: Avoid race condition between paging cmd and reset ack ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10272 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib2d60e2c59baf98e437e078d844adcc6dbdbfcd8 Gerrit-Change-Number: 10272 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 31 Jul 2018 06:50:39 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 06:50:42 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 06:50:42 +0000 Subject: Change in osmo-ttcn3-hacks[master]: BSC_Tests: Avoid race condition between paging cmd and reset ack In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10272 ) Change subject: BSC_Tests: Avoid race condition between paging cmd and reset ack ...................................................................... BSC_Tests: Avoid race condition between paging cmd and reset ack Sometimes (under heavy load and when the last paging cmd arrives near the reset ack) some messages are not enqueued in the IPA_RSL port after we have received the reset ack from BSSAP. In the failures I have seen wireshark reports that no paging cmd arrived after the reset ack, see jenkins job 285: https://jenkins.osmocom.org/jenkins/view/TTCN3/job/ttcn3-bsc-test/285/ Adding a sleep is always a bit crude, but since the paging cmd is scheduled through TCP while the reset ack is sent through sctp I don't see another way. Running the test under load in a loop showed improvements where I was not able to reproduce the failure with this patch. Change-Id: Ib2d60e2c59baf98e437e078d844adcc6dbdbfcd8 --- M bsc/BSC_Tests.ttcn 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index c802a6b..5af4573 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -1390,6 +1390,10 @@ [] BSSAP.receive { repeat; } } + /* Wait to avoid a possible race condition if a paging message is + * received right before the reset ACK. */ + f_sleep(0.2); + /* Clear the queue, it might still contain stuff like BCCH FILLING */ for (var integer i := 0; i < sizeof(IPA_RSL); i := i+1) { IPA_RSL[i].clear; -- To view, visit https://gerrit.osmocom.org/10272 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ib2d60e2c59baf98e437e078d844adcc6dbdbfcd8 Gerrit-Change-Number: 10272 Gerrit-PatchSet: 1 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 06:51:03 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 06:51:03 +0000 Subject: Change in osmo-hlr[master]: hlr_ussd.h: add #pragma once include guard In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10266 ) Change subject: hlr_ussd.h: add #pragma once include guard ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10266 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iba9470e11af2f2609486b9b0b6bfa3207b883a3a Gerrit-Change-Number: 10266 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 31 Jul 2018 06:51:03 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 06:51:25 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 06:51:25 +0000 Subject: Change in osmo-hlr[master]: hlr_ussd.h: use proper libc headers In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10267 ) Change subject: hlr_ussd.h: use proper libc headers ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10267 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I2b9485be08c6cbf188ed1f4059ff28ab65c61dbf Gerrit-Change-Number: 10267 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 31 Jul 2018 06:51:25 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 06:52:06 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 06:52:06 +0000 Subject: Change in osmo-hlr[master]: Update .gitignore: ignore osmo-euse-demo In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10269 ) Change subject: Update .gitignore: ignore osmo-euse-demo ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10269 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I1e2fb003d507a00f9255e021dd8956269f0657ee Gerrit-Change-Number: 10269 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 31 Jul 2018 06:52:06 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 06:52:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 06:52:08 +0000 Subject: Change in osmo-hlr[master]: hlr_ussd.h: add #pragma once include guard In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10266 ) Change subject: hlr_ussd.h: add #pragma once include guard ...................................................................... hlr_ussd.h: add #pragma once include guard Change-Id: Iba9470e11af2f2609486b9b0b6bfa3207b883a3a --- M src/hlr_ussd.h 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/hlr_ussd.h b/src/hlr_ussd.h index d1b9fe0..67e5d0d 100644 --- a/src/hlr_ussd.h +++ b/src/hlr_ussd.h @@ -1,3 +1,5 @@ +#pragma once + #include #include #include -- To view, visit https://gerrit.osmocom.org/10266 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iba9470e11af2f2609486b9b0b6bfa3207b883a3a Gerrit-Change-Number: 10266 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 06:52:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 06:52:08 +0000 Subject: Change in osmo-hlr[master]: hlr_ussd.h: use proper libc headers In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10267 ) Change subject: hlr_ussd.h: use proper libc headers ...................................................................... hlr_ussd.h: use proper libc headers Change-Id: I2b9485be08c6cbf188ed1f4059ff28ab65c61dbf --- M src/hlr_ussd.h 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/hlr_ussd.h b/src/hlr_ussd.h index 67e5d0d..a190dc6 100644 --- a/src/hlr_ussd.h +++ b/src/hlr_ussd.h @@ -1,6 +1,7 @@ #pragma once -#include +#include + #include #include #include "gsup_server.h" -- To view, visit https://gerrit.osmocom.org/10267 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I2b9485be08c6cbf188ed1f4059ff28ab65c61dbf Gerrit-Change-Number: 10267 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 06:53:30 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 06:53:30 +0000 Subject: Change in osmo-tetra[master]: add script for testing performance and number of correctly decoded fr... In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10261 ) Change subject: add script for testing performance and number of correctly decoded frames ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10261 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-tetra Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I6d8030969eed4519520745207591ce4731939201 Gerrit-Change-Number: 10261 Gerrit-PatchSet: 1 Gerrit-Owner: Jan Hrach Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 31 Jul 2018 06:53:30 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 06:53:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 06:53:48 +0000 Subject: Change in osmo-tetra[master]: Makefile: -O3 and debug build In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10262 ) Change subject: Makefile: -O3 and debug build ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10262 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-tetra Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ie943babb808ffdb1d807bcd7ce4ace54723b49a9 Gerrit-Change-Number: 10262 Gerrit-PatchSet: 1 Gerrit-Owner: Jan Hrach Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 31 Jul 2018 06:53:48 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 06:57:30 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 06:57:30 +0000 Subject: Change in osmo-tetra[master]: allow dumping GSMTAP to PCAP file In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10265 ) Change subject: allow dumping GSMTAP to PCAP file ...................................................................... Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/10265/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/10265/1//COMMIT_MSG at 9 PS1, Line 9: mixed up can you clarify how they are "mixed up"? https://gerrit.osmocom.org/#/c/10265/1//COMMIT_MSG at 10 PS1, Line 10: lost did you try increasing the socket buffer size of both the sender side (in osmo-tetra) as well as the receiver side (tcpdump "-B" option)? I'd somehow be surprised if the highly efficient linux loopback networking couldn't handle a low-bandwidth system like TETRA... -- To view, visit https://gerrit.osmocom.org/10265 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-tetra Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I955589a1d576f180fc4b80dba8ed8dc364e43d8b Gerrit-Change-Number: 10265 Gerrit-PatchSet: 1 Gerrit-Owner: Jan Hrach Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Harald Welte Gerrit-Comment-Date: Tue, 31 Jul 2018 06:57:30 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 06:58:04 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 06:58:04 +0000 Subject: Change in osmo-tetra[master]: update scrambling only if we have good CRC In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10270 ) Change subject: update scrambling only if we have good CRC ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10270 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-tetra Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5e88b52fcbb98532d7ab6ca85e4f956589a595ab Gerrit-Change-Number: 10270 Gerrit-PatchSet: 1 Gerrit-Owner: Jan Hrach Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 31 Jul 2018 06:58:04 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 06:58:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 06:58:11 +0000 Subject: Change in osmo-tetra[master]: add script for testing performance and number of correctly decoded fr... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10261 ) Change subject: add script for testing performance and number of correctly decoded frames ...................................................................... add script for testing performance and number of correctly decoded frames Change-Id: I6d8030969eed4519520745207591ce4731939201 --- M src/.gitignore A src/tetra-rx-tests.sh 2 files changed, 83 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/.gitignore b/src/.gitignore index 8451771..a72cffe 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -7,3 +7,4 @@ float_to_bits crc_test tunctl +tests_data/* diff --git a/src/tetra-rx-tests.sh b/src/tetra-rx-tests.sh new file mode 100755 index 0000000..f84a1ad --- /dev/null +++ b/src/tetra-rx-tests.sh @@ -0,0 +1,82 @@ +#!/bin/bash + +if [ $# -lt 1 ]; then + echo "$0" + echo "Runs tetra-rx on bit files provided as args, prints the number of correct frames" + echo " and the time it took and compares it to previous runs." + echo "" + echo "Extra options:" + echo " -n (default: git head id) (no spaces and \"-\" please)" + echo " -o overwrite previous measurement" + echo " -t parameters for tetra-rx" + echo "" + echo "Examples:" + echo "$0 path/to/file.bits" + echo "$0 -n \"something changed\" path/to/file.bits path/to/file2.bits" + exit 1 +fi + +if ! command -v bc > /dev/null; then + echo "Please install \"bc\"" +fi + +TESTS_DIR="tests_data/" +mkdir -p "$TESTS_DIR" + +n=`git rev-parse HEAD` +o=0 +t=" " +while getopts ":n:ot:" opt; do + case $opt in + n) + n="$OPTARG" + ;; + o) + o=1 + ;; + t) + t="$OPTARG" + ;; + \?) + echo "Unknown option $OPTARG" >&2 + exit 1 + ;; + :) + echo "-$OPTARG requires argument" >&2 + exit 1 + ;; + esac +done + +shift $(( $OPTIND - 1 )) + +tmpdir=`mktemp -d /tmp/tetraXXX` + +for f in $@; do + corrects=`"time" -o "$tmpdir/time" ./tetra-rx "$f" $t 2>/dev/null | grep -E "^CRC COMP: 0x.+ OK" | wc -l` + tt=`grep user "$tmpdir/time" | head -n 1 | cut -d u -f 1` + echo "$f: $corrects frames, $tt s" + hash=`sha256sum "$f" | cut -c 1-20` + fnb="$TESTS_DIR/rx-$hash-" + for meas in "$fnb"*; do + if ! [ -s "$meas" ]; then + continue + fi + tag=`echo "$meas" | rev | cut -d - -f 1 | rev` + if [ "$tag" = "$n" ]; then + continue + fi + pf=`cat "$meas" | cut -d " " -f 1` + pt=`cat "$meas" | cut -d " " -f 2` + deltaf=`echo "scale=7; $corrects/$pf" | bc -l` + deltat=`echo "scale=3; $tt/$pt" | bc -l` + echo "... ${deltaf}x frames than $tag" + echo "... ${deltat}x time than $tag" + done + fn="$fnb$n" + if [ "$o" -eq 1 -o ! -s "$fn" ]; then + echo "$corrects $tt" > "$fn" + fi +done + +rm -r "$tmpdir" -- To view, visit https://gerrit.osmocom.org/10261 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-tetra Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I6d8030969eed4519520745207591ce4731939201 Gerrit-Change-Number: 10261 Gerrit-PatchSet: 1 Gerrit-Owner: Jan Hrach Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 06:58:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 06:58:11 +0000 Subject: Change in osmo-tetra[master]: Makefile: -O3 and debug build In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10262 ) Change subject: Makefile: -O3 and debug build ...................................................................... Makefile: -O3 and debug build Build standard builds with -O3. Add a "debug" target with -Og and asan. Change-Id: Ie943babb808ffdb1d807bcd7ce4ace54723b49a9 --- M src/Makefile 1 file changed, 5 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/Makefile b/src/Makefile index f6ff0fc..b21f846 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,8 +1,12 @@ -CFLAGS=-g -O0 -Wall `pkg-config --cflags libosmocore 2> /dev/null` -I. +CFLAGS=-g -O3 -Wall `pkg-config --cflags libosmocore 2> /dev/null` -I. LDLIBS=`pkg-config --libs libosmocore 2> /dev/null` -losmocore all: conv_enc_test crc_test tetra-rx float_to_bits tunctl +debug: CFLAGS := -lasan $(CFLAGS) -fsanitize=address -fno-omit-frame-pointer -g -Og +debug: LDLIBS := -lasan $(LDLIBS) +debug: all + %.o: %.c $(CC) $(CFLAGS) -c $^ -o $@ -- To view, visit https://gerrit.osmocom.org/10262 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-tetra Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ie943babb808ffdb1d807bcd7ce4ace54723b49a9 Gerrit-Change-Number: 10262 Gerrit-PatchSet: 1 Gerrit-Owner: Jan Hrach Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 06:59:06 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 06:59:06 +0000 Subject: Change in osmo-hlr[master]: Update .gitignore: ignore osmo-euse-demo In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10269 ) Change subject: Update .gitignore: ignore osmo-euse-demo ...................................................................... Update .gitignore: ignore osmo-euse-demo Change-Id: I1e2fb003d507a00f9255e021dd8956269f0657ee --- M .gitignore 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/.gitignore b/.gitignore index baaaeb6..0fd74be 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,7 @@ src/db_bootstrap.h src/osmo-hlr src/osmo-hlr-db-tool +src/osmo-euse-demo src/gsupclient/gsup-test-client tests/atconfig -- To view, visit https://gerrit.osmocom.org/10269 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I1e2fb003d507a00f9255e021dd8956269f0657ee Gerrit-Change-Number: 10269 Gerrit-PatchSet: 2 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 11:00:19 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 11:00:19 +0000 Subject: Change in osmo-tetra[master]: update scrambling only if we have good CRC In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10270 ) Change subject: update scrambling only if we have good CRC ...................................................................... update scrambling only if we have good CRC When a bad frame is received, the scrambling should not be updated, because setting scrambling to wrong values will completely break further decoding (until another SYNC frame is received). Change-Id: I5e88b52fcbb98532d7ab6ca85e4f956589a595ab --- M src/lower_mac/tetra_lower_mac.c 1 file changed, 10 insertions(+), 8 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/lower_mac/tetra_lower_mac.c b/src/lower_mac/tetra_lower_mac.c index 7b62bb4..1e8f2e8 100644 --- a/src/lower_mac/tetra_lower_mac.c +++ b/src/lower_mac/tetra_lower_mac.c @@ -229,14 +229,16 @@ printf("MCC %s(%u) ", osmo_ubit_dump(type2+31, 10), bits_to_uint(type2+31, 10)); printf("MNC %s(%u)\n", osmo_ubit_dump(type2+41, 14), bits_to_uint(type2+41, 14)); /* obtain information from SYNC PDU */ - tcd->colour_code = bits_to_uint(type2+4, 6); - tcd->time.tn = bits_to_uint(type2+10, 2); - tcd->time.fn = bits_to_uint(type2+12, 5); - tcd->time.mn = bits_to_uint(type2+17, 6); - tcd->mcc = bits_to_uint(type2+31, 10); - tcd->mnc = bits_to_uint(type2+41, 14); - /* compute the scrambling code for the current cell */ - tcd->scramb_init = tetra_scramb_get_init(tcd->mcc, tcd->mnc, tcd->colour_code); + if (tup->crc_ok) { + tcd->colour_code = bits_to_uint(type2+4, 6); + tcd->time.tn = bits_to_uint(type2+10, 2); + tcd->time.fn = bits_to_uint(type2+12, 5); + tcd->time.mn = bits_to_uint(type2+17, 6); + tcd->mcc = bits_to_uint(type2+31, 10); + tcd->mnc = bits_to_uint(type2+41, 14); + /* compute the scrambling code for the current cell */ + tcd->scramb_init = tetra_scramb_get_init(tcd->mcc, tcd->mnc, tcd->colour_code); + } /* update the PHY layer time */ memcpy(&t_phy_state.time, &tcd->time, sizeof(t_phy_state.time)); tup->lchan = TETRA_LC_BSCH; -- To view, visit https://gerrit.osmocom.org/10270 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-tetra Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I5e88b52fcbb98532d7ab6ca85e4f956589a595ab Gerrit-Change-Number: 10270 Gerrit-PatchSet: 2 Gerrit-Owner: Jan Hrach Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 11:01:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 11:01:18 +0000 Subject: Change in osmo-hlr[master]: hlr_ussd.h: drop meaningless forward declaration In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10268 ) Change subject: hlr_ussd.h: drop meaningless forward declaration ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/10268/1/src/hlr_ussd.h File src/hlr_ussd.h: https://gerrit.osmocom.org/#/c/10268/1/src/hlr_ussd.h at a9 PS1, Line 9: why is it meaningless? This file does not include gsup_client.h and it uses 'struct osmo_gsup_conn *' below. So I think the original code is correct? -- To view, visit https://gerrit.osmocom.org/10268 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I70a5c7c83c2356b779fb1ea7ffe07ccc1e279c22 Gerrit-Change-Number: 10268 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder Gerrit-CC: Harald Welte Gerrit-Comment-Date: Tue, 31 Jul 2018 11:01:18 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 11:01:26 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 11:01:26 +0000 Subject: Change in osmo-hlr[master]: hlr_ussd.h: drop meaningless forward declaration In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10268 ) Change subject: hlr_ussd.h: drop meaningless forward declaration ...................................................................... Patch Set 1: Code-Review-1 -- To view, visit https://gerrit.osmocom.org/10268 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I70a5c7c83c2356b779fb1ea7ffe07ccc1e279c22 Gerrit-Change-Number: 10268 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 31 Jul 2018 11:01:26 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 11:19:24 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Tue, 31 Jul 2018 11:19:24 +0000 Subject: Change in docker-playground[master]: regen_docs: Add a script that extracts counter and vty info Message-ID: daniel has uploaded this change for review. ( https://gerrit.osmocom.org/10273 Change subject: regen_docs: Add a script that extracts counter and vty info ...................................................................... regen_docs: Add a script that extracts counter and vty info Start our osmo-* docker containers and extract the counter and vty documentation. Run it like this: OSMO_INTERACT_VTY=/usr/local/bin/osmo_interact_vty.py ./regen_docs.sh It will create bsc_ctr.adoc and bsc_vty_reference.xml for osmo-bsc and so on for the other programs. Change-Id: I4e57a64caccfbc982199f8f25bbb14c2d96e11a6 --- A regen_docs/osmo-bsc.cfg A regen_docs/osmo-ggsn.cfg A regen_docs/osmo-hlr.cfg A regen_docs/osmo-mgw.cfg A regen_docs/osmo-msc.cfg A regen_docs/osmo-sgsn.cfg A regen_docs/osmo-stp.cfg A regen_docs/regen_docs.sh 8 files changed, 646 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/73/10273/1 diff --git a/regen_docs/osmo-bsc.cfg b/regen_docs/osmo-bsc.cfg new file mode 100644 index 0000000..23eb0d5 --- /dev/null +++ b/regen_docs/osmo-bsc.cfg @@ -0,0 +1,324 @@ +! +! OsmoBSC (1.0.1.122-630df) configuration saved from vty +!! +password foo +! +stats interval 5 +! +line vty + no login + bind 0.0.0.0 +ctrl + bind 0.0.0.0 +! +e1_input + e1_line 0 driver ipa + e1_line 0 port 0 + no e1_line 0 keepalive +network + network country code 1 + mobile network code 1 + encryption a5 0 + neci 1 + paging any use tch 0 + handover 0 + handover window rxlev averaging 10 + handover window rxqual averaging 1 + handover window rxlev neighbor averaging 10 + handover power budget interval 6 + handover power budget hysteresis 3 + handover maximum distance 9999 + dyn_ts_allow_tch_f 1 + periodic location update 30 + timer t3113 10 + bts 0 + type sysmobts + band DCS1800 + cell_identity 0 + location_area_code 1 + dtx uplink force + dtx downlink + base_station_id_code 63 + ms max power 15 + cell reselection hysteresis 4 + rxlev access min 0 + radio-link-timeout 32 + channel allocator ascending + rach tx integer 9 + rach max transmission 7 + channel-descrption attach 1 + channel-descrption bs-pa-mfrms 5 + channel-descrption bs-ag-blks-res 1 + early-classmark-sending forbidden + ip.access unit_id 1234 0 + oml ip.access stream_id 255 line 0 + neighbor-list mode manual-si5 + neighbor-list add arfcn 100 + neighbor-list add arfcn 200 + si5 neighbor-list add arfcn 10 + si5 neighbor-list add arfcn 20 + codec-support fr + gprs mode gprs + gprs 11bit_rach_support_for_egprs 0 + gprs routing area 0 + gprs network-control-order nc0 + gprs cell bvci 1234 + gprs cell timer blocking-timer 3 + gprs cell timer blocking-retries 3 + gprs cell timer unblocking-retries 3 + gprs cell timer reset-timer 3 + gprs cell timer reset-retries 3 + gprs cell timer suspend-timer 10 + gprs cell timer suspend-retries 3 + gprs cell timer resume-timer 10 + gprs cell timer resume-retries 3 + gprs cell timer capability-update-timer 10 + gprs cell timer capability-update-retries 3 + gprs nsei 1234 + gprs ns timer tns-block 3 + gprs ns timer tns-block-retries 3 + gprs ns timer tns-reset 3 + gprs ns timer tns-reset-retries 3 + gprs ns timer tns-test 30 + gprs ns timer tns-alive 3 + gprs ns timer tns-alive-retries 10 + gprs nsvc 0 nsvci 1234 + gprs nsvc 0 local udp port 23000 + gprs nsvc 0 remote udp port 23000 + gprs nsvc 0 remote ip 192.168.100.239 + gprs nsvc 1 nsvci 0 + gprs nsvc 1 local udp port 0 + gprs nsvc 1 remote udp port 0 + gprs nsvc 1 remote ip 0.0.0.0 + no force-combined-si + trx 0 + rf_locked 0 + arfcn 871 + nominal power 23 + max_power_red 20 + rsl e1 tei 0 + timeslot 0 + phys_chan_config CCCH+SDCCH4 + hopping enabled 0 + timeslot 1 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 2 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 3 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 4 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 5 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 6 + phys_chan_config PDCH + hopping enabled 0 + timeslot 7 + phys_chan_config PDCH + hopping enabled 0 + bts 1 + type sysmobts + band DCS1800 + cell_identity 1 + location_area_code 2 + dtx uplink force + dtx downlink + base_station_id_code 63 + ms max power 15 + cell reselection hysteresis 4 + rxlev access min 0 + radio-link-timeout 32 + channel allocator ascending + rach tx integer 9 + rach max transmission 7 + channel-descrption attach 1 + channel-descrption bs-pa-mfrms 5 + channel-descrption bs-ag-blks-res 1 + early-classmark-sending forbidden + ip.access unit_id 1235 0 + oml ip.access stream_id 255 line 0 + neighbor-list mode manual-si5 + neighbor-list add arfcn 100 + neighbor-list add arfcn 200 + si5 neighbor-list add arfcn 10 + si5 neighbor-list add arfcn 20 + codec-support fr + gprs mode gprs + gprs 11bit_rach_support_for_egprs 0 + gprs routing area 0 + gprs network-control-order nc0 + gprs cell bvci 1235 + gprs cell timer blocking-timer 3 + gprs cell timer blocking-retries 3 + gprs cell timer unblocking-retries 3 + gprs cell timer reset-timer 3 + gprs cell timer reset-retries 3 + gprs cell timer suspend-timer 10 + gprs cell timer suspend-retries 3 + gprs cell timer resume-timer 10 + gprs cell timer resume-retries 3 + gprs cell timer capability-update-timer 10 + gprs cell timer capability-update-retries 3 + gprs nsei 1235 + gprs ns timer tns-block 3 + gprs ns timer tns-block-retries 3 + gprs ns timer tns-reset 3 + gprs ns timer tns-reset-retries 3 + gprs ns timer tns-test 30 + gprs ns timer tns-alive 3 + gprs ns timer tns-alive-retries 10 + gprs nsvc 0 nsvci 1235 + gprs nsvc 0 local udp port 23000 + gprs nsvc 0 remote udp port 23000 + gprs nsvc 0 remote ip 192.168.100.239 + gprs nsvc 1 nsvci 0 + gprs nsvc 1 local udp port 0 + gprs nsvc 1 remote udp port 0 + gprs nsvc 1 remote ip 0.0.0.0 + no force-combined-si + trx 0 + rf_locked 0 + arfcn 871 + nominal power 23 + max_power_red 20 + rsl e1 tei 0 + timeslot 0 + phys_chan_config CCCH+SDCCH4 + hopping enabled 0 + timeslot 1 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 2 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 3 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 4 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 5 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 6 + phys_chan_config PDCH + hopping enabled 0 + timeslot 7 + phys_chan_config PDCH + hopping enabled 0 + bts 2 + type sysmobts + band DCS1800 + cell_identity 1 + location_area_code 1 + dtx uplink force + dtx downlink + base_station_id_code 63 + ms max power 15 + cell reselection hysteresis 4 + rxlev access min 0 + radio-link-timeout 32 + channel allocator ascending + rach tx integer 9 + rach max transmission 7 + channel-descrption attach 1 + channel-descrption bs-pa-mfrms 5 + channel-descrption bs-ag-blks-res 1 + early-classmark-sending forbidden + ip.access unit_id 1236 0 + oml ip.access stream_id 255 line 0 + neighbor-list mode manual-si5 + neighbor-list add arfcn 100 + neighbor-list add arfcn 200 + si5 neighbor-list add arfcn 10 + si5 neighbor-list add arfcn 20 + codec-support fr + gprs mode gprs + gprs 11bit_rach_support_for_egprs 0 + gprs routing area 0 + gprs network-control-order nc0 + gprs cell bvci 1236 + gprs cell timer blocking-timer 3 + gprs cell timer blocking-retries 3 + gprs cell timer unblocking-retries 3 + gprs cell timer reset-timer 3 + gprs cell timer reset-retries 3 + gprs cell timer suspend-timer 10 + gprs cell timer suspend-retries 3 + gprs cell timer resume-timer 10 + gprs cell timer resume-retries 3 + gprs cell timer capability-update-timer 10 + gprs cell timer capability-update-retries 3 + gprs nsei 1236 + gprs ns timer tns-block 3 + gprs ns timer tns-block-retries 3 + gprs ns timer tns-reset 3 + gprs ns timer tns-reset-retries 3 + gprs ns timer tns-test 30 + gprs ns timer tns-alive 3 + gprs ns timer tns-alive-retries 10 + gprs nsvc 0 nsvci 1236 + gprs nsvc 0 local udp port 23000 + gprs nsvc 0 remote udp port 23000 + gprs nsvc 0 remote ip 192.168.100.239 + gprs nsvc 1 nsvci 0 + gprs nsvc 1 local udp port 0 + gprs nsvc 1 remote udp port 0 + gprs nsvc 1 remote ip 0.0.0.0 + no force-combined-si + trx 0 + rf_locked 0 + arfcn 871 + nominal power 23 + max_power_red 20 + rsl e1 tei 0 + timeslot 0 + phys_chan_config CCCH+SDCCH4 + hopping enabled 0 + timeslot 1 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 2 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 3 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 4 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 5 + phys_chan_config TCH/F + hopping enabled 0 + timeslot 6 + phys_chan_config PDCH + hopping enabled 0 + timeslot 7 + phys_chan_config PDCH + hopping enabled 0 +msc 0 + ip.access rtp-base 4000 + no bsc-welcome-text + no bsc-msc-lost-text + no bsc-grace-text + type normal + allow-emergency allow + amr-config 12_2k forbidden + amr-config 10_2k forbidden + amr-config 7_95k forbidden + amr-config 7_40k forbidden + amr-config 6_70k forbidden + amr-config 5_90k allowed + amr-config 5_15k forbidden + amr-config 4_75k forbidden + codec-list fr1 fr2 fr3 + lcls-mode mgw-loop +bsc + mid-call-timeout 0 + no missing-msc-text + access-list-name bsc-list diff --git a/regen_docs/osmo-ggsn.cfg b/regen_docs/osmo-ggsn.cfg new file mode 100644 index 0000000..53bd405 --- /dev/null +++ b/regen_docs/osmo-ggsn.cfg @@ -0,0 +1,45 @@ +! +! OpenGGSN (0.94.1-adac) configuration saved from vty +!! +! +stats interval 5 +! +line vty + no login + bind 0.0.0.0 +! +ggsn ggsn0 + gtp state-dir /tmp + gtp bind-ip 172.18.12.205 + apn internet + gtpu-mode tun + tun-device tun4 + type-support v4 + ip prefix dynamic 176.16.222.0/24 + ip dns 0 172.18.12.205 + ip dns 1 8.8.8.8 + ip ifconfig 176.16.222.0/24 + no shutdown + apn inet6 + gtpu-mode tun + tun-device tun6 + type-support v6 + ipv6 prefix dynamic 2001:780:44:2000:0:0:0:0/56 + ipv6 dns 0 2001:4860:4860::8888 + ipv6 dns 1 2001:4860:4860::8844 + ipv6 ifconfig 2001:780:44:2000:0:0:0:0/56 + no shutdown + apn inet46 + gtpu-mode tun + tun-device tun46 + type-support v4v6 + ip prefix dynamic 176.16.46.0/24 + ip dns 0 192.168.100.1 + ip dns 1 8.8.8.8 + ip ifconfig 176.16.46.0/24 + ipv6 prefix dynamic 2001:780:44:2100:0:0:0:0/56 + ipv6 dns 0 2001:4860:4860::8888 + ipv6 ifconfig 2001:780:44:2100:0:0:0:0/56 + no shutdown + default-apn internet + no shutdown ggsn diff --git a/regen_docs/osmo-hlr.cfg b/regen_docs/osmo-hlr.cfg new file mode 100644 index 0000000..71a76c8 --- /dev/null +++ b/regen_docs/osmo-hlr.cfg @@ -0,0 +1,19 @@ +! +! OsmoHLR example configuration +! +log stderr + logging filter all 1 + logging color 1 + logging print category 1 + logging timestamp 1 + logging print extended-timestamp 1 + logging level all debug + logging level linp error +! +line vty + bind 0.0.0.0 +ctrl + bind 0.0.0.0 +hlr + gsup + bind ip 0.0.0.0 diff --git a/regen_docs/osmo-mgw.cfg b/regen_docs/osmo-mgw.cfg new file mode 100644 index 0000000..c3ff7f3 --- /dev/null +++ b/regen_docs/osmo-mgw.cfg @@ -0,0 +1,29 @@ +! +! OsmoMGW (1.2.0.17-52e3) configuration saved from vty +!! +! +! +stats interval 5 +! +line vty + bind 0.0.0.0 + no login +! +mgcp + bind ip 172.18.12.201 + bind port 2427 + rtp port-range 4002 16000 + rtp bind-ip 172.18.12.201 + rtp ip-probing + rtp ip-dscp 184 + no rtp keep-alive + no rtcp-omit + no rtp-patch + sdp audio-payload number 98 + sdp audio-payload name GSM + sdp audio-payload send-ptime + sdp audio-payload send-name + loop 0 + number endpoints 31 + allow-transcoding + osmux off diff --git a/regen_docs/osmo-msc.cfg b/regen_docs/osmo-msc.cfg new file mode 100644 index 0000000..8142fe7 --- /dev/null +++ b/regen_docs/osmo-msc.cfg @@ -0,0 +1,48 @@ +! +! OsmoMSC (1.1.2.66-629c4-dirty) configuration saved from vty +!! +! +! +stats interval 5 +! +line vty + no login + bind 0.0.0.0 +ctrl + bind 0.0.0.0 +! +cs7 instance 0 + point-code 0.23.1 + asp asp-clnt-OsmoMSC-A 2905 0 m3ua + remote-ip 172.18.12.200 + as as-clnt-OsmoMSC-A m3ua + asp asp-clnt-OsmoMSC-A + routing-key 2 0.23.1 +network + network country code 262 + mobile network code 42 + short name OsmoMSC + long name OsmoMSC + encryption a5 0 + authentication optional + rrlp mode none + mm info 0 + periodic location update 30 +msc + assign-tmsi + cs7-instance-a 0 + cs7-instance-iu 0 + mgw remote-ip 172.18.12.103 + emergency-call route-to-msisdn 112 +mncc-int + default-codec tch-f fr + default-codec tch-h hr +smpp + local-tcp-port 2775 + policy closed + no smpp-first + esme msc_tester + password osmocom1 +hlr + remote-ip 172.18.12.103 + remote-port 4222 diff --git a/regen_docs/osmo-sgsn.cfg b/regen_docs/osmo-sgsn.cfg new file mode 100644 index 0000000..092440b --- /dev/null +++ b/regen_docs/osmo-sgsn.cfg @@ -0,0 +1,50 @@ +! +! OsmoSGSN (1.2.0.46-e77e-dirty) configuration saved from vty +!! +! +stats interval 5 +! +line vty + no login + bind 0.0.0.0 +ctrl + bind 0.0.0.0 +! +ns + timer tns-block 3 + timer tns-block-retries 3 + timer tns-reset 3 + timer tns-reset-retries 3 + timer tns-test 30 + timer tns-alive 3 + timer tns-alive-retries 10 + encapsulation udp local-ip 172.18.12.204 + encapsulation udp local-port 23000 + encapsulation framerelay-gre enabled 0 +bssgp +sgsn + gtp local-ip 172.18.12.204 + ggsn 0 remote-ip 172.18.12.205 + ggsn 0 gtp-version 1 + gsup remote-ip 172.18.12.9 + gsup remote-port 4222 + auth-policy remote + gsup oap-id 0 + ! apn * ggsn 0 + no cdr filename + no cdr trap + cdr interval 600 + timer t3312 600 + timer t3322 6 + timer t3350 6 + timer t3360 6 + timer t3370 6 + timer t3313 30 + timer t3314 44 + timer t3316 44 + timer t3385 8 + timer t3386 8 + timer t3395 8 + timer t3397 8 + no compression rfc1144 + no compression v42bis diff --git a/regen_docs/osmo-stp.cfg b/regen_docs/osmo-stp.cfg new file mode 100644 index 0000000..781e109 --- /dev/null +++ b/regen_docs/osmo-stp.cfg @@ -0,0 +1,25 @@ +! +! osmo-stp (0.0.6.3.179-b248) configuration saved from vty +!! +! +line vty + no login + bind 0.0.0.0 +! +cs7 instance 0 + xua rkm routing-key-allocation dynamic-permitted + asp virt-msc0-0 23905 2905 m3ua + local-ip 172.18.12.200 + remote-ip 172.18.12.203 + as mahlzeit ipa + routing-key 1 0.23.4 + point-code override dpc 0.23.1 + as virt-msc0 m3ua + asp virt-msc0-0 + routing-key 0 0.23.1 + route-table system + update route 0.23.1 7.255.7 linkset virt-msc0 + listen m3ua 2905 + accept-asp-connections dynamic-permitted + listen ipa 5000 + accept-asp-connections dynamic-permitted diff --git a/regen_docs/regen_docs.sh b/regen_docs/regen_docs.sh new file mode 100755 index 0000000..8a4e1c2 --- /dev/null +++ b/regen_docs/regen_docs.sh @@ -0,0 +1,106 @@ +#!/bin/sh +x + +. ../jenkins-common.sh + +if [ -z "$OSMO_INTERACT_VTY" ]; then + OSMO_INTERACT_VTY="osmo-interact-vty.py" +fi + +mkdir $VOL_BASE_DIR/osmo-hlr-master/ +cp osmo-hlr.cfg $VOL_BASE_DIR/osmo-hlr-master/ +mkdir $VOL_BASE_DIR/osmo-stp-master/ +cp osmo-stp.cfg $VOL_BASE_DIR/osmo-stp-master/ +mkdir $VOL_BASE_DIR/osmo-bsc-master/ +cp osmo-bsc.cfg $VOL_BASE_DIR/osmo-bsc-master/ +mkdir $VOL_BASE_DIR/osmo-msc-master/ +cp osmo-msc.cfg $VOL_BASE_DIR/osmo-msc-master/ +mkdir $VOL_BASE_DIR/osmo-mgw-master/ +cp osmo-mgw.cfg $VOL_BASE_DIR/osmo-mgw-master/ +mkdir $VOL_BASE_DIR/osmo-sgsn-master/ +cp osmo-sgsn.cfg $VOL_BASE_DIR/osmo-sgsn-master/ +mkdir $VOL_BASE_DIR/osmo-ggsn-master/ +cp osmo-ggsn.cfg $VOL_BASE_DIR/osmo-ggsn-master/ + + +network_create 172.18.12.0/24 + +container_create() { + NAME=$1 + IP_ADDR=$2 + + docker run --rm --network ${NET_NAME} --ip ${IP_ADDR} \ + -v ${VOL_BASE_DIR}/${NAME}:/data \ + --name ${BUILD_TAG}-${NAME} -d \ + ${REPO_USER}/${NAME} + + +} + +container_create osmo-stp-master 172.18.12.200 +container_create osmo-hlr-master 172.18.12.9 +container_create osmo-mgw-master 172.18.12.201 +container_create osmo-msc-master 172.18.12.203 +container_create osmo-bsc-master 172.18.12.11 +container_create osmo-sgsn-master 172.18.12.204 +container_create osmo-ggsn-master 172.18.12.205 + +# Get asciidoc counter info +#${OSMO_INTERACT_VTY} \ +# -c "enable;show asciidoc counters" -p 4239 -H 172.18.12.200 -O stp_ctr.adoc +#${OSMO_INTERACT_VTY} \ +# -c "enable;show asciidoc counters" -p 4258 -H 172.18.12.9 -O hlr_ctr.adoc +${OSMO_INTERACT_VTY} \ + -c "enable;show asciidoc counters" -p 4243 -H 172.18.12.201 -O mgw_ctr.adoc +${OSMO_INTERACT_VTY} \ + -c "enable;show asciidoc counters" -p 4254 -H 172.18.12.203 -O msc_ctr.adoc +${OSMO_INTERACT_VTY} \ + -c "enable;show asciidoc counters" -p 4242 -H 172.18.12.11 -O bsc_ctr.adoc +${OSMO_INTERACT_VTY} \ + -c "enable;show asciidoc counters" -p 4245 -H 172.18.12.204 -O sgsn_ctr.adoc +${OSMO_INTERACT_VTY} \ + -c "enable;show asciidoc counters" -p 4260 -H 172.18.12.205 -O ggsn_ctr.adoc + +# Get vty reference +${OSMO_INTERACT_VTY} \ + -X -p 4239 -H 172.18.12.200 -O stp_vty_reference.xml +${OSMO_INTERACT_VTY} \ + -X -p 4258 -H 172.18.12.9 -O hlr_vty_reference.xml +${OSMO_INTERACT_VTY} \ + -X -p 4243 -H 172.18.12.201 -O mgw_vty_reference.xml +${OSMO_INTERACT_VTY} \ + -X -p 4254 -H 172.18.12.203 -O msc_vty_reference.xml +${OSMO_INTERACT_VTY} \ + -X -p 4242 -H 172.18.12.11 -O bsc_vty_reference.xml +${OSMO_INTERACT_VTY} \ + -X -p 4245 -H 172.18.12.204 -O sgsn_vty_reference.xml +${OSMO_INTERACT_VTY} \ + -X -p 4260 -H 172.18.12.205 -O ggsn_vty_reference.xml + +docker container kill ${BUILD_TAG}-osmo-stp-master +docker container kill ${BUILD_TAG}-osmo-hlr-master +docker container kill ${BUILD_TAG}-osmo-msc-master +docker container kill ${BUILD_TAG}-osmo-mgw-master +docker container kill ${BUILD_TAG}-osmo-bsc-master +docker container kill ${BUILD_TAG}-osmo-sgsn-master +docker container kill ${BUILD_TAG}-osmo-ggsn-master + +network_remove + +#####define OSMO_VTY_PORT_TRX 4237 +#####define OSMO_VTY_PORT_STP 4239 +#####define OSMO_VTY_PORT_PCU 4240 /* also: osmo_pcap_client */ +#####define OSMO_VTY_PORT_BTS 4241 /* also: osmo_pcap_server */ +#####define OSMO_VTY_PORT_NITB_BSC 4242 +#####define OSMO_VTY_PORT_BSC_MGCP 4243 +#####define OSMO_VTY_PORT_MGW OSMO_VTY_PORT_BSC_MGCP +#####define OSMO_VTY_PORT_BSC_NAT 4244 +#####define OSMO_VTY_PORT_SGSN 4245 +#####define OSMO_VTY_PORT_GBPROXY 4246 +#####define OSMO_VTY_PORT_BB 4247 +#####define OSMO_VTY_PORT_BTSMGR 4252 +#####define OSMO_VTY_PORT_GTPHUB 4253 +#####define OSMO_VTY_PORT_MSC 4254 +#####define OSMO_VTY_PORT_MNCC_SIP 4256 +#####define OSMO_VTY_PORT_HLR 4258 +#####define OSMO_VTY_PORT_GGSN 4260 +#####define OSMO_VTY_PORT_HNBGW 4261 -- To view, visit https://gerrit.osmocom.org/10273 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I4e57a64caccfbc982199f8f25bbb14c2d96e11a6 Gerrit-Change-Number: 10273 Gerrit-PatchSet: 1 Gerrit-Owner: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 12:07:31 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 31 Jul 2018 12:07:31 +0000 Subject: Change in osmo-hlr[master]: hlr_ussd.h: drop meaningless forward declaration In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/10268 ) Change subject: hlr_ussd.h: drop meaningless forward declaration ...................................................................... Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/10268/1/src/hlr_ussd.h File src/hlr_ussd.h: https://gerrit.osmocom.org/#/c/10268/1/src/hlr_ussd.h at a9 PS1, Line 9: > why is it meaningless? This file does not include gsup_client. [?] The structure is defined in "gsup_server.h", which is included above... -- To view, visit https://gerrit.osmocom.org/10268 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I70a5c7c83c2356b779fb1ea7ffe07ccc1e279c22 Gerrit-Change-Number: 10268 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 31 Jul 2018 12:07:31 +0000 Gerrit-HasComments: Yes Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 13:49:09 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 13:49:09 +0000 Subject: Change in osmo-trx[master]: Fix config file saving of {tx, rx}-path VTY config strings Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10274 Change subject: Fix config file saving of {tx,rx}-path VTY config strings ...................................................................... Fix config file saving of {tx,rx}-path VTY config strings We were missing one indent level when writing the rx-path and tx-path Change-Id: I5d5b02c71d39220cabc2a23d059908ef3c6350e0 Closes: OS#3435 --- M CommonLibs/trx_vty.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/74/10274/1 diff --git a/CommonLibs/trx_vty.c b/CommonLibs/trx_vty.c index e69df77..baa26c8 100644 --- a/CommonLibs/trx_vty.c +++ b/CommonLibs/trx_vty.c @@ -424,9 +424,9 @@ chan = &trx->cfg.chans[i]; vty_out(vty, " chan %u%s", chan->idx, VTY_NEWLINE); if (chan->rx_path) - vty_out(vty, " rx-path %s%s", chan->rx_path, VTY_NEWLINE); + vty_out(vty, " rx-path %s%s", chan->rx_path, VTY_NEWLINE); if (chan->tx_path) - vty_out(vty, " tx-path %s%s", chan->tx_path, VTY_NEWLINE); + vty_out(vty, " tx-path %s%s", chan->tx_path, VTY_NEWLINE); } return CMD_SUCCESS; -- To view, visit https://gerrit.osmocom.org/10274 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I5d5b02c71d39220cabc2a23d059908ef3c6350e0 Gerrit-Change-Number: 10274 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 14:26:33 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 31 Jul 2018 14:26:33 +0000 Subject: Change in osmo-trx[master]: Fix config file saving of {tx, rx}-path VTY config strings In-Reply-To: References: Message-ID: Vadim Yanitskiy has posted comments on this change. ( https://gerrit.osmocom.org/10274 ) Change subject: Fix config file saving of {tx,rx}-path VTY config strings ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/10274 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5d5b02c71d39220cabc2a23d059908ef3c6350e0 Gerrit-Change-Number: 10274 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 31 Jul 2018 14:26:33 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 15:12:10 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Tue, 31 Jul 2018 15:12:10 +0000 Subject: Change in osmo-bts[master]: move caching of FAACH data to common BTS code Message-ID: Stefan Sperling has uploaded this change for review. ( https://gerrit.osmocom.org/10275 Change subject: move caching of FAACH data to common BTS code ...................................................................... move caching of FAACH data to common BTS code Move caching of FAACH data to the common BTS code to reduce duplicatation between sysmobts and litecell5. Change-Id: I252679206235c538335626d8075d003c0a27316f Related: OS#1950 --- M src/common/l1sap.c M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-sysmo/l1_if.c 3 files changed, 27 insertions(+), 26 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/75/10275/1 diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 8936674..cddba47 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -778,6 +778,31 @@ } msgb_free(pp.oph.msg); } + + if (dtx_dl_amr_enabled(lchan)) { + switch (lchan->tch.dtx.dl_amr_fsm->state) { + case ST_ONSET_F: + case ST_U_INH_F: + case ST_F1_INH_F: + if (L1SAP_IS_CHAN_TCHH(chan_nr) || L1SAP_IS_CHAN_TCHF(chan_nr) || + (L1SAP_IS_CHAN_PDCH(chan_nr) && !ts_is_pdch(&trx->ts[tn]))) { + /* FACCH interruption of DTX silence */ + /* cache FACCH data */ + memcpy(lchan->tch.dtx.facch, msg->l2h, msgb_l2len(msg)); + /* update FN so it can be checked by TCH silence + resume handler */ + lchan->tch.dtx.fn = LCHAN_FN_DUMMY; + } + break; + case ST_FACCH: + /* update FN so it can be checked by TCH silence + resume handler */ + lchan->tch.dtx.fn = LCHAN_FN_DUMMY; + break; + default: + break; + } + } } else if (L1SAP_IS_CHAN_AGCH_PCH(chan_nr)) { p = msgb_put(msg, GSM_MACBLOCK_LEN); rc = bts_ccch_copy_msg(trx->bts, p, &g_time, diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index e6cdfd4..b734942 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -422,9 +422,6 @@ } if (sapi == GsmL1_Sapi_TchH || sapi == GsmL1_Sapi_TchF) { /* FACCH interruption of DTX silence */ - /* cache FACCH data */ - memcpy(lchan->tch.dtx.facch, msg->l2h, - msgb_l2len(msg)); /* prepare ONSET or INH message */ if(lchan->tch.dtx.dl_amr_fsm->state == ST_ONSET_F) l1p->u.phDataReq.msgUnitParam.u8Buffer[0] = @@ -441,17 +438,8 @@ /* update length */ data_req_from_l1sap(l1p, fl1, u8Tn, u32Fn, sapi, subCh, u8BlockNbr, 3); - /* update FN so it can be checked by TCH silence - resume handler */ - lchan->tch.dtx.fn = LCHAN_FN_DUMMY; } - } else if (dtx_dl_amr_enabled(lchan) && - lchan->tch.dtx.dl_amr_fsm->state == ST_FACCH) { - /* update FN so it can be checked by TCH silence - resume handler */ - lchan->tch.dtx.fn = LCHAN_FN_DUMMY; - } - else { + } else { OSMO_ASSERT(msgb_l2len(msg) <= sizeof(l1p->u.phDataReq.msgUnitParam.u8Buffer)); memcpy(l1p->u.phDataReq.msgUnitParam.u8Buffer, msg->l2h, msgb_l2len(msg)); diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 3adb442..18fc9b8 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -419,9 +419,6 @@ } if (sapi == GsmL1_Sapi_TchH || sapi == GsmL1_Sapi_TchF) { /* FACCH interruption of DTX silence */ - /* cache FACCH data */ - memcpy(lchan->tch.dtx.facch, msg->l2h, - msgb_l2len(msg)); /* prepare ONSET or INH message */ if(lchan->tch.dtx.dl_amr_fsm->state == ST_ONSET_F) l1p->u.phDataReq.msgUnitParam.u8Buffer[0] = @@ -438,17 +435,8 @@ /* update length */ data_req_from_l1sap(l1p, fl1, u8Tn, u32Fn, sapi, subCh, u8BlockNbr, 3); - /* update FN so it can be checked by TCH silence - resume handler */ - lchan->tch.dtx.fn = LCHAN_FN_DUMMY; } - } else if (dtx_dl_amr_enabled(lchan) && - lchan->tch.dtx.dl_amr_fsm->state == ST_FACCH) { - /* update FN so it can be checked by TCH silence - resume handler */ - lchan->tch.dtx.fn = LCHAN_FN_DUMMY; - } - else { + } else { OSMO_ASSERT(msgb_l2len(msg) <= sizeof(l1p->u.phDataReq.msgUnitParam.u8Buffer)); memcpy(l1p->u.phDataReq.msgUnitParam.u8Buffer, msg->l2h, msgb_l2len(msg)); -- To view, visit https://gerrit.osmocom.org/10275 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I252679206235c538335626d8075d003c0a27316f Gerrit-Change-Number: 10275 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenkins at lists.osmocom.org Tue Jul 31 15:13:55 2018 From: jenkins at lists.osmocom.org (jenkins at lists.osmocom.org) Date: Tue, 31 Jul 2018 15:13:55 +0000 (UTC) Subject: =?UTF-8?Q?Jenkins_build_is_back_to_normal_:_master-asn1c_=C2=BB_a1=3Dde?= =?UTF-8?Q?fault,a2=3Ddefault,a3=3Ddefault,osmocom-master-debian9_#201?= In-Reply-To: <1069749641.10.1532963406493.JavaMail.jenkins@jenkins.osmocom.org> References: <1069749641.10.1532963406493.JavaMail.jenkins@jenkins.osmocom.org> Message-ID: <1814105465.19.1533050035798.JavaMail.jenkins@jenkins.osmocom.org> See From gerrit-no-reply at lists.osmocom.org Tue Jul 31 16:08:15 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 31 Jul 2018 16:08:15 +0000 Subject: Change in osmo-trx[master]: debian: add debian8/jessie compatible control/rules copies Message-ID: lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/10276 Change subject: debian: add debian8/jessie compatible control/rules copies ...................................................................... debian: add debian8/jessie compatible control/rules copies The osmocom-nightly/release can create debian8 package by replace rules, control files Change-Id: I261302d2ed16e76540073589504e7426e23d00a1 --- A debian/control-debian8-jessie A debian/rules-debian8-jessie 2 files changed, 86 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/76/10276/1 diff --git a/debian/control-debian8-jessie b/debian/control-debian8-jessie new file mode 100644 index 0000000..b7e499e --- /dev/null +++ b/debian/control-debian8-jessie @@ -0,0 +1,71 @@ +Source: osmo-trx +Section: net +Priority: optional +Maintainer: Ivan Klyuchnikov +Build-Depends: debhelper (>= 9), + autotools-dev, + autoconf-archive, + pkg-config, + dh-autoreconf, + libuhd-dev, + libusb-1.0-0-dev, + libboost-all-dev, + libfftw3-dev, + libtalloc-dev, + libusrp-dev, + libosmocore-dev (>= 0.10.0) +Standards-Version: 3.9.6 +Vcs-Browser: http://cgit.osmocom.org/osmo-trx +Vcs-Git: git://git.osmocom.org/osmo-trx +Homepage: https://projects.osmocom.org/projects/osmotrx + +Package: osmo-trx +Depends: osmo-trx-uhd +Architecture: all +Description: Metapackage for osmo-trx-uhd + +Package: osmo-trx-dbg +Architecture: any +Section: debug +Priority: extra +Depends: osmo-trx-uhd (= ${binary:Version}), osmo-trx-usrp1 (= ${binary:Version}), ${misc:Depends} +Description: Debug symbols for the osmo-trx-* + Make debugging possible + +Package: osmo-trx-uhd +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: SDR transceiver that implements Layer 1 of a GSM BTS (UHD) + OsmoTRX is a software-defined radio transceiver that implements the Layer 1 + physical layer of a BTS comprising the following 3GPP specifications: + . + TS 05.01 "Physical layer on the radio path" + TS 05.02 "Multiplexing and Multiple Access on the Radio Path" + TS 05.04 "Modulation" + TS 05.10 "Radio subsystem synchronization" + . + In this context, BTS is "Base transceiver station". It's the stations that + connect mobile phones to the mobile network. + . + 3GPP is the "3rd Generation Partnership Project" which is the collaboration + between different telecommunication associations for developing new + generations of mobile phone networks. (post-2G/GSM) + +Package: osmo-trx-usrp1 +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: SDR transceiver that implements Layer 1 of a GSM BTS (USRP1) + OsmoTRX is a software-defined radio transceiver that implements the Layer 1 + physical layer of a BTS comprising the following 3GPP specifications: + . + TS 05.01 "Physical layer on the radio path" + TS 05.02 "Multiplexing and Multiple Access on the Radio Path" + TS 05.04 "Modulation" + TS 05.10 "Radio subsystem synchronization" + . + In this context, BTS is "Base transceiver station". It's the stations that + connect mobile phones to the mobile network. + . + 3GPP is the "3rd Generation Partnership Project" which is the collaboration + between different telecommunication associations for developing new + generations of mobile phone networks. (post-2G/GSM) diff --git a/debian/rules-debian8-jessie b/debian/rules-debian8-jessie new file mode 100755 index 0000000..ac902c3 --- /dev/null +++ b/debian/rules-debian8-jessie @@ -0,0 +1,15 @@ +#!/usr/bin/make -f + +export DEB_BUILD_MAINT_OPTIONS = hardening=+all + +%: + dh $@ --with autoreconf + +override_dh_shlibdeps: + dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info + +override_dh_auto_configure: + dh_auto_configure -- --with-uhd --with-usrp1 + +override_dh_strip: + dh_strip --dbg-package=osmo-trx-dbg -- To view, visit https://gerrit.osmocom.org/10276 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I261302d2ed16e76540073589504e7426e23d00a1 Gerrit-Change-Number: 10276 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 16:25:01 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 31 Jul 2018 16:25:01 +0000 Subject: Change in osmo-ci[master]: obs-nightly: introduce osmo-trx-debian8-jessie Message-ID: lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/10277 Change subject: obs-nightly: introduce osmo-trx-debian8-jessie ...................................................................... obs-nightly: introduce osmo-trx-debian8-jessie A compatible package for debian8 as it does not support limesdr. This patch depend on: I261302d2ed16e76540073589504e7426e23d00a1 Change-Id: I8477b580976b376ee5abdde98a651d47199ef6d9 --- M scripts/osmocom-nightly-packages.sh 1 file changed, 13 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/77/10277/1 diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh index b616a8f..975127c 100755 --- a/scripts/osmocom-nightly-packages.sh +++ b/scripts/osmocom-nightly-packages.sh @@ -126,6 +126,16 @@ git checkout "$TAG" } +create_osmo_trx_debian8_jessie() { + # The package must be already checked out via `checkout osmo-trx` + cd "$REPO" + cp -a osmo-trx osmo-trx-debian8-jessie + cp osmo-trx-debian8-jessie/debian/control-debian8-jessie osmo-trx-debian8-jessie/debian/control + cp osmo-trx-debian8-jessie/debian/rules-debian8-jessie osmo-trx-debian8-jessie/debian/rules + cd osmo-trx-debian8-jessie/ + git commit -m "snapshot: apply debian 8 rules/control modifications" debian/ +} + build_osmocom() { BASE=$PWD DATA=$BASE/data @@ -165,6 +175,8 @@ checkout rtl-sdr checkout osmo-fl2k + create_osmo_trx_debian8_jessie + build limesuite no_commit --git-upstream-tree=01e2d00c5005b85d1f94cca02881756a72e35e2a build libosmocore build libosmo-sccp @@ -180,6 +192,7 @@ build openbsc build osmo-pcap build osmo-trx + build osmo-trx-debian8-jessie build osmo-sip-connector build osmo-bts build osmo-pcu -- To view, visit https://gerrit.osmocom.org/10277 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I8477b580976b376ee5abdde98a651d47199ef6d9 Gerrit-Change-Number: 10277 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 16:53:19 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Tue, 31 Jul 2018 16:53:19 +0000 Subject: Change in osmo-gsm-manuals[master]: mgw: Add new VTY reference Message-ID: daniel has uploaded this change for review. ( https://gerrit.osmocom.org/10278 Change subject: mgw: Add new VTY reference ...................................................................... mgw: Add new VTY reference Change-Id: Ic8ca983f3358aae9362fb21ff3a111f9c4f3935b --- M OsmoMGW/vty/mgw_vty_reference.xml 1 file changed, 15 insertions(+), 106 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/78/10278/1 diff --git a/OsmoMGW/vty/mgw_vty_reference.xml b/OsmoMGW/vty/mgw_vty_reference.xml index 5bb8e19..f11f484 100644 --- a/OsmoMGW/vty/mgw_vty_reference.xml +++ b/OsmoMGW/vty/mgw_vty_reference.xml @@ -85,12 +85,6 @@ - - - - - - @@ -192,15 +186,6 @@ - - - - - - - - - @@ -306,6 +291,12 @@ + + + + + + @@ -366,12 +357,6 @@ - - - - - - @@ -486,15 +471,6 @@ - - - - - - - - - @@ -600,6 +576,12 @@ + + + + + + @@ -1110,27 +1092,12 @@ - - - - - - - - - + - - - - - - - - - + + @@ -1140,13 +1107,6 @@ - - - - - - - @@ -1174,13 +1134,6 @@ - - - - - - - @@ -1225,14 +1178,6 @@ - - - - - - - - @@ -1249,24 +1194,6 @@ - - - - - - - - - - - - - - - - - - @@ -1483,24 +1410,6 @@ - - - - - - - - - - - - - - - - - - -- To view, visit https://gerrit.osmocom.org/10278 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ic8ca983f3358aae9362fb21ff3a111f9c4f3935b Gerrit-Change-Number: 10278 Gerrit-PatchSet: 1 Gerrit-Owner: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 16:53:19 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Tue, 31 Jul 2018 16:53:19 +0000 Subject: Change in osmo-gsm-manuals[master]: Add initial OsmoMGW manual Message-ID: daniel has uploaded this change for review. ( https://gerrit.osmocom.org/10279 Change subject: Add initial OsmoMGW manual ...................................................................... Add initial OsmoMGW manual Change-Id: I1b4ff96309d280c6a63105a6e06a82ec2e7b6908 --- M OsmoMGW/Makefile A OsmoMGW/chapters/configuration.adoc A OsmoMGW/chapters/counters.adoc A OsmoMGW/chapters/counters_generated.adoc A OsmoMGW/chapters/overview.adoc A OsmoMGW/chapters/running.adoc A OsmoMGW/osmomgw-usermanual-docinfo.xml A OsmoMGW/osmomgw-usermanual.adoc 8 files changed, 287 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/79/10279/1 diff --git a/OsmoMGW/Makefile b/OsmoMGW/Makefile index 46c97e4..b092e66 100644 --- a/OsmoMGW/Makefile +++ b/OsmoMGW/Makefile @@ -1,5 +1,9 @@ TOPDIR = .. +ASCIIDOC = osmomgw-usermanual.adoc +ASCIIDOC_DEPS = chapters/*.adoc +include $(TOPDIR)/build/Makefile.asciidoc.inc + VTY_REFERENCE = osmomgw-vty-reference.xml include $(TOPDIR)/build/Makefile.vty-reference.inc diff --git a/OsmoMGW/chapters/configuration.adoc b/OsmoMGW/chapters/configuration.adoc new file mode 100644 index 0000000..c398f25 --- /dev/null +++ b/OsmoMGW/chapters/configuration.adoc @@ -0,0 +1,57 @@ +== Configuring OsmoMGW + +A basic configation of OsmoMGW mainly consists of specifying the IP address +and port on which to listen to MGCP commands, but changing the port range at +which the RTP streams terminate as well as limiting operation to a single call +agent can be done as well as changing the number of endpoints. + +=== Configuring MGCP + +By default OsmoMGW listens for MGCP on port 2427 on any IP address. If a call +agent address is configured then OsmoMGW will only answer MGCP commands from +that IP port 2727, otherwise all sources are handled. A domain can be +specified + +.Example: MGCP configuration +---- +OsmoMGW(config-mgcp)# bind ip 127.0.0.1 +OsmoMGW(config-mgcp)# bind port 2427 +OsmoMGW(config-mgcp)# call-agent ip 127.0.0.1 +OsmoMGW(config-mgcp)# domain mgw-bsc +OsmoMGW(config-mgcp)# local ip 127.0.0.1 +---- + +=== Configuring the trunk + +The first trunk (trunk 0) is considered a virtual trunk in OsmoMGW. All +endpoints of type "rtpbridge" are routed here. The virtual trunk is configured +in the config-mgcp context. + +All other trunks are configured in the config-mgcp-trunk context, but the +commands used are identical. Right now trunks are considered only for ds/e1 +type endpoints which are not yet implemented. Don't use trunks other than the +"virtual" trunk 0. + +.Example: MGCP trunk configuration +---- +OsmoMGW(config-mgcp)# number endpoints 63 <1> +OsmoMGW(config-mgcp)# rtp bind-ip 10.0.0.1 <2> +OsmoMGW(config-mgcp)# rtp port-range 12000-14000 <3> +---- +<1> Maximum number of endpoints that can be allocated at once +<2> Use this IP when binding RTP endpoints +<3> Use ports in this range when binding RTP endpoints + +There are some options to tweak how RTP forwarding behaves in OsmoMGW: + +.Example: MGCP trunk rtp options +---- +OsmoMGW(config-mgcp)# rtp keep-alive 30 <1> +OsmoMGW(config-mgcp)# rtp-patch ssrc <2> +OsmoMGW(config-mgcp)# rtp-patch timestamp <3> +---- +<1> Send dummy UDP packets periodically to RTP destination +<2> Hide SSRC changes +<3> Ensure RTP timestamp is aligned with frame duration + + diff --git a/OsmoMGW/chapters/counters.adoc b/OsmoMGW/chapters/counters.adoc new file mode 100644 index 0000000..7fbb10c --- /dev/null +++ b/OsmoMGW/chapters/counters.adoc @@ -0,0 +1,4 @@ +[[counters]] +== Counters + +include::./counters_generated.adoc[] diff --git a/OsmoMGW/chapters/counters_generated.adoc b/OsmoMGW/chapters/counters_generated.adoc new file mode 100644 index 0000000..20a4dec --- /dev/null +++ b/OsmoMGW/chapters/counters_generated.adoc @@ -0,0 +1,14 @@ + +// autogenerated by show asciidoc counters +These counters and their description based on OsmoMGW 1.3.0.34-9cd52 (OsmoMGW). + +=== Rate Counters + +// generating tables for rate_ctr_group +== Osmo Stat Items + +// generating tables for osmo_stat_items +== Osmo Counters + +// generating tables for osmo_counters +// there are no ungrouped osmo_counters diff --git a/OsmoMGW/chapters/overview.adoc b/OsmoMGW/chapters/overview.adoc new file mode 100644 index 0000000..4ac79f2 --- /dev/null +++ b/OsmoMGW/chapters/overview.adoc @@ -0,0 +1,105 @@ +[[overview]] +== Overview + +This manual should help you getting started with OsmoMGW. It will cover +aspects of configuring and running the media gateway. + +[[intro_overview]] +=== About OsmoMGW + +OsmoMGW is the Osmocom implementation of a media gateway to handle user +plane (voice) traffic in cellular networks. It can connect and optionally +transcode RTP voice streams between different network elements such as BTSs +and external entities like SIP. It is typically co-located with both OsmoBSC +and OsmoMSC and controlled by them via MGCP, the Media Gateway Control +Protocol. + +[[fig-bsc]] +.OsmoMGW used with OsmoBSC +[graphviz] +---- +digraph G { + rankdir = LR; + OsmoBTS -> OsmoBSC [label="Abis/IP"]; + OsmoBSC -> OsmoMSC [label="3GPP AoIP"]; + OsmoBSC -> OsmoMGW [label="MGCP"]; + OsmoBTS -> OsmoMGW [label="RTP",dir=both]; + OsmoMGW -> OsmoMSC [label="RTP",dir=both]; + {rank=same OsmoBSC OsmoMGW} + OsmoMGW [color=red]; +} +---- + +[[fig-msc]] +.OsmoMGW used with OsmoMSC +[graphviz] +---- +digraph G { + rankdir = LR; + BTS -> BSC [label="Abis"]; + BSC -> OsmoMSC [label="3GPP AoIP"]; + OsmoMSC -> OsmoMGW [label="MGCP"]; + BSC -> OsmoMGW [label="RTP",dir=both]; + OsmoMSC -> OsmoSIP [label="MNCC"]; + OsmoSIP -> PBX [label="SIP Trunk"]; + OsmoMGW -> PBX [label="RTP",dir=both]; + {rank=same OsmoMSC OsmoMGW} + OsmoSIP [label="osmo-sip-connector"]; + OsmoMGW [color=red]; + + hNodeB -> OsmoHNBGW [label="Iuh"]; + OsmoHNBGW -> OsmoMSC [label="IuCS"]; + hNodeB -> OsmoMGW [label="RTP",dir=both]; +} +---- + +=== Software Components + +OsmoMGW contains a variety of different software components, which we?ll +quickly describe in this section. + +==== MGCP Implementation + +OsmoMGW brings its own MGCP implementation through which OsmoMGW is +controlled. + +The commands implemented are CRCX, MDCX, DLCX and RSIP. The command AUEP is +implemented as a stub and will simply respond with OK. + +==== RTP implementation + +Support for IuUP which is used in 3G cells is quite lacking at the moment. +3G<->3G and 2G<->2G calls should work, but 3G<->2G does not. + +==== Audio transcoder + +Although there is basic support for transcoding, please note that this feature +is not currently being used in production/testing setups and may not work or +work only partially. + +Support for transcoding needs to be enabled at compile-time which regular +packages do not do. + +=== Limitations + +Osmux is not yet supported in OsmoMGW. + +At the moment (July 2018), OsmoMGW only implements RTP proxy / RTP bridge +type endpoints, to each of which two RTP connections can be established. +We are planning to add endpoint types for: + +- classic E1/T1 timeslots (64kBps alaw/ulaw) +- classic E1/T1 16k sub-slots with TRAU frames for classic BTS support +- announcement/playout end-points +- conference endpoints + +=== Additional resources + +You can find the OsmoMGW issue tracker and wiki online at + +- https://osmocom.org/projects/osmomgw +- https://osmocom.org/projects/osmomgw/wiki + +RFC 3435 for MGCP is located at + +- https://tools.ietf.org/html/rfc3435 diff --git a/OsmoMGW/chapters/running.adoc b/OsmoMGW/chapters/running.adoc new file mode 100644 index 0000000..8565ea5 --- /dev/null +++ b/OsmoMGW/chapters/running.adoc @@ -0,0 +1,25 @@ +== Running OsmoMGW + +The OsmoMGW executable (`osmo-mgw`) offers the following command-line +arguments: + +=== SYNOPSIS + +*osmo-mgw* [-h|-V] [-D] [-c 'CONFIGFILE'] [-s] + +=== OPTIONS + +*-h, --help*:: + Print a short help message about the supported options +*-V, --version*:: + Print the compile-time version number of the OsmoBTS program +*-D, --daemonize*:: + Fork the process as a daemon into background. +*-c, --config-file 'CONFIGFILE'*:: + Specify the file and path name of the configuration file to be + used. If none is specified, use `osmo-mgw.cfg` in the current + working directory. +*-s, --disable-color*:: + Disable colors for logging to stderr. This has mostly been + deprecated by VTY based logging configuration, see <> + for more information. diff --git a/OsmoMGW/osmomgw-usermanual-docinfo.xml b/OsmoMGW/osmomgw-usermanual-docinfo.xml new file mode 100644 index 0000000..d801c9b --- /dev/null +++ b/OsmoMGW/osmomgw-usermanual-docinfo.xml @@ -0,0 +1,47 @@ + + + 1 + July 24th, 2018 + DW + + Initial version + + + + + + + Daniel + Willmann + dwillmann at sysmocom.de + DW + + sysmocom + sysmocom - s.f.m.c. GmbH + + + + + + 2018 + sysmocom - s.f.m.c. GmbH + + + + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.3 or any later version published by the Free Software + Foundation; with the Invariant Sections being just 'Foreword', + 'Acknowledgements' and 'Preface', with no Front-Cover Texts, + and no Back-Cover Texts. A copy of the license is included in + the section entitled "GNU Free Documentation License". + + + The Asciidoc source code of this manual can be found at + + http://git.osmocom.org/osmo-gsm-manuals/ + + + + diff --git a/OsmoMGW/osmomgw-usermanual.adoc b/OsmoMGW/osmomgw-usermanual.adoc new file mode 100644 index 0000000..c0178e2 --- /dev/null +++ b/OsmoMGW/osmomgw-usermanual.adoc @@ -0,0 +1,31 @@ +:gfdl-enabled: +:program-name: OsmoMGW + +OsmoMGW User Manual +==================== +Daniel Willmann + + +include::../common/chapters/preface.adoc[] + +include::chapters/overview.adoc[] + +include::chapters/running.adoc[] + +include::../common/chapters/vty.adoc[] + +include::../common/chapters/logging.adoc[] + +include::chapters/configuration.adoc[] + +include::chapters/counters.adoc[] + +include::../common/chapters/port_numbers.adoc[] + +include::../common/chapters/bibliography.adoc[] + +include::../common/chapters/glossary.adoc[] + +include::../common/chapters/gfdl.adoc[] + + -- To view, visit https://gerrit.osmocom.org/10279 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I1b4ff96309d280c6a63105a6e06a82ec2e7b6908 Gerrit-Change-Number: 10279 Gerrit-PatchSet: 1 Gerrit-Owner: daniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 17:08:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 17:08:47 +0000 Subject: Change in osmo-gsm-manuals[master]: mgw: Add new VTY reference In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10278 ) Change subject: mgw: Add new VTY reference ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10278 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ic8ca983f3358aae9362fb21ff3a111f9c4f3935b Gerrit-Change-Number: 10278 Gerrit-PatchSet: 2 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 31 Jul 2018 17:08:47 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 17:09:38 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Tue, 31 Jul 2018 17:09:38 +0000 Subject: Change in osmo-bts[master]: fix conditions for sending fill frames during RTS IND Message-ID: Stefan Sperling has uploaded this change for review. ( https://gerrit.osmocom.org/10280 Change subject: fix conditions for sending fill frames during RTS IND ...................................................................... fix conditions for sending fill frames during RTS IND Rewrite an if-statement to better match the description given in GSM 05.08, and quote the relevant paragraph in a comment. Since this entire block of code only runs for SDCCH and TCH, this new condition should provide the same result expect that in accordance with the standard we now stop sending fill-frames on a signalling TCH if DTX is in use. Also note that this code should already cover parts of the patch proposed at https://gerrit.osmocom.org/c/osmo-bts/+/5753 The changes to osmo-bts-litecell15/l1_if.c proposed there should be equivalent to the fill-frame logic in this existing common BTS code which is handling RTS IND. Change-Id: Ibaf3ecbd0bde4f37e799d5e2f5d00dc695e0139a Related: OS#1950 --- M src/common/l1sap.c 1 file changed, 10 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/80/10280/1 diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 8936674..8d735e5 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -758,9 +758,16 @@ memcpy(p + 2, si, GSM_MACBLOCK_LEN - 2); } else memcpy(p + 2, fill_frame, GSM_MACBLOCK_LEN - 2); - } else if ((!L1SAP_IS_CHAN_TCHF(chan_nr) && !L1SAP_IS_CHAN_TCHH(chan_nr)) - || lchan->rsl_cmode == RSL_CMOD_SPD_SIGN) { - /* send fill frame only, if not TCH/x != Signalling, otherwise send empty frame */ + } else if (L1SAP_IS_CHAN_SDCCH4(chan_nr) || L1SAP_IS_CHAN_SDCCH8(chan_nr) || + (lchan->rsl_cmode == RSL_CMOD_SPD_SIGN && !lchan->ts->trx->bts->dtxd)) { + /* + * SDCCH or TCH in signalling mode without DTX. + * + * Send fill frame according to GSM 05.08, section 8.3: "On the SDCCH and on the + * half rate speech traffic channel in signalling only mode DTX is not allowed. + * In these cases and during signalling on the TCH when DTX is not used, the same + * L2 fill frame shall be transmitted in case there is nothing else to transmit." + */ p = msgb_put(msg, GSM_MACBLOCK_LEN); memcpy(p, fill_frame, GSM_MACBLOCK_LEN); } /* else the message remains empty, so TCH frames are sent */ -- To view, visit https://gerrit.osmocom.org/10280 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ibaf3ecbd0bde4f37e799d5e2f5d00dc695e0139a Gerrit-Change-Number: 10280 Gerrit-PatchSet: 1 Gerrit-Owner: Stefan Sperling -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 17:18:10 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 17:18:10 +0000 Subject: Change in osmo-mgw[master]: mgcp_network: translate payload type numbers in RTP packets In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10172 ) Change subject: mgcp_network: translate payload type numbers in RTP packets ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10172 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3a874e59fa07bcc2a67c376cafa197360036f539 Gerrit-Change-Number: 10172 Gerrit-PatchSet: 3 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Comment-Date: Tue, 31 Jul 2018 17:18:10 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 17:18:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 17:18:14 +0000 Subject: Change in osmo-mgw[master]: mgcp_client_fsm: allow ptmap in mgcp_client_fsm as well In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10171 ) Change subject: mgcp_client_fsm: allow ptmap in mgcp_client_fsm as well ...................................................................... mgcp_client_fsm: allow ptmap in mgcp_client_fsm as well The regular version of the mgcp_client supports the configuration of of custom payload types. In case some corner cases require a specific dynamic paylod type number that is not according to 3GPP standards has to be used the user can override the standard settings. However the fsm based variant of the mgcp_client does not have that feature but it should have it as well. - add struct members for ptmap config. - pass configuration values down to the underlying magcp client. Change-Id: If176a3719dd9e888da16196d5fc0bdb53cc2a5f2 Related: OS#2728 Related: OS#3384 --- M include/osmocom/mgcp_client/mgcp_client_fsm.h M src/libosmo-mgcp-client/mgcp_client_fsm.c 2 files changed, 17 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/mgcp_client/mgcp_client_fsm.h b/include/osmocom/mgcp_client/mgcp_client_fsm.h index 353baff..81d3dea 100644 --- a/include/osmocom/mgcp_client/mgcp_client_fsm.h +++ b/include/osmocom/mgcp_client/mgcp_client_fsm.h @@ -34,6 +34,14 @@ /*! Number of codecs in RTP codec list (optional) */ unsigned int codecs_len; + + /*! RTP payload type map (optional, only needed when payload types are + * used that differ from what IANA/3GPP defines) */ + struct ptmap ptmap[MGCP_MAX_CODECS]; + + /*! RTP payload type map length (optional, only needed when payload + * types are used that differ from what IANA/3GPP defines) */ + unsigned int ptmap_len; }; struct osmo_fsm_inst *mgcp_conn_create(struct mgcp_client *mgcp, struct osmo_fsm_inst *parent_fi, uint32_t parent_term_evt, diff --git a/src/libosmo-mgcp-client/mgcp_client_fsm.c b/src/libosmo-mgcp-client/mgcp_client_fsm.c index fe1590f..a0dc0fb 100644 --- a/src/libosmo-mgcp-client/mgcp_client_fsm.c +++ b/src/libosmo-mgcp-client/mgcp_client_fsm.c @@ -114,10 +114,12 @@ .call_id = mgcp_ctx->conn_peer_local.call_id, .conn_mode = MGCP_CONN_RECV_ONLY, .ptime = mgcp_ctx->conn_peer_local.ptime, - .codecs_len = mgcp_ctx->conn_peer_local.codecs_len + .codecs_len = mgcp_ctx->conn_peer_local.codecs_len, + .ptmap_len = mgcp_ctx->conn_peer_local.ptmap_len }; osmo_strlcpy(mgcp_msg.endpoint, mgcp_ctx->conn_peer_local.endpoint, MGCP_ENDPOINT_MAXLEN); memcpy(mgcp_msg.codecs, mgcp_ctx->conn_peer_local.codecs, sizeof(mgcp_msg.codecs)); + memcpy(mgcp_msg.ptmap, mgcp_ctx->conn_peer_local.ptmap, sizeof(mgcp_msg.ptmap)); return mgcp_msg_gen(mgcp_ctx->mgcp, &mgcp_msg); } @@ -136,10 +138,12 @@ .audio_ip = mgcp_ctx->conn_peer_local.addr, .audio_port = mgcp_ctx->conn_peer_local.port, .ptime = mgcp_ctx->conn_peer_local.ptime, - .codecs_len = mgcp_ctx->conn_peer_local.codecs_len + .codecs_len = mgcp_ctx->conn_peer_local.codecs_len, + .ptmap_len = mgcp_ctx->conn_peer_local.ptmap_len }; osmo_strlcpy(mgcp_msg.endpoint, mgcp_ctx->conn_peer_local.endpoint, MGCP_ENDPOINT_MAXLEN); memcpy(mgcp_msg.codecs, mgcp_ctx->conn_peer_local.codecs, sizeof(mgcp_msg.codecs)); + memcpy(mgcp_msg.ptmap, mgcp_ctx->conn_peer_local.ptmap, sizeof(mgcp_msg.ptmap)); return mgcp_msg_gen(mgcp_ctx->mgcp, &mgcp_msg); } @@ -158,10 +162,12 @@ .audio_ip = mgcp_ctx->conn_peer_local.addr, .audio_port = mgcp_ctx->conn_peer_local.port, .ptime = mgcp_ctx->conn_peer_local.ptime, - .codecs_len = mgcp_ctx->conn_peer_local.codecs_len + .codecs_len = mgcp_ctx->conn_peer_local.codecs_len, + .ptmap_len = mgcp_ctx->conn_peer_local.ptmap_len }; osmo_strlcpy(mgcp_msg.endpoint, mgcp_ctx->conn_peer_remote.endpoint, MGCP_ENDPOINT_MAXLEN); memcpy(mgcp_msg.codecs, mgcp_ctx->conn_peer_local.codecs, sizeof(mgcp_msg.codecs)); + memcpy(mgcp_msg.ptmap, mgcp_ctx->conn_peer_local.ptmap, sizeof(mgcp_msg.ptmap)); /* Note: We take the endpoint and the call_id from the remote * connection info, because we can be confident that the -- To view, visit https://gerrit.osmocom.org/10171 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: If176a3719dd9e888da16196d5fc0bdb53cc2a5f2 Gerrit-Change-Number: 10171 Gerrit-PatchSet: 2 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 17:18:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 17:18:15 +0000 Subject: Change in osmo-mgw[master]: mgcp_network: translate payload type numbers in RTP packets In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10172 ) Change subject: mgcp_network: translate payload type numbers in RTP packets ...................................................................... mgcp_network: translate payload type numbers in RTP packets Since no transcoding is in place osmo-mgw forwards the incoming rtp packets as they are (there may be minor modifications of the header) from an ingress connection to an egress connection. This works without problems as long as both connections use the same payload type. For IANA defined fixed payload type numbers this is usually the case, but for dynemic payload type numbers both ends may set up the same codecs but with different payload type numbers. When different payload type numbers are set up, and the packet is passed through without modification, it will have the wrong payload type when it is sent. The receiving end may then toss the packet since it expects packets with the payload type it has configured. The machanism, which is introduced with this patch looks up actual codec inside the struct data of the ingress connection and then looks for the matching codec in the struct data of the egress connection. When it finds the codec there it looks up the payload type of this codec. The header of the RTP packet is then patched with the correct payoad type. - Add function mgcp_codec_pt_translate() to look up the payload type - Add unit-test for function mgcp_codec_pt_translate() - Add payload type translation to mgcp_network.c Change-Id: I3a874e59fa07bcc2a67c376cafa197360036f539 Related: OS#2728 Related: OS#3384 --- M include/osmocom/mgcp/mgcp_codec.h M src/libosmo-mgcp/mgcp_codec.c M src/libosmo-mgcp/mgcp_network.c M tests/mgcp/mgcp_test.c 4 files changed, 203 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/mgcp/mgcp_codec.h b/include/osmocom/mgcp/mgcp_codec.h index f8d5e70..334913b 100644 --- a/include/osmocom/mgcp/mgcp_codec.h +++ b/include/osmocom/mgcp/mgcp_codec.h @@ -4,3 +4,4 @@ void mgcp_codec_reset_all(struct mgcp_conn_rtp *conn); int mgcp_codec_add(struct mgcp_conn_rtp *conn, int payload_type, const char *audio_name); int mgcp_codec_decide(struct mgcp_conn_rtp *conn); +int mgcp_codec_pt_translate(struct mgcp_conn_rtp *conn_src, struct mgcp_conn_rtp *conn_dst, int payload_type); diff --git a/src/libosmo-mgcp/mgcp_codec.c b/src/libosmo-mgcp/mgcp_codec.c index 2ce90dd..55be554 100644 --- a/src/libosmo-mgcp/mgcp_codec.c +++ b/src/libosmo-mgcp/mgcp_codec.c @@ -341,3 +341,70 @@ return -EINVAL; } + +/* Compare two codecs, all parameters must match up, except for the payload type + * number. */ +static bool codecs_cmp(struct mgcp_rtp_codec *codec_a, struct mgcp_rtp_codec *codec_b) +{ + if (codec_a->rate != codec_b->rate) + return false; + if (codec_a->channels != codec_b->channels) + return false; + if (codec_a->frame_duration_num != codec_b->frame_duration_num) + return false; + if (codec_a->frame_duration_den != codec_b->frame_duration_den) + return false; + if (strcmp(codec_a->audio_name, codec_b->audio_name)) + return false; + if (strcmp(codec_a->subtype_name, codec_b->subtype_name)) + return false; + + return true; +} + +/*! Translate a given payload type number that belongs to the packet of a + * source connection to the equivalent payload type number that matches the + * configuration of a destination connection. + * \param[in] conn_src related source rtp-connection. + * \param[in] conn_dst related destination rtp-connection. + * \param[in] payload_type number from the source packet or source connection. + * \returns translated payload type number on success, -EINVAL on failure. */ +int mgcp_codec_pt_translate(struct mgcp_conn_rtp *conn_src, struct mgcp_conn_rtp *conn_dst, int payload_type) +{ + struct mgcp_rtp_end *rtp_src; + struct mgcp_rtp_end *rtp_dst; + struct mgcp_rtp_codec *codec_src = NULL; + struct mgcp_rtp_codec *codec_dst = NULL; + unsigned int i; + unsigned int codecs_assigned; + + rtp_src = &conn_src->end; + rtp_dst = &conn_dst->end; + + /* Find the codec information that is used on the source side */ + codecs_assigned = rtp_src->codecs_assigned; + OSMO_ASSERT(codecs_assigned <= MGCP_MAX_CODECS); + for (i = 0; i < codecs_assigned; i++) { + if (payload_type == rtp_src->codecs[i].payload_type) { + codec_src = &rtp_src->codecs[i]; + break; + } + } + if (!codec_src) + return -EINVAL; + + /* Use the codec infrmation from the source and try to find the + * equivalent of it on the destination side */ + codecs_assigned = rtp_dst->codecs_assigned; + OSMO_ASSERT(codecs_assigned <= MGCP_MAX_CODECS); + for (i = 0; i < codecs_assigned; i++) { + if (codecs_cmp(codec_src, &rtp_dst->codecs[i])) { + codec_dst = &rtp_dst->codecs[i]; + break; + } + } + if (!codec_dst) + return -EINVAL; + + return codec_dst->payload_type; +} diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c index 3ac93be..1b1867a 100644 --- a/src/libosmo-mgcp/mgcp_network.c +++ b/src/libosmo-mgcp/mgcp_network.c @@ -40,8 +40,10 @@ #include #include #include +#include #include + #define RTP_SEQ_MOD (1 << 16) #define RTP_MAX_DROPOUT 3000 #define RTP_MAX_MISORDER 100 @@ -474,6 +476,28 @@ state->stats.max_seq = seq; } +/* There may be different payload type numbers negotiated for two connections. + * Patch the payload type of an RTP packet so that it uses the payload type + * that is valid for the destination connection (conn_dst) */ +static int mgcp_patch_pt(struct mgcp_conn_rtp *conn_src, + struct mgcp_conn_rtp *conn_dst, char *data, int len) +{ + struct rtp_hdr *rtp_hdr; + uint8_t pt_in; + int pt_out; + + OSMO_ASSERT(len >= sizeof(struct rtp_hdr)); + rtp_hdr = (struct rtp_hdr *)data; + + pt_in = rtp_hdr->payload_type; + pt_out = mgcp_codec_pt_translate(conn_src, conn_dst, pt_in); + if (pt_out < 0) + return -EINVAL; + + rtp_hdr->payload_type = (uint8_t) pt_out; + return 0; +} + /* The RFC 3550 Appendix A assumes there are multiple sources but * some of the supported endpoints (e.g. the nanoBTS) can only handle * one source and this code will patch RTP header to appear as if there @@ -665,6 +689,7 @@ struct mgcp_rtp_end *rtp_end; struct mgcp_rtp_state *rtp_state; char *dest_name; + int rc; OSMO_ASSERT(conn_src); OSMO_ASSERT(conn_dst); @@ -684,6 +709,21 @@ ENDPOINT_NUMBER(endp), tcfg->audio_loop, conn_src->conn->mode, conn_src->conn->mode == MGCP_CONN_LOOPBACK ? " (loopback)" : ""); + /* FIXME: It is legal that the payload type on the egress connection is + * different from the payload type that has been negotiated on the + * ingress connection. Essentially the codecs are the same so we can + * match them and patch the payload type. However, if we can not find + * the codec pendant (everything ist equal except the PT), we are of + * course unable to patch the payload type. A situation like this + * should not occur if transcoding is consequently avoided. Until + * we have transcoding support in osmo-mgw we can not resolve this. */ + rc = mgcp_patch_pt(conn_src, conn_dst, buf, len); + if (rc < 0) { + LOGP(DRTP, LOGL_ERROR, + "endpoint:0x%x can not patch PT because no suitable egress codec was found.\n", + ENDPOINT_NUMBER(endp)); + } + /* Note: In case of loopback configuration, both, the source and the * destination will point to the same connection. */ rtp_end = &conn_dst->end; diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c index 56d0cee..df6ea2f 100644 --- a/tests/mgcp/mgcp_test.c +++ b/tests/mgcp/mgcp_test.c @@ -1616,6 +1616,100 @@ OSMO_ASSERT(check_local_cx_options(ctx, ",,,") == -1); } +static void test_mgcp_codec_pt_translate_pars(struct mgcp_rtp_codec *c) +{ + c->rate = 8000; + c->channels = 1; + c->frame_duration_num = 23; + c->frame_duration_den = 42; +} + +static void test_mgcp_codec_pt_translate(void) +{ + struct mgcp_conn_rtp conn_src; + struct mgcp_conn_rtp conn_dst; + int pt_dst; + + /* Setup a realistic set of codec configurations on both + * ends. AMR and HR will use different payload types. PCMU + * must use 0 on both ends since this is not a dynamic payload + * type */ + test_mgcp_codec_pt_translate_pars(&conn_src.end.codecs[0]); + test_mgcp_codec_pt_translate_pars(&conn_dst.end.codecs[0]); + test_mgcp_codec_pt_translate_pars(&conn_src.end.codecs[1]); + test_mgcp_codec_pt_translate_pars(&conn_dst.end.codecs[1]); + test_mgcp_codec_pt_translate_pars(&conn_src.end.codecs[2]); + test_mgcp_codec_pt_translate_pars(&conn_dst.end.codecs[2]); + conn_src.end.codecs[0].payload_type = 112; + conn_dst.end.codecs[0].payload_type = 96; + conn_src.end.codecs[1].payload_type = 0; + conn_dst.end.codecs[1].payload_type = 0; + conn_src.end.codecs[2].payload_type = 111; + conn_dst.end.codecs[2].payload_type = 97; + conn_src.end.codecs[0].audio_name = "AMR/8000/1"; + conn_dst.end.codecs[0].audio_name = "AMR/8000/1"; + conn_src.end.codecs[1].audio_name = "PCMU/8000/1"; + conn_dst.end.codecs[1].audio_name = "PCMU/8000/1"; + conn_src.end.codecs[2].audio_name = "GSM-HR-08/8000/1"; + conn_dst.end.codecs[2].audio_name = "GSM-HR-08/8000/1"; + conn_src.end.codecs[0].subtype_name = "AMR"; + conn_dst.end.codecs[0].subtype_name = "AMR"; + conn_src.end.codecs[1].subtype_name = "PCMU"; + conn_dst.end.codecs[1].subtype_name = "PCMU"; + conn_src.end.codecs[2].subtype_name = "GSM-HR-08"; + conn_dst.end.codecs[2].subtype_name = "GSM-HR-08"; + conn_src.end.codecs_assigned = 3; + conn_dst.end.codecs_assigned = 3; + + /* We expect the function to find the PT we must use when we send the + * packet out to the destination. All we know is the context for both + * connections and the payload type from the source packet */ + pt_dst = + mgcp_codec_pt_translate(&conn_src, &conn_dst, + conn_src.end.codecs[0].payload_type); + OSMO_ASSERT(pt_dst == conn_dst.end.codecs[0].payload_type); + pt_dst = + mgcp_codec_pt_translate(&conn_src, &conn_dst, + conn_src.end.codecs[1].payload_type); + OSMO_ASSERT(pt_dst == conn_dst.end.codecs[1].payload_type); + pt_dst = + mgcp_codec_pt_translate(&conn_src, &conn_dst, + conn_src.end.codecs[2].payload_type); + OSMO_ASSERT(pt_dst == conn_dst.end.codecs[2].payload_type); + + /* Try some constellations that must fail */ + pt_dst = mgcp_codec_pt_translate(&conn_src, &conn_dst, 123); + OSMO_ASSERT(pt_dst == -EINVAL); + conn_src.end.codecs_assigned = 0; + conn_dst.end.codecs_assigned = 3; + pt_dst = + mgcp_codec_pt_translate(&conn_src, &conn_dst, + conn_src.end.codecs[0].payload_type); + OSMO_ASSERT(pt_dst == -EINVAL); + pt_dst = + mgcp_codec_pt_translate(&conn_src, &conn_dst, + conn_src.end.codecs[1].payload_type); + OSMO_ASSERT(pt_dst == -EINVAL); + pt_dst = + mgcp_codec_pt_translate(&conn_src, &conn_dst, + conn_src.end.codecs[2].payload_type); + OSMO_ASSERT(pt_dst == -EINVAL); + conn_src.end.codecs_assigned = 3; + conn_dst.end.codecs_assigned = 0; + pt_dst = + mgcp_codec_pt_translate(&conn_src, &conn_dst, + conn_src.end.codecs[0].payload_type); + OSMO_ASSERT(pt_dst == -EINVAL); + pt_dst = + mgcp_codec_pt_translate(&conn_src, &conn_dst, + conn_src.end.codecs[1].payload_type); + OSMO_ASSERT(pt_dst == -EINVAL); + pt_dst = + mgcp_codec_pt_translate(&conn_src, &conn_dst, + conn_src.end.codecs[2].payload_type); + OSMO_ASSERT(pt_dst == -EINVAL); +} + int main(int argc, char **argv) { void *ctx = talloc_named_const(NULL, 0, "mgcp_test"); @@ -1639,6 +1733,7 @@ test_osmux_cid(); test_get_lco_identifier(); test_check_local_cx_options(ctx); + test_mgcp_codec_pt_translate(); OSMO_ASSERT(talloc_total_size(msgb_ctx) == 0); OSMO_ASSERT(talloc_total_blocks(msgb_ctx) == 1); -- To view, visit https://gerrit.osmocom.org/10172 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I3a874e59fa07bcc2a67c376cafa197360036f539 Gerrit-Change-Number: 10172 Gerrit-PatchSet: 4 Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 17:19:10 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 17:19:10 +0000 Subject: Change in osmo-hlr[master]: debian: Add sub-package for libosmo-gsup-client Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10281 Change subject: debian: Add sub-package for libosmo-gsup-client ...................................................................... debian: Add sub-package for libosmo-gsup-client Change-Id: Iad227bb477d64da30dd6bfbbe1bd0c0a55be9474 --- M debian/control A debian/libosmo-gsup-client-dev.install A debian/libosmo-gsup-client0.install 3 files changed, 30 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/81/10281/1 diff --git a/debian/control b/debian/control index d3a32c5..2cbcdca 100644 --- a/debian/control +++ b/debian/control @@ -32,3 +32,27 @@ Depends: osmo-hlr (= ${binary:Version}), ${misc:Depends} Description: Debug symbols for the osmo-hlr Make debugging possible + +Package: libosmo-gsup-client0 +Section: libs +Architecture: any +Multi-Arch: same +Depends: ${shlibs:Depends}, + ${misc:Depends} +Pre-Depends: ${misc:Pre-Depends} +Description: Osmocom GSUP (General Subscriber Update Protocol) client library + This is a shared library that can be used to implement client programs for + the GSUP protcol. The typical GSUP server is OsmoHLR, with OsmoMSC, OsmoSGSN + and External USSD Entities (EUSEs) using this library to implement clients. + +Package: libosmo-gsup-client-dev +Architecture: any +Multi-Arch: same +Depends: ${misc:Depends}, + libosmocore-dev +Description: Development headers of Osmocom GSUP client library + This is a shared library that can be used to implement client programs for + the GSUP protcol. The typical GSUP server is OsmoHLR, with OsmoMSC, OsmoSGSN + and External USSD Entities (EUSEs) using this library to implement clients. + . + This package contains the development headers. diff --git a/debian/libosmo-gsup-client-dev.install b/debian/libosmo-gsup-client-dev.install new file mode 100644 index 0000000..8a75973 --- /dev/null +++ b/debian/libosmo-gsup-client-dev.install @@ -0,0 +1,5 @@ +usr/include/osmocom/gsupclient +usr/lib/*/libosmo-gsup-client*.a +usr/lib/*/libosmo-gsup-client*.so +usr/lib/*/libosmo-gsup-client*.la +usr/lib/*/pkgconfig/libosmo-gsup-client.pc diff --git a/debian/libosmo-gsup-client0.install b/debian/libosmo-gsup-client0.install new file mode 100644 index 0000000..78cd89f --- /dev/null +++ b/debian/libosmo-gsup-client0.install @@ -0,0 +1 @@ +usr/lib/*/libosmo-gsup-client*.so.* -- To view, visit https://gerrit.osmocom.org/10281 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iad227bb477d64da30dd6bfbbe1bd0c0a55be9474 Gerrit-Change-Number: 10281 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 17:20:04 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 17:20:04 +0000 Subject: Change in osmo-hlr[master]: debian: Add sub-package for libosmo-gsup-client In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10281 ) Change subject: debian: Add sub-package for libosmo-gsup-client ...................................................................... Patch Set 2: Code-Review+2 verified locally using pbuilder / pdebuild -- To view, visit https://gerrit.osmocom.org/10281 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iad227bb477d64da30dd6bfbbe1bd0c0a55be9474 Gerrit-Change-Number: 10281 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-CC: Jenkins Builder Gerrit-Comment-Date: Tue, 31 Jul 2018 17:20:04 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 17:20:51 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 17:20:51 +0000 Subject: Change in osmo-sgsn[master]: migrate to oap_client in libosmogsm In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10259 ) Change subject: migrate to oap_client in libosmogsm ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/10259 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7b194f98ef3f925b6178d8a8dbd9fcf2f0c6e132 Gerrit-Change-Number: 10259 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 31 Jul 2018 17:20:51 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 17:20:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 17:20:52 +0000 Subject: Change in osmo-sgsn[master]: migrate to oap_client in libosmogsm In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10259 ) Change subject: migrate to oap_client in libosmogsm ...................................................................... migrate to oap_client in libosmogsm libosmogsm in libosmocore.git from Change-Id Ie36729996abd30b84d1c30a09f62ebc6a9794950 onwards contains oap_client.c, so we don't need our local copy here in this repo anymore. Change-Id: I7b194f98ef3f925b6178d8a8dbd9fcf2f0c6e132 Requires: libosmocore.git Change-Id Ie36729996abd30b84d1c30a09f62ebc6a9794950 --- M configure.ac M include/osmocom/sgsn/Makefile.am M include/osmocom/sgsn/gsup_client.h D include/osmocom/sgsn/oap_client.h M include/osmocom/sgsn/sgsn.h M src/gprs/Makefile.am M src/gprs/gsup_client.c D src/gprs/oap_client.c M src/libcommon/gsup_client.c D src/libcommon/oap_client.c M tests/Makefile.am D tests/oap/Makefile.am D tests/oap/oap_client_test.c D tests/oap/oap_client_test.err D tests/oap/oap_client_test.ok M tests/sgsn/Makefile.am M tests/testsuite.at 17 files changed, 15 insertions(+), 1,010 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/configure.ac b/configure.ac index 2b5bb1a..c233fa3 100644 --- a/configure.ac +++ b/configure.ac @@ -194,7 +194,6 @@ tests/gprs/Makefile tests/gbproxy/Makefile tests/sgsn/Makefile - tests/oap/Makefile tests/gtphub/Makefile tests/xid/Makefile tests/sndcp_xid/Makefile diff --git a/include/osmocom/sgsn/Makefile.am b/include/osmocom/sgsn/Makefile.am index 3f63b9f..269cebc 100644 --- a/include/osmocom/sgsn/Makefile.am +++ b/include/osmocom/sgsn/Makefile.am @@ -17,7 +17,6 @@ gprs_utils.h \ gsup_client.h \ gtphub.h \ - oap_client.h \ sgsn.h \ signal.h \ slhc.h \ diff --git a/include/osmocom/sgsn/gsup_client.h b/include/osmocom/sgsn/gsup_client.h index 29092ad..6ba0d15 100644 --- a/include/osmocom/sgsn/gsup_client.h +++ b/include/osmocom/sgsn/gsup_client.h @@ -23,7 +23,7 @@ #include -#include +#include #define GSUP_CLIENT_RECONNECT_INTERVAL 10 #define GSUP_CLIENT_PING_INTERVAL 20 @@ -43,7 +43,7 @@ gsup_client_read_cb_t read_cb; void *data; - struct oap_client_state oap_state; + struct osmo_oap_client_state oap_state; struct osmo_timer_list ping_timer; struct osmo_timer_list connect_timer; @@ -55,7 +55,7 @@ const char *ip_addr, unsigned int tcp_port, gsup_client_read_cb_t read_cb, - struct oap_client_config *oapc_config); + struct osmo_oap_client_config *oapc_config); void gsup_client_destroy(struct gsup_client *gsupc); int gsup_client_send(struct gsup_client *gsupc, struct msgb *msg); diff --git a/include/osmocom/sgsn/oap_client.h b/include/osmocom/sgsn/oap_client.h deleted file mode 100644 index 80c86d5..0000000 --- a/include/osmocom/sgsn/oap_client.h +++ /dev/null @@ -1,82 +0,0 @@ -/* Osmocom Authentication Protocol API */ - -/* (C) 2015 by Sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * Author: Neels Hofmeyr - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#pragma once - -#include - -struct msgb; -struct osmo_oap_message; - -/* This is the config part for vty. It is essentially copied in - * oap_client_state, where values are copied over once the config is - * considered valid. */ -struct oap_client_config { - uint16_t client_id; - int secret_k_present; - uint8_t secret_k[16]; - int secret_opc_present; - uint8_t secret_opc[16]; -}; - -/* The runtime state of the OAP client. client_id and the secrets are in fact - * duplicated from oap_client_config, so that a separate validation of the - * config data is possible, and so that only a struct oap_client_state* is - * passed around. */ -struct oap_client_state { - enum { - OAP_UNINITIALIZED = 0, /* just allocated. */ - OAP_DISABLED, /* disabled by config. */ - OAP_INITIALIZED, /* enabled, config is valid. */ - OAP_REQUESTED_CHALLENGE, - OAP_SENT_CHALLENGE_RESULT, - OAP_REGISTERED - } state; - uint16_t client_id; - uint8_t secret_k[16]; - uint8_t secret_opc[16]; - int registration_failures; -}; - -/* From config, initialize state. Return 0 on success. */ -int oap_client_init(struct oap_client_config *config, - struct oap_client_state *state); - -/* Construct an OAP registration message and return in *msg_tx. Use - * state->client_id and update state->state. - * Return 0 on success, or a negative value on error. - * If an error is returned, *msg_tx is guaranteed to be NULL. */ -int oap_client_register(struct oap_client_state *state, struct msgb **msg_tx); - -/* Decode and act on a received OAP message msg_rx. Update state->state. If a - * non-NULL pointer is returned in *msg_tx, that msgb should be sent to the OAP - * server (and freed) by the caller. The received msg_rx is not freed. - * Return 0 on success, or a negative value on error. - * If an error is returned, *msg_tx is guaranteed to be NULL. */ -int oap_client_handle(struct oap_client_state *state, - const struct msgb *msg_rx, struct msgb **msg_tx); - -/* Allocate a msgb and in it, return the encoded oap_client_msg. Return - * NULL on error. (Like oap_client_encode(), but also allocates a msgb.) - * About the name: the idea is do_something(oap_client_encoded(my_struct)) - */ -struct msgb *oap_client_encoded(const struct osmo_oap_message *oap_client_msg); diff --git a/include/osmocom/sgsn/sgsn.h b/include/osmocom/sgsn/sgsn.h index dae9d12..59d0bd7 100644 --- a/include/osmocom/sgsn/sgsn.h +++ b/include/osmocom/sgsn/sgsn.h @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include "../../bscconfig.h" @@ -101,7 +101,7 @@ int dynamic_lookup; - struct oap_client_config oap; + struct osmo_oap_client_config oap; /* RFC1144 TCP/IP header compression */ struct { diff --git a/src/gprs/Makefile.am b/src/gprs/Makefile.am index 1cf6785..46d94d4 100644 --- a/src/gprs/Makefile.am +++ b/src/gprs/Makefile.am @@ -84,7 +84,6 @@ gprs_llc_xid.c \ v42bis.c \ gsup_client.c \ - oap_client.c \ $(NULL) osmo_sgsn_LDADD = \ $(OSMO_LIBS) \ diff --git a/src/gprs/gsup_client.c b/src/gprs/gsup_client.c index 48357b4..95c4988 100644 --- a/src/gprs/gsup_client.c +++ b/src/gprs/gsup_client.c @@ -116,7 +116,7 @@ { struct msgb *msg_tx; int rc; - rc = oap_client_register(&gsupc->oap_state, &msg_tx); + rc = osmo_oap_client_register(&gsupc->oap_state, &msg_tx); if ((rc < 0) || (!msg_tx)) { LOGP(DLGSUP, LOGL_ERROR, "GSUP OAP set up, but cannot register.\n"); @@ -138,7 +138,7 @@ if (up) { start_test_procedure(gsupc); - if (gsupc->oap_state.state == OAP_INITIALIZED) + if (gsupc->oap_state.state == OSMO_OAP_INITIALIZED) gsup_client_oap_register(gsupc); osmo_timer_del(&gsupc->connect_timer); @@ -156,7 +156,7 @@ struct msgb *msg_tx; /* If the oap_state is disabled, this will reject the messages. */ - rc = oap_client_handle(&gsupc->oap_state, msg_rx, &msg_tx); + rc = osmo_oap_client_handle(&gsupc->oap_state, msg_rx, &msg_tx); msgb_free(msg_rx); if (rc < 0) return rc; @@ -269,7 +269,7 @@ const char *ip_addr, unsigned int tcp_port, gsup_client_read_cb_t read_cb, - struct oap_client_config *oapc_config) + struct osmo_oap_client_config *oapc_config) { struct gsup_client *gsupc; int rc; @@ -284,7 +284,7 @@ OSMO_ASSERT(gsupc->unit_name); /* a NULL oapc_config will mark oap_state disabled. */ - rc = oap_client_init(oapc_config, &gsupc->oap_state); + rc = osmo_oap_client_init(oapc_config, &gsupc->oap_state); if (rc != 0) goto failed; diff --git a/src/gprs/oap_client.c b/src/gprs/oap_client.c deleted file mode 100644 index 9ff84a6..0000000 --- a/src/gprs/oap_client.c +++ /dev/null @@ -1,280 +0,0 @@ -/* Osmocom Authentication Protocol API */ - -/* (C) 2015 by Sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * Author: Neels Hofmeyr - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include - -#include -#include -#include - -#include -#include - -int oap_client_init(struct oap_client_config *config, - struct oap_client_state *state) -{ - OSMO_ASSERT(state->state == OAP_UNINITIALIZED); - - if (!config) - goto disable; - - if (config->client_id == 0) - goto disable; - - if (config->secret_k_present == 0) { - LOGP(DLOAP, LOGL_NOTICE, "OAP: client ID set, but secret K missing.\n"); - goto disable; - } - - if (config->secret_opc_present == 0) { - LOGP(DLOAP, LOGL_NOTICE, "OAP: client ID set, but secret OPC missing.\n"); - goto disable; - } - - state->client_id = config->client_id; - memcpy(state->secret_k, config->secret_k, sizeof(state->secret_k)); - memcpy(state->secret_opc, config->secret_opc, sizeof(state->secret_opc)); - state->state = OAP_INITIALIZED; - return 0; - -disable: - state->state = OAP_DISABLED; - return 0; -} - -/* From the given state and received RAND and AUTN octets, validate the - * server's authenticity and formulate the matching milenage reply octets in - * *tx_xres. The state is not modified. - * On success, and if tx_res is not NULL, exactly 8 octets will be written to - * *tx_res. If not NULL, tx_res must point at allocated memory of at least 8 - * octets. The caller will want to send XRES back to the server in a challenge - * response message and update the state. - * Return 0 on success; -1 if OAP is disabled; -2 if rx_random and rx_autn fail - * the authentication check; -3 for any other errors. */ -static int oap_evaluate_challenge(const struct oap_client_state *state, - const uint8_t *rx_random, - const uint8_t *rx_autn, - uint8_t *tx_xres) -{ - struct osmo_auth_vector vec; - - struct osmo_sub_auth_data auth = { - .type = OSMO_AUTH_TYPE_UMTS, - .algo = OSMO_AUTH_ALG_MILENAGE, - }; - - osmo_static_assert(sizeof(((struct osmo_sub_auth_data*)0)->u.umts.k) - == sizeof(state->secret_k), _secret_k_size_match); - osmo_static_assert(sizeof(((struct osmo_sub_auth_data*)0)->u.umts.opc) - == sizeof(state->secret_opc), _secret_opc_size_match); - - switch (state->state) { - case OAP_UNINITIALIZED: - case OAP_DISABLED: - return -1; - default: - break; - } - - memcpy(auth.u.umts.k, state->secret_k, sizeof(auth.u.umts.k)); - memcpy(auth.u.umts.opc, state->secret_opc, sizeof(auth.u.umts.opc)); - memset(auth.u.umts.amf, '\0', sizeof(auth.u.umts.amf)); - auth.u.umts.sqn = 41; /* TODO use incrementing sequence nr */ - - memset(&vec, 0, sizeof(vec)); - osmo_auth_gen_vec(&vec, &auth, rx_random); - - if (vec.res_len != 8) { - LOGP(DLOAP, LOGL_ERROR, "OAP: Expected XRES to be 8 octets, got %d\n", - vec.res_len); - return -3; - } - - if (osmo_constant_time_cmp(vec.autn, rx_autn, sizeof(vec.autn)) != 0) { - LOGP(DLOAP, LOGL_ERROR, "OAP: AUTN mismatch!\n"); - LOGP(DLOAP, LOGL_INFO, "OAP: AUTN from server: %s\n", - osmo_hexdump_nospc(rx_autn, sizeof(vec.autn))); - LOGP(DLOAP, LOGL_INFO, "OAP: AUTN expected: %s\n", - osmo_hexdump_nospc(vec.autn, sizeof(vec.autn))); - return -2; - } - - if (tx_xres != NULL) - memcpy(tx_xres, vec.res, 8); - return 0; -} - -struct msgb *oap_client_encoded(const struct osmo_oap_message *oap_msg) -{ - struct msgb *msg = msgb_alloc_headroom(1000, 64, __func__); - OSMO_ASSERT(msg); - osmo_oap_encode(msg, oap_msg); - return msg; -} - -/* Create a new msgb containing an OAP registration message. - * On error, return NULL. */ -static struct msgb* oap_msg_register(uint16_t client_id) -{ - struct osmo_oap_message oap_msg = {0}; - - if (client_id < 1) { - LOGP(DLOAP, LOGL_ERROR, "OAP: Invalid client ID: %d\n", client_id); - return NULL; - } - - oap_msg.message_type = OAP_MSGT_REGISTER_REQUEST; - oap_msg.client_id = client_id; - return oap_client_encoded(&oap_msg); -} - -int oap_client_register(struct oap_client_state *state, struct msgb **msg_tx) -{ - *msg_tx = oap_msg_register(state->client_id); - if (!(*msg_tx)) - return -1; - - state->state = OAP_REQUESTED_CHALLENGE; - return 0; -} - -/* Create a new msgb containing an OAP challenge response message. - * xres must point at 8 octets to return as challenge response. - * On error, return NULL. */ -static struct msgb* oap_msg_challenge_response(uint8_t *xres) -{ - struct osmo_oap_message oap_reply = {0}; - - oap_reply.message_type = OAP_MSGT_CHALLENGE_RESULT; - memcpy(oap_reply.xres, xres, sizeof(oap_reply.xres)); - oap_reply.xres_present = 1; - return oap_client_encoded(&oap_reply); -} - -static int handle_challenge(struct oap_client_state *state, - struct osmo_oap_message *oap_rx, - struct msgb **msg_tx) -{ - int rc; - uint8_t xres[8]; - - if (!(oap_rx->rand_present && oap_rx->autn_present)) { - LOGP(DLOAP, LOGL_ERROR, - "OAP challenge incomplete (rand_present: %d, autn_present: %d)\n", - oap_rx->rand_present, oap_rx->autn_present); - rc = -2; - goto failure; - } - - rc = oap_evaluate_challenge(state, - oap_rx->rand, - oap_rx->autn, - xres); - if (rc < 0) - goto failure; - - *msg_tx = oap_msg_challenge_response(xres); - if ((*msg_tx) == NULL) { - rc = -1; - goto failure; - } - - state->state = OAP_SENT_CHALLENGE_RESULT; - return 0; - -failure: - OSMO_ASSERT(rc < 0); - state->state = OAP_INITIALIZED; - return rc; -} - -int oap_client_handle(struct oap_client_state *state, - const struct msgb *msg_rx, struct msgb **msg_tx) -{ - uint8_t *data = msgb_l2(msg_rx); - size_t data_len = msgb_l2len(msg_rx); - struct osmo_oap_message oap_msg = {0}; - int rc = 0; - - *msg_tx = NULL; - - OSMO_ASSERT(data); - - rc = osmo_oap_decode(&oap_msg, data, data_len); - if (rc < 0) { - LOGP(DLOAP, LOGL_ERROR, - "Decoding OAP message failed with error '%s' (%d)\n", - get_value_string(gsm48_gmm_cause_names, -rc), -rc); - return -10; - } - - switch (state->state) { - case OAP_UNINITIALIZED: - LOGP(DLOAP, LOGL_ERROR, - "Received OAP message %d, but the OAP client is" - " not initialized\n", oap_msg.message_type); - return -ENOTCONN; - case OAP_DISABLED: - LOGP(DLOAP, LOGL_ERROR, - "Received OAP message %d, but the OAP client is" - " disabled\n", oap_msg.message_type); - return -ENOTCONN; - default: - break; - } - - switch (oap_msg.message_type) { - case OAP_MSGT_CHALLENGE_REQUEST: - return handle_challenge(state, &oap_msg, msg_tx); - - case OAP_MSGT_REGISTER_RESULT: - /* successfully registered */ - state->state = OAP_REGISTERED; - break; - - case OAP_MSGT_REGISTER_ERROR: - LOGP(DLOAP, LOGL_ERROR, - "OAP registration failed\n"); - state->state = OAP_INITIALIZED; - if (state->registration_failures < 3) { - state->registration_failures ++; - return oap_client_register(state, msg_tx); - } - return -11; - - case OAP_MSGT_REGISTER_REQUEST: - case OAP_MSGT_CHALLENGE_RESULT: - LOGP(DLOAP, LOGL_ERROR, - "Received invalid OAP message type for OAP client side: %d\n", - (int)oap_msg.message_type); - return -12; - - default: - LOGP(DLOAP, LOGL_ERROR, - "Unknown OAP message type: %d\n", - (int)oap_msg.message_type); - return -13; - } - - return 0; -} diff --git a/src/libcommon/gsup_client.c b/src/libcommon/gsup_client.c index 89a9f70..0520045 100644 --- a/src/libcommon/gsup_client.c +++ b/src/libcommon/gsup_client.c @@ -116,7 +116,7 @@ { struct msgb *msg_tx; int rc; - rc = oap_client_register(&gsupc->oap_state, &msg_tx); + rc = osmo_oap_client_register(&gsupc->oap_state, &msg_tx); if ((rc < 0) || (!msg_tx)) { LOGP(DLGSUP, LOGL_ERROR, "GSUP OAP set up, but cannot register.\n"); @@ -138,7 +138,7 @@ if (up) { start_test_procedure(gsupc); - if (gsupc->oap_state.state == OAP_INITIALIZED) + if (gsupc->osmo_oap_state.state == OSMO_OAP_INITIALIZED) gsup_client_oap_register(gsupc); osmo_timer_del(&gsupc->connect_timer); @@ -156,7 +156,7 @@ struct msgb *msg_tx; /* If the oap_state is disabled, this will reject the messages. */ - rc = oap_client_handle(&gsupc->oap_state, msg_rx, &msg_tx); + rc = osmo_oap_client_handle(&gsupc->oap_state, msg_rx, &msg_tx); msgb_free(msg_rx); if (rc < 0) return rc; @@ -269,7 +269,7 @@ const char *ip_addr, unsigned int tcp_port, gsup_client_read_cb_t read_cb, - struct oap_client_config *oapc_config) + struct osmo_oap_client_config *oapc_config) { struct gsup_client *gsupc; int rc; @@ -284,7 +284,7 @@ OSMO_ASSERT(gsupc->unit_name); /* a NULL oapc_config will mark oap_state disabled. */ - rc = oap_client_init(oapc_config, &gsupc->oap_state); + rc = osmo_oap_client_init(oapc_config, &gsupc->oap_state); if (rc != 0) goto failed; diff --git a/src/libcommon/oap_client.c b/src/libcommon/oap_client.c deleted file mode 100644 index 9ff84a6..0000000 --- a/src/libcommon/oap_client.c +++ /dev/null @@ -1,280 +0,0 @@ -/* Osmocom Authentication Protocol API */ - -/* (C) 2015 by Sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * Author: Neels Hofmeyr - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include - -#include -#include -#include - -#include -#include - -int oap_client_init(struct oap_client_config *config, - struct oap_client_state *state) -{ - OSMO_ASSERT(state->state == OAP_UNINITIALIZED); - - if (!config) - goto disable; - - if (config->client_id == 0) - goto disable; - - if (config->secret_k_present == 0) { - LOGP(DLOAP, LOGL_NOTICE, "OAP: client ID set, but secret K missing.\n"); - goto disable; - } - - if (config->secret_opc_present == 0) { - LOGP(DLOAP, LOGL_NOTICE, "OAP: client ID set, but secret OPC missing.\n"); - goto disable; - } - - state->client_id = config->client_id; - memcpy(state->secret_k, config->secret_k, sizeof(state->secret_k)); - memcpy(state->secret_opc, config->secret_opc, sizeof(state->secret_opc)); - state->state = OAP_INITIALIZED; - return 0; - -disable: - state->state = OAP_DISABLED; - return 0; -} - -/* From the given state and received RAND and AUTN octets, validate the - * server's authenticity and formulate the matching milenage reply octets in - * *tx_xres. The state is not modified. - * On success, and if tx_res is not NULL, exactly 8 octets will be written to - * *tx_res. If not NULL, tx_res must point at allocated memory of at least 8 - * octets. The caller will want to send XRES back to the server in a challenge - * response message and update the state. - * Return 0 on success; -1 if OAP is disabled; -2 if rx_random and rx_autn fail - * the authentication check; -3 for any other errors. */ -static int oap_evaluate_challenge(const struct oap_client_state *state, - const uint8_t *rx_random, - const uint8_t *rx_autn, - uint8_t *tx_xres) -{ - struct osmo_auth_vector vec; - - struct osmo_sub_auth_data auth = { - .type = OSMO_AUTH_TYPE_UMTS, - .algo = OSMO_AUTH_ALG_MILENAGE, - }; - - osmo_static_assert(sizeof(((struct osmo_sub_auth_data*)0)->u.umts.k) - == sizeof(state->secret_k), _secret_k_size_match); - osmo_static_assert(sizeof(((struct osmo_sub_auth_data*)0)->u.umts.opc) - == sizeof(state->secret_opc), _secret_opc_size_match); - - switch (state->state) { - case OAP_UNINITIALIZED: - case OAP_DISABLED: - return -1; - default: - break; - } - - memcpy(auth.u.umts.k, state->secret_k, sizeof(auth.u.umts.k)); - memcpy(auth.u.umts.opc, state->secret_opc, sizeof(auth.u.umts.opc)); - memset(auth.u.umts.amf, '\0', sizeof(auth.u.umts.amf)); - auth.u.umts.sqn = 41; /* TODO use incrementing sequence nr */ - - memset(&vec, 0, sizeof(vec)); - osmo_auth_gen_vec(&vec, &auth, rx_random); - - if (vec.res_len != 8) { - LOGP(DLOAP, LOGL_ERROR, "OAP: Expected XRES to be 8 octets, got %d\n", - vec.res_len); - return -3; - } - - if (osmo_constant_time_cmp(vec.autn, rx_autn, sizeof(vec.autn)) != 0) { - LOGP(DLOAP, LOGL_ERROR, "OAP: AUTN mismatch!\n"); - LOGP(DLOAP, LOGL_INFO, "OAP: AUTN from server: %s\n", - osmo_hexdump_nospc(rx_autn, sizeof(vec.autn))); - LOGP(DLOAP, LOGL_INFO, "OAP: AUTN expected: %s\n", - osmo_hexdump_nospc(vec.autn, sizeof(vec.autn))); - return -2; - } - - if (tx_xres != NULL) - memcpy(tx_xres, vec.res, 8); - return 0; -} - -struct msgb *oap_client_encoded(const struct osmo_oap_message *oap_msg) -{ - struct msgb *msg = msgb_alloc_headroom(1000, 64, __func__); - OSMO_ASSERT(msg); - osmo_oap_encode(msg, oap_msg); - return msg; -} - -/* Create a new msgb containing an OAP registration message. - * On error, return NULL. */ -static struct msgb* oap_msg_register(uint16_t client_id) -{ - struct osmo_oap_message oap_msg = {0}; - - if (client_id < 1) { - LOGP(DLOAP, LOGL_ERROR, "OAP: Invalid client ID: %d\n", client_id); - return NULL; - } - - oap_msg.message_type = OAP_MSGT_REGISTER_REQUEST; - oap_msg.client_id = client_id; - return oap_client_encoded(&oap_msg); -} - -int oap_client_register(struct oap_client_state *state, struct msgb **msg_tx) -{ - *msg_tx = oap_msg_register(state->client_id); - if (!(*msg_tx)) - return -1; - - state->state = OAP_REQUESTED_CHALLENGE; - return 0; -} - -/* Create a new msgb containing an OAP challenge response message. - * xres must point at 8 octets to return as challenge response. - * On error, return NULL. */ -static struct msgb* oap_msg_challenge_response(uint8_t *xres) -{ - struct osmo_oap_message oap_reply = {0}; - - oap_reply.message_type = OAP_MSGT_CHALLENGE_RESULT; - memcpy(oap_reply.xres, xres, sizeof(oap_reply.xres)); - oap_reply.xres_present = 1; - return oap_client_encoded(&oap_reply); -} - -static int handle_challenge(struct oap_client_state *state, - struct osmo_oap_message *oap_rx, - struct msgb **msg_tx) -{ - int rc; - uint8_t xres[8]; - - if (!(oap_rx->rand_present && oap_rx->autn_present)) { - LOGP(DLOAP, LOGL_ERROR, - "OAP challenge incomplete (rand_present: %d, autn_present: %d)\n", - oap_rx->rand_present, oap_rx->autn_present); - rc = -2; - goto failure; - } - - rc = oap_evaluate_challenge(state, - oap_rx->rand, - oap_rx->autn, - xres); - if (rc < 0) - goto failure; - - *msg_tx = oap_msg_challenge_response(xres); - if ((*msg_tx) == NULL) { - rc = -1; - goto failure; - } - - state->state = OAP_SENT_CHALLENGE_RESULT; - return 0; - -failure: - OSMO_ASSERT(rc < 0); - state->state = OAP_INITIALIZED; - return rc; -} - -int oap_client_handle(struct oap_client_state *state, - const struct msgb *msg_rx, struct msgb **msg_tx) -{ - uint8_t *data = msgb_l2(msg_rx); - size_t data_len = msgb_l2len(msg_rx); - struct osmo_oap_message oap_msg = {0}; - int rc = 0; - - *msg_tx = NULL; - - OSMO_ASSERT(data); - - rc = osmo_oap_decode(&oap_msg, data, data_len); - if (rc < 0) { - LOGP(DLOAP, LOGL_ERROR, - "Decoding OAP message failed with error '%s' (%d)\n", - get_value_string(gsm48_gmm_cause_names, -rc), -rc); - return -10; - } - - switch (state->state) { - case OAP_UNINITIALIZED: - LOGP(DLOAP, LOGL_ERROR, - "Received OAP message %d, but the OAP client is" - " not initialized\n", oap_msg.message_type); - return -ENOTCONN; - case OAP_DISABLED: - LOGP(DLOAP, LOGL_ERROR, - "Received OAP message %d, but the OAP client is" - " disabled\n", oap_msg.message_type); - return -ENOTCONN; - default: - break; - } - - switch (oap_msg.message_type) { - case OAP_MSGT_CHALLENGE_REQUEST: - return handle_challenge(state, &oap_msg, msg_tx); - - case OAP_MSGT_REGISTER_RESULT: - /* successfully registered */ - state->state = OAP_REGISTERED; - break; - - case OAP_MSGT_REGISTER_ERROR: - LOGP(DLOAP, LOGL_ERROR, - "OAP registration failed\n"); - state->state = OAP_INITIALIZED; - if (state->registration_failures < 3) { - state->registration_failures ++; - return oap_client_register(state, msg_tx); - } - return -11; - - case OAP_MSGT_REGISTER_REQUEST: - case OAP_MSGT_CHALLENGE_RESULT: - LOGP(DLOAP, LOGL_ERROR, - "Received invalid OAP message type for OAP client side: %d\n", - (int)oap_msg.message_type); - return -12; - - default: - LOGP(DLOAP, LOGL_ERROR, - "Unknown OAP message type: %d\n", - (int)oap_msg.message_type); - return -13; - } - - return 0; -} diff --git a/tests/Makefile.am b/tests/Makefile.am index f6a1efc..035cfb0 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -3,7 +3,6 @@ gbproxy \ gtphub \ sgsn \ - oap \ xid \ sndcp_xid \ slhc \ diff --git a/tests/oap/Makefile.am b/tests/oap/Makefile.am deleted file mode 100644 index ccc6d8c..0000000 --- a/tests/oap/Makefile.am +++ /dev/null @@ -1,32 +0,0 @@ -AM_CPPFLAGS = \ - $(all_includes) \ - -I$(top_srcdir)/include \ - $(NULL) - -AM_CFLAGS = \ - -Wall \ - -ggdb3 \ - $(LIBOSMOCORE_CFLAGS) \ - $(LIBOSMOGSM_CFLAGS) \ - $(NULL) - -EXTRA_DIST = \ - oap_client_test.ok \ - oap_client_test.err \ - $(NULL) - -noinst_PROGRAMS = \ - oap_client_test \ - $(NULL) - -oap_client_test_SOURCES = \ - oap_client_test.c \ - $(NULL) - -oap_client_test_LDADD = \ - $(top_builddir)/src/gprs/gprs_utils.o \ - $(top_builddir)/src/gprs/oap_client.o \ - $(LIBOSMOCORE_LIBS) \ - $(LIBOSMOGSM_LIBS) \ - -lrt - diff --git a/tests/oap/oap_client_test.c b/tests/oap/oap_client_test.c deleted file mode 100644 index 87d2070..0000000 --- a/tests/oap/oap_client_test.c +++ /dev/null @@ -1,271 +0,0 @@ -/* Test Osmocom Authentication Protocol */ -/* - * (C) 2015 by sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include - -#include -#include - -#include -#include - -static void test_oap_api(void) -{ - printf("Testing OAP API\n"); - - struct oap_client_config _config; - struct oap_client_config *config = &_config; - - struct oap_client_state _state; - struct oap_client_state *state = &_state; - - struct osmo_oap_message oap_rx; - struct msgb *msg_rx; - - struct osmo_oap_message oap_tx; - struct msgb *msg_tx; - - memset(config, 0, sizeof(*config)); - memset(state, 0, sizeof(*state)); - - OSMO_ASSERT(osmo_hexparse("0102030405060708090a0b0c0d0e0f10", config->secret_k, 16) == 16); - OSMO_ASSERT(osmo_hexparse("1112131415161718191a1b1c1d1e1f20", config->secret_opc, 16) == 16); - - fprintf(stderr, "- make sure filling with zeros means uninitialized\n"); - OSMO_ASSERT(state->state == OAP_UNINITIALIZED); - - fprintf(stderr, "- reject messages in uninitialized state\n"); - memset(&oap_rx, 0, sizeof(oap_rx)); - state->client_id = 1; - oap_rx.message_type = OAP_MSGT_REGISTER_ERROR; - msg_rx = oap_client_encoded(&oap_rx); - OSMO_ASSERT(oap_client_handle(state, msg_rx, &msg_tx) < 0); - OSMO_ASSERT(state->state == OAP_UNINITIALIZED); - msgb_free(msg_rx); - OSMO_ASSERT(!msg_tx); - - fprintf(stderr, "- NULL config should disable\n"); - OSMO_ASSERT( oap_client_init(NULL, state) == 0 ); - OSMO_ASSERT(state->state == OAP_DISABLED); - - fprintf(stderr, "- reject messages in disabled state\n"); - memset(state, 0, sizeof(*state)); - memset(&oap_rx, 0, sizeof(oap_rx)); - state->state = OAP_DISABLED; - state->client_id = 1; - oap_rx.message_type = OAP_MSGT_REGISTER_ERROR; - msg_rx = oap_client_encoded(&oap_rx); - OSMO_ASSERT(oap_client_handle(state, msg_rx, &msg_tx) < 0); - OSMO_ASSERT(state->state == OAP_DISABLED); - msgb_free(msg_rx); - OSMO_ASSERT(!msg_tx); - - fprintf(stderr, "- invalid client_id and shared secret\n"); - memset(state, 0, sizeof(*state)); - config->client_id = 0; - config->secret_k_present = 0; - config->secret_opc_present = 0; - OSMO_ASSERT( oap_client_init(config, state) == 0 ); - OSMO_ASSERT(state->state == OAP_DISABLED); - - fprintf(stderr, "- reset state\n"); - memset(state, 0, sizeof(*state)); - - fprintf(stderr, "- only client_id is invalid\n"); - config->client_id = 0; - config->secret_k_present = 1; - config->secret_opc_present = 1; - OSMO_ASSERT( oap_client_init(config, state) == 0 ); - OSMO_ASSERT(state->state == OAP_DISABLED); - - memset(state, 0, sizeof(*state)); - - fprintf(stderr, "- valid id, but omitted shared_secret (1/2)\n"); - config->client_id = 12345; - config->secret_k_present = 0; - config->secret_opc_present = 1; - OSMO_ASSERT( oap_client_init(config, state) == 0 ); - OSMO_ASSERT(state->state == OAP_DISABLED); - - memset(state, 0, sizeof(*state)); - - fprintf(stderr, "- valid id, but omitted shared_secret (2/2)\n"); - config->client_id = 12345; - config->secret_k_present = 1; - config->secret_opc_present = 0; - OSMO_ASSERT( oap_client_init(config, state) == 0 ); - OSMO_ASSERT(state->state == OAP_DISABLED); - - memset(state, 0, sizeof(*state)); - - - fprintf(stderr, "- mint configuration\n"); - config->client_id = 12345; - config->secret_k_present = 1; - config->secret_opc_present = 1; - /*config->secret_* buffers are still set from the top */ - OSMO_ASSERT( oap_client_init(config, state) == 0 ); - OSMO_ASSERT(state->state == OAP_INITIALIZED); - - - fprintf(stderr, "- Missing challenge data\n"); - memset(&oap_rx, 0, sizeof(oap_rx)); - oap_rx.message_type = OAP_MSGT_CHALLENGE_REQUEST; - oap_rx.rand_present = 0; - oap_rx.autn_present = 0; - msg_rx = oap_client_encoded(&oap_rx); - OSMO_ASSERT(oap_client_handle(state, msg_rx, &msg_tx) == -2); - msgb_free(msg_rx); - OSMO_ASSERT(!msg_tx); - - fprintf(stderr, "- AUTN missing\n"); - osmo_hexparse("0102030405060708090a0b0c0d0e0f10", - oap_rx.rand, 16); - oap_rx.rand_present = 1; - msg_rx = oap_client_encoded(&oap_rx); - OSMO_ASSERT(oap_client_handle(state, msg_rx, &msg_tx) == -2); - msgb_free(msg_rx); - OSMO_ASSERT(!msg_tx); - - fprintf(stderr, "- RAND missing\n"); - oap_rx.rand_present = 0; - osmo_hexparse("cec4e3848a33000086781158ca40f136", - oap_rx.autn, 16); - oap_rx.autn_present = 1; - msg_rx = oap_client_encoded(&oap_rx); - OSMO_ASSERT(oap_client_handle(state, msg_rx, &msg_tx) == -2); - msgb_free(msg_rx); - OSMO_ASSERT(!msg_tx); - - fprintf(stderr, "- wrong autn (by one bit)\n"); - osmo_hexparse("0102030405060708090a0b0c0d0e0f10", - oap_rx.rand, 16); - osmo_hexparse("dec4e3848a33000086781158ca40f136", - oap_rx.autn, 16); - oap_rx.rand_present = 1; - oap_rx.autn_present = 1; - msg_rx = oap_client_encoded(&oap_rx); - OSMO_ASSERT(oap_client_handle(state, msg_rx, &msg_tx) == -2); - msgb_free(msg_rx); - OSMO_ASSERT(!msg_tx); - - fprintf(stderr, "- all data correct\n"); - osmo_hexparse("cec4e3848a33000086781158ca40f136", - oap_rx.autn, 16); - msg_rx = oap_client_encoded(&oap_rx); - - fprintf(stderr, "- but refuse to evaluate in uninitialized state\n"); - OSMO_ASSERT(state->state == OAP_INITIALIZED); - - state->state = OAP_UNINITIALIZED; - OSMO_ASSERT(oap_client_handle(state, msg_rx, &msg_tx) < 0); - OSMO_ASSERT(!msg_tx); - - state->state = OAP_DISABLED; - OSMO_ASSERT(oap_client_handle(state, msg_rx, &msg_tx) < 0); - OSMO_ASSERT(!msg_tx); - - state->state = OAP_INITIALIZED; - - fprintf(stderr, "- now everything is correct\n"); - /* a successful return value here indicates correct autn */ - OSMO_ASSERT(oap_client_handle(state, msg_rx, &msg_tx) == 0); - msgb_free(msg_rx); - - fprintf(stderr, "- Expect the challenge response in msg_tx\n"); - OSMO_ASSERT(msg_tx); - OSMO_ASSERT(osmo_oap_decode(&oap_tx, msg_tx->data, msg_tx->len) == 0); - OSMO_ASSERT(oap_tx.message_type == OAP_MSGT_CHALLENGE_RESULT); - OSMO_ASSERT(strcmp("e2d05b598c61d9ba", - osmo_hexdump_nospc(oap_tx.xres, sizeof(oap_tx.xres))) - == 0); - OSMO_ASSERT(state->state == OAP_SENT_CHALLENGE_RESULT); - msgb_free(msg_tx); - msg_tx = 0; - - struct oap_client_state saved_state = _state; - - fprintf(stderr, "- Receive registration error for the first time.\n"); - - memset(&oap_rx, 0, sizeof(oap_rx)); - oap_rx.message_type = OAP_MSGT_REGISTER_ERROR; - oap_rx.cause = GMM_CAUSE_PROTO_ERR_UNSPEC; - msg_rx = oap_client_encoded(&oap_rx); - - OSMO_ASSERT(state->registration_failures == 0); - OSMO_ASSERT(oap_client_handle(state, msg_rx, &msg_tx) == 0); - OSMO_ASSERT(state->registration_failures == 1); - OSMO_ASSERT(msg_tx); - OSMO_ASSERT(osmo_oap_decode(&oap_tx, msg_tx->data, msg_tx->len) == 0); - OSMO_ASSERT(oap_tx.message_type == OAP_MSGT_REGISTER_REQUEST); - OSMO_ASSERT(state->state == OAP_REQUESTED_CHALLENGE); - msgb_free(msg_tx); - msg_tx = 0; - - fprintf(stderr, "- Receive registration error for the Nth time.\n"); - state->registration_failures = 999; - OSMO_ASSERT(oap_client_handle(state, msg_rx, &msg_tx) == -11); - OSMO_ASSERT(!msg_tx); - OSMO_ASSERT(state->state == OAP_INITIALIZED); - msgb_free(msg_tx); - msg_tx = 0; - - msgb_free(msg_rx); - - fprintf(stderr, "- Registration success\n"); - - _state = saved_state; - memset(&oap_rx, 0, sizeof(oap_rx)); - oap_rx.message_type = OAP_MSGT_REGISTER_RESULT; - msg_rx = oap_client_encoded(&oap_rx); - OSMO_ASSERT(oap_client_handle(state, msg_rx, &msg_tx) == 0); - OSMO_ASSERT(!msg_tx); - OSMO_ASSERT(state->state == OAP_REGISTERED); - msgb_free(msg_rx); -} - -static struct log_info_cat oap_client_test_categories[] = { -}; - -static struct log_info info = { - .cat = oap_client_test_categories, - .num_cat = ARRAY_SIZE(oap_client_test_categories), -}; - -int main(int argc, char **argv) -{ - void *ctx = talloc_named_const(NULL, 0, "oap_client_test"); - msgb_talloc_ctx_init(ctx, 0); - osmo_init_logging2(ctx, &info); - - OSMO_ASSERT(osmo_stderr_target); - log_set_use_color(osmo_stderr_target, 0); - log_set_print_timestamp(osmo_stderr_target, 0); - log_set_print_filename(osmo_stderr_target, 0); - log_set_print_category(osmo_stderr_target, 1); - log_parse_category_mask(osmo_stderr_target, "DLOAP,1"); - - test_oap_api(); - printf("Done\n"); - - return 0; -} - diff --git a/tests/oap/oap_client_test.err b/tests/oap/oap_client_test.err deleted file mode 100644 index 62ddc9e..0000000 --- a/tests/oap/oap_client_test.err +++ /dev/null @@ -1,35 +0,0 @@ -- make sure filling with zeros means uninitialized -- reject messages in uninitialized state -DLOAP Received OAP message 5, but the OAP client is not initialized -- NULL config should disable -- reject messages in disabled state -DLOAP Received OAP message 5, but the OAP client is disabled -- invalid client_id and shared secret -- reset state -- only client_id is invalid -- valid id, but omitted shared_secret (1/2) -DLOAP OAP: client ID set, but secret K missing. -- valid id, but omitted shared_secret (2/2) -DLOAP OAP: client ID set, but secret OPC missing. -- mint configuration -- Missing challenge data -DLOAP OAP challenge incomplete (rand_present: 0, autn_present: 0) -- AUTN missing -DLOAP OAP challenge incomplete (rand_present: 1, autn_present: 0) -- RAND missing -DLOAP OAP challenge incomplete (rand_present: 0, autn_present: 1) -- wrong autn (by one bit) -DLOAP OAP: AUTN mismatch! -DLOAP OAP: AUTN from server: dec4e3848a33000086781158ca40f136 -DLOAP OAP: AUTN expected: cec4e3848a33000086781158ca40f136 -- all data correct -- but refuse to evaluate in uninitialized state -DLOAP Received OAP message 8, but the OAP client is not initialized -DLOAP Received OAP message 8, but the OAP client is disabled -- now everything is correct -- Expect the challenge response in msg_tx -- Receive registration error for the first time. -DLOAP OAP registration failed -- Receive registration error for the Nth time. -DLOAP OAP registration failed -- Registration success diff --git a/tests/oap/oap_client_test.ok b/tests/oap/oap_client_test.ok deleted file mode 100644 index 59108a7..0000000 --- a/tests/oap/oap_client_test.ok +++ /dev/null @@ -1,2 +0,0 @@ -Testing OAP API -Done diff --git a/tests/sgsn/Makefile.am b/tests/sgsn/Makefile.am index 8692fc3..abcc357 100644 --- a/tests/sgsn/Makefile.am +++ b/tests/sgsn/Makefile.am @@ -62,7 +62,6 @@ $(top_builddir)/src/gprs/v42bis.o \ $(top_builddir)/src/gprs/gprs_sndcp_dcomp.o \ $(top_builddir)/src/gprs/gsup_client.o \ - $(top_builddir)/src/gprs/oap_client.o \ $(LIBOSMOABIS_LIBS) \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ diff --git a/tests/testsuite.at b/tests/testsuite.at index 81cd713..d30115e 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -20,14 +20,6 @@ AT_CHECK([$abs_top_builddir/tests/sgsn/sgsn_test], [], [expout], [ignore]) AT_CLEANUP -AT_SETUP([oap]) -AT_KEYWORDS([oap]) -AT_CHECK([test "$enable_oap_test" != no || exit 77]) -cat $abs_srcdir/oap/oap_client_test.ok > expout -cat $abs_srcdir/oap/oap_client_test.err > experr -AT_CHECK([$abs_top_builddir/tests/oap/oap_client_test], [], [expout], [experr]) -AT_CLEANUP - AT_SETUP([gtphub]) AT_KEYWORDS([gtphub]) AT_CHECK([test "$enable_gtphub_test" != no || exit 77]) -- To view, visit https://gerrit.osmocom.org/10259 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I7b194f98ef3f925b6178d8a8dbd9fcf2f0c6e132 Gerrit-Change-Number: 10259 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 17:20:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 17:20:54 +0000 Subject: Change in osmo-sgsn[master]: remove libcommon In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10260 ) Change subject: remove libcommon ...................................................................... remove libcommon This seems to b remaining from ancient days. The code in there is either no longer needed, or has been moved to libosmocore. Change-Id: I9307f9da7f48dd0a2e1cb213072068736e569722 --- D src/libcommon/Makefile.am D src/libcommon/debug.c D src/libcommon/gsm_data.c D src/libcommon/gsm_data_shared.c D src/libcommon/gsm_subscriber_base.c D src/libcommon/gsup_client.c D src/libcommon/gsup_test_client.c D src/libcommon/socket.c D src/libcommon/talloc_ctx.c 9 files changed, 0 insertions(+), 2,446 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/libcommon/Makefile.am b/src/libcommon/Makefile.am deleted file mode 100644 index 69fb37d..0000000 --- a/src/libcommon/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -AM_CPPFLAGS = \ - $(all_includes) \ - -I$(top_srcdir)/include \ - -I$(top_builddir) \ - $(NULL) - -AM_CFLAGS = \ - -Wall \ - $(LIBOSMOCORE_CFLAGS) \ - $(LIBOSMOGSM_CFLAGS) \ - $(LIBOSMOVTY_CFLAGS) \ - $(LIBOSMOABIS_CFLAGS) \ - $(COVERAGE_CFLAGS) \ - $(NULL) - -noinst_LIBRARIES = \ - libcommon.a \ - $(NULL) - -libcommon_a_SOURCES = \ - debug.c \ - gsm_data.c \ - gsm_data_shared.c \ - gsup_client.c \ - oap_client.c \ - socket.c \ - talloc_ctx.c \ - gsm_subscriber_base.c \ - $(NULL) - -noinst_PROGRAMS = \ - gsup_test_client \ - $(NULL) - -gsup_test_client_SOURCES = \ - gsup_test_client.c \ - $(NULL) -gsup_test_client_LDADD = \ - libcommon.a \ - $(LIBOSMOCORE_LIBS) \ - $(LIBOSMOGSM_LIBS) \ - $(LIBOSMOVTY_LIBS) \ - $(LIBOSMOABIS_LIBS) \ - -lrt \ - $(NULL) diff --git a/src/libcommon/debug.c b/src/libcommon/debug.c deleted file mode 100644 index 27d7575..0000000 --- a/src/libcommon/debug.c +++ /dev/null @@ -1,222 +0,0 @@ -/* OpenBSC Debugging/Logging support code */ - -/* (C) 2008-2010 by Harald Welte - * (C) 2008 by Holger Hans Peter Freyther - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -/* default categories */ -static const struct log_info_cat default_categories[] = { - [DRLL] = { - .name = "DRLL", - .description = "A-bis Radio Link Layer (RLL)", - .color = "\033[1;31m", - .enabled = 1, .loglevel = LOGL_NOTICE, - }, - [DCC] = { - .name = "DCC", - .description = "Layer3 Call Control (CC)", - .color = "\033[1;32m", - .enabled = 1, .loglevel = LOGL_NOTICE, - }, - [DMM] = { - .name = "DMM", - .description = "Layer3 Mobility Management (MM)", - .color = "\033[1;33m", - .enabled = 1, .loglevel = LOGL_NOTICE, - }, - [DRR] = { - .name = "DRR", - .description = "Layer3 Radio Resource (RR)", - .color = "\033[1;34m", - .enabled = 1, .loglevel = LOGL_NOTICE, - }, - [DRSL] = { - .name = "DRSL", - .description = "A-bis Radio Siganlling Link (RSL)", - .color = "\033[1;35m", - .enabled = 1, .loglevel = LOGL_NOTICE, - }, - [DNM] = { - .name = "DNM", - .description = "A-bis Network Management / O&M (NM/OML)", - .color = "\033[1;36m", - .enabled = 1, .loglevel = LOGL_INFO, - }, - [DMNCC] = { - .name = "DMNCC", - .description = "MNCC API for Call Control application", - .color = "\033[1;39m", - .enabled = 1, .loglevel = LOGL_NOTICE, - }, - [DPAG] = { - .name = "DPAG", - .description = "Paging Subsystem", - .color = "\033[1;38m", - .enabled = 1, .loglevel = LOGL_NOTICE, - }, - [DMEAS] = { - .name = "DMEAS", - .description = "Radio Measurement Processing", - .enabled = 0, .loglevel = LOGL_NOTICE, - }, - [DSCCP] = { - .name = "DSCCP", - .description = "SCCP Protocol", - .enabled = 1, .loglevel = LOGL_NOTICE, - }, - [DMSC] = { - .name = "DMSC", - .description = "Mobile Switching Center", - .enabled = 1, .loglevel = LOGL_NOTICE, - }, - [DHO] = { - .name = "DHO", - .description = "Hand-Over", - .enabled = 1, .loglevel = LOGL_NOTICE, - }, - [DDB] = { - .name = "DDB", - .description = "Database Layer", - .enabled = 1, .loglevel = LOGL_NOTICE, - }, - [DREF] = { - .name = "DREF", - .description = "Reference Counting", - .enabled = 0, .loglevel = LOGL_NOTICE, - }, - [DGPRS] = { - .name = "DGPRS", - .description = "GPRS Packet Service", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, - [DNS] = { - .name = "DNS", - .description = "GPRS Network Service (NS)", - .enabled = 1, .loglevel = LOGL_INFO, - }, - [DBSSGP] = { - .name = "DBSSGP", - .description = "GPRS BSS Gateway Protocol (BSSGP)", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, - [DLLC] = { - .name = "DLLC", - .description = "GPRS Logical Link Control Protocol (LLC)", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, - [DSNDCP] = { - .name = "DSNDCP", - .description = "GPRS Sub-Network Dependent Control Protocol (SNDCP)", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, - [DNAT] = { - .name = "DNAT", - .description = "GSM 08.08 NAT/Multiplexer", - .enabled = 1, .loglevel = LOGL_NOTICE, - }, - [DCTRL] = { - .name = "DCTRL", - .description = "Control interface", - .enabled = 1, .loglevel = LOGL_NOTICE, - }, - [DFILTER] = { - .name = "DFILTER", - .description = "BSC/NAT IMSI based filtering", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, - [DRANAP] = { - .name = "DRANAP", - .description = "Radio Access Network Application Part Protocol", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, - [DSUA] = { - .name = "DSUA", - .description = "SCCP User Adaptation Protocol", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, - [DPCU] = { - .name = "DPCU", - .description = "PCU Interface", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, - [DVLR] = { - .name = "DVLR", - .description = "Visitor Location Register", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, - [DIUCS] = { - .name = "DIUCS", - .description = "Iu-CS Protocol", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, - [DSIGTRAN] = { - .name = "DSIGTRAN", - .description = "SIGTRAN Signalling Transport", - .color = "\033[1;29m", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, -}; - -static int filter_fn(const struct log_context *ctx, struct log_target *tar) -{ - const struct vlr_subscr *vsub = ctx->ctx[LOG_CTX_VLR_SUBSCR]; - const struct bsc_subscr *bsub = ctx->ctx[LOG_CTX_BSC_SUBSCR]; - const struct gprs_nsvc *nsvc = ctx->ctx[LOG_CTX_GB_NSVC]; - const struct gprs_nsvc *bvc = ctx->ctx[LOG_CTX_GB_BVC]; - - if ((tar->filter_map & (1 << LOG_FLT_VLR_SUBSCR)) != 0 - && vsub && vsub == tar->filter_data[LOG_FLT_VLR_SUBSCR]) - return 1; - - if ((tar->filter_map & (1 << LOG_FLT_BSC_SUBSCR)) != 0 - && bsub && bsub == tar->filter_data[LOG_FLT_BSC_SUBSCR]) - return 1; - - /* Filter on the NS Virtual Connection */ - if ((tar->filter_map & (1 << LOG_FLT_GB_NSVC)) != 0 - && nsvc && (nsvc == tar->filter_data[LOG_FLT_GB_NSVC])) - return 1; - - /* Filter on the NS Virtual Connection */ - if ((tar->filter_map & (1 << LOG_FLT_GB_BVC)) != 0 - && bvc && (bvc == tar->filter_data[LOG_FLT_GB_BVC])) - return 1; - - return 0; -} - -const struct log_info log_info = { - .filter_fn = filter_fn, - .cat = default_categories, - .num_cat = ARRAY_SIZE(default_categories), -}; diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c deleted file mode 100644 index 6400963..0000000 --- a/src/libcommon/gsm_data.c +++ /dev/null @@ -1,450 +0,0 @@ -/* (C) 2008-2010 by Harald Welte - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -void *tall_bsc_ctx; - -static LLIST_HEAD(bts_models); - -void set_ts_e1link(struct gsm_bts_trx_ts *ts, uint8_t e1_nr, - uint8_t e1_ts, uint8_t e1_ts_ss) -{ - ts->e1_link.e1_nr = e1_nr; - ts->e1_link.e1_ts = e1_ts; - ts->e1_link.e1_ts_ss = e1_ts_ss; -} - -static struct gsm_bts_model *bts_model_find(enum gsm_bts_type type) -{ - struct gsm_bts_model *model; - - llist_for_each_entry(model, &bts_models, list) { - if (model->type == type) - return model; - } - - return NULL; -} - -int gsm_bts_model_register(struct gsm_bts_model *model) -{ - if (bts_model_find(model->type)) - return -EEXIST; - - tlv_def_patch(&model->nm_att_tlvdef, &abis_nm_att_tlvdef); - llist_add_tail(&model->list, &bts_models); - return 0; -} - -const struct value_string bts_type_descs[_NUM_GSM_BTS_TYPE+1] = { - { GSM_BTS_TYPE_UNKNOWN, "Unknown BTS Type" }, - { GSM_BTS_TYPE_BS11, "Siemens BTS (BS-11 or compatible)" }, - { GSM_BTS_TYPE_NANOBTS, "ip.access nanoBTS or compatible" }, - { GSM_BTS_TYPE_RBS2000, "Ericsson RBS2000 Series" }, - { GSM_BTS_TYPE_NOKIA_SITE, "Nokia {Metro,Ultra,In}Site" }, - { GSM_BTS_TYPE_OSMOBTS, "sysmocom sysmoBTS" }, - { 0, NULL } -}; - -struct gsm_bts_trx *gsm_bts_trx_by_nr(struct gsm_bts *bts, int nr) -{ - struct gsm_bts_trx *trx; - - llist_for_each_entry(trx, &bts->trx_list, list) { - if (trx->nr == nr) - return trx; - } - return NULL; -} - -/* Search for a BTS in the given Location Area; optionally start searching - * with start_bts (for continuing to search after the first result) */ -struct gsm_bts *gsm_bts_by_lac(struct gsm_network *net, unsigned int lac, - struct gsm_bts *start_bts) -{ - int i; - struct gsm_bts *bts; - int skip = 0; - - if (start_bts) - skip = 1; - - for (i = 0; i < net->num_bts; i++) { - bts = gsm_bts_num(net, i); - - if (skip) { - if (start_bts == bts) - skip = 0; - continue; - } - - if (lac == GSM_LAC_RESERVED_ALL_BTS || bts->location_area_code == lac) - return bts; - } - return NULL; -} - -static const struct value_string auth_policy_names[] = { - { GSM_AUTH_POLICY_CLOSED, "closed" }, - { GSM_AUTH_POLICY_ACCEPT_ALL, "accept-all" }, - { GSM_AUTH_POLICY_TOKEN, "token" }, - { GSM_AUTH_POLICY_REGEXP, "regexp" }, - { 0, NULL } -}; - -enum gsm_auth_policy gsm_auth_policy_parse(const char *arg) -{ - return get_string_value(auth_policy_names, arg); -} - -const char *gsm_auth_policy_name(enum gsm_auth_policy policy) -{ - return get_value_string(auth_policy_names, policy); -} - -static const struct value_string rrlp_mode_names[] = { - { RRLP_MODE_NONE, "none" }, - { RRLP_MODE_MS_BASED, "ms-based" }, - { RRLP_MODE_MS_PREF, "ms-preferred" }, - { RRLP_MODE_ASS_PREF, "ass-preferred" }, - { 0, NULL } -}; - -enum rrlp_mode rrlp_mode_parse(const char *arg) -{ - return get_string_value(rrlp_mode_names, arg); -} - -const char *rrlp_mode_name(enum rrlp_mode mode) -{ - return get_value_string(rrlp_mode_names, mode); -} - -static const struct value_string bts_gprs_mode_names[] = { - { BTS_GPRS_NONE, "none" }, - { BTS_GPRS_GPRS, "gprs" }, - { BTS_GPRS_EGPRS, "egprs" }, - { 0, NULL } -}; - -enum bts_gprs_mode bts_gprs_mode_parse(const char *arg, int *valid) -{ - int rc; - - rc = get_string_value(bts_gprs_mode_names, arg); - if (valid) - *valid = rc != -EINVAL; - return rc; -} - -const char *bts_gprs_mode_name(enum bts_gprs_mode mode) -{ - return get_value_string(bts_gprs_mode_names, mode); -} - -int bts_gprs_mode_is_compat(struct gsm_bts *bts, enum bts_gprs_mode mode) -{ - if (mode != BTS_GPRS_NONE && - !gsm_btsmodel_has_feature(bts->model, BTS_FEAT_GPRS)) { - return 0; - } - if (mode == BTS_GPRS_EGPRS && - !gsm_btsmodel_has_feature(bts->model, BTS_FEAT_EGPRS)) { - return 0; - } - - return 1; -} - -int gsm_btsmodel_set_feature(struct gsm_bts_model *model, enum gsm_bts_features feat) -{ - OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES); - return bitvec_set_bit_pos(&model->features, feat, 1); -} - -bool gsm_btsmodel_has_feature(struct gsm_bts_model *model, enum gsm_bts_features feat) -{ - OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES); - return bitvec_get_bit_pos(&model->features, feat); -} - -int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type) -{ - struct gsm_bts_model *model; - - model = bts_model_find(type); - if (!model) - return -EINVAL; - - bts->type = type; - bts->model = model; - - if (model->start && !model->started) { - int ret = model->start(bts->network); - if (ret < 0) - return ret; - - model->started = true; - } - - switch (bts->type) { - case GSM_BTS_TYPE_NANOBTS: - case GSM_BTS_TYPE_OSMOBTS: - /* Set the default OML Stream ID to 0xff */ - bts->oml_tei = 0xff; - bts->c0->nominal_power = 23; - break; - case GSM_BTS_TYPE_RBS2000: - INIT_LLIST_HEAD(&bts->rbs2000.is.conn_groups); - INIT_LLIST_HEAD(&bts->rbs2000.con.conn_groups); - break; - case GSM_BTS_TYPE_BS11: - case GSM_BTS_TYPE_UNKNOWN: - case GSM_BTS_TYPE_NOKIA_SITE: - /* Set default BTS reset timer */ - bts->nokia.bts_reset_timer_cnf = 15; - case _NUM_GSM_BTS_TYPE: - break; - } - - return 0; -} - -struct gsm_bts *gsm_bts_alloc_register(struct gsm_network *net, enum gsm_bts_type type, - uint8_t bsic) -{ - struct gsm_bts_model *model = bts_model_find(type); - struct gsm_bts *bts; - - if (!model && type != GSM_BTS_TYPE_UNKNOWN) - return NULL; - - bts = gsm_bts_alloc(net, net->num_bts); - if (!bts) - return NULL; - - net->num_bts++; - - bts->network = net; - bts->type = type; - bts->model = model; - bts->bsic = bsic; - bts->dtxu = GSM48_DTX_SHALL_NOT_BE_USED; - bts->dtxd = false; - bts->gprs.ctrl_ack_type_use_block = true; /* use RLC/MAC control block */ - bts->neigh_list_manual_mode = 0; - bts->si_common.cell_sel_par.cell_resel_hyst = 2; /* 4 dB */ - bts->si_common.cell_sel_par.rxlev_acc_min = 0; - bts->si_common.si2quater_neigh_list.arfcn = bts->si_common.data.earfcn_list; - bts->si_common.si2quater_neigh_list.meas_bw = bts->si_common.data.meas_bw_list; - bts->si_common.si2quater_neigh_list.length = MAX_EARFCN_LIST; - bts->si_common.si2quater_neigh_list.thresh_hi = 0; - osmo_earfcn_init(&bts->si_common.si2quater_neigh_list); - bts->si_common.neigh_list.data = bts->si_common.data.neigh_list; - bts->si_common.neigh_list.data_len = - sizeof(bts->si_common.data.neigh_list); - bts->si_common.si5_neigh_list.data = bts->si_common.data.si5_neigh_list; - bts->si_common.si5_neigh_list.data_len = - sizeof(bts->si_common.data.si5_neigh_list); - bts->si_common.cell_alloc.data = bts->si_common.data.cell_alloc; - bts->si_common.cell_alloc.data_len = - sizeof(bts->si_common.data.cell_alloc); - bts->si_common.rach_control.re = 1; /* no re-establishment */ - bts->si_common.rach_control.tx_integer = 9; /* 12 slots spread - 217/115 slots delay */ - bts->si_common.rach_control.max_trans = 3; /* 7 retransmissions */ - bts->si_common.rach_control.t2 = 4; /* no emergency calls */ - bts->si_common.chan_desc.att = 1; /* attachment required */ - bts->si_common.chan_desc.bs_pa_mfrms = RSL_BS_PA_MFRMS_5; /* paging frames */ - bts->si_common.chan_desc.bs_ag_blks_res = 1; /* reserved AGCH blocks */ - bts->si_common.chan_desc.t3212 = net->t3212; /* Use network's current value */ - gsm_bts_set_radio_link_timeout(bts, 32); /* Use RADIO LINK TIMEOUT of 32 */ - - llist_add_tail(&bts->list, &net->bts_list); - - INIT_LLIST_HEAD(&bts->abis_queue); - - INIT_LLIST_HEAD(&bts->loc_list); - - return bts; -} - -void gprs_ra_id_by_bts(struct gprs_ra_id *raid, struct gsm_bts *bts) -{ - raid->mcc = bts->network->country_code; - raid->mnc = bts->network->network_code; - raid->lac = bts->location_area_code; - raid->rac = bts->gprs.rac; -} - -int gsm_parse_reg(void *ctx, regex_t *reg, char **str, int argc, const char **argv) -{ - int ret; - - ret = 0; - if (*str) { - talloc_free(*str); - *str = NULL; - } - regfree(reg); - - if (argc > 0) { - *str = talloc_strdup(ctx, argv[0]); - ret = regcomp(reg, argv[0], 0); - - /* handle compilation failures */ - if (ret != 0) { - talloc_free(*str); - *str = NULL; - } - } - - return ret; -} - -/* Assume there are only 256 possible bts */ -osmo_static_assert(sizeof(((struct gsm_bts *) 0)->nr) == 1, _bts_nr_is_256); -static void depends_calc_index_bit(int bts_nr, int *idx, int *bit) -{ - *idx = bts_nr / (8 * 4); - *bit = bts_nr % (8 * 4); -} - -void bts_depend_mark(struct gsm_bts *bts, int dep) -{ - int idx, bit; - depends_calc_index_bit(dep, &idx, &bit); - - bts->depends_on[idx] |= 1 << bit; -} - -void bts_depend_clear(struct gsm_bts *bts, int dep) -{ - int idx, bit; - depends_calc_index_bit(dep, &idx, &bit); - - bts->depends_on[idx] &= ~(1 << bit); -} - -int bts_depend_is_depedency(struct gsm_bts *base, struct gsm_bts *other) -{ - int idx, bit; - depends_calc_index_bit(other->nr, &idx, &bit); - - /* Check if there is a depends bit */ - return (base->depends_on[idx] & (1 << bit)) > 0; -} - -static int bts_is_online(struct gsm_bts *bts) -{ - /* TODO: support E1 BTS too */ - if (!is_ipaccess_bts(bts)) - return 1; - - if (!bts->oml_link) - return 0; - - return bts->mo.nm_state.operational == NM_OPSTATE_ENABLED; -} - -int bts_depend_check(struct gsm_bts *bts) -{ - struct gsm_bts *other_bts; - - llist_for_each_entry(other_bts, &bts->network->bts_list, list) { - if (!bts_depend_is_depedency(bts, other_bts)) - continue; - if (bts_is_online(other_bts)) - continue; - return 0; - } - return 1; -} - -/* get the radio link timeout (based on SACCH decode errors, according - * to algorithm specified in TS 05.08 section 5.2. A value of -1 - * indicates we should use an infinitely long timeout, which only works - * with OsmoBTS as the BTS implementation */ -int gsm_bts_get_radio_link_timeout(const struct gsm_bts *bts) -{ - const struct gsm48_cell_options *cell_options = &bts->si_common.cell_options; - - if (bts->infinite_radio_link_timeout) - return -1; - else { - /* Encoding as per Table 10.5.21 of TS 04.08 */ - return (cell_options->radio_link_timeout + 1) << 2; - } -} - -/* set the radio link timeout (based on SACCH decode errors, according - * to algorithm specified in TS 05.08 Section 5.2. A value of -1 - * indicates we should use an infinitely long timeout, which only works - * with OsmoBTS as the BTS implementation */ -void gsm_bts_set_radio_link_timeout(struct gsm_bts *bts, int value) -{ - struct gsm48_cell_options *cell_options = &bts->si_common.cell_options; - - if (value < 0) - bts->infinite_radio_link_timeout = true; - else { - bts->infinite_radio_link_timeout = false; - /* Encoding as per Table 10.5.21 of TS 04.08 */ - if (value < 4) - value = 4; - if (value > 64) - value = 64; - cell_options->radio_link_timeout = (value >> 2) - 1; - } -} - -bool classmark_is_r99(struct gsm_classmark *cm) -{ - int rev_lev = 0; - if (cm->classmark1_set) - rev_lev = cm->classmark1.rev_lev; - else if (cm->classmark2_len > 0) - rev_lev = (cm->classmark2[0] >> 5) & 0x3; - return rev_lev >= 2; -} - -const struct value_string ran_type_names[] = { - OSMO_VALUE_STRING(RAN_UNKNOWN), - OSMO_VALUE_STRING(RAN_GERAN_A), - OSMO_VALUE_STRING(RAN_UTRAN_IU), - { 0, NULL } -}; diff --git a/src/libcommon/gsm_data_shared.c b/src/libcommon/gsm_data_shared.c deleted file mode 100644 index 8d5f990..0000000 --- a/src/libcommon/gsm_data_shared.c +++ /dev/null @@ -1,853 +0,0 @@ -/* (C) 2008-2010 by Harald Welte - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - - -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include - -#include - -void gsm_abis_mo_reset(struct gsm_abis_mo *mo) -{ - mo->nm_state.operational = NM_OPSTATE_NULL; - mo->nm_state.availability = NM_AVSTATE_POWER_OFF; -} - -static void gsm_mo_init(struct gsm_abis_mo *mo, struct gsm_bts *bts, - uint8_t obj_class, uint8_t p1, uint8_t p2, uint8_t p3) -{ - mo->bts = bts; - mo->obj_class = obj_class; - mo->obj_inst.bts_nr = p1; - mo->obj_inst.trx_nr = p2; - mo->obj_inst.ts_nr = p3; - gsm_abis_mo_reset(mo); -} - -const struct value_string bts_attribute_names[] = { - OSMO_VALUE_STRING(BTS_TYPE_VARIANT), - OSMO_VALUE_STRING(BTS_SUB_MODEL), - OSMO_VALUE_STRING(TRX_PHY_VERSION), - { 0, NULL } -}; - -enum bts_attribute str2btsattr(const char *s) -{ - return get_string_value(bts_attribute_names, s); -} - -const char *btsatttr2str(enum bts_attribute v) -{ - return get_value_string(bts_attribute_names, v); -} - -const struct value_string osmo_bts_variant_names[_NUM_BTS_VARIANT + 1] = { - { BTS_UNKNOWN, "unknown" }, - { BTS_OSMO_LITECELL15, "osmo-bts-lc15" }, - { BTS_OSMO_OCTPHY, "osmo-bts-octphy" }, - { BTS_OSMO_SYSMO, "osmo-bts-sysmo" }, - { BTS_OSMO_TRX, "omso-bts-trx" }, - { 0, NULL } -}; - -enum gsm_bts_type_variant str2btsvariant(const char *arg) -{ - return get_string_value(osmo_bts_variant_names, arg); -} - -const char *btsvariant2str(enum gsm_bts_type_variant v) -{ - return get_value_string(osmo_bts_variant_names, v); -} - -const struct value_string bts_type_names[_NUM_GSM_BTS_TYPE + 1] = { - { GSM_BTS_TYPE_UNKNOWN, "unknown" }, - { GSM_BTS_TYPE_BS11, "bs11" }, - { GSM_BTS_TYPE_NANOBTS, "nanobts" }, - { GSM_BTS_TYPE_RBS2000, "rbs2000" }, - { GSM_BTS_TYPE_NOKIA_SITE, "nokia_site" }, - { GSM_BTS_TYPE_OSMOBTS, "sysmobts" }, - { 0, NULL } -}; - -enum gsm_bts_type str2btstype(const char *arg) -{ - return get_string_value(bts_type_names, arg); -} - -const char *btstype2str(enum gsm_bts_type type) -{ - return get_value_string(bts_type_names, type); -} - -const struct value_string gsm_bts_features_descs[] = { - { BTS_FEAT_HSCSD, "HSCSD" }, - { BTS_FEAT_GPRS, "GPRS" }, - { BTS_FEAT_EGPRS, "EGPRS" }, - { BTS_FEAT_ECSD, "ECSD" }, - { BTS_FEAT_HOPPING, "Frequency Hopping" }, - { BTS_FEAT_MULTI_TSC, "Multi-TSC" }, - { BTS_FEAT_OML_ALERTS, "OML Alerts" }, - { BTS_FEAT_AGCH_PCH_PROP, "AGCH/PCH proportional allocation" }, - { BTS_FEAT_CBCH, "CBCH" }, - { 0, NULL } -}; - -const struct value_string gsm_chreq_descs[] = { - { GSM_CHREQ_REASON_EMERG, "emergency call" }, - { GSM_CHREQ_REASON_PAG, "answer to paging" }, - { GSM_CHREQ_REASON_CALL, "call re-establishment" }, - { GSM_CHREQ_REASON_LOCATION_UPD,"Location updating" }, - { GSM_CHREQ_REASON_PDCH, "one phase packet access" }, - { GSM_CHREQ_REASON_OTHER, "other" }, - { 0, NULL } -}; - -const struct value_string gsm_pchant_names[13] = { - { GSM_PCHAN_NONE, "NONE" }, - { GSM_PCHAN_CCCH, "CCCH" }, - { GSM_PCHAN_CCCH_SDCCH4,"CCCH+SDCCH4" }, - { GSM_PCHAN_TCH_F, "TCH/F" }, - { GSM_PCHAN_TCH_H, "TCH/H" }, - { GSM_PCHAN_SDCCH8_SACCH8C, "SDCCH8" }, - { GSM_PCHAN_PDCH, "PDCH" }, - { GSM_PCHAN_TCH_F_PDCH, "TCH/F_PDCH" }, - { GSM_PCHAN_UNKNOWN, "UNKNOWN" }, - { GSM_PCHAN_CCCH_SDCCH4_CBCH, "CCCH+SDCCH4+CBCH" }, - { GSM_PCHAN_SDCCH8_SACCH8C_CBCH, "SDCCH8+CBCH" }, - { GSM_PCHAN_TCH_F_TCH_H_PDCH, "TCH/F_TCH/H_PDCH" }, - { 0, NULL } -}; - -const struct value_string gsm_pchant_descs[13] = { - { GSM_PCHAN_NONE, "Physical Channel not configured" }, - { GSM_PCHAN_CCCH, "FCCH + SCH + BCCH + CCCH (Comb. IV)" }, - { GSM_PCHAN_CCCH_SDCCH4, - "FCCH + SCH + BCCH + CCCH + 4 SDCCH + 2 SACCH (Comb. V)" }, - { GSM_PCHAN_TCH_F, "TCH/F + FACCH/F + SACCH (Comb. I)" }, - { GSM_PCHAN_TCH_H, "2 TCH/H + 2 FACCH/H + 2 SACCH (Comb. II)" }, - { GSM_PCHAN_SDCCH8_SACCH8C, "8 SDCCH + 4 SACCH (Comb. VII)" }, - { GSM_PCHAN_PDCH, "Packet Data Channel for GPRS/EDGE" }, - { GSM_PCHAN_TCH_F_PDCH, "Dynamic TCH/F or GPRS PDCH" }, - { GSM_PCHAN_UNKNOWN, "Unknown / Unsupported channel combination" }, - { GSM_PCHAN_CCCH_SDCCH4_CBCH, "FCCH + SCH + BCCH + CCCH + CBCH + 3 SDCCH + 2 SACCH (Comb. V)" }, - { GSM_PCHAN_SDCCH8_SACCH8C_CBCH, "7 SDCCH + 4 SACCH + CBCH (Comb. VII)" }, - { GSM_PCHAN_TCH_F_TCH_H_PDCH, "Dynamic TCH/F or TCH/H or GPRS PDCH" }, - { 0, NULL } -}; - -const char *gsm_pchan_name(enum gsm_phys_chan_config c) -{ - return get_value_string(gsm_pchant_names, c); -} - -enum gsm_phys_chan_config gsm_pchan_parse(const char *name) -{ - return get_string_value(gsm_pchant_names, name); -} - -/* TODO: move to libosmocore, next to gsm_chan_t_names? */ -const char *gsm_lchant_name(enum gsm_chan_t c) -{ - return get_value_string(gsm_chan_t_names, c); -} - -static const struct value_string lchan_s_names[] = { - { LCHAN_S_NONE, "NONE" }, - { LCHAN_S_ACT_REQ, "ACTIVATION REQUESTED" }, - { LCHAN_S_ACTIVE, "ACTIVE" }, - { LCHAN_S_INACTIVE, "INACTIVE" }, - { LCHAN_S_REL_REQ, "RELEASE REQUESTED" }, - { LCHAN_S_REL_ERR, "RELEASE DUE ERROR" }, - { LCHAN_S_BROKEN, "BROKEN UNUSABLE" }, - { 0, NULL } -}; - -const char *gsm_lchans_name(enum gsm_lchan_state s) -{ - return get_value_string(lchan_s_names, s); -} - -static const struct value_string chreq_names[] = { - { GSM_CHREQ_REASON_EMERG, "EMERGENCY" }, - { GSM_CHREQ_REASON_PAG, "PAGING" }, - { GSM_CHREQ_REASON_CALL, "CALL" }, - { GSM_CHREQ_REASON_LOCATION_UPD,"LOCATION_UPDATE" }, - { GSM_CHREQ_REASON_OTHER, "OTHER" }, - { 0, NULL } -}; - -const char *gsm_chreq_name(enum gsm_chreq_reason_t c) -{ - return get_value_string(chreq_names, c); -} - -struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num) -{ - struct gsm_bts *bts; - - if (num >= net->num_bts) - return NULL; - - llist_for_each_entry(bts, &net->bts_list, list) { - if (bts->nr == num) - return bts; - } - - return NULL; -} - -struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts) -{ - struct gsm_bts_trx *trx = talloc_zero(bts, struct gsm_bts_trx); - int k; - - if (!trx) - return NULL; - - trx->bts = bts; - trx->nr = bts->num_trx++; - trx->mo.nm_state.administrative = NM_STATE_UNLOCKED; - - gsm_mo_init(&trx->mo, bts, NM_OC_RADIO_CARRIER, - bts->nr, trx->nr, 0xff); - gsm_mo_init(&trx->bb_transc.mo, bts, NM_OC_BASEB_TRANSC, - bts->nr, trx->nr, 0xff); - - for (k = 0; k < TRX_NR_TS; k++) { - struct gsm_bts_trx_ts *ts = &trx->ts[k]; - int l; - - ts->trx = trx; - ts->nr = k; - ts->pchan = GSM_PCHAN_NONE; - ts->dyn.pchan_is = GSM_PCHAN_NONE; - ts->dyn.pchan_want = GSM_PCHAN_NONE; - ts->tsc = -1; - - gsm_mo_init(&ts->mo, bts, NM_OC_CHANNEL, - bts->nr, trx->nr, ts->nr); - - ts->hopping.arfcns.data_len = sizeof(ts->hopping.arfcns_data); - ts->hopping.arfcns.data = ts->hopping.arfcns_data; - ts->hopping.ma.data_len = sizeof(ts->hopping.ma_data); - ts->hopping.ma.data = ts->hopping.ma_data; - - for (l = 0; l < TS_MAX_LCHAN; l++) { - struct gsm_lchan *lchan; - char *name; - lchan = &ts->lchan[l]; - - lchan->ts = ts; - lchan->nr = l; - lchan->type = GSM_LCHAN_NONE; - - name = gsm_lchan_name_compute(lchan); - lchan->name = talloc_strdup(trx, name); -#ifndef ROLE_BSC - INIT_LLIST_HEAD(&lchan->sapi_cmds); -#endif - } - } - - if (trx->nr != 0) - trx->nominal_power = bts->c0->nominal_power; - - llist_add_tail(&trx->list, &bts->trx_list); - - return trx; -} - - -static const uint8_t bts_nse_timer_default[] = { 3, 3, 3, 3, 30, 3, 10 }; -static const uint8_t bts_cell_timer_default[] = - { 3, 3, 3, 3, 3, 10, 3, 10, 3, 10, 3 }; -static const struct gprs_rlc_cfg rlc_cfg_default = { - .parameter = { - [RLC_T3142] = 20, - [RLC_T3169] = 5, - [RLC_T3191] = 5, - [RLC_T3193] = 160, /* 10ms */ - [RLC_T3195] = 5, - [RLC_N3101] = 10, - [RLC_N3103] = 4, - [RLC_N3105] = 8, - [CV_COUNTDOWN] = 15, - [T_DL_TBF_EXT] = 250 * 10, /* ms */ - [T_UL_TBF_EXT] = 250 * 10, /* ms */ - }, - .paging = { - .repeat_time = 5 * 50, /* ms */ - .repeat_count = 3, - }, - .cs_mask = 0x1fff, - .initial_cs = 2, - .initial_mcs = 6, -}; - -struct gsm_bts *gsm_bts_alloc(void *ctx, uint8_t bts_num) -{ - struct gsm_bts *bts = talloc_zero(ctx, struct gsm_bts); - int i; - - if (!bts) - return NULL; - - bts->nr = bts_num; - bts->num_trx = 0; - INIT_LLIST_HEAD(&bts->trx_list); - bts->ms_max_power = 15; /* dBm */ - - gsm_mo_init(&bts->mo, bts, NM_OC_BTS, - bts->nr, 0xff, 0xff); - gsm_mo_init(&bts->site_mgr.mo, bts, NM_OC_SITE_MANAGER, - 0xff, 0xff, 0xff); - - for (i = 0; i < ARRAY_SIZE(bts->gprs.nsvc); i++) { - bts->gprs.nsvc[i].bts = bts; - bts->gprs.nsvc[i].id = i; - gsm_mo_init(&bts->gprs.nsvc[i].mo, bts, NM_OC_GPRS_NSVC, - bts->nr, i, 0xff); - } - memcpy(&bts->gprs.nse.timer, bts_nse_timer_default, - sizeof(bts->gprs.nse.timer)); - gsm_mo_init(&bts->gprs.nse.mo, bts, NM_OC_GPRS_NSE, - bts->nr, 0xff, 0xff); - memcpy(&bts->gprs.cell.timer, bts_cell_timer_default, - sizeof(bts->gprs.cell.timer)); - gsm_mo_init(&bts->gprs.cell.mo, bts, NM_OC_GPRS_CELL, - bts->nr, 0xff, 0xff); - memcpy(&bts->gprs.cell.rlc_cfg, &rlc_cfg_default, - sizeof(bts->gprs.cell.rlc_cfg)); - - /* create our primary TRX */ - bts->c0 = gsm_bts_trx_alloc(bts); - if (!bts->c0) { - talloc_free(bts); - return NULL; - } - bts->c0->ts[0].pchan = GSM_PCHAN_CCCH_SDCCH4; - - bts->rach_b_thresh = -1; - bts->rach_ldavg_slots = -1; - bts->paging.free_chans_need = -1; - bts->features.data = &bts->_features_data[0]; - bts->features.data_len = sizeof(bts->_features_data); - - /* si handling */ - bts->bcch_change_mark = 1; - - return bts; -} - -/* reset the state of all MO in the BTS */ -void gsm_bts_mo_reset(struct gsm_bts *bts) -{ - struct gsm_bts_trx *trx; - unsigned int i; - - gsm_abis_mo_reset(&bts->mo); - gsm_abis_mo_reset(&bts->site_mgr.mo); - for (i = 0; i < ARRAY_SIZE(bts->gprs.nsvc); i++) - gsm_abis_mo_reset(&bts->gprs.nsvc[i].mo); - gsm_abis_mo_reset(&bts->gprs.nse.mo); - gsm_abis_mo_reset(&bts->gprs.cell.mo); - - llist_for_each_entry(trx, &bts->trx_list, list) { - gsm_abis_mo_reset(&trx->mo); - gsm_abis_mo_reset(&trx->bb_transc.mo); - - for (i = 0; i < ARRAY_SIZE(trx->ts); i++) { - struct gsm_bts_trx_ts *ts = &trx->ts[i]; - gsm_abis_mo_reset(&ts->mo); - } - } -} - -struct gsm_bts_trx *gsm_bts_trx_num(const struct gsm_bts *bts, int num) -{ - struct gsm_bts_trx *trx; - - if (num >= bts->num_trx) - return NULL; - - llist_for_each_entry(trx, &bts->trx_list, list) { - if (trx->nr == num) - return trx; - } - - return NULL; -} - -static char ts2str[255]; - -char *gsm_trx_name(const struct gsm_bts_trx *trx) -{ - if (!trx) - snprintf(ts2str, sizeof(ts2str), "(trx=NULL)"); - else - snprintf(ts2str, sizeof(ts2str), "(bts=%d,trx=%d)", - trx->bts->nr, trx->nr); - - return ts2str; -} - - -char *gsm_ts_name(const struct gsm_bts_trx_ts *ts) -{ - snprintf(ts2str, sizeof(ts2str), "(bts=%d,trx=%d,ts=%d)", - ts->trx->bts->nr, ts->trx->nr, ts->nr); - - return ts2str; -} - -/*! Log timeslot number with full pchan information */ -char *gsm_ts_and_pchan_name(const struct gsm_bts_trx_ts *ts) -{ - switch (ts->pchan) { - case GSM_PCHAN_TCH_F_TCH_H_PDCH: - if (ts->dyn.pchan_is == ts->dyn.pchan_want) - snprintf(ts2str, sizeof(ts2str), - "(bts=%d,trx=%d,ts=%d,pchan=%s as %s)", - ts->trx->bts->nr, ts->trx->nr, ts->nr, - gsm_pchan_name(ts->pchan), - gsm_pchan_name(ts->dyn.pchan_is)); - else - snprintf(ts2str, sizeof(ts2str), - "(bts=%d,trx=%d,ts=%d,pchan=%s" - " switching %s -> %s)", - ts->trx->bts->nr, ts->trx->nr, ts->nr, - gsm_pchan_name(ts->pchan), - gsm_pchan_name(ts->dyn.pchan_is), - gsm_pchan_name(ts->dyn.pchan_want)); - break; - case GSM_PCHAN_TCH_F_PDCH: - if ((ts->flags & TS_F_PDCH_PENDING_MASK) == 0) - snprintf(ts2str, sizeof(ts2str), - "(bts=%d,trx=%d,ts=%d,pchan=%s as %s)", - ts->trx->bts->nr, ts->trx->nr, ts->nr, - gsm_pchan_name(ts->pchan), - (ts->flags & TS_F_PDCH_ACTIVE)? "PDCH" - : "TCH/F"); - else - snprintf(ts2str, sizeof(ts2str), - "(bts=%d,trx=%d,ts=%d,pchan=%s" - " switching %s -> %s)", - ts->trx->bts->nr, ts->trx->nr, ts->nr, - gsm_pchan_name(ts->pchan), - (ts->flags & TS_F_PDCH_ACTIVE)? "PDCH" - : "TCH/F", - (ts->flags & TS_F_PDCH_ACT_PENDING)? "PDCH" - : "TCH/F"); - break; - default: - snprintf(ts2str, sizeof(ts2str), "(bts=%d,trx=%d,ts=%d,pchan=%s)", - ts->trx->bts->nr, ts->trx->nr, ts->nr, - gsm_pchan_name(ts->pchan)); - break; - } - - return ts2str; -} - -char *gsm_lchan_name_compute(const struct gsm_lchan *lchan) -{ - struct gsm_bts_trx_ts *ts = lchan->ts; - - snprintf(ts2str, sizeof(ts2str), "(bts=%d,trx=%d,ts=%d,ss=%d)", - ts->trx->bts->nr, ts->trx->nr, ts->nr, lchan->nr); - - return ts2str; -} - -/* obtain the MO structure for a given object instance */ -struct gsm_abis_mo * -gsm_objclass2mo(struct gsm_bts *bts, uint8_t obj_class, - const struct abis_om_obj_inst *obj_inst) -{ - struct gsm_bts_trx *trx; - struct gsm_abis_mo *mo = NULL; - - switch (obj_class) { - case NM_OC_BTS: - mo = &bts->mo; - break; - case NM_OC_RADIO_CARRIER: - if (obj_inst->trx_nr >= bts->num_trx) { - return NULL; - } - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - mo = &trx->mo; - break; - case NM_OC_BASEB_TRANSC: - if (obj_inst->trx_nr >= bts->num_trx) { - return NULL; - } - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - mo = &trx->bb_transc.mo; - break; - case NM_OC_CHANNEL: - if (obj_inst->trx_nr >= bts->num_trx) { - return NULL; - } - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - if (obj_inst->ts_nr >= TRX_NR_TS) - return NULL; - mo = &trx->ts[obj_inst->ts_nr].mo; - break; - case NM_OC_SITE_MANAGER: - mo = &bts->site_mgr.mo; - break; - case NM_OC_BS11: - switch (obj_inst->bts_nr) { - case BS11_OBJ_CCLK: - mo = &bts->bs11.cclk.mo; - break; - case BS11_OBJ_BBSIG: - if (obj_inst->ts_nr > bts->num_trx) - return NULL; - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - mo = &trx->bs11.bbsig.mo; - break; - case BS11_OBJ_PA: - if (obj_inst->ts_nr > bts->num_trx) - return NULL; - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - mo = &trx->bs11.pa.mo; - break; - default: - return NULL; - } - break; - case NM_OC_BS11_RACK: - mo = &bts->bs11.rack.mo; - break; - case NM_OC_BS11_ENVABTSE: - if (obj_inst->trx_nr >= ARRAY_SIZE(bts->bs11.envabtse)) - return NULL; - mo = &bts->bs11.envabtse[obj_inst->trx_nr].mo; - break; - case NM_OC_GPRS_NSE: - mo = &bts->gprs.nse.mo; - break; - case NM_OC_GPRS_CELL: - mo = &bts->gprs.cell.mo; - break; - case NM_OC_GPRS_NSVC: - if (obj_inst->trx_nr >= ARRAY_SIZE(bts->gprs.nsvc)) - return NULL; - mo = &bts->gprs.nsvc[obj_inst->trx_nr].mo; - break; - } - return mo; -} - -/* obtain the gsm_nm_state data structure for a given object instance */ -struct gsm_nm_state * -gsm_objclass2nmstate(struct gsm_bts *bts, uint8_t obj_class, - const struct abis_om_obj_inst *obj_inst) -{ - struct gsm_abis_mo *mo; - - mo = gsm_objclass2mo(bts, obj_class, obj_inst); - if (!mo) - return NULL; - - return &mo->nm_state; -} - -/* obtain the in-memory data structure of a given object instance */ -void * -gsm_objclass2obj(struct gsm_bts *bts, uint8_t obj_class, - const struct abis_om_obj_inst *obj_inst) -{ - struct gsm_bts_trx *trx; - void *obj = NULL; - - switch (obj_class) { - case NM_OC_BTS: - obj = bts; - break; - case NM_OC_RADIO_CARRIER: - if (obj_inst->trx_nr >= bts->num_trx) { - return NULL; - } - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - obj = trx; - break; - case NM_OC_BASEB_TRANSC: - if (obj_inst->trx_nr >= bts->num_trx) { - return NULL; - } - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - obj = &trx->bb_transc; - break; - case NM_OC_CHANNEL: - if (obj_inst->trx_nr >= bts->num_trx) { - return NULL; - } - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - if (obj_inst->ts_nr >= TRX_NR_TS) - return NULL; - obj = &trx->ts[obj_inst->ts_nr]; - break; - case NM_OC_SITE_MANAGER: - obj = &bts->site_mgr; - break; - case NM_OC_GPRS_NSE: - obj = &bts->gprs.nse; - break; - case NM_OC_GPRS_CELL: - obj = &bts->gprs.cell; - break; - case NM_OC_GPRS_NSVC: - if (obj_inst->trx_nr >= ARRAY_SIZE(bts->gprs.nsvc)) - return NULL; - obj = &bts->gprs.nsvc[obj_inst->trx_nr]; - break; - } - return obj; -} - -/* See Table 10.5.25 of GSM04.08 */ -uint8_t gsm_pchan2chan_nr(enum gsm_phys_chan_config pchan, - uint8_t ts_nr, uint8_t lchan_nr) -{ - uint8_t cbits, chan_nr; - - switch (pchan) { - case GSM_PCHAN_TCH_F: - case GSM_PCHAN_TCH_F_PDCH: - OSMO_ASSERT(lchan_nr == 0); - cbits = 0x01; - break; - case GSM_PCHAN_PDCH: - OSMO_ASSERT(lchan_nr == 0); - cbits = RSL_CHAN_OSMO_PDCH >> 3; - break; - case GSM_PCHAN_TCH_H: - OSMO_ASSERT(lchan_nr < 2); - cbits = 0x02; - cbits += lchan_nr; - break; - case GSM_PCHAN_CCCH_SDCCH4: - case GSM_PCHAN_CCCH_SDCCH4_CBCH: - /* - * As a special hack for BCCH, lchan_nr == 4 may be passed - * here. This should never be sent in an RSL message. - * See osmo-bts-xxx/oml.c:opstart_compl(). - */ - if (lchan_nr == CCCH_LCHAN) - chan_nr = 0; - else - OSMO_ASSERT(lchan_nr < 4); - cbits = 0x04; - cbits += lchan_nr; - break; - case GSM_PCHAN_SDCCH8_SACCH8C: - case GSM_PCHAN_SDCCH8_SACCH8C_CBCH: - OSMO_ASSERT(lchan_nr < 8); - cbits = 0x08; - cbits += lchan_nr; - break; - default: - case GSM_PCHAN_CCCH: -#ifdef ROLE_BSC - OSMO_ASSERT(lchan_nr == 0); -#else - /* - * FIXME: On octphy and litecell, we hit above assertion (see - * Max's comment at https://gerrit.osmocom.org/589 ); disabled - * for BTS until this is clarified; remove the #ifdef when it - * is fixed. - */ -#warning "fix caller that passes lchan_nr != 0" -#endif - cbits = 0x10; - break; - } - - chan_nr = (cbits << 3) | (ts_nr & 0x7); - - return chan_nr; -} - -uint8_t gsm_lchan2chan_nr(const struct gsm_lchan *lchan) -{ - enum gsm_phys_chan_config pchan = lchan->ts->pchan; - if (pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH) - return gsm_lchan_as_pchan2chan_nr(lchan, - lchan->ts->dyn.pchan_is); - return gsm_pchan2chan_nr(lchan->ts->pchan, lchan->ts->nr, lchan->nr); -} - -uint8_t gsm_lchan_as_pchan2chan_nr(const struct gsm_lchan *lchan, - enum gsm_phys_chan_config as_pchan) -{ - if (lchan->ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH - && as_pchan == GSM_PCHAN_PDCH) - return RSL_CHAN_OSMO_PDCH | (lchan->ts->nr & ~RSL_CHAN_NR_MASK); - return gsm_pchan2chan_nr(as_pchan, lchan->ts->nr, lchan->nr); -} - -/* return the gsm_lchan for the CBCH (if it exists at all) */ -struct gsm_lchan *gsm_bts_get_cbch(struct gsm_bts *bts) -{ - struct gsm_lchan *lchan = NULL; - struct gsm_bts_trx *trx = bts->c0; - - if (trx->ts[0].pchan == GSM_PCHAN_CCCH_SDCCH4_CBCH) - lchan = &trx->ts[0].lchan[2]; - else { - int i; - for (i = 0; i < 8; i++) { - if (trx->ts[i].pchan == GSM_PCHAN_SDCCH8_SACCH8C_CBCH) { - lchan = &trx->ts[i].lchan[2]; - break; - } - } - } - - return lchan; -} - -/* determine logical channel based on TRX and channel number IE */ -struct gsm_lchan *rsl_lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr, - int *rc) -{ - uint8_t ts_nr = chan_nr & 0x07; - uint8_t cbits = chan_nr >> 3; - uint8_t lch_idx; - struct gsm_bts_trx_ts *ts = &trx->ts[ts_nr]; - bool ok = true; - - if (rc) - *rc = -EINVAL; - - if (cbits == 0x01) { - lch_idx = 0; /* TCH/F */ - if (ts->pchan != GSM_PCHAN_TCH_F && - ts->pchan != GSM_PCHAN_PDCH && - ts->pchan != GSM_PCHAN_TCH_F_PDCH - && !(ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH - && (ts->dyn.pchan_is == GSM_PCHAN_TCH_F - || ts->dyn.pchan_want == GSM_PCHAN_TCH_F))) - ok = false; - } else if ((cbits & 0x1e) == 0x02) { - lch_idx = cbits & 0x1; /* TCH/H */ - if (ts->pchan != GSM_PCHAN_TCH_H - && !(ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH - && (ts->dyn.pchan_is == GSM_PCHAN_TCH_H - || ts->dyn.pchan_want == GSM_PCHAN_TCH_H))) - ok = false; - } else if ((cbits & 0x1c) == 0x04) { - lch_idx = cbits & 0x3; /* SDCCH/4 */ - if (ts->pchan != GSM_PCHAN_CCCH_SDCCH4 && - ts->pchan != GSM_PCHAN_CCCH_SDCCH4_CBCH) - ok = false; - } else if ((cbits & 0x18) == 0x08) { - lch_idx = cbits & 0x7; /* SDCCH/8 */ - if (ts->pchan != GSM_PCHAN_SDCCH8_SACCH8C && - ts->pchan != GSM_PCHAN_SDCCH8_SACCH8C_CBCH) - ok = false; - } else if (cbits == 0x10 || cbits == 0x11 || cbits == 0x12) { - lch_idx = 0; - if (ts->pchan != GSM_PCHAN_CCCH && - ts->pchan != GSM_PCHAN_CCCH_SDCCH4 && - ts->pchan != GSM_PCHAN_CCCH_SDCCH4_CBCH) - ok = false; - /* FIXME: we should not return first sdcch4 !!! */ - } else if ((chan_nr & RSL_CHAN_NR_MASK) == RSL_CHAN_OSMO_PDCH) { - lch_idx = 0; - if (ts->pchan != GSM_PCHAN_TCH_F_TCH_H_PDCH) - ok = false; - } else - return NULL; - - if (rc && ok) - *rc = 0; - - return &ts->lchan[lch_idx]; -} - -static const uint8_t subslots_per_pchan[] = { - [GSM_PCHAN_NONE] = 0, - [GSM_PCHAN_CCCH] = 0, - [GSM_PCHAN_PDCH] = 0, - [GSM_PCHAN_CCCH_SDCCH4] = 4, - [GSM_PCHAN_TCH_F] = 1, - [GSM_PCHAN_TCH_H] = 2, - [GSM_PCHAN_SDCCH8_SACCH8C] = 8, - [GSM_PCHAN_CCCH_SDCCH4_CBCH] = 4, - [GSM_PCHAN_SDCCH8_SACCH8C_CBCH] = 8, - /* - * GSM_PCHAN_TCH_F_PDCH and GSM_PCHAN_TCH_F_TCH_H_PDCH should not be - * part of this, those TS are handled according to their dynamic state. - */ -}; - -/*! Return the actual pchan type, also heeding dynamic TS. */ -enum gsm_phys_chan_config ts_pchan(struct gsm_bts_trx_ts *ts) -{ - switch (ts->pchan) { - case GSM_PCHAN_TCH_F_TCH_H_PDCH: - return ts->dyn.pchan_is; - case GSM_PCHAN_TCH_F_PDCH: - if (ts->flags & TS_F_PDCH_ACTIVE) - return GSM_PCHAN_PDCH; - else - return GSM_PCHAN_TCH_F; - default: - return ts->pchan; - } -} - -/*! According to ts->pchan and possibly ts->dyn_pchan, return the number of - * logical channels available in the timeslot. */ -uint8_t ts_subslots(struct gsm_bts_trx_ts *ts) -{ - return subslots_per_pchan[ts_pchan(ts)]; -} - -static bool pchan_is_tch(enum gsm_phys_chan_config pchan) -{ - switch (pchan) { - case GSM_PCHAN_TCH_F: - case GSM_PCHAN_TCH_H: - return true; - default: - return false; - } -} - -bool ts_is_tch(struct gsm_bts_trx_ts *ts) -{ - return pchan_is_tch(ts_pchan(ts)); -} diff --git a/src/libcommon/gsm_subscriber_base.c b/src/libcommon/gsm_subscriber_base.c deleted file mode 100644 index 2a8a59f..0000000 --- a/src/libcommon/gsm_subscriber_base.c +++ /dev/null @@ -1,64 +0,0 @@ -/* The concept of a subscriber as seen by the BSC */ - -/* (C) 2008 by Harald Welte - * (C) 2009-2010 by Holger Hans Peter Freyther - * (C) 2010 by On-Waves - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -LLIST_HEAD(active_subscribers); -void *tall_subscr_ctx; - -/* return static buffer with printable name of VLR subscriber */ -const char *vlr_subscr_name(struct vlr_subscr *vsub) -{ - static char buf[32]; - if (!vsub) - return "unknown"; - if (vsub->msisdn[0]) - snprintf(buf, sizeof(buf), "MSISDN:%s", vsub->msisdn); - else if (vsub->imsi[0]) - snprintf(buf, sizeof(buf), "IMSI:%s", vsub->imsi); - else if (vsub->tmsi != GSM_RESERVED_TMSI) - snprintf(buf, sizeof(buf), "TMSI:0x%08x", vsub->tmsi); - else if (vsub->tmsi_new != GSM_RESERVED_TMSI) - snprintf(buf, sizeof(buf), "TMSI(new):0x%08x", vsub->tmsi_new); - else - return "unknown"; - buf[sizeof(buf)-1] = '\0'; - return buf; -} - -const char *vlr_subscr_msisdn_or_name(struct vlr_subscr *vsub) -{ - if (!vsub || !vsub->msisdn[0]) - return vlr_subscr_name(vsub); - return vsub->msisdn; -} diff --git a/src/libcommon/gsup_client.c b/src/libcommon/gsup_client.c deleted file mode 100644 index 0520045..0000000 --- a/src/libcommon/gsup_client.c +++ /dev/null @@ -1,347 +0,0 @@ -/* Generic Subscriber Update Protocol client */ - -/* (C) 2014-2016 by Sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * Author: Jacob Erlbeck - * Author: Neels Hofmeyr - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include - -#include -#include -#include -#include - -#include - -#include -#include - -extern void *tall_bsc_ctx; - -static void start_test_procedure(struct gsup_client *gsupc); - -static void gsup_client_send_ping(struct gsup_client *gsupc) -{ - struct msgb *msg = gsup_client_msgb_alloc(); - - msg->l2h = msgb_put(msg, 1); - msg->l2h[0] = IPAC_MSGT_PING; - ipa_msg_push_header(msg, IPAC_PROTO_IPACCESS); - ipa_client_conn_send(gsupc->link, msg); -} - -static int gsup_client_connect(struct gsup_client *gsupc) -{ - int rc; - - if (gsupc->is_connected) - return 0; - - if (osmo_timer_pending(&gsupc->connect_timer)) { - LOGP(DLGSUP, LOGL_DEBUG, - "GSUP connect: connect timer already running\n"); - osmo_timer_del(&gsupc->connect_timer); - } - - if (osmo_timer_pending(&gsupc->ping_timer)) { - LOGP(DLGSUP, LOGL_DEBUG, - "GSUP connect: ping timer already running\n"); - osmo_timer_del(&gsupc->ping_timer); - } - - if (ipa_client_conn_clear_queue(gsupc->link) > 0) - LOGP(DLGSUP, LOGL_DEBUG, "GSUP connect: discarded stored messages\n"); - - rc = ipa_client_conn_open(gsupc->link); - - if (rc >= 0) { - LOGP(DLGSUP, LOGL_NOTICE, "GSUP connecting to %s:%d\n", - gsupc->link->addr, gsupc->link->port); - return 0; - } - - LOGP(DLGSUP, LOGL_ERROR, "GSUP failed to connect to %s:%d: %s\n", - gsupc->link->addr, gsupc->link->port, strerror(-rc)); - - if (rc == -EBADF || rc == -ENOTSOCK || rc == -EAFNOSUPPORT || - rc == -EINVAL) - return rc; - - osmo_timer_schedule(&gsupc->connect_timer, - GSUP_CLIENT_RECONNECT_INTERVAL, 0); - - LOGP(DLGSUP, LOGL_INFO, "Scheduled timer to retry GSUP connect to %s:%d\n", - gsupc->link->addr, gsupc->link->port); - - return 0; -} - -static void connect_timer_cb(void *gsupc_) -{ - struct gsup_client *gsupc = gsupc_; - - if (gsupc->is_connected) - return; - - gsup_client_connect(gsupc); -} - -static void client_send(struct gsup_client *gsupc, int proto_ext, - struct msgb *msg_tx) -{ - ipa_prepend_header_ext(msg_tx, proto_ext); - ipa_msg_push_header(msg_tx, IPAC_PROTO_OSMO); - ipa_client_conn_send(gsupc->link, msg_tx); - /* msg_tx is now queued and will be freed. */ -} - -static void gsup_client_oap_register(struct gsup_client *gsupc) -{ - struct msgb *msg_tx; - int rc; - rc = osmo_oap_client_register(&gsupc->oap_state, &msg_tx); - - if ((rc < 0) || (!msg_tx)) { - LOGP(DLGSUP, LOGL_ERROR, "GSUP OAP set up, but cannot register.\n"); - return; - } - - client_send(gsupc, IPAC_PROTO_EXT_OAP, msg_tx); -} - -static void gsup_client_updown_cb(struct ipa_client_conn *link, int up) -{ - struct gsup_client *gsupc = link->data; - - LOGP(DLGSUP, LOGL_INFO, "GSUP link to %s:%d %s\n", - link->addr, link->port, up ? "UP" : "DOWN"); - - gsupc->is_connected = up; - - if (up) { - start_test_procedure(gsupc); - - if (gsupc->osmo_oap_state.state == OSMO_OAP_INITIALIZED) - gsup_client_oap_register(gsupc); - - osmo_timer_del(&gsupc->connect_timer); - } else { - osmo_timer_del(&gsupc->ping_timer); - - osmo_timer_schedule(&gsupc->connect_timer, - GSUP_CLIENT_RECONNECT_INTERVAL, 0); - } -} - -static int gsup_client_oap_handle(struct gsup_client *gsupc, struct msgb *msg_rx) -{ - int rc; - struct msgb *msg_tx; - - /* If the oap_state is disabled, this will reject the messages. */ - rc = osmo_oap_client_handle(&gsupc->oap_state, msg_rx, &msg_tx); - msgb_free(msg_rx); - if (rc < 0) - return rc; - - if (msg_tx) - client_send(gsupc, IPAC_PROTO_EXT_OAP, msg_tx); - - return 0; -} - -static int gsup_client_read_cb(struct ipa_client_conn *link, struct msgb *msg) -{ - struct ipaccess_head *hh = (struct ipaccess_head *) msg->data; - struct ipaccess_head_ext *he = (struct ipaccess_head_ext *) msgb_l2(msg); - struct gsup_client *gsupc = (struct gsup_client *)link->data; - int rc; - struct ipaccess_unit ipa_dev = { - /* see gsup_client_create() on const vs non-const */ - .unit_name = (char*)gsupc->unit_name, - }; - - OSMO_ASSERT(ipa_dev.unit_name); - - msg->l2h = &hh->data[0]; - - rc = ipaccess_bts_handle_ccm(link, &ipa_dev, msg); - - if (rc < 0) { - LOGP(DLGSUP, LOGL_NOTICE, - "GSUP received an invalid IPA/CCM message from %s:%d\n", - link->addr, link->port); - /* Link has been closed */ - gsupc->is_connected = 0; - msgb_free(msg); - return -1; - } - - if (rc == 1) { - uint8_t msg_type = *(msg->l2h); - /* CCM message */ - if (msg_type == IPAC_MSGT_PONG) { - LOGP(DLGSUP, LOGL_DEBUG, "GSUP receiving PONG\n"); - gsupc->got_ipa_pong = 1; - } - - msgb_free(msg); - return 0; - } - - if (hh->proto != IPAC_PROTO_OSMO) - goto invalid; - - if (!he || msgb_l2len(msg) < sizeof(*he)) - goto invalid; - - msg->l2h = &he->data[0]; - - if (he->proto == IPAC_PROTO_EXT_GSUP) { - OSMO_ASSERT(gsupc->read_cb != NULL); - gsupc->read_cb(gsupc, msg); - /* expecting read_cb() to free msg */ - } else if (he->proto == IPAC_PROTO_EXT_OAP) { - return gsup_client_oap_handle(gsupc, msg); - /* gsup_client_oap_handle frees msg */ - } else - goto invalid; - - return 0; - -invalid: - LOGP(DLGSUP, LOGL_NOTICE, - "GSUP received an invalid IPA message from %s:%d, size = %d\n", - link->addr, link->port, msgb_length(msg)); - - msgb_free(msg); - return -1; -} - -static void ping_timer_cb(void *gsupc_) -{ - struct gsup_client *gsupc = gsupc_; - - LOGP(DLGSUP, LOGL_INFO, "GSUP ping callback (%s, %s PONG)\n", - gsupc->is_connected ? "connected" : "not connected", - gsupc->got_ipa_pong ? "got" : "didn't get"); - - if (gsupc->got_ipa_pong) { - start_test_procedure(gsupc); - return; - } - - LOGP(DLGSUP, LOGL_NOTICE, "GSUP ping timed out, reconnecting\n"); - ipa_client_conn_close(gsupc->link); - gsupc->is_connected = 0; - - gsup_client_connect(gsupc); -} - -static void start_test_procedure(struct gsup_client *gsupc) -{ - osmo_timer_setup(&gsupc->ping_timer, ping_timer_cb, gsupc); - - gsupc->got_ipa_pong = 0; - osmo_timer_schedule(&gsupc->ping_timer, GSUP_CLIENT_PING_INTERVAL, 0); - LOGP(DLGSUP, LOGL_DEBUG, "GSUP sending PING\n"); - gsup_client_send_ping(gsupc); -} - -struct gsup_client *gsup_client_create(const char *unit_name, - const char *ip_addr, - unsigned int tcp_port, - gsup_client_read_cb_t read_cb, - struct osmo_oap_client_config *oapc_config) -{ - struct gsup_client *gsupc; - int rc; - - gsupc = talloc_zero(tall_bsc_ctx, struct gsup_client); - OSMO_ASSERT(gsupc); - - /* struct ipaccess_unit has a non-const unit_name, so let's copy to be - * able to have a non-const unit_name here as well. To not taint the - * public gsup_client API, let's store it in a const char* anyway. */ - gsupc->unit_name = talloc_strdup(gsupc, unit_name); - OSMO_ASSERT(gsupc->unit_name); - - /* a NULL oapc_config will mark oap_state disabled. */ - rc = osmo_oap_client_init(oapc_config, &gsupc->oap_state); - if (rc != 0) - goto failed; - - gsupc->link = ipa_client_conn_create(gsupc, - /* no e1inp */ NULL, - 0, - ip_addr, tcp_port, - gsup_client_updown_cb, - gsup_client_read_cb, - /* default write_cb */ NULL, - gsupc); - if (!gsupc->link) - goto failed; - - osmo_timer_setup(&gsupc->connect_timer, connect_timer_cb, gsupc); - - rc = gsup_client_connect(gsupc); - - if (rc < 0) - goto failed; - - gsupc->read_cb = read_cb; - - return gsupc; - -failed: - gsup_client_destroy(gsupc); - return NULL; -} - -void gsup_client_destroy(struct gsup_client *gsupc) -{ - osmo_timer_del(&gsupc->connect_timer); - osmo_timer_del(&gsupc->ping_timer); - - if (gsupc->link) { - ipa_client_conn_close(gsupc->link); - ipa_client_conn_destroy(gsupc->link); - gsupc->link = NULL; - } - talloc_free(gsupc); -} - -int gsup_client_send(struct gsup_client *gsupc, struct msgb *msg) -{ - if (!gsupc || !gsupc->is_connected) { - LOGP(DGPRS, LOGL_ERROR, "GSUP not connected, unable to send %s\n", msgb_hexdump(msg)); - msgb_free(msg); - return -ENOTCONN; - } - - client_send(gsupc, IPAC_PROTO_EXT_GSUP, msg); - - return 0; -} - -struct msgb *gsup_client_msgb_alloc(void) -{ - return msgb_alloc_headroom(4000, 64, __func__); -} diff --git a/src/libcommon/gsup_test_client.c b/src/libcommon/gsup_test_client.c deleted file mode 100644 index 2357ba5..0000000 --- a/src/libcommon/gsup_test_client.c +++ /dev/null @@ -1,299 +0,0 @@ -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include - -static struct gsup_client *g_gc; - - -/*********************************************************************** - * IMSI Operation - ***********************************************************************/ -static LLIST_HEAD(g_imsi_ops); - -struct imsi_op_stats { - uint32_t num_alloc; - uint32_t num_released; - uint32_t num_rx_success; - uint32_t num_rx_error; - uint32_t num_timeout; -}; - -enum imsi_op_type { - IMSI_OP_SAI, - IMSI_OP_LU, - IMSI_OP_ISD, - _NUM_IMSI_OP -}; - -static const struct value_string imsi_op_names[] = { - { IMSI_OP_SAI, "SAI" }, - { IMSI_OP_LU, "LU" }, - { IMSI_OP_ISD, "ISD" }, - { 0, NULL } -}; - -static struct imsi_op_stats imsi_op_stats[_NUM_IMSI_OP]; - -struct imsi_op { - struct llist_head list; - char imsi[17]; - enum imsi_op_type type; - struct osmo_timer_list timer; -}; - -static struct imsi_op *imsi_op_find(const char *imsi, - enum imsi_op_type type) -{ - struct imsi_op *io; - - llist_for_each_entry(io, &g_imsi_ops, list) { - if (!strcmp(io->imsi, imsi) && io->type == type) - return io; - } - return NULL; -} - -static void imsi_op_timer_cb(void *data); - -static struct imsi_op *imsi_op_alloc(void *ctx, const char *imsi, - enum imsi_op_type type) -{ - struct imsi_op *io; - - if (imsi_op_find(imsi, type)) - return NULL; - - io = talloc_zero(ctx, struct imsi_op); - osmo_strlcpy(io->imsi, imsi, sizeof(io->imsi)); - io->type = type; - osmo_timer_setup(&io->timer, imsi_op_timer_cb, io); - llist_add(&io->list, &g_imsi_ops); - imsi_op_stats[type].num_alloc++; - - return io; -} - -static void imsi_op_release(struct imsi_op *io) -{ - osmo_timer_del(&io->timer); - llist_del(&io->list); - imsi_op_stats[io->type].num_released++; - talloc_free(io); -} - -static void imsi_op_timer_cb(void *data) -{ - struct imsi_op *io = data; - printf("%s: Timer expiration\n", io->imsi); - imsi_op_stats[io->type].num_timeout++; - imsi_op_release(io); -} - -/* allocate + generate + send Send-Auth-Info */ -int req_auth_info(const char *imsi) -{ - struct imsi_op *io = imsi_op_alloc(g_gc, imsi, IMSI_OP_SAI); - struct osmo_gsup_message gsup = {0}; - struct msgb *msg = msgb_alloc_headroom(1200, 200, __func__); - - osmo_strlcpy(gsup.imsi, io->imsi, sizeof(gsup.imsi)); - gsup.message_type = OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST; - - osmo_gsup_encode(msg, &gsup); - - return gsup_client_send(g_gc, msg); -} - -/* allocate + generate + send Send-Auth-Info */ -int req_loc_upd(const char *imsi) -{ - struct imsi_op *io = imsi_op_alloc(g_gc, imsi, IMSI_OP_LU); - struct osmo_gsup_message gsup = {0}; - struct msgb *msg = msgb_alloc_headroom(1200, 200, __func__); - - osmo_strlcpy(gsup.imsi, io->imsi, sizeof(gsup.imsi)); - gsup.message_type = OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST; - - osmo_gsup_encode(msg, &gsup); - - return gsup_client_send(g_gc, msg); -} - -int resp_isd(struct imsi_op *io) -{ - struct osmo_gsup_message gsup = {0}; - struct msgb *msg = msgb_alloc_headroom(1200, 200, __func__); - - osmo_strlcpy(gsup.imsi, io->imsi, sizeof(gsup.imsi)); - gsup.message_type = OSMO_GSUP_MSGT_INSERT_DATA_RESULT; - - osmo_gsup_encode(msg, &gsup); - - imsi_op_release(io); - - return gsup_client_send(g_gc, msg); -} - -/* receive an incoming GSUP message */ -static void imsi_op_rx_gsup(struct imsi_op *io, const struct osmo_gsup_message *gsup) -{ - int is_error = 0; - - if (OSMO_GSUP_IS_MSGT_ERROR(gsup->message_type)) { - imsi_op_stats[io->type].num_rx_error++; - is_error = 1; - } else - imsi_op_stats[io->type].num_rx_success++; - - switch (io->type) { - case IMSI_OP_SAI: - printf("%s; SAI Response%s\n", io->imsi, is_error ? ": ERROR" : ""); - /* now that we have auth tuples, request LU */ - req_loc_upd(io->imsi); - imsi_op_release(io); - break; - case IMSI_OP_LU: - printf("%s; LU Response%s\n", io->imsi, is_error ? ": ERROR" : ""); - imsi_op_release(io); - break; - case IMSI_OP_ISD: - printf("%s; ISD Request%s\n", io->imsi, is_error ? ": ERROR" : ""); - resp_isd(io); - break; - default: - printf("%s: Unknown\n", io->imsi); - imsi_op_release(io); - break; - } -} - -static int op_type_by_gsup_msgt(enum osmo_gsup_message_type msg_type) -{ - switch (msg_type) { - case OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: - case OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR: - return IMSI_OP_SAI; - case OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: - case OSMO_GSUP_MSGT_UPDATE_LOCATION_ERROR: - return IMSI_OP_LU; - case OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: - return IMSI_OP_ISD; - default: - printf("Unknown GSUP msg_type %u\n", msg_type); - return -1; - } -} - -static int gsupc_read_cb(struct gsup_client *gsupc, struct msgb *msg) -{ - struct osmo_gsup_message gsup_msg = {0}; - struct imsi_op *io; - int rc; - - DEBUGP(DGPRS, "Rx GSUP %s\n", osmo_hexdump(msgb_l2(msg), msgb_l2len(msg))); - - rc = osmo_gsup_decode(msgb_l2(msg), msgb_l2len(msg), &gsup_msg); - if (rc < 0) - return rc; - - if (!gsup_msg.imsi[0]) - return -1; - - rc = op_type_by_gsup_msgt(gsup_msg.message_type); - if (rc < 0) - return rc; - - switch (rc) { - case IMSI_OP_SAI: - case IMSI_OP_LU: - io = imsi_op_find(gsup_msg.imsi, rc); - if (!io) - return -1; - break; - case IMSI_OP_ISD: - /* ISD is an inbound transaction */ - io = imsi_op_alloc(g_gc, gsup_msg.imsi, IMSI_OP_ISD); - break; - } - - imsi_op_rx_gsup(io, &gsup_msg); - msgb_free(msg); - - return 0; -} - -static void print_report(void) -{ - unsigned int i; - - for (i = 0; i < ARRAY_SIZE(imsi_op_stats); i++) { - struct imsi_op_stats *st = &imsi_op_stats[i]; - const char *name = get_value_string(imsi_op_names, i); - printf("%s: %u alloc, %u released, %u success, %u error , %u tout\n", - name, st->num_alloc, st->num_released, st->num_rx_success, - st->num_rx_error, st->num_timeout); - } -} - -static void sig_cb(int sig) -{ - switch (sig) { - case SIGINT: - print_report(); - exit(0); - break; - } -} - -void *tall_bsc_ctx = NULL; - -/* default categories */ -static struct log_info_cat default_categories[] = { -}; - -static const struct log_info gsup_test_client_log_info = { - .cat = default_categories, - .num_cat = ARRAY_SIZE(default_categories), -}; - -int main(int argc, char **argv) -{ - unsigned long long i; - char *server_host = "127.0.0.1"; - uint16_t server_port = OSMO_GSUP_PORT; - void *ctx = talloc_named_const(NULL, 0, "gsup_test_client"); - - osmo_init_logging2(ctx, &gsup_test_client_log_info); - - g_gc = gsup_client_create(ctx, "GSUPTEST", server_host, server_port, - gsupc_read_cb, NULL); - - - signal(SIGINT, sig_cb); - - for (i = 0; i < 10000; i++) { - unsigned long long imsi = 901790000000000 + i; - char imsi_buf[17]; - snprintf(imsi_buf, sizeof(imsi_buf), "%015llu", imsi); - req_auth_info(imsi_buf); - osmo_select_main(0); - } - - while (1) { - osmo_select_main(0); - } - - print_report(); - exit(0); -} diff --git a/src/libcommon/socket.c b/src/libcommon/socket.c deleted file mode 100644 index dfcb393..0000000 --- a/src/libcommon/socket.c +++ /dev/null @@ -1,111 +0,0 @@ -/* OpenBSC sokcet code, taken from Abis input driver for ip.access */ - -/* (C) 2009 by Harald Welte - * (C) 2010 by Holger Hans Peter Freyther - * (C) 2010 by On-Waves - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -int make_sock(struct osmo_fd *bfd, int proto, - uint32_t ip, uint16_t port, int priv_nr, - int (*cb)(struct osmo_fd *fd, unsigned int what), void *data) -{ - struct sockaddr_in addr; - int ret, on = 1; - int type = SOCK_STREAM; - - switch (proto) { - case IPPROTO_TCP: - type = SOCK_STREAM; - break; - case IPPROTO_UDP: - type = SOCK_DGRAM; - break; -#ifdef IPPROTO_GRE - case IPPROTO_GRE: - type = SOCK_RAW; - break; -#endif - default: - return -EINVAL; - } - - bfd->fd = socket(AF_INET, type, proto); - bfd->cb = cb; - bfd->when = BSC_FD_READ; - bfd->data = data; - bfd->priv_nr = priv_nr; - - if (bfd->fd < 0) { - LOGP(DLINP, LOGL_ERROR, "could not create socket.\n"); - return -EIO; - } - - memset(&addr, 0, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(port); - if (ip != INADDR_ANY) - addr.sin_addr.s_addr = htonl(ip); - else - addr.sin_addr.s_addr = INADDR_ANY; - - setsockopt(bfd->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); - - ret = bind(bfd->fd, (struct sockaddr *) &addr, sizeof(addr)); - if (ret < 0) { - LOGP(DLINP, LOGL_ERROR, "could not bind socket %s\n", - strerror(errno)); - close(bfd->fd); - return -EIO; - } - - if (proto == IPPROTO_TCP) { - ret = listen(bfd->fd, 1); - if (ret < 0) { - perror("listen"); - close(bfd->fd); - return ret; - } - } - - ret = osmo_fd_register(bfd); - if (ret < 0) { - perror("register_listen_fd"); - close(bfd->fd); - return ret; - } - return 0; -} diff --git a/src/libcommon/talloc_ctx.c b/src/libcommon/talloc_ctx.c deleted file mode 100644 index c8e9cd3..0000000 --- a/src/libcommon/talloc_ctx.c +++ /dev/null @@ -1,55 +0,0 @@ -/* OpenBSC allocation contexts initialization code */ -/* (C) 2011-2016 by sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include - -extern void *tall_bsc_ctx; -extern void *tall_fle_ctx; -extern void *tall_locop_ctx; -extern void *tall_authciphop_ctx; -extern void *tall_gsms_ctx; -extern void *tall_subscr_ctx; -extern void *tall_sub_req_ctx; -extern void *tall_call_ctx; -extern void *tall_paging_ctx; -extern void *tall_sigh_ctx; -extern void *tall_tqe_ctx; -extern void *tall_trans_ctx; -extern void *tall_map_ctx; -extern void *tall_upq_ctx; -extern void *tall_ctr_ctx; - -void talloc_ctx_init(void *ctx_root) -{ - msgb_talloc_ctx_init(ctx_root, 0); - tall_fle_ctx = talloc_named_const(ctx_root, 0, "bs11_file_list_entry"); - tall_locop_ctx = talloc_named_const(ctx_root, 0, "loc_updating_oper"); - tall_authciphop_ctx = talloc_named_const(ctx_root, 0, "auth_ciph_oper"); - tall_gsms_ctx = talloc_named_const(ctx_root, 0, "sms"); - tall_subscr_ctx = talloc_named_const(ctx_root, 0, "subscriber"); - tall_call_ctx = talloc_named_const(ctx_root, 0, "gsm_call"); - tall_paging_ctx = talloc_named_const(ctx_root, 0, "paging_request"); - tall_sigh_ctx = talloc_named_const(ctx_root, 0, "signal_handler"); - tall_tqe_ctx = talloc_named_const(ctx_root, 0, "subch_txq_entry"); - tall_trans_ctx = talloc_named_const(ctx_root, 0, "transaction"); - tall_map_ctx = talloc_named_const(ctx_root, 0, "trau_map_entry"); - tall_upq_ctx = talloc_named_const(ctx_root, 0, "trau_upq_entry"); - tall_ctr_ctx = talloc_named_const(ctx_root, 0, "counter"); -} -- To view, visit https://gerrit.osmocom.org/10260 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I9307f9da7f48dd0a2e1cb213072068736e569722 Gerrit-Change-Number: 10260 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 17:21:04 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 17:21:04 +0000 Subject: Change in osmo-trx[master]: Fix config file saving of {tx, rx}-path VTY config strings In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10274 ) Change subject: Fix config file saving of {tx,rx}-path VTY config strings ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10274 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I5d5b02c71d39220cabc2a23d059908ef3c6350e0 Gerrit-Change-Number: 10274 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Comment-Date: Tue, 31 Jul 2018 17:21:04 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 17:21:05 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 17:21:05 +0000 Subject: Change in osmo-trx[master]: Fix config file saving of {tx, rx}-path VTY config strings In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10274 ) Change subject: Fix config file saving of {tx,rx}-path VTY config strings ...................................................................... Fix config file saving of {tx,rx}-path VTY config strings We were missing one indent level when writing the rx-path and tx-path Change-Id: I5d5b02c71d39220cabc2a23d059908ef3c6350e0 Closes: OS#3435 --- M CommonLibs/trx_vty.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Vadim Yanitskiy: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/CommonLibs/trx_vty.c b/CommonLibs/trx_vty.c index e69df77..baa26c8 100644 --- a/CommonLibs/trx_vty.c +++ b/CommonLibs/trx_vty.c @@ -424,9 +424,9 @@ chan = &trx->cfg.chans[i]; vty_out(vty, " chan %u%s", chan->idx, VTY_NEWLINE); if (chan->rx_path) - vty_out(vty, " rx-path %s%s", chan->rx_path, VTY_NEWLINE); + vty_out(vty, " rx-path %s%s", chan->rx_path, VTY_NEWLINE); if (chan->tx_path) - vty_out(vty, " tx-path %s%s", chan->tx_path, VTY_NEWLINE); + vty_out(vty, " tx-path %s%s", chan->tx_path, VTY_NEWLINE); } return CMD_SUCCESS; -- To view, visit https://gerrit.osmocom.org/10274 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I5d5b02c71d39220cabc2a23d059908ef3c6350e0 Gerrit-Change-Number: 10274 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 17:21:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 17:21:23 +0000 Subject: Change in osmo-msc[master]: migrate to oap_client in libosmogsm In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10257 ) Change subject: migrate to oap_client in libosmogsm ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/10257 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib6496c35d0ce6eb531e97129dc45a9f68e503b34 Gerrit-Change-Number: 10257 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 31 Jul 2018 17:21:23 +0000 Gerrit-HasComments: No Gerrit-HasLabels: No -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 17:21:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 17:21:24 +0000 Subject: Change in osmo-msc[master]: migrate to oap_client in libosmogsm In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10257 ) Change subject: migrate to oap_client in libosmogsm ...................................................................... migrate to oap_client in libosmogsm libosmogsm in libosmocore.git from Change-Id Ie36729996abd30b84d1c30a09f62ebc6a9794950 onwards contains oap_client.c, so we don't need our local copy here in this repo anymore. Change-Id: Ib6496c35d0ce6eb531e97129dc45a9f68e503b34 Requires: libosmocore.git Change-Id Ie36729996abd30b84d1c30a09f62ebc6a9794950 --- M include/osmocom/msc/Makefile.am M include/osmocom/msc/gsup_client.h D include/osmocom/msc/oap_client.h M src/libgsupclient/Makefile.am M src/libgsupclient/gsup_client.c D src/libgsupclient/oap_client.c M tests/msc_vlr/msc_vlr_tests.c 7 files changed, 11 insertions(+), 375 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am index 5be51ea..b1a4810 100644 --- a/include/osmocom/msc/Makefile.am +++ b/include/osmocom/msc/Makefile.am @@ -21,7 +21,6 @@ mncc_int.h \ msc_ifaces.h \ msc_mgcp.h \ - oap_client.h \ openbscdefines.h \ a_reset.h \ osmo_msc.h \ diff --git a/include/osmocom/msc/gsup_client.h b/include/osmocom/msc/gsup_client.h index 59e650f..2f6170b 100644 --- a/include/osmocom/msc/gsup_client.h +++ b/include/osmocom/msc/gsup_client.h @@ -23,7 +23,7 @@ #include -#include +#include /* a loss of GSUP between MSC and HLR is considered quite serious, let's try to recover as quickly as * possible. Even one new connection attempt per second should be quite acceptable until the link is @@ -46,7 +46,7 @@ gsup_client_read_cb_t read_cb; void *data; - struct oap_client_state oap_state; + struct osmo_oap_client_state oap_state; struct osmo_timer_list ping_timer; struct osmo_timer_list connect_timer; @@ -59,7 +59,7 @@ const char *ip_addr, unsigned int tcp_port, gsup_client_read_cb_t read_cb, - struct oap_client_config *oapc_config); + struct osmo_oap_client_config *oapc_config); void gsup_client_destroy(struct gsup_client *gsupc); int gsup_client_send(struct gsup_client *gsupc, struct msgb *msg); diff --git a/include/osmocom/msc/oap_client.h b/include/osmocom/msc/oap_client.h deleted file mode 100644 index 80c86d5..0000000 --- a/include/osmocom/msc/oap_client.h +++ /dev/null @@ -1,82 +0,0 @@ -/* Osmocom Authentication Protocol API */ - -/* (C) 2015 by Sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * Author: Neels Hofmeyr - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#pragma once - -#include - -struct msgb; -struct osmo_oap_message; - -/* This is the config part for vty. It is essentially copied in - * oap_client_state, where values are copied over once the config is - * considered valid. */ -struct oap_client_config { - uint16_t client_id; - int secret_k_present; - uint8_t secret_k[16]; - int secret_opc_present; - uint8_t secret_opc[16]; -}; - -/* The runtime state of the OAP client. client_id and the secrets are in fact - * duplicated from oap_client_config, so that a separate validation of the - * config data is possible, and so that only a struct oap_client_state* is - * passed around. */ -struct oap_client_state { - enum { - OAP_UNINITIALIZED = 0, /* just allocated. */ - OAP_DISABLED, /* disabled by config. */ - OAP_INITIALIZED, /* enabled, config is valid. */ - OAP_REQUESTED_CHALLENGE, - OAP_SENT_CHALLENGE_RESULT, - OAP_REGISTERED - } state; - uint16_t client_id; - uint8_t secret_k[16]; - uint8_t secret_opc[16]; - int registration_failures; -}; - -/* From config, initialize state. Return 0 on success. */ -int oap_client_init(struct oap_client_config *config, - struct oap_client_state *state); - -/* Construct an OAP registration message and return in *msg_tx. Use - * state->client_id and update state->state. - * Return 0 on success, or a negative value on error. - * If an error is returned, *msg_tx is guaranteed to be NULL. */ -int oap_client_register(struct oap_client_state *state, struct msgb **msg_tx); - -/* Decode and act on a received OAP message msg_rx. Update state->state. If a - * non-NULL pointer is returned in *msg_tx, that msgb should be sent to the OAP - * server (and freed) by the caller. The received msg_rx is not freed. - * Return 0 on success, or a negative value on error. - * If an error is returned, *msg_tx is guaranteed to be NULL. */ -int oap_client_handle(struct oap_client_state *state, - const struct msgb *msg_rx, struct msgb **msg_tx); - -/* Allocate a msgb and in it, return the encoded oap_client_msg. Return - * NULL on error. (Like oap_client_encode(), but also allocates a msgb.) - * About the name: the idea is do_something(oap_client_encoded(my_struct)) - */ -struct msgb *oap_client_encoded(const struct osmo_oap_message *oap_client_msg); diff --git a/src/libgsupclient/Makefile.am b/src/libgsupclient/Makefile.am index a33fb38..6381687 100644 --- a/src/libgsupclient/Makefile.am +++ b/src/libgsupclient/Makefile.am @@ -19,7 +19,6 @@ libgsupclient_a_SOURCES = \ gsup_client.c \ - oap_client.c \ $(NULL) noinst_PROGRAMS = \ diff --git a/src/libgsupclient/gsup_client.c b/src/libgsupclient/gsup_client.c index 1f395ee..39dc181 100644 --- a/src/libgsupclient/gsup_client.c +++ b/src/libgsupclient/gsup_client.c @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -114,7 +115,7 @@ { struct msgb *msg_tx; int rc; - rc = oap_client_register(&gsupc->oap_state, &msg_tx); + rc = osmo_oap_client_register(&gsupc->oap_state, &msg_tx); if ((rc < 0) || (!msg_tx)) { LOGP(DLGSUP, LOGL_ERROR, "GSUP OAP set up, but cannot register.\n"); @@ -136,7 +137,7 @@ if (up) { start_test_procedure(gsupc); - if (gsupc->oap_state.state == OAP_INITIALIZED) + if (gsupc->oap_state.state == OSMO_OAP_INITIALIZED) gsup_client_oap_register(gsupc); osmo_timer_del(&gsupc->connect_timer); @@ -154,7 +155,7 @@ struct msgb *msg_tx; /* If the oap_state is disabled, this will reject the messages. */ - rc = oap_client_handle(&gsupc->oap_state, msg_rx, &msg_tx); + rc = osmo_oap_client_handle(&gsupc->oap_state, msg_rx, &msg_tx); msgb_free(msg_rx); if (rc < 0) return rc; @@ -268,7 +269,7 @@ const char *ip_addr, unsigned int tcp_port, gsup_client_read_cb_t read_cb, - struct oap_client_config *oapc_config) + struct osmo_oap_client_config *oapc_config) { struct gsup_client *gsupc; int rc; @@ -283,7 +284,7 @@ OSMO_ASSERT(gsupc->unit_name); /* a NULL oapc_config will mark oap_state disabled. */ - rc = oap_client_init(oapc_config, &gsupc->oap_state); + rc = osmo_oap_client_init(oapc_config, &gsupc->oap_state); if (rc != 0) goto failed; diff --git a/src/libgsupclient/oap_client.c b/src/libgsupclient/oap_client.c deleted file mode 100644 index 137515a..0000000 --- a/src/libgsupclient/oap_client.c +++ /dev/null @@ -1,281 +0,0 @@ -/* Osmocom Authentication Protocol API */ - -/* (C) 2015 by Sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * Author: Neels Hofmeyr - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include - -#include -#include -#include -#include - -#include -#include - -int oap_client_init(struct oap_client_config *config, - struct oap_client_state *state) -{ - OSMO_ASSERT(state->state == OAP_UNINITIALIZED); - - if (!config) - goto disable; - - if (config->client_id == 0) - goto disable; - - if (config->secret_k_present == 0) { - LOGP(DLOAP, LOGL_NOTICE, "OAP: client ID set, but secret K missing.\n"); - goto disable; - } - - if (config->secret_opc_present == 0) { - LOGP(DLOAP, LOGL_NOTICE, "OAP: client ID set, but secret OPC missing.\n"); - goto disable; - } - - state->client_id = config->client_id; - memcpy(state->secret_k, config->secret_k, sizeof(state->secret_k)); - memcpy(state->secret_opc, config->secret_opc, sizeof(state->secret_opc)); - state->state = OAP_INITIALIZED; - return 0; - -disable: - state->state = OAP_DISABLED; - return 0; -} - -/* From the given state and received RAND and AUTN octets, validate the - * server's authenticity and formulate the matching milenage reply octets in - * *tx_xres. The state is not modified. - * On success, and if tx_res is not NULL, exactly 8 octets will be written to - * *tx_res. If not NULL, tx_res must point at allocated memory of at least 8 - * octets. The caller will want to send XRES back to the server in a challenge - * response message and update the state. - * Return 0 on success; -1 if OAP is disabled; -2 if rx_random and rx_autn fail - * the authentication check; -3 for any other errors. */ -static int oap_evaluate_challenge(const struct oap_client_state *state, - const uint8_t *rx_random, - const uint8_t *rx_autn, - uint8_t *tx_xres) -{ - struct osmo_auth_vector vec; - - struct osmo_sub_auth_data auth = { - .type = OSMO_AUTH_TYPE_UMTS, - .algo = OSMO_AUTH_ALG_MILENAGE, - }; - - osmo_static_assert(sizeof(((struct osmo_sub_auth_data*)0)->u.umts.k) - == sizeof(state->secret_k), _secret_k_size_match); - osmo_static_assert(sizeof(((struct osmo_sub_auth_data*)0)->u.umts.opc) - == sizeof(state->secret_opc), _secret_opc_size_match); - - switch (state->state) { - case OAP_UNINITIALIZED: - case OAP_DISABLED: - return -1; - default: - break; - } - - memcpy(auth.u.umts.k, state->secret_k, sizeof(auth.u.umts.k)); - memcpy(auth.u.umts.opc, state->secret_opc, sizeof(auth.u.umts.opc)); - memset(auth.u.umts.amf, '\0', sizeof(auth.u.umts.amf)); - auth.u.umts.sqn = 41; /* TODO use incrementing sequence nr */ - - memset(&vec, 0, sizeof(vec)); - osmo_auth_gen_vec(&vec, &auth, rx_random); - - if (vec.res_len != 8) { - LOGP(DLOAP, LOGL_ERROR, "OAP: Expected XRES to be 8 octets, got %d\n", - vec.res_len); - return -3; - } - - if (osmo_constant_time_cmp(vec.autn, rx_autn, sizeof(vec.autn)) != 0) { - LOGP(DLOAP, LOGL_ERROR, "OAP: AUTN mismatch!\n"); - LOGP(DLOAP, LOGL_INFO, "OAP: AUTN from server: %s\n", - osmo_hexdump_nospc(rx_autn, sizeof(vec.autn))); - LOGP(DLOAP, LOGL_INFO, "OAP: AUTN expected: %s\n", - osmo_hexdump_nospc(vec.autn, sizeof(vec.autn))); - return -2; - } - - if (tx_xres != NULL) - memcpy(tx_xres, vec.res, 8); - return 0; -} - -struct msgb *oap_client_encoded(const struct osmo_oap_message *oap_msg) -{ - struct msgb *msg = msgb_alloc_headroom(1000, 64, __func__); - OSMO_ASSERT(msg); - osmo_oap_encode(msg, oap_msg); - return msg; -} - -/* Create a new msgb containing an OAP registration message. - * On error, return NULL. */ -static struct msgb* oap_msg_register(uint16_t client_id) -{ - struct osmo_oap_message oap_msg = {0}; - - if (client_id < 1) { - LOGP(DLOAP, LOGL_ERROR, "OAP: Invalid client ID: %d\n", client_id); - return NULL; - } - - oap_msg.message_type = OAP_MSGT_REGISTER_REQUEST; - oap_msg.client_id = client_id; - return oap_client_encoded(&oap_msg); -} - -int oap_client_register(struct oap_client_state *state, struct msgb **msg_tx) -{ - *msg_tx = oap_msg_register(state->client_id); - if (!(*msg_tx)) - return -1; - - state->state = OAP_REQUESTED_CHALLENGE; - return 0; -} - -/* Create a new msgb containing an OAP challenge response message. - * xres must point at 8 octets to return as challenge response. - * On error, return NULL. */ -static struct msgb* oap_msg_challenge_response(uint8_t *xres) -{ - struct osmo_oap_message oap_reply = {0}; - - oap_reply.message_type = OAP_MSGT_CHALLENGE_RESULT; - memcpy(oap_reply.xres, xres, sizeof(oap_reply.xres)); - oap_reply.xres_present = 1; - return oap_client_encoded(&oap_reply); -} - -static int handle_challenge(struct oap_client_state *state, - struct osmo_oap_message *oap_rx, - struct msgb **msg_tx) -{ - int rc; - uint8_t xres[8]; - - if (!(oap_rx->rand_present && oap_rx->autn_present)) { - LOGP(DLOAP, LOGL_ERROR, - "OAP challenge incomplete (rand_present: %d, autn_present: %d)\n", - oap_rx->rand_present, oap_rx->autn_present); - rc = -2; - goto failure; - } - - rc = oap_evaluate_challenge(state, - oap_rx->rand, - oap_rx->autn, - xres); - if (rc < 0) - goto failure; - - *msg_tx = oap_msg_challenge_response(xres); - if ((*msg_tx) == NULL) { - rc = -1; - goto failure; - } - - state->state = OAP_SENT_CHALLENGE_RESULT; - return 0; - -failure: - OSMO_ASSERT(rc < 0); - state->state = OAP_INITIALIZED; - return rc; -} - -int oap_client_handle(struct oap_client_state *state, - const struct msgb *msg_rx, struct msgb **msg_tx) -{ - uint8_t *data = msgb_l2(msg_rx); - size_t data_len = msgb_l2len(msg_rx); - struct osmo_oap_message oap_msg = {0}; - int rc = 0; - - *msg_tx = NULL; - - OSMO_ASSERT(data); - - rc = osmo_oap_decode(&oap_msg, data, data_len); - if (rc < 0) { - LOGP(DLOAP, LOGL_ERROR, - "Decoding OAP message failed with error '%s' (%d)\n", - get_value_string(gsm48_gmm_cause_names, -rc), -rc); - return -10; - } - - switch (state->state) { - case OAP_UNINITIALIZED: - LOGP(DLOAP, LOGL_ERROR, - "Received OAP message %d, but the OAP client is" - " not initialized\n", oap_msg.message_type); - return -ENOTCONN; - case OAP_DISABLED: - LOGP(DLOAP, LOGL_ERROR, - "Received OAP message %d, but the OAP client is" - " disabled\n", oap_msg.message_type); - return -ENOTCONN; - default: - break; - } - - switch (oap_msg.message_type) { - case OAP_MSGT_CHALLENGE_REQUEST: - return handle_challenge(state, &oap_msg, msg_tx); - - case OAP_MSGT_REGISTER_RESULT: - /* successfully registered */ - state->state = OAP_REGISTERED; - break; - - case OAP_MSGT_REGISTER_ERROR: - LOGP(DLOAP, LOGL_ERROR, - "OAP registration failed\n"); - state->state = OAP_INITIALIZED; - if (state->registration_failures < 3) { - state->registration_failures++; - return oap_client_register(state, msg_tx); - } - return -11; - - case OAP_MSGT_REGISTER_REQUEST: - case OAP_MSGT_CHALLENGE_RESULT: - LOGP(DLOAP, LOGL_ERROR, - "Received invalid OAP message type for OAP client side: %d\n", - (int)oap_msg.message_type); - return -12; - - default: - LOGP(DLOAP, LOGL_ERROR, - "Unknown OAP message type: %d\n", - (int)oap_msg.message_type); - return -13; - } - - return 0; -} diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index b38bfe0..1488109 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -497,11 +497,11 @@ struct gsup_client * __real_gsup_client_create(const char *ip_addr, unsigned int tcp_port, gsup_client_read_cb_t read_cb, - struct oap_client_config *oap_config); + struct osmo_oap_client_config *oap_config); struct gsup_client * __wrap_gsup_client_create(const char *ip_addr, unsigned int tcp_port, gsup_client_read_cb_t read_cb, - struct oap_client_config *oap_config) + struct osmo_oap_client_config *oap_config) { struct gsup_client *gsupc; gsupc = talloc_zero(msc_vlr_tests_ctx, struct gsup_client); -- To view, visit https://gerrit.osmocom.org/10257 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ib6496c35d0ce6eb531e97129dc45a9f68e503b34 Gerrit-Change-Number: 10257 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 17:30:31 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 17:30:31 +0000 Subject: Change in osmo-hlr[master]: debian: Add sub-package for libosmo-gsup-client In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10281 ) Change subject: debian: Add sub-package for libosmo-gsup-client ...................................................................... debian: Add sub-package for libosmo-gsup-client Change-Id: Iad227bb477d64da30dd6bfbbe1bd0c0a55be9474 --- M debian/control A debian/libosmo-gsup-client-dev.install A debian/libosmo-gsup-client0.install 3 files changed, 30 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/control b/debian/control index d3a32c5..2cbcdca 100644 --- a/debian/control +++ b/debian/control @@ -32,3 +32,27 @@ Depends: osmo-hlr (= ${binary:Version}), ${misc:Depends} Description: Debug symbols for the osmo-hlr Make debugging possible + +Package: libosmo-gsup-client0 +Section: libs +Architecture: any +Multi-Arch: same +Depends: ${shlibs:Depends}, + ${misc:Depends} +Pre-Depends: ${misc:Pre-Depends} +Description: Osmocom GSUP (General Subscriber Update Protocol) client library + This is a shared library that can be used to implement client programs for + the GSUP protcol. The typical GSUP server is OsmoHLR, with OsmoMSC, OsmoSGSN + and External USSD Entities (EUSEs) using this library to implement clients. + +Package: libosmo-gsup-client-dev +Architecture: any +Multi-Arch: same +Depends: ${misc:Depends}, + libosmocore-dev +Description: Development headers of Osmocom GSUP client library + This is a shared library that can be used to implement client programs for + the GSUP protcol. The typical GSUP server is OsmoHLR, with OsmoMSC, OsmoSGSN + and External USSD Entities (EUSEs) using this library to implement clients. + . + This package contains the development headers. diff --git a/debian/libosmo-gsup-client-dev.install b/debian/libosmo-gsup-client-dev.install new file mode 100644 index 0000000..8a75973 --- /dev/null +++ b/debian/libosmo-gsup-client-dev.install @@ -0,0 +1,5 @@ +usr/include/osmocom/gsupclient +usr/lib/*/libosmo-gsup-client*.a +usr/lib/*/libosmo-gsup-client*.so +usr/lib/*/libosmo-gsup-client*.la +usr/lib/*/pkgconfig/libosmo-gsup-client.pc diff --git a/debian/libosmo-gsup-client0.install b/debian/libosmo-gsup-client0.install new file mode 100644 index 0000000..78cd89f --- /dev/null +++ b/debian/libosmo-gsup-client0.install @@ -0,0 +1 @@ +usr/lib/*/libosmo-gsup-client*.so.* -- To view, visit https://gerrit.osmocom.org/10281 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iad227bb477d64da30dd6bfbbe1bd0c0a55be9474 Gerrit-Change-Number: 10281 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 17:39:10 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 17:39:10 +0000 Subject: Change in osmo-hlr[master]: pkg-config: Fix libosmo-gsup-client pkg-config file Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10282 Change subject: pkg-config: Fix libosmo-gsup-client pkg-config file ...................................................................... pkg-config: Fix libosmo-gsup-client pkg-config file Both description and actual "Libs" line were broken. Change-Id: I92e625418d53a2f17feca87c72624b84183f8cdb --- M libosmo-gsup-client.pc.in 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/82/10282/1 diff --git a/libosmo-gsup-client.pc.in b/libosmo-gsup-client.pc.in index 4210a4a..8bbae08 100644 --- a/libosmo-gsup-client.pc.in +++ b/libosmo-gsup-client.pc.in @@ -3,9 +3,9 @@ libdir=@libdir@ includedir=@includedir@ -Name: Osmocom GSUP and OAP Client Library +Name: Osmocom GSUP Client Library Description: C Utility Library Version: @VERSION@ -Libs: -L${libdir} @TALLOC_LIBS@ -losmogsm -losmocore +Libs: -L${libdir} -losmo-gsup-client Cflags: -I${includedir}/ -- To view, visit https://gerrit.osmocom.org/10282 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I92e625418d53a2f17feca87c72624b84183f8cdb Gerrit-Change-Number: 10282 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 17:39:39 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 17:39:39 +0000 Subject: Change in osmo-hlr[master]: pkg-config: Fix libosmo-gsup-client pkg-config file In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10282 ) Change subject: pkg-config: Fix libosmo-gsup-client pkg-config file ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10282 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I92e625418d53a2f17feca87c72624b84183f8cdb Gerrit-Change-Number: 10282 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Comment-Date: Tue, 31 Jul 2018 17:39:39 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 17:42:19 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 17:42:19 +0000 Subject: Change in osmo-msc[master]: Remove local libgsupclient; Use libosmo-gsup-client from osmo-hlr Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10283 Change subject: Remove local libgsupclient; Use libosmo-gsup-client from osmo-hlr ...................................................................... Remove local libgsupclient; Use libosmo-gsup-client from osmo-hlr osmo-hlr has recently (as of Change-Id Iad227bb477d64da30dd6bfbbe1bd0c0a55be9474) a working shared library implementation of libosmo-gsup-client. We can remove the local implementation in osmo-msc and use the system-installed shared library instead. Change-Id: I6f542945403cf2e3ddac419186b09ec0e2d43b69 --- M configure.ac M include/osmocom/msc/Makefile.am D include/osmocom/msc/gsup_client.h M include/osmocom/msc/vlr.h M src/Makefile.am D src/libgsupclient/Makefile.am D src/libgsupclient/gsup_client.c D src/libgsupclient/gsup_test_client.c M src/libmsc/gsm_09_11.c M src/libvlr/vlr.c M src/osmo-msc/Makefile.am M tests/msc_vlr/Makefile.am M tests/msc_vlr/msc_vlr_tests.c M tests/sms_queue/Makefile.am 14 files changed, 35 insertions(+), 806 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/83/10283/1 diff --git a/configure.ac b/configure.ac index be66d51..03acc0c 100644 --- a/configure.ac +++ b/configure.ac @@ -44,6 +44,7 @@ PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran >= 0.9.0) PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.9.0) PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.3.0) +PKG_CHECK_MODULES(LIBOSMOGSUPCLIENT, libosmo-gsup-client >= 0.2.1) AC_ARG_ENABLE(sanitize, [AS_HELP_STRING( @@ -193,7 +194,6 @@ src/Makefile src/libmsc/Makefile src/libvlr/Makefile - src/libgsupclient/Makefile src/osmo-msc/Makefile src/utils/Makefile tests/Makefile diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am index b1a4810..ebc946a 100644 --- a/include/osmocom/msc/Makefile.am +++ b/include/osmocom/msc/Makefile.am @@ -13,7 +13,6 @@ gsm_data.h \ gsm_data_shared.h \ gsm_subscriber.h \ - gsup_client.h \ iucs.h \ iucs_ranap.h \ iu_dummy.h \ diff --git a/include/osmocom/msc/gsup_client.h b/include/osmocom/msc/gsup_client.h deleted file mode 100644 index 2f6170b..0000000 --- a/include/osmocom/msc/gsup_client.h +++ /dev/null @@ -1,67 +0,0 @@ -/* GPRS Subscriber Update Protocol client */ - -/* (C) 2014 by Sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * Author: Jacob Erlbeck - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ -#pragma once - -#include - -#include - -/* a loss of GSUP between MSC and HLR is considered quite serious, let's try to recover as quickly as - * possible. Even one new connection attempt per second should be quite acceptable until the link is - * re-established */ -#define GSUP_CLIENT_RECONNECT_INTERVAL 1 -#define GSUP_CLIENT_PING_INTERVAL 20 - -struct msgb; -struct ipa_client_conn; -struct gsup_client; - -/* Expects message in msg->l2h */ -typedef int (*gsup_client_read_cb_t)(struct gsup_client *gsupc, - struct msgb *msg); - -struct gsup_client { - const char *unit_name; - - struct ipa_client_conn *link; - gsup_client_read_cb_t read_cb; - void *data; - - struct osmo_oap_client_state oap_state; - - struct osmo_timer_list ping_timer; - struct osmo_timer_list connect_timer; - int is_connected; - int got_ipa_pong; -}; - -struct gsup_client *gsup_client_create(void *talloc_ctx, - const char *unit_name, - const char *ip_addr, - unsigned int tcp_port, - gsup_client_read_cb_t read_cb, - struct osmo_oap_client_config *oapc_config); - -void gsup_client_destroy(struct gsup_client *gsupc); -int gsup_client_send(struct gsup_client *gsupc, struct msgb *msg); -struct msgb *gsup_client_msgb_alloc(void); - diff --git a/include/osmocom/msc/vlr.h b/include/osmocom/msc/vlr.h index b54aa55..91c28db 100644 --- a/include/osmocom/msc/vlr.h +++ b/include/osmocom/msc/vlr.h @@ -12,6 +12,7 @@ #include // for GSM_NAME_LENGTH #include +#include #define LOGGSUPP(level, gsup, fmt, args...) \ LOGP(DVLR, level, "GSUP(%s) " fmt, (gsup)->imsi, ## args) @@ -243,7 +244,7 @@ struct vlr_instance { struct llist_head subscribers; struct llist_head operations; - struct gsup_client *gsup_client; + struct osmo_gsup_client *gsup_client; struct vlr_ops ops; struct osmo_timer_list lu_expire_timer; struct { diff --git a/src/Makefile.am b/src/Makefile.am index 2322ade..4e7cea1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -21,7 +21,6 @@ # Libraries SUBDIRS = \ - libgsupclient \ libvlr \ libmsc \ $(NULL) diff --git a/src/libgsupclient/Makefile.am b/src/libgsupclient/Makefile.am deleted file mode 100644 index 6381687..0000000 --- a/src/libgsupclient/Makefile.am +++ /dev/null @@ -1,38 +0,0 @@ -AM_CPPFLAGS = \ - $(all_includes) \ - -I$(top_srcdir)/include \ - -I$(top_builddir) \ - $(NULL) - -AM_CFLAGS = \ - -Wall \ - $(LIBOSMOCORE_CFLAGS) \ - $(LIBOSMOGSM_CFLAGS) \ - $(LIBOSMOVTY_CFLAGS) \ - $(LIBOSMOABIS_CFLAGS) \ - $(COVERAGE_CFLAGS) \ - $(NULL) - -noinst_LIBRARIES = \ - libgsupclient.a \ - $(NULL) - -libgsupclient_a_SOURCES = \ - gsup_client.c \ - $(NULL) - -noinst_PROGRAMS = \ - gsup_test_client \ - $(NULL) - -gsup_test_client_SOURCES = \ - gsup_test_client.c \ - $(NULL) -gsup_test_client_LDADD = \ - libgsupclient.a \ - $(LIBOSMOCORE_LIBS) \ - $(LIBOSMOGSM_LIBS) \ - $(LIBOSMOVTY_LIBS) \ - $(LIBOSMOABIS_LIBS) \ - -lrt \ - $(NULL) diff --git a/src/libgsupclient/gsup_client.c b/src/libgsupclient/gsup_client.c deleted file mode 100644 index 39dc181..0000000 --- a/src/libgsupclient/gsup_client.c +++ /dev/null @@ -1,347 +0,0 @@ -/* Generic Subscriber Update Protocol client */ - -/* (C) 2014-2016 by Sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * Author: Jacob Erlbeck - * Author: Neels Hofmeyr - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include - -#include -#include -#include -#include -#include - -#include - -#include -#include - -static void start_test_procedure(struct gsup_client *gsupc); - -static void gsup_client_send_ping(struct gsup_client *gsupc) -{ - struct msgb *msg = gsup_client_msgb_alloc(); - - msg->l2h = msgb_put(msg, 1); - msg->l2h[0] = IPAC_MSGT_PING; - ipa_msg_push_header(msg, IPAC_PROTO_IPACCESS); - ipa_client_conn_send(gsupc->link, msg); -} - -static int gsup_client_connect(struct gsup_client *gsupc) -{ - int rc; - - if (gsupc->is_connected) - return 0; - - if (osmo_timer_pending(&gsupc->connect_timer)) { - LOGP(DLGSUP, LOGL_DEBUG, - "GSUP connect: connect timer already running\n"); - osmo_timer_del(&gsupc->connect_timer); - } - - if (osmo_timer_pending(&gsupc->ping_timer)) { - LOGP(DLGSUP, LOGL_DEBUG, - "GSUP connect: ping timer already running\n"); - osmo_timer_del(&gsupc->ping_timer); - } - - if (ipa_client_conn_clear_queue(gsupc->link) > 0) - LOGP(DLGSUP, LOGL_DEBUG, "GSUP connect: discarded stored messages\n"); - - rc = ipa_client_conn_open(gsupc->link); - - if (rc >= 0) { - LOGP(DLGSUP, LOGL_NOTICE, "GSUP connecting to %s:%d\n", - gsupc->link->addr, gsupc->link->port); - return 0; - } - - LOGP(DLGSUP, LOGL_ERROR, "GSUP failed to connect to %s:%d: %s\n", - gsupc->link->addr, gsupc->link->port, strerror(-rc)); - - if (rc == -EBADF || rc == -ENOTSOCK || rc == -EAFNOSUPPORT || - rc == -EINVAL) - return rc; - - osmo_timer_schedule(&gsupc->connect_timer, - GSUP_CLIENT_RECONNECT_INTERVAL, 0); - - LOGP(DLGSUP, LOGL_INFO, "Scheduled timer to retry GSUP connect to %s:%d\n", - gsupc->link->addr, gsupc->link->port); - - return 0; -} - -static void connect_timer_cb(void *gsupc_) -{ - struct gsup_client *gsupc = gsupc_; - - if (gsupc->is_connected) - return; - - gsup_client_connect(gsupc); -} - -static void client_send(struct gsup_client *gsupc, int proto_ext, - struct msgb *msg_tx) -{ - ipa_prepend_header_ext(msg_tx, proto_ext); - ipa_msg_push_header(msg_tx, IPAC_PROTO_OSMO); - ipa_client_conn_send(gsupc->link, msg_tx); - /* msg_tx is now queued and will be freed. */ -} - -static void gsup_client_oap_register(struct gsup_client *gsupc) -{ - struct msgb *msg_tx; - int rc; - rc = osmo_oap_client_register(&gsupc->oap_state, &msg_tx); - - if ((rc < 0) || (!msg_tx)) { - LOGP(DLGSUP, LOGL_ERROR, "GSUP OAP set up, but cannot register.\n"); - return; - } - - client_send(gsupc, IPAC_PROTO_EXT_OAP, msg_tx); -} - -static void gsup_client_updown_cb(struct ipa_client_conn *link, int up) -{ - struct gsup_client *gsupc = link->data; - - LOGP(DLGSUP, LOGL_INFO, "GSUP link to %s:%d %s\n", - link->addr, link->port, up ? "UP" : "DOWN"); - - gsupc->is_connected = up; - - if (up) { - start_test_procedure(gsupc); - - if (gsupc->oap_state.state == OSMO_OAP_INITIALIZED) - gsup_client_oap_register(gsupc); - - osmo_timer_del(&gsupc->connect_timer); - } else { - osmo_timer_del(&gsupc->ping_timer); - - osmo_timer_schedule(&gsupc->connect_timer, - GSUP_CLIENT_RECONNECT_INTERVAL, 0); - } -} - -static int gsup_client_oap_handle(struct gsup_client *gsupc, struct msgb *msg_rx) -{ - int rc; - struct msgb *msg_tx; - - /* If the oap_state is disabled, this will reject the messages. */ - rc = osmo_oap_client_handle(&gsupc->oap_state, msg_rx, &msg_tx); - msgb_free(msg_rx); - if (rc < 0) - return rc; - - if (msg_tx) - client_send(gsupc, IPAC_PROTO_EXT_OAP, msg_tx); - - return 0; -} - -static int gsup_client_read_cb(struct ipa_client_conn *link, struct msgb *msg) -{ - struct ipaccess_head *hh = (struct ipaccess_head *) msg->data; - struct ipaccess_head_ext *he = (struct ipaccess_head_ext *) msgb_l2(msg); - struct gsup_client *gsupc = (struct gsup_client *)link->data; - int rc; - struct ipaccess_unit ipa_dev = { - /* see gsup_client_create() on const vs non-const */ - .unit_name = (char*)gsupc->unit_name, - }; - - OSMO_ASSERT(ipa_dev.unit_name); - - msg->l2h = &hh->data[0]; - - rc = ipaccess_bts_handle_ccm(link, &ipa_dev, msg); - - if (rc < 0) { - LOGP(DLGSUP, LOGL_NOTICE, - "GSUP received an invalid IPA/CCM message from %s:%d\n", - link->addr, link->port); - /* Link has been closed */ - gsupc->is_connected = 0; - msgb_free(msg); - return -1; - } - - if (rc == 1) { - uint8_t msg_type = *(msg->l2h); - /* CCM message */ - if (msg_type == IPAC_MSGT_PONG) { - LOGP(DLGSUP, LOGL_DEBUG, "GSUP receiving PONG\n"); - gsupc->got_ipa_pong = 1; - } - - msgb_free(msg); - return 0; - } - - if (hh->proto != IPAC_PROTO_OSMO) - goto invalid; - - if (!he || msgb_l2len(msg) < sizeof(*he)) - goto invalid; - - msg->l2h = &he->data[0]; - - if (he->proto == IPAC_PROTO_EXT_GSUP) { - OSMO_ASSERT(gsupc->read_cb != NULL); - gsupc->read_cb(gsupc, msg); - /* expecting read_cb() to free msg */ - } else if (he->proto == IPAC_PROTO_EXT_OAP) { - return gsup_client_oap_handle(gsupc, msg); - /* gsup_client_oap_handle frees msg */ - } else - goto invalid; - - return 0; - -invalid: - LOGP(DLGSUP, LOGL_NOTICE, - "GSUP received an invalid IPA message from %s:%d, size = %d\n", - link->addr, link->port, msgb_length(msg)); - - msgb_free(msg); - return -1; -} - -static void ping_timer_cb(void *gsupc_) -{ - struct gsup_client *gsupc = gsupc_; - - LOGP(DLGSUP, LOGL_INFO, "GSUP ping callback (%s, %s PONG)\n", - gsupc->is_connected ? "connected" : "not connected", - gsupc->got_ipa_pong ? "got" : "didn't get"); - - if (gsupc->got_ipa_pong) { - start_test_procedure(gsupc); - return; - } - - LOGP(DLGSUP, LOGL_NOTICE, "GSUP ping timed out, reconnecting\n"); - ipa_client_conn_close(gsupc->link); - gsupc->is_connected = 0; - - gsup_client_connect(gsupc); -} - -static void start_test_procedure(struct gsup_client *gsupc) -{ - osmo_timer_setup(&gsupc->ping_timer, ping_timer_cb, gsupc); - - gsupc->got_ipa_pong = 0; - osmo_timer_schedule(&gsupc->ping_timer, GSUP_CLIENT_PING_INTERVAL, 0); - LOGP(DLGSUP, LOGL_DEBUG, "GSUP sending PING\n"); - gsup_client_send_ping(gsupc); -} - -struct gsup_client *gsup_client_create(void *talloc_ctx, - const char *unit_name, - const char *ip_addr, - unsigned int tcp_port, - gsup_client_read_cb_t read_cb, - struct osmo_oap_client_config *oapc_config) -{ - struct gsup_client *gsupc; - int rc; - - gsupc = talloc_zero(talloc_ctx, struct gsup_client); - OSMO_ASSERT(gsupc); - - /* struct ipaccess_unit has a non-const unit_name, so let's copy to be - * able to have a non-const unit_name here as well. To not taint the - * public gsup_client API, let's store it in a const char* anyway. */ - gsupc->unit_name = talloc_strdup(gsupc, unit_name); - OSMO_ASSERT(gsupc->unit_name); - - /* a NULL oapc_config will mark oap_state disabled. */ - rc = osmo_oap_client_init(oapc_config, &gsupc->oap_state); - if (rc != 0) - goto failed; - - gsupc->link = ipa_client_conn_create(gsupc, - /* no e1inp */ NULL, - 0, - ip_addr, tcp_port, - gsup_client_updown_cb, - gsup_client_read_cb, - /* default write_cb */ NULL, - gsupc); - if (!gsupc->link) - goto failed; - - osmo_timer_setup(&gsupc->connect_timer, connect_timer_cb, gsupc); - - rc = gsup_client_connect(gsupc); - - if (rc < 0) - goto failed; - - gsupc->read_cb = read_cb; - - return gsupc; - -failed: - gsup_client_destroy(gsupc); - return NULL; -} - -void gsup_client_destroy(struct gsup_client *gsupc) -{ - osmo_timer_del(&gsupc->connect_timer); - osmo_timer_del(&gsupc->ping_timer); - - if (gsupc->link) { - ipa_client_conn_close(gsupc->link); - ipa_client_conn_destroy(gsupc->link); - gsupc->link = NULL; - } - talloc_free(gsupc); -} - -int gsup_client_send(struct gsup_client *gsupc, struct msgb *msg) -{ - if (!gsupc || !gsupc->is_connected) { - LOGP(DLGSUP, LOGL_ERROR, "GSUP not connected, unable to send %s\n", msgb_hexdump(msg)); - msgb_free(msg); - return -ENOTCONN; - } - - client_send(gsupc, IPAC_PROTO_EXT_GSUP, msg); - - return 0; -} - -struct msgb *gsup_client_msgb_alloc(void) -{ - return msgb_alloc_headroom(4000, 64, __func__); -} diff --git a/src/libgsupclient/gsup_test_client.c b/src/libgsupclient/gsup_test_client.c deleted file mode 100644 index 0ebcd4a..0000000 --- a/src/libgsupclient/gsup_test_client.c +++ /dev/null @@ -1,321 +0,0 @@ -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include - -static struct gsup_client *g_gc; - - -/*********************************************************************** - * IMSI Operation - ***********************************************************************/ -static LLIST_HEAD(g_imsi_ops); - -struct imsi_op_stats { - uint32_t num_alloc; - uint32_t num_released; - uint32_t num_rx_success; - uint32_t num_rx_error; - uint32_t num_timeout; -}; - -enum imsi_op_type { - IMSI_OP_SAI, - IMSI_OP_LU, - IMSI_OP_ISD, - _NUM_IMSI_OP -}; - -static const struct value_string imsi_op_names[] = { - { IMSI_OP_SAI, "SAI" }, - { IMSI_OP_LU, "LU" }, - { IMSI_OP_ISD, "ISD" }, - { 0, NULL } -}; - -static struct imsi_op_stats imsi_op_stats[_NUM_IMSI_OP]; - -struct imsi_op { - struct llist_head list; - char imsi[17]; - enum imsi_op_type type; - struct osmo_timer_list timer; -}; - -static struct imsi_op *imsi_op_find(const char *imsi, - enum imsi_op_type type) -{ - struct imsi_op *io; - - llist_for_each_entry(io, &g_imsi_ops, list) { - if (!strcmp(io->imsi, imsi) && io->type == type) - return io; - } - return NULL; -} - -static void imsi_op_timer_cb(void *data); - -static struct imsi_op *imsi_op_alloc(void *ctx, const char *imsi, - enum imsi_op_type type) -{ - struct imsi_op *io; - - if (imsi_op_find(imsi, type)) - return NULL; - - io = talloc_zero(ctx, struct imsi_op); - OSMO_STRLCPY_ARRAY(io->imsi, imsi); - io->type = type; - osmo_timer_setup(&io->timer, imsi_op_timer_cb, io); - llist_add(&io->list, &g_imsi_ops); - imsi_op_stats[type].num_alloc++; - - return io; -} - -static void imsi_op_release(struct imsi_op *io) -{ - osmo_timer_del(&io->timer); - llist_del(&io->list); - imsi_op_stats[io->type].num_released++; - talloc_free(io); -} - -static void imsi_op_timer_cb(void *data) -{ - struct imsi_op *io = data; - printf("%s: Timer expiration\n", io->imsi); - imsi_op_stats[io->type].num_timeout++; - imsi_op_release(io); -} - -/* allocate + generate + send Send-Auth-Info */ -static int req_auth_info(const char *imsi) -{ - struct imsi_op *io = imsi_op_alloc(g_gc, imsi, IMSI_OP_SAI); - struct osmo_gsup_message gsup = {0}; - struct msgb *msg = msgb_alloc_headroom(1200, 200, __func__); - int rc; - - OSMO_STRLCPY_ARRAY(gsup.imsi, io->imsi); - gsup.message_type = OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST; - - rc = osmo_gsup_encode(msg, &gsup); - if (rc < 0) { - printf("%s: encoding failure (%s)\n", imsi, strerror(-rc)); - return rc; - } - - return gsup_client_send(g_gc, msg); -} - -/* allocate + generate + send Send-Auth-Info */ -static int req_loc_upd(const char *imsi) -{ - struct imsi_op *io = imsi_op_alloc(g_gc, imsi, IMSI_OP_LU); - struct osmo_gsup_message gsup = {0}; - struct msgb *msg = msgb_alloc_headroom(1200, 200, __func__); - int rc; - - OSMO_STRLCPY_ARRAY(gsup.imsi, io->imsi); - gsup.message_type = OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST; - - rc = osmo_gsup_encode(msg, &gsup); - if (rc < 0) { - printf("%s: encoding failure (%s)\n", imsi, strerror(-rc)); - return rc; - } - - return gsup_client_send(g_gc, msg); -} - -static int resp_isd(struct imsi_op *io) -{ - struct osmo_gsup_message gsup = {0}; - struct msgb *msg = msgb_alloc_headroom(1200, 200, __func__); - int rc; - - OSMO_STRLCPY_ARRAY(gsup.imsi, io->imsi); - gsup.message_type = OSMO_GSUP_MSGT_INSERT_DATA_RESULT; - - rc = osmo_gsup_encode(msg, &gsup); - if (rc < 0) { - printf("%s: encoding failure (%s)\n", io->imsi, strerror(-rc)); - return rc; - } - - imsi_op_release(io); - - return gsup_client_send(g_gc, msg); -} - -/* receive an incoming GSUP message */ -static void imsi_op_rx_gsup(struct imsi_op *io, const struct osmo_gsup_message *gsup) -{ - int is_error = 0, rc; - - if (OSMO_GSUP_IS_MSGT_ERROR(gsup->message_type)) { - imsi_op_stats[io->type].num_rx_error++; - is_error = 1; - } else - imsi_op_stats[io->type].num_rx_success++; - - switch (io->type) { - case IMSI_OP_SAI: - printf("%s; SAI Response%s\n", io->imsi, is_error ? ": ERROR" : ""); - /* now that we have auth tuples, request LU */ - rc = req_loc_upd(io->imsi); - if (rc < 0) - printf("Failed to request Location Update for %s\n", io->imsi); - imsi_op_release(io); - break; - case IMSI_OP_LU: - printf("%s; LU Response%s\n", io->imsi, is_error ? ": ERROR" : ""); - imsi_op_release(io); - break; - case IMSI_OP_ISD: - printf("%s; ISD Request%s\n", io->imsi, is_error ? ": ERROR" : ""); - rc = resp_isd(io); - if (rc < 0) - printf("Failed to insert subscriber data for %s\n", io->imsi); - break; - default: - printf("%s: Unknown\n", io->imsi); - imsi_op_release(io); - break; - } -} - -static int op_type_by_gsup_msgt(enum osmo_gsup_message_type msg_type) -{ - switch (msg_type) { - case OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT: - case OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR: - return IMSI_OP_SAI; - case OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: - case OSMO_GSUP_MSGT_UPDATE_LOCATION_ERROR: - return IMSI_OP_LU; - case OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: - return IMSI_OP_ISD; - default: - printf("Unknown GSUP msg_type %u\n", msg_type); - return -1; - } -} - -static int gsupc_read_cb(struct gsup_client *gsupc, struct msgb *msg) -{ - struct osmo_gsup_message gsup_msg = {0}; - struct imsi_op *io = NULL; - int rc; - - DEBUGP(DLGSUP, "Rx GSUP %s\n", msgb_hexdump(msg)); - - rc = osmo_gsup_decode(msgb_l2(msg), msgb_l2len(msg), &gsup_msg); - if (rc < 0) - return rc; - - if (!gsup_msg.imsi[0]) - return -1; - - rc = op_type_by_gsup_msgt(gsup_msg.message_type); - if (rc < 0) - return rc; - - switch (rc) { - case IMSI_OP_SAI: - case IMSI_OP_LU: - io = imsi_op_find(gsup_msg.imsi, rc); - break; - case IMSI_OP_ISD: - /* ISD is an inbound transaction */ - io = imsi_op_alloc(g_gc, gsup_msg.imsi, IMSI_OP_ISD); - break; - } - if (!io) - return -1; - - imsi_op_rx_gsup(io, &gsup_msg); - msgb_free(msg); - - return 0; -} - -static void print_report(void) -{ - unsigned int i; - - for (i = 0; i < ARRAY_SIZE(imsi_op_stats); i++) { - struct imsi_op_stats *st = &imsi_op_stats[i]; - const char *name = get_value_string(imsi_op_names, i); - printf("%s: %u alloc, %u released, %u success, %u error , %u tout\n", - name, st->num_alloc, st->num_released, st->num_rx_success, - st->num_rx_error, st->num_timeout); - } -} - -static void sig_cb(int sig) -{ - switch (sig) { - case SIGINT: - print_report(); - exit(0); - break; - } -} - -/* default categories */ -static struct log_info_cat default_categories[] = { -}; - -static const struct log_info gsup_test_client_log_info = { - .cat = default_categories, - .num_cat = ARRAY_SIZE(default_categories), -}; - -int main(int argc, char **argv) -{ - unsigned long long i; - char *server_host = "127.0.0.1"; - uint16_t server_port = OSMO_GSUP_PORT; - void *ctx = talloc_named_const(NULL, 0, "gsup_test_client"); - - osmo_init_logging2(ctx, &gsup_test_client_log_info); - - g_gc = gsup_client_create(ctx, "GSUPTEST", server_host, server_port, - gsupc_read_cb, NULL); - - - signal(SIGINT, sig_cb); - - for (i = 0; i < 10000; i++) { - unsigned long long imsi = 901790000000000 + i; - char imsi_buf[17] = { 0 }; - int rc; - - snprintf(imsi_buf, sizeof(imsi_buf), "%015llu", imsi); - rc = req_auth_info(imsi_buf); - if (rc < 0) - printf("Failed to request Auth Info for %s\n", imsi_buf); - - osmo_select_main(0); - } - - while (1) { - osmo_select_main(0); - } - - print_report(); - exit(0); -} diff --git a/src/libmsc/gsm_09_11.c b/src/libmsc/gsm_09_11.c index 9b0a9e4..342fd2b 100644 --- a/src/libmsc/gsm_09_11.c +++ b/src/libmsc/gsm_09_11.c @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include /* FIXME: choose a proper range */ @@ -165,7 +165,7 @@ OSMO_STRLCPY_ARRAY(gsup_msg.imsi, conn->vsub->imsi); /* Allocate GSUP message buffer */ - gsup_msgb = gsup_client_msgb_alloc(); + gsup_msgb = osmo_gsup_client_msgb_alloc(); if (!gsup_msgb) { LOGP(DMM, LOGL_ERROR, "Couldn't allocate GSUP message\n"); rc = -ENOMEM; @@ -180,7 +180,7 @@ } /* Finally send */ - rc = gsup_client_send(conn->network->vlr->gsup_client, gsup_msgb); + rc = osmo_gsup_client_send(conn->network->vlr->gsup_client, gsup_msgb); if (rc) { LOGP(DMM, LOGL_ERROR, "Couldn't send GSUP message\n"); goto error; diff --git a/src/libvlr/vlr.c b/src/libvlr/vlr.c index 2f7dc30..bfaf333 100644 --- a/src/libvlr/vlr.c +++ b/src/libvlr/vlr.c @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include @@ -156,7 +156,7 @@ static int vlr_tx_gsup_message(const struct vlr_instance *vlr, const struct osmo_gsup_message *gsup_msg) { - struct msgb *msg = gsup_client_msgb_alloc(); + struct msgb *msg = osmo_gsup_client_msgb_alloc(); int rc = osmo_gsup_encode(msg, gsup_msg); if (rc < 0) { @@ -174,7 +174,7 @@ LOGP(DVLR, LOGL_DEBUG, "GSUP tx: %s\n", osmo_hexdump_nospc(msg->data, msg->len)); - return gsup_client_send(vlr->gsup_client, msg); + return osmo_gsup_client_send(vlr->gsup_client, msg); } /* Transmit GSUP message for subscriber to HLR, using IMSI from subscriber */ @@ -974,7 +974,7 @@ /* Incoming handler for GSUP from HLR. * Keep this function non-static for direct invocation by unit tests. */ -int vlr_gsupc_read_cb(struct gsup_client *gsupc, struct msgb *msg) +int vlr_gsupc_read_cb(struct osmo_gsup_client *gsupc, struct msgb *msg) { struct vlr_instance *vlr = (struct vlr_instance *) gsupc->data; struct vlr_subscr *vsub; @@ -1214,10 +1214,10 @@ { OSMO_ASSERT(vlr); - vlr->gsup_client = gsup_client_create(vlr, gsup_unit_name, - gsup_server_addr_str, - gsup_server_port, - &vlr_gsupc_read_cb, NULL); + vlr->gsup_client = osmo_gsup_client_create(vlr, gsup_unit_name, + gsup_server_addr_str, + gsup_server_port, + &vlr_gsupc_read_cb, NULL); if (!vlr->gsup_client) return -ENOMEM; vlr->gsup_client->data = vlr; diff --git a/src/osmo-msc/Makefile.am b/src/osmo-msc/Makefile.am index 42bc69f..bcc4ada 100644 --- a/src/osmo-msc/Makefile.am +++ b/src/osmo-msc/Makefile.am @@ -17,6 +17,7 @@ $(LIBASN1C_CFLAGS) \ $(LIBOSMOSIGTRAN_CFLAGS) \ $(LIBOSMOMGCPCLIENT_CFLAGS) \ + $(LIBOSMOGSUPCLIENT_CFLAGS) \ $(NULL) AM_LDFLAGS = \ @@ -34,7 +35,6 @@ osmo_msc_LDADD = \ $(top_builddir)/src/libmsc/libmsc.a \ $(top_builddir)/src/libvlr/libvlr.a \ - $(top_builddir)/src/libgsupclient/libgsupclient.a \ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOVTY_LIBS) \ $(LIBOSMOCORE_LIBS) \ @@ -43,6 +43,7 @@ $(LIBSMPP34_LIBS) \ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBOSMOMGCPCLIENT_LIBS) \ + $(LIBOSMOGSUPCLIENT_LIBS) \ -ldbi \ $(NULL) if BUILD_IU diff --git a/tests/msc_vlr/Makefile.am b/tests/msc_vlr/Makefile.am index 8b29f79..e6b20e6 100644 --- a/tests/msc_vlr/Makefile.am +++ b/tests/msc_vlr/Makefile.am @@ -15,11 +15,12 @@ $(LIBOSMORANAP_CFLAGS) \ $(LIBASN1C_CFLAGS) \ $(LIBOSMOMGCPCLIENT_CFLAGS) \ + $(LIBOSMOGSUPCLIENT_CFLAGS) \ $(NULL) AM_LDFLAGS = \ - -Wl,--wrap=gsup_client_create \ - -Wl,--wrap=gsup_client_send \ + -Wl,--wrap=osmo_gsup_client_create \ + -Wl,--wrap=osmo_gsup_client_send \ -Wl,--wrap=a_iface_tx_dtap \ -Wl,--wrap=a_iface_tx_clear_cmd \ -Wl,--wrap=a_iface_tx_paging \ @@ -39,7 +40,6 @@ LDADD = \ $(top_builddir)/src/libmsc/libmsc.a \ $(top_builddir)/src/libvlr/libvlr.a \ - $(top_builddir)/src/libgsupclient/libgsupclient.a \ $(LIBSMPP34_LIBS) \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ @@ -48,6 +48,7 @@ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBOSMORANAP_LIBS) \ $(LIBOSMOMGCPCLIENT_LIBS) \ + $(LIBOSMOGSUPCLIENT_LIBS) \ $(LIBRARY_GSM) \ -ldbi \ -lrt \ diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index 1488109..f8551dd 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include #include @@ -138,7 +138,7 @@ dtap_tx_confirmed = false; } -int vlr_gsupc_read_cb(struct gsup_client *gsupc, struct msgb *msg); +int vlr_gsupc_read_cb(struct osmo_gsup_client *gsupc, struct msgb *msg); void gsup_rx(const char *rx_hex, const char *expect_tx_hex) { @@ -494,24 +494,24 @@ } /* override, requires '-Wl,--wrap=gsup_client_create' */ -struct gsup_client * -__real_gsup_client_create(const char *ip_addr, unsigned int tcp_port, - gsup_client_read_cb_t read_cb, +struct osmo_gsup_client * +__real_osmo_gsup_client_create(const char *ip_addr, unsigned int tcp_port, + osmo_gsup_client_read_cb_t read_cb, struct osmo_oap_client_config *oap_config); -struct gsup_client * -__wrap_gsup_client_create(const char *ip_addr, unsigned int tcp_port, - gsup_client_read_cb_t read_cb, +struct osmo_gsup_client * +__wrap_osmo_gsup_client_create(const char *ip_addr, unsigned int tcp_port, + osmo_gsup_client_read_cb_t read_cb, struct osmo_oap_client_config *oap_config) { - struct gsup_client *gsupc; - gsupc = talloc_zero(msc_vlr_tests_ctx, struct gsup_client); + struct osmo_gsup_client *gsupc; + gsupc = talloc_zero(msc_vlr_tests_ctx, struct osmo_gsup_client); OSMO_ASSERT(gsupc); return gsupc; } /* override, requires '-Wl,--wrap=gsup_client_send' */ -int __real_gsup_client_send(struct gsup_client *gsupc, struct msgb *msg); -int __wrap_gsup_client_send(struct gsup_client *gsupc, struct msgb *msg) +int __real_osmo_gsup_client_send(struct osmo_gsup_client *gsupc, struct msgb *msg); +int __wrap_osmo_gsup_client_send(struct osmo_gsup_client *gsupc, struct msgb *msg) { const char *is = osmo_hexdump_nospc(msg->data, msg->len); fprintf(stderr, "GSUP --> HLR: %s: %s\n", @@ -831,7 +831,7 @@ /* Expecting these to stick around in msc_vlr_tests_ctx: * talloc_total_blocks(tall_bsc_ctx) == 12 * full talloc report on 'msc_vlr_tests_ctx' (total 3636 bytes in 12 blocks) - * struct gsup_client contains 248 bytes in 1 blocks (ref 0) 0x563a489c05f0 + * struct osmo_gsup_client contains 248 bytes in 1 blocks (ref 0) 0x563a489c05f0 * struct gsm_network contains 2031 bytes in 4 blocks (ref 0) 0x563a489bfbb0 * struct vlr_instance contains 168 bytes in 1 blocks (ref 0) 0x563a489c04e0 * no_gsup_server contains 15 bytes in 1 blocks (ref 0) 0x563a489c0460 diff --git a/tests/sms_queue/Makefile.am b/tests/sms_queue/Makefile.am index 61b8515..1ffbe1c 100644 --- a/tests/sms_queue/Makefile.am +++ b/tests/sms_queue/Makefile.am @@ -14,6 +14,7 @@ $(LIBOSMORANAP_CFLAGS) \ $(LIBASN1C_CFLAGS) \ $(LIBOSMOMGCPCLIENT_CFLAGS) \ + $(LIBOSMOGSUPCLIENT_CFLAGS) \ $(NULL) EXTRA_DIST = \ @@ -32,7 +33,6 @@ sms_queue_test_LDADD = \ $(top_builddir)/src/libmsc/libmsc.a \ $(top_builddir)/src/libvlr/libvlr.a \ - $(top_builddir)/src/libgsupclient/libgsupclient.a \ $(LIBSMPP34_LIBS) \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ @@ -41,6 +41,7 @@ $(LIBOSMOSIGTRAN_LIBS) \ $(LIBOSMORANAP_LIBS) \ $(LIBOSMOMGCPCLIENT_LIBS) \ + $(LIBOSMOGSUPCLIENT_LIBS) \ $(LIBRARY_GSM) \ -ldbi \ -lrt \ -- To view, visit https://gerrit.osmocom.org/10283 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I6f542945403cf2e3ddac419186b09ec0e2d43b69 Gerrit-Change-Number: 10283 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 17:59:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 17:59:29 +0000 Subject: Change in osmo-msc[master]: Remove local libgsupclient; Use libosmo-gsup-client from osmo-hlr In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10283 to look at the new patch set (#2). Change subject: Remove local libgsupclient; Use libosmo-gsup-client from osmo-hlr ...................................................................... Remove local libgsupclient; Use libosmo-gsup-client from osmo-hlr osmo-hlr has recently (as of Change-Id Iad227bb477d64da30dd6bfbbe1bd0c0a55be9474) a working shared library implementation of libosmo-gsup-client. We can remove the local implementation in osmo-msc and use the system-installed shared library instead. Change-Id: I6f542945403cf2e3ddac419186b09ec0e2d43b69 --- M configure.ac M contrib/jenkins.sh M include/osmocom/msc/Makefile.am D include/osmocom/msc/gsup_client.h M include/osmocom/msc/vlr.h M src/Makefile.am D src/libgsupclient/Makefile.am D src/libgsupclient/gsup_client.c D src/libgsupclient/gsup_test_client.c M src/libmsc/gsm_09_11.c M src/libvlr/vlr.c M src/osmo-msc/Makefile.am M tests/msc_vlr/Makefile.am M tests/msc_vlr/msc_vlr_tests.c M tests/sms_queue/Makefile.am 15 files changed, 36 insertions(+), 806 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/83/10283/2 -- To view, visit https://gerrit.osmocom.org/10283 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6f542945403cf2e3ddac419186b09ec0e2d43b69 Gerrit-Change-Number: 10283 Gerrit-PatchSet: 2 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 18:02:07 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 18:02:07 +0000 Subject: Change in osmo-hlr[master]: pkg-config: Fix libosmo-gsup-client pkg-config file In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10282 ) Change subject: pkg-config: Fix libosmo-gsup-client pkg-config file ...................................................................... pkg-config: Fix libosmo-gsup-client pkg-config file Both description and actual "Libs" line were broken. Change-Id: I92e625418d53a2f17feca87c72624b84183f8cdb --- M libosmo-gsup-client.pc.in 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/libosmo-gsup-client.pc.in b/libosmo-gsup-client.pc.in index 4210a4a..8bbae08 100644 --- a/libosmo-gsup-client.pc.in +++ b/libosmo-gsup-client.pc.in @@ -3,9 +3,9 @@ libdir=@libdir@ includedir=@includedir@ -Name: Osmocom GSUP and OAP Client Library +Name: Osmocom GSUP Client Library Description: C Utility Library Version: @VERSION@ -Libs: -L${libdir} @TALLOC_LIBS@ -losmogsm -losmocore +Libs: -L${libdir} -losmo-gsup-client Cflags: -I${includedir}/ -- To view, visit https://gerrit.osmocom.org/10282 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I92e625418d53a2f17feca87c72624b84183f8cdb Gerrit-Change-Number: 10282 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 18:02:34 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 18:02:34 +0000 Subject: Change in osmo-msc[master]: Remove local libgsupclient; Use libosmo-gsup-client from osmo-hlr In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/10283 to look at the new patch set (#3). Change subject: Remove local libgsupclient; Use libosmo-gsup-client from osmo-hlr ...................................................................... Remove local libgsupclient; Use libosmo-gsup-client from osmo-hlr osmo-hlr has recently (as of Change-Id Iad227bb477d64da30dd6bfbbe1bd0c0a55be9474) a working shared library implementation of libosmo-gsup-client. We can remove the local implementation in osmo-msc and use the system-installed shared library instead. Change-Id: I6f542945403cf2e3ddac419186b09ec0e2d43b69 --- M configure.ac M contrib/jenkins.sh M debian/control M include/osmocom/msc/Makefile.am D include/osmocom/msc/gsup_client.h M include/osmocom/msc/vlr.h M src/Makefile.am D src/libgsupclient/Makefile.am D src/libgsupclient/gsup_client.c D src/libgsupclient/gsup_test_client.c M src/libmsc/gsm_09_11.c M src/libvlr/vlr.c M src/osmo-msc/Makefile.am M tests/msc_vlr/Makefile.am M tests/msc_vlr/msc_vlr_tests.c M tests/sms_queue/Makefile.am 16 files changed, 37 insertions(+), 806 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/83/10283/3 -- To view, visit https://gerrit.osmocom.org/10283 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6f542945403cf2e3ddac419186b09ec0e2d43b69 Gerrit-Change-Number: 10283 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 18:04:03 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 18:04:03 +0000 Subject: Change in osmo-sgsn[master]: Remove local libgsupclient; Use libosmo-gsup-client from osmo-hlr Message-ID: Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/10284 Change subject: Remove local libgsupclient; Use libosmo-gsup-client from osmo-hlr ...................................................................... Remove local libgsupclient; Use libosmo-gsup-client from osmo-hlr osmo-hlr has recently (as of Change-Id Iad227bb477d64da30dd6bfbbe1bd0c0a55be9474) a working shared library implementation of libosmo-gsup-client. We can remove the local implementation in osmo-sgsn and use the system-installed shared library instead. Change-Id: I6f542945403cf2e3ddac419186b09ec0e2d43b69 --- M configure.ac M contrib/jenkins.sh M debian/control M include/osmocom/sgsn/Makefile.am D include/osmocom/sgsn/gsup_client.h M include/osmocom/sgsn/sgsn.h M src/gprs/Makefile.am M src/gprs/gprs_subscriber.c D src/gprs/gsup_client.c M src/gprs/sgsn_vty.c M tests/sgsn/Makefile.am M tests/sgsn/sgsn_test.c 12 files changed, 33 insertions(+), 446 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/84/10284/1 diff --git a/configure.ac b/configure.ac index c233fa3..fe75749 100644 --- a/configure.ac +++ b/configure.ac @@ -46,6 +46,7 @@ PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.5.0) PKG_CHECK_MODULES(LIBOSMOGB, libosmogb >= 0.11.0) PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.2.0) +PKG_CHECK_MODULES(LIBOSMOGSUPCLIENT, libosmo-gsup-client >= 0.2.1) # Enable/disable 3G aka IuPS + IuCS support? AC_ARG_ENABLE([iu], [AS_HELP_STRING([--enable-iu], [Build 3G support, aka IuPS and IuCS interfaces])], diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index d873ee9..64663d6 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -28,6 +28,7 @@ osmo-build-dep.sh libosmo-abis osmo-build-dep.sh libosmo-netif osmo-build-dep.sh osmo-ggsn +osmo-build-dep.sh osmo-hlr enable_werror="" if [ "x$IU" = "x--enable-iu" ]; then diff --git a/debian/control b/debian/control index 330945f..6b70d05 100644 --- a/debian/control +++ b/debian/control @@ -16,7 +16,8 @@ libosmo-abis-dev, libosmo-ranap-dev, libosmo-sccp-dev, - libosmo-netif-dev + libosmo-netif-dev, + libosmo-gsup-client-dev Standards-Version: 3.9.8 Vcs-Git: git://git.osmocom.org/osmo-sgsn.git Vcs-Browser: https://git.osmocom.org/osmo-sgsn diff --git a/include/osmocom/sgsn/Makefile.am b/include/osmocom/sgsn/Makefile.am index 269cebc..12a5115 100644 --- a/include/osmocom/sgsn/Makefile.am +++ b/include/osmocom/sgsn/Makefile.am @@ -15,7 +15,6 @@ gprs_sndcp_xid.h \ gprs_subscriber.h \ gprs_utils.h \ - gsup_client.h \ gtphub.h \ sgsn.h \ signal.h \ diff --git a/include/osmocom/sgsn/gsup_client.h b/include/osmocom/sgsn/gsup_client.h deleted file mode 100644 index 6ba0d15..0000000 --- a/include/osmocom/sgsn/gsup_client.h +++ /dev/null @@ -1,63 +0,0 @@ -/* GPRS Subscriber Update Protocol client */ - -/* (C) 2014 by Sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * Author: Jacob Erlbeck - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ -#pragma once - -#include - -#include - -#define GSUP_CLIENT_RECONNECT_INTERVAL 10 -#define GSUP_CLIENT_PING_INTERVAL 20 - -struct msgb; -struct ipa_client_conn; -struct gsup_client; - -/* Expects message in msg->l2h */ -typedef int (*gsup_client_read_cb_t)(struct gsup_client *gsupc, - struct msgb *msg); - -struct gsup_client { - const char *unit_name; - - struct ipa_client_conn *link; - gsup_client_read_cb_t read_cb; - void *data; - - struct osmo_oap_client_state oap_state; - - struct osmo_timer_list ping_timer; - struct osmo_timer_list connect_timer; - int is_connected; - int got_ipa_pong; -}; - -struct gsup_client *gsup_client_create(const char *unit_name, - const char *ip_addr, - unsigned int tcp_port, - gsup_client_read_cb_t read_cb, - struct osmo_oap_client_config *oapc_config); - -void gsup_client_destroy(struct gsup_client *gsupc); -int gsup_client_send(struct gsup_client *gsupc, struct msgb *msg); -struct msgb *gsup_client_msgb_alloc(void); - diff --git a/include/osmocom/sgsn/sgsn.h b/include/osmocom/sgsn/sgsn.h index 59d0bd7..3a34ff9 100644 --- a/include/osmocom/sgsn/sgsn.h +++ b/include/osmocom/sgsn/sgsn.h @@ -7,6 +7,7 @@ #include #include #include +#include #include #include "../../bscconfig.h" @@ -18,7 +19,6 @@ #include #include -struct gprs_gsup_client; struct hostent; enum sgsn_auth_policy { @@ -138,7 +138,7 @@ /* GSN instance for libgtp */ struct gsn_t *gsn; /* Subscriber */ - struct gsup_client *gsup_client; + struct osmo_gsup_client *gsup_client; /* LLME inactivity timer */ struct osmo_timer_list llme_timer; diff --git a/src/gprs/Makefile.am b/src/gprs/Makefile.am index 46d94d4..2dbe23d 100644 --- a/src/gprs/Makefile.am +++ b/src/gprs/Makefile.am @@ -13,6 +13,7 @@ $(LIBOSMOCTRL_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ $(LIBOSMOGB_CFLAGS) \ + $(LIBOSMOGSUPCLIENT_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(LIBCARES_CFLAGS) \ $(LIBGTP_CFLAGS) \ @@ -83,11 +84,11 @@ slhc.c \ gprs_llc_xid.c \ v42bis.c \ - gsup_client.c \ $(NULL) osmo_sgsn_LDADD = \ $(OSMO_LIBS) \ $(LIBOSMOABIS_LIBS) \ + $(LIBOSMOGSUPCLIENT_LIBS) \ $(LIBCARES_LIBS) \ $(LIBGTP_LIBS) \ -lrt \ diff --git a/src/gprs/gprs_subscriber.c b/src/gprs/gprs_subscriber.c index dfd697b..40d8812 100644 --- a/src/gprs/gprs_subscriber.c +++ b/src/gprs/gprs_subscriber.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include @@ -52,7 +52,7 @@ LLIST_HEAD(_gprs_subscribers); struct llist_head * const gprs_subscribers = &_gprs_subscribers; -static int gsup_read_cb(struct gsup_client *gsupc, struct msgb *msg); +static int gsup_read_cb(struct osmo_gsup_client *gsupc, struct msgb *msg); /* TODO: Some functions are specific to the SGSN, but this file is more general * (it has gprs_* name). Either move these functions elsewhere, split them and @@ -69,7 +69,8 @@ addr_str = inet_ntoa(sgi->cfg.gsup_server_addr.sin_addr); - sgi->gsup_client = gsup_client_create( + sgi->gsup_client = osmo_gsup_client_create( + sgi, "SGSN", addr_str, sgi->cfg.gsup_server_port, &gsup_read_cb, @@ -81,7 +82,7 @@ return 1; } -static int gsup_read_cb(struct gsup_client *gsupc, struct msgb *msg) +static int gsup_read_cb(struct osmo_gsup_client *gsupc, struct msgb *msg) { int rc; @@ -194,7 +195,7 @@ static int gprs_subscr_tx_gsup_message(struct gprs_subscr *subscr, struct osmo_gsup_message *gsup_msg) { - struct msgb *msg = gsup_client_msgb_alloc(); + struct msgb *msg = osmo_gsup_client_msgb_alloc(); if (strlen(gsup_msg->imsi) == 0 && subscr) osmo_strlcpy(gsup_msg->imsi, subscr->imsi, @@ -210,7 +211,7 @@ return -ENOTSUP; } - return gsup_client_send(sgsn->gsup_client, msg); + return osmo_gsup_client_send(sgsn->gsup_client, msg); } static int gprs_subscr_tx_gsup_error_reply(struct gprs_subscr *subscr, diff --git a/src/gprs/gsup_client.c b/src/gprs/gsup_client.c deleted file mode 100644 index 95c4988..0000000 --- a/src/gprs/gsup_client.c +++ /dev/null @@ -1,355 +0,0 @@ -/* Generic Subscriber Update Protocol client */ - -/* (C) 2014-2016 by Sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * Author: Jacob Erlbeck - * Author: Neels Hofmeyr - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include - -#include -#include -#include -#include - -#include - -#include -#include - -extern void *tall_bsc_ctx; - -static void start_test_procedure(struct gsup_client *gsupc); - -static void gsup_client_send_ping(struct gsup_client *gsupc) -{ - struct msgb *msg = gsup_client_msgb_alloc(); - - msg->l2h = msgb_put(msg, 1); - msg->l2h[0] = IPAC_MSGT_PING; - ipa_msg_push_header(msg, IPAC_PROTO_IPACCESS); - ipa_client_conn_send(gsupc->link, msg); -} - -static int gsup_client_connect(struct gsup_client *gsupc) -{ - int rc; - - if (gsupc->is_connected) - return 0; - - if (osmo_timer_pending(&gsupc->connect_timer)) { - LOGP(DLGSUP, LOGL_DEBUG, - "GSUP connect: connect timer already running\n"); - osmo_timer_del(&gsupc->connect_timer); - } - - if (osmo_timer_pending(&gsupc->ping_timer)) { - LOGP(DLGSUP, LOGL_DEBUG, - "GSUP connect: ping timer already running\n"); - osmo_timer_del(&gsupc->ping_timer); - } - - if (ipa_client_conn_clear_queue(gsupc->link) > 0) - LOGP(DLGSUP, LOGL_DEBUG, "GSUP connect: discarded stored messages\n"); - - rc = ipa_client_conn_open(gsupc->link); - - if (rc >= 0) { - LOGP(DLGSUP, LOGL_NOTICE, "GSUP connecting to %s:%d\n", - gsupc->link->addr, gsupc->link->port); - return 0; - } - - LOGP(DLGSUP, LOGL_ERROR, "GSUP failed to connect to %s:%d: %s\n", - gsupc->link->addr, gsupc->link->port, strerror(-rc)); - - if (rc == -EBADF || rc == -ENOTSOCK || rc == -EAFNOSUPPORT || - rc == -EINVAL) - return rc; - - osmo_timer_schedule(&gsupc->connect_timer, - GSUP_CLIENT_RECONNECT_INTERVAL, 0); - - LOGP(DLGSUP, LOGL_INFO, "Scheduled timer to retry GSUP connect to %s:%d\n", - gsupc->link->addr, gsupc->link->port); - - return 0; -} - -static void connect_timer_cb(void *gsupc_) -{ - struct gsup_client *gsupc = gsupc_; - - if (gsupc->is_connected) - return; - - gsup_client_connect(gsupc); -} - -static void client_send(struct gsup_client *gsupc, int proto_ext, - struct msgb *msg_tx) -{ - ipa_prepend_header_ext(msg_tx, proto_ext); - ipa_msg_push_header(msg_tx, IPAC_PROTO_OSMO); - ipa_client_conn_send(gsupc->link, msg_tx); - /* msg_tx is now queued and will be freed. */ -} - -static void gsup_client_oap_register(struct gsup_client *gsupc) -{ - struct msgb *msg_tx; - int rc; - rc = osmo_oap_client_register(&gsupc->oap_state, &msg_tx); - - if ((rc < 0) || (!msg_tx)) { - LOGP(DLGSUP, LOGL_ERROR, "GSUP OAP set up, but cannot register.\n"); - return; - } - - client_send(gsupc, IPAC_PROTO_EXT_OAP, msg_tx); -} - -static void gsup_client_updown_cb(struct ipa_client_conn *link, int up) -{ - struct gsup_client *gsupc = link->data; - - LOGP(DLGSUP, LOGL_INFO, "GSUP link to %s:%d %s\n", - link->addr, link->port, up ? "UP" : "DOWN"); - - gsupc->is_connected = up; - - if (up) { - start_test_procedure(gsupc); - - if (gsupc->oap_state.state == OSMO_OAP_INITIALIZED) - gsup_client_oap_register(gsupc); - - osmo_timer_del(&gsupc->connect_timer); - } else { - osmo_timer_del(&gsupc->ping_timer); - - osmo_timer_schedule(&gsupc->connect_timer, - GSUP_CLIENT_RECONNECT_INTERVAL, 0); - } -} - -static int gsup_client_oap_handle(struct gsup_client *gsupc, struct msgb *msg_rx) -{ - int rc; - struct msgb *msg_tx; - - /* If the oap_state is disabled, this will reject the messages. */ - rc = osmo_oap_client_handle(&gsupc->oap_state, msg_rx, &msg_tx); - msgb_free(msg_rx); - if (rc < 0) - return rc; - - if (msg_tx) - client_send(gsupc, IPAC_PROTO_EXT_OAP, msg_tx); - - return 0; -} - -static int gsup_client_read_cb(struct ipa_client_conn *link, struct msgb *msg) -{ - struct ipaccess_head *hh = (struct ipaccess_head *) msg->data; - struct ipaccess_head_ext *he = (struct ipaccess_head_ext *) msgb_l2(msg); - struct gsup_client *gsupc = (struct gsup_client *)link->data; - int rc; - struct ipaccess_unit ipa_dev = { - /* see gsup_client_create() on const vs non-const */ - .unit_name = (char*)gsupc->unit_name, - }; - - OSMO_ASSERT(ipa_dev.unit_name); - - msg->l2h = &hh->data[0]; - - rc = ipaccess_bts_handle_ccm(link, &ipa_dev, msg); - - if (rc < 0) { - LOGP(DLGSUP, LOGL_NOTICE, - "GSUP received an invalid IPA/CCM message from %s:%d\n", - link->addr, link->port); - /* Link has been closed */ - gsupc->is_connected = 0; - msgb_free(msg); - return -1; - } - - if (rc == 1) { - uint8_t msg_type = *(msg->l2h); - /* CCM message */ - if (msg_type == IPAC_MSGT_PONG) { - LOGP(DLGSUP, LOGL_DEBUG, "GSUP receiving PONG\n"); - gsupc->got_ipa_pong = 1; - } - - msgb_free(msg); - return 0; - } - - if (hh->proto != IPAC_PROTO_OSMO) - goto invalid; - - if (!he || msgb_l2len(msg) < sizeof(*he)) - goto invalid; - - msg->l2h = &he->data[0]; - - if (he->proto == IPAC_PROTO_EXT_GSUP) { - OSMO_ASSERT(gsupc->read_cb != NULL); - gsupc->read_cb(gsupc, msg); - /* expecting read_cb() to free msg */ - } else if (he->proto == IPAC_PROTO_EXT_OAP) { - return gsup_client_oap_handle(gsupc, msg); - /* gsup_client_oap_handle frees msg */ - } else - goto invalid; - - return 0; - -invalid: - LOGP(DLGSUP, LOGL_NOTICE, - "GSUP received an invalid IPA message from %s:%d, size = %d\n", - link->addr, link->port, msgb_length(msg)); - - msgb_free(msg); - return -1; -} - -static void ping_timer_cb(void *gsupc_) -{ - struct gsup_client *gsupc = gsupc_; - - LOGP(DLGSUP, LOGL_INFO, "GSUP ping callback (%s, %s PONG)\n", - gsupc->is_connected ? "connected" : "not connected", - gsupc->got_ipa_pong ? "got" : "didn't get"); - - if (gsupc->got_ipa_pong) { - start_test_procedure(gsupc); - return; - } - - LOGP(DLGSUP, LOGL_NOTICE, "GSUP ping timed out, reconnecting\n"); - ipa_client_conn_close(gsupc->link); - gsupc->is_connected = 0; - - gsup_client_connect(gsupc); -} - -static void start_test_procedure(struct gsup_client *gsupc) -{ - osmo_timer_setup(&gsupc->ping_timer, ping_timer_cb, gsupc); - - gsupc->got_ipa_pong = 0; - osmo_timer_schedule(&gsupc->ping_timer, GSUP_CLIENT_PING_INTERVAL, 0); - LOGP(DLGSUP, LOGL_DEBUG, "GSUP sending PING\n"); - gsup_client_send_ping(gsupc); -} - -struct gsup_client *gsup_client_create(const char *unit_name, - const char *ip_addr, - unsigned int tcp_port, - gsup_client_read_cb_t read_cb, - struct osmo_oap_client_config *oapc_config) -{ - struct gsup_client *gsupc; - int rc; - - gsupc = talloc_zero(tall_bsc_ctx, struct gsup_client); - OSMO_ASSERT(gsupc); - - /* struct ipaccess_unit has a non-const unit_name, so let's copy to be - * able to have a non-const unit_name here as well. To not taint the - * public gsup_client API, let's store it in a const char* anyway. */ - gsupc->unit_name = talloc_strdup(gsupc, unit_name); - OSMO_ASSERT(gsupc->unit_name); - - /* a NULL oapc_config will mark oap_state disabled. */ - rc = osmo_oap_client_init(oapc_config, &gsupc->oap_state); - if (rc != 0) - goto failed; - - gsupc->link = ipa_client_conn_create(gsupc, - /* no e1inp */ NULL, - 0, - ip_addr, tcp_port, - gsup_client_updown_cb, - gsup_client_read_cb, - /* default write_cb */ NULL, - gsupc); - if (!gsupc->link) - goto failed; - - osmo_timer_setup(&gsupc->connect_timer, connect_timer_cb, gsupc); - - rc = gsup_client_connect(gsupc); - - if (rc < 0) - goto failed; - - gsupc->read_cb = read_cb; - - return gsupc; - -failed: - gsup_client_destroy(gsupc); - return NULL; -} - -void gsup_client_destroy(struct gsup_client *gsupc) -{ - osmo_timer_del(&gsupc->connect_timer); - osmo_timer_del(&gsupc->ping_timer); - - if (gsupc->link) { - ipa_client_conn_close(gsupc->link); - ipa_client_conn_destroy(gsupc->link); - gsupc->link = NULL; - } - talloc_free(gsupc); -} - -int gsup_client_send(struct gsup_client *gsupc, struct msgb *msg) -{ - if (!gsupc) { - LOGP(DGPRS, LOGL_NOTICE, "No GSUP client, unable to " - "send %s\n", msgb_hexdump(msg)); - msgb_free(msg); - return -ENOTCONN; - } - - if (!gsupc->is_connected) { - LOGP(DGPRS, LOGL_NOTICE, "GSUP not connected, unable to " - "send %s\n", msgb_hexdump(msg)); - msgb_free(msg); - return -EAGAIN; - } - - client_send(gsupc, IPAC_PROTO_EXT_GSUP, msg); - - return 0; -} - -struct msgb *gsup_client_msgb_alloc(void) -{ - return msgb_alloc_headroom(4000, 64, __func__); -} diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c index 8092158..8fb2b0f 100644 --- a/src/gprs/sgsn_vty.c +++ b/src/gprs/sgsn_vty.c @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include diff --git a/tests/sgsn/Makefile.am b/tests/sgsn/Makefile.am index abcc357..237709b 100644 --- a/tests/sgsn/Makefile.am +++ b/tests/sgsn/Makefile.am @@ -9,6 +9,7 @@ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ $(LIBOSMOGSM_CFLAGS) \ + $(LIBOSMOGSUPCLIENT_CFLAGS) \ $(LIBCARES_CFLAGS) \ $(LIBGTP_CFLAGS) \ $(NULL) @@ -37,7 +38,7 @@ -Wl,--wrap=sgsn_update_subscriber_data \ -Wl,--wrap=gprs_subscr_request_update_location \ -Wl,--wrap=gprs_subscr_request_auth_info \ - -Wl,--wrap=gsup_client_send \ + -Wl,--wrap=osmo_gsup_client_send \ $(NULL) sgsn_test_LDADD = \ @@ -61,11 +62,11 @@ $(top_builddir)/src/gprs/gprs_sndcp_pcomp.o \ $(top_builddir)/src/gprs/v42bis.o \ $(top_builddir)/src/gprs/gprs_sndcp_dcomp.o \ - $(top_builddir)/src/gprs/gsup_client.o \ $(LIBOSMOABIS_LIBS) \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOGB_LIBS) \ + $(LIBOSMOGSUPCLIENT_LIBS) \ $(LIBCARES_LIBS) \ $(LIBGTP_LIBS) \ -lrt \ diff --git a/tests/sgsn/sgsn_test.c b/tests/sgsn/sgsn_test.c index 0e5267b..7d9cbfb 100644 --- a/tests/sgsn/sgsn_test.c +++ b/tests/sgsn/sgsn_test.c @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include @@ -148,13 +148,13 @@ }; /* override, requires '-Wl,--wrap=gsup_client_send' */ -int __real_gsup_client_send(struct gsup_client *gsupc, struct msgb *msg); -int (*gsup_client_send_cb)(struct gsup_client *gsupc, struct msgb *msg) = - &__real_gsup_client_send; +int __real_osmo_gsup_client_send(struct osmo_gsup_client *gsupc, struct msgb *msg); +int (*osmo_gsup_client_send_cb)(struct osmo_gsup_client *gsupc, struct msgb *msg) = + &__real_osmo_gsup_client_send; -int __wrap_gsup_client_send(struct gsup_client *gsupc, struct msgb *msg) +int __wrap_osmo_gsup_client_send(struct osmo_gsup_client *gsupc, struct msgb *msg) { - return (*gsup_client_send_cb)(gsupc, msg); + return (*osmo_gsup_client_send_cb)(gsupc, msg); }; static int count(struct llist_head *head) @@ -729,7 +729,7 @@ cleanup_test(); } -int my_gsup_client_send_dummy(struct gsup_client *gsupc, struct msgb *msg) +int my_gsup_client_send_dummy(struct osmo_gsup_client *gsupc, struct msgb *msg) { msgb_free(msg); return 0; @@ -1302,7 +1302,7 @@ cleanup_test(); } -int my_gsup_client_send(struct gsup_client *gsupc, struct msgb *msg) +int my_gsup_client_send(struct osmo_gsup_client *gsupc, struct msgb *msg) { struct osmo_gsup_message to_peer = {0}; struct osmo_gsup_message from_peer = {0}; @@ -1344,7 +1344,7 @@ return 0; } - reply_msg = gsup_client_msgb_alloc(); + reply_msg = osmo_gsup_client_msgb_alloc(); reply_msg->l2h = reply_msg->data; osmo_gsup_encode(reply_msg, &from_peer); gprs_subscr_rx_gsup_message(reply_msg); @@ -1359,9 +1359,9 @@ struct gprs_subscr *subscr; sgsn_inst.cfg.auth_policy = SGSN_AUTH_POLICY_REMOTE; - gsup_client_send_cb = my_gsup_client_send; + osmo_gsup_client_send_cb = my_gsup_client_send; - sgsn->gsup_client = talloc_zero(tall_bsc_ctx, struct gsup_client); + sgsn->gsup_client = talloc_zero(tall_bsc_ctx, struct osmo_gsup_client); if (retry) { upd_loc_skip = 3; @@ -1376,7 +1376,7 @@ assert_no_subscrs(); sgsn->cfg.auth_policy = saved_auth_policy; - gsup_client_send_cb = __real_gsup_client_send; + osmo_gsup_client_send_cb = __real_osmo_gsup_client_send; upd_loc_skip = 0; auth_info_skip = 0; talloc_free(sgsn->gsup_client); @@ -2260,7 +2260,7 @@ printf("Testing GGSN selection\n"); - gsup_client_send_cb = my_gsup_client_send_dummy; + osmo_gsup_client_send_cb = my_gsup_client_send_dummy; /* Check for emptiness */ OSMO_ASSERT(gprs_subscr_get_by_imsi(imsi1) == NULL); @@ -2379,7 +2379,7 @@ sgsn_ggsn_ctx_free(ggcs[1]); sgsn_ggsn_ctx_free(ggcs[2]); - gsup_client_send_cb = __real_gsup_client_send; + osmo_gsup_client_send_cb = __real_osmo_gsup_client_send; cleanup_test(); } -- To view, visit https://gerrit.osmocom.org/10284 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I6f542945403cf2e3ddac419186b09ec0e2d43b69 Gerrit-Change-Number: 10284 Gerrit-PatchSet: 1 Gerrit-Owner: Harald Welte -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 18:13:25 2018 From: gerrit-no-reply at lists.osmocom.org (roox) Date: Tue, 31 Jul 2018 18:13:25 +0000 Subject: Change in osmo-hlr[master]: debian: Fix typo in package description Message-ID: roox has uploaded this change for review. ( https://gerrit.osmocom.org/10285 Change subject: debian: Fix typo in package description ...................................................................... debian: Fix typo in package description Change-Id: Iaa5a3b9e249ce493221569cf9411cc04c4044a0c --- M debian/control 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/85/10285/1 diff --git a/debian/control b/debian/control index 2cbcdca..222cd96 100644 --- a/debian/control +++ b/debian/control @@ -42,7 +42,7 @@ Pre-Depends: ${misc:Pre-Depends} Description: Osmocom GSUP (General Subscriber Update Protocol) client library This is a shared library that can be used to implement client programs for - the GSUP protcol. The typical GSUP server is OsmoHLR, with OsmoMSC, OsmoSGSN + the GSUP protocol. The typical GSUP server is OsmoHLR, with OsmoMSC, OsmoSGSN and External USSD Entities (EUSEs) using this library to implement clients. Package: libosmo-gsup-client-dev @@ -52,7 +52,7 @@ libosmocore-dev Description: Development headers of Osmocom GSUP client library This is a shared library that can be used to implement client programs for - the GSUP protcol. The typical GSUP server is OsmoHLR, with OsmoMSC, OsmoSGSN + the GSUP protocol. The typical GSUP server is OsmoHLR, with OsmoMSC, OsmoSGSN and External USSD Entities (EUSEs) using this library to implement clients. . This package contains the development headers. -- To view, visit https://gerrit.osmocom.org/10285 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Iaa5a3b9e249ce493221569cf9411cc04c4044a0c Gerrit-Change-Number: 10285 Gerrit-PatchSet: 1 Gerrit-Owner: roox -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 18:30:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 18:30:11 +0000 Subject: Change in osmo-hlr[master]: debian: Fix typo in package description In-Reply-To: References: Message-ID: Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/10285 ) Change subject: debian: Fix typo in package description ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/10285 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Iaa5a3b9e249ce493221569cf9411cc04c4044a0c Gerrit-Change-Number: 10285 Gerrit-PatchSet: 1 Gerrit-Owner: roox Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Tue, 31 Jul 2018 18:30:11 +0000 Gerrit-HasComments: No Gerrit-HasLabels: Yes -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Tue Jul 31 18:30:12 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 31 Jul 2018 18:30:12 +0000 Subject: Change in osmo-hlr[master]: debian: Fix typo in package description In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10285 ) Change subject: debian: Fix typo in package description ...................................................................... debian: Fix typo in package description Change-Id: Iaa5a3b9e249ce493221569cf9411cc04c4044a0c --- M debian/control 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/debian/control b/debian/control index 2cbcdca..222cd96 100644 --- a/debian/control +++ b/debian/control @@ -42,7 +42,7 @@ Pre-Depends: ${misc:Pre-Depends} Description: Osmocom GSUP (General Subscriber Update Protocol) client library This is a shared library that can be used to implement client programs for - the GSUP protcol. The typical GSUP server is OsmoHLR, with OsmoMSC, OsmoSGSN + the GSUP protocol. The typical GSUP server is OsmoHLR, with OsmoMSC, OsmoSGSN and External USSD Entities (EUSEs) using this library to implement clients. Package: libosmo-gsup-client-dev @@ -52,7 +52,7 @@ libosmocore-dev Description: Development headers of Osmocom GSUP client library This is a shared library that can be used to implement client programs for - the GSUP protcol. The typical GSUP server is OsmoHLR, with OsmoMSC, OsmoSGSN + the GSUP protocol. The typical GSUP server is OsmoHLR, with OsmoMSC, OsmoSGSN and External USSD Entities (EUSEs) using this library to implement clients. . This package contains the development headers. -- To view, visit https://gerrit.osmocom.org/10285 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iaa5a3b9e249ce493221569cf9411cc04c4044a0c Gerrit-Change-Number: 10285 Gerrit-PatchSet: 1 Gerrit-Owner: roox Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From admin at opensuse.org Tue Jul 31 20:01:05 2018 From: admin at opensuse.org (OBS Notification) Date: Tue, 31 Jul 2018 20:01:05 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <5b60c0175e428_2b0d7fa684963ca@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 93s] ^ [ 93s] handover_fsm.c:489:4: error: format not a string literal and no format arguments [-Werror=format-security] [ 93s] cc1: some warnings being treated as errors [ 93s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 93s] make[4]: *** [handover_fsm.o] Error 1 [ 93s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 93s] Makefile:407: recipe for target 'all-recursive' failed [ 93s] make[3]: *** [all-recursive] Error 1 [ 93s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 93s] Makefile:441: recipe for target 'all-recursive' failed [ 93s] make[2]: *** [all-recursive] Error 1 [ 93s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 93s] Makefile:373: recipe for target 'all' failed [ 93s] make[1]: *** [all] Error 2 [ 93s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 93s] dh_auto_build: make -j1 returned exit code 2 [ 93s] debian/rules:45: recipe for target 'build' failed [ 93s] make: *** [build] Error 2 [ 93s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 93s] [ 93s] lamb21 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:00:54 UTC 2018. [ 93s] [ 93s] ### VM INTERACTION START ### [ 97s] [ 86.804852] sysrq: SysRq : Power Off [ 97s] [ 86.812559] reboot: Power down [ 97s] ### VM INTERACTION END ### [ 97s] [ 97s] lamb21 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:00:58 UTC 2018. [ 97s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jul 31 20:01:05 2018 From: admin at opensuse.org (OBS Notification) Date: Tue, 31 Jul 2018 20:01:05 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <5b60c017a1f26_2b0d7fa68496413@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 93s] ^ [ 93s] handover_fsm.c:489:4: error: format not a string literal and no format arguments [-Werror=format-security] [ 93s] cc1: some warnings being treated as errors [ 93s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 93s] make[4]: *** [handover_fsm.o] Error 1 [ 93s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 93s] Makefile:407: recipe for target 'all-recursive' failed [ 93s] make[3]: *** [all-recursive] Error 1 [ 93s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 93s] Makefile:441: recipe for target 'all-recursive' failed [ 93s] make[2]: *** [all-recursive] Error 1 [ 93s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 93s] Makefile:373: recipe for target 'all' failed [ 93s] make[1]: *** [all] Error 2 [ 93s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 93s] dh_auto_build: make -j1 returned exit code 2 [ 93s] debian/rules:45: recipe for target 'build' failed [ 93s] make: *** [build] Error 2 [ 93s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 93s] [ 93s] lamb21 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:00:54 UTC 2018. [ 93s] [ 93s] ### VM INTERACTION START ### [ 97s] [ 86.804852] sysrq: SysRq : Power Off [ 97s] [ 86.812559] reboot: Power down [ 97s] ### VM INTERACTION END ### [ 97s] [ 97s] lamb21 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:00:58 UTC 2018. [ 97s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jul 31 20:01:22 2018 From: admin at opensuse.org (OBS Notification) Date: Tue, 31 Jul 2018 20:01:22 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <5b60c019284af_2b0d7fa684966b@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_9.0/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 90s] gsm0808_cell_id_name(&req->cell_id_target)); [ 90s] ^~~~~~~~~~~~~~~~~~~~ [ 91s] cc1: some warnings being treated as errors [ 91s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 91s] make[4]: *** [handover_fsm.o] Error 1 [ 91s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 91s] Makefile:407: recipe for target 'all-recursive' failed [ 91s] make[3]: *** [all-recursive] Error 1 [ 91s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 91s] Makefile:441: recipe for target 'all-recursive' failed [ 91s] make[2]: *** [all-recursive] Error 1 [ 91s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 91s] Makefile:373: recipe for target 'all' failed [ 91s] make[1]: *** [all] Error 2 [ 91s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 91s] dh_auto_build: make -j1 returned exit code 2 [ 91s] debian/rules:45: recipe for target 'build' failed [ 91s] make: *** [build] Error 2 [ 91s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 91s] [ 91s] lamb51 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:01:06 UTC 2018. [ 91s] [ 91s] ### VM INTERACTION START ### [ 94s] [ 82.306298] sysrq: SysRq : Power Off [ 94s] [ 82.312748] reboot: Power down [ 94s] ### VM INTERACTION END ### [ 94s] [ 94s] lamb51 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:01:10 UTC 2018. [ 94s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jul 31 20:01:22 2018 From: admin at opensuse.org (OBS Notification) Date: Tue, 31 Jul 2018 20:01:22 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <5b60c018d6dc8_2b0d7fa68496590@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_9.0/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 90s] gsm0808_cell_id_name(&req->cell_id_target)); [ 90s] ^~~~~~~~~~~~~~~~~~~~ [ 91s] cc1: some warnings being treated as errors [ 91s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 91s] make[4]: *** [handover_fsm.o] Error 1 [ 91s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 91s] Makefile:407: recipe for target 'all-recursive' failed [ 91s] make[3]: *** [all-recursive] Error 1 [ 91s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 91s] Makefile:441: recipe for target 'all-recursive' failed [ 91s] make[2]: *** [all-recursive] Error 1 [ 91s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 91s] Makefile:373: recipe for target 'all' failed [ 91s] make[1]: *** [all] Error 2 [ 91s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 91s] dh_auto_build: make -j1 returned exit code 2 [ 91s] debian/rules:45: recipe for target 'build' failed [ 91s] make: *** [build] Error 2 [ 91s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 91s] [ 91s] lamb51 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:01:06 UTC 2018. [ 91s] [ 91s] ### VM INTERACTION START ### [ 94s] [ 82.306298] sysrq: SysRq : Power Off [ 94s] [ 82.312748] reboot: Power down [ 94s] ### VM INTERACTION END ### [ 94s] [ 94s] lamb51 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:01:10 UTC 2018. [ 94s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jul 31 20:01:39 2018 From: admin at opensuse.org (OBS Notification) Date: Tue, 31 Jul 2018 20:01:39 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_9.0/i586 In-Reply-To: References: Message-ID: <5b60c038f32a7_2b0d7fa684967c8@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_9.0/i586 Package network:osmocom:nightly/osmo-bsc failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 95s] gsm0808_cell_id_name(&req->cell_id_target)); [ 95s] ^~~~~~~~~~~~~~~~~~~~ [ 96s] cc1: some warnings being treated as errors [ 96s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 96s] make[4]: *** [handover_fsm.o] Error 1 [ 96s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 96s] Makefile:407: recipe for target 'all-recursive' failed [ 96s] make[3]: *** [all-recursive] Error 1 [ 96s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 96s] Makefile:441: recipe for target 'all-recursive' failed [ 96s] make[2]: *** [all-recursive] Error 1 [ 96s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 96s] Makefile:373: recipe for target 'all' failed [ 96s] make[1]: *** [all] Error 2 [ 96s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 96s] dh_auto_build: make -j1 returned exit code 2 [ 96s] debian/rules:45: recipe for target 'build' failed [ 96s] make: *** [build] Error 2 [ 96s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 96s] [ 97s] lamb25 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:01:18 UTC 2018. [ 97s] [ 97s] ### VM INTERACTION START ### [ 100s] [ 88.156398] sysrq: SysRq : Power Off [ 100s] [ 88.166441] reboot: Power down [ 100s] ### VM INTERACTION END ### [ 100s] [ 100s] lamb25 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:01:22 UTC 2018. [ 100s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jul 31 20:01:39 2018 From: admin at opensuse.org (OBS Notification) Date: Tue, 31 Jul 2018 20:01:39 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_9.0/i586 In-Reply-To: References: Message-ID: <5b60c0393f722_2b0d7fa68496825@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_9.0/i586 Package network:osmocom:nightly/osmo-bsc failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 95s] gsm0808_cell_id_name(&req->cell_id_target)); [ 95s] ^~~~~~~~~~~~~~~~~~~~ [ 96s] cc1: some warnings being treated as errors [ 96s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 96s] make[4]: *** [handover_fsm.o] Error 1 [ 96s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 96s] Makefile:407: recipe for target 'all-recursive' failed [ 96s] make[3]: *** [all-recursive] Error 1 [ 96s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 96s] Makefile:441: recipe for target 'all-recursive' failed [ 96s] make[2]: *** [all-recursive] Error 1 [ 96s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 96s] Makefile:373: recipe for target 'all' failed [ 96s] make[1]: *** [all] Error 2 [ 96s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 96s] dh_auto_build: make -j1 returned exit code 2 [ 96s] debian/rules:45: recipe for target 'build' failed [ 96s] make: *** [build] Error 2 [ 96s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 96s] [ 97s] lamb25 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:01:18 UTC 2018. [ 97s] [ 97s] ### VM INTERACTION START ### [ 100s] [ 88.156398] sysrq: SysRq : Power Off [ 100s] [ 88.166441] reboot: Power down [ 100s] ### VM INTERACTION END ### [ 100s] [ 100s] lamb25 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:01:22 UTC 2018. [ 100s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jul 31 20:01:39 2018 From: admin at opensuse.org (OBS Notification) Date: Tue, 31 Jul 2018 20:01:39 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_17.10/x86_64 In-Reply-To: References: Message-ID: <5b60c039aee01_2b0d7fa684969c6@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_17.10/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_17.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 94s] gsm0808_cell_id_name(&req->cell_id_target)); [ 94s] ^~~~~~~~~~~~~~~~~~~~ [ 95s] cc1: some warnings being treated as errors [ 95s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 95s] make[4]: *** [handover_fsm.o] Error 1 [ 95s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 95s] Makefile:407: recipe for target 'all-recursive' failed [ 95s] make[3]: *** [all-recursive] Error 1 [ 95s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 95s] Makefile:441: recipe for target 'all-recursive' failed [ 95s] make[2]: *** [all-recursive] Error 1 [ 95s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 95s] Makefile:373: recipe for target 'all' failed [ 95s] make[1]: *** [all] Error 2 [ 95s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 95s] dh_auto_build: make -j1 returned exit code 2 [ 95s] debian/rules:45: recipe for target 'build' failed [ 95s] make: *** [build] Error 2 [ 95s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 95s] [ 95s] lamb60 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:01:19 UTC 2018. [ 95s] [ 95s] ### VM INTERACTION START ### [ 98s] [ 87.412914] sysrq: SysRq : Power Off [ 98s] [ 87.421041] reboot: Power down [ 98s] ### VM INTERACTION END ### [ 98s] [ 98s] lamb60 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:01:23 UTC 2018. [ 98s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jul 31 20:01:39 2018 From: admin at opensuse.org (OBS Notification) Date: Tue, 31 Jul 2018 20:01:39 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_17.10/x86_64 In-Reply-To: References: Message-ID: <5b60c03a1334_2b0d7fa684970d8@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_17.10/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_17.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 94s] gsm0808_cell_id_name(&req->cell_id_target)); [ 94s] ^~~~~~~~~~~~~~~~~~~~ [ 95s] cc1: some warnings being treated as errors [ 95s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 95s] make[4]: *** [handover_fsm.o] Error 1 [ 95s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 95s] Makefile:407: recipe for target 'all-recursive' failed [ 95s] make[3]: *** [all-recursive] Error 1 [ 95s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 95s] Makefile:441: recipe for target 'all-recursive' failed [ 95s] make[2]: *** [all-recursive] Error 1 [ 95s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 95s] Makefile:373: recipe for target 'all' failed [ 95s] make[1]: *** [all] Error 2 [ 95s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 95s] dh_auto_build: make -j1 returned exit code 2 [ 95s] debian/rules:45: recipe for target 'build' failed [ 95s] make: *** [build] Error 2 [ 95s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 95s] [ 95s] lamb60 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:01:19 UTC 2018. [ 95s] [ 95s] ### VM INTERACTION START ### [ 98s] [ 87.412914] sysrq: SysRq : Power Off [ 98s] [ 87.421041] reboot: Power down [ 98s] ### VM INTERACTION END ### [ 98s] [ 98s] lamb60 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:01:23 UTC 2018. [ 98s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jul 31 20:01:39 2018 From: admin at opensuse.org (OBS Notification) Date: Tue, 31 Jul 2018 20:01:39 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_17.10/i586 In-Reply-To: References: Message-ID: <5b60c03a47308_2b0d7fa68497124@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_17.10/i586 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_17.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 97s] gsm0808_cell_id_name(&req->cell_id_target)); [ 97s] ^~~~~~~~~~~~~~~~~~~~ [ 98s] cc1: some warnings being treated as errors [ 98s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 98s] make[4]: *** [handover_fsm.o] Error 1 [ 98s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 98s] Makefile:407: recipe for target 'all-recursive' failed [ 98s] make[3]: *** [all-recursive] Error 1 [ 98s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 98s] Makefile:441: recipe for target 'all-recursive' failed [ 98s] make[2]: *** [all-recursive] Error 1 [ 98s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 98s] Makefile:373: recipe for target 'all' failed [ 98s] make[1]: *** [all] Error 2 [ 98s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 98s] dh_auto_build: make -j1 returned exit code 2 [ 98s] debian/rules:45: recipe for target 'build' failed [ 98s] make: *** [build] Error 2 [ 98s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 98s] [ 98s] lamb59 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:01:26 UTC 2018. [ 98s] [ 98s] ### VM INTERACTION START ### [ 101s] [ 91.923760] sysrq: SysRq : Power Off [ 101s] [ 91.931979] reboot: Power down [ 101s] ### VM INTERACTION END ### [ 101s] [ 101s] lamb59 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:01:29 UTC 2018. [ 101s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jul 31 20:01:39 2018 From: admin at opensuse.org (OBS Notification) Date: Tue, 31 Jul 2018 20:01:39 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_17.10/i586 In-Reply-To: References: Message-ID: <5b60c03a8ec10_2b0d7fa6849720@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_17.10/i586 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_17.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 97s] gsm0808_cell_id_name(&req->cell_id_target)); [ 97s] ^~~~~~~~~~~~~~~~~~~~ [ 98s] cc1: some warnings being treated as errors [ 98s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 98s] make[4]: *** [handover_fsm.o] Error 1 [ 98s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 98s] Makefile:407: recipe for target 'all-recursive' failed [ 98s] make[3]: *** [all-recursive] Error 1 [ 98s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 98s] Makefile:441: recipe for target 'all-recursive' failed [ 98s] make[2]: *** [all-recursive] Error 1 [ 98s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 98s] Makefile:373: recipe for target 'all' failed [ 98s] make[1]: *** [all] Error 2 [ 98s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 98s] dh_auto_build: make -j1 returned exit code 2 [ 98s] debian/rules:45: recipe for target 'build' failed [ 98s] make: *** [build] Error 2 [ 98s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 98s] [ 98s] lamb59 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:01:26 UTC 2018. [ 98s] [ 98s] ### VM INTERACTION START ### [ 101s] [ 91.923760] sysrq: SysRq : Power Off [ 101s] [ 91.931979] reboot: Power down [ 101s] ### VM INTERACTION END ### [ 101s] [ 101s] lamb59 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:01:29 UTC 2018. [ 101s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jul 31 20:02:50 2018 From: admin at opensuse.org (OBS Notification) Date: Tue, 31 Jul 2018 20:02:50 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <5b60c074f2201_2b0d7fa6849757c@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_16.04/i586 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 118s] ^ [ 118s] handover_fsm.c:489:4: error: format not a string literal and no format arguments [-Werror=format-security] [ 119s] cc1: some warnings being treated as errors [ 119s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 119s] make[4]: *** [handover_fsm.o] Error 1 [ 119s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 119s] Makefile:407: recipe for target 'all-recursive' failed [ 119s] make[3]: *** [all-recursive] Error 1 [ 119s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 119s] Makefile:441: recipe for target 'all-recursive' failed [ 119s] make[2]: *** [all-recursive] Error 1 [ 119s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 119s] Makefile:373: recipe for target 'all' failed [ 119s] make[1]: *** [all] Error 2 [ 119s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 119s] dh_auto_build: make -j1 returned exit code 2 [ 119s] debian/rules:45: recipe for target 'build' failed [ 119s] make: *** [build] Error 2 [ 119s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 119s] [ 119s] cloud126 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:02:36 UTC 2018. [ 119s] [ 119s] ### VM INTERACTION START ### [ 122s] [ 102.944218] sysrq: SysRq : Power Off [ 122s] [ 102.947725] reboot: Power down [ 123s] ### VM INTERACTION END ### [ 123s] [ 123s] cloud126 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:02:41 UTC 2018. [ 123s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jul 31 20:02:50 2018 From: admin at opensuse.org (OBS Notification) Date: Tue, 31 Jul 2018 20:02:50 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <5b60c0756452f_2b0d7fa6849769@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_16.04/i586 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 118s] ^ [ 118s] handover_fsm.c:489:4: error: format not a string literal and no format arguments [-Werror=format-security] [ 119s] cc1: some warnings being treated as errors [ 119s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 119s] make[4]: *** [handover_fsm.o] Error 1 [ 119s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 119s] Makefile:407: recipe for target 'all-recursive' failed [ 119s] make[3]: *** [all-recursive] Error 1 [ 119s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 119s] Makefile:441: recipe for target 'all-recursive' failed [ 119s] make[2]: *** [all-recursive] Error 1 [ 119s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 119s] Makefile:373: recipe for target 'all' failed [ 119s] make[1]: *** [all] Error 2 [ 119s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 119s] dh_auto_build: make -j1 returned exit code 2 [ 119s] debian/rules:45: recipe for target 'build' failed [ 119s] make: *** [build] Error 2 [ 119s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 119s] [ 119s] cloud126 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:02:36 UTC 2018. [ 119s] [ 119s] ### VM INTERACTION START ### [ 122s] [ 102.944218] sysrq: SysRq : Power Off [ 122s] [ 102.947725] reboot: Power down [ 123s] ### VM INTERACTION END ### [ 123s] [ 123s] cloud126 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:02:41 UTC 2018. [ 123s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jul 31 20:03:41 2018 From: admin at opensuse.org (OBS Notification) Date: Tue, 31 Jul 2018 20:03:41 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_18.04/i586 In-Reply-To: References: Message-ID: <5b60c0b0d87b0_2b0d7fa68497757@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_18.04/i586 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_18.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 117s] gsm0808_cell_id_name(&req->cell_id_target)); [ 117s] ^~~~~~~~~~~~~~~~~~~~ [ 118s] cc1: some warnings being treated as errors [ 118s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 118s] make[4]: *** [handover_fsm.o] Error 1 [ 118s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 118s] Makefile:407: recipe for target 'all-recursive' failed [ 118s] make[3]: *** [all-recursive] Error 1 [ 118s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 118s] Makefile:441: recipe for target 'all-recursive' failed [ 118s] make[2]: *** [all-recursive] Error 1 [ 118s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 118s] Makefile:373: recipe for target 'all' failed [ 118s] make[1]: *** [all] Error 2 [ 118s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 118s] dh_auto_build: make -j1 returned exit code 2 [ 118s] debian/rules:45: recipe for target 'build' failed [ 118s] make: *** [build] Error 2 [ 118s] dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2 [ 118s] [ 118s] lamb58 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:03:34 UTC 2018. [ 118s] [ 118s] ### VM INTERACTION START ### [ 121s] [ 111.161069] sysrq: SysRq : Power Off [ 121s] [ 111.167387] reboot: Power down [ 121s] ### VM INTERACTION END ### [ 121s] [ 121s] lamb58 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:03:38 UTC 2018. [ 121s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jul 31 20:03:41 2018 From: admin at opensuse.org (OBS Notification) Date: Tue, 31 Jul 2018 20:03:41 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_18.04/i586 In-Reply-To: References: Message-ID: <5b60c0b13e810_2b0d7fa6849784a@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_18.04/i586 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_18.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 117s] gsm0808_cell_id_name(&req->cell_id_target)); [ 117s] ^~~~~~~~~~~~~~~~~~~~ [ 118s] cc1: some warnings being treated as errors [ 118s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 118s] make[4]: *** [handover_fsm.o] Error 1 [ 118s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 118s] Makefile:407: recipe for target 'all-recursive' failed [ 118s] make[3]: *** [all-recursive] Error 1 [ 118s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 118s] Makefile:441: recipe for target 'all-recursive' failed [ 118s] make[2]: *** [all-recursive] Error 1 [ 118s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 118s] Makefile:373: recipe for target 'all' failed [ 118s] make[1]: *** [all] Error 2 [ 118s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 118s] dh_auto_build: make -j1 returned exit code 2 [ 118s] debian/rules:45: recipe for target 'build' failed [ 118s] make: *** [build] Error 2 [ 118s] dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2 [ 118s] [ 118s] lamb58 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:03:34 UTC 2018. [ 118s] [ 118s] ### VM INTERACTION START ### [ 121s] [ 111.161069] sysrq: SysRq : Power Off [ 121s] [ 111.167387] reboot: Power down [ 121s] ### VM INTERACTION END ### [ 121s] [ 121s] lamb58 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:03:38 UTC 2018. [ 121s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jul 31 20:04:15 2018 From: admin at opensuse.org (OBS Notification) Date: Tue, 31 Jul 2018 20:04:15 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_8.0/i586 In-Reply-To: References: Message-ID: <5b60c0cc4d42d_2b0d7fa68497913@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_8.0/i586 Package network:osmocom:nightly/osmo-bsc failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 93s] ^ [ 93s] handover_fsm.c:489:4: error: format not a string literal and no format arguments [-Werror=format-security] [ 93s] cc1: some warnings being treated as errors [ 93s] Makefile:614: recipe for target 'handover_fsm.o' failed [ 93s] make[4]: *** [handover_fsm.o] Error 1 [ 93s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 93s] Makefile:395: recipe for target 'all-recursive' failed [ 93s] make[3]: *** [all-recursive] Error 1 [ 93s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 94s] Makefile:429: recipe for target 'all-recursive' failed [ 94s] make[2]: *** [all-recursive] Error 1 [ 94s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 94s] Makefile:360: recipe for target 'all' failed [ 94s] make[1]: *** [all] Error 2 [ 94s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 94s] dh_auto_build: make -j1 returned exit code 2 [ 94s] debian/rules:45: recipe for target 'build' failed [ 94s] make: *** [build] Error 2 [ 94s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 94s] [ 94s] lamb60 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:03:58 UTC 2018. [ 94s] [ 94s] ### VM INTERACTION START ### [ 95s] Powering off. [ 95s] [ 84.156219] reboot: Power down [ 95s] ### VM INTERACTION END ### [ 95s] [ 95s] lamb60 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:04:00 UTC 2018. [ 95s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jul 31 20:04:15 2018 From: admin at opensuse.org (OBS Notification) Date: Tue, 31 Jul 2018 20:04:15 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_8.0/i586 In-Reply-To: References: Message-ID: <5b60c0cc8ddd2_2b0d7fa68498090@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_8.0/i586 Package network:osmocom:nightly/osmo-bsc failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 93s] ^ [ 93s] handover_fsm.c:489:4: error: format not a string literal and no format arguments [-Werror=format-security] [ 93s] cc1: some warnings being treated as errors [ 93s] Makefile:614: recipe for target 'handover_fsm.o' failed [ 93s] make[4]: *** [handover_fsm.o] Error 1 [ 93s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 93s] Makefile:395: recipe for target 'all-recursive' failed [ 93s] make[3]: *** [all-recursive] Error 1 [ 93s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 94s] Makefile:429: recipe for target 'all-recursive' failed [ 94s] make[2]: *** [all-recursive] Error 1 [ 94s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 94s] Makefile:360: recipe for target 'all' failed [ 94s] make[1]: *** [all] Error 2 [ 94s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 94s] dh_auto_build: make -j1 returned exit code 2 [ 94s] debian/rules:45: recipe for target 'build' failed [ 94s] make: *** [build] Error 2 [ 94s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 94s] [ 94s] lamb60 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:03:58 UTC 2018. [ 94s] [ 94s] ### VM INTERACTION START ### [ 95s] Powering off. [ 95s] [ 84.156219] reboot: Power down [ 95s] ### VM INTERACTION END ### [ 95s] [ 95s] lamb60 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:04:00 UTC 2018. [ 95s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jul 31 20:04:15 2018 From: admin at opensuse.org (OBS Notification) Date: Tue, 31 Jul 2018 20:04:15 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_18.04/x86_64 In-Reply-To: References: Message-ID: <5b60c0ccdf877_2b0d7fa6849812a@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_18.04/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_18.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 114s] gsm0808_cell_id_name(&req->cell_id_target)); [ 114s] ^~~~~~~~~~~~~~~~~~~~ [ 115s] cc1: some warnings being treated as errors [ 115s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 115s] make[4]: *** [handover_fsm.o] Error 1 [ 115s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 115s] Makefile:407: recipe for target 'all-recursive' failed [ 115s] make[3]: *** [all-recursive] Error 1 [ 115s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 115s] Makefile:441: recipe for target 'all-recursive' failed [ 115s] make[2]: *** [all-recursive] Error 1 [ 115s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 115s] Makefile:373: recipe for target 'all' failed [ 115s] make[1]: *** [all] Error 2 [ 115s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 115s] dh_auto_build: make -j1 returned exit code 2 [ 115s] debian/rules:45: recipe for target 'build' failed [ 115s] make: *** [build] Error 2 [ 115s] dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2 [ 115s] [ 115s] lamb59 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:04:07 UTC 2018. [ 115s] [ 115s] ### VM INTERACTION START ### [ 118s] [ 107.271171] sysrq: SysRq : Power Off [ 118s] [ 107.278389] reboot: Power down [ 118s] ### VM INTERACTION END ### [ 118s] [ 118s] lamb59 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:04:11 UTC 2018. [ 118s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jul 31 20:04:15 2018 From: admin at opensuse.org (OBS Notification) Date: Tue, 31 Jul 2018 20:04:15 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in xUbuntu_18.04/x86_64 In-Reply-To: References: Message-ID: <5b60c0cd34456_2b0d7fa684982d3@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/xUbuntu_18.04/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in xUbuntu_18.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 114s] gsm0808_cell_id_name(&req->cell_id_target)); [ 114s] ^~~~~~~~~~~~~~~~~~~~ [ 115s] cc1: some warnings being treated as errors [ 115s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 115s] make[4]: *** [handover_fsm.o] Error 1 [ 115s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 115s] Makefile:407: recipe for target 'all-recursive' failed [ 115s] make[3]: *** [all-recursive] Error 1 [ 115s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 115s] Makefile:441: recipe for target 'all-recursive' failed [ 115s] make[2]: *** [all-recursive] Error 1 [ 115s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 115s] Makefile:373: recipe for target 'all' failed [ 115s] make[1]: *** [all] Error 2 [ 115s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 115s] dh_auto_build: make -j1 returned exit code 2 [ 115s] debian/rules:45: recipe for target 'build' failed [ 115s] make: *** [build] Error 2 [ 115s] dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2 [ 115s] [ 115s] lamb59 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:04:07 UTC 2018. [ 115s] [ 115s] ### VM INTERACTION START ### [ 118s] [ 107.271171] sysrq: SysRq : Power Off [ 118s] [ 107.278389] reboot: Power down [ 118s] ### VM INTERACTION END ### [ 118s] [ 118s] lamb59 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:04:11 UTC 2018. [ 118s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jul 31 20:04:32 2018 From: admin at opensuse.org (OBS Notification) Date: Tue, 31 Jul 2018 20:04:32 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <5b60c0ecbace4_2b0d7fa68498330@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_8.0/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 88s] ^ [ 88s] handover_fsm.c:489:4: error: format not a string literal and no format arguments [-Werror=format-security] [ 89s] cc1: some warnings being treated as errors [ 89s] Makefile:614: recipe for target 'handover_fsm.o' failed [ 89s] make[4]: *** [handover_fsm.o] Error 1 [ 89s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 89s] Makefile:395: recipe for target 'all-recursive' failed [ 89s] make[3]: *** [all-recursive] Error 1 [ 89s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 89s] Makefile:429: recipe for target 'all-recursive' failed [ 89s] make[2]: *** [all-recursive] Error 1 [ 89s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 89s] Makefile:360: recipe for target 'all' failed [ 89s] make[1]: *** [all] Error 2 [ 89s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 89s] dh_auto_build: make -j1 returned exit code 2 [ 89s] debian/rules:45: recipe for target 'build' failed [ 89s] make: *** [build] Error 2 [ 89s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 89s] [ 89s] lamb62 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:04:20 UTC 2018. [ 89s] [ 89s] ### VM INTERACTION START ### [ 90s] Powering off. [ 90s] [ 79.609500] reboot: Power down [ 90s] ### VM INTERACTION END ### [ 90s] [ 90s] lamb62 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:04:21 UTC 2018. [ 90s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jul 31 20:04:32 2018 From: admin at opensuse.org (OBS Notification) Date: Tue, 31 Jul 2018 20:04:32 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <5b60c0ed2bb75_2b0d7fa6849845e@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_8.0/x86_64 Package network:osmocom:nightly/osmo-bsc failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 88s] ^ [ 88s] handover_fsm.c:489:4: error: format not a string literal and no format arguments [-Werror=format-security] [ 89s] cc1: some warnings being treated as errors [ 89s] Makefile:614: recipe for target 'handover_fsm.o' failed [ 89s] make[4]: *** [handover_fsm.o] Error 1 [ 89s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 89s] Makefile:395: recipe for target 'all-recursive' failed [ 89s] make[3]: *** [all-recursive] Error 1 [ 89s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 89s] Makefile:429: recipe for target 'all-recursive' failed [ 89s] make[2]: *** [all-recursive] Error 1 [ 89s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 89s] Makefile:360: recipe for target 'all' failed [ 89s] make[1]: *** [all] Error 2 [ 89s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 89s] dh_auto_build: make -j1 returned exit code 2 [ 89s] debian/rules:45: recipe for target 'build' failed [ 89s] make: *** [build] Error 2 [ 89s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 89s] [ 89s] lamb62 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:04:20 UTC 2018. [ 89s] [ 89s] ### VM INTERACTION START ### [ 90s] Powering off. [ 90s] [ 79.609500] reboot: Power down [ 90s] ### VM INTERACTION END ### [ 90s] [ 90s] lamb62 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:04:21 UTC 2018. [ 90s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jul 31 20:22:52 2018 From: admin at opensuse.org (OBS Notification) Date: Tue, 31 Jul 2018 20:22:52 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_9.0/armv7l In-Reply-To: References: Message-ID: <5b60c5243e0c2_2b0d7fa684988fb@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_9.0/armv7l Package network:osmocom:nightly/osmo-bsc failed to build in Debian_9.0/armv7l Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 118s] gsm0808_cell_id_name(&req->cell_id_target)); [ 118s] ^~~~~~~~~~~~~~~~~~~~ [ 120s] cc1: some warnings being treated as errors [ 120s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 120s] make[4]: *** [handover_fsm.o] Error 1 [ 120s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 120s] Makefile:407: recipe for target 'all-recursive' failed [ 120s] make[3]: *** [all-recursive] Error 1 [ 120s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 120s] Makefile:441: recipe for target 'all-recursive' failed [ 120s] make[2]: *** [all-recursive] Error 1 [ 120s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 120s] Makefile:373: recipe for target 'all' failed [ 120s] make[1]: *** [all] Error 2 [ 120s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 120s] dh_auto_build: make -j1 returned exit code 2 [ 120s] debian/rules:45: recipe for target 'build' failed [ 120s] make: *** [build] Error 2 [ 120s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 120s] [ 120s] armbuild26 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:22:44 UTC 2018. [ 120s] [ 120s] ### VM INTERACTION START ### [ 123s] [ 103.892755] SysRq : Power Off [ 123s] [ 103.893933] reboot: Power down [ 123s] ### VM INTERACTION END ### [ 123s] [ 123s] armbuild26 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:22:47 UTC 2018. [ 123s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Tue Jul 31 20:22:52 2018 From: admin at opensuse.org (OBS Notification) Date: Tue, 31 Jul 2018 20:22:52 +0000 Subject: Build failure of network:osmocom:nightly/osmo-bsc in Debian_9.0/armv7l In-Reply-To: References: Message-ID: <5b60c524a20dd_2b0d7fa684989e7@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-bsc/Debian_9.0/armv7l Package network:osmocom:nightly/osmo-bsc failed to build in Debian_9.0/armv7l Check out the package for editing: osc checkout network:osmocom:nightly osmo-bsc Last lines of build log: [ 118s] gsm0808_cell_id_name(&req->cell_id_target)); [ 118s] ^~~~~~~~~~~~~~~~~~~~ [ 120s] cc1: some warnings being treated as errors [ 120s] Makefile:625: recipe for target 'handover_fsm.o' failed [ 120s] make[4]: *** [handover_fsm.o] Error 1 [ 120s] make[4]: Leaving directory '/usr/src/packages/BUILD/src/osmo-bsc' [ 120s] Makefile:407: recipe for target 'all-recursive' failed [ 120s] make[3]: *** [all-recursive] Error 1 [ 120s] make[3]: Leaving directory '/usr/src/packages/BUILD/src' [ 120s] Makefile:441: recipe for target 'all-recursive' failed [ 120s] make[2]: *** [all-recursive] Error 1 [ 120s] make[2]: Leaving directory '/usr/src/packages/BUILD' [ 120s] Makefile:373: recipe for target 'all' failed [ 120s] make[1]: *** [all] Error 2 [ 120s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 120s] dh_auto_build: make -j1 returned exit code 2 [ 120s] debian/rules:45: recipe for target 'build' failed [ 120s] make: *** [build] Error 2 [ 120s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 120s] [ 120s] armbuild26 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:22:44 UTC 2018. [ 120s] [ 120s] ### VM INTERACTION START ### [ 123s] [ 103.892755] SysRq : Power Off [ 123s] [ 103.893933] reboot: Power down [ 123s] ### VM INTERACTION END ### [ 123s] [ 123s] armbuild26 failed "build osmo-bsc_1.3.0.25.94d30.dsc" at Tue Jul 31 20:22:47 UTC 2018. [ 123s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Sun Jul 8 15:36:21 2018 From: gerrit-no-reply at lists.osmocom.org (=?UTF-8?Q?K=C3=A9vin_Redon?=) Date: Sun, 08 Jul 2018 15:36:21 -0000 Subject: Change in simtrace2[master]: replace leading spaces with tabs Message-ID: K?vin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/9918 Change subject: replace leading spaces with tabs ...................................................................... replace leading spaces with tabs Change-Id: I86783eba0827b58303b10310e9f6b9625e1a27f1 --- M firmware/apps/cardem/main.c M firmware/apps/dfu/main.c M firmware/apps/trace/main.c M firmware/apps/triple_play/main.c M firmware/libboard/common/source/board_cstartup_gnu.c M firmware/libboard/common/source/board_lowlevel.c M firmware/libboard/common/source/led.c M firmware/libboard/common/source/uart_console.c M firmware/libcommon/include/assert.h M firmware/libcommon/include/cciddriver.h M firmware/libcommon/include/iso7816_4.h M firmware/libcommon/include/simtrace.h M firmware/libcommon/source/cciddriver.c M firmware/libcommon/source/iso7816_4.c M firmware/libcommon/source/mode_cardemu.c M firmware/libcommon/source/mode_ccid.c M firmware/libcommon/source/stdio.c M firmware/libcommon/source/string.c 18 files changed, 1,727 insertions(+), 1,727 deletions(-) git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/18/9918/1 diff --git a/firmware/apps/cardem/main.c b/firmware/apps/cardem/main.c index 9241c06..ae46794 100644 --- a/firmware/apps/cardem/main.c +++ b/firmware/apps/cardem/main.c @@ -152,7 +152,7 @@ EEFC_ReadUniqueID(g_unique_id); - printf("\n\r\n\r" + printf("\n\r\n\r" "=============================================================================\n\r" "SIMtrace2 firmware " GIT_VERSION " (C) 2010-2016 by Harald Welte\n\r" "=============================================================================\n\r"); diff --git a/firmware/apps/dfu/main.c b/firmware/apps/dfu/main.c index eb63cb5..e93aa58 100644 --- a/firmware/apps/dfu/main.c +++ b/firmware/apps/dfu/main.c @@ -180,7 +180,7 @@ uint32_t *app_part = (uint32_t *)FLASH_ADDR(0); /* at the first call we are before the text segment has been relocated, * so g_dfu is not initialized yet */ - g_dfu = &_g_dfu; + g_dfu = &_g_dfu; static bool dfu_magic = false; if (dfu_magic || (!dfu_magic && USB_DFU_MAGIC == g_dfu->magic)) { dfu_magic = true; diff --git a/firmware/apps/trace/main.c b/firmware/apps/trace/main.c index d2fddf9..6b6d70b 100644 --- a/firmware/apps/trace/main.c +++ b/firmware/apps/trace/main.c @@ -155,7 +155,7 @@ EEFC_ReadUniqueID(g_unique_id); - printf("\n\r\n\r" + printf("\n\r\n\r" "=============================================================================\n\r" "SIMtrace2 firmware " GIT_VERSION " (C) 2010-2016 by Harald Welte\n\r" "=============================================================================\n\r"); diff --git a/firmware/apps/triple_play/main.c b/firmware/apps/triple_play/main.c index 47d53af..b81abdd 100644 --- a/firmware/apps/triple_play/main.c +++ b/firmware/apps/triple_play/main.c @@ -151,7 +151,7 @@ EEFC_ReadUniqueID(g_unique_id); - printf("\r\n\r\n" + printf("\r\n\r\n" "=============================================================================\r\n" "SIMtrace2 firmware " GIT_REVISION " (C) 2010-2017 by Harald Welte\r\n" "=============================================================================\r\n"); diff --git a/firmware/libboard/common/source/board_cstartup_gnu.c b/firmware/libboard/common/source/board_cstartup_gnu.c index 0e8bb87..e82a2fb 100644 --- a/firmware/libboard/common/source/board_cstartup_gnu.c +++ b/firmware/libboard/common/source/board_cstartup_gnu.c @@ -71,59 +71,59 @@ __attribute__((section(".vectors"))) IntFunc exception_table[] = { - /* Configure Initial Stack Pointer, using linker-generated symbols */ - (IntFunc)(&pdwStack[STACK_SIZE-1]), - ResetException, + /* Configure Initial Stack Pointer, using linker-generated symbols */ + (IntFunc)(&pdwStack[STACK_SIZE-1]), + ResetException, - NMI_Handler, - HardFault_Handler, - MemManage_Handler, - BusFault_Handler, - UsageFault_Handler, - 0, 0, 0, 0, /* Reserved */ - SVC_Handler, - DebugMon_Handler, - 0, /* Reserved */ - PendSV_Handler, - SysTick_Handler, + NMI_Handler, + HardFault_Handler, + MemManage_Handler, + BusFault_Handler, + UsageFault_Handler, + 0, 0, 0, 0, /* Reserved */ + SVC_Handler, + DebugMon_Handler, + 0, /* Reserved */ + PendSV_Handler, + SysTick_Handler, - /* Configurable interrupts */ - SUPC_IrqHandler, /* 0 Supply Controller */ - RSTC_IrqHandler, /* 1 Reset Controller */ - RTC_IrqHandler, /* 2 Real Time Clock */ - RTT_IrqHandler, /* 3 Real Time Timer */ - WDT_IrqHandler, /* 4 Watchdog Timer */ - PMC_IrqHandler, /* 5 PMC */ - EEFC_IrqHandler, /* 6 EEFC */ - IrqHandlerNotUsed, /* 7 Reserved */ - UART0_IrqHandler, /* 8 UART0 */ - UART1_IrqHandler, /* 9 UART1 */ - SMC_IrqHandler, /* 10 SMC */ - PIOA_IrqHandler, /* 11 Parallel IO Controller A */ - PIOB_IrqHandler, /* 12 Parallel IO Controller B */ - PIOC_IrqHandler, /* 13 Parallel IO Controller C */ - USART0_IrqHandler, /* 14 USART 0 */ - USART1_IrqHandler, /* 15 USART 1 */ - IrqHandlerNotUsed, /* 16 Reserved */ - IrqHandlerNotUsed, /* 17 Reserved */ - MCI_IrqHandler, /* 18 MCI */ - TWI0_IrqHandler, /* 19 TWI 0 */ - TWI1_IrqHandler, /* 20 TWI 1 */ - SPI_IrqHandler, /* 21 SPI */ - SSC_IrqHandler, /* 22 SSC */ - TC0_IrqHandler, /* 23 Timer Counter 0 */ - TC1_IrqHandler, /* 24 Timer Counter 1 */ - TC2_IrqHandler, /* 25 Timer Counter 2 */ - TC3_IrqHandler, /* 26 Timer Counter 3 */ - TC4_IrqHandler, /* 27 Timer Counter 4 */ - TC5_IrqHandler, /* 28 Timer Counter 5 */ - ADC_IrqHandler, /* 29 ADC controller */ - DAC_IrqHandler, /* 30 DAC controller */ - PWM_IrqHandler, /* 31 PWM */ - CRCCU_IrqHandler, /* 32 CRC Calculation Unit */ - ACC_IrqHandler, /* 33 Analog Comparator */ - USBD_IrqHandler, /* 34 USB Device Port */ - IrqHandlerNotUsed /* 35 not used */ + /* Configurable interrupts */ + SUPC_IrqHandler, /* 0 Supply Controller */ + RSTC_IrqHandler, /* 1 Reset Controller */ + RTC_IrqHandler, /* 2 Real Time Clock */ + RTT_IrqHandler, /* 3 Real Time Timer */ + WDT_IrqHandler, /* 4 Watchdog Timer */ + PMC_IrqHandler, /* 5 PMC */ + EEFC_IrqHandler, /* 6 EEFC */ + IrqHandlerNotUsed, /* 7 Reserved */ + UART0_IrqHandler, /* 8 UART0 */ + UART1_IrqHandler, /* 9 UART1 */ + SMC_IrqHandler, /* 10 SMC */ + PIOA_IrqHandler, /* 11 Parallel IO Controller A */ + PIOB_IrqHandler, /* 12 Parallel IO Controller B */ + PIOC_IrqHandler, /* 13 Parallel IO Controller C */ + USART0_IrqHandler, /* 14 USART 0 */ + USART1_IrqHandler, /* 15 USART 1 */ + IrqHandlerNotUsed, /* 16 Reserved */ + IrqHandlerNotUsed, /* 17 Reserved */ + MCI_IrqHandler, /* 18 MCI */ + TWI0_IrqHandler, /* 19 TWI 0 */ + TWI1_IrqHandler, /* 20 TWI 1 */ + SPI_IrqHandler, /* 21 SPI */ + SSC_IrqHandler, /* 22 SSC */ + TC0_IrqHandler, /* 23 Timer Counter 0 */ + TC1_IrqHandler, /* 24 Timer Counter 1 */ + TC2_IrqHandler, /* 25 Timer Counter 2 */ + TC3_IrqHandler, /* 26 Timer Counter 3 */ + TC4_IrqHandler, /* 27 Timer Counter 4 */ + TC5_IrqHandler, /* 28 Timer Counter 5 */ + ADC_IrqHandler, /* 29 ADC controller */ + DAC_IrqHandler, /* 30 DAC controller */ + PWM_IrqHandler, /* 31 PWM */ + CRCCU_IrqHandler, /* 32 CRC Calculation Unit */ + ACC_IrqHandler, /* 33 Analog Comparator */ + USBD_IrqHandler, /* 34 USB Device Port */ + IrqHandlerNotUsed /* 35 not used */ }; #if defined(BOARD_USB_DFU) && defined(APPLICATION_dfu) @@ -153,56 +153,56 @@ */ void ResetException( void ) { - uint32_t *pSrc, *pDest ; + uint32_t *pSrc, *pDest ; - /* Low level Initialize */ - LowLevelInit() ; + /* Low level Initialize */ + LowLevelInit() ; #if defined(BOARD_USB_DFU) && defined(APPLICATION_dfu) - if (!USBDFU_OverrideEnterDFU()) { - UART_Exit(); - __disable_irq(); - BootIntoApp(); - /* Infinite loop */ - while ( 1 ) ; - } + if (!USBDFU_OverrideEnterDFU()) { + UART_Exit(); + __disable_irq(); + BootIntoApp(); + /* Infinite loop */ + while ( 1 ) ; + } #endif - /* Initialize the relocate segment */ - pSrc = &_etext ; - pDest = &_srelocate ; + /* Initialize the relocate segment */ + pSrc = &_etext ; + pDest = &_srelocate ; - if ( pSrc != pDest ) - { - for ( ; pDest < &_erelocate ; ) - { - *pDest++ = *pSrc++ ; - } - } + if ( pSrc != pDest ) + { + for ( ; pDest < &_erelocate ; ) + { + *pDest++ = *pSrc++ ; + } + } - /* Clear the zero segment */ - for ( pDest = &_szero ; pDest < &_ezero ; ) - { - *pDest++ = 0; - } + /* Clear the zero segment */ + for ( pDest = &_szero ; pDest < &_ezero ; ) + { + *pDest++ = 0; + } - /* Set the vector table base address */ - pSrc = (uint32_t *)&_sfixed; - SCB->VTOR = ( (uint32_t)pSrc & SCB_VTOR_TBLOFF_Msk ) ; - - if ( ((uint32_t)pSrc >= IRAM_ADDR) && ((uint32_t)pSrc < IRAM_ADDR+IRAM_SIZE) ) - { + /* Set the vector table base address */ + pSrc = (uint32_t *)&_sfixed; + SCB->VTOR = ( (uint32_t)pSrc & SCB_VTOR_TBLOFF_Msk ) ; + + if ( ((uint32_t)pSrc >= IRAM_ADDR) && ((uint32_t)pSrc < IRAM_ADDR+IRAM_SIZE) ) + { SCB->VTOR |= 1 << SCB_VTOR_TBLBASE_Pos ; - } + } - /* App should have disabled interrupts during the transition */ - __enable_irq(); + /* App should have disabled interrupts during the transition */ + __enable_irq(); - /* Branch to main function */ - main() ; + /* Branch to main function */ + main() ; - /* Infinite loop */ - while ( 1 ) ; + /* Infinite loop */ + while ( 1 ) ; } diff --git a/firmware/libboard/common/source/board_lowlevel.c b/firmware/libboard/common/source/board_lowlevel.c index b37719c..b82f6f3 100644 --- a/firmware/libboard/common/source/board_lowlevel.c +++ b/firmware/libboard/common/source/board_lowlevel.c @@ -50,15 +50,15 @@ #if (BOARD_MAINOSC == 18432000) /* Clock settings at 48MHz for 18 MHz crystal */ #define BOARD_PLLAR (CKGR_PLLAR_STUCKTO1 \ - | CKGR_PLLAR_MULA(13-1) \ - | CKGR_PLLAR_PLLACOUNT(0x1) \ - | CKGR_PLLAR_DIVA(5)) + | CKGR_PLLAR_MULA(13-1) \ + | CKGR_PLLAR_PLLACOUNT(0x1) \ + | CKGR_PLLAR_DIVA(5)) #elif (BOARD_MAINOSC == 12000000) /* QMod has 12 MHz clock, so multply by 8 (96 MHz) and divide by 2 */ #define BOARD_PLLAR (CKGR_PLLAR_STUCKTO1 \ - | CKGR_PLLAR_MULA(8-1) \ - | CKGR_PLLAR_PLLACOUNT(0x1) \ - | CKGR_PLLAR_DIVA(2)) + | CKGR_PLLAR_MULA(8-1) \ + | CKGR_PLLAR_PLLACOUNT(0x1) \ + | CKGR_PLLAR_DIVA(2)) #else #error "Please define PLLA config for your MAINOSC frequency" #endif /* MAINOSC */ @@ -66,19 +66,19 @@ #if (BOARD_MAINOSC == 18432000) /* Clock settings at 64MHz for 18 MHz crystal: 64.512 MHz */ #define BOARD_PLLAR (CKGR_PLLAR_STUCKTO1 \ - | CKGR_PLLAR_MULA(7-1) \ - | CKGR_PLLAR_PLLACOUNT(0x1) \ - | CKGR_PLLAR_DIVA(2)) + | CKGR_PLLAR_MULA(7-1) \ + | CKGR_PLLAR_PLLACOUNT(0x1) \ + | CKGR_PLLAR_DIVA(2)) #elif (BOARD_MAINOSC == 12000000) /* QMod has 12 MHz clock, so multply by 10 / div by 2: 60 MHz */ #define BOARD_PLLAR (CKGR_PLLAR_STUCKTO1 \ - | CKGR_PLLAR_MULA(10-1) \ - | CKGR_PLLAR_PLLACOUNT(0x1) \ - | CKGR_PLLAR_DIVA(2)) + | CKGR_PLLAR_MULA(10-1) \ + | CKGR_PLLAR_PLLACOUNT(0x1) \ + | CKGR_PLLAR_DIVA(2)) #error "Please define PLLA config for your MAINOSC frequency" #endif /* MAINOSC */ #else - #error "No PLL settings for current BOARD_MCK." + #error "No PLL settings for current BOARD_MCK." #endif #if (BOARD_MAINOSC == 12000000) @@ -117,85 +117,85 @@ */ extern WEAK void LowLevelInit( void ) { - uint32_t timeout = 0; + uint32_t timeout = 0; - /* Configure the Supply Monitor to reset the CPU in case VDDIO is - * lower than 3.0V. As we run the board on 3.3V, any lower voltage - * might be some kind of leakage that creeps in some way, but is not - * the "official" power supply */ - SUPC->SUPC_SMMR = SUPC_SMMR_SMTH_3_0V | SUPC_SMMR_SMSMPL_CSM | + /* Configure the Supply Monitor to reset the CPU in case VDDIO is + * lower than 3.0V. As we run the board on 3.3V, any lower voltage + * might be some kind of leakage that creeps in some way, but is not + * the "official" power supply */ + SUPC->SUPC_SMMR = SUPC_SMMR_SMTH_3_0V | SUPC_SMMR_SMSMPL_CSM | SUPC_SMMR_SMRSTEN_ENABLE; - /* enable both LED and green LED */ - PIOA->PIO_PER |= PIO_LED_RED | PIO_LED_GREEN; - PIOA->PIO_OER |= PIO_LED_RED | PIO_LED_GREEN; - PIOA->PIO_CODR |= PIO_LED_RED | PIO_LED_GREEN; + /* enable both LED and green LED */ + PIOA->PIO_PER |= PIO_LED_RED | PIO_LED_GREEN; + PIOA->PIO_OER |= PIO_LED_RED | PIO_LED_GREEN; + PIOA->PIO_CODR |= PIO_LED_RED | PIO_LED_GREEN; - /* Set 3 FWS for Embedded Flash Access */ - EFC->EEFC_FMR = EEFC_FMR_FWS(3); + /* Set 3 FWS for Embedded Flash Access */ + EFC->EEFC_FMR = EEFC_FMR_FWS(3); - /* Select external slow clock */ + /* Select external slow clock */ /* if ((SUPC->SUPC_SR & SUPC_SR_OSCSEL) != SUPC_SR_OSCSEL_CRYST) - { - SUPC->SUPC_CR = (uint32_t)(SUPC_CR_XTALSEL_CRYSTAL_SEL | SUPC_CR_KEY(0xA5)); - timeout = 0; - while (!(SUPC->SUPC_SR & SUPC_SR_OSCSEL_CRYST) ); - } + { + SUPC->SUPC_CR = (uint32_t)(SUPC_CR_XTALSEL_CRYSTAL_SEL | SUPC_CR_KEY(0xA5)); + timeout = 0; + while (!(SUPC->SUPC_SR & SUPC_SR_OSCSEL_CRYST) ); + } */ #ifndef qmod - /* Initialize main oscillator */ - if ( !(PMC->CKGR_MOR & CKGR_MOR_MOSCSEL) ) - { - PMC->CKGR_MOR = CKGR_MOR_KEY(0x37) | BOARD_OSCOUNT | CKGR_MOR_MOSCRCEN | CKGR_MOR_MOSCXTEN; - timeout = 0; - while (!(PMC->PMC_SR & PMC_SR_MOSCXTS) && (timeout++ < CLOCK_TIMEOUT)); - } + /* Initialize main oscillator */ + if ( !(PMC->CKGR_MOR & CKGR_MOR_MOSCSEL) ) + { + PMC->CKGR_MOR = CKGR_MOR_KEY(0x37) | BOARD_OSCOUNT | CKGR_MOR_MOSCRCEN | CKGR_MOR_MOSCXTEN; + timeout = 0; + while (!(PMC->PMC_SR & PMC_SR_MOSCXTS) && (timeout++ < CLOCK_TIMEOUT)); + } - /* Switch to 3-20MHz Xtal oscillator */ - PIOB->PIO_PDR = (1 << 8) | (1 << 9); - PIOB->PIO_PUDR = (1 << 8) | (1 << 9); - PIOB->PIO_PPDDR = (1 << 8) | (1 << 9); - PMC->CKGR_MOR = CKGR_MOR_KEY(0x37) | BOARD_OSCOUNT | CKGR_MOR_MOSCRCEN | CKGR_MOR_MOSCXTEN | CKGR_MOR_MOSCSEL; - /* wait for Main XTAL oscillator stabilization */ - timeout = 0; - while (!(PMC->PMC_SR & PMC_SR_MOSCSELS) && (timeout++ < CLOCK_TIMEOUT)); + /* Switch to 3-20MHz Xtal oscillator */ + PIOB->PIO_PDR = (1 << 8) | (1 << 9); + PIOB->PIO_PUDR = (1 << 8) | (1 << 9); + PIOB->PIO_PPDDR = (1 << 8) | (1 << 9); + PMC->CKGR_MOR = CKGR_MOR_KEY(0x37) | BOARD_OSCOUNT | CKGR_MOR_MOSCRCEN | CKGR_MOR_MOSCXTEN | CKGR_MOR_MOSCSEL; + /* wait for Main XTAL oscillator stabilization */ + timeout = 0; + while (!(PMC->PMC_SR & PMC_SR_MOSCSELS) && (timeout++ < CLOCK_TIMEOUT)); #else - /* QMOD has external 12MHz clock source */ - PIOB->PIO_PDR = (1 << 9); - PIOB->PIO_PUDR = (1 << 9); - PIOB->PIO_PPDDR = (1 << 9); - PMC->CKGR_MOR = CKGR_MOR_KEY(0x37) | CKGR_MOR_MOSCRCEN | CKGR_MOR_MOSCXTBY| CKGR_MOR_MOSCSEL; + /* QMOD has external 12MHz clock source */ + PIOB->PIO_PDR = (1 << 9); + PIOB->PIO_PUDR = (1 << 9); + PIOB->PIO_PPDDR = (1 << 9); + PMC->CKGR_MOR = CKGR_MOR_KEY(0x37) | CKGR_MOR_MOSCRCEN | CKGR_MOR_MOSCXTBY| CKGR_MOR_MOSCSEL; #endif - /* disable the red LED after main clock initialization */ - PIOA->PIO_SODR = PIO_LED_RED; + /* disable the red LED after main clock initialization */ + PIOA->PIO_SODR = PIO_LED_RED; - /* "switch" to main clock as master clock source (should already be the case */ - PMC->PMC_MCKR = (PMC->PMC_MCKR & ~(uint32_t)PMC_MCKR_CSS_Msk) | PMC_MCKR_CSS_MAIN_CLK; - /* wait for master clock to be ready */ - for ( timeout = 0; !(PMC->PMC_SR & PMC_SR_MCKRDY) && (timeout++ < CLOCK_TIMEOUT) ; ); + /* "switch" to main clock as master clock source (should already be the case */ + PMC->PMC_MCKR = (PMC->PMC_MCKR & ~(uint32_t)PMC_MCKR_CSS_Msk) | PMC_MCKR_CSS_MAIN_CLK; + /* wait for master clock to be ready */ + for ( timeout = 0; !(PMC->PMC_SR & PMC_SR_MCKRDY) && (timeout++ < CLOCK_TIMEOUT) ; ); - /* Initialize PLLA */ - PMC->CKGR_PLLAR = BOARD_PLLAR; - /* Wait for PLLA to lock */ - timeout = 0; - while (!(PMC->PMC_SR & PMC_SR_LOCKA) && (timeout++ < CLOCK_TIMEOUT)); + /* Initialize PLLA */ + PMC->CKGR_PLLAR = BOARD_PLLAR; + /* Wait for PLLA to lock */ + timeout = 0; + while (!(PMC->PMC_SR & PMC_SR_LOCKA) && (timeout++ < CLOCK_TIMEOUT)); - /* Switch to main clock (again ?!?) */ - PMC->PMC_MCKR = (BOARD_MCKR & ~PMC_MCKR_CSS_Msk) | PMC_MCKR_CSS_MAIN_CLK; - /* wait for master clock to be ready */ - for ( timeout = 0; !(PMC->PMC_SR & PMC_SR_MCKRDY) && (timeout++ < CLOCK_TIMEOUT) ; ); + /* Switch to main clock (again ?!?) */ + PMC->PMC_MCKR = (BOARD_MCKR & ~PMC_MCKR_CSS_Msk) | PMC_MCKR_CSS_MAIN_CLK; + /* wait for master clock to be ready */ + for ( timeout = 0; !(PMC->PMC_SR & PMC_SR_MCKRDY) && (timeout++ < CLOCK_TIMEOUT) ; ); - /* switch to PLLA as master clock source */ - PMC->PMC_MCKR = BOARD_MCKR ; - /* wait for master clock to be ready */ - for ( timeout = 0; !(PMC->PMC_SR & PMC_SR_MCKRDY) && (timeout++ < CLOCK_TIMEOUT) ; ); + /* switch to PLLA as master clock source */ + PMC->PMC_MCKR = BOARD_MCKR ; + /* wait for master clock to be ready */ + for ( timeout = 0; !(PMC->PMC_SR & PMC_SR_MCKRDY) && (timeout++ < CLOCK_TIMEOUT) ; ); - /* Configure SysTick for 1ms */ - SysTick_Config(BOARD_MCK/1000); + /* Configure SysTick for 1ms */ + SysTick_Config(BOARD_MCK/1000); - _ConfigureUsbClock(); + _ConfigureUsbClock(); } /* SysTick based delay function */ diff --git a/firmware/libboard/common/source/led.c b/firmware/libboard/common/source/led.c index cffff70..e3293b6 100644 --- a/firmware/libboard/common/source/led.c +++ b/firmware/libboard/common/source/led.c @@ -35,9 +35,9 @@ ASSERT(led < PIO_LISTSIZE(pinsLeds)); if (on) - PIO_Clear(&pinsLeds[led]); + PIO_Clear(&pinsLeds[led]); else - PIO_Set(&pinsLeds[led]); + PIO_Set(&pinsLeds[led]); } /* LED blinking code */ diff --git a/firmware/libboard/common/source/uart_console.c b/firmware/libboard/common/source/uart_console.c index 88c9166..3ce7331 100644 --- a/firmware/libboard/common/source/uart_console.c +++ b/firmware/libboard/common/source/uart_console.c @@ -66,41 +66,41 @@ */ extern void UART_Configure( uint32_t baudrate, uint32_t masterClock) { - const Pin pPins[] = CONSOLE_PINS; - Uart *pUart = CONSOLE_UART; + const Pin pPins[] = CONSOLE_PINS; + Uart *pUart = CONSOLE_UART; - /* Configure PIO */ - PIO_Configure(pPins, PIO_LISTSIZE(pPins)); + /* Configure PIO */ + PIO_Configure(pPins, PIO_LISTSIZE(pPins)); - /* Configure PMC */ - PMC->PMC_PCER0 = 1 << CONSOLE_ID; + /* Configure PMC */ + PMC->PMC_PCER0 = 1 << CONSOLE_ID; - /* Reset and disable receiver & transmitter */ - pUart->UART_CR = UART_CR_RSTRX | UART_CR_RSTTX - | UART_CR_RXDIS | UART_CR_TXDIS; + /* Reset and disable receiver & transmitter */ + pUart->UART_CR = UART_CR_RSTRX | UART_CR_RSTTX + | UART_CR_RXDIS | UART_CR_TXDIS; - /* Configure mode */ - pUart->UART_MR = UART_MR_PAR_NO; + /* Configure mode */ + pUart->UART_MR = UART_MR_PAR_NO; - /* Configure baudrate */ - /* Asynchronous, no oversampling */ - pUart->UART_BRGR = (masterClock / baudrate) / 16; + /* Configure baudrate */ + /* Asynchronous, no oversampling */ + pUart->UART_BRGR = (masterClock / baudrate) / 16; - /* Disable PDC channel */ - pUart->UART_PTCR = UART_PTCR_RXTDIS | UART_PTCR_TXTDIS; + /* Disable PDC channel */ + pUart->UART_PTCR = UART_PTCR_RXTDIS | UART_PTCR_TXTDIS; - /* Reset transmit ring buffer */ - rbuf_reset(&uart_tx_buffer); + /* Reset transmit ring buffer */ + rbuf_reset(&uart_tx_buffer); - /* Enable TX interrupts */ - pUart->UART_IER = UART_IER_TXRDY; - NVIC_EnableIRQ(CONSOLE_IRQ); - - /* Enable receiver and transmitter */ - pUart->UART_CR = UART_CR_RXEN | UART_CR_TXEN; + /* Enable TX interrupts */ + pUart->UART_IER = UART_IER_TXRDY; + NVIC_EnableIRQ(CONSOLE_IRQ); + + /* Enable receiver and transmitter */ + pUart->UART_CR = UART_CR_RXEN | UART_CR_TXEN; - /* Remember the configuration is complete */ - _ucIsConsoleInitialized=1 ; + /* Remember the configuration is complete */ + _ucIsConsoleInitialized=1 ; } /** @@ -140,22 +140,22 @@ */ extern void UART_PutChar( uint8_t c ) { - Uart *pUart = CONSOLE_UART ; + Uart *pUart = CONSOLE_UART ; - /* Initialize console is not already done */ - if ( !_ucIsConsoleInitialized ) - { - UART_Configure(CONSOLE_BAUDRATE, BOARD_MCK); - } + /* Initialize console is not already done */ + if ( !_ucIsConsoleInitialized ) + { + UART_Configure(CONSOLE_BAUDRATE, BOARD_MCK); + } - /* Only store input if buffer is not full, else drop it */ - if (!rbuf_is_full(&uart_tx_buffer)) { - rbuf_write(&uart_tx_buffer, c); - if (!(pUart->UART_IMR & UART_IMR_TXRDY)) { - pUart->UART_IER = UART_IER_TXRDY; - CONSOLE_ISR(); - } - } + /* Only store input if buffer is not full, else drop it */ + if (!rbuf_is_full(&uart_tx_buffer)) { + rbuf_write(&uart_tx_buffer, c); + if (!(pUart->UART_IMR & UART_IMR_TXRDY)) { + pUart->UART_IER = UART_IER_TXRDY; + CONSOLE_ISR(); + } + } } /** @@ -166,17 +166,17 @@ */ extern uint32_t UART_GetChar( void ) { - Uart *pUart = CONSOLE_UART ; + Uart *pUart = CONSOLE_UART ; - if ( !_ucIsConsoleInitialized ) - { - UART_Configure(CONSOLE_BAUDRATE, BOARD_MCK); - } + if ( !_ucIsConsoleInitialized ) + { + UART_Configure(CONSOLE_BAUDRATE, BOARD_MCK); + } - while ( (pUart->UART_SR & UART_SR_RXRDY) == 0 ) - WDT_Restart(WDT); + while ( (pUart->UART_SR & UART_SR_RXRDY) == 0 ) + WDT_Restart(WDT); - return pUart->UART_RHR ; + return pUart->UART_RHR ; } /** @@ -186,14 +186,14 @@ */ extern uint32_t UART_IsRxReady( void ) { - Uart *pUart = CONSOLE_UART; + Uart *pUart = CONSOLE_UART; - if ( !_ucIsConsoleInitialized ) - { - UART_Configure( CONSOLE_BAUDRATE, BOARD_MCK ) ; - } + if ( !_ucIsConsoleInitialized ) + { + UART_Configure( CONSOLE_BAUDRATE, BOARD_MCK ) ; + } - return (pUart->UART_SR & UART_SR_RXRDY) > 0 ; + return (pUart->UART_SR & UART_SR_RXRDY) > 0 ; } /** @@ -204,14 +204,14 @@ */ extern void UART_DumpFrame( uint8_t* pucFrame, uint32_t dwSize ) { - uint32_t dw ; + uint32_t dw ; - for ( dw=0 ; dw < dwSize ; dw++ ) - { - printf( "%02X ", pucFrame[dw] ) ; - } + for ( dw=0 ; dw < dwSize ; dw++ ) + { + printf( "%02X ", pucFrame[dw] ) ; + } - printf( "\n\r" ) ; + printf( "\n\r" ) ; } /** @@ -223,62 +223,62 @@ */ extern void UART_DumpMemory( uint8_t* pucBuffer, uint32_t dwSize, uint32_t dwAddress ) { - uint32_t i ; - uint32_t j ; - uint32_t dwLastLineStart ; - uint8_t* pucTmp ; + uint32_t i ; + uint32_t j ; + uint32_t dwLastLineStart ; + uint8_t* pucTmp ; - for ( i=0 ; i < (dwSize / 16) ; i++ ) - { - printf( "0x%08X: ", (unsigned int)(dwAddress + (i*16)) ) ; - pucTmp = (uint8_t*)&pucBuffer[i*16] ; + for ( i=0 ; i < (dwSize / 16) ; i++ ) + { + printf( "0x%08X: ", (unsigned int)(dwAddress + (i*16)) ) ; + pucTmp = (uint8_t*)&pucBuffer[i*16] ; - for ( j=0 ; j < 4 ; j++ ) - { - printf( "%02X%02X%02X%02X ", pucTmp[0], pucTmp[1], pucTmp[2], pucTmp[3] ) ; - pucTmp += 4 ; - } + for ( j=0 ; j < 4 ; j++ ) + { + printf( "%02X%02X%02X%02X ", pucTmp[0], pucTmp[1], pucTmp[2], pucTmp[3] ) ; + pucTmp += 4 ; + } - pucTmp=(uint8_t*)&pucBuffer[i*16] ; + pucTmp=(uint8_t*)&pucBuffer[i*16] ; - for ( j=0 ; j < 16 ; j++ ) - { - UART_PutChar( *pucTmp++ ) ; - } + for ( j=0 ; j < 16 ; j++ ) + { + UART_PutChar( *pucTmp++ ) ; + } - printf( "\n\r" ) ; - } + printf( "\n\r" ) ; + } - if ( (dwSize%16) != 0 ) - { - dwLastLineStart=dwSize - (dwSize%16) ; + if ( (dwSize%16) != 0 ) + { + dwLastLineStart=dwSize - (dwSize%16) ; - printf( "0x%08X: ", (unsigned int)(dwAddress + dwLastLineStart) ) ; - for ( j=dwLastLineStart ; j < dwLastLineStart+16 ; j++ ) - { - if ( (j!=dwLastLineStart) && (j%4 == 0) ) - { - printf( " " ) ; - } + printf( "0x%08X: ", (unsigned int)(dwAddress + dwLastLineStart) ) ; + for ( j=dwLastLineStart ; j < dwLastLineStart+16 ; j++ ) + { + if ( (j!=dwLastLineStart) && (j%4 == 0) ) + { + printf( " " ) ; + } - if ( j < dwSize ) - { - printf( "%02X", pucBuffer[j] ) ; - } - else - { - printf(" ") ; - } - } + if ( j < dwSize ) + { + printf( "%02X", pucBuffer[j] ) ; + } + else + { + printf(" ") ; + } + } - printf( " " ) ; - for ( j=dwLastLineStart ; j < dwSize ; j++ ) - { - UART_PutChar( pucBuffer[j] ) ; - } + printf( " " ) ; + for ( j=dwLastLineStart ; j < dwSize ; j++ ) + { + UART_PutChar( pucBuffer[j] ) ; + } - printf( "\n\r" ) ; - } + printf( "\n\r" ) ; + } } /** @@ -288,46 +288,46 @@ */ extern uint32_t UART_GetInteger( uint32_t* pdwValue ) { - uint8_t ucKey ; - uint8_t ucNbNb=0 ; - uint32_t dwValue=0 ; + uint8_t ucKey ; + uint8_t ucNbNb=0 ; + uint32_t dwValue=0 ; - while ( 1 ) - { - ucKey=UART_GetChar() ; - UART_PutChar( ucKey ) ; + while ( 1 ) + { + ucKey=UART_GetChar() ; + UART_PutChar( ucKey ) ; - if ( ucKey >= '0' && ucKey <= '9' ) - { - dwValue = (dwValue * 10) + (ucKey - '0'); - ucNbNb++ ; - } - else - { - if ( ucKey == 0x0D || ucKey == ' ' ) - { - if ( ucNbNb == 0 ) - { - printf( "\n\rWrite a number and press ENTER or SPACE!\n\r" ) ; - return 0 ; - } - else - { - printf( "\n\r" ) ; - *pdwValue=dwValue ; + if ( ucKey >= '0' && ucKey <= '9' ) + { + dwValue = (dwValue * 10) + (ucKey - '0'); + ucNbNb++ ; + } + else + { + if ( ucKey == 0x0D || ucKey == ' ' ) + { + if ( ucNbNb == 0 ) + { + printf( "\n\rWrite a number and press ENTER or SPACE!\n\r" ) ; + return 0 ; + } + else + { + printf( "\n\r" ) ; + *pdwValue=dwValue ; - return 1 ; - } - } - else - { - printf( "\n\r'%c' not a number!\n\r", ucKey ) ; + return 1 ; + } + } + else + { + printf( "\n\r'%c' not a number!\n\r", ucKey ) ; - return 0 ; - } - } - WDT_Restart(WDT); - } + return 0 ; + } + } + WDT_Restart(WDT); + } } /** @@ -339,25 +339,25 @@ */ extern uint32_t UART_GetIntegerMinMax( uint32_t* pdwValue, uint32_t dwMin, uint32_t dwMax ) { - uint32_t dwValue=0 ; + uint32_t dwValue=0 ; - if ( UART_GetInteger( &dwValue ) == 0 ) - { - return 0 ; - } + if ( UART_GetInteger( &dwValue ) == 0 ) + { + return 0 ; + } - if ( dwValue < dwMin || dwValue > dwMax ) + if ( dwValue < dwMin || dwValue > dwMax ) { - printf( "\n\rThe number have to be between %d and %d\n\r", (int)dwMin, (int)dwMax ) ; + printf( "\n\rThe number have to be between %d and %d\n\r", (int)dwMin, (int)dwMax ) ; - return 0 ; - } + return 0 ; + } - printf( "\n\r" ) ; + printf( "\n\r" ) ; - *pdwValue = dwValue ; + *pdwValue = dwValue ; - return 1 ; + return 1 ; } /** @@ -367,45 +367,45 @@ */ extern uint32_t UART_GetHexa32( uint32_t* pdwValue ) { - uint8_t ucKey ; - uint32_t dw = 0 ; - uint32_t dwValue = 0 ; + uint8_t ucKey ; + uint32_t dw = 0 ; + uint32_t dwValue = 0 ; - for ( dw=0 ; dw < 8 ; dw++ ) - { - ucKey = UART_GetChar() ; - UART_PutChar( ucKey ) ; + for ( dw=0 ; dw < 8 ; dw++ ) + { + ucKey = UART_GetChar() ; + UART_PutChar( ucKey ) ; - if ( ucKey >= '0' && ucKey <= '9' ) - { - dwValue = (dwValue * 16) + (ucKey - '0') ; - } - else - { - if ( ucKey >= 'A' && ucKey <= 'F' ) - { - dwValue = (dwValue * 16) + (ucKey - 'A' + 10) ; - } - else - { - if ( ucKey >= 'a' && ucKey <= 'f' ) - { - dwValue = (dwValue * 16) + (ucKey - 'a' + 10) ; - } - else - { - printf( "\n\rIt is not a hexa character!\n\r" ) ; + if ( ucKey >= '0' && ucKey <= '9' ) + { + dwValue = (dwValue * 16) + (ucKey - '0') ; + } + else + { + if ( ucKey >= 'A' && ucKey <= 'F' ) + { + dwValue = (dwValue * 16) + (ucKey - 'A' + 10) ; + } + else + { + if ( ucKey >= 'a' && ucKey <= 'f' ) + { + dwValue = (dwValue * 16) + (ucKey - 'a' + 10) ; + } + else + { + printf( "\n\rIt is not a hexa character!\n\r" ) ; - return 0 ; - } - } - } - } + return 0 ; + } + } + } + } - printf("\n\r" ) ; - *pdwValue = dwValue ; + printf("\n\r" ) ; + *pdwValue = dwValue ; - return 1 ; + return 1 ; } #if defined __ICCARM__ /* IAR Ewarm 5.41+ */ @@ -418,9 +418,9 @@ */ extern WEAK signed int putchar( signed int c ) { - UART_PutChar( c ) ; + UART_PutChar( c ) ; - return c ; + return c ; } #endif // defined __ICCARM__ diff --git a/firmware/libcommon/include/assert.h b/firmware/libcommon/include/assert.h index a52ffa9..22bb101 100644 --- a/firmware/libcommon/include/assert.h +++ b/firmware/libcommon/include/assert.h @@ -65,41 +65,41 @@ // Definitions //------------------------------------------------------------------------------ #if defined(NOASSERT) - #define ASSERT(...) - #define SANITY_CHECK(...) + #define ASSERT(...) + #define SANITY_CHECK(...) #else - #if (TRACE_LEVEL == 0) - /// Checks that the given condition is true, - /// otherwise stops the program execution. - /// \param condition Condition to verify. - #define ASSERT(condition) { \ - if (!(condition)) { \ - while (1); \ - } \ - } + #if (TRACE_LEVEL == 0) + /// Checks that the given condition is true, + /// otherwise stops the program execution. + /// \param condition Condition to verify. + #define ASSERT(condition) { \ + if (!(condition)) { \ + while (1); \ + } \ + } - /// Performs the same duty as the ASSERT() macro - /// \param condition Condition to verify. - #define SANITY_CHECK(condition) ASSERT(condition, ...) + /// Performs the same duty as the ASSERT() macro + /// \param condition Condition to verify. + #define SANITY_CHECK(condition) ASSERT(condition, ...) - #else - /// Checks that the given condition is true, otherwise displays an error - /// message and stops the program execution. - /// \param condition Condition to verify. - #define ASSERT(condition) { \ - if (!(condition)) { \ - printf("-F- ASSERT: %s %s:%d\n\r", #condition, __BASE_FILE__, __LINE__); \ - while (1); \ - } \ - } - #define SANITY_ERROR "Sanity check failed at %s:%d\n\r" - - /// Performs the same duty as the ASSERT() macro, except a default error - /// message is output if the condition is false. - /// \param condition Condition to verify. - #define SANITY_CHECK(condition) ASSERT(condition, SANITY_ERROR, __FILE__, __LINE__) - #endif + #else + /// Checks that the given condition is true, otherwise displays an error + /// message and stops the program execution. + /// \param condition Condition to verify. + #define ASSERT(condition) { \ + if (!(condition)) { \ + printf("-F- ASSERT: %s %s:%d\n\r", #condition, __BASE_FILE__, __LINE__); \ + while (1); \ + } \ + } + #define SANITY_ERROR "Sanity check failed at %s:%d\n\r" + + /// Performs the same duty as the ASSERT() macro, except a default error + /// message is output if the condition is false. + /// \param condition Condition to verify. + #define SANITY_CHECK(condition) ASSERT(condition, SANITY_ERROR, __FILE__, __LINE__) + #endif #endif diff --git a/firmware/libcommon/include/cciddriver.h b/firmware/libcommon/include/cciddriver.h index ee5e028..f9be027 100644 --- a/firmware/libcommon/include/cciddriver.h +++ b/firmware/libcommon/include/cciddriver.h @@ -145,129 +145,129 @@ /// 6.1.11.2 PIN Verification Data Structure typedef struct { - /// Number of seconds. - unsigned char bTimerOut; - /// Several parameters for the PIN format options - unsigned char bmFormatString; - /// Define the length of the PIN to present in the APDU command - unsigned char bmPINBlockString; - /// Allows the length PIN insertion in the APDU command - unsigned char bmPINLengthFormat; - /// Minimum PIN size in digit and Maximum PIN size in digit - unsigned char wPINMaxExtraDigit; - /// The value is a bit wise OR operation. - unsigned char bEntryValidationCondition; - /// Number of messages to display for the PIN modify command - unsigned char bNumberMessage; - /// Language used to display the messages. - unsigned char wLangId; - /// Message index in the Reader message table - unsigned char bMsgIndex; - /// T=1 I-block prologue field to use - unsigned char bTeoPrologue[3]; - /// APDU to send to the ICC - unsigned char abPINApdu[255]; + /// Number of seconds. + unsigned char bTimerOut; + /// Several parameters for the PIN format options + unsigned char bmFormatString; + /// Define the length of the PIN to present in the APDU command + unsigned char bmPINBlockString; + /// Allows the length PIN insertion in the APDU command + unsigned char bmPINLengthFormat; + /// Minimum PIN size in digit and Maximum PIN size in digit + unsigned char wPINMaxExtraDigit; + /// The value is a bit wise OR operation. + unsigned char bEntryValidationCondition; + /// Number of messages to display for the PIN modify command + unsigned char bNumberMessage; + /// Language used to display the messages. + unsigned char wLangId; + /// Message index in the Reader message table + unsigned char bMsgIndex; + /// T=1 I-block prologue field to use + unsigned char bTeoPrologue[3]; + /// APDU to send to the ICC + unsigned char abPINApdu[255]; }__attribute__ ((packed)) S_ccid_PIN_Verification; /// 6.1.11.7 PIN Modification Data Structure typedef struct { - /// Number of seconds. If 00h then CCID default value is used. - unsigned char bTimeOut; - /// Several parameters for the PIN format options (defined in ? 6.1.11.4) - unsigned char bmFormatString4; - /// Define the length of the PIN to present in the APDU command - unsigned char bmPINBlockString; - /// Allows the length PIN insertion in the APDU command (defined in ? 6.1.11.6) - unsigned char bmPinLengthFormat; - /// Insertion position offset in byte for the current PIN - unsigned char bInsertionOffsetOld; - /// Insertion position offset in byte for the new PIN - unsigned char bInsertionOffsetNew; - /// XXYYh - /// XX: Minimum PIN size in digit - /// YY: Maximum PIN size in digit - unsigned char wPINMaxExtraDigit; - /// 00h,01h,02h,03h - /// Indicates if a confirmation is requested before acceptance of a new PIN (meaning that the user has to enter this new PIN twice before it is accepted) - /// Indicates if the current PIN must be entered and set in the same APDU field of not. - unsigned char bConfirmPIN; - /// The value is a bit wise OR operation. - /// 01h Max size reached - /// 02h Validation key pressed - /// 04h Timeout occurred - unsigned char bEntryValidationCondition; - /// 00h,01h,02h,03h,or FFh - /// Number of messages to display for the PIN modify command. - unsigned char bNumberMessage; - /// Language used to display the messages. The 16 bit - unsigned char wLangId; - /// Message index in the Reader message table (should be 00h or 01h). - unsigned char bMsgIndex1; - /// Message index in the Reader message table (should be 01h or 02h). - unsigned char bMsgIndex2; - /// Message index in the Reader message table (should be 02h). - unsigned char bMsgIndex3; - /// T=1 I-block prologue field to use. Significant only if protocol in use is T=1. - unsigned char bTeoPrologue[3]; - /// Byte array APDU to send to the ICC - unsigned char abPINApdu[255]; + /// Number of seconds. If 00h then CCID default value is used. + unsigned char bTimeOut; + /// Several parameters for the PIN format options (defined in ? 6.1.11.4) + unsigned char bmFormatString4; + /// Define the length of the PIN to present in the APDU command + unsigned char bmPINBlockString; + /// Allows the length PIN insertion in the APDU command (defined in ? 6.1.11.6) + unsigned char bmPinLengthFormat; + /// Insertion position offset in byte for the current PIN + unsigned char bInsertionOffsetOld; + /// Insertion position offset in byte for the new PIN + unsigned char bInsertionOffsetNew; + /// XXYYh + /// XX: Minimum PIN size in digit + /// YY: Maximum PIN size in digit + unsigned char wPINMaxExtraDigit; + /// 00h,01h,02h,03h + /// Indicates if a confirmation is requested before acceptance of a new PIN (meaning that the user has to enter this new PIN twice before it is accepted) + /// Indicates if the current PIN must be entered and set in the same APDU field of not. + unsigned char bConfirmPIN; + /// The value is a bit wise OR operation. + /// 01h Max size reached + /// 02h Validation key pressed + /// 04h Timeout occurred + unsigned char bEntryValidationCondition; + /// 00h,01h,02h,03h,or FFh + /// Number of messages to display for the PIN modify command. + unsigned char bNumberMessage; + /// Language used to display the messages. The 16 bit + unsigned char wLangId; + /// Message index in the Reader message table (should be 00h or 01h). + unsigned char bMsgIndex1; + /// Message index in the Reader message table (should be 01h or 02h). + unsigned char bMsgIndex2; + /// Message index in the Reader message table (should be 02h). + unsigned char bMsgIndex3; + /// T=1 I-block prologue field to use. Significant only if protocol in use is T=1. + unsigned char bTeoPrologue[3]; + /// Byte array APDU to send to the ICC + unsigned char abPINApdu[255]; }__attribute__ ((packed)) S_ccid_PIN_Modification; /// Protocol Data Structure for Protocol T=0 (bProtocolNum=0, dwLength=00000005h) typedef struct { - /// B7-4 ? FI ? Index into the table 7 in ISO/IEC 7816-3:1997 selecting a - /// clock rate conversion factor - /// B3-0 ? DI - Index into the table 8 in ISO/IEC 7816-3:1997 selecting a - /// baud rate conversion factor - unsigned char bmFindexDindex; - /// For T=0 ,B0 ? 0b, B7-2 ? 000000b - /// B1 ? Convention used (b1=0 for direct, b1=1 for inverse) - unsigned char bmTCCKST0; // 0 to 2 - /// Extra Guardtime between two characters. Add 0 to 254 etu to the normal - /// guardtime of 12etu. FFh is the same as 00h. - unsigned char bGuardTimeT0; // 0 to FF - /// WI for T=0 used to define WWT - unsigned char bWaitingIntegerT0; // 0 to FF - /// ICC Clock Stop Support - /// 00 = Stopping the Clock is not allowed - /// 01 = Stop with Clock signal Low - /// 02 = Stop with Clock signal High - /// 03 = Stop with Clock either High or Low - unsigned char bClockStop; // 0 to 3 + /// B7-4 ? FI ? Index into the table 7 in ISO/IEC 7816-3:1997 selecting a + /// clock rate conversion factor + /// B3-0 ? DI - Index into the table 8 in ISO/IEC 7816-3:1997 selecting a + /// baud rate conversion factor + unsigned char bmFindexDindex; + /// For T=0 ,B0 ? 0b, B7-2 ? 000000b + /// B1 ? Convention used (b1=0 for direct, b1=1 for inverse) + unsigned char bmTCCKST0; // 0 to 2 + /// Extra Guardtime between two characters. Add 0 to 254 etu to the normal + /// guardtime of 12etu. FFh is the same as 00h. + unsigned char bGuardTimeT0; // 0 to FF + /// WI for T=0 used to define WWT + unsigned char bWaitingIntegerT0; // 0 to FF + /// ICC Clock Stop Support + /// 00 = Stopping the Clock is not allowed + /// 01 = Stop with Clock signal Low + /// 02 = Stop with Clock signal High + /// 03 = Stop with Clock either High or Low + unsigned char bClockStop; // 0 to 3 } __attribute__ ((packed)) S_ccid_protocol_t0; /// Protocol Data Structure for Protocol T=1 (bProtocolNum=1, dwLength=00000007h) typedef struct { - /// B7-4 ? FI ? Index into the table 7 in ISO/IEC 7816-3:1997 selecting a - /// clock rate conversion factor - /// B3-0 ? DI - Index into the table 8 in ISO/IEC 7816-3:1997 selecting a - /// baud rate conversion factor - unsigned char bmFindexDindex; - /// For T=1, B7-2 ? 000100b - /// B0 ? Checksum type (b0=0 for LRC, b0=1 for CRC - /// B1 ? Convention used (b1=0 for direct, b1=1 for inverse) - unsigned char bmTCCKST1; // 10h, 11h, 12h, 13h - /// Extra Guardtime (0 to 254 etu between two characters). - /// If value is FFh, then guardtime is reduced by 1. - unsigned char bGuardTimeT1; // 0 to FF - /// B7-4 = BWI - /// B3-0 = CWI - unsigned char bmWaitingIntegersT1; // 0 to 9 - /// ICC Clock Stop Support - /// 00 = Stopping the Clock is not allowed - /// 01 = Stop with Clock signal Low - /// 02 = Stop with Clock signal High - /// 03 = Stop with Clock either High or Low - unsigned char bClockStop; // 0 to 3 - /// Size of negotiated IFSC - unsigned char bIFSC; // 0 to FE - /// Nad value used by CCID - unsigned char bNadValue; // 0 to FF + /// B7-4 ? FI ? Index into the table 7 in ISO/IEC 7816-3:1997 selecting a + /// clock rate conversion factor + /// B3-0 ? DI - Index into the table 8 in ISO/IEC 7816-3:1997 selecting a + /// baud rate conversion factor + unsigned char bmFindexDindex; + /// For T=1, B7-2 ? 000100b + /// B0 ? Checksum type (b0=0 for LRC, b0=1 for CRC + /// B1 ? Convention used (b1=0 for direct, b1=1 for inverse) + unsigned char bmTCCKST1; // 10h, 11h, 12h, 13h + /// Extra Guardtime (0 to 254 etu between two characters). + /// If value is FFh, then guardtime is reduced by 1. + unsigned char bGuardTimeT1; // 0 to FF + /// B7-4 = BWI + /// B3-0 = CWI + unsigned char bmWaitingIntegersT1; // 0 to 9 + /// ICC Clock Stop Support + /// 00 = Stopping the Clock is not allowed + /// 01 = Stop with Clock signal Low + /// 02 = Stop with Clock signal High + /// 03 = Stop with Clock either High or Low + unsigned char bClockStop; // 0 to 3 + /// Size of negotiated IFSC + unsigned char bIFSC; // 0 to FE + /// Nad value used by CCID + unsigned char bNadValue; // 0 to FF } __attribute__ ((packed)) S_ccid_protocol_t1; @@ -357,8 +357,8 @@ //------------------------------------------------------------------------------ extern unsigned char RDRtoPCHardwareError( unsigned char bSlot, - unsigned char bSeq, - unsigned char bHardwareErrorCode ); + unsigned char bSeq, + unsigned char bHardwareErrorCode ); /* #if !defined(NOAUTOCALLBACK) @@ -368,13 +368,13 @@ extern void CCID_SmartCardRequest( void ); extern void CCIDDriver_Initialize( void ); extern unsigned char CCID_Read(void *pBuffer, - unsigned int dLength, - TransferCallback fCallback, - void *pArgument); + unsigned int dLength, + TransferCallback fCallback, + void *pArgument); extern unsigned char CCID_Write(void *pBuffer, - unsigned int dLength, - TransferCallback fCallback, - void *pArgument); + unsigned int dLength, + TransferCallback fCallback, + void *pArgument); extern unsigned char CCID_Insertion( void ); extern unsigned char CCID_Removal( void ); diff --git a/firmware/libcommon/include/iso7816_4.h b/firmware/libcommon/include/iso7816_4.h index 7c371b2..e2215c7 100644 --- a/firmware/libcommon/include/iso7816_4.h +++ b/firmware/libcommon/include/iso7816_4.h @@ -76,9 +76,9 @@ extern void ISO7816_IccPowerOff(void); extern uint32_t ISO7816_XfrBlockTPDU_T0(const uint8_t *pAPDU, - uint8_t *pMessage, - uint16_t wLength, - uint16_t *retlen); + uint8_t *pMessage, + uint16_t wLength, + uint16_t *retlen); extern void ISO7816_Escape( void ); extern void ISO7816_RestartClock(void); extern void ISO7816_StopClock( void ); diff --git a/firmware/libcommon/include/simtrace.h b/firmware/libcommon/include/simtrace.h index 5edea17..0486581 100644 --- a/firmware/libcommon/include/simtrace.h +++ b/firmware/libcommon/include/simtrace.h @@ -65,19 +65,19 @@ /// device using the CCID driver. typedef struct { - /// Configuration descriptor - USBConfigurationDescriptor configuration; - /// Interface descriptor - USBInterfaceDescriptor interface; - /// CCID descriptor - CCIDDescriptor ccid; - /// Bulk OUT endpoint descriptor - USBEndpointDescriptor bulkOut; - /// Bulk IN endpoint descriptor - USBEndpointDescriptor bulkIn; - /// Interrupt OUT endpoint descriptor - USBEndpointDescriptor interruptIn; - DFURT_IF_DESCRIPTOR_STRUCT + /// Configuration descriptor + USBConfigurationDescriptor configuration; + /// Interface descriptor + USBInterfaceDescriptor interface; + /// CCID descriptor + CCIDDescriptor ccid; + /// Bulk OUT endpoint descriptor + USBEndpointDescriptor bulkOut; + /// Bulk IN endpoint descriptor + USBEndpointDescriptor bulkIn; + /// Interrupt OUT endpoint descriptor + USBEndpointDescriptor interruptIn; + DFURT_IF_DESCRIPTOR_STRUCT } __attribute__ ((packed)) CCIDDriverConfigurationDescriptors; extern const USBConfigurationDescriptor *configurationDescriptorsArr[]; diff --git a/firmware/libcommon/source/cciddriver.c b/firmware/libcommon/source/cciddriver.c index 8cf28ca..1dbdf23 100644 --- a/firmware/libcommon/source/cciddriver.c +++ b/firmware/libcommon/source/cciddriver.c @@ -83,24 +83,24 @@ /// Driver structure for an CCID device typedef struct { - /// CCID message - S_ccid_bulk_in_header sCcidMessage; - /// CCID command - S_ccid_bulk_out_header sCcidCommand; - /// Interrupt message answer - unsigned char BufferINT[4]; - /// Buffer data of message - unsigned char ProtocolDataStructure[10]; - /// Protocol used - unsigned char bProtocol; - /// SlotStatus - /// Bit 0 = Slot 0 current state - /// Bit 1 = Slot 0 changed status - /// Bit 2 = Slot 1 current state - /// Bit 3 = Slot 1 changed status - /// Bit 4 = Slot 2 current state - /// Bit 5 = Slot 2 changed status - unsigned char SlotStatus; + /// CCID message + S_ccid_bulk_in_header sCcidMessage; + /// CCID command + S_ccid_bulk_out_header sCcidCommand; + /// Interrupt message answer + unsigned char BufferINT[4]; + /// Buffer data of message + unsigned char ProtocolDataStructure[10]; + /// Protocol used + unsigned char bProtocol; + /// SlotStatus + /// Bit 0 = Slot 0 current state + /// Bit 1 = Slot 0 changed status + /// Bit 2 = Slot 1 current state + /// Bit 3 = Slot 1 changed status + /// Bit 4 = Slot 2 current state + /// Bit 5 = Slot 2 changed status + unsigned char SlotStatus; } CCIDDriver; @@ -121,7 +121,7 @@ //------------------------------------------------------------------------------ void CCIDDriver_Initialize( void ) { - configurationDescriptorsFS = (CCIDDriverConfigurationDescriptors *) configurationDescriptorsArr[CFG_NUM_CCID-1]; + configurationDescriptorsFS = (CCIDDriverConfigurationDescriptors *) configurationDescriptorsArr[CFG_NUM_CCID-1]; } //------------------------------------------------------------------------------ @@ -137,25 +137,25 @@ //------------------------------------------------------------------------------ static void RDRtoPCSlotStatus( void ) { - // Header fields settings - ccidDriver.sCcidMessage.bMessageType = RDR_TO_PC_SLOTSTATUS; - ccidDriver.sCcidMessage.wLength = 0; + // Header fields settings + ccidDriver.sCcidMessage.bMessageType = RDR_TO_PC_SLOTSTATUS; + ccidDriver.sCcidMessage.wLength = 0; - if (ccidDriver.SlotStatus == ICC_INSERTED_EVENT) { - ccidDriver.sCcidMessage.bStatus = 0; /* ICC present and active card */ - } else if (ccidDriver.SlotStatus == ICC_NOT_PRESENT) { - ccidDriver.sCcidMessage.bStatus = 2; /* No ICC present*/ - } else{ - TRACE_ERROR("Strange bStatus"); - ccidDriver.sCcidMessage.bStatus = 0; - } - ccidDriver.sCcidMessage.bError = 0; - // 00h Clock running - // 01h Clock stopped in state L - // 02h Clock stopped in state H - // 03h Clock stopped in an unknown state - // All other values are Reserved for Future Use. - ccidDriver.sCcidMessage.bSpecific = 0; + if (ccidDriver.SlotStatus == ICC_INSERTED_EVENT) { + ccidDriver.sCcidMessage.bStatus = 0; /* ICC present and active card */ + } else if (ccidDriver.SlotStatus == ICC_NOT_PRESENT) { + ccidDriver.sCcidMessage.bStatus = 2; /* No ICC present*/ + } else{ + TRACE_ERROR("Strange bStatus"); + ccidDriver.sCcidMessage.bStatus = 0; + } + ccidDriver.sCcidMessage.bError = 0; + // 00h Clock running + // 01h Clock stopped in state L + // 02h Clock stopped in state H + // 03h Clock stopped in an unknown state + // All other values are Reserved for Future Use. + ccidDriver.sCcidMessage.bSpecific = 0; } //------------------------------------------------------------------------------ @@ -164,71 +164,71 @@ //------------------------------------------------------------------------------ static void RDRtoPCDatablock_ATR( void ) { - unsigned char i; - unsigned char Atr[ATR_SIZE_MAX]; - unsigned char length; - uint32_t status; + unsigned char i; + unsigned char Atr[ATR_SIZE_MAX]; + unsigned char length; + uint32_t status; - TRACE_DEBUG("."); + TRACE_DEBUG("."); - status = ISO7816_Datablock_ATR( Atr, &length ); - ISO7816_Decode_ATR( Atr ); + status = ISO7816_Datablock_ATR( Atr, &length ); + ISO7816_Decode_ATR( Atr ); - if (status == 0) { - TRACE_DEBUG("Timeout occured while reading ATR"); + if (status == 0) { + TRACE_DEBUG("Timeout occured while reading ATR"); // FIXME: react properly to timeout.. // return; - } + } // FIXME: More tests? Is bProtocol = Atr[3] ? - if( length > 5 ) { - ccidDriver.ProtocolDataStructure[1] = Atr[3]&0x0F; // TD(1) - ccidDriver.bProtocol = Atr[3]&0x0F; // TD(1) - TRACE_INFO("Protocol data structure: 0x%x\n\r", - ccidDriver.ProtocolDataStructure[1]); - } + if( length > 5 ) { + ccidDriver.ProtocolDataStructure[1] = Atr[3]&0x0F; // TD(1) + ccidDriver.bProtocol = Atr[3]&0x0F; // TD(1) + TRACE_INFO("Protocol data structure: 0x%x\n\r", + ccidDriver.ProtocolDataStructure[1]); + } - // S_ccid_protocol_t0 - // bmFindexDindex - ccidDriver.ProtocolDataStructure[0] = Atr[2]; // TA(1) + // S_ccid_protocol_t0 + // bmFindexDindex + ccidDriver.ProtocolDataStructure[0] = Atr[2]; // TA(1) - // bmTCCKST0 - // For T=0 ,B0 ? 0b, B7-2 ? 000000b - // B1 ? Convention used (b1=0 for direct, b1=1 for inverse) + // bmTCCKST0 + // For T=0 ,B0 ? 0b, B7-2 ? 000000b + // B1 ? Convention used (b1=0 for direct, b1=1 for inverse) - // bGuardTimeT0 - // Extra Guardtime between two characters. Add 0 to 254 etu to the normal - // guardtime of 12etu. FFh is the same as 00h. - ccidDriver.ProtocolDataStructure[2] = Atr[4]; // TC(1) - // AT91C_BASE_US0->US_TTGR = 0; // TC1 + // bGuardTimeT0 + // Extra Guardtime between two characters. Add 0 to 254 etu to the normal + // guardtime of 12etu. FFh is the same as 00h. + ccidDriver.ProtocolDataStructure[2] = Atr[4]; // TC(1) + // AT91C_BASE_US0->US_TTGR = 0; // TC1 - // bWaitingIntegerT0 - // WI for T=0 used to define WWT - ccidDriver.ProtocolDataStructure[3] = Atr[7]; // TC(2) + // bWaitingIntegerT0 + // WI for T=0 used to define WWT + ccidDriver.ProtocolDataStructure[3] = Atr[7]; // TC(2) - // bClockStop - // ICC Clock Stop Support - // 00 = Stopping the Clock is not allowed - // 01 = Stop with Clock signal Low - // 02 = Stop with Clock signal High - // 03 = Stop with Clock either High or Low - ccidDriver.ProtocolDataStructure[4] = 0x00; // 0 to 3 + // bClockStop + // ICC Clock Stop Support + // 00 = Stopping the Clock is not allowed + // 01 = Stop with Clock signal Low + // 02 = Stop with Clock signal High + // 03 = Stop with Clock either High or Low + ccidDriver.ProtocolDataStructure[4] = 0x00; // 0 to 3 - // Header fields settings - ccidDriver.sCcidMessage.bMessageType = RDR_TO_PC_DATABLOCK; - ccidDriver.sCcidMessage.wLength = length; // Size of ATR - ccidDriver.sCcidMessage.bSizeToSend += length; // Size of ATR - // bChainParameter: 00 the response APDU begins and ends in this command - ccidDriver.sCcidMessage.bSpecific = 0; + // Header fields settings + ccidDriver.sCcidMessage.bMessageType = RDR_TO_PC_DATABLOCK; + ccidDriver.sCcidMessage.wLength = length; // Size of ATR + ccidDriver.sCcidMessage.bSizeToSend += length; // Size of ATR + // bChainParameter: 00 the response APDU begins and ends in this command + ccidDriver.sCcidMessage.bSpecific = 0; - for( i=0; iccid.dwFeatures & CCID_FEATURES_AUTO_VOLT) ) { + TRACE_DEBUG("."); + if( CCID_FEATURES_AUTO_VOLT == (configurationDescriptorsFS->ccid.dwFeatures & CCID_FEATURES_AUTO_VOLT) ) { - //bPowerSelect = ccidDriver.sCcidCommand.bSpecific_0; - ccidDriver.sCcidCommand.bSpecific_0 = VOLTS_AUTO; - } + //bPowerSelect = ccidDriver.sCcidCommand.bSpecific_0; + ccidDriver.sCcidCommand.bSpecific_0 = VOLTS_AUTO; + } - ISO7816_warm_reset(); + ISO7816_warm_reset(); // ISO7816_cold_reset(); - // for emulation only //JCB - if ( ccidDriver.sCcidCommand.bSpecific_0 != VOLTS_5_0 ) { + // for emulation only //JCB + if ( ccidDriver.sCcidCommand.bSpecific_0 != VOLTS_5_0 ) { - TRACE_ERROR("POWER_NOT_SUPPORTED\n\r"); - } + TRACE_ERROR("POWER_NOT_SUPPORTED\n\r"); + } - else { + else { - RDRtoPCDatablock_ATR(); + RDRtoPCDatablock_ATR(); - } + } } //------------------------------------------------------------------------------ @@ -384,23 +384,23 @@ //------------------------------------------------------------------------------ static void PCtoRDRIccPowerOff( void ) { - unsigned char bStatus; + unsigned char bStatus; - TRACE_DEBUG("."); + TRACE_DEBUG("."); - ISO7816_IccPowerOff(); + ISO7816_IccPowerOff(); - //JCB stub - bStatus = ICC_BS_PRESENT_NOTACTIVATED; + //JCB stub + bStatus = ICC_BS_PRESENT_NOTACTIVATED; - // Set the slot to an inactive status - ccidDriver.sCcidMessage.bStatus = 0; - ccidDriver.sCcidMessage.bError = 0; + // Set the slot to an inactive status + ccidDriver.sCcidMessage.bStatus = 0; + ccidDriver.sCcidMessage.bError = 0; - // if error, see Table 6.1-2 errors + // if error, see Table 6.1-2 errors - // Return the slot status to the host - RDRtoPCSlotStatus(); + // Return the slot status to the host + RDRtoPCSlotStatus(); } //------------------------------------------------------------------------------ @@ -409,13 +409,13 @@ //------------------------------------------------------------------------------ static void PCtoRDRGetSlotStatus( void ) { - TRACE_DEBUG("."); + TRACE_DEBUG("."); - ccidDriver.sCcidMessage.bStatus = 0; - ccidDriver.sCcidMessage.bError = 0; + ccidDriver.sCcidMessage.bStatus = 0; + ccidDriver.sCcidMessage.bError = 0; - // Return the slot status to the host - RDRtoPCSlotStatus(); + // Return the slot status to the host + RDRtoPCSlotStatus(); } //------------------------------------------------------------------------------ @@ -425,69 +425,69 @@ //------------------------------------------------------------------------------ static void PCtoRDRXfrBlock( void ) { - uint16_t msglen = 0; - uint32_t ret; + uint16_t msglen = 0; + uint32_t ret; - TRACE_DEBUG("PCtoRDRXfrBlock\n"); + TRACE_DEBUG("PCtoRDRXfrBlock\n"); - // Check the block length - if ( ccidDriver.sCcidCommand.wLength > (configurationDescriptorsFS->ccid.dwMaxCCIDMessageLength-10) ) { - TRACE_DEBUG("Err block/msg len"); - ccidDriver.sCcidMessage.bStatus = 1; - ccidDriver.sCcidMessage.bError = 0; - } - // check bBWI - else if ( 0 != ccidDriver.sCcidCommand.bSpecific_0 ) { + // Check the block length + if ( ccidDriver.sCcidCommand.wLength > (configurationDescriptorsFS->ccid.dwMaxCCIDMessageLength-10) ) { + TRACE_DEBUG("Err block/msg len"); + ccidDriver.sCcidMessage.bStatus = 1; + ccidDriver.sCcidMessage.bError = 0; + } + // check bBWI + else if ( 0 != ccidDriver.sCcidCommand.bSpecific_0 ) { - TRACE_ERROR("Bad bBWI\n\r"); - } - else { + TRACE_ERROR("Bad bBWI\n\r"); + } + else { - // APDU or TPDU - switch(configurationDescriptorsFS->ccid.dwFeatures - & (CCID_FEATURES_EXC_TPDU|CCID_FEATURES_EXC_SAPDU|CCID_FEATURES_EXC_APDU)) { + // APDU or TPDU + switch(configurationDescriptorsFS->ccid.dwFeatures + & (CCID_FEATURES_EXC_TPDU|CCID_FEATURES_EXC_SAPDU|CCID_FEATURES_EXC_APDU)) { - case CCID_FEATURES_EXC_TPDU: - if (ccidDriver.ProtocolDataStructure[1] == PROTOCOL_TO) { - TRACE_DEBUG("APDU cmd: %x %x %x ..", ccidDriver.sCcidCommand.APDU[0], ccidDriver.sCcidCommand.APDU[1],ccidDriver.sCcidCommand.APDU[2] ); + case CCID_FEATURES_EXC_TPDU: + if (ccidDriver.ProtocolDataStructure[1] == PROTOCOL_TO) { + TRACE_DEBUG("APDU cmd: %x %x %x ..", ccidDriver.sCcidCommand.APDU[0], ccidDriver.sCcidCommand.APDU[1],ccidDriver.sCcidCommand.APDU[2] ); - // Send commande APDU - ret = ISO7816_XfrBlockTPDU_T0( ccidDriver.sCcidCommand.APDU , - ccidDriver.sCcidMessage.abData, - ccidDriver.sCcidCommand.wLength, - &msglen ); - if (ret != 0) { - TRACE_ERROR("APDU could not be sent: (US_CSR = 0x%x)", ret); - return; - } - } - else { - if (ccidDriver.ProtocolDataStructure[1] == PROTOCOL_T1) { - TRACE_DEBUG("Not supported T=1\n\r"); - } - else { - TRACE_DEBUG("Not supported 0x%x\n\r", ccidDriver.ProtocolDataStructure[1]); - } - } - break; + // Send commande APDU + ret = ISO7816_XfrBlockTPDU_T0( ccidDriver.sCcidCommand.APDU , + ccidDriver.sCcidMessage.abData, + ccidDriver.sCcidCommand.wLength, + &msglen ); + if (ret != 0) { + TRACE_ERROR("APDU could not be sent: (US_CSR = 0x%x)", ret); + return; + } + } + else { + if (ccidDriver.ProtocolDataStructure[1] == PROTOCOL_T1) { + TRACE_DEBUG("Not supported T=1\n\r"); + } + else { + TRACE_DEBUG("Not supported 0x%x\n\r", ccidDriver.ProtocolDataStructure[1]); + } + } + break; - case CCID_FEATURES_EXC_APDU: - TRACE_DEBUG("Not supported CCID_FEATURES_EXC_APDU\n\r"); - break; + case CCID_FEATURES_EXC_APDU: + TRACE_DEBUG("Not supported CCID_FEATURES_EXC_APDU\n\r"); + break; - default: - break; - } + default: + break; + } - } + } - ccidDriver.sCcidMessage.wLength = msglen; - TRACE_DEBUG("USB: 0x%X, 0x%X, 0x%X, 0x%X, 0x%X\n\r", ccidDriver.sCcidMessage.abData[0], - ccidDriver.sCcidMessage.abData[1], - ccidDriver.sCcidMessage.abData[2], - ccidDriver.sCcidMessage.abData[3], - ccidDriver.sCcidMessage.abData[4] ); - RDRtoPCDatablock(); + ccidDriver.sCcidMessage.wLength = msglen; + TRACE_DEBUG("USB: 0x%X, 0x%X, 0x%X, 0x%X, 0x%X\n\r", ccidDriver.sCcidMessage.abData[0], + ccidDriver.sCcidMessage.abData[1], + ccidDriver.sCcidMessage.abData[2], + ccidDriver.sCcidMessage.abData[3], + ccidDriver.sCcidMessage.abData[4] ); + RDRtoPCDatablock(); } @@ -497,21 +497,21 @@ //------------------------------------------------------------------------------ static void PCtoRDRGetParameters( void ) { - TRACE_DEBUG("."); + TRACE_DEBUG("."); - // We support only one slot + // We support only one slot - // bmIccStatus - if( ISO7816_StatusReset() ) { - // 0: An ICC is present and active (power is on and stable, RST is inactive - ccidDriver.sCcidMessage.bStatus = 0; - } - else { - // 1: An ICC is present and inactive (not activated or shut down by hardware error) - ccidDriver.sCcidMessage.bStatus = 1; - } + // bmIccStatus + if( ISO7816_StatusReset() ) { + // 0: An ICC is present and active (power is on and stable, RST is inactive + ccidDriver.sCcidMessage.bStatus = 0; + } + else { + // 1: An ICC is present and inactive (not activated or shut down by hardware error) + ccidDriver.sCcidMessage.bStatus = 1; + } - RDRtoPCParameters(); + RDRtoPCParameters(); } //------------------------------------------------------------------------------ @@ -520,12 +520,12 @@ //------------------------------------------------------------------------------ static void PCtoRDRResetParameters( void ) { - TRACE_DEBUG("."); + TRACE_DEBUG("."); - ccidDriver.SlotStatus = ICC_NOT_PRESENT; - ccidDriver.sCcidMessage.bStatus = ccidDriver.SlotStatus; + ccidDriver.SlotStatus = ICC_NOT_PRESENT; + ccidDriver.sCcidMessage.bStatus = ccidDriver.SlotStatus; - RDRtoPCParameters(); + RDRtoPCParameters(); } //------------------------------------------------------------------------------ @@ -534,13 +534,13 @@ //------------------------------------------------------------------------------ static void PCtoRDRSetParameters( void ) { - TRACE_DEBUG("."); + TRACE_DEBUG("."); - ccidDriver.SlotStatus = ccidDriver.sCcidCommand.bSlot; - ccidDriver.sCcidMessage.bStatus = ccidDriver.SlotStatus; - // Not all feature supported + ccidDriver.SlotStatus = ccidDriver.sCcidCommand.bSlot; + ccidDriver.sCcidMessage.bStatus = ccidDriver.SlotStatus; + // Not all feature supported - RDRtoPCParameters(); + RDRtoPCParameters(); } //------------------------------------------------------------------------------ @@ -551,13 +551,13 @@ //------------------------------------------------------------------------------ static void PCtoRDREscape( void ) { - TRACE_DEBUG("."); + TRACE_DEBUG("."); - // If needed by the user - ISO7816_Escape(); + // If needed by the user + ISO7816_Escape(); - // stub, return all value send - RDRtoPCEscape( ccidDriver.sCcidCommand.wLength, ccidDriver.sCcidCommand.APDU); + // stub, return all value send + RDRtoPCEscape( ccidDriver.sCcidCommand.wLength, ccidDriver.sCcidCommand.APDU); } //------------------------------------------------------------------------------ @@ -566,18 +566,18 @@ //------------------------------------------------------------------------------ static void PCtoRDRICCClock( void ) { - TRACE_DEBUG("."); + TRACE_DEBUG("."); - if( 0 == ccidDriver.sCcidCommand.bSpecific_0 ) { - // restarts the clock - ISO7816_RestartClock(); - } - else { - // stop clock in the state shown in the bClockStop field - ISO7816_StopClock(); - } + if( 0 == ccidDriver.sCcidCommand.bSpecific_0 ) { + // restarts the clock + ISO7816_RestartClock(); + } + else { + // stop clock in the state shown in the bClockStop field + ISO7816_StopClock(); + } - RDRtoPCSlotStatus( ); + RDRtoPCSlotStatus( ); } //------------------------------------------------------------------------------ @@ -587,22 +587,22 @@ //------------------------------------------------------------------------------ static void PCtoRDRtoAPDU( void ) { - unsigned char bmChanges; - unsigned char bClassGetResponse; - unsigned char bClassEnvelope; + unsigned char bmChanges; + unsigned char bClassGetResponse; + unsigned char bClassEnvelope; - TRACE_INFO("."); + TRACE_INFO("."); - if( configurationDescriptorsFS->ccid.dwFeatures == (CCID_FEATURES_EXC_SAPDU|CCID_FEATURES_EXC_APDU) ) { + if( configurationDescriptorsFS->ccid.dwFeatures == (CCID_FEATURES_EXC_SAPDU|CCID_FEATURES_EXC_APDU) ) { - bmChanges = ccidDriver.sCcidCommand.bSpecific_0; - bClassGetResponse = ccidDriver.sCcidCommand.bSpecific_1; - bClassEnvelope = ccidDriver.sCcidCommand.bSpecific_2; + bmChanges = ccidDriver.sCcidCommand.bSpecific_0; + bClassGetResponse = ccidDriver.sCcidCommand.bSpecific_1; + bClassEnvelope = ccidDriver.sCcidCommand.bSpecific_2; - ISO7816_toAPDU(); - } + ISO7816_toAPDU(); + } - RDRtoPCSlotStatus(); + RDRtoPCSlotStatus(); } //------------------------------------------------------------------------------ @@ -612,9 +612,9 @@ //------------------------------------------------------------------------------ static void PCtoRDRSecure( void ) { - TRACE_DEBUG("."); + TRACE_DEBUG("."); - TRACE_DEBUG("For user\n\r"); + TRACE_DEBUG("For user\n\r"); } //------------------------------------------------------------------------------ @@ -627,10 +627,10 @@ //------------------------------------------------------------------------------ static void PCtoRDRMechanical( void ) { - TRACE_DEBUG("."); - TRACE_DEBUG("Not implemented\n\r"); + TRACE_DEBUG("."); + TRACE_DEBUG("Not implemented\n\r"); - RDRtoPCSlotStatus(); + RDRtoPCSlotStatus(); } //------------------------------------------------------------------------------ @@ -641,9 +641,9 @@ //------------------------------------------------------------------------------ static void PCtoRDRAbort( void ) { - TRACE_DEBUG("."); + TRACE_DEBUG("."); - RDRtoPCSlotStatus(); + RDRtoPCSlotStatus(); } //------------------------------------------------------------------------------ @@ -653,24 +653,24 @@ //------------------------------------------------------------------------------ static void PCtoRDRSetDataRateAndClockFrequency( void ) { - unsigned int dwClockFrequency; - unsigned int dwDataRate; + unsigned int dwClockFrequency; + unsigned int dwDataRate; - TRACE_DEBUG("."); + TRACE_DEBUG("."); - dwClockFrequency = ccidDriver.sCcidCommand.APDU[0] - + (ccidDriver.sCcidCommand.APDU[1]<<8) - + (ccidDriver.sCcidCommand.APDU[2]<<16) - + (ccidDriver.sCcidCommand.APDU[3]<<24); + dwClockFrequency = ccidDriver.sCcidCommand.APDU[0] + + (ccidDriver.sCcidCommand.APDU[1]<<8) + + (ccidDriver.sCcidCommand.APDU[2]<<16) + + (ccidDriver.sCcidCommand.APDU[3]<<24); - dwDataRate = ccidDriver.sCcidCommand.APDU[4] - + (ccidDriver.sCcidCommand.APDU[5]<<8) - + (ccidDriver.sCcidCommand.APDU[6]<<16) - + (ccidDriver.sCcidCommand.APDU[7]<<24); + dwDataRate = ccidDriver.sCcidCommand.APDU[4] + + (ccidDriver.sCcidCommand.APDU[5]<<8) + + (ccidDriver.sCcidCommand.APDU[6]<<16) + + (ccidDriver.sCcidCommand.APDU[7]<<24); - ISO7816_SetDataRateandClockFrequency( dwClockFrequency, dwDataRate ); + ISO7816_SetDataRateandClockFrequency( dwClockFrequency, dwDataRate ); - RDRtoPCDataRateAndClockFrequency( dwClockFrequency, dwDataRate ); + RDRtoPCDataRateAndClockFrequency( dwClockFrequency, dwDataRate ); } @@ -679,20 +679,20 @@ //------------------------------------------------------------------------------ static void vCCIDCommandNotSupported( void ) { - // Command not supported - // vCCIDReportError(CMD_NOT_SUPPORTED); + // Command not supported + // vCCIDReportError(CMD_NOT_SUPPORTED); - TRACE_DEBUG("CMD_NOT_SUPPORTED\n\r"); + TRACE_DEBUG("CMD_NOT_SUPPORTED\n\r"); - // Header fields settings - ccidDriver.sCcidMessage.bMessageType = RDR_TO_PC_SLOTSTATUS; - ccidDriver.sCcidMessage.wLength = 0; - ccidDriver.sCcidMessage.bSpecific = 0; + // Header fields settings + ccidDriver.sCcidMessage.bMessageType = RDR_TO_PC_SLOTSTATUS; + ccidDriver.sCcidMessage.wLength = 0; + ccidDriver.sCcidMessage.bSpecific = 0; - ccidDriver.sCcidMessage.bStatus |= ICC_CS_FAILED; + ccidDriver.sCcidMessage.bStatus |= ICC_CS_FAILED; - // Send the response to the host - //vCCIDSendResponse(); + // Send the response to the host + //vCCIDSendResponse(); } //------------------------------------------------------------------------------ @@ -700,15 +700,15 @@ //------------------------------------------------------------------------------ static void vCCIDSendResponse( void ) { - unsigned char bStatus; - TRACE_DEBUG("."); + unsigned char bStatus; + TRACE_DEBUG("."); - do { - bStatus = CCID_Write((void*)&ccidDriver.sCcidMessage, - ccidDriver.sCcidMessage.bSizeToSend, 0, 0 ); - } while (bStatus != USBD_STATUS_SUCCESS); + do { + bStatus = CCID_Write((void*)&ccidDriver.sCcidMessage, + ccidDriver.sCcidMessage.bSizeToSend, 0, 0 ); + } while (bStatus != USBD_STATUS_SUCCESS); - TRACE_DEBUG("bStatus: 0x%x\n\r", bStatus); + TRACE_DEBUG("bStatus: 0x%x\n\r", bStatus); } @@ -717,133 +717,133 @@ //------------------------------------------------------------------------------ static void CCIDCommandDispatcher( void *pArg, uint8_t status, uint32_t transferred, uint32_t remaining ) { - unsigned char MessageToSend = 0; + unsigned char MessageToSend = 0; - if (status != USBD_STATUS_SUCCESS) { - TRACE_ERROR("USB error: %d", status); - return; - } - TRACE_DEBUG("Command: 0x%X 0x%x 0x%X 0x%X 0x%X 0x%X 0x%X\n\r\n\r", - (unsigned int)ccidDriver.sCcidCommand.bMessageType, - (unsigned int)ccidDriver.sCcidCommand.wLength, - (unsigned int)ccidDriver.sCcidCommand.bSlot, - (unsigned int)ccidDriver.sCcidCommand.bSeq, - (unsigned int)ccidDriver.sCcidCommand.bSpecific_0, - (unsigned int)ccidDriver.sCcidCommand.bSpecific_1, - (unsigned int)ccidDriver.sCcidCommand.bSpecific_2); + if (status != USBD_STATUS_SUCCESS) { + TRACE_ERROR("USB error: %d", status); + return; + } + TRACE_DEBUG("Command: 0x%X 0x%x 0x%X 0x%X 0x%X 0x%X 0x%X\n\r\n\r", + (unsigned int)ccidDriver.sCcidCommand.bMessageType, + (unsigned int)ccidDriver.sCcidCommand.wLength, + (unsigned int)ccidDriver.sCcidCommand.bSlot, + (unsigned int)ccidDriver.sCcidCommand.bSeq, + (unsigned int)ccidDriver.sCcidCommand.bSpecific_0, + (unsigned int)ccidDriver.sCcidCommand.bSpecific_1, + (unsigned int)ccidDriver.sCcidCommand.bSpecific_2); - // Check the slot number - if ( ccidDriver.sCcidCommand.bSlot > 0 ) { + // Check the slot number + if ( ccidDriver.sCcidCommand.bSlot > 0 ) { - TRACE_ERROR("BAD_SLOT_NUMBER\n\r"); - } + TRACE_ERROR("BAD_SLOT_NUMBER\n\r"); + } - TRACE_INFO("typ=0x%X\n\r", ccidDriver.sCcidCommand.bMessageType); + TRACE_INFO("typ=0x%X\n\r", ccidDriver.sCcidCommand.bMessageType); - ccidDriver.sCcidMessage.bStatus = 0; + ccidDriver.sCcidMessage.bStatus = 0; - ccidDriver.sCcidMessage.bSeq = ccidDriver.sCcidCommand.bSeq; - ccidDriver.sCcidMessage.bSlot = ccidDriver.sCcidCommand.bSlot; + ccidDriver.sCcidMessage.bSeq = ccidDriver.sCcidCommand.bSeq; + ccidDriver.sCcidMessage.bSlot = ccidDriver.sCcidCommand.bSlot; - ccidDriver.sCcidMessage.bSizeToSend = sizeof(S_ccid_bulk_in_header)-(ABDATA_SIZE+1); + ccidDriver.sCcidMessage.bSizeToSend = sizeof(S_ccid_bulk_in_header)-(ABDATA_SIZE+1); - // Command dispatcher - switch ( ccidDriver.sCcidCommand.bMessageType ) { + // Command dispatcher + switch ( ccidDriver.sCcidCommand.bMessageType ) { - case PC_TO_RDR_ICCPOWERON: - PCtoRDRIccPowerOn(); - MessageToSend = 1; - break; + case PC_TO_RDR_ICCPOWERON: + PCtoRDRIccPowerOn(); + MessageToSend = 1; + break; - case PC_TO_RDR_ICCPOWEROFF: - PCtoRDRIccPowerOff(); - MessageToSend = 1; - break; + case PC_TO_RDR_ICCPOWEROFF: + PCtoRDRIccPowerOff(); + MessageToSend = 1; + break; - case PC_TO_RDR_GETSLOTSTATUS: - PCtoRDRGetSlotStatus(); - MessageToSend = 1; - break; + case PC_TO_RDR_GETSLOTSTATUS: + PCtoRDRGetSlotStatus(); + MessageToSend = 1; + break; - case PC_TO_RDR_XFRBLOCK: - PCtoRDRXfrBlock(); - MessageToSend = 1; - break; + case PC_TO_RDR_XFRBLOCK: + PCtoRDRXfrBlock(); + MessageToSend = 1; + break; - case PC_TO_RDR_GETPARAMETERS: - PCtoRDRGetParameters(); - MessageToSend = 1; - break; + case PC_TO_RDR_GETPARAMETERS: + PCtoRDRGetParameters(); + MessageToSend = 1; + break; - case PC_TO_RDR_RESETPARAMETERS: - PCtoRDRResetParameters(); - MessageToSend = 1; - break; + case PC_TO_RDR_RESETPARAMETERS: + PCtoRDRResetParameters(); + MessageToSend = 1; + break; - case PC_TO_RDR_SETPARAMETERS: - PCtoRDRSetParameters(); - MessageToSend = 1; - break; + case PC_TO_RDR_SETPARAMETERS: + PCtoRDRSetParameters(); + MessageToSend = 1; + break; - case PC_TO_RDR_ESCAPE: - PCtoRDREscape(); - MessageToSend = 1; - break; + case PC_TO_RDR_ESCAPE: + PCtoRDREscape(); + MessageToSend = 1; + break; - case PC_TO_RDR_ICCCLOCK: - PCtoRDRICCClock(); - MessageToSend = 1; - break; + case PC_TO_RDR_ICCCLOCK: + PCtoRDRICCClock(); + MessageToSend = 1; + break; - case PC_TO_RDR_T0APDU: - // Only CCIDs reporting a short or extended APDU level in the dwFeatures - // field of the CCID class descriptor may take this command into account. - if( (CCID_FEATURES_EXC_SAPDU == (CCID_FEATURES_EXC_SAPDU&configurationDescriptorsFS->ccid.dwFeatures)) - || (CCID_FEATURES_EXC_APDU == (CCID_FEATURES_EXC_APDU &configurationDescriptorsFS->ccid.dwFeatures)) ) { + case PC_TO_RDR_T0APDU: + // Only CCIDs reporting a short or extended APDU level in the dwFeatures + // field of the CCID class descriptor may take this command into account. + if( (CCID_FEATURES_EXC_SAPDU == (CCID_FEATURES_EXC_SAPDU&configurationDescriptorsFS->ccid.dwFeatures)) + || (CCID_FEATURES_EXC_APDU == (CCID_FEATURES_EXC_APDU &configurationDescriptorsFS->ccid.dwFeatures)) ) { - // command supported - PCtoRDRtoAPDU(); - } - else { - // command not supported - TRACE_INFO("Not supported: PC_TO_RDR_T0APDU\n\r"); - vCCIDCommandNotSupported(); - } - MessageToSend = 1; - break; + // command supported + PCtoRDRtoAPDU(); + } + else { + // command not supported + TRACE_INFO("Not supported: PC_TO_RDR_T0APDU\n\r"); + vCCIDCommandNotSupported(); + } + MessageToSend = 1; + break; - case PC_TO_RDR_SECURE: - PCtoRDRSecure(); - MessageToSend = 1; - break; + case PC_TO_RDR_SECURE: + PCtoRDRSecure(); + MessageToSend = 1; + break; - case PC_TO_RDR_MECHANICAL: - PCtoRDRMechanical(); - MessageToSend = 1; - break; + case PC_TO_RDR_MECHANICAL: + PCtoRDRMechanical(); + MessageToSend = 1; + break; - case PC_TO_RDR_ABORT: - PCtoRDRAbort(); - MessageToSend = 1; - break; + case PC_TO_RDR_ABORT: + PCtoRDRAbort(); + MessageToSend = 1; + break; - case PC_TO_RDR_SETDATARATEANDCLOCKFREQUENCY: - PCtoRDRSetDataRateAndClockFrequency(); - MessageToSend = 1; - break; + case PC_TO_RDR_SETDATARATEANDCLOCKFREQUENCY: + PCtoRDRSetDataRateAndClockFrequency(); + MessageToSend = 1; + break; - default: - TRACE_DEBUG("default: Not supported: 0x%X\n\r", ccidDriver.sCcidCommand.bMessageType); - vCCIDCommandNotSupported(); - MessageToSend = 1; - break; + default: + TRACE_DEBUG("default: Not supported: 0x%X\n\r", ccidDriver.sCcidCommand.bMessageType); + vCCIDCommandNotSupported(); + MessageToSend = 1; + break; - } + } - if( MessageToSend == 1 ) { - vCCIDSendResponse(); - } + if( MessageToSend == 1 ) { + vCCIDSendResponse(); + } } @@ -853,49 +853,49 @@ //------------------------------------------------------------------------------ static void CCID_RequestHandler(const USBGenericRequest *pRequest) { - TRACE_DEBUG("CCID_RHl\n\r"); + TRACE_DEBUG("CCID_RHl\n\r"); - // Check if this is a class request - if (USBGenericRequest_GetType(pRequest) == USBGenericRequest_CLASS) { + // Check if this is a class request + if (USBGenericRequest_GetType(pRequest) == USBGenericRequest_CLASS) { - // Check if the request is supported - switch (USBGenericRequest_GetRequest(pRequest)) { + // Check if the request is supported + switch (USBGenericRequest_GetRequest(pRequest)) { - case CCIDGenericRequest_ABORT: - TRACE_DEBUG("CCIDGenericRequest_ABORT\n\r"); - break; + case CCIDGenericRequest_ABORT: + TRACE_DEBUG("CCIDGenericRequest_ABORT\n\r"); + break; - case CCIDGenericRequest_GET_CLOCK_FREQUENCIES: - TRACE_DEBUG("Not supported: CCIDGenericRequest_GET_CLOCK_FREQUENCIES\n\r"); - // A CCID with bNumClockSupported equal to 00h does not have - // to support this request - break; + case CCIDGenericRequest_GET_CLOCK_FREQUENCIES: + TRACE_DEBUG("Not supported: CCIDGenericRequest_GET_CLOCK_FREQUENCIES\n\r"); + // A CCID with bNumClockSupported equal to 00h does not have + // to support this request + break; - case CCIDGenericRequest_GET_DATA_RATES: - TRACE_DEBUG("Not supported: CCIDGenericRequest_GET_DATA_RATES\n\r"); - // A CCID with bNumDataRatesSupported equal to 00h does not have - // to support this request. - break; + case CCIDGenericRequest_GET_DATA_RATES: + TRACE_DEBUG("Not supported: CCIDGenericRequest_GET_DATA_RATES\n\r"); + // A CCID with bNumDataRatesSupported equal to 00h does not have + // to support this request. + break; - default: - TRACE_WARNING( "CCIDDriver_RequestHandler: Unsupported request (%d)\n\r", - USBGenericRequest_GetRequest(pRequest)); - USBD_Stall(0); - } - } + default: + TRACE_WARNING( "CCIDDriver_RequestHandler: Unsupported request (%d)\n\r", + USBGenericRequest_GetRequest(pRequest)); + USBD_Stall(0); + } + } - else if (USBGenericRequest_GetType(pRequest) == USBGenericRequest_STANDARD) { + else if (USBGenericRequest_GetType(pRequest) == USBGenericRequest_STANDARD) { - // Forward request to the standard handler - USBDDriver_RequestHandler(USBD_GetDriver(), pRequest); - } - else { + // Forward request to the standard handler + USBDDriver_RequestHandler(USBD_GetDriver(), pRequest); + } + else { - // Unsupported request type - TRACE_WARNING( "CCIDDriver_RequestHandler: Unsupported request type (%d)\n\r", - USBGenericRequest_GetType(pRequest)); - USBD_Stall(0); - } + // Unsupported request type + TRACE_WARNING( "CCIDDriver_RequestHandler: Unsupported request type (%d)\n\r", + USBGenericRequest_GetType(pRequest)); + USBD_Stall(0); + } } @@ -910,7 +910,7 @@ // not static function void USBDCallbacks_RequestReceived(const USBGenericRequest *request) { - CCID_RequestHandler(request); + CCID_RequestHandler(request); } #endif @@ -920,17 +920,17 @@ //------------------------------------------------------------------------------ void CCID_SmartCardRequest( void ) { - unsigned char bStatus; - TRACE_DEBUG("CCID_req\n"); + unsigned char bStatus; + TRACE_DEBUG("CCID_req\n"); - do { + do { - bStatus = CCID_Read( (void*)&ccidDriver.sCcidCommand, - sizeof(S_ccid_bulk_out_header), - (TransferCallback)&CCIDCommandDispatcher, - (void*)0 ); - } - while (0); + bStatus = CCID_Read( (void*)&ccidDriver.sCcidCommand, + sizeof(S_ccid_bulk_out_header), + (TransferCallback)&CCIDCommandDispatcher, + (void*)0 ); + } + while (0); } @@ -943,11 +943,11 @@ /// \return USBD_STATUS_LOCKED or USBD_STATUS_SUCCESS //------------------------------------------------------------------------------ unsigned char CCID_Read(void *pBuffer, - unsigned int dLength, - TransferCallback fCallback, - void *pArgument) + unsigned int dLength, + TransferCallback fCallback, + void *pArgument) { - return USBD_Read(CCID_EPT_DATA_OUT, pBuffer, dLength, fCallback, pArgument); + return USBD_Read(CCID_EPT_DATA_OUT, pBuffer, dLength, fCallback, pArgument); } //------------------------------------------------------------------------------ @@ -959,11 +959,11 @@ /// \return USBD_STATUS_LOCKED or USBD_STATUS_SUCCESS //------------------------------------------------------------------------------ unsigned char CCID_Write(void *pBuffer, - unsigned int dLength, - TransferCallback fCallback, - void *pArgument) + unsigned int dLength, + TransferCallback fCallback, + void *pArgument) { - return USBD_Write(CCID_EPT_DATA_IN, pBuffer, dLength, fCallback, pArgument); + return USBD_Write(CCID_EPT_DATA_IN, pBuffer, dLength, fCallback, pArgument); } //------------------------------------------------------------------------------ @@ -973,15 +973,15 @@ //------------------------------------------------------------------------------ unsigned char CCID_Insertion( void ) { - TRACE_DEBUG("."); + TRACE_DEBUG("."); - // Build the Interrupt-IN message - ccidDriver.BufferINT[0] = RDR_TO_PC_NOTIFYSLOTCHANGE; - ccidDriver.BufferINT[1] = ICC_INSERTED_EVENT; - ccidDriver.SlotStatus = ICC_INSERTED_EVENT; + // Build the Interrupt-IN message + ccidDriver.BufferINT[0] = RDR_TO_PC_NOTIFYSLOTCHANGE; + ccidDriver.BufferINT[1] = ICC_INSERTED_EVENT; + ccidDriver.SlotStatus = ICC_INSERTED_EVENT; - // Notify the host that a ICC is inserted - return USBD_Write( CCID_EPT_NOTIFICATION, ccidDriver.BufferINT, 2, 0, 0 ); + // Notify the host that a ICC is inserted + return USBD_Write( CCID_EPT_NOTIFICATION, ccidDriver.BufferINT, 2, 0, 0 ); } //------------------------------------------------------------------------------ @@ -991,15 +991,15 @@ //------------------------------------------------------------------------------ unsigned char CCID_Removal( void ) { - TRACE_DEBUG("."); + TRACE_DEBUG("."); - // Build the Interrupt-IN message - ccidDriver.BufferINT[0] = RDR_TO_PC_NOTIFYSLOTCHANGE; - ccidDriver.BufferINT[1] = ICC_NOT_PRESENT; - ccidDriver.SlotStatus = ICC_NOT_PRESENT; + // Build the Interrupt-IN message + ccidDriver.BufferINT[0] = RDR_TO_PC_NOTIFYSLOTCHANGE; + ccidDriver.BufferINT[1] = ICC_NOT_PRESENT; + ccidDriver.SlotStatus = ICC_NOT_PRESENT; - // Notify the host that a ICC is inserted - return USBD_Write( CCID_EPT_NOTIFICATION, ccidDriver.BufferINT, 2, 0, 0 ); + // Notify the host that a ICC is inserted + return USBD_Write( CCID_EPT_NOTIFICATION, ccidDriver.BufferINT, 2, 0, 0 ); } //------------------------------------------------------------------------------ @@ -1014,19 +1014,19 @@ /// \return USBD_STATUS_LOCKED or USBD_STATUS_SUCCESS //------------------------------------------------------------------------------ unsigned char RDRtoPCHardwareError( unsigned char bSlot, - unsigned char bSeq, - unsigned char bHardwareErrorCode ) + unsigned char bSeq, + unsigned char bHardwareErrorCode ) { - TRACE_DEBUG("."); + TRACE_DEBUG("."); - // Build the Interrupt-IN message - ccidDriver.BufferINT[0] = RDR_TO_PC_HARDWAREERROR; - ccidDriver.BufferINT[1] = bSlot; - ccidDriver.BufferINT[2] = bSeq; - ccidDriver.BufferINT[3] = bHardwareErrorCode; + // Build the Interrupt-IN message + ccidDriver.BufferINT[0] = RDR_TO_PC_HARDWAREERROR; + ccidDriver.BufferINT[1] = bSlot; + ccidDriver.BufferINT[2] = bSeq; + ccidDriver.BufferINT[3] = bHardwareErrorCode; - // Notify the host that a ICC is inserted - return USBD_Write( CCID_EPT_NOTIFICATION, ccidDriver.BufferINT, 4, 0, 0 ); + // Notify the host that a ICC is inserted + return USBD_Write( CCID_EPT_NOTIFICATION, ccidDriver.BufferINT, 4, 0, 0 ); } #endif /* HAVE_CCID */ diff --git a/firmware/libcommon/source/iso7816_4.c b/firmware/libcommon/source/iso7816_4.c index 7219741..ac15306 100644 --- a/firmware/libcommon/source/iso7816_4.c +++ b/firmware/libcommon/source/iso7816_4.c @@ -76,45 +76,45 @@ */ uint32_t ISO7816_GetChar( uint8_t *pCharToReceive, Usart_info *usart) { - uint32_t status; - uint32_t timeout=0; + uint32_t status; + uint32_t timeout=0; - Usart *us_base = usart->base; - uint32_t us_id = usart->id; + Usart *us_base = usart->base; + uint32_t us_id = usart->id; - if( usart->state == USART_SEND ) { - while((us_base->US_CSR & US_CSR_TXEMPTY) == 0) {} - us_base->US_CR = US_CR_RSTSTA | US_CR_RSTIT | US_CR_RSTNACK; - usart->state = USART_RCV; - } + if( usart->state == USART_SEND ) { + while((us_base->US_CSR & US_CSR_TXEMPTY) == 0) {} + us_base->US_CR = US_CR_RSTSTA | US_CR_RSTIT | US_CR_RSTNACK; + usart->state = USART_RCV; + } - /* Wait USART ready for reception */ - while( ((us_base->US_CSR & US_CSR_RXRDY) == 0) ) { + /* Wait USART ready for reception */ + while( ((us_base->US_CSR & US_CSR_RXRDY) == 0) ) { WDT_Restart(WDT); - if(timeout++ > 12000 * (BOARD_MCK/1000000)) { - TRACE_WARNING("TimeOut\n\r"); - return( 0 ); - } - } + if(timeout++ > 12000 * (BOARD_MCK/1000000)) { + TRACE_WARNING("TimeOut\n\r"); + return( 0 ); + } + } - /* At least one complete character has been received and US_RHR has not yet been read. */ + /* At least one complete character has been received and US_RHR has not yet been read. */ - /* Get a char */ - *pCharToReceive = ((us_base->US_RHR) & 0xFF); + /* Get a char */ + *pCharToReceive = ((us_base->US_RHR) & 0xFF); - status = (us_base->US_CSR&(US_CSR_OVRE|US_CSR_FRAME| - US_CSR_PARE|US_CSR_TIMEOUT|US_CSR_NACK| - (1<<10))); + status = (us_base->US_CSR&(US_CSR_OVRE|US_CSR_FRAME| + US_CSR_PARE|US_CSR_TIMEOUT|US_CSR_NACK| + (1<<10))); - if (status != 0 ) { - TRACE_DEBUG("R:0x%" PRIX32 "\n\r", status); - TRACE_DEBUG("R:0x%" PRIX32 "\n\r", us_base->US_CSR); - TRACE_DEBUG("Nb:0x%" PRIX32 "\n\r", us_base->US_NER ); - us_base->US_CR = US_CR_RSTSTA; - } + if (status != 0 ) { + TRACE_DEBUG("R:0x%" PRIX32 "\n\r", status); + TRACE_DEBUG("R:0x%" PRIX32 "\n\r", us_base->US_CSR); + TRACE_DEBUG("Nb:0x%" PRIX32 "\n\r", us_base->US_NER ); + us_base->US_CR = US_CR_RSTSTA; + } - /* Return status */ - return( status ); + /* Return status */ + return( status ); } @@ -125,50 +125,50 @@ */ uint32_t ISO7816_SendChar( uint8_t CharToSend, Usart_info *usart ) { - uint32_t status; + uint32_t status; - Usart *us_base = usart->base; - uint32_t us_id = usart->id; + Usart *us_base = usart->base; + uint32_t us_id = usart->id; - if( usart->state == USART_RCV ) { - us_base->US_CR = US_CR_RSTSTA | US_CR_RSTIT | US_CR_RSTNACK; - usart->state = USART_SEND; - } + if( usart->state == USART_RCV ) { + us_base->US_CR = US_CR_RSTSTA | US_CR_RSTIT | US_CR_RSTNACK; + usart->state = USART_SEND; + } - /* Wait USART ready for transmit */ - int i = 0; - while((us_base->US_CSR & (US_CSR_TXRDY)) == 0) { - i++; - if (!(i%1000000)) { - printf("s: %x ", us_base->US_CSR); - printf("s: %x\r\n", us_base->US_RHR & 0xFF); - us_base->US_CR = US_CR_RSTTX; - us_base->US_CR = US_CR_RSTRX; - } - } - /* There is no character in the US_THR */ + /* Wait USART ready for transmit */ + int i = 0; + while((us_base->US_CSR & (US_CSR_TXRDY)) == 0) { + i++; + if (!(i%1000000)) { + printf("s: %x ", us_base->US_CSR); + printf("s: %x\r\n", us_base->US_RHR & 0xFF); + us_base->US_CR = US_CR_RSTTX; + us_base->US_CR = US_CR_RSTRX; + } + } + /* There is no character in the US_THR */ - /* Transmit a char */ - us_base->US_THR = CharToSend; + /* Transmit a char */ + us_base->US_THR = CharToSend; - TRACE_ERROR("Sx%02X\r\n", CharToSend); + TRACE_ERROR("Sx%02X\r\n", CharToSend); - status = (us_base->US_CSR&(US_CSR_OVRE|US_CSR_FRAME| - US_CSR_PARE|US_CSR_TIMEOUT|US_CSR_NACK| - (1<<10))); + status = (us_base->US_CSR&(US_CSR_OVRE|US_CSR_FRAME| + US_CSR_PARE|US_CSR_TIMEOUT|US_CSR_NACK| + (1<<10))); - if (status != 0 ) { - TRACE_INFO("******* status: 0x%" PRIX32 " (Overrun: %" PRIX32 - ", NACK: %" PRIX32 ", Timeout: %" PRIX32 ", underrun: %" PRIX32 ")\n\r", - status, ((status & US_CSR_OVRE)>> 5), ((status & US_CSR_NACK) >> 13), - ((status & US_CSR_TIMEOUT) >> 8), ((status & (1 << 10)) >> 10)); - TRACE_INFO("E (USART CSR reg):0x%" PRIX32 "\n\r", us_base->US_CSR); - TRACE_INFO("Nb (Number of errors):0x%" PRIX32 "\n\r", us_base->US_NER ); - us_base->US_CR = US_CR_RSTSTA; - } + if (status != 0 ) { + TRACE_INFO("******* status: 0x%" PRIX32 " (Overrun: %" PRIX32 + ", NACK: %" PRIX32 ", Timeout: %" PRIX32 ", underrun: %" PRIX32 ")\n\r", + status, ((status & US_CSR_OVRE)>> 5), ((status & US_CSR_NACK) >> 13), + ((status & US_CSR_TIMEOUT) >> 8), ((status & (1 << 10)) >> 10)); + TRACE_INFO("E (USART CSR reg):0x%" PRIX32 "\n\r", us_base->US_CSR); + TRACE_INFO("Nb (Number of errors):0x%" PRIX32 "\n\r", us_base->US_NER ); + us_base->US_CR = US_CR_RSTSTA; + } - /* Return status */ - return( status ); + /* Return status */ + return( status ); } @@ -177,10 +177,10 @@ */ static void ISO7816_IccPowerOn( void ) { - /* Set RESET Master Card */ - if (st_pinIso7816RstMC) { - PIO_Set(st_pinIso7816RstMC); - } + /* Set RESET Master Card */ + if (st_pinIso7816RstMC) { + PIO_Set(st_pinIso7816RstMC); + } } /*---------------------------------------------------------------------------- @@ -192,10 +192,10 @@ */ void ISO7816_IccPowerOff( void ) { - /* Clear RESET Master Card */ - if (st_pinIso7816RstMC) { - PIO_Clear(st_pinIso7816RstMC); - } + /* Clear RESET Master Card */ + if (st_pinIso7816RstMC) { + PIO_Clear(st_pinIso7816RstMC); + } } /** @@ -207,159 +207,159 @@ * \return 0 on success, content of US_CSR otherwise */ uint32_t ISO7816_XfrBlockTPDU_T0(const uint8_t *pAPDU, - uint8_t *pMessage, - uint16_t wLength, - uint16_t *retlen ) + uint8_t *pMessage, + uint16_t wLength, + uint16_t *retlen ) { - uint16_t NeNc; - uint16_t indexApdu = 4; - uint16_t indexMsg = 0; - uint8_t SW1 = 0; - uint8_t procByte; - uint8_t cmdCase; - uint32_t status = 0; + uint16_t NeNc; + uint16_t indexApdu = 4; + uint16_t indexMsg = 0; + uint8_t SW1 = 0; + uint8_t procByte; + uint8_t cmdCase; + uint32_t status = 0; - TRACE_INFO("pAPDU[0]=0x%X\n\r",pAPDU[0]); - TRACE_INFO("pAPDU[1]=0x%X\n\r",pAPDU[1]); - TRACE_INFO("pAPDU[2]=0x%X\n\r",pAPDU[2]); - TRACE_INFO("pAPDU[3]=0x%X\n\r",pAPDU[3]); - TRACE_INFO("pAPDU[4]=0x%X\n\r",pAPDU[4]); - TRACE_INFO("pAPDU[5]=0x%X\n\r",pAPDU[5]); - TRACE_INFO("wlength=%d\n\r",wLength); + TRACE_INFO("pAPDU[0]=0x%X\n\r",pAPDU[0]); + TRACE_INFO("pAPDU[1]=0x%X\n\r",pAPDU[1]); + TRACE_INFO("pAPDU[2]=0x%X\n\r",pAPDU[2]); + TRACE_INFO("pAPDU[3]=0x%X\n\r",pAPDU[3]); + TRACE_INFO("pAPDU[4]=0x%X\n\r",pAPDU[4]); + TRACE_INFO("pAPDU[5]=0x%X\n\r",pAPDU[5]); + TRACE_INFO("wlength=%d\n\r",wLength); - ISO7816_SendChar( pAPDU[0], &usart_sim ); /* CLA */ - ISO7816_SendChar( pAPDU[1], &usart_sim ); /* INS */ - ISO7816_SendChar( pAPDU[2], &usart_sim ); /* P1 */ - ISO7816_SendChar( pAPDU[3], &usart_sim ); /* P2 */ - ISO7816_SendChar( pAPDU[4], &usart_sim ); /* P3 */ + ISO7816_SendChar( pAPDU[0], &usart_sim ); /* CLA */ + ISO7816_SendChar( pAPDU[1], &usart_sim ); /* INS */ + ISO7816_SendChar( pAPDU[2], &usart_sim ); /* P1 */ + ISO7816_SendChar( pAPDU[3], &usart_sim ); /* P2 */ + ISO7816_SendChar( pAPDU[4], &usart_sim ); /* P3 */ - /* Handle the four structures of command APDU */ - indexApdu = 5; + /* Handle the four structures of command APDU */ + indexApdu = 5; - if( wLength == 4 ) { - cmdCase = CASE1; - NeNc = 0; - } - else if( wLength == 5) { - cmdCase = CASE2; - NeNc = pAPDU[4]; /* C5 */ - if (NeNc == 0) { - NeNc = 256; - } - } - else if( wLength == 6) { - NeNc = pAPDU[4]; /* C5 */ - cmdCase = CASE3; - } - else if( wLength == 7) { - NeNc = pAPDU[4]; /* C5 */ - if( NeNc == 0 ) { - cmdCase = CASE2; - NeNc = (pAPDU[5]<<8)+pAPDU[6]; - } - else { - cmdCase = CASE3; - } - } - else { - NeNc = pAPDU[4]; /* C5 */ - if( NeNc == 0 ) { - cmdCase = CASE3; - NeNc = (pAPDU[5]<<8)+pAPDU[6]; - } - else { - cmdCase = CASE3; - } - } + if( wLength == 4 ) { + cmdCase = CASE1; + NeNc = 0; + } + else if( wLength == 5) { + cmdCase = CASE2; + NeNc = pAPDU[4]; /* C5 */ + if (NeNc == 0) { + NeNc = 256; + } + } + else if( wLength == 6) { + NeNc = pAPDU[4]; /* C5 */ + cmdCase = CASE3; + } + else if( wLength == 7) { + NeNc = pAPDU[4]; /* C5 */ + if( NeNc == 0 ) { + cmdCase = CASE2; + NeNc = (pAPDU[5]<<8)+pAPDU[6]; + } + else { + cmdCase = CASE3; + } + } + else { + NeNc = pAPDU[4]; /* C5 */ + if( NeNc == 0 ) { + cmdCase = CASE3; + NeNc = (pAPDU[5]<<8)+pAPDU[6]; + } + else { + cmdCase = CASE3; + } + } - TRACE_DEBUG("CASE=0x%X NeNc=0x%X\n\r", cmdCase, NeNc); + TRACE_DEBUG("CASE=0x%X NeNc=0x%X\n\r", cmdCase, NeNc); - /* Handle Procedure Bytes */ - do { - status = ISO7816_GetChar(&procByte, &usart_sim); - if (status != 0) { - return status; - } - TRACE_INFO("procByte: 0x%X\n\r", procByte); - /* Handle NULL */ - if ( procByte == ISO_NULL_VAL ) { - TRACE_INFO("INS\n\r"); - continue; - } - /* Handle SW1 */ - else if ( ((procByte & 0xF0) ==0x60) || ((procByte & 0xF0) ==0x90) ) { - TRACE_INFO("SW1\n\r"); - SW1 = 1; - } - /* Handle INS */ - else if ( pAPDU[1] == procByte) { - TRACE_INFO("HdlINS\n\r"); - if (cmdCase == CASE2) { - /* receive data from card */ - do { - status = ISO7816_GetChar(&pMessage[indexMsg++], &usart_sim); - } while(( 0 != --NeNc) && (status == 0) ); - if (status != 0) { - return status; - } - } - else { - /* Send data */ - do { - TRACE_INFO("Send %X", pAPDU[indexApdu]); - ISO7816_SendChar(pAPDU[indexApdu++], &usart_sim); - } while( 0 != --NeNc ); - } - } - /* Handle INS ^ 0xff */ - else - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wsign-compare" - if ( pAPDU[1] == (procByte ^ 0xff)) { - #pragma GCC diagnostic pop - TRACE_INFO("HdlINS+\n\r"); - if (cmdCase == CASE2) { - /* receive data from card */ - status = ISO7816_GetChar(&pMessage[indexMsg++], &usart_sim); - if (status != 0) { - return status; - } - TRACE_INFO("Rcv: 0x%X\n\r", pMessage[indexMsg-1]); - } - else { - status = ISO7816_SendChar(pAPDU[indexApdu++], &usart_sim); - if (status != 0) { - return status; - } - } - NeNc--; - } - else { - /* ?? */ - TRACE_INFO("procByte=0x%X\n\r", procByte); - break; - } - } while (NeNc != 0); + /* Handle Procedure Bytes */ + do { + status = ISO7816_GetChar(&procByte, &usart_sim); + if (status != 0) { + return status; + } + TRACE_INFO("procByte: 0x%X\n\r", procByte); + /* Handle NULL */ + if ( procByte == ISO_NULL_VAL ) { + TRACE_INFO("INS\n\r"); + continue; + } + /* Handle SW1 */ + else if ( ((procByte & 0xF0) ==0x60) || ((procByte & 0xF0) ==0x90) ) { + TRACE_INFO("SW1\n\r"); + SW1 = 1; + } + /* Handle INS */ + else if ( pAPDU[1] == procByte) { + TRACE_INFO("HdlINS\n\r"); + if (cmdCase == CASE2) { + /* receive data from card */ + do { + status = ISO7816_GetChar(&pMessage[indexMsg++], &usart_sim); + } while(( 0 != --NeNc) && (status == 0) ); + if (status != 0) { + return status; + } + } + else { + /* Send data */ + do { + TRACE_INFO("Send %X", pAPDU[indexApdu]); + ISO7816_SendChar(pAPDU[indexApdu++], &usart_sim); + } while( 0 != --NeNc ); + } + } + /* Handle INS ^ 0xff */ + else + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wsign-compare" + if ( pAPDU[1] == (procByte ^ 0xff)) { + #pragma GCC diagnostic pop + TRACE_INFO("HdlINS+\n\r"); + if (cmdCase == CASE2) { + /* receive data from card */ + status = ISO7816_GetChar(&pMessage[indexMsg++], &usart_sim); + if (status != 0) { + return status; + } + TRACE_INFO("Rcv: 0x%X\n\r", pMessage[indexMsg-1]); + } + else { + status = ISO7816_SendChar(pAPDU[indexApdu++], &usart_sim); + if (status != 0) { + return status; + } + } + NeNc--; + } + else { + /* ?? */ + TRACE_INFO("procByte=0x%X\n\r", procByte); + break; + } + } while (NeNc != 0); - /* Status Bytes */ - if (SW1 == 0) { - status = ISO7816_GetChar(&pMessage[indexMsg++], &usart_sim); /* SW1 */ - if (status != 0) { - return status; - } - } - else { - pMessage[indexMsg++] = procByte; - } - status = ISO7816_GetChar(&pMessage[indexMsg++], &usart_sim); /* SW2 */ - if (status != 0) { - return status; - } + /* Status Bytes */ + if (SW1 == 0) { + status = ISO7816_GetChar(&pMessage[indexMsg++], &usart_sim); /* SW1 */ + if (status != 0) { + return status; + } + } + else { + pMessage[indexMsg++] = procByte; + } + status = ISO7816_GetChar(&pMessage[indexMsg++], &usart_sim); /* SW2 */ + if (status != 0) { + return status; + } - TRACE_WARNING("SW1=0x%X, SW2=0x%X\n\r", pMessage[indexMsg-2], pMessage[indexMsg-1]); + TRACE_WARNING("SW1=0x%X, SW2=0x%X\n\r", pMessage[indexMsg-2], pMessage[indexMsg-1]); - *retlen = indexMsg; - return status; + *retlen = indexMsg; + return status; } @@ -368,7 +368,7 @@ */ void ISO7816_Escape( void ) { - TRACE_DEBUG("For user, if needed\n\r"); + TRACE_DEBUG("For user, if needed\n\r"); } /** @@ -376,8 +376,8 @@ */ void ISO7816_RestartClock( void ) { - TRACE_DEBUG("ISO7816_RestartClock\n\r"); - USART_SIM->US_BRGR = 13; + TRACE_DEBUG("ISO7816_RestartClock\n\r"); + USART_SIM->US_BRGR = 13; } /** @@ -385,8 +385,8 @@ */ void ISO7816_StopClock( void ) { - TRACE_DEBUG("ISO7816_StopClock\n\r"); - USART_SIM->US_BRGR = 0; + TRACE_DEBUG("ISO7816_StopClock\n\r"); + USART_SIM->US_BRGR = 0; } /** @@ -394,8 +394,8 @@ */ void ISO7816_toAPDU( void ) { - TRACE_DEBUG("ISO7816_toAPDU\n\r"); - TRACE_DEBUG("Not supported at this time\n\r"); + TRACE_DEBUG("ISO7816_toAPDU\n\r"); + TRACE_DEBUG("Not supported at this time\n\r"); } /** @@ -406,64 +406,64 @@ */ uint32_t ISO7816_Datablock_ATR( uint8_t* pAtr, uint8_t* pLength ) { - uint32_t i; - uint32_t j; - uint32_t y; - uint32_t status = 0; + uint32_t i; + uint32_t j; + uint32_t y; + uint32_t status = 0; - *pLength = 0; + *pLength = 0; - /* Read ATR TS */ - // FIXME: There should always be a check for the GetChar return value..0 means timeout - status = ISO7816_GetChar(&pAtr[0], &usart_sim); - if (status != 0) { - return status; - } + /* Read ATR TS */ + // FIXME: There should always be a check for the GetChar return value..0 means timeout + status = ISO7816_GetChar(&pAtr[0], &usart_sim); + if (status != 0) { + return status; + } - /* Read ATR T0 */ - status = ISO7816_GetChar(&pAtr[1], &usart_sim); - if (status != 0) { - return status; - } - y = pAtr[1] & 0xF0; - i = 2; + /* Read ATR T0 */ + status = ISO7816_GetChar(&pAtr[1], &usart_sim); + if (status != 0) { + return status; + } + y = pAtr[1] & 0xF0; + i = 2; - /* Read ATR Ti */ - while (y && (status == 0)) { + /* Read ATR Ti */ + while (y && (status == 0)) { - if (y & 0x10) { /* TA[i] */ - status = ISO7816_GetChar(&pAtr[i++], &usart_sim); - } - if (y & 0x20) { /* TB[i] */ - status = ISO7816_GetChar(&pAtr[i++], &usart_sim); - } - if (y & 0x40) { /* TC[i] */ - status = ISO7816_GetChar(&pAtr[i++], &usart_sim); - } - if (y & 0x80) { /* TD[i] */ - status = ISO7816_GetChar(&pAtr[i], &usart_sim); - y = pAtr[i++] & 0xF0; - } - else { - y = 0; - } - } - if (status != 0) { - return status; - } + if (y & 0x10) { /* TA[i] */ + status = ISO7816_GetChar(&pAtr[i++], &usart_sim); + } + if (y & 0x20) { /* TB[i] */ + status = ISO7816_GetChar(&pAtr[i++], &usart_sim); + } + if (y & 0x40) { /* TC[i] */ + status = ISO7816_GetChar(&pAtr[i++], &usart_sim); + } + if (y & 0x80) { /* TD[i] */ + status = ISO7816_GetChar(&pAtr[i], &usart_sim); + y = pAtr[i++] & 0xF0; + } + else { + y = 0; + } + } + if (status != 0) { + return status; + } - /* Historical Bytes */ - y = pAtr[1] & 0x0F; - for( j=0; (j < y) && (status == 0); j++ ) { - status = ISO7816_GetChar(&pAtr[i++], &usart_sim); - } + /* Historical Bytes */ + y = pAtr[1] & 0x0F; + for( j=0; (j < y) && (status == 0); j++ ) { + status = ISO7816_GetChar(&pAtr[i++], &usart_sim); + } - if (status != 0) { - return status; - } + if (status != 0) { + return status; + } - *pLength = i; - return status; + *pLength = i; + return status; } /** @@ -473,18 +473,18 @@ */ void ISO7816_SetDataRateandClockFrequency( uint32_t dwClockFrequency, uint32_t dwDataRate ) { - uint8_t ClockFrequency; + uint8_t ClockFrequency; - /* Define the baud rate divisor register */ - /* CD = MCK / SCK */ - /* SCK = FIDI x BAUD = 372 x 9600 */ - /* BOARD_MCK */ - /* CD = MCK/(FIDI x BAUD) = 48000000 / (372x9600) = 13 */ - USART_SIM->US_BRGR = BOARD_MCK / (dwClockFrequency*1000); + /* Define the baud rate divisor register */ + /* CD = MCK / SCK */ + /* SCK = FIDI x BAUD = 372 x 9600 */ + /* BOARD_MCK */ + /* CD = MCK/(FIDI x BAUD) = 48000000 / (372x9600) = 13 */ + USART_SIM->US_BRGR = BOARD_MCK / (dwClockFrequency*1000); - ClockFrequency = BOARD_MCK / USART_SIM->US_BRGR; + ClockFrequency = BOARD_MCK / USART_SIM->US_BRGR; - USART_SIM->US_FIDI = (ClockFrequency)/dwDataRate; + USART_SIM->US_FIDI = (ClockFrequency)/dwDataRate; } @@ -494,10 +494,10 @@ */ uint8_t ISO7816_StatusReset( void ) { - if (st_pinIso7816RstMC) { - return PIO_Get(st_pinIso7816RstMC); - } - return 0; + if (st_pinIso7816RstMC) { + return PIO_Get(st_pinIso7816RstMC); + } + return 0; } /** @@ -505,16 +505,16 @@ */ void ISO7816_cold_reset( void ) { - volatile uint32_t i; + volatile uint32_t i; - /* tb: wait ??? cycles*/ - for( i=0; i<(400*(BOARD_MCK/1000000)); i++ ) { - } + /* tb: wait ??? cycles*/ + for( i=0; i<(400*(BOARD_MCK/1000000)); i++ ) { + } - USART_SIM->US_RHR; - USART_SIM->US_CR = US_CR_RSTSTA | US_CR_RSTIT | US_CR_RSTNACK; + USART_SIM->US_RHR; + USART_SIM->US_CR = US_CR_RSTSTA | US_CR_RSTIT | US_CR_RSTNACK; - ISO7816_IccPowerOn(); + ISO7816_IccPowerOn(); } /** @@ -522,20 +522,20 @@ */ void ISO7816_warm_reset( void ) { - volatile uint32_t i; + volatile uint32_t i; // Clears Reset - ISO7816_IccPowerOff(); + ISO7816_IccPowerOff(); - /* tb: wait ??? cycles */ - for( i=0; i<(400*(BOARD_MCK/1000000)); i++ ) { - } + /* tb: wait ??? cycles */ + for( i=0; i<(400*(BOARD_MCK/1000000)); i++ ) { + } - USART_SIM->US_RHR; - USART_SIM->US_CR = US_CR_RSTSTA | US_CR_RSTIT | US_CR_RSTNACK; + USART_SIM->US_RHR; + USART_SIM->US_CR = US_CR_RSTSTA | US_CR_RSTIT | US_CR_RSTNACK; // Sets Reset - ISO7816_IccPowerOn(); + ISO7816_IccPowerOn(); } /** @@ -544,99 +544,99 @@ */ void ISO7816_Decode_ATR( uint8_t* pAtr ) { - uint32_t i; - uint32_t j; - uint32_t y; - uint8_t offset; + uint32_t i; + uint32_t j; + uint32_t y; + uint8_t offset; - printf("\n\r"); - printf("ATR: Answer To Reset:\n\r"); - printf("TS = 0x%X Initial character ",pAtr[0]); - if( pAtr[0] == 0x3B ) { + printf("\n\r"); + printf("ATR: Answer To Reset:\n\r"); + printf("TS = 0x%X Initial character ",pAtr[0]); + if( pAtr[0] == 0x3B ) { - printf("Direct Convention\n\r"); - } - else { - if( pAtr[0] == 0x3F ) { + printf("Direct Convention\n\r"); + } + else { + if( pAtr[0] == 0x3F ) { - printf("Inverse Convention\n\r"); - } - else { - printf("BAD Convention\n\r"); - } - } + printf("Inverse Convention\n\r"); + } + else { + printf("BAD Convention\n\r"); + } + } - printf("T0 = 0x%X Format caracter\n\r",pAtr[1]); - printf(" Number of historical bytes: K = %d\n\r", pAtr[1]&0x0F); - printf(" Presence further interface byte:\n\r"); - if( pAtr[1]&0x80 ) { - printf("TA "); - } - if( pAtr[1]&0x40 ) { - printf("TB "); - } - if( pAtr[1]&0x20 ) { - printf("TC "); - } - if( pAtr[1]&0x10 ) { - printf("TD "); - } - if( pAtr[1] != 0 ) { - printf(" present\n\r"); - } + printf("T0 = 0x%X Format caracter\n\r",pAtr[1]); + printf(" Number of historical bytes: K = %d\n\r", pAtr[1]&0x0F); + printf(" Presence further interface byte:\n\r"); + if( pAtr[1]&0x80 ) { + printf("TA "); + } + if( pAtr[1]&0x40 ) { + printf("TB "); + } + if( pAtr[1]&0x20 ) { + printf("TC "); + } + if( pAtr[1]&0x10 ) { + printf("TD "); + } + if( pAtr[1] != 0 ) { + printf(" present\n\r"); + } - i = 2; - y = pAtr[1] & 0xF0; + i = 2; + y = pAtr[1] & 0xF0; - /* Read ATR Ti */ - offset = 1; - while (y) { + /* Read ATR Ti */ + offset = 1; + while (y) { - if (y & 0x10) { /* TA[i] */ - printf("TA[%d] = 0x%X ", offset, pAtr[i]); - if( offset == 1 ) { - printf("FI = %d ", (pAtr[i]>>8)); - printf("DI = %d", (pAtr[i]&0x0F)); - } - printf("\n\r"); - i++; - } - if (y & 0x20) { /* TB[i] */ - printf("TB[%d] = 0x%X\n\r", offset, pAtr[i]); - i++; - } - if (y & 0x40) { /* TC[i] */ - printf("TC[%d] = 0x%X ", offset, pAtr[i]); - if( offset == 1 ) { - printf("Extra Guard Time: N = %d", pAtr[i]); - } - printf("\n\r"); - i++; - } - if (y & 0x80) { /* TD[i] */ - printf("TD[%d] = 0x%X\n\r", offset, pAtr[i]); - y = pAtr[i++] & 0xF0; - } - else { - y = 0; - } - offset++; - } + if (y & 0x10) { /* TA[i] */ + printf("TA[%d] = 0x%X ", offset, pAtr[i]); + if( offset == 1 ) { + printf("FI = %d ", (pAtr[i]>>8)); + printf("DI = %d", (pAtr[i]&0x0F)); + } + printf("\n\r"); + i++; + } + if (y & 0x20) { /* TB[i] */ + printf("TB[%d] = 0x%X\n\r", offset, pAtr[i]); + i++; + } + if (y & 0x40) { /* TC[i] */ + printf("TC[%d] = 0x%X ", offset, pAtr[i]); + if( offset == 1 ) { + printf("Extra Guard Time: N = %d", pAtr[i]); + } + printf("\n\r"); + i++; + } + if (y & 0x80) { /* TD[i] */ + printf("TD[%d] = 0x%X\n\r", offset, pAtr[i]); + y = pAtr[i++] & 0xF0; + } + else { + y = 0; + } + offset++; + } - /* Historical Bytes */ - printf("Historical bytes:\n\r"); - y = pAtr[1] & 0x0F; - for( j=0; j < y; j++ ) { - printf(" 0x%X", pAtr[i]); - i++; - } - printf("\n\r\n\r"); + /* Historical Bytes */ + printf("Historical bytes:\n\r"); + y = pAtr[1] & 0x0F; + for( j=0; j < y; j++ ) { + printf(" 0x%X", pAtr[i]); + i++; + } + printf("\n\r\n\r"); } void ISO7816_Set_Reset_Pin(const Pin *pPinIso7816RstMC) { - /* Pin ISO7816 initialize */ - st_pinIso7816RstMC = (Pin *)pPinIso7816RstMC; + /* Pin ISO7816 initialize */ + st_pinIso7816RstMC = (Pin *)pPinIso7816RstMC; } /** Initializes a ISO driver @@ -644,46 +644,46 @@ */ void ISO7816_Init( Usart_info *usart, bool master_clock ) { - uint32_t clk; - TRACE_DEBUG("ISO_Init\n\r"); + uint32_t clk; + TRACE_DEBUG("ISO_Init\n\r"); - Usart *us_base = usart->base; - uint32_t us_id = usart->id; + Usart *us_base = usart->base; + uint32_t us_id = usart->id; - if (master_clock == true) { - clk = US_MR_USCLKS_MCK; - } else { - clk = US_MR_USCLKS_SCK; - } + if (master_clock == true) { + clk = US_MR_USCLKS_MCK; + } else { + clk = US_MR_USCLKS_SCK; + } - USART_Configure( us_base, - US_MR_USART_MODE_IS07816_T_0 - | clk - | US_MR_NBSTOP_1_BIT - | US_MR_PAR_EVEN - | US_MR_CHRL_8_BIT - | US_MR_CLKO - | US_MR_INACK /* Inhibit errors */ - | (3<<24), /* MAX_ITERATION */ - 1, - 0); + USART_Configure( us_base, + US_MR_USART_MODE_IS07816_T_0 + | clk + | US_MR_NBSTOP_1_BIT + | US_MR_PAR_EVEN + | US_MR_CHRL_8_BIT + | US_MR_CLKO + | US_MR_INACK /* Inhibit errors */ + | (3<<24), /* MAX_ITERATION */ + 1, + 0); - /* Disable interrupts */ - us_base->US_IDR = (uint32_t) -1; + /* Disable interrupts */ + us_base->US_IDR = (uint32_t) -1; - /* Configure USART */ - PMC_EnablePeripheral(us_id); + /* Configure USART */ + PMC_EnablePeripheral(us_id); - us_base->US_FIDI = 372; /* by default */ - /* Define the baud rate divisor register */ - /* CD = MCK / SCK */ - /* SCK = FIDI x BAUD = 372 x 9600 */ - /* BOARD_MCK */ - /* CD = MCK/(FIDI x BAUD) = 48000000 / (372x9600) = 13 */ - if (master_clock == true) { - us_base->US_BRGR = BOARD_MCK / (372*9600); - } else { - us_base->US_BRGR = US_BRGR_CD(1); - } + us_base->US_FIDI = 372; /* by default */ + /* Define the baud rate divisor register */ + /* CD = MCK / SCK */ + /* SCK = FIDI x BAUD = 372 x 9600 */ + /* BOARD_MCK */ + /* CD = MCK/(FIDI x BAUD) = 48000000 / (372x9600) = 13 */ + if (master_clock == true) { + us_base->US_BRGR = BOARD_MCK / (372*9600); + } else { + us_base->US_BRGR = US_BRGR_CD(1); + } } diff --git a/firmware/libcommon/source/mode_cardemu.c b/firmware/libcommon/source/mode_cardemu.c index bc91273..c7362cf 100644 --- a/firmware/libcommon/source/mode_cardemu.c +++ b/firmware/libcommon/source/mode_cardemu.c @@ -202,7 +202,7 @@ csr = usart->US_CSR & usart->US_IMR; if (csr & US_CSR_RXRDY) { - byte = (usart->US_RHR) & 0xFF; + byte = (usart->US_RHR) & 0xFF; if (rbuf_write(&ci->rb, byte) < 0) TRACE_ERROR("rbuf overrun\r\n"); } diff --git a/firmware/libcommon/source/mode_ccid.c b/firmware/libcommon/source/mode_ccid.c index 77d4158..516826e 100644 --- a/firmware/libcommon/source/mode_ccid.c +++ b/firmware/libcommon/source/mode_ccid.c @@ -84,11 +84,11 @@ static void ISR_PioSmartCard(const Pin * pPin) { /* FIXME: why is pinSmartCard.pio->PIO_ISR the wrong number? - printf("+++++ Trying to check for pending interrupts (PIO ISR: 0x%X)\n\r", pinSmartCard.pio->PIO_ISR); - printf("+++++ Mask: 0x%X\n\r", pinSmartCard.mask); + printf("+++++ Trying to check for pending interrupts (PIO ISR: 0x%X)\n\r", pinSmartCard.pio->PIO_ISR); + printf("+++++ Mask: 0x%X\n\r", pinSmartCard.mask); Output: - +++++ Trying to check for pending interrupts (PIO ISR: 0x400)) = 1<<10 - +++++ Mask: 0x100 = 1<<8 + +++++ Trying to check for pending interrupts (PIO ISR: 0x400)) = 1<<10 + +++++ Mask: 0x100 = 1<<8 */ // PA10 is DTXD, which is the debug uart transmit pin diff --git a/firmware/libcommon/source/stdio.c b/firmware/libcommon/source/stdio.c index 32bd617..505c895 100644 --- a/firmware/libcommon/source/stdio.c +++ b/firmware/libcommon/source/stdio.c @@ -76,8 +76,8 @@ //------------------------------------------------------------------------------ signed int PutChar(char *pStr, char c) { - *pStr = c; - return 1; + *pStr = c; + return 1; } //------------------------------------------------------------------------------ @@ -89,15 +89,15 @@ //------------------------------------------------------------------------------ signed int PutString(char *pStr, const char *pSource) { - signed int num = 0; + signed int num = 0; - while (*pSource != 0) { + while (*pSource != 0) { - *pStr++ = *pSource++; - num++; - } + *pStr++ = *pSource++; + num++; + } - return num; + return num; } //------------------------------------------------------------------------------ @@ -110,38 +110,38 @@ // \param value Integer value. //------------------------------------------------------------------------------ signed int PutUnsignedInt( - char *pStr, - char fill, - signed int width, - unsigned int value) + char *pStr, + char fill, + signed int width, + unsigned int value) { - signed int num = 0; + signed int num = 0; - // Take current digit into account when calculating width - width--; + // Take current digit into account when calculating width + width--; - // Recursively write upper digits - if ((value / 10) > 0) { + // Recursively write upper digits + if ((value / 10) > 0) { - num = PutUnsignedInt(pStr, fill, width, value / 10); - pStr += num; - } - // Write filler characters - else { + num = PutUnsignedInt(pStr, fill, width, value / 10); + pStr += num; + } + // Write filler characters + else { - while (width > 0) { + while (width > 0) { - PutChar(pStr, fill); - pStr++; - num++; - width--; - } - } + PutChar(pStr, fill); + pStr++; + num++; + width--; + } + } - // Write lower digit - num += PutChar(pStr, (value % 10) + '0'); + // Write lower digit + num += PutChar(pStr, (value % 10) + '0'); - return num; + return num; } //------------------------------------------------------------------------------ @@ -154,69 +154,69 @@ // \param value Signed integer value. //------------------------------------------------------------------------------ signed int PutSignedInt( - char *pStr, - char fill, - signed int width, - signed int value) + char *pStr, + char fill, + signed int width, + signed int value) { - signed int num = 0; - unsigned int absolute; + signed int num = 0; + unsigned int absolute; - // Compute absolute value - if (value < 0) { + // Compute absolute value + if (value < 0) { - absolute = -value; - } - else { + absolute = -value; + } + else { - absolute = value; - } + absolute = value; + } - // Take current digit into account when calculating width - width--; + // Take current digit into account when calculating width + width--; - // Recursively write upper digits - if ((absolute / 10) > 0) { + // Recursively write upper digits + if ((absolute / 10) > 0) { - if (value < 0) { - - num = PutSignedInt(pStr, fill, width, -(absolute / 10)); - } - else { + if (value < 0) { + + num = PutSignedInt(pStr, fill, width, -(absolute / 10)); + } + else { - num = PutSignedInt(pStr, fill, width, absolute / 10); - } - pStr += num; - } - else { + num = PutSignedInt(pStr, fill, width, absolute / 10); + } + pStr += num; + } + else { - // Reserve space for sign - if (value < 0) { + // Reserve space for sign + if (value < 0) { - width--; - } + width--; + } - // Write filler characters - while (width > 0) { + // Write filler characters + while (width > 0) { - PutChar(pStr, fill); - pStr++; - num++; - width--; - } + PutChar(pStr, fill); + pStr++; + num++; + width--; + } - // Write sign - if (value < 0) { + // Write sign + if (value < 0) { - num += PutChar(pStr, '-'); - pStr++; - } - } + num += PutChar(pStr, '-'); + pStr++; + } + } - // Write lower digit - num += PutChar(pStr, (absolute % 10) + '0'); + // Write lower digit + num += PutChar(pStr, (absolute % 10) + '0'); - return num; + return num; } //------------------------------------------------------------------------------ @@ -230,51 +230,51 @@ // \param value Hexadecimal value. //------------------------------------------------------------------------------ signed int PutHexa( - char *pStr, - char fill, - signed int width, - unsigned char maj, - unsigned int value) + char *pStr, + char fill, + signed int width, + unsigned char maj, + unsigned int value) { - signed int num = 0; + signed int num = 0; - // Decrement width - width--; + // Decrement width + width--; - // Recursively output upper digits - if ((value >> 4) > 0) { + // Recursively output upper digits + if ((value >> 4) > 0) { - num += PutHexa(pStr, fill, width, maj, value >> 4); - pStr += num; - } - // Write filler chars - else { + num += PutHexa(pStr, fill, width, maj, value >> 4); + pStr += num; + } + // Write filler chars + else { - while (width > 0) { + while (width > 0) { - PutChar(pStr, fill); - pStr++; - num++; - width--; - } - } + PutChar(pStr, fill); + pStr++; + num++; + width--; + } + } - // Write current digit - if ((value & 0xF) < 10) { + // Write current digit + if ((value & 0xF) < 10) { - PutChar(pStr, (value & 0xF) + '0'); - } - else if (maj) { + PutChar(pStr, (value & 0xF) + '0'); + } + else if (maj) { - PutChar(pStr, (value & 0xF) - 10 + 'A'); - } - else { + PutChar(pStr, (value & 0xF) - 10 + 'A'); + } + else { - PutChar(pStr, (value & 0xF) - 10 + 'a'); - } - num++; + PutChar(pStr, (value & 0xF) - 10 + 'a'); + } + num++; - return num; + return num; } //------------------------------------------------------------------------------ @@ -292,91 +292,91 @@ //------------------------------------------------------------------------------ signed int vsnprintf(char *pStr, size_t length, const char *pFormat, va_list ap) { - char fill; - unsigned char width; - signed int num = 0; - size_t size = 0; + char fill; + unsigned char width; + signed int num = 0; + size_t size = 0; - // Clear the string - if (pStr) { + // Clear the string + if (pStr) { - *pStr = 0; - } + *pStr = 0; + } - // Phase string - while (*pFormat != 0 && size < length) { + // Phase string + while (*pFormat != 0 && size < length) { - // Normal character - if (*pFormat != '%') { + // Normal character + if (*pFormat != '%') { - *pStr++ = *pFormat++; - size++; - } - // Escaped '%' - else if (*(pFormat+1) == '%') { + *pStr++ = *pFormat++; + size++; + } + // Escaped '%' + else if (*(pFormat+1) == '%') { - *pStr++ = '%'; - pFormat += 2; - size++; - } - // Token delimiter - else { + *pStr++ = '%'; + pFormat += 2; + size++; + } + // Token delimiter + else { - fill = ' '; - width = 0; - pFormat++; + fill = ' '; + width = 0; + pFormat++; - // Parse filler - if (*pFormat == '0') { + // Parse filler + if (*pFormat == '0') { - fill = '0'; - pFormat++; - } + fill = '0'; + pFormat++; + } - // Parse width - while ((*pFormat >= '0') && (*pFormat <= '9')) { - - width = (width*10) + *pFormat-'0'; - pFormat++; - } + // Parse width + while ((*pFormat >= '0') && (*pFormat <= '9')) { + + width = (width*10) + *pFormat-'0'; + pFormat++; + } - // Check if there is enough space - if (size + width > length) { + // Check if there is enough space + if (size + width > length) { - width = length - size; - } - - // Parse type - switch (*pFormat) { - case 'd': - case 'i': num = PutSignedInt(pStr, fill, width, va_arg(ap, signed int)); break; - case 'u': num = PutUnsignedInt(pStr, fill, width, va_arg(ap, unsigned int)); break; - case 'x': num = PutHexa(pStr, fill, width, 0, va_arg(ap, unsigned int)); break; - case 'X': num = PutHexa(pStr, fill, width, 1, va_arg(ap, unsigned int)); break; - case 's': num = PutString(pStr, va_arg(ap, char *)); break; - case 'c': num = PutChar(pStr, va_arg(ap, unsigned int)); break; - default: - return EOF; - } + width = length - size; + } + + // Parse type + switch (*pFormat) { + case 'd': + case 'i': num = PutSignedInt(pStr, fill, width, va_arg(ap, signed int)); break; + case 'u': num = PutUnsignedInt(pStr, fill, width, va_arg(ap, unsigned int)); break; + case 'x': num = PutHexa(pStr, fill, width, 0, va_arg(ap, unsigned int)); break; + case 'X': num = PutHexa(pStr, fill, width, 1, va_arg(ap, unsigned int)); break; + case 's': num = PutString(pStr, va_arg(ap, char *)); break; + case 'c': num = PutChar(pStr, va_arg(ap, unsigned int)); break; + default: + return EOF; + } - pFormat++; - pStr += num; - size += num; - } - } + pFormat++; + pStr += num; + size += num; + } + } - // NULL-terminated (final \0 is not counted) - if (size < length) { + // NULL-terminated (final \0 is not counted) + if (size < length) { - *pStr = 0; - } - else { + *pStr = 0; + } + else { - *(--pStr) = 0; - size--; - } + *(--pStr) = 0; + size--; + } - return size; + return size; } //------------------------------------------------------------------------------ @@ -390,14 +390,14 @@ //------------------------------------------------------------------------------ signed int snprintf(char *pString, size_t length, const char *pFormat, ...) { - va_list ap; - signed int rc; + va_list ap; + signed int rc; - va_start(ap, pFormat); - rc = vsnprintf(pString, length, pFormat, ap); - va_end(ap); + va_start(ap, pFormat); + rc = vsnprintf(pString, length, pFormat, ap); + va_end(ap); - return rc; + return rc; } //------------------------------------------------------------------------------ @@ -410,7 +410,7 @@ //------------------------------------------------------------------------------ signed int vsprintf(char *pString, const char *pFormat, va_list ap) { - return vsnprintf(pString, MAX_STRING_SIZE, pFormat, ap); + return vsnprintf(pString, MAX_STRING_SIZE, pFormat, ap); } //------------------------------------------------------------------------------ @@ -422,17 +422,17 @@ //------------------------------------------------------------------------------ signed int vfprintf(FILE *pStream, const char *pFormat, va_list ap) { - char pStr[MAX_STRING_SIZE]; - char pError[] = "stdio.c: increase MAX_STRING_SIZE\n\r"; + char pStr[MAX_STRING_SIZE]; + char pError[] = "stdio.c: increase MAX_STRING_SIZE\n\r"; - // Write formatted string in buffer - if (vsprintf(pStr, pFormat, ap) >= MAX_STRING_SIZE) { + // Write formatted string in buffer + if (vsprintf(pStr, pFormat, ap) >= MAX_STRING_SIZE) { - fputs(pError, stderr); - } + fputs(pError, stderr); + } - // Display string - return fputs(pStr, pStream); + // Display string + return fputs(pStr, pStream); } //------------------------------------------------------------------------------ @@ -443,7 +443,7 @@ //------------------------------------------------------------------------------ signed int vprintf(const char *pFormat, va_list ap) { - return vfprintf(stdout, pFormat, ap); + return vfprintf(stdout, pFormat, ap); } //------------------------------------------------------------------------------ @@ -454,15 +454,15 @@ //------------------------------------------------------------------------------ signed int fprintf(FILE *pStream, const char *pFormat, ...) { - va_list ap; - signed int result; + va_list ap; + signed int result; - // Forward call to vfprintf - va_start(ap, pFormat); - result = vfprintf(pStream, pFormat, ap); - va_end(ap); + // Forward call to vfprintf + va_start(ap, pFormat); + result = vfprintf(pStream, pFormat, ap); + va_end(ap); - return result; + return result; } //------------------------------------------------------------------------------ @@ -472,15 +472,15 @@ //------------------------------------------------------------------------------ signed int printf(const char *pFormat, ...) { - va_list ap; - signed int result; + va_list ap; + signed int result; - // Forward call to vprintf - va_start(ap, pFormat); - result = vprintf(pFormat, ap); - va_end(ap); + // Forward call to vprintf + va_start(ap, pFormat); + result = vprintf(pFormat, ap); + va_end(ap); - return result; + return result; } //------------------------------------------------------------------------------ @@ -490,15 +490,15 @@ //------------------------------------------------------------------------------ signed int sprintf(char *pStr, const char *pFormat, ...) { - va_list ap; - signed int result; + va_list ap; + signed int result; - // Forward call to vsprintf - va_start(ap, pFormat); - result = vsprintf(pStr, pFormat, ap); - va_end(ap); + // Forward call to vsprintf + va_start(ap, pFormat); + result = vsprintf(pStr, pFormat, ap); + va_end(ap); - return result; + return result; } //------------------------------------------------------------------------------ @@ -507,6 +507,6 @@ //------------------------------------------------------------------------------ signed int puts(const char *pStr) { - return fputs(pStr, stdout); + return fputs(pStr, stdout); } diff --git a/firmware/libcommon/source/string.c b/firmware/libcommon/source/string.c index dbbb0e9..0d789a0 100644 --- a/firmware/libcommon/source/string.c +++ b/firmware/libcommon/source/string.c @@ -61,33 +61,33 @@ //------------------------------------------------------------------------------ void * memcpy(void *pDestination, const void *pSource, size_t num) { - unsigned char *pByteDestination; - unsigned char *pByteSource; - unsigned int *pAlignedSource = (unsigned int *) pSource; - unsigned int *pAlignedDestination = (unsigned int *) pDestination; + unsigned char *pByteDestination; + unsigned char *pByteSource; + unsigned int *pAlignedSource = (unsigned int *) pSource; + unsigned int *pAlignedDestination = (unsigned int *) pDestination; - // If num is more than 4 bytes, and both dest. and source are aligned, - // then copy dwords - if ((((unsigned int) pAlignedDestination & 0x3) == 0) - && (((unsigned int) pAlignedSource & 0x3) == 0) - && (num >= 4)) { + // If num is more than 4 bytes, and both dest. and source are aligned, + // then copy dwords + if ((((unsigned int) pAlignedDestination & 0x3) == 0) + && (((unsigned int) pAlignedSource & 0x3) == 0) + && (num >= 4)) { - while (num >= 4) { + while (num >= 4) { - *pAlignedDestination++ = *pAlignedSource++; - num -= 4; - } - } + *pAlignedDestination++ = *pAlignedSource++; + num -= 4; + } + } - // Copy remaining bytes - pByteDestination = (unsigned char *) pAlignedDestination; - pByteSource = (unsigned char *) pAlignedSource; - while (num--) { + // Copy remaining bytes + pByteDestination = (unsigned char *) pAlignedDestination; + pByteSource = (unsigned char *) pAlignedSource; + while (num--) { - *pByteDestination++ = *pByteSource++; - } + *pByteDestination++ = *pByteSource++; + } - return pDestination; + return pDestination; } //------------------------------------------------------------------------------ @@ -99,23 +99,23 @@ //------------------------------------------------------------------------------ void * memset(void *pBuffer, int value, size_t num) { - unsigned char *pByteDestination; - unsigned int *pAlignedDestination = (unsigned int *) pBuffer; - unsigned int alignedValue = (value << 24) | (value << 16) | (value << 8) | value; + unsigned char *pByteDestination; + unsigned int *pAlignedDestination = (unsigned int *) pBuffer; + unsigned int alignedValue = (value << 24) | (value << 16) | (value << 8) | value; - // Set words if possible - if ((((unsigned int) pAlignedDestination & 0x3) == 0) && (num >= 4)) { - while (num >= 4) { - *pAlignedDestination++ = alignedValue; - num -= 4; - } - } - // Set remaining bytes - pByteDestination = (unsigned char *) pAlignedDestination; - while (num--) { - *pByteDestination++ = value; - } - return pBuffer; + // Set words if possible + if ((((unsigned int) pAlignedDestination & 0x3) == 0) && (num >= 4)) { + while (num >= 4) { + *pAlignedDestination++ = alignedValue; + num -= 4; + } + } + // Set remaining bytes + pByteDestination = (unsigned char *) pAlignedDestination; + while (num--) { + *pByteDestination++ = value; + } + return pBuffer; } //----------------------------------------------------------------------------- @@ -126,16 +126,16 @@ //----------------------------------------------------------------------------- char * strchr(const char *pString, int character) { - char * p = (char *)pString; - char c = character & 0xFF; + char * p = (char *)pString; + char c = character & 0xFF; - while(*p != c) { - if (*p == 0) { - return 0; - } - p++; - } - return p; + while(*p != c) { + if (*p == 0) { + return 0; + } + p++; + } + return p; } //----------------------------------------------------------------------------- @@ -144,12 +144,12 @@ //----------------------------------------------------------------------------- size_t strlen(const char *pString) { - unsigned int length = 0; + unsigned int length = 0; - while(*pString++ != 0) { - length++; - } - return length; + while(*pString++ != 0) { + length++; + } + return length; } @@ -161,14 +161,14 @@ //----------------------------------------------------------------------------- char * strrchr(const char *pString, int character) { - char *p = 0; + char *p = 0; - while(*pString != 0) { - if (*pString++ == character) { - p = (char*)pString; - } - } - return p; + while(*pString != 0) { + if (*pString++ == character) { + p = (char*)pString; + } + } + return p; } //----------------------------------------------------------------------------- @@ -179,10 +179,10 @@ //----------------------------------------------------------------------------- char * strcpy(char *pDestination, const char *pSource) { - char *pSaveDest = pDestination; + char *pSaveDest = pDestination; - for(; (*pDestination = *pSource) != 0; ++pSource, ++pDestination); - return pSaveDest; + for(; (*pDestination = *pSource) != 0; ++pSource, ++pDestination); + return pSaveDest; } //----------------------------------------------------------------------------- @@ -196,22 +196,22 @@ //----------------------------------------------------------------------------- int strncmp(const char *pString1, const char *pString2, size_t count) { - int r; + int r; - while(count) { - r = *pString1 - *pString2; - if (r == 0) { - if (*pString1 == 0) { - break; - } - pString1++; - pString2++; - count--; - continue; - } - return r; - } - return 0; + while(count) { + r = *pString1 - *pString2; + if (r == 0) { + if (*pString1 == 0) { + break; + } + pString1++; + pString2++; + count--; + continue; + } + return r; + } + return 0; } //----------------------------------------------------------------------------- @@ -223,17 +223,17 @@ //----------------------------------------------------------------------------- char * strncpy(char *pDestination, const char *pSource, size_t count) { - char *pSaveDest = pDestination; + char *pSaveDest = pDestination; - while (count) { - *pDestination = *pSource; - if (*pSource == 0) { - break; - } - pDestination++; - pSource++; - count--; - } - return pSaveDest; + while (count) { + *pDestination = *pSource; + if (*pSource == 0) { + break; + } + pDestination++; + pSource++; + count--; + } + return pSaveDest; } -- To view, visit https://gerrit.osmocom.org/9918 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I86783eba0827b58303b10310e9f6b9625e1a27f1 Gerrit-Change-Number: 9918 Gerrit-PatchSet: 1 Gerrit-Owner: K?vin Redon -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 11 20:24:58 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 11 Jul 2018 20:24:58 -0000 Subject: Change in simtrace2[master]: replace leading spaces with tabs In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9918 ) Change subject: replace leading spaces with tabs ...................................................................... replace leading spaces with tabs Change-Id: I86783eba0827b58303b10310e9f6b9625e1a27f1 --- M firmware/apps/cardem/main.c M firmware/apps/trace/main.c M firmware/apps/triple_play/main.c M firmware/libboard/common/source/board_cstartup_gnu.c M firmware/libboard/common/source/board_lowlevel.c M firmware/libboard/common/source/led.c M firmware/libboard/common/source/uart_console.c M firmware/libcommon/include/assert.h M firmware/libcommon/include/cciddriver.h M firmware/libcommon/include/iso7816_4.h M firmware/libcommon/include/simtrace.h M firmware/libcommon/source/cciddriver.c M firmware/libcommon/source/iso7816_4.c M firmware/libcommon/source/mode_cardemu.c M firmware/libcommon/source/mode_ccid.c M firmware/libcommon/source/stdio.c M firmware/libcommon/source/string.c 17 files changed, 1,726 insertions(+), 1,726 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/firmware/apps/cardem/main.c b/firmware/apps/cardem/main.c index 9241c06..ae46794 100644 --- a/firmware/apps/cardem/main.c +++ b/firmware/apps/cardem/main.c @@ -152,7 +152,7 @@ EEFC_ReadUniqueID(g_unique_id); - printf("\n\r\n\r" + printf("\n\r\n\r" "=============================================================================\n\r" "SIMtrace2 firmware " GIT_VERSION " (C) 2010-2016 by Harald Welte\n\r" "=============================================================================\n\r"); diff --git a/firmware/apps/trace/main.c b/firmware/apps/trace/main.c index d2fddf9..6b6d70b 100644 --- a/firmware/apps/trace/main.c +++ b/firmware/apps/trace/main.c @@ -155,7 +155,7 @@ EEFC_ReadUniqueID(g_unique_id); - printf("\n\r\n\r" + printf("\n\r\n\r" "=============================================================================\n\r" "SIMtrace2 firmware " GIT_VERSION " (C) 2010-2016 by Harald Welte\n\r" "=============================================================================\n\r"); diff --git a/firmware/apps/triple_play/main.c b/firmware/apps/triple_play/main.c index 47d53af..b81abdd 100644 --- a/firmware/apps/triple_play/main.c +++ b/firmware/apps/triple_play/main.c @@ -151,7 +151,7 @@ EEFC_ReadUniqueID(g_unique_id); - printf("\r\n\r\n" + printf("\r\n\r\n" "=============================================================================\r\n" "SIMtrace2 firmware " GIT_REVISION " (C) 2010-2017 by Harald Welte\r\n" "=============================================================================\r\n"); diff --git a/firmware/libboard/common/source/board_cstartup_gnu.c b/firmware/libboard/common/source/board_cstartup_gnu.c index 0e8bb87..e82a2fb 100644 --- a/firmware/libboard/common/source/board_cstartup_gnu.c +++ b/firmware/libboard/common/source/board_cstartup_gnu.c @@ -71,59 +71,59 @@ __attribute__((section(".vectors"))) IntFunc exception_table[] = { - /* Configure Initial Stack Pointer, using linker-generated symbols */ - (IntFunc)(&pdwStack[STACK_SIZE-1]), - ResetException, + /* Configure Initial Stack Pointer, using linker-generated symbols */ + (IntFunc)(&pdwStack[STACK_SIZE-1]), + ResetException, - NMI_Handler, - HardFault_Handler, - MemManage_Handler, - BusFault_Handler, - UsageFault_Handler, - 0, 0, 0, 0, /* Reserved */ - SVC_Handler, - DebugMon_Handler, - 0, /* Reserved */ - PendSV_Handler, - SysTick_Handler, + NMI_Handler, + HardFault_Handler, + MemManage_Handler, + BusFault_Handler, + UsageFault_Handler, + 0, 0, 0, 0, /* Reserved */ + SVC_Handler, + DebugMon_Handler, + 0, /* Reserved */ + PendSV_Handler, + SysTick_Handler, - /* Configurable interrupts */ - SUPC_IrqHandler, /* 0 Supply Controller */ - RSTC_IrqHandler, /* 1 Reset Controller */ - RTC_IrqHandler, /* 2 Real Time Clock */ - RTT_IrqHandler, /* 3 Real Time Timer */ - WDT_IrqHandler, /* 4 Watchdog Timer */ - PMC_IrqHandler, /* 5 PMC */ - EEFC_IrqHandler, /* 6 EEFC */ - IrqHandlerNotUsed, /* 7 Reserved */ - UART0_IrqHandler, /* 8 UART0 */ - UART1_IrqHandler, /* 9 UART1 */ - SMC_IrqHandler, /* 10 SMC */ - PIOA_IrqHandler, /* 11 Parallel IO Controller A */ - PIOB_IrqHandler, /* 12 Parallel IO Controller B */ - PIOC_IrqHandler, /* 13 Parallel IO Controller C */ - USART0_IrqHandler, /* 14 USART 0 */ - USART1_IrqHandler, /* 15 USART 1 */ - IrqHandlerNotUsed, /* 16 Reserved */ - IrqHandlerNotUsed, /* 17 Reserved */ - MCI_IrqHandler, /* 18 MCI */ - TWI0_IrqHandler, /* 19 TWI 0 */ - TWI1_IrqHandler, /* 20 TWI 1 */ - SPI_IrqHandler, /* 21 SPI */ - SSC_IrqHandler, /* 22 SSC */ - TC0_IrqHandler, /* 23 Timer Counter 0 */ - TC1_IrqHandler, /* 24 Timer Counter 1 */ - TC2_IrqHandler, /* 25 Timer Counter 2 */ - TC3_IrqHandler, /* 26 Timer Counter 3 */ - TC4_IrqHandler, /* 27 Timer Counter 4 */ - TC5_IrqHandler, /* 28 Timer Counter 5 */ - ADC_IrqHandler, /* 29 ADC controller */ - DAC_IrqHandler, /* 30 DAC controller */ - PWM_IrqHandler, /* 31 PWM */ - CRCCU_IrqHandler, /* 32 CRC Calculation Unit */ - ACC_IrqHandler, /* 33 Analog Comparator */ - USBD_IrqHandler, /* 34 USB Device Port */ - IrqHandlerNotUsed /* 35 not used */ + /* Configurable interrupts */ + SUPC_IrqHandler, /* 0 Supply Controller */ + RSTC_IrqHandler, /* 1 Reset Controller */ + RTC_IrqHandler, /* 2 Real Time Clock */ + RTT_IrqHandler, /* 3 Real Time Timer */ + WDT_IrqHandler, /* 4 Watchdog Timer */ + PMC_IrqHandler, /* 5 PMC */ + EEFC_IrqHandler, /* 6 EEFC */ + IrqHandlerNotUsed, /* 7 Reserved */ + UART0_IrqHandler, /* 8 UART0 */ + UART1_IrqHandler, /* 9 UART1 */ + SMC_IrqHandler, /* 10 SMC */ + PIOA_IrqHandler, /* 11 Parallel IO Controller A */ + PIOB_IrqHandler, /* 12 Parallel IO Controller B */ + PIOC_IrqHandler, /* 13 Parallel IO Controller C */ + USART0_IrqHandler, /* 14 USART 0 */ + USART1_IrqHandler, /* 15 USART 1 */ + IrqHandlerNotUsed, /* 16 Reserved */ + IrqHandlerNotUsed, /* 17 Reserved */ + MCI_IrqHandler, /* 18 MCI */ + TWI0_IrqHandler, /* 19 TWI 0 */ + TWI1_IrqHandler, /* 20 TWI 1 */ + SPI_IrqHandler, /* 21 SPI */ + SSC_IrqHandler, /* 22 SSC */ + TC0_IrqHandler, /* 23 Timer Counter 0 */ + TC1_IrqHandler, /* 24 Timer Counter 1 */ + TC2_IrqHandler, /* 25 Timer Counter 2 */ + TC3_IrqHandler, /* 26 Timer Counter 3 */ + TC4_IrqHandler, /* 27 Timer Counter 4 */ + TC5_IrqHandler, /* 28 Timer Counter 5 */ + ADC_IrqHandler, /* 29 ADC controller */ + DAC_IrqHandler, /* 30 DAC controller */ + PWM_IrqHandler, /* 31 PWM */ + CRCCU_IrqHandler, /* 32 CRC Calculation Unit */ + ACC_IrqHandler, /* 33 Analog Comparator */ + USBD_IrqHandler, /* 34 USB Device Port */ + IrqHandlerNotUsed /* 35 not used */ }; #if defined(BOARD_USB_DFU) && defined(APPLICATION_dfu) @@ -153,56 +153,56 @@ */ void ResetException( void ) { - uint32_t *pSrc, *pDest ; + uint32_t *pSrc, *pDest ; - /* Low level Initialize */ - LowLevelInit() ; + /* Low level Initialize */ + LowLevelInit() ; #if defined(BOARD_USB_DFU) && defined(APPLICATION_dfu) - if (!USBDFU_OverrideEnterDFU()) { - UART_Exit(); - __disable_irq(); - BootIntoApp(); - /* Infinite loop */ - while ( 1 ) ; - } + if (!USBDFU_OverrideEnterDFU()) { + UART_Exit(); + __disable_irq(); + BootIntoApp(); + /* Infinite loop */ + while ( 1 ) ; + } #endif - /* Initialize the relocate segment */ - pSrc = &_etext ; - pDest = &_srelocate ; + /* Initialize the relocate segment */ + pSrc = &_etext ; + pDest = &_srelocate ; - if ( pSrc != pDest ) - { - for ( ; pDest < &_erelocate ; ) - { - *pDest++ = *pSrc++ ; - } - } + if ( pSrc != pDest ) + { + for ( ; pDest < &_erelocate ; ) + { + *pDest++ = *pSrc++ ; + } + } - /* Clear the zero segment */ - for ( pDest = &_szero ; pDest < &_ezero ; ) - { - *pDest++ = 0; - } + /* Clear the zero segment */ + for ( pDest = &_szero ; pDest < &_ezero ; ) + { + *pDest++ = 0; + } - /* Set the vector table base address */ - pSrc = (uint32_t *)&_sfixed; - SCB->VTOR = ( (uint32_t)pSrc & SCB_VTOR_TBLOFF_Msk ) ; - - if ( ((uint32_t)pSrc >= IRAM_ADDR) && ((uint32_t)pSrc < IRAM_ADDR+IRAM_SIZE) ) - { + /* Set the vector table base address */ + pSrc = (uint32_t *)&_sfixed; + SCB->VTOR = ( (uint32_t)pSrc & SCB_VTOR_TBLOFF_Msk ) ; + + if ( ((uint32_t)pSrc >= IRAM_ADDR) && ((uint32_t)pSrc < IRAM_ADDR+IRAM_SIZE) ) + { SCB->VTOR |= 1 << SCB_VTOR_TBLBASE_Pos ; - } + } - /* App should have disabled interrupts during the transition */ - __enable_irq(); + /* App should have disabled interrupts during the transition */ + __enable_irq(); - /* Branch to main function */ - main() ; + /* Branch to main function */ + main() ; - /* Infinite loop */ - while ( 1 ) ; + /* Infinite loop */ + while ( 1 ) ; } diff --git a/firmware/libboard/common/source/board_lowlevel.c b/firmware/libboard/common/source/board_lowlevel.c index b37719c..b82f6f3 100644 --- a/firmware/libboard/common/source/board_lowlevel.c +++ b/firmware/libboard/common/source/board_lowlevel.c @@ -50,15 +50,15 @@ #if (BOARD_MAINOSC == 18432000) /* Clock settings at 48MHz for 18 MHz crystal */ #define BOARD_PLLAR (CKGR_PLLAR_STUCKTO1 \ - | CKGR_PLLAR_MULA(13-1) \ - | CKGR_PLLAR_PLLACOUNT(0x1) \ - | CKGR_PLLAR_DIVA(5)) + | CKGR_PLLAR_MULA(13-1) \ + | CKGR_PLLAR_PLLACOUNT(0x1) \ + | CKGR_PLLAR_DIVA(5)) #elif (BOARD_MAINOSC == 12000000) /* QMod has 12 MHz clock, so multply by 8 (96 MHz) and divide by 2 */ #define BOARD_PLLAR (CKGR_PLLAR_STUCKTO1 \ - | CKGR_PLLAR_MULA(8-1) \ - | CKGR_PLLAR_PLLACOUNT(0x1) \ - | CKGR_PLLAR_DIVA(2)) + | CKGR_PLLAR_MULA(8-1) \ + | CKGR_PLLAR_PLLACOUNT(0x1) \ + | CKGR_PLLAR_DIVA(2)) #else #error "Please define PLLA config for your MAINOSC frequency" #endif /* MAINOSC */ @@ -66,19 +66,19 @@ #if (BOARD_MAINOSC == 18432000) /* Clock settings at 64MHz for 18 MHz crystal: 64.512 MHz */ #define BOARD_PLLAR (CKGR_PLLAR_STUCKTO1 \ - | CKGR_PLLAR_MULA(7-1) \ - | CKGR_PLLAR_PLLACOUNT(0x1) \ - | CKGR_PLLAR_DIVA(2)) + | CKGR_PLLAR_MULA(7-1) \ + | CKGR_PLLAR_PLLACOUNT(0x1) \ + | CKGR_PLLAR_DIVA(2)) #elif (BOARD_MAINOSC == 12000000) /* QMod has 12 MHz clock, so multply by 10 / div by 2: 60 MHz */ #define BOARD_PLLAR (CKGR_PLLAR_STUCKTO1 \ - | CKGR_PLLAR_MULA(10-1) \ - | CKGR_PLLAR_PLLACOUNT(0x1) \ - | CKGR_PLLAR_DIVA(2)) + | CKGR_PLLAR_MULA(10-1) \ + | CKGR_PLLAR_PLLACOUNT(0x1) \ + | CKGR_PLLAR_DIVA(2)) #error "Please define PLLA config for your MAINOSC frequency" #endif /* MAINOSC */ #else - #error "No PLL settings for current BOARD_MCK." + #error "No PLL settings for current BOARD_MCK." #endif #if (BOARD_MAINOSC == 12000000) @@ -117,85 +117,85 @@ */ extern WEAK void LowLevelInit( void ) { - uint32_t timeout = 0; + uint32_t timeout = 0; - /* Configure the Supply Monitor to reset the CPU in case VDDIO is - * lower than 3.0V. As we run the board on 3.3V, any lower voltage - * might be some kind of leakage that creeps in some way, but is not - * the "official" power supply */ - SUPC->SUPC_SMMR = SUPC_SMMR_SMTH_3_0V | SUPC_SMMR_SMSMPL_CSM | + /* Configure the Supply Monitor to reset the CPU in case VDDIO is + * lower than 3.0V. As we run the board on 3.3V, any lower voltage + * might be some kind of leakage that creeps in some way, but is not + * the "official" power supply */ + SUPC->SUPC_SMMR = SUPC_SMMR_SMTH_3_0V | SUPC_SMMR_SMSMPL_CSM | SUPC_SMMR_SMRSTEN_ENABLE; - /* enable both LED and green LED */ - PIOA->PIO_PER |= PIO_LED_RED | PIO_LED_GREEN; - PIOA->PIO_OER |= PIO_LED_RED | PIO_LED_GREEN; - PIOA->PIO_CODR |= PIO_LED_RED | PIO_LED_GREEN; + /* enable both LED and green LED */ + PIOA->PIO_PER |= PIO_LED_RED | PIO_LED_GREEN; + PIOA->PIO_OER |= PIO_LED_RED | PIO_LED_GREEN; + PIOA->PIO_CODR |= PIO_LED_RED | PIO_LED_GREEN; - /* Set 3 FWS for Embedded Flash Access */ - EFC->EEFC_FMR = EEFC_FMR_FWS(3); + /* Set 3 FWS for Embedded Flash Access */ + EFC->EEFC_FMR = EEFC_FMR_FWS(3); - /* Select external slow clock */ + /* Select external slow clock */ /* if ((SUPC->SUPC_SR & SUPC_SR_OSCSEL) != SUPC_SR_OSCSEL_CRYST) - { - SUPC->SUPC_CR = (uint32_t)(SUPC_CR_XTALSEL_CRYSTAL_SEL | SUPC_CR_KEY(0xA5)); - timeout = 0; - while (!(SUPC->SUPC_SR & SUPC_SR_OSCSEL_CRYST) ); - } + { + SUPC->SUPC_CR = (uint32_t)(SUPC_CR_XTALSEL_CRYSTAL_SEL | SUPC_CR_KEY(0xA5)); + timeout = 0; + while (!(SUPC->SUPC_SR & SUPC_SR_OSCSEL_CRYST) ); + } */ #ifndef qmod - /* Initialize main oscillator */ - if ( !(PMC->CKGR_MOR & CKGR_MOR_MOSCSEL) ) - { - PMC->CKGR_MOR = CKGR_MOR_KEY(0x37) | BOARD_OSCOUNT | CKGR_MOR_MOSCRCEN | CKGR_MOR_MOSCXTEN; - timeout = 0; - while (!(PMC->PMC_SR & PMC_SR_MOSCXTS) && (timeout++ < CLOCK_TIMEOUT)); - } + /* Initialize main oscillator */ + if ( !(PMC->CKGR_MOR & CKGR_MOR_MOSCSEL) ) + { + PMC->CKGR_MOR = CKGR_MOR_KEY(0x37) | BOARD_OSCOUNT | CKGR_MOR_MOSCRCEN | CKGR_MOR_MOSCXTEN; + timeout = 0; + while (!(PMC->PMC_SR & PMC_SR_MOSCXTS) && (timeout++ < CLOCK_TIMEOUT)); + } - /* Switch to 3-20MHz Xtal oscillator */ - PIOB->PIO_PDR = (1 << 8) | (1 << 9); - PIOB->PIO_PUDR = (1 << 8) | (1 << 9); - PIOB->PIO_PPDDR = (1 << 8) | (1 << 9); - PMC->CKGR_MOR = CKGR_MOR_KEY(0x37) | BOARD_OSCOUNT | CKGR_MOR_MOSCRCEN | CKGR_MOR_MOSCXTEN | CKGR_MOR_MOSCSEL; - /* wait for Main XTAL oscillator stabilization */ - timeout = 0; - while (!(PMC->PMC_SR & PMC_SR_MOSCSELS) && (timeout++ < CLOCK_TIMEOUT)); + /* Switch to 3-20MHz Xtal oscillator */ + PIOB->PIO_PDR = (1 << 8) | (1 << 9); + PIOB->PIO_PUDR = (1 << 8) | (1 << 9); + PIOB->PIO_PPDDR = (1 << 8) | (1 << 9); + PMC->CKGR_MOR = CKGR_MOR_KEY(0x37) | BOARD_OSCOUNT | CKGR_MOR_MOSCRCEN | CKGR_MOR_MOSCXTEN | CKGR_MOR_MOSCSEL; + /* wait for Main XTAL oscillator stabilization */ + timeout = 0; + while (!(PMC->PMC_SR & PMC_SR_MOSCSELS) && (timeout++ < CLOCK_TIMEOUT)); #else - /* QMOD has external 12MHz clock source */ - PIOB->PIO_PDR = (1 << 9); - PIOB->PIO_PUDR = (1 << 9); - PIOB->PIO_PPDDR = (1 << 9); - PMC->CKGR_MOR = CKGR_MOR_KEY(0x37) | CKGR_MOR_MOSCRCEN | CKGR_MOR_MOSCXTBY| CKGR_MOR_MOSCSEL; + /* QMOD has external 12MHz clock source */ + PIOB->PIO_PDR = (1 << 9); + PIOB->PIO_PUDR = (1 << 9); + PIOB->PIO_PPDDR = (1 << 9); + PMC->CKGR_MOR = CKGR_MOR_KEY(0x37) | CKGR_MOR_MOSCRCEN | CKGR_MOR_MOSCXTBY| CKGR_MOR_MOSCSEL; #endif - /* disable the red LED after main clock initialization */ - PIOA->PIO_SODR = PIO_LED_RED; + /* disable the red LED after main clock initialization */ + PIOA->PIO_SODR = PIO_LED_RED; - /* "switch" to main clock as master clock source (should already be the case */ - PMC->PMC_MCKR = (PMC->PMC_MCKR & ~(uint32_t)PMC_MCKR_CSS_Msk) | PMC_MCKR_CSS_MAIN_CLK; - /* wait for master clock to be ready */ - for ( timeout = 0; !(PMC->PMC_SR & PMC_SR_MCKRDY) && (timeout++ < CLOCK_TIMEOUT) ; ); + /* "switch" to main clock as master clock source (should already be the case */ + PMC->PMC_MCKR = (PMC->PMC_MCKR & ~(uint32_t)PMC_MCKR_CSS_Msk) | PMC_MCKR_CSS_MAIN_CLK; + /* wait for master clock to be ready */ + for ( timeout = 0; !(PMC->PMC_SR & PMC_SR_MCKRDY) && (timeout++ < CLOCK_TIMEOUT) ; ); - /* Initialize PLLA */ - PMC->CKGR_PLLAR = BOARD_PLLAR; - /* Wait for PLLA to lock */ - timeout = 0; - while (!(PMC->PMC_SR & PMC_SR_LOCKA) && (timeout++ < CLOCK_TIMEOUT)); + /* Initialize PLLA */ + PMC->CKGR_PLLAR = BOARD_PLLAR; + /* Wait for PLLA to lock */ + timeout = 0; + while (!(PMC->PMC_SR & PMC_SR_LOCKA) && (timeout++ < CLOCK_TIMEOUT)); - /* Switch to main clock (again ?!?) */ - PMC->PMC_MCKR = (BOARD_MCKR & ~PMC_MCKR_CSS_Msk) | PMC_MCKR_CSS_MAIN_CLK; - /* wait for master clock to be ready */ - for ( timeout = 0; !(PMC->PMC_SR & PMC_SR_MCKRDY) && (timeout++ < CLOCK_TIMEOUT) ; ); + /* Switch to main clock (again ?!?) */ + PMC->PMC_MCKR = (BOARD_MCKR & ~PMC_MCKR_CSS_Msk) | PMC_MCKR_CSS_MAIN_CLK; + /* wait for master clock to be ready */ + for ( timeout = 0; !(PMC->PMC_SR & PMC_SR_MCKRDY) && (timeout++ < CLOCK_TIMEOUT) ; ); - /* switch to PLLA as master clock source */ - PMC->PMC_MCKR = BOARD_MCKR ; - /* wait for master clock to be ready */ - for ( timeout = 0; !(PMC->PMC_SR & PMC_SR_MCKRDY) && (timeout++ < CLOCK_TIMEOUT) ; ); + /* switch to PLLA as master clock source */ + PMC->PMC_MCKR = BOARD_MCKR ; + /* wait for master clock to be ready */ + for ( timeout = 0; !(PMC->PMC_SR & PMC_SR_MCKRDY) && (timeout++ < CLOCK_TIMEOUT) ; ); - /* Configure SysTick for 1ms */ - SysTick_Config(BOARD_MCK/1000); + /* Configure SysTick for 1ms */ + SysTick_Config(BOARD_MCK/1000); - _ConfigureUsbClock(); + _ConfigureUsbClock(); } /* SysTick based delay function */ diff --git a/firmware/libboard/common/source/led.c b/firmware/libboard/common/source/led.c index cffff70..e3293b6 100644 --- a/firmware/libboard/common/source/led.c +++ b/firmware/libboard/common/source/led.c @@ -35,9 +35,9 @@ ASSERT(led < PIO_LISTSIZE(pinsLeds)); if (on) - PIO_Clear(&pinsLeds[led]); + PIO_Clear(&pinsLeds[led]); else - PIO_Set(&pinsLeds[led]); + PIO_Set(&pinsLeds[led]); } /* LED blinking code */ diff --git a/firmware/libboard/common/source/uart_console.c b/firmware/libboard/common/source/uart_console.c index 88c9166..3ce7331 100644 --- a/firmware/libboard/common/source/uart_console.c +++ b/firmware/libboard/common/source/uart_console.c @@ -66,41 +66,41 @@ */ extern void UART_Configure( uint32_t baudrate, uint32_t masterClock) { - const Pin pPins[] = CONSOLE_PINS; - Uart *pUart = CONSOLE_UART; + const Pin pPins[] = CONSOLE_PINS; + Uart *pUart = CONSOLE_UART; - /* Configure PIO */ - PIO_Configure(pPins, PIO_LISTSIZE(pPins)); + /* Configure PIO */ + PIO_Configure(pPins, PIO_LISTSIZE(pPins)); - /* Configure PMC */ - PMC->PMC_PCER0 = 1 << CONSOLE_ID; + /* Configure PMC */ + PMC->PMC_PCER0 = 1 << CONSOLE_ID; - /* Reset and disable receiver & transmitter */ - pUart->UART_CR = UART_CR_RSTRX | UART_CR_RSTTX - | UART_CR_RXDIS | UART_CR_TXDIS; + /* Reset and disable receiver & transmitter */ + pUart->UART_CR = UART_CR_RSTRX | UART_CR_RSTTX + | UART_CR_RXDIS | UART_CR_TXDIS; - /* Configure mode */ - pUart->UART_MR = UART_MR_PAR_NO; + /* Configure mode */ + pUart->UART_MR = UART_MR_PAR_NO; - /* Configure baudrate */ - /* Asynchronous, no oversampling */ - pUart->UART_BRGR = (masterClock / baudrate) / 16; + /* Configure baudrate */ + /* Asynchronous, no oversampling */ + pUart->UART_BRGR = (masterClock / baudrate) / 16; - /* Disable PDC channel */ - pUart->UART_PTCR = UART_PTCR_RXTDIS | UART_PTCR_TXTDIS; + /* Disable PDC channel */ + pUart->UART_PTCR = UART_PTCR_RXTDIS | UART_PTCR_TXTDIS; - /* Reset transmit ring buffer */ - rbuf_reset(&uart_tx_buffer); + /* Reset transmit ring buffer */ + rbuf_reset(&uart_tx_buffer); - /* Enable TX interrupts */ - pUart->UART_IER = UART_IER_TXRDY; - NVIC_EnableIRQ(CONSOLE_IRQ); - - /* Enable receiver and transmitter */ - pUart->UART_CR = UART_CR_RXEN | UART_CR_TXEN; + /* Enable TX interrupts */ + pUart->UART_IER = UART_IER_TXRDY; + NVIC_EnableIRQ(CONSOLE_IRQ); + + /* Enable receiver and transmitter */ + pUart->UART_CR = UART_CR_RXEN | UART_CR_TXEN; - /* Remember the configuration is complete */ - _ucIsConsoleInitialized=1 ; + /* Remember the configuration is complete */ + _ucIsConsoleInitialized=1 ; } /** @@ -140,22 +140,22 @@ */ extern void UART_PutChar( uint8_t c ) { - Uart *pUart = CONSOLE_UART ; + Uart *pUart = CONSOLE_UART ; - /* Initialize console is not already done */ - if ( !_ucIsConsoleInitialized ) - { - UART_Configure(CONSOLE_BAUDRATE, BOARD_MCK); - } + /* Initialize console is not already done */ + if ( !_ucIsConsoleInitialized ) + { + UART_Configure(CONSOLE_BAUDRATE, BOARD_MCK); + } - /* Only store input if buffer is not full, else drop it */ - if (!rbuf_is_full(&uart_tx_buffer)) { - rbuf_write(&uart_tx_buffer, c); - if (!(pUart->UART_IMR & UART_IMR_TXRDY)) { - pUart->UART_IER = UART_IER_TXRDY; - CONSOLE_ISR(); - } - } + /* Only store input if buffer is not full, else drop it */ + if (!rbuf_is_full(&uart_tx_buffer)) { + rbuf_write(&uart_tx_buffer, c); + if (!(pUart->UART_IMR & UART_IMR_TXRDY)) { + pUart->UART_IER = UART_IER_TXRDY; + CONSOLE_ISR(); + } + } } /** @@ -166,17 +166,17 @@ */ extern uint32_t UART_GetChar( void ) { - Uart *pUart = CONSOLE_UART ; + Uart *pUart = CONSOLE_UART ; - if ( !_ucIsConsoleInitialized ) - { - UART_Configure(CONSOLE_BAUDRATE, BOARD_MCK); - } + if ( !_ucIsConsoleInitialized ) + { + UART_Configure(CONSOLE_BAUDRATE, BOARD_MCK); + } - while ( (pUart->UART_SR & UART_SR_RXRDY) == 0 ) - WDT_Restart(WDT); + while ( (pUart->UART_SR & UART_SR_RXRDY) == 0 ) + WDT_Restart(WDT); - return pUart->UART_RHR ; + return pUart->UART_RHR ; } /** @@ -186,14 +186,14 @@ */ extern uint32_t UART_IsRxReady( void ) { - Uart *pUart = CONSOLE_UART; + Uart *pUart = CONSOLE_UART; - if ( !_ucIsConsoleInitialized ) - { - UART_Configure( CONSOLE_BAUDRATE, BOARD_MCK ) ; - } + if ( !_ucIsConsoleInitialized ) + { + UART_Configure( CONSOLE_BAUDRATE, BOARD_MCK ) ; + } - return (pUart->UART_SR & UART_SR_RXRDY) > 0 ; + return (pUart->UART_SR & UART_SR_RXRDY) > 0 ; } /** @@ -204,14 +204,14 @@ */ extern void UART_DumpFrame( uint8_t* pucFrame, uint32_t dwSize ) { - uint32_t dw ; + uint32_t dw ; - for ( dw=0 ; dw < dwSize ; dw++ ) - { - printf( "%02X ", pucFrame[dw] ) ; - } + for ( dw=0 ; dw < dwSize ; dw++ ) + { + printf( "%02X ", pucFrame[dw] ) ; + } - printf( "\n\r" ) ; + printf( "\n\r" ) ; } /** @@ -223,62 +223,62 @@ */ extern void UART_DumpMemory( uint8_t* pucBuffer, uint32_t dwSize, uint32_t dwAddress ) { - uint32_t i ; - uint32_t j ; - uint32_t dwLastLineStart ; - uint8_t* pucTmp ; + uint32_t i ; + uint32_t j ; + uint32_t dwLastLineStart ; + uint8_t* pucTmp ; - for ( i=0 ; i < (dwSize / 16) ; i++ ) - { - printf( "0x%08X: ", (unsigned int)(dwAddress + (i*16)) ) ; - pucTmp = (uint8_t*)&pucBuffer[i*16] ; + for ( i=0 ; i < (dwSize / 16) ; i++ ) + { + printf( "0x%08X: ", (unsigned int)(dwAddress + (i*16)) ) ; + pucTmp = (uint8_t*)&pucBuffer[i*16] ; - for ( j=0 ; j < 4 ; j++ ) - { - printf( "%02X%02X%02X%02X ", pucTmp[0], pucTmp[1], pucTmp[2], pucTmp[3] ) ; - pucTmp += 4 ; - } + for ( j=0 ; j < 4 ; j++ ) + { + printf( "%02X%02X%02X%02X ", pucTmp[0], pucTmp[1], pucTmp[2], pucTmp[3] ) ; + pucTmp += 4 ; + } - pucTmp=(uint8_t*)&pucBuffer[i*16] ; + pucTmp=(uint8_t*)&pucBuffer[i*16] ; - for ( j=0 ; j < 16 ; j++ ) - { - UART_PutChar( *pucTmp++ ) ; - } + for ( j=0 ; j < 16 ; j++ ) + { + UART_PutChar( *pucTmp++ ) ; + } - printf( "\n\r" ) ; - } + printf( "\n\r" ) ; + } - if ( (dwSize%16) != 0 ) - { - dwLastLineStart=dwSize - (dwSize%16) ; + if ( (dwSize%16) != 0 ) + { + dwLastLineStart=dwSize - (dwSize%16) ; - printf( "0x%08X: ", (unsigned int)(dwAddress + dwLastLineStart) ) ; - for ( j=dwLastLineStart ; j < dwLastLineStart+16 ; j++ ) - { - if ( (j!=dwLastLineStart) && (j%4 == 0) ) - { - printf( " " ) ; - } + printf( "0x%08X: ", (unsigned int)(dwAddress + dwLastLineStart) ) ; + for ( j=dwLastLineStart ; j < dwLastLineStart+16 ; j++ ) + { + if ( (j!=dwLastLineStart) && (j%4 == 0) ) + { + printf( " " ) ; + } - if ( j < dwSize ) - { - printf( "%02X", pucBuffer[j] ) ; - } - else - { - printf(" ") ; - } - } + if ( j < dwSize ) + { + printf( "%02X", pucBuffer[j] ) ; + } + else + { + printf(" ") ; + } + } - printf( " " ) ; - for ( j=dwLastLineStart ; j < dwSize ; j++ ) - { - UART_PutChar( pucBuffer[j] ) ; - } + printf( " " ) ; + for ( j=dwLastLineStart ; j < dwSize ; j++ ) + { + UART_PutChar( pucBuffer[j] ) ; + } - printf( "\n\r" ) ; - } + printf( "\n\r" ) ; + } } /** @@ -288,46 +288,46 @@ */ extern uint32_t UART_GetInteger( uint32_t* pdwValue ) { - uint8_t ucKey ; - uint8_t ucNbNb=0 ; - uint32_t dwValue=0 ; + uint8_t ucKey ; + uint8_t ucNbNb=0 ; + uint32_t dwValue=0 ; - while ( 1 ) - { - ucKey=UART_GetChar() ; - UART_PutChar( ucKey ) ; + while ( 1 ) + { + ucKey=UART_GetChar() ; + UART_PutChar( ucKey ) ; - if ( ucKey >= '0' && ucKey <= '9' ) - { - dwValue = (dwValue * 10) + (ucKey - '0'); - ucNbNb++ ; - } - else - { - if ( ucKey == 0x0D || ucKey == ' ' ) - { - if ( ucNbNb == 0 ) - { - printf( "\n\rWrite a number and press ENTER or SPACE!\n\r" ) ; - return 0 ; - } - else - { - printf( "\n\r" ) ; - *pdwValue=dwValue ; + if ( ucKey >= '0' && ucKey <= '9' ) + { + dwValue = (dwValue * 10) + (ucKey - '0'); + ucNbNb++ ; + } + else + { + if ( ucKey == 0x0D || ucKey == ' ' ) + { + if ( ucNbNb == 0 ) + { + printf( "\n\rWrite a number and press ENTER or SPACE!\n\r" ) ; + return 0 ; + } + else + { + printf( "\n\r" ) ; + *pdwValue=dwValue ; - return 1 ; - } - } - else - { - printf( "\n\r'%c' not a number!\n\r", ucKey ) ; + return 1 ; + } + } + else + { + printf( "\n\r'%c' not a number!\n\r", ucKey ) ; - return 0 ; - } - } - WDT_Restart(WDT); - } + return 0 ; + } + } + WDT_Restart(WDT); + } } /** @@ -339,25 +339,25 @@ */ extern uint32_t UART_GetIntegerMinMax( uint32_t* pdwValue, uint32_t dwMin, uint32_t dwMax ) { - uint32_t dwValue=0 ; + uint32_t dwValue=0 ; - if ( UART_GetInteger( &dwValue ) == 0 ) - { - return 0 ; - } + if ( UART_GetInteger( &dwValue ) == 0 ) + { + return 0 ; + } - if ( dwValue < dwMin || dwValue > dwMax ) + if ( dwValue < dwMin || dwValue > dwMax ) { - printf( "\n\rThe number have to be between %d and %d\n\r", (int)dwMin, (int)dwMax ) ; + printf( "\n\rThe number have to be between %d and %d\n\r", (int)dwMin, (int)dwMax ) ; - return 0 ; - } + return 0 ; + } - printf( "\n\r" ) ; + printf( "\n\r" ) ; - *pdwValue = dwValue ; + *pdwValue = dwValue ; - return 1 ; + return 1 ; } /** @@ -367,45 +367,45 @@ */ extern uint32_t UART_GetHexa32( uint32_t* pdwValue ) { - uint8_t ucKey ; - uint32_t dw = 0 ; - uint32_t dwValue = 0 ; + uint8_t ucKey ; + uint32_t dw = 0 ; + uint32_t dwValue = 0 ; - for ( dw=0 ; dw < 8 ; dw++ ) - { - ucKey = UART_GetChar() ; - UART_PutChar( ucKey ) ; + for ( dw=0 ; dw < 8 ; dw++ ) + { + ucKey = UART_GetChar() ; + UART_PutChar( ucKey ) ; - if ( ucKey >= '0' && ucKey <= '9' ) - { - dwValue = (dwValue * 16) + (ucKey - '0') ; - } - else - { - if ( ucKey >= 'A' && ucKey <= 'F' ) - { - dwValue = (dwValue * 16) + (ucKey - 'A' + 10) ; - } - else - { - if ( ucKey >= 'a' && ucKey <= 'f' ) - { - dwValue = (dwValue * 16) + (ucKey - 'a' + 10) ; - } - else - { - printf( "\n\rIt is not a hexa character!\n\r" ) ; + if ( ucKey >= '0' && ucKey <= '9' ) + { + dwValue = (dwValue * 16) + (ucKey - '0') ; + } + else + { + if ( ucKey >= 'A' && ucKey <= 'F' ) + { + dwValue = (dwValue * 16) + (ucKey - 'A' + 10) ; + } + else + { + if ( ucKey >= 'a' && ucKey <= 'f' ) + { + dwValue = (dwValue * 16) + (ucKey - 'a' + 10) ; + } + else + { + printf( "\n\rIt is not a hexa character!\n\r" ) ; - return 0 ; - } - } - } - } + return 0 ; + } + } + } + } - printf("\n\r" ) ; - *pdwValue = dwValue ; + printf("\n\r" ) ; + *pdwValue = dwValue ; - return 1 ; + return 1 ; } #if defined __ICCARM__ /* IAR Ewarm 5.41+ */ @@ -418,9 +418,9 @@ */ extern WEAK signed int putchar( signed int c ) { - UART_PutChar( c ) ; + UART_PutChar( c ) ; - return c ; + return c ; } #endif // defined __ICCARM__ diff --git a/firmware/libcommon/include/assert.h b/firmware/libcommon/include/assert.h index a52ffa9..22bb101 100644 --- a/firmware/libcommon/include/assert.h +++ b/firmware/libcommon/include/assert.h @@ -65,41 +65,41 @@ // Definitions //------------------------------------------------------------------------------ #if defined(NOASSERT) - #define ASSERT(...) - #define SANITY_CHECK(...) + #define ASSERT(...) + #define SANITY_CHECK(...) #else - #if (TRACE_LEVEL == 0) - /// Checks that the given condition is true, - /// otherwise stops the program execution. - /// \param condition Condition to verify. - #define ASSERT(condition) { \ - if (!(condition)) { \ - while (1); \ - } \ - } + #if (TRACE_LEVEL == 0) + /// Checks that the given condition is true, + /// otherwise stops the program execution. + /// \param condition Condition to verify. + #define ASSERT(condition) { \ + if (!(condition)) { \ + while (1); \ + } \ + } - /// Performs the same duty as the ASSERT() macro - /// \param condition Condition to verify. - #define SANITY_CHECK(condition) ASSERT(condition, ...) + /// Performs the same duty as the ASSERT() macro + /// \param condition Condition to verify. + #define SANITY_CHECK(condition) ASSERT(condition, ...) - #else - /// Checks that the given condition is true, otherwise displays an error - /// message and stops the program execution. - /// \param condition Condition to verify. - #define ASSERT(condition) { \ - if (!(condition)) { \ - printf("-F- ASSERT: %s %s:%d\n\r", #condition, __BASE_FILE__, __LINE__); \ - while (1); \ - } \ - } - #define SANITY_ERROR "Sanity check failed at %s:%d\n\r" - - /// Performs the same duty as the ASSERT() macro, except a default error - /// message is output if the condition is false. - /// \param condition Condition to verify. - #define SANITY_CHECK(condition) ASSERT(condition, SANITY_ERROR, __FILE__, __LINE__) - #endif + #else + /// Checks that the given condition is true, otherwise displays an error + /// message and stops the program execution. + /// \param condition Condition to verify. + #define ASSERT(condition) { \ + if (!(condition)) { \ + printf("-F- ASSERT: %s %s:%d\n\r", #condition, __BASE_FILE__, __LINE__); \ + while (1); \ + } \ + } + #define SANITY_ERROR "Sanity check failed at %s:%d\n\r" + + /// Performs the same duty as the ASSERT() macro, except a default error + /// message is output if the condition is false. + /// \param condition Condition to verify. + #define SANITY_CHECK(condition) ASSERT(condition, SANITY_ERROR, __FILE__, __LINE__) + #endif #endif diff --git a/firmware/libcommon/include/cciddriver.h b/firmware/libcommon/include/cciddriver.h index ee5e028..f9be027 100644 --- a/firmware/libcommon/include/cciddriver.h +++ b/firmware/libcommon/include/cciddriver.h @@ -145,129 +145,129 @@ /// 6.1.11.2 PIN Verification Data Structure typedef struct { - /// Number of seconds. - unsigned char bTimerOut; - /// Several parameters for the PIN format options - unsigned char bmFormatString; - /// Define the length of the PIN to present in the APDU command - unsigned char bmPINBlockString; - /// Allows the length PIN insertion in the APDU command - unsigned char bmPINLengthFormat; - /// Minimum PIN size in digit and Maximum PIN size in digit - unsigned char wPINMaxExtraDigit; - /// The value is a bit wise OR operation. - unsigned char bEntryValidationCondition; - /// Number of messages to display for the PIN modify command - unsigned char bNumberMessage; - /// Language used to display the messages. - unsigned char wLangId; - /// Message index in the Reader message table - unsigned char bMsgIndex; - /// T=1 I-block prologue field to use - unsigned char bTeoPrologue[3]; - /// APDU to send to the ICC - unsigned char abPINApdu[255]; + /// Number of seconds. + unsigned char bTimerOut; + /// Several parameters for the PIN format options + unsigned char bmFormatString; + /// Define the length of the PIN to present in the APDU command + unsigned char bmPINBlockString; + /// Allows the length PIN insertion in the APDU command + unsigned char bmPINLengthFormat; + /// Minimum PIN size in digit and Maximum PIN size in digit + unsigned char wPINMaxExtraDigit; + /// The value is a bit wise OR operation. + unsigned char bEntryValidationCondition; + /// Number of messages to display for the PIN modify command + unsigned char bNumberMessage; + /// Language used to display the messages. + unsigned char wLangId; + /// Message index in the Reader message table + unsigned char bMsgIndex; + /// T=1 I-block prologue field to use + unsigned char bTeoPrologue[3]; + /// APDU to send to the ICC + unsigned char abPINApdu[255]; }__attribute__ ((packed)) S_ccid_PIN_Verification; /// 6.1.11.7 PIN Modification Data Structure typedef struct { - /// Number of seconds. If 00h then CCID default value is used. - unsigned char bTimeOut; - /// Several parameters for the PIN format options (defined in ? 6.1.11.4) - unsigned char bmFormatString4; - /// Define the length of the PIN to present in the APDU command - unsigned char bmPINBlockString; - /// Allows the length PIN insertion in the APDU command (defined in ? 6.1.11.6) - unsigned char bmPinLengthFormat; - /// Insertion position offset in byte for the current PIN - unsigned char bInsertionOffsetOld; - /// Insertion position offset in byte for the new PIN - unsigned char bInsertionOffsetNew; - /// XXYYh - /// XX: Minimum PIN size in digit - /// YY: Maximum PIN size in digit - unsigned char wPINMaxExtraDigit; - /// 00h,01h,02h,03h - /// Indicates if a confirmation is requested before acceptance of a new PIN (meaning that the user has to enter this new PIN twice before it is accepted) - /// Indicates if the current PIN must be entered and set in the same APDU field of not. - unsigned char bConfirmPIN; - /// The value is a bit wise OR operation. - /// 01h Max size reached - /// 02h Validation key pressed - /// 04h Timeout occurred - unsigned char bEntryValidationCondition; - /// 00h,01h,02h,03h,or FFh - /// Number of messages to display for the PIN modify command. - unsigned char bNumberMessage; - /// Language used to display the messages. The 16 bit - unsigned char wLangId; - /// Message index in the Reader message table (should be 00h or 01h). - unsigned char bMsgIndex1; - /// Message index in the Reader message table (should be 01h or 02h). - unsigned char bMsgIndex2; - /// Message index in the Reader message table (should be 02h). - unsigned char bMsgIndex3; - /// T=1 I-block prologue field to use. Significant only if protocol in use is T=1. - unsigned char bTeoPrologue[3]; - /// Byte array APDU to send to the ICC - unsigned char abPINApdu[255]; + /// Number of seconds. If 00h then CCID default value is used. + unsigned char bTimeOut; + /// Several parameters for the PIN format options (defined in ? 6.1.11.4) + unsigned char bmFormatString4; + /// Define the length of the PIN to present in the APDU command + unsigned char bmPINBlockString; + /// Allows the length PIN insertion in the APDU command (defined in ? 6.1.11.6) + unsigned char bmPinLengthFormat; + /// Insertion position offset in byte for the current PIN + unsigned char bInsertionOffsetOld; + /// Insertion position offset in byte for the new PIN + unsigned char bInsertionOffsetNew; + /// XXYYh + /// XX: Minimum PIN size in digit + /// YY: Maximum PIN size in digit + unsigned char wPINMaxExtraDigit; + /// 00h,01h,02h,03h + /// Indicates if a confirmation is requested before acceptance of a new PIN (meaning that the user has to enter this new PIN twice before it is accepted) + /// Indicates if the current PIN must be entered and set in the same APDU field of not. + unsigned char bConfirmPIN; + /// The value is a bit wise OR operation. + /// 01h Max size reached + /// 02h Validation key pressed + /// 04h Timeout occurred + unsigned char bEntryValidationCondition; + /// 00h,01h,02h,03h,or FFh + /// Number of messages to display for the PIN modify command. + unsigned char bNumberMessage; + /// Language used to display the messages. The 16 bit + unsigned char wLangId; + /// Message index in the Reader message table (should be 00h or 01h). + unsigned char bMsgIndex1; + /// Message index in the Reader message table (should be 01h or 02h). + unsigned char bMsgIndex2; + /// Message index in the Reader message table (should be 02h). + unsigned char bMsgIndex3; + /// T=1 I-block prologue field to use. Significant only if protocol in use is T=1. + unsigned char bTeoPrologue[3]; + /// Byte array APDU to send to the ICC + unsigned char abPINApdu[255]; }__attribute__ ((packed)) S_ccid_PIN_Modification; /// Protocol Data Structure for Protocol T=0 (bProtocolNum=0, dwLength=00000005h) typedef struct { - /// B7-4 ? FI ? Index into the table 7 in ISO/IEC 7816-3:1997 selecting a - /// clock rate conversion factor - /// B3-0 ? DI - Index into the table 8 in ISO/IEC 7816-3:1997 selecting a - /// baud rate conversion factor - unsigned char bmFindexDindex; - /// For T=0 ,B0 ? 0b, B7-2 ? 000000b - /// B1 ? Convention used (b1=0 for direct, b1=1 for inverse) - unsigned char bmTCCKST0; // 0 to 2 - /// Extra Guardtime between two characters. Add 0 to 254 etu to the normal - /// guardtime of 12etu. FFh is the same as 00h. - unsigned char bGuardTimeT0; // 0 to FF - /// WI for T=0 used to define WWT - unsigned char bWaitingIntegerT0; // 0 to FF - /// ICC Clock Stop Support - /// 00 = Stopping the Clock is not allowed - /// 01 = Stop with Clock signal Low - /// 02 = Stop with Clock signal High - /// 03 = Stop with Clock either High or Low - unsigned char bClockStop; // 0 to 3 + /// B7-4 ? FI ? Index into the table 7 in ISO/IEC 7816-3:1997 selecting a + /// clock rate conversion factor + /// B3-0 ? DI - Index into the table 8 in ISO/IEC 7816-3:1997 selecting a + /// baud rate conversion factor + unsigned char bmFindexDindex; + /// For T=0 ,B0 ? 0b, B7-2 ? 000000b + /// B1 ? Convention used (b1=0 for direct, b1=1 for inverse) + unsigned char bmTCCKST0; // 0 to 2 + /// Extra Guardtime between two characters. Add 0 to 254 etu to the normal + /// guardtime of 12etu. FFh is the same as 00h. + unsigned char bGuardTimeT0; // 0 to FF + /// WI for T=0 used to define WWT + unsigned char bWaitingIntegerT0; // 0 to FF + /// ICC Clock Stop Support + /// 00 = Stopping the Clock is not allowed + /// 01 = Stop with Clock signal Low + /// 02 = Stop with Clock signal High + /// 03 = Stop with Clock either High or Low + unsigned char bClockStop; // 0 to 3 } __attribute__ ((packed)) S_ccid_protocol_t0; /// Protocol Data Structure for Protocol T=1 (bProtocolNum=1, dwLength=00000007h) typedef struct { - /// B7-4 ? FI ? Index into the table 7 in ISO/IEC 7816-3:1997 selecting a - /// clock rate conversion factor - /// B3-0 ? DI - Index into the table 8 in ISO/IEC 7816-3:1997 selecting a - /// baud rate conversion factor - unsigned char bmFindexDindex; - /// For T=1, B7-2 ? 000100b - /// B0 ? Checksum type (b0=0 for LRC, b0=1 for CRC - /// B1 ? Convention used (b1=0 for direct, b1=1 for inverse) - unsigned char bmTCCKST1; // 10h, 11h, 12h, 13h - /// Extra Guardtime (0 to 254 etu between two characters). - /// If value is FFh, then guardtime is reduced by 1. - unsigned char bGuardTimeT1; // 0 to FF - /// B7-4 = BWI - /// B3-0 = CWI - unsigned char bmWaitingIntegersT1; // 0 to 9 - /// ICC Clock Stop Support - /// 00 = Stopping the Clock is not allowed - /// 01 = Stop with Clock signal Low - /// 02 = Stop with Clock signal High - /// 03 = Stop with Clock either High or Low - unsigned char bClockStop; // 0 to 3 - /// Size of negotiated IFSC - unsigned char bIFSC; // 0 to FE - /// Nad value used by CCID - unsigned char bNadValue; // 0 to FF + /// B7-4 ? FI ? Index into the table 7 in ISO/IEC 7816-3:1997 selecting a + /// clock rate conversion factor + /// B3-0 ? DI - Index into the table 8 in ISO/IEC 7816-3:1997 selecting a + /// baud rate conversion factor + unsigned char bmFindexDindex; + /// For T=1, B7-2 ? 000100b + /// B0 ? Checksum type (b0=0 for LRC, b0=1 for CRC + /// B1 ? Convention used (b1=0 for direct, b1=1 for inverse) + unsigned char bmTCCKST1; // 10h, 11h, 12h, 13h + /// Extra Guardtime (0 to 254 etu between two characters). + /// If value is FFh, then guardtime is reduced by 1. + unsigned char bGuardTimeT1; // 0 to FF + /// B7-4 = BWI + /// B3-0 = CWI + unsigned char bmWaitingIntegersT1; // 0 to 9 + /// ICC Clock Stop Support + /// 00 = Stopping the Clock is not allowed + /// 01 = Stop with Clock signal Low + /// 02 = Stop with Clock signal High + /// 03 = Stop with Clock either High or Low + unsigned char bClockStop; // 0 to 3 + /// Size of negotiated IFSC + unsigned char bIFSC; // 0 to FE + /// Nad value used by CCID + unsigned char bNadValue; // 0 to FF } __attribute__ ((packed)) S_ccid_protocol_t1; @@ -357,8 +357,8 @@ //------------------------------------------------------------------------------ extern unsigned char RDRtoPCHardwareError( unsigned char bSlot, - unsigned char bSeq, - unsigned char bHardwareErrorCode ); + unsigned char bSeq, + unsigned char bHardwareErrorCode ); /* #if !defined(NOAUTOCALLBACK) @@ -368,13 +368,13 @@ extern void CCID_SmartCardRequest( void ); extern void CCIDDriver_Initialize( void ); extern unsigned char CCID_Read(void *pBuffer, - unsigned int dLength, - TransferCallback fCallback, - void *pArgument); + unsigned int dLength, + TransferCallback fCallback, + void *pArgument); extern unsigned char CCID_Write(void *pBuffer, - unsigned int dLength, - TransferCallback fCallback, - void *pArgument); + unsigned int dLength, + TransferCallback fCallback, + void *pArgument); extern unsigned char CCID_Insertion( void ); extern unsigned char CCID_Removal( void ); diff --git a/firmware/libcommon/include/iso7816_4.h b/firmware/libcommon/include/iso7816_4.h index 7c371b2..e2215c7 100644 --- a/firmware/libcommon/include/iso7816_4.h +++ b/firmware/libcommon/include/iso7816_4.h @@ -76,9 +76,9 @@ extern void ISO7816_IccPowerOff(void); extern uint32_t ISO7816_XfrBlockTPDU_T0(const uint8_t *pAPDU, - uint8_t *pMessage, - uint16_t wLength, - uint16_t *retlen); + uint8_t *pMessage, + uint16_t wLength, + uint16_t *retlen); extern void ISO7816_Escape( void ); extern void ISO7816_RestartClock(void); extern void ISO7816_StopClock( void ); diff --git a/firmware/libcommon/include/simtrace.h b/firmware/libcommon/include/simtrace.h index 5edea17..0486581 100644 --- a/firmware/libcommon/include/simtrace.h +++ b/firmware/libcommon/include/simtrace.h @@ -65,19 +65,19 @@ /// device using the CCID driver. typedef struct { - /// Configuration descriptor - USBConfigurationDescriptor configuration; - /// Interface descriptor - USBInterfaceDescriptor interface; - /// CCID descriptor - CCIDDescriptor ccid; - /// Bulk OUT endpoint descriptor - USBEndpointDescriptor bulkOut; - /// Bulk IN endpoint descriptor - USBEndpointDescriptor bulkIn; - /// Interrupt OUT endpoint descriptor - USBEndpointDescriptor interruptIn; - DFURT_IF_DESCRIPTOR_STRUCT + /// Configuration descriptor + USBConfigurationDescriptor configuration; + /// Interface descriptor + USBInterfaceDescriptor interface; + /// CCID descriptor + CCIDDescriptor ccid; + /// Bulk OUT endpoint descriptor + USBEndpointDescriptor bulkOut; + /// Bulk IN endpoint descriptor + USBEndpointDescriptor bulkIn; + /// Interrupt OUT endpoint descriptor + USBEndpointDescriptor interruptIn; + DFURT_IF_DESCRIPTOR_STRUCT } __attribute__ ((packed)) CCIDDriverConfigurationDescriptors; extern const USBConfigurationDescriptor *configurationDescriptorsArr[]; diff --git a/firmware/libcommon/source/cciddriver.c b/firmware/libcommon/source/cciddriver.c index 8cf28ca..1dbdf23 100644 --- a/firmware/libcommon/source/cciddriver.c +++ b/firmware/libcommon/source/cciddriver.c @@ -83,24 +83,24 @@ /// Driver structure for an CCID device typedef struct { - /// CCID message - S_ccid_bulk_in_header sCcidMessage; - /// CCID command - S_ccid_bulk_out_header sCcidCommand; - /// Interrupt message answer - unsigned char BufferINT[4]; - /// Buffer data of message - unsigned char ProtocolDataStructure[10]; - /// Protocol used - unsigned char bProtocol; - /// SlotStatus - /// Bit 0 = Slot 0 current state - /// Bit 1 = Slot 0 changed status - /// Bit 2 = Slot 1 current state - /// Bit 3 = Slot 1 changed status - /// Bit 4 = Slot 2 current state - /// Bit 5 = Slot 2 changed status - unsigned char SlotStatus; + /// CCID message + S_ccid_bulk_in_header sCcidMessage; + /// CCID command + S_ccid_bulk_out_header sCcidCommand; + /// Interrupt message answer + unsigned char BufferINT[4]; + /// Buffer data of message + unsigned char ProtocolDataStructure[10]; + /// Protocol used + unsigned char bProtocol; + /// SlotStatus + /// Bit 0 = Slot 0 current state + /// Bit 1 = Slot 0 changed status + /// Bit 2 = Slot 1 current state + /// Bit 3 = Slot 1 changed status + /// Bit 4 = Slot 2 current state + /// Bit 5 = Slot 2 changed status + unsigned char SlotStatus; } CCIDDriver; @@ -121,7 +121,7 @@ //------------------------------------------------------------------------------ void CCIDDriver_Initialize( void ) { - configurationDescriptorsFS = (CCIDDriverConfigurationDescriptors *) configurationDescriptorsArr[CFG_NUM_CCID-1]; + configurationDescriptorsFS = (CCIDDriverConfigurationDescriptors *) configurationDescriptorsArr[CFG_NUM_CCID-1]; } //------------------------------------------------------------------------------ @@ -137,25 +137,25 @@ //------------------------------------------------------------------------------ static void RDRtoPCSlotStatus( void ) { - // Header fields settings - ccidDriver.sCcidMessage.bMessageType = RDR_TO_PC_SLOTSTATUS; - ccidDriver.sCcidMessage.wLength = 0; + // Header fields settings + ccidDriver.sCcidMessage.bMessageType = RDR_TO_PC_SLOTSTATUS; + ccidDriver.sCcidMessage.wLength = 0; - if (ccidDriver.SlotStatus == ICC_INSERTED_EVENT) { - ccidDriver.sCcidMessage.bStatus = 0; /* ICC present and active card */ - } else if (ccidDriver.SlotStatus == ICC_NOT_PRESENT) { - ccidDriver.sCcidMessage.bStatus = 2; /* No ICC present*/ - } else{ - TRACE_ERROR("Strange bStatus"); - ccidDriver.sCcidMessage.bStatus = 0; - } - ccidDriver.sCcidMessage.bError = 0; - // 00h Clock running - // 01h Clock stopped in state L - // 02h Clock stopped in state H - // 03h Clock stopped in an unknown state - // All other values are Reserved for Future Use. - ccidDriver.sCcidMessage.bSpecific = 0; + if (ccidDriver.SlotStatus == ICC_INSERTED_EVENT) { + ccidDriver.sCcidMessage.bStatus = 0; /* ICC present and active card */ + } else if (ccidDriver.SlotStatus == ICC_NOT_PRESENT) { + ccidDriver.sCcidMessage.bStatus = 2; /* No ICC present*/ + } else{ + TRACE_ERROR("Strange bStatus"); + ccidDriver.sCcidMessage.bStatus = 0; + } + ccidDriver.sCcidMessage.bError = 0; + // 00h Clock running + // 01h Clock stopped in state L + // 02h Clock stopped in state H + // 03h Clock stopped in an unknown state + // All other values are Reserved for Future Use. + ccidDriver.sCcidMessage.bSpecific = 0; } //------------------------------------------------------------------------------ @@ -164,71 +164,71 @@ //------------------------------------------------------------------------------ static void RDRtoPCDatablock_ATR( void ) { - unsigned char i; - unsigned char Atr[ATR_SIZE_MAX]; - unsigned char length; - uint32_t status; + unsigned char i; + unsigned char Atr[ATR_SIZE_MAX]; + unsigned char length; + uint32_t status; - TRACE_DEBUG("."); + TRACE_DEBUG("."); - status = ISO7816_Datablock_ATR( Atr, &length ); - ISO7816_Decode_ATR( Atr ); + status = ISO7816_Datablock_ATR( Atr, &length ); + ISO7816_Decode_ATR( Atr ); - if (status == 0) { - TRACE_DEBUG("Timeout occured while reading ATR"); + if (status == 0) { + TRACE_DEBUG("Timeout occured while reading ATR"); // FIXME: react properly to timeout.. // return; - } + } // FIXME: More tests? Is bProtocol = Atr[3] ? - if( length > 5 ) { - ccidDriver.ProtocolDataStructure[1] = Atr[3]&0x0F; // TD(1) - ccidDriver.bProtocol = Atr[3]&0x0F; // TD(1) - TRACE_INFO("Protocol data structure: 0x%x\n\r", - ccidDriver.ProtocolDataStructure[1]); - } + if( length > 5 ) { + ccidDriver.ProtocolDataStructure[1] = Atr[3]&0x0F; // TD(1) + ccidDriver.bProtocol = Atr[3]&0x0F; // TD(1) + TRACE_INFO("Protocol data structure: 0x%x\n\r", + ccidDriver.ProtocolDataStructure[1]); + } - // S_ccid_protocol_t0 - // bmFindexDindex - ccidDriver.ProtocolDataStructure[0] = Atr[2]; // TA(1) + // S_ccid_protocol_t0 + // bmFindexDindex + ccidDriver.ProtocolDataStructure[0] = Atr[2]; // TA(1) - // bmTCCKST0 - // For T=0 ,B0 ? 0b, B7-2 ? 000000b - // B1 ? Convention used (b1=0 for direct, b1=1 for inverse) + // bmTCCKST0 + // For T=0 ,B0 ? 0b, B7-2 ? 000000b + // B1 ? Convention used (b1=0 for direct, b1=1 for inverse) - // bGuardTimeT0 - // Extra Guardtime between two characters. Add 0 to 254 etu to the normal - // guardtime of 12etu. FFh is the same as 00h. - ccidDriver.ProtocolDataStructure[2] = Atr[4]; // TC(1) - // AT91C_BASE_US0->US_TTGR = 0; // TC1 + // bGuardTimeT0 + // Extra Guardtime between two characters. Add 0 to 254 etu to the normal + // guardtime of 12etu. FFh is the same as 00h. + ccidDriver.ProtocolDataStructure[2] = Atr[4]; // TC(1) + // AT91C_BASE_US0->US_TTGR = 0; // TC1 - // bWaitingIntegerT0 - // WI for T=0 used to define WWT - ccidDriver.ProtocolDataStructure[3] = Atr[7]; // TC(2) + // bWaitingIntegerT0 + // WI for T=0 used to define WWT + ccidDriver.ProtocolDataStructure[3] = Atr[7]; // TC(2) - // bClockStop - // ICC Clock Stop Support - // 00 = Stopping the Clock is not allowed - // 01 = Stop with Clock signal Low - // 02 = Stop with Clock signal High - // 03 = Stop with Clock either High or Low - ccidDriver.ProtocolDataStructure[4] = 0x00; // 0 to 3 + // bClockStop + // ICC Clock Stop Support + // 00 = Stopping the Clock is not allowed + // 01 = Stop with Clock signal Low + // 02 = Stop with Clock signal High + // 03 = Stop with Clock either High or Low + ccidDriver.ProtocolDataStructure[4] = 0x00; // 0 to 3 - // Header fields settings - ccidDriver.sCcidMessage.bMessageType = RDR_TO_PC_DATABLOCK; - ccidDriver.sCcidMessage.wLength = length; // Size of ATR - ccidDriver.sCcidMessage.bSizeToSend += length; // Size of ATR - // bChainParameter: 00 the response APDU begins and ends in this command - ccidDriver.sCcidMessage.bSpecific = 0; + // Header fields settings + ccidDriver.sCcidMessage.bMessageType = RDR_TO_PC_DATABLOCK; + ccidDriver.sCcidMessage.wLength = length; // Size of ATR + ccidDriver.sCcidMessage.bSizeToSend += length; // Size of ATR + // bChainParameter: 00 the response APDU begins and ends in this command + ccidDriver.sCcidMessage.bSpecific = 0; - for( i=0; iccid.dwFeatures & CCID_FEATURES_AUTO_VOLT) ) { + TRACE_DEBUG("."); + if( CCID_FEATURES_AUTO_VOLT == (configurationDescriptorsFS->ccid.dwFeatures & CCID_FEATURES_AUTO_VOLT) ) { - //bPowerSelect = ccidDriver.sCcidCommand.bSpecific_0; - ccidDriver.sCcidCommand.bSpecific_0 = VOLTS_AUTO; - } + //bPowerSelect = ccidDriver.sCcidCommand.bSpecific_0; + ccidDriver.sCcidCommand.bSpecific_0 = VOLTS_AUTO; + } - ISO7816_warm_reset(); + ISO7816_warm_reset(); // ISO7816_cold_reset(); - // for emulation only //JCB - if ( ccidDriver.sCcidCommand.bSpecific_0 != VOLTS_5_0 ) { + // for emulation only //JCB + if ( ccidDriver.sCcidCommand.bSpecific_0 != VOLTS_5_0 ) { - TRACE_ERROR("POWER_NOT_SUPPORTED\n\r"); - } + TRACE_ERROR("POWER_NOT_SUPPORTED\n\r"); + } - else { + else { - RDRtoPCDatablock_ATR(); + RDRtoPCDatablock_ATR(); - } + } } //------------------------------------------------------------------------------ @@ -384,23 +384,23 @@ //------------------------------------------------------------------------------ static void PCtoRDRIccPowerOff( void ) { - unsigned char bStatus; + unsigned char bStatus; - TRACE_DEBUG("."); + TRACE_DEBUG("."); - ISO7816_IccPowerOff(); + ISO7816_IccPowerOff(); - //JCB stub - bStatus = ICC_BS_PRESENT_NOTACTIVATED; + //JCB stub + bStatus = ICC_BS_PRESENT_NOTACTIVATED; - // Set the slot to an inactive status - ccidDriver.sCcidMessage.bStatus = 0; - ccidDriver.sCcidMessage.bError = 0; + // Set the slot to an inactive status + ccidDriver.sCcidMessage.bStatus = 0; + ccidDriver.sCcidMessage.bError = 0; - // if error, see Table 6.1-2 errors + // if error, see Table 6.1-2 errors - // Return the slot status to the host - RDRtoPCSlotStatus(); + // Return the slot status to the host + RDRtoPCSlotStatus(); } //------------------------------------------------------------------------------ @@ -409,13 +409,13 @@ //------------------------------------------------------------------------------ static void PCtoRDRGetSlotStatus( void ) { - TRACE_DEBUG("."); + TRACE_DEBUG("."); - ccidDriver.sCcidMessage.bStatus = 0; - ccidDriver.sCcidMessage.bError = 0; + ccidDriver.sCcidMessage.bStatus = 0; + ccidDriver.sCcidMessage.bError = 0; - // Return the slot status to the host - RDRtoPCSlotStatus(); + // Return the slot status to the host + RDRtoPCSlotStatus(); } //------------------------------------------------------------------------------ @@ -425,69 +425,69 @@ //------------------------------------------------------------------------------ static void PCtoRDRXfrBlock( void ) { - uint16_t msglen = 0; - uint32_t ret; + uint16_t msglen = 0; + uint32_t ret; - TRACE_DEBUG("PCtoRDRXfrBlock\n"); + TRACE_DEBUG("PCtoRDRXfrBlock\n"); - // Check the block length - if ( ccidDriver.sCcidCommand.wLength > (configurationDescriptorsFS->ccid.dwMaxCCIDMessageLength-10) ) { - TRACE_DEBUG("Err block/msg len"); - ccidDriver.sCcidMessage.bStatus = 1; - ccidDriver.sCcidMessage.bError = 0; - } - // check bBWI - else if ( 0 != ccidDriver.sCcidCommand.bSpecific_0 ) { + // Check the block length + if ( ccidDriver.sCcidCommand.wLength > (configurationDescriptorsFS->ccid.dwMaxCCIDMessageLength-10) ) { + TRACE_DEBUG("Err block/msg len"); + ccidDriver.sCcidMessage.bStatus = 1; + ccidDriver.sCcidMessage.bError = 0; + } + // check bBWI + else if ( 0 != ccidDriver.sCcidCommand.bSpecific_0 ) { - TRACE_ERROR("Bad bBWI\n\r"); - } - else { + TRACE_ERROR("Bad bBWI\n\r"); + } + else { - // APDU or TPDU - switch(configurationDescriptorsFS->ccid.dwFeatures - & (CCID_FEATURES_EXC_TPDU|CCID_FEATURES_EXC_SAPDU|CCID_FEATURES_EXC_APDU)) { + // APDU or TPDU + switch(configurationDescriptorsFS->ccid.dwFeatures + & (CCID_FEATURES_EXC_TPDU|CCID_FEATURES_EXC_SAPDU|CCID_FEATURES_EXC_APDU)) { - case CCID_FEATURES_EXC_TPDU: - if (ccidDriver.ProtocolDataStructure[1] == PROTOCOL_TO) { - TRACE_DEBUG("APDU cmd: %x %x %x ..", ccidDriver.sCcidCommand.APDU[0], ccidDriver.sCcidCommand.APDU[1],ccidDriver.sCcidCommand.APDU[2] ); + case CCID_FEATURES_EXC_TPDU: + if (ccidDriver.ProtocolDataStructure[1] == PROTOCOL_TO) { + TRACE_DEBUG("APDU cmd: %x %x %x ..", ccidDriver.sCcidCommand.APDU[0], ccidDriver.sCcidCommand.APDU[1],ccidDriver.sCcidCommand.APDU[2] ); - // Send commande APDU - ret = ISO7816_XfrBlockTPDU_T0( ccidDriver.sCcidCommand.APDU , - ccidDriver.sCcidMessage.abData, - ccidDriver.sCcidCommand.wLength, - &msglen ); - if (ret != 0) { - TRACE_ERROR("APDU could not be sent: (US_CSR = 0x%x)", ret); - return; - } - } - else { - if (ccidDriver.ProtocolDataStructure[1] == PROTOCOL_T1) { - TRACE_DEBUG("Not supported T=1\n\r"); - } - else { - TRACE_DEBUG("Not supported 0x%x\n\r", ccidDriver.ProtocolDataStructure[1]); - } - } - break; + // Send commande APDU + ret = ISO7816_XfrBlockTPDU_T0( ccidDriver.sCcidCommand.APDU , + ccidDriver.sCcidMessage.abData, + ccidDriver.sCcidCommand.wLength, + &msglen ); + if (ret != 0) { + TRACE_ERROR("APDU could not be sent: (US_CSR = 0x%x)", ret); + return; + } + } + else { + if (ccidDriver.ProtocolDataStructure[1] == PROTOCOL_T1) { + TRACE_DEBUG("Not supported T=1\n\r"); + } + else { + TRACE_DEBUG("Not supported 0x%x\n\r", ccidDriver.ProtocolDataStructure[1]); + } + } + break; - case CCID_FEATURES_EXC_APDU: - TRACE_DEBUG("Not supported CCID_FEATURES_EXC_APDU\n\r"); - break; + case CCID_FEATURES_EXC_APDU: + TRACE_DEBUG("Not supported CCID_FEATURES_EXC_APDU\n\r"); + break; - default: - break; - } + default: + break; + } - } + } - ccidDriver.sCcidMessage.wLength = msglen; - TRACE_DEBUG("USB: 0x%X, 0x%X, 0x%X, 0x%X, 0x%X\n\r", ccidDriver.sCcidMessage.abData[0], - ccidDriver.sCcidMessage.abData[1], - ccidDriver.sCcidMessage.abData[2], - ccidDriver.sCcidMessage.abData[3], - ccidDriver.sCcidMessage.abData[4] ); - RDRtoPCDatablock(); + ccidDriver.sCcidMessage.wLength = msglen; + TRACE_DEBUG("USB: 0x%X, 0x%X, 0x%X, 0x%X, 0x%X\n\r", ccidDriver.sCcidMessage.abData[0], + ccidDriver.sCcidMessage.abData[1], + ccidDriver.sCcidMessage.abData[2], + ccidDriver.sCcidMessage.abData[3], + ccidDriver.sCcidMessage.abData[4] ); + RDRtoPCDatablock(); } @@ -497,21 +497,21 @@ //------------------------------------------------------------------------------ static void PCtoRDRGetParameters( void ) { - TRACE_DEBUG("."); + TRACE_DEBUG("."); - // We support only one slot + // We support only one slot - // bmIccStatus - if( ISO7816_StatusReset() ) { - // 0: An ICC is present and active (power is on and stable, RST is inactive - ccidDriver.sCcidMessage.bStatus = 0; - } - else { - // 1: An ICC is present and inactive (not activated or shut down by hardware error) - ccidDriver.sCcidMessage.bStatus = 1; - } + // bmIccStatus + if( ISO7816_StatusReset() ) { + // 0: An ICC is present and active (power is on and stable, RST is inactive + ccidDriver.sCcidMessage.bStatus = 0; + } + else { + // 1: An ICC is present and inactive (not activated or shut down by hardware error) + ccidDriver.sCcidMessage.bStatus = 1; + } - RDRtoPCParameters(); + RDRtoPCParameters(); } //------------------------------------------------------------------------------ @@ -520,12 +520,12 @@ //------------------------------------------------------------------------------ static void PCtoRDRResetParameters( void ) { - TRACE_DEBUG("."); + TRACE_DEBUG("."); - ccidDriver.SlotStatus = ICC_NOT_PRESENT; - ccidDriver.sCcidMessage.bStatus = ccidDriver.SlotStatus; + ccidDriver.SlotStatus = ICC_NOT_PRESENT; + ccidDriver.sCcidMessage.bStatus = ccidDriver.SlotStatus; - RDRtoPCParameters(); + RDRtoPCParameters(); } //------------------------------------------------------------------------------ @@ -534,13 +534,13 @@ //------------------------------------------------------------------------------ static void PCtoRDRSetParameters( void ) { - TRACE_DEBUG("."); + TRACE_DEBUG("."); - ccidDriver.SlotStatus = ccidDriver.sCcidCommand.bSlot; - ccidDriver.sCcidMessage.bStatus = ccidDriver.SlotStatus; - // Not all feature supported + ccidDriver.SlotStatus = ccidDriver.sCcidCommand.bSlot; + ccidDriver.sCcidMessage.bStatus = ccidDriver.SlotStatus; + // Not all feature supported - RDRtoPCParameters(); + RDRtoPCParameters(); } //------------------------------------------------------------------------------ @@ -551,13 +551,13 @@ //------------------------------------------------------------------------------ static void PCtoRDREscape( void ) { - TRACE_DEBUG("."); + TRACE_DEBUG("."); - // If needed by the user - ISO7816_Escape(); + // If needed by the user + ISO7816_Escape(); - // stub, return all value send - RDRtoPCEscape( ccidDriver.sCcidCommand.wLength, ccidDriver.sCcidCommand.APDU); + // stub, return all value send + RDRtoPCEscape( ccidDriver.sCcidCommand.wLength, ccidDriver.sCcidCommand.APDU); } //------------------------------------------------------------------------------ @@ -566,18 +566,18 @@ //------------------------------------------------------------------------------ static void PCtoRDRICCClock( void ) { - TRACE_DEBUG("."); + TRACE_DEBUG("."); - if( 0 == ccidDriver.sCcidCommand.bSpecific_0 ) { - // restarts the clock - ISO7816_RestartClock(); - } - else { - // stop clock in the state shown in the bClockStop field - ISO7816_StopClock(); - } + if( 0 == ccidDriver.sCcidCommand.bSpecific_0 ) { + // restarts the clock + ISO7816_RestartClock(); + } + else { + // stop clock in the state shown in the bClockStop field + ISO7816_StopClock(); + } - RDRtoPCSlotStatus( ); + RDRtoPCSlotStatus( ); } //------------------------------------------------------------------------------ @@ -587,22 +587,22 @@ //------------------------------------------------------------------------------ static void PCtoRDRtoAPDU( void ) { - unsigned char bmChanges; - unsigned char bClassGetResponse; - unsigned char bClassEnvelope; + unsigned char bmChanges; + unsigned char bClassGetResponse; + unsigned char bClassEnvelope; - TRACE_INFO("."); + TRACE_INFO("."); - if( configurationDescriptorsFS->ccid.dwFeatures == (CCID_FEATURES_EXC_SAPDU|CCID_FEATURES_EXC_APDU) ) { + if( configurationDescriptorsFS->ccid.dwFeatures == (CCID_FEATURES_EXC_SAPDU|CCID_FEATURES_EXC_APDU) ) { - bmChanges = ccidDriver.sCcidCommand.bSpecific_0; - bClassGetResponse = ccidDriver.sCcidCommand.bSpecific_1; - bClassEnvelope = ccidDriver.sCcidCommand.bSpecific_2; + bmChanges = ccidDriver.sCcidCommand.bSpecific_0; + bClassGetResponse = ccidDriver.sCcidCommand.bSpecific_1; + bClassEnvelope = ccidDriver.sCcidCommand.bSpecific_2; - ISO7816_toAPDU(); - } + ISO7816_toAPDU(); + } - RDRtoPCSlotStatus(); + RDRtoPCSlotStatus(); } //------------------------------------------------------------------------------ @@ -612,9 +612,9 @@ //------------------------------------------------------------------------------ static void PCtoRDRSecure( void ) { - TRACE_DEBUG("."); + TRACE_DEBUG("."); - TRACE_DEBUG("For user\n\r"); + TRACE_DEBUG("For user\n\r"); } //------------------------------------------------------------------------------ @@ -627,10 +627,10 @@ //------------------------------------------------------------------------------ static void PCtoRDRMechanical( void ) { - TRACE_DEBUG("."); - TRACE_DEBUG("Not implemented\n\r"); + TRACE_DEBUG("."); + TRACE_DEBUG("Not implemented\n\r"); - RDRtoPCSlotStatus(); + RDRtoPCSlotStatus(); } //------------------------------------------------------------------------------ @@ -641,9 +641,9 @@ //------------------------------------------------------------------------------ static void PCtoRDRAbort( void ) { - TRACE_DEBUG("."); + TRACE_DEBUG("."); - RDRtoPCSlotStatus(); + RDRtoPCSlotStatus(); } //------------------------------------------------------------------------------ @@ -653,24 +653,24 @@ //------------------------------------------------------------------------------ static void PCtoRDRSetDataRateAndClockFrequency( void ) { - unsigned int dwClockFrequency; - unsigned int dwDataRate; + unsigned int dwClockFrequency; + unsigned int dwDataRate; - TRACE_DEBUG("."); + TRACE_DEBUG("."); - dwClockFrequency = ccidDriver.sCcidCommand.APDU[0] - + (ccidDriver.sCcidCommand.APDU[1]<<8) - + (ccidDriver.sCcidCommand.APDU[2]<<16) - + (ccidDriver.sCcidCommand.APDU[3]<<24); + dwClockFrequency = ccidDriver.sCcidCommand.APDU[0] + + (ccidDriver.sCcidCommand.APDU[1]<<8) + + (ccidDriver.sCcidCommand.APDU[2]<<16) + + (ccidDriver.sCcidCommand.APDU[3]<<24); - dwDataRate = ccidDriver.sCcidCommand.APDU[4] - + (ccidDriver.sCcidCommand.APDU[5]<<8) - + (ccidDriver.sCcidCommand.APDU[6]<<16) - + (ccidDriver.sCcidCommand.APDU[7]<<24); + dwDataRate = ccidDriver.sCcidCommand.APDU[4] + + (ccidDriver.sCcidCommand.APDU[5]<<8) + + (ccidDriver.sCcidCommand.APDU[6]<<16) + + (ccidDriver.sCcidCommand.APDU[7]<<24); - ISO7816_SetDataRateandClockFrequency( dwClockFrequency, dwDataRate ); + ISO7816_SetDataRateandClockFrequency( dwClockFrequency, dwDataRate ); - RDRtoPCDataRateAndClockFrequency( dwClockFrequency, dwDataRate ); + RDRtoPCDataRateAndClockFrequency( dwClockFrequency, dwDataRate ); } @@ -679,20 +679,20 @@ //------------------------------------------------------------------------------ static void vCCIDCommandNotSupported( void ) { - // Command not supported - // vCCIDReportError(CMD_NOT_SUPPORTED); + // Command not supported + // vCCIDReportError(CMD_NOT_SUPPORTED); - TRACE_DEBUG("CMD_NOT_SUPPORTED\n\r"); + TRACE_DEBUG("CMD_NOT_SUPPORTED\n\r"); - // Header fields settings - ccidDriver.sCcidMessage.bMessageType = RDR_TO_PC_SLOTSTATUS; - ccidDriver.sCcidMessage.wLength = 0; - ccidDriver.sCcidMessage.bSpecific = 0; + // Header fields settings + ccidDriver.sCcidMessage.bMessageType = RDR_TO_PC_SLOTSTATUS; + ccidDriver.sCcidMessage.wLength = 0; + ccidDriver.sCcidMessage.bSpecific = 0; - ccidDriver.sCcidMessage.bStatus |= ICC_CS_FAILED; + ccidDriver.sCcidMessage.bStatus |= ICC_CS_FAILED; - // Send the response to the host - //vCCIDSendResponse(); + // Send the response to the host + //vCCIDSendResponse(); } //------------------------------------------------------------------------------ @@ -700,15 +700,15 @@ //------------------------------------------------------------------------------ static void vCCIDSendResponse( void ) { - unsigned char bStatus; - TRACE_DEBUG("."); + unsigned char bStatus; + TRACE_DEBUG("."); - do { - bStatus = CCID_Write((void*)&ccidDriver.sCcidMessage, - ccidDriver.sCcidMessage.bSizeToSend, 0, 0 ); - } while (bStatus != USBD_STATUS_SUCCESS); + do { + bStatus = CCID_Write((void*)&ccidDriver.sCcidMessage, + ccidDriver.sCcidMessage.bSizeToSend, 0, 0 ); + } while (bStatus != USBD_STATUS_SUCCESS); - TRACE_DEBUG("bStatus: 0x%x\n\r", bStatus); + TRACE_DEBUG("bStatus: 0x%x\n\r", bStatus); } @@ -717,133 +717,133 @@ //------------------------------------------------------------------------------ static void CCIDCommandDispatcher( void *pArg, uint8_t status, uint32_t transferred, uint32_t remaining ) { - unsigned char MessageToSend = 0; + unsigned char MessageToSend = 0; - if (status != USBD_STATUS_SUCCESS) { - TRACE_ERROR("USB error: %d", status); - return; - } - TRACE_DEBUG("Command: 0x%X 0x%x 0x%X 0x%X 0x%X 0x%X 0x%X\n\r\n\r", - (unsigned int)ccidDriver.sCcidCommand.bMessageType, - (unsigned int)ccidDriver.sCcidCommand.wLength, - (unsigned int)ccidDriver.sCcidCommand.bSlot, - (unsigned int)ccidDriver.sCcidCommand.bSeq, - (unsigned int)ccidDriver.sCcidCommand.bSpecific_0, - (unsigned int)ccidDriver.sCcidCommand.bSpecific_1, - (unsigned int)ccidDriver.sCcidCommand.bSpecific_2); + if (status != USBD_STATUS_SUCCESS) { + TRACE_ERROR("USB error: %d", status); + return; + } + TRACE_DEBUG("Command: 0x%X 0x%x 0x%X 0x%X 0x%X 0x%X 0x%X\n\r\n\r", + (unsigned int)ccidDriver.sCcidCommand.bMessageType, + (unsigned int)ccidDriver.sCcidCommand.wLength, + (unsigned int)ccidDriver.sCcidCommand.bSlot, + (unsigned int)ccidDriver.sCcidCommand.bSeq, + (unsigned int)ccidDriver.sCcidCommand.bSpecific_0, + (unsigned int)ccidDriver.sCcidCommand.bSpecific_1, + (unsigned int)ccidDriver.sCcidCommand.bSpecific_2); - // Check the slot number - if ( ccidDriver.sCcidCommand.bSlot > 0 ) { + // Check the slot number + if ( ccidDriver.sCcidCommand.bSlot > 0 ) { - TRACE_ERROR("BAD_SLOT_NUMBER\n\r"); - } + TRACE_ERROR("BAD_SLOT_NUMBER\n\r"); + } - TRACE_INFO("typ=0x%X\n\r", ccidDriver.sCcidCommand.bMessageType); + TRACE_INFO("typ=0x%X\n\r", ccidDriver.sCcidCommand.bMessageType); - ccidDriver.sCcidMessage.bStatus = 0; + ccidDriver.sCcidMessage.bStatus = 0; - ccidDriver.sCcidMessage.bSeq = ccidDriver.sCcidCommand.bSeq; - ccidDriver.sCcidMessage.bSlot = ccidDriver.sCcidCommand.bSlot; + ccidDriver.sCcidMessage.bSeq = ccidDriver.sCcidCommand.bSeq; + ccidDriver.sCcidMessage.bSlot = ccidDriver.sCcidCommand.bSlot; - ccidDriver.sCcidMessage.bSizeToSend = sizeof(S_ccid_bulk_in_header)-(ABDATA_SIZE+1); + ccidDriver.sCcidMessage.bSizeToSend = sizeof(S_ccid_bulk_in_header)-(ABDATA_SIZE+1); - // Command dispatcher - switch ( ccidDriver.sCcidCommand.bMessageType ) { + // Command dispatcher + switch ( ccidDriver.sCcidCommand.bMessageType ) { - case PC_TO_RDR_ICCPOWERON: - PCtoRDRIccPowerOn(); - MessageToSend = 1; - break; + case PC_TO_RDR_ICCPOWERON: + PCtoRDRIccPowerOn(); + MessageToSend = 1; + break; - case PC_TO_RDR_ICCPOWEROFF: - PCtoRDRIccPowerOff(); - MessageToSend = 1; - break; + case PC_TO_RDR_ICCPOWEROFF: + PCtoRDRIccPowerOff(); + MessageToSend = 1; + break; - case PC_TO_RDR_GETSLOTSTATUS: - PCtoRDRGetSlotStatus(); - MessageToSend = 1; - break; + case PC_TO_RDR_GETSLOTSTATUS: + PCtoRDRGetSlotStatus(); + MessageToSend = 1; + break; - case PC_TO_RDR_XFRBLOCK: - PCtoRDRXfrBlock(); - MessageToSend = 1; - break; + case PC_TO_RDR_XFRBLOCK: + PCtoRDRXfrBlock(); + MessageToSend = 1; + break; - case PC_TO_RDR_GETPARAMETERS: - PCtoRDRGetParameters(); - MessageToSend = 1; - break; + case PC_TO_RDR_GETPARAMETERS: + PCtoRDRGetParameters(); + MessageToSend = 1; + break; - case PC_TO_RDR_RESETPARAMETERS: - PCtoRDRResetParameters(); - MessageToSend = 1; - break; + case PC_TO_RDR_RESETPARAMETERS: + PCtoRDRResetParameters(); + MessageToSend = 1; + break; - case PC_TO_RDR_SETPARAMETERS: - PCtoRDRSetParameters(); - MessageToSend = 1; - break; + case PC_TO_RDR_SETPARAMETERS: + PCtoRDRSetParameters(); + MessageToSend = 1; + break; - case PC_TO_RDR_ESCAPE: - PCtoRDREscape(); - MessageToSend = 1; - break; + case PC_TO_RDR_ESCAPE: + PCtoRDREscape(); + MessageToSend = 1; + break; - case PC_TO_RDR_ICCCLOCK: - PCtoRDRICCClock(); - MessageToSend = 1; - break; + case PC_TO_RDR_ICCCLOCK: + PCtoRDRICCClock(); + MessageToSend = 1; + break; - case PC_TO_RDR_T0APDU: - // Only CCIDs reporting a short or extended APDU level in the dwFeatures - // field of the CCID class descriptor may take this command into account. - if( (CCID_FEATURES_EXC_SAPDU == (CCID_FEATURES_EXC_SAPDU&configurationDescriptorsFS->ccid.dwFeatures)) - || (CCID_FEATURES_EXC_APDU == (CCID_FEATURES_EXC_APDU &configurationDescriptorsFS->ccid.dwFeatures)) ) { + case PC_TO_RDR_T0APDU: + // Only CCIDs reporting a short or extended APDU level in the dwFeatures + // field of the CCID class descriptor may take this command into account. + if( (CCID_FEATURES_EXC_SAPDU == (CCID_FEATURES_EXC_SAPDU&configurationDescriptorsFS->ccid.dwFeatures)) + || (CCID_FEATURES_EXC_APDU == (CCID_FEATURES_EXC_APDU &configurationDescriptorsFS->ccid.dwFeatures)) ) { - // command supported - PCtoRDRtoAPDU(); - } - else { - // command not supported - TRACE_INFO("Not supported: PC_TO_RDR_T0APDU\n\r"); - vCCIDCommandNotSupported(); - } - MessageToSend = 1; - break; + // command supported + PCtoRDRtoAPDU(); + } + else { + // command not supported + TRACE_INFO("Not supported: PC_TO_RDR_T0APDU\n\r"); + vCCIDCommandNotSupported(); + } + MessageToSend = 1; + break; - case PC_TO_RDR_SECURE: - PCtoRDRSecure(); - MessageToSend = 1; - break; + case PC_TO_RDR_SECURE: + PCtoRDRSecure(); + MessageToSend = 1; + break; - case PC_TO_RDR_MECHANICAL: - PCtoRDRMechanical(); - MessageToSend = 1; - break; + case PC_TO_RDR_MECHANICAL: + PCtoRDRMechanical(); + MessageToSend = 1; + break; - case PC_TO_RDR_ABORT: - PCtoRDRAbort(); - MessageToSend = 1; - break; + case PC_TO_RDR_ABORT: + PCtoRDRAbort(); + MessageToSend = 1; + break; - case PC_TO_RDR_SETDATARATEANDCLOCKFREQUENCY: - PCtoRDRSetDataRateAndClockFrequency(); - MessageToSend = 1; - break; + case PC_TO_RDR_SETDATARATEANDCLOCKFREQUENCY: + PCtoRDRSetDataRateAndClockFrequency(); + MessageToSend = 1; + break; - default: - TRACE_DEBUG("default: Not supported: 0x%X\n\r", ccidDriver.sCcidCommand.bMessageType); - vCCIDCommandNotSupported(); - MessageToSend = 1; - break; + default: + TRACE_DEBUG("default: Not supported: 0x%X\n\r", ccidDriver.sCcidCommand.bMessageType); + vCCIDCommandNotSupported(); + MessageToSend = 1; + break; - } + } - if( MessageToSend == 1 ) { - vCCIDSendResponse(); - } + if( MessageToSend == 1 ) { + vCCIDSendResponse(); + } } @@ -853,49 +853,49 @@ //------------------------------------------------------------------------------ static void CCID_RequestHandler(const USBGenericRequest *pRequest) { - TRACE_DEBUG("CCID_RHl\n\r"); + TRACE_DEBUG("CCID_RHl\n\r"); - // Check if this is a class request - if (USBGenericRequest_GetType(pRequest) == USBGenericRequest_CLASS) { + // Check if this is a class request + if (USBGenericRequest_GetType(pRequest) == USBGenericRequest_CLASS) { - // Check if the request is supported - switch (USBGenericRequest_GetRequest(pRequest)) { + // Check if the request is supported + switch (USBGenericRequest_GetRequest(pRequest)) { - case CCIDGenericRequest_ABORT: - TRACE_DEBUG("CCIDGenericRequest_ABORT\n\r"); - break; + case CCIDGenericRequest_ABORT: + TRACE_DEBUG("CCIDGenericRequest_ABORT\n\r"); + break; - case CCIDGenericRequest_GET_CLOCK_FREQUENCIES: - TRACE_DEBUG("Not supported: CCIDGenericRequest_GET_CLOCK_FREQUENCIES\n\r"); - // A CCID with bNumClockSupported equal to 00h does not have - // to support this request - break; + case CCIDGenericRequest_GET_CLOCK_FREQUENCIES: + TRACE_DEBUG("Not supported: CCIDGenericRequest_GET_CLOCK_FREQUENCIES\n\r"); + // A CCID with bNumClockSupported equal to 00h does not have + // to support this request + break; - case CCIDGenericRequest_GET_DATA_RATES: - TRACE_DEBUG("Not supported: CCIDGenericRequest_GET_DATA_RATES\n\r"); - // A CCID with bNumDataRatesSupported equal to 00h does not have - // to support this request. - break; + case CCIDGenericRequest_GET_DATA_RATES: + TRACE_DEBUG("Not supported: CCIDGenericRequest_GET_DATA_RATES\n\r"); + // A CCID with bNumDataRatesSupported equal to 00h does not have + // to support this request. + break; - default: - TRACE_WARNING( "CCIDDriver_RequestHandler: Unsupported request (%d)\n\r", - USBGenericRequest_GetRequest(pRequest)); - USBD_Stall(0); - } - } + default: + TRACE_WARNING( "CCIDDriver_RequestHandler: Unsupported request (%d)\n\r", + USBGenericRequest_GetRequest(pRequest)); + USBD_Stall(0); + } + } - else if (USBGenericRequest_GetType(pRequest) == USBGenericRequest_STANDARD) { + else if (USBGenericRequest_GetType(pRequest) == USBGenericRequest_STANDARD) { - // Forward request to the standard handler - USBDDriver_RequestHandler(USBD_GetDriver(), pRequest); - } - else { + // Forward request to the standard handler + USBDDriver_RequestHandler(USBD_GetDriver(), pRequest); + } + else { - // Unsupported request type - TRACE_WARNING( "CCIDDriver_RequestHandler: Unsupported request type (%d)\n\r", - USBGenericRequest_GetType(pRequest)); - USBD_Stall(0); - } + // Unsupported request type + TRACE_WARNING( "CCIDDriver_RequestHandler: Unsupported request type (%d)\n\r", + USBGenericRequest_GetType(pRequest)); + USBD_Stall(0); + } } @@ -910,7 +910,7 @@ // not static function void USBDCallbacks_RequestReceived(const USBGenericRequest *request) { - CCID_RequestHandler(request); + CCID_RequestHandler(request); } #endif @@ -920,17 +920,17 @@ //------------------------------------------------------------------------------ void CCID_SmartCardRequest( void ) { - unsigned char bStatus; - TRACE_DEBUG("CCID_req\n"); + unsigned char bStatus; + TRACE_DEBUG("CCID_req\n"); - do { + do { - bStatus = CCID_Read( (void*)&ccidDriver.sCcidCommand, - sizeof(S_ccid_bulk_out_header), - (TransferCallback)&CCIDCommandDispatcher, - (void*)0 ); - } - while (0); + bStatus = CCID_Read( (void*)&ccidDriver.sCcidCommand, + sizeof(S_ccid_bulk_out_header), + (TransferCallback)&CCIDCommandDispatcher, + (void*)0 ); + } + while (0); } @@ -943,11 +943,11 @@ /// \return USBD_STATUS_LOCKED or USBD_STATUS_SUCCESS //------------------------------------------------------------------------------ unsigned char CCID_Read(void *pBuffer, - unsigned int dLength, - TransferCallback fCallback, - void *pArgument) + unsigned int dLength, + TransferCallback fCallback, + void *pArgument) { - return USBD_Read(CCID_EPT_DATA_OUT, pBuffer, dLength, fCallback, pArgument); + return USBD_Read(CCID_EPT_DATA_OUT, pBuffer, dLength, fCallback, pArgument); } //------------------------------------------------------------------------------ @@ -959,11 +959,11 @@ /// \return USBD_STATUS_LOCKED or USBD_STATUS_SUCCESS //------------------------------------------------------------------------------ unsigned char CCID_Write(void *pBuffer, - unsigned int dLength, - TransferCallback fCallback, - void *pArgument) + unsigned int dLength, + TransferCallback fCallback, + void *pArgument) { - return USBD_Write(CCID_EPT_DATA_IN, pBuffer, dLength, fCallback, pArgument); + return USBD_Write(CCID_EPT_DATA_IN, pBuffer, dLength, fCallback, pArgument); } //------------------------------------------------------------------------------ @@ -973,15 +973,15 @@ //------------------------------------------------------------------------------ unsigned char CCID_Insertion( void ) { - TRACE_DEBUG("."); + TRACE_DEBUG("."); - // Build the Interrupt-IN message - ccidDriver.BufferINT[0] = RDR_TO_PC_NOTIFYSLOTCHANGE; - ccidDriver.BufferINT[1] = ICC_INSERTED_EVENT; - ccidDriver.SlotStatus = ICC_INSERTED_EVENT; + // Build the Interrupt-IN message + ccidDriver.BufferINT[0] = RDR_TO_PC_NOTIFYSLOTCHANGE; + ccidDriver.BufferINT[1] = ICC_INSERTED_EVENT; + ccidDriver.SlotStatus = ICC_INSERTED_EVENT; - // Notify the host that a ICC is inserted - return USBD_Write( CCID_EPT_NOTIFICATION, ccidDriver.BufferINT, 2, 0, 0 ); + // Notify the host that a ICC is inserted + return USBD_Write( CCID_EPT_NOTIFICATION, ccidDriver.BufferINT, 2, 0, 0 ); } //------------------------------------------------------------------------------ @@ -991,15 +991,15 @@ //------------------------------------------------------------------------------ unsigned char CCID_Removal( void ) { - TRACE_DEBUG("."); + TRACE_DEBUG("."); - // Build the Interrupt-IN message - ccidDriver.BufferINT[0] = RDR_TO_PC_NOTIFYSLOTCHANGE; - ccidDriver.BufferINT[1] = ICC_NOT_PRESENT; - ccidDriver.SlotStatus = ICC_NOT_PRESENT; + // Build the Interrupt-IN message + ccidDriver.BufferINT[0] = RDR_TO_PC_NOTIFYSLOTCHANGE; + ccidDriver.BufferINT[1] = ICC_NOT_PRESENT; + ccidDriver.SlotStatus = ICC_NOT_PRESENT; - // Notify the host that a ICC is inserted - return USBD_Write( CCID_EPT_NOTIFICATION, ccidDriver.BufferINT, 2, 0, 0 ); + // Notify the host that a ICC is inserted + return USBD_Write( CCID_EPT_NOTIFICATION, ccidDriver.BufferINT, 2, 0, 0 ); } //------------------------------------------------------------------------------ @@ -1014,19 +1014,19 @@ /// \return USBD_STATUS_LOCKED or USBD_STATUS_SUCCESS //------------------------------------------------------------------------------ unsigned char RDRtoPCHardwareError( unsigned char bSlot, - unsigned char bSeq, - unsigned char bHardwareErrorCode ) + unsigned char bSeq, + unsigned char bHardwareErrorCode ) { - TRACE_DEBUG("."); + TRACE_DEBUG("."); - // Build the Interrupt-IN message - ccidDriver.BufferINT[0] = RDR_TO_PC_HARDWAREERROR; - ccidDriver.BufferINT[1] = bSlot; - ccidDriver.BufferINT[2] = bSeq; - ccidDriver.BufferINT[3] = bHardwareErrorCode; + // Build the Interrupt-IN message + ccidDriver.BufferINT[0] = RDR_TO_PC_HARDWAREERROR; + ccidDriver.BufferINT[1] = bSlot; + ccidDriver.BufferINT[2] = bSeq; + ccidDriver.BufferINT[3] = bHardwareErrorCode; - // Notify the host that a ICC is inserted - return USBD_Write( CCID_EPT_NOTIFICATION, ccidDriver.BufferINT, 4, 0, 0 ); + // Notify the host that a ICC is inserted + return USBD_Write( CCID_EPT_NOTIFICATION, ccidDriver.BufferINT, 4, 0, 0 ); } #endif /* HAVE_CCID */ diff --git a/firmware/libcommon/source/iso7816_4.c b/firmware/libcommon/source/iso7816_4.c index 7219741..ac15306 100644 --- a/firmware/libcommon/source/iso7816_4.c +++ b/firmware/libcommon/source/iso7816_4.c @@ -76,45 +76,45 @@ */ uint32_t ISO7816_GetChar( uint8_t *pCharToReceive, Usart_info *usart) { - uint32_t status; - uint32_t timeout=0; + uint32_t status; + uint32_t timeout=0; - Usart *us_base = usart->base; - uint32_t us_id = usart->id; + Usart *us_base = usart->base; + uint32_t us_id = usart->id; - if( usart->state == USART_SEND ) { - while((us_base->US_CSR & US_CSR_TXEMPTY) == 0) {} - us_base->US_CR = US_CR_RSTSTA | US_CR_RSTIT | US_CR_RSTNACK; - usart->state = USART_RCV; - } + if( usart->state == USART_SEND ) { + while((us_base->US_CSR & US_CSR_TXEMPTY) == 0) {} + us_base->US_CR = US_CR_RSTSTA | US_CR_RSTIT | US_CR_RSTNACK; + usart->state = USART_RCV; + } - /* Wait USART ready for reception */ - while( ((us_base->US_CSR & US_CSR_RXRDY) == 0) ) { + /* Wait USART ready for reception */ + while( ((us_base->US_CSR & US_CSR_RXRDY) == 0) ) { WDT_Restart(WDT); - if(timeout++ > 12000 * (BOARD_MCK/1000000)) { - TRACE_WARNING("TimeOut\n\r"); - return( 0 ); - } - } + if(timeout++ > 12000 * (BOARD_MCK/1000000)) { + TRACE_WARNING("TimeOut\n\r"); + return( 0 ); + } + } - /* At least one complete character has been received and US_RHR has not yet been read. */ + /* At least one complete character has been received and US_RHR has not yet been read. */ - /* Get a char */ - *pCharToReceive = ((us_base->US_RHR) & 0xFF); + /* Get a char */ + *pCharToReceive = ((us_base->US_RHR) & 0xFF); - status = (us_base->US_CSR&(US_CSR_OVRE|US_CSR_FRAME| - US_CSR_PARE|US_CSR_TIMEOUT|US_CSR_NACK| - (1<<10))); + status = (us_base->US_CSR&(US_CSR_OVRE|US_CSR_FRAME| + US_CSR_PARE|US_CSR_TIMEOUT|US_CSR_NACK| + (1<<10))); - if (status != 0 ) { - TRACE_DEBUG("R:0x%" PRIX32 "\n\r", status); - TRACE_DEBUG("R:0x%" PRIX32 "\n\r", us_base->US_CSR); - TRACE_DEBUG("Nb:0x%" PRIX32 "\n\r", us_base->US_NER ); - us_base->US_CR = US_CR_RSTSTA; - } + if (status != 0 ) { + TRACE_DEBUG("R:0x%" PRIX32 "\n\r", status); + TRACE_DEBUG("R:0x%" PRIX32 "\n\r", us_base->US_CSR); + TRACE_DEBUG("Nb:0x%" PRIX32 "\n\r", us_base->US_NER ); + us_base->US_CR = US_CR_RSTSTA; + } - /* Return status */ - return( status ); + /* Return status */ + return( status ); } @@ -125,50 +125,50 @@ */ uint32_t ISO7816_SendChar( uint8_t CharToSend, Usart_info *usart ) { - uint32_t status; + uint32_t status; - Usart *us_base = usart->base; - uint32_t us_id = usart->id; + Usart *us_base = usart->base; + uint32_t us_id = usart->id; - if( usart->state == USART_RCV ) { - us_base->US_CR = US_CR_RSTSTA | US_CR_RSTIT | US_CR_RSTNACK; - usart->state = USART_SEND; - } + if( usart->state == USART_RCV ) { + us_base->US_CR = US_CR_RSTSTA | US_CR_RSTIT | US_CR_RSTNACK; + usart->state = USART_SEND; + } - /* Wait USART ready for transmit */ - int i = 0; - while((us_base->US_CSR & (US_CSR_TXRDY)) == 0) { - i++; - if (!(i%1000000)) { - printf("s: %x ", us_base->US_CSR); - printf("s: %x\r\n", us_base->US_RHR & 0xFF); - us_base->US_CR = US_CR_RSTTX; - us_base->US_CR = US_CR_RSTRX; - } - } - /* There is no character in the US_THR */ + /* Wait USART ready for transmit */ + int i = 0; + while((us_base->US_CSR & (US_CSR_TXRDY)) == 0) { + i++; + if (!(i%1000000)) { + printf("s: %x ", us_base->US_CSR); + printf("s: %x\r\n", us_base->US_RHR & 0xFF); + us_base->US_CR = US_CR_RSTTX; + us_base->US_CR = US_CR_RSTRX; + } + } + /* There is no character in the US_THR */ - /* Transmit a char */ - us_base->US_THR = CharToSend; + /* Transmit a char */ + us_base->US_THR = CharToSend; - TRACE_ERROR("Sx%02X\r\n", CharToSend); + TRACE_ERROR("Sx%02X\r\n", CharToSend); - status = (us_base->US_CSR&(US_CSR_OVRE|US_CSR_FRAME| - US_CSR_PARE|US_CSR_TIMEOUT|US_CSR_NACK| - (1<<10))); + status = (us_base->US_CSR&(US_CSR_OVRE|US_CSR_FRAME| + US_CSR_PARE|US_CSR_TIMEOUT|US_CSR_NACK| + (1<<10))); - if (status != 0 ) { - TRACE_INFO("******* status: 0x%" PRIX32 " (Overrun: %" PRIX32 - ", NACK: %" PRIX32 ", Timeout: %" PRIX32 ", underrun: %" PRIX32 ")\n\r", - status, ((status & US_CSR_OVRE)>> 5), ((status & US_CSR_NACK) >> 13), - ((status & US_CSR_TIMEOUT) >> 8), ((status & (1 << 10)) >> 10)); - TRACE_INFO("E (USART CSR reg):0x%" PRIX32 "\n\r", us_base->US_CSR); - TRACE_INFO("Nb (Number of errors):0x%" PRIX32 "\n\r", us_base->US_NER ); - us_base->US_CR = US_CR_RSTSTA; - } + if (status != 0 ) { + TRACE_INFO("******* status: 0x%" PRIX32 " (Overrun: %" PRIX32 + ", NACK: %" PRIX32 ", Timeout: %" PRIX32 ", underrun: %" PRIX32 ")\n\r", + status, ((status & US_CSR_OVRE)>> 5), ((status & US_CSR_NACK) >> 13), + ((status & US_CSR_TIMEOUT) >> 8), ((status & (1 << 10)) >> 10)); + TRACE_INFO("E (USART CSR reg):0x%" PRIX32 "\n\r", us_base->US_CSR); + TRACE_INFO("Nb (Number of errors):0x%" PRIX32 "\n\r", us_base->US_NER ); + us_base->US_CR = US_CR_RSTSTA; + } - /* Return status */ - return( status ); + /* Return status */ + return( status ); } @@ -177,10 +177,10 @@ */ static void ISO7816_IccPowerOn( void ) { - /* Set RESET Master Card */ - if (st_pinIso7816RstMC) { - PIO_Set(st_pinIso7816RstMC); - } + /* Set RESET Master Card */ + if (st_pinIso7816RstMC) { + PIO_Set(st_pinIso7816RstMC); + } } /*---------------------------------------------------------------------------- @@ -192,10 +192,10 @@ */ void ISO7816_IccPowerOff( void ) { - /* Clear RESET Master Card */ - if (st_pinIso7816RstMC) { - PIO_Clear(st_pinIso7816RstMC); - } + /* Clear RESET Master Card */ + if (st_pinIso7816RstMC) { + PIO_Clear(st_pinIso7816RstMC); + } } /** @@ -207,159 +207,159 @@ * \return 0 on success, content of US_CSR otherwise */ uint32_t ISO7816_XfrBlockTPDU_T0(const uint8_t *pAPDU, - uint8_t *pMessage, - uint16_t wLength, - uint16_t *retlen ) + uint8_t *pMessage, + uint16_t wLength, + uint16_t *retlen ) { - uint16_t NeNc; - uint16_t indexApdu = 4; - uint16_t indexMsg = 0; - uint8_t SW1 = 0; - uint8_t procByte; - uint8_t cmdCase; - uint32_t status = 0; + uint16_t NeNc; + uint16_t indexApdu = 4; + uint16_t indexMsg = 0; + uint8_t SW1 = 0; + uint8_t procByte; + uint8_t cmdCase; + uint32_t status = 0; - TRACE_INFO("pAPDU[0]=0x%X\n\r",pAPDU[0]); - TRACE_INFO("pAPDU[1]=0x%X\n\r",pAPDU[1]); - TRACE_INFO("pAPDU[2]=0x%X\n\r",pAPDU[2]); - TRACE_INFO("pAPDU[3]=0x%X\n\r",pAPDU[3]); - TRACE_INFO("pAPDU[4]=0x%X\n\r",pAPDU[4]); - TRACE_INFO("pAPDU[5]=0x%X\n\r",pAPDU[5]); - TRACE_INFO("wlength=%d\n\r",wLength); + TRACE_INFO("pAPDU[0]=0x%X\n\r",pAPDU[0]); + TRACE_INFO("pAPDU[1]=0x%X\n\r",pAPDU[1]); + TRACE_INFO("pAPDU[2]=0x%X\n\r",pAPDU[2]); + TRACE_INFO("pAPDU[3]=0x%X\n\r",pAPDU[3]); + TRACE_INFO("pAPDU[4]=0x%X\n\r",pAPDU[4]); + TRACE_INFO("pAPDU[5]=0x%X\n\r",pAPDU[5]); + TRACE_INFO("wlength=%d\n\r",wLength); - ISO7816_SendChar( pAPDU[0], &usart_sim ); /* CLA */ - ISO7816_SendChar( pAPDU[1], &usart_sim ); /* INS */ - ISO7816_SendChar( pAPDU[2], &usart_sim ); /* P1 */ - ISO7816_SendChar( pAPDU[3], &usart_sim ); /* P2 */ - ISO7816_SendChar( pAPDU[4], &usart_sim ); /* P3 */ + ISO7816_SendChar( pAPDU[0], &usart_sim ); /* CLA */ + ISO7816_SendChar( pAPDU[1], &usart_sim ); /* INS */ + ISO7816_SendChar( pAPDU[2], &usart_sim ); /* P1 */ + ISO7816_SendChar( pAPDU[3], &usart_sim ); /* P2 */ + ISO7816_SendChar( pAPDU[4], &usart_sim ); /* P3 */ - /* Handle the four structures of command APDU */ - indexApdu = 5; + /* Handle the four structures of command APDU */ + indexApdu = 5; - if( wLength == 4 ) { - cmdCase = CASE1; - NeNc = 0; - } - else if( wLength == 5) { - cmdCase = CASE2; - NeNc = pAPDU[4]; /* C5 */ - if (NeNc == 0) { - NeNc = 256; - } - } - else if( wLength == 6) { - NeNc = pAPDU[4]; /* C5 */ - cmdCase = CASE3; - } - else if( wLength == 7) { - NeNc = pAPDU[4]; /* C5 */ - if( NeNc == 0 ) { - cmdCase = CASE2; - NeNc = (pAPDU[5]<<8)+pAPDU[6]; - } - else { - cmdCase = CASE3; - } - } - else { - NeNc = pAPDU[4]; /* C5 */ - if( NeNc == 0 ) { - cmdCase = CASE3; - NeNc = (pAPDU[5]<<8)+pAPDU[6]; - } - else { - cmdCase = CASE3; - } - } + if( wLength == 4 ) { + cmdCase = CASE1; + NeNc = 0; + } + else if( wLength == 5) { + cmdCase = CASE2; + NeNc = pAPDU[4]; /* C5 */ + if (NeNc == 0) { + NeNc = 256; + } + } + else if( wLength == 6) { + NeNc = pAPDU[4]; /* C5 */ + cmdCase = CASE3; + } + else if( wLength == 7) { + NeNc = pAPDU[4]; /* C5 */ + if( NeNc == 0 ) { + cmdCase = CASE2; + NeNc = (pAPDU[5]<<8)+pAPDU[6]; + } + else { + cmdCase = CASE3; + } + } + else { + NeNc = pAPDU[4]; /* C5 */ + if( NeNc == 0 ) { + cmdCase = CASE3; + NeNc = (pAPDU[5]<<8)+pAPDU[6]; + } + else { + cmdCase = CASE3; + } + } - TRACE_DEBUG("CASE=0x%X NeNc=0x%X\n\r", cmdCase, NeNc); + TRACE_DEBUG("CASE=0x%X NeNc=0x%X\n\r", cmdCase, NeNc); - /* Handle Procedure Bytes */ - do { - status = ISO7816_GetChar(&procByte, &usart_sim); - if (status != 0) { - return status; - } - TRACE_INFO("procByte: 0x%X\n\r", procByte); - /* Handle NULL */ - if ( procByte == ISO_NULL_VAL ) { - TRACE_INFO("INS\n\r"); - continue; - } - /* Handle SW1 */ - else if ( ((procByte & 0xF0) ==0x60) || ((procByte & 0xF0) ==0x90) ) { - TRACE_INFO("SW1\n\r"); - SW1 = 1; - } - /* Handle INS */ - else if ( pAPDU[1] == procByte) { - TRACE_INFO("HdlINS\n\r"); - if (cmdCase == CASE2) { - /* receive data from card */ - do { - status = ISO7816_GetChar(&pMessage[indexMsg++], &usart_sim); - } while(( 0 != --NeNc) && (status == 0) ); - if (status != 0) { - return status; - } - } - else { - /* Send data */ - do { - TRACE_INFO("Send %X", pAPDU[indexApdu]); - ISO7816_SendChar(pAPDU[indexApdu++], &usart_sim); - } while( 0 != --NeNc ); - } - } - /* Handle INS ^ 0xff */ - else - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wsign-compare" - if ( pAPDU[1] == (procByte ^ 0xff)) { - #pragma GCC diagnostic pop - TRACE_INFO("HdlINS+\n\r"); - if (cmdCase == CASE2) { - /* receive data from card */ - status = ISO7816_GetChar(&pMessage[indexMsg++], &usart_sim); - if (status != 0) { - return status; - } - TRACE_INFO("Rcv: 0x%X\n\r", pMessage[indexMsg-1]); - } - else { - status = ISO7816_SendChar(pAPDU[indexApdu++], &usart_sim); - if (status != 0) { - return status; - } - } - NeNc--; - } - else { - /* ?? */ - TRACE_INFO("procByte=0x%X\n\r", procByte); - break; - } - } while (NeNc != 0); + /* Handle Procedure Bytes */ + do { + status = ISO7816_GetChar(&procByte, &usart_sim); + if (status != 0) { + return status; + } + TRACE_INFO("procByte: 0x%X\n\r", procByte); + /* Handle NULL */ + if ( procByte == ISO_NULL_VAL ) { + TRACE_INFO("INS\n\r"); + continue; + } + /* Handle SW1 */ + else if ( ((procByte & 0xF0) ==0x60) || ((procByte & 0xF0) ==0x90) ) { + TRACE_INFO("SW1\n\r"); + SW1 = 1; + } + /* Handle INS */ + else if ( pAPDU[1] == procByte) { + TRACE_INFO("HdlINS\n\r"); + if (cmdCase == CASE2) { + /* receive data from card */ + do { + status = ISO7816_GetChar(&pMessage[indexMsg++], &usart_sim); + } while(( 0 != --NeNc) && (status == 0) ); + if (status != 0) { + return status; + } + } + else { + /* Send data */ + do { + TRACE_INFO("Send %X", pAPDU[indexApdu]); + ISO7816_SendChar(pAPDU[indexApdu++], &usart_sim); + } while( 0 != --NeNc ); + } + } + /* Handle INS ^ 0xff */ + else + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wsign-compare" + if ( pAPDU[1] == (procByte ^ 0xff)) { + #pragma GCC diagnostic pop + TRACE_INFO("HdlINS+\n\r"); + if (cmdCase == CASE2) { + /* receive data from card */ + status = ISO7816_GetChar(&pMessage[indexMsg++], &usart_sim); + if (status != 0) { + return status; + } + TRACE_INFO("Rcv: 0x%X\n\r", pMessage[indexMsg-1]); + } + else { + status = ISO7816_SendChar(pAPDU[indexApdu++], &usart_sim); + if (status != 0) { + return status; + } + } + NeNc--; + } + else { + /* ?? */ + TRACE_INFO("procByte=0x%X\n\r", procByte); + break; + } + } while (NeNc != 0); - /* Status Bytes */ - if (SW1 == 0) { - status = ISO7816_GetChar(&pMessage[indexMsg++], &usart_sim); /* SW1 */ - if (status != 0) { - return status; - } - } - else { - pMessage[indexMsg++] = procByte; - } - status = ISO7816_GetChar(&pMessage[indexMsg++], &usart_sim); /* SW2 */ - if (status != 0) { - return status; - } + /* Status Bytes */ + if (SW1 == 0) { + status = ISO7816_GetChar(&pMessage[indexMsg++], &usart_sim); /* SW1 */ + if (status != 0) { + return status; + } + } + else { + pMessage[indexMsg++] = procByte; + } + status = ISO7816_GetChar(&pMessage[indexMsg++], &usart_sim); /* SW2 */ + if (status != 0) { + return status; + } - TRACE_WARNING("SW1=0x%X, SW2=0x%X\n\r", pMessage[indexMsg-2], pMessage[indexMsg-1]); + TRACE_WARNING("SW1=0x%X, SW2=0x%X\n\r", pMessage[indexMsg-2], pMessage[indexMsg-1]); - *retlen = indexMsg; - return status; + *retlen = indexMsg; + return status; } @@ -368,7 +368,7 @@ */ void ISO7816_Escape( void ) { - TRACE_DEBUG("For user, if needed\n\r"); + TRACE_DEBUG("For user, if needed\n\r"); } /** @@ -376,8 +376,8 @@ */ void ISO7816_RestartClock( void ) { - TRACE_DEBUG("ISO7816_RestartClock\n\r"); - USART_SIM->US_BRGR = 13; + TRACE_DEBUG("ISO7816_RestartClock\n\r"); + USART_SIM->US_BRGR = 13; } /** @@ -385,8 +385,8 @@ */ void ISO7816_StopClock( void ) { - TRACE_DEBUG("ISO7816_StopClock\n\r"); - USART_SIM->US_BRGR = 0; + TRACE_DEBUG("ISO7816_StopClock\n\r"); + USART_SIM->US_BRGR = 0; } /** @@ -394,8 +394,8 @@ */ void ISO7816_toAPDU( void ) { - TRACE_DEBUG("ISO7816_toAPDU\n\r"); - TRACE_DEBUG("Not supported at this time\n\r"); + TRACE_DEBUG("ISO7816_toAPDU\n\r"); + TRACE_DEBUG("Not supported at this time\n\r"); } /** @@ -406,64 +406,64 @@ */ uint32_t ISO7816_Datablock_ATR( uint8_t* pAtr, uint8_t* pLength ) { - uint32_t i; - uint32_t j; - uint32_t y; - uint32_t status = 0; + uint32_t i; + uint32_t j; + uint32_t y; + uint32_t status = 0; - *pLength = 0; + *pLength = 0; - /* Read ATR TS */ - // FIXME: There should always be a check for the GetChar return value..0 means timeout - status = ISO7816_GetChar(&pAtr[0], &usart_sim); - if (status != 0) { - return status; - } + /* Read ATR TS */ + // FIXME: There should always be a check for the GetChar return value..0 means timeout + status = ISO7816_GetChar(&pAtr[0], &usart_sim); + if (status != 0) { + return status; + } - /* Read ATR T0 */ - status = ISO7816_GetChar(&pAtr[1], &usart_sim); - if (status != 0) { - return status; - } - y = pAtr[1] & 0xF0; - i = 2; + /* Read ATR T0 */ + status = ISO7816_GetChar(&pAtr[1], &usart_sim); + if (status != 0) { + return status; + } + y = pAtr[1] & 0xF0; + i = 2; - /* Read ATR Ti */ - while (y && (status == 0)) { + /* Read ATR Ti */ + while (y && (status == 0)) { - if (y & 0x10) { /* TA[i] */ - status = ISO7816_GetChar(&pAtr[i++], &usart_sim); - } - if (y & 0x20) { /* TB[i] */ - status = ISO7816_GetChar(&pAtr[i++], &usart_sim); - } - if (y & 0x40) { /* TC[i] */ - status = ISO7816_GetChar(&pAtr[i++], &usart_sim); - } - if (y & 0x80) { /* TD[i] */ - status = ISO7816_GetChar(&pAtr[i], &usart_sim); - y = pAtr[i++] & 0xF0; - } - else { - y = 0; - } - } - if (status != 0) { - return status; - } + if (y & 0x10) { /* TA[i] */ + status = ISO7816_GetChar(&pAtr[i++], &usart_sim); + } + if (y & 0x20) { /* TB[i] */ + status = ISO7816_GetChar(&pAtr[i++], &usart_sim); + } + if (y & 0x40) { /* TC[i] */ + status = ISO7816_GetChar(&pAtr[i++], &usart_sim); + } + if (y & 0x80) { /* TD[i] */ + status = ISO7816_GetChar(&pAtr[i], &usart_sim); + y = pAtr[i++] & 0xF0; + } + else { + y = 0; + } + } + if (status != 0) { + return status; + } - /* Historical Bytes */ - y = pAtr[1] & 0x0F; - for( j=0; (j < y) && (status == 0); j++ ) { - status = ISO7816_GetChar(&pAtr[i++], &usart_sim); - } + /* Historical Bytes */ + y = pAtr[1] & 0x0F; + for( j=0; (j < y) && (status == 0); j++ ) { + status = ISO7816_GetChar(&pAtr[i++], &usart_sim); + } - if (status != 0) { - return status; - } + if (status != 0) { + return status; + } - *pLength = i; - return status; + *pLength = i; + return status; } /** @@ -473,18 +473,18 @@ */ void ISO7816_SetDataRateandClockFrequency( uint32_t dwClockFrequency, uint32_t dwDataRate ) { - uint8_t ClockFrequency; + uint8_t ClockFrequency; - /* Define the baud rate divisor register */ - /* CD = MCK / SCK */ - /* SCK = FIDI x BAUD = 372 x 9600 */ - /* BOARD_MCK */ - /* CD = MCK/(FIDI x BAUD) = 48000000 / (372x9600) = 13 */ - USART_SIM->US_BRGR = BOARD_MCK / (dwClockFrequency*1000); + /* Define the baud rate divisor register */ + /* CD = MCK / SCK */ + /* SCK = FIDI x BAUD = 372 x 9600 */ + /* BOARD_MCK */ + /* CD = MCK/(FIDI x BAUD) = 48000000 / (372x9600) = 13 */ + USART_SIM->US_BRGR = BOARD_MCK / (dwClockFrequency*1000); - ClockFrequency = BOARD_MCK / USART_SIM->US_BRGR; + ClockFrequency = BOARD_MCK / USART_SIM->US_BRGR; - USART_SIM->US_FIDI = (ClockFrequency)/dwDataRate; + USART_SIM->US_FIDI = (ClockFrequency)/dwDataRate; } @@ -494,10 +494,10 @@ */ uint8_t ISO7816_StatusReset( void ) { - if (st_pinIso7816RstMC) { - return PIO_Get(st_pinIso7816RstMC); - } - return 0; + if (st_pinIso7816RstMC) { + return PIO_Get(st_pinIso7816RstMC); + } + return 0; } /** @@ -505,16 +505,16 @@ */ void ISO7816_cold_reset( void ) { - volatile uint32_t i; + volatile uint32_t i; - /* tb: wait ??? cycles*/ - for( i=0; i<(400*(BOARD_MCK/1000000)); i++ ) { - } + /* tb: wait ??? cycles*/ + for( i=0; i<(400*(BOARD_MCK/1000000)); i++ ) { + } - USART_SIM->US_RHR; - USART_SIM->US_CR = US_CR_RSTSTA | US_CR_RSTIT | US_CR_RSTNACK; + USART_SIM->US_RHR; + USART_SIM->US_CR = US_CR_RSTSTA | US_CR_RSTIT | US_CR_RSTNACK; - ISO7816_IccPowerOn(); + ISO7816_IccPowerOn(); } /** @@ -522,20 +522,20 @@ */ void ISO7816_warm_reset( void ) { - volatile uint32_t i; + volatile uint32_t i; // Clears Reset - ISO7816_IccPowerOff(); + ISO7816_IccPowerOff(); - /* tb: wait ??? cycles */ - for( i=0; i<(400*(BOARD_MCK/1000000)); i++ ) { - } + /* tb: wait ??? cycles */ + for( i=0; i<(400*(BOARD_MCK/1000000)); i++ ) { + } - USART_SIM->US_RHR; - USART_SIM->US_CR = US_CR_RSTSTA | US_CR_RSTIT | US_CR_RSTNACK; + USART_SIM->US_RHR; + USART_SIM->US_CR = US_CR_RSTSTA | US_CR_RSTIT | US_CR_RSTNACK; // Sets Reset - ISO7816_IccPowerOn(); + ISO7816_IccPowerOn(); } /** @@ -544,99 +544,99 @@ */ void ISO7816_Decode_ATR( uint8_t* pAtr ) { - uint32_t i; - uint32_t j; - uint32_t y; - uint8_t offset; + uint32_t i; + uint32_t j; + uint32_t y; + uint8_t offset; - printf("\n\r"); - printf("ATR: Answer To Reset:\n\r"); - printf("TS = 0x%X Initial character ",pAtr[0]); - if( pAtr[0] == 0x3B ) { + printf("\n\r"); + printf("ATR: Answer To Reset:\n\r"); + printf("TS = 0x%X Initial character ",pAtr[0]); + if( pAtr[0] == 0x3B ) { - printf("Direct Convention\n\r"); - } - else { - if( pAtr[0] == 0x3F ) { + printf("Direct Convention\n\r"); + } + else { + if( pAtr[0] == 0x3F ) { - printf("Inverse Convention\n\r"); - } - else { - printf("BAD Convention\n\r"); - } - } + printf("Inverse Convention\n\r"); + } + else { + printf("BAD Convention\n\r"); + } + } - printf("T0 = 0x%X Format caracter\n\r",pAtr[1]); - printf(" Number of historical bytes: K = %d\n\r", pAtr[1]&0x0F); - printf(" Presence further interface byte:\n\r"); - if( pAtr[1]&0x80 ) { - printf("TA "); - } - if( pAtr[1]&0x40 ) { - printf("TB "); - } - if( pAtr[1]&0x20 ) { - printf("TC "); - } - if( pAtr[1]&0x10 ) { - printf("TD "); - } - if( pAtr[1] != 0 ) { - printf(" present\n\r"); - } + printf("T0 = 0x%X Format caracter\n\r",pAtr[1]); + printf(" Number of historical bytes: K = %d\n\r", pAtr[1]&0x0F); + printf(" Presence further interface byte:\n\r"); + if( pAtr[1]&0x80 ) { + printf("TA "); + } + if( pAtr[1]&0x40 ) { + printf("TB "); + } + if( pAtr[1]&0x20 ) { + printf("TC "); + } + if( pAtr[1]&0x10 ) { + printf("TD "); + } + if( pAtr[1] != 0 ) { + printf(" present\n\r"); + } - i = 2; - y = pAtr[1] & 0xF0; + i = 2; + y = pAtr[1] & 0xF0; - /* Read ATR Ti */ - offset = 1; - while (y) { + /* Read ATR Ti */ + offset = 1; + while (y) { - if (y & 0x10) { /* TA[i] */ - printf("TA[%d] = 0x%X ", offset, pAtr[i]); - if( offset == 1 ) { - printf("FI = %d ", (pAtr[i]>>8)); - printf("DI = %d", (pAtr[i]&0x0F)); - } - printf("\n\r"); - i++; - } - if (y & 0x20) { /* TB[i] */ - printf("TB[%d] = 0x%X\n\r", offset, pAtr[i]); - i++; - } - if (y & 0x40) { /* TC[i] */ - printf("TC[%d] = 0x%X ", offset, pAtr[i]); - if( offset == 1 ) { - printf("Extra Guard Time: N = %d", pAtr[i]); - } - printf("\n\r"); - i++; - } - if (y & 0x80) { /* TD[i] */ - printf("TD[%d] = 0x%X\n\r", offset, pAtr[i]); - y = pAtr[i++] & 0xF0; - } - else { - y = 0; - } - offset++; - } + if (y & 0x10) { /* TA[i] */ + printf("TA[%d] = 0x%X ", offset, pAtr[i]); + if( offset == 1 ) { + printf("FI = %d ", (pAtr[i]>>8)); + printf("DI = %d", (pAtr[i]&0x0F)); + } + printf("\n\r"); + i++; + } + if (y & 0x20) { /* TB[i] */ + printf("TB[%d] = 0x%X\n\r", offset, pAtr[i]); + i++; + } + if (y & 0x40) { /* TC[i] */ + printf("TC[%d] = 0x%X ", offset, pAtr[i]); + if( offset == 1 ) { + printf("Extra Guard Time: N = %d", pAtr[i]); + } + printf("\n\r"); + i++; + } + if (y & 0x80) { /* TD[i] */ + printf("TD[%d] = 0x%X\n\r", offset, pAtr[i]); + y = pAtr[i++] & 0xF0; + } + else { + y = 0; + } + offset++; + } - /* Historical Bytes */ - printf("Historical bytes:\n\r"); - y = pAtr[1] & 0x0F; - for( j=0; j < y; j++ ) { - printf(" 0x%X", pAtr[i]); - i++; - } - printf("\n\r\n\r"); + /* Historical Bytes */ + printf("Historical bytes:\n\r"); + y = pAtr[1] & 0x0F; + for( j=0; j < y; j++ ) { + printf(" 0x%X", pAtr[i]); + i++; + } + printf("\n\r\n\r"); } void ISO7816_Set_Reset_Pin(const Pin *pPinIso7816RstMC) { - /* Pin ISO7816 initialize */ - st_pinIso7816RstMC = (Pin *)pPinIso7816RstMC; + /* Pin ISO7816 initialize */ + st_pinIso7816RstMC = (Pin *)pPinIso7816RstMC; } /** Initializes a ISO driver @@ -644,46 +644,46 @@ */ void ISO7816_Init( Usart_info *usart, bool master_clock ) { - uint32_t clk; - TRACE_DEBUG("ISO_Init\n\r"); + uint32_t clk; + TRACE_DEBUG("ISO_Init\n\r"); - Usart *us_base = usart->base; - uint32_t us_id = usart->id; + Usart *us_base = usart->base; + uint32_t us_id = usart->id; - if (master_clock == true) { - clk = US_MR_USCLKS_MCK; - } else { - clk = US_MR_USCLKS_SCK; - } + if (master_clock == true) { + clk = US_MR_USCLKS_MCK; + } else { + clk = US_MR_USCLKS_SCK; + } - USART_Configure( us_base, - US_MR_USART_MODE_IS07816_T_0 - | clk - | US_MR_NBSTOP_1_BIT - | US_MR_PAR_EVEN - | US_MR_CHRL_8_BIT - | US_MR_CLKO - | US_MR_INACK /* Inhibit errors */ - | (3<<24), /* MAX_ITERATION */ - 1, - 0); + USART_Configure( us_base, + US_MR_USART_MODE_IS07816_T_0 + | clk + | US_MR_NBSTOP_1_BIT + | US_MR_PAR_EVEN + | US_MR_CHRL_8_BIT + | US_MR_CLKO + | US_MR_INACK /* Inhibit errors */ + | (3<<24), /* MAX_ITERATION */ + 1, + 0); - /* Disable interrupts */ - us_base->US_IDR = (uint32_t) -1; + /* Disable interrupts */ + us_base->US_IDR = (uint32_t) -1; - /* Configure USART */ - PMC_EnablePeripheral(us_id); + /* Configure USART */ + PMC_EnablePeripheral(us_id); - us_base->US_FIDI = 372; /* by default */ - /* Define the baud rate divisor register */ - /* CD = MCK / SCK */ - /* SCK = FIDI x BAUD = 372 x 9600 */ - /* BOARD_MCK */ - /* CD = MCK/(FIDI x BAUD) = 48000000 / (372x9600) = 13 */ - if (master_clock == true) { - us_base->US_BRGR = BOARD_MCK / (372*9600); - } else { - us_base->US_BRGR = US_BRGR_CD(1); - } + us_base->US_FIDI = 372; /* by default */ + /* Define the baud rate divisor register */ + /* CD = MCK / SCK */ + /* SCK = FIDI x BAUD = 372 x 9600 */ + /* BOARD_MCK */ + /* CD = MCK/(FIDI x BAUD) = 48000000 / (372x9600) = 13 */ + if (master_clock == true) { + us_base->US_BRGR = BOARD_MCK / (372*9600); + } else { + us_base->US_BRGR = US_BRGR_CD(1); + } } diff --git a/firmware/libcommon/source/mode_cardemu.c b/firmware/libcommon/source/mode_cardemu.c index bc91273..c7362cf 100644 --- a/firmware/libcommon/source/mode_cardemu.c +++ b/firmware/libcommon/source/mode_cardemu.c @@ -202,7 +202,7 @@ csr = usart->US_CSR & usart->US_IMR; if (csr & US_CSR_RXRDY) { - byte = (usart->US_RHR) & 0xFF; + byte = (usart->US_RHR) & 0xFF; if (rbuf_write(&ci->rb, byte) < 0) TRACE_ERROR("rbuf overrun\r\n"); } diff --git a/firmware/libcommon/source/mode_ccid.c b/firmware/libcommon/source/mode_ccid.c index 77d4158..516826e 100644 --- a/firmware/libcommon/source/mode_ccid.c +++ b/firmware/libcommon/source/mode_ccid.c @@ -84,11 +84,11 @@ static void ISR_PioSmartCard(const Pin * pPin) { /* FIXME: why is pinSmartCard.pio->PIO_ISR the wrong number? - printf("+++++ Trying to check for pending interrupts (PIO ISR: 0x%X)\n\r", pinSmartCard.pio->PIO_ISR); - printf("+++++ Mask: 0x%X\n\r", pinSmartCard.mask); + printf("+++++ Trying to check for pending interrupts (PIO ISR: 0x%X)\n\r", pinSmartCard.pio->PIO_ISR); + printf("+++++ Mask: 0x%X\n\r", pinSmartCard.mask); Output: - +++++ Trying to check for pending interrupts (PIO ISR: 0x400)) = 1<<10 - +++++ Mask: 0x100 = 1<<8 + +++++ Trying to check for pending interrupts (PIO ISR: 0x400)) = 1<<10 + +++++ Mask: 0x100 = 1<<8 */ // PA10 is DTXD, which is the debug uart transmit pin diff --git a/firmware/libcommon/source/stdio.c b/firmware/libcommon/source/stdio.c index 32bd617..505c895 100644 --- a/firmware/libcommon/source/stdio.c +++ b/firmware/libcommon/source/stdio.c @@ -76,8 +76,8 @@ //------------------------------------------------------------------------------ signed int PutChar(char *pStr, char c) { - *pStr = c; - return 1; + *pStr = c; + return 1; } //------------------------------------------------------------------------------ @@ -89,15 +89,15 @@ //------------------------------------------------------------------------------ signed int PutString(char *pStr, const char *pSource) { - signed int num = 0; + signed int num = 0; - while (*pSource != 0) { + while (*pSource != 0) { - *pStr++ = *pSource++; - num++; - } + *pStr++ = *pSource++; + num++; + } - return num; + return num; } //------------------------------------------------------------------------------ @@ -110,38 +110,38 @@ // \param value Integer value. //------------------------------------------------------------------------------ signed int PutUnsignedInt( - char *pStr, - char fill, - signed int width, - unsigned int value) + char *pStr, + char fill, + signed int width, + unsigned int value) { - signed int num = 0; + signed int num = 0; - // Take current digit into account when calculating width - width--; + // Take current digit into account when calculating width + width--; - // Recursively write upper digits - if ((value / 10) > 0) { + // Recursively write upper digits + if ((value / 10) > 0) { - num = PutUnsignedInt(pStr, fill, width, value / 10); - pStr += num; - } - // Write filler characters - else { + num = PutUnsignedInt(pStr, fill, width, value / 10); + pStr += num; + } + // Write filler characters + else { - while (width > 0) { + while (width > 0) { - PutChar(pStr, fill); - pStr++; - num++; - width--; - } - } + PutChar(pStr, fill); + pStr++; + num++; + width--; + } + } - // Write lower digit - num += PutChar(pStr, (value % 10) + '0'); + // Write lower digit + num += PutChar(pStr, (value % 10) + '0'); - return num; + return num; } //------------------------------------------------------------------------------ @@ -154,69 +154,69 @@ // \param value Signed integer value. //------------------------------------------------------------------------------ signed int PutSignedInt( - char *pStr, - char fill, - signed int width, - signed int value) + char *pStr, + char fill, + signed int width, + signed int value) { - signed int num = 0; - unsigned int absolute; + signed int num = 0; + unsigned int absolute; - // Compute absolute value - if (value < 0) { + // Compute absolute value + if (value < 0) { - absolute = -value; - } - else { + absolute = -value; + } + else { - absolute = value; - } + absolute = value; + } - // Take current digit into account when calculating width - width--; + // Take current digit into account when calculating width + width--; - // Recursively write upper digits - if ((absolute / 10) > 0) { + // Recursively write upper digits + if ((absolute / 10) > 0) { - if (value < 0) { - - num = PutSignedInt(pStr, fill, width, -(absolute / 10)); - } - else { + if (value < 0) { + + num = PutSignedInt(pStr, fill, width, -(absolute / 10)); + } + else { - num = PutSignedInt(pStr, fill, width, absolute / 10); - } - pStr += num; - } - else { + num = PutSignedInt(pStr, fill, width, absolute / 10); + } + pStr += num; + } + else { - // Reserve space for sign - if (value < 0) { + // Reserve space for sign + if (value < 0) { - width--; - } + width--; + } - // Write filler characters - while (width > 0) { + // Write filler characters + while (width > 0) { - PutChar(pStr, fill); - pStr++; - num++; - width--; - } + PutChar(pStr, fill); + pStr++; + num++; + width--; + } - // Write sign - if (value < 0) { + // Write sign + if (value < 0) { - num += PutChar(pStr, '-'); - pStr++; - } - } + num += PutChar(pStr, '-'); + pStr++; + } + } - // Write lower digit - num += PutChar(pStr, (absolute % 10) + '0'); + // Write lower digit + num += PutChar(pStr, (absolute % 10) + '0'); - return num; + return num; } //------------------------------------------------------------------------------ @@ -230,51 +230,51 @@ // \param value Hexadecimal value. //------------------------------------------------------------------------------ signed int PutHexa( - char *pStr, - char fill, - signed int width, - unsigned char maj, - unsigned int value) + char *pStr, + char fill, + signed int width, + unsigned char maj, + unsigned int value) { - signed int num = 0; + signed int num = 0; - // Decrement width - width--; + // Decrement width + width--; - // Recursively output upper digits - if ((value >> 4) > 0) { + // Recursively output upper digits + if ((value >> 4) > 0) { - num += PutHexa(pStr, fill, width, maj, value >> 4); - pStr += num; - } - // Write filler chars - else { + num += PutHexa(pStr, fill, width, maj, value >> 4); + pStr += num; + } + // Write filler chars + else { - while (width > 0) { + while (width > 0) { - PutChar(pStr, fill); - pStr++; - num++; - width--; - } - } + PutChar(pStr, fill); + pStr++; + num++; + width--; + } + } - // Write current digit - if ((value & 0xF) < 10) { + // Write current digit + if ((value & 0xF) < 10) { - PutChar(pStr, (value & 0xF) + '0'); - } - else if (maj) { + PutChar(pStr, (value & 0xF) + '0'); + } + else if (maj) { - PutChar(pStr, (value & 0xF) - 10 + 'A'); - } - else { + PutChar(pStr, (value & 0xF) - 10 + 'A'); + } + else { - PutChar(pStr, (value & 0xF) - 10 + 'a'); - } - num++; + PutChar(pStr, (value & 0xF) - 10 + 'a'); + } + num++; - return num; + return num; } //------------------------------------------------------------------------------ @@ -292,91 +292,91 @@ //------------------------------------------------------------------------------ signed int vsnprintf(char *pStr, size_t length, const char *pFormat, va_list ap) { - char fill; - unsigned char width; - signed int num = 0; - size_t size = 0; + char fill; + unsigned char width; + signed int num = 0; + size_t size = 0; - // Clear the string - if (pStr) { + // Clear the string + if (pStr) { - *pStr = 0; - } + *pStr = 0; + } - // Phase string - while (*pFormat != 0 && size < length) { + // Phase string + while (*pFormat != 0 && size < length) { - // Normal character - if (*pFormat != '%') { + // Normal character + if (*pFormat != '%') { - *pStr++ = *pFormat++; - size++; - } - // Escaped '%' - else if (*(pFormat+1) == '%') { + *pStr++ = *pFormat++; + size++; + } + // Escaped '%' + else if (*(pFormat+1) == '%') { - *pStr++ = '%'; - pFormat += 2; - size++; - } - // Token delimiter - else { + *pStr++ = '%'; + pFormat += 2; + size++; + } + // Token delimiter + else { - fill = ' '; - width = 0; - pFormat++; + fill = ' '; + width = 0; + pFormat++; - // Parse filler - if (*pFormat == '0') { + // Parse filler + if (*pFormat == '0') { - fill = '0'; - pFormat++; - } + fill = '0'; + pFormat++; + } - // Parse width - while ((*pFormat >= '0') && (*pFormat <= '9')) { - - width = (width*10) + *pFormat-'0'; - pFormat++; - } + // Parse width + while ((*pFormat >= '0') && (*pFormat <= '9')) { + + width = (width*10) + *pFormat-'0'; + pFormat++; + } - // Check if there is enough space - if (size + width > length) { + // Check if there is enough space + if (size + width > length) { - width = length - size; - } - - // Parse type - switch (*pFormat) { - case 'd': - case 'i': num = PutSignedInt(pStr, fill, width, va_arg(ap, signed int)); break; - case 'u': num = PutUnsignedInt(pStr, fill, width, va_arg(ap, unsigned int)); break; - case 'x': num = PutHexa(pStr, fill, width, 0, va_arg(ap, unsigned int)); break; - case 'X': num = PutHexa(pStr, fill, width, 1, va_arg(ap, unsigned int)); break; - case 's': num = PutString(pStr, va_arg(ap, char *)); break; - case 'c': num = PutChar(pStr, va_arg(ap, unsigned int)); break; - default: - return EOF; - } + width = length - size; + } + + // Parse type + switch (*pFormat) { + case 'd': + case 'i': num = PutSignedInt(pStr, fill, width, va_arg(ap, signed int)); break; + case 'u': num = PutUnsignedInt(pStr, fill, width, va_arg(ap, unsigned int)); break; + case 'x': num = PutHexa(pStr, fill, width, 0, va_arg(ap, unsigned int)); break; + case 'X': num = PutHexa(pStr, fill, width, 1, va_arg(ap, unsigned int)); break; + case 's': num = PutString(pStr, va_arg(ap, char *)); break; + case 'c': num = PutChar(pStr, va_arg(ap, unsigned int)); break; + default: + return EOF; + } - pFormat++; - pStr += num; - size += num; - } - } + pFormat++; + pStr += num; + size += num; + } + } - // NULL-terminated (final \0 is not counted) - if (size < length) { + // NULL-terminated (final \0 is not counted) + if (size < length) { - *pStr = 0; - } - else { + *pStr = 0; + } + else { - *(--pStr) = 0; - size--; - } + *(--pStr) = 0; + size--; + } - return size; + return size; } //------------------------------------------------------------------------------ @@ -390,14 +390,14 @@ //------------------------------------------------------------------------------ signed int snprintf(char *pString, size_t length, const char *pFormat, ...) { - va_list ap; - signed int rc; + va_list ap; + signed int rc; - va_start(ap, pFormat); - rc = vsnprintf(pString, length, pFormat, ap); - va_end(ap); + va_start(ap, pFormat); + rc = vsnprintf(pString, length, pFormat, ap); + va_end(ap); - return rc; + return rc; } //------------------------------------------------------------------------------ @@ -410,7 +410,7 @@ //------------------------------------------------------------------------------ signed int vsprintf(char *pString, const char *pFormat, va_list ap) { - return vsnprintf(pString, MAX_STRING_SIZE, pFormat, ap); + return vsnprintf(pString, MAX_STRING_SIZE, pFormat, ap); } //------------------------------------------------------------------------------ @@ -422,17 +422,17 @@ //------------------------------------------------------------------------------ signed int vfprintf(FILE *pStream, const char *pFormat, va_list ap) { - char pStr[MAX_STRING_SIZE]; - char pError[] = "stdio.c: increase MAX_STRING_SIZE\n\r"; + char pStr[MAX_STRING_SIZE]; + char pError[] = "stdio.c: increase MAX_STRING_SIZE\n\r"; - // Write formatted string in buffer - if (vsprintf(pStr, pFormat, ap) >= MAX_STRING_SIZE) { + // Write formatted string in buffer + if (vsprintf(pStr, pFormat, ap) >= MAX_STRING_SIZE) { - fputs(pError, stderr); - } + fputs(pError, stderr); + } - // Display string - return fputs(pStr, pStream); + // Display string + return fputs(pStr, pStream); } //------------------------------------------------------------------------------ @@ -443,7 +443,7 @@ //------------------------------------------------------------------------------ signed int vprintf(const char *pFormat, va_list ap) { - return vfprintf(stdout, pFormat, ap); + return vfprintf(stdout, pFormat, ap); } //------------------------------------------------------------------------------ @@ -454,15 +454,15 @@ //------------------------------------------------------------------------------ signed int fprintf(FILE *pStream, const char *pFormat, ...) { - va_list ap; - signed int result; + va_list ap; + signed int result; - // Forward call to vfprintf - va_start(ap, pFormat); - result = vfprintf(pStream, pFormat, ap); - va_end(ap); + // Forward call to vfprintf + va_start(ap, pFormat); + result = vfprintf(pStream, pFormat, ap); + va_end(ap); - return result; + return result; } //------------------------------------------------------------------------------ @@ -472,15 +472,15 @@ //------------------------------------------------------------------------------ signed int printf(const char *pFormat, ...) { - va_list ap; - signed int result; + va_list ap; + signed int result; - // Forward call to vprintf - va_start(ap, pFormat); - result = vprintf(pFormat, ap); - va_end(ap); + // Forward call to vprintf + va_start(ap, pFormat); + result = vprintf(pFormat, ap); + va_end(ap); - return result; + return result; } //------------------------------------------------------------------------------ @@ -490,15 +490,15 @@ //------------------------------------------------------------------------------ signed int sprintf(char *pStr, const char *pFormat, ...) { - va_list ap; - signed int result; + va_list ap; + signed int result; - // Forward call to vsprintf - va_start(ap, pFormat); - result = vsprintf(pStr, pFormat, ap); - va_end(ap); + // Forward call to vsprintf + va_start(ap, pFormat); + result = vsprintf(pStr, pFormat, ap); + va_end(ap); - return result; + return result; } //------------------------------------------------------------------------------ @@ -507,6 +507,6 @@ //------------------------------------------------------------------------------ signed int puts(const char *pStr) { - return fputs(pStr, stdout); + return fputs(pStr, stdout); } diff --git a/firmware/libcommon/source/string.c b/firmware/libcommon/source/string.c index dbbb0e9..0d789a0 100644 --- a/firmware/libcommon/source/string.c +++ b/firmware/libcommon/source/string.c @@ -61,33 +61,33 @@ //------------------------------------------------------------------------------ void * memcpy(void *pDestination, const void *pSource, size_t num) { - unsigned char *pByteDestination; - unsigned char *pByteSource; - unsigned int *pAlignedSource = (unsigned int *) pSource; - unsigned int *pAlignedDestination = (unsigned int *) pDestination; + unsigned char *pByteDestination; + unsigned char *pByteSource; + unsigned int *pAlignedSource = (unsigned int *) pSource; + unsigned int *pAlignedDestination = (unsigned int *) pDestination; - // If num is more than 4 bytes, and both dest. and source are aligned, - // then copy dwords - if ((((unsigned int) pAlignedDestination & 0x3) == 0) - && (((unsigned int) pAlignedSource & 0x3) == 0) - && (num >= 4)) { + // If num is more than 4 bytes, and both dest. and source are aligned, + // then copy dwords + if ((((unsigned int) pAlignedDestination & 0x3) == 0) + && (((unsigned int) pAlignedSource & 0x3) == 0) + && (num >= 4)) { - while (num >= 4) { + while (num >= 4) { - *pAlignedDestination++ = *pAlignedSource++; - num -= 4; - } - } + *pAlignedDestination++ = *pAlignedSource++; + num -= 4; + } + } - // Copy remaining bytes - pByteDestination = (unsigned char *) pAlignedDestination; - pByteSource = (unsigned char *) pAlignedSource; - while (num--) { + // Copy remaining bytes + pByteDestination = (unsigned char *) pAlignedDestination; + pByteSource = (unsigned char *) pAlignedSource; + while (num--) { - *pByteDestination++ = *pByteSource++; - } + *pByteDestination++ = *pByteSource++; + } - return pDestination; + return pDestination; } //------------------------------------------------------------------------------ @@ -99,23 +99,23 @@ //------------------------------------------------------------------------------ void * memset(void *pBuffer, int value, size_t num) { - unsigned char *pByteDestination; - unsigned int *pAlignedDestination = (unsigned int *) pBuffer; - unsigned int alignedValue = (value << 24) | (value << 16) | (value << 8) | value; + unsigned char *pByteDestination; + unsigned int *pAlignedDestination = (unsigned int *) pBuffer; + unsigned int alignedValue = (value << 24) | (value << 16) | (value << 8) | value; - // Set words if possible - if ((((unsigned int) pAlignedDestination & 0x3) == 0) && (num >= 4)) { - while (num >= 4) { - *pAlignedDestination++ = alignedValue; - num -= 4; - } - } - // Set remaining bytes - pByteDestination = (unsigned char *) pAlignedDestination; - while (num--) { - *pByteDestination++ = value; - } - return pBuffer; + // Set words if possible + if ((((unsigned int) pAlignedDestination & 0x3) == 0) && (num >= 4)) { + while (num >= 4) { + *pAlignedDestination++ = alignedValue; + num -= 4; + } + } + // Set remaining bytes + pByteDestination = (unsigned char *) pAlignedDestination; + while (num--) { + *pByteDestination++ = value; + } + return pBuffer; } //----------------------------------------------------------------------------- @@ -126,16 +126,16 @@ //----------------------------------------------------------------------------- char * strchr(const char *pString, int character) { - char * p = (char *)pString; - char c = character & 0xFF; + char * p = (char *)pString; + char c = character & 0xFF; - while(*p != c) { - if (*p == 0) { - return 0; - } - p++; - } - return p; + while(*p != c) { + if (*p == 0) { + return 0; + } + p++; + } + return p; } //----------------------------------------------------------------------------- @@ -144,12 +144,12 @@ //----------------------------------------------------------------------------- size_t strlen(const char *pString) { - unsigned int length = 0; + unsigned int length = 0; - while(*pString++ != 0) { - length++; - } - return length; + while(*pString++ != 0) { + length++; + } + return length; } @@ -161,14 +161,14 @@ //----------------------------------------------------------------------------- char * strrchr(const char *pString, int character) { - char *p = 0; + char *p = 0; - while(*pString != 0) { - if (*pString++ == character) { - p = (char*)pString; - } - } - return p; + while(*pString != 0) { + if (*pString++ == character) { + p = (char*)pString; + } + } + return p; } //----------------------------------------------------------------------------- @@ -179,10 +179,10 @@ //----------------------------------------------------------------------------- char * strcpy(char *pDestination, const char *pSource) { - char *pSaveDest = pDestination; + char *pSaveDest = pDestination; - for(; (*pDestination = *pSource) != 0; ++pSource, ++pDestination); - return pSaveDest; + for(; (*pDestination = *pSource) != 0; ++pSource, ++pDestination); + return pSaveDest; } //----------------------------------------------------------------------------- @@ -196,22 +196,22 @@ //----------------------------------------------------------------------------- int strncmp(const char *pString1, const char *pString2, size_t count) { - int r; + int r; - while(count) { - r = *pString1 - *pString2; - if (r == 0) { - if (*pString1 == 0) { - break; - } - pString1++; - pString2++; - count--; - continue; - } - return r; - } - return 0; + while(count) { + r = *pString1 - *pString2; + if (r == 0) { + if (*pString1 == 0) { + break; + } + pString1++; + pString2++; + count--; + continue; + } + return r; + } + return 0; } //----------------------------------------------------------------------------- @@ -223,17 +223,17 @@ //----------------------------------------------------------------------------- char * strncpy(char *pDestination, const char *pSource, size_t count) { - char *pSaveDest = pDestination; + char *pSaveDest = pDestination; - while (count) { - *pDestination = *pSource; - if (*pSource == 0) { - break; - } - pDestination++; - pSource++; - count--; - } - return pSaveDest; + while (count) { + *pDestination = *pSource; + if (*pSource == 0) { + break; + } + pDestination++; + pSource++; + count--; + } + return pSaveDest; } -- To view, visit https://gerrit.osmocom.org/9918 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: simtrace2 Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I86783eba0827b58303b10310e9f6b9625e1a27f1 Gerrit-Change-Number: 9918 Gerrit-PatchSet: 6 Gerrit-Owner: K?vin Redon Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerrit-no-reply at lists.osmocom.org Wed Jul 25 18:53:58 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 25 Jul 2018 18:53:58 -0000 Subject: Change in osmo-msc[master]: libmsc: move L3 call-control to separate C file (gsm_04_08_cc.c) In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9705 ) Change subject: libmsc: move L3 call-control to separate C file (gsm_04_08_cc.c) ...................................................................... libmsc: move L3 call-control to separate C file (gsm_04_08_cc.c) The CC sub-layer is fairly self-contained, so let's move it to a separate C source file. The old gsm_04_08.c file now only contains the 04.07 / DTAP core and MM sub-layer handling. I did this initially as an experiment to see how self-contained our CC implementation really is. Given this rather straight-forward patch builds fine, CC really is self-contained (yay!). Change-Id: Idb8dd7a8d9d8b4a28c492f12da3cc3305b695cca --- M include/osmocom/msc/gsm_04_08.h M src/libmsc/Makefile.am M src/libmsc/gsm_04_08.c A src/libmsc/gsm_04_08_cc.c 4 files changed, 2,142 insertions(+), 2,066 deletions(-) Approvals: Harald Welte: Looks good to me, approved Vadim Yanitskiy: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/include/osmocom/msc/gsm_04_08.h b/include/osmocom/msc/gsm_04_08.h index a99e458..8767070 100644 --- a/include/osmocom/msc/gsm_04_08.h +++ b/include/osmocom/msc/gsm_04_08.h @@ -77,5 +77,6 @@ int gsm48_multirate_config(uint8_t *lv, const struct amr_multirate_conf *mr, const struct amr_mode *modes); int gsm48_tch_rtp_create(struct gsm_trans *trans); +int gsm48_conn_sendmsg(struct msgb *msg, struct gsm_subscriber_connection *conn, struct gsm_trans *trans); #endif diff --git a/src/libmsc/Makefile.am b/src/libmsc/Makefile.am index ad8deec..a2560ea 100644 --- a/src/libmsc/Makefile.am +++ b/src/libmsc/Makefile.am @@ -32,6 +32,7 @@ msc_vty.c \ db.c \ gsm_04_08.c \ + gsm_04_08_cc.c \ gsm_04_11.c \ gsm_04_14.c \ gsm_04_80.c \ diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 04fa4b0..f81a6fa 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -80,7 +80,23 @@ static int gsm0408_loc_upd_acc(struct gsm_subscriber_connection *conn, uint32_t send_tmsi); -static uint32_t new_callref = 0x80000001; +/*! Send a simple GSM 04.08 message without any payload + * \param conn Active subscriber connection + * \param[in] pdisc Protocol discriminator + * \param[in] msg_type Message type + * \return result of \ref gsm48_conn_sendmsg + */ +int gsm48_tx_simple(struct gsm_subscriber_connection *conn, + uint8_t pdisc, uint8_t msg_type) +{ + struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 TX SIMPLE"); + struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + + gh->proto_discr = pdisc; + gh->msg_type = msg_type; + + return gsm48_conn_sendmsg(msg, conn, NULL); +} static bool classmark_is_r99(struct gsm_classmark *cm) { @@ -148,13 +164,7 @@ } } -void cc_tx_to_mncc(struct gsm_network *net, struct msgb *msg) -{ - net->mncc_recv(net, msg); -} - -static int gsm48_conn_sendmsg(struct msgb *msg, struct gsm_subscriber_connection *conn, - struct gsm_trans *trans) +int gsm48_conn_sendmsg(struct msgb *msg, struct gsm_subscriber_connection *conn, struct gsm_trans *trans) { struct gsm48_hdr *gh = (struct gsm48_hdr *) msg->data; @@ -168,23 +178,6 @@ return msc_tx_dtap(conn, msg); } -int gsm48_cc_tx_notify_ss(struct gsm_trans *trans, const char *message) -{ - struct gsm48_hdr *gh; - struct msgb *ss_notify; - - ss_notify = gsm0480_create_notifySS(message); - if (!ss_notify) - return -1; - - gsm0480_wrap_invoke(ss_notify, GSM0480_OP_CODE_NOTIFY_SS, 0); - uint8_t *data = msgb_push(ss_notify, 1); - data[0] = ss_notify->len - 1; - gh = (struct gsm48_hdr *) msgb_push(ss_notify, sizeof(*gh)); - gh->msg_type = GSM48_MT_CC_FACILITY; - return gsm48_conn_sendmsg(ss_notify, trans->conn, trans); -} - /* clear all transactions globally; used in case of MNCC socket disconnect */ void gsm0408_clear_all_trans(struct gsm_network *net, int protocol) { @@ -1269,2047 +1262,6 @@ return gsm48_conn_sendmsg(msg, conn, NULL); } -/* FIXME: this count_statistics is a state machine behaviour. we should convert - * the complete call control into a state machine. Afterwards we can move this - * code into state transitions. - */ -static void count_statistics(struct gsm_trans *trans, int new_state) -{ - int old_state = trans->cc.state; - struct rate_ctr_group *msc = trans->net->msc_ctrs; - - if (old_state == new_state) - return; - - /* state incoming */ - switch (new_state) { - case GSM_CSTATE_ACTIVE: - osmo_counter_inc(trans->net->active_calls); - rate_ctr_inc(&msc->ctr[MSC_CTR_CALL_ACTIVE]); - break; - } - - /* state outgoing */ - switch (old_state) { - case GSM_CSTATE_ACTIVE: - osmo_counter_dec(trans->net->active_calls); - if (new_state == GSM_CSTATE_DISCONNECT_REQ || - new_state == GSM_CSTATE_DISCONNECT_IND) - rate_ctr_inc(&msc->ctr[MSC_CTR_CALL_COMPLETE]); - else - rate_ctr_inc(&msc->ctr[MSC_CTR_CALL_INCOMPLETE]); - break; - } -} - -/* Call Control */ - -/* The entire call control code is written in accordance with Figure 7.10c - * for 'very early assignment', i.e. we allocate a TCH/F during IMMEDIATE - * ASSIGN, then first use that TCH/F for signalling and later MODE MODIFY - * it for voice */ - -static void new_cc_state(struct gsm_trans *trans, int state) -{ - if (state > 31 || state < 0) - return; - - DEBUGP(DCC, "(ti %02x sub %s) new state %s -> %s\n", - trans->transaction_id, - vlr_subscr_name(trans->vsub), - gsm48_cc_state_name(trans->cc.state), - gsm48_cc_state_name(state)); - - count_statistics(trans, state); - trans->cc.state = state; -} - -static int gsm48_cc_tx_status(struct gsm_trans *trans, void *arg) -{ - struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC STATUS"); - struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); - uint8_t *cause, *call_state; - - gh->msg_type = GSM48_MT_CC_STATUS; - - cause = msgb_put(msg, 3); - cause[0] = 2; - cause[1] = GSM48_CAUSE_CS_GSM | GSM48_CAUSE_LOC_USER; - cause[2] = 0x80 | 30; /* response to status inquiry */ - - call_state = msgb_put(msg, 1); - call_state[0] = 0xc0 | 0x00; - - return gsm48_conn_sendmsg(msg, trans->conn, trans); -} - -/*! Send a simple GSM 04.08 message without any payload - * \param conn Active subscriber connection - * \param[in] pdisc Protocol discriminator - * \param[in] msg_type Message type - * \return result of \ref gsm48_conn_sendmsg - */ -int gsm48_tx_simple(struct gsm_subscriber_connection *conn, - uint8_t pdisc, uint8_t msg_type) -{ - struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 TX SIMPLE"); - struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); - - gh->proto_discr = pdisc; - gh->msg_type = msg_type; - - return gsm48_conn_sendmsg(msg, conn, NULL); -} - -static void gsm48_stop_cc_timer(struct gsm_trans *trans) -{ - if (osmo_timer_pending(&trans->cc.timer)) { - DEBUGP(DCC, "stopping pending timer T%x\n", trans->cc.Tcurrent); - osmo_timer_del(&trans->cc.timer); - trans->cc.Tcurrent = 0; - } -} - -static int mncc_recvmsg(struct gsm_network *net, struct gsm_trans *trans, - int msg_type, struct gsm_mncc *mncc) -{ - struct msgb *msg; - unsigned char *data; - - DEBUGP(DMNCC, "transmit message %s\n", get_mncc_name(msg_type)); - -#if BEFORE_MSCSPLIT - /* Re-enable this log output once we can obtain this information via - * A-interface, see OS#2391. */ - if (trans) - if (trans->conn && trans->conn->lchan) - DEBUGP(DCC, "(bts %d trx %d ts %d ti %x sub %s) " - "Sending '%s' to MNCC.\n", - trans->conn->lchan->ts->trx->bts->nr, - trans->conn->lchan->ts->trx->nr, - trans->conn->lchan->ts->nr, trans->transaction_id, - vlr_subscr_msisdn_or_name(trans->vsub), - get_mncc_name(msg_type)); - else - DEBUGP(DCC, "(bts - trx - ts - ti -- sub %s) " - "Sending '%s' to MNCC.\n", - vlr_subscr_msisdn_or_name(trans->vsub), - get_mncc_name(msg_type)); - else - DEBUGP(DCC, "(bts - trx - ts - ti -- sub -) " - "Sending '%s' to MNCC.\n", get_mncc_name(msg_type)); -#else - DEBUGP(DCC, "Sending '%s' to MNCC.\n", get_mncc_name(msg_type)); -#endif - - mncc->msg_type = msg_type; - - msg = msgb_alloc(sizeof(struct gsm_mncc), "MNCC"); - if (!msg) - return -ENOMEM; - - data = msgb_put(msg, sizeof(struct gsm_mncc)); - memcpy(data, mncc, sizeof(struct gsm_mncc)); - - cc_tx_to_mncc(net, msg); - - return 0; -} - -int mncc_release_ind(struct gsm_network *net, struct gsm_trans *trans, - uint32_t callref, int location, int value) -{ - struct gsm_mncc rel; - - memset(&rel, 0, sizeof(rel)); - rel.callref = callref; - mncc_set_cause(&rel, location, value); - if (trans && trans->cc.state == GSM_CSTATE_RELEASE_REQ) - return mncc_recvmsg(net, trans, MNCC_REL_CNF, &rel); - return mncc_recvmsg(net, trans, MNCC_REL_IND, &rel); -} - -/* Call Control Specific transaction release. - * gets called by trans_free, DO NOT CALL YOURSELF! */ -void _gsm48_cc_trans_free(struct gsm_trans *trans) -{ - gsm48_stop_cc_timer(trans); - - /* Initiate the teardown of the related connections on the MGW */ - msc_mgcp_call_release(trans); - - /* send release to L4, if callref still exists */ - if (trans->callref) { - /* Ressource unavailable */ - mncc_release_ind(trans->net, trans, trans->callref, - GSM48_CAUSE_LOC_PRN_S_LU, - GSM48_CC_CAUSE_RESOURCE_UNAVAIL); - /* This is a final freeing of the transaction. The MNCC release may have triggered the - * T308 release timer, but we don't have the luxury of graceful CC Release here. */ - gsm48_stop_cc_timer(trans); - } - if (trans->cc.state != GSM_CSTATE_NULL) - new_cc_state(trans, GSM_CSTATE_NULL); -} - -static int gsm48_cc_tx_setup(struct gsm_trans *trans, void *arg); - -/* call-back from paging the B-end of the connection */ -static int setup_trig_pag_evt(unsigned int hooknum, unsigned int event, - struct msgb *msg, void *_conn, void *_transt) -{ - struct gsm_subscriber_connection *conn = _conn; - struct gsm_trans *transt = _transt; - enum gsm_paging_event paging_event = event; - - OSMO_ASSERT(!transt->conn); - - switch (paging_event) { - case GSM_PAGING_SUCCEEDED: - DEBUGP(DCC, "Paging subscr %s succeeded!\n", - vlr_subscr_msisdn_or_name(transt->vsub)); - OSMO_ASSERT(conn); - /* Assign conn */ - transt->conn = msc_subscr_conn_get(conn, MSC_CONN_USE_TRANS_CC); - transt->paging_request = NULL; - /* send SETUP request to called party */ - gsm48_cc_tx_setup(transt, &transt->cc.msg); - break; - case GSM_PAGING_EXPIRED: - case GSM_PAGING_BUSY: - DEBUGP(DCC, "Paging subscr %s %s!\n", - vlr_subscr_msisdn_or_name(transt->vsub), - paging_event == GSM_PAGING_EXPIRED ? "expired" : "busy"); - /* Temporarily out of order */ - mncc_release_ind(transt->net, transt, - transt->callref, - GSM48_CAUSE_LOC_PRN_S_LU, - GSM48_CC_CAUSE_DEST_OOO); - transt->callref = 0; - transt->paging_request = NULL; - trans_free(transt); - break; - } - - return 0; -} - -/* bridge channels of two transactions */ -static int tch_bridge(struct gsm_network *net, struct gsm_mncc_bridge *bridge) -{ - struct gsm_trans *trans1 = trans_find_by_callref(net, bridge->callref[0]); - struct gsm_trans *trans2 = trans_find_by_callref(net, bridge->callref[1]); - int rc; - - if (!trans1 || !trans2) - return -EIO; - - if (!trans1->conn || !trans2->conn) - return -EIO; - - /* Which subscriber do we want to track trans1 or trans2? */ - log_set_context(LOG_CTX_VLR_SUBSCR, trans1->vsub); - - /* Bridge RTP streams */ - rc = msc_mgcp_call_complete(trans1, trans2->conn->rtp.local_port_cn, - trans2->conn->rtp.local_addr_cn); - if (rc) - return -EINVAL; - - rc = msc_mgcp_call_complete(trans2, trans1->conn->rtp.local_port_cn, - trans1->conn->rtp.local_addr_cn); - if (rc) - return -EINVAL; - - return 0; -} - -static int gsm48_cc_rx_status_enq(struct gsm_trans *trans, struct msgb *msg) -{ - DEBUGP(DCC, "-> STATUS ENQ\n"); - return gsm48_cc_tx_status(trans, msg); -} - -static int gsm48_cc_tx_release(struct gsm_trans *trans, void *arg); -static int gsm48_cc_tx_disconnect(struct gsm_trans *trans, void *arg); - -static void gsm48_cc_timeout(void *arg) -{ - struct gsm_trans *trans = arg; - int disconnect = 0, release = 0; - int mo_cause = GSM48_CC_CAUSE_RECOVERY_TIMER; - int mo_location = GSM48_CAUSE_LOC_USER; - int l4_cause = GSM48_CC_CAUSE_NORMAL_UNSPEC; - int l4_location = GSM48_CAUSE_LOC_PRN_S_LU; - struct gsm_mncc mo_rel, l4_rel; - - memset(&mo_rel, 0, sizeof(struct gsm_mncc)); - mo_rel.callref = trans->callref; - memset(&l4_rel, 0, sizeof(struct gsm_mncc)); - l4_rel.callref = trans->callref; - - switch(trans->cc.Tcurrent) { - case 0x303: - release = 1; - l4_cause = GSM48_CC_CAUSE_USER_NOTRESPOND; - break; - case 0x310: - disconnect = 1; - l4_cause = GSM48_CC_CAUSE_USER_NOTRESPOND; - break; - case 0x313: - disconnect = 1; - /* unknown, did not find it in the specs */ - break; - case 0x301: - disconnect = 1; - l4_cause = GSM48_CC_CAUSE_USER_NOTRESPOND; - break; - case 0x308: - if (!trans->cc.T308_second) { - /* restart T308 a second time */ - gsm48_cc_tx_release(trans, &trans->cc.msg); - trans->cc.T308_second = 1; - break; /* stay in release state */ - } - trans_free(trans); - return; - case 0x306: - release = 1; - mo_cause = trans->cc.msg.cause.value; - mo_location = trans->cc.msg.cause.location; - break; - case 0x323: - disconnect = 1; - break; - default: - release = 1; - } - - if (release && trans->callref) { - /* process release towards layer 4 */ - mncc_release_ind(trans->net, trans, trans->callref, - l4_location, l4_cause); - trans->callref = 0; - } - - if (disconnect && trans->callref) { - /* process disconnect towards layer 4 */ - mncc_set_cause(&l4_rel, l4_location, l4_cause); - mncc_recvmsg(trans->net, trans, MNCC_DISC_IND, &l4_rel); - } - - /* process disconnect towards mobile station */ - if (disconnect || release) { - mncc_set_cause(&mo_rel, mo_location, mo_cause); - mo_rel.cause.diag[0] = ((trans->cc.Tcurrent & 0xf00) >> 8) + '0'; - mo_rel.cause.diag[1] = ((trans->cc.Tcurrent & 0x0f0) >> 4) + '0'; - mo_rel.cause.diag[2] = (trans->cc.Tcurrent & 0x00f) + '0'; - mo_rel.cause.diag_len = 3; - - if (disconnect) - gsm48_cc_tx_disconnect(trans, &mo_rel); - if (release) - gsm48_cc_tx_release(trans, &mo_rel); - } - -} - -/* disconnect both calls from the bridge */ -static inline void disconnect_bridge(struct gsm_network *net, - struct gsm_mncc_bridge *bridge, int err) -{ - struct gsm_trans *trans0 = trans_find_by_callref(net, bridge->callref[0]); - struct gsm_trans *trans1 = trans_find_by_callref(net, bridge->callref[1]); - struct gsm_mncc mx_rel; - if (!trans0 || !trans1) - return; - - DEBUGP(DCC, "Failed to bridge TCH for calls %x <-> %x :: %s \n", - trans0->callref, trans1->callref, strerror(err)); - - memset(&mx_rel, 0, sizeof(struct gsm_mncc)); - mncc_set_cause(&mx_rel, GSM48_CAUSE_LOC_INN_NET, - GSM48_CC_CAUSE_CHAN_UNACCEPT); - - mx_rel.callref = trans0->callref; - gsm48_cc_tx_disconnect(trans0, &mx_rel); - - mx_rel.callref = trans1->callref; - gsm48_cc_tx_disconnect(trans1, &mx_rel); -} - -static void gsm48_start_cc_timer(struct gsm_trans *trans, int current, - int sec, int micro) -{ - DEBUGP(DCC, "starting timer T%x with %d seconds\n", current, sec); - osmo_timer_setup(&trans->cc.timer, gsm48_cc_timeout, trans); - osmo_timer_schedule(&trans->cc.timer, sec, micro); - trans->cc.Tcurrent = current; -} - -static int gsm48_cc_rx_setup(struct gsm_trans *trans, struct msgb *msg) -{ - struct gsm48_hdr *gh = msgb_l3(msg); - uint8_t msg_type = gsm48_hdr_msg_type(gh); - unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh); - struct tlv_parsed tp; - struct gsm_mncc setup; - - memset(&setup, 0, sizeof(struct gsm_mncc)); - setup.callref = trans->callref; - - tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, 0, 0); - /* emergency setup is identified by msg_type */ - if (msg_type == GSM48_MT_CC_EMERG_SETUP) { - setup.fields |= MNCC_F_EMERGENCY; - setup.emergency = 1; - /* use destination number as configured by user (if any) */ - if (trans->net->emergency.route_to_msisdn) { - setup.fields |= MNCC_F_CALLED; - setup.called.type = 0; /* unknown */ - setup.called.plan = 0; /* unknown */ - OSMO_STRLCPY_ARRAY(setup.called.number, - trans->net->emergency.route_to_msisdn); - } - } - - /* use subscriber as calling party number */ - setup.fields |= MNCC_F_CALLING; - OSMO_STRLCPY_ARRAY(setup.calling.number, trans->vsub->msisdn); - OSMO_STRLCPY_ARRAY(setup.imsi, trans->vsub->imsi); - - /* bearer capability */ - if (TLVP_PRESENT(&tp, GSM48_IE_BEARER_CAP)) { - setup.fields |= MNCC_F_BEARER_CAP; - gsm48_decode_bearer_cap(&setup.bearer_cap, - TLVP_VAL(&tp, GSM48_IE_BEARER_CAP)-1); - - /* Create a copy of the bearer capability - * in the transaction struct, so we can use - * this information later */ - memcpy(&trans->bearer_cap,&setup.bearer_cap, - sizeof(trans->bearer_cap)); - } - /* facility */ - if (TLVP_PRESENT(&tp, GSM48_IE_FACILITY)) { - setup.fields |= MNCC_F_FACILITY; - gsm48_decode_facility(&setup.facility, - TLVP_VAL(&tp, GSM48_IE_FACILITY)-1); - } - /* called party bcd number */ - if (TLVP_PRESENT(&tp, GSM48_IE_CALLED_BCD)) { - setup.fields |= MNCC_F_CALLED; - gsm48_decode_called(&setup.called, - TLVP_VAL(&tp, GSM48_IE_CALLED_BCD)-1); - } - /* user-user */ - if (TLVP_PRESENT(&tp, GSM48_IE_USER_USER)) { - setup.fields |= MNCC_F_USERUSER; - gsm48_decode_useruser(&setup.useruser, - TLVP_VAL(&tp, GSM48_IE_USER_USER)-1); - } - /* ss-version */ - if (TLVP_PRESENT(&tp, GSM48_IE_SS_VERS)) { - setup.fields |= MNCC_F_SSVERSION; - gsm48_decode_ssversion(&setup.ssversion, - TLVP_VAL(&tp, GSM48_IE_SS_VERS)-1); - } - /* CLIR suppression */ - if (TLVP_PRESENT(&tp, GSM48_IE_CLIR_SUPP)) - setup.clir.sup = 1; - /* CLIR invocation */ - if (TLVP_PRESENT(&tp, GSM48_IE_CLIR_INVOC)) - setup.clir.inv = 1; - /* cc cap */ - if (TLVP_PRESENT(&tp, GSM48_IE_CC_CAP)) { - setup.fields |= MNCC_F_CCCAP; - gsm48_decode_cccap(&setup.cccap, - TLVP_VAL(&tp, GSM48_IE_CC_CAP)-1); - } - - new_cc_state(trans, GSM_CSTATE_INITIATED); - - LOGP(DCC, setup.emergency ? LOGL_NOTICE : LOGL_INFO, "Subscriber %s (%s) sends %sSETUP to %s\n", - vlr_subscr_name(trans->vsub), trans->vsub->msisdn, setup.emergency ? "EMERGENCY_" : "", - setup.called.number); - - rate_ctr_inc(&trans->net->msc_ctrs->ctr[MSC_CTR_CALL_MO_SETUP]); - - /* indicate setup to MNCC */ - mncc_recvmsg(trans->net, trans, MNCC_SETUP_IND, &setup); - - /* MNCC code will modify the channel asynchronously, we should - * ipaccess-bind only after the modification has been made to the - * lchan->tch_mode */ - return 0; -} - -static int gsm48_cc_tx_setup(struct gsm_trans *trans, void *arg) -{ - struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC STUP"); - struct gsm48_hdr *gh; - struct gsm_mncc *setup = arg; - int rc, trans_id; - - gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); - - /* transaction id must not be assigned */ - if (trans->transaction_id != 0xff) { /* unasssigned */ - DEBUGP(DCC, "TX Setup with assigned transaction. " - "This is not allowed!\n"); - /* Temporarily out of order */ - rc = mncc_release_ind(trans->net, trans, trans->callref, - GSM48_CAUSE_LOC_PRN_S_LU, - GSM48_CC_CAUSE_RESOURCE_UNAVAIL); - trans->callref = 0; - trans_free(trans); - return rc; - } - - /* Get free transaction_id */ - trans_id = trans_assign_trans_id(trans->net, trans->vsub, - GSM48_PDISC_CC, 0); - if (trans_id < 0) { - /* no free transaction ID */ - rc = mncc_release_ind(trans->net, trans, trans->callref, - GSM48_CAUSE_LOC_PRN_S_LU, - GSM48_CC_CAUSE_RESOURCE_UNAVAIL); - trans->callref = 0; - trans_free(trans); - return rc; - } - trans->transaction_id = trans_id; - - gh->msg_type = GSM48_MT_CC_SETUP; - - gsm48_start_cc_timer(trans, 0x303, GSM48_T303); - - /* bearer capability */ - if (setup->fields & MNCC_F_BEARER_CAP) { - /* Create a copy of the bearer capability in the transaction struct, so we - * can use this information later */ - memcpy(&trans->bearer_cap, &setup->bearer_cap, sizeof(trans->bearer_cap)); - gsm48_encode_bearer_cap(msg, 0, &setup->bearer_cap); - } - /* facility */ - if (setup->fields & MNCC_F_FACILITY) - gsm48_encode_facility(msg, 0, &setup->facility); - /* progress */ - if (setup->fields & MNCC_F_PROGRESS) - gsm48_encode_progress(msg, 0, &setup->progress); - /* calling party BCD number */ - if (setup->fields & MNCC_F_CALLING) - gsm48_encode_calling(msg, &setup->calling); - /* called party BCD number */ - if (setup->fields & MNCC_F_CALLED) - gsm48_encode_called(msg, &setup->called); - /* user-user */ - if (setup->fields & MNCC_F_USERUSER) - gsm48_encode_useruser(msg, 0, &setup->useruser); - /* redirecting party BCD number */ - if (setup->fields & MNCC_F_REDIRECTING) - gsm48_encode_redirecting(msg, &setup->redirecting); - /* signal */ - if (setup->fields & MNCC_F_SIGNAL) - gsm48_encode_signal(msg, setup->signal); - - new_cc_state(trans, GSM_CSTATE_CALL_PRESENT); - - rate_ctr_inc(&trans->net->msc_ctrs->ctr[MSC_CTR_CALL_MT_SETUP]); - - return gsm48_conn_sendmsg(msg, trans->conn, trans); -} - -static int gsm48_cc_rx_call_conf(struct gsm_trans *trans, struct msgb *msg) -{ - struct gsm48_hdr *gh = msgb_l3(msg); - unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh); - struct tlv_parsed tp; - struct gsm_mncc call_conf; - int rc; - - gsm48_stop_cc_timer(trans); - gsm48_start_cc_timer(trans, 0x310, GSM48_T310); - - memset(&call_conf, 0, sizeof(struct gsm_mncc)); - call_conf.callref = trans->callref; - - tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, 0, 0); -#if 0 - /* repeat */ - if (TLVP_PRESENT(&tp, GSM48_IE_REPEAT_CIR)) - call_conf.repeat = 1; - if (TLVP_PRESENT(&tp, GSM48_IE_REPEAT_SEQ)) - call_conf.repeat = 2; -#endif - /* bearer capability */ - if (TLVP_PRESENT(&tp, GSM48_IE_BEARER_CAP)) { - call_conf.fields |= MNCC_F_BEARER_CAP; - gsm48_decode_bearer_cap(&call_conf.bearer_cap, - TLVP_VAL(&tp, GSM48_IE_BEARER_CAP)-1); - - /* Create a copy of the bearer capability - * in the transaction struct, so we can use - * this information later */ - memcpy(&trans->bearer_cap,&call_conf.bearer_cap, - sizeof(trans->bearer_cap)); - } - /* cause */ - if (TLVP_PRESENT(&tp, GSM48_IE_CAUSE)) { - call_conf.fields |= MNCC_F_CAUSE; - gsm48_decode_cause(&call_conf.cause, - TLVP_VAL(&tp, GSM48_IE_CAUSE)-1); - } - /* cc cap */ - if (TLVP_PRESENT(&tp, GSM48_IE_CC_CAP)) { - call_conf.fields |= MNCC_F_CCCAP; - gsm48_decode_cccap(&call_conf.cccap, - TLVP_VAL(&tp, GSM48_IE_CC_CAP)-1); - } - - /* IMSI of called subscriber */ - OSMO_STRLCPY_ARRAY(call_conf.imsi, trans->vsub->imsi); - - new_cc_state(trans, GSM_CSTATE_MO_TERM_CALL_CONF); - - /* Assign call (if not done yet) */ - if (trans->assignment_done == false) { - rc = msc_mgcp_call_assignment(trans); - trans->assignment_done = true; - } - else - rc = 0; - - /* don't continue, if there were problems with - * the call assignment. */ - if (rc) - return rc; - - return mncc_recvmsg(trans->net, trans, MNCC_CALL_CONF_IND, - &call_conf); -} - -static int gsm48_cc_tx_call_proc_and_assign(struct gsm_trans *trans, void *arg) -{ - struct gsm_mncc *proceeding = arg; - struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC PROC"); - struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); - int rc; - - gh->msg_type = GSM48_MT_CC_CALL_PROC; - - new_cc_state(trans, GSM_CSTATE_MO_CALL_PROC); - - /* bearer capability */ - if (proceeding->fields & MNCC_F_BEARER_CAP) { - gsm48_encode_bearer_cap(msg, 0, &proceeding->bearer_cap); - memcpy(&trans->bearer_cap, &proceeding->bearer_cap, sizeof(trans->bearer_cap)); - } - /* facility */ - if (proceeding->fields & MNCC_F_FACILITY) - gsm48_encode_facility(msg, 0, &proceeding->facility); - /* progress */ - if (proceeding->fields & MNCC_F_PROGRESS) - gsm48_encode_progress(msg, 0, &proceeding->progress); - - rc = gsm48_conn_sendmsg(msg, trans->conn, trans); - if (rc) - return rc; - - /* Assign call (if not done yet) */ - if (trans->assignment_done == false) { - rc = msc_mgcp_call_assignment(trans); - trans->assignment_done = true; - } - else - rc = 0; - - return rc; -} - -static int gsm48_cc_rx_alerting(struct gsm_trans *trans, struct msgb *msg) -{ - struct gsm48_hdr *gh = msgb_l3(msg); - unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh); - struct tlv_parsed tp; - struct gsm_mncc alerting; - - gsm48_stop_cc_timer(trans); - gsm48_start_cc_timer(trans, 0x301, GSM48_T301); - - memset(&alerting, 0, sizeof(struct gsm_mncc)); - alerting.callref = trans->callref; - tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, 0, 0); - /* facility */ - if (TLVP_PRESENT(&tp, GSM48_IE_FACILITY)) { - alerting.fields |= MNCC_F_FACILITY; - gsm48_decode_facility(&alerting.facility, - TLVP_VAL(&tp, GSM48_IE_FACILITY)-1); - } - - /* progress */ - if (TLVP_PRESENT(&tp, GSM48_IE_PROGR_IND)) { - alerting.fields |= MNCC_F_PROGRESS; - gsm48_decode_progress(&alerting.progress, - TLVP_VAL(&tp, GSM48_IE_PROGR_IND)-1); - } - /* ss-version */ - if (TLVP_PRESENT(&tp, GSM48_IE_SS_VERS)) { - alerting.fields |= MNCC_F_SSVERSION; - gsm48_decode_ssversion(&alerting.ssversion, - TLVP_VAL(&tp, GSM48_IE_SS_VERS)-1); - } - - new_cc_state(trans, GSM_CSTATE_CALL_RECEIVED); - - return mncc_recvmsg(trans->net, trans, MNCC_ALERT_IND, - &alerting); -} - -static int gsm48_cc_tx_alerting(struct gsm_trans *trans, void *arg) -{ - struct gsm_mncc *alerting = arg; - struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC ALERT"); - struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); - - gh->msg_type = GSM48_MT_CC_ALERTING; - - /* facility */ - if (alerting->fields & MNCC_F_FACILITY) - gsm48_encode_facility(msg, 0, &alerting->facility); - /* progress */ - if (alerting->fields & MNCC_F_PROGRESS) - gsm48_encode_progress(msg, 0, &alerting->progress); - /* user-user */ - if (alerting->fields & MNCC_F_USERUSER) - gsm48_encode_useruser(msg, 0, &alerting->useruser); - - new_cc_state(trans, GSM_CSTATE_CALL_DELIVERED); - - return gsm48_conn_sendmsg(msg, trans->conn, trans); -} - -static int gsm48_cc_tx_progress(struct gsm_trans *trans, void *arg) -{ - struct gsm_mncc *progress = arg; - struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC PROGRESS"); - struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); - - gh->msg_type = GSM48_MT_CC_PROGRESS; - - /* progress */ - gsm48_encode_progress(msg, 1, &progress->progress); - /* user-user */ - if (progress->fields & MNCC_F_USERUSER) - gsm48_encode_useruser(msg, 0, &progress->useruser); - - return gsm48_conn_sendmsg(msg, trans->conn, trans); -} - -static int gsm48_cc_tx_connect(struct gsm_trans *trans, void *arg) -{ - struct gsm_mncc *connect = arg; - struct msgb *msg = gsm48_msgb_alloc_name("GSN 04.08 CC CON"); - struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); - - gh->msg_type = GSM48_MT_CC_CONNECT; - - gsm48_stop_cc_timer(trans); - gsm48_start_cc_timer(trans, 0x313, GSM48_T313); - - /* facility */ - if (connect->fields & MNCC_F_FACILITY) - gsm48_encode_facility(msg, 0, &connect->facility); - /* progress */ - if (connect->fields & MNCC_F_PROGRESS) - gsm48_encode_progress(msg, 0, &connect->progress); - /* connected number */ - if (connect->fields & MNCC_F_CONNECTED) - gsm48_encode_connected(msg, &connect->connected); - /* user-user */ - if (connect->fields & MNCC_F_USERUSER) - gsm48_encode_useruser(msg, 0, &connect->useruser); - - new_cc_state(trans, GSM_CSTATE_CONNECT_IND); - - return gsm48_conn_sendmsg(msg, trans->conn, trans); -} - -static int gsm48_cc_rx_connect(struct gsm_trans *trans, struct msgb *msg) -{ - struct gsm48_hdr *gh = msgb_l3(msg); - unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh); - struct tlv_parsed tp; - struct gsm_mncc connect; - - gsm48_stop_cc_timer(trans); - - memset(&connect, 0, sizeof(struct gsm_mncc)); - connect.callref = trans->callref; - tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, 0, 0); - /* use subscriber as connected party number */ - connect.fields |= MNCC_F_CONNECTED; - OSMO_STRLCPY_ARRAY(connect.connected.number, trans->vsub->msisdn); - OSMO_STRLCPY_ARRAY(connect.imsi, trans->vsub->imsi); - - /* facility */ - if (TLVP_PRESENT(&tp, GSM48_IE_FACILITY)) { - connect.fields |= MNCC_F_FACILITY; - gsm48_decode_facility(&connect.facility, - TLVP_VAL(&tp, GSM48_IE_FACILITY)-1); - } - /* user-user */ - if (TLVP_PRESENT(&tp, GSM48_IE_USER_USER)) { - connect.fields |= MNCC_F_USERUSER; - gsm48_decode_useruser(&connect.useruser, - TLVP_VAL(&tp, GSM48_IE_USER_USER)-1); - } - /* ss-version */ - if (TLVP_PRESENT(&tp, GSM48_IE_SS_VERS)) { - connect.fields |= MNCC_F_SSVERSION; - gsm48_decode_ssversion(&connect.ssversion, - TLVP_VAL(&tp, GSM48_IE_SS_VERS)-1); - } - - new_cc_state(trans, GSM_CSTATE_CONNECT_REQUEST); - rate_ctr_inc(&trans->net->msc_ctrs->ctr[MSC_CTR_CALL_MT_CONNECT]); - - return mncc_recvmsg(trans->net, trans, MNCC_SETUP_CNF, &connect); -} - - -static int gsm48_cc_rx_connect_ack(struct gsm_trans *trans, struct msgb *msg) -{ - struct gsm_mncc connect_ack; - - gsm48_stop_cc_timer(trans); - - new_cc_state(trans, GSM_CSTATE_ACTIVE); - rate_ctr_inc(&trans->net->msc_ctrs->ctr[MSC_CTR_CALL_MO_CONNECT_ACK]); - - memset(&connect_ack, 0, sizeof(struct gsm_mncc)); - connect_ack.callref = trans->callref; - - return mncc_recvmsg(trans->net, trans, MNCC_SETUP_COMPL_IND, - &connect_ack); -} - -static int gsm48_cc_tx_connect_ack(struct gsm_trans *trans, void *arg) -{ - struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC CON ACK"); - struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); - - gh->msg_type = GSM48_MT_CC_CONNECT_ACK; - - new_cc_state(trans, GSM_CSTATE_ACTIVE); - - return gsm48_conn_sendmsg(msg, trans->conn, trans); -} - -static int gsm48_cc_rx_disconnect(struct gsm_trans *trans, struct msgb *msg) -{ - struct gsm48_hdr *gh = msgb_l3(msg); - unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh); - struct tlv_parsed tp; - struct gsm_mncc disc; - - gsm48_stop_cc_timer(trans); - - new_cc_state(trans, GSM_CSTATE_DISCONNECT_REQ); - - memset(&disc, 0, sizeof(struct gsm_mncc)); - disc.callref = trans->callref; - tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, GSM48_IE_CAUSE, 0); - /* cause */ - if (TLVP_PRESENT(&tp, GSM48_IE_CAUSE)) { - disc.fields |= MNCC_F_CAUSE; - gsm48_decode_cause(&disc.cause, - TLVP_VAL(&tp, GSM48_IE_CAUSE)-1); - } - /* facility */ - if (TLVP_PRESENT(&tp, GSM48_IE_FACILITY)) { - disc.fields |= MNCC_F_FACILITY; - gsm48_decode_facility(&disc.facility, - TLVP_VAL(&tp, GSM48_IE_FACILITY)-1); - } - /* user-user */ - if (TLVP_PRESENT(&tp, GSM48_IE_USER_USER)) { - disc.fields |= MNCC_F_USERUSER; - gsm48_decode_useruser(&disc.useruser, - TLVP_VAL(&tp, GSM48_IE_USER_USER)-1); - } - /* ss-version */ - if (TLVP_PRESENT(&tp, GSM48_IE_SS_VERS)) { - disc.fields |= MNCC_F_SSVERSION; - gsm48_decode_ssversion(&disc.ssversion, - TLVP_VAL(&tp, GSM48_IE_SS_VERS)-1); - } - - return mncc_recvmsg(trans->net, trans, MNCC_DISC_IND, &disc); - -} - -static struct gsm_mncc_cause default_cause = { - .location = GSM48_CAUSE_LOC_PRN_S_LU, - .coding = 0, - .rec = 0, - .rec_val = 0, - .value = GSM48_CC_CAUSE_NORMAL_UNSPEC, - .diag_len = 0, - .diag = { 0 }, -}; - -static int gsm48_cc_tx_disconnect(struct gsm_trans *trans, void *arg) -{ - struct gsm_mncc *disc = arg; - struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC DISC"); - struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); - - gh->msg_type = GSM48_MT_CC_DISCONNECT; - - gsm48_stop_cc_timer(trans); - gsm48_start_cc_timer(trans, 0x306, GSM48_T306); - - /* cause */ - if (disc->fields & MNCC_F_CAUSE) - gsm48_encode_cause(msg, 1, &disc->cause); - else - gsm48_encode_cause(msg, 1, &default_cause); - - /* facility */ - if (disc->fields & MNCC_F_FACILITY) - gsm48_encode_facility(msg, 0, &disc->facility); - /* progress */ - if (disc->fields & MNCC_F_PROGRESS) - gsm48_encode_progress(msg, 0, &disc->progress); - /* user-user */ - if (disc->fields & MNCC_F_USERUSER) - gsm48_encode_useruser(msg, 0, &disc->useruser); - - /* store disconnect cause for T306 expiry */ - memcpy(&trans->cc.msg, disc, sizeof(struct gsm_mncc)); - - new_cc_state(trans, GSM_CSTATE_DISCONNECT_IND); - - return gsm48_conn_sendmsg(msg, trans->conn, trans); -} - -static int gsm48_cc_rx_release(struct gsm_trans *trans, struct msgb *msg) -{ - struct gsm48_hdr *gh = msgb_l3(msg); - unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh); - struct tlv_parsed tp; - struct gsm_mncc rel; - int rc; - - gsm48_stop_cc_timer(trans); - - memset(&rel, 0, sizeof(struct gsm_mncc)); - rel.callref = trans->callref; - tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, 0, 0); - /* cause */ - if (TLVP_PRESENT(&tp, GSM48_IE_CAUSE)) { - rel.fields |= MNCC_F_CAUSE; - gsm48_decode_cause(&rel.cause, - TLVP_VAL(&tp, GSM48_IE_CAUSE)-1); - } - /* facility */ - if (TLVP_PRESENT(&tp, GSM48_IE_FACILITY)) { - rel.fields |= MNCC_F_FACILITY; - gsm48_decode_facility(&rel.facility, - TLVP_VAL(&tp, GSM48_IE_FACILITY)-1); - } - /* user-user */ - if (TLVP_PRESENT(&tp, GSM48_IE_USER_USER)) { - rel.fields |= MNCC_F_USERUSER; - gsm48_decode_useruser(&rel.useruser, - TLVP_VAL(&tp, GSM48_IE_USER_USER)-1); - } - /* ss-version */ - if (TLVP_PRESENT(&tp, GSM48_IE_SS_VERS)) { - rel.fields |= MNCC_F_SSVERSION; - gsm48_decode_ssversion(&rel.ssversion, - TLVP_VAL(&tp, GSM48_IE_SS_VERS)-1); - } - - if (trans->cc.state == GSM_CSTATE_RELEASE_REQ) { - /* release collision 5.4.5 */ - rc = mncc_recvmsg(trans->net, trans, MNCC_REL_CNF, &rel); - } else { - rc = gsm48_tx_simple(trans->conn, - GSM48_PDISC_CC | (trans->transaction_id << 4), - GSM48_MT_CC_RELEASE_COMPL); - rc = mncc_recvmsg(trans->net, trans, MNCC_REL_IND, &rel); - } - - new_cc_state(trans, GSM_CSTATE_NULL); - - trans->callref = 0; - trans_free(trans); - - return rc; -} - -static int gsm48_cc_tx_release(struct gsm_trans *trans, void *arg) -{ - struct gsm_mncc *rel = arg; - struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC REL"); - struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); - - gh->msg_type = GSM48_MT_CC_RELEASE; - - gsm48_stop_cc_timer(trans); - gsm48_start_cc_timer(trans, 0x308, GSM48_T308); - - /* cause */ - if (rel->fields & MNCC_F_CAUSE) - gsm48_encode_cause(msg, 0, &rel->cause); - /* facility */ - if (rel->fields & MNCC_F_FACILITY) - gsm48_encode_facility(msg, 0, &rel->facility); - /* user-user */ - if (rel->fields & MNCC_F_USERUSER) - gsm48_encode_useruser(msg, 0, &rel->useruser); - - trans->cc.T308_second = 0; - memcpy(&trans->cc.msg, rel, sizeof(struct gsm_mncc)); - - if (trans->cc.state != GSM_CSTATE_RELEASE_REQ) - new_cc_state(trans, GSM_CSTATE_RELEASE_REQ); - - return gsm48_conn_sendmsg(msg, trans->conn, trans); -} - -static int gsm48_cc_rx_release_compl(struct gsm_trans *trans, struct msgb *msg) -{ - struct gsm48_hdr *gh = msgb_l3(msg); - unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh); - struct tlv_parsed tp; - struct gsm_mncc rel; - int rc = 0; - - gsm48_stop_cc_timer(trans); - - memset(&rel, 0, sizeof(struct gsm_mncc)); - rel.callref = trans->callref; - tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, 0, 0); - /* cause */ - if (TLVP_PRESENT(&tp, GSM48_IE_CAUSE)) { - rel.fields |= MNCC_F_CAUSE; - gsm48_decode_cause(&rel.cause, - TLVP_VAL(&tp, GSM48_IE_CAUSE)-1); - } - /* facility */ - if (TLVP_PRESENT(&tp, GSM48_IE_FACILITY)) { - rel.fields |= MNCC_F_FACILITY; - gsm48_decode_facility(&rel.facility, - TLVP_VAL(&tp, GSM48_IE_FACILITY)-1); - } - /* user-user */ - if (TLVP_PRESENT(&tp, GSM48_IE_USER_USER)) { - rel.fields |= MNCC_F_USERUSER; - gsm48_decode_useruser(&rel.useruser, - TLVP_VAL(&tp, GSM48_IE_USER_USER)-1); - } - /* ss-version */ - if (TLVP_PRESENT(&tp, GSM48_IE_SS_VERS)) { - rel.fields |= MNCC_F_SSVERSION; - gsm48_decode_ssversion(&rel.ssversion, - TLVP_VAL(&tp, GSM48_IE_SS_VERS)-1); - } - - if (trans->callref) { - switch (trans->cc.state) { - case GSM_CSTATE_CALL_PRESENT: - rc = mncc_recvmsg(trans->net, trans, - MNCC_REJ_IND, &rel); - break; - case GSM_CSTATE_RELEASE_REQ: - rc = mncc_recvmsg(trans->net, trans, - MNCC_REL_CNF, &rel); - break; - default: - rc = mncc_recvmsg(trans->net, trans, - MNCC_REL_IND, &rel); - } - } - - trans->callref = 0; - trans_free(trans); - - return rc; -} - -static int gsm48_cc_tx_release_compl(struct gsm_trans *trans, void *arg) -{ - struct gsm_mncc *rel = arg; - struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC REL COMPL"); - struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); - int ret; - - gh->msg_type = GSM48_MT_CC_RELEASE_COMPL; - - trans->callref = 0; - - gsm48_stop_cc_timer(trans); - - /* cause */ - if (rel->fields & MNCC_F_CAUSE) - gsm48_encode_cause(msg, 0, &rel->cause); - /* facility */ - if (rel->fields & MNCC_F_FACILITY) - gsm48_encode_facility(msg, 0, &rel->facility); - /* user-user */ - if (rel->fields & MNCC_F_USERUSER) - gsm48_encode_useruser(msg, 0, &rel->useruser); - - ret = gsm48_conn_sendmsg(msg, trans->conn, trans); - - trans_free(trans); - - return ret; -} - -static int gsm48_cc_rx_facility(struct gsm_trans *trans, struct msgb *msg) -{ - struct gsm48_hdr *gh = msgb_l3(msg); - unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh); - struct tlv_parsed tp; - struct gsm_mncc fac; - - memset(&fac, 0, sizeof(struct gsm_mncc)); - fac.callref = trans->callref; - tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, GSM48_IE_FACILITY, 0); - /* facility */ - if (TLVP_PRESENT(&tp, GSM48_IE_FACILITY)) { - fac.fields |= MNCC_F_FACILITY; - gsm48_decode_facility(&fac.facility, - TLVP_VAL(&tp, GSM48_IE_FACILITY)-1); - } - /* ss-version */ - if (TLVP_PRESENT(&tp, GSM48_IE_SS_VERS)) { - fac.fields |= MNCC_F_SSVERSION; - gsm48_decode_ssversion(&fac.ssversion, - TLVP_VAL(&tp, GSM48_IE_SS_VERS)-1); - } - - return mncc_recvmsg(trans->net, trans, MNCC_FACILITY_IND, &fac); -} - -static int gsm48_cc_tx_facility(struct gsm_trans *trans, void *arg) -{ - struct gsm_mncc *fac = arg; - struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC FAC"); - struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); - - gh->msg_type = GSM48_MT_CC_FACILITY; - - /* facility */ - gsm48_encode_facility(msg, 1, &fac->facility); - - return gsm48_conn_sendmsg(msg, trans->conn, trans); -} - -static int gsm48_cc_rx_hold(struct gsm_trans *trans, struct msgb *msg) -{ - struct gsm_mncc hold; - - memset(&hold, 0, sizeof(struct gsm_mncc)); - hold.callref = trans->callref; - return mncc_recvmsg(trans->net, trans, MNCC_HOLD_IND, &hold); -} - -static int gsm48_cc_tx_hold_ack(struct gsm_trans *trans, void *arg) -{ - struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC HLD ACK"); - struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); - - gh->msg_type = GSM48_MT_CC_HOLD_ACK; - - return gsm48_conn_sendmsg(msg, trans->conn, trans); -} - -static int gsm48_cc_tx_hold_rej(struct gsm_trans *trans, void *arg) -{ - struct gsm_mncc *hold_rej = arg; - struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC HLD REJ"); - struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); - - gh->msg_type = GSM48_MT_CC_HOLD_REJ; - - /* cause */ - if (hold_rej->fields & MNCC_F_CAUSE) - gsm48_encode_cause(msg, 1, &hold_rej->cause); - else - gsm48_encode_cause(msg, 1, &default_cause); - - return gsm48_conn_sendmsg(msg, trans->conn, trans); -} - -static int gsm48_cc_rx_retrieve(struct gsm_trans *trans, struct msgb *msg) -{ - struct gsm_mncc retrieve; - - memset(&retrieve, 0, sizeof(struct gsm_mncc)); - retrieve.callref = trans->callref; - return mncc_recvmsg(trans->net, trans, MNCC_RETRIEVE_IND, - &retrieve); -} - -static int gsm48_cc_tx_retrieve_ack(struct gsm_trans *trans, void *arg) -{ - struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC RETR ACK"); - struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); - - gh->msg_type = GSM48_MT_CC_RETR_ACK; - - return gsm48_conn_sendmsg(msg, trans->conn, trans); -} - -static int gsm48_cc_tx_retrieve_rej(struct gsm_trans *trans, void *arg) -{ - struct gsm_mncc *retrieve_rej = arg; - struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC RETR REJ"); - struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); - - gh->msg_type = GSM48_MT_CC_RETR_REJ; - - /* cause */ - if (retrieve_rej->fields & MNCC_F_CAUSE) - gsm48_encode_cause(msg, 1, &retrieve_rej->cause); - else - gsm48_encode_cause(msg, 1, &default_cause); - - return gsm48_conn_sendmsg(msg, trans->conn, trans); -} - -static int gsm48_cc_rx_start_dtmf(struct gsm_trans *trans, struct msgb *msg) -{ - struct gsm48_hdr *gh = msgb_l3(msg); - unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh); - struct tlv_parsed tp; - struct gsm_mncc dtmf; - - memset(&dtmf, 0, sizeof(struct gsm_mncc)); - dtmf.callref = trans->callref; - tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, 0, 0); - /* keypad facility */ - if (TLVP_PRESENT(&tp, GSM48_IE_KPD_FACILITY)) { - dtmf.fields |= MNCC_F_KEYPAD; - gsm48_decode_keypad(&dtmf.keypad, - TLVP_VAL(&tp, GSM48_IE_KPD_FACILITY)-1); - } - - return mncc_recvmsg(trans->net, trans, MNCC_START_DTMF_IND, &dtmf); -} - -static int gsm48_cc_tx_start_dtmf_ack(struct gsm_trans *trans, void *arg) -{ - struct gsm_mncc *dtmf = arg; - struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 DTMF ACK"); - struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); - - gh->msg_type = GSM48_MT_CC_START_DTMF_ACK; - - /* keypad */ - if (dtmf->fields & MNCC_F_KEYPAD) - gsm48_encode_keypad(msg, dtmf->keypad); - - return gsm48_conn_sendmsg(msg, trans->conn, trans); -} - -static int gsm48_cc_tx_start_dtmf_rej(struct gsm_trans *trans, void *arg) -{ - struct gsm_mncc *dtmf = arg; - struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 DTMF REJ"); - struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); - - gh->msg_type = GSM48_MT_CC_START_DTMF_REJ; - - /* cause */ - if (dtmf->fields & MNCC_F_CAUSE) - gsm48_encode_cause(msg, 1, &dtmf->cause); - else - gsm48_encode_cause(msg, 1, &default_cause); - - return gsm48_conn_sendmsg(msg, trans->conn, trans); -} - -static int gsm48_cc_tx_stop_dtmf_ack(struct gsm_trans *trans, void *arg) -{ - struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 DTMF STP ACK"); - struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); - - gh->msg_type = GSM48_MT_CC_STOP_DTMF_ACK; - - return gsm48_conn_sendmsg(msg, trans->conn, trans); -} - -static int gsm48_cc_rx_stop_dtmf(struct gsm_trans *trans, struct msgb *msg) -{ - struct gsm_mncc dtmf; - - memset(&dtmf, 0, sizeof(struct gsm_mncc)); - dtmf.callref = trans->callref; - - return mncc_recvmsg(trans->net, trans, MNCC_STOP_DTMF_IND, &dtmf); -} - -static int gsm48_cc_rx_modify(struct gsm_trans *trans, struct msgb *msg) -{ - struct gsm48_hdr *gh = msgb_l3(msg); - unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh); - struct tlv_parsed tp; - struct gsm_mncc modify; - - memset(&modify, 0, sizeof(struct gsm_mncc)); - modify.callref = trans->callref; - tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, GSM48_IE_BEARER_CAP, 0); - /* bearer capability */ - if (TLVP_PRESENT(&tp, GSM48_IE_BEARER_CAP)) { - modify.fields |= MNCC_F_BEARER_CAP; - gsm48_decode_bearer_cap(&modify.bearer_cap, - TLVP_VAL(&tp, GSM48_IE_BEARER_CAP)-1); - - /* Create a copy of the bearer capability - * in the transaction struct, so we can use - * this information later */ - memcpy(&trans->bearer_cap,&modify.bearer_cap, - sizeof(trans->bearer_cap)); - } - - new_cc_state(trans, GSM_CSTATE_MO_ORIG_MODIFY); - - return mncc_recvmsg(trans->net, trans, MNCC_MODIFY_IND, &modify); -} - -static int gsm48_cc_tx_modify(struct gsm_trans *trans, void *arg) -{ - struct gsm_mncc *modify = arg; - struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC MOD"); - struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); - - gh->msg_type = GSM48_MT_CC_MODIFY; - - gsm48_start_cc_timer(trans, 0x323, GSM48_T323); - - /* bearer capability */ - gsm48_encode_bearer_cap(msg, 1, &modify->bearer_cap); - memcpy(&trans->bearer_cap, &modify->bearer_cap, sizeof(trans->bearer_cap)); - - new_cc_state(trans, GSM_CSTATE_MO_TERM_MODIFY); - - return gsm48_conn_sendmsg(msg, trans->conn, trans); -} - -static int gsm48_cc_rx_modify_complete(struct gsm_trans *trans, struct msgb *msg) -{ - struct gsm48_hdr *gh = msgb_l3(msg); - unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh); - struct tlv_parsed tp; - struct gsm_mncc modify; - - gsm48_stop_cc_timer(trans); - - memset(&modify, 0, sizeof(struct gsm_mncc)); - modify.callref = trans->callref; - tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, GSM48_IE_BEARER_CAP, 0); - /* bearer capability */ - if (TLVP_PRESENT(&tp, GSM48_IE_BEARER_CAP)) { - modify.fields |= MNCC_F_BEARER_CAP; - gsm48_decode_bearer_cap(&modify.bearer_cap, - TLVP_VAL(&tp, GSM48_IE_BEARER_CAP)-1); - - /* Create a copy of the bearer capability - * in the transaction struct, so we can use - * this information later */ - memcpy(&trans->bearer_cap,&modify.bearer_cap, - sizeof(trans->bearer_cap)); - } - - new_cc_state(trans, GSM_CSTATE_ACTIVE); - - return mncc_recvmsg(trans->net, trans, MNCC_MODIFY_CNF, &modify); -} - -static int gsm48_cc_tx_modify_complete(struct gsm_trans *trans, void *arg) -{ - struct gsm_mncc *modify = arg; - struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC MOD COMPL"); - struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); - - gh->msg_type = GSM48_MT_CC_MODIFY_COMPL; - - /* bearer capability */ - gsm48_encode_bearer_cap(msg, 1, &modify->bearer_cap); - memcpy(&trans->bearer_cap, &modify->bearer_cap, sizeof(trans->bearer_cap)); - - new_cc_state(trans, GSM_CSTATE_ACTIVE); - - return gsm48_conn_sendmsg(msg, trans->conn, trans); -} - -static int gsm48_cc_rx_modify_reject(struct gsm_trans *trans, struct msgb *msg) -{ - struct gsm48_hdr *gh = msgb_l3(msg); - unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh); - struct tlv_parsed tp; - struct gsm_mncc modify; - - gsm48_stop_cc_timer(trans); - - memset(&modify, 0, sizeof(struct gsm_mncc)); - modify.callref = trans->callref; - tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, GSM48_IE_BEARER_CAP, GSM48_IE_CAUSE); - /* bearer capability */ - if (TLVP_PRESENT(&tp, GSM48_IE_BEARER_CAP)) { - modify.fields |= GSM48_IE_BEARER_CAP; - gsm48_decode_bearer_cap(&modify.bearer_cap, - TLVP_VAL(&tp, GSM48_IE_BEARER_CAP)-1); - - /* Create a copy of the bearer capability - * in the transaction struct, so we can use - * this information later */ - memcpy(&trans->bearer_cap,&modify.bearer_cap, - sizeof(trans->bearer_cap)); - } - /* cause */ - if (TLVP_PRESENT(&tp, GSM48_IE_CAUSE)) { - modify.fields |= MNCC_F_CAUSE; - gsm48_decode_cause(&modify.cause, - TLVP_VAL(&tp, GSM48_IE_CAUSE)-1); - } - - new_cc_state(trans, GSM_CSTATE_ACTIVE); - - return mncc_recvmsg(trans->net, trans, MNCC_MODIFY_REJ, &modify); -} - -static int gsm48_cc_tx_modify_reject(struct gsm_trans *trans, void *arg) -{ - struct gsm_mncc *modify = arg; - struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC MOD REJ"); - struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); - - gh->msg_type = GSM48_MT_CC_MODIFY_REJECT; - - /* bearer capability */ - gsm48_encode_bearer_cap(msg, 1, &modify->bearer_cap); - memcpy(&trans->bearer_cap, &modify->bearer_cap, sizeof(trans->bearer_cap)); - /* cause */ - gsm48_encode_cause(msg, 1, &modify->cause); - - new_cc_state(trans, GSM_CSTATE_ACTIVE); - - return gsm48_conn_sendmsg(msg, trans->conn, trans); -} - -static int gsm48_cc_tx_notify(struct gsm_trans *trans, void *arg) -{ - struct gsm_mncc *notify = arg; - struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC NOT"); - struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); - - gh->msg_type = GSM48_MT_CC_NOTIFY; - - /* notify */ - gsm48_encode_notify(msg, notify->notify); - - return gsm48_conn_sendmsg(msg, trans->conn, trans); -} - -static int gsm48_cc_rx_notify(struct gsm_trans *trans, struct msgb *msg) -{ - struct gsm48_hdr *gh = msgb_l3(msg); - unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh); -// struct tlv_parsed tp; - struct gsm_mncc notify; - - memset(¬ify, 0, sizeof(struct gsm_mncc)); - notify.callref = trans->callref; -// tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len); - if (payload_len >= 1) - gsm48_decode_notify(¬ify.notify, gh->data); - - return mncc_recvmsg(trans->net, trans, MNCC_NOTIFY_IND, ¬ify); -} - -static int gsm48_cc_tx_userinfo(struct gsm_trans *trans, void *arg) -{ - struct gsm_mncc *user = arg; - struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 USR INFO"); - struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); - - gh->msg_type = GSM48_MT_CC_USER_INFO; - - /* user-user */ - if (user->fields & MNCC_F_USERUSER) - gsm48_encode_useruser(msg, 1, &user->useruser); - /* more data */ - if (user->more) - gsm48_encode_more(msg); - - return gsm48_conn_sendmsg(msg, trans->conn, trans); -} - -static int gsm48_cc_rx_userinfo(struct gsm_trans *trans, struct msgb *msg) -{ - struct gsm48_hdr *gh = msgb_l3(msg); - unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh); - struct tlv_parsed tp; - struct gsm_mncc user; - - memset(&user, 0, sizeof(struct gsm_mncc)); - user.callref = trans->callref; - tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, GSM48_IE_USER_USER, 0); - /* user-user */ - if (TLVP_PRESENT(&tp, GSM48_IE_USER_USER)) { - user.fields |= MNCC_F_USERUSER; - gsm48_decode_useruser(&user.useruser, - TLVP_VAL(&tp, GSM48_IE_USER_USER)-1); - } - /* more data */ - if (TLVP_PRESENT(&tp, GSM48_IE_MORE_DATA)) - user.more = 1; - - return mncc_recvmsg(trans->net, trans, MNCC_USERINFO_IND, &user); -} - -static void mncc_recv_rtp(struct gsm_network *net, uint32_t callref, - int cmd, uint32_t addr, uint16_t port, uint32_t payload_type, - uint32_t payload_msg_type) -{ - uint8_t data[sizeof(struct gsm_mncc)]; - struct gsm_mncc_rtp *rtp; - - memset(&data, 0, sizeof(data)); - rtp = (struct gsm_mncc_rtp *) &data[0]; - - rtp->callref = callref; - rtp->msg_type = cmd; - rtp->ip = addr; - rtp->port = port; - rtp->payload_type = payload_type; - rtp->payload_msg_type = payload_msg_type; - mncc_recvmsg(net, NULL, cmd, (struct gsm_mncc *)data); -} - -static void mncc_recv_rtp_sock(struct gsm_network *net, struct gsm_trans *trans, int cmd) -{ - int msg_type; - - /* FIXME This has to be set to some meaningful value. - * Possible options are: - * GSM_TCHF_FRAME, GSM_TCHF_FRAME_EFR, - * GSM_TCHH_FRAME, GSM_TCH_FRAME_AMR - * (0 if unknown) */ - msg_type = GSM_TCHF_FRAME; - - uint32_t addr = inet_addr(trans->conn->rtp.local_addr_cn); - uint16_t port = trans->conn->rtp.local_port_cn; - - LOGP(DMNCC, LOGL_ERROR, "RTP create for non-existing trans\n"); - - if (addr == INADDR_NONE) { - LOGP(DMNCC, LOGL_ERROR, - "(subscriber:%s) external MNCC is signalling invalid IP-Address\n", - vlr_subscr_name(trans->vsub)); - return; - } - if (port == 0) { - LOGP(DMNCC, LOGL_ERROR, - "(subscriber:%s) external MNCC is signalling invalid Port\n", - vlr_subscr_name(trans->vsub)); - return; - } - - /* FIXME: This has to be set to some meaningful value, - * before the MSC-Split, this value was pulled from - * lchan->abis_ip.rtp_payload */ - uint32_t payload_type = 0; - - return mncc_recv_rtp(net, trans->callref, cmd, - addr, - port, - payload_type, - msg_type); -} - -static void mncc_recv_rtp_err(struct gsm_network *net, uint32_t callref, int cmd) -{ - return mncc_recv_rtp(net, callref, cmd, 0, 0, 0, 0); -} - -static int tch_rtp_create(struct gsm_network *net, uint32_t callref) -{ - struct gsm_trans *trans; - int rc; - - /* Find callref */ - trans = trans_find_by_callref(net, callref); - if (!trans) { - LOGP(DMNCC, LOGL_ERROR, "RTP create for non-existing trans\n"); - mncc_recv_rtp_err(net, callref, MNCC_RTP_CREATE); - return -EIO; - } - log_set_context(LOG_CTX_VLR_SUBSCR, trans->vsub); - if (!trans->conn) { - LOGP(DMNCC, LOGL_NOTICE, "RTP create for trans without conn\n"); - mncc_recv_rtp_err(net, callref, MNCC_RTP_CREATE); - return 0; - } - - trans->conn->mncc_rtp_bridge = 1; - - /* When we call msc_mgcp_call_assignment() we will trigger, depending - * on the RAN type the call assignment on the A or Iu interface. - * msc_mgcp_call_assignment() also takes care about sending the CRCX - * command to the MGCP-GW. The CRCX will return the port number, - * where the PBX (e.g. Asterisk) will send its RTP stream to. We - * have to return this port number back to the MNCC by sending - * it back with the TCH_RTP_CREATE message. To make sure that - * this message is sent AFTER the response to CRCX from the - * MGCP-GW has arrived, we need will instruct msc_mgcp_call_assignment() - * to take care of this by setting trans->tch_rtp_create to true. - * This will make sure that gsm48_tch_rtp_create() (below) is - * called as soon as the local port number has become known. */ - trans->tch_rtp_create = true; - - /* Assign call (if not done yet) */ - if (trans->assignment_done == false) { - rc = msc_mgcp_call_assignment(trans); - trans->assignment_done = true; - } - else - rc = 0; - - return rc; -} - -/* Trigger TCH_RTP_CREATE acknowledgement */ -int gsm48_tch_rtp_create(struct gsm_trans *trans) -{ - /* This function is called as soon as the port, on which the - * mgcp-gw expects the incoming RTP stream from the remote - * end (e.g. Asterisk) is known. */ - - struct gsm_subscriber_connection *conn = trans->conn; - struct gsm_network *network = conn->network; - - mncc_recv_rtp_sock(network, trans, MNCC_RTP_CREATE); - return 0; -} - -static int tch_rtp_connect(struct gsm_network *net, void *arg) -{ - struct gsm_trans *trans; - struct gsm_mncc_rtp *rtp = arg; - struct in_addr addr; - - /* Find callref */ - trans = trans_find_by_callref(net, rtp->callref); - if (!trans) { - LOGP(DMNCC, LOGL_ERROR, "RTP connect for non-existing trans\n"); - mncc_recv_rtp_err(net, rtp->callref, MNCC_RTP_CONNECT); - return -EIO; - } - log_set_context(LOG_CTX_VLR_SUBSCR, trans->vsub); - if (!trans->conn) { - LOGP(DMNCC, LOGL_ERROR, "RTP connect for trans without conn\n"); - mncc_recv_rtp_err(net, rtp->callref, MNCC_RTP_CONNECT); - return 0; - } - - addr.s_addr = osmo_htonl(rtp->ip); - return msc_mgcp_call_complete(trans, rtp->port, inet_ntoa(addr)); -} - -static struct downstate { - uint32_t states; - int type; - int (*rout) (struct gsm_trans *trans, void *arg); -} downstatelist[] = { - /* mobile originating call establishment */ - {SBIT(GSM_CSTATE_INITIATED), /* 5.2.1.2 */ - MNCC_CALL_PROC_REQ, gsm48_cc_tx_call_proc_and_assign}, - {SBIT(GSM_CSTATE_INITIATED) | SBIT(GSM_CSTATE_MO_CALL_PROC), /* 5.2.1.2 | 5.2.1.5 */ - MNCC_ALERT_REQ, gsm48_cc_tx_alerting}, - {SBIT(GSM_CSTATE_INITIATED) | SBIT(GSM_CSTATE_MO_CALL_PROC) | SBIT(GSM_CSTATE_CALL_DELIVERED), /* 5.2.1.2 | 5.2.1.6 | 5.2.1.6 */ - MNCC_SETUP_RSP, gsm48_cc_tx_connect}, - {SBIT(GSM_CSTATE_MO_CALL_PROC), /* 5.2.1.4.2 */ - MNCC_PROGRESS_REQ, gsm48_cc_tx_progress}, - /* mobile terminating call establishment */ - {SBIT(GSM_CSTATE_NULL), /* 5.2.2.1 */ - MNCC_SETUP_REQ, gsm48_cc_tx_setup}, - {SBIT(GSM_CSTATE_CONNECT_REQUEST), - MNCC_SETUP_COMPL_REQ, gsm48_cc_tx_connect_ack}, - /* signalling during call */ - {SBIT(GSM_CSTATE_ACTIVE), - MNCC_NOTIFY_REQ, gsm48_cc_tx_notify}, - {ALL_STATES - SBIT(GSM_CSTATE_NULL) - SBIT(GSM_CSTATE_RELEASE_REQ), - MNCC_FACILITY_REQ, gsm48_cc_tx_facility}, - {ALL_STATES, - MNCC_START_DTMF_RSP, gsm48_cc_tx_start_dtmf_ack}, - {ALL_STATES, - MNCC_START_DTMF_REJ, gsm48_cc_tx_start_dtmf_rej}, - {ALL_STATES, - MNCC_STOP_DTMF_RSP, gsm48_cc_tx_stop_dtmf_ack}, - {SBIT(GSM_CSTATE_ACTIVE), - MNCC_HOLD_CNF, gsm48_cc_tx_hold_ack}, - {SBIT(GSM_CSTATE_ACTIVE), - MNCC_HOLD_REJ, gsm48_cc_tx_hold_rej}, - {SBIT(GSM_CSTATE_ACTIVE), - MNCC_RETRIEVE_CNF, gsm48_cc_tx_retrieve_ack}, - {SBIT(GSM_CSTATE_ACTIVE), - MNCC_RETRIEVE_REJ, gsm48_cc_tx_retrieve_rej}, - {SBIT(GSM_CSTATE_ACTIVE), - MNCC_MODIFY_REQ, gsm48_cc_tx_modify}, - {SBIT(GSM_CSTATE_MO_ORIG_MODIFY), - MNCC_MODIFY_RSP, gsm48_cc_tx_modify_complete}, - {SBIT(GSM_CSTATE_MO_ORIG_MODIFY), - MNCC_MODIFY_REJ, gsm48_cc_tx_modify_reject}, - {SBIT(GSM_CSTATE_ACTIVE), - MNCC_USERINFO_REQ, gsm48_cc_tx_userinfo}, - /* clearing */ - {SBIT(GSM_CSTATE_INITIATED), - MNCC_REJ_REQ, gsm48_cc_tx_release_compl}, - {ALL_STATES - SBIT(GSM_CSTATE_NULL) - SBIT(GSM_CSTATE_DISCONNECT_IND) - SBIT(GSM_CSTATE_RELEASE_REQ) - SBIT(GSM_CSTATE_DISCONNECT_REQ), /* 5.4.4 */ - MNCC_DISC_REQ, gsm48_cc_tx_disconnect}, - {ALL_STATES - SBIT(GSM_CSTATE_NULL) - SBIT(GSM_CSTATE_RELEASE_REQ), /* 5.4.3.2 */ - MNCC_REL_REQ, gsm48_cc_tx_release}, -}; - -#define DOWNSLLEN \ - (sizeof(downstatelist) / sizeof(struct downstate)) - - -int mncc_tx_to_cc(struct gsm_network *net, int msg_type, void *arg) -{ - int i, rc = 0; - struct gsm_trans *trans = NULL, *transt; - struct gsm_subscriber_connection *conn = NULL; - struct gsm_mncc *data = arg, rel; - - DEBUGP(DMNCC, "receive message %s\n", get_mncc_name(msg_type)); - - /* handle special messages */ - switch(msg_type) { - case MNCC_BRIDGE: - rc = tch_bridge(net, arg); - if (rc < 0) - disconnect_bridge(net, arg, -rc); - return rc; - case MNCC_RTP_CREATE: - return tch_rtp_create(net, data->callref); - case MNCC_RTP_CONNECT: - return tch_rtp_connect(net, arg); - case MNCC_RTP_FREE: - /* unused right now */ - return -EIO; - - case MNCC_FRAME_DROP: - case MNCC_FRAME_RECV: - case GSM_TCHF_FRAME: - case GSM_TCHF_FRAME_EFR: - case GSM_TCHH_FRAME: - case GSM_TCH_FRAME_AMR: - LOGP(DMNCC, LOGL_ERROR, "RTP streams must be handled externally; %s not supported.\n", - get_mncc_name(msg_type)); - return -ENOTSUP; - } - - memset(&rel, 0, sizeof(struct gsm_mncc)); - rel.callref = data->callref; - - /* Find callref */ - trans = trans_find_by_callref(net, data->callref); - - /* Callref unknown */ - if (!trans) { - struct vlr_subscr *vsub; - - if (msg_type != MNCC_SETUP_REQ) { - DEBUGP(DCC, "(bts - trx - ts - ti -- sub %s) " - "Received '%s' from MNCC with " - "unknown callref %d\n", data->called.number, - get_mncc_name(msg_type), data->callref); - /* Invalid call reference */ - return mncc_release_ind(net, NULL, data->callref, - GSM48_CAUSE_LOC_PRN_S_LU, - GSM48_CC_CAUSE_INVAL_TRANS_ID); - } - if (!data->called.number[0] && !data->imsi[0]) { - DEBUGP(DCC, "(bts - trx - ts - ti) " - "Received '%s' from MNCC with " - "no number or IMSI\n", get_mncc_name(msg_type)); - /* Invalid number */ - return mncc_release_ind(net, NULL, data->callref, - GSM48_CAUSE_LOC_PRN_S_LU, - GSM48_CC_CAUSE_INV_NR_FORMAT); - } - /* New transaction due to setup, find subscriber */ - if (data->called.number[0]) - vsub = vlr_subscr_find_by_msisdn(net->vlr, - data->called.number); - else - vsub = vlr_subscr_find_by_imsi(net->vlr, data->imsi); - - /* update the subscriber we deal with */ - log_set_context(LOG_CTX_VLR_SUBSCR, vsub); - - /* If subscriber is not found */ - if (!vsub) { - DEBUGP(DCC, "(bts - trx - ts - ti -- sub %s) " - "Received '%s' from MNCC with " - "unknown subscriber %s\n", data->called.number, - get_mncc_name(msg_type), data->called.number); - /* Unknown subscriber */ - return mncc_release_ind(net, NULL, data->callref, - GSM48_CAUSE_LOC_PRN_S_LU, - GSM48_CC_CAUSE_UNASSIGNED_NR); - } - /* If subscriber is not "attached" */ - if (!vsub->lac) { - DEBUGP(DCC, "(bts - trx - ts - ti -- sub %s) " - "Received '%s' from MNCC with " - "detached subscriber %s\n", data->called.number, - get_mncc_name(msg_type), vlr_subscr_name(vsub)); - vlr_subscr_put(vsub); - /* Temporarily out of order */ - return mncc_release_ind(net, NULL, data->callref, - GSM48_CAUSE_LOC_PRN_S_LU, - GSM48_CC_CAUSE_DEST_OOO); - } - /* Create transaction */ - trans = trans_alloc(net, vsub, GSM48_PDISC_CC, 0xff, data->callref); - if (!trans) { - DEBUGP(DCC, "No memory for trans.\n"); - vlr_subscr_put(vsub); - /* Ressource unavailable */ - mncc_release_ind(net, NULL, data->callref, - GSM48_CAUSE_LOC_PRN_S_LU, - GSM48_CC_CAUSE_RESOURCE_UNAVAIL); - return -ENOMEM; - } - - /* Find conn */ - conn = connection_for_subscr(vsub); - - /* If subscriber has no conn */ - if (!conn) { - /* find transaction with this subscriber already paging */ - llist_for_each_entry(transt, &net->trans_list, entry) { - /* Transaction of our conn? */ - if (transt == trans || - transt->vsub != vsub) - continue; - DEBUGP(DCC, "(bts - trx - ts - ti -- sub %s) " - "Received '%s' from MNCC with " - "unallocated channel, paging already " - "started for lac %d.\n", - data->called.number, - get_mncc_name(msg_type), vsub->lac); - vlr_subscr_put(vsub); - trans_free(trans); - return 0; - } - /* store setup information until paging succeeds */ - memcpy(&trans->cc.msg, data, sizeof(struct gsm_mncc)); - - /* Request a channel */ - trans->paging_request = subscr_request_conn( - vsub, - setup_trig_pag_evt, - trans, - "MNCC: establish call"); - if (!trans->paging_request) { - LOGP(DCC, LOGL_ERROR, "Failed to allocate paging token.\n"); - vlr_subscr_put(vsub); - trans_free(trans); - return 0; - } - vlr_subscr_put(vsub); - return 0; - } - - /* Assign conn */ - trans->conn = msc_subscr_conn_get(conn, MSC_CONN_USE_TRANS_CC); - trans->dlci = 0x00; /* SAPI=0, not SACCH */ - vlr_subscr_put(vsub); - } else { - /* update the subscriber we deal with */ - log_set_context(LOG_CTX_VLR_SUBSCR, trans->vsub); - } - - if (trans->conn) - conn = trans->conn; - - /* if paging did not respond yet */ - if (!conn) { - DEBUGP(DCC, "(sub %s) " - "Received '%s' from MNCC in paging state\n", - vlr_subscr_msisdn_or_name(trans->vsub), - get_mncc_name(msg_type)); - mncc_set_cause(&rel, GSM48_CAUSE_LOC_PRN_S_LU, - GSM48_CC_CAUSE_NORM_CALL_CLEAR); - if (msg_type == MNCC_REL_REQ) - rc = mncc_recvmsg(net, trans, MNCC_REL_CNF, &rel); - else - rc = mncc_recvmsg(net, trans, MNCC_REL_IND, &rel); - trans->callref = 0; - trans_free(trans); - return rc; - } else { - DEBUGP(DCC, "(ti %02x sub %s) " - "Received '%s' from MNCC in state %d (%s)\n", - trans->transaction_id, - vlr_subscr_msisdn_or_name(trans->conn->vsub), - get_mncc_name(msg_type), trans->cc.state, - gsm48_cc_state_name(trans->cc.state)); - } - - /* Find function for current state and message */ - for (i = 0; i < DOWNSLLEN; i++) - if ((msg_type == downstatelist[i].type) - && ((1 << trans->cc.state) & downstatelist[i].states)) - break; - if (i == DOWNSLLEN) { - DEBUGP(DCC, "Message unhandled at this state.\n"); - return 0; - } - - rc = downstatelist[i].rout(trans, arg); - - return rc; -} - - -static struct datastate { - uint32_t states; - int type; - int (*rout) (struct gsm_trans *trans, struct msgb *msg); -} datastatelist[] = { - /* mobile originating call establishment */ - {SBIT(GSM_CSTATE_NULL), /* 5.2.1.2 */ - GSM48_MT_CC_SETUP, gsm48_cc_rx_setup}, - {SBIT(GSM_CSTATE_NULL), /* 5.2.1.2 */ - GSM48_MT_CC_EMERG_SETUP, gsm48_cc_rx_setup}, - {SBIT(GSM_CSTATE_CONNECT_IND), /* 5.2.1.2 */ - GSM48_MT_CC_CONNECT_ACK, gsm48_cc_rx_connect_ack}, - /* mobile terminating call establishment */ - {SBIT(GSM_CSTATE_CALL_PRESENT), /* 5.2.2.3.2 */ - GSM48_MT_CC_CALL_CONF, gsm48_cc_rx_call_conf}, - {SBIT(GSM_CSTATE_CALL_PRESENT) | SBIT(GSM_CSTATE_MO_TERM_CALL_CONF), /* ???? | 5.2.2.3.2 */ - GSM48_MT_CC_ALERTING, gsm48_cc_rx_alerting}, - {SBIT(GSM_CSTATE_CALL_PRESENT) | SBIT(GSM_CSTATE_MO_TERM_CALL_CONF) | SBIT(GSM_CSTATE_CALL_RECEIVED), /* (5.2.2.6) | 5.2.2.6 | 5.2.2.6 */ - GSM48_MT_CC_CONNECT, gsm48_cc_rx_connect}, - /* signalling during call */ - {ALL_STATES - SBIT(GSM_CSTATE_NULL), - GSM48_MT_CC_FACILITY, gsm48_cc_rx_facility}, - {SBIT(GSM_CSTATE_ACTIVE), - GSM48_MT_CC_NOTIFY, gsm48_cc_rx_notify}, - {ALL_STATES, - GSM48_MT_CC_START_DTMF, gsm48_cc_rx_start_dtmf}, - {ALL_STATES, - GSM48_MT_CC_STOP_DTMF, gsm48_cc_rx_stop_dtmf}, - {ALL_STATES, - GSM48_MT_CC_STATUS_ENQ, gsm48_cc_rx_status_enq}, - {SBIT(GSM_CSTATE_ACTIVE), - GSM48_MT_CC_HOLD, gsm48_cc_rx_hold}, - {SBIT(GSM_CSTATE_ACTIVE), - GSM48_MT_CC_RETR, gsm48_cc_rx_retrieve}, - {SBIT(GSM_CSTATE_ACTIVE), - GSM48_MT_CC_MODIFY, gsm48_cc_rx_modify}, - {SBIT(GSM_CSTATE_MO_TERM_MODIFY), - GSM48_MT_CC_MODIFY_COMPL, gsm48_cc_rx_modify_complete}, - {SBIT(GSM_CSTATE_MO_TERM_MODIFY), - GSM48_MT_CC_MODIFY_REJECT, gsm48_cc_rx_modify_reject}, - {SBIT(GSM_CSTATE_ACTIVE), - GSM48_MT_CC_USER_INFO, gsm48_cc_rx_userinfo}, - /* clearing */ - {ALL_STATES - SBIT(GSM_CSTATE_NULL) - SBIT(GSM_CSTATE_RELEASE_REQ), /* 5.4.3.2 */ - GSM48_MT_CC_DISCONNECT, gsm48_cc_rx_disconnect}, - {ALL_STATES - SBIT(GSM_CSTATE_NULL), /* 5.4.4.1.2.2 */ - GSM48_MT_CC_RELEASE, gsm48_cc_rx_release}, - {ALL_STATES, /* 5.4.3.4 */ - GSM48_MT_CC_RELEASE_COMPL, gsm48_cc_rx_release_compl}, -}; - -#define DATASLLEN \ - (sizeof(datastatelist) / sizeof(struct datastate)) - -static int gsm0408_rcv_cc(struct gsm_subscriber_connection *conn, struct msgb *msg) -{ - struct gsm48_hdr *gh = msgb_l3(msg); - uint8_t msg_type = gsm48_hdr_msg_type(gh); - uint8_t transaction_id = gsm48_hdr_trans_id_flip_ti(gh); - struct gsm_trans *trans = NULL; - int i, rc = 0; - - if (msg_type & 0x80) { - DEBUGP(DCC, "MSG 0x%2x not defined for PD error\n", msg_type); - return -EINVAL; - } - - if (!conn->vsub) { - LOGP(DCC, LOGL_ERROR, "Invalid conn: no subscriber\n"); - return -EINVAL; - } - - /* Find transaction */ - trans = trans_find_by_id(conn, GSM48_PDISC_CC, transaction_id); - -#if BEFORE_MSCSPLIT - /* Re-enable this log output once we can obtain this information via - * A-interface, see OS#2391. */ - DEBUGP(DCC, "(bts %d trx %d ts %d ti %x sub %s) " - "Received '%s' from MS in state %d (%s)\n", - conn->bts->nr, conn->lchan->ts->trx->nr, conn->lchan->ts->nr, - transaction_id, vlr_subscr_msisdn_or_name(conn->vsub), - gsm48_cc_msg_name(msg_type), trans?(trans->cc.state):0, - gsm48_cc_state_name(trans?(trans->cc.state):0)); -#endif - - /* Create transaction */ - if (!trans) { - DEBUGP(DCC, "Unknown transaction ID %x, " - "creating new trans.\n", transaction_id); - /* Create transaction */ - trans = trans_alloc(conn->network, conn->vsub, - GSM48_PDISC_CC, - transaction_id, new_callref++); - if (!trans) { - DEBUGP(DCC, "No memory for trans.\n"); - rc = gsm48_tx_simple(conn, - GSM48_PDISC_CC | (transaction_id << 4), - GSM48_MT_CC_RELEASE_COMPL); - return -ENOMEM; - } - /* Assign transaction */ - trans->conn = msc_subscr_conn_get(conn, MSC_CONN_USE_TRANS_CC); - trans->dlci = OMSC_LINKID_CB(msg); /* DLCI as received from BSC */ - cm_service_request_concludes(conn, msg); - } - - /* find function for current state and message */ - for (i = 0; i < DATASLLEN; i++) - if ((msg_type == datastatelist[i].type) - && ((1 << trans->cc.state) & datastatelist[i].states)) - break; - if (i == DATASLLEN) { - DEBUGP(DCC, "Message unhandled at this state.\n"); - return 0; - } - - assert(trans->vsub); - - rc = datastatelist[i].rout(trans, msg); - - msc_subscr_conn_communicating(conn); - return rc; -} - static bool msg_is_initially_permitted(const struct gsm48_hdr *hdr) { uint8_t pdisc = gsm48_hdr_pdisc(hdr); @@ -3460,6 +1412,8 @@ } } +extern int gsm0408_rcv_cc(struct gsm_subscriber_connection *conn, struct msgb *msg); + /* Main entry point for GSM 04.08/44.008 Layer 3 data (e.g. from the BSC). */ int gsm0408_dispatch(struct gsm_subscriber_connection *conn, struct msgb *msg) { diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c new file mode 100644 index 0000000..8becd05 --- /dev/null +++ b/src/libmsc/gsm_04_08_cc.c @@ -0,0 +1,2120 @@ +/* GSM Mobile Radio Interface Layer 3 Call Control */ + +/* (C) 2008-2016 by Harald Welte + * (C) 2008-2012 by Holger Hans Peter Freyther + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "bscconfig.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef BUILD_IU +#include +#endif + +#include +#include +#include + +#include + +static uint32_t new_callref = 0x80000001; + + +/* Call Control */ + +void cc_tx_to_mncc(struct gsm_network *net, struct msgb *msg) +{ + net->mncc_recv(net, msg); +} + +int gsm48_cc_tx_notify_ss(struct gsm_trans *trans, const char *message) +{ + struct gsm48_hdr *gh; + struct msgb *ss_notify; + + ss_notify = gsm0480_create_notifySS(message); + if (!ss_notify) + return -1; + + gsm0480_wrap_invoke(ss_notify, GSM0480_OP_CODE_NOTIFY_SS, 0); + uint8_t *data = msgb_push(ss_notify, 1); + data[0] = ss_notify->len - 1; + gh = (struct gsm48_hdr *) msgb_push(ss_notify, sizeof(*gh)); + gh->msg_type = GSM48_MT_CC_FACILITY; + return gsm48_conn_sendmsg(ss_notify, trans->conn, trans); +} + +/* FIXME: this count_statistics is a state machine behaviour. we should convert + * the complete call control into a state machine. Afterwards we can move this + * code into state transitions. + */ +static void count_statistics(struct gsm_trans *trans, int new_state) +{ + int old_state = trans->cc.state; + struct rate_ctr_group *msc = trans->net->msc_ctrs; + + if (old_state == new_state) + return; + + /* state incoming */ + switch (new_state) { + case GSM_CSTATE_ACTIVE: + osmo_counter_inc(trans->net->active_calls); + rate_ctr_inc(&msc->ctr[MSC_CTR_CALL_ACTIVE]); + break; + } + + /* state outgoing */ + switch (old_state) { + case GSM_CSTATE_ACTIVE: + osmo_counter_dec(trans->net->active_calls); + if (new_state == GSM_CSTATE_DISCONNECT_REQ || + new_state == GSM_CSTATE_DISCONNECT_IND) + rate_ctr_inc(&msc->ctr[MSC_CTR_CALL_COMPLETE]); + else + rate_ctr_inc(&msc->ctr[MSC_CTR_CALL_INCOMPLETE]); + break; + } +} + +/* The entire call control code is written in accordance with Figure 7.10c + * for 'very early assignment', i.e. we allocate a TCH/F during IMMEDIATE + * ASSIGN, then first use that TCH/F for signalling and later MODE MODIFY + * it for voice */ + +static void new_cc_state(struct gsm_trans *trans, int state) +{ + if (state > 31 || state < 0) + return; + + DEBUGP(DCC, "(ti %02x sub %s) new state %s -> %s\n", + trans->transaction_id, + vlr_subscr_name(trans->vsub), + gsm48_cc_state_name(trans->cc.state), + gsm48_cc_state_name(state)); + + count_statistics(trans, state); + trans->cc.state = state; +} + +static int gsm48_cc_tx_status(struct gsm_trans *trans, void *arg) +{ + struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC STATUS"); + struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + uint8_t *cause, *call_state; + + gh->msg_type = GSM48_MT_CC_STATUS; + + cause = msgb_put(msg, 3); + cause[0] = 2; + cause[1] = GSM48_CAUSE_CS_GSM | GSM48_CAUSE_LOC_USER; + cause[2] = 0x80 | 30; /* response to status inquiry */ + + call_state = msgb_put(msg, 1); + call_state[0] = 0xc0 | 0x00; + + return gsm48_conn_sendmsg(msg, trans->conn, trans); +} + +static void gsm48_stop_cc_timer(struct gsm_trans *trans) +{ + if (osmo_timer_pending(&trans->cc.timer)) { + DEBUGP(DCC, "stopping pending timer T%x\n", trans->cc.Tcurrent); + osmo_timer_del(&trans->cc.timer); + trans->cc.Tcurrent = 0; + } +} + +static int mncc_recvmsg(struct gsm_network *net, struct gsm_trans *trans, + int msg_type, struct gsm_mncc *mncc) +{ + struct msgb *msg; + unsigned char *data; + + DEBUGP(DMNCC, "transmit message %s\n", get_mncc_name(msg_type)); + +#if BEFORE_MSCSPLIT + /* Re-enable this log output once we can obtain this information via + * A-interface, see OS#2391. */ + if (trans) + if (trans->conn && trans->conn->lchan) + DEBUGP(DCC, "(bts %d trx %d ts %d ti %x sub %s) " + "Sending '%s' to MNCC.\n", + trans->conn->lchan->ts->trx->bts->nr, + trans->conn->lchan->ts->trx->nr, + trans->conn->lchan->ts->nr, trans->transaction_id, + vlr_subscr_msisdn_or_name(trans->vsub), + get_mncc_name(msg_type)); + else + DEBUGP(DCC, "(bts - trx - ts - ti -- sub %s) " + "Sending '%s' to MNCC.\n", + vlr_subscr_msisdn_or_name(trans->vsub), + get_mncc_name(msg_type)); + else + DEBUGP(DCC, "(bts - trx - ts - ti -- sub -) " + "Sending '%s' to MNCC.\n", get_mncc_name(msg_type)); +#else + DEBUGP(DCC, "Sending '%s' to MNCC.\n", get_mncc_name(msg_type)); +#endif + + mncc->msg_type = msg_type; + + msg = msgb_alloc(sizeof(struct gsm_mncc), "MNCC"); + if (!msg) + return -ENOMEM; + + data = msgb_put(msg, sizeof(struct gsm_mncc)); + memcpy(data, mncc, sizeof(struct gsm_mncc)); + + cc_tx_to_mncc(net, msg); + + return 0; +} + +int mncc_release_ind(struct gsm_network *net, struct gsm_trans *trans, + uint32_t callref, int location, int value) +{ + struct gsm_mncc rel; + + memset(&rel, 0, sizeof(rel)); + rel.callref = callref; + mncc_set_cause(&rel, location, value); + if (trans && trans->cc.state == GSM_CSTATE_RELEASE_REQ) + return mncc_recvmsg(net, trans, MNCC_REL_CNF, &rel); + return mncc_recvmsg(net, trans, MNCC_REL_IND, &rel); +} + +/* Call Control Specific transaction release. + * gets called by trans_free, DO NOT CALL YOURSELF! */ +void _gsm48_cc_trans_free(struct gsm_trans *trans) +{ + gsm48_stop_cc_timer(trans); + + /* Initiate the teardown of the related connections on the MGW */ + msc_mgcp_call_release(trans); + + /* send release to L4, if callref still exists */ + if (trans->callref) { + /* Ressource unavailable */ + mncc_release_ind(trans->net, trans, trans->callref, + GSM48_CAUSE_LOC_PRN_S_LU, + GSM48_CC_CAUSE_RESOURCE_UNAVAIL); + /* This is a final freeing of the transaction. The MNCC release may have triggered the + * T308 release timer, but we don't have the luxury of graceful CC Release here. */ + gsm48_stop_cc_timer(trans); + } + if (trans->cc.state != GSM_CSTATE_NULL) + new_cc_state(trans, GSM_CSTATE_NULL); +} + +static int gsm48_cc_tx_setup(struct gsm_trans *trans, void *arg); + +/* call-back from paging the B-end of the connection */ +static int setup_trig_pag_evt(unsigned int hooknum, unsigned int event, + struct msgb *msg, void *_conn, void *_transt) +{ + struct gsm_subscriber_connection *conn = _conn; + struct gsm_trans *transt = _transt; + enum gsm_paging_event paging_event = event; + + OSMO_ASSERT(!transt->conn); + + switch (paging_event) { + case GSM_PAGING_SUCCEEDED: + DEBUGP(DCC, "Paging subscr %s succeeded!\n", + vlr_subscr_msisdn_or_name(transt->vsub)); + OSMO_ASSERT(conn); + /* Assign conn */ + transt->conn = msc_subscr_conn_get(conn, MSC_CONN_USE_TRANS_CC); + transt->paging_request = NULL; + /* send SETUP request to called party */ + gsm48_cc_tx_setup(transt, &transt->cc.msg); + break; + case GSM_PAGING_EXPIRED: + case GSM_PAGING_BUSY: + DEBUGP(DCC, "Paging subscr %s %s!\n", + vlr_subscr_msisdn_or_name(transt->vsub), + paging_event == GSM_PAGING_EXPIRED ? "expired" : "busy"); + /* Temporarily out of order */ + mncc_release_ind(transt->net, transt, + transt->callref, + GSM48_CAUSE_LOC_PRN_S_LU, + GSM48_CC_CAUSE_DEST_OOO); + transt->callref = 0; + transt->paging_request = NULL; + trans_free(transt); + break; + } + + return 0; +} + +/* bridge channels of two transactions */ +static int tch_bridge(struct gsm_network *net, struct gsm_mncc_bridge *bridge) +{ + struct gsm_trans *trans1 = trans_find_by_callref(net, bridge->callref[0]); + struct gsm_trans *trans2 = trans_find_by_callref(net, bridge->callref[1]); + int rc; + + if (!trans1 || !trans2) + return -EIO; + + if (!trans1->conn || !trans2->conn) + return -EIO; + + /* Which subscriber do we want to track trans1 or trans2? */ + log_set_context(LOG_CTX_VLR_SUBSCR, trans1->vsub); + + /* Bridge RTP streams */ + rc = msc_mgcp_call_complete(trans1, trans2->conn->rtp.local_port_cn, + trans2->conn->rtp.local_addr_cn); + if (rc) + return -EINVAL; + + rc = msc_mgcp_call_complete(trans2, trans1->conn->rtp.local_port_cn, + trans1->conn->rtp.local_addr_cn); + if (rc) + return -EINVAL; + + return 0; +} + +static int gsm48_cc_rx_status_enq(struct gsm_trans *trans, struct msgb *msg) +{ + DEBUGP(DCC, "-> STATUS ENQ\n"); + return gsm48_cc_tx_status(trans, msg); +} + +static int gsm48_cc_tx_release(struct gsm_trans *trans, void *arg); +static int gsm48_cc_tx_disconnect(struct gsm_trans *trans, void *arg); + +static void gsm48_cc_timeout(void *arg) +{ + struct gsm_trans *trans = arg; + int disconnect = 0, release = 0; + int mo_cause = GSM48_CC_CAUSE_RECOVERY_TIMER; + int mo_location = GSM48_CAUSE_LOC_USER; + int l4_cause = GSM48_CC_CAUSE_NORMAL_UNSPEC; + int l4_location = GSM48_CAUSE_LOC_PRN_S_LU; + struct gsm_mncc mo_rel, l4_rel; + + memset(&mo_rel, 0, sizeof(struct gsm_mncc)); + mo_rel.callref = trans->callref; + memset(&l4_rel, 0, sizeof(struct gsm_mncc)); + l4_rel.callref = trans->callref; + + switch(trans->cc.Tcurrent) { + case 0x303: + release = 1; + l4_cause = GSM48_CC_CAUSE_USER_NOTRESPOND; + break; + case 0x310: + disconnect = 1; + l4_cause = GSM48_CC_CAUSE_USER_NOTRESPOND; + break; + case 0x313: + disconnect = 1; + /* unknown, did not find it in the specs */ + break; + case 0x301: + disconnect = 1; + l4_cause = GSM48_CC_CAUSE_USER_NOTRESPOND; + break; + case 0x308: + if (!trans->cc.T308_second) { + /* restart T308 a second time */ + gsm48_cc_tx_release(trans, &trans->cc.msg); + trans->cc.T308_second = 1; + break; /* stay in release state */ + } + trans_free(trans); + return; + case 0x306: + release = 1; + mo_cause = trans->cc.msg.cause.value; + mo_location = trans->cc.msg.cause.location; + break; + case 0x323: + disconnect = 1; + break; + default: + release = 1; + } + + if (release && trans->callref) { + /* process release towards layer 4 */ + mncc_release_ind(trans->net, trans, trans->callref, + l4_location, l4_cause); + trans->callref = 0; + } + + if (disconnect && trans->callref) { + /* process disconnect towards layer 4 */ + mncc_set_cause(&l4_rel, l4_location, l4_cause); + mncc_recvmsg(trans->net, trans, MNCC_DISC_IND, &l4_rel); + } + + /* process disconnect towards mobile station */ + if (disconnect || release) { + mncc_set_cause(&mo_rel, mo_location, mo_cause); + mo_rel.cause.diag[0] = ((trans->cc.Tcurrent & 0xf00) >> 8) + '0'; + mo_rel.cause.diag[1] = ((trans->cc.Tcurrent & 0x0f0) >> 4) + '0'; + mo_rel.cause.diag[2] = (trans->cc.Tcurrent & 0x00f) + '0'; + mo_rel.cause.diag_len = 3; + + if (disconnect) + gsm48_cc_tx_disconnect(trans, &mo_rel); + if (release) + gsm48_cc_tx_release(trans, &mo_rel); + } + +} + +/* disconnect both calls from the bridge */ +static inline void disconnect_bridge(struct gsm_network *net, + struct gsm_mncc_bridge *bridge, int err) +{ + struct gsm_trans *trans0 = trans_find_by_callref(net, bridge->callref[0]); + struct gsm_trans *trans1 = trans_find_by_callref(net, bridge->callref[1]); + struct gsm_mncc mx_rel; + if (!trans0 || !trans1) + return; + + DEBUGP(DCC, "Failed to bridge TCH for calls %x <-> %x :: %s \n", + trans0->callref, trans1->callref, strerror(err)); + + memset(&mx_rel, 0, sizeof(struct gsm_mncc)); + mncc_set_cause(&mx_rel, GSM48_CAUSE_LOC_INN_NET, + GSM48_CC_CAUSE_CHAN_UNACCEPT); + + mx_rel.callref = trans0->callref; + gsm48_cc_tx_disconnect(trans0, &mx_rel); + + mx_rel.callref = trans1->callref; + gsm48_cc_tx_disconnect(trans1, &mx_rel); +} + +static void gsm48_start_cc_timer(struct gsm_trans *trans, int current, + int sec, int micro) +{ + DEBUGP(DCC, "starting timer T%x with %d seconds\n", current, sec); + osmo_timer_setup(&trans->cc.timer, gsm48_cc_timeout, trans); + osmo_timer_schedule(&trans->cc.timer, sec, micro); + trans->cc.Tcurrent = current; +} + +static int gsm48_cc_rx_setup(struct gsm_trans *trans, struct msgb *msg) +{ + struct gsm48_hdr *gh = msgb_l3(msg); + uint8_t msg_type = gsm48_hdr_msg_type(gh); + unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh); + struct tlv_parsed tp; + struct gsm_mncc setup; + + memset(&setup, 0, sizeof(struct gsm_mncc)); + setup.callref = trans->callref; + + tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, 0, 0); + /* emergency setup is identified by msg_type */ + if (msg_type == GSM48_MT_CC_EMERG_SETUP) { + setup.fields |= MNCC_F_EMERGENCY; + setup.emergency = 1; + /* use destination number as configured by user (if any) */ + if (trans->net->emergency.route_to_msisdn) { + setup.fields |= MNCC_F_CALLED; + setup.called.type = 0; /* unknown */ + setup.called.plan = 0; /* unknown */ + OSMO_STRLCPY_ARRAY(setup.called.number, + trans->net->emergency.route_to_msisdn); + } + } + + /* use subscriber as calling party number */ + setup.fields |= MNCC_F_CALLING; + OSMO_STRLCPY_ARRAY(setup.calling.number, trans->vsub->msisdn); + OSMO_STRLCPY_ARRAY(setup.imsi, trans->vsub->imsi); + + /* bearer capability */ + if (TLVP_PRESENT(&tp, GSM48_IE_BEARER_CAP)) { + setup.fields |= MNCC_F_BEARER_CAP; + gsm48_decode_bearer_cap(&setup.bearer_cap, + TLVP_VAL(&tp, GSM48_IE_BEARER_CAP)-1); + + /* Create a copy of the bearer capability + * in the transaction struct, so we can use + * this information later */ + memcpy(&trans->bearer_cap,&setup.bearer_cap, + sizeof(trans->bearer_cap)); + } + /* facility */ + if (TLVP_PRESENT(&tp, GSM48_IE_FACILITY)) { + setup.fields |= MNCC_F_FACILITY; + gsm48_decode_facility(&setup.facility, + TLVP_VAL(&tp, GSM48_IE_FACILITY)-1); + } + /* called party bcd number */ + if (TLVP_PRESENT(&tp, GSM48_IE_CALLED_BCD)) { + setup.fields |= MNCC_F_CALLED; + gsm48_decode_called(&setup.called, + TLVP_VAL(&tp, GSM48_IE_CALLED_BCD)-1); + } + /* user-user */ + if (TLVP_PRESENT(&tp, GSM48_IE_USER_USER)) { + setup.fields |= MNCC_F_USERUSER; + gsm48_decode_useruser(&setup.useruser, + TLVP_VAL(&tp, GSM48_IE_USER_USER)-1); + } + /* ss-version */ + if (TLVP_PRESENT(&tp, GSM48_IE_SS_VERS)) { + setup.fields |= MNCC_F_SSVERSION; + gsm48_decode_ssversion(&setup.ssversion, + TLVP_VAL(&tp, GSM48_IE_SS_VERS)-1); + } + /* CLIR suppression */ + if (TLVP_PRESENT(&tp, GSM48_IE_CLIR_SUPP)) + setup.clir.sup = 1; + /* CLIR invocation */ + if (TLVP_PRESENT(&tp, GSM48_IE_CLIR_INVOC)) + setup.clir.inv = 1; + /* cc cap */ + if (TLVP_PRESENT(&tp, GSM48_IE_CC_CAP)) { + setup.fields |= MNCC_F_CCCAP; + gsm48_decode_cccap(&setup.cccap, + TLVP_VAL(&tp, GSM48_IE_CC_CAP)-1); + } + + new_cc_state(trans, GSM_CSTATE_INITIATED); + + LOGP(DCC, setup.emergency ? LOGL_NOTICE : LOGL_INFO, "Subscriber %s (%s) sends %sSETUP to %s\n", + vlr_subscr_name(trans->vsub), trans->vsub->msisdn, setup.emergency ? "EMERGENCY_" : "", + setup.called.number); + + rate_ctr_inc(&trans->net->msc_ctrs->ctr[MSC_CTR_CALL_MO_SETUP]); + + /* indicate setup to MNCC */ + mncc_recvmsg(trans->net, trans, MNCC_SETUP_IND, &setup); + + /* MNCC code will modify the channel asynchronously, we should + * ipaccess-bind only after the modification has been made to the + * lchan->tch_mode */ + return 0; +} + +static int gsm48_cc_tx_setup(struct gsm_trans *trans, void *arg) +{ + struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC STUP"); + struct gsm48_hdr *gh; + struct gsm_mncc *setup = arg; + int rc, trans_id; + + gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + + /* transaction id must not be assigned */ + if (trans->transaction_id != 0xff) { /* unasssigned */ + DEBUGP(DCC, "TX Setup with assigned transaction. " + "This is not allowed!\n"); + /* Temporarily out of order */ + rc = mncc_release_ind(trans->net, trans, trans->callref, + GSM48_CAUSE_LOC_PRN_S_LU, + GSM48_CC_CAUSE_RESOURCE_UNAVAIL); + trans->callref = 0; + trans_free(trans); + return rc; + } + + /* Get free transaction_id */ + trans_id = trans_assign_trans_id(trans->net, trans->vsub, + GSM48_PDISC_CC, 0); + if (trans_id < 0) { + /* no free transaction ID */ + rc = mncc_release_ind(trans->net, trans, trans->callref, + GSM48_CAUSE_LOC_PRN_S_LU, + GSM48_CC_CAUSE_RESOURCE_UNAVAIL); + trans->callref = 0; + trans_free(trans); + return rc; + } + trans->transaction_id = trans_id; + + gh->msg_type = GSM48_MT_CC_SETUP; + + gsm48_start_cc_timer(trans, 0x303, GSM48_T303); + + /* bearer capability */ + if (setup->fields & MNCC_F_BEARER_CAP) { + /* Create a copy of the bearer capability in the transaction struct, so we + * can use this information later */ + memcpy(&trans->bearer_cap, &setup->bearer_cap, sizeof(trans->bearer_cap)); + gsm48_encode_bearer_cap(msg, 0, &setup->bearer_cap); + } + /* facility */ + if (setup->fields & MNCC_F_FACILITY) + gsm48_encode_facility(msg, 0, &setup->facility); + /* progress */ + if (setup->fields & MNCC_F_PROGRESS) + gsm48_encode_progress(msg, 0, &setup->progress); + /* calling party BCD number */ + if (setup->fields & MNCC_F_CALLING) + gsm48_encode_calling(msg, &setup->calling); + /* called party BCD number */ + if (setup->fields & MNCC_F_CALLED) + gsm48_encode_called(msg, &setup->called); + /* user-user */ + if (setup->fields & MNCC_F_USERUSER) + gsm48_encode_useruser(msg, 0, &setup->useruser); + /* redirecting party BCD number */ + if (setup->fields & MNCC_F_REDIRECTING) + gsm48_encode_redirecting(msg, &setup->redirecting); + /* signal */ + if (setup->fields & MNCC_F_SIGNAL) + gsm48_encode_signal(msg, setup->signal); + + new_cc_state(trans, GSM_CSTATE_CALL_PRESENT); + + rate_ctr_inc(&trans->net->msc_ctrs->ctr[MSC_CTR_CALL_MT_SETUP]); + + return gsm48_conn_sendmsg(msg, trans->conn, trans); +} + +static int gsm48_cc_rx_call_conf(struct gsm_trans *trans, struct msgb *msg) +{ + struct gsm48_hdr *gh = msgb_l3(msg); + unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh); + struct tlv_parsed tp; + struct gsm_mncc call_conf; + int rc; + + gsm48_stop_cc_timer(trans); + gsm48_start_cc_timer(trans, 0x310, GSM48_T310); + + memset(&call_conf, 0, sizeof(struct gsm_mncc)); + call_conf.callref = trans->callref; + + tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, 0, 0); +#if 0 + /* repeat */ + if (TLVP_PRESENT(&tp, GSM48_IE_REPEAT_CIR)) + call_conf.repeat = 1; + if (TLVP_PRESENT(&tp, GSM48_IE_REPEAT_SEQ)) + call_conf.repeat = 2; +#endif + /* bearer capability */ + if (TLVP_PRESENT(&tp, GSM48_IE_BEARER_CAP)) { + call_conf.fields |= MNCC_F_BEARER_CAP; + gsm48_decode_bearer_cap(&call_conf.bearer_cap, + TLVP_VAL(&tp, GSM48_IE_BEARER_CAP)-1); + + /* Create a copy of the bearer capability + * in the transaction struct, so we can use + * this information later */ + memcpy(&trans->bearer_cap,&call_conf.bearer_cap, + sizeof(trans->bearer_cap)); + } + /* cause */ + if (TLVP_PRESENT(&tp, GSM48_IE_CAUSE)) { + call_conf.fields |= MNCC_F_CAUSE; + gsm48_decode_cause(&call_conf.cause, + TLVP_VAL(&tp, GSM48_IE_CAUSE)-1); + } + /* cc cap */ + if (TLVP_PRESENT(&tp, GSM48_IE_CC_CAP)) { + call_conf.fields |= MNCC_F_CCCAP; + gsm48_decode_cccap(&call_conf.cccap, + TLVP_VAL(&tp, GSM48_IE_CC_CAP)-1); + } + + /* IMSI of called subscriber */ + OSMO_STRLCPY_ARRAY(call_conf.imsi, trans->vsub->imsi); + + new_cc_state(trans, GSM_CSTATE_MO_TERM_CALL_CONF); + + /* Assign call (if not done yet) */ + if (trans->assignment_done == false) { + rc = msc_mgcp_call_assignment(trans); + trans->assignment_done = true; + } + else + rc = 0; + + /* don't continue, if there were problems with + * the call assignment. */ + if (rc) + return rc; + + return mncc_recvmsg(trans->net, trans, MNCC_CALL_CONF_IND, + &call_conf); +} + +static int gsm48_cc_tx_call_proc_and_assign(struct gsm_trans *trans, void *arg) +{ + struct gsm_mncc *proceeding = arg; + struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC PROC"); + struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + int rc; + + gh->msg_type = GSM48_MT_CC_CALL_PROC; + + new_cc_state(trans, GSM_CSTATE_MO_CALL_PROC); + + /* bearer capability */ + if (proceeding->fields & MNCC_F_BEARER_CAP) { + gsm48_encode_bearer_cap(msg, 0, &proceeding->bearer_cap); + memcpy(&trans->bearer_cap, &proceeding->bearer_cap, sizeof(trans->bearer_cap)); + } + /* facility */ + if (proceeding->fields & MNCC_F_FACILITY) + gsm48_encode_facility(msg, 0, &proceeding->facility); + /* progress */ + if (proceeding->fields & MNCC_F_PROGRESS) + gsm48_encode_progress(msg, 0, &proceeding->progress); + + rc = gsm48_conn_sendmsg(msg, trans->conn, trans); + if (rc) + return rc; + + /* Assign call (if not done yet) */ + if (trans->assignment_done == false) { + rc = msc_mgcp_call_assignment(trans); + trans->assignment_done = true; + } + else + rc = 0; + + return rc; +} + +static int gsm48_cc_rx_alerting(struct gsm_trans *trans, struct msgb *msg) +{ + struct gsm48_hdr *gh = msgb_l3(msg); + unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh); + struct tlv_parsed tp; + struct gsm_mncc alerting; + + gsm48_stop_cc_timer(trans); + gsm48_start_cc_timer(trans, 0x301, GSM48_T301); + + memset(&alerting, 0, sizeof(struct gsm_mncc)); + alerting.callref = trans->callref; + tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, 0, 0); + /* facility */ + if (TLVP_PRESENT(&tp, GSM48_IE_FACILITY)) { + alerting.fields |= MNCC_F_FACILITY; + gsm48_decode_facility(&alerting.facility, + TLVP_VAL(&tp, GSM48_IE_FACILITY)-1); + } + + /* progress */ + if (TLVP_PRESENT(&tp, GSM48_IE_PROGR_IND)) { + alerting.fields |= MNCC_F_PROGRESS; + gsm48_decode_progress(&alerting.progress, + TLVP_VAL(&tp, GSM48_IE_PROGR_IND)-1); + } + /* ss-version */ + if (TLVP_PRESENT(&tp, GSM48_IE_SS_VERS)) { + alerting.fields |= MNCC_F_SSVERSION; + gsm48_decode_ssversion(&alerting.ssversion, + TLVP_VAL(&tp, GSM48_IE_SS_VERS)-1); + } + + new_cc_state(trans, GSM_CSTATE_CALL_RECEIVED); + + return mncc_recvmsg(trans->net, trans, MNCC_ALERT_IND, + &alerting); +} + +static int gsm48_cc_tx_alerting(struct gsm_trans *trans, void *arg) +{ + struct gsm_mncc *alerting = arg; + struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC ALERT"); + struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + + gh->msg_type = GSM48_MT_CC_ALERTING; + + /* facility */ + if (alerting->fields & MNCC_F_FACILITY) + gsm48_encode_facility(msg, 0, &alerting->facility); + /* progress */ + if (alerting->fields & MNCC_F_PROGRESS) + gsm48_encode_progress(msg, 0, &alerting->progress); + /* user-user */ + if (alerting->fields & MNCC_F_USERUSER) + gsm48_encode_useruser(msg, 0, &alerting->useruser); + + new_cc_state(trans, GSM_CSTATE_CALL_DELIVERED); + + return gsm48_conn_sendmsg(msg, trans->conn, trans); +} + +static int gsm48_cc_tx_progress(struct gsm_trans *trans, void *arg) +{ + struct gsm_mncc *progress = arg; + struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC PROGRESS"); + struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + + gh->msg_type = GSM48_MT_CC_PROGRESS; + + /* progress */ + gsm48_encode_progress(msg, 1, &progress->progress); + /* user-user */ + if (progress->fields & MNCC_F_USERUSER) + gsm48_encode_useruser(msg, 0, &progress->useruser); + + return gsm48_conn_sendmsg(msg, trans->conn, trans); +} + +static int gsm48_cc_tx_connect(struct gsm_trans *trans, void *arg) +{ + struct gsm_mncc *connect = arg; + struct msgb *msg = gsm48_msgb_alloc_name("GSN 04.08 CC CON"); + struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + + gh->msg_type = GSM48_MT_CC_CONNECT; + + gsm48_stop_cc_timer(trans); + gsm48_start_cc_timer(trans, 0x313, GSM48_T313); + + /* facility */ + if (connect->fields & MNCC_F_FACILITY) + gsm48_encode_facility(msg, 0, &connect->facility); + /* progress */ + if (connect->fields & MNCC_F_PROGRESS) + gsm48_encode_progress(msg, 0, &connect->progress); + /* connected number */ + if (connect->fields & MNCC_F_CONNECTED) + gsm48_encode_connected(msg, &connect->connected); + /* user-user */ + if (connect->fields & MNCC_F_USERUSER) + gsm48_encode_useruser(msg, 0, &connect->useruser); + + new_cc_state(trans, GSM_CSTATE_CONNECT_IND); + + return gsm48_conn_sendmsg(msg, trans->conn, trans); +} + +static int gsm48_cc_rx_connect(struct gsm_trans *trans, struct msgb *msg) +{ + struct gsm48_hdr *gh = msgb_l3(msg); + unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh); + struct tlv_parsed tp; + struct gsm_mncc connect; + + gsm48_stop_cc_timer(trans); + + memset(&connect, 0, sizeof(struct gsm_mncc)); + connect.callref = trans->callref; + tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, 0, 0); + /* use subscriber as connected party number */ + connect.fields |= MNCC_F_CONNECTED; + OSMO_STRLCPY_ARRAY(connect.connected.number, trans->vsub->msisdn); + OSMO_STRLCPY_ARRAY(connect.imsi, trans->vsub->imsi); + + /* facility */ + if (TLVP_PRESENT(&tp, GSM48_IE_FACILITY)) { + connect.fields |= MNCC_F_FACILITY; + gsm48_decode_facility(&connect.facility, + TLVP_VAL(&tp, GSM48_IE_FACILITY)-1); + } + /* user-user */ + if (TLVP_PRESENT(&tp, GSM48_IE_USER_USER)) { + connect.fields |= MNCC_F_USERUSER; + gsm48_decode_useruser(&connect.useruser, + TLVP_VAL(&tp, GSM48_IE_USER_USER)-1); + } + /* ss-version */ + if (TLVP_PRESENT(&tp, GSM48_IE_SS_VERS)) { + connect.fields |= MNCC_F_SSVERSION; + gsm48_decode_ssversion(&connect.ssversion, + TLVP_VAL(&tp, GSM48_IE_SS_VERS)-1); + } + + new_cc_state(trans, GSM_CSTATE_CONNECT_REQUEST); + rate_ctr_inc(&trans->net->msc_ctrs->ctr[MSC_CTR_CALL_MT_CONNECT]); + + return mncc_recvmsg(trans->net, trans, MNCC_SETUP_CNF, &connect); +} + + +static int gsm48_cc_rx_connect_ack(struct gsm_trans *trans, struct msgb *msg) +{ + struct gsm_mncc connect_ack; + + gsm48_stop_cc_timer(trans); + + new_cc_state(trans, GSM_CSTATE_ACTIVE); + rate_ctr_inc(&trans->net->msc_ctrs->ctr[MSC_CTR_CALL_MO_CONNECT_ACK]); + + memset(&connect_ack, 0, sizeof(struct gsm_mncc)); + connect_ack.callref = trans->callref; + + return mncc_recvmsg(trans->net, trans, MNCC_SETUP_COMPL_IND, + &connect_ack); +} + +static int gsm48_cc_tx_connect_ack(struct gsm_trans *trans, void *arg) +{ + struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC CON ACK"); + struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + + gh->msg_type = GSM48_MT_CC_CONNECT_ACK; + + new_cc_state(trans, GSM_CSTATE_ACTIVE); + + return gsm48_conn_sendmsg(msg, trans->conn, trans); +} + +static int gsm48_cc_rx_disconnect(struct gsm_trans *trans, struct msgb *msg) +{ + struct gsm48_hdr *gh = msgb_l3(msg); + unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh); + struct tlv_parsed tp; + struct gsm_mncc disc; + + gsm48_stop_cc_timer(trans); + + new_cc_state(trans, GSM_CSTATE_DISCONNECT_REQ); + + memset(&disc, 0, sizeof(struct gsm_mncc)); + disc.callref = trans->callref; + tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, GSM48_IE_CAUSE, 0); + /* cause */ + if (TLVP_PRESENT(&tp, GSM48_IE_CAUSE)) { + disc.fields |= MNCC_F_CAUSE; + gsm48_decode_cause(&disc.cause, + TLVP_VAL(&tp, GSM48_IE_CAUSE)-1); + } + /* facility */ + if (TLVP_PRESENT(&tp, GSM48_IE_FACILITY)) { + disc.fields |= MNCC_F_FACILITY; + gsm48_decode_facility(&disc.facility, + TLVP_VAL(&tp, GSM48_IE_FACILITY)-1); + } + /* user-user */ + if (TLVP_PRESENT(&tp, GSM48_IE_USER_USER)) { + disc.fields |= MNCC_F_USERUSER; + gsm48_decode_useruser(&disc.useruser, + TLVP_VAL(&tp, GSM48_IE_USER_USER)-1); + } + /* ss-version */ + if (TLVP_PRESENT(&tp, GSM48_IE_SS_VERS)) { + disc.fields |= MNCC_F_SSVERSION; + gsm48_decode_ssversion(&disc.ssversion, + TLVP_VAL(&tp, GSM48_IE_SS_VERS)-1); + } + + return mncc_recvmsg(trans->net, trans, MNCC_DISC_IND, &disc); + +} + +static struct gsm_mncc_cause default_cause = { + .location = GSM48_CAUSE_LOC_PRN_S_LU, + .coding = 0, + .rec = 0, + .rec_val = 0, + .value = GSM48_CC_CAUSE_NORMAL_UNSPEC, + .diag_len = 0, + .diag = { 0 }, +}; + +static int gsm48_cc_tx_disconnect(struct gsm_trans *trans, void *arg) +{ + struct gsm_mncc *disc = arg; + struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC DISC"); + struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + + gh->msg_type = GSM48_MT_CC_DISCONNECT; + + gsm48_stop_cc_timer(trans); + gsm48_start_cc_timer(trans, 0x306, GSM48_T306); + + /* cause */ + if (disc->fields & MNCC_F_CAUSE) + gsm48_encode_cause(msg, 1, &disc->cause); + else + gsm48_encode_cause(msg, 1, &default_cause); + + /* facility */ + if (disc->fields & MNCC_F_FACILITY) + gsm48_encode_facility(msg, 0, &disc->facility); + /* progress */ + if (disc->fields & MNCC_F_PROGRESS) + gsm48_encode_progress(msg, 0, &disc->progress); + /* user-user */ + if (disc->fields & MNCC_F_USERUSER) + gsm48_encode_useruser(msg, 0, &disc->useruser); + + /* store disconnect cause for T306 expiry */ + memcpy(&trans->cc.msg, disc, sizeof(struct gsm_mncc)); + + new_cc_state(trans, GSM_CSTATE_DISCONNECT_IND); + + return gsm48_conn_sendmsg(msg, trans->conn, trans); +} + +static int gsm48_cc_rx_release(struct gsm_trans *trans, struct msgb *msg) +{ + struct gsm48_hdr *gh = msgb_l3(msg); + unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh); + struct tlv_parsed tp; + struct gsm_mncc rel; + int rc; + + gsm48_stop_cc_timer(trans); + + memset(&rel, 0, sizeof(struct gsm_mncc)); + rel.callref = trans->callref; + tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, 0, 0); + /* cause */ + if (TLVP_PRESENT(&tp, GSM48_IE_CAUSE)) { + rel.fields |= MNCC_F_CAUSE; + gsm48_decode_cause(&rel.cause, + TLVP_VAL(&tp, GSM48_IE_CAUSE)-1); + } + /* facility */ + if (TLVP_PRESENT(&tp, GSM48_IE_FACILITY)) { + rel.fields |= MNCC_F_FACILITY; + gsm48_decode_facility(&rel.facility, + TLVP_VAL(&tp, GSM48_IE_FACILITY)-1); + } + /* user-user */ + if (TLVP_PRESENT(&tp, GSM48_IE_USER_USER)) { + rel.fields |= MNCC_F_USERUSER; + gsm48_decode_useruser(&rel.useruser, + TLVP_VAL(&tp, GSM48_IE_USER_USER)-1); + } + /* ss-version */ + if (TLVP_PRESENT(&tp, GSM48_IE_SS_VERS)) { + rel.fields |= MNCC_F_SSVERSION; + gsm48_decode_ssversion(&rel.ssversion, + TLVP_VAL(&tp, GSM48_IE_SS_VERS)-1); + } + + if (trans->cc.state == GSM_CSTATE_RELEASE_REQ) { + /* release collision 5.4.5 */ + rc = mncc_recvmsg(trans->net, trans, MNCC_REL_CNF, &rel); + } else { + rc = gsm48_tx_simple(trans->conn, + GSM48_PDISC_CC | (trans->transaction_id << 4), + GSM48_MT_CC_RELEASE_COMPL); + rc = mncc_recvmsg(trans->net, trans, MNCC_REL_IND, &rel); + } + + new_cc_state(trans, GSM_CSTATE_NULL); + + trans->callref = 0; + trans_free(trans); + + return rc; +} + +static int gsm48_cc_tx_release(struct gsm_trans *trans, void *arg) +{ + struct gsm_mncc *rel = arg; + struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC REL"); + struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + + gh->msg_type = GSM48_MT_CC_RELEASE; + + gsm48_stop_cc_timer(trans); + gsm48_start_cc_timer(trans, 0x308, GSM48_T308); + + /* cause */ + if (rel->fields & MNCC_F_CAUSE) + gsm48_encode_cause(msg, 0, &rel->cause); + /* facility */ + if (rel->fields & MNCC_F_FACILITY) + gsm48_encode_facility(msg, 0, &rel->facility); + /* user-user */ + if (rel->fields & MNCC_F_USERUSER) + gsm48_encode_useruser(msg, 0, &rel->useruser); + + trans->cc.T308_second = 0; + memcpy(&trans->cc.msg, rel, sizeof(struct gsm_mncc)); + + if (trans->cc.state != GSM_CSTATE_RELEASE_REQ) + new_cc_state(trans, GSM_CSTATE_RELEASE_REQ); + + return gsm48_conn_sendmsg(msg, trans->conn, trans); +} + +static int gsm48_cc_rx_release_compl(struct gsm_trans *trans, struct msgb *msg) +{ + struct gsm48_hdr *gh = msgb_l3(msg); + unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh); + struct tlv_parsed tp; + struct gsm_mncc rel; + int rc = 0; + + gsm48_stop_cc_timer(trans); + + memset(&rel, 0, sizeof(struct gsm_mncc)); + rel.callref = trans->callref; + tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, 0, 0); + /* cause */ + if (TLVP_PRESENT(&tp, GSM48_IE_CAUSE)) { + rel.fields |= MNCC_F_CAUSE; + gsm48_decode_cause(&rel.cause, + TLVP_VAL(&tp, GSM48_IE_CAUSE)-1); + } + /* facility */ + if (TLVP_PRESENT(&tp, GSM48_IE_FACILITY)) { + rel.fields |= MNCC_F_FACILITY; + gsm48_decode_facility(&rel.facility, + TLVP_VAL(&tp, GSM48_IE_FACILITY)-1); + } + /* user-user */ + if (TLVP_PRESENT(&tp, GSM48_IE_USER_USER)) { + rel.fields |= MNCC_F_USERUSER; + gsm48_decode_useruser(&rel.useruser, + TLVP_VAL(&tp, GSM48_IE_USER_USER)-1); + } + /* ss-version */ + if (TLVP_PRESENT(&tp, GSM48_IE_SS_VERS)) { + rel.fields |= MNCC_F_SSVERSION; + gsm48_decode_ssversion(&rel.ssversion, + TLVP_VAL(&tp, GSM48_IE_SS_VERS)-1); + } + + if (trans->callref) { + switch (trans->cc.state) { + case GSM_CSTATE_CALL_PRESENT: + rc = mncc_recvmsg(trans->net, trans, + MNCC_REJ_IND, &rel); + break; + case GSM_CSTATE_RELEASE_REQ: + rc = mncc_recvmsg(trans->net, trans, + MNCC_REL_CNF, &rel); + break; + default: + rc = mncc_recvmsg(trans->net, trans, + MNCC_REL_IND, &rel); + } + } + + trans->callref = 0; + trans_free(trans); + + return rc; +} + +static int gsm48_cc_tx_release_compl(struct gsm_trans *trans, void *arg) +{ + struct gsm_mncc *rel = arg; + struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC REL COMPL"); + struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + int ret; + + gh->msg_type = GSM48_MT_CC_RELEASE_COMPL; + + trans->callref = 0; + + gsm48_stop_cc_timer(trans); + + /* cause */ + if (rel->fields & MNCC_F_CAUSE) + gsm48_encode_cause(msg, 0, &rel->cause); + /* facility */ + if (rel->fields & MNCC_F_FACILITY) + gsm48_encode_facility(msg, 0, &rel->facility); + /* user-user */ + if (rel->fields & MNCC_F_USERUSER) + gsm48_encode_useruser(msg, 0, &rel->useruser); + + ret = gsm48_conn_sendmsg(msg, trans->conn, trans); + + trans_free(trans); + + return ret; +} + +static int gsm48_cc_rx_facility(struct gsm_trans *trans, struct msgb *msg) +{ + struct gsm48_hdr *gh = msgb_l3(msg); + unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh); + struct tlv_parsed tp; + struct gsm_mncc fac; + + memset(&fac, 0, sizeof(struct gsm_mncc)); + fac.callref = trans->callref; + tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, GSM48_IE_FACILITY, 0); + /* facility */ + if (TLVP_PRESENT(&tp, GSM48_IE_FACILITY)) { + fac.fields |= MNCC_F_FACILITY; + gsm48_decode_facility(&fac.facility, + TLVP_VAL(&tp, GSM48_IE_FACILITY)-1); + } + /* ss-version */ + if (TLVP_PRESENT(&tp, GSM48_IE_SS_VERS)) { + fac.fields |= MNCC_F_SSVERSION; + gsm48_decode_ssversion(&fac.ssversion, + TLVP_VAL(&tp, GSM48_IE_SS_VERS)-1); + } + + return mncc_recvmsg(trans->net, trans, MNCC_FACILITY_IND, &fac); +} + +static int gsm48_cc_tx_facility(struct gsm_trans *trans, void *arg) +{ + struct gsm_mncc *fac = arg; + struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC FAC"); + struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + + gh->msg_type = GSM48_MT_CC_FACILITY; + + /* facility */ + gsm48_encode_facility(msg, 1, &fac->facility); + + return gsm48_conn_sendmsg(msg, trans->conn, trans); +} + +static int gsm48_cc_rx_hold(struct gsm_trans *trans, struct msgb *msg) +{ + struct gsm_mncc hold; + + memset(&hold, 0, sizeof(struct gsm_mncc)); + hold.callref = trans->callref; + return mncc_recvmsg(trans->net, trans, MNCC_HOLD_IND, &hold); +} + +static int gsm48_cc_tx_hold_ack(struct gsm_trans *trans, void *arg) +{ + struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC HLD ACK"); + struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + + gh->msg_type = GSM48_MT_CC_HOLD_ACK; + + return gsm48_conn_sendmsg(msg, trans->conn, trans); +} + +static int gsm48_cc_tx_hold_rej(struct gsm_trans *trans, void *arg) +{ + struct gsm_mncc *hold_rej = arg; + struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC HLD REJ"); + struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + + gh->msg_type = GSM48_MT_CC_HOLD_REJ; + + /* cause */ + if (hold_rej->fields & MNCC_F_CAUSE) + gsm48_encode_cause(msg, 1, &hold_rej->cause); + else + gsm48_encode_cause(msg, 1, &default_cause); + + return gsm48_conn_sendmsg(msg, trans->conn, trans); +} + +static int gsm48_cc_rx_retrieve(struct gsm_trans *trans, struct msgb *msg) +{ + struct gsm_mncc retrieve; + + memset(&retrieve, 0, sizeof(struct gsm_mncc)); + retrieve.callref = trans->callref; + return mncc_recvmsg(trans->net, trans, MNCC_RETRIEVE_IND, + &retrieve); +} + +static int gsm48_cc_tx_retrieve_ack(struct gsm_trans *trans, void *arg) +{ + struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC RETR ACK"); + struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + + gh->msg_type = GSM48_MT_CC_RETR_ACK; + + return gsm48_conn_sendmsg(msg, trans->conn, trans); +} + +static int gsm48_cc_tx_retrieve_rej(struct gsm_trans *trans, void *arg) +{ + struct gsm_mncc *retrieve_rej = arg; + struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC RETR REJ"); + struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + + gh->msg_type = GSM48_MT_CC_RETR_REJ; + + /* cause */ + if (retrieve_rej->fields & MNCC_F_CAUSE) + gsm48_encode_cause(msg, 1, &retrieve_rej->cause); + else + gsm48_encode_cause(msg, 1, &default_cause); + + return gsm48_conn_sendmsg(msg, trans->conn, trans); +} + +static int gsm48_cc_rx_start_dtmf(struct gsm_trans *trans, struct msgb *msg) +{ + struct gsm48_hdr *gh = msgb_l3(msg); + unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh); + struct tlv_parsed tp; + struct gsm_mncc dtmf; + + memset(&dtmf, 0, sizeof(struct gsm_mncc)); + dtmf.callref = trans->callref; + tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, 0, 0); + /* keypad facility */ + if (TLVP_PRESENT(&tp, GSM48_IE_KPD_FACILITY)) { + dtmf.fields |= MNCC_F_KEYPAD; + gsm48_decode_keypad(&dtmf.keypad, + TLVP_VAL(&tp, GSM48_IE_KPD_FACILITY)-1); + } + + return mncc_recvmsg(trans->net, trans, MNCC_START_DTMF_IND, &dtmf); +} + +static int gsm48_cc_tx_start_dtmf_ack(struct gsm_trans *trans, void *arg) +{ + struct gsm_mncc *dtmf = arg; + struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 DTMF ACK"); + struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + + gh->msg_type = GSM48_MT_CC_START_DTMF_ACK; + + /* keypad */ + if (dtmf->fields & MNCC_F_KEYPAD) + gsm48_encode_keypad(msg, dtmf->keypad); + + return gsm48_conn_sendmsg(msg, trans->conn, trans); +} + +static int gsm48_cc_tx_start_dtmf_rej(struct gsm_trans *trans, void *arg) +{ + struct gsm_mncc *dtmf = arg; + struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 DTMF REJ"); + struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + + gh->msg_type = GSM48_MT_CC_START_DTMF_REJ; + + /* cause */ + if (dtmf->fields & MNCC_F_CAUSE) + gsm48_encode_cause(msg, 1, &dtmf->cause); + else + gsm48_encode_cause(msg, 1, &default_cause); + + return gsm48_conn_sendmsg(msg, trans->conn, trans); +} + +static int gsm48_cc_tx_stop_dtmf_ack(struct gsm_trans *trans, void *arg) +{ + struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 DTMF STP ACK"); + struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + + gh->msg_type = GSM48_MT_CC_STOP_DTMF_ACK; + + return gsm48_conn_sendmsg(msg, trans->conn, trans); +} + +static int gsm48_cc_rx_stop_dtmf(struct gsm_trans *trans, struct msgb *msg) +{ + struct gsm_mncc dtmf; + + memset(&dtmf, 0, sizeof(struct gsm_mncc)); + dtmf.callref = trans->callref; + + return mncc_recvmsg(trans->net, trans, MNCC_STOP_DTMF_IND, &dtmf); +} + +static int gsm48_cc_rx_modify(struct gsm_trans *trans, struct msgb *msg) +{ + struct gsm48_hdr *gh = msgb_l3(msg); + unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh); + struct tlv_parsed tp; + struct gsm_mncc modify; + + memset(&modify, 0, sizeof(struct gsm_mncc)); + modify.callref = trans->callref; + tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, GSM48_IE_BEARER_CAP, 0); + /* bearer capability */ + if (TLVP_PRESENT(&tp, GSM48_IE_BEARER_CAP)) { + modify.fields |= MNCC_F_BEARER_CAP; + gsm48_decode_bearer_cap(&modify.bearer_cap, + TLVP_VAL(&tp, GSM48_IE_BEARER_CAP)-1); + + /* Create a copy of the bearer capability + * in the transaction struct, so we can use + * this information later */ + memcpy(&trans->bearer_cap,&modify.bearer_cap, + sizeof(trans->bearer_cap)); + } + + new_cc_state(trans, GSM_CSTATE_MO_ORIG_MODIFY); + + return mncc_recvmsg(trans->net, trans, MNCC_MODIFY_IND, &modify); +} + +static int gsm48_cc_tx_modify(struct gsm_trans *trans, void *arg) +{ + struct gsm_mncc *modify = arg; + struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC MOD"); + struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + + gh->msg_type = GSM48_MT_CC_MODIFY; + + gsm48_start_cc_timer(trans, 0x323, GSM48_T323); + + /* bearer capability */ + gsm48_encode_bearer_cap(msg, 1, &modify->bearer_cap); + memcpy(&trans->bearer_cap, &modify->bearer_cap, sizeof(trans->bearer_cap)); + + new_cc_state(trans, GSM_CSTATE_MO_TERM_MODIFY); + + return gsm48_conn_sendmsg(msg, trans->conn, trans); +} + +static int gsm48_cc_rx_modify_complete(struct gsm_trans *trans, struct msgb *msg) +{ + struct gsm48_hdr *gh = msgb_l3(msg); + unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh); + struct tlv_parsed tp; + struct gsm_mncc modify; + + gsm48_stop_cc_timer(trans); + + memset(&modify, 0, sizeof(struct gsm_mncc)); + modify.callref = trans->callref; + tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, GSM48_IE_BEARER_CAP, 0); + /* bearer capability */ + if (TLVP_PRESENT(&tp, GSM48_IE_BEARER_CAP)) { + modify.fields |= MNCC_F_BEARER_CAP; + gsm48_decode_bearer_cap(&modify.bearer_cap, + TLVP_VAL(&tp, GSM48_IE_BEARER_CAP)-1); + + /* Create a copy of the bearer capability + * in the transaction struct, so we can use + * this information later */ + memcpy(&trans->bearer_cap,&modify.bearer_cap, + sizeof(trans->bearer_cap)); + } + + new_cc_state(trans, GSM_CSTATE_ACTIVE); + + return mncc_recvmsg(trans->net, trans, MNCC_MODIFY_CNF, &modify); +} + +static int gsm48_cc_tx_modify_complete(struct gsm_trans *trans, void *arg) +{ + struct gsm_mncc *modify = arg; + struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC MOD COMPL"); + struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + + gh->msg_type = GSM48_MT_CC_MODIFY_COMPL; + + /* bearer capability */ + gsm48_encode_bearer_cap(msg, 1, &modify->bearer_cap); + memcpy(&trans->bearer_cap, &modify->bearer_cap, sizeof(trans->bearer_cap)); + + new_cc_state(trans, GSM_CSTATE_ACTIVE); + + return gsm48_conn_sendmsg(msg, trans->conn, trans); +} + +static int gsm48_cc_rx_modify_reject(struct gsm_trans *trans, struct msgb *msg) +{ + struct gsm48_hdr *gh = msgb_l3(msg); + unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh); + struct tlv_parsed tp; + struct gsm_mncc modify; + + gsm48_stop_cc_timer(trans); + + memset(&modify, 0, sizeof(struct gsm_mncc)); + modify.callref = trans->callref; + tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, GSM48_IE_BEARER_CAP, GSM48_IE_CAUSE); + /* bearer capability */ + if (TLVP_PRESENT(&tp, GSM48_IE_BEARER_CAP)) { + modify.fields |= GSM48_IE_BEARER_CAP; + gsm48_decode_bearer_cap(&modify.bearer_cap, + TLVP_VAL(&tp, GSM48_IE_BEARER_CAP)-1); + + /* Create a copy of the bearer capability + * in the transaction struct, so we can use + * this information later */ + memcpy(&trans->bearer_cap,&modify.bearer_cap, + sizeof(trans->bearer_cap)); + } + /* cause */ + if (TLVP_PRESENT(&tp, GSM48_IE_CAUSE)) { + modify.fields |= MNCC_F_CAUSE; + gsm48_decode_cause(&modify.cause, + TLVP_VAL(&tp, GSM48_IE_CAUSE)-1); + } + + new_cc_state(trans, GSM_CSTATE_ACTIVE); + + return mncc_recvmsg(trans->net, trans, MNCC_MODIFY_REJ, &modify); +} + +static int gsm48_cc_tx_modify_reject(struct gsm_trans *trans, void *arg) +{ + struct gsm_mncc *modify = arg; + struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC MOD REJ"); + struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + + gh->msg_type = GSM48_MT_CC_MODIFY_REJECT; + + /* bearer capability */ + gsm48_encode_bearer_cap(msg, 1, &modify->bearer_cap); + memcpy(&trans->bearer_cap, &modify->bearer_cap, sizeof(trans->bearer_cap)); + /* cause */ + gsm48_encode_cause(msg, 1, &modify->cause); + + new_cc_state(trans, GSM_CSTATE_ACTIVE); + + return gsm48_conn_sendmsg(msg, trans->conn, trans); +} + +static int gsm48_cc_tx_notify(struct gsm_trans *trans, void *arg) +{ + struct gsm_mncc *notify = arg; + struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 CC NOT"); + struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + + gh->msg_type = GSM48_MT_CC_NOTIFY; + + /* notify */ + gsm48_encode_notify(msg, notify->notify); + + return gsm48_conn_sendmsg(msg, trans->conn, trans); +} + +static int gsm48_cc_rx_notify(struct gsm_trans *trans, struct msgb *msg) +{ + struct gsm48_hdr *gh = msgb_l3(msg); + unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh); +// struct tlv_parsed tp; + struct gsm_mncc notify; + + memset(¬ify, 0, sizeof(struct gsm_mncc)); + notify.callref = trans->callref; +// tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len); + if (payload_len >= 1) + gsm48_decode_notify(¬ify.notify, gh->data); + + return mncc_recvmsg(trans->net, trans, MNCC_NOTIFY_IND, ¬ify); +} + +static int gsm48_cc_tx_userinfo(struct gsm_trans *trans, void *arg) +{ + struct gsm_mncc *user = arg; + struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 USR INFO"); + struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + + gh->msg_type = GSM48_MT_CC_USER_INFO; + + /* user-user */ + if (user->fields & MNCC_F_USERUSER) + gsm48_encode_useruser(msg, 1, &user->useruser); + /* more data */ + if (user->more) + gsm48_encode_more(msg); + + return gsm48_conn_sendmsg(msg, trans->conn, trans); +} + +static int gsm48_cc_rx_userinfo(struct gsm_trans *trans, struct msgb *msg) +{ + struct gsm48_hdr *gh = msgb_l3(msg); + unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh); + struct tlv_parsed tp; + struct gsm_mncc user; + + memset(&user, 0, sizeof(struct gsm_mncc)); + user.callref = trans->callref; + tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, GSM48_IE_USER_USER, 0); + /* user-user */ + if (TLVP_PRESENT(&tp, GSM48_IE_USER_USER)) { + user.fields |= MNCC_F_USERUSER; + gsm48_decode_useruser(&user.useruser, + TLVP_VAL(&tp, GSM48_IE_USER_USER)-1); + } + /* more data */ + if (TLVP_PRESENT(&tp, GSM48_IE_MORE_DATA)) + user.more = 1; + + return mncc_recvmsg(trans->net, trans, MNCC_USERINFO_IND, &user); +} + +static void mncc_recv_rtp(struct gsm_network *net, uint32_t callref, + int cmd, uint32_t addr, uint16_t port, uint32_t payload_type, + uint32_t payload_msg_type) +{ + uint8_t data[sizeof(struct gsm_mncc)]; + struct gsm_mncc_rtp *rtp; + + memset(&data, 0, sizeof(data)); + rtp = (struct gsm_mncc_rtp *) &data[0]; + + rtp->callref = callref; + rtp->msg_type = cmd; + rtp->ip = addr; + rtp->port = port; + rtp->payload_type = payload_type; + rtp->payload_msg_type = payload_msg_type; + mncc_recvmsg(net, NULL, cmd, (struct gsm_mncc *)data); +} + +static void mncc_recv_rtp_sock(struct gsm_network *net, struct gsm_trans *trans, int cmd) +{ + int msg_type; + + /* FIXME This has to be set to some meaningful value. + * Possible options are: + * GSM_TCHF_FRAME, GSM_TCHF_FRAME_EFR, + * GSM_TCHH_FRAME, GSM_TCH_FRAME_AMR + * (0 if unknown) */ + msg_type = GSM_TCHF_FRAME; + + uint32_t addr = inet_addr(trans->conn->rtp.local_addr_cn); + uint16_t port = trans->conn->rtp.local_port_cn; + + LOGP(DMNCC, LOGL_ERROR, "RTP create for non-existing trans\n"); + + if (addr == INADDR_NONE) { + LOGP(DMNCC, LOGL_ERROR, + "(subscriber:%s) external MNCC is signalling invalid IP-Address\n", + vlr_subscr_name(trans->vsub)); + return; + } + if (port == 0) { + LOGP(DMNCC, LOGL_ERROR, + "(subscriber:%s) external MNCC is signalling invalid Port\n", + vlr_subscr_name(trans->vsub)); + return; + } + + /* FIXME: This has to be set to some meaningful value, + * before the MSC-Split, this value was pulled from + * lchan->abis_ip.rtp_payload */ + uint32_t payload_type = 0; + + return mncc_recv_rtp(net, trans->callref, cmd, + addr, + port, + payload_type, + msg_type); +} + +static void mncc_recv_rtp_err(struct gsm_network *net, uint32_t callref, int cmd) +{ + return mncc_recv_rtp(net, callref, cmd, 0, 0, 0, 0); +} + +static int tch_rtp_create(struct gsm_network *net, uint32_t callref) +{ + struct gsm_trans *trans; + int rc; + + /* Find callref */ + trans = trans_find_by_callref(net, callref); + if (!trans) { + LOGP(DMNCC, LOGL_ERROR, "RTP create for non-existing trans\n"); + mncc_recv_rtp_err(net, callref, MNCC_RTP_CREATE); + return -EIO; + } + log_set_context(LOG_CTX_VLR_SUBSCR, trans->vsub); + if (!trans->conn) { + LOGP(DMNCC, LOGL_NOTICE, "RTP create for trans without conn\n"); + mncc_recv_rtp_err(net, callref, MNCC_RTP_CREATE); + return 0; + } + + trans->conn->mncc_rtp_bridge = 1; + + /* When we call msc_mgcp_call_assignment() we will trigger, depending + * on the RAN type the call assignment on the A or Iu interface. + * msc_mgcp_call_assignment() also takes care about sending the CRCX + * command to the MGCP-GW. The CRCX will return the port number, + * where the PBX (e.g. Asterisk) will send its RTP stream to. We + * have to return this port number back to the MNCC by sending + * it back with the TCH_RTP_CREATE message. To make sure that + * this message is sent AFTER the response to CRCX from the + * MGCP-GW has arrived, we need will instruct msc_mgcp_call_assignment() + * to take care of this by setting trans->tch_rtp_create to true. + * This will make sure that gsm48_tch_rtp_create() (below) is + * called as soon as the local port number has become known. */ + trans->tch_rtp_create = true; + + /* Assign call (if not done yet) */ + if (trans->assignment_done == false) { + rc = msc_mgcp_call_assignment(trans); + trans->assignment_done = true; + } + else + rc = 0; + + return rc; +} + +/* Trigger TCH_RTP_CREATE acknowledgement */ +int gsm48_tch_rtp_create(struct gsm_trans *trans) +{ + /* This function is called as soon as the port, on which the + * mgcp-gw expects the incoming RTP stream from the remote + * end (e.g. Asterisk) is known. */ + + struct gsm_subscriber_connection *conn = trans->conn; + struct gsm_network *network = conn->network; + + mncc_recv_rtp_sock(network, trans, MNCC_RTP_CREATE); + return 0; +} + +static int tch_rtp_connect(struct gsm_network *net, void *arg) +{ + struct gsm_trans *trans; + struct gsm_mncc_rtp *rtp = arg; + struct in_addr addr; + + /* Find callref */ + trans = trans_find_by_callref(net, rtp->callref); + if (!trans) { + LOGP(DMNCC, LOGL_ERROR, "RTP connect for non-existing trans\n"); + mncc_recv_rtp_err(net, rtp->callref, MNCC_RTP_CONNECT); + return -EIO; + } + log_set_context(LOG_CTX_VLR_SUBSCR, trans->vsub); + if (!trans->conn) { + LOGP(DMNCC, LOGL_ERROR, "RTP connect for trans without conn\n"); + mncc_recv_rtp_err(net, rtp->callref, MNCC_RTP_CONNECT); + return 0; + } + + addr.s_addr = osmo_htonl(rtp->ip); + return msc_mgcp_call_complete(trans, rtp->port, inet_ntoa(addr)); +} + +static struct downstate { + uint32_t states; + int type; + int (*rout) (struct gsm_trans *trans, void *arg); +} downstatelist[] = { + /* mobile originating call establishment */ + {SBIT(GSM_CSTATE_INITIATED), /* 5.2.1.2 */ + MNCC_CALL_PROC_REQ, gsm48_cc_tx_call_proc_and_assign}, + {SBIT(GSM_CSTATE_INITIATED) | SBIT(GSM_CSTATE_MO_CALL_PROC), /* 5.2.1.2 | 5.2.1.5 */ + MNCC_ALERT_REQ, gsm48_cc_tx_alerting}, + {SBIT(GSM_CSTATE_INITIATED) | SBIT(GSM_CSTATE_MO_CALL_PROC) | SBIT(GSM_CSTATE_CALL_DELIVERED), /* 5.2.1.2 | 5.2.1.6 | 5.2.1.6 */ + MNCC_SETUP_RSP, gsm48_cc_tx_connect}, + {SBIT(GSM_CSTATE_MO_CALL_PROC), /* 5.2.1.4.2 */ + MNCC_PROGRESS_REQ, gsm48_cc_tx_progress}, + /* mobile terminating call establishment */ + {SBIT(GSM_CSTATE_NULL), /* 5.2.2.1 */ + MNCC_SETUP_REQ, gsm48_cc_tx_setup}, + {SBIT(GSM_CSTATE_CONNECT_REQUEST), + MNCC_SETUP_COMPL_REQ, gsm48_cc_tx_connect_ack}, + /* signalling during call */ + {SBIT(GSM_CSTATE_ACTIVE), + MNCC_NOTIFY_REQ, gsm48_cc_tx_notify}, + {ALL_STATES - SBIT(GSM_CSTATE_NULL) - SBIT(GSM_CSTATE_RELEASE_REQ), + MNCC_FACILITY_REQ, gsm48_cc_tx_facility}, + {ALL_STATES, + MNCC_START_DTMF_RSP, gsm48_cc_tx_start_dtmf_ack}, + {ALL_STATES, + MNCC_START_DTMF_REJ, gsm48_cc_tx_start_dtmf_rej}, + {ALL_STATES, + MNCC_STOP_DTMF_RSP, gsm48_cc_tx_stop_dtmf_ack}, + {SBIT(GSM_CSTATE_ACTIVE), + MNCC_HOLD_CNF, gsm48_cc_tx_hold_ack}, + {SBIT(GSM_CSTATE_ACTIVE), + MNCC_HOLD_REJ, gsm48_cc_tx_hold_rej}, + {SBIT(GSM_CSTATE_ACTIVE), + MNCC_RETRIEVE_CNF, gsm48_cc_tx_retrieve_ack}, + {SBIT(GSM_CSTATE_ACTIVE), + MNCC_RETRIEVE_REJ, gsm48_cc_tx_retrieve_rej}, + {SBIT(GSM_CSTATE_ACTIVE), + MNCC_MODIFY_REQ, gsm48_cc_tx_modify}, + {SBIT(GSM_CSTATE_MO_ORIG_MODIFY), + MNCC_MODIFY_RSP, gsm48_cc_tx_modify_complete}, + {SBIT(GSM_CSTATE_MO_ORIG_MODIFY), + MNCC_MODIFY_REJ, gsm48_cc_tx_modify_reject}, + {SBIT(GSM_CSTATE_ACTIVE), + MNCC_USERINFO_REQ, gsm48_cc_tx_userinfo}, + /* clearing */ + {SBIT(GSM_CSTATE_INITIATED), + MNCC_REJ_REQ, gsm48_cc_tx_release_compl}, + {ALL_STATES - SBIT(GSM_CSTATE_NULL) - SBIT(GSM_CSTATE_DISCONNECT_IND) - SBIT(GSM_CSTATE_RELEASE_REQ) - SBIT(GSM_CSTATE_DISCONNECT_REQ), /* 5.4.4 */ + MNCC_DISC_REQ, gsm48_cc_tx_disconnect}, + {ALL_STATES - SBIT(GSM_CSTATE_NULL) - SBIT(GSM_CSTATE_RELEASE_REQ), /* 5.4.3.2 */ + MNCC_REL_REQ, gsm48_cc_tx_release}, +}; + +#define DOWNSLLEN \ + (sizeof(downstatelist) / sizeof(struct downstate)) + + +int mncc_tx_to_cc(struct gsm_network *net, int msg_type, void *arg) +{ + int i, rc = 0; + struct gsm_trans *trans = NULL, *transt; + struct gsm_subscriber_connection *conn = NULL; + struct gsm_mncc *data = arg, rel; + + DEBUGP(DMNCC, "receive message %s\n", get_mncc_name(msg_type)); + + /* handle special messages */ + switch(msg_type) { + case MNCC_BRIDGE: + rc = tch_bridge(net, arg); + if (rc < 0) + disconnect_bridge(net, arg, -rc); + return rc; + case MNCC_RTP_CREATE: + return tch_rtp_create(net, data->callref); + case MNCC_RTP_CONNECT: + return tch_rtp_connect(net, arg); + case MNCC_RTP_FREE: + /* unused right now */ + return -EIO; + + case MNCC_FRAME_DROP: + case MNCC_FRAME_RECV: + case GSM_TCHF_FRAME: + case GSM_TCHF_FRAME_EFR: + case GSM_TCHH_FRAME: + case GSM_TCH_FRAME_AMR: + LOGP(DMNCC, LOGL_ERROR, "RTP streams must be handled externally; %s not supported.\n", + get_mncc_name(msg_type)); + return -ENOTSUP; + } + + memset(&rel, 0, sizeof(struct gsm_mncc)); + rel.callref = data->callref; + + /* Find callref */ + trans = trans_find_by_callref(net, data->callref); + + /* Callref unknown */ + if (!trans) { + struct vlr_subscr *vsub; + + if (msg_type != MNCC_SETUP_REQ) { + DEBUGP(DCC, "(bts - trx - ts - ti -- sub %s) " + "Received '%s' from MNCC with " + "unknown callref %d\n", data->called.number, + get_mncc_name(msg_type), data->callref); + /* Invalid call reference */ + return mncc_release_ind(net, NULL, data->callref, + GSM48_CAUSE_LOC_PRN_S_LU, + GSM48_CC_CAUSE_INVAL_TRANS_ID); + } + if (!data->called.number[0] && !data->imsi[0]) { + DEBUGP(DCC, "(bts - trx - ts - ti) " + "Received '%s' from MNCC with " + "no number or IMSI\n", get_mncc_name(msg_type)); + /* Invalid number */ + return mncc_release_ind(net, NULL, data->callref, + GSM48_CAUSE_LOC_PRN_S_LU, + GSM48_CC_CAUSE_INV_NR_FORMAT); + } + /* New transaction due to setup, find subscriber */ + if (data->called.number[0]) + vsub = vlr_subscr_find_by_msisdn(net->vlr, + data->called.number); + else + vsub = vlr_subscr_find_by_imsi(net->vlr, data->imsi); + + /* update the subscriber we deal with */ + log_set_context(LOG_CTX_VLR_SUBSCR, vsub); + + /* If subscriber is not found */ + if (!vsub) { + DEBUGP(DCC, "(bts - trx - ts - ti -- sub %s) " + "Received '%s' from MNCC with " + "unknown subscriber %s\n", data->called.number, + get_mncc_name(msg_type), data->called.number); + /* Unknown subscriber */ + return mncc_release_ind(net, NULL, data->callref, + GSM48_CAUSE_LOC_PRN_S_LU, + GSM48_CC_CAUSE_UNASSIGNED_NR); + } + /* If subscriber is not "attached" */ + if (!vsub->lac) { + DEBUGP(DCC, "(bts - trx - ts - ti -- sub %s) " + "Received '%s' from MNCC with " + "detached subscriber %s\n", data->called.number, + get_mncc_name(msg_type), vlr_subscr_name(vsub)); + vlr_subscr_put(vsub); + /* Temporarily out of order */ + return mncc_release_ind(net, NULL, data->callref, + GSM48_CAUSE_LOC_PRN_S_LU, + GSM48_CC_CAUSE_DEST_OOO); + } + /* Create transaction */ + trans = trans_alloc(net, vsub, GSM48_PDISC_CC, 0xff, data->callref); + if (!trans) { + DEBUGP(DCC, "No memory for trans.\n"); + vlr_subscr_put(vsub); + /* Ressource unavailable */ + mncc_release_ind(net, NULL, data->callref, + GSM48_CAUSE_LOC_PRN_S_LU, + GSM48_CC_CAUSE_RESOURCE_UNAVAIL); + return -ENOMEM; + } + + /* Find conn */ + conn = connection_for_subscr(vsub); + + /* If subscriber has no conn */ + if (!conn) { + /* find transaction with this subscriber already paging */ + llist_for_each_entry(transt, &net->trans_list, entry) { + /* Transaction of our conn? */ + if (transt == trans || + transt->vsub != vsub) + continue; + DEBUGP(DCC, "(bts - trx - ts - ti -- sub %s) " + "Received '%s' from MNCC with " + "unallocated channel, paging already " + "started for lac %d.\n", + data->called.number, + get_mncc_name(msg_type), vsub->lac); + vlr_subscr_put(vsub); + trans_free(trans); + return 0; + } + /* store setup information until paging succeeds */ + memcpy(&trans->cc.msg, data, sizeof(struct gsm_mncc)); + + /* Request a channel */ + trans->paging_request = subscr_request_conn( + vsub, + setup_trig_pag_evt, + trans, + "MNCC: establish call"); + if (!trans->paging_request) { + LOGP(DCC, LOGL_ERROR, "Failed to allocate paging token.\n"); + vlr_subscr_put(vsub); + trans_free(trans); + return 0; + } + vlr_subscr_put(vsub); + return 0; + } + + /* Assign conn */ + trans->conn = msc_subscr_conn_get(conn, MSC_CONN_USE_TRANS_CC); + trans->dlci = 0x00; /* SAPI=0, not SACCH */ + vlr_subscr_put(vsub); + } else { + /* update the subscriber we deal with */ + log_set_context(LOG_CTX_VLR_SUBSCR, trans->vsub); + } + + if (trans->conn) + conn = trans->conn; + + /* if paging did not respond yet */ + if (!conn) { + DEBUGP(DCC, "(sub %s) " + "Received '%s' from MNCC in paging state\n", + vlr_subscr_msisdn_or_name(trans->vsub), + get_mncc_name(msg_type)); + mncc_set_cause(&rel, GSM48_CAUSE_LOC_PRN_S_LU, + GSM48_CC_CAUSE_NORM_CALL_CLEAR); + if (msg_type == MNCC_REL_REQ) + rc = mncc_recvmsg(net, trans, MNCC_REL_CNF, &rel); + else + rc = mncc_recvmsg(net, trans, MNCC_REL_IND, &rel); + trans->callref = 0; + trans_free(trans); + return rc; + } else { + DEBUGP(DCC, "(ti %02x sub %s) " + "Received '%s' from MNCC in state %d (%s)\n", + trans->transaction_id, + vlr_subscr_msisdn_or_name(trans->conn->vsub), + get_mncc_name(msg_type), trans->cc.state, + gsm48_cc_state_name(trans->cc.state)); + } + + /* Find function for current state and message */ + for (i = 0; i < DOWNSLLEN; i++) + if ((msg_type == downstatelist[i].type) + && ((1 << trans->cc.state) & downstatelist[i].states)) + break; + if (i == DOWNSLLEN) { + DEBUGP(DCC, "Message unhandled at this state.\n"); + return 0; + } + + rc = downstatelist[i].rout(trans, arg); + + return rc; +} + + +static struct datastate { + uint32_t states; + int type; + int (*rout) (struct gsm_trans *trans, struct msgb *msg); +} datastatelist[] = { + /* mobile originating call establishment */ + {SBIT(GSM_CSTATE_NULL), /* 5.2.1.2 */ + GSM48_MT_CC_SETUP, gsm48_cc_rx_setup}, + {SBIT(GSM_CSTATE_NULL), /* 5.2.1.2 */ + GSM48_MT_CC_EMERG_SETUP, gsm48_cc_rx_setup}, + {SBIT(GSM_CSTATE_CONNECT_IND), /* 5.2.1.2 */ + GSM48_MT_CC_CONNECT_ACK, gsm48_cc_rx_connect_ack}, + /* mobile terminating call establishment */ + {SBIT(GSM_CSTATE_CALL_PRESENT), /* 5.2.2.3.2 */ + GSM48_MT_CC_CALL_CONF, gsm48_cc_rx_call_conf}, + {SBIT(GSM_CSTATE_CALL_PRESENT) | SBIT(GSM_CSTATE_MO_TERM_CALL_CONF), /* ???? | 5.2.2.3.2 */ + GSM48_MT_CC_ALERTING, gsm48_cc_rx_alerting}, + {SBIT(GSM_CSTATE_CALL_PRESENT) | SBIT(GSM_CSTATE_MO_TERM_CALL_CONF) | SBIT(GSM_CSTATE_CALL_RECEIVED), /* (5.2.2.6) | 5.2.2.6 | 5.2.2.6 */ + GSM48_MT_CC_CONNECT, gsm48_cc_rx_connect}, + /* signalling during call */ + {ALL_STATES - SBIT(GSM_CSTATE_NULL), + GSM48_MT_CC_FACILITY, gsm48_cc_rx_facility}, + {SBIT(GSM_CSTATE_ACTIVE), + GSM48_MT_CC_NOTIFY, gsm48_cc_rx_notify}, + {ALL_STATES, + GSM48_MT_CC_START_DTMF, gsm48_cc_rx_start_dtmf}, + {ALL_STATES, + GSM48_MT_CC_STOP_DTMF, gsm48_cc_rx_stop_dtmf}, + {ALL_STATES, + GSM48_MT_CC_STATUS_ENQ, gsm48_cc_rx_status_enq}, + {SBIT(GSM_CSTATE_ACTIVE), + GSM48_MT_CC_HOLD, gsm48_cc_rx_hold}, + {SBIT(GSM_CSTATE_ACTIVE), + GSM48_MT_CC_RETR, gsm48_cc_rx_retrieve}, + {SBIT(GSM_CSTATE_ACTIVE), + GSM48_MT_CC_MODIFY, gsm48_cc_rx_modify}, + {SBIT(GSM_CSTATE_MO_TERM_MODIFY), + GSM48_MT_CC_MODIFY_COMPL, gsm48_cc_rx_modify_complete}, + {SBIT(GSM_CSTATE_MO_TERM_MODIFY), + GSM48_MT_CC_MODIFY_REJECT, gsm48_cc_rx_modify_reject}, + {SBIT(GSM_CSTATE_ACTIVE), + GSM48_MT_CC_USER_INFO, gsm48_cc_rx_userinfo}, + /* clearing */ + {ALL_STATES - SBIT(GSM_CSTATE_NULL) - SBIT(GSM_CSTATE_RELEASE_REQ), /* 5.4.3.2 */ + GSM48_MT_CC_DISCONNECT, gsm48_cc_rx_disconnect}, + {ALL_STATES - SBIT(GSM_CSTATE_NULL), /* 5.4.4.1.2.2 */ + GSM48_MT_CC_RELEASE, gsm48_cc_rx_release}, + {ALL_STATES, /* 5.4.3.4 */ + GSM48_MT_CC_RELEASE_COMPL, gsm48_cc_rx_release_compl}, +}; + +#define DATASLLEN \ + (sizeof(datastatelist) / sizeof(struct datastate)) + +int gsm0408_rcv_cc(struct gsm_subscriber_connection *conn, struct msgb *msg) +{ + struct gsm48_hdr *gh = msgb_l3(msg); + uint8_t msg_type = gsm48_hdr_msg_type(gh); + uint8_t transaction_id = gsm48_hdr_trans_id_flip_ti(gh); + struct gsm_trans *trans = NULL; + int i, rc = 0; + + if (msg_type & 0x80) { + DEBUGP(DCC, "MSG 0x%2x not defined for PD error\n", msg_type); + return -EINVAL; + } + + if (!conn->vsub) { + LOGP(DCC, LOGL_ERROR, "Invalid conn: no subscriber\n"); + return -EINVAL; + } + + /* Find transaction */ + trans = trans_find_by_id(conn, GSM48_PDISC_CC, transaction_id); + +#if BEFORE_MSCSPLIT + /* Re-enable this log output once we can obtain this information via + * A-interface, see OS#2391. */ + DEBUGP(DCC, "(bts %d trx %d ts %d ti %x sub %s) " + "Received '%s' from MS in state %d (%s)\n", + conn->bts->nr, conn->lchan->ts->trx->nr, conn->lchan->ts->nr, + transaction_id, vlr_subscr_msisdn_or_name(conn->vsub), + gsm48_cc_msg_name(msg_type), trans?(trans->cc.state):0, + gsm48_cc_state_name(trans?(trans->cc.state):0)); +#endif + + /* Create transaction */ + if (!trans) { + DEBUGP(DCC, "Unknown transaction ID %x, " + "creating new trans.\n", transaction_id); + /* Create transaction */ + trans = trans_alloc(conn->network, conn->vsub, + GSM48_PDISC_CC, + transaction_id, new_callref++); + if (!trans) { + DEBUGP(DCC, "No memory for trans.\n"); + rc = gsm48_tx_simple(conn, + GSM48_PDISC_CC | (transaction_id << 4), + GSM48_MT_CC_RELEASE_COMPL); + return -ENOMEM; + } + /* Assign transaction */ + trans->conn = msc_subscr_conn_get(conn, MSC_CONN_USE_TRANS_CC); + trans->dlci = OMSC_LINKID_CB(msg); /* DLCI as received from BSC */ + cm_service_request_concludes(conn, msg); + } + + /* find function for current state and message */ + for (i = 0; i < DATASLLEN; i++) + if ((msg_type == datastatelist[i].type) + && ((1 << trans->cc.state) & datastatelist[i].states)) + break; + if (i == DATASLLEN) { + DEBUGP(DCC, "Message unhandled at this state.\n"); + return 0; + } + + assert(trans->vsub); + + rc = datastatelist[i].rout(trans, msg); + + msc_subscr_conn_communicating(conn); + return rc; +} -- To view, visit https://gerrit.osmocom.org/9705 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Idb8dd7a8d9d8b4a28c492f12da3cc3305b695cca Gerrit-Change-Number: 9705 Gerrit-PatchSet: 3 Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy -------------- next part -------------- An HTML attachment was scrubbed... URL: