libasn1c[master]: add /debian to build a package

2017-08-11 Thread Neels Hofmeyr

Patch Set 2: Code-Review+1

(1 comment)

https://gerrit.osmocom.org/#/c/3440/2/debian/copyright
File debian/copyright:

Line 65
@hwelte, are the licenses making sense now?


-- 
To view, visit https://gerrit.osmocom.org/3440
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I135d975b84027d51cb1dc534e04dd314bbd20289
Gerrit-PatchSet: 2
Gerrit-Project: libasn1c
Gerrit-Branch: master
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: lynxis lazus 
Gerrit-HasComments: Yes


libasn1c[master]: add /debian to build a package

2017-08-11 Thread lynxis lazus

Patch Set 2:

done

-- 
To view, visit https://gerrit.osmocom.org/3440
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I135d975b84027d51cb1dc534e04dd314bbd20289
Gerrit-PatchSet: 2
Gerrit-Project: libasn1c
Gerrit-Branch: master
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: lynxis lazus 
Gerrit-HasComments: No


[PATCH] libasn1c[master]: add /debian to build a package

2017-08-11 Thread lynxis lazus
Hello Neels Hofmeyr,

I'd like you to reexamine a change.  Please visit

https://gerrit.osmocom.org/3440

to look at the new patch set (#2).

add /debian to build a package

debian files need a release so start with release 0.1.0

Change-Id: I135d975b84027d51cb1dc534e04dd314bbd20289
---
A debian/changelog
A debian/compat
A debian/control
A debian/copyright
A debian/libasn1c-dev.install
A debian/libasn1c0.install
A debian/rules
A debian/source/format
8 files changed, 168 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libasn1c refs/changes/40/3440/2

diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 000..f56c11a
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+libasn1c (0.1.0) UNRELEASED; urgency=low
+
+  * Initial release.
+
+ -- Alexander Couzens   Sun, 06 Aug 2017 22:25:03 +
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 000..ec63514
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/debian/control b/debian/control
new file mode 100644
index 000..4313249
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,33 @@
+Source: libasn1c
+Section: libs
+Priority: extra
+Maintainer: Alexander Couzens 
+Build-Depends: debhelper (>=9),
+   dh-autoreconf,
+   libtalloc-dev
+Standards-Version: 3.9.8
+Vcs-Git: git://git.osmocom.org/libasn1c.git
+Vcs-Browser: http://git.osmocom.org/gitweb?p=libasn1c.git;a=summary
+Homepage: https://projects.osmocom.org/projects/libasn1c
+
+Package: libasn1c0
+Section: libs
+Architecture: any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: asn1c runtime code as shared library
+
+Package: libasn1c-dbg
+Section: debug
+Architecture: any
+Multi-Arch: same
+Depends: libasn1c0 (= ${binary:Version}), ${misc:Depends}
+Description: asn1c runtime code as shared library
+
+Package: libasn1c-dev
+Section: libdevel
+Architecture: any
+Multi-Arch: same
+Depends: libasn1c0 (= ${binary:Version}), ${misc:Depends}
+Description: asn1c runtime code as shared library
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 000..91a7cb9
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,64 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: libasn1c
+Source: git://git.osmocom.org/libasn1c
+
+Files: *
+Copyright: 2005-2014 Lev Walkin 
+License: BSD-3-Clause
+
+Files: src/xer_support.c
+Copyright: 2003,2004 X/IO Labs, xiolabs.com.
+   2003,2004,2005 Lev Walkin .
+License: BSD-3-Clause
+
+Files: include/asn1c/xer_support.h
+Copyright: 2003,2004 X/IO Labs, xiolabs.com
+   2003,2004 Lev Walkin 
+License: BSD-3-Clause
+
+Files: src/asn1helpers.c
+Copyright: 2014-2015 by Harald Welte 
+License:   AGPL-3.0+
+ 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 .
+
+Files: debian/*
+Copyright: 2017 Alexander Couzens 
+License: BSD-3-Clause
+
+License: BSD-3-Clause
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ .
+ 1. Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+ 3. Neither the name of the University nor the names of its contributors
+may be used to endorse or promote products derived from this software
+without specific prior written permission.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS 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 

osmo-msc[master]: Implement AoIP, port to M3UA SIGTRAN (large addition and ref...

2017-08-11 Thread Neels Hofmeyr

Patch Set 1: Code-Review-1

(1 comment)

https://gerrit.osmocom.org/#/c/3486/1/src/osmo-bsc/osmo_bsc_vty.c
File src/osmo-bsc/osmo_bsc_vty.c:

Line 192:* store the string names instead. */
This has to be fixed before the vty tests can go through. Currently it prints 
'(null)' as address name for the reason described in this FIXME comment, which 
obviously cannot be read back in.


-- 
To view, visit https://gerrit.osmocom.org/3486
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I5ae4e05ee7c57cad341ea5e86af37c1f6b0ffa77
Gerrit-PatchSet: 1
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: dexter 
Gerrit-HasComments: Yes


osmo-msc[master]: examples: Change IP address of config files

2017-08-11 Thread Neels Hofmeyr

Patch Set 2:

Hmm. In the example config file, we set a local IP address that is useful for 
OE packaging, because it matches a sysmocom device's actual IP address 
configuration. It's a good idea to actually use the example and thus be sure 
that we have a usable example config in doc/.

But this now fails the python tests that try to launch an SGSN binding to a 
local address of 10.23.24.1. The 127.0.0.1 worked because it is available 
everywhere.

It seems that we cannot use the example for OE as-is. Solution pending.

-- 
To view, visit https://gerrit.osmocom.org/3419
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie3a25f6771ed6e620cb2b315638c622a9a24e530
Gerrit-PatchSet: 2
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: daniel 
Gerrit-HasComments: No


Build failure of network:osmocom:nightly/openbsc in xUbuntu_16.10/i586

2017-08-11 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_16.10/i586

Package network:osmocom:nightly/openbsc failed to build in xUbuntu_16.10/i586

Check out the package for editing:
  osc checkout network:osmocom:nightly openbsc

Last lines of build log:
[  159s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests'
[  159s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests'
[  159s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc'
[  159s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc'
[  159s] make[4]: Nothing to be done for 'install-exec-am'.
[  159s]  /bin/mkdir -p 
'/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig'
[  159s]  /usr/bin/install -c -m 644 openbsc.pc 
'/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig'
[  159s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  159s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  159s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  159s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  159s]dh_install -O--sourcedirectory=openbsc
[  159s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried 
in "." and "debian/tmp")
[  159s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn
[  159s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" 
(tried in "." and "debian/tmp")
[  159s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub
[  159s] dh_install: missing files, aborting
[  159s] debian/rules:13: recipe for target 'binary' failed
[  159s] make: *** [binary] Error 2
[  159s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit 
status 2
[  159s] 
[  159s] lamb12 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 
20:11:24 UTC 2017.
[  159s] 
[  159s] ### VM INTERACTION START ###
[  162s] [  151.517993] reboot: Power down
[  162s] ### VM INTERACTION END ###
[  162s] 
[  162s] lamb12 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 
20:11:27 UTC 2017.
[  162s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


Build failure of network:osmocom:nightly/openbsc in Debian_9.0/i586

2017-08-11 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/Debian_9.0/i586

Package network:osmocom:nightly/openbsc failed to build in Debian_9.0/i586

Check out the package for editing:
  osc checkout network:osmocom:nightly openbsc

Last lines of build log:
[  179s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests'
[  179s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests'
[  179s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc'
[  179s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc'
[  179s] make[4]: Nothing to be done for 'install-exec-am'.
[  179s]  /bin/mkdir -p 
'/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig'
[  179s]  /usr/bin/install -c -m 644 openbsc.pc 
'/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig'
[  179s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  179s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  179s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  179s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  179s]dh_install -O--sourcedirectory=openbsc
[  179s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried 
in "." and "debian/tmp")
[  179s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn
[  179s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" 
(tried in "." and "debian/tmp")
[  179s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub
[  179s] dh_install: missing files, aborting
[  179s] debian/rules:13: recipe for target 'binary' failed
[  179s] make: *** [binary] Error 2
[  179s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit 
status 2
[  179s] 
[  179s] lamb09 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 
20:07:50 UTC 2017.
[  179s] 
[  179s] ### VM INTERACTION START ###
[  183s] [  170.722626] reboot: Power down
[  183s] ### VM INTERACTION END ###
[  183s] 
[  183s] lamb09 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 
20:07:54 UTC 2017.
[  183s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


Build failure of network:osmocom:nightly/openbsc in Debian_9.0/i586

2017-08-11 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/Debian_9.0/i586

Package network:osmocom:nightly/openbsc failed to build in Debian_9.0/i586

Check out the package for editing:
  osc checkout network:osmocom:nightly openbsc

Last lines of build log:
[  179s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests'
[  179s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests'
[  179s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc'
[  179s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc'
[  179s] make[4]: Nothing to be done for 'install-exec-am'.
[  179s]  /bin/mkdir -p 
'/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig'
[  179s]  /usr/bin/install -c -m 644 openbsc.pc 
'/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig'
[  179s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  179s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  179s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  179s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  179s]dh_install -O--sourcedirectory=openbsc
[  179s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried 
in "." and "debian/tmp")
[  179s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn
[  179s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" 
(tried in "." and "debian/tmp")
[  179s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub
[  179s] dh_install: missing files, aborting
[  179s] debian/rules:13: recipe for target 'binary' failed
[  179s] make: *** [binary] Error 2
[  179s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit 
status 2
[  179s] 
[  179s] lamb09 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 
20:07:50 UTC 2017.
[  179s] 
[  179s] ### VM INTERACTION START ###
[  183s] [  170.722626] reboot: Power down
[  183s] ### VM INTERACTION END ###
[  183s] 
[  183s] lamb09 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 
20:07:54 UTC 2017.
[  183s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


Build failure of network:osmocom:nightly/openbsc in xUbuntu_16.04/x86_64

2017-08-11 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_16.04/x86_64

Package network:osmocom:nightly/openbsc failed to build in xUbuntu_16.04/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly openbsc

Last lines of build log:
[  186s] make[5]: Nothing to be done for 'install-data-am'.
[  186s] make[5]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests'
[  186s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests'
[  186s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests'
[  186s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc'
[  186s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc'
[  186s] make[4]: Nothing to be done for 'install-exec-am'.
[  186s]  /bin/mkdir -p 
'/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig'
[  186s]  /usr/bin/install -c -m 644 openbsc.pc 
'/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig'
[  186s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  186s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  186s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  186s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  186s]dh_install -O--sourcedirectory=openbsc
[  186s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn
[  186s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub
[  186s] dh_install: missing files, aborting
[  186s] debian/rules:13: recipe for target 'binary' failed
[  186s] make: *** [binary] Error 2
[  186s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit 
status 2
[  186s] 
[  186s] lamb53 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 
20:06:20 UTC 2017.
[  186s] 
[  186s] ### VM INTERACTION START ###
[  190s] [  178.677392] reboot: Power down
[  190s] ### VM INTERACTION END ###
[  190s] 
[  190s] lamb53 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 
20:06:24 UTC 2017.
[  190s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


Build failure of network:osmocom:nightly/openbsc in xUbuntu_16.10/x86_64

2017-08-11 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_16.10/x86_64

Package network:osmocom:nightly/openbsc failed to build in xUbuntu_16.10/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly openbsc

Last lines of build log:
[  188s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests'
[  188s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests'
[  188s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc'
[  188s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc'
[  188s] make[4]: Nothing to be done for 'install-exec-am'.
[  188s]  /bin/mkdir -p 
'/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig'
[  188s]  /usr/bin/install -c -m 644 openbsc.pc 
'/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig'
[  188s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  188s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  188s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  188s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  188s]dh_install -O--sourcedirectory=openbsc
[  188s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried 
in "." and "debian/tmp")
[  188s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn
[  188s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" 
(tried in "." and "debian/tmp")
[  188s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub
[  188s] dh_install: missing files, aborting
[  188s] debian/rules:13: recipe for target 'binary' failed
[  188s] make: *** [binary] Error 2
[  188s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit 
status 2
[  188s] 
[  188s] cloud137 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 
20:06:23 UTC 2017.
[  188s] 
[  188s] ### VM INTERACTION START ###
[  191s] [  170.110907] reboot: Power down
[  193s] ### VM INTERACTION END ###
[  193s] 
[  193s] cloud137 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 
20:06:29 UTC 2017.
[  193s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


Build failure of network:osmocom:nightly/openbsc in xUbuntu_16.10/x86_64

2017-08-11 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_16.10/x86_64

Package network:osmocom:nightly/openbsc failed to build in xUbuntu_16.10/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly openbsc

Last lines of build log:
[  188s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests'
[  188s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests'
[  188s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc'
[  188s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc'
[  188s] make[4]: Nothing to be done for 'install-exec-am'.
[  188s]  /bin/mkdir -p 
'/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig'
[  188s]  /usr/bin/install -c -m 644 openbsc.pc 
'/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig'
[  188s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  188s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  188s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  188s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  188s]dh_install -O--sourcedirectory=openbsc
[  188s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried 
in "." and "debian/tmp")
[  188s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn
[  188s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" 
(tried in "." and "debian/tmp")
[  188s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub
[  188s] dh_install: missing files, aborting
[  188s] debian/rules:13: recipe for target 'binary' failed
[  188s] make: *** [binary] Error 2
[  188s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit 
status 2
[  188s] 
[  188s] cloud137 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 
20:06:23 UTC 2017.
[  188s] 
[  188s] ### VM INTERACTION START ###
[  191s] [  170.110907] reboot: Power down
[  193s] ### VM INTERACTION END ###
[  193s] 
[  193s] cloud137 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 
20:06:29 UTC 2017.
[  193s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


Build failure of network:osmocom:nightly/openbsc in xUbuntu_16.04/x86_64

2017-08-11 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_16.04/x86_64

Package network:osmocom:nightly/openbsc failed to build in xUbuntu_16.04/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly openbsc

Last lines of build log:
[  186s] make[5]: Nothing to be done for 'install-data-am'.
[  186s] make[5]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests'
[  186s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests'
[  186s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests'
[  186s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc'
[  186s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc'
[  186s] make[4]: Nothing to be done for 'install-exec-am'.
[  186s]  /bin/mkdir -p 
'/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig'
[  186s]  /usr/bin/install -c -m 644 openbsc.pc 
'/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig'
[  186s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  186s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  186s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  186s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  186s]dh_install -O--sourcedirectory=openbsc
[  186s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn
[  186s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub
[  186s] dh_install: missing files, aborting
[  186s] debian/rules:13: recipe for target 'binary' failed
[  186s] make: *** [binary] Error 2
[  186s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit 
status 2
[  186s] 
[  186s] lamb53 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 
20:06:20 UTC 2017.
[  186s] 
[  186s] ### VM INTERACTION START ###
[  190s] [  178.677392] reboot: Power down
[  190s] ### VM INTERACTION END ###
[  190s] 
[  190s] lamb53 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 
20:06:24 UTC 2017.
[  190s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


Build failure of network:osmocom:nightly/openbsc in Debian_9.0/x86_64

2017-08-11 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/Debian_9.0/x86_64

Package network:osmocom:nightly/openbsc failed to build in Debian_9.0/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly openbsc

Last lines of build log:
[  176s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests'
[  176s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests'
[  176s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc'
[  176s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc'
[  176s] make[4]: Nothing to be done for 'install-exec-am'.
[  176s]  /bin/mkdir -p 
'/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig'
[  176s]  /usr/bin/install -c -m 644 openbsc.pc 
'/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig'
[  176s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  176s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  176s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  176s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  176s]dh_install -O--sourcedirectory=openbsc
[  176s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried 
in "." and "debian/tmp")
[  176s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn
[  176s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" 
(tried in "." and "debian/tmp")
[  176s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub
[  176s] dh_install: missing files, aborting
[  176s] debian/rules:13: recipe for target 'binary' failed
[  176s] make: *** [binary] Error 2
[  176s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit 
status 2
[  176s] 
[  176s] lamb17 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 
20:03:59 UTC 2017.
[  176s] 
[  176s] ### VM INTERACTION START ###
[  180s] [  168.503704] reboot: Power down
[  180s] ### VM INTERACTION END ###
[  180s] 
[  180s] lamb17 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 
20:04:03 UTC 2017.
[  180s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


Build failure of network:osmocom:nightly/openbsc in Debian_9.0/x86_64

2017-08-11 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/Debian_9.0/x86_64

Package network:osmocom:nightly/openbsc failed to build in Debian_9.0/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly openbsc

Last lines of build log:
[  176s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests'
[  176s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests'
[  176s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc'
[  176s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc'
[  176s] make[4]: Nothing to be done for 'install-exec-am'.
[  176s]  /bin/mkdir -p 
'/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig'
[  176s]  /usr/bin/install -c -m 644 openbsc.pc 
'/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig'
[  176s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  176s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  176s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  176s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  176s]dh_install -O--sourcedirectory=openbsc
[  176s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried 
in "." and "debian/tmp")
[  176s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn
[  176s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" 
(tried in "." and "debian/tmp")
[  176s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub
[  176s] dh_install: missing files, aborting
[  176s] debian/rules:13: recipe for target 'binary' failed
[  176s] make: *** [binary] Error 2
[  176s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit 
status 2
[  176s] 
[  176s] lamb17 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 
20:03:59 UTC 2017.
[  176s] 
[  176s] ### VM INTERACTION START ###
[  180s] [  168.503704] reboot: Power down
[  180s] ### VM INTERACTION END ###
[  180s] 
[  180s] lamb17 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 
20:04:03 UTC 2017.
[  180s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


Build failure of network:osmocom:nightly/openbsc in xUbuntu_17.04/i586

2017-08-11 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_17.04/i586

Package network:osmocom:nightly/openbsc failed to build in xUbuntu_17.04/i586

Check out the package for editing:
  osc checkout network:osmocom:nightly openbsc

Last lines of build log:
[  172s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests'
[  172s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests'
[  172s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc'
[  172s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc'
[  172s] make[4]: Nothing to be done for 'install-exec-am'.
[  172s]  /bin/mkdir -p 
'/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig'
[  172s]  /usr/bin/install -c -m 644 openbsc.pc 
'/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig'
[  172s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  172s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  172s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  172s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  172s]dh_install -O--sourcedirectory=openbsc
[  172s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried 
in "." and "debian/tmp")
[  172s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn
[  172s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" 
(tried in "." and "debian/tmp")
[  172s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub
[  172s] dh_install: missing files, aborting
[  172s] debian/rules:13: recipe for target 'binary' failed
[  172s] make: *** [binary] Error 2
[  172s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit 
status 2
[  172s] 
[  172s] lamb54 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 
20:03:08 UTC 2017.
[  172s] 
[  172s] ### VM INTERACTION START ###
[  175s] [  164.411962] reboot: Power down
[  175s] ### VM INTERACTION END ###
[  175s] 
[  175s] lamb54 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 
20:03:11 UTC 2017.
[  175s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


Build failure of network:osmocom:nightly/openbsc in xUbuntu_17.04/x86_64

2017-08-11 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_17.04/x86_64

Package network:osmocom:nightly/openbsc failed to build in xUbuntu_17.04/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly openbsc

Last lines of build log:
[  101s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests'
[  101s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests'
[  101s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc'
[  101s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc'
[  101s] make[4]: Nothing to be done for 'install-exec-am'.
[  101s]  /bin/mkdir -p 
'/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig'
[  101s]  /usr/bin/install -c -m 644 openbsc.pc 
'/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig'
[  101s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  101s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  101s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  101s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  101s]dh_install -O--sourcedirectory=openbsc
[  101s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried 
in "." and "debian/tmp")
[  101s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn
[  101s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" 
(tried in "." and "debian/tmp")
[  101s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub
[  101s] dh_install: missing files, aborting
[  101s] debian/rules:13: recipe for target 'binary' failed
[  101s] make: *** [binary] Error 2
[  101s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit 
status 2
[  101s] 
[  101s] build84 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 
20:03:09 UTC 2017.
[  101s] 
[  101s] ### VM INTERACTION START ###
[  105s] [   96.912828] reboot: Power down
[  105s] ### VM INTERACTION END ###
[  106s] 
[  106s] build84 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 
20:03:14 UTC 2017.
[  106s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


Build failure of network:osmocom:nightly/openbsc in xUbuntu_17.04/x86_64

2017-08-11 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_17.04/x86_64

Package network:osmocom:nightly/openbsc failed to build in xUbuntu_17.04/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly openbsc

Last lines of build log:
[  101s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests'
[  101s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests'
[  101s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc'
[  101s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc'
[  101s] make[4]: Nothing to be done for 'install-exec-am'.
[  101s]  /bin/mkdir -p 
'/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig'
[  101s]  /usr/bin/install -c -m 644 openbsc.pc 
'/usr/src/packages/BUILD/debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig'
[  101s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  101s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  101s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  101s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  101s]dh_install -O--sourcedirectory=openbsc
[  101s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried 
in "." and "debian/tmp")
[  101s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn
[  101s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" 
(tried in "." and "debian/tmp")
[  101s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub
[  101s] dh_install: missing files, aborting
[  101s] debian/rules:13: recipe for target 'binary' failed
[  101s] make: *** [binary] Error 2
[  101s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit 
status 2
[  101s] 
[  101s] build84 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 
20:03:09 UTC 2017.
[  101s] 
[  101s] ### VM INTERACTION START ###
[  105s] [   96.912828] reboot: Power down
[  105s] ### VM INTERACTION END ###
[  106s] 
[  106s] build84 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 
20:03:14 UTC 2017.
[  106s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


Build failure of network:osmocom:nightly/openbsc in xUbuntu_17.04/i586

2017-08-11 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_17.04/i586

Package network:osmocom:nightly/openbsc failed to build in xUbuntu_17.04/i586

Check out the package for editing:
  osc checkout network:osmocom:nightly openbsc

Last lines of build log:
[  172s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests'
[  172s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests'
[  172s] make[3]: Entering directory '/usr/src/packages/BUILD/openbsc'
[  172s] make[4]: Entering directory '/usr/src/packages/BUILD/openbsc'
[  172s] make[4]: Nothing to be done for 'install-exec-am'.
[  172s]  /bin/mkdir -p 
'/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig'
[  172s]  /usr/bin/install -c -m 644 openbsc.pc 
'/usr/src/packages/BUILD/debian/tmp/usr/lib/i386-linux-gnu/pkgconfig'
[  172s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  172s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  172s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  172s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc'
[  172s]dh_install -O--sourcedirectory=openbsc
[  172s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-sgsn" (tried 
in "." and "debian/tmp")
[  172s] dh_install: osmocom-sgsn missing files: /usr/bin/osmo-sgsn
[  172s] dh_install: Cannot find (any matches for) "/usr/bin/osmo-gtphub" 
(tried in "." and "debian/tmp")
[  172s] dh_install: osmo-gtphub missing files: /usr/bin/osmo-gtphub
[  172s] dh_install: missing files, aborting
[  172s] debian/rules:13: recipe for target 'binary' failed
[  172s] make: *** [binary] Error 2
[  172s] dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit 
status 2
[  172s] 
[  172s] lamb54 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 
20:03:08 UTC 2017.
[  172s] 
[  172s] ### VM INTERACTION START ###
[  175s] [  164.411962] reboot: Power down
[  175s] ### VM INTERACTION END ###
[  175s] 
[  175s] lamb54 failed "build openbsc_0.15.1.20170811.dsc" at Fri Aug 11 
20:03:11 UTC 2017.
[  175s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


[PATCH] osmo-msc[master]: rework debian packages support

2017-08-11 Thread Neels Hofmeyr

Review at  https://gerrit.osmocom.org/3499

rework debian packages support

Remove old leftover from split of osmo-mgw out of openbsc.

Change-Id: I77544cb38c31777c3fab52979d19488a63e52de3
---
D debian/autoreconf
M debian/changelog
M debian/control
M debian/copyright
D debian/docs
D debian/openbsc-dev.install
A debian/osmo-msc.install
D debian/osmocom-nitb.default
D debian/osmocom-nitb.dirs
D debian/osmocom-nitb.examples
D debian/osmocom-nitb.init
D debian/osmocom-nitb.install
M debian/rules
13 files changed, 240 insertions(+), 557 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/99/3499/1

diff --git a/debian/autoreconf b/debian/autoreconf
deleted file mode 100644
index 9a3a67f..000
--- a/debian/autoreconf
+++ /dev/null
@@ -1 +0,0 @@
-openbsc
diff --git a/debian/changelog b/debian/changelog
index e9a4212..a1b3dda 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,75 +1,5 @@
-openbsc (0.15.1) UNRELEASED; urgency=medium
+osmo-msc (0.1.0) UNRELEASED; urgency=low
 
-  * Move forward toward a new release.
-  * Prevent SGSN starting with 'auth-policy remote' when no 'gsup remote-*' 
are configured.
-Note: such configs are broken without extra workarounds anyway.
+  * Initial release.
 
- -- Holger Hans Peter Freyther   Tue, 24 May 2016 
23:14:31 +0200
-
-openbsc (0.14.0) unstable; urgency=low
-
-  * New upstream tag and additional patches.
-
- -- Holger Hans Peter Freyther   Sat, 14 Mar 2015 20:33:25 
+0100
-
-openbsc (0.12.0+git26-7) unstable; urgency=low
-
-  * 64bit fix for the MGCP rewriting
-
- -- Holger Hans Peter Freyther   Wed, 07 Nov 2012 11:39:34 
+0100
-
-openbsc (0.12.0+git26-6) precise; urgency=low
-
-  * Added init script for osmocom-sgsn. 
-
- -- Eric Butler   Fri, 24 Aug 2012 21:04:32 -0700
-
-openbsc (0.12.0+git26-5) precise; urgency=low
-
-  * Don't enable MNCC sock by default.
-  * Automatically create important directories.
-  * Fix init script 'stop' command.
-
- -- Eric Butler   Fri, 24 Aug 2012 20:56:33 -0700
-
-openbsc (0.12.0+git26-4) precise; urgency=low
-
-  * Specify HLR path and enable RTP proxy.
-
- -- Eric Butler   Mon, 20 Aug 2012 00:21:07 -0700
-
-openbsc (0.12.0+git26-3) precise; urgency=low
-
-  * Fix init script.
-
- -- Eric Butler   Sun, 19 Aug 2012 16:05:44 -0700
-
-openbsc (0.12.0+git26-2) precise; urgency=low
-
-  * Fix libdbi package dependency.
-
- -- Eric Butler   Wed, 15 Aug 2012 00:35:37 -0700
-
-openbsc (0.12.0+git26-1) precise; urgency=low
-
-  * Fix version issue.
-
- -- Eric Butler   Tue, 14 Aug 2012 21:00:51 -0700
-
-openbsc (0.12.0+git26) precise; urgency=low
-
-  * Updated ubuntu package.
-
- -- Eric Butler   Tue, 14 Aug 2012 17:36:51 -0700
-
-openbsc (0.9.13.115.eb113-1) natty; urgency=low
-
-  * New upstream release
-
- -- Harald Welte   Wed, 11 May 2011 18:41:24 +
-
-openbsc (0.9.4-1) unstable; urgency=low
-
-  * Initial release
-
- -- Harald Welte   Tue, 24 Aug 2010 13:34:24 +0200
+ -- Alexander Couzens   Tue, 08 Aug 2017 01:13:01 +
diff --git a/debian/control b/debian/control
index 87b6f07..907ec38 100644
--- a/debian/control
+++ b/debian/control
@@ -1,181 +1,41 @@
-Source: openbsc
-Maintainer: Harald Welte 
+Source: osmo-msc
 Section: net
-Priority: optional
-Build-Depends: debhelper (>= 9),
-   autotools-dev,
-   autoconf-archive,
-   pkg-config,
-   libgtp-dev,
-   libosmocore-dev,
-   libosmo-sccp-dev,
-   libdbi0-dev,
+Priority: extra
+Maintainer: Alexander Couzens 
+Build-Depends: debhelper (>=9),
dh-autoreconf,
-   libosmo-abis-dev,
-   libosmo-netif-dev,
-   libdbd-sqlite3,
-   libpcap-dev,
+   autotools-dev,
+   autoconf,
+   automake,
+   libtool,
+   pkg-config,
+   libdbi-dev,
+   libtalloc-dev,
libssl-dev,
libc-ares-dev,
-   libsmpp34-dev
+   libgtp-dev,
+   libasn1c-dev,
+   libc-ares-dev,
+   libosmocore-dev,
+   libosmo-sccp-dev,
+   libosmo-abis-dev,
+   libosmo-legacy-mgcp-dev,
+   libosmo-netif-dev,
+   libosmo-ranap-dev
 Standards-Version: 3.9.8
-Vcs-Git: git://bs11-abis.gnumonks.org/openbsc.git
-Vcs-Browser: http://openbsc.osmocom.org/trac/browser
-Homepage: https://projects.osmocom.org/projects/openbsc
+Vcs-Git: git://git.osmocom.org/osmo-bsc.git
+Vcs-Browser: https://git.osmocom.org/osmo-bsc/
+Homepage: https://projects.osmocom.org/projects/osmo-bsc
 
-Package: osmocom-bsc
+Package: osmo-msc
 

[PATCH] osmo-msc[master]: split off osmo-msc: remove files, apply build, rename

2017-08-11 Thread Neels Hofmeyr

Review at  https://gerrit.osmocom.org/3497

split off osmo-msc: remove files, apply build, rename

Change-Id: Icf025e5ea8d180613b3114282951c9afa67af9a7
---
M configure.ac
D debian/osmo-gtphub.default
D debian/osmo-gtphub.examples
D debian/osmo-gtphub.init
D debian/osmo-gtphub.install
D debian/osmocom-bs11-utils.install
D debian/osmocom-bsc-nat.init
D debian/osmocom-bsc-nat.install
D debian/osmocom-bsc.examples
D debian/osmocom-bsc.install
D debian/osmocom-gbproxy.init
D debian/osmocom-gbproxy.install
D debian/osmocom-ipaccess-utils.install
D debian/osmocom-sgsn.default
D debian/osmocom-sgsn.examples
D debian/osmocom-sgsn.init
D debian/osmocom-sgsn.install
D doc/BS11-OML.txt
D doc/channel_release.txt
D doc/examples/osmo-bsc/osmo-bsc.cfg
D doc/examples/osmo-bsc_mgcp/mgcp.cfg
D doc/examples/osmo-bsc_nat/black-list.cfg
D doc/examples/osmo-bsc_nat/osmo-bsc_nat.cfg
D doc/examples/osmo-gbproxy/osmo-gbproxy-legacy.cfg
D doc/examples/osmo-gbproxy/osmo-gbproxy.cfg
D doc/examples/osmo-gtphub/gtphub-example.txt
D doc/examples/osmo-gtphub/osmo-gtphub-1iface.cfg
D doc/examples/osmo-gtphub/osmo-gtphub.cfg
D doc/examples/osmo-sgsn/osmo-sgsn.cfg
D doc/oml-interface.txt
M include/Makefile.am
D include/compat_af_isdn.h
D include/mISDNif.h
M include/openbsc/Makefile.am
D include/openbsc/bsc_nat.h
D include/openbsc/bsc_nat_callstats.h
D include/openbsc/bsc_nat_sccp.h
D include/openbsc/bsc_subscriber.h
D include/openbsc/gb_proxy.h
D include/openbsc/gprs_gb_parse.h
D include/openbsc/gprs_gmm.h
D include/openbsc/gprs_llc.h
D include/openbsc/gprs_llc_xid.h
D include/openbsc/gprs_sgsn.h
D include/openbsc/gprs_sndcp.h
D include/openbsc/gprs_sndcp_comp.h
D include/openbsc/gprs_sndcp_dcomp.h
D include/openbsc/gprs_sndcp_pcomp.h
D include/openbsc/gprs_sndcp_xid.h
D include/openbsc/gprs_subscriber.h
D include/openbsc/gprs_utils.h
D include/openbsc/nat_rewrite_trie.h
M include/openbsc/paging.h
D include/openbsc/pcu_if.h
D include/openbsc/pcuif_proto.h
D include/openbsc/sgsn.h
D include/openbsc/v42bis.h
D include/openbsc/v42bis_private.h
M src/Makefile.am
D src/gprs/.gitignore
D src/gprs/Makefile.am
D src/gprs/crc24.c
D src/gprs/gb_proxy.c
D src/gprs/gb_proxy_main.c
D src/gprs/gb_proxy_patch.c
D src/gprs/gb_proxy_peer.c
D src/gprs/gb_proxy_tlli.c
D src/gprs/gb_proxy_vty.c
D src/gprs/gprs_gb_parse.c
D src/gprs/gprs_gmm.c
D src/gprs/gprs_llc.c
D src/gprs/gprs_llc_parse.c
D src/gprs/gprs_llc_vty.c
D src/gprs/gprs_llc_xid.c
D src/gprs/gprs_sgsn.c
D src/gprs/gprs_sndcp.c
D src/gprs/gprs_sndcp_comp.c
D src/gprs/gprs_sndcp_dcomp.c
D src/gprs/gprs_sndcp_pcomp.c
D src/gprs/gprs_sndcp_vty.c
D src/gprs/gprs_sndcp_xid.c
D src/gprs/gprs_subscriber.c
D src/gprs/gprs_utils.c
D src/gprs/gtphub.c
D src/gprs/gtphub_ares.c
D src/gprs/gtphub_main.c
D src/gprs/gtphub_sock.c
D src/gprs/gtphub_vty.c
D src/gprs/osmo_sgsn.cfg
D src/gprs/sgsn_ares.c
D src/gprs/sgsn_auth.c
D src/gprs/sgsn_cdr.c
D src/gprs/sgsn_ctrl.c
D src/gprs/sgsn_libgtp.c
D src/gprs/sgsn_main.c
D src/gprs/sgsn_vty.c
D src/gprs/slhc.c
D src/gprs/v42bis.c
D src/ipaccess/Makefile.am
D src/ipaccess/abisip-find.c
D src/ipaccess/ipaccess-config.c
D src/ipaccess/ipaccess-firmware.c
D src/ipaccess/ipaccess-proxy.c
D src/ipaccess/network_listen.c
D src/libbsc/Makefile.am
D src/libbsc/abis_nm.c
D src/libbsc/abis_nm_ipaccess.c
D src/libbsc/abis_nm_vty.c
D src/libbsc/abis_om2000.c
D src/libbsc/abis_om2000_vty.c
D src/libbsc/abis_rsl.c
D src/libbsc/arfcn_range_encode.c
D src/libbsc/bsc_api.c
D src/libbsc/bsc_ctrl_commands.c
D src/libbsc/bsc_ctrl_lookup.c
D src/libbsc/bsc_dyn_ts.c
D src/libbsc/bsc_init.c
D src/libbsc/bsc_msc.c
D src/libbsc/bsc_rf_ctrl.c
D src/libbsc/bsc_rll.c
D src/libbsc/bsc_subscriber.c
D src/libbsc/bsc_vty.c
D src/libbsc/bts_ericsson_rbs2000.c
D src/libbsc/bts_init.c
D src/libbsc/bts_ipaccess_nanobts.c
D src/libbsc/bts_ipaccess_nanobts_omlattr.c
D src/libbsc/bts_nokia_site.c
D src/libbsc/bts_siemens_bs11.c
D src/libbsc/bts_sysmobts.c
D src/libbsc/bts_unknown.c
D src/libbsc/chan_alloc.c
D src/libbsc/e1_config.c
D src/libbsc/gsm_04_08_utils.c
D src/libbsc/gsm_04_80_utils.c
D src/libbsc/handover_decision.c
D src/libbsc/handover_logic.c
D src/libbsc/meas_proc.c
D src/libbsc/meas_rep.c
D src/libbsc/net_init.c
D src/libbsc/paging.c
D src/libbsc/pcu_sock.c
D src/libbsc/rest_octets.c
D src/libbsc/system_information.c
M src/libcommon/common_vty.c
D src/libfilter/Makefile.am
D src/libfilter/bsc_msg_acc.c
D src/libfilter/bsc_msg_filter.c
D src/libfilter/bsc_msg_vty.c
M src/libmsc/vty_interface_layer3.c
D src/libtrau/Makefile.am
D src/libtrau/rtp_proxy.c
D src/libtrau/trau_mux.c
D src/libtrau/trau_upqueue.c
M src/libvlr/vlr.c
D src/osmo-bsc/Makefile.am
D src/osmo-bsc/osmo_bsc_api.c
D src/osmo-bsc/osmo_bsc_audio.c
D src/osmo-bsc/osmo_bsc_bssap.c
D src/osmo-bsc/osmo_bsc_ctrl.c
D src/osmo-bsc/osmo_bsc_filter.c
D src/osmo-bsc/osmo_bsc_grace.c
D src/osmo-bsc/osmo_bsc_main.c
D src/osmo-bsc/osmo_bsc_msc.c
D src/osmo-bsc/osmo_bsc_reset.c
D src/osmo-bsc/osmo_bsc_sigtran.c
D src/osmo-bsc/osmo_bsc_vty.c
D 

[PATCH] osmo-msc[master]: vlr: set require IMEI by default

2017-08-11 Thread Neels Hofmeyr

Review at  https://gerrit.osmocom.org/3495

vlr: set require IMEI by default

Change-Id: I91d8f3e79cdaa206f8cd32b42bd7c23933f9631a
---
M src/libvlr/vlr.c
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/95/3495/1

diff --git a/src/libvlr/vlr.c b/src/libvlr/vlr.c
index d95d1b7..22898b1 100644
--- a/src/libvlr/vlr.c
+++ b/src/libvlr/vlr.c
@@ -980,6 +980,9 @@
INIT_LLIST_HEAD(>operations);
memcpy(>ops, ops, sizeof(vlr->ops));
 
+   /* defaults */
+   vlr->cfg.check_imei_rqd = true;
+
/* osmo_auth_fsm.c */
osmo_fsm_register(_auth_fsm);
/* osmo_lu_fsm.c */

-- 
To view, visit https://gerrit.osmocom.org/3495
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I91d8f3e79cdaa206f8cd32b42bd7c23933f9631a
Gerrit-PatchSet: 1
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


[PATCH] osmo-msc[master]: add msg type to SMS rx logging

2017-08-11 Thread Neels Hofmeyr

Review at  https://gerrit.osmocom.org/3496

add msg type to SMS rx logging

Change-Id: I73ea4eebe57b2d1008045a27f174072178b9f077
---
M src/libmsc/gsm_04_11.c
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/96/3496/1

diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c
index bdf2ad7..6949ac5 100644
--- a/src/libmsc/gsm_04_11.c
+++ b/src/libmsc/gsm_04_11.c
@@ -809,7 +809,7 @@
return -EIO;
/* FIXME: send some error message */
 
-   DEBUGP(DLSMS, "receiving data (trans_id=%x)\n", transaction_id);
+   DEBUGP(DLSMS, "receiving data (trans_id=%x, msg_type=%d)\n", 
transaction_id, msg_type);
trans = trans_find_by_id(conn, GSM48_PDISC_SMS, transaction_id);
 
/*

-- 
To view, visit https://gerrit.osmocom.org/3496
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I73ea4eebe57b2d1008045a27f174072178b9f077
Gerrit-PatchSet: 1
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


[PATCH] osmo-msc[master]: replace internal libmgcp with libosmo-legacy-mgcp

2017-08-11 Thread Neels Hofmeyr

Review at  https://gerrit.osmocom.org/3492

replace internal libmgcp with libosmo-legacy-mgcp

Change-Id: Ic99d681759edce11564da62500c2aac5cf5fffe2
---
M configure.ac
M include/openbsc/Makefile.am
M include/openbsc/bsc_nat.h
M include/openbsc/gsm_data.h
D include/openbsc/mgcp.h
D include/openbsc/mgcp_internal.h
D include/openbsc/mgcp_transcode.h
D include/openbsc/mgcpgw_client.h
M src/Makefile.am
M src/libfilter/bsc_msg_acc.c
D src/libmgcp/Makefile.am
D src/libmgcp/g711common.h
D src/libmgcp/mgcp_common.c
D src/libmgcp/mgcp_network.c
D src/libmgcp/mgcp_osmux.c
D src/libmgcp/mgcp_protocol.c
D src/libmgcp/mgcp_sdp.c
D src/libmgcp/mgcp_transcode.c
D src/libmgcp/mgcp_vty.c
D src/libmgcp/mgcpgw_client.c
D src/libmgcp/mgcpgw_client_vty.c
M src/libmsc/a_iface.c
M src/libmsc/msc_ifaces.c
M src/libmsc/msc_vty.c
D src/osmo-bsc_mgcp/Makefile.am
D src/osmo-bsc_mgcp/mgcp_main.c
M src/osmo-msc/Makefile.am
M src/osmo-msc/msc_main.c
M tests/Makefile.am
D tests/mgcp/Makefile.am
D tests/mgcp/mgcp_test.c
D tests/mgcp/mgcp_test.ok
D tests/mgcp/mgcp_transcoding_test.c
D tests/mgcp/mgcp_transcoding_test.ok
D tests/mgcp/mgcpgw_client_test.c
D tests/mgcp/mgcpgw_client_test.err
D tests/mgcp/mgcpgw_client_test.ok
M tests/msc_vlr/Makefile.am
M tests/sms_queue/Makefile.am
M tests/testsuite.at
40 files changed, 20 insertions(+), 11,344 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/92/3492/1


-- 
To view, visit https://gerrit.osmocom.org/3492
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic99d681759edce11564da62500c2aac5cf5fffe2
Gerrit-PatchSet: 1
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


[PATCH] osmo-msc[master]: libmsc: make pitfall in gsm0408_dispatch() more obvious

2017-08-11 Thread Neels Hofmeyr

Review at  https://gerrit.osmocom.org/3498

libmsc: make pitfall in gsm0408_dispatch() more obvious

The function gsm0408_dispatch() accepts a message buffer pointer
and accesses the l3h pointer. Even in a properly allocated
message buffer, this may lead into a segfault if the user forgets
to set the l3h pointer. This commit adds assertions to popup a
more expressive error message.

Change-Id: I43bd9bd1c170559aaa8dacaef25dba090744bcd5
---
M src/libmsc/gsm_04_08.c
1 file changed, 6 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/98/3498/1

diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c
index be23c64..f16cca0 100644
--- a/src/libmsc/gsm_04_08.c
+++ b/src/libmsc/gsm_04_08.c
@@ -3208,13 +3208,17 @@
 /* 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)
 {
-   struct gsm48_hdr *gh = msgb_l3(msg);
-   uint8_t pdisc = gsm48_hdr_pdisc(gh);
+   struct gsm48_hdr *gh;
+   uint8_t pdisc;
int rc = 0;
 
+   OSMO_ASSERT(msg->l3h)
OSMO_ASSERT(conn);
OSMO_ASSERT(msg);
 
+   gh = msgb_l3(msg);
+   pdisc = gsm48_hdr_pdisc(gh);
+
LOGP(DRLL, LOGL_DEBUG, "Dispatching 04.08 message %s (0x%x:0x%x)\n",
 gsm48_pdisc_msgtype_name(pdisc, gsm48_hdr_msg_type(gh)),
 pdisc, gsm48_hdr_msg_type(gh));

-- 
To view, visit https://gerrit.osmocom.org/3498
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I43bd9bd1c170559aaa8dacaef25dba090744bcd5
Gerrit-PatchSet: 1
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: dexter 


[PATCH] osmo-msc[master]: cosmetic: msc_vlr_tests: drop unused var

2017-08-11 Thread Neels Hofmeyr

Review at  https://gerrit.osmocom.org/3490

cosmetic: msc_vlr_tests: drop unused var

Change-Id: I584c0dfffe005597563dbd72fad8a087c554ba3d
---
M tests/msc_vlr/msc_vlr_tests.c
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/90/3490/1

diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c
index c555603..6a7d648 100644
--- a/tests/msc_vlr/msc_vlr_tests.c
+++ b/tests/msc_vlr/msc_vlr_tests.c
@@ -449,7 +449,6 @@
 
 int _validate_dtap(struct msgb *msg, enum ran_type to_ran)
 {
-   struct gsm48_hdr *gh = (void*)msg->data;
btw("DTAP --%s--> MS: %s: %s",
ran_type_name(to_ran), msg_type_name(msg),
osmo_hexdump_nospc(msg->data, msg->len));

-- 
To view, visit https://gerrit.osmocom.org/3490
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I584c0dfffe005597563dbd72fad8a087c554ba3d
Gerrit-PatchSet: 1
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


[PATCH] osmo-msc[master]: msc_vlr tests: add IMEISV tests

2017-08-11 Thread Neels Hofmeyr

Review at  https://gerrit.osmocom.org/3494

msc_vlr tests: add IMEISV tests

Change-Id: I752afef2ae3ce04e813c7e9fea0e883e607c0e14
---
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
6 files changed, 1,324 insertions(+), 48 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/94/3494/1

diff --git a/tests/msc_vlr/msc_vlr_test_gsm_authen.c 
b/tests/msc_vlr/msc_vlr_test_gsm_authen.c
index 44e4052..70b7614 100644
--- a/tests/msc_vlr/msc_vlr_test_gsm_authen.c
+++ b/tests/msc_vlr/msc_vlr_test_gsm_authen.c
@@ -563,7 +563,7 @@
 
btw("MS replies with an Identity Response");
expect_bssap_clear();
-   ms_sends_msg("0559084a32244332244332");
+   ms_sends_msg("0559084a32244332244302");
VERBOSE_ASSERT(bssap_clear_sent, == true, "%d");
 
btw("LU was successful, and the conn has already been closed");
@@ -573,7 +573,7 @@
btw("Subscriber has the IMEI");
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
OSMO_ASSERT(vsub);
-   VERBOSE_ASSERT(strcmp(vsub->imei, "423423423423423"), == 0, "%d");
+   VERBOSE_ASSERT(strcmp(vsub->imei, "423423423423420"), == 0, "%d");
vlr_subscr_put(vsub);
 
BTW("subscriber detaches");
@@ -661,7 +661,7 @@
thwart_rx_non_initial_requests();
 
btw("MS replies with an Identity Response");
-   ms_sends_msg("0559084a32244332244332");
+   ms_sends_msg("0559084a32244332244302");
 
btw("a LU Accept with a new TMSI was sent, waiting for TMSI Realloc 
Compl");
EXPECT_CONN_COUNT(1);
@@ -688,7 +688,7 @@
btw("Subscriber has the IMEI and TMSI");
vsub = vlr_subscr_find_by_imsi(net->vlr, imsi);
OSMO_ASSERT(vsub);
-   VERBOSE_ASSERT(strcmp(vsub->imei, "423423423423423"), == 0, "%d");
+   VERBOSE_ASSERT(strcmp(vsub->imei, "423423423423420"), == 0, "%d");
VERBOSE_ASSERT(vsub->tmsi, == 0x03020100, "0x%08x");
vlr_subscr_put(vsub);
 
diff --git a/tests/msc_vlr/msc_vlr_test_gsm_authen.err 
b/tests/msc_vlr/msc_vlr_test_gsm_authen.err
index bca64a4..c12eba1 100644
--- a/tests/msc_vlr/msc_vlr_test_gsm_authen.err
+++ b/tests/msc_vlr/msc_vlr_test_gsm_authen.err
@@ -1250,8 +1250,8 @@
   MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP
 DREF MSISDN:46071: MSC conn use + 1 == 2
 DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19)
-DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423
-DVLR set IMEI on subscriber; IMSI=90170004620 IMEI=423423423423423
+DMM IDENTITY RESPONSE: MI(IMEI)=423423423423420
+DVLR set IMEI on subscriber; IMSI=90170004620 IMEI=423423423423420
 DVLR vlr_lu_fsm(90170004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event 
VLR_ULA_E_ID_IMEI
 DVLR lu_compl_vlr_fsm(90170004620){LU_COMPL_VLR_S_WAIT_IMEI}: Received 
Event LU_COMPL_VLR_E_IMEI_CHECK_ACK
 - sending LU Accept for MSISDN:46071
@@ -1289,7 +1289,7 @@
   llist_count(>subscr_conns) == 0
 - Subscriber has the IMEI
 DREF VLR subscr MSISDN:46071 usage increases to: 2
-  strcmp(vsub->imei, "423423423423423") == 0
+  strcmp(vsub->imei, "423423423423420") == 0
 DREF VLR subscr MSISDN:46071 usage decreases to: 1
 ---
 - subscriber detaches
@@ -1469,8 +1469,8 @@
   MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP
 DREF MSISDN:46071: MSC conn use + 1 == 2
 DRLL Dispatching 04.08 message GSM48_MT_MM_ID_RESP (0x5:0x19)
-DMM IDENTITY RESPONSE: MI(IMEI)=423423423423423
-DVLR set IMEI on subscriber; IMSI=90170004620 IMEI=423423423423423
+DMM IDENTITY RESPONSE: MI(IMEI)=423423423423420
+DVLR set IMEI on subscriber; IMSI=90170004620 IMEI=423423423423420
 DVLR vlr_lu_fsm(90170004620){VLR_ULA_S_WAIT_LU_COMPL}: Received Event 
VLR_ULA_E_ID_IMEI
 DVLR lu_compl_vlr_fsm(90170004620){LU_COMPL_VLR_S_WAIT_IMEI_TMSI}: 
Received Event LU_COMPL_VLR_E_IMEI_CHECK_ACK
 DVLR lu_compl_vlr_fsm(90170004620){LU_COMPL_VLR_S_WAIT_IMEI_TMSI}: 
lu_compl_vlr_new_tmsi()
@@ -1538,7 +1538,7 @@
   llist_count(>subscr_conns) == 0
 - Subscriber has the IMEI and TMSI
 DREF VLR subscr MSISDN:46071 usage increases to: 2
-  strcmp(vsub->imei, "423423423423423") == 0
+  strcmp(vsub->imei, "423423423423420") == 0
   vsub->tmsi == 0x03020100
 DREF VLR subscr MSISDN:46071 usage decreases to: 1
 ---
diff --git a/tests/msc_vlr/msc_vlr_test_gsm_ciph.c 
b/tests/msc_vlr/msc_vlr_test_gsm_ciph.c
index 42e7c73..e0bd967 100644
--- a/tests/msc_vlr/msc_vlr_test_gsm_ciph.c
+++ b/tests/msc_vlr/msc_vlr_test_gsm_ciph.c
@@ -553,7 +553,7 @@
 
btw("MS replies with an Identity Response");
expect_bssap_clear();
-   ms_sends_msg("0559084a32244332244332");
+   ms_sends_msg("0559084a32244332244302");
VERBOSE_ASSERT(bssap_clear_sent, == true, "%d");
 
btw("LU was successful, and the conn has already been closed");
@@ -563,7 +563,7 @@
btw("Subscriber has the 

[PATCH] osmo-msc[master]: mgcp: add VTY Option to force-realloc endpoints

2017-08-11 Thread Neels Hofmeyr

Review at  https://gerrit.osmocom.org/3487

mgcp: add VTY Option to force-realloc endpoints

Currently the force_realloc feature is turnd on and of in a
hardcoded way. This patch makes the option available via VTY.

Change-Id: Ic8740512c5ea0766ff6ceb1c28b9c2b3fe46e75f
---
M src/libmgcp/mgcp_vty.c
M src/osmo-bsc_mgcp/mgcp_main.c
M src/osmo-bsc_nat/bsc_mgcp_utils.c
M src/osmo-bsc_nat/bsc_nat.c
4 files changed, 18 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/87/3487/1

diff --git a/src/libmgcp/mgcp_vty.c b/src/libmgcp/mgcp_vty.c
index 7d4b2da..51889d9 100644
--- a/src/libmgcp/mgcp_vty.c
+++ b/src/libmgcp/mgcp_vty.c
@@ -591,6 +591,16 @@
return CMD_SUCCESS;
 }
 
+DEFUN(cfg_mgcp_force_realloc,
+  cfg_mgcp_force_realloc_cmd,
+  "force-realloc (0|1)",
+  "Force endpoint reallocation when the endpoint is still seized\n"
+  "Don't force reallocation\n" "force reallocation\n")
+{
+   g_cfg->trunk.force_realloc = atoi(argv[0]);
+   return CMD_SUCCESS;
+}
+
 DEFUN(cfg_mgcp_number_endp,
   cfg_mgcp_number_endp_cmd,
   "number endpoints <0-65534>",
@@ -803,9 +813,10 @@
trunk->keepalive_interval, VTY_NEWLINE);
else
vty_out(vty, "  no rtp keep-alive%s", VTY_NEWLINE);
-
vty_out(vty, "  loop %d%s",
trunk->audio_loop, VTY_NEWLINE);
+   vty_out(vty, "  force-realloc %d%s",
+   trunk->force_realloc, VTY_NEWLINE);
if (trunk->omit_rtcp)
vty_out(vty, "  rtcp-omit%s", VTY_NEWLINE);
else
@@ -1379,6 +1390,7 @@
install_element(MGCP_NODE, _mgcp_sdp_payload_number_cmd_old);
install_element(MGCP_NODE, _mgcp_sdp_payload_name_cmd_old);
install_element(MGCP_NODE, _mgcp_loop_cmd);
+   install_element(MGCP_NODE, _mgcp_force_realloc_cmd);
install_element(MGCP_NODE, _mgcp_number_endp_cmd);
install_element(MGCP_NODE, _mgcp_omit_rtcp_cmd);
install_element(MGCP_NODE, _mgcp_no_omit_rtcp_cmd);
diff --git a/src/osmo-bsc_mgcp/mgcp_main.c b/src/osmo-bsc_mgcp/mgcp_main.c
index 4ea0700..6cf9ab7 100644
--- a/src/osmo-bsc_mgcp/mgcp_main.c
+++ b/src/osmo-bsc_mgcp/mgcp_main.c
@@ -218,6 +218,8 @@
cfg->get_net_downlink_format_cb = _transcoding_net_downlink_format;
 #endif
 
+   cfg->trunk.force_realloc = 1;
+
vty_info.copyright = openbsc_copyright;
vty_init(_info);
logging_vty_add_cmds(NULL);
diff --git a/src/osmo-bsc_nat/bsc_mgcp_utils.c 
b/src/osmo-bsc_nat/bsc_mgcp_utils.c
index 4884786..7df362f 100644
--- a/src/osmo-bsc_nat/bsc_mgcp_utils.c
+++ b/src/osmo-bsc_nat/bsc_mgcp_utils.c
@@ -1101,7 +1101,6 @@
/* some more MGCP config handling */
cfg->data = nat;
cfg->policy_cb = bsc_mgcp_policy_cb;
-   cfg->trunk.force_realloc = 1;
 
if (cfg->bts_ip)
talloc_free(cfg->bts_ip);
diff --git a/src/osmo-bsc_nat/bsc_nat.c b/src/osmo-bsc_nat/bsc_nat.c
index daa066d..d15ba87 100644
--- a/src/osmo-bsc_nat/bsc_nat.c
+++ b/src/osmo-bsc_nat/bsc_nat.c
@@ -1628,6 +1628,9 @@
rate_ctr_init(tall_bsc_ctx);
osmo_stats_init(tall_bsc_ctx);
 
+   /* Ensure that forced enpoint allocation is turned on by default */
+   cfg->trunk.force_realloc = 1;
+
/* init vty and parse */
if (mgcp_parse_config(config_file, nat->mgcp_cfg, MGCP_BSC_NAT) < 0) {
fprintf(stderr, "Failed to parse the config file: '%s'\n", 
config_file);

-- 
To view, visit https://gerrit.osmocom.org/3487
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic8740512c5ea0766ff6ceb1c28b9c2b3fe46e75f
Gerrit-PatchSet: 1
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: dexter 


[PATCH] osmo-msc[master]: Implement IuCS (large refactoring and addition)

2017-08-11 Thread Neels Hofmeyr
Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

https://gerrit.osmocom.org/3347

to look at the new patch set (#6).

Implement IuCS (large refactoring and addition)

osmo-nitb becomes osmo-msc
add DIUCS debug log constant
add iucs.[hc]
add msc vty, remove nitb vty
add libiudummy, to avoid linking Iu deps in tests
Use new msc_tx_dtap() instead of gsm0808_submit_dtap()
libmgcp: add mgcpgw client API
bridge calls via mgcpgw

Enable MSC specific CTRL commands, bsc_base_ctrl_cmds_install() still needs to
be split up.

Change-Id: I5b5b6a9678b458affa86800afb1ec726e66eed88
---
M .gitignore
M configure.ac
M doc/examples/osmo-bsc_mgcp/mgcp.cfg
A doc/examples/osmo-msc/osmo-msc.cfg
D doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg
D doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg
D doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg
D doc/examples/osmo-nitb/bs11/openbsc.cfg
D doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg
D doc/examples/osmo-nitb/nanobts/openbsc.cfg
D doc/examples/osmo-nitb/nokia/openbsc_nokia_3trx.cfg
D doc/examples/osmo-nitb/rbs2308/openbsc.cfg
D doc/examples/osmo-nitb/sysmobts/openbsc.cfg
M include/openbsc/Makefile.am
A include/openbsc/common.h
M include/openbsc/debug.h
M include/openbsc/gprs_gmm.h
M include/openbsc/gsm_data.h
M include/openbsc/gsm_subscriber.h
M include/openbsc/iu.h
A include/openbsc/iucs.h
A include/openbsc/iucs_ranap.h
M include/openbsc/mgcp.h
M include/openbsc/mgcp_internal.h
A include/openbsc/mgcpgw_client.h
M include/openbsc/msc_ifaces.h
M include/openbsc/osmo_msc.h
M include/openbsc/sgsn.h
M include/openbsc/transaction.h
M include/openbsc/vlr.h
M include/openbsc/vty.h
M osmoappdesc.py
M src/Makefile.am
M src/gprs/gprs_gmm.c
M src/gprs/gprs_sgsn.c
M src/gprs/sgsn_libgtp.c
M src/gprs/sgsn_main.c
M src/gprs/sgsn_vty.c
M src/libbsc/bsc_init.c
M src/libbsc/paging.c
M src/libcommon/debug.c
M src/libcommon/gsm_data.c
M src/libiu/iu.c
M src/libiu/iu_vty.c
M src/libmgcp/Makefile.am
A src/libmgcp/mgcp_common.c
M src/libmgcp/mgcp_network.c
M src/libmgcp/mgcp_protocol.c
A src/libmgcp/mgcpgw_client.c
A src/libmgcp/mgcpgw_client_vty.c
M src/libmsc/Makefile.am
M src/libmsc/a_iface.c
M src/libmsc/gsm_04_08.c
M src/libmsc/gsm_04_11.c
M src/libmsc/gsm_04_80.c
M src/libmsc/gsm_subscriber.c
A src/libmsc/iu_dummy.c
A src/libmsc/iucs.c
A src/libmsc/iucs_ranap.c
M src/libmsc/msc_ifaces.c
A src/libmsc/msc_vty.c
M src/libmsc/osmo_msc.c
M src/libmsc/silent_call.c
M src/libmsc/subscr_conn.c
M src/libmsc/transaction.c
M src/libmsc/vty_interface_layer3.c
M src/libvlr/vlr.c
M src/libvlr/vlr_access_req_fsm.c
M src/libvlr/vlr_lu_fsm.c
M src/osmo-bsc/osmo_bsc_api.c
R src/osmo-msc/Makefile.am
A src/osmo-msc/msc_main.c
D src/osmo-nitb/bsc_hack.c
M tests/ctrl_test_runner.py
M tests/db/Makefile.am
M tests/db/db_test.c
M tests/mgcp/Makefile.am
A tests/mgcp/mgcpgw_client_test.c
A tests/mgcp/mgcpgw_client_test.err
A tests/mgcp/mgcpgw_client_test.ok
M tests/msc_vlr/Makefile.am
M tests/msc_vlr/msc_vlr_test_gsm_authen.err
M tests/msc_vlr/msc_vlr_test_gsm_ciph.err
M tests/msc_vlr/msc_vlr_test_hlr_reject.err
M tests/msc_vlr/msc_vlr_test_hlr_timeout.err
M tests/msc_vlr/msc_vlr_test_ms_timeout.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.err
M tests/msc_vlr/msc_vlr_test_rest.err
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/smpp_test_runner.py
M tests/sms_queue/Makefile.am
M tests/testsuite.at
M tests/vty_test_runner.py
98 files changed, 5,030 insertions(+), 3,347 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/47/3347/6


-- 
To view, visit https://gerrit.osmocom.org/3347
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I5b5b6a9678b458affa86800afb1ec726e66eed88
Gerrit-PatchSet: 6
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder


[PATCH] osmo-msc[master]: MSC, SGSN: use OSMO_GSUP_PORT == 4222 instead of 2222

2017-08-11 Thread Neels Hofmeyr

Review at  https://gerrit.osmocom.org/3488

MSC,SGSN: use OSMO_GSUP_PORT == 4222 instead of 

In SGSN, actually place the port in the SGSN config by default, so that the
gsup port may now be omitted in the VTY config (the IP address suffices).

Adjust the osmo-sgsn.cfg example.

Depends: I4222e21686c823985be8ff1f16b1182be8ad6175 (libosmocore)
Change-Id: I50f2040e2eb0baacb43849e93cfed10cbc2fc156
---
M doc/examples/osmo-sgsn/osmo-sgsn.cfg
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/88/3488/1

diff --git a/doc/examples/osmo-sgsn/osmo-sgsn.cfg 
b/doc/examples/osmo-sgsn/osmo-sgsn.cfg
index 01be513..4189adc 100644
--- a/doc/examples/osmo-sgsn/osmo-sgsn.cfg
+++ b/doc/examples/osmo-sgsn/osmo-sgsn.cfg
@@ -11,7 +11,7 @@
  ggsn 0 gtp-version 1
  auth-policy remote
  gsup remote-ip 127.0.0.1
- gsup remote-port 
+ gsup remote-port 4222
 !
 ns
  timer tns-block 3

-- 
To view, visit https://gerrit.osmocom.org/3488
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I50f2040e2eb0baacb43849e93cfed10cbc2fc156
Gerrit-PatchSet: 1
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


[PATCH] osmo-msc[master]: .gitignore: cosmetic: use globs to ignore test binaries

2017-08-11 Thread Neels Hofmeyr

Review at  https://gerrit.osmocom.org/3491

.gitignore: cosmetic: use globs to ignore test binaries

Change-Id: I840e4333a4cad646d751ebafe7e0ef23e7a9c708
---
M .gitignore
1 file changed, 7 insertions(+), 39 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/91/3491/1

diff --git a/.gitignore b/.gitignore
index cf5542d..a9e6b84 100644
--- a/.gitignore
+++ b/.gitignore
@@ -62,45 +62,13 @@
 
 #tests
 tests/testsuite.dir
-tests/bsc-nat/bsc_nat_test
-tests/bsc-nat-trie/bsc_nat_trie_test
-tests/channel/channel_test
-tests/db/db_test
-tests/debug/debug_test
-tests/gsm0408/gsm0408_test
-tests/mgcp/mgcp_test
-tests/sccp/sccp_test
-tests/sms/sms_test
-tests/timer/timer_test
-tests/gprs/gprs_test
-tests/gbproxy/gbproxy_test
-tests/abis/abis_test
-tests/si/si_test
-tests/smpp/smpp_test
-tests/bsc/bsc_test
-tests/trau/trau_test
-tests/mgcp/mgcp_transcoding_test
-tests/sgsn/sgsn_test
-tests/subscr/subscr_test
-tests/subscr/bsc_subscr_test
-tests/oap/oap_test
-tests/gtphub/gtphub_test
-tests/mm_auth/mm_auth_test
-tests/xid/xid_test
-tests/sndcp_xid/sndcp_xid_test
-tests/slhc/slhc_test
-tests/v42bis/v42bis_test
-tests/nanobts_omlattr/nanobts_omlattr_test
-tests/oap/oap_client_test
-tests/msc_vlr/msc_vlr_test_no_authen
-tests/msc_vlr/msc_vlr_test_gsm_authen
-tests/msc_vlr/msc_vlr_test_gsm_ciph
-tests/msc_vlr/msc_vlr_test_umts_authen
-tests/msc_vlr/msc_vlr_test_hlr_reject
-tests/msc_vlr/msc_vlr_test_hlr_timeout
-tests/msc_vlr/msc_vlr_test_ms_timeout
-tests/msc_vlr/msc_vlr_test_reject_concurrency
-tests/msc_vlr/msc_vlr_test_rest
+tests/*/*_test
+# ignore compiled binaries like msc_vlr_test_foo; do not ignore
+# msc_vlr_test_foo.{c,ok,err}, but do still ignore the corresponding .o object
+# files:
+tests/msc_vlr/msc_vlr_test_*
+!tests/msc_vlr/msc_vlr_test_*.*
+tests/msc_vlr/msc_vlr_test_*.o
 
 
 tests/atconfig

-- 
To view, visit https://gerrit.osmocom.org/3491
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I840e4333a4cad646d751ebafe7e0ef23e7a9c708
Gerrit-PatchSet: 1
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


[PATCH] osmo-msc[master]: move libiu to osmo-iuh/libosmo-ranap

2017-08-11 Thread Neels Hofmeyr

Review at  https://gerrit.osmocom.org/3489

move libiu to osmo-iuh/libosmo-ranap

Remove libiu here, use the functions from libosmo-ranap instead, by applying
the ranap_ / RANAP_ prefix.

Corresponding change-id in osmo-iuh.git is 
I6a3f7ad15be03fb94689b4af6ccfa828c25f45c0

To be able to run the msc_vlr tests for RAN_UTRAN_IU without Iu client headers
available, add iu_dummy.h, containing mere function signatures that match
iu_dummy.c.

Change-Id: Ib8c4fcdb4766c5e575618b95ce16dce51063206b
---
M configure.ac
M include/openbsc/Makefile.am
M include/openbsc/gprs_sgsn.h
M include/openbsc/gsm_data.h
D include/openbsc/iu.h
A include/openbsc/iu_dummy.h
M include/openbsc/iucs.h
M include/openbsc/iucs_ranap.h
M include/openbsc/sgsn.h
M src/Makefile.am
M src/gprs/Makefile.am
M src/gprs/gprs_gmm.c
M src/gprs/gprs_sgsn.c
M src/gprs/sgsn_libgtp.c
M src/gprs/sgsn_main.c
M src/gprs/sgsn_vty.c
D src/libiu/Makefile.am
D src/libiu/iu.c
D src/libiu/iu_vty.c
M src/libmsc/Makefile.am
M src/libmsc/a_iface_bssap.c
M src/libmsc/gsm_04_08.c
M src/libmsc/gsm_subscriber.c
M src/libmsc/iu_dummy.c
M src/libmsc/iucs.c
M src/libmsc/iucs_ranap.c
M src/libmsc/msc_ifaces.c
M src/libmsc/msc_vty.c
M src/libmsc/osmo_msc.c
M src/libmsc/subscr_conn.c
M src/osmo-msc/Makefile.am
M src/osmo-msc/msc_main.c
M tests/msc_vlr/Makefile.am
M tests/msc_vlr/msc_vlr_tests.c
M tests/sgsn/Makefile.am
M tests/sms_queue/Makefile.am
36 files changed, 194 insertions(+), 1,148 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/89/3489/1

diff --git a/configure.ac b/configure.ac
index 803f739..dc2a4ad 100644
--- a/configure.ac
+++ b/configure.ac
@@ -229,7 +229,6 @@
 src/libmgcp/Makefile
 src/libcommon/Makefile
 src/libfilter/Makefile
-src/libiu/Makefile
 src/libcommon-cs/Makefile
 src/osmo-msc/Makefile
 src/osmo-bsc/Makefile
diff --git a/include/openbsc/Makefile.am b/include/openbsc/Makefile.am
index e5377a0..9dfb506 100644
--- a/include/openbsc/Makefile.am
+++ b/include/openbsc/Makefile.am
@@ -48,9 +48,9 @@
handover.h \
handover_decision.h \
ipaccess.h \
-   iu.h \
iucs.h \
iucs_ranap.h \
+   iu_dummy.h \
meas_feed.h \
meas_rep.h \
mgcp.h \
diff --git a/include/openbsc/gprs_sgsn.h b/include/openbsc/gprs_sgsn.h
index fd86174..52fba66 100644
--- a/include/openbsc/gprs_sgsn.h
+++ b/include/openbsc/gprs_sgsn.h
@@ -117,7 +117,7 @@
uint16_t pdp_status;
 };
 
-struct ue_conn_ctx;
+struct ranap_ue_conn_ctx;
 
 /* According to TS 03.60, Table 5: SGSN MM and PDP Contexts */
 /* Extended by 3GPP TS 23.060, Table 6: SGSN MM and PDP Contexts */
@@ -159,7 +159,7 @@
/* CSG Subscription Data */
/* LIPA Allowed */
/* Voice Support Match Indicator */
-   struct ue_conn_ctx  *ue_ctx;
+   struct ranap_ue_conn_ctx*ue_ctx;
struct service_info service;
} iu;
/* VLR number */
diff --git a/include/openbsc/gsm_data.h b/include/openbsc/gsm_data.h
index 849381a..2467bf0 100644
--- a/include/openbsc/gsm_data.h
+++ b/include/openbsc/gsm_data.h
@@ -30,7 +30,7 @@
 struct bsc_subscr;
 struct vlr_instance;
 struct vlr_subscr;
-struct ue_conn_ctx;
+struct ranap_ue_conn_ctx;
 
 #define OBSC_LINKID_CB(__msgb) (__msgb)->cb[3]
 
@@ -203,7 +203,7 @@
 
/* which Iu-CS connection, if any. */
struct {
-   struct ue_conn_ctx *ue_ctx;
+   struct ranap_ue_conn_ctx *ue_ctx;
uint8_t rab_id;
} iu;
 
@@ -485,7 +485,7 @@
struct {
/* CS7 instance id number (set via VTY) */
uint32_t cs7_instance;
-   enum nsap_addr_enc rab_assign_addr_enc;
+   int rab_assign_addr_enc;
struct osmo_sccp_instance *sccp;
} iu;
 
diff --git a/include/openbsc/iu.h b/include/openbsc/iu.h
deleted file mode 100644
index 08e4cd0..000
--- a/include/openbsc/iu.h
+++ /dev/null
@@ -1,77 +0,0 @@
-#pragma once
-
-#include 
-#include 
-
-#include 
-#include 
-#include 
-
-#include 
-
-struct sgsn_pdp_ctx;
-struct msgb;
-struct gsm_auth_tuple;
-struct osmo_sccp_addr;
-struct osmo_ss7_instance;
-
-struct RANAP_RAB_SetupOrModifiedItemIEs_s;
-struct RANAP_GlobalRNC_ID;
-struct RANAP_Cause;
-
-/* Debugging switches from asn1c and osmo-iuh */
-extern int asn_debug;
-extern int asn1_xer_print;
-
-struct ue_conn_ctx {
-   struct llist_head list;
-   /* TODO: It's not needed to store the full SCCP address for each
-* UE.  Rather than that, a pointer to the RNC should be far
-* sufficient */
-   struct osmo_sccp_addr sccp_addr;
-   uint32_t conn_id;
-   int integrity_active;
-   struct gprs_ra_id ra_id;
-   enum nsap_addr_enc rab_assign_addr_enc;
-};
-
-enum iu_event_type {
-   IU_EVENT_RAB_ASSIGN,
-   IU_EVENT_SECURITY_MODE_COMPLETE,
-   IU_EVENT_IU_RELEASE, /* An actual Iu Release message was 

[PATCH] osmo-msc[master]: gsup client: move not-connected to error loglevel

2017-08-11 Thread Neels Hofmeyr

Review at  https://gerrit.osmocom.org/3493

gsup client: move not-connected to error loglevel

Change-Id: I8290963aedb7237da89c9ff98adf4cd33beb5031
---
M src/libcommon/gsup_client.c
1 file changed, 2 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/93/3493/1

diff --git a/src/libcommon/gsup_client.c b/src/libcommon/gsup_client.c
index 258f230..fd65e7b 100644
--- a/src/libcommon/gsup_client.c
+++ b/src/libcommon/gsup_client.c
@@ -330,18 +330,10 @@
 
 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));
+   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;
-   }
-
-   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);

-- 
To view, visit https://gerrit.osmocom.org/3493
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8290963aedb7237da89c9ff98adf4cd33beb5031
Gerrit-PatchSet: 1
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


[PATCH] osmo-msc[master]: Implement AoIP, port to M3UA SIGTRAN (large addition and ref...

2017-08-11 Thread Neels Hofmeyr

Review at  https://gerrit.osmocom.org/3486

Implement AoIP, port to M3UA SIGTRAN (large addition and refactoring)

This was originally a long series of commits converging to the final result
seen in this patch. It does not make much sense to review the smaller steps'
trial and error, we need to review this entire change as a whole.

Implement AoIP in osmo-msc and osmo-bsc.

Change over to the new libosmo-sigtran API with support for proper
SCCP/M3UA/SCTP stacking, as mandated by 3GPP specifications for the IuCS and
IuPS interfaces.

>From here on, a separate osmo-stp process is required for SCCP routing between
OsmoBSC / OsmoHNBGW <-> OsmoMSC / OsmoSGSN

Patch-by: pmaier, nhofmeyr, laforge
Change-Id: I5ae4e05ee7c57cad341ea5e86af37c1f6b0ffa77
---
M configure.ac
M include/openbsc/Makefile.am
A include/openbsc/a_iface.h
A include/openbsc/a_iface_bssap.h
A include/openbsc/a_reset.h
M include/openbsc/bsc_msc.h
M include/openbsc/bsc_msc_data.h
M include/openbsc/debug.h
M include/openbsc/gsm_04_08.h
M include/openbsc/gsm_data.h
M include/openbsc/gsm_data_shared.h
M include/openbsc/iu.h
M include/openbsc/mgcpgw_client.h
M include/openbsc/msc_ifaces.h
M include/openbsc/osmo_bsc.h
A include/openbsc/osmo_bsc_reset.h
A include/openbsc/osmo_bsc_sigtran.h
M include/openbsc/osmo_msc.h
M include/openbsc/transaction.h
M src/gprs/Makefile.am
M src/gprs/sgsn_main.c
M src/libbsc/abis_rsl.c
M src/libcommon-cs/Makefile.am
A src/libcommon-cs/a_reset.c
M src/libcommon-cs/common_cs.c
M src/libcommon/common_vty.c
M src/libcommon/debug.c
M src/libiu/iu.c
M src/libiu/iu_vty.c
M src/libmgcp/mgcp_protocol.c
M src/libmgcp/mgcpgw_client.c
M src/libmgcp/mgcpgw_client_vty.c
M src/libmsc/Makefile.am
M src/libmsc/a_iface.c
A src/libmsc/a_iface_bssap.c
M src/libmsc/gsm_04_08.c
M src/libmsc/gsm_subscriber.c
M src/libmsc/iucs.c
M src/libmsc/msc_ifaces.c
M src/libmsc/msc_vty.c
M src/libmsc/osmo_msc.c
M src/libmsc/subscr_conn.c
M src/osmo-bsc/Makefile.am
M src/osmo-bsc/osmo_bsc_api.c
M src/osmo-bsc/osmo_bsc_audio.c
M src/osmo-bsc/osmo_bsc_bssap.c
M src/osmo-bsc/osmo_bsc_main.c
M src/osmo-bsc/osmo_bsc_msc.c
A src/osmo-bsc/osmo_bsc_reset.c
D src/osmo-bsc/osmo_bsc_sccp.c
A src/osmo-bsc/osmo_bsc_sigtran.c
M src/osmo-bsc/osmo_bsc_vty.c
M src/osmo-bsc_mgcp/Makefile.am
M src/osmo-bsc_nat/Makefile.am
M src/osmo-msc/msc_main.c
M tests/msc_vlr/Makefile.am
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_hlr_reject.c
M tests/msc_vlr/msc_vlr_test_hlr_reject.err
M tests/msc_vlr/msc_vlr_test_hlr_timeout.c
M tests/msc_vlr/msc_vlr_test_hlr_timeout.err
M tests/msc_vlr/msc_vlr_test_ms_timeout.c
M tests/msc_vlr/msc_vlr_test_ms_timeout.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
M tests/msc_vlr/msc_vlr_test_rest.c
M tests/msc_vlr/msc_vlr_test_rest.err
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
76 files changed, 4,255 insertions(+), 706 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/86/3486/1


-- 
To view, visit https://gerrit.osmocom.org/3486
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5ae4e05ee7c57cad341ea5e86af37c1f6b0ffa77
Gerrit-PatchSet: 1
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: dexter 


[PATCH] libosmo-sccp[master]: sccp: fixup for osmo_sccp_get_ss7()

2017-08-11 Thread dexter

Review at  https://gerrit.osmocom.org/3485

sccp: fixup for osmo_sccp_get_ss7()

osmo_sccp_get_ss7() has the risk of a nullpointer dereference, when
sccp is NULL.

Return NULL when the sccp instance is NULL.

Add doxygen comment

Change-Id: I84d484e4441fd37443fff8c67e17df8fb15d5b2e
---
M include/osmocom/sigtran/sccp_sap.h
M src/sccp_user.c
2 files changed, 7 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/85/3485/1

diff --git a/include/osmocom/sigtran/sccp_sap.h 
b/include/osmocom/sigtran/sccp_sap.h
index bf1b368..5524bd8 100644
--- a/include/osmocom/sigtran/sccp_sap.h
+++ b/include/osmocom/sigtran/sccp_sap.h
@@ -246,7 +246,7 @@
 struct osmo_sccp_instance *
 osmo_sccp_instance_create(struct osmo_ss7_instance *ss7, void *priv);
 void osmo_sccp_instance_destroy(struct osmo_sccp_instance *inst);
-struct osmo_ss7_instance *osmo_sccp_get_ss7(struct osmo_sccp_instance *sccp);
+struct osmo_ss7_instance *osmo_sccp_get_ss7(const struct osmo_sccp_instance 
*sccp);
 struct osmo_sccp_instance *osmo_sccp_get_sccp(const struct osmo_sccp_user 
*scu);
 
 void osmo_sccp_user_unbind(struct osmo_sccp_user *scu);
diff --git a/src/sccp_user.c b/src/sccp_user.c
index a4568cf..b0a807d 100644
--- a/src/sccp_user.c
+++ b/src/sccp_user.c
@@ -598,8 +598,13 @@
return NULL;
 }
 
-struct osmo_ss7_instance *osmo_sccp_get_ss7(struct osmo_sccp_instance *sccp)
+/*! \brief get the SS7 instance that is related to the given SCCP instance
+ *  \param[in] sccp SCCP instance
+ *  \returns SS7 instance; NULL if sccp was NULL */
+struct osmo_ss7_instance *osmo_sccp_get_ss7(const struct osmo_sccp_instance 
*sccp)
 {
+   if (!sccp)
+   return NULL;
return sccp->ss7;
 }
 

-- 
To view, visit https://gerrit.osmocom.org/3485
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I84d484e4441fd37443fff8c67e17df8fb15d5b2e
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: dexter 


[PATCH] libosmo-sccp[master]: sccp: function to get sccp instance from sccp user

2017-08-11 Thread dexter

Review at  https://gerrit.osmocom.org/3484

sccp: function to get sccp instance from sccp user

It is currently impossible to find out which SCCP instance handles
a particular user.

Introduce function to lookup the SCCP instance from a given SCCP
user.

Change-Id: I9562c4f1d00e2ebb3252c5dea598b643aa393719
---
M include/osmocom/sigtran/sccp_sap.h
M src/sccp_user.c
2 files changed, 11 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/84/3484/1

diff --git a/include/osmocom/sigtran/sccp_sap.h 
b/include/osmocom/sigtran/sccp_sap.h
index 796597f..bf1b368 100644
--- a/include/osmocom/sigtran/sccp_sap.h
+++ b/include/osmocom/sigtran/sccp_sap.h
@@ -247,6 +247,7 @@
 osmo_sccp_instance_create(struct osmo_ss7_instance *ss7, void *priv);
 void osmo_sccp_instance_destroy(struct osmo_sccp_instance *inst);
 struct osmo_ss7_instance *osmo_sccp_get_ss7(struct osmo_sccp_instance *sccp);
+struct osmo_sccp_instance *osmo_sccp_get_sccp(const struct osmo_sccp_user 
*scu);
 
 void osmo_sccp_user_unbind(struct osmo_sccp_user *scu);
 void osmo_sccp_user_set_priv(struct osmo_sccp_user *scu, void *priv);
diff --git a/src/sccp_user.c b/src/sccp_user.c
index c0e2b5a..a4568cf 100644
--- a/src/sccp_user.c
+++ b/src/sccp_user.c
@@ -602,3 +602,13 @@
 {
return sccp->ss7;
 }
+
+/*! \brief get the SCCP instance that is related to the given sccp user
+ *  \param[in] scu SCCP user
+ *  \returns SCCP instance; NULL if scu was NULL */
+struct osmo_sccp_instance *osmo_sccp_get_sccp(const struct osmo_sccp_user *scu)
+{
+   if (!scu)
+   return NULL;
+   return scu->inst;
+}

-- 
To view, visit https://gerrit.osmocom.org/3484
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9562c4f1d00e2ebb3252c5dea598b643aa393719
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: dexter 


osmo-msc[master]: 04.08: log protocol discriminators and message types by name

2017-08-11 Thread Pablo Neira Ayuso

Patch Set 6: Code-Review+1

-- 
To view, visit https://gerrit.osmocom.org/3350
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ida205d217e304337d816b14fd15e2ee435e7397d
Gerrit-PatchSet: 6
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pablo Neira Ayuso 
Gerrit-HasComments: No


osmo-gsm-manuals[master]: osmux: Fix description for Dummy frames FT field

2017-08-11 Thread Pablo Neira Ayuso

Patch Set 1: Code-Review+1

-- 
To view, visit https://gerrit.osmocom.org/3478
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia421655bd1be45101da3db2a0af44fbb3cc111c1
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pablo Neira Ayuso 
Gerrit-HasComments: No


openbsc[master]: mgcp_osmux: Remove unused parameter

2017-08-11 Thread Pablo Neira Ayuso

Patch Set 1: Code-Review+1

-- 
To view, visit https://gerrit.osmocom.org/3483
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Icb1e7cb15fe04642578f5292124ebc1eac9c9aa3
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pablo Neira Ayuso 
Gerrit-HasComments: No


[PATCH] openbsc[master]: mgcp_osmux: Remove unused parameter

2017-08-11 Thread Pau Espin Pedrol

Review at  https://gerrit.osmocom.org/3483

mgcp_osmux: Remove unused parameter

Change-Id: Icb1e7cb15fe04642578f5292124ebc1eac9c9aa3
---
M openbsc/include/openbsc/osmux.h
M openbsc/src/libmgcp/mgcp_osmux.c
2 files changed, 4 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/83/3483/1

diff --git a/openbsc/include/openbsc/osmux.h b/openbsc/include/openbsc/osmux.h
index 0b64a7f..f3ea72a 100644
--- a/openbsc/include/openbsc/osmux.h
+++ b/openbsc/include/openbsc/osmux.h
@@ -11,8 +11,7 @@
 };
 
 int osmux_init(int role, struct mgcp_config *cfg);
-int osmux_enable_endpoint(struct mgcp_endpoint *endp, int role,
- struct in_addr *addr, uint16_t port);
+int osmux_enable_endpoint(struct mgcp_endpoint *endp, struct in_addr *addr, 
uint16_t port);
 void osmux_disable_endpoint(struct mgcp_endpoint *endp);
 void osmux_allocate_cid(struct mgcp_endpoint *endp);
 void osmux_release_cid(struct mgcp_endpoint *endp);
diff --git a/openbsc/src/libmgcp/mgcp_osmux.c b/openbsc/src/libmgcp/mgcp_osmux.c
index b46a80e..c52984b 100644
--- a/openbsc/src/libmgcp/mgcp_osmux.c
+++ b/openbsc/src/libmgcp/mgcp_osmux.c
@@ -340,8 +340,7 @@
if (endp->osmux.state == OSMUX_STATE_ENABLED)
goto out;
 
-   if (osmux_enable_endpoint(endp, OSMUX_ROLE_BSC_NAT,
- >sin_addr, addr->sin_port) < 0 ){
+   if (osmux_enable_endpoint(endp, >sin_addr, addr->sin_port) < 0 ) {
LOGP(DMGCP, LOGL_ERROR,
 "Could not enable osmux in endpoint %d\n",
 ENDPOINT_NUMBER(endp));
@@ -433,8 +432,7 @@
return 0;
 }
 
-int osmux_enable_endpoint(struct mgcp_endpoint *endp, int role,
- struct in_addr *addr, uint16_t port)
+int osmux_enable_endpoint(struct mgcp_endpoint *endp, struct in_addr *addr, 
uint16_t port)
 {
/* If osmux is enabled, initialize the output handler. This handler is
 * used to reconstruct the RTP flow from osmux. The RTP SSRC is
@@ -522,8 +520,7 @@
return 0;
 
if (endp->osmux.state == OSMUX_STATE_ACTIVATING) {
-   if (osmux_enable_endpoint(endp, OSMUX_ROLE_BSC,
- >net_end.addr,
+   if (osmux_enable_endpoint(endp, >net_end.addr,
  htons(endp->cfg->osmux_port)) < 0) {
LOGP(DMGCP, LOGL_ERROR,
 "Could not activate osmux in endpoint %d\n",

-- 
To view, visit https://gerrit.osmocom.org/3483
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icb1e7cb15fe04642578f5292124ebc1eac9c9aa3
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[PATCH] libosmo-sccp[master]: sccp: make osmo_sccp_addr_name() available

2017-08-11 Thread dexter

Review at  https://gerrit.osmocom.org/3482

sccp: make osmo_sccp_addr_name() available

osmo_sccp_addr_name() is not listed in any header file.

Add osmo_sccp_addr_name() to sccp_helpers.h in order to make
it available.

Change-Id: I092dd55948faeeff78f28f7d50c5b84b9e69ef24
---
M include/osmocom/sigtran/sccp_helpers.h
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/82/3482/1

diff --git a/include/osmocom/sigtran/sccp_helpers.h 
b/include/osmocom/sigtran/sccp_helpers.h
index 2f318f4..c2175f4 100644
--- a/include/osmocom/sigtran/sccp_helpers.h
+++ b/include/osmocom/sigtran/sccp_helpers.h
@@ -54,3 +54,4 @@
 
 char *osmo_sccp_gt_dump(const struct osmo_sccp_gt *gt);
 char *osmo_sccp_addr_dump(const struct osmo_sccp_addr *addr);
+char *osmo_sccp_addr_name(const struct osmo_ss7_instance *ss7, const struct 
osmo_sccp_addr *addr);

-- 
To view, visit https://gerrit.osmocom.org/3482
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I092dd55948faeeff78f28f7d50c5b84b9e69ef24
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: dexter 


[PATCH] libosmo-sccp[master]: sccp: check for valid point code in osmo_sccp_simple_client()

2017-08-11 Thread dexter

Review at  https://gerrit.osmocom.org/3480

sccp: check for valid point code in osmo_sccp_simple_client()

The point-code is not checked in the beginning, only the ASP
checks the point code at a very late stage and fails in case
an invalid point-code is detected.

Remove the check in the ASP creation.

Add a new check after the SS7 initalization that checks the
point-code. If none is set, the default point-code will be
used.

Change-Id: I334d90e769bd9952f67c51b12a945f22bd268fa8
---
M src/sccp_user.c
1 file changed, 10 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/80/3480/1

diff --git a/src/sccp_user.c b/src/sccp_user.c
index 4e28aa0..387061c 100644
--- a/src/sccp_user.c
+++ b/src/sccp_user.c
@@ -342,6 +342,16 @@
ss7->cfg.primary_pc = default_pc;
ss7_created = true;
}
+
+   /* In case no valid point-code has been configured via the VTY, we
+* will fall back to the default pointcode. */
+   if (!osmo_ss7_pc_is_valid(ss7->cfg.primary_pc)) {
+   LOGP(DLSCCP, LOGL_ERROR,
+"SS7 instance %u: no primary point-code set, using default 
point-code\n",
+ss7->cfg.id);
+   ss7->cfg.primary_pc = default_pc;
+   }
+
LOGP(DLSCCP, LOGL_NOTICE, "%s: Using SS7 instance %u, pc:%s\n", name,
 ss7->cfg.id, osmo_ss7_pointcode_print(ss7, ss7->cfg.primary_pc));
 
@@ -364,12 +374,6 @@
if (!as)
goto out_ss7;
as_created = true;
-
-   if (!osmo_ss7_pc_is_valid(ss7->cfg.primary_pc)) {
-   LOGP(DLSCCP, LOGL_ERROR, "SS7 instance %u: no primary 
point-code set\n",
-ss7->cfg.id);
-   goto out_ss7;
-   }
as->cfg.routing_key.pc = ss7->cfg.primary_pc;
}
LOGP(DLSCCP, LOGL_NOTICE, "%s: Using AS instance %s\n", name,

-- 
To view, visit https://gerrit.osmocom.org/3480
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I334d90e769bd9952f67c51b12a945f22bd268fa8
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: dexter 


[PATCH] libosmo-sccp[master]: sccp: add doxgen comments for osmo_sccp_simple_client()

2017-08-11 Thread dexter

Review at  https://gerrit.osmocom.org/3481

sccp: add doxgen comments for osmo_sccp_simple_client()

Some of the functons in sccp_user.c have already
doygen comments on them.

Add doxygen comments for the simple client functions as well

Change-Id: I9143bdc54d729f9f50e69fe38cd1798e065f2497
---
M src/sccp_user.c
1 file changed, 32 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/81/3481/1

diff --git a/src/sccp_user.c b/src/sccp_user.c
index 387061c..c0e2b5a 100644
--- a/src/sccp_user.c
+++ b/src/sccp_user.c
@@ -295,6 +295,18 @@
  * Convenience function for CLIENT
  ***/
 
+/*! \brief request an sccp client instance
+ *  \param[in] ctx talloc context
+ *  \param[in] ss7_id of the SS7/CS7 instance
+ *  \param[in] name human readable name
+ *  \param[in] default_pc pointcode to be used on missing VTY setting
+ *  \param[in] prot protocol to be used (e.g OSMO_SS7_ASP_PROT_M3UA)
+ *  \param[in] default_local_port local port to be usd on missing VTY setting
+ *  \param[in] default_local_ip local IP-address to be usd on missing VTY 
setting
+ *  \param[in] default_remote_port remote port to be usd on missing VTY setting
+ *  \param[in] default_remote_ip remote IP-address to be usd on missing VTY 
setting
+ *  \returns callee-allocated SCCP instance on success; NULL on error */
+
 struct osmo_sccp_instance *
 osmo_sccp_simple_client_on_ss7_id(void *ctx, uint32_t ss7_id, const char *name,
  uint32_t default_pc,
@@ -313,6 +325,12 @@
struct osmo_ss7_asp *asp;
bool asp_created = false;
char *as_name, *asp_name = NULL;
+
+   /*! The function will examine the given CS7 instance and its sub
+*  components (as, asp, etc.). If necessary it will allocate
+*  the missing components. If no CS7 instance can be detected
+*  under the caller supplied ID, a new instance will be created
+*  beforehand. */
 
/* Choose default ports when the caller does not supply valid port
 * numbers. */
@@ -450,12 +468,26 @@
return NULL;
 }
 
+/*! \brief request an sccp client instance
+ *  \param[in] ctx talloc context
+ *  \param[in] name human readable name
+ *  \param[in] default_pc pointcode to be used on missing VTY setting
+ *  \param[in] prot protocol to be used (e.g OSMO_SS7_ASP_PROT_M3UA)
+ *  \param[in] default_local_port local port to be usd on missing VTY setting
+ *  \param[in] default_local_ip local IP-address to be usd on missing VTY 
setting
+ *  \param[in] default_remote_port remote port to be usd on missing VTY setting
+ *  \param[in] default_remote_ip remote IP-address to be usd on missing VTY 
setting
+ *  \returns callee-allocated SCCP instance on success; NULL on error */
 struct osmo_sccp_instance *
 osmo_sccp_simple_client(void *ctx, const char *name, uint32_t default_pc,
enum osmo_ss7_asp_protocol prot, int default_local_port,
const char *default_local_ip, int default_remote_port,
const char *default_remote_ip)
 {
+   /*! This is simplified version of osmo_sccp_simple_client_on_ss7_id().
+*  the only difference is that the ID of the CS7 instance will be
+*  set to 1 statically */
+
return osmo_sccp_simple_client_on_ss7_id(ctx, 1, name, default_pc, prot,
 default_local_port,
 default_local_ip,

-- 
To view, visit https://gerrit.osmocom.org/3481
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9143bdc54d729f9f50e69fe38cd1798e065f2497
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: dexter 


[PATCH] libosmo-sccp[master]: sccp: fix handling of default IP addresses in osmo_sccp_simp...

2017-08-11 Thread dexter

Review at  https://gerrit.osmocom.org/3479

sccp: fix handling of default IP addresses in osmo_sccp_simple_client()

When the default IP addresses (remote or local) the respective
struct value should be set to NULL.

Fix wrong ?:-notation.

Change-Id: I312caf9d54cedb02034e4ef88fdd2e6ad9ca1c34
---
M src/sccp_user.c
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/79/3479/1

diff --git a/src/sccp_user.c b/src/sccp_user.c
index 9116b60..4e28aa0 100644
--- a/src/sccp_user.c
+++ b/src/sccp_user.c
@@ -404,10 +404,10 @@
goto out_rt;
asp_created = true;
 
-   default_local_ip ? asp->cfg.local.host =
-   talloc_strdup(asp, default_local_ip) : NULL;
-   default_remote_ip ? asp->cfg.remote.host =
-   talloc_strdup(asp, default_remote_ip) : NULL;
+   asp->cfg.local.host =
+   default_local_ip ? asp->cfg.local.host : NULL;
+   asp->cfg.remote.host =
+   default_remote_ip ? asp->cfg.remote.host : NULL;
 
osmo_ss7_as_add_asp(as, asp->cfg.name);
}

-- 
To view, visit https://gerrit.osmocom.org/3479
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I312caf9d54cedb02034e4ef88fdd2e6ad9ca1c34
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: dexter 


[PATCH] osmo-gsm-manuals[master]: osmux: Fix description for Dummy frames FT field

2017-08-11 Thread Pau Espin Pedrol

Review at  https://gerrit.osmocom.org/3478

osmux: Fix description for Dummy frames FT field

Change-Id: Ia421655bd1be45101da3db2a0af44fbb3cc111c1
---
M OsmoBSC/osmux-reference.adoc
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals 
refs/changes/78/3478/1

diff --git a/OsmoBSC/osmux-reference.adoc b/OsmoBSC/osmux-reference.adoc
index 4d03a4b..929f442 100644
--- a/OsmoBSC/osmux-reference.adoc
+++ b/OsmoBSC/osmux-reference.adoc
@@ -159,7 +159,7 @@
 
 
 Field Type (FT): 2 bits::
-The Field Type allocated for LAPD Signalling is "0".
+The Field Type allocated for LAPD Signalling frames is "0".
 
 This frame type is not yet supported inside OsmoCom and may be subject to
 change in future versions of the protocol.
@@ -197,7 +197,7 @@
 talkspurt.
 
 Field Type (FT): 2 bits::
-The Field Type allocated for AMR codec is "1".
+The Field Type allocated for AMR Codec frames is "1".
 
 Frame Counter (CTR): 2 bits::
 Provides the number of batched AMR payloads (starting 0) after the header. For
@@ -284,7 +284,7 @@
 
 
 Field Type (FT): 2 bits::
-The Field Type allocated for AMR codec is "2".
+The Field Type allocated for Dummy frames is "2".
 
 Frame Counter (CTR): 2 bits::
 Provides the number of dummy batched AMR payloads (starting 0) after the 
header.

-- 
To view, visit https://gerrit.osmocom.org/3478
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia421655bd1be45101da3db2a0af44fbb3cc111c1
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[PATCH] openbsc[master]: libmsc: use smpp34_tlv_for_each() to avoid suboptimal TLV ha...

2017-08-11 Thread Pablo Neira Ayuso
Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

https://gerrit.osmocom.org/3470

to look at the new patch set (#3).

libmsc: use smpp34_tlv_for_each() to avoid suboptimal TLV handling

submit_to_sms() now handles two TLVs, so find_tlv() is suboptiomal and
it can be removed, since it would result in two passes on the TLV list.
Use new smpp34_tlv_for_each() helper to iterate over the list of TLVs
that is available since I446929feed049d0411e1629ca263e2bc41f714cc.

Change-Id: I53a65164a6cc4abc6bf57d9a8dc275cf21c90222
---
M openbsc/src/libmsc/smpp_openbsc.c
1 file changed, 41 insertions(+), 31 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/70/3470/3

diff --git a/openbsc/src/libmsc/smpp_openbsc.c 
b/openbsc/src/libmsc/smpp_openbsc.c
index 85de040..7e23abd 100644
--- a/openbsc/src/libmsc/smpp_openbsc.c
+++ b/openbsc/src/libmsc/smpp_openbsc.c
@@ -72,26 +72,31 @@
return subscr;
 }
 
-/*! \brief find a TLV with given tag in list of libsmpp34 TLVs */
-static struct tlv_t *find_tlv(struct tlv_t *head, uint16_t tag)
+static int smpp34_submit_tlv_msg_payload(const struct tlv_t *t,
+const struct submit_sm_t *submit,
+const uint8_t **sms_msg,
+unsigned int *sms_msg_len)
 {
-   struct tlv_t *t;
-
-   for (t = head; t != NULL; t = t->next) {
-   if (t->tag == tag)
-   return t;
+   if (submit->sm_length) {
+   LOGP(DLSMS, LOGL_ERROR,
+"SMPP cannot have payload in TLV _and_ in the header\n");
+   return -1;
}
-   return NULL;
+   *sms_msg = t->value.octet;
+   *sms_msg_len = t->length;
+
+   return 0;
 }
 
 /*! \brief convert from submit_sm_t to gsm_sms */
 static int submit_to_sms(struct gsm_sms **psms, struct gsm_network *net,
 const struct submit_sm_t *submit)
 {
+   const uint8_t *sms_msg = NULL;
struct gsm_subscriber *dest;
+   uint16_t msg_ref = 0;
struct gsm_sms *sms;
struct tlv_t *t;
-   const uint8_t *sms_msg;
unsigned int sms_msg_len;
int mode;
 
@@ -105,31 +110,40 @@
return ESME_RINVDSTADR;
}
 
-   t = find_tlv(submit->tlv, TLVID_message_payload);
-   if (t) {
-   if (submit->sm_length) {
-   /* ERROR: we cannot have both! */
-   LOGP(DLSMS, LOGL_ERROR, "SMPP Cannot have payload in "
-   "TLV _and_ in the header\n");
-   subscr_put(dest);
-   return ESME_ROPTPARNOTALLWD;
+   smpp34_tlv_for_each(t, submit->tlv) {
+   switch (t->tag) {
+   case TLVID_message_payload:
+   if (smpp34_submit_tlv_msg_payload(t, submit, _msg,
+ _msg_len) < 0) {
+   subscr_put(dest);
+   return ESME_ROPTPARNOTALLWD;
+   }
+   break;
+   case TLVID_user_message_reference:
+   msg_ref = ntohs(t->value.val16);
+   break;
+   default:
+   break;
}
-   sms_msg = t->value.octet;
-   sms_msg_len = t->length;
-   } else if (submit->sm_length > 0 && submit->sm_length < 255) {
-   sms_msg = submit->short_message;
-   sms_msg_len = submit->sm_length;
-   } else {
-   LOGP(DLSMS, LOGL_ERROR,
-   "SMPP neither message payload nor valid sm_length.\n");
-   subscr_put(dest);
-   return ESME_RINVPARLEN;
+   }
+
+   if (!sms_msg) {
+   if (submit->sm_length > 0 && submit->sm_length < 255) {
+   sms_msg = submit->short_message;
+   sms_msg_len = submit->sm_length;
+   } else {
+   LOGP(DLSMS, LOGL_ERROR,
+"SMPP neither message payload nor valid 
sm_length.\n");
+   subscr_put(dest);
+   return ESME_RINVPARLEN;
+   }
}
 
sms = sms_alloc();
sms->source = SMS_SOURCE_SMPP;
sms->smpp.sequence_nr = submit->sequence_number;
sms->status_rep_req = submit->registered_delivery;
+   sms->msg_ref = msg_ref;
 
/* fill in the destination address */
sms->receiver = dest;
@@ -203,10 +217,6 @@
memcpy(sms->user_data, sms_msg, sms_msg_len);
sms->user_data_len = sms_msg_len;
}
-
-   t = find_tlv(submit->tlv, TLVID_user_message_reference);
-   if (t)
-   sms->msg_ref = ntohs(t->value.val16);
 
*psms = sms;
return ESME_ROK;

-- 
To view, visit 

openbsc[master]: libmsc: use smpp34_tlv_for_each() to avoid suboptimal TLV ha...

2017-08-11 Thread Pau Espin Pedrol

Patch Set 2:

I never looked at that library so far, and I cannot give +2 on it anyway, sorry 
for that.

Regarding your "retrigger by pushing again", I give you a tip for that: You can 
re-trigger the jenkins job which was launched by Gerrit and it if succeeds, it 
will automatically give Verify+1 to the patch.

You can find the link to the last job in one of the old comments in this patch, 
which is posted by "Jenkins Builder". Follow the link to jenkins and press 
"Retrigger" button which, if you have enough permissions, should appear on the 
left side of the web page.

-- 
To view, visit https://gerrit.osmocom.org/3470
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I53a65164a6cc4abc6bf57d9a8dc275cf21c90222
Gerrit-PatchSet: 2
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Pablo Neira Ayuso 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pablo Neira Ayuso 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No


[MERGED] openggsn[master]: Use osmocom-style git-version-gen / .version magic

2017-08-11 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: Use osmocom-style git-version-gen / .version magic
..


Use osmocom-style git-version-gen / .version magic

This generates the version number from the latest tag + git history

Change-Id: I71e1c3f8f534d9e9690c94068eccdee29a6fee12
---
M Makefile.am
M configure.ac
M debian/rules
A git-version-gen
4 files changed, 163 insertions(+), 2 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/Makefile.am b/Makefile.am
index 8232770..970fbf7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,4 +4,10 @@
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = libgtp.pc
 
-EXTRA_DIST = README.md README.FreeBSD README.MacOSX README.Solaris
+BUILT_SOURCES = $(top_srcdir)/.version
+$(top_srcdir)/.version:
+   echo $(VERSION) > $@-t && mv $@-t $@
+dist-hook:
+   echo $(VERSION) > $(distdir)/.tarball-version
+
+EXTRA_DIST = git-version-gen .version README.md README.FreeBSD README.MacOSX 
README.Solaris
diff --git a/configure.ac b/configure.ac
index b7e6793..63d3117 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
 # Process this file with autoconf to produce a configure script.
-AC_INIT(openggsn, 0.93, lafo...@gnumonks.org)
+AC_INIT(openggsn, m4_esyscmd([./git-version-gen .tarball-version]), 
osmocom-net-g...@lists.osmocom.org)
 AC_CONFIG_SRCDIR([gtp/gtp.c])
 AM_CONFIG_HEADER([config.h])
 #AC_CONFIG_HEADER([config.h])
diff --git a/debian/rules b/debian/rules
index 5562909..8710fa0 100755
--- a/debian/rules
+++ b/debian/rules
@@ -12,3 +12,7 @@
 
 override_dh_strip:
dh_strip --dbg-package=openggsn-dbg
+
+override_dh_autoreconf:
+   echo $(VERSION) > .tarball-version
+   dh_autoreconf
diff --git a/git-version-gen b/git-version-gen
new file mode 100755
index 000..42cf3d2
--- /dev/null
+++ b/git-version-gen
@@ -0,0 +1,151 @@
+#!/bin/sh
+# Print a version string.
+scriptversion=2010-01-28.01
+
+# Copyright (C) 2007-2010 Free Software Foundation, Inc.
+#
+# 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 .
+
+# This script is derived from GIT-VERSION-GEN from GIT: http://git.or.cz/.
+# It may be run two ways:
+# - from a git repository in which the "git describe" command below
+#   produces useful output (thus requiring at least one signed tag)
+# - from a non-git-repo directory containing a .tarball-version file, which
+#   presumes this script is invoked like "./git-version-gen .tarball-version".
+
+# In order to use intra-version strings in your project, you will need two
+# separate generated version string files:
+#
+# .tarball-version - present only in a distribution tarball, and not in
+#   a checked-out repository.  Created with contents that were learned at
+#   the last time autoconf was run, and used by git-version-gen.  Must not
+#   be present in either $(srcdir) or $(builddir) for git-version-gen to
+#   give accurate answers during normal development with a checked out tree,
+#   but must be present in a tarball when there is no version control system.
+#   Therefore, it cannot be used in any dependencies.  GNUmakefile has
+#   hooks to force a reconfigure at distribution time to get the value
+#   correct, without penalizing normal development with extra reconfigures.
+#
+# .version - present in a checked-out repository and in a distribution
+#   tarball.  Usable in dependencies, particularly for files that don't
+#   want to depend on config.h but do want to track version changes.
+#   Delete this file prior to any autoconf run where you want to rebuild
+#   files to pick up a version string change; and leave it stale to
+#   minimize rebuild time after unrelated changes to configure sources.
+#
+# It is probably wise to add these two files to .gitignore, so that you
+# don't accidentally commit either generated file.
+#
+# Use the following line in your configure.ac, so that $(VERSION) will
+# automatically be up-to-date each time configure is run (and note that
+# since configure.ac no longer includes a version string, Makefile rules
+# should not depend on configure.ac for version updates).
+#
+# AC_INIT([GNU project],
+# m4_esyscmd([build-aux/git-version-gen .tarball-version]),
+# [bug-project@example])
+#
+# Then use the following lines in your Makefile.am, so that .version
+# 

openggsn[master]: Use osmocom-style git-version-gen / .version magic

2017-08-11 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/3475
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I71e1c3f8f534d9e9690c94068eccdee29a6fee12
Gerrit-PatchSet: 1
Gerrit-Project: openggsn
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[PATCH] libsmpp34[master]: add esm_class definitions

2017-08-11 Thread Pablo Neira Ayuso
Hello Harald Welte, Jenkins Builder,

I'd like you to reexamine a change.  Please visit

https://gerrit.osmocom.org/3473

to look at the new patch set (#2).

add esm_class definitions

Add special message attributes definitions that are associated with the
short message. Thus, we can get rid of magic numbers in our codebase.

Change-Id: I91afd8b462b8fd3b2c4c5b54f4eeb7ec5b730b65
---
M src/smpp34.h
1 file changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libsmpp34 refs/changes/73/3473/2

diff --git a/src/smpp34.h b/src/smpp34.h
index 5fb6395..9d51a4a 100644
--- a/src/smpp34.h
+++ b/src/smpp34.h
@@ -204,4 +204,12 @@
 #define TLVID_its_reply_type  0x1380 /* CDMA */
 #define TLVID_its_session_info0x1383 /* CDMA */
 
+/* As defined by SMPP 3.4, Sect. 5.2.12 Parameter Definition esm_class. */
+#define SMPP34_DATAGRAM_MODE   0x01
+#define SMPP34_MSG_MODE_MASK   0x03
+#define SMPP34_DELIVERY_RECEIPT0x04
+#define SMPP34_DELIVERY_ACK0x08
+#define SMPP34_UDHI_IND0x40
+#define SMPP34_REPLY_PATH  0x80
+
 #endif

-- 
To view, visit https://gerrit.osmocom.org/3473
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I91afd8b462b8fd3b2c4c5b54f4eeb7ec5b730b65
Gerrit-PatchSet: 2
Gerrit-Project: libsmpp34
Gerrit-Branch: master
Gerrit-Owner: Pablo Neira Ayuso 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pablo Neira Ayuso 


[PATCH] openggsn[master]: Use osmocom-style git-version-gen / .version magic

2017-08-11 Thread Harald Welte

Review at  https://gerrit.osmocom.org/3475

Use osmocom-style git-version-gen / .version magic

This generates the version number from the latest tag + git history

Change-Id: I71e1c3f8f534d9e9690c94068eccdee29a6fee12
---
M Makefile.am
M configure.ac
M debian/rules
A git-version-gen
4 files changed, 163 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/75/3475/1

diff --git a/Makefile.am b/Makefile.am
index 8232770..970fbf7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,4 +4,10 @@
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = libgtp.pc
 
-EXTRA_DIST = README.md README.FreeBSD README.MacOSX README.Solaris
+BUILT_SOURCES = $(top_srcdir)/.version
+$(top_srcdir)/.version:
+   echo $(VERSION) > $@-t && mv $@-t $@
+dist-hook:
+   echo $(VERSION) > $(distdir)/.tarball-version
+
+EXTRA_DIST = git-version-gen .version README.md README.FreeBSD README.MacOSX 
README.Solaris
diff --git a/configure.ac b/configure.ac
index b7e6793..63d3117 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
 # Process this file with autoconf to produce a configure script.
-AC_INIT(openggsn, 0.93, lafo...@gnumonks.org)
+AC_INIT(openggsn, m4_esyscmd([./git-version-gen .tarball-version]), 
osmocom-net-g...@lists.osmocom.org)
 AC_CONFIG_SRCDIR([gtp/gtp.c])
 AM_CONFIG_HEADER([config.h])
 #AC_CONFIG_HEADER([config.h])
diff --git a/debian/rules b/debian/rules
index 5562909..8710fa0 100755
--- a/debian/rules
+++ b/debian/rules
@@ -12,3 +12,7 @@
 
 override_dh_strip:
dh_strip --dbg-package=openggsn-dbg
+
+override_dh_autoreconf:
+   echo $(VERSION) > .tarball-version
+   dh_autoreconf
diff --git a/git-version-gen b/git-version-gen
new file mode 100755
index 000..42cf3d2
--- /dev/null
+++ b/git-version-gen
@@ -0,0 +1,151 @@
+#!/bin/sh
+# Print a version string.
+scriptversion=2010-01-28.01
+
+# Copyright (C) 2007-2010 Free Software Foundation, Inc.
+#
+# 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 .
+
+# This script is derived from GIT-VERSION-GEN from GIT: http://git.or.cz/.
+# It may be run two ways:
+# - from a git repository in which the "git describe" command below
+#   produces useful output (thus requiring at least one signed tag)
+# - from a non-git-repo directory containing a .tarball-version file, which
+#   presumes this script is invoked like "./git-version-gen .tarball-version".
+
+# In order to use intra-version strings in your project, you will need two
+# separate generated version string files:
+#
+# .tarball-version - present only in a distribution tarball, and not in
+#   a checked-out repository.  Created with contents that were learned at
+#   the last time autoconf was run, and used by git-version-gen.  Must not
+#   be present in either $(srcdir) or $(builddir) for git-version-gen to
+#   give accurate answers during normal development with a checked out tree,
+#   but must be present in a tarball when there is no version control system.
+#   Therefore, it cannot be used in any dependencies.  GNUmakefile has
+#   hooks to force a reconfigure at distribution time to get the value
+#   correct, without penalizing normal development with extra reconfigures.
+#
+# .version - present in a checked-out repository and in a distribution
+#   tarball.  Usable in dependencies, particularly for files that don't
+#   want to depend on config.h but do want to track version changes.
+#   Delete this file prior to any autoconf run where you want to rebuild
+#   files to pick up a version string change; and leave it stale to
+#   minimize rebuild time after unrelated changes to configure sources.
+#
+# It is probably wise to add these two files to .gitignore, so that you
+# don't accidentally commit either generated file.
+#
+# Use the following line in your configure.ac, so that $(VERSION) will
+# automatically be up-to-date each time configure is run (and note that
+# since configure.ac no longer includes a version string, Makefile rules
+# should not depend on configure.ac for version updates).
+#
+# AC_INIT([GNU project],
+# m4_esyscmd([build-aux/git-version-gen .tarball-version]),
+# [bug-project@example])
+#
+# Then use the following lines in your Makefile.am, so that .version
+# will be present for dependencies, and so that .tarball-version will
+# exist in distribution tarballs.
+#
+# BUILT_SOURCES = $(top_srcdir)/.version
+# 

[MERGED] libsmpp34[master]: add smpp34_tlv_for_each() helper

2017-08-11 Thread Pablo Neira Ayuso
Pablo Neira Ayuso has submitted this change and it was merged.

Change subject: add smpp34_tlv_for_each() helper
..


add smpp34_tlv_for_each() helper

So we don't need to remember this is an opencoded list of TLVs.

Change-Id: I446929feed049d0411e1629ca263e2bc41f714cc
---
M src/smpp34_structs.h
1 file changed, 3 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/smpp34_structs.h b/src/smpp34_structs.h
index b9effb2..025109d 100644
--- a/src/smpp34_structs.h
+++ b/src/smpp34_structs.h
@@ -86,6 +86,9 @@
 OCTET16( inst, octet, size); \
 } par;
 
+#define smpp34_tlv_for_each(pos, head) \
+   for (pos = (head); pos != NULL; pos = pos->next)
+
 #define DAD( inst, par, do_dest_address ) dad_t *par;
 #define UU2( inst, par, size ) union { \
 struct { \

-- 
To view, visit https://gerrit.osmocom.org/3469
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I446929feed049d0411e1629ca263e2bc41f714cc
Gerrit-PatchSet: 1
Gerrit-Project: libsmpp34
Gerrit-Branch: master
Gerrit-Owner: Pablo Neira Ayuso 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pablo Neira Ayuso 


libsmpp34[master]: add esm_class definitions

2017-08-11 Thread Harald Welte

Patch Set 1: Code-Review+1

(1 comment)

https://gerrit.osmocom.org/#/c/3473/1/src/smpp34.h
File src/smpp34.h:

Line 213:   SMPP34_REPLY_PATH   = 0x80,
I think an enum only makes sense for fields that are not a bit/flag mask.  The 
biggest benefit of using enum's is that you will get compiler warnings in case 
you forgot to handle one of the cases.  However, for bit-mask values, that 
won't work either.  Aynway, not critical.  To me it seems like the "mode" could 
be an enum, but everything else is flags masked into the same byte?


-- 
To view, visit https://gerrit.osmocom.org/3473
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I91afd8b462b8fd3b2c4c5b54f4eeb7ec5b730b65
Gerrit-PatchSet: 1
Gerrit-Project: libsmpp34
Gerrit-Branch: master
Gerrit-Owner: Pablo Neira Ayuso 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: Yes


libsmpp34[master]: add smpp34_tlv_for_each() helper

2017-08-11 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/3469
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I446929feed049d0411e1629ca263e2bc41f714cc
Gerrit-PatchSet: 1
Gerrit-Project: libsmpp34
Gerrit-Branch: master
Gerrit-Owner: Pablo Neira Ayuso 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[MERGED] openggsn[master]: replace hand-coded tun_gifindex() with standard POSIX if_nam...

2017-08-11 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: replace hand-coded tun_gifindex() with standard POSIX 
if_nametoindex()
..


replace hand-coded tun_gifindex() with standard POSIX if_nametoindex()

Change-Id: I738472765ab09f530dcf071455e1bb4e6fb3f6e5
---
M lib/tun.c
1 file changed, 3 insertions(+), 25 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/lib/tun.c b/lib/tun.c
index 11ea7bc..f6869ef 100644
--- a/lib/tun.c
+++ b/lib/tun.c
@@ -87,30 +87,6 @@
n->nlmsg_len = alen + len;
return 0;
 }
-
-int tun_gifindex(struct tun_t *this, __u32 * index)
-{
-   struct ifreq ifr;
-   int fd;
-
-   memset(, '\0', sizeof(ifr));
-   ifr.ifr_addr.sa_family = AF_INET;
-   ifr.ifr_dstaddr.sa_family = AF_INET;
-   ifr.ifr_netmask.sa_family = AF_INET;
-   strncpy(ifr.ifr_name, this->devname, IFNAMSIZ);
-   ifr.ifr_name[IFNAMSIZ - 1] = 0; /* Make sure to terminate */
-   if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
-   SYS_ERR(DTUN, LOGL_ERROR, errno, "socket() failed");
-   }
-   if (ioctl(fd, SIOCGIFINDEX, )) {
-   SYS_ERR(DTUN, LOGL_ERROR, errno, "ioctl() failed");
-   close(fd);
-   return -1;
-   }
-   close(fd);
-   *index = ifr.ifr_ifindex;
-   return 0;
-}
 #endif
 
 int tun_sifflags(struct tun_t *this, int flags)
@@ -264,7 +240,9 @@
req.i.ifa_prefixlen = 32;   /* 32 FOR IPv4 */
req.i.ifa_flags = 0;
req.i.ifa_scope = RT_SCOPE_HOST;/* TODO or 0 */
-   if (tun_gifindex(this, _index)) {
+   req.i.ifa_index = if_nametoindex(this->devname);
+   if (!req.i.ifa_index) {
+   SYS_ERR(DTUN, LOGL_ERROR, errno, "Unable to get ifindex for 
%s", this->devname);
return -1;
}
 

-- 
To view, visit https://gerrit.osmocom.org/3471
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I738472765ab09f530dcf071455e1bb4e6fb3f6e5
Gerrit-PatchSet: 2
Gerrit-Project: openggsn
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


openggsn[master]: tun_new(): Fix array overflow in FreeBSD related code

2017-08-11 Thread Harald Welte

Patch Set 2: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/3472
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I096e3b614e82e402886163274cfcf9355bd57580
Gerrit-PatchSet: 2
Gerrit-Project: openggsn
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[MERGED] openggsn[master]: tun_new(): Fix array overflow in FreeBSD related code

2017-08-11 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: tun_new(): Fix array overflow in FreeBSD related code
..


tun_new(): Fix array overflow in FreeBSD related code

Change-Id: I096e3b614e82e402886163274cfcf9355bd57580
---
M lib/tun.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/lib/tun.c b/lib/tun.c
index f6869ef..c4b7d10 100644
--- a/lib/tun.c
+++ b/lib/tun.c
@@ -784,7 +784,7 @@
}
 
snprintf((*tun)->devname, sizeof((*tun)->devname), "tun%d", devnum);
-   (*tun)->devname[sizeof((*tun)->devname)] = 0;
+   (*tun)->devname[sizeof((*tun)->devname)-1] = 0;
 
/* The tun device we found might have "old" IP addresses allocated */
/* We need to delete those. This problem is not present on Linux */

-- 
To view, visit https://gerrit.osmocom.org/3472
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I096e3b614e82e402886163274cfcf9355bd57580
Gerrit-PatchSet: 2
Gerrit-Project: openggsn
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


openbsc[master]: libmsc: use smpp34_tlv_for_each() to avoid suboptimal TLV ha...

2017-08-11 Thread Pablo Neira Ayuso

Patch Set 2:

Oh, I forgot.

You can probably speed up the process if you give me +X to my libsmpp34 patches 
(if you're familiar with that code).

Thanks!

-- 
To view, visit https://gerrit.osmocom.org/3470
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I53a65164a6cc4abc6bf57d9a8dc275cf21c90222
Gerrit-PatchSet: 2
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Pablo Neira Ayuso 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pablo Neira Ayuso 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No


openbsc[master]: libmsc: use smpp34_tlv_for_each() to avoid suboptimal TLV ha...

2017-08-11 Thread Pablo Neira Ayuso

Patch Set 2:

OK, will include this info once patches for libsmpp34 get in. So this also 
helps re-kick Jenkins building.

-- 
To view, visit https://gerrit.osmocom.org/3470
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I53a65164a6cc4abc6bf57d9a8dc275cf21c90222
Gerrit-PatchSet: 2
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Pablo Neira Ayuso 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pablo Neira Ayuso 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No


openbsc[master]: libmsc: use smpp34_tlv_for_each() to avoid suboptimal TLV ha...

2017-08-11 Thread Pau Espin Pedrol

Patch Set 2:

You could provide info about the dependency in the form "Requires libsmpp34 
Change-Id XYZ" in the commit message, or at least here as a comment. This way 
is easier to track what needs to be merged, or which version of the library is 
used.

-- 
To view, visit https://gerrit.osmocom.org/3470
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I53a65164a6cc4abc6bf57d9a8dc275cf21c90222
Gerrit-PatchSet: 2
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Pablo Neira Ayuso 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pablo Neira Ayuso 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No


openbsc[master]: libmsc: use new smpp34 esm_class definitions

2017-08-11 Thread Pablo Neira Ayuso

Patch Set 1:

This jenkins build will fail too, because it depends on a patch in libsmpp34 
that I have just submitted.

-- 
To view, visit https://gerrit.osmocom.org/3474
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I6c458690da60c8f3637680efbd718f6e8c6feb4c
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Pablo Neira Ayuso 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pablo Neira Ayuso 
Gerrit-HasComments: No


[MERGED] openggsn[master]: IPv6: Support PCO for IPv6 DNS addresses

2017-08-11 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: IPv6: Support PCO for IPv6 DNS addresses
..


IPv6: Support PCO for IPv6 DNS addresses

In IPv6, DNS server information is not passed along as IPCP6 like
in IPv5 with IPCP.  The reason is that IPCP6 (for PPP) doesn't
support passing DNS server information.  Rather, the relevant RFCs
indicate DHCPv6 should be used even over point-to-point links.

3GPP decided to avoid DHCPv6 dependency for stateless autoconfiguration
(the only mandatory IPv6 configuration mechanism) and added some new
non-PPP-style PCO information elements ("containers") which can among
other things inform a MS about IPV6 DNS servers.

That same mechanism can also be used to inform the MS about IPv4 DNS
servers, so for IPv4 there are now two competing mechanisms: IPCP and
the new "native" PCO container.  With this patch, we support both
for IPv4.

Change-Id: I21499afd61def8c925f7838bde76f34d28214b56
---
M ggsn/ggsn.c
1 file changed, 137 insertions(+), 42 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c
index c307177..991b54c 100644
--- a/ggsn/ggsn.c
+++ b/ggsn/ggsn.c
@@ -72,7 +72,7 @@
 struct in_addr listen_;
 struct in_addr netaddr, destaddr, net; /* Network interface   */
 size_t prefixlen;
-struct in_addr dns1, dns2; /* PCO DNS address */
+struct in46_addr dns1, dns2;   /* PCO DNS address */
 char *ipup, *ipdown;   /* Filename of scripts */
 int debug; /* Print debug output  */
 struct ul255_t pco;
@@ -175,6 +175,103 @@
return 0;
 }
 
+#include 
+
+/* 3GPP TS 24.008 10.6.5.3 */
+enum pco_protocols {
+   PCO_P_LCP   = 0xC021,
+   PCO_P_PAP   = 0xC023,
+   PCO_P_CHAP  = 0xC223,
+   PCO_P_IPCP  = 0x8021,
+   PCO_P_PCSCF_ADDR= 0x0001,
+   PCO_P_IM_CN_SS_F= 0x0002,
+   PCO_P_DNS_IPv6_ADDR = 0x0003,
+   PCO_P_POLICY_CTRL_REJ   = 0x0004,   /* only in Network->MS */
+   PCO_P_MS_SUP_NETREQ_BCI = 0x0005,
+   /* reserved */
+   PCO_P_DSMIPv6_HA_ADDR   = 0x0007,
+   PCO_P_DSMIPv6_HN_PREF   = 0x0008,
+   PCO_P_DSMIPv6_v4_HA_ADDR= 0x0009,
+   PCO_P_IP_ADDR_VIA_NAS   = 0x000a,   /* only MS->Network */
+   PCO_P_IPv4_ADDR_VIA_DHCP= 0x000b,   /* only MS->Netowrk */
+   PCO_P_PCSCF_IPv4_ADDR   = 0x000c,
+   PCO_P_DNS_IPv4_ADDR = 0x000d,
+   PCO_P_MSISDN= 0x000e,
+   PCO_P_IFOM_SUPPORT  = 0x000f,
+   PCO_P_IPv4_LINK_MTU = 0x0010,
+   PCO_P_MS_SUPP_LOC_A_TFT = 0x0011,
+   PCO_P_PCSCF_RESEL_SUP   = 0x0012,   /* only MS->Network */
+   PCO_P_NBIFOM_REQ= 0x0013,
+   PCO_P_NBIFOM_MODE   = 0x0014,
+   PCO_P_NONIP_LINK_MTU= 0x0015,
+   PCO_P_APN_RATE_CTRL_SUP = 0x0016,
+   PCO_P_PS_DATA_OFF_UE= 0x0017,
+   PCO_P_REL_DATA_SVC  = 0x0018,
+};
+
+/* determine if PCO contains given protocol */
+static bool pco_contains_proto(struct ul255_t *pco, uint16_t prot)
+{
+   uint8_t *cur = pco->v + 1;
+
+   /* iterate over PCO and check if protocol contained */
+   while (cur + 2 < pco->v + pco->l) {
+   uint16_t cur_prot = osmo_load16be(cur);
+   uint8_t cur_len = cur[2];
+   if (cur_prot == prot)
+   return true;
+   if (cur_len == 0)
+   break;
+   cur += cur_len;
+   }
+   return false;
+}
+
+/* determine if PDP context has IPv6 support */
+static bool pdp_has_v4(struct pdp_t *pdp)
+{
+   if (pdp->eua.l == 4+2)
+   return true;
+   else
+   return false;
+}
+
+/* process one PCO request from a MS/UE, putting together the proper responses 
*/
+static void process_pco(struct pdp_t *pdp)
+{
+   struct msgb *msg = msgb_alloc(256, "PCO");
+   msgb_put_u8(msg, 0x80); /* ext-bit + configuration protocol byte */
+
+   /* FIXME: also check if primary / secondary DNS was requested */
+   if (pdp_has_v4(pdp) && pco_contains_proto(>pco_req, PCO_P_IPCP)) {
+   /* FIXME: properly implement this for IPCP */
+   uint8_t *cur = msgb_put(msg, pco.l-1);
+   memcpy(cur, pco.v+1, pco.l-1);
+   }
+
+   if (pco_contains_proto(>pco_req, PCO_P_DNS_IPv6_ADDR)) {
+   if (dns1.len == 16)
+   msgb_t16lv_put(msg, PCO_P_DNS_IPv6_ADDR, dns1.len, 
dns1.v6.s6_addr);
+   if (dns2.len == 16)
+   msgb_t16lv_put(msg, PCO_P_DNS_IPv6_ADDR, dns2.len, 
dns2.v6.s6_addr);
+   }
+
+   if (pco_contains_proto(>pco_req, PCO_P_DNS_IPv4_ADDR)) {
+   if (dns1.len == 4)
+   msgb_t16lv_put(msg, PCO_P_DNS_IPv4_ADDR, dns1.len, 
(uint8_t *));
+   if (dns2.len == 4)
+

[MERGED] openggsn[master]: IPv6: Implement IPv6 prefix assignment via ICMPv6 router adv...

2017-08-11 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: IPv6: Implement IPv6 prefix assignment via ICMPv6 router 
advertisement
..


IPv6: Implement IPv6 prefix assignment via ICMPv6 router advertisement

The 3GPP specs are quite strange when it comes to how an IPv6 address
or rather prefix is assigned to an IPv6 PDP context.  The designated
method for allocating the IPv6 address via the PDP EUA (End User
Address) Information Element in the GTP signalling plane is *not*
used to allocate the address/prefix.  Instead, the EUA is used to
allocate an "interface identifier" to the MS, which it the uses
to derive its link-local source address to send a router solicitation.

The GGSN subsequently answers witha router advertisement, advertising
a single/64 prefix, whihcthe MS then uses to generate it's real IPv6
source address for subsequent communication.

Change-Id: Icddf7d30e01d76a4784bcef5787b36f52f703a9f
---
M ggsn/Makefile.am
A ggsn/checksum.c
A ggsn/checksum.h
M ggsn/ggsn.c
A ggsn/icmpv6.c
A ggsn/icmpv6.h
M lib/debug.c
M lib/syserr.h
8 files changed, 510 insertions(+), 2 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/ggsn/Makefile.am b/ggsn/Makefile.am
index 3ad3a6e..c945f0b 100644
--- a/ggsn/Makefile.am
+++ b/ggsn/Makefile.am
@@ -12,7 +12,7 @@
 endif
 
 ggsn_DEPENDENCIES = ../gtp/libgtp.la ../lib/libmisc.a
-ggsn_SOURCES = ggsn.c cmdline.c cmdline.h gtp-kernel.h
+ggsn_SOURCES = ggsn.c cmdline.c cmdline.h gtp-kernel.h icmpv6.c icmpv6.h 
checksum.c checksum.h
 
 if ENABLE_GTP_KERNEL
 ggsn_SOURCES += gtp-kernel.c
diff --git a/ggsn/checksum.c b/ggsn/checksum.c
new file mode 100644
index 000..4b23897
--- /dev/null
+++ b/ggsn/checksum.c
@@ -0,0 +1,211 @@
+/*
+ *
+ * INETAn implementation of the TCP/IP protocol suite for the 
LINUX
+ * operating system.  INET is implemented using the  BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * IP/TCP/UDP checksumming routines
+ *
+ * Authors:Jorge Cwik, 
+ * Arnt Gulbrandsen, 
+ * Tom May, 
+ * Andreas Schwab, 
+ * Lots of code moved from tcp.c and ip.c; see those files
+ * for more names.
+ *
+ * 03/02/96Jes Sorensen, Andreas Schwab, Roman Hodek:
+ * Fixed some nasty bugs, causing some horrible crashes.
+ * A: At some points, the sum (%0) was used as
+ * length-counter instead of the length counter
+ * (%1). Thanks to Roman Hodek for pointing this out.
+ * B: GCC seems to mess up if one uses too many
+ * data-registers to hold input values and one tries to
+ * specify d0 and d1 as scratch registers. Letting gcc
+ * choose these registers itself solves the problem.
+ *
+ * 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.
+ */
+
+/* Revised by Kenneth Albanowski for m68knommu. Basic problem: unaligned access
+ kills, so most of the assembly has to go. */
+
+#if defined(__FreeBSD__)
+#define _KERNEL/* needed on FreeBSD 10.x for s6_addr32 */
+#include 
+#include 
+#include 
+#endif
+
+#include "checksum.h"
+#include 
+
+static inline unsigned short from32to16(unsigned int x)
+{
+   /* add up 16-bit and 16-bit for 16+c bit */
+   x = (x & 0x) + (x >> 16);
+   /* add up carry.. */
+   x = (x & 0x) + (x >> 16);
+   return x;
+}
+
+static unsigned int do_csum(const unsigned char *buff, int len)
+{
+   int odd;
+   unsigned int result = 0;
+
+   if (len <= 0)
+   goto out;
+   odd = 1 & (unsigned long) buff;
+   if (odd) {
+#if BYTE_ORDER == LITTLE_ENDIAN
+   result += (*buff << 8);
+#else
+   result = *buff;
+#endif
+   len--;
+   buff++;
+   }
+   if (len >= 2) {
+   if (2 & (unsigned long) buff) {
+   result += *(unsigned short *) buff;
+   len -= 2;
+   buff += 2;
+   }
+   if (len >= 4) {
+   const unsigned char *end = buff + ((unsigned)len & ~3);
+   unsigned int carry = 0;
+   do {
+   unsigned int w = *(unsigned int *) buff;
+   buff += 4;
+   result += carry;
+   result += w;
+   carry = (w > result);
+

[PATCH] openbsc[master]: libmsc: use new smpp34 esm_class definitions

2017-08-11 Thread Pablo Neira Ayuso

Review at  https://gerrit.osmocom.org/3474

libmsc: use new smpp34 esm_class definitions

Replace magic numbers by esm_class definitions.

Change-Id: I6c458690da60c8f3637680efbd718f6e8c6feb4c
---
M openbsc/src/libmsc/smpp_openbsc.c
1 file changed, 8 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/74/3474/1

diff --git a/openbsc/src/libmsc/smpp_openbsc.c 
b/openbsc/src/libmsc/smpp_openbsc.c
index 7e23abd..ddb24b5 100644
--- a/openbsc/src/libmsc/smpp_openbsc.c
+++ b/openbsc/src/libmsc/smpp_openbsc.c
@@ -157,14 +157,13 @@
osmo_strlcpy(sms->src.addr, (char *)submit->source_addr,
 sizeof(sms->src.addr));
 
-   /* This is a Delivery Acknowledgment. */
-   if (submit->esm_class == 0x08)
+   if (submit->esm_class == SMPP34_DELIVERY_ACK)
sms->is_report = true;
 
-   if (submit->esm_class & 0x40)
+   if (submit->esm_class & SMPP34_UDHI_IND)
sms->ud_hdr_ind = 1;
 
-   if (submit->esm_class & 0x80) {
+   if (submit->esm_class & SMPP34_REPLY_PATH) {
sms->reply_path_req = 1;
 #warning Implement reply path
}
@@ -240,7 +239,7 @@
sms->smpp.esme = esme;
sms->protocol_id = submit->protocol_id;
 
-   switch (submit->esm_class & 3) {
+   switch (submit->esm_class & SMPP34_MSG_MODE_MASK) {
case 0: /* default */
case 1: /* datagram */
case 3: /* store-and-forward */
@@ -664,16 +663,15 @@
memcpy(deliver.destination_addr, sms->dst.addr,
sizeof(deliver.destination_addr));
 
-   /* Short message contains a delivery receipt? Sect. 5.2.12. */
if (sms->is_report)
-   deliver.esm_class = 0x04;
+   deliver.esm_class = SMPP34_DELIVERY_RECEIPT;
else
-   deliver.esm_class = 1;  /* datagram mode */
+   deliver.esm_class = SMPP34_DATAGRAM_MODE;
 
if (sms->ud_hdr_ind)
-   deliver.esm_class |= 0x40;
+   deliver.esm_class |= SMPP34_UDHI_IND;
if (sms->reply_path_req)
-   deliver.esm_class |= 0x80;
+   deliver.esm_class |= SMPP34_REPLY_PATH;
 
deliver.protocol_id = sms->protocol_id;
deliver.priority_flag   = 0;

-- 
To view, visit https://gerrit.osmocom.org/3474
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6c458690da60c8f3637680efbd718f6e8c6feb4c
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Pablo Neira Ayuso 


openggsn[master]: Support setting TUN device IPv6 address + prefix

2017-08-11 Thread Harald Welte

Patch Set 9: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/3408
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I899d21e52d02e0b8384af29ddd489ff19c8f2cf6
Gerrit-PatchSet: 9
Gerrit-Project: openggsn
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[MERGED] openggsn[master]: IPv6: in46_addr: OSMO_ASSERT() in case of unsupported calls

2017-08-11 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: IPv6: in46_addr: OSMO_ASSERT() in case of unsupported calls
..


IPv6: in46_addr: OSMO_ASSERT() in case of unsupported calls

There's a bit of trickery with the ip_pool and it's "lengty=8" IPv6
prefix handling, let's make sure we don't accidentially call any
support functions with addresses of wrong length.

Change-Id: I444c190bdcd18780344e1f0dad4faf3bcf9da5a5
---
M lib/in46_addr.c
1 file changed, 6 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/lib/in46_addr.c b/lib/in46_addr.c
index 1785377..8f5cc09 100644
--- a/lib/in46_addr.c
+++ b/lib/in46_addr.c
@@ -11,6 +11,8 @@
 
 #include "../lib/in46_addr.h"
 
+#include 
+
 #include 
 #include 
 #include 
@@ -29,6 +31,7 @@
case 16:
return AF_INET6;
default:
+   OSMO_ASSERT(0);
return -1;
}
 }
@@ -49,6 +52,7 @@
sin6->sin6_addr = in->v6;
break;
default:
+   OSMO_ASSERT(0);
return -1;
}
 
@@ -161,6 +165,7 @@
create_ipv6_netmask(, prefixlen);
return ipv6_within_mask(>v6, >v6, );
default:
+   OSMO_ASSERT(0);
return 0;
}
 }
@@ -184,6 +189,7 @@
memcpy(>v[2], >v6, 16);   /* Copy a 16 byte 
address */
break;
default:
+   OSMO_ASSERT(0);
return -1;
}
return 0;

-- 
To view, visit https://gerrit.osmocom.org/3460
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I444c190bdcd18780344e1f0dad4faf3bcf9da5a5
Gerrit-PatchSet: 3
Gerrit-Project: openggsn
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[MERGED] openggsn[master]: Support setting TUN device IPv6 address + prefix

2017-08-11 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: Support setting TUN device IPv6 address + prefix
..


Support setting TUN device IPv6 address + prefix

As we can now have PDP contexts with IPv6 user IP payload,
it is useful to extend the TUN related code to be able to
configure the tun device IPv6 address + prefix length

Change-Id: I899d21e52d02e0b8384af29ddd489ff19c8f2cf6
---
M ggsn/ggsn.c
M lib/tun.c
M lib/tun.h
3 files changed, 127 insertions(+), 19 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c
index 991b54c..05a56ae 100644
--- a/ggsn/ggsn.c
+++ b/ggsn/ggsn.c
@@ -70,7 +70,7 @@
 int maxfd = 0; /* For select()*/
 
 struct in_addr listen_;
-struct in_addr netaddr, destaddr, net; /* Network interface   */
+struct in46_addr netaddr, destaddr, net;   /* Network interface   */
 size_t prefixlen;
 struct in46_addr dns1, dns2;   /* PCO DNS address */
 char *ipup, *ipdown;   /* Filename of scripts */
@@ -547,16 +547,16 @@
/* net  */
/* Store net as in_addr net and mask*/
if (args_info.net_arg) {
-   struct in46_addr in46;
-   if (ippool_aton(, , args_info.net_arg, 0)) {
+   if (ippool_aton(, , args_info.net_arg, 0)) {
SYS_ERR(DGGSN, LOGL_ERROR, 0,
"Invalid network address: %s!",
args_info.net_arg);
exit(1);
}
-   net.s_addr = in46.v4.s_addr;
-   netaddr.s_addr = htonl(ntohl(net.s_addr) + 1);
-   destaddr.s_addr = htonl(ntohl(net.s_addr) + 1);
+   /* default for network + destination address = net + 1 */
+   netaddr = net;
+   in46a_inc();
+   destaddr = netaddr;
} else {
SYS_ERR(DGGSN, LOGL_ERROR, 0,
"Network address must be specified: %s!",
@@ -710,7 +710,7 @@
maxfd = gsn->fd1u;
 
/* use GTP kernel module for data packet encapsulation */
-   if (gtp_kernel_init(gsn, , prefixlen, _info) < 0)
+   if (gtp_kernel_init(gsn, , prefixlen, _info) < 0)
goto err;
 
gtp_set_cb_data_ind(gsn, encaps_tun);
@@ -735,7 +735,7 @@
}
 
DEBUGP(DGGSN, "Setting tun IP address\n");
-   if (tun_setaddr(tun, , , )) {
+   if (tun_setaddr(tun, , , prefixlen)) {
SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to set tun IP address");
exit(1);
}
diff --git a/lib/tun.c b/lib/tun.c
index 8325f5d..11ea7bc 100644
--- a/lib/tun.c
+++ b/lib/tun.c
@@ -1,6 +1,7 @@
 /* 
  * TUN interface functions.
  * Copyright (C) 2002, 2003, 2004 Mondru AB.
+ * Copyright (C) 2017 by Harald Welte 
  * 
  * The contents of this file may be used under the terms of the GNU
  * General Public License Version 2, provided that the above copyright
@@ -37,16 +38,17 @@
 #include 
 #include 
 #include 
+#include 
 
 #if defined(__linux__)
-#include 
 #include 
 #include 
 #include 
 
 #elif defined (__FreeBSD__)
-#include 
 #include 
+#include 
+#include 
 
 #elif defined (__APPLE__)
 #include 
@@ -65,7 +67,12 @@
 #include "tun.h"
 #include "syserr.h"
 
+static int tun_setaddr4(struct tun_t *this, struct in_addr *addr,
+   struct in_addr *dstaddr, struct in_addr *netmask);
+
 #if defined(__linux__)
+
+#include 
 
 int tun_nlattr(struct nlmsghdr *n, int nsize, int type, void *d, int dlen)
 {
@@ -247,7 +254,7 @@
struct msghdr msg;
 
if (!this->addrs)   /* Use ioctl for first addr to make ping work */
-   return tun_setaddr(this, addr, dstaddr, netmask);
+   return tun_setaddr4(this, addr, dstaddr, netmask);
 
memset(, 0, sizeof(req));
req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifaddrmsg));
@@ -345,7 +352,7 @@
 
/* TODO: Is this needed on FreeBSD? */
if (!this->addrs)   /* Use ioctl for first addr to make ping work */
-   return tun_setaddr(this, addr, dstaddr, netmask);   /* TODO 
dstaddr */
+   return tun_setaddr4(this, addr, dstaddr, netmask);  /* TODO 
dstaddr */
 
memset(, 0, sizeof(areq));
 
@@ -391,7 +398,7 @@
 #elif defined (__sun__)
 
if (!this->addrs)   /* Use ioctl for first addr to make ping work */
-   return tun_setaddr(this, addr, dstaddr, netmask);
+   return tun_setaddr4(this, addr, dstaddr, netmask);
 
SYS_ERR(DTUN, LOGL_ERROR, errno,
"Setting multiple addresses not possible on Solaris");
@@ -403,9 +410,8 @@
 
 }
 
-int tun_setaddr(struct tun_t *this,
-   struct in_addr *addr,
-   

openbsc[master]: libmsc: use smpp34_tlv_for_each() to avoid suboptimal TLV ha...

2017-08-11 Thread Pablo Neira Ayuso

Patch Set 2:

Build breaks because this patch depends on a patch in libsmpp34.

-- 
To view, visit https://gerrit.osmocom.org/3470
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I53a65164a6cc4abc6bf57d9a8dc275cf21c90222
Gerrit-PatchSet: 2
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Pablo Neira Ayuso 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pablo Neira Ayuso 
Gerrit-HasComments: No


[PATCH] libsmpp34[master]: add esm_class definitions

2017-08-11 Thread Pablo Neira Ayuso

Review at  https://gerrit.osmocom.org/3473

add esm_class definitions

Add special message attributes definitions that are associated with the
short message. Thus, we can get rid of magic numbers in our codebase.

Change-Id: I91afd8b462b8fd3b2c4c5b54f4eeb7ec5b730b65
---
M src/smpp34.h
1 file changed, 11 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libsmpp34 refs/changes/73/3473/1

diff --git a/src/smpp34.h b/src/smpp34.h
index 5fb6395..b114ba7 100644
--- a/src/smpp34.h
+++ b/src/smpp34.h
@@ -204,4 +204,15 @@
 #define TLVID_its_reply_type  0x1380 /* CDMA */
 #define TLVID_its_session_info0x1383 /* CDMA */
 
+/* As defined by SMPP 3.4, Sect. 5.2.12 Parameter Definition esm_class. */
+enum smpp34_esm_class {
+   SMPP34_DATAGRAM_MODE= 0x01,
+   SMPP34_DELIVERY_RECEIPT = 0x04,
+   SMPP34_DELIVERY_ACK = 0x08,
+   SMPP34_UDHI_IND = 0x40,
+   SMPP34_REPLY_PATH   = 0x80,
+};
+
+#define SMPP34_MSG_MODE_MASK   0x03
+
 #endif

-- 
To view, visit https://gerrit.osmocom.org/3473
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I91afd8b462b8fd3b2c4c5b54f4eeb7ec5b730b65
Gerrit-PatchSet: 1
Gerrit-Project: libsmpp34
Gerrit-Branch: master
Gerrit-Owner: Pablo Neira Ayuso 


[PATCH] openggsn[master]: Support setting TUN device IPv6 address + prefix

2017-08-11 Thread Harald Welte
Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

https://gerrit.osmocom.org/3408

to look at the new patch set (#9).

Support setting TUN device IPv6 address + prefix

As we can now have PDP contexts with IPv6 user IP payload,
it is useful to extend the TUN related code to be able to
configure the tun device IPv6 address + prefix length

Change-Id: I899d21e52d02e0b8384af29ddd489ff19c8f2cf6
---
M ggsn/ggsn.c
M lib/tun.c
M lib/tun.h
3 files changed, 127 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/08/3408/9

diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c
index 991b54c..05a56ae 100644
--- a/ggsn/ggsn.c
+++ b/ggsn/ggsn.c
@@ -70,7 +70,7 @@
 int maxfd = 0; /* For select()*/
 
 struct in_addr listen_;
-struct in_addr netaddr, destaddr, net; /* Network interface   */
+struct in46_addr netaddr, destaddr, net;   /* Network interface   */
 size_t prefixlen;
 struct in46_addr dns1, dns2;   /* PCO DNS address */
 char *ipup, *ipdown;   /* Filename of scripts */
@@ -547,16 +547,16 @@
/* net  */
/* Store net as in_addr net and mask*/
if (args_info.net_arg) {
-   struct in46_addr in46;
-   if (ippool_aton(, , args_info.net_arg, 0)) {
+   if (ippool_aton(, , args_info.net_arg, 0)) {
SYS_ERR(DGGSN, LOGL_ERROR, 0,
"Invalid network address: %s!",
args_info.net_arg);
exit(1);
}
-   net.s_addr = in46.v4.s_addr;
-   netaddr.s_addr = htonl(ntohl(net.s_addr) + 1);
-   destaddr.s_addr = htonl(ntohl(net.s_addr) + 1);
+   /* default for network + destination address = net + 1 */
+   netaddr = net;
+   in46a_inc();
+   destaddr = netaddr;
} else {
SYS_ERR(DGGSN, LOGL_ERROR, 0,
"Network address must be specified: %s!",
@@ -710,7 +710,7 @@
maxfd = gsn->fd1u;
 
/* use GTP kernel module for data packet encapsulation */
-   if (gtp_kernel_init(gsn, , prefixlen, _info) < 0)
+   if (gtp_kernel_init(gsn, , prefixlen, _info) < 0)
goto err;
 
gtp_set_cb_data_ind(gsn, encaps_tun);
@@ -735,7 +735,7 @@
}
 
DEBUGP(DGGSN, "Setting tun IP address\n");
-   if (tun_setaddr(tun, , , )) {
+   if (tun_setaddr(tun, , , prefixlen)) {
SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to set tun IP address");
exit(1);
}
diff --git a/lib/tun.c b/lib/tun.c
index 8325f5d..11ea7bc 100644
--- a/lib/tun.c
+++ b/lib/tun.c
@@ -1,6 +1,7 @@
 /* 
  * TUN interface functions.
  * Copyright (C) 2002, 2003, 2004 Mondru AB.
+ * Copyright (C) 2017 by Harald Welte 
  * 
  * The contents of this file may be used under the terms of the GNU
  * General Public License Version 2, provided that the above copyright
@@ -37,16 +38,17 @@
 #include 
 #include 
 #include 
+#include 
 
 #if defined(__linux__)
-#include 
 #include 
 #include 
 #include 
 
 #elif defined (__FreeBSD__)
-#include 
 #include 
+#include 
+#include 
 
 #elif defined (__APPLE__)
 #include 
@@ -65,7 +67,12 @@
 #include "tun.h"
 #include "syserr.h"
 
+static int tun_setaddr4(struct tun_t *this, struct in_addr *addr,
+   struct in_addr *dstaddr, struct in_addr *netmask);
+
 #if defined(__linux__)
+
+#include 
 
 int tun_nlattr(struct nlmsghdr *n, int nsize, int type, void *d, int dlen)
 {
@@ -247,7 +254,7 @@
struct msghdr msg;
 
if (!this->addrs)   /* Use ioctl for first addr to make ping work */
-   return tun_setaddr(this, addr, dstaddr, netmask);
+   return tun_setaddr4(this, addr, dstaddr, netmask);
 
memset(, 0, sizeof(req));
req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifaddrmsg));
@@ -345,7 +352,7 @@
 
/* TODO: Is this needed on FreeBSD? */
if (!this->addrs)   /* Use ioctl for first addr to make ping work */
-   return tun_setaddr(this, addr, dstaddr, netmask);   /* TODO 
dstaddr */
+   return tun_setaddr4(this, addr, dstaddr, netmask);  /* TODO 
dstaddr */
 
memset(, 0, sizeof(areq));
 
@@ -391,7 +398,7 @@
 #elif defined (__sun__)
 
if (!this->addrs)   /* Use ioctl for first addr to make ping work */
-   return tun_setaddr(this, addr, dstaddr, netmask);
+   return tun_setaddr4(this, addr, dstaddr, netmask);
 
SYS_ERR(DTUN, LOGL_ERROR, errno,
"Setting multiple addresses not possible on Solaris");
@@ -403,9 +410,8 @@
 
 }
 
-int tun_setaddr(struct tun_t *this,
-   struct in_addr *addr,
-   struct in_addr *dstaddr, struct in_addr 

openggsn[master]: IPv6: in46_addr: OSMO_ASSERT() in case of unsupported calls

2017-08-11 Thread Harald Welte

Patch Set 3: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/3460
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I444c190bdcd18780344e1f0dad4faf3bcf9da5a5
Gerrit-PatchSet: 3
Gerrit-Project: openggsn
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


openggsn[master]: IPv6: Support PCO for IPv6 DNS addresses

2017-08-11 Thread Harald Welte

Patch Set 3: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/3459
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I21499afd61def8c925f7838bde76f34d28214b56
Gerrit-PatchSet: 3
Gerrit-Project: openggsn
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


openggsn[master]: IPv6: Implement IPv6 prefix assignment via ICMPv6 router adv...

2017-08-11 Thread Harald Welte

Patch Set 3: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/3458
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Icddf7d30e01d76a4784bcef5787b36f52f703a9f
Gerrit-PatchSet: 3
Gerrit-Project: openggsn
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


openbsc[master]: libmsc: update database to accomodate SMS status-report fields

2017-08-11 Thread Pablo Neira Ayuso

Patch Set 4:

Agreed.

So let it sink by when the NITB code becomes officially dead.

Thanks!

-- 
To view, visit https://gerrit.osmocom.org/3435
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I7276d356d805a83ebeec72b02c8563b7135ea0b6
Gerrit-PatchSet: 4
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Pablo Neira Ayuso 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Holger Freyther 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Keith Whyte 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pablo Neira Ayuso 
Gerrit-HasComments: No


[PATCH] openggsn[master]: tun_new(): Fix array overflow in FreeBSD related code

2017-08-11 Thread Harald Welte

Review at  https://gerrit.osmocom.org/3472

tun_new(): Fix array overflow in FreeBSD related code

Change-Id: I096e3b614e82e402886163274cfcf9355bd57580
---
M lib/tun.c
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/72/3472/1

diff --git a/lib/tun.c b/lib/tun.c
index 717da88..767052f 100644
--- a/lib/tun.c
+++ b/lib/tun.c
@@ -786,7 +786,7 @@
}
 
snprintf((*tun)->devname, sizeof((*tun)->devname), "tun%d", devnum);
-   (*tun)->devname[sizeof((*tun)->devname)] = 0;
+   (*tun)->devname[sizeof((*tun)->devname)-1] = 0;
 
/* The tun device we found might have "old" IP addresses allocated */
/* We need to delete those. This problem is not present on Linux */

-- 
To view, visit https://gerrit.osmocom.org/3472
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I096e3b614e82e402886163274cfcf9355bd57580
Gerrit-PatchSet: 1
Gerrit-Project: openggsn
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[PATCH] openggsn[master]: replace hand-coded tun_gifindex() with standard POSIX if_nam...

2017-08-11 Thread Harald Welte

Review at  https://gerrit.osmocom.org/3471

replace hand-coded tun_gifindex() with standard POSIX if_nametoindex()

Change-Id: I738472765ab09f530dcf071455e1bb4e6fb3f6e5
---
M lib/tun.c
1 file changed, 3 insertions(+), 25 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/71/3471/1

diff --git a/lib/tun.c b/lib/tun.c
index 205d39a..717da88 100644
--- a/lib/tun.c
+++ b/lib/tun.c
@@ -89,30 +89,6 @@
n->nlmsg_len = alen + len;
return 0;
 }
-
-int tun_gifindex(struct tun_t *this, __u32 * index)
-{
-   struct ifreq ifr;
-   int fd;
-
-   memset(, '\0', sizeof(ifr));
-   ifr.ifr_addr.sa_family = AF_INET;
-   ifr.ifr_dstaddr.sa_family = AF_INET;
-   ifr.ifr_netmask.sa_family = AF_INET;
-   strncpy(ifr.ifr_name, this->devname, IFNAMSIZ);
-   ifr.ifr_name[IFNAMSIZ - 1] = 0; /* Make sure to terminate */
-   if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
-   SYS_ERR(DTUN, LOGL_ERROR, errno, "socket() failed");
-   }
-   if (ioctl(fd, SIOCGIFINDEX, )) {
-   SYS_ERR(DTUN, LOGL_ERROR, errno, "ioctl() failed");
-   close(fd);
-   return -1;
-   }
-   close(fd);
-   *index = ifr.ifr_ifindex;
-   return 0;
-}
 #endif
 
 int tun_sifflags(struct tun_t *this, int flags)
@@ -266,7 +242,9 @@
req.i.ifa_prefixlen = 32;   /* 32 FOR IPv4 */
req.i.ifa_flags = 0;
req.i.ifa_scope = RT_SCOPE_HOST;/* TODO or 0 */
-   if (tun_gifindex(this, _index)) {
+   req.i.ifa_index = if_nametoindex(this->devname);
+   if (!req.i.ifa_index) {
+   SYS_ERR(DTUN, LOGL_ERROR, errno, "Unable to get ifindex for 
%s", this->devname);
return -1;
}
 

-- 
To view, visit https://gerrit.osmocom.org/3471
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I738472765ab09f530dcf071455e1bb4e6fb3f6e5
Gerrit-PatchSet: 1
Gerrit-Project: openggsn
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[PATCH] openggsn[master]: Support setting TUN device IPv6 address + prefix

2017-08-11 Thread Harald Welte
Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

https://gerrit.osmocom.org/3408

to look at the new patch set (#8).

Support setting TUN device IPv6 address + prefix

As we can now have PDP contexts with IPv6 user IP payload,
it is useful to extend the TUN related code to be able to
configure the tun device IPv6 address + prefix length

Change-Id: I899d21e52d02e0b8384af29ddd489ff19c8f2cf6
---
M ggsn/ggsn.c
M lib/tun.c
M lib/tun.h
3 files changed, 127 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/08/3408/8

diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c
index 991b54c..05a56ae 100644
--- a/ggsn/ggsn.c
+++ b/ggsn/ggsn.c
@@ -70,7 +70,7 @@
 int maxfd = 0; /* For select()*/
 
 struct in_addr listen_;
-struct in_addr netaddr, destaddr, net; /* Network interface   */
+struct in46_addr netaddr, destaddr, net;   /* Network interface   */
 size_t prefixlen;
 struct in46_addr dns1, dns2;   /* PCO DNS address */
 char *ipup, *ipdown;   /* Filename of scripts */
@@ -547,16 +547,16 @@
/* net  */
/* Store net as in_addr net and mask*/
if (args_info.net_arg) {
-   struct in46_addr in46;
-   if (ippool_aton(, , args_info.net_arg, 0)) {
+   if (ippool_aton(, , args_info.net_arg, 0)) {
SYS_ERR(DGGSN, LOGL_ERROR, 0,
"Invalid network address: %s!",
args_info.net_arg);
exit(1);
}
-   net.s_addr = in46.v4.s_addr;
-   netaddr.s_addr = htonl(ntohl(net.s_addr) + 1);
-   destaddr.s_addr = htonl(ntohl(net.s_addr) + 1);
+   /* default for network + destination address = net + 1 */
+   netaddr = net;
+   in46a_inc();
+   destaddr = netaddr;
} else {
SYS_ERR(DGGSN, LOGL_ERROR, 0,
"Network address must be specified: %s!",
@@ -710,7 +710,7 @@
maxfd = gsn->fd1u;
 
/* use GTP kernel module for data packet encapsulation */
-   if (gtp_kernel_init(gsn, , prefixlen, _info) < 0)
+   if (gtp_kernel_init(gsn, , prefixlen, _info) < 0)
goto err;
 
gtp_set_cb_data_ind(gsn, encaps_tun);
@@ -735,7 +735,7 @@
}
 
DEBUGP(DGGSN, "Setting tun IP address\n");
-   if (tun_setaddr(tun, , , )) {
+   if (tun_setaddr(tun, , , prefixlen)) {
SYS_ERR(DGGSN, LOGL_ERROR, 0, "Failed to set tun IP address");
exit(1);
}
diff --git a/lib/tun.c b/lib/tun.c
index 8325f5d..205d39a 100644
--- a/lib/tun.c
+++ b/lib/tun.c
@@ -1,6 +1,7 @@
 /* 
  * TUN interface functions.
  * Copyright (C) 2002, 2003, 2004 Mondru AB.
+ * Copyright (C) 2017 by Harald Welte 
  * 
  * The contents of this file may be used under the terms of the GNU
  * General Public License Version 2, provided that the above copyright
@@ -37,6 +38,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #if defined(__linux__)
 #include 
@@ -47,6 +49,8 @@
 #elif defined (__FreeBSD__)
 #include 
 #include 
+#include 
+#include 
 
 #elif defined (__APPLE__)
 #include 
@@ -65,7 +69,12 @@
 #include "tun.h"
 #include "syserr.h"
 
+static int tun_setaddr4(struct tun_t *this, struct in_addr *addr,
+   struct in_addr *dstaddr, struct in_addr *netmask);
+
 #if defined(__linux__)
+
+#include 
 
 int tun_nlattr(struct nlmsghdr *n, int nsize, int type, void *d, int dlen)
 {
@@ -247,7 +256,7 @@
struct msghdr msg;
 
if (!this->addrs)   /* Use ioctl for first addr to make ping work */
-   return tun_setaddr(this, addr, dstaddr, netmask);
+   return tun_setaddr4(this, addr, dstaddr, netmask);
 
memset(, 0, sizeof(req));
req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifaddrmsg));
@@ -345,7 +354,7 @@
 
/* TODO: Is this needed on FreeBSD? */
if (!this->addrs)   /* Use ioctl for first addr to make ping work */
-   return tun_setaddr(this, addr, dstaddr, netmask);   /* TODO 
dstaddr */
+   return tun_setaddr4(this, addr, dstaddr, netmask);  /* TODO 
dstaddr */
 
memset(, 0, sizeof(areq));
 
@@ -391,7 +400,7 @@
 #elif defined (__sun__)
 
if (!this->addrs)   /* Use ioctl for first addr to make ping work */
-   return tun_setaddr(this, addr, dstaddr, netmask);
+   return tun_setaddr4(this, addr, dstaddr, netmask);
 
SYS_ERR(DTUN, LOGL_ERROR, errno,
"Setting multiple addresses not possible on Solaris");
@@ -403,9 +412,8 @@
 
 }
 
-int tun_setaddr(struct tun_t *this,
-   struct in_addr *addr,
-   struct in_addr *dstaddr, struct in_addr *netmask)
+static int 

[PATCH] openggsn[master]: IPv6: Implement IPv6 prefix assignment via ICMPv6 router adv...

2017-08-11 Thread Harald Welte
Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

https://gerrit.osmocom.org/3458

to look at the new patch set (#3).

IPv6: Implement IPv6 prefix assignment via ICMPv6 router advertisement

The 3GPP specs are quite strange when it comes to how an IPv6 address
or rather prefix is assigned to an IPv6 PDP context.  The designated
method for allocating the IPv6 address via the PDP EUA (End User
Address) Information Element in the GTP signalling plane is *not*
used to allocate the address/prefix.  Instead, the EUA is used to
allocate an "interface identifier" to the MS, which it the uses
to derive its link-local source address to send a router solicitation.

The GGSN subsequently answers witha router advertisement, advertising
a single/64 prefix, whihcthe MS then uses to generate it's real IPv6
source address for subsequent communication.

Change-Id: Icddf7d30e01d76a4784bcef5787b36f52f703a9f
---
M ggsn/Makefile.am
A ggsn/checksum.c
A ggsn/checksum.h
M ggsn/ggsn.c
A ggsn/icmpv6.c
A ggsn/icmpv6.h
M lib/debug.c
M lib/syserr.h
8 files changed, 510 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/58/3458/3

diff --git a/ggsn/Makefile.am b/ggsn/Makefile.am
index 3ad3a6e..c945f0b 100644
--- a/ggsn/Makefile.am
+++ b/ggsn/Makefile.am
@@ -12,7 +12,7 @@
 endif
 
 ggsn_DEPENDENCIES = ../gtp/libgtp.la ../lib/libmisc.a
-ggsn_SOURCES = ggsn.c cmdline.c cmdline.h gtp-kernel.h
+ggsn_SOURCES = ggsn.c cmdline.c cmdline.h gtp-kernel.h icmpv6.c icmpv6.h 
checksum.c checksum.h
 
 if ENABLE_GTP_KERNEL
 ggsn_SOURCES += gtp-kernel.c
diff --git a/ggsn/checksum.c b/ggsn/checksum.c
new file mode 100644
index 000..4b23897
--- /dev/null
+++ b/ggsn/checksum.c
@@ -0,0 +1,211 @@
+/*
+ *
+ * INETAn implementation of the TCP/IP protocol suite for the 
LINUX
+ * operating system.  INET is implemented using the  BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * IP/TCP/UDP checksumming routines
+ *
+ * Authors:Jorge Cwik, 
+ * Arnt Gulbrandsen, 
+ * Tom May, 
+ * Andreas Schwab, 
+ * Lots of code moved from tcp.c and ip.c; see those files
+ * for more names.
+ *
+ * 03/02/96Jes Sorensen, Andreas Schwab, Roman Hodek:
+ * Fixed some nasty bugs, causing some horrible crashes.
+ * A: At some points, the sum (%0) was used as
+ * length-counter instead of the length counter
+ * (%1). Thanks to Roman Hodek for pointing this out.
+ * B: GCC seems to mess up if one uses too many
+ * data-registers to hold input values and one tries to
+ * specify d0 and d1 as scratch registers. Letting gcc
+ * choose these registers itself solves the problem.
+ *
+ * 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.
+ */
+
+/* Revised by Kenneth Albanowski for m68knommu. Basic problem: unaligned access
+ kills, so most of the assembly has to go. */
+
+#if defined(__FreeBSD__)
+#define _KERNEL/* needed on FreeBSD 10.x for s6_addr32 */
+#include 
+#include 
+#include 
+#endif
+
+#include "checksum.h"
+#include 
+
+static inline unsigned short from32to16(unsigned int x)
+{
+   /* add up 16-bit and 16-bit for 16+c bit */
+   x = (x & 0x) + (x >> 16);
+   /* add up carry.. */
+   x = (x & 0x) + (x >> 16);
+   return x;
+}
+
+static unsigned int do_csum(const unsigned char *buff, int len)
+{
+   int odd;
+   unsigned int result = 0;
+
+   if (len <= 0)
+   goto out;
+   odd = 1 & (unsigned long) buff;
+   if (odd) {
+#if BYTE_ORDER == LITTLE_ENDIAN
+   result += (*buff << 8);
+#else
+   result = *buff;
+#endif
+   len--;
+   buff++;
+   }
+   if (len >= 2) {
+   if (2 & (unsigned long) buff) {
+   result += *(unsigned short *) buff;
+   len -= 2;
+   buff += 2;
+   }
+   if (len >= 4) {
+   const unsigned char *end = buff + ((unsigned)len & ~3);
+   unsigned int carry = 0;
+   do {
+   unsigned int w = *(unsigned int *) buff;
+   buff += 4;
+   result += carry;
+   result += w;
+   carry = (w > result);
+   } while (buff < end);
+   result += carry;
+  

openbsc[master]: libmsc: update database to accomodate SMS status-report fields

2017-08-11 Thread Holger Freyther

Patch Set 4:

> When would it be good time to remove code for backward
 > compatibility?
 > 
 > Holger added v3 by 2014-03-07, it's a bit more than 3 years now.

I don't know... let me try to build an opinion :)

* The nitb in the current form is deprecated anyway. So spending time to remove 
compat seems wasted?
* We have integration test support to migrate from version 3 up (e.g. 
tests/db/hlr.sqlite3)
* We don't seem to change schema frequently?

>From my point of view the code is not subject to bitrot, has little 
>maintenance requirement (have not touched it in quite some time) and will die 
>soon anyway. I wouldn't touch it now.

-- 
To view, visit https://gerrit.osmocom.org/3435
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I7276d356d805a83ebeec72b02c8563b7135ea0b6
Gerrit-PatchSet: 4
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Pablo Neira Ayuso 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Holger Freyther 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Keith Whyte 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pablo Neira Ayuso 
Gerrit-HasComments: No


[PATCH] openbsc[master]: libmsc: use smpp34_tlv_for_each() to avoid suboptimal TLV ha...

2017-08-11 Thread Pablo Neira Ayuso

libmsc: use smpp34_tlv_for_each() to avoid suboptimal TLV handling

submit_to_sms() now handles two TLVs, so find_tlv() is suboptiomal and
it can be removed, since it would result in two passes on the TLV list.
Use new smpp34_tlv_for_each() helper to iterate over the list of TLVs.

Change-Id: I53a65164a6cc4abc6bf57d9a8dc275cf21c90222
---
M openbsc/src/libmsc/smpp_openbsc.c
1 file changed, 41 insertions(+), 31 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/70/3470/2

diff --git a/openbsc/src/libmsc/smpp_openbsc.c 
b/openbsc/src/libmsc/smpp_openbsc.c
index 85de040..7e23abd 100644
--- a/openbsc/src/libmsc/smpp_openbsc.c
+++ b/openbsc/src/libmsc/smpp_openbsc.c
@@ -72,26 +72,31 @@
return subscr;
 }
 
-/*! \brief find a TLV with given tag in list of libsmpp34 TLVs */
-static struct tlv_t *find_tlv(struct tlv_t *head, uint16_t tag)
+static int smpp34_submit_tlv_msg_payload(const struct tlv_t *t,
+const struct submit_sm_t *submit,
+const uint8_t **sms_msg,
+unsigned int *sms_msg_len)
 {
-   struct tlv_t *t;
-
-   for (t = head; t != NULL; t = t->next) {
-   if (t->tag == tag)
-   return t;
+   if (submit->sm_length) {
+   LOGP(DLSMS, LOGL_ERROR,
+"SMPP cannot have payload in TLV _and_ in the header\n");
+   return -1;
}
-   return NULL;
+   *sms_msg = t->value.octet;
+   *sms_msg_len = t->length;
+
+   return 0;
 }
 
 /*! \brief convert from submit_sm_t to gsm_sms */
 static int submit_to_sms(struct gsm_sms **psms, struct gsm_network *net,
 const struct submit_sm_t *submit)
 {
+   const uint8_t *sms_msg = NULL;
struct gsm_subscriber *dest;
+   uint16_t msg_ref = 0;
struct gsm_sms *sms;
struct tlv_t *t;
-   const uint8_t *sms_msg;
unsigned int sms_msg_len;
int mode;
 
@@ -105,31 +110,40 @@
return ESME_RINVDSTADR;
}
 
-   t = find_tlv(submit->tlv, TLVID_message_payload);
-   if (t) {
-   if (submit->sm_length) {
-   /* ERROR: we cannot have both! */
-   LOGP(DLSMS, LOGL_ERROR, "SMPP Cannot have payload in "
-   "TLV _and_ in the header\n");
-   subscr_put(dest);
-   return ESME_ROPTPARNOTALLWD;
+   smpp34_tlv_for_each(t, submit->tlv) {
+   switch (t->tag) {
+   case TLVID_message_payload:
+   if (smpp34_submit_tlv_msg_payload(t, submit, _msg,
+ _msg_len) < 0) {
+   subscr_put(dest);
+   return ESME_ROPTPARNOTALLWD;
+   }
+   break;
+   case TLVID_user_message_reference:
+   msg_ref = ntohs(t->value.val16);
+   break;
+   default:
+   break;
}
-   sms_msg = t->value.octet;
-   sms_msg_len = t->length;
-   } else if (submit->sm_length > 0 && submit->sm_length < 255) {
-   sms_msg = submit->short_message;
-   sms_msg_len = submit->sm_length;
-   } else {
-   LOGP(DLSMS, LOGL_ERROR,
-   "SMPP neither message payload nor valid sm_length.\n");
-   subscr_put(dest);
-   return ESME_RINVPARLEN;
+   }
+
+   if (!sms_msg) {
+   if (submit->sm_length > 0 && submit->sm_length < 255) {
+   sms_msg = submit->short_message;
+   sms_msg_len = submit->sm_length;
+   } else {
+   LOGP(DLSMS, LOGL_ERROR,
+"SMPP neither message payload nor valid 
sm_length.\n");
+   subscr_put(dest);
+   return ESME_RINVPARLEN;
+   }
}
 
sms = sms_alloc();
sms->source = SMS_SOURCE_SMPP;
sms->smpp.sequence_nr = submit->sequence_number;
sms->status_rep_req = submit->registered_delivery;
+   sms->msg_ref = msg_ref;
 
/* fill in the destination address */
sms->receiver = dest;
@@ -203,10 +217,6 @@
memcpy(sms->user_data, sms_msg, sms_msg_len);
sms->user_data_len = sms_msg_len;
}
-
-   t = find_tlv(submit->tlv, TLVID_user_message_reference);
-   if (t)
-   sms->msg_ref = ntohs(t->value.val16);
 
*psms = sms;
return ESME_ROK;

-- 
To view, visit https://gerrit.osmocom.org/3470
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I53a65164a6cc4abc6bf57d9a8dc275cf21c90222
Gerrit-PatchSet: 2
Gerrit-Project: 

[PATCH] openbsc[master]: libmsc: use smpp34_tlv_for_each() to avoid suboptimal TLV ha...

2017-08-11 Thread Pablo Neira Ayuso

Review at  https://gerrit.osmocom.org/3470

libmsc: use smpp34_tlv_for_each() to avoid suboptimal TLV handling

submit_to_sms() now handles two TLVs, so find_tlv() is suboptiomal and
it can be removed, since it would result in two passes on the TLV list.
Use new smpp34_tlv_for_each() helper to iterate over the list of TLVs.

Change-Id: I53a65164a6cc4abc6bf57d9a8dc275cf21c90222
---
M openbsc/src/libmsc/smpp_openbsc.c
1 file changed, 41 insertions(+), 31 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/70/3470/1

diff --git a/openbsc/src/libmsc/smpp_openbsc.c 
b/openbsc/src/libmsc/smpp_openbsc.c
index 85de040..b2944a9 100644
--- a/openbsc/src/libmsc/smpp_openbsc.c
+++ b/openbsc/src/libmsc/smpp_openbsc.c
@@ -72,26 +72,31 @@
return subscr;
 }
 
-/*! \brief find a TLV with given tag in list of libsmpp34 TLVs */
-static struct tlv_t *find_tlv(struct tlv_t *head, uint16_t tag)
+static int smpp34_submit_tlv_msg_payload(const struct tlv_t *t,
+const struct submit_sm_t *submit,
+const uint8_t **sms_msg,
+unsigned int *sms_msg_len)
 {
-   struct tlv_t *t;
-
-   for (t = head; t != NULL; t = t->next) {
-   if (t->tag == tag)
-   return t;
+   if (submit->sm_length) {
+   LOGP(DLSMS, LOGL_ERROR,
+"SMPP cannot have payload in TLV _and_ in the header\n");
+   return -1;
}
-   return NULL;
+   *sms_msg = t->value.octet;
+   *sms_msg_len = t->length;
+
+   return 0;
 }
 
 /*! \brief convert from submit_sm_t to gsm_sms */
 static int submit_to_sms(struct gsm_sms **psms, struct gsm_network *net,
 const struct submit_sm_t *submit)
 {
+   const uint8_t *sms_msg = NULL;
struct gsm_subscriber *dest;
+   uint8_t msg_ref = 0;
struct gsm_sms *sms;
struct tlv_t *t;
-   const uint8_t *sms_msg;
unsigned int sms_msg_len;
int mode;
 
@@ -105,31 +110,40 @@
return ESME_RINVDSTADR;
}
 
-   t = find_tlv(submit->tlv, TLVID_message_payload);
-   if (t) {
-   if (submit->sm_length) {
-   /* ERROR: we cannot have both! */
-   LOGP(DLSMS, LOGL_ERROR, "SMPP Cannot have payload in "
-   "TLV _and_ in the header\n");
-   subscr_put(dest);
-   return ESME_ROPTPARNOTALLWD;
+   smpp34_tlv_for_each(t, submit->tlv) {
+   switch (t->tag) {
+   case TLVID_message_payload:
+   if (smpp34_submit_tlv_msg_payload(t, submit, _msg,
+ _msg_len) < 0) {
+   subscr_put(dest);
+   return ESME_ROPTPARNOTALLWD;
+   }
+   break;
+   case TLVID_user_message_reference:
+   msg_ref = ntohs(t->value.val16);
+   break;
+   default:
+   break;
}
-   sms_msg = t->value.octet;
-   sms_msg_len = t->length;
-   } else if (submit->sm_length > 0 && submit->sm_length < 255) {
-   sms_msg = submit->short_message;
-   sms_msg_len = submit->sm_length;
-   } else {
-   LOGP(DLSMS, LOGL_ERROR,
-   "SMPP neither message payload nor valid sm_length.\n");
-   subscr_put(dest);
-   return ESME_RINVPARLEN;
+   }
+
+   if (!sms_msg) {
+   if (submit->sm_length > 0 && submit->sm_length < 255) {
+   sms_msg = submit->short_message;
+   sms_msg_len = submit->sm_length;
+   } else {
+   LOGP(DLSMS, LOGL_ERROR,
+"SMPP neither message payload nor valid 
sm_length.\n");
+   subscr_put(dest);
+   return ESME_RINVPARLEN;
+   }
}
 
sms = sms_alloc();
sms->source = SMS_SOURCE_SMPP;
sms->smpp.sequence_nr = submit->sequence_number;
sms->status_rep_req = submit->registered_delivery;
+   sms->msg_ref = msg_ref;
 
/* fill in the destination address */
sms->receiver = dest;
@@ -203,10 +217,6 @@
memcpy(sms->user_data, sms_msg, sms_msg_len);
sms->user_data_len = sms_msg_len;
}
-
-   t = find_tlv(submit->tlv, TLVID_user_message_reference);
-   if (t)
-   sms->msg_ref = ntohs(t->value.val16);
 
*psms = sms;
return ESME_ROK;

-- 
To view, visit https://gerrit.osmocom.org/3470
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: 

openbsc[master]: libmsc: update database to accomodate SMS status-report fields

2017-08-11 Thread Pablo Neira Ayuso

Patch Set 4:

When would it be good time to remove code for backward compatibility?

Holger added v3 by 2014-03-07, it's a bit more than 3 years now.

-- 
To view, visit https://gerrit.osmocom.org/3435
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I7276d356d805a83ebeec72b02c8563b7135ea0b6
Gerrit-PatchSet: 4
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Pablo Neira Ayuso 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Holger Freyther 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Keith Whyte 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pablo Neira Ayuso 
Gerrit-HasComments: No


[PATCH] libsmpp34[master]: add smpp34_tlv_for_each() helper

2017-08-11 Thread Pablo Neira Ayuso

Review at  https://gerrit.osmocom.org/3469

add smpp34_tlv_for_each() helper

So we don't need to remember this is an opencoded list of TLVs.

Change-Id: I446929feed049d0411e1629ca263e2bc41f714cc
---
M src/smpp34_structs.h
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libsmpp34 refs/changes/69/3469/1

diff --git a/src/smpp34_structs.h b/src/smpp34_structs.h
index b9effb2..025109d 100644
--- a/src/smpp34_structs.h
+++ b/src/smpp34_structs.h
@@ -86,6 +86,9 @@
 OCTET16( inst, octet, size); \
 } par;
 
+#define smpp34_tlv_for_each(pos, head) \
+   for (pos = (head); pos != NULL; pos = pos->next)
+
 #define DAD( inst, par, do_dest_address ) dad_t *par;
 #define UU2( inst, par, size ) union { \
 struct { \

-- 
To view, visit https://gerrit.osmocom.org/3469
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I446929feed049d0411e1629ca263e2bc41f714cc
Gerrit-PatchSet: 1
Gerrit-Project: libsmpp34
Gerrit-Branch: master
Gerrit-Owner: Pablo Neira Ayuso